summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ximera/src/makeCounter.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/ximera/src/makeCounter.dtx')
-rw-r--r--macros/latex/contrib/ximera/src/makeCounter.dtx37
1 files changed, 37 insertions, 0 deletions
diff --git a/macros/latex/contrib/ximera/src/makeCounter.dtx b/macros/latex/contrib/ximera/src/makeCounter.dtx
new file mode 100644
index 0000000000..2e898255e7
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/makeCounter.dtx
@@ -0,0 +1,37 @@
+% \subsubsection{Utility macros}
+% These are a list of new utility macros that are generally useful and are loaded after packages and the Tikz Fix.
+% \begin{macrocode}
+%<*classXimera>
+% \end{macrocode}
+% \begin{macro}{NewCounter}
+% Improved version of |\newcounter| to check for existance before creating a counter to minimize conflicts with packages. Added by Jason Nowell
+% \begin{macrocode}
+\newcommand{\Make@Counter}[1]{% This is an internal macro that should probably be depreciated for the below universal macro.
+% Code located in "Utilitymacros.dtx"
+ \@ifundefined{c@#1}% Check to see if counter exists
+ { % If not, create it and set it to 0.
+ \newcounter{#1}
+ \setcounter{#1}{0}
+ }
+ {%If so, reset to 0.
+ \setcounter{#1}{0}
+ }
+}
+
+\newcommand{\MakeCounter}[1]{%% Code located in "Utilitymacros.dtx"
+% Code located in "Utilitymacros.dtx"
+ \@ifundefined{c@#1}% Check to see if counter exists
+ { % If not, create it and set it to 0.
+ \newcounter{#1}
+ \setcounter{#1}{0}
+ }
+ {%If so, reset to 0.
+ \setcounter{#1}{0}
+ }
+}
+% \end{macrocode}
+%</classXimera>
+% \end{macro}
+
+
+