GeneralHow to recall an equation without rewriting it

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
bagvian
Posts: 1
Joined: Fri Jul 27, 2012 10:34 am

How to recall an equation without rewriting it

Post by bagvian »

Hello there,
When writing a very long document full of formulae, one often needs to recall them a few times at different pages. An easy way to do this is, of course, to use cross referencing, i.e. \label{} and \ref{}.
Sometimes, cross referencing is not enough since one would like to see the equation again next to the one currently discussed, without having to use hyperlinks or going through the pages of a printed document.

Is there a way to recall an equation without rewriting it?
(I mean to automatically reprint the equation when needed by using a simple reference without having to rewrite it in the source text.)

In other words, is there something like a "\recallequation{}" command that could automatically regenerate the equation?
(The reference of this new equation should remain the same than the original one.)
(Hyperlinking to the new equation should come as an option.)

For instance, today one has to rewrite the same equation again to recall and reprint it:

- Page 1 -
[...]

... energy is given by the equation \ref{eq:energy} hereafter...
\begin{equation}
e = mc^2
\label{eq:energy}
\end{equation}


[...]


- Page 1000 -
[...]

... one recalls from equation \ref{eq:energy} that energy can be obtained by the equation \ref{eq:energybis} hereafter ...

\begin{equation}
e = mc^2
\label{eq:energybis}
\end{equation}


[...]

One would instead like to write the source of Page 1000 as follows:

- Page 1000 -
[...]

... one recalls from equation \ref{eq:energy} that energy can be obtained by the equation \ref{eq:energybis} hereafter ...

\recallequation[eq:energybis]{eq:energy}

[...]

Any idea?
Cheers, JS

Recommended reading 2024:

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

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

Stefan Kottwitz
Site Admin
Posts: 10347
Joined: Mon Mar 10, 2008 9:44 pm

How to recall an equation without rewriting it

Post by Stefan Kottwitz »

Hi JS,

welcome to the board!

Such recalling an equation is unusual for serious texts, I think. I guess you won't find it in a good book. For example, look at the numbering: if you recall equations from time to time, which use their original number as a tag, the order of the numbering is destroyed, numbers appear mixed, making it hard to follow the real references.

If it's unnumbered or if it may get a new number, you could simply make a macro for the equation. If it should be copied exactly as it was typeset the first time, you could save the equation in a box. Since repeating things is not very unusual, the thm-restate package supports it, is described in 1.4 Repeating theorems in the thmtools documentation, where it belongs to.

As I said, I would prefer not to do it. I would prefer to have consistent numbers and references instead of losing that just because I thought repeating and repeating would make it more convenient for the reader. Hyperlinks are already useful. Another possibility would be providing popup-windows which are shown when the reader goes with the pointer over a reference.

Stefan
LaTeX.org admin
Post Reply