# Workaround that allows the use of digits as part of counter names?

I tried to define indexed counters, such as x1, x2, . . . etc, by defining them like this : \newcount\x1, \newcount\x2, . . . etc, but it didn't work. Is there a workaround for this in TeX or LaTeX ? I have written a small tex-file that illustrates what happens when you try it. Note added : With the remark made by @cfr, that in LaTex one may use the command \newcounter{name} the question has a good answer that cannot easily be found by using the search engine. (I have some good reference books for TeX, but not for LaTeX.)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%  Example tex-file that illustrates what happens  %%
%%  when you use a number in the name of a counter  %%
%%                                                  %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass{article}
\usepackage[paperwidth=0.75in, paperheight=1.5in]{geometry}
\pagestyle{empty}

\begin{document}

\newcount\a  \newcount\b \newcount\c7

\a=1   \b=41 \c7=78

\noindent
a = \number\a
\par \vskip 5pt \noindent
b = \number\b
\par \vskip 5pt \noindent
c7 = \number\c7

\end{document}
• Since you are using LaTeX, wouldn't it be better to use e.g. \newcounter rather than \newcount? – cfr Nov 9 '14 at 21:08
• @cfr then you could use digits:-) \newcounter{a1} is OK:-) – David Carlisle Nov 9 '14 at 21:09
• I didn't know there was a variant. But that would indeed be the workaround. Thanks ! With the new answer it isn't a duplicate after all, then ? – user35145 Nov 9 '14 at 21:15
• @user35145 It should be reworded to specifically mention counters, at least – Sean Allred Nov 9 '14 at 21:43
• I extended my answer with specifics about counters as the question is reopened. – David Carlisle Nov 10 '14 at 12:30