Debian Codegraph @

texmf-dist/doc/latex/ximera/src/makeCounter.dtx

raw
1 % \subsubsection{Utility macros}
2 % These are a list of new utility macros that are generally useful and are loaded after packages and the Tikz Fix.
3 % \begin{macrocode}
4 %<*classXimera>
5 % \end{macrocode}
6 % \begin{macro}{NewCounter}
7 % Improved version of |\newcounter| to check for existance before creating a counter to minimize conflicts with packages. Added by Jason Nowell
8 % \begin{macrocode}
9 \newcommand{\Make@Counter}[1]{% This is an internal macro that should probably be depreciated for the below universal macro.
10 % Code located in "Utilitymacros.dtx"
11 \@ifundefined{c@#1}% Check to see if counter exists
12 { % If not, create it and set it to 0.
13 \newcounter{#1}
14 \setcounter{#1}{0}
15 }
16 {%If so, reset to 0.
17 \setcounter{#1}{0}
18 }
19 }
20
21 \newcommand{\MakeCounter}[1]{%% Code located in "Utilitymacros.dtx"
22 % Code located in "Utilitymacros.dtx"
23 \@ifundefined{c@#1}% Check to see if counter exists
24 { % If not, create it and set it to 0.
25 \newcounter{#1}
26 \setcounter{#1}{0}
27 }
28 {%If so, reset to 0.
29 \setcounter{#1}{0}
30 }
31 }
32 % \end{macrocode}
33 %</classXimera>
34 % \end{macro}
35
36
37