I am trying to delete a counter in my ".sty" file. Right now I have a few ".tex" files that use the same ".sty". They use the same ".sty" file to use \newcommands
. However, when I go to make a new counter sometimes the counter may have the same name. When that is the case I get a compiler error since I'm trying to create something that is already defined. Is there a way I can delete the counter?
An example of what is happening in my code can be seen below:
\newcommand{\addMsg}[1] % This would be in the file.sty
{
\newcounter{#1}
}
\addMsg{nameOfCounter} % This would be in File1.tex
\addMsg{nameOfCounter} % This would be in File1.tex
Keep in mind many people may edit these files, thus in file1.tex
someone may put \addMsg{Counter1}
and in file2.tex
someone may also put \addMsg{Counter1}
. Thus I cannot just simply make sure all counters are named differently.