I am trying to put all the equations of my presentation made with Beamer into a single table to summarize them. They are however in various frames within \align environments. How can I achieve this?
Asked
Active
Viewed 411 times
8
-
Welcome to TeX.SX. Note that you don't have to sign with your name since it automatically appears in the lower right corner of your post. Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. – Claudio Fiandrino Nov 28 '12 at 15:33
2 Answers
6
You can use the collect* environment from the collect package; a simple example:
\documentclass{beamer}
\usepackage{collect}
\definecollection{equations}
\begin{document}
\begin{frame}
\frametitle{A frame with an equation}
\begin{collect*}{equations}{}{}{}{}
\begin{align*}
a &= b \\
&=c.
\end{align*}
\end{collect*}
\end{frame}
\begin{frame}
\frametitle{Another frame with an equation}
\begin{collect*}{equations}{}{}{}{}
\begin{align*}
x &= y \\
&=z.
\end{align*}
\end{collect*}
\end{frame}
\begin{frame}
\frametitle{List of Equations}
\includecollection{equations}
\end{frame}
\end{document}

Moriambar
- 11,466
Gonzalo Medina
- 505,128
-
1Will this work for numbered equations in an align environment as well? – user17947 Nov 28 '12 at 15:57
-
1@user17947 some work will have to be done for the correct display of the counters. – Gonzalo Medina Nov 28 '12 at 16:03
-
-
@user17947 so you want to suppress the numbering in the final list? – Gonzalo Medina Nov 28 '12 at 17:01
-
no. I would like to retain it. There is a problem with allowframebreaks option when I include the collection as a list of equations in the end inside the last frame. The equations are not visible. – user17947 Nov 28 '12 at 18:26
0
Here's a solution that borrows from Write content of box to a file
I've used the etoolbox to wrap the align and equation environment with
% surround the align environment with
% \begin{lrbox}{\mybox}
% \begin{minipage}{\linewidth}
%
% CONTENT
%
% \end{minipage}
% \end{lrbox}
which saves the content to the box \mybox; the content is of course outputted to the screen, but it is also saved for use later on in the box \savedeqns

\documentclass{beamer}
\usepackage{amsmath}
\usepackage{etoolbox}
% to store the contents of a SINGLE equation
\newsavebox{\mybox}
% to store the contents of ALL of the equations
\newbox\savedqns
\setbox\savedqns\vbox{}
% surround the align environment with
% \begin{lrbox}{\mybox}
% \begin{minipage}{\linewidth}
%
% CONTENT
%
% \end{minipage}
% \end{lrbox}
\BeforeBeginEnvironment{align}{\begin{lrbox}{\mybox}\noindent\begin{minipage}{\linewidth}}
\AfterEndEnvironment{align}{%
\end{minipage}%
\end{lrbox}%
\vspace{\abovedisplayskip}%
\noindent\usebox{\mybox}%
% save the equations for later
\global\setbox\savedqns\vbox{%
\unvbox\savedqns
\bigskip
\filbreak
\noindent\usebox{\mybox}}%
}
% do the same for the equation environment
\BeforeBeginEnvironment{equation}{\begin{lrbox}{\mybox}\noindent\begin{minipage}{\linewidth}}
\AfterEndEnvironment{equation}{%
\end{minipage}%
\end{lrbox}%
\vspace{\abovedisplayskip}%
\noindent\usebox{\mybox}%
% save the equations for later
\global\setbox\savedqns\vbox{%
\unvbox\savedqns
\bigskip
\filbreak
\noindent\usebox{\mybox}}%
}
\begin{document}
\begin{frame}{An align environment...}
\begin{align}
y&=x^2+2\\
&=2+x^2
\end{align}
\end{frame}
\begin{frame}{An equation environment...}
\begin{equation}
y=mx+b
\end{equation}
\end{frame}
\begin{frame}{My very important equations- SUMMARY}
\unvbox\savedqns
\end{frame}
\end{document}
David Carlisle
- 757,742
cmhughes
- 100,947