forked from henrikmidtiby/todonotes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
todonotes.dtx
1844 lines (1840 loc) · 66 KB
/
todonotes.dtx
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% \iffalse meta-comment
%
% Copyright (C) 2015 by Henrik Skov Midtiby <henrikmidtiby@gmail.com>
% -------------------------------------------------------
%
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.2
% of this license or (at your option) any later version.
% The latest version of this license is in:
%
% http://www.latex-project.org/lppl.txt
%
% and version 1.2 or later is part of all distributions of LaTeX
% version 1999/12/01 or later.
%
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{todonotes.dtx}
%</driver>
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{todonotes}
%<*package>
[2015/07/09 .dtx Todonotes source and documentation.]
%</package>
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{wrapfig}
\usepackage[colorlinks, linkcolor=black, urlcolor=blue]{hyperref}
\usepackage[colorinlistoftodos, shadow]{todonotes}[2015/07/09]
\usepackage{amsmath}
\usepackage{setspace}
\usepackage{soul}
\setcounter{tocdepth}{2}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
\DocInput{todonotes.dtx}
%\iffalse
% \PrintChanges
% \PrintIndex
%\fi
\end{document}
%</driver>
% \fi
%
% \CheckSum{596}
%
% \CharacterTable
% {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
% 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
% Digits \0\1\2\3\4\5\6\7\8\9
% Exclamation \! Double quote \" Hash (number) \#
% Dollar \$ Percent \% Ampersand \&
% Acute accent \' Left paren \( Right paren \)
% Asterisk \* Plus \+ Comma \,
% Minus \- Point \. Solidus \/
% Colon \: Semicolon \; Less than \<
% Equals \= Greater than \> Question mark \?
% Commercial at \@ Left bracket \[ Backslash \\
% Right bracket \] Circumflex \^ Underscore \_
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
%
% \changes{0.1}{2008/04/17}{The first version of the package}
% \changes{0.2}{2008/05/15}{Updated the option handling of the package}
% \changes{0.2.1}{2008/05/16}{Slightly modified by Kjell Magne Fauske to
% support notes in the left margin (for documentstyle book).}
% \changes{0.2.2}{2008/05/28}{Added a missingfigure command}
% \changes{0.2.3}{2008/06/10}{Made a dependency on the calc package}
% \changes{0.3}{2008/07/11}{Delayed the requirements for the hyperref package
% untill begin document and added an optional argument
% to the todo command for adding inline todonotes (Idea
% from Patrick Toche)}
% \changes{0.3.1}{2008/07/15}{Added some options to the todo macro (Idea: Patrick
% Toche) and made the \\listoftodos point at the inserted
% todos and not only the current / previous section,
% subsection or figure using the \\phantomsection macro.}
% \changes{0.4}{2008/07/28}{Modified the behaviour of the inline todonotes, to
% avoid empty lines around the inline todonotes.}
% \changes{0.4.1}{2008/07/28}{
% Added the option colorinlistoftodos which inserts a
% small box with the used fillcolor of the todonotes in
% the list of todos.}
% \changes{0.4.2}{2008/07/30}{Fixed a bug with the disable option to the
% package.}
% \changes{0.5}{2008/08/05}{Created a dtx file containing both source
% code and documentation of the package}
% \changes{0.5.1}{2008/09/15}{Updated the documentation}
% \changes{0.5.2}{2008/10/20}{Fixed a bug that prevented the usage
% of the option french for babel. Bug report by Thomas
% Braun.}
% \changes{0.6}{2008/10/24}{Added the caption option to the todo
% command.}
% \changes{0.6.1}{2008/11/07}{Added a new usecase with decreased line
% spacing.}
% \changes{0.6.2}{2008/11/13}{Added a usecase by Fabrice Niessen.}
% \changes{0.7}{2008/11/22}{Added language options on request from
% Peter Zimmermann.}
% \changes{0.7.1}{2008/12/07}{Reworked the color options for both
% the whole package and the todo command. General code
% clean up. Added the prependcaption package option.}
% \changes{0.7.2}{2008/12/27}{Avoid to change the fontsize inside
% the list of todos, fixing a bug revealed by Vladimir
% Zhuravlev.}
% \changes{0.7.3}{2008/12/30}{The localization options (danish and
% german) and the disable options, were all flawed by
% naming inconsistencies that made then break the
% package. This have been fixed.}
% \changes{0.7.4}{2008/12/30}{Fixed a bug related to the caption
% option for the todo command. Introduced a counter of
% the number of inserted todos.}
% \changes{0.7.5}{2009/01/02}{Fixed a typo in a macroname.}
% \changes{0.7.6}{2009/01/04}{Added a textsize option for the
% package and the prepend / noprepend option for the
% todo command.}
% \changes{0.8}{2009/01/09}{Added three new translations french,
% spanish and catalan thanks to Richard Dominique and
% Joan Queralt. Improved the visual appearence of the
% inserted notes (rounded corners and optional shadows)
% with code from Joan Queralt. Found an untranslated
% textstring ''Figure'' in the source. Added a figwidth
% option to the missingfigure command, patch by Paul
% Ivanov.}
% \changes{0.8.1}{2009/01/12}{Added a space between the colored
% square and the text in the list of todos. Added a new
% usecase for marking old / new sections. Made the name
% of listoftodos changeable.}
% \changes{0.8.2}{2009/02/04}{Italian translation by Gustavo
% Cevolani. Removed the dependence on the hyperref
% package.}
% \changes{0.8.3}{2009/03/31}{Added a use case for linking to the
% list of todos, idea from Andreas Plank. Introduced a
% package option for listening to the draft option given
% to the document class.}
% \changes{0.8.4}{2009/04/02}{Fixed a bug related to the obeyDraft
% option.}
% \changes{0.8.5}{2009/08/01}{Added two new usecases (enumeration of
% inserted todonotes and how to set custom default values).
% Changed the order of the use case examples.}
% \changes{0.8.6}{2009/08/05}{Added a portuguese translation by Og DeSouza.}
% \changes{0.8.7}{2009/10/24}{Updated portuguese translation. Added a ngerman
% alias for the german translation suggested by Michael Niedermair.}
% \changes{0.8.8}{2009/12/07}{Added a new usecase from Vitaly. Fixed a
% bug reported by Oscar Gustafsson. Explained why the placement
% of todonotes in the margin fails in certain custom document classes.}
% \changes{0.8.9}{2009/12/25}{Added a dutch translation by Ruben Ruben Vermeersch.}
% \changes{0.9.0}{2010/09/13}{Added a english option as suggested by Marco Berghoff.}
% \changes{0.9.1}{2010/09/13}{Added the todototoc command by idea from Sven Augustin.}
% \changes{0.9.2}{2010/09/13}{Use chapter (if available) for the list of todos heading.}
% \changes{0.9.3}{2010/09/13}{Make an internal definition of the todo command,
% for easing redefinition of the command behaviour.}
% \changes{0.9.4}{2010/09/26}{Make the disable option work on a local scale.}
% \changes{0.9.5}{2010/09/26}{Code simplification by extracting functionality to
% smaller macros.}
% \changes{0.9.6}{2010/11/04}{Give fontsize to TikZ. Align notes with line where note
% is set. Added new option fancyline. Patches by Benjamin Kellermann.}
% \changes{0.9.7}{2011/03/07}{Updated documentation.}
% \changes{0.9.8}{2011/04/21}{Suppress warnings about underfull / overful boxes
% generated by the inserted todonotes. Patch by Peter M Schuler.}
% \changes{0.9.9}{2011/10/22}{Added author option, implementation provided by
% Xavier Alameda-Pineda. Example of modifying the
% listoftodos removing some protect commands with no effect.}
% \changes{1.0.0}{2012/07/25}{Mention trouble with the classicthesis style.
% Refer to some alternatives to the package.
% Added todoin command as suggested by Stefan Pinnow.
% Described how to use tikz externalize with todonotes.
% Added obeyDraft and obeyFinal options.}
% \changes{1.0.1}{2012/11/24}{Fix spacing issues reported by Jonathan Zachhuber and
% Brent Longborough.
% Added figheight option to the missingfigure command as suggested by Kim Albertsson.}
% \changes{1.0.2}{2014/07/14}{Added Swedish translation by Emil Lundberg.
% Added usecase by Tobias Winchen.
% Mentioned that default arguments can be set using the presetkeys command.
% Updated list of alternatives to the todonotes package.
% Draw borders around coloured boxes in the list of todos, patch by Ze Loff.}
% \changes{1.0.3}{2014/10/21}{Added the option figcolor to missing figure, patch by Pascal Hebbeker.
% Added Croatian translation by Ican Kokan.
% Changed default with of missingfigure.
% Removed some underfull box warnings, solution by Ernst Blecha.}
% \changes{1.0.4}{2015/07/09}{Restructured documentation and placed some examples in the
% doc/examples subdirectory.}
% \changes{1.0.5}{2016/11/02}{Example of how to change the space eating behaviour added by Anselm Wagner. Reduced the width of missingfigure to avoid bad box warnings.}
% \GetFileInfo{todonotes.dtx}
%
% \DoNotIndex{\newcommand,\newenvironment}
%
% \iffalse
% A macro for marking things todo before the next relase
% (typically update of documentation).
% \fi
% \newcommand{\donow}[1]{\todo[color=blue]{#1}}
%
%
% \title{The \textsf{todonotes} package\thanks{This document
% corresponds to \textsf{todonotes}~\fileversion, dated \filedate.}}
% \author{Henrik Skov Midtiby \\ \texttt{henrikmidtiby@gmail.com}}
%
% \maketitle
%
% \begin{abstract}
% The |todonotes| package allows you to insert to--do items in your
% document. At any point in the document a list of all the inserted
% to--do items can be listed with the |\listoftodos| command.
% \end{abstract}
%
% \tableofcontents
%
% \newpage
% \section{Introduction}
%
% The |todonotes| package makes three commands available to the
% user: |\todo[]{}|, |\missingfigure{}| and |\listoftodos|.
% |\todo[]{}| and |\missingfigure{}| makes it possible to insert
% notes in your document about things that has to be done later
% (todonotes \ldots).
% I developed the basic functionality of the package while I worked
% on my bachelor project.
%
% Some alternatives for the todonotes package are:
% \begin{itemize}
% \item \href{http://ctan.org/pkg/easy-todo}{easy-todo}\\
% Depends on |color|, |tocloft| and |ifthen|, small feature set.
% \item \href{http://ctan.org/pkg/fixmetodonotes}{fixmetodonotes}\\
% Depends on |graphicx|, |color|, |transparent|, |watermark|,|fix-cm|, |ulem| and |tocloft|, small feature set.
% \item \href{http://ctan.org/pkg/todo}{todo}\\
% Depends on |amssymb|, medium feature set.
% \item \href{http://ctan.org/pkg/fixme}{fixme}\\
% Large package with a lot of features.
% \end{itemize}
% The main reason for considering other packages is that the todonotes
% package is quire large and relies heavily on tikz.
% This can slow down compilation of large documents significantly.
% The mentioned alternatives have a different feature set and does not
% rely on tikz, which makes them require less ressoureces.
%
%
% \subsection{Usage}
%
% \DescribeMacro{\todo}
% My \index{\todo}most common usage of the todonotes package, is to
% insert an todonotes somewhere in a latex document.
% An example of this usage is the command
%
% |\todo{Make a cake \ldots}|,
%
% \noindent
% which renders like\todo{Make a cake \ldots}.
% The |\todo| command has this structure:
% |\todo|\oarg{options}\marg{todo text}.
% The |todo text| is the text that will be shown in the todonote and
% in the list of todos. The optional argument |options|, allows the
% user to customize the appearance of the inserted todonotes.
% For a description of all the options see section
% \ref{subsecTodoOptions}.
%
%
% \DescribeMacro{\missingfigure}
% The |\missingfigure| command inserts an image containing an
% attention sign and the given text.
% The command takes only one argument
% |\missingfigure|\marg{text}, a text string that could
% describe what the figure should consist of.
% An example of its usage could be
%
% |\missingfigure{Make a sketch of the structure of a trebuchet.}|
%
% \noindent
% which renders like.
%
% \missingfigure{Make a sketch of the structure of a trebuchet.}
%
%
% \DescribeMacro{\listoftodos}
% The |\listoftodos| command inserts a list of all the todos in the
% current document. |\listoftodos| takes no arguments.
% For this document the list of to--do's looks like.
% \listoftodos
% \vspace{0.5cm}
%
% \DescribeMacro{\todototoc}
% The |\todototoc| command adds an entry to the table of contents for
% list of todos. The command should be placed right before the
% |\listoftodos| command.
%
% \subsection{Package options}
% \label{subsecPackageOptions}
% \DescribeMacro{disable}
% If the option |disable| is passed to the package, the macros
% usually defined by the package (|\todo|, |\listoftodos| and
% |\missingfigure|) are defined as macros with no effect, and thus
% all inserted notes are removed.
%
% \DescribeMacro{obeyDraft, obeyFinal}
% When the option |obeyDraft| is given, the package checks
% if the one of the options |draft|, |draftcls| or |draftclsnofoot|
% is given (this option is usually given to
% the documentclass). If the |draft| option is given, the
% functionality of the package is enabled and otherwise the effect
% of the package is disabled.
% The option |obeyFinal| does something similar, except that the
% todonotes package is only disabled if the |final| option given.
%
% \DescribeMacro{danish, german, ngerman, english, french, swedish}
% \DescribeMacro{spanish, catalan, italian}
% \DescribeMacro{portuguese, dutch, croatian}
% Use translations of the text strings
% ''List of todos'' and ''Missing figure''.
% The default is to use none of these options, which results in
% english text strings.
% Currently the following languages are supported:
% catalan,
% croatian,
% danish,
% dutch,
% english,
% french,
% german,
% ngerman,
% italian,
% portuguese,
% spanish and
% swedish.
%
% \DescribeMacro{colorinlistoftodos}
% Adds a small colored square in front of all items in the Todo
% list. The color of the square is the same as the fill color of the
% inserted todonote.
% This can be useful if there are different types of todos
% (insert reference, explain in detail, \ldots) where the color of
% the inserted todonote marks the type of todo.
%
% \DescribeMacro{color}
% \DescribeMacro{backgroundcolor}
% \DescribeMacro{linecolor}
% \DescribeMacro{bordercolor}
% These options sets the default colors for the todo command.
% There is three colors that can be specified. The border color
% (default |bordercolor=black|) around the inserted text, the color
% behind the inserted text (default |backgroundcolor=orange|) and
% the color of the line connecting the inserted textbox with the
% current location in the text (default |linecolor=orange|).
% Setting the |color| option to |val| passes this value on to the
% background and line color options.
% The specified colors must be valid according to the
% |xcolor| package.
%
% \DescribeMacro{textwidth}
% |textwidth=length| sets the width of a todo item in the margin to
% |length|. The width of inline todonotes will allways be the same
% as the current line width.
%
% \DescribeMacro{textsize}
% |textsize=value| sets the default text size of the inserted
% todonotes to the given value.
% Value is the ''name'' of the used font size, eg. if the desired
% fontsize is |\tiny| use |textsize=tiny|. The default value is
% |textsize=normalsize|.
%
% \DescribeMacro{prependcaption}
% The |prependcaption| option triggers a special behaviour of the
% |caption=val| option for the todo command, where the given value
% |val| is inserted in the inserted todonote.
%
% \DescribeMacro{shadow}
% If the |shadow| option is given, the inserted todonotes will be
% displayed with a gray shadow.
% I expect that the option will trigger problems with tikz versions
% prior to 2.0.
%
% \DescribeMacro{dvistyle}
% When a document with todonotes is compiled with plain latex (to a
% dvi-file), there is an issue with the visual
% appearance\footnote{The problem is placement of text inside the
% colored boxes.}.
% The option |dvistyle| changes the appearance of the inserted
% todonotes to avoid this problem.
%
% \DescribeMacro{figwidth}
% The |figwidth=length| option sets the default width of the figure
% inserted by the |\missingfigure| command.
% The default value is |\linewidth|.
%
%
%
% \subsection{Options for the todo command}
% \label{subsecTodoOptions}
% There are several options that can be given to the |\todo|
% command. All the options are described here and often I have
% included examples of the change in visual appearance.
% Default values for these options can be set using the presetkeys
% command.
% \begin{verbatim}
% \presetkeys{todonotes}{fancyline, color=blue!30}{}
% \end{verbatim}
%
% \DescribeMacro{disable}
% The |disable| option can be given directly to the todo command.
% If given the command has no effect.
%
% \DescribeMacro{color}
% \DescribeMacro{backgroundcolor}
% \DescribeMacro{linecolor}
% \DescribeMacro{bordercolor}
% These options set the color that is used in the current todo
% command.
% The color classes is the same as used in the color package
% options, see section \ref{subsecPackageOptions}.
% Default values can be set by the color
% options when the todonotes package is loaded.
% \todo[color=green!40]{And a green note}
% The todo notes inserted in this paragraph is created with the
% command
% |\todo[color=green!40]{And a green note}|.
% The color of the inserted note could be used to mark different
% types of tasks (insert references, explain something in detail,
% \ldots), this could be streamlined by defining new commands like
% below.
% \begin{verbatim}
% \newcommand{\insertref}[1]{\todo[color=green!40]{#1}}
% \newcommand{\explainindetail}[1]{\todo[color=red!40]{#1}}
% \end{verbatim}
% An example that uses all of the color options is given below
% \todo[linecolor=green!70!white, backgroundcolor=blue!20!white,
% bordercolor=red]{Anything but default colors}.
% \begin{verbatim}
% \todo[linecolor=green!70!white, backgroundcolor=blue!20!white,
% bordercolor=red]{Anything but default colors}.
% \end{verbatim}
%
%
% \DescribeMacro{line / noline}
% If you want to get rid of the line connecting the inserted note
% with the place in the text where the note occurs in the latex
% code, the option |noline| can be used.
% \todo[noline]{A note with no line connecting it to the placement
% in the original text.}
% |\todo[noline]{A note with no line ...}|
% \vspace{1.0cm}
%
%
% \DescribeMacro{inline / noinline}
% It is possible to place a todonote inside the text instead of
% placing it in the margin, this could be desirable if the text in
% the note has a considerable length.
% |\todo[inline]{A todonote placed in the text}|
% \todo[inline]{A todonote placed in the text}
% \begin{wrapfigure}[1]{r}[20mm]{40mm}
% \begin{tikzpicture}
% \draw[red] (0, 0) circle(0.45);
% \draw[green] (1, 0) circle(0.45);
% \draw[blue] (2, 0) circle(0.45);
% \end{tikzpicture}
% \caption{A text explaining the image.
% \todo[inline]{Fill those circles \ldots}}
% \end{wrapfigure}
% Another usage for the inline option is when you want to add a
% todonote to a figure caption.
%
% \begin{verbatim}
% \begin{wrapfigure}{r}[20mm]{40mm}
% \begin{tikzpicture}
% \draw[red] (0, 0) circle(0.45);
% \draw[green] (1, 0) circle(0.45);
% \draw[blue] (2, 0) circle(0.45);
% \end{tikzpicture}
% \caption{A text explaining the image.
% \todo[inline]{Fill those circles \ldots}}
% \end{wrapfigure}
% \end{verbatim}
%
% \DescribeMacro{size}
% |size=val| changes the size of the text inside the todonote.
% The commands used to create the notes below are \\ \noindent
% |\todo[size=\Large]{A note with a large font size.}|
% and \\ \noindent
% |\todo[inline, size=\tiny]{Note with very small font size.}|.
% \todo[size=\Large]{A note with a large font size.}
% \todo[inline, size=\footnotesize]{Note with very small font size.}
%
% \DescribeMacro{list / nolist}
% When the option |nolist| is given, the todo item will not appear in
% the list of todos.
%
% \DescribeMacro{caption}
% The |caption| option enables the user to specify a short
% description of the todonote that are inserted in the list of
% todos instead of the full todonote text.
% \todo[caption={Short note}]{A very long and tedious note that
% cannot be on one line in the list of todos.}
% \begin{verbatim}
% \todo[caption={Short note}]{A very long and tedious note that
% cannot be on one line in the list of todos.}.
% \end{verbatim}
% The effect of this option is altered with the package option
% |prependcaption| or the |prepend| / |noprepend| option for the
% todo command.
%
% \DescribeMacro{prepend / noprepend}
% The options |prepend| and |noprepend| can be used for setting
% whether a given caption should be prepended to the todonote or
% not.
% Globally this can be set using the |prependcaption| option for the
% package.~\todo[prepend, caption={Short note with prepend}]{A very
% long and tedious note that cannot be on one line in the list of
% todos.} Below is the effect of the option shown using the code:
% \todo[noprepend, caption={Short note with noprepend}]{A very long
% and tedious note that cannot be on one line in the list of
% todos.}
% \begin{verbatim}
% \todo[prepend, caption={Short note with prepend}]{A very long and tedious
% note that cannot be on one line in the list of todos.}.
% \todo[noprepend, caption={Short note with noprepend}]{A very long and
% tedious note that cannot be on one line in the list of todos.}.
% \end{verbatim}
%
% \DescribeMacro{fancyline}
% The |fancyline| option inserts a curved arrow, pointing from the inserted
% note to the insertion point.
% \todo[fancyline]{Testing.}
% The option is used like this:
% \begin{verbatim}
% \todo[fancyline]{Testing.}
% \end{verbatim}
%
%
% \DescribeMacro{author}
% The |author| option takes a parameter, the name of the author.
% The given name is inserted in the todonote.
% \todo[author=Xavier]{Testing author option.}
% \todo[author=Xavier, inline]{Testing author option.}
% \begin{verbatim}
% \todo[author=Xavier]{Testing author option.}
% \todo[author=Xavier, inline]{Testing author option.}
% \end{verbatim}
%
% \subsection{Options for the missingfigure command}
%
% \DescribeMacro{figwidth}
% The |figwidth=length| option sets the width of the figure inserted by the
% |\missingfigure| command.
% Length values below $6cm$ might trigger some problems with the
% visual appearance.
% Try to compare the default of the missing figure command, when the
% option is given or not.
% \begin{verbatim}
% \missingfigure[figwidth=6cm]{Testing a long text string}
% \end{verbatim}
% \missingfigure[figwidth=6cm]{Testing a long text string}
% \begin{verbatim}
% \missingfigure{Testing a long text string}
% \end{verbatim}
% \missingfigure{Testing a long text string}
% \begin{wrapfigure}[1]{r}[2cm]{6cm}
% \missingfigure[figwidth=6cm]{Add a test image \ldots}
% \end{wrapfigure}
% Another usage of the option is when |\missingfigure| is used in
% the wrapfigure environment.
% \begin{verbatim}
% \begin{wrapfigure}[1]{r}[2cm]{6cm}
% \missingfigure[figwidth=6cm]{Add a test image \ldots}
% \end{wrapfigure}
% \end{verbatim}
%
% \DescribeMacro{figheight}
% The |figheight=length| option changes the height of the inserted
% missing figure.
% The default height is 4cm and using values lower than this might
% cause the warning sign to pop out of the gray area.
% \begin{verbatim}
% \missingfigure[figheight=6cm]{Testing a long text string}
% \end{verbatim}
% \missingfigure[figheight=6cm]{Testing}
%
%
% \DescribeMacro{figcolor}
% The |figcolor=color| options sets the background color of
% inserted missing figures.
% The default color is |black!40|.
% \begin{verbatim}
% \missingfigure[figcolor=white]{Testing figcolor}
% \end{verbatim}
% \missingfigure[figcolor=white]{Testing figcolor}
%
% \subsection{Options for the listoftodos command}
% The |\listoftodos| command takes one optional argument, that
% defines the name of the inserted list of todos.
% \begin{verbatim}
% \listoftodos[I can be called anything]
% \end{verbatim}
%
%
%
% \subsection{Known issues}
% \subsubsection{Package loading order}
% The todonotes package requires the following packages.
% \begin{multicols}{2}
% \begin{itemize}
% \item ifthen
% \item xkeyval
% \item xcolor
% \item tikz
% \item calc
% \item graphicx (is loaded via the tikz package)
% \end{itemize}
% \end{multicols}
% \noindent
% When todonotes are loaded in the preamble, the package checks
% if these packages all are loaded. If that is not the case it loads
% the missing packages with no options given.
% If you want to give some specific options to some of these
% packages, you have to load them \emph{before} the todonotes
% package, otherwise you will get an ''Option clash'' error when
% latex works on the document.
%
% If both the menukeys and the xcolor (with the option \verb!table!)
% package should be loaded, the following order must be used.
% \begin{verbatim}
%\usepackage[table]{xcolor}
%\usepackage{todonotes}
%\usepackage{menukeys}
% \end{verbatim}
%
% \subsubsection{Spacing around inserted notes}
% Inserted todo commands will eat the white space after the command.
% \begin{verbatim}
%Testing\todo{Does this eat the space?} testing.\end{verbatim}
% \noindent
% Testing\todo{Does this eat the space?} testing.
%
% This can be prevented by adding curly parenthesis after the
% todo command, like shown below.
% \begin{verbatim}
%Testing\todo{Does this eat the space?}{} testing.\end{verbatim}
% \noindent
% Testing\todo{Does this eat the space?}{} testing.
%
% \subsubsection{Wrapping of long lines in list of todos}
% When a document is compiled with latex (and not pdflatex) long
% items in the list of todos are not wrapped into several lines, and
% do instead continue to the right out of the page.
%
%
% \subsubsection{Conflicts with the amsart documentclass}
% The |amsart| document class redefines some internal commands that
% is used by the todonotes package, this will cause an malfunctioning
% |\listoftodos| command.
% The following code to circumvent the problem was given by Dan
% Luecking on comp.text.tex
% \begin{verbatim}
% \makeatletter
% \providecommand\@dotsep{5}
% \makeatother
% \listoftodos\relax
% \end{verbatim}
%
% NOT TESTED
% NOT TESTED
% NOT TESTED
%
% Dominique suggests the following workaround.
% \begin{verbatim}
% \makeatletter
% \providecommand\@dotsep{5}
% \def\listtodoname{List of Todos}
% \def\listoftodos{\@starttoc{tdo}\listtodoname}
% \makeatother
% \end{verbatim}
%
%
%
% \subsubsection{Unknown option ''remember picture''}
% If latex throws the error
% \begin{verbatim}
% Package tikz Error: I do not know what to do with the option ``remember picture''.
% \end{verbatim}
% It probably means that your latex installation is outdated, as
% only newer versions of latex driver for tikz supports the
% |remember picture| option.
% For additional info consult
% ''Section 9.2.2 Producing PDF Output'' in the tikz manual.
% \url{http://www.ctan.org/tex-archive/graphics/pgf/base/doc/generic/pgf/pgfmanual.pdf}
%
%
% \subsubsection{Todonotes wrongly placed in the margin}
% When using some document classes or packages, the todonotes inserted in the
% page margin can be placed quite oddly.
% This is often caused by a wrong value of the |\marginparwidth| lenght.
% Try using the code below in your preamble to see if this cures the problem.
% \begin{verbatim}
% \setlength{\marginparwidth}{2cm}
% \end{verbatim}
%
% If the todonotes are inserted in the wrong margin, the solution is the
% |\reversemarginpar| command.
% When this command is issued the following marginpars (which todonotes
% relies on) is inserted in the other margin.
%
% \subsubsection{Reduce number of warnings}
% If the width of the inserted todonotes is forced to be larger than the
% available space in the margin, a lot of warnings are issued.
% This can be reduced with the following code.
% \begin{verbatim}
% \usepackage[textwidth=3.7cm]{todonotes}
% \setlength{\marginparwidth}{3.7cm}
% \end{verbatim}
%
%
% \subsubsection{Todonotes in footnotes}
% Placing todonotes in footnotes throws a lot of errors.
% Richard Stanton comes with the following work around.
% \begin{verbatim}
% \renewcommand{\marginpar}{\marginnote}
% \end{verbatim}
%
%
% \subsubsection{List of todo heading is not correctly formatted}
% If using natbib, the todonotes list title gets screwed up unless
% you do something like this:
% \begin{verbatim}
% \makeatletter\let\chapter\@undefined\makeatother
% \end{verbatim}
% Suggestion by Richard Stanton.
%
%
% \subsubsection{Trouble with classicthesis.sty}
% \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}.
%
% Solution by Stefan Kottwitz.
% The problem is caused by the redefinition of |\marginpar| in
% classicthesis.sty. |\marginpar| is used by todonotes.
% It can be fixed by restoring the original meaning, if you don't
% need the classicthesis marginpar style.
% Just add this to your document preamble:
% |\let\marginpar\oldmarginpar|
%
%
% \subsection{Things to improve}
% This is a list of things I consider to improve sometime in the
% future. It have not been done yet as I lack the time or skills to
% implement them.
% Patches with implementations of these tasks will be appreciated
% and might be included in the package if it will improve the
% package quality.
%
%
% \subsubsection{Owner information}
% Option for the todo command.
% \begin{verbatim}
% \todo[owner={Fabrice}]{Stuff}
% \end{verbatim}
% Add info on who ''owns'' the current todo.
% Idea: Fabrice Niessen
%
%
% \subsubsection{Due date}
% Option for the todo command.
% \begin{verbatim}
% \todo[due=2008-12-07]{Stuff}
% \end{verbatim}
% Add info on when the current todo is due.
% Might be enhanced by a time line of the todos that have a due date
% assigned.
% Idea: Fabrice Niessen
%
%
% \subsubsection{Mark accomplished todos}
% \begin{verbatim}
% \todo[done]{Stuff}
% \end{verbatim}
% Idea: Fabrice Niessen
%
%
%
%
%
% \subsection{Usage methods}
% In this section I have collected some different methods to use the
% |todonotes| package.
%
%
% \subsubsection{Define new commands with fixed options}
% Often there is a need for marking different classes of things to
% do (add reference, rewrite, \ldots).
% One way to do this, is to define some new commands as shown below
% (idea from Florent B.).
% \begin{verbatim}
% \newcommand{\addref}{\todo[color=red!40]{Add reference.}}
% \newcommand{\rewrite}[1]{\todo[color=green!40]{#1}}
% \end{verbatim}
% To distinguish between the different types of todos, the
% |todonotes| package can be loaded with the |colorinlistoftodos|
% option, which adds small colored squares to the list of todos.
% \begin{verbatim}
% \usepackage[colorinlistoftodos]{todonotes}
% \end{verbatim}
%
%
% \subsubsection{Define new commands with arbitrary default options}
% If you do not like the default values of the standard todo command,
% it is possible to define a new command with the similar
% functionality of |\todo| with custom default values.
% \begin{verbatim}
% \newcommand{\todoredefined}[2][]
% {\todo[color=red, #1]{#2}}
% \end{verbatim}
% \newcommand{\todoredefined}[2][]
% {\todo[color=red, #1]{#2}}
% \todoredefined{Test of newly defined command.}
% The new command can now be used like shown below
% \begin{verbatim}
% \todoredefined{Test of newly defined command.}
% \todoredefined[color=green]{Test of newly defined command, requesting a green color.}
% \end{verbatim}
% \todoredefined[color=green]{Test of newly defined command, requesting a green color.}
% This can be done with all the accepted options for the |\todo| command.
%
%
%
% \subsubsection{Enumerate todonotes}
%
% If the inserted todonotes should be enumerated, it is possible to define
% a new command with the desired behaviour.
% \begin{verbatim}
% \newcounter{todocounter}
% \newcommand{\todonum}[2][]
% {\stepcounter{todocounter}\todo[#1]{\thetodocounter: #2}}
% \end{verbatim}
% \newcounter{todocounter}
% \newcommand{\todonum}[2][]
% {\stepcounter{todocounter}\todo[#1]{\thetodocounter: #2}}
% The idea is to define a new counter |todocounter|, and insert the
% \todonum{A numbered todonote.}
% value of the counter in each todonote.
% The new command can be used like
% \todonum{Another numbered todonote.}
% \begin{verbatim}
% \todonum{A numbered todonote.}
% \todonum{Another numbered todonote.}
% \end{verbatim}
%
%
%
% \subsubsection{Comments ''a la Word''}
%
% Fabrice Niessen sent me the following use case.
% The idea is to define a new command |\mycomment| which adds a
% counter and optionally the initials of the author to the inserted
% todonote.
%
% \begin{verbatim}
% \newcounter{mycomment}
% \newcommand{\mycomment}[2][]{%
% % initials of the author (optional) + note in the margin
% \refstepcounter{mycomment}%
% {%
% \setstretch{0.7}% spacing
% \todo[color={red!100!green!33},size=\small]{%
% \textbf{Comment [\uppercase{#1}\themycomment]:}~#2}%
% }}
% \end{verbatim}
% \newcounter{mycomment}
% \newcommand{\mycomment}[2][]{%
% \refstepcounter{mycomment}%
% {%
% \setstretch{0.7}%
% \todo[color={red!100!green!33},size=\small]{%
% \textbf{Comment [\uppercase{#1}\themycomment]:}~#2}%
% }}
%
% The command |\mycomment[HSM]{Testing first time.}| is displayed
% \mycomment[HSM]{Testing first time.}%
% like shown in the left margin, and another call of the command is
% added below |\mycomment[HSM]{Testing second time.}|.
% \mycomment[HSM]{Testing second time.}%
%
%
%
% \subsubsection{Combination with the fixme package}
%
% Thomas Arildsen has mailed me this use case. Check the
% documentation for the |fixme| package, as the code below relies
% directly on it (the |\FDUser| command is augmented when
% |\begin{document}| is reached).
% \begin{verbatim}
% \usepackage[user,nomargin]{fixme}
% \usepackage{todonotes}
% \newcommand{\FXUser}[2]{\todo[inline,size=\small]{{\bfseries #1:} #2}}
% \end{verbatim}
%
%
%
% \subsubsection{Altering the line spacing of todonotes}
%
% The |setspace| package lets you alter the line spacing of smaller
% sections of your document. The primary construct is the
% |spacing| environment, which is demonstrated below.
% \begin{verbatim}
% \begin{spacing}{0.5}
% Some lines with a decreased line spacing. This is accomplished
% using the setspace package that is included in standard latex
% distributions.
% \end{spacing}
% \end{verbatim}
% \begin{spacing}{0.5}
% Some lines with a decreased line spacing. This is accomplished
% using the setspace package that is included in standard latex
% distributions.
% \end{spacing}
%
% \vspace{0.25cm}
% Using the |spacing| environment we can define a new todonote
% command using the code below:
% \begin{verbatim}
% \newcommand{\smalltodo}[2][]
% {\todo[caption={#2}, #1]
% {\begin{spacing}{0.5}#2\end{spacing}}}
% \end{verbatim}
% \newcommand{\smalltodo}[2][]
% {\todo[caption={#2}, #1]
% {\begin{spacing}{0.5}#2\end{spacing}}}
% Todonotes with decreased line spacing can now be inserted as
% follows
% \smalltodo[size=\footnotesize]{
% Some lines with a decreased line spacing. This is accomplished
% using the setspace package that is included in standard latex
% distributions.}
% \begin{verbatim}
% \smalltodo[size=\footnotesize]{
% Some lines with a decreased line spacing. This is accomplished
% using the setspace package that is included in standard latex
% distributions.}
% \end{verbatim}
%
% \noindent
% A different approach is given by Vitaly.
% \newcommand{\tinytodo}[2][]
% {\todo[caption={#2}, size=\small, #1]{\renewcommand{\baselinestretch}{0.5}\selectfont#2\par}}
% \begin{verbatim}
% \newcommand{\tinytodo}[2][]
% {\todo[caption={#2}, size=\small, #1]{\renewcommand{\baselinestretch}{0.5}\selectfont#2\par}}
% \end{verbatim}
% It looks like seen here.
% \tinytodo{
% Some lines with a decreased line spacing. This is accomplished
% without using any special packages.}
% \begin{verbatim}
% \tinytodo{
% Some lines with a decreased line spacing. This is accomplished
% without using any special packages.}
% \end{verbatim}
%
%
%
%
% \subsubsection{Marking new / old sections}
% Sometimes a whole section has to be marked by some means. You
% might want to try the following.
% \begin{verbatim}
% \todo[inline, caption={Some text}]{
% \begin{minipage}{\linewidth}
% Some text that might differ from the text given to the caption
% option.
% \end{minipage}
% }
% \end{verbatim}
% It is important to add the |caption={text}| option, otherwise
% latex will try to embed a minipage in the table of contents which
% triggers an error.
% Inside the minipage environment almost anything could be placed,
% except for other todo commands.
%
% To streamline use the following command was suggested by Stefan Pinnow.
% \newcommand\todoin[2][]{\todo[inline, caption={2do}, #1]{
% \begin{minipage}{\textwidth-4pt}#2\end{minipage}}}
% \begin{verbatim}
% \newcommand\todoin[2][]{\todo[inline, caption={2do}, #1]{
% \begin{minipage}{\textwidth-4pt}#2\end{minipage}}}
% \end{verbatim}
% This example renders like
% \begin{verbatim}
% \todoin{
% Some text.
% \begin{align}
% \sin(\theta)^2 + \cos(\theta)^2 = 1
% \end{align}
% A formula and a list
% \begin{itemize}
% \item An item
% \end{itemize}
% }
% \end{verbatim}
%
% \todoin{
% Some text.