Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have an equation:

\begin{equation}\label{eq:equation}
f(x)=x
\end{equation}

I would like to refer to this equation and show the whole formula again, and not only its number. In other words, I wanna get $f(x)=x$ instead of \eqref{eq:equation}.

How do I refer to the equation in order to reproduce its formula instead of its number?

share|improve this question
    
Welcome to TeX.sx! –  henrique Oct 8 '12 at 14:43
    
A tip: indent with 4 spaces the code block to format it properly or use the button with the braces ({}) above the edit window. In the case of inline code, either put the code between backticks (`) or select and press Ctrl+K. –  Count Zero Oct 8 '12 at 14:45
1  
The answer to the question at tex.stackexchange.com/questions/47570/… suggests a way to write a command that "remembers" text in one place to use in another. It might work for you if you don't need to do it often. For a systematic solution, you will have to wait for one of the regulars here to chip in. –  Ethan Bolker Oct 8 '12 at 15:15
add comment

2 Answers 2

up vote 6 down vote accepted

I just found this question that was asked earlier: Is it possible to re-insert a LaTeX equation by label?

It cites "Equation Reuse" from LaTeX-Community Forum as a solution.

Namely:

\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}

\begin{document}

%defining the box
\newsavebox\myeq
%filling the box
\savebox\myeq{\vbox{\begin{align*}
  a &= b\\
  &= c\\
  &= d\\
  &= e\\
  &= f
\end{align*}}}

%using the box
\usebox\myeq

%using the box
\usebox\myeq

%using the box
\usebox\myeq

\end{document}

Hope this helps!

share|improve this answer
    
It works pretty well. I would like to turn off the numbering when I use equation or align instead of align*. For instance, the first time the equation apear, I want to number it. The next time it apears, I want turn off the number. Anyone have an idea? –  Diogo Oct 8 '12 at 22:31
    
You could have the first instance be in the equation environment and define a separate box with the equation in displaymath. It's not a great solution, unfortunately. –  kanatzidis Oct 8 '12 at 23:33
add comment

This might be a solution, but I don't see how it would help the reader.

\documentclass{article}
\usepackage{amsmath}
\makeatletter
\newcommand{\repeatable}[2]{%
  \label{#1}\global\@namedef{repeatable@#1}{#2}#2
}
\newcommand{\eqrepeat}[1]{%
  \@ifundefined{repeatable@#1}{NOT FOUND}{$\@nameuse{repeatable@#1}$}%
  ~\eqref{#1}}
\makeatother

\begin{document}

\begin{equation}
\repeatable{eq:good}{f(x)=x}
\end{equation}

This is seen in \eqrepeat{eq:good}.

\end{document}

However it seems from your comments that you want something more complicated; please be more specific in your question.

enter image description here

share|improve this answer
    
Actually, I just want to repeat the function of equation. Your answer worked well. Do you know how to hide the number not in the main equation, but when I am referring to that in the text? Thanks. –  Diogo Nov 27 '13 at 5:09
    
@Diogo Use equation*. But I don't find particular merits in the practice of repeating the whole equation; to be honest I consider it heavy. –  egreg Nov 27 '13 at 7:25
add comment

Your Answer

 
discard

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.