0

Code:

\documentclass[tikz]{standalone}
\usetikzlibrary{external}
\tikzexternalize
\begin{document}
\begin{tikzpicture}
\node[circle,draw] at (2, 3) {};
\end{tikzpicture}
\begin{tikzpicture}
\node[circle,draw] at (2, 3) {};
\end{tikzpicture}
\end{document}

Yields

! Missing } inserted.

Something is wrong with standalone when used with tikzexternalize. Can this be made to work?

Neil G
  • 17,947
  • @cmhughes: can standalone produce a pdf for each tikzpicture? – Neil G Feb 18 '14 at 02:22
  • Could you explain what you are trying to do exactly? As I understand it, standalone produces 1-out-for-1-in. But can't you just use two source files? Or use externalize rather than standalone? – cfr Feb 18 '14 at 02:42
  • @cfr: I generate a latex file with all of my images. I want them all to be compiled to individual pdfs that I can then include in my real latex file. This works with tikzexternal and standalone if I don't give standalone the tikz option. With that option, standalone puts each tikzpicture on a separate page, which is nice for viewing. – Neil G Feb 18 '14 at 03:04
  • I still don't see why you can't have each image in a separate file. Then your viewing file can use standalone as a package just as your main file does. – cfr Feb 18 '14 at 03:10
  • @cfr Can you explain what you mean? My "main file" uses memoir. My generated file uses "standalone" because memoir was letting figures extend out of the page. – Neil G Feb 18 '14 at 03:12
  • So you just need a script to split the generated file into separate files. (If you can't change the generation to use separate files.) Or use externalize and include the images back into a file for viewing. (But splitting is probably more flexible if the number of generated images might change.) – cfr Feb 18 '14 at 03:28
  • Sorry. The system doesn't recognise me on Chat or Meta. I can read but I can't write. But that probably doesn't matter since probably somebody else there will have a brighter idea;) – cfr Feb 18 '14 at 03:36
  • @NeilG: When you use tikz as option, standalone produces a pdf file with as much pages as tikzpicture. You can use \includegraphics[page=#]{xxx} to include one of them. Better explained at http://tex.stackexchange.com/questions/29820/how-can-i-generate-just-pgf-tikz-images-not-placed-a-whole-page-or-slide/29875#29875 – Ignasi Feb 18 '14 at 08:05
  • @ignasi: Thanks, yes, that definitely works. Is it true that tikzexternal won't rebuild graphics that haven't changed? Plus referencing graphics by page number rather than by name means that if I insert a graphic, I'll have to redo all of the page references. – Neil G Feb 18 '14 at 15:10
  • @NeilG Does this help? – Ignasi Feb 18 '14 at 16:58
  • @Ignasi: Yes, that solves the referencing problem. tikzexternal is still nice for its conditional rebuild, I think. – Neil G Feb 18 '14 at 18:01
  • Old stuff, but @NeilG Could you offer your answer or is it a duplicat to the linked questions of Ignasi? – Bobyandbob Nov 05 '17 at 14:31

0 Answers0