TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to number use a equation and add a letter to the equation number such as:

f(x) =a x and g(x) = b x                     (3.1.1a,b)

That is e.g. using \begin{equation} ... \label{eq} \end{equation}

share|improve this question

migrated from stackoverflow.com Dec 18 '11 at 20:38

This question came from our site for professional and enthusiast programmers.

up vote 35 down vote accepted

The amsmath package provides \tag{<whatever>} that allows you to tag (or number) an equation with <whatever> you want. Here's a minimal working example:

enter image description here

\usepackage{amsmath}% http://ctan.org/pkg/amsmath
  f(x)=ax \qquad \text{and} \qquad g(x)=bx \tag{3.1.1a,b}\label{myeq}
For example, see \eqref{myeq}.

If you don't want the parentheses around the \tag, use \tag* instead. With this, however, you can only reference the entire equation, not the separate components.

For the ability to reference either the main equation or the sub-equations as a whole, you could use the following setup:

enter image description here

\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\setcounter{section}{2}% Just for illustrative purposes
\section{A section} \subsection{A subsection}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.%
\refstepcounter{equation}\label{myeqn1}% Correctly mark and label equation
  f(x)=ax \qquad \text{and} \qquad g(x)=bx \tag{\theequation a,b}\label{myeqn2}
For example, see~\eqref{myeqn1} and~\eqref{myeqn2}.

The idea is to correctly step and reference (using \refstepcounter) the equation before it is typeset, and use the equation number in \tag (via \theequation) for appropriate labelling and referencing.

share|improve this answer
Just curious: what's the best way to put in the "3.1.1" part automatically? – rdhs Dec 18 '11 at 20:46
In the equation, one could use \stepcounter{equation}\tag{{\theequation}a,b}. This assumes that your equations are numbered according to (say) \thesection.\arabic{equation} and sections according to (say) \thechapter.\arabic{section}. – Werner Dec 18 '11 at 21:10
@rdhs -- if you're using amsmath, you can say \numberwithin{equation}{section}. – barbara beeton Dec 19 '11 at 15:08


a=b\qquad c=d



This doesn't work for alignment environments such as align and gather, though.

The argument to \specialnumber is added after the normal equation number. For references, you have to add it manually, so the \specialeqref command comes handy.

share|improve this answer
It doesn't work if you're using \documentclass[fleqn]{article} as well. – Henry Dec 28 '11 at 20:04

There is an easy way to do this automatically if you put the equations on seperate lines. The amsmath package provides an environment subequations which can easily be used in conjunction with the align environment for equations. For example:

  f(x)&=ax + b \\
  g(x)&=cx^2 + dx + e
For example, see \eqref{equations}.
Or see equations \eqref{eq:f} and \eqref{eq:g}.
share|improve this answer
Wow, I'd never heard of subequations, it's just brilliant. You can even use it to use the same numeration for equations with paragraphs between them. Hot stuff! – Alfredo Hernández Jan 5 at 21:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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