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
66 \newenvironment{prototype}[2]{
69 \begin{minipage}[c]{14cm}
70 \par \texttt{\#include <#1>}
73 % \begin{lstlisting}{}
86 \newenvironment{errlist}{\begin{description}}{\end{description}}