From bc258ba7464ef10d950ea5cadaf99bfa4f94f19c Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 23 Nov 2018 21:42:53 +0000 Subject: todonotes (23nov18) git-svn-id: svn://tug.org/texlive/trunk@49233 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/todonotes/README | 2 +- .../examples/alterAppearenceOfListOfTodos.pdf | Bin 62871 -> 62842 bytes .../doc/latex/todonotes/examples/externalize.pdf | Bin 27659 -> 27648 bytes .../todonotes/examples/saveColorByUsingLayers.pdf | Bin 25180 -> 25181 bytes .../texmf-dist/doc/latex/todonotes/todonotes.pdf | Bin 314771 -> 315960 bytes .../source/latex/todonotes/todonotes.dtx | 271 ++++++++++++++------- .../texmf-dist/tex/latex/todonotes/todonotes.sty | 150 ++++++++---- 7 files changed, 287 insertions(+), 136 deletions(-) (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/todonotes/README b/Master/texmf-dist/doc/latex/todonotes/README index be267bedff2..5d85a836b36 100644 --- a/Master/texmf-dist/doc/latex/todonotes/README +++ b/Master/texmf-dist/doc/latex/todonotes/README @@ -43,7 +43,7 @@ Authors License ------- -Copyright 2015-07-08 Henrik Skov Midtiby +Copyright 2018-11-22 Henrik Skov Midtiby This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 diff --git a/Master/texmf-dist/doc/latex/todonotes/examples/alterAppearenceOfListOfTodos.pdf b/Master/texmf-dist/doc/latex/todonotes/examples/alterAppearenceOfListOfTodos.pdf index 68617bdc7ad..3443c1d3dfd 100644 Binary files a/Master/texmf-dist/doc/latex/todonotes/examples/alterAppearenceOfListOfTodos.pdf and b/Master/texmf-dist/doc/latex/todonotes/examples/alterAppearenceOfListOfTodos.pdf differ diff --git a/Master/texmf-dist/doc/latex/todonotes/examples/externalize.pdf b/Master/texmf-dist/doc/latex/todonotes/examples/externalize.pdf index 0a1bea8b369..3129f1a4218 100644 Binary files a/Master/texmf-dist/doc/latex/todonotes/examples/externalize.pdf and b/Master/texmf-dist/doc/latex/todonotes/examples/externalize.pdf differ diff --git a/Master/texmf-dist/doc/latex/todonotes/examples/saveColorByUsingLayers.pdf b/Master/texmf-dist/doc/latex/todonotes/examples/saveColorByUsingLayers.pdf index 43dfaae1d36..8081a3d5dbf 100644 Binary files a/Master/texmf-dist/doc/latex/todonotes/examples/saveColorByUsingLayers.pdf and b/Master/texmf-dist/doc/latex/todonotes/examples/saveColorByUsingLayers.pdf differ diff --git a/Master/texmf-dist/doc/latex/todonotes/todonotes.pdf b/Master/texmf-dist/doc/latex/todonotes/todonotes.pdf index c7ec5dffe89..facf0799b04 100644 Binary files a/Master/texmf-dist/doc/latex/todonotes/todonotes.pdf and b/Master/texmf-dist/doc/latex/todonotes/todonotes.pdf differ diff --git a/Master/texmf-dist/source/latex/todonotes/todonotes.dtx b/Master/texmf-dist/source/latex/todonotes/todonotes.dtx index c0327e426e3..4604bceb623 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> - [2015/07/09 .dtx Todonotes source and documentation.] + [2018/11/22 v1.1.1 Todonotes source and documentation.] % % %<*driver> \documentclass{ltxdoc} \usepackage{wrapfig} \usepackage[colorlinks, linkcolor=black, urlcolor=blue]{hyperref} -\usepackage[colorinlistoftodos, shadow]{todonotes}[2015/07/09] +\usepackage[colorinlistoftodos]{todonotes}[2018/11/22] \usepackage{amsmath} \usepackage{setspace} \usepackage{soul} @@ -47,7 +47,7 @@ % % \fi % -% \CheckSum{631} +% \CheckSum{710} % % \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 @@ -196,6 +196,16 @@ % suggested by ErikBoesen.} % \changes{1.0.7}{2018/07/09}{Changed the warning about marginparwidth to a % proper warning message.} +% \changes{1.0.8}{2018/09/08}{Improved spacing behaviour so it mimics the index macro, +% patch by Frank Mittelbach. +% Center graphics vertically in missingfigure, patch by Philipp Allgeuer. +% Added new option tickmarkheight as suggested by Richard Niland.} +% \changes{1.1.0}{2018/10/17}{Many improvements to the user interface by Frank Mittelbach. +% Added the command setuptodonotes. Added textcolor as an option. +% Marked the insertion point of notes with tickmarks with a customizable height. +% Steamline which options that are accepted to size commands +% (both commands (backslash tiny) and text (tiny) are now supported).} +% \changes{1.1.1}{2018/11/22}{Implemented shadow and noshadow options for the todo command.} % \GetFileInfo{todonotes.dtx} % % \DoNotIndex{\newcommand,\newenvironment} @@ -347,12 +357,14 @@ % % \DescribeMacro{color} % \DescribeMacro{backgroundcolor} +% \DescribeMacro{textcolor} % \DescribeMacro{linecolor} % \DescribeMacro{bordercolor} % These options sets the default colors for the todo command. -% There is three colors that can be specified. The border color +% There are four colors that can be specified. The border color % (default |bordercolor=black|) around the inserted text, the color -% behind the inserted text (default |backgroundcolor=orange|) and +% behind the inserted text (default |backgroundcolor=orange|), the +% color of the inserted text (default |textcolor=black|) and % the color of the line connecting the inserted textbox with the % current location in the text (default |linecolor=orange|). % Setting the |color| option to |val| passes this value on to the @@ -360,6 +372,10 @@ % The specified colors must be valid according to the % |xcolor| package. % +% \DescribeMacro{tickmarkheight} +% |tickmarkheight=length| set the height of the tickmark at +% the location where the todo is inserted, the default value is |0pt|. +% % \DescribeMacro{textwidth} % |textwidth=length| sets the width of a todo item in the margin to % |length|. The width of inline todonotes will allways be the same @@ -403,10 +419,10 @@ % There are several options that can be given to the |\todo| % command. All the options are described here and often I have % included examples of the change in visual appearance. -% Default values for these options can be set using the presetkeys +% Default values for these options can be set using the setuptodonotes % command. % \begin{verbatim} -% \presetkeys{todonotes}{fancyline, color=blue!30}{} +% \setuptodonotes{fancyline, color=blue!30} % \end{verbatim} % % \DescribeMacro{disable} @@ -415,6 +431,7 @@ % % \DescribeMacro{color} % \DescribeMacro{backgroundcolor} +% \DescribeMacro{textcolor} % \DescribeMacro{linecolor} % \DescribeMacro{bordercolor} % These options set the color that is used in the current todo @@ -437,10 +454,34 @@ % \end{verbatim} % An example that uses all of the color options is given % below\todo[linecolor=green!70!white, backgroundcolor=blue!20!white, -% bordercolor=red]{Anything but default colors}. +% bordercolor=red, textcolor=yellow]{Anything but default colors}. % \begin{verbatim} % \todo[linecolor=green!70!white, backgroundcolor=blue!20!white, -% bordercolor=red]{Anything but default colors}. +% bordercolor=red, textcolor=yellow]{Anything but default colors}. +% \end{verbatim} +% +% +% \DescribeMacro{shadow / noshadow} +% If the package is loaded with the |shadow| option, +% a shadow is added to all notes, otherwise no shadows are shown. +% This global setting can be overwritten by the |shadow| and |noshadow| +% \todo[noshadow]{A note without a shadow} +% options to the todo command. +% To insert a note with and without shadows, use the |shadow| +% \todo[shadow]{A note with a shadow} +% and |noshadow| options as shown here: +% \begin{verbatim} +% \todo[shadow]{A note with a shadow} +% \todo[noshadow]{A note without a shadow} +% \end{verbatim} +% +% \DescribeMacro{tickmarkheight} +% |tickmarkheight=length| set the height of the tickmark at +% the location where the todo is inserted. +% An example of the option in use is shown here. +% \todo[tickmarkheight=0.1cm]{Test of option.} +% \begin{verbatim} +% \todo[tickmarkheight=0.1cm]{Test of option.} % \end{verbatim} % % @@ -589,15 +630,16 @@ % \end{verbatim} % \missingfigure{Testing a long text string} % \begin{wrapfigure}[1]{r}[2cm]{6cm} -% \missingfigure[figwidth=6cm]{Add a test image \ldots} +% \missingfigure[figwidth=6cm]{Add an image \ldots} % \end{wrapfigure} % Another usage of the option is when |\missingfigure| is used in % the wrapfigure environment. % \begin{verbatim} % \begin{wrapfigure}[1]{r}[2cm]{6cm} -% \missingfigure[figwidth=6cm]{Add a test image \ldots} +% \missingfigure[figwidth=6cm]{Add an image \ldots} % \end{wrapfigure} % \end{verbatim} +% \vspace{2cm} % % \DescribeMacro{figheight} % The |figheight=length| option changes the height of the inserted @@ -659,19 +701,6 @@ %\usepackage{menukeys} % \end{verbatim} % -% \subsubsection{Spacing around inserted notes} -% Inserted todo commands will eat the white space after the command. -% \begin{verbatim} -%Testing\todo{Does this eat the space?} testing.\end{verbatim} -% \noindent -% Testing\todo{Does this eat the space?} testing. -% -% This can be prevented by adding curly parenthesis after the -% todo command, like shown below. -% \begin{verbatim} -%Testing\todo{Does this eat the space?}{} testing.\end{verbatim} -% \noindent -% Testing\todo{Does this eat the space?}{} testing. % % \subsubsection{Wrapping of long lines in list of todos} % When a document is compiled with latex (and not pdflatex) long @@ -752,15 +781,6 @@ % \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. -% -% % \subsubsection{Trouble with classicthesis.sty} % \href{http://tex.stackexchange.com/questions/33423/todonotes-produces-double-inline-notes-instead-of-single-margin-note-with-class}{Problem description on tex.stackexchange.com}. % @@ -1087,7 +1107,6 @@ % \todoTrans[inline]{damplokomotiv} % % -% \pagebreak[4] % \subsubsection{Numbered todonotes} % % The inserted todonotes can be argumented with the current subsubsection number. @@ -1194,20 +1213,27 @@ % % Identifies the package and loads the packages dependences. % \begin{macrocode} -\ProvidesPackage{todonotes}[2012/07/25] +\ProvidesPackage{todonotes}[2018/11/22] \RequirePackage{ifthen} \RequirePackage{xkeyval} \RequirePackage{xcolor} \RequirePackage{tikz} \usetikzlibrary{positioning} +\usetikzlibrary{shadows} \RequirePackage{calc} % \end{macrocode} +% Implement a function for setting up the todonotes package. +% \begin{macrocode} +\newcommand\setuptodonotes[1]{\presetkeys{todonotes}{#1}{}} +% \end{macrocode} % Some default values are set % \begin{macrocode} \newcommand{\@todonotes@text}{}% \newcommand{\@todonotes@backgroundcolor}{orange} +\newcommand{\@todonotes@textcolor}{black} \newcommand{\@todonotes@linecolor}{orange} \newcommand{\@todonotes@bordercolor}{black} +\newcommand{\@todonotes@tickmarkheight}{0cm} \newcommand{\@todonotes@textwidth}{\marginparwidth} \newcommand{\@todonotes@textsize}{\normalsize} \newcommand{\@todonotes@figwidth}{\linewidth} @@ -1377,6 +1403,12 @@ prior to loading the todonotes package.} \else\fi% \define@key{todonotes.sty}% {backgroundcolor}{\renewcommand{\@todonotes@backgroundcolor}{#1}} % \end{macrocode} +% Make the text color of the notes as +% an option. +% \begin{macrocode} +\define@key{todonotes.sty}% + {textcolor}{\renewcommand{\@todonotes@textcolor}{#1}} +% \end{macrocode} % Make the line color of the notes as % an option. % \begin{macrocode} @@ -1389,6 +1421,12 @@ prior to loading the todonotes package.} \else\fi% \define@key{todonotes.sty}% {bordercolor}{\renewcommand{\@todonotes@bordercolor}{#1}} % \end{macrocode} +% Make the height of the line start marking as +% an option. +% \begin{macrocode} +\define@key{todonotes.sty}% + {tickmarkheight}{\renewcommand{\@todonotes@tickmarkheight}{#1}} +% \end{macrocode} % Set whether short captions given as arguments to the todo command % should be included in the inserted todonote. % \begin{macrocode} @@ -1401,19 +1439,17 @@ prior to loading the todonotes package.} \else\fi% \define@key{todonotes.sty}% {textwidth}{\renewcommand{\@todonotes@textwidth}{#1}} % \end{macrocode} -% Make the text size as an option. It requires some magic with the -% |\csname| and |\endcsname| macros, as commands cannot be taken as -% options for a package. +% Make the text size as an option, accept both |size| and |textsize|. % \begin{macrocode} \define@key{todonotes.sty}% - {textsize}{\renewcommand{\@todonotes@textsize}{\csname #1\endcsname}} + {textsize}{\renewcommand{\@todonotes@textsize}{#1}} +\define@key{todonotes.sty}% + {size}{\renewcommand{\@todonotes@textsize}{#1}} % \end{macrocode} % Add option for shadows behind the inserted notes % \begin{macrocode} -\newif{\if@todonotes@shadowenabled} -\@todonotes@shadowenabledfalse -\DeclareOptionX{shadow}{\@todonotes@shadowenabledtrue -\usetikzlibrary{shadows}} +\newcommand{\@todonotes@shadowenabledbydefault}{noshadow} +\DeclareOptionX{shadow}{\renewcommand{\@todonotes@shadowenabledbydefault}{shadow}} % \end{macrocode} % Add option for the default width of the figure inserted with % |\missingfigure|. @@ -1464,6 +1500,7 @@ prior to loading the todonotes package.} \else\fi% % \begin{macrocode} \newcommand{\@todonotes@currentlinecolor}{}% \newcommand{\@todonotes@currentbackgroundcolor}{}% +\newcommand{\@todonotes@currenttextcolor}{}% \newcommand{\@todonotes@currentbordercolor}{}% \define@key{todonotes}{color}{% \renewcommand{\@todonotes@currentlinecolor}{#1}% @@ -1472,13 +1509,27 @@ prior to loading the todonotes package.} \else\fi% \renewcommand{\@todonotes@currentlinecolor}{#1}}% \define@key{todonotes}{backgroundcolor}{% \renewcommand{\@todonotes@currentbackgroundcolor}{#1}}% +\define@key{todonotes}{textcolor}{% + \renewcommand{\@todonotes@currenttextcolor}{#1}}% \define@key{todonotes}{bordercolor}{% \renewcommand{\@todonotes@currentbordercolor}{#1}}% % \end{macrocode} +% Toggle whether there is a shadow behind the inserted notes. +% \begin{macrocode} +\newif\if@todonotes@useshadow% +\define@key{todonotes}{shadow}[]{\@todonotes@useshadowtrue}% +\define@key{todonotes}{noshadow}[]{\@todonotes@useshadowfalse}% +% \end{macrocode} +% Define height of the inserted tickmark. +% \begin{macrocode} +\define@key{todonotes}{tickmarkheight}{% + \renewcommand{\@todonotes@tickmarkheight}{#1}}% +% \end{macrocode} % Set a relative font size % \begin{macrocode} \newcommand{\@todonotes@sizecommand}{}% -\define@key{todonotes}{size}{\renewcommand{\@todonotes@sizecommand}{#1}}% +\define@key{todonotes}{size}{\renewcommand{\@todonotes@sizecommand}{#1}% +}% % \end{macrocode} % Should the todo item be disabled? % \begin{macrocode} @@ -1567,18 +1618,24 @@ prior to loading the todonotes package.} \else\fi% {todonotes}% {linecolor=\@todonotes@linecolor,% backgroundcolor=\@todonotes@backgroundcolor,% + textcolor=\@todonotes@textcolor,% bordercolor=\@todonotes@bordercolor,% + tickmarkheight=0cm,% nofancyline,% nodisable,% noinline,% nocaption,% noauthor,% + \@todonotes@shadowenabledbydefault,% figwidth=\@todonotes@figwidth,% figheight=\@todonotes@figheight,% figcolor=\@todonotes@figcolor,% - line, list, size=\@todonotes@textsize, + line, list,% inlinewidth=\linewidth, inlinepar}{}% +\@temptokena\expandafter{\@todonotes@textsize} +\edef\next{\noexpand\presetkeys{todonotes}{size=\the\@temptokena}{}} +\next % \end{macrocode} % \subsection{The main code part} % Here is the actual macros defined. @@ -1604,30 +1661,12 @@ prior to loading the todonotes package.} \else\fi% \tikzstyle{notestyleraw} = [ draw=\@todonotes@currentbordercolor, fill=\@todonotes@currentbackgroundcolor, + text=\@todonotes@currenttextcolor, line width=0.5pt, text width = \@todonotes@textwidth - 1.6 ex - 1pt, inner sep = 0.8 ex, rounded corners=4pt] % \end{macrocode} -% Add shadows and rounded corners to the inserted todonotes. -% \begin{macrocode} -\if@todonotes@shadowenabled -\tikzstyle{notestyle} = [notestyleraw, - general shadow={shadow xshift=.5ex, shadow yshift=-.5ex, - opacity=1,fill=black!50}] -\else -\tikzstyle{notestyle} = [notestyleraw] -\fi -\tikzstyle{notestyleleft} = [ - notestyle, - left] -\tikzstyle{connectstyle} = [ - thick, - draw=\@todonotes@currentlinecolor] -\tikzstyle{inlinenotestyle} = [ - notestyle, - text width=\@todonotes@inlinewidth - 1.6 ex - 1 pt] -% \end{macrocode} % % \begin{macro}{\@todo} % Define the |\@todo| command. @@ -1648,6 +1687,29 @@ prior to loading the todonotes package.} \else\fi% \renewcommand{\@todonotes@caption}{#2}% \setkeys{todonotes}{#1}% % \end{macrocode} +% +% Add shadows to the inserted todonotes. +% \begin{macrocode} +\if@todonotes@useshadow% +\tikzstyle{notestyle} = [notestyleraw,% + general shadow={shadow xshift=0.5ex, shadow yshift=-0.5ex,% + opacity=1,fill=black!50}]% +\else% +\tikzstyle{notestyle} = [notestyleraw]% +\fi% +% \end{macrocode} +% Update notestyles +% \begin{macrocode} +\tikzstyle{notestyleleft} = [% + notestyle,% + left]% +\tikzstyle{connectstyle} = [% + thick,% + draw=\@todonotes@currentlinecolor]% +\tikzstyle{inlinenotestyle} = [% + notestyle,% + text width=\@todonotes@inlinewidth - 1.6 ex - 1 pt]% +% \end{macrocode} % If the option |disable| is given to the command, no output is generated. % \begin{macrocode} \if@todonotes@localdisable% @@ -1697,6 +1759,12 @@ prior to loading the todonotes package.} \else\fi% % First is the current location in the document stored, this enables % us later to connect this point with the inserted todonote. % \begin{macrocode} +\ifvmode + \vspace*{-\parskip}% % backup if we are already in vertical mode + \vskip-\baselineskip % (and don't loose that space after a + % pagebreak ... + \noindent +\fi \begin{tikzpicture}[remember picture, overlay, baseline=-0.75ex]% \node [coordinate] (inText) {};% \end{tikzpicture}% @@ -1734,6 +1802,18 @@ prior to loading the todonotes package.} \else\fi% % \end{macrocode} % \end{macro} % \begin{macro}{drawInlineNote} +% Define helper function |useSizeCommand|. +% \begin{macrocode} +\newcommand{\@todonotes@useSizeCommand}{% +\ifcsname \expandafter\string\@todonotes@sizecommand\endcsname +\csname \expandafter\string\@todonotes@sizecommand\endcsname% +\else +\@todonotes@sizecommand +\fi% +}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{drawInlineNote} % Define helper function |drawInlineNote|. % \begin{macrocode} \newcommand{\@todonotes@drawInlineNote}{% @@ -1744,9 +1824,9 @@ prior to loading the todonotes package.} \else\fi% \end{tikzpicture}% \if@todonotes@inlinepar\par\fi}% \if@todonotes@authorgiven% - {\noindent \@todonotes@sizecommand \@todonotes@author:\,\@todonotes@text}% + {\noindent \@todonotes@useSizeCommand \@todonotes@author:\,\@todonotes@text}% \else% - {\noindent \@todonotes@sizecommand \@todonotes@text}% + {\noindent \@todonotes@useSizeCommand \@todonotes@text}% \fi {\if@todonotes@inlinepar\par\noindent\fi% \begin{tikzpicture}[remember picture]% @@ -1756,11 +1836,11 @@ prior to loading the todonotes package.} \else\fi% \else% {\if@todonotes@inlinepar\par\noindent\fi% \begin{tikzpicture}[remember picture]% - \draw node[inlinenotestyle,font=\@todonotes@sizecommand]{% + \draw node[inlinenotestyle,font=\@todonotes@useSizeCommand]{% \if@todonotes@authorgiven% - {\noindent \@todonotes@sizecommand \@todonotes@author:\,\@todonotes@text}% + {\noindent \@todonotes@author:\,\@todonotes@text}% \else% - {\noindent \@todonotes@sizecommand \@todonotes@text}% + {\noindent \@todonotes@text}% \fi};% \end{tikzpicture}% \if@todonotes@inlinepar\par\fi}% @@ -1777,9 +1857,9 @@ prior to loading the todonotes package.} \else\fi% \end{tikzpicture}\\% \begin{minipage}{\@todonotes@textwidth}% \if@todonotes@authorgiven% - \@todonotes@sizecommand \@todonotes@author \@todonotes@text% + \@todonotes@useSizeCommand \@todonotes@author \@todonotes@text% \else% - \@todonotes@sizecommand \@todonotes@text% + \@todonotes@useSizeCommand \@todonotes@text% \fi% \end{minipage}\\% \begin{tikzpicture}[remember picture]% @@ -1789,15 +1869,15 @@ prior to loading the todonotes package.} \else\fi% \let\originalHbadness\hbadness% \hbadness 100000% \begin{tikzpicture}[remember picture,baseline=(X.base)]% - \node(X){\vphantom{\@todonotes@sizecommand X}};% + \node(X){\vphantom{\@todonotes@useSizeCommand X}};% \if@todonotes@authorgiven% - \draw node[notestyle,font=\@todonotes@sizecommand,anchor=north] (inNote) at (X.north)% - {\@todonotes@sizecommand\@todonotes@author};% + \draw node[notestyle,font=\@todonotes@useSizeCommand,anchor=north] (inNote) at (X.north)% + {\@todonotes@author};% \node(Y)[below=of X]{};% - \draw node[notestyle,font=\@todonotes@sizecommand,anchor=north] (inNote) at (X.south)% + \draw node[notestyle,font=\@todonotes@useSizeCommand,anchor=north] (inNote) at (X.south)% {\@todonotes@text};% \else% - \draw node[notestyle,font=\@todonotes@sizecommand,anchor=north] (inNote) at (X.north)% + \draw node[notestyle,font=\@todonotes@useSizeCommand,anchor=north] (inNote) at (X.north)% {\@todonotes@text};% \fi% \end{tikzpicture}% @@ -1823,7 +1903,8 @@ prior to loading the todonotes package.} \else\fi% \else% \begin{tikzpicture}[remember picture, overlay]% \draw[connectstyle]% - ([yshift=-0.2cm] inText)% + ([yshift=-0.2cm + \@todonotes@tickmarkheight] inText)% + -| ([yshift=-0.2cm] inText)% -| ([xshift=-0.2cm] inNote.west)% -| (inNote.west);% \end{tikzpicture}% @@ -1849,7 +1930,8 @@ prior to loading the todonotes package.} \else\fi% \else% \begin{tikzpicture}[remember picture, overlay]% \draw[connectstyle]% - ([yshift=-0.2cm] inText)% + ([yshift=-0.2cm + \@todonotes@tickmarkheight] inText)% + -| ([yshift=-0.2cm] inText)% -| ([xshift=0.2cm] inNote.east)% -| (inNote.east);% \end{tikzpicture}% @@ -1865,16 +1947,19 @@ prior to loading the todonotes package.} \else\fi% \addcontentsline{tdo}{todo}{\@todonotes@MissingFigureText: #2}% \par \noindent +\hfill \begin{tikzpicture} \draw[fill=\@todonotes@currentfigcolor, draw = black!40, line width=2pt] - (-2, -2.5) rectangle +(\@todonotes@currentfigwidth, \@todonotes@currentfigheight); -\draw (2, -0.3) node[right, text - width=\@todonotes@currentfigwidth-4.5cm, font=\@todonotes@sizecommand] {#2}; + (-2, -0.5*\@todonotes@currentfigheight-0.5cm) + rectangle +(\@todonotes@currentfigwidth, \@todonotes@currentfigheight); +\draw (2, -0.5) node[right, text + width=\@todonotes@currentfigwidth-4.5cm, font=\@todonotes@useSizeCommand] {#2}; \draw[red, fill=white, rounded corners = 5pt, line width=10pt] (30:2cm) -- (150:2cm) -- (270:2cm) -- cycle; \draw (0, 0.3) node {\@todonotes@MissingFigureUp}; \draw (0, -0.3) node {\@todonotes@MissingFigureDown}; \end{tikzpicture}\hfill +\null\par }% Ending \missingfigure command \fi% Ending \@todonotes@ifdisabled % \end{macrocode} @@ -1885,10 +1970,10 @@ prior to loading the todonotes package.} \else\fi% % The |\todototoc| command respects the disable option. % \begin{macrocode} \newcommand{\todototoc} -{ +{% \if@todonotes@disabled \else - \addcontentsline{toc}{\@ifundefined{chapter}{section}{chapter}}{\@todonotes@todolistname} + \addcontentsline{toc}{\@ifundefined{chapter}{section}{chapter}}{\@todonotes@todolistname}% \fi } % \end{macrocode} @@ -1897,11 +1982,23 @@ prior to loading the todonotes package.} \else\fi% % \begin{macro}{\todo} % Define the |\todo| command as a redirection to |\@todo|. % \begin{macrocode} -\newcommand{\todo}[2][]{\if@todonotes@inlinepar% - \@bsphack\@todo[#1]{#2}\@esphack% +\newcommand{\todo}[2][]{% + \if@todonotes@inlinepar + \ifhmode + \@bsphack + \@todonotes@vmodefalse + \else + \@savsf\@m + \@savsk\z@ + \@todonotes@vmodetrue + \fi + {\@todo[#1]{#2}}% + \@esphack% + \if@todonotes@vmode \par \fi \else% - \@todo[#1]{#2}% - \fi}% + \@todo[#1]{#2}% + \fi} +\newif\if@todonotes@vmode % \end{macrocode} % \end{macro} % \appendix diff --git a/Master/texmf-dist/tex/latex/todonotes/todonotes.sty b/Master/texmf-dist/tex/latex/todonotes/todonotes.sty index 0d1ce58cd3b..7b9a76d30bb 100644 --- a/Master/texmf-dist/tex/latex/todonotes/todonotes.sty +++ b/Master/texmf-dist/tex/latex/todonotes/todonotes.sty @@ -22,19 +22,23 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{todonotes} - [2015/07/09 .dtx Todonotes source and documentation.] + [2018/11/22 v1.1.1 Todonotes source and documentation.] -\ProvidesPackage{todonotes}[2012/07/25] +\ProvidesPackage{todonotes}[2018/11/22] \RequirePackage{ifthen} \RequirePackage{xkeyval} \RequirePackage{xcolor} \RequirePackage{tikz} \usetikzlibrary{positioning} +\usetikzlibrary{shadows} \RequirePackage{calc} +\newcommand\setuptodonotes[1]{\presetkeys{todonotes}{#1}{}} \newcommand{\@todonotes@text}{}% \newcommand{\@todonotes@backgroundcolor}{orange} +\newcommand{\@todonotes@textcolor}{black} \newcommand{\@todonotes@linecolor}{orange} \newcommand{\@todonotes@bordercolor}{black} +\newcommand{\@todonotes@tickmarkheight}{0cm} \newcommand{\@todonotes@textwidth}{\marginparwidth} \newcommand{\@todonotes@textsize}{\normalsize} \newcommand{\@todonotes@figwidth}{\linewidth} @@ -162,21 +166,25 @@ prior to loading the todonotes package.} \else\fi% \renewcommand{\@todonotes@linecolor}{#1}} \define@key{todonotes.sty}% {backgroundcolor}{\renewcommand{\@todonotes@backgroundcolor}{#1}} +\define@key{todonotes.sty}% + {textcolor}{\renewcommand{\@todonotes@textcolor}{#1}} \define@key{todonotes.sty}% {linecolor}{\renewcommand{\@todonotes@linecolor}{#1}} \define@key{todonotes.sty}% {bordercolor}{\renewcommand{\@todonotes@bordercolor}{#1}} +\define@key{todonotes.sty}% + {tickmarkheight}{\renewcommand{\@todonotes@tickmarkheight}{#1}} \newif{\if@todonotes@prependcaptionglobal} \@todonotes@prependcaptionglobalfalse \DeclareOptionX{prependcaption}{\@todonotes@prependcaptionglobaltrue} \define@key{todonotes.sty}% {textwidth}{\renewcommand{\@todonotes@textwidth}{#1}} \define@key{todonotes.sty}% - {textsize}{\renewcommand{\@todonotes@textsize}{\csname #1\endcsname}} -\newif{\if@todonotes@shadowenabled} -\@todonotes@shadowenabledfalse -\DeclareOptionX{shadow}{\@todonotes@shadowenabledtrue -\usetikzlibrary{shadows}} + {textsize}{\renewcommand{\@todonotes@textsize}{#1}} +\define@key{todonotes.sty}% + {size}{\renewcommand{\@todonotes@textsize}{#1}} +\newcommand{\@todonotes@shadowenabledbydefault}{noshadow} +\DeclareOptionX{shadow}{\renewcommand{\@todonotes@shadowenabledbydefault}{shadow}} \define@key{todonotes.sty}% {figwidth}{\renewcommand{\@todonotes@figwidth}{#1}} \define@key{todonotes.sty}% @@ -202,6 +210,7 @@ prior to loading the todonotes package.} \else\fi% \newcommand{\@todonotes@currentlinecolor}{}% \newcommand{\@todonotes@currentbackgroundcolor}{}% +\newcommand{\@todonotes@currenttextcolor}{}% \newcommand{\@todonotes@currentbordercolor}{}% \define@key{todonotes}{color}{% \renewcommand{\@todonotes@currentlinecolor}{#1}% @@ -210,10 +219,18 @@ prior to loading the todonotes package.} \else\fi% \renewcommand{\@todonotes@currentlinecolor}{#1}}% \define@key{todonotes}{backgroundcolor}{% \renewcommand{\@todonotes@currentbackgroundcolor}{#1}}% +\define@key{todonotes}{textcolor}{% + \renewcommand{\@todonotes@currenttextcolor}{#1}}% \define@key{todonotes}{bordercolor}{% \renewcommand{\@todonotes@currentbordercolor}{#1}}% +\newif\if@todonotes@useshadow% +\define@key{todonotes}{shadow}[]{\@todonotes@useshadowtrue}% +\define@key{todonotes}{noshadow}[]{\@todonotes@useshadowfalse}% +\define@key{todonotes}{tickmarkheight}{% + \renewcommand{\@todonotes@tickmarkheight}{#1}}% \newcommand{\@todonotes@sizecommand}{}% -\define@key{todonotes}{size}{\renewcommand{\@todonotes@sizecommand}{#1}}% +\define@key{todonotes}{size}{\renewcommand{\@todonotes@sizecommand}{#1}% +}% \newif\if@todonotes@localdisable% \define@key{todonotes}{disable}[]{\@todonotes@localdisabletrue}% \define@key{todonotes}{nodisable}[]{\@todonotes@localdisablefalse}% @@ -264,18 +281,24 @@ prior to loading the todonotes package.} \else\fi% {todonotes}% {linecolor=\@todonotes@linecolor,% backgroundcolor=\@todonotes@backgroundcolor,% + textcolor=\@todonotes@textcolor,% bordercolor=\@todonotes@bordercolor,% + tickmarkheight=0cm,% nofancyline,% nodisable,% noinline,% nocaption,% noauthor,% + \@todonotes@shadowenabledbydefault,% figwidth=\@todonotes@figwidth,% figheight=\@todonotes@figheight,% figcolor=\@todonotes@figcolor,% - line, list, size=\@todonotes@textsize, + line, list,% inlinewidth=\linewidth, inlinepar}{}% +\@temptokena\expandafter{\@todonotes@textsize} +\edef\next{\noexpand\presetkeys{todonotes}{size=\the\@temptokena}{}} +\next \if@todonotes@disabled% \newcommand{\listoftodos}[1][]{} \newcommand{\@todo}[2][]{} @@ -288,26 +311,11 @@ prior to loading the todonotes package.} \else\fi% \tikzstyle{notestyleraw} = [ draw=\@todonotes@currentbordercolor, fill=\@todonotes@currentbackgroundcolor, + text=\@todonotes@currenttextcolor, line width=0.5pt, text width = \@todonotes@textwidth - 1.6 ex - 1pt, inner sep = 0.8 ex, rounded corners=4pt] -\if@todonotes@shadowenabled -\tikzstyle{notestyle} = [notestyleraw, - general shadow={shadow xshift=.5ex, shadow yshift=-.5ex, - opacity=1,fill=black!50}] -\else -\tikzstyle{notestyle} = [notestyleraw] -\fi -\tikzstyle{notestyleleft} = [ - notestyle, - left] -\tikzstyle{connectstyle} = [ - thick, - draw=\@todonotes@currentlinecolor] -\tikzstyle{inlinenotestyle} = [ - notestyle, - text width=\@todonotes@inlinewidth - 1.6 ex - 1 pt] \newcommand{\@todo}[2][]{% \if@todonotes@prependcaptionglobal% \@todonotes@prependcaptiontrue% @@ -317,6 +325,22 @@ prior to loading the todonotes package.} \else\fi% \renewcommand{\@todonotes@text}{#2}% \renewcommand{\@todonotes@caption}{#2}% \setkeys{todonotes}{#1}% +\if@todonotes@useshadow% +\tikzstyle{notestyle} = [notestyleraw,% + general shadow={shadow xshift=0.5ex, shadow yshift=-0.5ex,% + opacity=1,fill=black!50}]% +\else% +\tikzstyle{notestyle} = [notestyleraw]% +\fi% +\tikzstyle{notestyleleft} = [% + notestyle,% + left]% +\tikzstyle{connectstyle} = [% + thick,% + draw=\@todonotes@currentlinecolor]% +\tikzstyle{inlinenotestyle} = [% + notestyle,% + text width=\@todonotes@inlinewidth - 1.6 ex - 1 pt]% \if@todonotes@localdisable% \else% \addtocounter{@todonotes@numberoftodonotes}{1}% @@ -341,6 +365,12 @@ prior to loading the todonotes package.} \else\fi% \fi%\if@todonotes@localdisable }% \newcommand{\@todonotes@drawMarginNoteWithLine}{% +\ifvmode + \vspace*{-\parskip}% % backup if we are already in vertical mode + \vskip-\baselineskip % (and don't loose that space after a + % pagebreak ... + \noindent +\fi \begin{tikzpicture}[remember picture, overlay, baseline=-0.75ex]% \node [coordinate] (inText) {};% \end{tikzpicture}% @@ -362,6 +392,13 @@ prior to loading the todonotes package.} \else\fi% \else% \addcontentsline{tdo}{todo}{\@todonotes@caption}% \fi}% +\newcommand{\@todonotes@useSizeCommand}{% +\ifcsname \expandafter\string\@todonotes@sizecommand\endcsname +\csname \expandafter\string\@todonotes@sizecommand\endcsname% +\else +\@todonotes@sizecommand +\fi% +}% \newcommand{\@todonotes@drawInlineNote}{% \if@todonotes@dviStyle% {\if@todonotes@inlinepar\par\noindent\fi% @@ -370,9 +407,9 @@ prior to loading the todonotes package.} \else\fi% \end{tikzpicture}% \if@todonotes@inlinepar\par\fi}% \if@todonotes@authorgiven% - {\noindent \@todonotes@sizecommand \@todonotes@author:\,\@todonotes@text}% + {\noindent \@todonotes@useSizeCommand \@todonotes@author:\,\@todonotes@text}% \else% - {\noindent \@todonotes@sizecommand \@todonotes@text}% + {\noindent \@todonotes@useSizeCommand \@todonotes@text}% \fi {\if@todonotes@inlinepar\par\noindent\fi% \begin{tikzpicture}[remember picture]% @@ -382,11 +419,11 @@ prior to loading the todonotes package.} \else\fi% \else% {\if@todonotes@inlinepar\par\noindent\fi% \begin{tikzpicture}[remember picture]% - \draw node[inlinenotestyle,font=\@todonotes@sizecommand]{% + \draw node[inlinenotestyle,font=\@todonotes@useSizeCommand]{% \if@todonotes@authorgiven% - {\noindent \@todonotes@sizecommand \@todonotes@author:\,\@todonotes@text}% + {\noindent \@todonotes@author:\,\@todonotes@text}% \else% - {\noindent \@todonotes@sizecommand \@todonotes@text}% + {\noindent \@todonotes@text}% \fi};% \end{tikzpicture}% \if@todonotes@inlinepar\par\fi}% @@ -398,9 +435,9 @@ prior to loading the todonotes package.} \else\fi% \end{tikzpicture}\\% \begin{minipage}{\@todonotes@textwidth}% \if@todonotes@authorgiven% - \@todonotes@sizecommand \@todonotes@author \@todonotes@text% + \@todonotes@useSizeCommand \@todonotes@author \@todonotes@text% \else% - \@todonotes@sizecommand \@todonotes@text% + \@todonotes@useSizeCommand \@todonotes@text% \fi% \end{minipage}\\% \begin{tikzpicture}[remember picture]% @@ -410,15 +447,15 @@ prior to loading the todonotes package.} \else\fi% \let\originalHbadness\hbadness% \hbadness 100000% \begin{tikzpicture}[remember picture,baseline=(X.base)]% - \node(X){\vphantom{\@todonotes@sizecommand X}};% + \node(X){\vphantom{\@todonotes@useSizeCommand X}};% \if@todonotes@authorgiven% - \draw node[notestyle,font=\@todonotes@sizecommand,anchor=north] (inNote) at (X.north)% - {\@todonotes@sizecommand\@todonotes@author};% + \draw node[notestyle,font=\@todonotes@useSizeCommand,anchor=north] (inNote) at (X.north)% + {\@todonotes@author};% \node(Y)[below=of X]{};% - \draw node[notestyle,font=\@todonotes@sizecommand,anchor=north] (inNote) at (X.south)% + \draw node[notestyle,font=\@todonotes@useSizeCommand,anchor=north] (inNote) at (X.south)% {\@todonotes@text};% \else% - \draw node[notestyle,font=\@todonotes@sizecommand,anchor=north] (inNote) at (X.north)% + \draw node[notestyle,font=\@todonotes@useSizeCommand,anchor=north] (inNote) at (X.north)% {\@todonotes@text};% \fi% \end{tikzpicture}% @@ -439,7 +476,8 @@ prior to loading the todonotes package.} \else\fi% \else% \begin{tikzpicture}[remember picture, overlay]% \draw[connectstyle]% -([yshift=-0.2cm] inText)% +([yshift=-0.2cm + \@todonotes@tickmarkheight] inText)% +-| ([yshift=-0.2cm] inText)% -| ([xshift=-0.2cm] inNote.west)% -| (inNote.west);% \end{tikzpicture}% @@ -460,7 +498,8 @@ prior to loading the todonotes package.} \else\fi% \else% \begin{tikzpicture}[remember picture, overlay]% \draw[connectstyle]% -([yshift=-0.2cm] inText)% +([yshift=-0.2cm + \@todonotes@tickmarkheight] inText)% +-| ([yshift=-0.2cm] inText)% -| ([xshift=0.2cm] inNote.east)% -| (inNote.east);% \end{tikzpicture}% @@ -471,30 +510,45 @@ prior to loading the todonotes package.} \else\fi% \addcontentsline{tdo}{todo}{\@todonotes@MissingFigureText: #2}% \par \noindent +\hfill \begin{tikzpicture} \draw[fill=\@todonotes@currentfigcolor, draw = black!40, line width=2pt] - (-2, -2.5) rectangle +(\@todonotes@currentfigwidth, \@todonotes@currentfigheight); -\draw (2, -0.3) node[right, text - width=\@todonotes@currentfigwidth-4.5cm, font=\@todonotes@sizecommand] {#2}; + (-2, -0.5*\@todonotes@currentfigheight-0.5cm) + rectangle +(\@todonotes@currentfigwidth, \@todonotes@currentfigheight); +\draw (2, -0.5) node[right, text + width=\@todonotes@currentfigwidth-4.5cm, font=\@todonotes@useSizeCommand] {#2}; \draw[red, fill=white, rounded corners = 5pt, line width=10pt] (30:2cm) -- (150:2cm) -- (270:2cm) -- cycle; \draw (0, 0.3) node {\@todonotes@MissingFigureUp}; \draw (0, -0.3) node {\@todonotes@MissingFigureDown}; \end{tikzpicture}\hfill +\null\par }% Ending \missingfigure command \fi% Ending \@todonotes@ifdisabled \newcommand{\todototoc} -{ +{% \if@todonotes@disabled \else -\addcontentsline{toc}{\@ifundefined{chapter}{section}{chapter}}{\@todonotes@todolistname} +\addcontentsline{toc}{\@ifundefined{chapter}{section}{chapter}}{\@todonotes@todolistname}% \fi } -\newcommand{\todo}[2][]{\if@todonotes@inlinepar% - \@bsphack\@todo[#1]{#2}\@esphack% +\newcommand{\todo}[2][]{% + \if@todonotes@inlinepar + \ifhmode + \@bsphack + \@todonotes@vmodefalse + \else + \@savsf\@m + \@savsk\z@ + \@todonotes@vmodetrue + \fi + {\@todo[#1]{#2}}% + \@esphack% + \if@todonotes@vmode \par \fi \else% - \@todo[#1]{#2}% - \fi}% + \@todo[#1]{#2}% + \fi} +\newif\if@todonotes@vmode \endinput %% %% End of file `todonotes.sty'. -- cgit v1.2.3