summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-03-08 00:15:41 +0000
committerKarl Berry <karl@freefriends.org>2011-03-08 00:15:41 +0000
commitc6fbfe0da4a3e034e28c1395203b5607ee79149c (patch)
tree2c8607ad24ca7ed0dfa45a418d2ad7313e2c61eb /Master/texmf-dist/source
parent3cd9c8be1dc12c3a8bf7c16323676c629ddc46a6 (diff)
todonotes (7mar11)
git-svn-id: svn://tug.org/texlive/trunk@21639 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/latex/todonotes/todonotes.dtx103
1 files changed, 75 insertions, 28 deletions
diff --git a/Master/texmf-dist/source/latex/todonotes/todonotes.dtx b/Master/texmf-dist/source/latex/todonotes/todonotes.dtx
index 46991c905d6..7725a6e419e 100644
--- a/Master/texmf-dist/source/latex/todonotes/todonotes.dtx
+++ b/Master/texmf-dist/source/latex/todonotes/todonotes.dtx
@@ -22,14 +22,14 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{todonotes}
%<*package>
- [2010/09/26 .dtx Todonotes source and documentation.]
+ [2011/03/07 .dtx Todonotes source and documentation.]
%</package>
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{wrapfig}
\usepackage[colorlinks, linkcolor=black]{hyperref}
-\usepackage[colorinlistoftodos, shadow]{todonotes}[2010/09/26]
+\usepackage[colorinlistoftodos, shadow]{todonotes}[2011/03/07]
\usepackage{amsmath}
\usepackage{setspace}
\setcounter{tocdepth}{2}
@@ -46,7 +46,7 @@
%</driver>
% \fi
%
-% \CheckSum{458}
+% \CheckSum{0}
%
% \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
@@ -153,11 +153,12 @@
% \changes{0.9.2}{2010/09/13}{Use chapter (if available) for the list of todos heading.}
% \changes{0.9.3}{2010/09/13}{Make an internal definition of the todo command,
% for easing redefinition of the command behaviour.}
-% \changes{0.9.4}{2010/09/26}{Make the disable option work on a local scale as
-% suggested by Stefan Pinnow.}
+% \changes{0.9.4}{2010/09/26}{Make the disable option work on a local scale.}
% \changes{0.9.5}{2010/09/26}{Code simplification by extracting functionality to
% smaller macros.}
-%
+% \changes{0.9.6}{2010/11/04}{Give fontsize to TikZ. Align notes with line where note
+% is set. Added new option fancyline. Patches by Benjamin Kellermann.}
+% \changes{0.9.7}{2011/03/07}{Updated documentation.}
% \GetFileInfo{todonotes.dtx}
%
% \DoNotIndex{\newcommand,\newenvironment}
@@ -331,6 +332,11 @@
% The option |dvistyle| changes the appearance of the inserted
% todonotes to avoid this problem.
%
+% \DescribeMacro{figwidth}
+% The |figwidth=length| option sets the default width of the figure
+% inserted by the |\missingfigure| command.
+% The default value is |\columnwidth|.
+%
%
%
% \subsection{Options for the todo command}
@@ -459,12 +465,15 @@
% \todo[noprepend, caption={Short note with noprepend}]{A very long and
% tedious note that cannot be on one line in the list of todos.}.
% \end{verbatim}
-% \DescribeMacro{figwidth}
-% The |figwidth=length| option sets the default width of the figure
-% inserted by the |\missingfigure| command.
-% The default value is |\columnwidth|.
-%
%
+% \DescribeMacro{fancyline}
+% The |fancyline| option inserts a curved arrow, pointing from the inserted
+% note to the insertion point.
+% \todo[fancyline]{Testing.}
+% The option is used like this:
+% \begin{verbatim}
+% \todo[fancyline]{Testing.}
+% \end{verbatim}
%
% \subsection{Options for the missingfigure command}
%
@@ -570,6 +579,11 @@
% \setlength{\marginparwidth}{2cm}
% \end{verbatim}
%
+% If the todonotes are inserted in the wrong margin, the solution is the
+% |\reversemarginpar| command.
+% When this command is issued the following marginpars (which todonotes
+% relies on) is inserted in the other margin.
+%
%
% \subsection{Things to improve}
% This is a list of things I consider to improve sometime in the
@@ -933,7 +947,7 @@
%
% Identifies the package and loads the packages dependences.
% \begin{macrocode}
-\ProvidesPackage{todonotes}[2010/09/26]
+\ProvidesPackage{todonotes}[2011/03/07]
\RequirePackage{ifthen}
\RequirePackage{xkeyval}
\RequirePackage{xcolor}
@@ -1208,6 +1222,13 @@
\define@key{todonotes}{line}[]{\@todonotes@linetrue}%
\define@key{todonotes}{noline}[]{\@todonotes@linefalse}%
% \end{macrocode}
+% Should the connection between note and insertion point be drawn
+% in a fancy way? (does only work if line=true)
+% \begin{macrocode}
+\newif\if@todonotes@fancyline\@todonotes@fancylinefalse%
+\define@key{todonotes}{fancyline}[]{\@todonotes@fancylinetrue}%
+\define@key{todonotes}{nofancyline}[]{\@todonotes@fancylinefalse}%
+% \end{macrocode}
% Should the text in the list of todos be different from the text
% in the todonote?
% \begin{macrocode}
@@ -1231,6 +1252,7 @@
{linecolor=\@todonotes@linecolor,%
backgroundcolor=\@todonotes@backgroundcolor,%
bordercolor=\@todonotes@bordercolor,%
+ nofancyline,%
nodisable,%
noinline,%
nocaption,%
@@ -1402,7 +1424,7 @@
\draw node[inlinenotestyle] {};\end{tikzpicture}\par}%
\else%
{\par\noindent\begin{tikzpicture}[remember picture]%
- \draw node[inlinenotestyle] {\@todonotes@sizecommand \@todonotes@text};%
+ \draw node[inlinenotestyle,font=\@todonotes@sizecommand] {\@todonotes@text};%
\end{tikzpicture}\par}%
\fi}%
% \end{macrocode}
@@ -1422,9 +1444,10 @@
\draw node[notestyle] (inNote) {};%
\end{tikzpicture}%
\else%
- \begin{tikzpicture}[remember picture]%
- \draw node[notestyle] (inNote)%
- {\@todonotes@sizecommand \@todonotes@text};%
+ \begin{tikzpicture}[remember picture,baseline=(X.base)]%
+ \node(X){\vphantom{X}};%
+ \draw node[notestyle,font=\@todonotes@sizecommand,anchor=north] (inNote) at (X.north)%
+ {\@todonotes@text};%
\end{tikzpicture}%
\fi}%
% \end{macrocode}
@@ -1434,12 +1457,24 @@
% \begin{macrocode}
\newcommand{\@todonotes@drawLineToRightMargin}{%
\if@todonotes@line%
-\begin{tikzpicture}[remember picture, overlay]%
- \draw[connectstyle]%
- ([yshift=-0.2cm] inText)%
- -| ([xshift=-0.2cm] inNote.west)%
- -| (inNote.west);%
- \end{tikzpicture}%
+ \if@todonotes@fancyline%
+ \tikz[remember picture,overlay]{%
+ \tikzstyle{both}=[line width=3pt, draw, opacity=0.15]%
+ \tikzstyle{line}=[shorten >=5pt, line cap=round]%
+ \tikzstyle{head}=[shorten >=-1pt, dash pattern=on 0pt off 1pt, ->]%
+ \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]%
+ ([yshift=-0.2cm] inText)%
+ -| ([xshift=-0.2cm] inNote.west)%
+ -| (inNote.west);%
+ \end{tikzpicture}%
+ \fi
\fi}%
% \end{macrocode}
% \end{macro}
@@ -1448,12 +1483,24 @@
% \begin{macrocode}
\newcommand{\@todonotes@drawLineToLeftMargin}{
\if@todonotes@line%
- \begin{tikzpicture}[remember picture, overlay]%
- \draw[connectstyle]%
- ([yshift=-0.2cm] inText)%
- -| ([xshift=0.2cm] inNote.east)%
- -| (inNote.east);%
- \end{tikzpicture}%
+ \if@todonotes@fancyline%
+ \tikz[remember picture,overlay]{%
+ \tikzstyle{both}=[line width=3pt, draw, opacity=0.15]%
+ \tikzstyle{line}=[shorten >=5pt, line cap=round]%
+ \tikzstyle{head}=[shorten >=-1pt, dash pattern=on 0pt off 1pt,->]%
+ \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]%
+ ([yshift=-0.2cm] inText)%
+ -| ([xshift=0.2cm] inNote.east)%
+ -| (inNote.east);%
+ \end{tikzpicture}%
+ \fi%
\fi}
% \end{macrocode}
% \end{macro}