Enable local disabling of todos.

master
Henrik Skov Midtiby 16 years ago
parent 2ee16aa3e3
commit ed7dc564eb
  1. 20
      todonotes.dtx

@ -46,7 +46,7 @@
%</driver>
% \fi
%
% \CheckSum{451}
% \CheckSum{0}
%
% \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,7 @@
% \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.}
%
% \GetFileInfo{todonotes.dtx}
%
@ -1170,6 +1171,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 +1224,7 @@
{linecolor=\@todonotes@linecolor,%
backgroundcolor=\@todonotes@backgroundcolor,%
bordercolor=\@todonotes@bordercolor,%
nodisable,%
noinline,%
nocaption,%
figwidth=\@todonotes@figwidth,%
@ -1272,7 +1280,7 @@
% \end{macrocode}
%
% \begin{macro}{\@todo}
% Define the |\@todo| command
% Define the |\@todo| command.
% \begin{macrocode}
\newcommand{\@todo}[2][]{%
% \end{macrocode}
@ -1284,12 +1292,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.
@ -1404,6 +1417,7 @@
\fi%
}%
\fi%
\fi %\if@todonotes@appendtolistoftodos%
\ignorespaces%
}%
% \end{macrocode}

Loading…
Cancel
Save