summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/todonotes
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-09-16 18:27:05 +0000
committerKarl Berry <karl@freefriends.org>2008-09-16 18:27:05 +0000
commited76d6be902b9c6ce0bf4a373ce44f48137d7529 (patch)
treed05f5cf6869b37ef1ffa46cd10ec20873697ce29 /Master/texmf-dist/source/latex/todonotes
parent42d691218d8edd24d57cf2ba6406037635be7946 (diff)
todonotes (15sep08)
git-svn-id: svn://tug.org/texlive/trunk@10614 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/todonotes')
-rw-r--r--Master/texmf-dist/source/latex/todonotes/todonotes.dtx161
1 files changed, 93 insertions, 68 deletions
diff --git a/Master/texmf-dist/source/latex/todonotes/todonotes.dtx b/Master/texmf-dist/source/latex/todonotes/todonotes.dtx
index 58f21af49d4..ff88f086ef7 100644
--- a/Master/texmf-dist/source/latex/todonotes/todonotes.dtx
+++ b/Master/texmf-dist/source/latex/todonotes/todonotes.dtx
@@ -22,13 +22,13 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{todonotes}
%<*package>
- [2008/08/11 .dtx Todonotes source and documentation.]
+ [2008/09/15 .dtx Todonotes source and documentation.]
%</package>
%
%<*driver>
\documentclass{ltxdoc}
\usepackage[colorlinks, linkcolor=black]{hyperref}
-\usepackage[colorinlistoftodos]{todonotes}[2008/08/11]
+\usepackage[colorinlistoftodos]{todonotes}[2008/09/15]
\EnableCrossrefs
\CodelineIndex
\RecordChanges
@@ -42,7 +42,7 @@
%</driver>
% \fi
%
-% \CheckSum{0}
+% \CheckSum{222}
%
% \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
@@ -83,8 +83,9 @@
% the list of todos.}
% \changes{0.4.2}{2008/07/30}{Fixed a bug with the disable option to the
% package.}
-% \changes{0.5}{2008/09/05}{Created a dtx file containing both source
+% \changes{0.5}{2008/08/05}{Created a dtx file containing both source
% code and documentation of the package}
+% \changes{0.5.1}{2008/09/15}{Updated the documentation}
%
% \GetFileInfo{todonotes.dtx}
%
@@ -103,6 +104,7 @@
% to--do items can be listed with the |\listoftodos| command.
% \end{abstract}
%
+% \tableofcontents
%
% \section{Introduction}
%
@@ -115,7 +117,6 @@
% on my bachelor project.
%
%
-%
%
% \subsection{Usage}
%
@@ -259,6 +260,30 @@
% \subsection{Options for the listoftodos command}
% Currently the listoftodos command takes no optional arguments.
%
+% \subsection{Known issues}
+% \subsubsection{Package loading order}
+% The todonotes package requires the following packages.
+% \begin{multicols}{2}
+% \begin{itemize}
+% \item ifthen
+% \item xkeyval
+% \item hyperref
+% \item xcolor
+% \item tikz
+% \item calc
+% \item graphicx (is loaded via the tikz package)
+% \end{itemize}
+% \end{multicols}
+% \noindent
+% When todonotes are loaded in the preamble, the package checks
+% if these packages all are loaded. If that is not the case it loads
+% the missing packages with no options given.
+% If you want to give some specific options to some of these
+% packages, you have to load them \emph{before} the todonotes
+% package, otherwise you will get an ''Option clash'' error when
+% latex works on the document.
+%
+%
% \iffalse
% \StopEventually{\PrintChanges\PrintIndex}
% \fi
@@ -268,7 +293,7 @@
%
% Identifies the package and loads the packages dependences.
% \begin{macrocode}
-\ProvidesPackage{todonotes}[2008/08/11]
+\ProvidesPackage{todonotes}[2008/09/15]
\RequirePackage{ifthen}
\RequirePackage{xkeyval}
\RequirePackage{hyperref}
@@ -278,9 +303,9 @@
% \end{macrocode}
% Some default values are set
% \begin{macrocode}
-\newcommand{\@backgroundcolor}{orange}
-\newcommand{\@bordercolor}{black}
-\newcommand{\@textwidth}{\marginparwidth}
+\newcommand{\@todonotes@backgroundcolor}{orange}
+\newcommand{\@todonotes@bordercolor}{black}
+\newcommand{\@todonotes@textwidth}{\marginparwidth}
% \end{macrocode}
%
% \subsection{Declaration of options for the package}
@@ -293,39 +318,39 @@
% as commands with no effect. (But you can still
% compile you document with these commands).
% \begin{macrocode}
-\newif{\ifdisabled}
-\DeclareOptionX{disable}{\disabledtrue}
+\newif{\if@todonotes@disabled}
+\DeclareOptionX{disable}{\@todonotes@disabledtrue}
% \end{macrocode}
% Show small boxes in the list of todos with the color of the
% inserted todonotes.
% \begin{macrocode}
-\newif{\ifcolorinlistoftodos}
-\DeclareOptionX{colorinlistoftodos}{\colorinlistoftodostrue}
+\newif{\if@todonotes@colorinlistoftodos}
+\DeclareOptionX{colorinlistoftodos}{\@todonotes@colorinlistoftodostrue}
% \end{macrocode}
% The default style behaves bad when compiled
% with latex (some text placement problems).
% The dvistyle option, changes the visual behavior
% to avoid this text placement problem.
% \begin{macrocode}
-\newif{\ifdviStyle}
-\DeclareOptionX{dvistyle}{\dviStyletrue}
+\newif{\if@todonotes@dviStyle}
+\DeclareOptionX{dvistyle}{\@todonotes@dviStyletrue}
% \end{macrocode}
% Make the background color of the notes as
% an option.
% \begin{macrocode}
\define@key{todonotes.sty}%
- {color}{\renewcommand{\@backgroundcolor}{#1}}
+ {color}{\renewcommand{\@todonotes@backgroundcolor}{#1}}
% \end{macrocode}
% Make the color of the notes box color as
% an option.
% \begin{macrocode}
\define@key{todonotes.sty}%
- {bordercolor}{\renewcommand{\@bordercolor}{#1}}
+ {bordercolor}{\renewcommand{\@todonotes@bordercolor}{#1}}
% \end{macrocode}
% Make the text width as an option.
% \begin{macrocode}
\define@key{todonotes.sty}%
- {textwidth}{\renewcommand{\@textwidth}{#1}}
+ {textwidth}{\renewcommand{\@todonotes@textwidth}{#1}}
% \end{macrocode}
% Finally process the given options.
% \begin{macrocode}
@@ -339,38 +364,38 @@
% commands in the package are defined.
% Set an arbitrarily fill color
% \begin{macrocode}
-\newcommand{\fillcolor}{}%
-\define@key{todonotes}{color}{\renewcommand{\fillcolor}{#1}}%
+\newcommand{\@todonotes@fillcolor}{}%
+\define@key{todonotes}{color}{\renewcommand{\@todonotes@fillcolor}{#1}}%
% \end{macrocode}
% Set a relative font size
% \begin{macrocode}
-\newcommand{\sizecommand}{}%
-\define@key{todonotes}{size}{\renewcommand{\sizecommand}{#1}}%
+\newcommand{\@todonotes@sizecommand}{}%
+\define@key{todonotes}{size}{\renewcommand{\@todonotes@sizecommand}{#1}}%
% \end{macrocode}
% Should the todo item be included in the list of todos?
% \begin{macrocode}
-\newif\ifappendtolistoftodos%
-\define@key{todonotes}{list}[]{\appendtolistoftodostrue}%
-\define@key{todonotes}{nolist}[]{\appendtolistoftodosfalse}%
+\newif\if@todonotes@appendtolistoftodos%
+\define@key{todonotes}{list}[]{\@todonotes@appendtolistoftodostrue}%
+\define@key{todonotes}{nolist}[]{\@todonotes@appendtolistoftodosfalse}%
% \end{macrocode}
% Should the todo item be displayed inline?
% \begin{macrocode}
-\newif\ifinlinenote%
-\define@key{todonotes}{inline}[]{\inlinenotetrue}%
-\define@key{todonotes}{noinline}[]{\inlinenotefalse}%
+\newif\if@todonotes@inlinenote%
+\define@key{todonotes}{inline}[]{\@todonotes@inlinenotetrue}%
+\define@key{todonotes}{noinline}[]{\@todonotes@inlinenotefalse}%
% \end{macrocode}
% Should the note in the margin be connected to the insertion point
% in the text?
% \begin{macrocode}
-\newif\ifline%
-\define@key{todonotes}{line}[]{\linetrue}%
-\define@key{todonotes}{noline}[]{\linefalse}%
+\newif\if@todonotes@line%
+\define@key{todonotes}{line}[]{\@todonotes@linetrue}%
+\define@key{todonotes}{noline}[]{\@todonotes@linefalse}%
% \end{macrocode}
% Preset values of the options
% \begin{macrocode}
\presetkeys
{todonotes}
- {color=\@backgroundcolor, noinline,
+ {color=\@todonotes@backgroundcolor, noinline,
line, list, size=\normalsize}{}%
% \end{macrocode}
@@ -380,11 +405,11 @@
% If the option "disable" was passed to the package
% define empty commands.
% \begin{macrocode}
-\ifdisabled
+\if@todonotes@disabled
\newcommand{\listoftodos}{}
\newcommand{\todo}[2][]{}
\newcommand{\missingfigure}[1]{}
-\else % \ifdisabled
+\else % \if@todonotes@disabled
% \end{macrocode}
% Define the |\listoftodos| command and define the
% appearance of the list of todos.
@@ -396,8 +421,8 @@
% \end{macrocode}
% Define styles used by the todo command
% \begin{macrocode}
-\tikzstyle{notestyle} = [draw=\@bordercolor, line width=0.5pt,
- text width = \@textwidth - 1.6 ex - 1pt, inner sep = 0.8 ex]
+\tikzstyle{notestyle} = [draw=\@todonotes@bordercolor, line width=0.5pt,
+ text width = \@todonotes@textwidth - 1.6 ex - 1pt, inner sep = 0.8 ex]
\tikzstyle{notestyleleft} = [notestyle, left]
\tikzstyle{connectstyle} = [thick]
\tikzstyle{inlinenotestyle} = [notestyle, text width=\textwidth - 1.6 ex - 1 pt]
@@ -413,11 +438,11 @@
% |colorinlistoftodos| is given to the package a small colored
% square is added in front of the text.
% \begin{macrocode}
-\ifappendtolistoftodos%
+\if@todonotes@appendtolistoftodos%
\phantomsection%
- \ifcolorinlistoftodos%
+ \if@todonotes@colorinlistoftodos%
\addcontentsline{tdo}{todo}{\protect{%
- \colorbox{\fillcolor}{\textcolor{\fillcolor}{\tiny i}} %
+ \colorbox{\@todonotes@fillcolor}{\textcolor{\@todonotes@fillcolor}{\tiny i}} %
#2}}%
\else%
\addcontentsline{tdo}{todo}{\protect{#2}}%
@@ -427,16 +452,16 @@
% Place the todonote as indicated by the options (inline or in a
% marginpar), below is the code for the inline placement.
% \begin{macrocode}
-\ifinlinenote%
- \ifdviStyle%
+\if@todonotes@inlinenote%
+ \if@todonotes@dviStyle%
{\par\noindent\tikz[remember picture] \draw node[inlinenotestyle, %
- fill=\fillcolor] {};\par}%
- {\noindent \sizecommand #2}%
+ fill=\@todonotes@fillcolor] {};\par}%
+ {\noindent \@todonotes@sizecommand #2}%
{\par\noindent\tikz[remember picture] \draw node[inlinenotestyle, %
- fill=\fillcolor] {};\par}%
+ fill=\@todonotes@fillcolor] {};\par}%
\else%
{\par\noindent\tikz[remember picture] \draw node[inlinenotestyle, %
- fill=\fillcolor] {\sizecommand #2};\par}%
+ fill=\@todonotes@fillcolor] {\@todonotes@sizecommand #2};\par}%
\fi%
\else%
% \end{macrocode}
@@ -449,26 +474,26 @@
\node [coordinate] (inText) {};%
\end{tikzpicture}%
\marginpar[{% Draw note in left margin
-\ifdviStyle%
- \tikz[remember picture] \draw node[notestyle, fill=\fillcolor] {}; \\ %
- \begin{minipage}{\@textwidth}%
- \sizecommand #2%
+\if@todonotes@dviStyle%
+ \tikz[remember picture] \draw node[notestyle, fill=\@todonotes@fillcolor] {}; \\ %
+ \begin{minipage}{\@todonotes@textwidth}%
+ \@todonotes@sizecommand #2%
\end{minipage} \\%
- \tikz[remember picture] \draw node[notestyle, fill=\fillcolor] (inNote) {};%
- \ifline%
+ \tikz[remember picture] \draw node[notestyle, fill=\@todonotes@fillcolor] (inNote) {};%
+ \if@todonotes@line%
\begin{tikzpicture}[remember picture, overlay]%
- \draw[connectstyle, draw=\fillcolor]%
+ \draw[connectstyle, draw=\@todonotes@fillcolor]%
([yshift=-0.2cm] inText)%
-| ([xshift=0.2cm] inNote.east)%
-| (inNote.east);%
\end{tikzpicture}%
\fi%
\else%
- \tikz[remember picture] \draw node[notestyle, fill=\fillcolor]
-(inNote) {\sizecommand #2};%
- \ifline%
+ \tikz[remember picture] \draw node[notestyle, fill=\@todonotes@fillcolor]
+(inNote) {\@todonotes@sizecommand #2};%
+ \if@todonotes@line%
\begin{tikzpicture}[remember picture, overlay]%
- \draw[connectstyle, draw=\fillcolor]%
+ \draw[connectstyle, draw=\@todonotes@fillcolor]%
([yshift=-0.2cm] inText)%
-| ([xshift=0.2cm] inNote.east)%
-| (inNote.east);%
@@ -482,26 +507,26 @@
% which
% \begin{macrocode}
}]{% Draw note in right margin
-\ifdviStyle%
- \tikz[remember picture] \draw node[notestyle, fill=\fillcolor] {}; \\ %
- \begin{minipage}{\@textwidth}%
- \sizecommand #2%
+\if@todonotes@dviStyle%
+ \tikz[remember picture] \draw node[notestyle, fill=\@todonotes@fillcolor] {}; \\ %
+ \begin{minipage}{\@todonotes@textwidth}%
+ \@todonotes@sizecommand #2%
\end{minipage} \\%
- \tikz[remember picture] \draw node[notestyle, fill=\fillcolor] (inNote) {};%
- \ifline%
+ \tikz[remember picture] \draw node[notestyle, fill=\@todonotes@fillcolor] (inNote) {};%
+ \if@todonotes@line%
\begin{tikzpicture}[remember picture, overlay]%
- \draw[connectstyle, draw=\fillcolor]%
+ \draw[connectstyle, draw=\@todonotes@fillcolor]%
([yshift=-0.2cm] inText)%
-| ([xshift=-0.2cm] inNote.west)%
-| (inNote.west);%
\end{tikzpicture}%
\fi%
\else%
- \tikz[remember picture] \draw node[notestyle, fill=\fillcolor]
-(inNote) {\sizecommand #2};%
- \ifline%
+ \tikz[remember picture] \draw node[notestyle, fill=\@todonotes@fillcolor]
+(inNote) {\@todonotes@sizecommand #2};%
+ \if@todonotes@line%
\begin{tikzpicture}[remember picture, overlay]%
- \draw[connectstyle, draw=\fillcolor]%
+ \draw[connectstyle, draw=\@todonotes@fillcolor]%
([yshift=-0.2cm] inText)%
-| ([xshift=-0.2cm] inNote.west)%
-| (inNote.west);%
@@ -530,7 +555,7 @@
\draw (0, -0.3) node {figure};
\end{tikzpicture}
}% Ending \missingfigure command
-\fi % Ending \ifdisabled
+\fi % Ending \@todonotes@ifdisabled
% \end{macrocode}
% \end{macro}
%