texlive[49233] Master/texmf-dist: todonotes (23nov18)

commits+karl at tug.org commits+karl at tug.org
Fri Nov 23 22:42:54 CET 2018


Revision: 49233
          http://tug.org/svn/texlive?view=revision&revision=49233
Author:   karl
Date:     2018-11-23 22:42:53 +0100 (Fri, 23 Nov 2018)
Log Message:
-----------
todonotes (23nov18)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/todonotes/README
    trunk/Master/texmf-dist/doc/latex/todonotes/examples/alterAppearenceOfListOfTodos.pdf
    trunk/Master/texmf-dist/doc/latex/todonotes/examples/externalize.pdf
    trunk/Master/texmf-dist/doc/latex/todonotes/examples/saveColorByUsingLayers.pdf
    trunk/Master/texmf-dist/doc/latex/todonotes/todonotes.pdf
    trunk/Master/texmf-dist/source/latex/todonotes/todonotes.dtx
    trunk/Master/texmf-dist/tex/latex/todonotes/todonotes.sty

Modified: trunk/Master/texmf-dist/doc/latex/todonotes/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/todonotes/README	2018-11-23 21:42:39 UTC (rev 49232)
+++ trunk/Master/texmf-dist/doc/latex/todonotes/README	2018-11-23 21:42:53 UTC (rev 49233)
@@ -43,7 +43,7 @@
 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

Modified: trunk/Master/texmf-dist/doc/latex/todonotes/examples/alterAppearenceOfListOfTodos.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/todonotes/examples/externalize.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/todonotes/examples/saveColorByUsingLayers.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/todonotes/todonotes.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/todonotes/todonotes.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/todonotes/todonotes.dtx	2018-11-23 21:42:39 UTC (rev 49232)
+++ trunk/Master/texmf-dist/source/latex/todonotes/todonotes.dtx	2018-11-23 21:42:53 UTC (rev 49233)
@@ -22,7 +22,7 @@
 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
 %<package>\ProvidesPackage{todonotes}
 %<*package>
-    [2015/07/09 .dtx Todonotes source and documentation.]
+    [2018/11/22 v1.1.1 Todonotes source and documentation.]
 %</package>
 %
 %<*driver>
@@ -29,7 +29,7 @@
 \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 @@
 %</driver>
 % \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,13 +454,37 @@
 % \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}
+%
+%
 % \DescribeMacro{line / noline}
 % If you want to get rid of the line connecting the inserted note
 % with the place in the text where the note occurs in the latex
@@ -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,20 +701,7 @@
 %\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
 % items in the list of todos are not wrapped into several lines, and
@@ -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 at text}{}%
 \newcommand{\@todonotes at backgroundcolor}{orange}
+\newcommand{\@todonotes at textcolor}{black}
 \newcommand{\@todonotes at linecolor}{orange}
 \newcommand{\@todonotes at bordercolor}{black}
+\newcommand{\@todonotes at tickmarkheight}{0cm}
 \newcommand{\@todonotes at textwidth}{\marginparwidth}
 \newcommand{\@todonotes at textsize}{\normalsize}
 \newcommand{\@todonotes at figwidth}{\linewidth}
@@ -1377,6 +1403,12 @@
 \define at key{todonotes.sty}%
     {backgroundcolor}{\renewcommand{\@todonotes at backgroundcolor}{#1}}
 %    \end{macrocode}
+% Make the text color of the notes as
+% an option.
+%    \begin{macrocode}
+\define at key{todonotes.sty}%
+    {textcolor}{\renewcommand{\@todonotes at textcolor}{#1}}
+%    \end{macrocode}
 % Make the line color of the notes as
 % an option.
 %    \begin{macrocode}
@@ -1389,6 +1421,12 @@
 \define at key{todonotes.sty}%
     {bordercolor}{\renewcommand{\@todonotes at bordercolor}{#1}}
 %    \end{macrocode}
+% Make the height of the line start marking as
+% an option.
+%    \begin{macrocode}
+\define at key{todonotes.sty}%
+    {tickmarkheight}{\renewcommand{\@todonotes at 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 @@
 \define at key{todonotes.sty}%
     {textwidth}{\renewcommand{\@todonotes at 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 at key{todonotes.sty}%
-    {textsize}{\renewcommand{\@todonotes at textsize}{\csname #1\endcsname}}
+    {textsize}{\renewcommand{\@todonotes at textsize}{#1}}
+\define at key{todonotes.sty}%
+    {size}{\renewcommand{\@todonotes at textsize}{#1}}
 %    \end{macrocode}
 % Add option for shadows behind the inserted notes
 %    \begin{macrocode}
-\newif{\if at todonotes@shadowenabled}
-\@todonotes at shadowenabledfalse
-\DeclareOptionX{shadow}{\@todonotes at shadowenabledtrue
-\usetikzlibrary{shadows}}
+\newcommand{\@todonotes at shadowenabledbydefault}{noshadow}
+\DeclareOptionX{shadow}{\renewcommand{\@todonotes at shadowenabledbydefault}{shadow}}
 %    \end{macrocode}
 % Add option for the default width of the figure inserted with
 % |\missingfigure|.
@@ -1464,6 +1500,7 @@
 %    \begin{macrocode}
 \newcommand{\@todonotes at currentlinecolor}{}%
 \newcommand{\@todonotes at currentbackgroundcolor}{}%
+\newcommand{\@todonotes at currenttextcolor}{}%
 \newcommand{\@todonotes at currentbordercolor}{}%
 \define at key{todonotes}{color}{%
     \renewcommand{\@todonotes at currentlinecolor}{#1}%
@@ -1472,13 +1509,27 @@
     \renewcommand{\@todonotes at currentlinecolor}{#1}}%
 \define at key{todonotes}{backgroundcolor}{%
     \renewcommand{\@todonotes at currentbackgroundcolor}{#1}}%
+\define at key{todonotes}{textcolor}{%
+    \renewcommand{\@todonotes at currenttextcolor}{#1}}%
 \define at key{todonotes}{bordercolor}{%
     \renewcommand{\@todonotes at currentbordercolor}{#1}}%
 %    \end{macrocode}
+% Toggle whether there is a shadow behind the inserted notes.
+%    \begin{macrocode}
+\newif\if at todonotes@useshadow%
+\define at key{todonotes}{shadow}[]{\@todonotes at useshadowtrue}%
+\define at key{todonotes}{noshadow}[]{\@todonotes at useshadowfalse}%
+%    \end{macrocode}
+% Define height of the inserted tickmark.
+%    \begin{macrocode}
+\define at key{todonotes}{tickmarkheight}{%
+    \renewcommand{\@todonotes at tickmarkheight}{#1}}%
+%    \end{macrocode}
 % Set a relative font size
 %    \begin{macrocode}
 \newcommand{\@todonotes at sizecommand}{}%
-\define at key{todonotes}{size}{\renewcommand{\@todonotes at sizecommand}{#1}}%
+\define at key{todonotes}{size}{\renewcommand{\@todonotes at sizecommand}{#1}%
+}%
 %    \end{macrocode}
 % Should the todo item be disabled?
 %    \begin{macrocode}
@@ -1567,18 +1618,24 @@
     {todonotes}%
     {linecolor=\@todonotes at linecolor,%
     backgroundcolor=\@todonotes at backgroundcolor,%
+    textcolor=\@todonotes at textcolor,%
     bordercolor=\@todonotes at bordercolor,%
+    tickmarkheight=0cm,%
     nofancyline,%
     nodisable,%
     noinline,%
     nocaption,%
     noauthor,%
+    \@todonotes at shadowenabledbydefault,%
     figwidth=\@todonotes at figwidth,%
     figheight=\@todonotes at figheight,%
     figcolor=\@todonotes at figcolor,%
-    line, list, size=\@todonotes at textsize,
+    line, list,%
     inlinewidth=\linewidth,
     inlinepar}{}%
+\@temptokena\expandafter{\@todonotes at 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 @@
 \tikzstyle{notestyleraw} = [
     draw=\@todonotes at currentbordercolor, 
     fill=\@todonotes at currentbackgroundcolor,
+    text=\@todonotes at currenttextcolor,
     line width=0.5pt,
     text width = \@todonotes at 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 at 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 at currentlinecolor]
-\tikzstyle{inlinenotestyle} = [
-    notestyle, 
-    text width=\@todonotes at inlinewidth - 1.6 ex - 1 pt]
-%    \end{macrocode}
 %
 % \begin{macro}{\@todo}
 % Define the |\@todo| command.
@@ -1648,6 +1687,29 @@
 \renewcommand{\@todonotes at caption}{#2}%
 \setkeys{todonotes}{#1}%
 %    \end{macrocode}
+%
+% Add shadows to the inserted todonotes.
+%    \begin{macrocode}
+\if at 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 at currentlinecolor]%
+\tikzstyle{inlinenotestyle} = [%
+    notestyle,%
+    text width=\@todonotes at inlinewidth - 1.6 ex - 1 pt]%
+%    \end{macrocode}
 % If the option |disable| is given to the command, no output is generated.
 %    \begin{macrocode}
 \if at todonotes@localdisable%
@@ -1697,6 +1759,12 @@
 % 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 @@
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{drawInlineNote}
+% Define helper function |useSizeCommand|.
+%    \begin{macrocode}
+\newcommand{\@todonotes at useSizeCommand}{%
+\ifcsname \expandafter\string\@todonotes at sizecommand\endcsname
+\csname \expandafter\string\@todonotes at sizecommand\endcsname%
+\else
+\@todonotes at sizecommand
+\fi%
+}%
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{drawInlineNote}
 % Define helper function |drawInlineNote|.
 %    \begin{macrocode}
 \newcommand{\@todonotes at drawInlineNote}{%
@@ -1744,9 +1824,9 @@
          \end{tikzpicture}%
          \if at todonotes@inlinepar\par\fi}%
             \if at todonotes@authorgiven%
-                {\noindent \@todonotes at sizecommand \@todonotes at author:\,\@todonotes at text}%
+                {\noindent \@todonotes at useSizeCommand \@todonotes at author:\,\@todonotes at text}%
             \else%
-                {\noindent \@todonotes at sizecommand \@todonotes at text}%
+                {\noindent \@todonotes at useSizeCommand \@todonotes at text}%
             \fi
         {\if at todonotes@inlinepar\par\noindent\fi%
          \begin{tikzpicture}[remember picture]%
@@ -1756,11 +1836,11 @@
     \else%
         {\if at todonotes@inlinepar\par\noindent\fi%
          \begin{tikzpicture}[remember picture]%
-            \draw node[inlinenotestyle,font=\@todonotes at sizecommand]{%
+            \draw node[inlinenotestyle,font=\@todonotes at useSizeCommand]{%
                 \if at todonotes@authorgiven%
-                    {\noindent \@todonotes at sizecommand \@todonotes at author:\,\@todonotes at text}%
+                    {\noindent \@todonotes at author:\,\@todonotes at text}%
                 \else%
-                    {\noindent \@todonotes at sizecommand \@todonotes at text}%
+                    {\noindent \@todonotes at text}%
                 \fi};%
          \end{tikzpicture}%
          \if at todonotes@inlinepar\par\fi}%
@@ -1777,9 +1857,9 @@
     \end{tikzpicture}\\%
     \begin{minipage}{\@todonotes at textwidth}%
     \if at todonotes@authorgiven%
-      \@todonotes at sizecommand \@todonotes at author \@todonotes at text%
+      \@todonotes at useSizeCommand \@todonotes at author \@todonotes at text%
     \else%
-      \@todonotes at sizecommand \@todonotes at text%
+      \@todonotes at useSizeCommand \@todonotes at text%
     \fi%
     \end{minipage}\\%
     \begin{tikzpicture}[remember picture]%
@@ -1789,15 +1869,15 @@
     \let\originalHbadness\hbadness%
     \hbadness 100000%
     \begin{tikzpicture}[remember picture,baseline=(X.base)]%
-        \node(X){\vphantom{\@todonotes at sizecommand X}};%
+        \node(X){\vphantom{\@todonotes at useSizeCommand X}};%
         \if at todonotes@authorgiven%
-            \draw node[notestyle,font=\@todonotes at sizecommand,anchor=north] (inNote) at (X.north)%
-                {\@todonotes at sizecommand\@todonotes at author};%
+            \draw node[notestyle,font=\@todonotes at useSizeCommand,anchor=north] (inNote) at (X.north)%
+                {\@todonotes at author};%
             \node(Y)[below=of X]{};%
-            \draw node[notestyle,font=\@todonotes at sizecommand,anchor=north] (inNote) at (X.south)%
+            \draw node[notestyle,font=\@todonotes at useSizeCommand,anchor=north] (inNote) at (X.south)%
                 {\@todonotes at text};%
         \else%
-            \draw node[notestyle,font=\@todonotes at sizecommand,anchor=north] (inNote) at (X.north)%
+            \draw node[notestyle,font=\@todonotes at useSizeCommand,anchor=north] (inNote) at (X.north)%
                 {\@todonotes at text};%
         \fi%
     \end{tikzpicture}%
@@ -1823,7 +1903,8 @@
 	\else%
 		\begin{tikzpicture}[remember picture, overlay]%
 			\draw[connectstyle]%
-			([yshift=-0.2cm] inText)%
+			([yshift=-0.2cm + \@todonotes at tickmarkheight] inText)%
+			-| ([yshift=-0.2cm] inText)%
 			-| ([xshift=-0.2cm] inNote.west)%
 			-| (inNote.west);%
 		\end{tikzpicture}%
@@ -1849,7 +1930,8 @@
 	\else%
 		\begin{tikzpicture}[remember picture, overlay]%
 			\draw[connectstyle]%
-			([yshift=-0.2cm] inText)%
+			([yshift=-0.2cm + \@todonotes at tickmarkheight] inText)%
+			-| ([yshift=-0.2cm] inText)%
 			-| ([xshift=0.2cm] inNote.east)%
 			-| (inNote.east);%
 		\end{tikzpicture}%
@@ -1865,16 +1947,19 @@
 \addcontentsline{tdo}{todo}{\@todonotes at MissingFigureText: #2}%
 \par
 \noindent
+\hfill
 \begin{tikzpicture}
 \draw[fill=\@todonotes at currentfigcolor, draw = black!40, line width=2pt]
-    (-2, -2.5) rectangle +(\@todonotes at currentfigwidth, \@todonotes at currentfigheight);
-\draw (2, -0.3) node[right, text
-    width=\@todonotes at currentfigwidth-4.5cm, font=\@todonotes at sizecommand] {#2};
+    (-2, -0.5*\@todonotes at currentfigheight-0.5cm)
+    rectangle +(\@todonotes at currentfigwidth, \@todonotes at currentfigheight);
+\draw (2, -0.5) node[right, text
+    width=\@todonotes at currentfigwidth-4.5cm, font=\@todonotes at 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 at MissingFigureUp};
 \draw (0, -0.3) node {\@todonotes at MissingFigureDown};
 \end{tikzpicture}\hfill
+\null\par
 }% Ending \missingfigure command
 \fi% Ending \@todonotes at ifdisabled
 %    \end{macrocode}
@@ -1885,10 +1970,10 @@
 % The |\todototoc| command respects the disable option.
 %    \begin{macrocode}
 \newcommand{\todototoc}
-{
+{%
     \if at todonotes@disabled
     \else
-		\addcontentsline{toc}{\@ifundefined{chapter}{section}{chapter}}{\@todonotes at todolistname}
+		\addcontentsline{toc}{\@ifundefined{chapter}{section}{chapter}}{\@todonotes at todolistname}%
     \fi
 }
 %    \end{macrocode}
@@ -1897,11 +1982,23 @@
 % \begin{macro}{\todo}
 % Define the |\todo| command as a redirection to |\@todo|.
 %    \begin{macrocode}
-\newcommand{\todo}[2][]{\if at todonotes@inlinepar%
-  \@bsphack\@todo[#1]{#2}\@esphack%
+\newcommand{\todo}[2][]{%
+  \if at todonotes@inlinepar
+    \ifhmode
+      \@bsphack
+      \@todonotes at vmodefalse
+    \else
+      \@savsf\@m
+      \@savsk\z@
+      \@todonotes at vmodetrue
+    \fi
+    {\@todo[#1]{#2}}%
+    \@esphack%
+    \if at todonotes@vmode \par \fi
   \else%
-  \@todo[#1]{#2}%
-  \fi}%
+    \@todo[#1]{#2}%
+  \fi}
+\newif\if at todonotes@vmode
 %    \end{macrocode}
 % \end{macro}
 % \appendix

Modified: trunk/Master/texmf-dist/tex/latex/todonotes/todonotes.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/todonotes/todonotes.sty	2018-11-23 21:42:39 UTC (rev 49232)
+++ trunk/Master/texmf-dist/tex/latex/todonotes/todonotes.sty	2018-11-23 21:42:53 UTC (rev 49233)
@@ -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 at text}{}%
 \newcommand{\@todonotes at backgroundcolor}{orange}
+\newcommand{\@todonotes at textcolor}{black}
 \newcommand{\@todonotes at linecolor}{orange}
 \newcommand{\@todonotes at bordercolor}{black}
+\newcommand{\@todonotes at tickmarkheight}{0cm}
 \newcommand{\@todonotes at textwidth}{\marginparwidth}
 \newcommand{\@todonotes at textsize}{\normalsize}
 \newcommand{\@todonotes at figwidth}{\linewidth}
@@ -163,9 +167,13 @@
 \define at key{todonotes.sty}%
     {backgroundcolor}{\renewcommand{\@todonotes at backgroundcolor}{#1}}
 \define at key{todonotes.sty}%
+    {textcolor}{\renewcommand{\@todonotes at textcolor}{#1}}
+\define at key{todonotes.sty}%
     {linecolor}{\renewcommand{\@todonotes at linecolor}{#1}}
 \define at key{todonotes.sty}%
     {bordercolor}{\renewcommand{\@todonotes at bordercolor}{#1}}
+\define at key{todonotes.sty}%
+    {tickmarkheight}{\renewcommand{\@todonotes at tickmarkheight}{#1}}
 \newif{\if at todonotes@prependcaptionglobal}
 \@todonotes at prependcaptionglobalfalse
 \DeclareOptionX{prependcaption}{\@todonotes at prependcaptionglobaltrue}
@@ -172,12 +180,12 @@
 \define at key{todonotes.sty}%
     {textwidth}{\renewcommand{\@todonotes at textwidth}{#1}}
 \define at key{todonotes.sty}%
-    {textsize}{\renewcommand{\@todonotes at textsize}{\csname #1\endcsname}}
-\newif{\if at todonotes@shadowenabled}
-\@todonotes at shadowenabledfalse
-\DeclareOptionX{shadow}{\@todonotes at shadowenabledtrue
-\usetikzlibrary{shadows}}
+    {textsize}{\renewcommand{\@todonotes at textsize}{#1}}
 \define at key{todonotes.sty}%
+    {size}{\renewcommand{\@todonotes at textsize}{#1}}
+\newcommand{\@todonotes at shadowenabledbydefault}{noshadow}
+\DeclareOptionX{shadow}{\renewcommand{\@todonotes at shadowenabledbydefault}{shadow}}
+\define at key{todonotes.sty}%
     {figwidth}{\renewcommand{\@todonotes at figwidth}{#1}}
 \define at key{todonotes.sty}%
     {figheight}{\renewcommand{\@todonotes at figheight}{#1}}
@@ -202,6 +210,7 @@
 
 \newcommand{\@todonotes at currentlinecolor}{}%
 \newcommand{\@todonotes at currentbackgroundcolor}{}%
+\newcommand{\@todonotes at currenttextcolor}{}%
 \newcommand{\@todonotes at currentbordercolor}{}%
 \define at key{todonotes}{color}{%
     \renewcommand{\@todonotes at currentlinecolor}{#1}%
@@ -210,10 +219,18 @@
     \renewcommand{\@todonotes at currentlinecolor}{#1}}%
 \define at key{todonotes}{backgroundcolor}{%
     \renewcommand{\@todonotes at currentbackgroundcolor}{#1}}%
+\define at key{todonotes}{textcolor}{%
+    \renewcommand{\@todonotes at currenttextcolor}{#1}}%
 \define at key{todonotes}{bordercolor}{%
     \renewcommand{\@todonotes at currentbordercolor}{#1}}%
+\newif\if at todonotes@useshadow%
+\define at key{todonotes}{shadow}[]{\@todonotes at useshadowtrue}%
+\define at key{todonotes}{noshadow}[]{\@todonotes at useshadowfalse}%
+\define at key{todonotes}{tickmarkheight}{%
+    \renewcommand{\@todonotes at tickmarkheight}{#1}}%
 \newcommand{\@todonotes at sizecommand}{}%
-\define at key{todonotes}{size}{\renewcommand{\@todonotes at sizecommand}{#1}}%
+\define at key{todonotes}{size}{\renewcommand{\@todonotes at sizecommand}{#1}%
+}%
 \newif\if at todonotes@localdisable%
 \define at key{todonotes}{disable}[]{\@todonotes at localdisabletrue}%
 \define at key{todonotes}{nodisable}[]{\@todonotes at localdisablefalse}%
@@ -264,18 +281,24 @@
     {todonotes}%
     {linecolor=\@todonotes at linecolor,%
     backgroundcolor=\@todonotes at backgroundcolor,%
+    textcolor=\@todonotes at textcolor,%
     bordercolor=\@todonotes at bordercolor,%
+    tickmarkheight=0cm,%
     nofancyline,%
     nodisable,%
     noinline,%
     nocaption,%
     noauthor,%
+    \@todonotes at shadowenabledbydefault,%
     figwidth=\@todonotes at figwidth,%
     figheight=\@todonotes at figheight,%
     figcolor=\@todonotes at figcolor,%
-    line, list, size=\@todonotes at textsize,
+    line, list,%
     inlinewidth=\linewidth,
     inlinepar}{}%
+\@temptokena\expandafter{\@todonotes at textsize}
+\edef\next{\noexpand\presetkeys{todonotes}{size=\the\@temptokena}{}}
+\next
 \if at todonotes@disabled%
     \newcommand{\listoftodos}[1][]{}
     \newcommand{\@todo}[2][]{}
@@ -288,26 +311,11 @@
 \tikzstyle{notestyleraw} = [
     draw=\@todonotes at currentbordercolor,
     fill=\@todonotes at currentbackgroundcolor,
+    text=\@todonotes at currenttextcolor,
     line width=0.5pt,
     text width = \@todonotes at textwidth - 1.6 ex - 1pt,
     inner sep = 0.8 ex,
     rounded corners=4pt]
-\if at 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 at currentlinecolor]
-\tikzstyle{inlinenotestyle} = [
-    notestyle,
-    text width=\@todonotes at inlinewidth - 1.6 ex - 1 pt]
 \newcommand{\@todo}[2][]{%
 \if at todonotes@prependcaptionglobal%
 \@todonotes at prependcaptiontrue%
@@ -317,6 +325,22 @@
 \renewcommand{\@todonotes at text}{#2}%
 \renewcommand{\@todonotes at caption}{#2}%
 \setkeys{todonotes}{#1}%
+\if at 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 at currentlinecolor]%
+\tikzstyle{inlinenotestyle} = [%
+    notestyle,%
+    text width=\@todonotes at inlinewidth - 1.6 ex - 1 pt]%
 \if at todonotes@localdisable%
 \else%
 \addtocounter{@todonotes at numberoftodonotes}{1}%
@@ -341,6 +365,12 @@
 \fi%\if at todonotes@localdisable
 }%
 \newcommand{\@todonotes at 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 @@
     \else%
         \addcontentsline{tdo}{todo}{\@todonotes at caption}%
     \fi}%
+\newcommand{\@todonotes at useSizeCommand}{%
+\ifcsname \expandafter\string\@todonotes at sizecommand\endcsname
+\csname \expandafter\string\@todonotes at sizecommand\endcsname%
+\else
+\@todonotes at sizecommand
+\fi%
+}%
 \newcommand{\@todonotes at drawInlineNote}{%
     \if at todonotes@dviStyle%
         {\if at todonotes@inlinepar\par\noindent\fi%
@@ -370,9 +407,9 @@
          \end{tikzpicture}%
          \if at todonotes@inlinepar\par\fi}%
             \if at todonotes@authorgiven%
-                {\noindent \@todonotes at sizecommand \@todonotes at author:\,\@todonotes at text}%
+                {\noindent \@todonotes at useSizeCommand \@todonotes at author:\,\@todonotes at text}%
             \else%
-                {\noindent \@todonotes at sizecommand \@todonotes at text}%
+                {\noindent \@todonotes at useSizeCommand \@todonotes at text}%
             \fi
         {\if at todonotes@inlinepar\par\noindent\fi%
          \begin{tikzpicture}[remember picture]%
@@ -382,11 +419,11 @@
     \else%
         {\if at todonotes@inlinepar\par\noindent\fi%
          \begin{tikzpicture}[remember picture]%
-            \draw node[inlinenotestyle,font=\@todonotes at sizecommand]{%
+            \draw node[inlinenotestyle,font=\@todonotes at useSizeCommand]{%
                 \if at todonotes@authorgiven%
-                    {\noindent \@todonotes at sizecommand \@todonotes at author:\,\@todonotes at text}%
+                    {\noindent \@todonotes at author:\,\@todonotes at text}%
                 \else%
-                    {\noindent \@todonotes at sizecommand \@todonotes at text}%
+                    {\noindent \@todonotes at text}%
                 \fi};%
          \end{tikzpicture}%
          \if at todonotes@inlinepar\par\fi}%
@@ -398,9 +435,9 @@
     \end{tikzpicture}\\%
     \begin{minipage}{\@todonotes at textwidth}%
     \if at todonotes@authorgiven%
-      \@todonotes at sizecommand \@todonotes at author \@todonotes at text%
+      \@todonotes at useSizeCommand \@todonotes at author \@todonotes at text%
     \else%
-      \@todonotes at sizecommand \@todonotes at text%
+      \@todonotes at useSizeCommand \@todonotes at text%
     \fi%
     \end{minipage}\\%
     \begin{tikzpicture}[remember picture]%
@@ -410,15 +447,15 @@
     \let\originalHbadness\hbadness%
     \hbadness 100000%
     \begin{tikzpicture}[remember picture,baseline=(X.base)]%
-        \node(X){\vphantom{\@todonotes at sizecommand X}};%
+        \node(X){\vphantom{\@todonotes at useSizeCommand X}};%
         \if at todonotes@authorgiven%
-            \draw node[notestyle,font=\@todonotes at sizecommand,anchor=north] (inNote) at (X.north)%
-                {\@todonotes at sizecommand\@todonotes at author};%
+            \draw node[notestyle,font=\@todonotes at useSizeCommand,anchor=north] (inNote) at (X.north)%
+                {\@todonotes at author};%
             \node(Y)[below=of X]{};%
-            \draw node[notestyle,font=\@todonotes at sizecommand,anchor=north] (inNote) at (X.south)%
+            \draw node[notestyle,font=\@todonotes at useSizeCommand,anchor=north] (inNote) at (X.south)%
                 {\@todonotes at text};%
         \else%
-            \draw node[notestyle,font=\@todonotes at sizecommand,anchor=north] (inNote) at (X.north)%
+            \draw node[notestyle,font=\@todonotes at useSizeCommand,anchor=north] (inNote) at (X.north)%
                 {\@todonotes at text};%
         \fi%
     \end{tikzpicture}%
@@ -439,7 +476,8 @@
 \else%
 \begin{tikzpicture}[remember picture, overlay]%
 \draw[connectstyle]%
-([yshift=-0.2cm] inText)%
+([yshift=-0.2cm + \@todonotes at tickmarkheight] inText)%
+-| ([yshift=-0.2cm] inText)%
 -| ([xshift=-0.2cm] inNote.west)%
 -| (inNote.west);%
 \end{tikzpicture}%
@@ -460,7 +498,8 @@
 \else%
 \begin{tikzpicture}[remember picture, overlay]%
 \draw[connectstyle]%
-([yshift=-0.2cm] inText)%
+([yshift=-0.2cm + \@todonotes at tickmarkheight] inText)%
+-| ([yshift=-0.2cm] inText)%
 -| ([xshift=0.2cm] inNote.east)%
 -| (inNote.east);%
 \end{tikzpicture}%
@@ -471,30 +510,45 @@
 \addcontentsline{tdo}{todo}{\@todonotes at MissingFigureText: #2}%
 \par
 \noindent
+\hfill
 \begin{tikzpicture}
 \draw[fill=\@todonotes at currentfigcolor, draw = black!40, line width=2pt]
-    (-2, -2.5) rectangle +(\@todonotes at currentfigwidth, \@todonotes at currentfigheight);
-\draw (2, -0.3) node[right, text
-    width=\@todonotes at currentfigwidth-4.5cm, font=\@todonotes at sizecommand] {#2};
+    (-2, -0.5*\@todonotes at currentfigheight-0.5cm)
+    rectangle +(\@todonotes at currentfigwidth, \@todonotes at currentfigheight);
+\draw (2, -0.5) node[right, text
+    width=\@todonotes at currentfigwidth-4.5cm, font=\@todonotes at 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 at MissingFigureUp};
 \draw (0, -0.3) node {\@todonotes at MissingFigureDown};
 \end{tikzpicture}\hfill
+\null\par
 }% Ending \missingfigure command
 \fi% Ending \@todonotes at ifdisabled
 \newcommand{\todototoc}
-{
+{%
     \if at todonotes@disabled
     \else
-\addcontentsline{toc}{\@ifundefined{chapter}{section}{chapter}}{\@todonotes at todolistname}
+\addcontentsline{toc}{\@ifundefined{chapter}{section}{chapter}}{\@todonotes at todolistname}%
     \fi
 }
-\newcommand{\todo}[2][]{\if at todonotes@inlinepar%
-  \@bsphack\@todo[#1]{#2}\@esphack%
+\newcommand{\todo}[2][]{%
+  \if at todonotes@inlinepar
+    \ifhmode
+      \@bsphack
+      \@todonotes at vmodefalse
+    \else
+      \@savsf\@m
+      \@savsk\z@
+      \@todonotes at vmodetrue
+    \fi
+    {\@todo[#1]{#2}}%
+    \@esphack%
+    \if at todonotes@vmode \par \fi
   \else%
-  \@todo[#1]{#2}%
-  \fi}%
+    \@todo[#1]{#2}%
+  \fi}
+\newif\if at todonotes@vmode
 \endinput
 %%
 %% End of file `todonotes.sty'.



More information about the tex-live-commits mailing list