6

I've built a beamer presentation in which a TikZ graph is built up sequentially using \pause. Example:

\documentclass{beamer}
\usepackage{tikz}
\begin{document}
        \begin{frame}
                \begin{tikzpicture}[ scale=5 ]
                        \draw (0,0) -- (1,0) node[below] {$f_1$};
                        \pause
                        \draw (0,0) -- (0,1) node[left] {$f_2$};
                        \pause
                        \draw (0,0) -- (0.87,0.5) node[right] {$f_3$};
                \end{tikzpicture}
        \end{frame}
\end{document}

This results in three slides. I want these as three separate images in which each TikZ picture covers an entire "page" or "slide". That is, I want the output slide1.pdf, slide2.pdf and slide3.pdf, and in each of them, the TikZ picture should cover the entire slide.

I could accomplish this by creating three standalone .tex files with a lot of duplicate TikZ code, but I suppose there is a better way.

What is a good solution?

  • You could extract them from the beamer presentation using the pdfpages package. You could also use the plain option for the frame environment so that you won't have headers/footers etc. – mbork Mar 31 '14 at 12:40
  • This is a tip with \only in use: tex.stackexchange.com/questions/119428/… – Malipivo Mar 31 '14 at 13:02
12

I'm not sure about the question but I think you're looking for standalone

\documentclass[beamer]{standalone}
\usepackage{tikz}
\begin{document}
        \begin{standaloneframe}
                \begin{tikzpicture}[ scale=5 ]
                        \draw (0,0) -- (1,0) node[below] {$f_1$};
                        \pause
                        \draw (0,0) -- (0,1) node[left] {$f_2$};
                        \pause
                        \draw (0,0) -- (0.87,0.5) node[right] {$f_3$};
                \end{tikzpicture}
        \end{standaloneframe}
\end{document}

produces a three pages/frames pdf document.

enter image description here

You can include them as background in any beamer presentation with \includegraphics[page=x]{your-standalone-file.pdf} where x=1,2,3.

With standaloneframe you don't have to worry about different figure sizes because all of them are equal.

\documentclass{beamer}

\begin{document}
\setbeamertemplate{background}{\includegraphics[page=1]{168685}}
        \begin{frame}{First frame}
        \end{frame}
\setbeamertemplate{background}{\includegraphics[page=2]{168685}}
        \begin{frame}{Second frame}
        \end{frame}
\setbeamertemplate{background}{\includegraphics[page=3]{168685}}
        \begin{frame}{Third frame}
        \end{frame}
\end{document}

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.