Math & ScienceSame label for two different placed equation?

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
Yue
Posts: 30
Joined: Sat May 08, 2010 9:58 pm

Same label for two different placed equation?

Post by Yue »

I have written the same equation twice, one in the text, other in the appendix. Can I label them both so that they show the same equation number?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Same label for two different placed equation?

Post by localghost »

Code: Select all

\documentclass[english]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{amsmath}

\begin{document}
  \section{First Section}
    An equation in the document seen as
    \begin{equation}\label{eqn:einstein}
      E=mc^2
    \end{equation}
    Followed by some equations just for demonstration
    \begin{subequations}\label{eqn:binomi}
      \begin{align}
        (a+b)^2 &= a^2+2ab+b^2 \label{subeqn-1:binomi} \\
        (a+b)^2 &= a^2-2ab+b^2 \label{subeqn-2:binomi} \\
        (a+b)(a-b) &= a^2-b^2 \label{subeqn-3:binomi}
      \end{align}
    \end{subequations}

  \appendix
  \section{First Appendix Section}
    And now the same equation again
    \begin{equation}
      E=mc^2 \tag{\ref{eqn:einstein}}
    \end{equation}
    tagged with the same number.
\end{document}

Best regards
Thorsten
Yue
Posts: 30
Joined: Sat May 08, 2010 9:58 pm

Re: Same label for two different placed equation?

Post by Yue »

Thx, but my document gives errors, so here is another question:
Can I use \include{appendix} in my main document and make a new page called appendix.tex and start that page with \appendix?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Same label for two different placed equation?

Post by localghost »

Yue wrote:[...] but my document gives errors [...]
Be precise and show concrete error messages from the log.
Yue wrote:[...] Can I use \include{appendix} in my main document and make a new page called appendix.tex and start that page with \appendix?
Of course. You only need one more compiler. In the first run the file »appendix.aux« is created. In the second run the compiler will retrieve all necessary information from that file to get the references right.
Yue
Posts: 30
Joined: Sat May 08, 2010 9:58 pm

Re: Same label for two different placed equation?

Post by Yue »

I mean, is this the correct way to make an appendix? I got all my chapters using \include{chaptername}. Can I do the same with appendix?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Same label for two different placed equation?

Post by localghost »

Why don't you just test it? All you can get is an error message. Your machine won't be blown up.
Yue
Posts: 30
Joined: Sat May 08, 2010 9:58 pm

Re: Same label for two different placed equation?

Post by Yue »

It says 65 errors, so I am trying to figure it out
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Same label for two different placed equation?

Post by localghost »

I could build a working example, but I think it's your turn to show the opposite [1]. Otherwise we won't get closer to a solution.

[1] Creating a LaTeX Minimal Example
Yue
Posts: 30
Joined: Sat May 08, 2010 9:58 pm

Re: Same label for two different placed equation?

Post by Yue »

I think I figured it out,
\appendix
\include{butter}
\include{bibliographi}
etc.
Thx for your patience, it appears the Appendix only changes nummeration of the chapters and sections
Post Reply