texlive[65699] Master/texmf-dist: todonotes (31jan23)

commits+karl at tug.org commits+karl at tug.org
Tue Jan 31 21:51:09 CET 2023


Revision: 65699
          http://tug.org/svn/texlive?view=revision&revision=65699
Author:   karl
Date:     2023-01-31 21:51:08 +0100 (Tue, 31 Jan 2023)
Log Message:
-----------
todonotes (31jan23)

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

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/todonotes/img/
    trunk/Master/texmf-dist/doc/latex/todonotes/img/AlteredAppearenceOfListOfTodos.png

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)

Added: trunk/Master/texmf-dist/doc/latex/todonotes/img/AlteredAppearenceOfListOfTodos.png
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/todonotes/img/AlteredAppearenceOfListOfTodos.png
===================================================================
--- trunk/Master/texmf-dist/doc/latex/todonotes/img/AlteredAppearenceOfListOfTodos.png	2023-01-31 20:50:37 UTC (rev 65698)
+++ trunk/Master/texmf-dist/doc/latex/todonotes/img/AlteredAppearenceOfListOfTodos.png	2023-01-31 20:51:08 UTC (rev 65699)

Property changes on: trunk/Master/texmf-dist/doc/latex/todonotes/img/AlteredAppearenceOfListOfTodos.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
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	2023-01-31 20:50:37 UTC (rev 65698)
+++ trunk/Master/texmf-dist/source/latex/todonotes/todonotes.dtx	2023-01-31 20:51:08 UTC (rev 65699)
@@ -20,7 +20,7 @@
 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
 %<package>\ProvidesPackage{todonotes}
 %<*package>
-    [2021/06/04 v1.1.5 Todonotes source and documentation.]
+    [2023/01/31 v1.1.6 Todonotes source and documentation.]
 %</package>
 %
 %<*driver>
@@ -27,7 +27,7 @@
 \documentclass{ltxdoc}
 \usepackage{wrapfig}
 \usepackage[colorlinks, linkcolor=black, urlcolor=blue]{hyperref}
-\usepackage[colorinlistoftodos, loadshadowlibrary]{todonotes}[2021/06/04]
+\usepackage[colorinlistoftodos, loadshadowlibrary]{todonotes}[2023/01/31]
 \usepackage{amsmath}
 \usepackage{setspace}
 \usepackage{soul}
@@ -45,7 +45,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{734}
+% \CheckSum{760}
 %
 % \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
@@ -213,6 +213,9 @@
 %             shadows. Actually use the tickmarkheight option as suggested by 
 %             José Francisco Loff library by default. Described a workaround for using 
 %             the standalone document class.}
+% \changes{1.1.6}{2023/01/31}{Fix issue 64 by adding the command definetodostyle and 
+%             the format option to the todo and missingfigure commands. 
+%             Pull request by rzach.}
 % \GetFileInfo{todonotes.dtx}   
 %
 % \DoNotIndex{\newcommand,\newenvironment}
@@ -241,11 +244,14 @@
 % \newpage
 % \section{Introduction}
 %
-% The |todonotes| package makes three commands available to the
+% The |todonotes| package makes four commands available to the
 % user: |\todo[]{}|, |\missingfigure{}| and |\listoftodos|.
 % |\todo[]{}| and |\missingfigure{}| makes it possible to insert
 % notes in your document about things that has to be done later
-% (todonotes \ldots).
+% (todonotes \ldots). 
+% The |\todostyle| command allows the user to 
+% define named custom styles as abbreviations for lists of other
+% options that can be given to the |\todo| command.
 % I developed the basic functionality of the package while I worked
 % on my bachelor project.
 % 
@@ -315,6 +321,19 @@
 % list of todos. The command should be placed right before the 
 % |\listoftodos| command.
 %
+% \DescribeMacro{\todostyle\marg{name}\marg{style}}
+% The |\todostyle| command defines a new optional argument to the
+% |\todo| command \meta{name} which sets the options given by
+% \meta{style}. For instance, after issuing
+% \begin{verbatim}
+% \todostyle{red}{color=red,shadow}\end{verbatim}
+% the command |\todonote[red]{Stuff}| has the same effect as:
+% \begin{verbatim}
+% \todonote[color=red,shadow]{Stuff}\end{verbatim}
+% Defined styles should be used
+% as the first optional argument to |\todo|, as they reset all
+% predefined options to their defaults.
+%
 % \subsection{Package options}
 % \label{subsecPackageOptions}
 % \DescribeMacro{disable}
@@ -385,8 +404,9 @@
 %
 % \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 
-% as the current line width.
+% |length|. The width of inline todonotes defaults to the width of the 
+% current |\linewidth| but can be adjusted using the 
+% |inlinewidth| option.
 %
 % \DescribeMacro{textsize}
 % |textsize=value| sets the default text size of the inserted
@@ -794,6 +814,11 @@
 %
 % \subsubsection{Todonotes in footnotes}
 % Placing todonotes in footnotes throws a lot of errors.
+% However inline notes seems to work fine, as shown here
+% \footnote{Note \todo[inline]{description}}:
+% \begin{verbatim}
+% \footnote{Note \todo[inline]{description}}
+% \end{verbatim}
 % Richard Stanton comes with the following work around.
 % \begin{verbatim}
 % \renewcommand{\marginpar}{\marginnote}
@@ -857,8 +882,18 @@
 % \end{document}
 % \end{verbatim}
 %
+% \subsubsection{Issues with user-defined styles}
 %
+% Using an option defined using |\todostyle| will reset all predefined
+% options to their defaults. For instance,
+% |\todo[inline,newstyle]{Stuff}| will not be inline; however
+% |\todo[newstyle,inline]{Stuff}| will be.
 %
+% |\todostyle| does not check if the name of the defined style is
+% already one of the defined options, so, e.g.,
+% |\todostyle{inline}{color=red}| will redefine the |inline| option
+% to produce red marginal notes.
+%
 % \subsection{Things to improve}
 % This is a list of things I consider to improve sometime in the
 % future. It have not been done yet as I lack the time or skills to
@@ -937,6 +972,15 @@
 % This \todoredefined[color=green]{Test of newly defined command, requesting a green color.}
 % can be done with all the accepted options for the |\todo| command.
 % 
+% If only available options to the |\todo| command are desired in the
+% defined command, a similar effect can be achieved by defining a new style.
+% For instance, 
+% \begin{verbatim}
+% \todostyle{red}{color=red}
+% \todo[red,inline]{A red to do}\end{verbatim}
+% \todostyle{red}{color=red}%
+% will produce a note like this:\todo[red,inline]{A todo with user-defined
+% style \emph{red}}
 %
 %
 % \subsubsection{Enumerate todonotes}
@@ -1296,6 +1340,38 @@
 % \tododone[disable]{Testing}
 % 
 % 
+% \subsubsection{Notes in both left and right margin}
+% 
+% If you want to add many todonotes in your document, it can be beneficial to 
+% use both the left and right margins for the inserted notes.
+% This can be achieved by defining a helper function the following way.
+% The main drawback is that notes inserted using the \verb!marginnote! 
+% command does not float and thus they can get to overlap.
+% This idea was suggested by 
+% \href{https://github.com/henrikmidtiby/todonotes/issues/56}{FranzAtGithub}.
+% 
+% \begin{verbatim}
+% \usepackage{marginnote}
+% \usepackage{etoolbox}
+% 
+% \newtoggle{lmargin}
+% \newcommand{\alternatingtodo}[2][]{%
+%    \iftoggle{lmargin}%
+%     {%
+%         \todo[#1]{#2}
+%         \togglefalse{lmargin}
+%     }{%
+%         {%
+%             \let\marginpar\marginnote%
+%             \reversemarginpar%
+%             \todo[#1]{#2}%
+%         }%
+%         \toggletrue{lmargin}%
+%     }%
+% }%
+% \end{verbatim}
+% 
+% 
 %
 % \iffalse
 % \StopEventually{\PrintChanges\PrintIndex}
@@ -1307,7 +1383,7 @@
 %
 % Identifies the package and loads the packages dependences.
 %    \begin{macrocode}
-\ProvidesPackage{todonotes}[2021/06/04]
+\ProvidesPackage{todonotes}[2023/01/31]
 \RequirePackage{ifthen}
 \RequirePackage{xkeyval}
 \RequirePackage{xcolor}
@@ -1533,6 +1609,17 @@
 \define at key{todonotes.sty}%
     {textwidth}{\renewcommand{\@todonotes at textwidth}{#1}}
 %    \end{macrocode}
+% Make the formatting of a note an option.
+% Notes are formatted using |\todoformat|, which by default does
+% nothing.
+% If the option |format=cmd| is given, notes are formatted using
+% |\cmd| instead.
+% Default formatting can also be changed by redefining |\todoformat|.
+%    \begin{macrocode}
+\newcommand{\todoformat}[1]{#1}
+\define at key{todonotes.sty}%
+    {format}{\renewcommand{\todoformat}{\@nameuse{#1}}}
+%    \end{macrocode}
 % Make the text size as an option, accept both |size| and |textsize|. 
 %    \begin{macrocode}
 \define at key{todonotes.sty}%
@@ -1625,6 +1712,14 @@
 \define at key{todonotes}{tickmarkheight}{%
     \renewcommand{\@todonotes at tickmarkheight}{#1}}%
 %    \end{macrocode}
+% Make formatting of notes a per-note option as well, by redefining
+% the internal |\@todonotes at format| command, which is then used in
+% formatting the actual note.
+%    \begin{macrocode}
+\newcommand{\@todonotes at format}{\todoformat}%
+\define at key{todonotes}{format}{%
+    \renewcommand{\@todonotes at format}{\@nameuse{#1}}}%
+%    \end{macrocode}
 % Set a relative font size
 %    \begin{macrocode}
 \newcommand{\@todonotes at sizecommand}{}%
@@ -1720,6 +1815,7 @@
     backgroundcolor=\@todonotes at backgroundcolor,%
     textcolor=\@todonotes at textcolor,%
     bordercolor=\@todonotes at bordercolor,%
+    format=todoformat,%
     tickmarkheight=\@todonotes at defaulttickmarkheight,%
     nofancyline,%
     nodisable,%
@@ -1931,9 +2027,10 @@
          \end{tikzpicture}%
          \if at todonotes@inlinepar\par\fi}%
             \if at todonotes@authorgiven%
-                {\noindent \@todonotes at useSizeCommand \@todonotes at author:\,\@todonotes at text}%
+                {\noindent \@todonotes at useSizeCommand \@todonotes at author:\,\@todonotes at format{\@todonotes at text}}%
             \else%
-                {\noindent \@todonotes at useSizeCommand \@todonotes at text}%
+                {\noindent \@todonotes at useSizeCommand%
+                    \@todonotes at format{\@todonotes at text}}%
             \fi
         {\if at todonotes@inlinepar\par\noindent\fi%
          \begin{tikzpicture}[remember picture]%
@@ -1945,9 +2042,10 @@
          \begin{tikzpicture}[remember picture]%
             \draw node[inlinenotestyle,font=\@todonotes at useSizeCommand]{%
                 \if at todonotes@authorgiven%
-                    {\noindent \@todonotes at author:\,\@todonotes at text}%
+                    {\noindent \@todonotes at author:\,%
+                        \@todonotes at format{\@todonotes at text}}%
                 \else%
-                    {\noindent \@todonotes at text}%
+                    {\noindent \@todonotes at format{\@todonotes at text}}%
                 \fi};%
          \end{tikzpicture}%
          \if at todonotes@inlinepar\par\fi}%
@@ -1964,9 +2062,10 @@
     \end{tikzpicture}\\%
     \begin{minipage}{\@todonotes at textwidth}%
     \if at todonotes@authorgiven%
-      \@todonotes at useSizeCommand \@todonotes at author \@todonotes at text%
+      \@todonotes at useSizeCommand \@todonotes at author:\,
+         \@todonotes at format{\@todonotes at text}%
     \else%
-      \@todonotes at useSizeCommand \@todonotes at text%
+      \@todonotes at useSizeCommand\@todonotes at format{\@todonotes at text}%
     \fi%
     \end{minipage}\\%
     \begin{tikzpicture}[remember picture]%
@@ -1982,10 +2081,10 @@
                 {\@todonotes at author};%
             \node(Y)[below=of X]{};%
             \draw node[notestyle,font=\@todonotes at useSizeCommand,anchor=north] (inNote) at (X.south)%
-                {\@todonotes at text};%
+                {\@todonotes at format{\@todonotes at text}};%
         \else%
             \draw node[notestyle,font=\@todonotes at useSizeCommand,anchor=north] (inNote) at (X.north)%
-                {\@todonotes at text};%
+                {\@todonotes at format{\@todonotes at text}};%
         \fi%
     \end{tikzpicture}%
     \hbadness \originalHbadness%
@@ -2111,6 +2210,17 @@
 \newif\if at todonotes@vmode
 %    \end{macrocode}
 % \end{macro}
+% \begin{macro}{\todostyle}
+% Define the |\todostyle| macro. |\todostyle|\marg{name}\marg{style}
+% defines an |xkeyval| option \meta{name} that, when called in a
+% |\todo| or |\missingfigure| command, sets the preset options 
+% followed by \meta{style}.
+%    \begin{macrocode}
+\newcommand*{\todostyle}[2]{%
+    \define at key{todonotes}{#1}[]{%
+        \setkeys{todonotes}{#2}}}
+%    \end{macrocode}
+% \end{macro}
 % \appendix
 % \newpage
 % \Finale

Modified: trunk/Master/texmf-dist/tex/latex/todonotes/todonotes.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/todonotes/todonotes.sty	2023-01-31 20:50:37 UTC (rev 65698)
+++ trunk/Master/texmf-dist/tex/latex/todonotes/todonotes.sty	2023-01-31 20:51:08 UTC (rev 65699)
@@ -22,9 +22,9 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesPackage{todonotes}
-    [2021/06/04 v1.1.5 Todonotes source and documentation.]
+    [2023/01/31 v1.1.6 Todonotes source and documentation.]
 
-\ProvidesPackage{todonotes}[2021/06/04]
+\ProvidesPackage{todonotes}[2023/01/31]
 \RequirePackage{ifthen}
 \RequirePackage{xkeyval}
 \RequirePackage{xcolor}
@@ -179,7 +179,10 @@
 \DeclareOptionX{prependcaption}{\@todonotes at prependcaptionglobaltrue}
 \define at key{todonotes.sty}%
     {textwidth}{\renewcommand{\@todonotes at textwidth}{#1}}
+\newcommand{\todoformat}[1]{#1}
 \define at key{todonotes.sty}%
+    {format}{\renewcommand{\todoformat}{\@nameuse{#1}}}
+\define at key{todonotes.sty}%
     {textsize}{\renewcommand{\@todonotes at textsize}{#1}}
 \define at key{todonotes.sty}%
     {size}{\renewcommand{\@todonotes at textsize}{#1}}
@@ -234,6 +237,9 @@
 \define at key{todonotes}{noshadow}[]{\@todonotes at useshadowfalse}%
 \define at key{todonotes}{tickmarkheight}{%
     \renewcommand{\@todonotes at tickmarkheight}{#1}}%
+\newcommand{\@todonotes at format}{\todoformat}%
+\define at key{todonotes}{format}{%
+    \renewcommand{\@todonotes at format}{\@nameuse{#1}}}%
 \newcommand{\@todonotes at sizecommand}{}%
 \define at key{todonotes}{size}{\renewcommand{\@todonotes at sizecommand}{#1}%
 }%
@@ -289,6 +295,7 @@
     backgroundcolor=\@todonotes at backgroundcolor,%
     textcolor=\@todonotes at textcolor,%
     bordercolor=\@todonotes at bordercolor,%
+    format=todoformat,%
     tickmarkheight=\@todonotes at defaulttickmarkheight,%
     nofancyline,%
     nodisable,%
@@ -420,9 +427,10 @@
          \end{tikzpicture}%
          \if at todonotes@inlinepar\par\fi}%
             \if at todonotes@authorgiven%
-                {\noindent \@todonotes at useSizeCommand \@todonotes at author:\,\@todonotes at text}%
+                {\noindent \@todonotes at useSizeCommand \@todonotes at author:\,\@todonotes at format{\@todonotes at text}}%
             \else%
-                {\noindent \@todonotes at useSizeCommand \@todonotes at text}%
+                {\noindent \@todonotes at useSizeCommand%
+                    \@todonotes at format{\@todonotes at text}}%
             \fi
         {\if at todonotes@inlinepar\par\noindent\fi%
          \begin{tikzpicture}[remember picture]%
@@ -434,9 +442,10 @@
          \begin{tikzpicture}[remember picture]%
             \draw node[inlinenotestyle,font=\@todonotes at useSizeCommand]{%
                 \if at todonotes@authorgiven%
-                    {\noindent \@todonotes at author:\,\@todonotes at text}%
+                    {\noindent \@todonotes at author:\,%
+                        \@todonotes at format{\@todonotes at text}}%
                 \else%
-                    {\noindent \@todonotes at text}%
+                    {\noindent \@todonotes at format{\@todonotes at text}}%
                 \fi};%
          \end{tikzpicture}%
          \if at todonotes@inlinepar\par\fi}%
@@ -448,9 +457,10 @@
     \end{tikzpicture}\\%
     \begin{minipage}{\@todonotes at textwidth}%
     \if at todonotes@authorgiven%
-      \@todonotes at useSizeCommand \@todonotes at author \@todonotes at text%
+      \@todonotes at useSizeCommand \@todonotes at author:\,
+         \@todonotes at format{\@todonotes at text}%
     \else%
-      \@todonotes at useSizeCommand \@todonotes at text%
+      \@todonotes at useSizeCommand\@todonotes at format{\@todonotes at text}%
     \fi%
     \end{minipage}\\%
     \begin{tikzpicture}[remember picture]%
@@ -466,10 +476,10 @@
                 {\@todonotes at author};%
             \node(Y)[below=of X]{};%
             \draw node[notestyle,font=\@todonotes at useSizeCommand,anchor=north] (inNote) at (X.south)%
-                {\@todonotes at text};%
+                {\@todonotes at format{\@todonotes at text}};%
         \else%
             \draw node[notestyle,font=\@todonotes at useSizeCommand,anchor=north] (inNote) at (X.north)%
-                {\@todonotes at text};%
+                {\@todonotes at format{\@todonotes at text}};%
         \fi%
     \end{tikzpicture}%
     \hbadness \originalHbadness%
@@ -565,6 +575,9 @@
     \@todo[#1]{#2}%
   \fi}
 \newif\if at todonotes@vmode
+\newcommand*{\todostyle}[2]{%
+    \define at key{todonotes}{#1}[]{%
+        \setkeys{todonotes}{#2}}}
 \endinput
 %%
 %% End of file `todonotes.sty'.



More information about the tex-live-commits mailing list.