3

I am having trouble correctly formatting cross-referenced equations.

When I reference an equation I would like the equation number to appear on the far right-hand side of the page, just as the regular equation numbers are formatted. Unfortunately, I am not sure how to achieve this.

Here is an example of what I have tried.

\section{Introduction}

\begin{equation} 

(x+y)^2 = x^2 + 2xy + y^2 \label{I.1}

\end{equation}

\section{Results}

\begin{equation*} 

(x+y)^2 = x^2 + 2xy + y^2 \eqref{I.1}

\end{equation*} 

This gives a reference number that comes directly after the equation. I know there are functions such as \quad and \qquad to manually space things, but these don't put it over far enough. Plus I feel like there is a much better way to achieve this that I am not aware of.

So how do I get my reference number to the far right side?

  • Use \tag as in \tag{I.1}, but why are you trying to number manually your questions? Let LaTeX do the job. – Gonzalo Medina Feb 3 '15 at 2:36
  • 2
    the usual default is for the equation numbers to be flush against the right margin, so something unusual is going on here. please extend your example to be compilable, beginning with the \documentclass and ending with \end{document}. also, there shouldn't be any blank lines between \begin{equation} ... \end{equation}`. – barbara beeton Feb 3 '15 at 2:38
4

Don't leave blank lines inside math mode (equation environment etc). You can use \tag{\ref{I.1}} to get the equation number.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
  \section{Introduction}

\begin{equation}
\label{I.1}
(x+y)^2 = x^2 + 2xy + y^2
\end{equation}

\section{Results}

\begin{equation}
(x+y)^2 = x^2 + 2xy + y^2 \tag{\ref{I.1}}
\end{equation}
\end{document}

Aside, it is not a good practice to use numbers in labels, use some thing you remember and meaningful.

  • Why equation* and not just equation for the second equation? Logically it males more sense to have a numbered environment for something that is going to receive a number. – Gonzalo Medina Feb 3 '15 at 2:39
  • @GonzaloMedina I don't know!. I assumed that the OP wants to reproduce the number of first equation in the second equation, may be he wants to reproduce it again. – user11232 Feb 3 '15 at 2:41
  • I understand that. What I mean is that it would be better (from a logical point of view, at least) to use equation (without star) for the second equation. – Gonzalo Medina Feb 3 '15 at 2:54
  • @GonzaloMedina Oh! Now I got it. Yes I agree. Will change. – user11232 Feb 3 '15 at 2:55
  • Maybe I've got this all wrong, I would like to list the same equation in two different parts of my paper. If I use \equation in both instances it will give the equation two different numbers when I would like to use the equation number LaTeX gave it in the first instance. This is why I thought I had to use \equation* and manually insert a reference for the second instance. Am I wrong? – FofX Feb 3 '15 at 2:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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