Extension of the rcollyer counter usage offer:
%counter of current constant number:
\newcounter{constant}
%defines a new constant, but does not typeset anything:
\newcommand{\newconstant}[1]{\refstepcounter{constant}\label{
%typesets named constant:
\newcommand{\useconstant}[1]{C_{\ref{
(This code has been edited so that labels are longer than one character)
And here is a piece of code that seems to work:
I want to define two constants:\newconstant{A}\newconstant{B}$\useconstant{A}$ and
$\useconstant{B}$. Then I want to use $\useconstant{A}$ again.
Aniko source
share