Debian Codegraph @

texmf-dist/doc/latex/todonotes/examples/externalize.tex

raw
1 % comment out to define
2 %\def\CompileTikZFigures{}
3
4 \documentclass{article}
5 \usepackage{xspace}
6 \usepackage{tikz}
7 \ifx\CompileTikZFigures\undefined
8 \usetikzlibrary{external}
9 \tikzexternalize[prefix=pics/tikz/]
10 \fi
11
12 \usepackage{todonotes}
13
14 \ifx\CompileTikZFigures\undefined
15 \makeatletter
16 \renewcommand{\todo}[2][]{%
17 \tikzexternaldisable%
18 \@bsphack\@todo[#1]{#2}\@esphack\ignorespaces%
19 \tikzexternalenable%
20 \xspace%
21 }
22 \makeatother
23 \else
24 \makeatletter
25 \renewcommand{\todo}[2][]{%
26 \@bsphack\@todo[#1]{#2}\@esphack\ignorespaces\xspace%
27 }
28 \makeatother
29 \fi
30
31 \begin{document}
32 Example by Marek Rjelka.
33
34 \verb+\CompileTikZFigures+ is
35 \ifx\CompileTikZFigures\undefined%
36 un%
37 \fi%
38 defined.
39
40 \bigskip
41 Here goes some\todo{a comment} text.
42
43 \end{document}