Debian Codegraph @

texmf-dist/source/latex/todonotes/todonotes.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 2019 by Henrik Skov Midtiby <[email protected]>
4 % -------------------------------------------------------
5 %
6 % This work may be distributed and/or modified under the
7 % conditions of the LaTeX Project Public License, either version 1.3
8 % of this license or (at your option) any later version.
9 % The latest version of this license is in
10 % http://www.latex-project.org/lppl.txt
11 % and version 1.3 or later is part of all distributions of LaTeX
12 % version 2005/12/01 or later.
13 %
14 % \fi
15 %
16 % \iffalse
17 %<*driver>
18 \ProvidesFile{todonotes.dtx}
19 %</driver>
20 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
21 %<package>\ProvidesPackage{todonotes}
22 %<*package>
23 [2024/01/05 v1.1.7 Todonotes source and documentation.]
24 %</package>
25 %
26 %<*driver>
27 \documentclass{ltxdoc}
28 \usepackage{wrapfig}
29 \usepackage[colorlinks, linkcolor=black, urlcolor=blue]{hyperref}
30 \usepackage[colorinlistoftodos, loadshadowlibrary]{todonotes}[2024/01/05]
31 \usepackage{amsmath}
32 \usepackage{setspace}
33 \usepackage{soul}
34 \setcounter{tocdepth}{2}
35 \EnableCrossrefs
36 \CodelineIndex
37 \RecordChanges
38 \begin{document}
39 \DocInput{todonotes.dtx}
40 %\iffalse
41 % \PrintChanges
42 % \PrintIndex
43 %\fi
44 \end{document}
45 %</driver>
46 % \fi
47 %
48 % \CheckSum{766}
49 %
50 % \CharacterTable
51 % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
52 % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
53 % Digits \0\1\2\3\4\5\6\7\8\9
54 % Exclamation \! Double quote \" Hash (number) \#
55 % Dollar \$ Percent \% Ampersand \&
56 % Acute accent \' Left paren \( Right paren \)
57 % Asterisk \* Plus \+ Comma \,
58 % Minus \- Point \. Solidus \/
59 % Colon \: Semicolon \; Less than \<
60 % Equals \= Greater than \> Question mark \?
61 % Commercial at \@ Left bracket \[ Backslash \\
62 % Right bracket \] Circumflex \^ Underscore \_
63 % Grave accent \` Left brace \{ Vertical bar \|
64 % Right brace \} Tilde \~}
65 %
66 %
67 % \changes{0.1}{2008/04/17}{The first version of the package}
68 % \changes{0.2}{2008/05/15}{Updated the option handling of the package}
69 % \changes{0.2.1}{2008/05/16}{Slightly modified by Kjell Magne Fauske to
70 % support notes in the left margin (for documentstyle book).}
71 % \changes{0.2.2}{2008/05/28}{Added a missingfigure command}
72 % \changes{0.2.3}{2008/06/10}{Made a dependency on the calc package}
73 % \changes{0.3}{2008/07/11}{Delayed the requirements for the hyperref package
74 % untill begin document and added an optional argument
75 % to the todo command for adding inline todonotes (Idea
76 % from Patrick Toche)}
77 % \changes{0.3.1}{2008/07/15}{Added some options to the todo macro (Idea: Patrick
78 % Toche) and made the \\listoftodos point at the inserted
79 % todos and not only the current / previous section,
80 % subsection or figure using the \\phantomsection macro.}
81 % \changes{0.4}{2008/07/28}{Modified the behaviour of the inline todonotes, to
82 % avoid empty lines around the inline todonotes.}
83 % \changes{0.4.1}{2008/07/28}{
84 % Added the option colorinlistoftodos which inserts a
85 % small box with the used fillcolor of the todonotes in
86 % the list of todos.}
87 % \changes{0.4.2}{2008/07/30}{Fixed a bug with the disable option to the
88 % package.}
89 % \changes{0.5}{2008/08/05}{Created a dtx file containing both source
90 % code and documentation of the package}
91 % \changes{0.5.1}{2008/09/15}{Updated the documentation}
92 % \changes{0.5.2}{2008/10/20}{Fixed a bug that prevented the usage
93 % of the option french for babel. Bug report by Thomas
94 % Braun.}
95 % \changes{0.6}{2008/10/24}{Added the caption option to the todo
96 % command.}
97 % \changes{0.6.1}{2008/11/07}{Added a new usecase with decreased line
98 % spacing.}
99 % \changes{0.6.2}{2008/11/13}{Added a usecase by Fabrice Niessen.}
100 % \changes{0.7}{2008/11/22}{Added language options on request from
101 % Peter Zimmermann.}
102 % \changes{0.7.1}{2008/12/07}{Reworked the color options for both
103 % the whole package and the todo command. General code
104 % clean up. Added the prependcaption package option.}
105 % \changes{0.7.2}{2008/12/27}{Avoid to change the fontsize inside
106 % the list of todos, fixing a bug revealed by Vladimir
107 % Zhuravlev.}
108 % \changes{0.7.3}{2008/12/30}{The localization options (danish and
109 % german) and the disable options, were all flawed by
110 % naming inconsistencies that made then break the
111 % package. This have been fixed.}
112 % \changes{0.7.4}{2008/12/30}{Fixed a bug related to the caption
113 % option for the todo command. Introduced a counter of
114 % the number of inserted todos.}
115 % \changes{0.7.5}{2009/01/02}{Fixed a typo in a macroname.}
116 % \changes{0.7.6}{2009/01/04}{Added a textsize option for the
117 % package and the prepend / noprepend option for the
118 % todo command.}
119 % \changes{0.8}{2009/01/09}{Added three new translations french,
120 % spanish and catalan thanks to Richard Dominique and
121 % Joan Queralt. Improved the visual appearence of the
122 % inserted notes (rounded corners and optional shadows)
123 % with code from Joan Queralt. Found an untranslated
124 % textstring ''Figure'' in the source. Added a figwidth
125 % option to the missingfigure command, patch by Paul
126 % Ivanov.}
127 % \changes{0.8.1}{2009/01/12}{Added a space between the colored
128 % square and the text in the list of todos. Added a new
129 % usecase for marking old / new sections. Made the name
130 % of listoftodos changeable.}
131 % \changes{0.8.2}{2009/02/04}{Italian translation by Gustavo
132 % Cevolani. Removed the dependence on the hyperref
133 % package.}
134 % \changes{0.8.3}{2009/03/31}{Added a use case for linking to the
135 % list of todos, idea from Andreas Plank. Introduced a
136 % package option for listening to the draft option given
137 % to the document class.}
138 % \changes{0.8.4}{2009/04/02}{Fixed a bug related to the obeyDraft
139 % option.}
140 % \changes{0.8.5}{2009/08/01}{Added two new usecases (enumeration of
141 % inserted todonotes and how to set custom default values).
142 % Changed the order of the use case examples.}
143 % \changes{0.8.6}{2009/08/05}{Added a portuguese translation by Og DeSouza.}
144 % \changes{0.8.7}{2009/10/24}{Updated portuguese translation. Added a ngerman
145 % alias for the german translation suggested by Michael Niedermair.}
146 % \changes{0.8.8}{2009/12/07}{Added a new usecase from Vitaly. Fixed a
147 % bug reported by Oscar Gustafsson. Explained why the placement
148 % of todonotes in the margin fails in certain custom document classes.}
149 % \changes{0.8.9}{2009/12/25}{Added a dutch translation by Ruben Ruben Vermeersch.}
150 % \changes{0.9.0}{2010/09/13}{Added a english option as suggested by Marco Berghoff.}
151 % \changes{0.9.1}{2010/09/13}{Added the todototoc command by idea from Sven Augustin.}
152 % \changes{0.9.2}{2010/09/13}{Use chapter (if available) for the list of todos heading.}
153 % \changes{0.9.3}{2010/09/13}{Make an internal definition of the todo command,
154 % for easing redefinition of the command behaviour.}
155 % \changes{0.9.4}{2010/09/26}{Make the disable option work on a local scale.}
156 % \changes{0.9.5}{2010/09/26}{Code simplification by extracting functionality to
157 % smaller macros.}
158 % \changes{0.9.6}{2010/11/04}{Give fontsize to TikZ. Align notes with line where note
159 % is set. Added new option fancyline. Patches by Benjamin Kellermann.}
160 % \changes{0.9.7}{2011/03/07}{Updated documentation.}
161 % \changes{0.9.8}{2011/04/21}{Suppress warnings about underfull / overful boxes
162 % generated by the inserted todonotes. Patch by Peter M Schuler.}
163 % \changes{0.9.9}{2011/10/22}{Added author option, implementation provided by
164 % Xavier Alameda-Pineda. Example of modifying the
165 % listoftodos removing some protect commands with no effect.}
166 % \changes{1.0.0}{2012/07/25}{Mention trouble with the classicthesis style.
167 % Refer to some alternatives to the package.
168 % Added todoin command as suggested by Stefan Pinnow.
169 % Described how to use tikz externalize with todonotes.
170 % Added obeyDraft and obeyFinal options.}
171 % \changes{1.0.1}{2012/11/24}{Fix spacing issues reported by Jonathan Zachhuber and
172 % Brent Longborough.
173 % Added figheight option to the missingfigure command as suggested by Kim Albertsson.}
174 % \changes{1.0.2}{2014/07/14}{Added Swedish translation by Emil Lundberg.
175 % Added usecase by Tobias Winchen.
176 % Mentioned that default arguments can be set using the presetkeys command.
177 % Updated list of alternatives to the todonotes package.
178 % Draw borders around coloured boxes in the list of todos, patch by Ze Loff.}
179 % \changes{1.0.3}{2014/10/21}{Added the option figcolor to missing figure, patch by Pascal Hebbeker.
180 % Added Croatian translation by Ican Kokan.
181 % Changed default with of missingfigure.
182 % Removed some underfull box warnings, solution by Ernst Blecha.}
183 % \changes{1.0.4}{2015/07/09}{Restructured documentation and placed some examples in the
184 % doc/examples subdirectory.}
185 % \changes{1.0.5}{2016/11/02}{Example of how to change the space eating behaviour
186 % added by Anselm Wagner.
187 % Reduced the width of missingfigure to avoid bad box warnings.}
188 % \changes{1.0.6}{2018/07/09}{Changed how whitespaces are handled around inserted
189 % todos to better mimick macros like index (Suggestion by Frank Mittelbach).
190 % Fix missing character warnings using patch by Niels Anders Danielsson.
191 % Use the specified textsize for missingfigure, patch by Johannes Twittmann.
192 % Added new options for inline todonotes based on code from Daniel Krenn.
193 % Added warning message when marginparwidth is less than 2cm, as
194 % suggested by ErikBoesen.}
195 % \changes{1.0.7}{2018/07/09}{Changed the warning about marginparwidth to a
196 % proper warning message.}
197 % \changes{1.0.8}{2018/09/08}{Improved spacing behaviour so it mimics the index macro,
198 % patch by Frank Mittelbach.
199 % Center graphics vertically in missingfigure, patch by Philipp Allgeuer.
200 % Added new option tickmarkheight as suggested by Richard Niland.}
201 % \changes{1.1.0}{2018/10/17}{Many improvements to the user interface by Frank Mittelbach.
202 % Added the command setuptodonotes. Added textcolor as an option.
203 % Marked the insertion point of notes with tickmarks with a customizable height.
204 % Steamline which options that are accepted to size commands
205 % (both commands (backslash tiny) and text (tiny) are now supported).}
206 % \changes{1.1.1}{2018/11/22}{Implemented shadow and noshadow options for the todo command.}
207 % \changes{1.1.2}{2019/01/24}{Fix issue 36 and 37.}
208 % \changes{1.1.3}{2020/08/18}{Fix issue 48 and make colors used in the last todo
209 % globally available.}
210 % \changes{1.1.4}{2021/04/26}{Fix issue 51 by avoid loading the tikz shadows
211 % library by default.}
212 % \changes{1.1.5}{2021/06/04}{Fix issue 54 related to additional spacing around todos with
213 % shadows. Actually use the tickmarkheight option as suggested by
214 % José Francisco Loff library by default. Described a workaround for using
215 % the standalone document class.}
216 % \changes{1.1.6}{2023/01/31}{Fix issue 64 by adding the command definetodostyle and
217 % the format option to the todo and missingfigure commands.
218 % Pull request by rzach.}
219 % \changes{1.1.7}{2024/01/05}{Fix issue 73 by providing default values for parameters
220 % needed to typeset the list of todos.}
221 % \GetFileInfo{todonotes.dtx}
222 %
223 % \DoNotIndex{\newcommand,\newenvironment}
224 %
225 % \iffalse
226 % A macro for marking things todo before the next relase
227 % (typically update of documentation).
228 % \fi
229 % \newcommand{\donow}[1]{\todo[color=blue]{#1}}
230 %
231 %
232 % \title{The \textsf{todonotes} package\thanks{This document
233 % corresponds to \textsf{todonotes}~\fileversion, dated \filedate.}}
234 % \author{Henrik Skov Midtiby \\ \texttt{[email protected]}}
235 %
236 % \maketitle
237 %
238 % \begin{abstract}
239 % The |todonotes| package allows you to insert to--do items in your
240 % document. At any point in the document a list of all the inserted
241 % to--do items can be listed with the |\listoftodos| command.
242 % \end{abstract}
243 %
244 % \tableofcontents
245 %
246 % \newpage
247 % \section{Introduction}
248 %
249 % The |todonotes| package makes four commands available to the
250 % user: |\todo[]{}|, |\missingfigure{}| and |\listoftodos|.
251 % |\todo[]{}| and |\missingfigure{}| makes it possible to insert
252 % notes in your document about things that has to be done later
253 % (todonotes \ldots).
254 % The |\todostyle| command allows the user to
255 % define named custom styles as abbreviations for lists of other
256 % options that can be given to the |\todo| command.
257 % I developed the basic functionality of the package while I worked
258 % on my bachelor project.
259 %
260 % Some alternatives for the todonotes package are:
261 % \begin{itemize}
262 % \item \href{http://ctan.org/pkg/easy-todo}{easy-todo}\\
263 % Depends on |color|, |tocloft| and |ifthen|, small feature set.
264 % \item \href{http://ctan.org/pkg/fixmetodonotes}{fixmetodonotes}\\
265 % Depends on |graphicx|, |color|, |transparent|, |watermark|,|fix-cm|, |ulem| and |tocloft|, small feature set.
266 % \item \href{http://ctan.org/pkg/todo}{todo}\\
267 % Depends on |amssymb|, medium feature set.
268 % \item \href{http://ctan.org/pkg/fixme}{fixme}\\
269 % Large package with a lot of features.
270 % \end{itemize}
271 % The main reason for considering other packages is that the todonotes
272 % package is quite large and relies heavily on tikz.
273 % This can slow down compilation of large documents significantly.
274 % The mentioned alternatives have a different feature set and does not
275 % rely on tikz, which makes them require fewer resources.
276 %
277 %
278 % \subsection{Usage}
279 %
280 % \DescribeMacro{\todo}
281 % My \index{\todo}most common usage of the todonotes package, is to
282 % insert an todonotes somewhere in a latex document.
283 % An example of this usage is the command
284 %
285 % |\todo{Make a cake \ldots}|,
286 %
287 % \noindent
288 % which renders like\todo{Make a cake \ldots}.
289 % The |\todo| command has this structure:
290 % |\todo|\oarg{options}\marg{todo text}.
291 % The |todo text| is the text that will be shown in the todonote and
292 % in the list of todos. The optional argument |options|, allows the
293 % user to customize the appearance of the inserted todonotes.
294 % For a description of all the options see section
295 % \ref{subsecTodoOptions}.
296 %
297 %
298 % \DescribeMacro{\missingfigure}
299 % The |\missingfigure| command inserts an image containing an
300 % attention sign and the given text.
301 % The command takes only one argument
302 % |\missingfigure|\marg{text}, a text string that could
303 % describe what the figure should consist of.
304 % An example of its usage could be
305 %
306 % |\missingfigure{Make a sketch of the structure of a trebuchet.}|
307 %
308 % \noindent
309 % which renders like.
310 %
311 % \missingfigure{Make a sketch of the structure of a trebuchet.}
312 %
313 %
314 % \DescribeMacro{\listoftodos}
315 % The |\listoftodos| command inserts a list of all the todos in the
316 % current document. |\listoftodos| takes no arguments.
317 % For this document the list of to--do's looks like.
318 % \listoftodos
319 % \vspace{0.5cm}
320 %
321 % \DescribeMacro{\todototoc}
322 % The |\todototoc| command adds an entry to the table of contents for
323 % list of todos. The command should be placed right before the
324 % |\listoftodos| command.
325 %
326 % \DescribeMacro{\todostyle\marg{name}\marg{style}}
327 % The |\todostyle| command defines a new optional argument to the
328 % |\todo| command \meta{name} which sets the options given by
329 % \meta{style}. For instance, after issuing
330 % \begin{verbatim}
331 % \todostyle{red}{color=red,shadow}\end{verbatim}
332 % the command |\todonote[red]{Stuff}| has the same effect as:
333 % \begin{verbatim}
334 % \todonote[color=red,shadow]{Stuff}\end{verbatim}
335 % Defined styles should be used
336 % as the first optional argument to |\todo|, as they reset all
337 % predefined options to their defaults.
338 %
339 % \subsection{Package options}
340 % \label{subsecPackageOptions}
341 % \DescribeMacro{disable}
342 % If the option |disable| is passed to the package, the macros
343 % usually defined by the package (|\todo|, |\listoftodos| and
344 % |\missingfigure|) are defined as macros with no effect, and thus
345 % all inserted notes are removed.
346 %
347 % \DescribeMacro{obeyDraft, obeyFinal}
348 % When the option |obeyDraft| is given, the package checks
349 % if the one of the options |draft|, |draftcls| or |draftclsnofoot|
350 % is given (this option is usually given to
351 % the documentclass). If the |draft| option is given, the
352 % functionality of the package is enabled and otherwise the effect
353 % of the package is disabled.
354 % The option |obeyFinal| does something similar, except that the
355 % todonotes package is only disabled if the |final| option given.
356 %
357 % \DescribeMacro{danish, german, ngerman, english, french, swedish}
358 % \DescribeMacro{spanish, catalan, italian}
359 % \DescribeMacro{portuguese, dutch, croatian}
360 % Use translations of the text strings
361 % ''List of todos'' and ''Missing figure''.
362 % The default is to use none of these options, which results in
363 % english text strings.
364 % Currently the following languages are supported:
365 % catalan,
366 % croatian,
367 % danish,
368 % dutch,
369 % english,
370 % french,
371 % german,
372 % ngerman,
373 % italian,
374 % portuguese,
375 % spanish and
376 % swedish.
377 %
378 % \DescribeMacro{colorinlistoftodos}
379 % Adds a small colored square in front of all items in the Todo
380 % list. The color of the square is the same as the fill color of the
381 % inserted todonote.
382 % This can be useful if there are different types of todos
383 % (insert reference, explain in detail, \ldots) where the color of
384 % the inserted todonote marks the type of todo.
385 %
386 % \DescribeMacro{color}
387 % \DescribeMacro{backgroundcolor}
388 % \DescribeMacro{textcolor}
389 % \DescribeMacro{linecolor}
390 % \DescribeMacro{bordercolor}
391 % These options sets the default colors for the todo command.
392 % There are four colors that can be specified. The border color
393 % (default |bordercolor=black|) around the inserted text, the color
394 % behind the inserted text (default |backgroundcolor=orange|), the
395 % color of the inserted text (default |textcolor=black|) and
396 % the color of the line connecting the inserted textbox with the
397 % current location in the text (default |linecolor=orange|).
398 % Setting the |color| option to |val| passes this value on to the
399 % background and line color options.
400 % The specified colors must be valid according to the
401 % |xcolor| package.
402 %
403 % \DescribeMacro{tickmarkheight}
404 % |tickmarkheight=length| set the height of the tickmark at
405 % the location where the todo is inserted, the default value is |0pt|.
406 %
407 % \DescribeMacro{textwidth}
408 % |textwidth=length| sets the width of a todo item in the margin to
409 % |length|. The width of inline todonotes defaults to the width of the
410 % current |\linewidth| but can be adjusted using the
411 % |inlinewidth| option.
412 %
413 % \DescribeMacro{textsize}
414 % |textsize=value| sets the default text size of the inserted
415 % todonotes to the given value.
416 % Value is the ''name'' of the used font size, eg. if the desired
417 % fontsize is |\tiny| use |textsize=tiny|. The default value is
418 % |textsize=normalsize|.
419 %
420 % \DescribeMacro{prependcaption}
421 % The |prependcaption| option triggers a special behaviour of the
422 % |caption=val| option for the todo command, where the given value
423 % |val| is inserted in the inserted todonote.
424 %
425 % \DescribeMacro{loadshadowlibrary}
426 % If given, the |shadows| tikz library will be loaded. This is required
427 % for adding shadows to the inserted todonotes.
428 %
429 % \DescribeMacro{shadow}
430 % If the |shadow| option is given, the inserted todonotes will by
431 % default be displayed with a gray shadow.
432 % For this to work, the package option |loadshadowlibrary| must be
433 % provided.
434 % I expect that the option will trigger problems with tikz versions
435 % prior to 2.0.
436 %
437 % \DescribeMacro{dvistyle}
438 % When a document with todonotes is compiled with plain latex (to a
439 % dvi-file), there is an issue with the visual
440 % appearance\footnote{The problem is placement of text inside the
441 % colored boxes.}.
442 % The option |dvistyle| changes the appearance of the inserted
443 % todonotes to avoid this problem.
444 %
445 % \DescribeMacro{figwidth}
446 % The |figwidth=length| option sets the default width of the figure
447 % inserted by the |\missingfigure| command.
448 % The default value is |\linewidth|.
449 %
450 %
451 %
452 % \subsection{Options for the todo command}
453 % \label{subsecTodoOptions}
454 % There are several options that can be given to the |\todo|
455 % command. All the options are described here and often I have
456 % included examples of the change in visual appearance.
457 % Default values for these options can be set using the setuptodonotes
458 % command.
459 % \begin{verbatim}
460 % \setuptodonotes{fancyline, color=blue!30}
461 % \end{verbatim}
462 %
463 % \DescribeMacro{disable}
464 % The |disable| option can be given directly to the todo command.
465 % If given the command has no effect.
466 %
467 % \DescribeMacro{color}
468 % \DescribeMacro{backgroundcolor}
469 % \DescribeMacro{textcolor}
470 % \DescribeMacro{linecolor}
471 % \DescribeMacro{bordercolor}
472 % These options set the color that is used in the current todo
473 % command.
474 % The color classes is the same as used in the color package
475 % options, see section \ref{subsecPackageOptions}.
476 % Default values can be set by the color
477 % options when the todonotes package is loaded.
478 % \todo[color=green!40]{And a green note}
479 % The todo notes inserted in this paragraph is created with the
480 % command
481 % |\todo[color=green!40]{And a green note}|.
482 % The color of the inserted note could be used to mark different
483 % types of tasks (insert references, explain something in detail,
484 % \ldots), this could be streamlined by defining new commands like
485 % below.
486 % \begin{verbatim}
487 % \newcommand{\insertref}[1]{\todo[color=green!40]{#1}}
488 % \newcommand{\explainindetail}[1]{\todo[color=red!40]{#1}}
489 % \end{verbatim}
490 % An example that uses all of the color options is given
491 % below\todo[linecolor=green!70!white, backgroundcolor=blue!20!white,
492 % bordercolor=red, textcolor=yellow]{Anything but default colors}.
493 % \begin{verbatim}
494 % \todo[linecolor=green!70!white, backgroundcolor=blue!20!white,
495 % bordercolor=red, textcolor=yellow]{Anything but default colors}.
496 % \end{verbatim}
497 %
498 %
499 % \DescribeMacro{shadow / noshadow}
500 % If the package is loaded with the |shadow| option,
501 % a shadow is added to all notes, otherwise no shadows are shown.
502 % This global setting can be overwritten by the |shadow| and |noshadow|
503 % \todo[noshadow]{A note without a shadow}
504 % options to the todo command.
505 % To insert a note with and without shadows, use the |shadow|
506 % \todo[shadow]{A note with a shadow}
507 % and |noshadow| options as shown here:
508 % \begin{verbatim}
509 % \todo[shadow]{A note with a shadow}
510 % \todo[noshadow]{A note without a shadow}
511 % \end{verbatim}
512 %
513 % \DescribeMacro{tickmarkheight}
514 % |tickmarkheight=length| set the height of the tickmark at
515 % the location where the todo is inserted.
516 % An example of the option in use is shown here.
517 % \todo[tickmarkheight=0.1cm]{Test of option.}
518 % \begin{verbatim}
519 % \todo[tickmarkheight=0.1cm]{Test of option.}
520 % \end{verbatim}
521 %
522 %
523 % \DescribeMacro{line / noline}
524 % If you want to get rid of the line connecting the inserted note
525 % with the place in the text where the note occurs in the latex
526 % code, the option |noline| can be used.
527 % \todo[noline]{A note with no line connecting it to the placement
528 % in the original text.}
529 % |\todo[noline]{A note with no line ...}|
530 % \vspace{1.0cm}
531 %
532 %
533 % \DescribeMacro{inline / noinline}
534 % It is possible to place a todonote inside the text instead of
535 % placing it in the margin, this could be desirable if the text in
536 % the note has a considerable length.
537 % |\todo[inline]{A todonote placed in the text}|
538 % \todo[inline]{A todonote placed in the text}
539
540 % \begin{wrapfigure}[1]{r}[20mm]{40mm}
541 % \begin{tikzpicture}
542 % \draw[red] (0, 0) circle(0.45);
543 % \draw[green] (1, 0) circle(0.45);
544 % \draw[blue] (2, 0) circle(0.45);
545 % \end{tikzpicture}
546 % \caption{A text explaining the image.
547 % \todo[inline]{Fill those circles \ldots}}
548 % \end{wrapfigure}
549 % Another usage for the inline option is when you want to add a
550 % todonote to a figure caption.
551 %
552 % \begin{verbatim}
553 % \begin{wrapfigure}{r}[20mm]{40mm}
554 % \begin{tikzpicture}
555 % \draw[red] (0, 0) circle(0.45);
556 % \draw[green] (1, 0) circle(0.45);
557 % \draw[blue] (2, 0) circle(0.45);
558 % \end{tikzpicture}
559 % \caption{A text explaining the image.
560 % \todo[inline]{Fill those circles \ldots}}
561 % \end{wrapfigure}
562 % \end{verbatim}
563 %
564 % \DescribeMacro{size}
565 % |size=val| changes the size of the text inside the todonote.
566 % The commands used to create the notes below are \\ \noindent
567 % |\todo[size=\Large]{A note with a large font size.}|
568 % and \\ \noindent
569 % |\todo[inline, size=\tiny]{Note with very small font size.}|.
570 % \todo[size=\Large]{A note with a large font size.}
571 % \todo[inline, size=\footnotesize]{Note with very small font size.}
572 %
573 % \DescribeMacro{list / nolist}
574 % When the option |nolist| is given, the todo item will not appear in
575 % the list of todos.
576 %
577 % \DescribeMacro{caption}
578 % The |caption| option enables the user to specify a short
579 % description of the todonote that are inserted in the list of
580 % todos instead of the full todonote text.
581 % \todo[caption={Short note}]{A very long and tedious note that
582 % cannot be on one line in the list of todos.}
583 % \begin{verbatim}
584 % \todo[caption={Short note}]{A very long and tedious note that
585 % cannot be on one line in the list of todos.}.
586 % \end{verbatim}
587 % The effect of this option is altered with the package option
588 % |prependcaption| or the |prepend| / |noprepend| option for the
589 % todo command.
590 %
591 % \DescribeMacro{prepend / noprepend}
592 % The options |prepend| and |noprepend| can be used for setting
593 % whether a given caption should be prepended to the todonote or
594 % not.
595 % Globally this can be set using the |prependcaption| option for the
596 % package.~\todo[prepend, caption={Short note with prepend}]{A very
597 % long and tedious note that cannot be on one line in the list of
598 % todos.} Below is the effect of the option shown using the code:
599 % \todo[noprepend, caption={Short note with noprepend}]{A very long
600 % and tedious note that cannot be on one line in the list of
601 % todos.}
602 % \begin{verbatim}
603 % \todo[prepend, caption={Short note with prepend}]{A very long and tedious
604 % note that cannot be on one line in the list of todos.}.
605 % \todo[noprepend, caption={Short note with noprepend}]{A very long and
606 % tedious note that cannot be on one line in the list of todos.}.
607 % \end{verbatim}
608 %
609 % \DescribeMacro{fancyline}
610 % The |fancyline| option inserts a curved arrow, pointing from the inserted
611 % note to the insertion point.
612 % \todo[fancyline]{Testing.}
613 % The option is used like this:
614 % \begin{verbatim}
615 % \todo[fancyline]{Testing.}
616 % \end{verbatim}
617 %
618 %
619 % \DescribeMacro{author}
620 % The |author| option takes a parameter, the name of the author.
621 % The given name is inserted in the todonote.
622 % \todo[author=Xavier]{Testing author option.}
623 % \todo[author=Xavier, inline]{Testing author option.}
624 % \begin{verbatim}
625 % \todo[author=Xavier]{Testing author option.}
626 % \todo[author=Xavier, inline]{Testing author option.}
627 % \end{verbatim}
628 %
629 %
630 % \DescribeMacro{inlinewidth}
631 % The |inlinewidth| option makes it possible to alter the width
632 % of inline todos.
633 % \todo[inline, inlinewidth=5cm]{Testing the option inlinewidth.}
634 % \begin{verbatim}
635 % \todo[inline, inlinewidth=5cm]{Testing the option inlinewidth.}
636 % \end{verbatim}
637 %
638 %
639 % \DescribeMacro{inlinepar / noinlinepar}
640 % The options |inlinepar| and |noinlinepar| (default) determine whether the inserted inline
641 % todonote is sorrounded with \texttt{par} macros that enforce new lines
642 % prior to and after inserted inline todonotes.
643 % \todo[inline, inlinewidth=5cm, noinlinepar]{Testing the option inlinepar.}
644 % This is a line after the inserted todonote.
645 % \begin{verbatim}
646 % \todo[inline, inlinewidth=5cm, noinlinepar]{Testing the option inlinepar.}
647 % \end{verbatim}
648 %
649 %
650 % \subsection{Options for the missingfigure command}
651 %
652 % \DescribeMacro{figwidth}
653 % The |figwidth=length| option sets the width of the figure inserted by the
654 % |\missingfigure| command.
655 % Length values below $6cm$ might trigger some problems with the
656 % visual appearance.
657 % Try to compare the default of the missing figure command, when the
658 % option is given or not.
659 % \begin{verbatim}
660 % \missingfigure[figwidth=6cm]{Testing a long text string}
661 % \end{verbatim}
662 % \missingfigure[figwidth=6cm]{Testing a long text string}
663 % \begin{verbatim}
664 % \missingfigure{Testing a long text string}
665 % \end{verbatim}
666 % \missingfigure{Testing a long text string}
667 % \begin{wrapfigure}[1]{r}[2cm]{6cm}
668 % \missingfigure[figwidth=6cm]{Add an image \ldots}
669 % \end{wrapfigure}
670 % Another usage of the option is when |\missingfigure| is used in
671 % the wrapfigure environment.
672 % \begin{verbatim}
673 % \begin{wrapfigure}[1]{r}[2cm]{6cm}
674 % \missingfigure[figwidth=6cm]{Add an image \ldots}
675 % \end{wrapfigure}
676 % \end{verbatim}
677 % \vspace{2cm}
678 %
679 % \DescribeMacro{figheight}
680 % The |figheight=length| option changes the height of the inserted
681 % missing figure.
682 % The default height is 4cm and using values lower than this might
683 % cause the warning sign to pop out of the gray area.
684 % \begin{verbatim}
685 % \missingfigure[figheight=6cm]{Testing a long text string}
686 % \end{verbatim}
687 % \missingfigure[figheight=6cm]{Testing}
688 %
689 %
690 % \DescribeMacro{figcolor}
691 % The |figcolor=color| options sets the background color of
692 % inserted missing figures.
693 % The default color is |black!40|.
694 % \begin{verbatim}
695 % \missingfigure[figcolor=white]{Testing figcolor}
696 % \end{verbatim}
697 % \missingfigure[figcolor=white]{Testing figcolor}
698 %
699 %
700 % \subsection{Options for the listoftodos command}
701 % The |\listoftodos| command takes one optional argument, that
702 % defines the name of the inserted list of todos.
703 % \begin{verbatim}
704 % \listoftodos[I can be called anything]
705 % \end{verbatim}
706 %
707 %
708 %
709 % \subsection{Known issues}
710 % \subsubsection{Package loading order}
711 % The todonotes package requires the following packages.
712 % \begin{multicols}{2}
713 % \begin{itemize}
714 % \item ifthen
715 % \item xkeyval
716 % \item xcolor
717 % \item tikz
718 % \item calc
719 % \item graphicx (is loaded via the tikz package)
720 % \end{itemize}
721 % \end{multicols}
722 % \noindent
723 % When todonotes are loaded in the preamble, the package checks
724 % if these packages all are loaded. If that is not the case it loads
725 % the missing packages with no options given.
726 % If you want to give some specific options to some of these
727 % packages, you have to load them \emph{before} the todonotes
728 % package, otherwise you will get an ''Option clash'' error when
729 % latex works on the document.
730 %
731 % If both the menukeys and the xcolor (with the option \verb!table!)
732 % package should be loaded, the following order must be used.
733 % \begin{verbatim}
734 %\usepackage[table]{xcolor}
735 %\usepackage{todonotes}
736 %\usepackage{menukeys}
737 % \end{verbatim}
738 %
739 % The following packages must be loaded before the todonotes
740 % package:
741 % \begin{itemize}
742 % \item polyglossia
743 % \end{itemize}
744 %
745 %
746 % \subsubsection{Wrapping of long lines in list of todos}
747 % When a document is compiled with latex (and not pdflatex) long
748 % items in the list of todos are not wrapped into several lines, and
749 % do instead continue to the right out of the page.
750 %
751 %
752 % \subsubsection{Conflicts with the amsart documentclass}
753 % The |amsart| document class redefines some internal commands that
754 % is used by the todonotes package, this will cause an malfunctioning
755 % |\listoftodos| command.
756 % The following code to circumvent the problem was given by Dan
757 % Luecking on comp.text.tex
758 % \begin{verbatim}
759 % \makeatletter
760 % \providecommand\@dotsep{5}
761 % \makeatother
762 % \listoftodos\relax
763 % \end{verbatim}
764 %
765 % NOT TESTED
766 % NOT TESTED
767 % NOT TESTED
768 %
769 % Dominique suggests the following workaround.
770 % \begin{verbatim}
771 % \makeatletter
772 % \providecommand\@dotsep{5}
773 % \def\listtodoname{List of Todos}
774 % \def\listoftodos{\@starttoc{tdo}\listtodoname}
775 % \makeatother
776 % \end{verbatim}
777 %
778 %
779 %
780 % \subsubsection{Unknown option ''remember picture''}
781 % If latex throws the error
782 % \begin{verbatim}
783 % Package tikz Error: I do not know what to do with the option ``remember picture''.
784 % \end{verbatim}
785 % It probably means that your latex installation is outdated, as
786 % only newer versions of latex driver for tikz supports the
787 % |remember picture| option.
788 % For additional info consult
789 % ''Section 9.2.2 Producing PDF Output'' in the tikz manual.
790 % \url{http://www.ctan.org/tex-archive/graphics/pgf/base/doc/generic/pgf/pgfmanual.pdf}
791 %
792 %
793 % \subsubsection{Todonotes wrongly placed in the margin}
794 % When using some document classes or packages, the todonotes inserted in the
795 % page margin can be placed quite oddly.
796 % This is often caused by a wrong value of the |\marginparwidth| lenght.
797 % Try using the code below in your preamble to see if this cures the problem.
798 % \begin{verbatim}
799 % \setlength{\marginparwidth}{2cm}
800 % \end{verbatim}
801 %
802 % If the todonotes are inserted in the wrong margin, the solution is the
803 % |\reversemarginpar| command.
804 % When this command is issued the following marginpars (which todonotes
805 % relies on) is inserted in the other margin.
806 %
807 % \subsubsection{Reduce number of warnings}
808 % If the width of the inserted todonotes is forced to be larger than the
809 % available space in the margin, a lot of warnings are issued.
810 % This can be reduced with the following code.
811 % \begin{verbatim}
812 % \usepackage[textwidth=3.7cm]{todonotes}
813 % \setlength{\marginparwidth}{3.7cm}
814 % \end{verbatim}
815 %
816 %
817 % \subsubsection{Todonotes in footnotes}
818 % Placing todonotes in footnotes throws a lot of errors.
819 % However inline notes seems to work fine, as shown here
820 % \footnote{Note \todo[inline]{description}}:
821 % \begin{verbatim}
822 % \footnote{Note \todo[inline]{description}}
823 % \end{verbatim}
824 % Richard Stanton comes with the following work around.
825 % \begin{verbatim}
826 % \renewcommand{\marginpar}{\marginnote}
827 % \end{verbatim}
828 %
829 %
830 % \subsubsection{Trouble with classicthesis.sty}
831 % \href{http://tex.stackexchange.com/questions/33423/todonotes-produces-double-inline-notes-instead-of-single-margin-note-with-class}{Problem description on tex.stackexchange.com}.
832 %
833 % Solution by Stefan Kottwitz.
834 % The problem is caused by the redefinition of |\marginpar| in
835 % classicthesis.sty. |\marginpar| is used by todonotes.
836 % It can be fixed by restoring the original meaning, if you don't
837 % need the classicthesis marginpar style.
838 % Just add this to your document preamble:
839 % |\let\marginpar\oldmarginpar|
840 %
841 %
842 % \subsubsection{Todos in math and floating environments}
843 % It is not possible to insert todonotes into math environments or
844 % floating environments like \verb!figure! or \verb!table!.
845 % By replacing the marginpar command with a marginnote this
846 % can be enabled.
847 % For todos inside math environments the todo must be placed in an
848 % \verb!mbox! or \verb!\textrm! command.
849 %
850 % \begin{verbatim}
851 % \documentclass{article}
852 % \usepackage{todonotes}
853 % \usepackage{marginnote}
854 % \let\marginpar\marginnote
855 %
856 % \begin{document}
857 % \begin{equation}
858 % a^2=b^2+c^2 \textrm{\todo{Test}}
859 % \end{equation}
860 % \begin{figure}
861 % \centering
862 % \caption{Caption\todo{tests}.}
863 % \label{fig}
864 % \end{figure}
865 %
866 % \end{verbatim}
867 %
868 %
869 % \subsubsection{Conflict between marginpar and the standalone class}
870 %
871 % The \verb!standalone! document class is not compatible with the
872 % \verb!\marginpar! command, which is used in the todonotes package
873 % to insert contents in the side margins.
874 % A workaround is to replace the \verb!\marginpar! with \verb!\marginnote!.
875 % This is demonstrated here:
876 % \begin{verbatim}
877 % \documentclass[crop=false]{standalone}
878 % \usepackage{todonotes}
879 % \usepackage{marginnote}
880 % \let\marginpar\marginnote
881 % \begin{document}
882 % Lorem ipsum
883 % \todo{Bug}
884 % \end{document}
885 % \end{verbatim}
886 %
887 % \subsubsection{Issues with user-defined styles}
888 %
889 % Using an option defined using |\todostyle| will reset all predefined
890 % options to their defaults. For instance,
891 % |\todo[inline,newstyle]{Stuff}| will not be inline; however
892 % |\todo[newstyle,inline]{Stuff}| will be.
893 %
894 % |\todostyle| does not check if the name of the defined style is
895 % already one of the defined options, so, e.g.,
896 % |\todostyle{inline}{color=red}| will redefine the |inline| option
897 % to produce red marginal notes.
898 %
899 % \subsection{Things to improve}
900 % This is a list of things I consider to improve sometime in the
901 % future. It have not been done yet as I lack the time or skills to
902 % implement them.
903 % Patches with implementations of these tasks will be appreciated
904 % and might be included in the package if it will improve the
905 % package quality.
906 %
907 %
908 % \subsubsection{Owner information}
909 % Option for the todo command.
910 % \begin{verbatim}
911 % \todo[owner={Fabrice}]{Stuff}
912 % \end{verbatim}
913 % Add info on who ''owns'' the current todo.
914 % Idea: Fabrice Niessen
915 %
916 %
917 % \subsubsection{Due date}
918 % Option for the todo command.
919 % \begin{verbatim}
920 % \todo[due=2008-12-07]{Stuff}
921 % \end{verbatim}
922 % Add info on when the current todo is due.
923 % Might be enhanced by a time line of the todos that have a due date
924 % assigned.
925 % Idea: Fabrice Niessen
926 %
927 %
928 % \subsubsection{Mark accomplished todos}
929 % \begin{verbatim}
930 % \todo[done]{Stuff}
931 % \end{verbatim}
932 % Idea: Fabrice Niessen
933 %
934 %
935 %
936 %
937 %
938 % \subsection{Usage methods}
939 % In this section I have collected some different methods to use the
940 % |todonotes| package.
941 %
942 %
943 % \subsubsection{Define new commands with fixed options}
944 % Often there is a need for marking different classes of things to
945 % do (add reference, rewrite, \ldots).
946 % One way to do this, is to define some new commands as shown below
947 % (idea from Florent B.).
948 % \begin{verbatim}
949 % \newcommand{\addref}{\todo[color=red!40]{Add reference.}}
950 % \newcommand{\rewrite}[1]{\todo[color=green!40]{#1}}
951 % \end{verbatim}
952 % To distinguish between the different types of todos, the
953 % |todonotes| package can be loaded with the |colorinlistoftodos|
954 % option, which adds small colored squares to the list of todos.
955 % \begin{verbatim}
956 % \usepackage[colorinlistoftodos]{todonotes}
957 % \end{verbatim}
958 %
959 %
960 % \subsubsection{Define new commands with arbitrary default options}
961 % If you do not like the default values of the standard todo command,
962 % it is possible to define a new command with the similar
963 % functionality of |\todo| with custom default values.
964 % \begin{verbatim}
965 % \newcommand{\todoredefined}[2][]
966 % {\todo[color=red, #1]{#2}}\end{verbatim}
967 % \newcommand{\todoredefined}[2][]
968 % {\todo[color=red, #1]{#2}}
969 % The \todoredefined{Test of newly defined command.}
970 % new command can now be used like shown below
971 % \begin{verbatim}
972 % \todoredefined{Test of newly defined command.}
973 % \todoredefined[color=green]{Test of newly defined command, requesting a green color.} \end{verbatim}
974 % This \todoredefined[color=green]{Test of newly defined command, requesting a green color.}
975 % can be done with all the accepted options for the |\todo| command.
976 %
977 % If only available options to the |\todo| command are desired in the
978 % defined command, a similar effect can be achieved by defining a new style.
979 % For instance,
980 % \begin{verbatim}
981 % \todostyle{red}{color=red}
982 % \todo[red,inline]{A red to do}\end{verbatim}
983 % \todostyle{red}{color=red}%
984 % will produce a note like this:\todo[red,inline]{A todo with user-defined
985 % style \emph{red}}
986 %
987 %
988 % \subsubsection{Enumerate todonotes}
989 %
990 % If the inserted todonotes should be enumerated, it is possible to define
991 % a new command with the desired behaviour.
992 % \begin{verbatim}
993 % \newcounter{todocounter}
994 % \newcommand{\todonum}[2][]
995 % {\stepcounter{todocounter}\todo[#1]{\thetodocounter: #2}}
996 % \end{verbatim}
997 % \newcounter{todocounter}
998 % \newcommand{\todonum}[2][]
999 % {\stepcounter{todocounter}\todo[#1]{\thetodocounter: #2}}
1000 % The idea is to define a new counter |todocounter|, and insert the
1001 % \todonum{A numbered todonote.}
1002 % value of the counter in each todonote.
1003 % The new command can be used like
1004 % \todonum{Another numbered todonote.}
1005 % \begin{verbatim}
1006 % \todonum{A numbered todonote.}
1007 % \todonum{Another numbered todonote.}
1008 % \end{verbatim}
1009 %
1010 %
1011 %
1012 % \subsubsection{Comments ''a la Word''}
1013 %
1014 % Fabrice Niessen sent me the following use case.
1015 % The idea is to define a new command |\mycomment| which adds a
1016 % counter and optionally the initials of the author to the inserted
1017 % todonote.
1018 %
1019 % \begin{verbatim}
1020 % \newcounter{mycomment}
1021 % \newcommand{\mycomment}[2][]{%
1022 % % initials of the author (optional) + note in the margin
1023 % \refstepcounter{mycomment}%
1024 % {%
1025 % \setstretch{0.7}% spacing
1026 % \todo[color={red!100!green!33},size=\small]{%
1027 % \textbf{Comment [\uppercase{#1}\themycomment]:}~#2}%
1028 % }}
1029 % \end{verbatim}
1030 % \newcounter{mycomment}
1031 % \newcommand{\mycomment}[2][]{%
1032 % \refstepcounter{mycomment}%
1033 % {%
1034 % \setstretch{0.7}%
1035 % \todo[color={red!100!green!33},size=\small]{%
1036 % \textbf{Comment [\uppercase{#1}\themycomment]:}~#2}%
1037 % }}
1038 %
1039 % The command |\mycomment[HSM]{Testing first time.}| is displayed
1040 % \mycomment[HSM]{Testing first time.}%
1041 % like shown in the left margin, and another call of the command is
1042 % added below |\mycomment[HSM]{Testing second time.}|.
1043 % \mycomment[HSM]{Testing second time.}%
1044 %
1045 %
1046 %
1047 % \subsubsection{Combination with the fixme package}
1048 %
1049 % Thomas Arildsen has mailed me this use case. Check the
1050 % documentation for the |fixme| package, as the code below relies
1051 % directly on it (the |\FDUser| command is augmented when
1052 % |\begin{document}| is reached).
1053 % \begin{verbatim}
1054 % \usepackage[user,nomargin]{fixme}
1055 % \usepackage{todonotes}
1056 % \newcommand{\FXUser}[2]{\todo[inline,size=\small]{{\bfseries #1:} #2}}
1057 % \end{verbatim}
1058 %
1059 %
1060 %
1061 % \subsubsection{Altering the line spacing of todonotes}
1062 %
1063 % The |setspace| package lets you alter the line spacing of smaller
1064 % sections of your document. The primary construct is the
1065 % |spacing| environment, which is demonstrated below.
1066 % \begin{verbatim}
1067 % \begin{spacing}{0.5}
1068 % Some lines with a decreased line spacing. This is accomplished
1069 % using the setspace package that is included in standard latex
1070 % distributions.
1071 % \end{spacing}
1072 % \end{verbatim}
1073 % \begin{spacing}{0.5}
1074 % Some lines with a decreased line spacing. This is accomplished
1075 % using the setspace package that is included in standard latex
1076 % distributions.
1077 % \end{spacing}
1078 %
1079 % \vspace{0.25cm}
1080 % Using the |spacing| environment we can define a new todonote
1081 % command using the code below:
1082 % \begin{verbatim}
1083 % \newcommand{\smalltodo}[2][]
1084 % {\todo[caption={#2}, #1]
1085 % {\begin{spacing}{0.5}#2\end{spacing}}}
1086 % \end{verbatim}
1087 % \newcommand{\smalltodo}[2][]
1088 % {\todo[caption={#2}, #1]
1089 % {\begin{spacing}{0.5}#2\end{spacing}}}
1090 % Todonotes with decreased line spacing can now be inserted as
1091 % follows
1092 % \smalltodo[size=\footnotesize]{
1093 % Some lines with a decreased line spacing. This is accomplished
1094 % using the setspace package that is included in standard latex
1095 % distributions.}
1096 % \begin{verbatim}
1097 % \smalltodo[size=\footnotesize]{
1098 % Some lines with a decreased line spacing. This is accomplished
1099 % using the setspace package that is included in standard latex
1100 % distributions.}
1101 % \end{verbatim}
1102 %
1103 % \noindent
1104 % A different approach is given by Vitaly.
1105 % \newcommand{\tinytodo}[2][]
1106 % {\todo[caption={#2}, size=\small, #1]{\renewcommand{\baselinestretch}{0.5}\selectfont#2\par}}
1107 % \begin{verbatim}
1108 % \newcommand{\tinytodo}[2][]
1109 % {\todo[caption={#2}, size=\small, #1]{\renewcommand{\baselinestretch}{0.5}\selectfont#2\par}}
1110 % \end{verbatim}
1111 % It looks like seen here.
1112 % \tinytodo{
1113 % Some lines with a decreased line spacing. This is accomplished
1114 % without using any special packages.}
1115 % \begin{verbatim}
1116 % \tinytodo{
1117 % Some lines with a decreased line spacing. This is accomplished
1118 % without using any special packages.}
1119 % \end{verbatim}
1120 %
1121 %
1122 %
1123 %
1124 % \subsubsection{Marking new / old sections}
1125 % Sometimes a whole section has to be marked by some means. You
1126 % might want to try the following.
1127 % \begin{verbatim}
1128 % \todo[inline, caption={Some text}]{
1129 % \begin{minipage}{\linewidth}
1130 % Some text that might differ from the text given to the caption
1131 % option.
1132 % \end{minipage}
1133 % }
1134 % \end{verbatim}
1135 % It is important to add the |caption={text}| option, otherwise
1136 % latex will try to embed a minipage in the table of contents which
1137 % triggers an error.
1138 % Inside the minipage environment almost anything could be placed,
1139 % except for other todo commands.
1140 %
1141 % To streamline use the following command was suggested by Stefan Pinnow.
1142 % \newcommand\todoin[2][]{\todo[inline, caption={2do}, #1]{
1143 % \begin{minipage}{\textwidth-4pt}#2\end{minipage}}}
1144 % \begin{verbatim}
1145 % \newcommand\todoin[2][]{\todo[inline, caption={2do}, #1]{
1146 % \begin{minipage}{\textwidth-4pt}#2\end{minipage}}}
1147 % \end{verbatim}
1148 % This example renders like
1149 % \begin{verbatim}
1150 % \todoin{
1151 % Some text.
1152 % \begin{align}
1153 % \sin(\theta)^2 + \cos(\theta)^2 = 1
1154 % \end{align}
1155 % A formula and a list
1156 % \begin{itemize}
1157 % \item An item
1158 % \end{itemize}
1159 % }
1160 % \end{verbatim}
1161 %
1162 % \todoin{
1163 % Some text.
1164 % \begin{align}
1165 % \sin(\theta)^2 + \cos(\theta)^2 = 1
1166 % \end{align}
1167 % A formula and a list
1168 % \begin{itemize}
1169 % \item An item
1170 % \end{itemize}
1171 % }
1172 %
1173 %
1174 %
1175 % \subsubsection{Link to list of todos}
1176 %
1177 % Using the |hyperref| package it is possible to add a link from
1178 % the inserted todonotes to the list of todos.
1179 % The example were supplied by Andreas Plank.
1180 % \begin{verbatim}
1181 % % Define a counter for the inserted todonotes.
1182 % \newcounter{todoListItems}
1183 % \newcommand{\todoTrans}[2][ ]{
1184 % % Increment counter
1185 % \addtocounter{todoListItems}{1}
1186 % \todo[%
1187 % caption={\protect\hypertarget{todo\thetodoListItems}{}Translation},
1188 % #1]
1189 % {
1190 % #2 \hfill
1191 % \hyperlink{todo\thetodoListItems}{$\uparrow$}
1192 % }
1193 % }
1194 % \end{verbatim}
1195 %
1196 % \newcounter{todoListItems}
1197 % \newcommand{\todoTrans}[2][ ]{
1198 % \addtocounter{todoListItems}{1}
1199 % \todo[
1200 % caption={\protect\hypertarget{todo\thetodoListItems}{}Translation},
1201 % #1]{
1202 % #2 \hfill
1203 % \hyperlink{todo\thetodoListItems}{$\uparrow$}
1204 % }
1205 % }
1206 %
1207 % The idea behind the code is to embed a |hypertarget| in each entry
1208 % in the list of todos. In the todonotes a link to the entry in the
1209 % list of todos is inserted as an arrow that points upwards.
1210 % Using the |\todoTrans| command like below, the following two notes
1211 % have been inserted.
1212 % \begin{verbatim}
1213 % \todoTrans{papirsflyver}
1214 % \todoTrans[inline]{damplokomotiv}
1215 % \end{verbatim}
1216 % \todoTrans{papirsflyver}
1217 % \todoTrans[inline]{damplokomotiv}
1218 %
1219 %
1220 % \subsubsection{Numbered todonotes}
1221 %
1222 % The inserted todonotes can be argumented with the current subsubsection number.
1223 % The code is shown below.
1224 % \newcommand{\ntodo}[2][]{\todo[#1]{\thesubsubsection{}. #2}}
1225 % \begin{verbatim}
1226 % \newcommand{\ntodo}[2][]{\todo[#1]{\thesubsubsection{}. #2}}
1227 % \end{verbatim}
1228 % By changing |\thesubsubsection| to |\thesection|, the current section number
1229 % can be inserted instead of the subsubsection number.
1230 % The result looks \ntodo{A numbered todo.} like.
1231 % Which were generated by the code
1232 % \begin{verbatim}
1233 % \ntodo{A subsection numbered todo.}.
1234 % \end{verbatim}
1235 %
1236 %
1237 % \subsubsection{Combining several modifications}
1238 %
1239 % \newcommand{\sstodo}[2][]
1240 % {\addtocounter{todoListItems}{1}
1241 % \todo[caption={\protect\hypertarget{todo\thetodoListItems}{}\thesection. #2}, #1]
1242 % {\begin{spacing}{1} \hfill \hyperlink{todo\thetodoListItems}{#2} \end{spacing} }}
1243 %
1244 % Manduca have combined several of the modifications above into a highly specialized
1245 % todo command.
1246 % \sstodo{Small notes with links back to the list of todos.}
1247 % She uses the code:
1248 % \sstodo{Smart notes with links back to the list of todos.}
1249 %
1250 % \begin{verbatim}
1251 % \newcounter{todoListItems}
1252 % \newcommand{\sstodo}[2][]
1253 % {\addtocounter{todoListItems}{1}
1254 % \todo[caption={\protect\hypertarget{todo\thetodoListItems}{}\thesection. #2}, #1]
1255 % {\begin{spacing}{1} \hfill \hyperlink{todo\thetodoListItems}{#2} \end{spacing} }}
1256 % \end{verbatim}
1257 %
1258 % Using this approach it is possible to customize the behavior of the inserted notes
1259 % to a very high degree.
1260 %
1261 %
1262 % \subsubsection{Alter the appearance of the list of todos}
1263 % Marco Daniel gives the following example of how to add section
1264 % numbers to the elements in the list of todos.
1265 % The code is slightly modified from
1266 % \url{http://tex.stackexchange.com/questions/18838/replacing-page-number-with-other-counter-in-listoftodos}.
1267 % An example of the modified list of todos is shown below, the complete
1268 % code example is given in the example directory.\\
1269 % \noindent
1270 % \begin{tikzpicture}
1271 % \draw node[shape=rectangle, fill=black!30, inner sep=1mm]{\includegraphics[width=\linewidth-2mm]{img/AlteredAppearenceOfListOfTodos.png}};
1272 % \end{tikzpicture}
1273 %
1274 %
1275 % \subsubsection{Tikz externalization issues}
1276 %
1277 % Using the tikz externalization framework together with todonotes
1278 % can lead to some problems.
1279 % One solution is to disable the externalization just before the \verb!todo!
1280 % command is issued and then reactivate externalization afterwards.
1281 % The \verb!ruggedtodo! handles this deactivation and reactivation.
1282 % \begin{verbatim}
1283 % \usetikzlibrary{external}
1284 % \tikzexternalize
1285 % \newcommand{\ruggedtodo}[2][]{\tikzexternaldisable\todo[#1]{#2}\tikzexternalenable}
1286 % \end{verbatim}
1287 %
1288 %
1289 % \subsubsection{Highligt text to fix}
1290 % Tobias Winchen provides the following example on how to highlight
1291 % text related to the inserted todonote.
1292 % \makeatletter
1293 % \if@todonotes@disabled
1294 % \newcommand{\hlfix}[2]{#1}
1295 % \else
1296 % \newcommand{\hlfix}[2]{\texthl{#1}\todo{#2}}
1297 % \fi
1298 % \makeatother
1299 % Example \hlfix{wrong text}{fix text}~continues here.
1300 % Notice that the code relies on the \verb!soul! package.
1301 % \begin{verbatim}
1302 % \makeatletter
1303 % \if@todonotes@disabled
1304 % \newcommand{\hlfix}[2]{#1}
1305 % \else
1306 % \newcommand{\hlfix}[2]{\texthl{#1}\todo{#2}}
1307 % \fi
1308 % \makeatother
1309 % Example \hlfix{wrong text}{fix text}~continues here.
1310 % \end{verbatim}
1311 %
1312 %
1313 % \subsubsection{Adding color coded levels of todos}
1314 %
1315 % Sometimes it can be beneficial to be able to distinguish
1316 % between different types of todos.
1317 % For this I would suggest the following approach:
1318 % \begin{verbatim}
1319 % \newcommand{\todoerror}[2][]{\todo[color=red!70, #1]{#2}}
1320 % \newcommand{\todowarn}[2][]{\todo[color=orange, #1]{#2}}
1321 % \newcommand{\todoremark}[2][]{\todo[color=yellow!80!black, #1]{#2}}
1322 % \newcommand{\todohint}[2][]{\todo[color=green!20, #1]{#2}}
1323 % \newcommand{\tododone}[2][]{\todo[color=blue!50, #1]{#2}}
1324 %
1325 % \todoerror[inline]{Testing}
1326 % \todoremark{Testing}
1327 % \todowarn[inline]{Testing}
1328 % \todohint{Testing}
1329 % \tododone[disable]{Testing}
1330 % \end{verbatim}
1331 %
1332 % \newcommand{\todoerror}[2][]{\todo[color=red!70, #1]{#2}}
1333 % \newcommand{\todowarn}[2][]{\todo[color=orange, #1]{#2}}
1334 % \newcommand{\todoremark}[2][]{\todo[color=yellow!80!black, #1]{#2}}
1335 % \newcommand{\todohint}[2][]{\todo[color=green!20, #1]{#2}}
1336 % \newcommand{\tododone}[2][]{\todo[color=blue!50, #1]{#2}}
1337 %
1338 % \todoerror[inline]{Testing}
1339 % \todoremark{Testing}
1340 % \todowarn[inline]{Testing}
1341 % \todohint{Testing}
1342 % \tododone[disable]{Testing}
1343 %
1344 %
1345 % \subsubsection{Notes in both left and right margin}
1346 %
1347 % If you want to add many todonotes in your document, it can be beneficial to
1348 % use both the left and right margins for the inserted notes.
1349 % This can be achieved by defining a helper function the following way.
1350 % The main drawback is that notes inserted using the \verb!marginnote!
1351 % command does not float and thus they can get to overlap.
1352 % This idea was suggested by
1353 % \href{https://github.com/henrikmidtiby/todonotes/issues/56}{FranzAtGithub}.
1354 %
1355 % \begin{verbatim}
1356 % \usepackage{marginnote}
1357 % \usepackage{etoolbox}
1358 %
1359 % \newtoggle{lmargin}
1360 % \newcommand{\alternatingtodo}[2][]{%
1361 % \iftoggle{lmargin}%
1362 % {%
1363 % \todo[#1]{#2}
1364 % \togglefalse{lmargin}
1365 % }{%
1366 % {%
1367 % \let\marginpar\marginnote%
1368 % \reversemarginpar%
1369 % \todo[#1]{#2}%
1370 % }%
1371 % \toggletrue{lmargin}%
1372 % }%
1373 % }%
1374 % \end{verbatim}
1375 %
1376 %
1377 %
1378 % \iffalse
1379 % \StopEventually{\PrintChanges\PrintIndex}
1380 % \fi
1381 % \StopEventually{\PrintChanges}
1382 %
1383 % \newpage
1384 % \section{Implementation}
1385 %
1386 % Identifies the package and loads the packages dependences.
1387 % \begin{macrocode}
1388 \ProvidesPackage{todonotes}[2024/01/05]
1389 \RequirePackage{ifthen}
1390 \RequirePackage{xkeyval}
1391 \RequirePackage{xcolor}
1392 \RequirePackage{tikz}
1393 \usetikzlibrary{positioning}
1394 \RequirePackage{calc}
1395 % \end{macrocode}
1396 % Implement a function for setting up the todonotes package.
1397 % \begin{macrocode}
1398 \newcommand\setuptodonotes[1]{\presetkeys{todonotes}{#1}{}}
1399 % \end{macrocode}
1400 % Some default values are set
1401 % \begin{macrocode}
1402 \newcommand{\@todonotes@text}{}%
1403 \newcommand{\@todonotes@backgroundcolor}{orange}
1404 \newcommand{\@todonotes@textcolor}{black}
1405 \newcommand{\@todonotes@linecolor}{orange}
1406 \newcommand{\@todonotes@bordercolor}{black}
1407 \newcommand{\@todonotes@tickmarkheight}{unused value}
1408 \newcommand{\@todonotes@textwidth}{\marginparwidth}
1409 \newcommand{\@todonotes@textsize}{\normalsize}
1410 \newcommand{\@todonotes@figwidth}{\linewidth}
1411 \newcommand{\@todonotes@figheight}{4cm}
1412 \newcommand{\@todonotes@figcolor}{black!40}
1413 % \end{macrocode}
1414 % \begin{macrocode}
1415 \AtBeginDocument{
1416 \ifx\undefined\phantomsection
1417 \newcommand{\phantomsection}{}
1418 \fi
1419 \ifdim \marginparwidth < 2cm
1420 \PackageWarning{todonotes}{The length marginparwidth is
1421 less than 2cm and will most likely cause issues with the
1422 appearance of inserted todonotes.
1423 The issue can be solved by adding a line like
1424 \setlength{\marginparwidth}{2cm}
1425 prior to loading the todonotes package.} \else\fi%
1426 }
1427 % \end{macrocode}
1428 %
1429 % \subsection{Declaration of options for the package}
1430 % In this part the various options for
1431 % the package are defined.
1432
1433 % Define the default text strings and set localization options for
1434 % the danish and german languages.
1435 % \begin{macrocode}
1436 \newcommand{\@todonotes@todolistname}{Todo list}
1437 \newcommand{\@todonotes@MissingFigureText}{Figure}
1438 \newcommand{\@todonotes@MissingFigureUp}{Missing}
1439 \newcommand{\@todonotes@MissingFigureDown}{figure}
1440 \newcommand{\@todonotes@SetTodoListName}[1]
1441 {\renewcommand{\@todonotes@todolistname}{#1}}
1442 \newcommand{\@todonotes@SetMissingFigureText}[1]
1443 {\renewcommand{\@todonotes@MissingFigureText}{#1}}
1444 \newcommand{\@todonotes@SetMissingFigureUp}[1]
1445 {\renewcommand{\@todonotes@MissingFigureUp}{#1}}
1446 \newcommand{\@todonotes@SetMissingFigureDown}[1]
1447 {\renewcommand{\@todonotes@MissingFigureDown}{#1}}
1448 \newif{\if@todonotes@reverseMissingFigureTriangle}
1449 \DeclareOptionX{catalan}{
1450 \@todonotes@SetTodoListName{Llista de feines pendents}%
1451 \@todonotes@SetMissingFigureText{Figura}%
1452 \@todonotes@SetMissingFigureUp{Figura}%
1453 \@todonotes@SetMissingFigureDown{pendent}%
1454 }
1455 \DeclareOptionX{croatian}{%
1456 \@todonotes@SetTodoListName{Popis obveza}%
1457 \@todonotes@SetMissingFigureText{Slika}%
1458 \@todonotes@SetMissingFigureUp{Nedostaje}%
1459 \@todonotes@SetMissingFigureDown{slika}%
1460 }
1461 \DeclareOptionX{danish}{%
1462 \@todonotes@SetTodoListName{G\o{}rem\aa{}lsliste}%
1463 \@todonotes@SetMissingFigureText{Figur}%
1464 \@todonotes@SetMissingFigureUp{Manglende}%
1465 \@todonotes@SetMissingFigureDown{figur}%
1466 }
1467 \DeclareOptionX{dutch}{%
1468 \@todonotes@SetTodoListName{Lijst van onafgewerkte taken}%
1469 \@todonotes@SetMissingFigureText{Figuur}%
1470 \@todonotes@SetMissingFigureUp{Ontbrekende}%
1471 \@todonotes@SetMissingFigureDown{figuur}%
1472 }
1473 \DeclareOptionX{english}{%
1474 \@todonotes@SetTodoListName{Todo list}%
1475 \@todonotes@SetMissingFigureText{Figure}%
1476 \@todonotes@SetMissingFigureUp{Missing}%
1477 \@todonotes@SetMissingFigureDown{figure}%
1478 }
1479 \DeclareOptionX{french}{%
1480 \@todonotes@SetTodoListName{Liste des points \`a traiter}%
1481 \@todonotes@SetMissingFigureText{Figure}%
1482 \@todonotes@SetMissingFigureUp{Figure}%
1483 \@todonotes@SetMissingFigureDown{manquante}%
1484 \@todonotes@reverseMissingFigureTrianglefalse
1485 }
1486 \DeclareOptionX{german}{%
1487 \@todonotes@SetTodoListName{Liste der noch zu erledigenden Punkte}%
1488 \@todonotes@SetMissingFigureText{Abbildung}%
1489 \@todonotes@SetMissingFigureUp{Fehlende}%
1490 \@todonotes@SetMissingFigureDown{Abbildung}%
1491 }
1492 \DeclareOptionX{italian}{
1493 \@todonotes@SetTodoListName{Elenco delle cose da fare}%
1494 \@todonotes@SetMissingFigureText{Figura}%
1495 \@todonotes@SetMissingFigureUp{Figura}%
1496 \@todonotes@SetMissingFigureDown{mancante}%
1497 }
1498 \DeclareOptionX{ngerman}{%
1499 \@todonotes@SetTodoListName{Liste der noch zu erledigenden Punkte}%
1500 \@todonotes@SetMissingFigureText{Abbildung}%
1501 \@todonotes@SetMissingFigureUp{Fehlende}%
1502 \@todonotes@SetMissingFigureDown{Abbildung}%
1503 }
1504 \DeclareOptionX{portuguese}{
1505 \@todonotes@SetTodoListName{Lista de tarefas pendentes}%
1506 \@todonotes@SetMissingFigureText{Figura}%
1507 \@todonotes@SetMissingFigureUp{Figura}%
1508 \@todonotes@SetMissingFigureDown{pendente}%
1509 }
1510 \DeclareOptionX{spanish}{
1511 \@todonotes@SetTodoListName{Lista de tareas pendientes}%
1512 \@todonotes@SetMissingFigureText{Figura}%
1513 \@todonotes@SetMissingFigureUp{Figura}%
1514 \@todonotes@SetMissingFigureDown{pendiente}%
1515 }
1516 \DeclareOptionX{swedish}{%
1517 \@todonotes@SetTodoListName{Att g\"{o}ra-lista}%
1518 \@todonotes@SetMissingFigureText{Figur}%
1519 \@todonotes@SetMissingFigureUp{Figur}%
1520 \@todonotes@SetMissingFigureDown{saknas}%
1521 }
1522 % \end{macrocode}
1523 % Define parameters for the list of todo if they are not defined by
1524 % the current document class.
1525 % \begin{macrocode}
1526 \providecommand{\@tocrmarg}{2.55em}
1527 \providecommand{\@dotsep}{4.5}
1528 \providecommand{\@pnumwidth}{1.55em}
1529 % \end{macrocode}
1530 % Create a counter, for storing the number of inserted todos.
1531 % \begin{macrocode}
1532 \newcounter{@todonotes@numberoftodonotes}
1533 % \end{macrocode}
1534 %
1535 % Toggle whether the package should obey the global draft option.
1536 % \begin{macrocode}
1537 \newif{\if@todonotes@obeyDraft}
1538 \DeclareOptionX{obeyDraft}{\@todonotes@obeyDrafttrue}
1539 \newif{\if@todonotes@isDraft}
1540 \DeclareOptionX{draft}{\@todonotes@isDrafttrue}
1541 \DeclareOptionX{draftcls}{\@todonotes@isDrafttrue}
1542 \DeclareOptionX{draftclsnofoot}{\@todonotes@isDrafttrue}
1543 \newif{\if@todonotes@obeyFinal}
1544 \DeclareOptionX{obeyFinal}{\@todonotes@obeyFinaltrue}
1545 \newif{\if@todonotes@isFinal}
1546 \DeclareOptionX{final}{\@todonotes@isFinaltrue}
1547 % \end{macrocode}
1548 % Make it possible to disable the functionality
1549 % of the package. If this option is given, the
1550 % commands |\todo{}| and |\listoftodos| are defined
1551 % as commands with no effect. (But you can still
1552 % compile you document with these commands).
1553 % \begin{macrocode}
1554 \newif{\if@todonotes@disabled}
1555 \DeclareOptionX{disable}{\@todonotes@disabledtrue}
1556 % \end{macrocode}
1557 % Show small boxes in the list of todos with the color of the
1558 % inserted todonotes.
1559 % \begin{macrocode}
1560 \newif{\if@todonotes@colorinlistoftodos}
1561 \DeclareOptionX{colorinlistoftodos}{\@todonotes@colorinlistoftodostrue}
1562 % \end{macrocode}
1563 % The default style behaves bad when compiled
1564 % with latex (some text placement problems).
1565 % The dvistyle option, changes the visual behavior
1566 % to avoid this text placement problem.
1567 % \begin{macrocode}
1568 \newif{\if@todonotes@dviStyle}
1569 \DeclareOptionX{dvistyle}{\@todonotes@dviStyletrue}
1570 % \end{macrocode}
1571 % Create a color option.
1572 % \begin{macrocode}
1573 \define@key{todonotes.sty}%
1574 {color}{
1575 \renewcommand{\@todonotes@backgroundcolor}{#1}
1576 \renewcommand{\@todonotes@linecolor}{#1}}
1577 % \end{macrocode}
1578 % Make the background color of the notes as
1579 % an option.
1580 % \begin{macrocode}
1581 \define@key{todonotes.sty}%
1582 {backgroundcolor}{\renewcommand{\@todonotes@backgroundcolor}{#1}}
1583 % \end{macrocode}
1584 % Make the text color of the notes as
1585 % an option.
1586 % \begin{macrocode}
1587 \define@key{todonotes.sty}%
1588 {textcolor}{\renewcommand{\@todonotes@textcolor}{#1}}
1589 % \end{macrocode}
1590 % Make the line color of the notes as
1591 % an option.
1592 % \begin{macrocode}
1593 \define@key{todonotes.sty}%
1594 {linecolor}{\renewcommand{\@todonotes@linecolor}{#1}}
1595 % \end{macrocode}
1596 % Make the color of the notes box color as
1597 % an option.
1598 % \begin{macrocode}
1599 \define@key{todonotes.sty}%
1600 {bordercolor}{\renewcommand{\@todonotes@bordercolor}{#1}}
1601 % \end{macrocode}
1602 % Make the height of the line start marking as
1603 % an option.
1604 % \begin{macrocode}
1605 \newcommand{\@todonotes@defaulttickmarkheight}{0cm}
1606 \define@key{todonotes.sty}{tickmarkheight}{%
1607 \renewcommand{\@todonotes@defaulttickmarkheight}{#1}}%
1608 % \end{macrocode}
1609 % Set whether short captions given as arguments to the todo command
1610 % should be included in the inserted todonote.
1611 % \begin{macrocode}
1612 \newif{\if@todonotes@prependcaptionglobal}
1613 \@todonotes@prependcaptionglobalfalse
1614 \DeclareOptionX{prependcaption}{\@todonotes@prependcaptionglobaltrue}
1615 % \end{macrocode}
1616 % Make the text width as an option.
1617 % \begin{macrocode}
1618 \define@key{todonotes.sty}%
1619 {textwidth}{\renewcommand{\@todonotes@textwidth}{#1}}
1620 % \end{macrocode}
1621 % Make the formatting of a note an option.
1622 % Notes are formatted using |\todoformat|, which by default does
1623 % nothing.
1624 % If the option |format=cmd| is given, notes are formatted using
1625 % |\cmd| instead.
1626 % Default formatting can also be changed by redefining |\todoformat|.
1627 % \begin{macrocode}
1628 \newcommand{\todoformat}[1]{#1}
1629 \define@key{todonotes.sty}%
1630 {format}{\renewcommand{\todoformat}{\@nameuse{#1}}}
1631 % \end{macrocode}
1632 % Make the text size as an option, accept both |size| and |textsize|.
1633 % \begin{macrocode}
1634 \define@key{todonotes.sty}%
1635 {textsize}{\renewcommand{\@todonotes@textsize}{#1}}
1636 \define@key{todonotes.sty}%
1637 {size}{\renewcommand{\@todonotes@textsize}{#1}}
1638 % \end{macrocode}
1639 % Add option for shadows behind the inserted notes
1640 % \begin{macrocode}
1641 \newif\if@todonotes@shadowlibraryloaded
1642 \@todonotes@shadowlibraryloadedfalse
1643 \DeclareOptionX{loadshadowlibrary}{%
1644 \usetikzlibrary{shadows}%
1645 \@todonotes@shadowlibraryloadedtrue}
1646 \newcommand{\@todonotes@shadowenabledbydefault}{noshadow}
1647 \DeclareOptionX{shadow}{%
1648 \renewcommand{\@todonotes@shadowenabledbydefault}{shadow}}
1649 % \end{macrocode}
1650 % Add option for the default width of the figure inserted with
1651 % |\missingfigure|.
1652 % \begin{macrocode}
1653 \define@key{todonotes.sty}%
1654 {figwidth}{\renewcommand{\@todonotes@figwidth}{#1}}
1655 \define@key{todonotes.sty}%
1656 {figheight}{\renewcommand{\@todonotes@figheight}{#1}}
1657 \define@key{todonotes.sty}%
1658 {figcolor}{\renewcommand{\@todonotes@figcolor}{#1}}
1659 % \end{macrocode}
1660 % Make the text width as an option.
1661 % \begin{macrocode}
1662 % Finally process the given options.
1663 % \begin{macrocode}
1664 \ProcessOptionsX*
1665 % \end{macrocode}
1666 % If the |obeyDraft| is given, check whether one of the |draft|,
1667 % |draftcls| or |draftclsnofoot|
1668 % options are given and enable or disable the functionality of this
1669 % package.
1670 % If the |obeyFinal| option is given together with the |final| option
1671 % the todonotes are disabled.
1672 % The |disable| option will overrule the effect of |obeyDraft|.
1673 % \begin{macrocode}
1674 \if@todonotes@disabled
1675 \else
1676 \if@todonotes@obeyDraft
1677 \@todonotes@disabledtrue
1678 \if@todonotes@isDraft
1679 \@todonotes@disabledfalse
1680 \fi
1681 \fi
1682 \if@todonotes@obeyFinal
1683 \@todonotes@disabledfalse
1684 \if@todonotes@isFinal
1685 \@todonotes@disabledtrue
1686 \fi
1687 \fi
1688 \fi
1689 % \end{macrocode}
1690
1691 % \subsection{Options for the todo command}
1692 %
1693 % In this part the various options for
1694 % commands in the package are defined.
1695 % Set an arbitrarily fill color
1696 % \begin{macrocode}
1697 \gdef\@todonotes@currentlinecolor{\@todonotes@linecolor}%
1698 \gdef\@todonotes@currentbackgroundcolor{\@todonotes@backgroundcolor}%
1699 \gdef\@todonotes@currenttextcolor{\@todonotes@textcolor}%
1700 \gdef\@todonotes@currentbordercolor{\@todonotes@bordercolor}%
1701 \define@key{todonotes}{color}{%
1702 \gdef\@todonotes@currentlinecolor{#1}%
1703 \gdef\@todonotes@currentbackgroundcolor{#1}}%
1704 \define@key{todonotes}{linecolor}{%
1705 \gdef\@todonotes@currentlinecolor{#1}}%
1706 \define@key{todonotes}{backgroundcolor}{%
1707 \gdef\@todonotes@currentbackgroundcolor{#1}}%
1708 \define@key{todonotes}{textcolor}{%
1709 \gdef\@todonotes@currenttextcolor{#1}}%
1710 \define@key{todonotes}{bordercolor}{%
1711 \gdef\@todonotes@currentbordercolor{#1}}%
1712 % \end{macrocode}
1713 % Toggle whether there is a shadow behind the inserted notes.
1714 % \begin{macrocode}
1715 \newif\if@todonotes@useshadow%
1716 \define@key{todonotes}{shadow}[]{\@todonotes@useshadowtrue}%
1717 \define@key{todonotes}{noshadow}[]{\@todonotes@useshadowfalse}%
1718 % \end{macrocode}
1719 % Define height of the inserted tickmark.
1720 % \begin{macrocode}
1721 \define@key{todonotes}{tickmarkheight}{%
1722 \renewcommand{\@todonotes@tickmarkheight}{#1}}%
1723 % \end{macrocode}
1724 % Make formatting of notes a per-note option as well, by redefining
1725 % the internal |\@todonotes@format| command, which is then used in
1726 % formatting the actual note.
1727 % \begin{macrocode}
1728 \newcommand{\@todonotes@format}{\todoformat}%
1729 \define@key{todonotes}{format}{%
1730 \renewcommand{\@todonotes@format}{\@nameuse{#1}}}%
1731 % \end{macrocode}
1732 % Set a relative font size
1733 % \begin{macrocode}
1734 \newcommand{\@todonotes@sizecommand}{}%
1735 \define@key{todonotes}{size}{\renewcommand{\@todonotes@sizecommand}{#1}%
1736 }%
1737 % \end{macrocode}
1738 % Should the todo item be disabled?
1739 % \begin{macrocode}
1740 \newif\if@todonotes@localdisable%
1741 \define@key{todonotes}{disable}[]{\@todonotes@localdisabletrue}%
1742 \define@key{todonotes}{nodisable}[]{\@todonotes@localdisablefalse}%
1743 % \end{macrocode}
1744 % Should the todo item be included in the list of todos?
1745 % \begin{macrocode}
1746 \newif\if@todonotes@appendtolistoftodos%
1747 \define@key{todonotes}{list}[]{\@todonotes@appendtolistoftodostrue}%
1748 \define@key{todonotes}{nolist}[]{\@todonotes@appendtolistoftodosfalse}%
1749 % \end{macrocode}
1750 % Should the todo item be displayed inline?
1751 % \begin{macrocode}
1752 \newif\if@todonotes@inlinenote%
1753 \define@key{todonotes}{inline}[]{\@todonotes@inlinenotetrue}%
1754 \define@key{todonotes}{noinline}[]{\@todonotes@inlinenotefalse}%
1755 % \end{macrocode}
1756 % \begin{macrocode}
1757 \newif\if@todonotes@prependcaption%
1758 \define@key{todonotes}{prepend}[]{\@todonotes@prependcaptiontrue}%
1759 \define@key{todonotes}{noprepend}[]{\@todonotes@prependcaptionfalse}%
1760 % \end{macrocode}
1761 % Should the note in the margin be connected to the insertion point
1762 % in the text?
1763 % \begin{macrocode}
1764 \newif\if@todonotes@line%
1765 \define@key{todonotes}{line}[]{\@todonotes@linetrue}%
1766 \define@key{todonotes}{noline}[]{\@todonotes@linefalse}%
1767 % \end{macrocode}
1768 % Should the connection between note and insertion point be drawn
1769 % in a fancy way? (does only work if line=true)
1770 % \begin{macrocode}
1771 \newif\if@todonotes@fancyline\@todonotes@fancylinefalse%
1772 \define@key{todonotes}{fancyline}[]{\@todonotes@fancylinetrue}%
1773 \define@key{todonotes}{nofancyline}[]{\@todonotes@fancylinefalse}%
1774 % \end{macrocode}
1775 % Author option.
1776 % \begin{macrocode}
1777 \newcommand{\@todonotes@author}{}%
1778 \newif\if@todonotes@authorgiven%
1779 \define@key{todonotes}{author}{%
1780 \renewcommand{\@todonotes@author}{#1}%
1781 \@todonotes@authorgiventrue}%
1782 \define@key{todonotes}{noauthor}[]{\@todonotes@authorgivenfalse}%
1783 % \end{macrocode}
1784 % Should the text in the list of todos be different from the text
1785 % in the todonote?
1786 % \begin{macrocode}
1787 \newcommand{\@todonotes@caption}{}%
1788 \newif\if@todonotes@captiongiven%
1789 \define@key{todonotes}{caption}%
1790 {\renewcommand{\@todonotes@caption}{#1}%
1791 \@todonotes@captiongiventrue}%
1792 \define@key{todonotes}{nocaption}[]{\@todonotes@captiongivenfalse}%
1793 % \end{macrocode}
1794 % Change the current figure width and height.
1795 % \begin{macrocode}
1796 \newcommand{\@todonotes@currentfigwidth}{\@todonotes@figwidth}
1797 \define@key{todonotes}%
1798 {figwidth}{\renewcommand{\@todonotes@currentfigwidth}{#1-2pt}}
1799 \newcommand{\@todonotes@currentfigheight}{\@todonotes@figheight}
1800 \define@key{todonotes}%
1801 {figheight}{\renewcommand{\@todonotes@currentfigheight}{#1-2pt}}
1802 \newcommand{\@todonotes@currentfigcolor}{\@todonotes@figcolor}
1803 \define@key{todonotes}%
1804 {figcolor}{\renewcommand{\@todonotes@currentfigcolor}{#1}}
1805 % \end{macrocode}
1806 % Change the width of an inline note.
1807 % \begin{macrocode}
1808 \newcommand{\@todonotes@inlinewidth}{\linewidth}%
1809 \define@key{todonotes}%
1810 {inlinewidth}{\renewcommand{\@todonotes@inlinewidth}{#1}}
1811 % \end{macrocode}
1812 % Change if inline note is written to a separate line or not.
1813 % \begin{macrocode}
1814 \newif\if@todonotes@inlinepar
1815 \@todonotes@inlinepartrue
1816 \define@key{todonotes}{inlinepar}[]{\@todonotes@inlinepartrue}%
1817 \define@key{todonotes}{noinlinepar}[]{\@todonotes@inlineparfalse}%
1818 % \end{macrocode}
1819 % Preset values of the options
1820 % \begin{macrocode}
1821 \presetkeys%
1822 {todonotes}%
1823 {linecolor=\@todonotes@linecolor,%
1824 backgroundcolor=\@todonotes@backgroundcolor,%
1825 textcolor=\@todonotes@textcolor,%
1826 bordercolor=\@todonotes@bordercolor,%
1827 format=todoformat,%
1828 tickmarkheight=\@todonotes@defaulttickmarkheight,%
1829 nofancyline,%
1830 nodisable,%
1831 noinline,%
1832 nocaption,%
1833 noauthor,%
1834 \@todonotes@shadowenabledbydefault,%
1835 figwidth=\@todonotes@figwidth,%
1836 figheight=\@todonotes@figheight,%
1837 figcolor=\@todonotes@figcolor,%
1838 line, list,%
1839 inlinewidth=\linewidth,
1840 inlinepar}{}%
1841 \@temptokena\expandafter{\@todonotes@textsize}
1842 \edef\next{\noexpand\presetkeys{todonotes}{size=\the\@temptokena}{}}
1843 \next
1844 % \end{macrocode}
1845 % \subsection{The main code part}
1846 % Here is the actual macros defined.
1847 % If the option "disable" was passed to the package
1848 % define empty commands.
1849 % \begin{macrocode}
1850 \if@todonotes@disabled%
1851 \newcommand{\listoftodos}[1][]{}
1852 \newcommand{\@todo}[2][]{}
1853 \newcommand{\missingfigure}[2][]{}
1854 \else % \if@todonotes@disabled
1855 % \end{macrocode}
1856 % Define the |\listoftodos| command and define the
1857 % appearance of the list of todos.
1858 % \begin{macrocode}
1859 \newcommand{\listoftodos}[1][\@todonotes@todolistname]
1860 {\@ifundefined{chapter}{\section*{#1}}{\chapter*{#1}} \@starttoc{tdo}}
1861 \newcommand{\l@todo}
1862 {\@dottedtocline{1}{0em}{2.3em}}
1863 % \end{macrocode}
1864 % Define styles used by the todo command
1865 % \begin{macrocode}
1866 \tikzstyle{notestyleraw} = [
1867 draw=\@todonotes@currentbordercolor,
1868 fill=\@todonotes@currentbackgroundcolor,
1869 text=\@todonotes@currenttextcolor,
1870 line width=0.5pt,
1871 text width = \@todonotes@textwidth - 1.6 ex - 1pt,
1872 inner sep = 0.8 ex,
1873 rounded corners=4pt]
1874 % \end{macrocode}
1875 %
1876 % \begin{macro}{\@todo}
1877 % Define the |\@todo| command.
1878 % \begin{macrocode}
1879 \newcommand{\@todo}[2][]{%
1880 % \end{macrocode}
1881 % Use the global value for determining the default prepend behavior.
1882 % \begin{macrocode}
1883 \if@todonotes@prependcaptionglobal%
1884 \@todonotes@prependcaptiontrue%
1885 \else%
1886 \@todonotes@prependcaptionfalse%
1887 \fi%
1888 % \end{macrocode}
1889 % Store the original text for later usage and parse the given options.
1890 % \begin{macrocode}
1891 \renewcommand{\@todonotes@text}{#2}%
1892 \renewcommand{\@todonotes@caption}{#2}%
1893 \setkeys{todonotes}{#1}%
1894 % \end{macrocode}
1895 %
1896 % Add shadows to the inserted todonotes.
1897 % \begin{macrocode}
1898 \if@todonotes@useshadow%
1899 \if@todonotes@shadowlibraryloaded%
1900 \tikzstyle{notestyle} = [notestyleraw,%
1901 general shadow={shadow xshift=0.5ex, shadow yshift=-0.5ex,%
1902 opacity=1,fill=black!50}]%
1903 \else%
1904 \PackageWarning{todonotes}{Trying to put a shadow below a todonote,%
1905 but the loadshadowlibrary option was not given when loading%
1906 the todonotes package}%
1907 \tikzstyle{notestyle} = [notestyleraw]%
1908 \fi%
1909 \else%
1910 \tikzstyle{notestyle} = [notestyleraw]%
1911 \fi%
1912 % \end{macrocode}
1913 % Update notestyles
1914 % \begin{macrocode}
1915 \tikzstyle{notestyleleft} = [%
1916 notestyle,%
1917 left]%
1918 \tikzstyle{connectstyle} = [%
1919 thick,%
1920 draw=\@todonotes@currentlinecolor]%
1921 \tikzstyle{inlinenotestyle} = [%
1922 notestyle,%
1923 text width=\@todonotes@inlinewidth - 1.6 ex - 1 pt]%
1924 % \end{macrocode}
1925 % If the option |disable| is given to the command, no output is generated.
1926 % \begin{macrocode}
1927 \if@todonotes@localdisable%
1928 \else%
1929 % \end{macrocode}
1930 % Add the item to the list of todos. When the option
1931 % |colorinlistoftodos| is given to the package a small colored
1932 % square is added in front of the text.
1933 % \begin{macrocode}
1934 \addtocounter{@todonotes@numberoftodonotes}{1}%
1935 \if@todonotes@appendtolistoftodos%
1936 \phantomsection%
1937 \if@todonotes@captiongiven%
1938 \else%
1939 \renewcommand{\@todonotes@caption}{#2}%
1940 \fi%
1941 \@todonotes@addElementToListOfTodos%
1942 \fi%
1943 % \end{macrocode}
1944 % Prepend the short caption given if it is requested
1945 % \begin{macrocode}
1946 \if@todonotes@captiongiven%
1947 \if@todonotes@prependcaption%
1948 \renewcommand{\@todonotes@text}{\@todonotes@caption: #2}%
1949 \fi%
1950 \fi%
1951 % \end{macrocode}
1952 % Place the todonote as indicated by the options (inline or in a
1953 % marginpar), below is the code for the inline placement.
1954 % \begin{macrocode}
1955 \if@todonotes@inlinenote%
1956 \@todonotes@drawInlineNote%
1957 \else%
1958 \@todonotes@drawMarginNoteWithLine%
1959 \fi%\if@todonotes@inlinenote
1960 \fi%\if@todonotes@localdisable
1961 }%
1962 % \end{macrocode}
1963 % \end{macro}
1964 % \begin{macro}{drawMarginNoteWithLine}
1965 % Define helper function |drawMarginNoteWithLine|.
1966 % \begin{macrocode}
1967 \newcommand{\@todonotes@drawMarginNoteWithLine}{%
1968 % \end{macrocode}
1969 % When the todonote should be placed inside a marginpar, the code
1970 % below is applied.
1971 % First is the current location in the document stored, this enables
1972 % us later to connect this point with the inserted todonote.
1973 % \begin{macrocode}
1974 \ifvmode
1975 \vspace*{-\parskip}% % backup if we are already in vertical mode
1976 \vskip-\baselineskip % (and don't loose that space after a
1977 % pagebreak ...
1978 \noindent
1979 \fi
1980 \begin{tikzpicture}[remember picture, overlay, baseline=-0.75ex]%
1981 \node [coordinate] (inText) {};%
1982 \end{tikzpicture}%
1983 \marginpar[{% Draw note in left margin
1984 \@todonotes@drawMarginNote%
1985 \@todonotes@drawLineToLeftMargin%
1986 % \end{macrocode}
1987 % In the book documentclass (which is a twoside layout), the
1988 % |\marginpar| marginpar macro takes two arguments
1989 % |\marginpar[left]{right}|.
1990 % If both arguments are given, latex will decide in which side the
1991 % margin note has to be inserted, and then use the corresponding
1992 % commands.
1993 % \begin{macrocode}
1994 }]{% Draw note in right margin
1995 \@todonotes@drawMarginNote%
1996 \@todonotes@drawLineToRightMargin%
1997 }%
1998 }%
1999 % \end{macrocode}
2000 % \end{macro}
2001 % \begin{macro}{addElementToListOfTodos}
2002 % Define helper function |addElementToListOfTodos|.
2003 % \begin{macrocode}
2004 \newcommand{\@todonotes@addElementToListOfTodos}{%
2005 \if@todonotes@colorinlistoftodos%
2006 \addcontentsline{tdo}{todo}{%
2007 \fcolorbox{\@todonotes@currentbordercolor}%
2008 {\@todonotes@currentbackgroundcolor}%
2009 {\textcolor{\@todonotes@currentbackgroundcolor}{o}}%
2010 \ \@todonotes@caption}%
2011 \else%
2012 \addcontentsline{tdo}{todo}{\@todonotes@caption}%
2013 \fi}%
2014 % \end{macrocode}
2015 % \end{macro}
2016 % \begin{macro}{drawInlineNote}
2017 % Define helper function |useSizeCommand|.
2018 % \begin{macrocode}
2019 \newcommand{\@todonotes@useSizeCommand}{%
2020 \ifcsname \expandafter\string\@todonotes@sizecommand\endcsname
2021 \csname \expandafter\string\@todonotes@sizecommand\endcsname%
2022 \else
2023 \@todonotes@sizecommand
2024 \fi%
2025 }%
2026 % \end{macrocode}
2027 % \end{macro}
2028 % \begin{macro}{drawInlineNote}
2029 % Define helper function |drawInlineNote|.
2030 % \begin{macrocode}
2031 \newcommand{\@todonotes@drawInlineNote}{%
2032 \if@todonotes@dviStyle%
2033 {\if@todonotes@inlinepar\par\noindent\fi%
2034 \begin{tikzpicture}[remember picture]%
2035 \draw node[inlinenotestyle] {};
2036 \end{tikzpicture}%
2037 \if@todonotes@inlinepar\par\fi}%
2038 \if@todonotes@authorgiven%
2039 {\noindent \@todonotes@useSizeCommand \@todonotes@author:\,\@todonotes@format{\@todonotes@text}}%
2040 \else%
2041 {\noindent \@todonotes@useSizeCommand%
2042 \@todonotes@format{\@todonotes@text}}%
2043 \fi
2044 {\if@todonotes@inlinepar\par\noindent\fi%
2045 \begin{tikzpicture}[remember picture]%
2046 \draw node[inlinenotestyle] {};
2047 \end{tikzpicture}%
2048 \if@todonotes@inlinepar\par\fi}%
2049 \else%
2050 {\if@todonotes@inlinepar\par\noindent\fi%
2051 \begin{tikzpicture}[remember picture]%
2052 \draw node[inlinenotestyle,font=\@todonotes@useSizeCommand]{%
2053 \if@todonotes@authorgiven%
2054 {\noindent \@todonotes@author:\,%
2055 \@todonotes@format{\@todonotes@text}}%
2056 \else%
2057 {\noindent \@todonotes@format{\@todonotes@text}}%
2058 \fi};%
2059 \end{tikzpicture}%
2060 \if@todonotes@inlinepar\par\fi}%
2061 \fi}%
2062 % \end{macrocode}
2063 % \end{macro}
2064 % \begin{macro}{drawMarginNote}
2065 % Define helper function |drawMarginNote|.
2066 % \begin{macrocode}
2067 \newcommand{\@todonotes@drawMarginNote}{%
2068 \if@todonotes@dviStyle%
2069 \begin{tikzpicture}[remember picture]%
2070 \draw node[notestyle] {};%
2071 \end{tikzpicture}\\%
2072 \begin{minipage}{\@todonotes@textwidth}%
2073 \if@todonotes@authorgiven%
2074 \@todonotes@useSizeCommand \@todonotes@author:\,
2075 \@todonotes@format{\@todonotes@text}%
2076 \else%
2077 \@todonotes@useSizeCommand\@todonotes@format{\@todonotes@text}%
2078 \fi%
2079 \end{minipage}\\%
2080 \begin{tikzpicture}[remember picture]%
2081 \draw node[notestyle] (inNote) {};%
2082 \end{tikzpicture}%
2083 \else%
2084 \let\originalHbadness\hbadness%
2085 \hbadness 100000%
2086 \begin{tikzpicture}[remember picture,baseline=(X.base)]%
2087 \node(X){\vphantom{\@todonotes@useSizeCommand X}};%
2088 \if@todonotes@authorgiven%
2089 \draw node[notestyle,font=\@todonotes@useSizeCommand,anchor=north] (inNote) at (X.north)%
2090 {\@todonotes@author};%
2091 \node(Y)[below=of X]{};%
2092 \draw node[notestyle,font=\@todonotes@useSizeCommand,anchor=north] (inNote) at (X.south)%
2093 {\@todonotes@format{\@todonotes@text}};%
2094 \else%
2095 \draw node[notestyle,font=\@todonotes@useSizeCommand,anchor=north] (inNote) at (X.north)%
2096 {\@todonotes@format{\@todonotes@text}};%
2097 \fi%
2098 \end{tikzpicture}%
2099 \hbadness \originalHbadness%
2100 \fi}%
2101 % \end{macrocode}
2102 % \end{macro}
2103 % \begin{macro}{drawLineToRightMargin}
2104 % Define helper function |drawLineToRightMargin|.
2105 % \begin{macrocode}
2106 \newcommand{\@todonotes@drawLineToRightMargin}{%
2107 \if@todonotes@line%
2108 \if@todonotes@fancyline%
2109 \tikz[remember picture,overlay]{%
2110 \tikzstyle{both}=[line width=3pt, draw, opacity=0.15]%
2111 \tikzstyle{line}=[shorten >=5pt, line cap=round]%
2112 \tikzstyle{head}=[shorten >=-1pt, dash pattern=on 0pt off 1pt, ->]%
2113 \foreach \s in {line,head}{%
2114 \draw[both,\s]%
2115 (inNote.north west).. controls +(0:0) and +(90:1.5)..([yshift=1ex] inText);%
2116 }%
2117 }%
2118 \else%
2119 \begin{tikzpicture}[remember picture, overlay]%
2120 \draw[connectstyle]%
2121 ([yshift=-0.2cm + \@todonotes@tickmarkheight] inText)%
2122 -| ([yshift=-0.2cm] inText)%
2123 -| ([xshift=-0.2cm] inNote.west)%
2124 -| (inNote.west);%
2125 \end{tikzpicture}%
2126 \fi%
2127 \fi}%
2128 % \end{macrocode}
2129 % \end{macro}
2130 % \begin{macro}{drawLineToLeftMargin}
2131 % Define helper function |drawLineToLeftMargin|.
2132 % \begin{macrocode}
2133 \newcommand{\@todonotes@drawLineToLeftMargin}{%
2134 \if@todonotes@line%
2135 \if@todonotes@fancyline%
2136 \tikz[remember picture,overlay]{%
2137 \tikzstyle{both}=[line width=3pt, draw, opacity=0.15]%
2138 \tikzstyle{line}=[shorten >=5pt, line cap=round]%
2139 \tikzstyle{head}=[shorten >=-1pt, dash pattern=on 0pt off 1pt,->]%
2140 \foreach \s in {line,head}{%
2141 \draw[both,\s]%
2142 (inNote.north east).. controls +(0:0) and +(90:1.5)..([yshift=1ex] inText);%
2143 }%
2144 }%
2145 \else%
2146 \begin{tikzpicture}[remember picture, overlay]%
2147 \draw[connectstyle]%
2148 ([yshift=-0.2cm + \@todonotes@tickmarkheight] inText)%
2149 -| ([yshift=-0.2cm] inText)%
2150 -| ([xshift=0.2cm] inNote.east)%
2151 -| (inNote.east);%
2152 \end{tikzpicture}%
2153 \fi%
2154 \fi}%
2155 % \end{macrocode}
2156 % \end{macro}
2157 % \begin{macro}{\missingfigure}
2158 % Defines the |\missingfigure| macro.
2159 % \begin{macrocode}
2160 \newcommand{\missingfigure}[2][]{%
2161 \setkeys{todonotes}{#1}%
2162 \addcontentsline{tdo}{todo}{\@todonotes@MissingFigureText: #2}%
2163 \par
2164 \noindent
2165 \hfill
2166 \begin{tikzpicture}
2167 \draw[fill=\@todonotes@currentfigcolor, draw = black!40, line width=2pt]
2168 (-2, -0.5*\@[email protected])
2169 rectangle +(\@todonotes@currentfigwidth, \@todonotes@currentfigheight);
2170 \draw (2, -0.5) node[right, text
2171 width=\@[email protected], font=\@todonotes@useSizeCommand] {#2};
2172 \draw[red, fill=white, rounded corners = 5pt, line width=10pt]
2173 (30:2cm) -- (150:2cm) -- (270:2cm) -- cycle;
2174 \draw (0, 0.3) node {\@todonotes@MissingFigureUp};
2175 \draw (0, -0.3) node {\@todonotes@MissingFigureDown};
2176 \end{tikzpicture}\hfill
2177 \null\par
2178 }% Ending \missingfigure command
2179 \fi% Ending \@todonotes@ifdisabled
2180 % \end{macrocode}
2181 % \end{macro}
2182 % \begin{macro}{\todototoc}
2183 % Inserts a reference to the list of todos in the table of contents. If |chapter| is defined,
2184 % |chapter| is used as level otherwise will |section| be used.
2185 % The |\todototoc| command respects the disable option.
2186 % \begin{macrocode}
2187 \newcommand{\todototoc}
2188 {%
2189 \if@todonotes@disabled
2190 \else
2191 \addcontentsline{toc}{\@ifundefined{chapter}{section}{chapter}}{\@todonotes@todolistname}%
2192 \fi
2193 }
2194 % \end{macrocode}
2195 % \end{macro}
2196 %
2197 % \begin{macro}{\todo}
2198 % Define the |\todo| command as a redirection to |\@todo|.
2199 % \begin{macrocode}
2200 \newcommand{\todo}[2][]{%
2201 % Needed to output any dangling \item of a noskip section (see #36):
2202 \if@inlabel \leavevmode \fi
2203 \if@noskipsec \leavevmode \fi
2204 \if@todonotes@inlinepar
2205 \ifhmode
2206 \@bsphack
2207 \@todonotes@vmodefalse
2208 \else
2209 \@savsf\@m
2210 \@savsk\z@
2211 \@todonotes@vmodetrue
2212 \fi
2213 {\@todo[#1]{#2}}%
2214 \@esphack%
2215 \if@todonotes@vmode \par \fi
2216 \else%
2217 \@todo[#1]{#2}%
2218 \fi}
2219 \newif\if@todonotes@vmode
2220 % \end{macrocode}
2221 % \end{macro}
2222 % \begin{macro}{\todostyle}
2223 % Define the |\todostyle| macro. |\todostyle|\marg{name}\marg{style}
2224 % defines an |xkeyval| option \meta{name} that, when called in a
2225 % |\todo| or |\missingfigure| command, sets the preset options
2226 % followed by \meta{style}.
2227 % \begin{macrocode}
2228 \newcommand*{\todostyle}[2]{%
2229 \define@key{todonotes}{#1}[]{%
2230 \setkeys{todonotes}{#2}}}
2231 % \end{macrocode}
2232 % \end{macro}
2233 % \appendix
2234 % \newpage
2235 % \Finale
2236 \endinput
2237