2 % Defining some commands to manipulate counter to avoid ude of
3 % \label and \ref commands (and related problem to remeber the
4 % used labels) to refer nearest objects
7 \newcounter{usercount} % define a new counter for internal use
11 \newcommand{\curfig}{fig.~\thefigure}
14 \setcounter{usercount}{\value{figure}}%
15 \addtocounter{usercount}{1}%
16 fig.~\thechapter.\theusercount}
19 \setcounter{usercount}{\value{figure}}%
20 \addtocounter{usercount}{-1}%
21 fig.~\thechapter.\theusercount}
23 \newcommand{\figref}[1]{fig.~\ref{#1}}
27 \newcommand{\curtab}{tab.~\thetable}
29 \setcounter{usercount}{\value{table}}%
30 \addtocounter{usercount}{1}%
31 tab.~\thechapter.\theusercount}
33 \setcounter{usercount}{\value{table}}%
34 \addtocounter{usercount}{-1}%
35 tab.~\thechapter.\theusercount}
36 \newcommand{\tabref}[1]{tab.~\ref{#1}}
40 \newcommand{\cureq}{(\theequation)}
42 \setcounter{usercount}{\value{equation}}%
43 \addtocounter{usercount}{1}%
44 (\thechapter.\theusercount)}
46 \setcounter{usercount}{\value{equation}}%
47 \addtocounter{usercount}{-1}%
48 (\thechapter.\theusercount)}
50 % Macro to put picture (in format PICT) inside a figure
52 \newcommand{\pictfig}[3]{
53 \begin{minipage}[t][#1][b]{#2}
54 \mbox{\special{pict=#3}}
59 % Command for section and chapters
61 \newcommand{\capref}[1]{cap.~\ref{#1}}
62 \newcommand{\secref}[1]{sez.~\ref{#1}}
64 % Macro to create a special environment for function prototypes
67 \newenvironment{prototype}[2]
68 {% defining what is done by \begin
70 \begin{boxedminipage}[c]{14cm}
72 \begin{description*}{}{}
73 \item \texttt{\#include <#1>}
74 \item \texttt{#2} \par
75 % \begin{lstlisting}{}
80 {% defining what is done by \end
89 \newenvironment{errlist}{\begin{basedescript}{\desclabelwidth{1.5cm}}}
93 % Slighty different envirnoment to be used for multi-header,
94 % multi-functions boxed description
96 \newcommand{\headdecl}[1]{\item\texttt{\#include <#1>}}
97 \newcommand{\funcdecl}[1]{\item\texttt{#1}\par}
98 \newcommand{\bodydesc}[1]{\par \end{description*} #1
99 \begin{description*}{}{} \baselineskip=0pt
102 \newenvironment{functions}
103 {% defining what is done by \begin
105 \begin{boxedminipage}[c]{14cm}
107 \begin{description*}{}{}
109 {% defining what is done by \end
118 % Wrapper for shell command, functions, filenames, links,
119 % variables, macros, and everything can be useul,
121 \newcommand{\cmd}[1]{\texttt{#1}} % shell command
122 \newcommand{\code}[1]{\texttt{#1}} % for simple code
123 \newcommand{\func}[1]{%
124 \index{\texttt{#1}}\texttt{#1}%
125 } % library function (or system call)
126 \newcommand{\macro}[1]{\texttt{#1}} % macro constant
127 \newcommand{\var}[1]{\texttt{#1}} % variable
128 \newcommand{\file}[1]{\texttt{#1}} % file name
129 \newcommand{\link}[1]{\texttt{#1}} % html link
130 \newcommand{\type}[1]{\texttt{#1}} % variable type
131 \newcommand{\param}[1]{\texttt{#1}} % function parameter
132 \newcommand{\acr}[1]{\textsl{#1}} % acrostic (for pid, suid, etc.)
135 % per usare latex2html scommentare questi e non includere mdwlist
136 %\newenvironment{description*}{\begin{description}}{\end{description}}
137 %\newenvironment{itemize*}{\begin{itemize}}{\end{itemize}}
138 %\newenvironment{enumerate*}{\begin{enumerate}}{\end{enumerate}}