summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/todonotes
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-01-14 00:15:21 +0000
committerKarl Berry <karl@freefriends.org>2009-01-14 00:15:21 +0000
commit46e27c02c3e31502a5f55cf2cbe3c69edc033742 (patch)
tree40b878e1eb9db4328b3ab356c3b09aa54ba89afe /Master/texmf-dist/tex/latex/todonotes
parent1cf000674b16b9f15f3c5112f70c07a08e8bb5de (diff)
todonotes (10jan09)
git-svn-id: svn://tug.org/texlive/trunk@11861 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/todonotes')
-rw-r--r--Master/texmf-dist/tex/latex/todonotes/todonotes.sty112
1 files changed, 85 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/latex/todonotes/todonotes.sty b/Master/texmf-dist/tex/latex/todonotes/todonotes.sty
index ae35d16af8b..ae601f22380 100644
--- a/Master/texmf-dist/tex/latex/todonotes/todonotes.sty
+++ b/Master/texmf-dist/tex/latex/todonotes/todonotes.sty
@@ -22,9 +22,9 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{todonotes}
- [2008/12/27 .dtx Todonotes source and documentation.]
+ [2009/01/09 .dtx Todonotes source and documentation.]
-\ProvidesPackage{todonotes}[2008/12/27]
+\ProvidesPackage{todonotes}[2009/01/09]
\RequirePackage{ifthen}
\RequirePackage{xkeyval}
\RequirePackage{hyperref}
@@ -36,23 +36,50 @@
\newcommand{\@todonotes@linecolor}{orange}
\newcommand{\@todonotes@bordercolor}{black}
\newcommand{\@todonotes@textwidth}{\marginparwidth}
+\newcommand{\@todonotes@textsize}{\normalsize}
+\newcommand{\@todonotes@figwidth}{\textwidth}
\newcommand{\@todonotes@todolistname}{Todo list}
+\newcommand{\@todonotes@MissingFigureText}{Figure}
\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}}
+\newcommand{\@todonotes@SetTodoListName}[1]{\renewcommand{\@todonotes@todolistname}{#1}}
+\newcommand{\@todonotes@SetMissingFigureText}[1]{\renewcommand{\@todonotes@MissingFigureText}{#1}}
+\newcommand{\@todonotes@SetMissingFigureUp}[1]{\renewcommand{\@todonotes@MissingFigureUp}{#1}}
+\newcommand{\@todonotes@SetMissingFigureDown}[1]{\renewcommand{\@todonotes@MissingFigureDown}{#1}}
+\newif{\if@todonotes@reverseMissingFigureTriangle}
\DeclareOptionX{danish}{%
\@todonotes@SetTodoListName{G\o{}rem\aa{}lsliste}%
+ \@todonotes@SetMissingFigureText{Figur}%
\@todonotes@SetMissingFigureUp{Manglende}%
\@todonotes@SetMissingFigureDown{figur}%
}
\DeclareOptionX{german}{%
\@todonotes@SetTodoListName{Liste der noch zu erledigenden Punkte}%
+ \@todonotes@SetMissingFigureText{Abbildung}%
\@todonotes@SetMissingFigureUp{Fehlende}%
\@todonotes@SetMissingFigureDown{Abbildung}%
}
+\DeclareOptionX{french}{%
+ \@todonotes@SetTodoListName{Liste des points \`a traiter}%
+ \@todonotes@SetMissingFigureText{Figure}%
+ \@todonotes@SetMissingFigureUp{Figure}%
+ \@todonotes@SetMissingFigureDown{manquante}%
+ \@todonotes@reverseMissingFigureTrianglefalse
+}
+\DeclareOptionX{catalan}{
+ \@todonotes@SetTodoListName{Llista de feines pendents}%
+ \@todonotes@SetMissingFigureText{Figura}%
+ \@todonotes@SetMissingFigureUp{Figura}%
+ \@todonotes@SetMissingFigureDown{pendent}%
+}
+\DeclareOptionX{spanish}{
+ \@todonotes@SetTodoListName{Lista de tareas pendientes}%
+ \@todonotes@SetMissingFigureText{Figura}%
+ \@todonotes@SetMissingFigureUp{Figura}%
+ \@todonotes@SetMissingFigureDown{pendient}%
+}
+\newcounter{@todonotes@numberoftodonotes}
\newif{\if@todonotes@disabled}
\DeclareOptionX{disable}{\@todonotes@disabledtrue}
\newif{\if@todonotes@colorinlistoftodos}
@@ -62,18 +89,26 @@
\define@key{todonotes.sty}%
{color}{
\renewcommand{\@todonotes@backgroundcolor}{#1}
- \renewcommand{\@todonotes@linegroundcolor}{#1}}
+ \renewcommand{\@todonotes@linecolor}{#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}
+\newif{\if@todonotes@prependcaptionglobal}
+\@todonotes@prependcaptionglobalfalse
+\DeclareOptionX{prependcaption}{\@todonotes@prependcaptionglobaltrue}
\define@key{todonotes.sty}%
{textwidth}{\renewcommand{\@todonotes@textwidth}{#1}}
+\define@key{todonotes.sty}%
+ {textsize}{\renewcommand{\@todonotes@textsize}{\csname #1\endcsname}}
+\newif{\if@todonotes@shadowenabled}
+\@todonotes@shadowenabledfalse
+\DeclareOptionX{shadow}{\@todonotes@shadowenabledtrue
+\usetikzlibrary{shadows}}
+\define@key{todonotes.sty}%
+ {figwidth}{\renewcommand{\@todonotes@figwidth}{#1}}
\ProcessOptionsX
\newcommand{\@todonotes@currentlinecolor}{}%
@@ -96,6 +131,9 @@
\newif\if@todonotes@inlinenote%
\define@key{todonotes}{inline}[]{\@todonotes@inlinenotetrue}%
\define@key{todonotes}{noinline}[]{\@todonotes@inlinenotefalse}%
+\newif\if@todonotes@prependcaption%
+\define@key{todonotes}{prepend}[]{\@todonotes@prependcaptiontrue}%
+\define@key{todonotes}{noprepend}[]{\@todonotes@prependcaptionfalse}%
\newif\if@todonotes@line%
\define@key{todonotes}{line}[]{\@todonotes@linetrue}%
\define@key{todonotes}{noline}[]{\@todonotes@linefalse}%
@@ -104,29 +142,42 @@
\define@key{todonotes}{caption}%
{\renewcommand{\@todonotes@caption}{#1}%
\@todonotes@captiongiventrue}%
+\define@key{todonotes}{nocaption}[]{\@todonotes@captiongivenfalse}%
+\newcommand{\@todonotes@currentfigwidth}{\@todonotes@figwidth}
+\define@key{todonotes}%
+ {figwidth}{\renewcommand{\@todonotes@currentfigwidth}{#1}}
\presetkeys%
{todonotes}%
{linecolor=\@todonotes@linecolor,%
backgroundcolor=\@todonotes@backgroundcolor,%
bordercolor=\@todonotes@bordercolor,%
noinline,%
- line, list, size=\normalsize}{}%
-
+ nocaption,%
+ figwidth=\@todonotes@figwidth,%
+ line, list, size=\@todonotes@textsize}{}%
\if@todonotes@disabled%
\newcommand{\listoftodos}{}
- \newcommand{\todo}[2][]{\ignotespaces}
- \newcommand{\missingfigure}[1]{}
+ \newcommand{\todo}[2][]{\ignorespaces}
+ \newcommand{\missingfigure}[2]{}
\else % \if@todonotes@disabled
\newcommand{\listoftodos}
{\section*{\@todonotes@todolistname} \@starttoc{tdo}}
\newcommand{\l@todo}
{\@dottedtocline{1}{0em}{2.3em}}
-\tikzstyle{notestyle} = [
+\tikzstyle{notestyleraw} = [
draw=\@todonotes@currentbordercolor,
fill=\@todonotes@currentbackgroundcolor,
line width=0.5pt,
text width = \@todonotes@textwidth - 1.6 ex - 1pt,
- inner sep = 0.8 ex]
+ inner sep = 0.8 ex,
+ rounded corners=4pt]
+\if@todonotes@shadowenabled
+\tikzstyle{notestyle} = [notestyleraw,
+ general shadow={shadow xshift=.5ex, shadow yshift=-.5ex,
+ opacity=1,fill=black!50}]
+\else
+\tikzstyle{notestyle} = [notestyleraw]
+\fi
\tikzstyle{notestyleleft} = [
notestyle,
left]
@@ -137,9 +188,15 @@
notestyle,
text width=\linewidth - 1.6 ex - 1 pt]
\newcommand{\todo}[2][]{%
+\if@todonotes@prependcaptionglobal%
+\@todonotes@prependcaptiontrue%
+\else%
+\@todonotes@prependcaptionfalse%
+\fi%
\renewcommand{\@todonotes@text}{#2}%
\renewcommand{\@todonotes@caption}{#2}%
\setkeys{todonotes}{#1}%
+\addtocounter{@todonotes@numberoftodonotes}{1}%
\if@todonotes@appendtolistoftodos%
\phantomsection%
\if@todonotes@captiongiven%
@@ -149,17 +206,17 @@
\if@todonotes@colorinlistoftodos%
\addcontentsline{tdo}{todo}{\protect{%
\colorbox{\@todonotes@currentbackgroundcolor}%
- {\textcolor{\@todonotes@currentbackgroundcolor}{o}} %
+ {\textcolor{\@todonotes@currentbackgroundcolor}{o}}%
\@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@captiongiven%
+ \if@todonotes@prependcaption%
+ \renewcommand{\@todonotes@text}{\@todonotes@caption: #2}%
+ \fi%
+\fi%
\if@todonotes@inlinenote%
\if@todonotes@dviStyle%
{\par\noindent\begin{tikzpicture}[remember picture]%
@@ -169,8 +226,7 @@
\draw node[inlinenotestyle] {};\end{tikzpicture}\par}%
\else%
{\par\noindent\begin{tikzpicture}[remember picture]%
- \draw node[inlinenotestyle] {\@todonotes@sizecommand
-\@todonotes@text};%
+ \draw node[inlinenotestyle] {\@todonotes@sizecommand \@todonotes@text};%
\end{tikzpicture}\par}%
\fi%
\else%
@@ -231,14 +287,16 @@
\fi%
\ignorespaces%
}%
-\newcommand{\missingfigure}[1]{
-\addcontentsline{tdo}{todo}{Figure: \protect{#1}}%
+\newcommand{\missingfigure}[2][]{
+\setkeys{todonotes}{#1}%
+\addcontentsline{tdo}{todo}{\@todonotes@MissingFigureText: \protect{#2}}%
\par
\noindent
\begin{tikzpicture}
\draw[fill=black!40, draw = white, line width=0pt]
- (-3, -2.5) rectangle +(\textwidth, 4cm);
-\draw (3, 0) node[right, text width=4cm] {#1};
+ (-2, -2.5) rectangle +(\@todonotes@currentfigwidth, 4cm);
+\draw (2, -0.3) node[right, text
+ width=\@todonotes@currentfigwidth-4.5cm] {#2};
\draw[red, fill=white, rounded corners = 5pt, line width=10pt]
(30:2cm) -- (150:2cm) -- (270:2cm) -- cycle;
\draw (0, 0.3) node {\@todonotes@MissingFigureUp};