2 %% This is file `todonotes.sty',
3 %% generated with the docstrip utility.
5 %% The original source files were:
7 %% todonotes.dtx (with options: `package')
9 %% This is a generated file.
11 %% Copyright (C) 2008 by Henrik Skov Midtiby <henrikmidtiby@gmail.com>
13 %% This file may be distributed and/or modified under the conditions of
14 %% the LaTeX Project Public License, either version 1.2 of this license
15 %% or (at your option) any later version. The latest version of this
18 %% http://www.latex-project.org/lppl.txt
20 %% and version 1.2 or later is part of all distributions of LaTeX version
21 %% 1999/12/01 or later.
23 \NeedsTeXFormat{LaTeX2e
}[1999/
12/
01]
24 \ProvidesPackage{todonotes
}
25 [2010/
09/
26 .dtx Todonotes source and documentation.
]
27 \ProvidesPackage{todonotes
}[2010/
09/
26]
28 \RequirePackage{ifthen
}
29 \RequirePackage{xkeyval
}
30 \RequirePackage{xcolor
}
33 \newcommand{\@todonotes@text
}{}%
34 \newcommand{\@todonotes@backgroundcolor
}{orange
}
35 \newcommand{\@todonotes@linecolor
}{orange
}
36 \newcommand{\@todonotes@bordercolor
}{black
}
37 \newcommand{\@todonotes@textwidth
}{\marginparwidth}
38 \newcommand{\@todonotes@textsize
}{\normalsize}
39 \newcommand{\@todonotes@figwidth
}{\columnwidth}
41 \ifx\undefined\phantomsection
42 \newcommand{\phantomsection}{}
46 \newcommand{\@todonotes@todolistname
}{Todo list
}
47 \newcommand{\@todonotes@MissingFigureText
}{Figure
}
48 \newcommand{\@todonotes@MissingFigureUp
}{Missing
}
49 \newcommand{\@todonotes@MissingFigureDown
}{figure
}
50 \newcommand{\@todonotes@SetTodoListName
}[1]
51 {\renewcommand{\@todonotes@todolistname
}{#1}}
52 \newcommand{\@todonotes@SetMissingFigureText
}[1]
53 {\renewcommand{\@todonotes@MissingFigureText
}{#1}}
54 \newcommand{\@todonotes@SetMissingFigureUp
}[1]
55 {\renewcommand{\@todonotes@MissingFigureUp
}{#1}}
56 \newcommand{\@todonotes@SetMissingFigureDown
}[1]
57 {\renewcommand{\@todonotes@MissingFigureDown
}{#1}}
58 \newif{\if@todonotes@reverseMissingFigureTriangle
}
59 \DeclareOptionX{catalan
}{
60 \@todonotes@SetTodoListName
{Llista de feines pendents
}%
61 \@todonotes@SetMissingFigureText
{Figura
}%
62 \@todonotes@SetMissingFigureUp
{Figura
}%
63 \@todonotes@SetMissingFigureDown
{pendent
}%
65 \DeclareOptionX{danish
}{%
66 \@todonotes@SetTodoListName
{G
\o{}rem
\aa{}lsliste
}%
67 \@todonotes@SetMissingFigureText
{Figur
}%
68 \@todonotes@SetMissingFigureUp
{Manglende
}%
69 \@todonotes@SetMissingFigureDown
{figur
}%
71 \DeclareOptionX{dutch
}{%
72 \@todonotes@SetTodoListName
{Lijst van onafgewerkte taken
}%
73 \@todonotes@SetMissingFigureText
{Figuur
}%
74 \@todonotes@SetMissingFigureUp
{Ontbrekende
}%
75 \@todonotes@SetMissingFigureDown
{figuur
}%
77 \DeclareOptionX{english
}{%
78 \@todonotes@SetTodoListName
{Todo list
}%
79 \@todonotes@SetMissingFigureText
{Figure
}%
80 \@todonotes@SetMissingFigureUp
{Missing
}%
81 \@todonotes@SetMissingFigureDown
{figure
}%
83 \DeclareOptionX{french
}{%
84 \@todonotes@SetTodoListName
{Liste des points \`a traiter
}%
85 \@todonotes@SetMissingFigureText
{Figure
}%
86 \@todonotes@SetMissingFigureUp
{Figure
}%
87 \@todonotes@SetMissingFigureDown
{manquante
}%
88 \@todonotes@reverseMissingFigureTrianglefalse
90 \DeclareOptionX{german
}{%
91 \@todonotes@SetTodoListName
{Liste der noch zu erledigenden Punkte
}%
92 \@todonotes@SetMissingFigureText
{Abbildung
}%
93 \@todonotes@SetMissingFigureUp
{Fehlende
}%
94 \@todonotes@SetMissingFigureDown
{Abbildung
}%
96 \DeclareOptionX{italian
}{
97 \@todonotes@SetTodoListName
{Elenco delle cose da fare
}%
98 \@todonotes@SetMissingFigureText
{Figura
}%
99 \@todonotes@SetMissingFigureUp
{Figura
}%
100 \@todonotes@SetMissingFigureDown
{mancante
}%
102 \DeclareOptionX{ngerman}{%
103 \@todonotes@SetTodoListName
{Liste der noch zu erledigenden Punkte
}%
104 \@todonotes@SetMissingFigureText
{Abbildung
}%
105 \@todonotes@SetMissingFigureUp
{Fehlende
}%
106 \@todonotes@SetMissingFigureDown
{Abbildung
}%
108 \DeclareOptionX{portuguese
}{
109 \@todonotes@SetTodoListName
{Lista de tarefas pendentes
}%
110 \@todonotes@SetMissingFigureText
{Figura
}%
111 \@todonotes@SetMissingFigureUp
{Figura
}%
112 \@todonotes@SetMissingFigureDown
{pendente
}%
114 \DeclareOptionX{spanish
}{
115 \@todonotes@SetTodoListName
{Lista de tareas pendientes
}%
116 \@todonotes@SetMissingFigureText
{Figura
}%
117 \@todonotes@SetMissingFigureUp
{Figura
}%
118 \@todonotes@SetMissingFigureDown
{pendient
}%
120 \newcounter{@todonotes@numberoftodonotes
}
121 \newif{\if@todonotes@obeyDraft
}
122 \DeclareOptionX{obeyDraft
}{\@todonotes@obeyDrafttrue
}
123 \newif{\if@todonotes@isDraft
}
124 \DeclareOptionX{draft
}{\@todonotes@isDrafttrue
}
125 \newif{\if@todonotes@disabled
}
126 \DeclareOptionX{disable
}{\@todonotes@disabledtrue
}
127 \newif{\if@todonotes@colorinlistoftodos
}
128 \DeclareOptionX{colorinlistoftodos
}{\@todonotes@colorinlistoftodostrue
}
129 \newif{\if@todonotes@dviStyle
}
130 \DeclareOptionX{dvistyle
}{\@todonotes@dviStyletrue
}
131 \define@key
{todonotes.sty
}%
133 \renewcommand{\@todonotes@backgroundcolor
}{#1}
134 \renewcommand{\@todonotes@linecolor
}{#1}}
135 \define@key
{todonotes.sty
}%
136 {backgroundcolor
}{\renewcommand{\@todonotes@backgroundcolor
}{#1}}
137 \define@key
{todonotes.sty
}%
138 {linecolor
}{\renewcommand{\@todonotes@linecolor
}{#1}}
139 \define@key
{todonotes.sty
}%
140 {bordercolor
}{\renewcommand{\@todonotes@bordercolor
}{#1}}
141 \newif{\if@todonotes@prependcaptionglobal
}
142 \@todonotes@prependcaptionglobalfalse
143 \DeclareOptionX{prependcaption
}{\@todonotes@prependcaptionglobaltrue
}
144 \define@key
{todonotes.sty
}%
145 {textwidth
}{\renewcommand{\@todonotes@textwidth
}{#1}}
146 \define@key
{todonotes.sty
}%
147 {textsize
}{\renewcommand{\@todonotes@textsize
}{\csname #1\endcsname}}
148 \newif{\if@todonotes@shadowenabled
}
149 \@todonotes@shadowenabledfalse
150 \DeclareOptionX{shadow
}{\@todonotes@shadowenabledtrue
151 \usetikzlibrary{shadows
}}
152 \define@key
{todonotes.sty
}%
153 {figwidth
}{\renewcommand{\@todonotes@figwidth
}{#1}}
155 \if@todonotes@disabled
157 \if@todonotes@obeyDraft
158 \@todonotes@disabledtrue
159 \if@todonotes@isDraft
160 \@todonotes@disabledfalse
165 \newcommand{\@todonotes@currentlinecolor
}{}%
166 \newcommand{\@todonotes@currentbackgroundcolor
}{}%
167 \newcommand{\@todonotes@currentbordercolor
}{}%
168 \define@key
{todonotes
}{color}{%
169 \renewcommand{\@todonotes@currentlinecolor
}{#1}%
170 \renewcommand{\@todonotes@currentbackgroundcolor
}{#1}}%
171 \define@key
{todonotes
}{linecolor
}{%
172 \renewcommand{\@todonotes@currentlinecolor
}{#1}}%
173 \define@key
{todonotes
}{backgroundcolor
}{%
174 \renewcommand{\@todonotes@currentbackgroundcolor
}{#1}}%
175 \define@key
{todonotes
}{bordercolor
}{%
176 \renewcommand{\@todonotes@currentbordercolor
}{#1}}%
177 \newcommand{\@todonotes@sizecommand
}{}%
178 \define@key
{todonotes
}{size
}{\renewcommand{\@todonotes@sizecommand
}{#1}}%
179 \newif\if@todonotes@localdisable
%
180 \define@key
{todonotes
}{disable
}[]{\@todonotes@localdisabletrue
}%
181 \define@key
{todonotes
}{nodisable
}[]{\@todonotes@localdisablefalse
}%
182 \newif\if@todonotes@appendtolistoftodos
%
183 \define@key
{todonotes
}{list
}[]{\@todonotes@appendtolistoftodostrue
}%
184 \define@key
{todonotes
}{nolist
}[]{\@todonotes@appendtolistoftodosfalse
}%
185 \newif\if@todonotes@inlinenote
%
186 \define@key
{todonotes
}{inline
}[]{\@todonotes@inlinenotetrue
}%
187 \define@key
{todonotes
}{noinline
}[]{\@todonotes@inlinenotefalse
}%
188 \newif\if@todonotes@prependcaption
%
189 \define@key
{todonotes
}{prepend
}[]{\@todonotes@prependcaptiontrue
}%
190 \define@key
{todonotes
}{noprepend
}[]{\@todonotes@prependcaptionfalse
}%
191 \newif\if@todonotes@line
%
192 \define@key
{todonotes
}{line
}[]{\@todonotes@linetrue
}%
193 \define@key
{todonotes
}{noline
}[]{\@todonotes@linefalse
}%
194 \newcommand{\@todonotes@caption
}{}%
195 \newif\if@todonotes@captiongiven
%
196 \define@key
{todonotes
}{caption
}%
197 {\renewcommand{\@todonotes@caption
}{#1}%
198 \@todonotes@captiongiventrue
}%
199 \define@key
{todonotes
}{nocaption
}[]{\@todonotes@captiongivenfalse
}%
200 \newcommand{\@todonotes@currentfigwidth
}{\@todonotes@figwidth
}
201 \define@key
{todonotes
}%
202 {figwidth
}{\renewcommand{\@todonotes@currentfigwidth
}{#1}}
205 {linecolor=\@todonotes@linecolor,
%
206 backgroundcolor=\@todonotes@backgroundcolor,
%
207 bordercolor=\@todonotes@bordercolor,
%
211 figwidth=\@todonotes@figwidth,
%
212 line, list, size=\@todonotes@textsize
}{}%
213 \if@todonotes@disabled
%
214 \newcommand{\listoftodos}[1][]{}
215 \newcommand{\@todo
}[2][]{\ignorespaces}
216 \newcommand{\missingfigure}[2][]{}
217 \else % \if@todonotes@disabled
218 \newcommand{\listoftodos}[1][\@todonotes@todolistname
]
219 {\ifdefined\chapter\chapter*
{#1}\else\section*
{#1}\fi \@starttoc
{tdo
}}
221 {\@dottedtocline
{1}{0em
}{2.3em
}}
222 \tikzstyle{notestyleraw
} =
[
223 draw=\@todonotes@currentbordercolor,
224 fill=\@todonotes@currentbackgroundcolor,
226 text width = \@todonotes@textwidth -
1.6 ex -
1pt,
229 \if@todonotes@shadowenabled
230 \tikzstyle{notestyle
} =
[notestyleraw,
231 general shadow=
{shadow xshift=
.5ex, shadow yshift=-
.5ex,
232 opacity=
1,fill=black!
50}]
234 \tikzstyle{notestyle
} =
[notestyleraw
]
236 \tikzstyle{notestyleleft
} =
[
239 \tikzstyle{connectstyle
} =
[
241 draw=\@todonotes@currentlinecolor
]
242 \tikzstyle{inlinenotestyle
} =
[
244 text width=
\linewidth -
1.6 ex -
1 pt
]
245 \newcommand{\@todo
}[2][]{%
246 \if@todonotes@prependcaptionglobal
%
247 \@todonotes@prependcaptiontrue
%
249 \@todonotes@prependcaptionfalse
%
251 \renewcommand{\@todonotes@text
}{#2}%
252 \renewcommand{\@todonotes@caption
}{#2}%
253 \setkeys{todonotes
}{#1}%
254 \if@todonotes@localdisable
%
256 \addtocounter{@todonotes@numberoftodonotes
}{1}%
257 \if@todonotes@appendtolistoftodos
%
259 \if@todonotes@captiongiven
%
261 \renewcommand{\@todonotes@caption
}{#2}%
263 \@todonotes@addElementToListOfTodos
265 \if@todonotes@captiongiven
%
266 \if@todonotes@prependcaption
%
267 \renewcommand{\@todonotes@text
}{\@todonotes@caption:
#2}%
270 \if@todonotes@inlinenote
%
271 \@todonotes@drawInlineNote
273 \@todonotes@drawMarginNoteWithLine
274 \fi %\if@todonotes@inlinenote
275 \fi %\if@todonotes@localdisable
278 \newcommand{\@todonotes@drawMarginNoteWithLine
}{%
279 \begin{tikzpicture
}[remember picture, baseline=-
0.75ex
]%
280 \node [coordinate
] (inText)
{};
%
282 \marginpar[{% Draw note in left margin
283 \@todonotes@drawMarginNote
%
284 \@todonotes@drawLineToLeftMargin
%
285 }]{% Draw note in right margin
286 \@todonotes@drawMarginNote
%
287 \@todonotes@drawLineToRightMargin
%
290 \newcommand{\@todonotes@addElementToListOfTodos
}{%
291 \if@todonotes@colorinlistoftodos
%
292 \addcontentsline{tdo
}{todo
}{\protect{%
293 \colorbox{\@todonotes@currentbackgroundcolor
}%
294 {\textcolor{\@todonotes@currentbackgroundcolor
}{o
}}%
295 \ \@todonotes@caption
}}%
297 \addcontentsline{tdo
}{todo
}{\protect{\@todonotes@caption
}}%
299 \newcommand{\@todonotes@drawInlineNote
}{%
300 \if@todonotes@dviStyle
%
301 {\par\noindent\begin{tikzpicture
}[remember picture
]%
302 \draw node
[inlinenotestyle
] {};
\end{tikzpicture
}\par}%
303 {\noindent \@todonotes@sizecommand \@todonotes@text
}%
304 {\par\noindent\begin{tikzpicture
}[remember picture
]%
305 \draw node
[inlinenotestyle
] {};
\end{tikzpicture
}\par}%
307 {\par\noindent\begin{tikzpicture
}[remember picture
]%
308 \draw node
[inlinenotestyle
] {\@todonotes@sizecommand \@todonotes@text
};
%
309 \end{tikzpicture
}\par}%
311 \newcommand{\@todonotes@drawMarginNote
}{%
312 \if@todonotes@dviStyle
%
313 \begin{tikzpicture
}[remember picture
]%
314 \draw node
[notestyle
] {};
%
315 \end{tikzpicture
}\\
%
316 \begin{minipage
}{\@todonotes@textwidth
}%
317 \@todonotes@sizecommand \@todonotes@text
%
319 \begin{tikzpicture
}[remember picture
]%
320 \draw node
[notestyle
] (inNote)
{};
%
323 \begin{tikzpicture
}[remember picture
]%
324 \draw node
[notestyle
] (inNote)
%
325 {\@todonotes@sizecommand \@todonotes@text
};
%
328 \newcommand{\@todonotes@drawLineToRightMargin
}{%
330 \begin{tikzpicture
}[remember picture, overlay
]%
332 (
[yshift=-
0.2cm
] inText)
%
333 -| (
[xshift=-
0.2cm
] inNote.west)
%
337 \newcommand{\@todonotes@drawLineToLeftMargin
}{
339 \begin{tikzpicture
}[remember picture, overlay
]%
341 (
[yshift=-
0.2cm
] inText)
%
342 -| (
[xshift=
0.2cm
] inNote.east)
%
346 \newcommand{\missingfigure}[2][]{
347 \setkeys{todonotes
}{#1}%
348 \addcontentsline{tdo
}{todo
}{\@todonotes@MissingFigureText:
\protect{#2}}%
352 \draw[fill=black!
40, draw = white, line width=
0pt
]
353 (-
2, -
2.5) rectangle +(\@todonotes@currentfigwidth,
4cm);
354 \draw (
2, -
0.3) node
[right, text
355 width=\@todonotes@currentfigwidth-
4.5cm
] {#2};
356 \draw[red, fill=white, rounded corners =
5pt, line width=
10pt
]
357 (
30:
2cm) -- (
150:
2cm) -- (
270:
2cm) -- cycle;
358 \draw (
0,
0.3) node
{\@todonotes@MissingFigureUp
};
359 \draw (
0, -
0.3) node
{\@todonotes@MissingFigureDown
};
361 }% Ending \missingfigure command
362 \fi % Ending \@todonotes@ifdisabled
363 \newcommand{\todototoc}
365 \if@todonotes@disabled
367 \addcontentsline{toc
}{\@ifundefined
{chapter
}{section
}{chapter
}}{\@todonotes@todolistname
}
370 \newcommand{\todo}[2][]{\@todo
[#1]{#2}}
373 %% End of file `todonotes.sty'.