summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ximera/src/utilitymacros.dtx
blob: e44b490e06442ddc6cf6c9109fce131d304c8377 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
% \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}

% \begin{macro}{latexProblemContent}
%    Added for those that want to use UF problems without using the problem filter code. This command is renewed into something meaningful in the 'ProblemSelector.sty'.
%    \begin{macrocode}
\providecommand{\latexProblemContent}[1]{#1}
% Iterate count for problem counts.
\Make@Counter{Iteration@probCnt}        
%    \end{macrocode}
% \end{macro}