Debian Codegraph @

texmf-dist/doc/latex/ximera/src/tikzexport.dtx

raw
1 % \subsubsection{TikZ export}
2 % We generate SVGs and PNGs for any TikZ images, via the
3 % ``externalize'' feature of TikZ.
4 %
5 % Currently TikZ doesn't compile natively into the website because of
6 % how the xake bake compilation works. In order to make Tikz work,
7 % you need to get the tool \verb|mutool| on the machine that is
8 % performing \verb|xake bake|.
9 % \begin{macrocode}
10 %<*classXimera>
11 \ifdefined\HCode
12 \tikzexporttrue
13 \fi
14
15 \iftikzexport
16 \usetikzlibrary{external}
17
18 \ifdefined\HCode
19 % in htlatex, just include the svg files
20 \def\pgfsys@imagesuffixlist{.svg}
21
22 \tikzexternalize[prefix=./,mode=graphics if exists]
23 \else
24 % in pdflatex, actually generate the svg files
25 \tikzset{
26 /tikz/external/system call={
27 pdflatex \tikzexternalcheckshellescape
28 -halt-on-error -interaction=batchmode
29 -jobname "\image" "\\PassOptionsToClass{tikzexport}{ximera}\texsource";
30 mutool draw -F svg \image.pdf > \image.svg ; % mutool adds "1" to filename ????
31 mutool draw -o \image.svg \image.pdf ;
32 mutool draw -r 150 -c rgbalpha -o \image.png \image.pdf ;
33 ebb -x \image.png
34 }
35 }
36 \tikzexternalize[optimize=false,prefix=./]
37 \fi
38
39 \fi
40
41 %</classXimera>
42 % \end{macrocode}