From 3a7ed51293855b6db86b4ce41e7f2403cc02c774 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 27 Sep 2010 00:39:06 +0000 Subject: todonotes 0.9.5 (26sep10) git-svn-id: svn://tug.org/texlive/trunk@19905 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/todonotes/todonotes.sty | 95 ++++++++++++---------- 1 file changed, 50 insertions(+), 45 deletions(-) (limited to 'Master/texmf-dist/tex/latex/todonotes') 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}}% -- cgit v1.2.3