summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/todonotes
diff options
context:
space:
mode:
authorDr. Clea F. Rees <cfrees@imapmail.org>2008-12-08 01:28:39 +0000
committerDr. Clea F. Rees <cfrees@imapmail.org>2008-12-08 01:28:39 +0000
commit483f7f233f9cc6004c32b5b1569a0d21f277e2fc (patch)
tree2a5bbf723866e49534706e87120aeaee359d0327 /Master/texmf-dist/tex/latex/todonotes
parente42a8e5ea29023f9e35316ec28cfad279efa9e55 (diff)
todonotes (update 2008/12/08)
git-svn-id: svn://tug.org/texlive/trunk@11550 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/todonotes')
-rw-r--r--Master/texmf-dist/tex/latex/todonotes/todonotes.sty218
1 files changed, 132 insertions, 86 deletions
diff --git a/Master/texmf-dist/tex/latex/todonotes/todonotes.sty b/Master/texmf-dist/tex/latex/todonotes/todonotes.sty
index c26c3d3ad27..b48b0bb4947 100644
--- a/Master/texmf-dist/tex/latex/todonotes/todonotes.sty
+++ b/Master/texmf-dist/tex/latex/todonotes/todonotes.sty
@@ -22,19 +22,37 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{todonotes}
- [2008/11/07 .dtx Todonotes source and documentation.]
+ [2008/12/07 .dtx Todonotes source and documentation.]
-\ProvidesPackage{todonotes}[2008/11/07]
+\ProvidesPackage{todonotes}[2008/12/07]
\RequirePackage{ifthen}
\RequirePackage{xkeyval}
\RequirePackage{hyperref}
\RequirePackage{xcolor}
\RequirePackage{tikz}
\RequirePackage{calc}
+\newcommand{\@todonotes@text}{}%
\newcommand{\@todonotes@backgroundcolor}{orange}
+\newcommand{\@todonotes@linecolor}{orange}
\newcommand{\@todonotes@bordercolor}{black}
\newcommand{\@todonotes@textwidth}{\marginparwidth}
+\newcommand{\@todonotes@todolistname}{Todo list}
+\newcommand{\@todonotes@MissingFigureUp}{Missing}
+\newcommand{\@todonotes@MissingFigureDown}{figure}
+\newcommand{\@todonotes@SetTodoListName}[1]{\renewcommand{\todolistname}{#1}}
+\newcommand{\@todonotes@SetMissingFigureUp}[1]{\renewcommand{\MissingFigureUp}{#1}}
+\providecommand{\SetMissingFigureDown}[1]{\renewcommand{\MissingFigureDown}{#1}}
+\DeclareOptionX{danish}{%
+ \@todonotes@SetTodoListName{G\o{}rem\aa{}lsliste}%
+ \@todonotes@SetMissingFigureUp{Manglende}%
+ \@todonotes@SetMissingFigureDown{figur}%
+}
+\DeclareOptionX{german}{%
+ \@todonotes@SetTodoListName{Liste der noch zu erledigenden Punkte}%
+ \@todonotes@SetMissingFigureUp{Fehlende}%
+ \@todonotes@SetMissingFigureDown{Abbildung}%
+}
\newif{\if@todonotes@disabled}
\DeclareOptionX{disable}{\@todonotes@disabledtrue}
\newif{\if@todonotes@colorinlistoftodos}
@@ -42,15 +60,34 @@
\newif{\if@todonotes@dviStyle}
\DeclareOptionX{dvistyle}{\@todonotes@dviStyletrue}
\define@key{todonotes.sty}%
- {color}{\renewcommand{\@todonotes@backgroundcolor}{#1}}
+ {color}{
+ \renewcommand{\@todonotes@backgroundcolor}{#1}
+ \renewcommand{\@todonotes@linegroundcolor}{#1}}
+\define@key{todonotes.sty}%
+ {backgroundcolor}{\renewcommand{\@todonotes@backgroundcolor}{#1}}
+\define@key{todonotes.sty}%
+ {linecolor}{\renewcommand{\@todonotes@linecolor}{#1}}
\define@key{todonotes.sty}%
{bordercolor}{\renewcommand{\@todonotes@bordercolor}{#1}}
+\newif{\if@todonotes@prependcaption}
+\@todonotes@prependcaptionfalse
+\DeclareOptionX{prependcaption}{\@todonotes@prependcaptiontrue}
\define@key{todonotes.sty}%
{textwidth}{\renewcommand{\@todonotes@textwidth}{#1}}
\ProcessOptionsX
-\newcommand{\@todonotes@fillcolor}{}%
-\define@key{todonotes}{color}{\renewcommand{\@todonotes@fillcolor}{#1}}%
+\newcommand{\@todonotes@currentlinecolor}{}%
+\newcommand{\@todonotes@currentbackgroundcolor}{}%
+\newcommand{\@todonotes@currentbordercolor}{}%
+\define@key{todonotes}{color}{%
+ \renewcommand{\@todonotes@currentlinecolor}{#1}%
+ \renewcommand{\@todonotes@currentbackgroundcolor}{#1}}%
+\define@key{todonotes}{linecolor}{%
+ \renewcommand{\@todonotes@currentlinecolor}{#1}}%
+\define@key{todonotes}{backgroundcolor}{%
+ \renewcommand{\@todonotes@currentbackgroundcolor}{#1}}%
+\define@key{todonotes}{bordercolor}{%
+ \renewcommand{\@todonotes@currentbordercolor}{#1}}%
\newcommand{\@todonotes@sizecommand}{}%
\define@key{todonotes}{size}{\renewcommand{\@todonotes@sizecommand}{#1}}%
\newif\if@todonotes@appendtolistoftodos%
@@ -65,54 +102,76 @@
\newcommand{\@todonotes@caption}{}%
\newif\if@todonotes@captiongiven%
\define@key{todonotes}{caption}%
-{\renewcommand{\@todonotes@caption}{#1}%
-\@todonotes@captiongiventrue}%
-\presetkeys
- {todonotes}
- {color=\@todonotes@backgroundcolor, noinline,
+ {\renewcommand{\@todonotes@caption}{#1}%
+ \@todonotes@captiongiventrue}%
+\presetkeys%
+ {todonotes}%
+ {linecolor=\@todonotes@linecolor,%
+ backgroundcolor=\@todonotes@backgroundcolor,%
+ bordercolor=\@todonotes@bordercolor,%
+ noinline,%
line, list, size=\normalsize}{}%
-\if@todonotes@disabled
+\if@todonotes@disabled%
\newcommand{\listoftodos}{}
- \newcommand{\todo}[2][]{}
+ \newcommand{\todo}[2][]{\ignotespaces}
\newcommand{\missingfigure}[1]{}
\else % \if@todonotes@disabled
\newcommand{\listoftodos}
- {\section*{Todo list} \@starttoc{tdo}}
+ {\section*{\@todonotes@todolistname} \@starttoc{tdo}}
\newcommand{\l@todo}
{\@dottedtocline{1}{0em}{2.3em}}
-\tikzstyle{notestyle} = [draw=\@todonotes@bordercolor, line width=0.5pt,
- text width = \@todonotes@textwidth - 1.6 ex - 1pt, inner sep = 0.8 ex]
-\tikzstyle{notestyleleft} = [notestyle, left]
-\tikzstyle{connectstyle} = [thick]
-\tikzstyle{inlinenotestyle} = [notestyle, text width=\linewidth - 1.6 ex - 1 pt]
+\tikzstyle{notestyle} = [
+ draw=\@todonotes@currentbordercolor,
+ fill=\@todonotes@currentbackgroundcolor,
+ line width=0.5pt,
+ text width = \@todonotes@textwidth - 1.6 ex - 1pt,
+ inner sep = 0.8 ex]
+\tikzstyle{notestyleleft} = [
+ notestyle,
+ left]
+\tikzstyle{connectstyle} = [
+ thick,
+ draw=\@todonotes@currentlinecolor]
+\tikzstyle{inlinenotestyle} = [
+ notestyle,
+ text width=\linewidth - 1.6 ex - 1 pt]
\newcommand{\todo}[2][]{%
+\renewcommand{\@todonotes@text}{#2}%
\renewcommand{\@todonotes@caption}{#2}%
\setkeys{todonotes}{#1}%
\if@todonotes@appendtolistoftodos%
\phantomsection%
-\if@todonotes@captiongiven%
-\else%
-\renewcommand{\@todonotes@caption}{#2}
-\fi%
+ \if@todonotes@captiongiven%
+ \else%
+ \renewcommand{\@todonotes@caption}{#2}%
+ \fi%
\if@todonotes@colorinlistoftodos%
\addcontentsline{tdo}{todo}{\protect{%
- \colorbox{\@todonotes@fillcolor}{\textcolor{\@todonotes@fillcolor}{\tiny i}} %
+ \colorbox{\@todonotes@currentbackgroundcolor}%
+ {\textcolor{\@todonotes@currentbackgroundcolor}{\tiny i}}%
\@todonotes@caption}}%
\else%
\addcontentsline{tdo}{todo}{\protect{\@todonotes@caption}}%
\fi%
\fi%
+\if@todonotes@captiongiven
+ \if@todonotes@prependcaption
+ \renewcommand{\@todonotes@text}{\@todonotes@caption: #2}
+ \fi
+\fi
\if@todonotes@inlinenote%
\if@todonotes@dviStyle%
- {\par\noindent\begin{tikzpicture}[remember picture] \draw node[inlinenotestyle, %
- fill=\@todonotes@fillcolor] {};\end{tikzpicture}\par}%
- {\noindent \@todonotes@sizecommand #2}%
- {\par\noindent\begin{tikzpicture}[remember picture] \draw node[inlinenotestyle, %
- fill=\@todonotes@fillcolor] {};\end{tikzpicture}\par}%
+ {\par\noindent\begin{tikzpicture}[remember picture]%
+ \draw node[inlinenotestyle] {};\end{tikzpicture}\par}%
+ {\noindent \@todonotes@sizecommand \@todonotes@text}%
+ {\par\noindent\begin{tikzpicture}[remember picture]%
+ \draw node[inlinenotestyle] {};\end{tikzpicture}\par}%
\else%
- {\par\noindent\begin{tikzpicture}[remember picture] \draw node[inlinenotestyle, %
- fill=\@todonotes@fillcolor] {\@todonotes@sizecommand #2};\end{tikzpicture}\par}%
+ {\par\noindent\begin{tikzpicture}[remember picture]%
+ \draw node[inlinenotestyle] {\@todonotes@sizecommand
+\@todonotes@text};%
+ \end{tikzpicture}\par}%
\fi%
\else%
\begin{tikzpicture}[remember picture, baseline=-0.75ex]%
@@ -120,70 +179,57 @@
\end{tikzpicture}%
\marginpar[{% Draw note in left margin
\if@todonotes@dviStyle%
- \begin{tikzpicture}[remember picture] %
-\draw node[notestyle, fill=\@todonotes@fillcolor] {}; %
-\end{tikzpicture}\\ %
+ \begin{tikzpicture}[remember picture]%
+ \draw node[notestyle] {};%
+ \end{tikzpicture}\\ %
\begin{minipage}{\@todonotes@textwidth}%
- \@todonotes@sizecommand #2%
- \end{minipage} \\%
- \begin{tikzpicture}[remember picture] %
-\draw node[notestyle, fill=\@todonotes@fillcolor] (inNote) {};%
-\end{tikzpicture}%
- \if@todonotes@line%
- \begin{tikzpicture}[remember picture, overlay]%
- \draw[connectstyle, draw=\@todonotes@fillcolor]%
- ([yshift=-0.2cm] inText)%
- -| ([xshift=0.2cm] inNote.east)%
- -| (inNote.east);%
- \end{tikzpicture}%
- \fi%
+ \@todonotes@sizecommand \@todonotes@text%
+ \end{minipage}\\%
+ \begin{tikzpicture}[remember picture]%
+ \draw node[notestyle] (inNote) {};%
+ \end{tikzpicture}%
\else%
- \begin{tikzpicture}[remember picture] %
-\draw node[notestyle, fill=\@todonotes@fillcolor] (inNote) %
-{\@todonotes@sizecommand #2}; %
-\end{tikzpicture}%
- \if@todonotes@line%
- \begin{tikzpicture}[remember picture, overlay]%
- \draw[connectstyle, draw=\@todonotes@fillcolor]%
- ([yshift=-0.2cm] inText)%
- -| ([xshift=0.2cm] inNote.east)%
- -| (inNote.east);%
- \end{tikzpicture}%
- \fi%
+ \begin{tikzpicture}[remember picture]%
+ \draw node[notestyle] (inNote)%
+ {\@todonotes@sizecommand \@todonotes@text};%
+ \end{tikzpicture}%
+\fi%
+\if@todonotes@line%
+ \begin{tikzpicture}[remember picture, overlay]%
+ \draw[connectstyle]%
+ ([yshift=-0.2cm] inText)%
+ -| ([xshift=0.2cm] inNote.east)%
+ -| (inNote.east);%
+ \end{tikzpicture}%
\fi%
}]{% Draw note in right margin
\if@todonotes@dviStyle%
- \begin{tikzpicture}[remember picture] %
-\draw node[notestyle, fill=\@todonotes@fillcolor] {}; %
-\end{tikzpicture} \\ %
+ \begin{tikzpicture}[remember picture]%
+ \draw node[notestyle] {};%
+ \end{tikzpicture}\\%
\begin{minipage}{\@todonotes@textwidth}%
- \@todonotes@sizecommand #2%
- \end{minipage} \\%
- \begin{tikzpicture}[remember picture] %
-\draw node[notestyle, fill=\@todonotes@fillcolor] (inNote) {};%
-\end{tikzpicture} %
- \if@todonotes@line%
- \begin{tikzpicture}[remember picture, overlay]%
- \draw[connectstyle, draw=\@todonotes@fillcolor]%
- ([yshift=-0.2cm] inText)%
- -| ([xshift=-0.2cm] inNote.west)%
- -| (inNote.west);%
- \end{tikzpicture}%
- \fi%
+ \@todonotes@sizecommand \@todonotes@text%
+ \end{minipage}\\%
+ \begin{tikzpicture}[remember picture]%
+ \draw node[notestyle] (inNote) {};%
+ \end{tikzpicture}%
\else%
- \begin{tikzpicture}[remember picture] \draw node[notestyle, fill=\@todonotes@fillcolor]
-(inNote) {\@todonotes@sizecommand #2}; \end{tikzpicture}%
- \if@todonotes@line%
- \begin{tikzpicture}[remember picture, overlay]%
- \draw[connectstyle, draw=\@todonotes@fillcolor]%
- ([yshift=-0.2cm] inText)%
- -| ([xshift=-0.2cm] inNote.west)%
- -| (inNote.west);%
- \end{tikzpicture}%
- \fi%
+ \begin{tikzpicture}[remember picture]%
+ \draw node[notestyle](inNote)%
+ {\@todonotes@sizecommand \@todonotes@text};%
+ \end{tikzpicture}%
+\fi%
+\if@todonotes@line%
+ \begin{tikzpicture}[remember picture, overlay]%
+ \draw[connectstyle]%
+ ([yshift=-0.2cm] inText)%
+ -| ([xshift=-0.2cm] inNote.west)%
+ -| (inNote.west);%
+ \end{tikzpicture}%
\fi%
}%
\fi%
+\ignorespaces%
}%
\newcommand{\missingfigure}[1]{
\addcontentsline{tdo}{todo}{Figure: \protect{#1}}%
@@ -195,8 +241,8 @@
\draw (3, 0) node[right, text width=4cm] {#1};
\draw[red, fill=white, rounded corners = 5pt, line width=10pt]
(30:2cm) -- (150:2cm) -- (270:2cm) -- cycle;
-\draw (0, 0.3) node {Missing};
-\draw (0, -0.3) node {figure};
+\draw (0, 0.3) node {\@todonotes@MissingFigureUp};
+\draw (0, -0.3) node {\@todonotes@MissingFigureDown};
\end{tikzpicture}
}% Ending \missingfigure command
\fi % Ending \@todonotes@ifdisabled