You can use standalone
class with beamer
option which allows to use all beamer
overlay constructs. This will create a pdf with as much as pages as overlays. Each of these pages can be cropped with pdfcrop
and you'll get a new pdf file with one adjusted overlay in each page. Finally you can include all of them in your article with page=
includegraphics option or with recent tcolorbox
rater
library.
As an example I've adapted the code from my answer to drawing(uncover) a curve bit-by-bit using tikzpcture and beamer and \onslide just eliminating frame titles:
\documentclass[beamer]{standalone}
\usepackage{tikz}
\usetikzlibrary{patterns}
\usetikzlibrary{decorations}
% A simple empty decoration, that is used to ignore the last bit of the path
\pgfdeclaredecoration{ignore}{final}
{
\state{final}{}
}
% Declare the actual decoration.
\pgfdeclaremetadecoration{middle}{initial}{
\state{initial}[
width={0pt},
next state=middle
]
{\decoration{moveto}}
\state{middle}[
width={\pgfdecorationsegmentlength*\pgfmetadecoratedpathlength},
next state=final
]
{\decoration{curveto}}
\state{final}
{\decoration{ignore}}
}
% Create a key for easy access to the decoration
\tikzset{middle segment/.style={decoration={middle},decorate, segment length=#1}}
\newcommand{\mypath}{(10,0)(9,-0.1)(8,-0.3)(7,-0.8)(6,-2)(5,-4.5)(4,-5)(3,-3)(2,0)(1.5,1.5)(1.4,1.75)(1.35,2)}
\begin{document}
\begin{frame}{} %<- no title for better cropping
\begin{tikzpicture}
\onslide<5->{\draw[green!20, pattern color =green!20, thin,pattern=north west lines] (0,-5) rectangle (2,2) node[rotate=90,midway,above] {\tiny{\textcolor{green!30!black}{repulsive forces dominant}}};}% drawn first so appear as underlay
\onslide<5->{\draw[red!0, pattern color =red!20, thin,pattern=north west lines] (2,-5) rectangle (10,2) node[midway,above] {\tiny{\textcolor{red!30!black}{attractive forces dominant}}};}
\onslide<1->{\draw[thick,->] (0,0) --(10,0) node[above left=0.2] {\tiny{Separation}};}
\onslide<1->{\draw[thick,->] (0,-5) --(0,2) node[rotate=90, near end,above] {\tiny{Potential Energy}};}
\onslide<2>{\draw[middle segment=0.3,color=blue, thick,-] plot[smooth] coordinates{\mypath};}
\onslide<3>{\draw[middle segment=0.6,color=blue, thick,-] plot[smooth] coordinates{\mypath};}
\onslide<4>{\draw[middle segment=0.8,color=blue, thick,-] plot[smooth] coordinates{\mypath};}
\onslide<5>{\draw[color=blue, thick,-] plot[smooth] coordinates{\mypath};}
\end{tikzpicture}
\end{frame}
\end{document}
The result has been pdfcrop
-ed and included in an article
file like this:
\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{tcbraster}[raster columns=2, raster equal height]
\tcbincludegraphics[graphics options={page=1}]{214474-crop}
\tcbincludegraphics[graphics options={page=2}]{214474-crop}
\tcbincludegraphics[graphics options={page=3}]{214474-crop}
\tcbincludegraphics[graphics options={page=4}]{214474-crop}
\tcbincludegraphics[graphics options={page=5}]{214474-crop}
\end{tcbraster}
\end{document}
2nd version
It could be easier. Command \tcbincludepdf{pdffile.pdf}
inside a tcbraster
environment includes one page after page from dffile.pdf
. Therefore, same results as previous code could be obtaned with just:
\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{tcbraster}[raster columns=2, raster equal height]
\tcbincludepdf{214474-crop.pdf}
\end{tcbraster}
\end{document}
texpower
with document classes likepdfscreen
;texpower
may do what you want.beamer
is quite different from other classes. In particular, it parses stuff differently and redefines many commands in order to make stuff work with overlay specifications. I doubt there is a general solution which does not involve essentially reproducing that functionality. And that would depend, among other things, on your document class. And you'd have to be careful not to load other packages which tried to redefine the same commands. If you wanted something which would work for some specific form of overlay specification or with something similar to an overlay specification....