As mentioned you can use a package which mimics the internals of a tikzpicture but requiring that the images created by the external library are included.
This is very well explained in the manual of pgf, but I will explain how to use it.
First of, your regular local document will be having regular tikzset commands etc.
So:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{external}
\tikzexternalize
\begin{document}
Text ...
\tikzsetnextfilename{arrow}
\begin{tikzpicture}
\draw [->] (0,0) -- (2,3);
\end{tikzpicture}
\end{document}
This will create the document with the externalized picture creating a picture named arrow.pdf.
Now lets imagine you are done and wish to collaborate with a non-TikZian.
This will probably also mean that he does not have any pgf/tikz packages installed.
First thing is to find the file tikzexternal.sty, it should be located in
your TeX-tree under:
latex/pgf/utilities/tikzexternal.sty
Copy this file to your main-TeX file folder.
Comment out your \usepackage{tikz,pgf,pgfplots}.
Comment out any \usetikzlibrary, \usepgfplotslibrary, etc.
Add the usage of the package \usepackage{tikzexternal}.
- You do not need to comment out any
\tikzset commands as that will be emulated away
The above things which should be commented out, can be performed by local \iffalse ... \fi statements, but the explicit comment out is more rigorous when distributing it to others.
This should give you a document like so:
\documentclass{article}
\usepackage{tikzexternal}
\tikzexternalize
\begin{document}
Text ...
\tikzsetnextfilename{arrow}
\begin{tikzpicture}
\draw [->] (0,0) -- (2,3);
\end{tikzpicture}
\end{document}
And compile to find that TikZ is not used, but loading of the image is correct.
However, there are some caveats in using this method. First off, the entire key-value system in keys are not present. Hence, all references to external settings should be performed using the designated commands:
- Use
\tikzsetexternalprefix instead of the key prefix
- Use
\tikzsetfigurename instead of the key figure name
- Not even the content in
\tikzexternalize[<content>] will be recognized.
Also, the package tikzexternal gobbles the tikzpicture environment, hence the full environment should be visible (don't do any fancy things here :) ).
\documentclass{standalone}in your figures document. Also be sure to include the same packages than your professor, in order to guarantee that the same typefaces, font sizes, mathematical notation, etc. are used. Also try to create the figures in their final size, so that\includegraphicswon't require anyscale,widthorheightoption. This way the size of the fonts and line widths will be consistent among all figures. – JLDiaz Mar 10 at 21:33externallibrary which also has an extra library to include the created PDF's without usingTikZ. See the section Using External Graphics Without pgf Installed in the manual. – zeroth Mar 10 at 21:46standalonedocument class in and of itself, but it still required some fussing with the scaling to get it to work as if I inputted the TikZ code normally. On the other hand, theexternallibrary as described by zeroth is an excellent way to export all my TikZ code to separate .pdfs without having to manually compile separate .tex documents. And it didn't run into the above problem I had with thestandalonedocument class either (which is kind of weird to be honest, but whatever). – Riem Mar 11 at 0:51