1

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.

2

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}%
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  \hyperlink{Red line}{\xusebox{Red line}}
  \hyperlink{Blue line}{\xusebox{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. :) – Laurent May 16 '17 at 14:33
  • Another option, without additional slides, could be a click-to-zoom box. – AlexG May 16 '17 at 14:42

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.