Merge commit '73a973' into ReleaseBranchTwo

master
Henrik Skov Midtiby 15 years ago
commit b5104d5a64
  1. BIN
      img/AlteredAppearenceOfListOfTodos.png
  2. 158
      todonotes.dtx

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

@ -22,14 +22,14 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{todonotes} %<package>\ProvidesPackage{todonotes}
%<*package> %<*package>
[2011/03/07 .dtx Todonotes source and documentation.] [2011/10/22 .dtx Todonotes source and documentation.]
%</package> %</package>
% %
%<*driver> %<*driver>
\documentclass{ltxdoc} \documentclass{ltxdoc}
\usepackage{wrapfig} \usepackage{wrapfig}
\usepackage[colorlinks, linkcolor=black]{hyperref} \usepackage[colorlinks, linkcolor=black]{hyperref}
\usepackage[colorinlistoftodos, shadow]{todonotes}[2011/03/07] \usepackage[colorinlistoftodos, shadow]{todonotes}[2011/10/22]
\usepackage{amsmath} \usepackage{amsmath}
\usepackage{setspace} \usepackage{setspace}
\setcounter{tocdepth}{2} \setcounter{tocdepth}{2}
@ -46,7 +46,7 @@
%</driver> %</driver>
% \fi % \fi
% %
% \CheckSum{495} % \CheckSum{541}
% %
% \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
@ -161,6 +161,9 @@
% \changes{0.9.7}{2011/03/07}{Updated documentation.} % \changes{0.9.7}{2011/03/07}{Updated documentation.}
% \changes{0.9.8}{2011/04/21}{Suppress warnings about underfull / overful boxes % \changes{0.9.8}{2011/04/21}{Suppress warnings about underfull / overful boxes
% generated by the inserted todonotes. Patch by Peter M Schuler.} % generated by the inserted todonotes. Patch by Peter M Schuler.}
% \changes{0.9.9}{2011/10/22}{Added author option, implementation provided by
% Xavier Alameda-Pineda. Example of modifying the
% listoftodos removing some protect commands with no effect.}
% \GetFileInfo{todonotes.dtx} % \GetFileInfo{todonotes.dtx}
% %
% \DoNotIndex{\newcommand,\newenvironment} % \DoNotIndex{\newcommand,\newenvironment}
@ -477,6 +480,17 @@
% \todo[fancyline]{Testing.} % \todo[fancyline]{Testing.}
% \end{verbatim} % \end{verbatim}
% %
%
% \DescribeMacro{author}
% The |author| option takes a parameter, the name of the author.
% The given name is inserted in the todonote.
% \todo[author=Xavier]{Testing author option.}
% \todo[author=Xavier, inline]{Testing author option.}
% \begin{verbatim}
% \todo[author=Xavier]{Testing author option.}
% \todo[author=Xavier, inline]{Testing author option.}
% \end{verbatim}
%
% \subsection{Options for the missingfigure command} % \subsection{Options for the missingfigure command}
% %
% \DescribeMacro{figwidth} % \DescribeMacro{figwidth}
@ -587,6 +601,23 @@
% relies on) is inserted in the other margin. % relies on) is inserted in the other margin.
% %
% %
% \subsubsection{Todonotes in footnotes}
% Placing todonotes in footnotes throws a lot of errors.
% Richard Stanton comes with the following work around.
% \begin{verbatim}
% \renewcommand{\marginpar}{\marginnote}
% \end{verbatim}
%
%
% \subsubsection{List of todo heading is not correctly formatted}
% If using natbib, the todonotes list title gets screwed up unless
% you do something like this:
% \begin{verbatim}
% \makeatletter\let\chapter\@undefined\makeatother
% \end{verbatim}
% Suggestion by Richard Stanton.
%
%
% \subsection{Things to improve} % \subsection{Things to improve}
% This is a list of things I consider to improve sometime in the % This is a list of things I consider to improve sometime in the
% future. It have not been done yet as I lack the time or skills to % future. It have not been done yet as I lack the time or skills to
@ -938,6 +969,18 @@
% Using this approach it is possible to customize the behavior of the inserted notes % Using this approach it is possible to customize the behavior of the inserted notes
% to a very high degree. % to a very high degree.
% %
%
% \subsubsection{Alter the appearance of the list of todos}
% Marco Daniel gives the following example of how to add section
% numbers to the elements in the list of todos.
% The code is slightly modified from
% \url{http://tex.stackexchange.com/questions/18838/replacing-page-number-with-other-counter-in-listoftodos}.
% An example of the modified list of todos is shown below, the complete
% code example is given in appendix \ref{appssecAlterAppearenceOfListoftodos}.\\
% \noindent
% \begin{tikzpicture}
% \draw node[shape=rectangle, fill=black!30, inner sep=1mm]{\includegraphics[width=\linewidth-2mm]{img/AlteredAppearenceOfListOfTodos.png}};
% \end{tikzpicture}
% %
% \iffalse % \iffalse
% \StopEventually{\PrintChanges\PrintIndex} % \StopEventually{\PrintChanges\PrintIndex}
@ -949,11 +992,12 @@
% %
% Identifies the package and loads the packages dependences. % Identifies the package and loads the packages dependences.
% \begin{macrocode} % \begin{macrocode}
\ProvidesPackage{todonotes}[2011/03/07] \ProvidesPackage{todonotes}[2011/10/22]
\RequirePackage{ifthen} \RequirePackage{ifthen}
\RequirePackage{xkeyval} \RequirePackage{xkeyval}
\RequirePackage{xcolor} \RequirePackage{xcolor}
\RequirePackage{tikz} \RequirePackage{tikz}
\usetikzlibrary{positioning}
\RequirePackage{calc} \RequirePackage{calc}
% \end{macrocode} % \end{macrocode}
% Some default values are set % Some default values are set
@ -1053,7 +1097,7 @@
\@todonotes@SetTodoListName{Lista de tareas pendientes}% \@todonotes@SetTodoListName{Lista de tareas pendientes}%
\@todonotes@SetMissingFigureText{Figura}% \@todonotes@SetMissingFigureText{Figura}%
\@todonotes@SetMissingFigureUp{Figura}% \@todonotes@SetMissingFigureUp{Figura}%
\@todonotes@SetMissingFigureDown{pendient}% \@todonotes@SetMissingFigureDown{pendiente}%
} }
% \end{macrocode} % \end{macrocode}
% Create a counter, for storing the number of inserted todos. % Create a counter, for storing the number of inserted todos.
@ -1231,6 +1275,15 @@
\define@key{todonotes}{fancyline}[]{\@todonotes@fancylinetrue}% \define@key{todonotes}{fancyline}[]{\@todonotes@fancylinetrue}%
\define@key{todonotes}{nofancyline}[]{\@todonotes@fancylinefalse}% \define@key{todonotes}{nofancyline}[]{\@todonotes@fancylinefalse}%
% \end{macrocode} % \end{macrocode}
% Author option.
% \begin{macrocode}
\newcommand{\@todonotes@author}{}%
\newif\if@todonotes@authorgiven%
\define@key{todonotes}{author}{%
\renewcommand{\@todonotes@author}{#1}%
\@todonotes@authorgiventrue}%
\define@key{todonotes}{noauthor}[]{\@todonotes@authorgivenfalse}%
% \end{macrocode}
% Should the text in the list of todos be different from the text % Should the text in the list of todos be different from the text
% in the todonote? % in the todonote?
% \begin{macrocode} % \begin{macrocode}
@ -1258,6 +1311,7 @@
nodisable,% nodisable,%
noinline,% noinline,%
nocaption,% nocaption,%
noauthor,%
figwidth=\@todonotes@figwidth,% figwidth=\@todonotes@figwidth,%
line, list, size=\@todonotes@textsize}{}% line, list, size=\@todonotes@textsize}{}%
% \end{macrocode} % \end{macrocode}
@ -1405,12 +1459,12 @@
% \begin{macrocode} % \begin{macrocode}
\newcommand{\@todonotes@addElementToListOfTodos}{% \newcommand{\@todonotes@addElementToListOfTodos}{%
\if@todonotes@colorinlistoftodos% \if@todonotes@colorinlistoftodos%
\addcontentsline{tdo}{todo}{\protect{% \addcontentsline{tdo}{todo}{%
\colorbox{\@todonotes@currentbackgroundcolor}% \colorbox{\@todonotes@currentbackgroundcolor}%
{\textcolor{\@todonotes@currentbackgroundcolor}{o}}% {\textcolor{\@todonotes@currentbackgroundcolor}{o}}%
\ \@todonotes@caption}}% \ \@todonotes@caption}%
\else% \else%
\addcontentsline{tdo}{todo}{\protect{\@todonotes@caption}}% \addcontentsline{tdo}{todo}{\@todonotes@caption}%
\fi}% \fi}%
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
@ -1421,12 +1475,21 @@
\if@todonotes@dviStyle% \if@todonotes@dviStyle%
{\par\noindent\begin{tikzpicture}[remember picture]% {\par\noindent\begin{tikzpicture}[remember picture]%
\draw node[inlinenotestyle] {};\end{tikzpicture}\par}% \draw node[inlinenotestyle] {};\end{tikzpicture}\par}%
{\noindent \@todonotes@sizecommand \@todonotes@text}% \if@todonotes@authorgiven%
{\noindent \@todonotes@sizecommand \@todonotes@author:\,\@todonotes@text}%
\else%
{\noindent \@todonotes@sizecommand \@todonotes@text}%
\fi
{\par\noindent\begin{tikzpicture}[remember picture]% {\par\noindent\begin{tikzpicture}[remember picture]%
\draw node[inlinenotestyle] {};\end{tikzpicture}\par}% \draw node[inlinenotestyle] {};\end{tikzpicture}\par}%
\else% \else%
{\par\noindent\begin{tikzpicture}[remember picture]% {\par\noindent\begin{tikzpicture}[remember picture]%
\draw node[inlinenotestyle,font=\@todonotes@sizecommand] {\@todonotes@text};% \draw node[inlinenotestyle,font=\@todonotes@sizecommand] {%
\if@todonotes@authorgiven%
{\noindent \@todonotes@sizecommand \@todonotes@author:\,\@todonotes@text}%
\else%
{\noindent \@todonotes@sizecommand \@todonotes@text}%
\fi};%
\end{tikzpicture}\par}% \end{tikzpicture}\par}%
\fi}% \fi}%
% \end{macrocode} % \end{macrocode}
@ -1440,20 +1503,34 @@
\draw node[notestyle] {};% \draw node[notestyle] {};%
\end{tikzpicture}\\ % \end{tikzpicture}\\ %
\begin{minipage}{\@todonotes@textwidth}% \begin{minipage}{\@todonotes@textwidth}%
\@todonotes@sizecommand \@todonotes@text% \if@todonotes@authorgiven%
\@todonotes@sizecommand \@todonotes@author \@todonotes@text%
\else%
\@todonotes@sizecommand \@todonotes@text%
\fi%
\end{minipage}\\% \end{minipage}\\%
\begin{tikzpicture}[remember picture]% \begin{tikzpicture}[remember picture]%
\draw node[notestyle] (inNote) {};% \draw node[notestyle] (inNote) {};%
\end{tikzpicture}% \end{tikzpicture}%
\else% \else%
\let\originalHbadness\hbadness \let\originalHbadness\hbadness
\hbadness 100000 \hbadness 100000
\begin{tikzpicture}[remember picture,baseline=(X.base)]% \begin{tikzpicture}[remember picture,baseline=(X.base)]%
\node(X){\vphantom{X}};% \node(X){\vphantom{X}};%
\draw node[notestyle,font=\@todonotes@sizecommand,anchor=north] (inNote) at (X.north)% \draw node[notestyle,font=\@todonotes@sizecommand,anchor=north] (inNote) at (X.north)%
{\@todonotes@text};% {\@todonotes@text};%
\if@todonotes@authorgiven%
\draw node[notestyle,font=\@todonotes@sizecommand,anchor=north] (inNote) at (X.north)%
{\@todonotes@sizecommand\@todonotes@author};%
\node(Y)[below=of X]{};%
\draw node[notestyle,font=\@todonotes@sizecommand,anchor=north] (inNote) at (X.south)%
{\@todonotes@text};%
\else%
\draw node[notestyle,font=\@todonotes@sizecommand,anchor=north] (inNote) at (X.north)%
{\@todonotes@text};%
\fi%
\end{tikzpicture}% \end{tikzpicture}%
\hbadness \originalHbadness \hbadness \originalHbadness
\fi}% \fi}%
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
@ -1512,9 +1589,9 @@
% \begin{macro}{\missingfigure} % \begin{macro}{\missingfigure}
% Defines the |\missingfigure| macro. % Defines the |\missingfigure| macro.
% \begin{macrocode} % \begin{macrocode}
\newcommand{\missingfigure}[2][]{ \newcommand{\missingfigure}[2][]{%
\setkeys{todonotes}{#1}% \setkeys{todonotes}{#1}%
\addcontentsline{tdo}{todo}{\@todonotes@MissingFigureText: \protect{#2}}% \addcontentsline{tdo}{todo}{\@todonotes@MissingFigureText: #2}%
\par \par
\noindent \noindent
\begin{tikzpicture} \begin{tikzpicture}
@ -1549,10 +1626,55 @@
% \begin{macro}{\todo} % \begin{macro}{\todo}
% Define the |\todo| command as a redirection to |\@todo|. % Define the |\todo| command as a redirection to |\@todo|.
% \begin{macrocode} % \begin{macrocode}
\newcommand{\todo}[2][]{\@todo[#1]{#2}} \newcommand{\todo}[2][]{\@todo[#1]{#2}}%
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
% \appendix
% \section{Longer code examples}
% \subsection{Alter appearence of the list of todos}
% \label{appssecAlterAppearenceOfListoftodos}
% \begin{verbatim}
% \documentclass{book}
%
% \usepackage{todonotes}
% \usepackage{lipsum}
% \makeatletter
% \def\myaddcontentsline#1#2#3{%
% \addtocontents{#1}{\protect\contentsline{#2}{#3}{see \thesection\ at p. \thepage}}}
% \renewcommand{\@todonotes@addElementToListOfTodos}{%
% \if@todonotes@colorinlistoftodos%
% \myaddcontentsline{tdo}{todo}{{%
% \colorbox{\@todonotes@currentbackgroundcolor}%
% {\textcolor{\@todonotes@currentbackgroundcolor}{o}}%
% \ \@todonotes@caption}}%
% \else%
% \myaddcontentsline{tdo}{todo}{{\@todonotes@caption}}%
% \fi}%
% \newcommand*\mylistoftodos{%
% \begingroup
% \setbox\@tempboxa\hbox{see 9.9 at p. 99}%
% \renewcommand*\@tocrmarg{\the\wd\@tempboxa}%
% \renewcommand*\@pnumwidth{\the\wd\@tempboxa}%
% \listoftodos%
% \endgroup
% }
% \makeatother
%
% \begin{document}
% \chapter{My first chapter}
% \section{A first section}
% \lipsum
% \todo{This is a note}
% \section{Another section}
% \lipsum
% \todo{This is another note}
%
% \tableofcontents
% \mylistoftodos
% \end{document}
% \end{verbatim}
% %
% \newpage
% \Finale % \Finale
\endinput \endinput

Loading…
Cancel
Save