Is there a way using e.g. the external TikZ library to produce, from a master LaTeX document, another LaTeX source where each tikzpicture environment is replaced by the appropriate includegraphics command?
This can be painful to do by hand in a document which contains many such environments.
Example master document x.tex:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{...}
\usetikzlibrary{external}
\tikzexternalize
\begin{document}
...
\begin{figure}
\begin{tikzpicture}
...
\end{tikzpicture}
\caption{A}
\end{figure}
\begin{figure}
\begin{tikzpicture}
...
\end{tikzpicture}
\caption{B}
\end{figure}
...
\end{document}
desired output:
\documentclass{article}
\usepackage{graphics}
\begin{document}
...
\begin{figure}
\includegraphics{x-figure0}
\caption{A}
\end{figure}
\begin{figure}
\includegraphics{x-figure1}
\caption{B}
\end{figure}
...
\end{document}
externallibrary does. When the figure doesn't exist, it creates a pdf file which is used in later compilations. – Ignasi Oct 06 '15 at 15:03.texthatexternalgenerates? I need to replace pictures in TikZ and pgfplots by the generated PDF images in the.tex, i.e. I would like to get automatically a LaTeX document with no PGF/TikZ code. This is for a submission to arxiv, which does not seem to support correctly pgfplots. – user43513 Oct 06 '15 at 15:26