In short, I am looking for a way to reduce redundancy in my tex projects. I have a lot of standalone tikzpictures with overlay specifications which I want to be able to include in my article, where the overlays should be ignored, and in my presentation, where I want the option to use the overlays or not.

Suppose I have this standalone file, say fig.tex:


            \draw<2>[thick] (0,0) -- node[above]{hello} (1,0);

I can use it in my beamer presentation like this:


Is there some sort of option I can pass to this include statement which tells the compiler to ignore overlays?

An important point is that the text in the tikzpicture should be rendered in the font of the document in which it is included. This excludes using \includestandalone[mode=image]{fig}.

I am currently using two files, one with and one without overlay specifications. Every time I want to change something, I need to do it two times and it frustrates me so any help or pointers would be much appreciated.

Things I have tried:

  • different includestandalone modes
  • using \ifstandalonebeamer in the standalone file, but I don't know how to make this evaluate to true when I include it elsewhere.
  • The method explained here, which doesn't work for me because it doesn't use the font of the document where it is included
  • Using \againframe could work in the presentation if the figure was the only thing on the slide. In my case I want to be able to include only the figure without overlays somewhere else in the presentation.
  • Do you intent to have more overlay stuff in your picture or just one? If the complete picture should appear only as whole, then you may put the overlay outside of tikz. You could do something like <2->\input{picture}. This should work also in article. – Harald Lichtenstein Dec 5 '20 at 22:12
  • 1
    In the beginning of my presentation I build the figure step by step, then later on in the presentation and in my article I want to show the figure again without the build up. – MDescamps Dec 5 '20 at 22:52
  • When I remember correctly there is an article mode in beamer to export all without overlays. – Harald Lichtenstein Dec 5 '20 at 23:04
  • I don't think I can use handout mode because then my overlay specifications would be ignored everywhere if I understand it correctly. My guess is that I need a solution on the level of the standalone package, maybe using \ifstandalonebeamer. – MDescamps Dec 6 '20 at 11:02
  • 4
    I’m voting to close this question because OP did not react to comment for a long time. – Dr. Manuel Kuehner Apr 1 at 16:36