3

Sometimes I think it is helpful to have a visual reference to a cited equation, besides its reference number. Let me give a (manual) example of what I'm talking about:

\begin{document}
(...)

\begin{equation}\label{1.1}
  y=x
\end{equation}

<several pages later>

... in equation \eqref{1.1}\footnote{y=x} ...
\end{document}

I'd like to create a command that makes this process automatically. Something like

\newcommand{\foo}[1]{\eqref{#1}\footnote{eqcont}}

where the 'eqcont' part is a call to the contents of the equation environment. However, I can't figure out a code to do this.

Any suggestions?

Ruben
  • 13,448
JGSeg
  • 33
  • 3
  • 1
    Welcome to TeX.sx! This question and its answers might be helpful: http://tex.stackexchange.com/questions/87095 – cgnieder Dec 22 '13 at 21:01

1 Answers1

3

Although @cgnieder s comment could be very helpful, I think the focus of the question is slightly different and needs further treatment.

The environ package is very helpful here. It allows you to redefine \eqref exactly as you intended it to be, where 'eqcont' had to be changed a little:

\documentclass{article}
\usepackage{lipsum}
\usepackage{amsmath}
\usepackage{environ}
\NewEnviron{refeq}[1]{%
  \label{#1}
  \begin{equation} \BODY \end{equation}
  \expandafter\xdef\csname eq#1\endcsname{\BODY}
  }
\let\AMSeqref\eqref
\renewcommand{\eqref}[1]{\aftergroup\AMSeqref{#1}\footnote{\csname eq#1\endcsname}}

\begin{document}
\lipsum[8]
\begin{refeq}{1.1}
  y=x
\end{refeq}
\lipsum
... in equation \eqref{1.1} ...
\end{document}

enter image description here

enter image description here

Ruben
  • 13,448