Debian Codegraph @

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

raw
1 \documentclass{article}
2 \usepackage{todonotes}
3 \usepackage{ocg-p}
4 \newcommand{\TODO}[1]{
5 \newsavebox\todoboxa
6 \savebox\todoboxa{\begin{ocg}[printocg=never]{ToDo screen}{todo4screen}{1}
7 \todo[inline]{#1}
8 \end{ocg}}
9 \newsavebox\todoboxb
10 \savebox\todoboxb{\begin{ocg}[printocg=always]{ToDo print}{todo4print}{0}
11 \todo[inline, color=white]{#1}
12 \end{ocg}}
13 \noindent\usebox\todoboxb\llap{\usebox\todoboxa}
14 \global\let\todoboxa\relax
15 \global\let\todoboxb\relax
16 }
17
18 \begin{document}
19
20 \section{Hello world!}
21
22 The todo inserted below is shown in color on the screen, but in black and white when sent to the printer.
23
24 Example by Robert Rehner.
25
26 \TODO{Example todo}
27 \end{document}