summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/todonotes/examples/externalize.tex
blob: 3d6776cb7649dd081dfc333be230be86e01682b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
% comment out to define
%\def\CompileTikZFigures{}

\documentclass{article}
\usepackage{xspace}
\usepackage{tikz}
\ifx\CompileTikZFigures\undefined
	\usetikzlibrary{external}
	\tikzexternalize[prefix=pics/tikz/]
\fi

\usepackage{todonotes}

\ifx\CompileTikZFigures\undefined
	\makeatletter
	\renewcommand{\todo}[2][]{%
		\tikzexternaldisable%
		\@bsphack\@todo[#1]{#2}\@esphack\ignorespaces%
		\tikzexternalenable%
		\xspace%
		}
	\makeatother
\else
	\makeatletter
	\renewcommand{\todo}[2][]{%
		\@bsphack\@todo[#1]{#2}\@esphack\ignorespaces\xspace%
	}
	\makeatother
\fi

\begin{document}
Example by Marek Rjelka.

\verb+\CompileTikZFigures+ is
\ifx\CompileTikZFigures\undefined%
	un%
\fi%
defined.

\bigskip
Here goes some\todo{a comment} text.

\end{document}