I need to save the result of a tikzpicture to disk in code.
Basically I have written some optimization routines for other things that only create the image if it does not exist on disk. I want to apply the same thing to tikzpictures. I do not want to use externalize(mine is faster and more useful to me).
So, given a tikzpicture:
\begin{tikspicture}[...]
...
\end{tikzpicture}
I need some way to save it to disk as a png or jpg or whatever(png is preferable).
Something like:
\begin{tikspicture}[save=filename,...]
...
\end{tikzpicture}
or
\begin{tikspicture}[...]
...
\end{tikzpicture}
\savelasttikzpicture{filename}
(tikz externalize does not work because it doesn't seem to play nice with lualatex. I have code essentially like this:
\directlua{ drawTikzFig(arg); }
in lua:
function drawTikzFig(arg)
tex.print('\\begin{tikzpicture} ... \\directlua{getValue(arg);} ... \\end{tikzpicture}')
end
In fact, I don't know if this is exactly what is breaking tikz externalize or not but it gives errors at \directlua{}
Thanks
\export[filename]{...}which will export the... "visual". This way it can be used with anything like equations, tables, or whatever. – Archival Jan 3 at 20:05standaloneclass, and have a make file which compiles everything. For more on creating tikzpictures usingstandalone, see this answer. – Vivi Jan 4 at 20:38\include{}in the main file (using\usepackage{standalone}). I don't think it would be that difficult, and I believe it would save you a lot of time in the future. Anyway, food for thought :) – Vivi Jan 4 at 20:57standaloneto help people to switch their existing internaltikzpictures etc. to external files. However, so far I didn't had time. – Martin Scharrer♦ Jan 4 at 21:32