für eine Präsentation möchte ich eine schematische Zeichnung mit TikZ erstellen. Da die Präsentation recht umfangreich wird und damit das kompilieren recht lange dauert, möchte ich die Grafiken mit der external-Bibliothek von TikZ auslagern.
In mehreren Bildern wiederkehrende Symbole habe ich per \newcommand vordefiniert und lade sie dann in das entsprechende Bild ein. Dabei gehen bei Nutzung von external leider eine Reihe von Ankern bzw. Nodes verloren und so Linien nicht korrekt gezeichnet. Die Umsetzung ohne external funktioniert hingegen problemlos.
Habt ihr eine Idee wie ich das Schema dennoch mit External umsetzen kann?
Vielen Dank und Grüße
P.s.: Zwar kein richtiges Minimalbeispiel aber schon deutlich entschlackt und hoffentlich trotzdem hilfreich.
\documentclass{scrreprt} \usepackage{tikz} \usetikzlibrary{external,calc} \usepackage{ifthen} \tikzset{external/system call={"C:/texlive/port/bin/win32/lualatex.exe" --shell-escape -halt-on-error -batchmode=interactive -jobname "\image" "\texsource"}} \tikzexternalize[prefix=./] \newcommand\WT[3]{% \begin{tikzpicture}[remember picture, scale=#2, rotate=#3]% \draw[ % show curve controls ] (-2,-8) -- (-2,8) .. controls +(0,1) and +(0,1) .. (2,8) node [pos=0.5, anchor=center] (#1_in) {} -- (2,-8) .. controls +(0,-1) and +(0,-1) .. (-2,-8) node [pos=0.5,anchor=center] (#1_out) {} ; \draw[fill=white] (-2.5,-6.5) -- (-2.5,-6) -- (2.5,-6) -- (2.5,-6.5) --cycle; \draw[fill=white] (-2.5,6.5) -- (-2.5,6) -- (2.5,6) -- (2.5,6.5) --cycle; \draw[fill=black] (-1.4,-6) -- ++(0,12); \draw[fill=black] (-0.84,-6) -- ++(0,12); \draw[fill=black] (-0.28,-6) -- ++(0,12); \draw[fill=black] ( 0.28,-6) -- ++(0,12); \draw[fill=black] ( 0.84,-6) -- ++(0,12); \draw[fill=black] ( 1.4,-6) -- ++(0,12); \end{tikzpicture}% } \begin{document} \tikzexternalenable \begin{tikzpicture}[remember picture] \def\figheight{7} \def\figwidth{4} \def\stages{7} % Kolonnenumriss \draw[ %show curve controls ] (-0.5*\figwidth, -0.5*\figheight) -- ++(0,\figheight) .. controls +(0,1.2) and +(0,1.2) .. node foreach[count=\i,] \k in {0,0.1,...,1,1} (Kopf_node\i) [pos=\k, anchor=center] {} ++(\figwidth,0) -- ++(0,-\figheight) ..controls +(0,-1.2) and +(0,-1.2) .. node foreach[count=\i,] \k in {0,0.1,...,1,1} (Sumpf_node\i) [pos=\k, anchor=center] {} ++(-\figwidth,0) --cycle; %\foreach[count=\I,] \K/\nlabel in {-1/N,0/\dots,1/k+1,2/k,3/k-1,4/\dots,5/f,6/\dots,7/j+1,8/j,9/j-1,10/\dots,11/1} { \foreach[count=\I,] \K/\nlabel in {-1/N,0/\dots,1/k,2/\dots,3/f,4/\dots,5/j,6/j-1,7/\dots} { \pgfmathsetmacro{\k}{\K*\figheight/(\stages)}; \pgfmathsetmacro{\dk}{0.5*\figheight/(\stages)}; \ifthenelse{\I > 1}{ % Stufenböden \draw (-0.5*\figwidth,\k-0.5*\figheight) -- (0.5*\figwidth,\k-0.5*\figheight); % Pfeile für Dampf V und Flüssigkeit L \draw[->] (0.5-0.5*\figwidth,-0.35+\k-0.5*\figheight) -- (0.5-0.5*\figwidth,0.35+\k-0.5*\figheight) node[pos=1] (vlabel\K) {}; \draw[<-] (-0.5+0.5*\figwidth,-0.35+\k-0.5*\figheight) -- (-0.5+0.5*\figwidth,0.35+\k-0.5*\figheight) node[pos=0] (llabel\K) {}; } {}; \node (nlabel\K) at (0,\k-0.5*\figheight+\dk) {}; }; % % Kondensator Kopf \node[anchor=west, inner sep=0pt] (KopfWT) at ($(Kopf_node6)+(0.5,0.75)$) {\WT{KopfWT}{0.1}{-90}}; % Kondensator Sumpf \node[anchor=east, inner sep=0pt] (SumpfWT) at ($(Sumpf_node6)+(-0.5,-0.75)$) {\WT{SumpfWT}{0.1}{90}}; % Kopfprodukt -> Kondensator \draw [->] (Kopf_node6.center) |- (KopfWT_out.center) node[pos=0, anchor=south east] (labelKopf) {}; % Sumpfprodukt -> Kondensator \draw [->] (Sumpf_node6.center) |- (SumpfWT_out.center) node[pos=0, anchor=north west] (labelSumpf) {}; % Kondensator -> Produkt \draw [->] (KopfWT_in.center) -- +(1.75,0) node[pos=1, anchor=south east] (KopfProd) {}; % Kondensator -> Produkt \draw [->] (SumpfWT_in.center) -- +(-1.75,0) node[pos=1, anchor=south west] (SumpfProd) {}; \draw[dashed] let \p1 = ($(SumpfProd.south west)+(0.75,-0.5)$), \p2 = ($(KopfProd.north east)+(-0.75,+0.5)$), \p3 = (nlabel2) in (\p1) -- ($(\x1, \y3)+(0,-0.35)$) -- ($(\x2, \y3)+(0,-0.35)$) -- (\x2,\y1) -- cycle; \draw[dashed] let \p1 = ($(SumpfProd.south west)+(0.75,-0.5)$), \p2 = ($(KopfProd.north east)+(-0.75,+0.5)$), \p3 = (nlabel4) in (\x1,\y2) -- ($(\x1, \y3)+(0,0.35)$) -- ($(\x2, \y3)+(0,0.35)$) -- (\p2) -- cycle; \foreach[count=\I,] \K/\nlabel in {-1/N,0/\dots,1/k,2/\dots,3/f,4/\dots,5/j,6/\dots,7/1} { \node[anchor=center, fill=white, opacity=0.9, text opacity=1] at (nlabel\K.center) {\nlabel}; }; \end{tikzpicture} \end{document}