From 56c00847bbaa3a4973a9409f0cd23390c888a2c7 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 25 Nov 2012 23:24:03 +0000 Subject: todonotes (25nov12) git-svn-id: svn://tug.org/texlive/trunk@28362 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/todonotes/todonotes.sty | 44 ++++++++++++---------- 1 file changed, 25 insertions(+), 19 deletions(-) (limited to 'Master/texmf-dist/tex/latex') diff --git a/Master/texmf-dist/tex/latex/todonotes/todonotes.sty b/Master/texmf-dist/tex/latex/todonotes/todonotes.sty index dc45536e97a..b6276a32dd6 100644 --- a/Master/texmf-dist/tex/latex/todonotes/todonotes.sty +++ b/Master/texmf-dist/tex/latex/todonotes/todonotes.sty @@ -38,6 +38,7 @@ \newcommand{\@todonotes@textwidth}{\marginparwidth} \newcommand{\@todonotes@textsize}{\normalsize} \newcommand{\@todonotes@figwidth}{\columnwidth} +\newcommand{\@todonotes@figheight}{4cm} \AtBeginDocument{ \ifx\undefined\phantomsection \newcommand{\phantomsection}{} @@ -158,6 +159,8 @@ \usetikzlibrary{shadows}} \define@key{todonotes.sty}% {figwidth}{\renewcommand{\@todonotes@figwidth}{#1}} +\define@key{todonotes.sty}% + {figheight}{\renewcommand{\@todonotes@figheight}{#1}} \ProcessOptionsX* \if@todonotes@disabled \else @@ -222,6 +225,9 @@ \newcommand{\@todonotes@currentfigwidth}{\@todonotes@figwidth} \define@key{todonotes}% {figwidth}{\renewcommand{\@todonotes@currentfigwidth}{#1}} +\newcommand{\@todonotes@currentfigheight}{\@todonotes@figheight} +\define@key{todonotes}% + {figheight}{\renewcommand{\@todonotes@currentfigheight}{#1}} \presetkeys% {todonotes}% {linecolor=\@todonotes@linecolor,% @@ -233,14 +239,15 @@ nocaption,% noauthor,% figwidth=\@todonotes@figwidth,% + figheight=\@todonotes@figheight,% line, list, size=\@todonotes@textsize}{}% \if@todonotes@disabled% \newcommand{\listoftodos}[1][]{} - \newcommand{\@todo}[2][]{\ignorespaces} + \newcommand{\@todo}[2][]{} \newcommand{\missingfigure}[2][]{} \else % \if@todonotes@disabled \newcommand{\listoftodos}[1][\@todonotes@todolistname] - {\ifdefined\chapter\chapter*{#1}\else\section*{#1}\fi \@starttoc{tdo}} + {\@ifundefined{chapter}{\section*{#1}}{\chapter*{#1}} \@starttoc{tdo}} \newcommand{\l@todo} {\@dottedtocline{1}{0em}{2.3em}} \tikzstyle{notestyleraw} = [ @@ -284,7 +291,7 @@ \else% \renewcommand{\@todonotes@caption}{#2}% \fi% - \@todonotes@addElementToListOfTodos + \@todonotes@addElementToListOfTodos% \fi% \if@todonotes@captiongiven% \if@todonotes@prependcaption% @@ -292,15 +299,14 @@ \fi% \fi% \if@todonotes@inlinenote% - \@todonotes@drawInlineNote + \@todonotes@drawInlineNote% \else% - \@todonotes@drawMarginNoteWithLine -\fi %\if@todonotes@inlinenote -\fi %\if@todonotes@localdisable -\ignorespaces% + \@todonotes@drawMarginNoteWithLine% +\fi%\if@todonotes@inlinenote +\fi%\if@todonotes@localdisable }% \newcommand{\@todonotes@drawMarginNoteWithLine}{% -\begin{tikzpicture}[remember picture, baseline=-0.75ex]% +\begin{tikzpicture}[remember picture, overlay, baseline=-0.75ex]% \node [coordinate] (inText) {};% \end{tikzpicture}% \marginpar[{% Draw note in left margin @@ -333,7 +339,7 @@ \draw node[inlinenotestyle] {};\end{tikzpicture}\par}% \else% {\par\noindent\begin{tikzpicture}[remember picture]% - \draw node[inlinenotestyle,font=\@todonotes@sizecommand] {% + \draw node[inlinenotestyle,font=\@todonotes@sizecommand]{% \if@todonotes@authorgiven% {\noindent \@todonotes@sizecommand \@todonotes@author:\,\@todonotes@text}% \else% @@ -345,7 +351,7 @@ \if@todonotes@dviStyle% \begin{tikzpicture}[remember picture]% \draw node[notestyle] {};% - \end{tikzpicture}\\ % + \end{tikzpicture}\\% \begin{minipage}{\@todonotes@textwidth}% \if@todonotes@authorgiven% \@todonotes@sizecommand \@todonotes@author \@todonotes@text% @@ -357,8 +363,8 @@ \draw node[notestyle] (inNote) {};% \end{tikzpicture}% \else% - \let\originalHbadness\hbadness - \hbadness 100000 + \let\originalHbadness\hbadness% + \hbadness 100000% \begin{tikzpicture}[remember picture,baseline=(X.base)]% \node(X){\vphantom{X}};% \draw node[notestyle,font=\@todonotes@sizecommand,anchor=north] (inNote) at (X.north)% @@ -374,7 +380,7 @@ {\@todonotes@text};% \fi% \end{tikzpicture}% - \hbadness \originalHbadness + \hbadness \originalHbadness% \fi}% \newcommand{\@todonotes@drawLineToRightMargin}{% \if@todonotes@line% @@ -395,9 +401,9 @@ -| ([xshift=-0.2cm] inNote.west)% -| (inNote.west);% \end{tikzpicture}% -\fi +\fi% \fi}% -\newcommand{\@todonotes@drawLineToLeftMargin}{ +\newcommand{\@todonotes@drawLineToLeftMargin}{% \if@todonotes@line% \if@todonotes@fancyline% \tikz[remember picture,overlay]{% @@ -417,7 +423,7 @@ -| (inNote.east);% \end{tikzpicture}% \fi% -\fi} +\fi}% \newcommand{\missingfigure}[2][]{% \setkeys{todonotes}{#1}% \addcontentsline{tdo}{todo}{\@todonotes@MissingFigureText: #2}% @@ -425,7 +431,7 @@ \noindent \begin{tikzpicture} \draw[fill=black!40, draw = white, line width=0pt] - (-2, -2.5) rectangle +(\@todonotes@currentfigwidth, 4cm); + (-2, -2.5) rectangle +(\@todonotes@currentfigwidth, \@todonotes@currentfigheight); \draw (2, -0.3) node[right, text width=\@todonotes@currentfigwidth-4.5cm] {#2}; \draw[red, fill=white, rounded corners = 5pt, line width=10pt] @@ -442,7 +448,7 @@ \addcontentsline{toc}{\@ifundefined{chapter}{section}{chapter}}{\@todonotes@todolistname} \fi } -\newcommand{\todo}[2][]{\@todo[#1]{#2}}% +\newcommand{\todo}[2][]{\@bsphack\@todo[#1]{#2}\@esphack\ignorespaces}% \endinput %% %% End of file `todonotes.sty'. -- cgit v1.2.3