1

I have a beamer presentation. In one of the slides, I would like to include a fancy tikz graphic that makes heave use of \only<>. I would like to include only a specific frame number of that slide, say k-j.

I am fully aware that you can simply use \begin{frame}<n-m>. However, this does not do the trick! This only works if the that slide does not make use of other frame numbers. Then, I could of course simply use \begin{frame}<k-j>. But if the frame itself uses further \only<> commands, then this obviously does not work anymore. Here is a MWE:

  \documentclass{beamer}
  \usepackage{tikz}

  \begin{document}

  \begin{frame}
    \begin{itemize}[<+->]
      \item point 1
      \item point 2; here I would like to include frame number 4 of a fancy tikz picture:\\
      \input{someGraphic.tikz}
      \item point 3
    \end{itemize}
  \end{frame}

  \end{document}

  % content of the file someGraphic.tikz:

  \begin{tikzpicture}
  \node<1> {node on frame 1};
  \node<2> {node on frame 2};
  \node<3> {node on frame 3};
  \node<4> {node on frame 4};
  \node<5> {node on frame 5};
  \node<6> {node on frame 6};
  \end{tikzpicture}

I would thus need to tell the import command to use frame 4 of the imported picture, but I did not find such a possibility. Does it exist?

5
  • I'm not sure if I full understand what you are trying to achieve. Which of the overlay numbers of your example frame should be included? Aug 27, 2018 at 14:46
  • in this example, 4. But that number was picked arbitrariĺy.
    – Prof.Chaos
    Aug 27, 2018 at 15:28
  • So the only thing imported should be "node on frame 4" and on which overlay should it be placed? Aug 27, 2018 at 15:50
  • Well, it's just a very simple example. So, yes; here this is the case. But in the real world there is a very fancy graphic with many slides. The point of this example is that the slide number of the included presentation does not coincide with the slide number from which it is called (here, it is called on the second slide, but the slide that should be shown is not 2 but 4).
    – Prof.Chaos
    Aug 27, 2018 at 16:01
  • See also tex.stackexchange.com/questions/440474/… Aug 27, 2018 at 17:33

1 Answer 1

1

Would this do the job?

\documentclass{beamer}
\usepackage{tikz}

\usepackage{filecontents}
\begin{filecontents*}{someGraphic.tikz}
\begin{tikzpicture}
\node<1> {node on frame 1};
\node<2> {node on frame 2};
\node<3> {node on frame 3};
\node<4> {node on frame 4};
\node<5> {node on frame 5};
\node<6> {node on frame 6};
\end{tikzpicture}
\end{filecontents*}

\begin{document}

\begin{frame}<1,4,7>
  \begin{itemize}[<+->]
    \item point 1
    \item poiant 2; here I would like to include frame number 4 of a fancy tikz picture:\\
    \input{someGraphic.tikz}
    \item<7> point 3
  \end{itemize}
\end{frame}

\end{document}

Alternatively you could use the standalone class to precompile your image and then just include the 4th page as image.

3
  • First of all: thank you very much for your answer/efforts! Though I like your first idea (the code), that's not fully what I am looking for: node 4 is, of course, only visible on slide 4 (because the included graphic demands this), whereas I would like to fix slide 4. I basically want to include that picture -- i.e. the snapshot generated at slide 4 -- without seeing it chaning later on. Our second answer (standalone) solves it, I guess. Although I had liked a "direct" solution more. Thanks again!
    – Prof.Chaos
    Aug 27, 2018 at 16:34
  • Hm, I just realized that the first option (the code) also does not work for a second reason: In my example, I actually require to input the first slide/frame of the graphic. But because there are already appearing several other frames before that (in my example, the inclusion of the graphic happens at sub frame 2), this option does not work either.
    – Prof.Chaos
    Aug 27, 2018 at 16:56
  • @Prof.Chaos Maybe something like tex.stackexchange.com/a/318257/36296 could fix the problem - but being inside a list makes everything much more complicate... Aug 27, 2018 at 17:51

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.