This code uses the .aux file to store the relevant information. \rememberequation both typesets and saves the equation. On the second run, the data is automatically read in at the beginning of the document, building (a long) macro \listofequations, which is then used by \tableofequations to typeset the table (anywhere in the document).
\documentclass{article}
\usepackage{etoolbox}
\makeatletter
\newcommand\rememberequation[2]{%
\begin{equation}#1\end{equation}%
\protected@write\@mainaux{}
{\detokenize{\gappto\listofequations}{%
(\theequation)&
\detokenize{$#1$}&
\detokenize{#2}&
\thepage\\
}%
}%
}
\makeatother
\newcommand\tableofequations{%
\preto\listofequations{%
\begin{tabular}{cccc}
\#&Equation&Name&Page\\\hline
}%
\appto\listofequations{%
\hline
\end{tabular}
}%
\begin{center}
\listofequations
\end{center}
}
\begin{document}
\tableofequations
\rememberequation{e^{i\pi}=-1}{Euler's Equation}
\rememberequation{e^{i\pi}=-1}{Euler's Equation, again}
\newpage
\rememberequation{e^{i\pi}=-1}{Euler's Equation, yet again}
\end{document}
EDIT: the fancy version requested in the comment
So, the idea is that we write equations in the usual equation environment and trigger the "remembering" code by \caption. (I believe \caption is a better choice than \label.)
Before the code, a disclaimer. This is a hack. I have no idea what trouble it might cause in conjunction with some package ...
\documentclass{article}
\usepackage{etoolbox}
\usepackage{environ}
\makeatletter
\AtBeginEnvironment{equation}{%
\Collect@Body\rememberequation
}
\newtoks\currentequation
\def\rememberequation#1{%
\typeout{DEBUG: \detokenize{#1}}%
% #1 starts with \csname equation\endcsname
\expandafter\currentequation\expandafter{#1}%
\let\caption\storecurrentequation
#1%
}
\def\storecurrentequation#1{%
\protected@write\@mainaux{}%
{\detokenize{\gappto\listofequations}{%
(\theequation)&
$\expandafter\detokenize\expandafter{\the\currentequation}$&
\detokenize{#1}&% #1 = caption
\thepage\\
}%
}%
}
\newcommand\tableofequations{%
\preto\listofequations{%
\begin{tabular}{cccc}
\#&Equation&Name&Page\\\hline
}%
\appto\listofequations{%
\hline
\end{tabular}
}%
\begin{center}
\let\equation\relax
\let\label\@gobble
\let\caption\@gobble
\listofequations
\end{center}
}
\makeatother
\begin{document}
\tableofequations
\def\caption#1{}
\begin{equation}
\label{eq:1}
e^{i\pi}=-1
\caption{Euler's Equation}
\end{equation}
\begin{equation}
\label{eq:2}
e^{i\pi}=-1
\caption{Euler's Equation, again}
\end{equation}
\newpage
\begin{equation}
\label{eq:3}
e^{i\pi}=-1
\caption{Euler's Equation, yet again}
\end{equation}
\end{document}
\addcontentslineto create a table or something similar with the maths in. Maybe an answer based on the source code for\addcontentslinewould be helpful, but I can't find that either! – Nathanael Farley Feb 5 at 16:41