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 have a centred equation and I'd like to place a (1) on the same line as the equation, but aligned to the right, so that I can refer back to the equation in future. What I have at the moment is:

\center  $ \begin{pmatrix} e & \frac{f}{2} \\ \frac{f}{5} & g \end{pmatrix} = L^T %
  \begin{pmatrix} a & b \\ c & d \end{pmatrix} L $ \flushright' (1)
share|improve this question
I recommend reading chapter 3 of The Not So Short Introduction to LaTeX. – Ian Thompson Jan 6 '12 at 17:23
up vote 3 down vote accepted

\begin{align} \label{foo}
\begin{pmatrix} e & \frac{f}{2} \\ \frac{f}{5} & g \end{pmatrix} 
  &= L^T   \begin{pmatrix} a & b \\ c & d \end{pmatrix} L 

See Eqn~\ref{foo}
share|improve this answer
Why align instead of equation? – egreg Jan 6 '12 at 21:20
why not? and it is not a good idea when you change my code in a way that it did not work! – Herbert Jan 6 '12 at 21:30
align gives different spacing than equation and the latter is surely preferable for single line equations. Of course the & before the = serves no purpose in a single line equation. I believe that simplicity is better. – egreg Jan 6 '12 at 21:36
sure, if I want the spacing of equation then I'd used it ... – Herbert Jan 6 '12 at 21:39

What is wrong with

\begin{pmatrix} e & \frac{f}{2} 
 \frac{f}{5} & g 
= L^T 
 a & b 
 c & d 

then use \eqref{eq:1} (assuming amsmath)

share|improve this answer

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.