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> %</driver>
% \fi % \fi
% %
% \CheckSum{451} % \CheckSum{0}
% %
% \CharacterTable % \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 % {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.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, % \changes{0.9.3}{2010/09/13}{Make an internal definition of the todo command,
% for easing redefinition of the command behaviour.} % 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} % \GetFileInfo{todonotes.dtx}
% %
@ -1170,6 +1171,12 @@
\newcommand{\@todonotes@sizecommand}{}% \newcommand{\@todonotes@sizecommand}{}%
\define@key{todonotes}{size}{\renewcommand{\@todonotes@sizecommand}{#1}}% \define@key{todonotes}{size}{\renewcommand{\@todonotes@sizecommand}{#1}}%
% \end{macrocode} % \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? % Should the todo item be included in the list of todos?
% \begin{macrocode} % \begin{macrocode}
\newif\if@todonotes@appendtolistoftodos% \newif\if@todonotes@appendtolistoftodos%
@ -1217,6 +1224,7 @@
{linecolor=\@todonotes@linecolor,% {linecolor=\@todonotes@linecolor,%
backgroundcolor=\@todonotes@backgroundcolor,% backgroundcolor=\@todonotes@backgroundcolor,%
bordercolor=\@todonotes@bordercolor,% bordercolor=\@todonotes@bordercolor,%
nodisable,%
noinline,% noinline,%
nocaption,% nocaption,%
figwidth=\@todonotes@figwidth,% figwidth=\@todonotes@figwidth,%
@ -1272,7 +1280,7 @@
% \end{macrocode} % \end{macrocode}
% %
% \begin{macro}{\@todo} % \begin{macro}{\@todo}
% Define the |\@todo| command % Define the |\@todo| command.
% \begin{macrocode} % \begin{macrocode}
\newcommand{\@todo}[2][]{% \newcommand{\@todo}[2][]{%
% \end{macrocode} % \end{macrocode}
@ -1284,12 +1292,17 @@
\@todonotes@prependcaptionfalse% \@todonotes@prependcaptionfalse%
\fi% \fi%
% \end{macrocode} % \end{macrocode}
% Store the original text for later usage. % Store the original text for later usage and parse the given options.
% \begin{macrocode} % \begin{macrocode}
\renewcommand{\@todonotes@text}{#2}% \renewcommand{\@todonotes@text}{#2}%
\renewcommand{\@todonotes@caption}{#2}% \renewcommand{\@todonotes@caption}{#2}%
\setkeys{todonotes}{#1}% \setkeys{todonotes}{#1}%
% \end{macrocode} % \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 % Add the item to the list of todos. When the option
% |colorinlistoftodos| is given to the package a small colored % |colorinlistoftodos| is given to the package a small colored
% square is added in front of the text. % square is added in front of the text.
@ -1404,6 +1417,7 @@
\fi% \fi%
}% }%
\fi% \fi%
\fi %\if@todonotes@appendtolistoftodos%
\ignorespaces% \ignorespaces%
}% }%
% \end{macrocode} % \end{macrocode}

Loading…
Cancel
Save