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}
13 \setcounter{usercount}{\value{figure}}%
14 \addtocounter{usercount}{1}%
15 fig.~\thechapter.\theusercount}
17 \setcounter{usercount}{\value{figure}}%
18 \addtocounter{usercount}{-1}%
19 fig.~\thechapter.\theusercount}
20 \newcommand{\figref}[1]{fig.~\ref{#1}}
24 \newcommand{\curtab}{tab.~\thetable}
26 \setcounter{usercount}{\value{table}}%
27 \addtocounter{usercount}{1}%
28 tab.~\thechapter.\theusercount}
30 \setcounter{usercount}{\value{table}}%
31 \addtocounter{usercount}{-1}%
32 tab.~\thechapter.\theusercount}
33 \newcommand{\tabref}[1]{tab.~\ref{#1}}
37 \newcommand{\cureq}{(\theequation)}
39 \setcounter{usercount}{\value{equation}}%
40 \addtocounter{usercount}{1}%
41 (\thechapter.\theusercount)}
43 \setcounter{usercount}{\value{equation}}%
44 \addtocounter{usercount}{-1}%
45 (\thechapter.\theusercount)}
47 % Macro to put picture (in format PICT) inside a figure
49 \newcommand{\pictfig}[3]{
50 \begin{minipage}[t][#1][b]{#2}
51 \mbox{\special{pict=#3}}
56 % Command for section and chapters
58 \newcommand{\capref}[1]{cap.~\ref{#1}}
59 \newcommand{\sezref}[1]{sez.~\ref{#1}}
62 % Macro to create a special environment for function prototypes
64 \newenvironment{prototype}[1]{\begin{itemize}
65 \item \texttt{#1}}{\end{itemize}}
66 \newenvironment{errlist}{\begin{itemize}}{\end{itemize}}