summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-09-27 00:39:06 +0000
committerKarl Berry <karl@freefriends.org>2010-09-27 00:39:06 +0000
commit3a7ed51293855b6db86b4ce41e7f2403cc02c774 (patch)
treeae29ed561be3d582e3f4c3d06dca866816e9efc7
parent6f75f25fe8d374ef4209118bd8849d742410ccd1 (diff)
todonotes 0.9.5 (26sep10)
git-svn-id: svn://tug.org/texlive/trunk@19905 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/todonotes/todonotes.pdfbin325175 -> 328116 bytes
-rw-r--r--Master/texmf-dist/doc/latex/todonotes/todonotesexample.pdfbin49549 -> 48982 bytes
-rw-r--r--Master/texmf-dist/doc/latex/todonotes/todonotesexample.tex2
-rw-r--r--Master/texmf-dist/source/latex/todonotes/todonotes.dtx165
-rw-r--r--Master/texmf-dist/tex/latex/todonotes/todonotes.sty95
5 files changed, 158 insertions, 104 deletions
diff --git a/Master/texmf-dist/doc/latex/todonotes/todonotes.pdf b/Master/texmf-dist/doc/latex/todonotes/todonotes.pdf
index 22f328420d4..0373e9c805e 100644
--- a/Master/texmf-dist/doc/latex/todonotes/todonotes.pdf
+++ b/Master/texmf-dist/doc/latex/todonotes/todonotes.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/todonotes/todonotesexample.pdf b/Master/texmf-dist/doc/latex/todonotes/todonotesexample.pdf
index 8887bb35857..23a6a79a44e 100644
--- a/Master/texmf-dist/doc/latex/todonotes/todonotesexample.pdf
+++ b/Master/texmf-dist/doc/latex/todonotes/todonotesexample.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/todonotes/todonotesexample.tex b/Master/texmf-dist/doc/latex/todonotes/todonotesexample.tex
index 51e249a97a4..01bfe35e64d 100644
--- a/Master/texmf-dist/doc/latex/todonotes/todonotesexample.tex
+++ b/Master/texmf-dist/doc/latex/todonotes/todonotesexample.tex
@@ -9,7 +9,7 @@
\listoftodos
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla
-\todo{Plain todonotes.}%
+\todo[disable]{Plain todonotes.}%
urna. Maecenas interdum nunc in augue. Mauris quis massa in ante
tincidunt mollis. Proin imperdiet. Donec porttitor pede id est. Sed
in ante. Integer id arcu. Nam lectus nisl, posuere sit amet,
diff --git a/Master/texmf-dist/source/latex/todonotes/todonotes.dtx b/Master/texmf-dist/source/latex/todonotes/todonotes.dtx
index a90f2f5cca9..46991c905d6 100644
--- a/Master/texmf-dist/source/latex/todonotes/todonotes.dtx
+++ b/Master/texmf-dist/source/latex/todonotes/todonotes.dtx
@@ -22,14 +22,14 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{todonotes}
%<*package>
- [2010/09/13 .dtx Todonotes source and documentation.]
+ [2010/09/26 .dtx Todonotes source and documentation.]
%</package>
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{wrapfig}
\usepackage[colorlinks, linkcolor=black]{hyperref}
-\usepackage[colorinlistoftodos, shadow]{todonotes}[2010/09/13]
+\usepackage[colorinlistoftodos, shadow]{todonotes}[2010/09/26]
\usepackage{amsmath}
\usepackage{setspace}
\setcounter{tocdepth}{2}
@@ -46,7 +46,7 @@
%</driver>
% \fi
%
-% \CheckSum{451}
+% \CheckSum{458}
%
% \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
@@ -153,6 +153,10 @@
% \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 as
+% suggested by Stefan Pinnow.}
+% \changes{0.9.5}{2010/09/26}{Code simplification by extracting functionality to
+% smaller macros.}
%
% \GetFileInfo{todonotes.dtx}
%
@@ -335,6 +339,10 @@
% command. All the options are described here and often I have
% included examples of the change in visual appearance.
%
+% \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}
@@ -925,7 +933,7 @@
%
% Identifies the package and loads the packages dependences.
% \begin{macrocode}
-\ProvidesPackage{todonotes}[2010/09/13]
+\ProvidesPackage{todonotes}[2010/09/26]
\RequirePackage{ifthen}
\RequirePackage{xkeyval}
\RequirePackage{xcolor}
@@ -1170,6 +1178,12 @@
\newcommand{\@todonotes@sizecommand}{}%
\define@key{todonotes}{size}{\renewcommand{\@todonotes@sizecommand}{#1}}%
% \end{macrocode}
+% Should the todo item be disabled?
+% \begin{macrocode}
+\newif\if@todonotes@localdisable%
+\define@key{todonotes}{disable}[]{\@todonotes@localdisabletrue}%
+\define@key{todonotes}{nodisable}[]{\@todonotes@localdisablefalse}%
+% \end{macrocode}
% Should the todo item be included in the list of todos?
% \begin{macrocode}
\newif\if@todonotes@appendtolistoftodos%
@@ -1217,6 +1231,7 @@
{linecolor=\@todonotes@linecolor,%
backgroundcolor=\@todonotes@backgroundcolor,%
bordercolor=\@todonotes@bordercolor,%
+ nodisable,%
noinline,%
nocaption,%
figwidth=\@todonotes@figwidth,%
@@ -1272,7 +1287,7 @@
% \end{macrocode}
%
% \begin{macro}{\@todo}
-% Define the |\@todo| command
+% Define the |\@todo| command.
% \begin{macrocode}
\newcommand{\@todo}[2][]{%
% \end{macrocode}
@@ -1284,12 +1299,17 @@
\@todonotes@prependcaptionfalse%
\fi%
% \end{macrocode}
-% Store the original text for later usage.
+% Store the original text for later usage and parse the given options.
% \begin{macrocode}
\renewcommand{\@todonotes@text}{#2}%
\renewcommand{\@todonotes@caption}{#2}%
\setkeys{todonotes}{#1}%
% \end{macrocode}
+% If the option |disable| is given to the command, no output is generated.
+% \begin{macrocode}
+\if@todonotes@localdisable%
+\else%
+% \end{macrocode}
% Add the item to the list of todos. When the option
% |colorinlistoftodos| is given to the package a small colored
% square is added in front of the text.
@@ -1301,14 +1321,7 @@
\else%
\renewcommand{\@todonotes@caption}{#2}%
\fi%
- \if@todonotes@colorinlistoftodos%
- \addcontentsline{tdo}{todo}{\protect{%
- \colorbox{\@todonotes@currentbackgroundcolor}%
- {\textcolor{\@todonotes@currentbackgroundcolor}{o}}%
- \ \@todonotes@caption}}%
- \else%
- \addcontentsline{tdo}{todo}{\protect{\@todonotes@caption}}%
- \fi%
+ \@todonotes@addElementToListOfTodos
\fi%
% \end{macrocode}
% Prepend the short caption given if it is requested
@@ -1323,18 +1336,19 @@
% marginpar), below is the code for the inline placement.
% \begin{macrocode}
\if@todonotes@inlinenote%
- \if@todonotes@dviStyle%
- {\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] {\@todonotes@sizecommand \@todonotes@text};%
- \end{tikzpicture}\par}%
- \fi%
+ \@todonotes@drawInlineNote
\else%
+ \@todonotes@drawMarginNoteWithLine
+\fi %\if@todonotes@inlinenote
+\fi %\if@todonotes@localdisable
+\ignorespaces%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{drawMarginNoteWithLine}
+% Define helper function |drawMarginNoteWithLine|.
+% \begin{macrocode}
+\newcommand{\@todonotes@drawMarginNoteWithLine}{%
% \end{macrocode}
% When the todonote should be placed inside a marginpar, the code
% below is applied.
@@ -1345,30 +1359,8 @@
\node [coordinate] (inText) {};%
\end{tikzpicture}%
\marginpar[{% Draw note in left margin
-\if@todonotes@dviStyle%
- \begin{tikzpicture}[remember picture]%
- \draw node[notestyle] {};%
- \end{tikzpicture}\\ %
- \begin{minipage}{\@todonotes@textwidth}%
- \@todonotes@sizecommand \@todonotes@text%
- \end{minipage}\\%
- \begin{tikzpicture}[remember picture]%
- \draw node[notestyle] (inNote) {};%
- \end{tikzpicture}%
-\else%
- \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%
+ \@todonotes@drawMarginNote%
+ \@todonotes@drawLineToLeftMargin%
% \end{macrocode}
% In the book documentclass (which is a twoside layout), the
% |\marginpar| marginpar macro takes two arguments
@@ -1378,10 +1370,51 @@
% commands.
% \begin{macrocode}
}]{% Draw note in right margin
+ \@todonotes@drawMarginNote%
+ \@todonotes@drawLineToRightMargin%
+}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{addElementToListOfTodos}
+% Define helper function |addElementToListOfTodos|.
+% \begin{macrocode}
+\newcommand{\@todonotes@addElementToListOfTodos}{%
+ \if@todonotes@colorinlistoftodos%
+ \addcontentsline{tdo}{todo}{\protect{%
+ \colorbox{\@todonotes@currentbackgroundcolor}%
+ {\textcolor{\@todonotes@currentbackgroundcolor}{o}}%
+ \ \@todonotes@caption}}%
+ \else%
+ \addcontentsline{tdo}{todo}{\protect{\@todonotes@caption}}%
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{drawInlineNote}
+% Define helper function |drawInlineNote|.
+% \begin{macrocode}
+\newcommand{\@todonotes@drawInlineNote}{%
+ \if@todonotes@dviStyle%
+ {\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] {\@todonotes@sizecommand \@todonotes@text};%
+ \end{tikzpicture}\par}%
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{drawMarginNote}
+% Define helper function |drawMarginNote|.
+% \begin{macrocode}
+\newcommand{\@todonotes@drawMarginNote}{%
\if@todonotes@dviStyle%
\begin{tikzpicture}[remember picture]%
\draw node[notestyle] {};%
- \end{tikzpicture}\\%
+ \end{tikzpicture}\\ %
\begin{minipage}{\@todonotes@textwidth}%
\@todonotes@sizecommand \@todonotes@text%
\end{minipage}\\%
@@ -1390,22 +1423,38 @@
\end{tikzpicture}%
\else%
\begin{tikzpicture}[remember picture]%
- \draw node[notestyle](inNote)%
+ \draw node[notestyle] (inNote)%
{\@todonotes@sizecommand \@todonotes@text};%
\end{tikzpicture}%
-\fi%
+\fi}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{drawLineToRightMargin}
+% Define helper function |drawLineToRightMargin|.
+% \begin{macrocode}
+\newcommand{\@todonotes@drawLineToRightMargin}{%
\if@todonotes@line%
- \begin{tikzpicture}[remember picture, overlay]%
+\begin{tikzpicture}[remember picture, overlay]%
\draw[connectstyle]%
([yshift=-0.2cm] inText)%
-| ([xshift=-0.2cm] inNote.west)%
-| (inNote.west);%
\end{tikzpicture}%
-\fi%
-}%
-\fi%
-\ignorespaces%
-}%
+\fi}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{drawLineToLeftMargin}
+% Define helper function |drawLineToLeftMargin|.
+% \begin{macrocode}
+\newcommand{\@todonotes@drawLineToLeftMargin}{
+\if@todonotes@line%
+ \begin{tikzpicture}[remember picture, overlay]%
+ \draw[connectstyle]%
+ ([yshift=-0.2cm] inText)%
+ -| ([xshift=0.2cm] inNote.east)%
+ -| (inNote.east);%
+ \end{tikzpicture}%
+\fi}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\missingfigure}
diff --git a/Master/texmf-dist/tex/latex/todonotes/todonotes.sty b/Master/texmf-dist/tex/latex/todonotes/todonotes.sty
index fef33bf07db..0425ea9aeb5 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}
- [2010/09/13 .dtx Todonotes source and documentation.]
+ [2010/09/26 .dtx Todonotes source and documentation.]
-\ProvidesPackage{todonotes}[2010/09/13]
+\ProvidesPackage{todonotes}[2010/09/26]
\RequirePackage{ifthen}
\RequirePackage{xkeyval}
\RequirePackage{xcolor}
@@ -176,6 +176,9 @@
\renewcommand{\@todonotes@currentbordercolor}{#1}}%
\newcommand{\@todonotes@sizecommand}{}%
\define@key{todonotes}{size}{\renewcommand{\@todonotes@sizecommand}{#1}}%
+\newif\if@todonotes@localdisable%
+\define@key{todonotes}{disable}[]{\@todonotes@localdisabletrue}%
+\define@key{todonotes}{nodisable}[]{\@todonotes@localdisablefalse}%
\newif\if@todonotes@appendtolistoftodos%
\define@key{todonotes}{list}[]{\@todonotes@appendtolistoftodostrue}%
\define@key{todonotes}{nolist}[]{\@todonotes@appendtolistoftodosfalse}%
@@ -202,6 +205,7 @@
{linecolor=\@todonotes@linecolor,%
backgroundcolor=\@todonotes@backgroundcolor,%
bordercolor=\@todonotes@bordercolor,%
+ nodisable,%
noinline,%
nocaption,%
figwidth=\@todonotes@figwidth,%
@@ -247,6 +251,8 @@
\renewcommand{\@todonotes@text}{#2}%
\renewcommand{\@todonotes@caption}{#2}%
\setkeys{todonotes}{#1}%
+\if@todonotes@localdisable%
+\else%
\addtocounter{@todonotes@numberoftodonotes}{1}%
\if@todonotes@appendtolistoftodos%
\phantomsection%
@@ -254,14 +260,7 @@
\else%
\renewcommand{\@todonotes@caption}{#2}%
\fi%
- \if@todonotes@colorinlistoftodos%
- \addcontentsline{tdo}{todo}{\protect{%
- \colorbox{\@todonotes@currentbackgroundcolor}%
- {\textcolor{\@todonotes@currentbackgroundcolor}{o}}%
- \ \@todonotes@caption}}%
- \else%
- \addcontentsline{tdo}{todo}{\protect{\@todonotes@caption}}%
- \fi%
+ \@todonotes@addElementToListOfTodos
\fi%
\if@todonotes@captiongiven%
\if@todonotes@prependcaption%
@@ -269,6 +268,35 @@
\fi%
\fi%
\if@todonotes@inlinenote%
+ \@todonotes@drawInlineNote
+\else%
+ \@todonotes@drawMarginNoteWithLine
+\fi %\if@todonotes@inlinenote
+\fi %\if@todonotes@localdisable
+\ignorespaces%
+}%
+\newcommand{\@todonotes@drawMarginNoteWithLine}{%
+\begin{tikzpicture}[remember picture, baseline=-0.75ex]%
+ \node [coordinate] (inText) {};%
+\end{tikzpicture}%
+\marginpar[{% Draw note in left margin
+ \@todonotes@drawMarginNote%
+ \@todonotes@drawLineToLeftMargin%
+}]{% Draw note in right margin
+ \@todonotes@drawMarginNote%
+ \@todonotes@drawLineToRightMargin%
+}%
+}%
+\newcommand{\@todonotes@addElementToListOfTodos}{%
+ \if@todonotes@colorinlistoftodos%
+ \addcontentsline{tdo}{todo}{\protect{%
+ \colorbox{\@todonotes@currentbackgroundcolor}%
+ {\textcolor{\@todonotes@currentbackgroundcolor}{o}}%
+ \ \@todonotes@caption}}%
+ \else%
+ \addcontentsline{tdo}{todo}{\protect{\@todonotes@caption}}%
+ \fi}%
+\newcommand{\@todonotes@drawInlineNote}{%
\if@todonotes@dviStyle%
{\par\noindent\begin{tikzpicture}[remember picture]%
\draw node[inlinenotestyle] {};\end{tikzpicture}\par}%
@@ -279,12 +307,8 @@
{\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]%
- \node [coordinate] (inText) {};%
-\end{tikzpicture}%
-\marginpar[{% Draw note in left margin
+ \fi}%
+\newcommand{\@todonotes@drawMarginNote}{%
\if@todonotes@dviStyle%
\begin{tikzpicture}[remember picture]%
\draw node[notestyle] {};%
@@ -300,44 +324,25 @@
\draw node[notestyle] (inNote)%
{\@todonotes@sizecommand \@todonotes@text};%
\end{tikzpicture}%
-\fi%
+\fi}%
+\newcommand{\@todonotes@drawLineToRightMargin}{%
\if@todonotes@line%
- \begin{tikzpicture}[remember picture, overlay]%
+\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] {};%
- \end{tikzpicture}\\%
- \begin{minipage}{\@todonotes@textwidth}%
- \@todonotes@sizecommand \@todonotes@text%
- \end{minipage}\\%
- \begin{tikzpicture}[remember picture]%
- \draw node[notestyle] (inNote) {};%
- \end{tikzpicture}%
-\else%
- \begin{tikzpicture}[remember picture]%
- \draw node[notestyle](inNote)%
- {\@todonotes@sizecommand \@todonotes@text};%
+ -| ([xshift=-0.2cm] inNote.west)%
+ -| (inNote.west);%
\end{tikzpicture}%
-\fi%
+\fi}%
+\newcommand{\@todonotes@drawLineToLeftMargin}{
\if@todonotes@line%
\begin{tikzpicture}[remember picture, overlay]%
\draw[connectstyle]%
([yshift=-0.2cm] inText)%
- -| ([xshift=-0.2cm] inNote.west)%
- -| (inNote.west);%
+ -| ([xshift=0.2cm] inNote.east)%
+ -| (inNote.east);%
\end{tikzpicture}%
-\fi%
-}%
-\fi%
-\ignorespaces%
-}%
+\fi}
\newcommand{\missingfigure}[2][]{
\setkeys{todonotes}{#1}%
\addcontentsline{tdo}{todo}{\@todonotes@MissingFigureText: \protect{#2}}%