4

Is there a way to label an equation with letters instead of numbers? For instance,

\begin{equation}
\label{Problem}
\phi'(t)=f(t, \phi(t)).
\end{equation}
  • Yes. Could you elaborate on the use-case? Do you want all equations labelled with letters or just some? What should the letter format be... (A), (B), ... or (a), (b), ... or something different altogether? – Werner Mar 2 '15 at 23:09
  • And welcome to TeX.SX! – egreg Mar 2 '15 at 23:29
  • Please post complete code i.e. a small, compilable document. That is much more useful than a fragment. – cfr Mar 3 '15 at 0:59
  • 1
    @Nicolas How is this a duplicate? That question explicitly says neither a number nor a letter, which is not the case here. (The solution might be similar but that's a different issue.) – cfr Mar 3 '15 at 1:01
  • Do you want all equations labelled with letters or just some? Just some. – José David Campos F Mar 3 '15 at 3:03
3

With the alphalph package, after 26 equations, they become AA, AB, AC, etc. If one uses \alphalph, the letters are in lowercase.

\documentclass{article}
\usepackage{alphalph}
\def\theequation{\AlphAlph{\value{equation}}}
\begin{document}
\begin{equation}
y=x
\end{equation}
\begin{equation}
y=x^2
\end{equation}
\begin{equation}
y=x^3
\end{equation}
\end{document}

enter image description here

1

You can simply redefine the counter to display with letters with:

\renewcommand{\theequation}{\alph{equation}}

If you want Uppercase letters use:

\renewcommand{\theequation}{\Alph{equation}}

You can even use combined Letters and numbers. Incorporating the section number as a number, and the equation as a letter:

\renewcommand{\theequation}{\arabic{section}.\Alph{equation}}

Full example...

\documentclass{article}
\usepackage{amssymb}

\renewcommand{\theequation}{\alph{equation}}

\begin{document}

\section{Lower Case Letter}   
\begin{equation}
y=x
\end{equation}
\begin{equation}
y=x^2
\end{equation}
\begin{equation}
y=x^3
\end{equation}

\section{Upper Case Letter}
\renewcommand{\theequation}{\Alph{equation}}
\begin{equation}
y=x
\end{equation}
\begin{equation}
y=x^2
\end{equation}
\begin{equation}
y=x^3
\end{equation}

\section{Section number and Upper Case Letter}
\renewcommand{\theequation}{\arabic{section}.\Alph{equation}}
\begin{equation}
y=x
\end{equation}
\begin{equation}
y=x^2
\end{equation}
\begin{equation}
y=x^3
\end{equation}

\end{document}

Example

  • Of course this fails of you have more than 26 equations. You can do set the counter to 0 explicitly at the beginning of each section with \setcounter{equation}{0}. Then with the section number and letter option I mentioned above you can have 26 equations per section. The same follows logically for all levels of sectioning -- chapter, subsection etc. – tmgriffiths Mar 3 '15 at 6:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.