Scritta una nuova macro per i prototipi delle funzioni. Adesso ci sara` da
[gapil.git] / macro.tex
1 %
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
5 %
6 %
7 \newcounter{usercount}       % define a new counter for internal use
8 %
9 % Figure commands
10 %
11 \newcommand{\curfig}{fig.~\thefigure}
12 \newcommand{\nfig}{%
13 \setcounter{usercount}{\value{figure}}%
14 \addtocounter{usercount}{1}%
15 fig.~\thechapter.\theusercount}
16 \newcommand{\pfig}{%
17 \setcounter{usercount}{\value{figure}}%
18 \addtocounter{usercount}{-1}%
19 fig.~\thechapter.\theusercount}
20 \newcommand{\figref}[1]{fig.~\ref{#1}}
21 %
22 % Tables commands
23 %
24 \newcommand{\curtab}{tab.~\thetable}
25 \newcommand{\ntab}{%
26 \setcounter{usercount}{\value{table}}%
27 \addtocounter{usercount}{1}%
28 tab.~\thechapter.\theusercount}
29 \newcommand{\ptab}{%
30 \setcounter{usercount}{\value{table}}%
31 \addtocounter{usercount}{-1}%
32 tab.~\thechapter.\theusercount}
33 \newcommand{\tabref}[1]{tab.~\ref{#1}}
34 %
35 % equations commands
36 %
37 \newcommand{\cureq}{(\theequation)}
38 \newcommand{\nxeq}{%
39 \setcounter{usercount}{\value{equation}}%
40 \addtocounter{usercount}{1}%
41 (\thechapter.\theusercount)}
42 \newcommand{\preeq}{%
43 \setcounter{usercount}{\value{equation}}%
44 \addtocounter{usercount}{-1}%
45 (\thechapter.\theusercount)}
46 %
47 % Macro to put picture (in format PICT) inside a figure
48 %
49 \newcommand{\pictfig}[3]{
50         \begin{minipage}[t][#1][b]{#2}
51         \mbox{\special{pict=#3}}
52 %    \vspace{3cm}
53     \end{minipage}
54 }
55 %
56 % Command for section and chapters
57 %
58 \newcommand{\capref}[1]{cap.~\ref{#1}}
59 \newcommand{\sezref}[1]{sez.~\ref{#1}}
60
61 %
62 % Macro to create a special environment for function prototypes
63 %
64 \newenvironment{prototype}[1]{\begin{itemize} 
65   \item \texttt{#1}}{\end{itemize}}
66 \newenvironment{errlist}{\begin{itemize}}{\end{itemize}}
67
68