# Linking tikzpicture to an enlarged version at end of beamer slides

I am using the code from https://tfischernet.wordpress.com/2010/09/07/more-on-latex-beamer-linking-images-to-an-enlarged-version/ to link small images in my latex beamer slides to enlarged versions at the end. The nice thing is that the additional slides at the end are automatically generated. This code writes the filenames to a separate file and reads it in again during the next compilation run in order to pass the filename to includegraphics. Is it possible to design something similar for tikzpictures? I.e. if I have a small tikzpicture in some of my slides, that LaTeX automatically generates an additional slide at the end that contains an enlarged version of the same figure.

TikZ pictures can be saved in boxes for later replay. Here, the xsavebox package is used, which allows for arbitrarily named boxes and which efficiently saves the PDF code of the drawings into PDF XObjects. (Standard \savebox/lrbox and \usebox replicate the PDF code on every box insertion.)

\documentclass{beamer}

\usepackage{xsavebox}
\usepackage{tikz}
\usepackage{amssymb}

\begin{document}

\section{Main}

\begin{frame}{My talk}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%define and save some tikzpictures
\begin{xlrbox}{Red line}
\begin{tikzpicture}
\draw [red] (0,0) -- (1,1);
\end{tikzpicture}
\end{xlrbox}%
%
\begin{xlrbox}{Blue line}
\begin{tikzpicture}
\draw [blue] (0,1) -- (1,0);
\end{tikzpicture}
\end{xlrbox}%
\gdef\mytikzpictures{Red line, Blue line}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{frame}

\section{Appendix}

% enlarged views, 1 frame per image
\foreach \i in \mytikzpictures {
\begin{frame}{\Acrobatmenu{GoBack}{$\curvearrowleft$} \i}
\hypertarget{\i}{\resizebox{0.5\linewidth}{!}{\xusebox{\i}}}
\end{frame}
}

\end{document}

• Seems to work for me. :) May 16 '17 at 14:33
• Another option, without additional slides, could be a click-to-zoom box. May 16 '17 at 14:42