summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/todonotes/todonotes.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/todonotes/todonotes.dtx')
-rw-r--r--macros/latex/contrib/todonotes/todonotes.dtx85
1 files changed, 70 insertions, 15 deletions
diff --git a/macros/latex/contrib/todonotes/todonotes.dtx b/macros/latex/contrib/todonotes/todonotes.dtx
index 0ca23696c6..9bea77d925 100644
--- a/macros/latex/contrib/todonotes/todonotes.dtx
+++ b/macros/latex/contrib/todonotes/todonotes.dtx
@@ -20,14 +20,14 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{todonotes}
%<*package>
- [2021/04/26 v1.1.4 Todonotes source and documentation.]
+ [2021/06/04 v1.1.5 Todonotes source and documentation.]
%</package>
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{wrapfig}
\usepackage[colorlinks, linkcolor=black, urlcolor=blue]{hyperref}
-\usepackage[colorinlistoftodos, loadshadowlibrary]{todonotes}[2021/04/26]
+\usepackage[colorinlistoftodos, loadshadowlibrary]{todonotes}[2021/06/04]
\usepackage{amsmath}
\usepackage{setspace}
\usepackage{soul}
@@ -45,7 +45,7 @@
%</driver>
% \fi
%
-% \CheckSum{731}
+% \CheckSum{734}
%
% \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
@@ -209,6 +209,10 @@
% globally available.}
% \changes{1.1.4}{2021/04/26}{Fix issue 51 by avoid loading the tikz shadows
% library by default.}
+% \changes{1.1.5}{2021/06/04}{Fix issue 54 related to additional spacing around todos with
+% shadows. Actually use the tickmarkheight option as suggested by
+% José Francisco Loff library by default. Described a workaround for using
+% the standalone document class.}
% \GetFileInfo{todonotes.dtx}
%
% \DoNotIndex{\newcommand,\newenvironment}
@@ -808,7 +812,7 @@
% |\let\marginpar\oldmarginpar|
%
%
-% \subsubsection{todos in math and floating environments}
+% \subsubsection{Todos in math and floating environments}
% It is not possible to insert todonotes into math environments or
% floating environments like \verb!figure! or \verb!table!.
% By replacing the marginpar command with a marginnote this
@@ -835,6 +839,26 @@
% \end{verbatim}
%
%
+% \subsubsection{Conflict between marginpar and the standalone class}
+%
+% The \verb!standalone! document class is not compatible with the
+% \verb!\marginpar! command, which is used in the todonotes package
+% to insert contents in the side margins.
+% A workaround is to replace the \verb!\marginpar! with \verb!\marginnote!.
+% This is demonstrated here:
+% \begin{verbatim}
+% \documentclass[crop=false]{standalone}
+% \usepackage{todonotes}
+% \usepackage{marginnote}
+% \let\marginpar\marginnote
+% \begin{document}
+% Lorem ipsum
+% \todo{Bug}
+% \end{document}
+% \end{verbatim}
+%
+%
+%
% \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
@@ -1240,6 +1264,36 @@
% \end{verbatim}
%
%
+% \subsubsection{Adding color coded levels of todos}
+%
+% Sometimes it can be beneficial to be able to distinguish
+% between different types of todos.
+% For this I would suggest the following approach:
+% \begin{verbatim}
+% \newcommand{\todoerror}[2][]{\todo[color=red!70, #1]{#2}}
+% \newcommand{\todowarn}[2][]{\todo[color=orange, #1]{#2}}
+% \newcommand{\todoremark}[2][]{\todo[color=yellow!80!black, #1]{#2}}
+% \newcommand{\todohint}[2][]{\todo[color=green!20, #1]{#2}}
+% \newcommand{\tododone}[2][]{\todo[color=blue!50, #1]{#2}}
+%
+% \todoerror[inline]{Testing}
+% \todoremark{Testing}
+% \todowarn[inline]{Testing}
+% \todohint{Testing}
+% \tododone[disable]{Testing}
+% \end{verbatim}
+%
+% \newcommand{\todoerror}[2][]{\todo[color=red!70, #1]{#2}}
+% \newcommand{\todowarn}[2][]{\todo[color=orange, #1]{#2}}
+% \newcommand{\todoremark}[2][]{\todo[color=yellow!80!black, #1]{#2}}
+% \newcommand{\todohint}[2][]{\todo[color=green!20, #1]{#2}}
+% \newcommand{\tododone}[2][]{\todo[color=blue!50, #1]{#2}}
+%
+% \todoerror[inline]{Testing}
+% \todoremark{Testing}
+% \todowarn[inline]{Testing}
+% \todohint{Testing}
+% \tododone[disable]{Testing}
%
%
%
@@ -1253,7 +1307,7 @@
%
% Identifies the package and loads the packages dependences.
% \begin{macrocode}
-\ProvidesPackage{todonotes}[2018/11/22]
+\ProvidesPackage{todonotes}[2021/06/04]
\RequirePackage{ifthen}
\RequirePackage{xkeyval}
\RequirePackage{xcolor}
@@ -1272,7 +1326,7 @@
\newcommand{\@todonotes@textcolor}{black}
\newcommand{\@todonotes@linecolor}{orange}
\newcommand{\@todonotes@bordercolor}{black}
-\newcommand{\@todonotes@tickmarkheight}{0cm}
+\newcommand{\@todonotes@tickmarkheight}{unused value}
\newcommand{\@todonotes@textwidth}{\marginparwidth}
\newcommand{\@todonotes@textsize}{\normalsize}
\newcommand{\@todonotes@figwidth}{\linewidth}
@@ -1463,8 +1517,9 @@ prior to loading the todonotes package.} \else\fi%
% Make the height of the line start marking as
% an option.
% \begin{macrocode}
-\define@key{todonotes.sty}%
- {tickmarkheight}{\renewcommand{\@todonotes@tickmarkheight}{#1}}
+\newcommand{\@todonotes@defaulttickmarkheight}{0cm}
+\define@key{todonotes.sty}{tickmarkheight}{%
+ \renewcommand{\@todonotes@defaulttickmarkheight}{#1}}%
% \end{macrocode}
% Set whether short captions given as arguments to the todo command
% should be included in the inserted todonote.
@@ -1490,11 +1545,11 @@ prior to loading the todonotes package.} \else\fi%
\newif\if@todonotes@shadowlibraryloaded
\@todonotes@shadowlibraryloadedfalse
\DeclareOptionX{loadshadowlibrary}{%
- \usetikzlibrary{shadows}%
- \@todonotes@shadowlibraryloadedtrue}
+ \usetikzlibrary{shadows}%
+ \@todonotes@shadowlibraryloadedtrue}
\newcommand{\@todonotes@shadowenabledbydefault}{noshadow}
\DeclareOptionX{shadow}{%
- \renewcommand{\@todonotes@shadowenabledbydefault}{shadow}}
+ \renewcommand{\@todonotes@shadowenabledbydefault}{shadow}}
% \end{macrocode}
% Add option for the default width of the figure inserted with
% |\missingfigure|.
@@ -1665,7 +1720,7 @@ prior to loading the todonotes package.} \else\fi%
backgroundcolor=\@todonotes@backgroundcolor,%
textcolor=\@todonotes@textcolor,%
bordercolor=\@todonotes@bordercolor,%
- tickmarkheight=0cm,%
+ tickmarkheight=\@todonotes@defaulttickmarkheight,%
nofancyline,%
nodisable,%
noinline,%
@@ -1741,9 +1796,9 @@ prior to loading the todonotes package.} \else\fi%
general shadow={shadow xshift=0.5ex, shadow yshift=-0.5ex,%
opacity=1,fill=black!50}]%
\else%
-\PackageWarning{todonotes}{Trying to put a shadow below a todonote,
- but the loadshadowlibrary option was not given when loading
- the todonotes package}
+\PackageWarning{todonotes}{Trying to put a shadow below a todonote,%
+ but the loadshadowlibrary option was not given when loading%
+ the todonotes package}%
\tikzstyle{notestyle} = [notestyleraw]%
\fi%
\else%