I want to create a tikz picture that makes usage of beamer commands such as \only<2>
, thereby creating multiple pages and adding lines etc. only in the second page.
I then later on want to include these pages in a presentation.
Currently, I'm doing that by using \documentclass{beamer}
, and putting the tikzpicture
inside a frame
. However, this forces me to finish the presentation in this document: I need to specify frame title, and also footer, and presentation styles.
I would much rather just create the plain pictures here, include them in the other presentation using \begin{frame}{Foo} \includegraphics{...}\end{frame}
. However, when I do that inside beamer
, there is unnecessary white space around the tikzpictures. When I don't do it inside beamer
, I cannot use the \only
. What should I do?
%\documentclass[tikz]{standalone}
\documentclass{beamer}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{frame}
\begin{tikzpicture}
\begin{axis}
\addplot[blue, thick] {x};
\only<2>{\addplot[blue, thick, dashed] {2*x};}
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}
beamerarticle
package (part of the beamer class) that allows you to use beamer commands in other classes (such as article), which might be useful here. See page 209 of the manual.\usepackage[noxcolor]{beamerarticle}
allows me to compile everything astikz standalone
, but will only show the "last page" of each slide, instead of having several pages. Unfortunately, I cannot find this use caseto be detailed in the manual.\standaloneframe
s, as e.g. in tex.stackexchange.com/a/168705/121799 ?\ifnum
? See e.g. tex.stackexchange.com/a/459641/121799 for how to use it for drawing certain things only on certain "frames". Sometimes\ifcase
can be useful.)