texlive[48181] Master/texmf-dist: todonotes (10jul18)

commits+karl at tug.org commits+karl at tug.org
Tue Jul 10 23:07:55 CEST 2018


Revision: 48181
          http://tug.org/svn/texlive?view=revision&revision=48181
Author:   karl
Date:     2018-07-10 23:07:55 +0200 (Tue, 10 Jul 2018)
Log Message:
-----------
todonotes (10jul18)

Modified Paths:
--------------
    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/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-07-10 21:07:37 UTC (rev 48180)
+++ trunk/Master/texmf-dist/source/latex/todonotes/todonotes.dtx	2018-07-10 21:07:55 UTC (rev 48181)
@@ -47,7 +47,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{596}
+% \CheckSum{636}
 %
 % \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
@@ -184,7 +184,16 @@
 %             Removed some underfull box warnings, solution by Ernst Blecha.} 
 % \changes{1.0.4}{2015/07/09}{Restructured documentation and placed some examples in the 
 %             doc/examples subdirectory.}
-% \changes{1.0.5}{2016/11/02}{Example of how to change the space eating behaviour added by Anselm Wagner. Reduced the width of missingfigure to avoid bad box warnings.}
+% \changes{1.0.5}{2016/11/02}{Example of how to change the space eating behaviour 
+%             added by Anselm Wagner. 
+%             Reduced the width of missingfigure to avoid bad box warnings.}
+% \changes{1.0.6}{2018/07/09}{Changed how whitespaces are handled around inserted 
+%             todos to better mimick macros like index (Suggestion by Frank Mittelbach). 
+%             Fix missing character warnings using patch by Niels Anders Danielsson. 
+%             Use the specified textsize for missingfigure, patch by Johannes Twittmann. 
+%             Added new options for inline todonotes based on code from Daniel Krenn. 
+%             Added warning message when marginparwidth is less than 2cm, as 
+%             suggested by ErikBoesen.}
 % \GetFileInfo{todonotes.dtx}   
 %
 % \DoNotIndex{\newcommand,\newenvironment}
@@ -424,8 +433,8 @@
 % \newcommand{\insertref}[1]{\todo[color=green!40]{#1}}
 % \newcommand{\explainindetail}[1]{\todo[color=red!40]{#1}}
 % \end{verbatim}
-% An example that uses all of the color options is given below
-% \todo[linecolor=green!70!white, backgroundcolor=blue!20!white,
+% 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}.
 % \begin{verbatim}
 % \todo[linecolor=green!70!white, backgroundcolor=blue!20!white,
@@ -539,6 +548,27 @@
 % \todo[author=Xavier, inline]{Testing author option.}
 % \end{verbatim}
 %
+%
+% \DescribeMacro{inlinewidth}
+% The |inlinewidth| option makes it possible to alter the width
+% of inline todos.
+% \todo[inline, inlinewidth=5cm]{Testing the option inlinewidth.}
+% \begin{verbatim}
+% \todo[inline, inlinewidth=5cm]{Testing the option inlinewidth.}
+% \end{verbatim}
+%
+%
+% \DescribeMacro{inlinepar / noinlinepar}
+% The options |inlinepar| and |noinlinepar| (default) determine whether the inserted inline 
+% todonote is sorrounded with \texttt{par} macros that enforce new lines
+% prior to and after inserted inline todonotes.
+% \todo[inline, inlinewidth=5cm, noinlinepar]{Testing the option inlinepar.}
+% This is a line after the inserted todonote.
+% \begin{verbatim}
+% \todo[inline, inlinewidth=5cm, noinlinepar]{Testing the option inlinepar.}
+% \end{verbatim}
+%
+%
 % \subsection{Options for the missingfigure command}
 %
 % \DescribeMacro{figwidth}
@@ -587,6 +617,7 @@
 % \end{verbatim}
 % \missingfigure[figcolor=white]{Testing figcolor}
 %
+%
 % \subsection{Options for the listoftodos command}
 % The |\listoftodos| command takes one optional argument, that
 % defines the name of the inserted list of todos.
@@ -1186,6 +1217,13 @@
 \ifx\undefined\phantomsection
 \newcommand{\phantomsection}{}
 \fi
+\ifdim \marginparwidth < 2cm 
+\todo[inline]{Warning. The length $\backslash$marginparwidth is 
+less than 2cm and will most likely cause issues with the 
+appearance of inserted todonotes. 
+The issue can be solved by adding a line like 
+$\backslash$setlength\{$\backslash$marginparwidth\}\{2cm\} 
+prior to loading the todonotes package.} \else\fi%
 }
 %    \end{macrocode}
 %
@@ -1508,6 +1546,19 @@
 \define at key{todonotes}%
     {figcolor}{\renewcommand{\@todonotes at currentfigcolor}{#1}}
 %    \end{macrocode}
+% Change the width of an inline note.
+%    \begin{macrocode}
+\newcommand{\@todonotes at inlinewidth}{\linewidth}%
+\define at key{todonotes}%
+    {inlinewidth}{\renewcommand{\@todonotes at inlinewidth}{#1}}
+%    \end{macrocode}
+% Change if inline note is written to a separate line or not.
+%    \begin{macrocode}
+\newif\if at todonotes@inlinepar
+\@todonotes at inlinepartrue
+\define at key{todonotes}{inlinepar}[]{\@todonotes at inlinepartrue}%
+\define at key{todonotes}{noinlinepar}[]{\@todonotes at inlineparfalse}%
+%    \end{macrocode}
 % Preset values of the options
 %    \begin{macrocode}
 \presetkeys%
@@ -1523,7 +1574,9 @@
     figwidth=\@todonotes at figwidth,%
     figheight=\@todonotes at figheight,%
     figcolor=\@todonotes at figcolor,%
-    line, list, size=\@todonotes at textsize}{}%
+    line, list, size=\@todonotes at textsize,
+    inlinewidth=\linewidth,
+    inlinepar}{}%
 %    \end{macrocode}
 % \subsection{The main code part}
 % Here is the actual macros defined.
@@ -1571,7 +1624,7 @@
     draw=\@todonotes at currentlinecolor]
 \tikzstyle{inlinenotestyle} = [
     notestyle, 
-    text width=\linewidth - 1.6 ex - 1 pt]
+    text width=\@todonotes at inlinewidth - 1.6 ex - 1 pt]
 %    \end{macrocode}
 %
 % \begin{macro}{\@todo}
@@ -1683,17 +1736,24 @@
 %    \begin{macrocode}
 \newcommand{\@todonotes at drawInlineNote}{%
     \if at todonotes@dviStyle%
-        {\par\noindent\begin{tikzpicture}[remember picture]%
-            \draw node[inlinenotestyle] {};\end{tikzpicture}\par}%
+        {\if at todonotes@inlinepar\par\noindent\fi%
+         \begin{tikzpicture}[remember picture]%
+            \draw node[inlinenotestyle] {};
+         \end{tikzpicture}%
+         \if at todonotes@inlinepar\par\fi}%
             \if at todonotes@authorgiven%
                 {\noindent \@todonotes at sizecommand \@todonotes at author:\,\@todonotes at text}%
             \else%
                 {\noindent \@todonotes at sizecommand \@todonotes at text}%
             \fi
-        {\par\noindent\begin{tikzpicture}[remember picture]%
-            \draw node[inlinenotestyle] {};\end{tikzpicture}\par}%
+        {\if at todonotes@inlinepar\par\noindent\fi%
+         \begin{tikzpicture}[remember picture]%
+            \draw node[inlinenotestyle] {};
+         \end{tikzpicture}%
+         \if at todonotes@inlinepar\par\fi}%
     \else%
-        {\par\noindent\begin{tikzpicture}[remember picture]%
+        {\if at todonotes@inlinepar\par\noindent\fi%
+         \begin{tikzpicture}[remember picture]%
             \draw node[inlinenotestyle,font=\@todonotes at sizecommand]{%
                 \if at todonotes@authorgiven%
                     {\noindent \@todonotes at sizecommand \@todonotes at author:\,\@todonotes at text}%
@@ -1700,7 +1760,8 @@
                 \else%
                     {\noindent \@todonotes at sizecommand \@todonotes at text}%
                 \fi};%
-            \end{tikzpicture}\par}%
+         \end{tikzpicture}%
+         \if at todonotes@inlinepar\par\fi}%
     \fi}%
 %    \end{macrocode}
 % \end{macro}
@@ -1726,9 +1787,7 @@
     \let\originalHbadness\hbadness%
     \hbadness 100000%
     \begin{tikzpicture}[remember picture,baseline=(X.base)]%
-        \node(X){\vphantom{X}};%
-        \draw node[notestyle,font=\@todonotes at sizecommand,anchor=north] (inNote) at (X.north)%
-            {\@todonotes at text};%
+        \node(X){\vphantom{\@todonotes at sizecommand X}};%
         \if at todonotes@authorgiven%
             \draw node[notestyle,font=\@todonotes at sizecommand,anchor=north] (inNote) at (X.north)%
                 {\@todonotes at sizecommand\@todonotes at author};%
@@ -1757,7 +1816,7 @@
 			\foreach \s in {line,head}{%
 				\draw[both,\s]%
 					(inNote.north west).. controls +(0:0) and +(90:1.5)..([yshift=1ex] inText);%
-			};%
+			}%
 		}%
 	\else%
 		\begin{tikzpicture}[remember picture, overlay]%
@@ -1783,7 +1842,7 @@
 			\foreach \s in {line,head}{%
 				\draw[both,\s]%
 					(inNote.north east).. controls +(0:0) and +(90:1.5)..([yshift=1ex] inText);%
-			};%
+			}%
 		}%
 	\else%
 		\begin{tikzpicture}[remember picture, overlay]%
@@ -1808,7 +1867,7 @@
 \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] {#2};
+    width=\@todonotes at currentfigwidth-4.5cm, font=\@todonotes at sizecommand] {#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};
@@ -1836,7 +1895,11 @@
 % \begin{macro}{\todo}
 % Define the |\todo| command as a redirection to |\@todo|.
 %    \begin{macrocode}
-\newcommand{\todo}[2][]{\@bsphack\@todo[#1]{#2}\@esphack\ignorespaces}%
+\newcommand{\todo}[2][]{\if at todonotes@inlinepar%
+  \@bsphack\@todo[#1]{#2}\@esphack%
+  \else%
+  \@todo[#1]{#2}%
+  \fi}%
 %    \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-07-10 21:07:37 UTC (rev 48180)
+++ trunk/Master/texmf-dist/tex/latex/todonotes/todonotes.sty	2018-07-10 21:07:55 UTC (rev 48181)
@@ -44,6 +44,13 @@
 \ifx\undefined\phantomsection
 \newcommand{\phantomsection}{}
 \fi
+\ifdim \marginparwidth < 2cm
+\todo[inline]{Warning. The length $\backslash$marginparwidth is
+less than 2cm and will most likely cause issues with the
+appearance of inserted todonotes.
+The issue can be solved by adding a line like
+$\backslash$setlength\{$\backslash$marginparwidth\}\{2cm\}
+prior to loading the todonotes package.} \else\fi%
 }
 
 \newcommand{\@todonotes at todolistname}{Todo list}
@@ -246,6 +253,13 @@
 \newcommand{\@todonotes at currentfigcolor}{\@todonotes at figcolor}
 \define at key{todonotes}%
     {figcolor}{\renewcommand{\@todonotes at currentfigcolor}{#1}}
+\newcommand{\@todonotes at inlinewidth}{\linewidth}%
+\define at key{todonotes}%
+    {inlinewidth}{\renewcommand{\@todonotes at inlinewidth}{#1}}
+\newif\if at todonotes@inlinepar
+\@todonotes at inlinepartrue
+\define at key{todonotes}{inlinepar}[]{\@todonotes at inlinepartrue}%
+\define at key{todonotes}{noinlinepar}[]{\@todonotes at inlineparfalse}%
 \presetkeys%
     {todonotes}%
     {linecolor=\@todonotes at linecolor,%
@@ -259,7 +273,9 @@
     figwidth=\@todonotes at figwidth,%
     figheight=\@todonotes at figheight,%
     figcolor=\@todonotes at figcolor,%
-    line, list, size=\@todonotes at textsize}{}%
+    line, list, size=\@todonotes at textsize,
+    inlinewidth=\linewidth,
+    inlinepar}{}%
 \if at todonotes@disabled%
     \newcommand{\listoftodos}[1][]{}
     \newcommand{\@todo}[2][]{}
@@ -291,7 +307,7 @@
     draw=\@todonotes at currentlinecolor]
 \tikzstyle{inlinenotestyle} = [
     notestyle,
-    text width=\linewidth - 1.6 ex - 1 pt]
+    text width=\@todonotes at inlinewidth - 1.6 ex - 1 pt]
 \newcommand{\@todo}[2][]{%
 \if at todonotes@prependcaptionglobal%
 \@todonotes at prependcaptiontrue%
@@ -348,17 +364,24 @@
     \fi}%
 \newcommand{\@todonotes at drawInlineNote}{%
     \if at todonotes@dviStyle%
-        {\par\noindent\begin{tikzpicture}[remember picture]%
-            \draw node[inlinenotestyle] {};\end{tikzpicture}\par}%
+        {\if at todonotes@inlinepar\par\noindent\fi%
+         \begin{tikzpicture}[remember picture]%
+            \draw node[inlinenotestyle] {};
+         \end{tikzpicture}%
+         \if at todonotes@inlinepar\par\fi}%
             \if at todonotes@authorgiven%
                 {\noindent \@todonotes at sizecommand \@todonotes at author:\,\@todonotes at text}%
             \else%
                 {\noindent \@todonotes at sizecommand \@todonotes at text}%
             \fi
-        {\par\noindent\begin{tikzpicture}[remember picture]%
-            \draw node[inlinenotestyle] {};\end{tikzpicture}\par}%
+        {\if at todonotes@inlinepar\par\noindent\fi%
+         \begin{tikzpicture}[remember picture]%
+            \draw node[inlinenotestyle] {};
+         \end{tikzpicture}%
+         \if at todonotes@inlinepar\par\fi}%
     \else%
-        {\par\noindent\begin{tikzpicture}[remember picture]%
+        {\if at todonotes@inlinepar\par\noindent\fi%
+         \begin{tikzpicture}[remember picture]%
             \draw node[inlinenotestyle,font=\@todonotes at sizecommand]{%
                 \if at todonotes@authorgiven%
                     {\noindent \@todonotes at sizecommand \@todonotes at author:\,\@todonotes at text}%
@@ -365,7 +388,8 @@
                 \else%
                     {\noindent \@todonotes at sizecommand \@todonotes at text}%
                 \fi};%
-            \end{tikzpicture}\par}%
+         \end{tikzpicture}%
+         \if at todonotes@inlinepar\par\fi}%
     \fi}%
 \newcommand{\@todonotes at drawMarginNote}{%
 \if at todonotes@dviStyle%
@@ -386,9 +410,7 @@
     \let\originalHbadness\hbadness%
     \hbadness 100000%
     \begin{tikzpicture}[remember picture,baseline=(X.base)]%
-        \node(X){\vphantom{X}};%
-        \draw node[notestyle,font=\@todonotes at sizecommand,anchor=north] (inNote) at (X.north)%
-            {\@todonotes at text};%
+        \node(X){\vphantom{\@todonotes at sizecommand X}};%
         \if at todonotes@authorgiven%
             \draw node[notestyle,font=\@todonotes at sizecommand,anchor=north] (inNote) at (X.north)%
                 {\@todonotes at sizecommand\@todonotes at author};%
@@ -412,8 +434,8 @@
 \foreach \s in {line,head}{%
 \draw[both,\s]%
 (inNote.north west).. controls +(0:0) and +(90:1.5)..([yshift=1ex] inText);%
-};%
 }%
+}%
 \else%
 \begin{tikzpicture}[remember picture, overlay]%
 \draw[connectstyle]%
@@ -433,8 +455,8 @@
 \foreach \s in {line,head}{%
 \draw[both,\s]%
 (inNote.north east).. controls +(0:0) and +(90:1.5)..([yshift=1ex] inText);%
-};%
 }%
+}%
 \else%
 \begin{tikzpicture}[remember picture, overlay]%
 \draw[connectstyle]%
@@ -453,7 +475,7 @@
 \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] {#2};
+    width=\@todonotes at currentfigwidth-4.5cm, font=\@todonotes at sizecommand] {#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};
@@ -468,7 +490,11 @@
 \addcontentsline{toc}{\@ifundefined{chapter}{section}{chapter}}{\@todonotes at todolistname}
     \fi
 }
-\newcommand{\todo}[2][]{\@bsphack\@todo[#1]{#2}\@esphack\ignorespaces}%
+\newcommand{\todo}[2][]{\if at todonotes@inlinepar%
+  \@bsphack\@todo[#1]{#2}\@esphack%
+  \else%
+  \@todo[#1]{#2}%
+  \fi}%
 \endinput
 %%
 %% End of file `todonotes.sty'.



More information about the tex-live-commits mailing list