29

The problem is that once the first graphics has been created, beamer is "blind": it does not know that a further slide has to be generated to fulfill the \only<2>. I had the same problem some time ago... if I remember correctly, I solved it by adding \only<1-2> around the external picture: \documentclass{beamer} % main document, called main....


22

You can automatically add the overlay number to the file name using the code from Accessing the current overlay number in beamer. If you only want to do this for some pictures, then use like: \tikzsetnextfilename{figure-\overlaynumber} To add it to every picture you could make it part of the prefix: \tikzexternalize[prefix=picture-\overlaynumber-] ...


20

There are two questions hidden in your post, they have two answers that are basically orthogonal: #Speeding up compilation by using tikzexternalize: You don't actually have to write them into separate files to save compilation time. You can leave your code almost unchanged, that's the beauty of it. This is the simplest possible setup with externalization \...


19

That is nasty, indeed. At least with pdf output (the resulting bounding box of the image is also used to clip the image). It might work better with ps output (I do not know). I guess the only solution is to increase the size of the bounding box manually. In your example, you could use \useasboundingbox (-0.2,-0.2); as last statement (otherwise it would ...


18

The externalize in tikz may generated individual picture for every \begin{tikzpicture}...\end{tikzpicture}. \usepgfplotslibrary{external} let all pgf-plots outside of the compile. Let pdflatex know those pictures are compiled with make. \tikzexternalize[mode=list and make] let tikz to know we would use the make. Because at present only the make support ...


17

A simple solution requiring only TikZ \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture}[scale=2,vertex/.style={draw,circle}, arc/.style={draw,thick,->}] \foreach [count=\i] \coord in {(0.809,0.588),(0.309,0.951),(-0.309,0.951),(-0.809,0.588),(-1.,0.),(-0.809,-0.588),(-0.309,-0.951),(0.309,-0.951),(0.809,-0.588),(1.,0.)}{ \...


16

I was able to reproduce the error and to fix it. Let's start to examine a simple document with a plot and a resistor: \documentclass[a4paper,11pt]{article} \usepackage{circuitikz} \usepackage{pgfplots} \pgfplotsset{compat=1.7} \usetikzlibrary{external} \tikzexternalize \tikzset{external/force remake} \begin{document} \begin{tikzpicture} \begin{axis}[...


15

I hope I fully understood what you requested. Here goes. \tikzexternalize accepts a prefix parameter which tells pdflatex where to store the externalised graphics. So even if you use \input in main.tex to include exercises with tikzpictures, you can set prefix=<something> in main.tex to let pdflatex know that externalised graphics should be stored in ...


14

Here is a simple method to add some margin (2mm in this example) to your tikzpicture: \documentclass{report} \usepackage{tikz} \usetikzlibrary{external,fit} \tikzexternalize \begin{document} \begin{tikzpicture} \draw[->,ultra thick] (0,0) -- (0,5); \draw[->,ultra thick] (0,0) -- (5,0); \node[fit=(current bounding box),inner sep=2mm]{...


14

There is the option to "optimize expensive commands away" when externalizing stuff. Since the includepdf statement is irrelevant for externalize, we could optimize it away - and your example compiled fine. To be more precise: I moved \usepackage{pdfpages} before the externalize call and configured includepdf as "remove away": \documentclass{scrbook} \...


14

i had the same issue, try using \tikzexternalize[optimize=false,prefix=PREFIX] i dont know why but the option optimze=false solved the problem Good Luck!


14

This solution does not allow you to externalise diagrams produced using the tikzcd environment but it does allow you to externalise other tikz pictures in your document. It is based on a workaround mentioned in the tikz manual in section 50.8.2 (pages 627-8). To make its use more convenient, etoolbox is used to patch the tikzcd environment. Essentially, this ...


13

There is a "fix" for the underlying problem as proposed by Christians comment: TikZ does not use \includegraphics for externalized figures as stated in the documentation but \pgfimage{figure0.eps}. This is not aware of the draft mode. This can be changed in the beginning of the document with \pgfkeys{/pgf/images/include external/.code=\includegraphics{#1}}...


13

This isn't latexmk automagic, but it avoids recompiling if the source .tex file hasn't changed: latexmk -pdf file.tex make -n -f file.makefile > /dev/null | grep pdflatex > /dev/null if [ $? -eq 0 ] ; then make -f file.makefile latexmk -g -pdf file.tex fi If the auto-generated makefile isn't actually going to compile any figures, the string "...


12

Here's a not-all-that-optimal solution. It gets round the main problem but introduces a few suboptimal pieces. (Hopefully someone who understood the externalisation process better than I do would be able to fix those ... looking at no Feuersängers in particular.) The main problem is when the command \only<2>{...} refers to a frame that is not ...


12

Make sure that you include --shell-escape parameter when invoking pdflatex. In TeXStudio, click on the following menu Options > Configure TeXStudio > Commands and change pdflatex -synctex=1 -interaction=nonstopmode %.tex into pdflatex -synctex=1 -interaction=nonstopmode --shell-escape %.tex


12

Your issue occurs because you are using the flag -output-directory=build when running pdflatex. In order to makes explanations less ambiguous, let's rename folders: you are using the flag -output-directory=foo; your .tex file is in a folder named root; you are using following macro in your .tex file: \tikzexternalize[prefix=bar/]. What happens is that ...


11

The problem is the same as that in Problem with environment expansion and the Tikz external library. in that TeX does not see the \end{tikzpicture} inside the \end{tikzcd}. The solution in Problem with environment expansion and the Tikz external library. is to pack everything inside a macro to ensure that the customised end-of-environment is expanded before ...


11

You need the shellesc package \documentclass{article} \usepackage{shellesc} % main document, called main.tex \usepackage{tikz} \usetikzlibrary{external} \tikzexternalize % activate! \begin{document} \loggingall \begin{tikzpicture} \node {root} child {node {left}} child {node {right} child {node {child}} child {node {child}} }; \end{...


10

For me neither of the proposed solutions worked. Maybe it is platform-dependent, taking into consideration the significant number of up-votes in favor of the accepted answer. However, mSSM's approach with \let was close. The reason for it not to work properly with \missingfigure is that the latter consumes an optional argument. The simple \let fails to ...


10

All in one approach Read the comments whether or not you need ImageMagick and/or FFMPEG installed on your machine. \documentclass{article} \usepackage{filecontents} % create a parameterized template \begin{filecontents*}{template.tex} \documentclass[tikz,border=12pt]{standalone} \usepackage{pgfplots} \begin{document} \foreach \ind in {1,2,...,30} { ...


10

This problem occurs because the testfile.png is expected to be in the same folder as the .tex file. When you're using the external library with the prefix=pics/ option, that's where the .tex file is, so testfile.png is expected to be in the pics folder as well. A couple of different ways of fixing this spring to mind: Move the testfile.png to the pics ...


9

I figured out the solution. \ref is not really required in this case. If \ref{named} is substituted with \pgfplotslegendfromname{named} then the MWE works. Though \ref can be used to put the legend, it is not a good usage.


9

The global externalization setting can be temporary disabled/enabled (until the end of the TeX group) using \tikzexternaldisable and \tikzexternalenable. Another option is to set the /tikz/external/export={true/false} key; the variant /tikz/external/export next={true/false} applies only for a single picture. All these are described in the chapter "...


9

This works for me \tikzset{external/system call={lualatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"}} The only other thing I am doing is to have write18 enabled in my pdflatex call so pdflatex can call lualatex. Works fine also with large data, but it is painfully slow. Also if there is an error in ...


9

Consider using Asymptote (part of TeXLive distribution), it is perfectly suited for such tasks. Here is a brief MWE to draw wiki example with added loop to the node 5. This code use three main inputs: adjacency matrix adj, a list of coordinates pair[] vcenter and a list of self-loops directions (in degrees) real[] SelfLoopDir. // gmx.asy // settings.tex="...


9

The approach in expl3 is that each command has clear, defined semantics independent of other code loaded. In contrast, the LaTeX document command \input is (as observed in the question) modified by the filehooks package. As such, \file_input:n is rather more like the TeX \input primitive (\@@input in LaTeX) than the document level \input command. In expl3, \...


8

The letters in the first examples serve as node labels hence referencing them needs text chars/numbers. If you want to put other types of labels you need to use L=<special chars> options. If L= option is empty the node label automatically becomes the visual label. \documentclass[border=5mm]{standalone} \usepackage{tkz-graph} \begin{document} \begin{...


8

edit: I believe the TikZ key external/mode=graphics if exists does exactly what you want. (See the TikZ/PGF Manual v2.10 Section 32.4.4, page 349.) Try the following for your example: \documentclass{article} \usepackage{tikz} \usetikzlibrary{external} \tikzexternalize \tikzset{external/mode=graphics if exists} \begin{document} \def\mypic#1{ \begin{...


8

This problem appears because the corners on the lines are really tight, causing the lines to overshoot when a sharp line join is used (see How can I prevent pgfplots from rendering lines incorrectly when I use "no markers"?). You can fix this by using line join=round. to apply that option to all your plots without having to change all the files, ...


Only top voted, non community-wiki answers of a minimum length are eligible