Unfortunately, I cannot provide a MWE, as after trying for quite some time everything seems to work perfectly with small examples. So this is perhaps some package clash or problem with RTL, I am not sure; would be glad to hear any hint, even for how to set a proper MWE in this case.
I have a long manuscript full with tikz pictures, written in Hebrew (RTL), using XeLaTeX + polyglossia. My tikz setup is as simple as
\usepackage{tikz}
\usetikzlibrary{shapes,backgrounds}
Since compilation is long, I tried using the external tikz package, by
\usetikzlibrary{external}
\tikzexternalize[prefix=figures/]
making sure the folder figures/
really exists.
However, compilation, using
xelatex -synctex=1 -interaction=nonstopmode --shell-escape "notes".tex
now causes an error at the end of the first tikz picture:
\begin{tikzpicture@tcb@hooked} on input line 302 ended by \end{tikzpicture}. \end{tikzpicture}
The first tikz picture looks as follows:
\begin{tikzpicture}
\shade[ball color=blue] (0,0) circle (.25cm);
\shade[top color=red,bottom color=black] (0.5,-0.25) rectangle +(0.1,0.5);
\shade[ball color=blue] (1.1,0) circle (.25cm);
\shade[ball color=blue] (1.85,0) circle (.25cm);
\shade[ball color=blue] (2.6,0) circle (.25cm);
\shade[top color=red,bottom color=black] (3.1,-0.25) rectangle +(0.1,0.5);
\shade[top color=red,bottom color=black] (3.45,-0.25) rectangle +(0.1,0.5);
\shade[ball color=blue] (4.05,0) circle (.25cm);
\shade[ball color=blue] (4.8,0) circle (.25cm);
\end{tikzpicture}
Nothing fancy. But as I said, trying a MWE with this tikzpicture and the same tikz setup, without polyglossia and the rest of the packages I use, works perfect.
Here are some log lines from the log file, until the relevant error:
! Package tikz Warning: The key 'up to date check=md5' is impossible, there is
no macro to compute MD5. Falling back to 'up to date check=diff'.
\openout4 = `figures/notes-figure0.md5'.
===== 'mode=convert with system call': Invoking 'pdflatex -halt-on-error -inter
action=batchmode -jobname "figures/notes-figure0" "\def\tikzexternalrealjob{not
es}\input{notes}"' ========
\openout4 = `notes.auxlock'.
runsystem(pdflatex -halt-on-error -interaction=batchmode -jobname "figures/note
s-figure0" "\def\tikzexternalrealjob{notes}\input{notes}")...executed.
\openout4 = `notes.auxlock'.
File: figures/notes-figure0.pdf Graphic file (type QTm)
<use "figures/notes-figure0.pdf" >
! LaTeX Error: \begin{tikzpicture@tcb@hooked} on input line 302 ended by \end{t
ikzpicture}.
I guess the problem lies in tcolorbox
, another package that I use. Indeed, one pdf is processed properly, and my figures folder contain a compiled pdf file which consists of the first tcolorbox in the paper. The rest of the tcolorboxed are not compiled (it seems), and the tikzpicture
which generates the error appears in the code after many such tcolorboxes.
Any idea what I should look for, or hints about generating a proper MWE?
tikzpicture@tcb@hooked
is a tcolorbox command, so I would look at the parts of the code which use tcolorbox and tikz.tcolorbox
es which require it. (Things likeenhanced
etc. cause problems for me. I'm sure there are others.)\tcbset{shield externalize}
inside the preamble to avoid externalization fortcolorbox
es? See Section 4.23 (page 98) of thetcolorbox
manual.