From 5c628436fda45c9dcae5c2382445eb7d3395d1d6 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 2 Apr 2009 18:41:54 +0000 Subject: todonotes update (31mar09) git-svn-id: svn://tug.org/texlive/trunk@12606 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/todonotes/todonotes.dtx | 84 ++++++++++++++++++++-- 1 file changed, 79 insertions(+), 5 deletions(-) (limited to 'Master/texmf-dist/source/latex/todonotes') diff --git a/Master/texmf-dist/source/latex/todonotes/todonotes.dtx b/Master/texmf-dist/source/latex/todonotes/todonotes.dtx index 3ab1952f8f1..8bf91f5b7d3 100644 --- a/Master/texmf-dist/source/latex/todonotes/todonotes.dtx +++ b/Master/texmf-dist/source/latex/todonotes/todonotes.dtx @@ -22,14 +22,14 @@ %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{todonotes} %<*package> - [2009/01/09 .dtx Todonotes source and documentation.] + [2009/03/31 .dtx Todonotes source and documentation.] % % %<*driver> \documentclass{ltxdoc} \usepackage{wrapfig} \usepackage[colorlinks, linkcolor=black]{hyperref} -\usepackage[colorinlistoftodos, shadow]{todonotes}[2009/01/09] +\usepackage[colorinlistoftodos, shadow]{todonotes}[2009/03/31] \usepackage{amsmath} \usepackage{setspace} \setcounter{tocdepth}{2} @@ -46,7 +46,7 @@ % % \fi % -% \CheckSum{398} +% \CheckSum{412} % % \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 @@ -132,6 +132,10 @@ % \changes{0.8.2}{2009/02/04}{Italian translation by Gustavo % Cevolani. Removed the dependence on the hyperref % package.} +% \changes{0.8.3}{2009/03/31}{Added a use case for linking to the +% list of todos, idea from Andreas Plank. Introduced a +% package option for listening to the draft option given +% to the document class.} % % \GetFileInfo{todonotes.dtx} % @@ -222,6 +226,13 @@ % |\missingfigure|) are defined as macros with no effect, and thus % all inserted notes are removed. % +% \DescribeMacro{obeyDraft} +% When the option |obeyDraft| is given, the package checks +% if the option |draft| is given (this option is usually given to +% the documentclass). If the |draft| option is given, the +% functionality of the package is enabled and otherwise the effect +% of the package is disabled. +% % \DescribeMacro{danish, german, french} % \DescribeMacro{spanish, catalan, italian} % Use the danish or german translations of the text strings @@ -713,6 +724,52 @@ % } % % +% +% \subsubsection{Link to list of todos} +% +% Using the |hyperref| package it is possible to add a link from +% the inserted todonotes to the list of todos. +% The example were supplied by Andreas Plank. +% \begin{verbatim} +% % Define a counter for the inserted todonotes. +% \newcounter{todoListItems} +% \newcommand{\todoTrans}[2][ ]{ +% % Increment counter +% \addtocounter{todoListItems}{1} +% \todo[% +% caption={\protect\hypertarget{todo\thetodoListItems}{} Translation}, +% #1] +% { +% #2 \hfill +% \hyperlink{todo\thetodoListItems}{$\uparrow$} +% } +% } +% \end{verbatim} +% +% \newcounter{todoListItems} +% \newcommand{\todoTrans}[2][ ]{ +% \addtocounter{todoListItems}{1} +% \todo[ +% caption={\protect\hypertarget{todo\thetodoListItems}{} Translation}, +% #1]{ +% #2 \hfill +% \hyperlink{todo\thetodoListItems}{$\uparrow$} +% } +% } +% +% The idea behind the code is to embed a |hypertarget| in each entry +% in the list of todos. In the todonotes a link to the entry in the +% list of todos is inserted as an arrow that points upwards. +% Using the |\todoTrans| command like below, the following two notes +% have been inserted. +% \begin{verbatim} +% \todoTrans{papirsflyver} +% \todoTrans[inline]{damplokomotiv} +% \end{verbatim} +% \todoTrans{papirsflyver} +% \todoTrans[inline]{damplokomotiv} +% +% % \iffalse % \StopEventually{\PrintChanges\PrintIndex} % \fi @@ -723,7 +780,7 @@ % % Identifies the package and loads the packages dependences. % \begin{macrocode} -\ProvidesPackage{todonotes}[2009/01/09] +\ProvidesPackage{todonotes}[2009/03/31] \RequirePackage{ifthen} \RequirePackage{xkeyval} \RequirePackage{xcolor} @@ -811,6 +868,13 @@ \newcounter{@todonotes@numberoftodonotes} % \end{macrocode} % +% Toggle whether the package should obey the global draft option. +% \begin{macrocode} +\newif{\if@todonotes@obeyDraft} +\DeclareOptionX{obeyDraft}{\@todonotes@obeyDrafttrue} +\newif{\if@todonotes@isDraft} +\DeclareOptionX{draft}{\@todonotes@isDrafttrue} +% \end{macrocode} % Make it possible to disable the functionality % of the package. If this option is given, the % commands |\todo{}| and |\listoftodos| are defined @@ -897,7 +961,17 @@ % \begin{macrocode} \ProcessOptionsX % \end{macrocode} - +% If the |obeyDraft| is given, check whether the |draft| +% option is given and enable or disable the functionality of this +% package. +% \begin{macrocode} +\if@todonotes@obeyDraft + \@todonotes@disabledfalse + \if@todonotes@isDraft + \@todonotes@disabledtrue + \fi +\fi +% \end{macrocode} % \subsection{Options for the todo command} % -- cgit v1.2.3