summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-09-07 23:55:42 +0000
committerKarl Berry <karl@freefriends.org>2008-09-07 23:55:42 +0000
commit439639682a803e8520a3d85ec0201dffad34b60e (patch)
tree5012692d68f648b4a1a8d18faf3461c866cf96d1 /Master/texmf-dist/source/latex
parentead7e280e84ad2e3de8687bf122fdd2bc82080f1 (diff)
new package todonotes (6sep08)
git-svn-id: svn://tug.org/texlive/trunk@10452 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r--Master/texmf-dist/source/latex/todonotes/todonotes.dtx539
-rw-r--r--Master/texmf-dist/source/latex/todonotes/todonotes.ins56
2 files changed, 595 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/todonotes/todonotes.dtx b/Master/texmf-dist/source/latex/todonotes/todonotes.dtx
new file mode 100644
index 00000000000..58f21af49d4
--- /dev/null
+++ b/Master/texmf-dist/source/latex/todonotes/todonotes.dtx
@@ -0,0 +1,539 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2008 by Henrik Skov Midtiby <henrikmidtiby@gmail.com>
+% -------------------------------------------------------
+%
+% This file may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.2
+% of this license or (at your option) any later version.
+% The latest version of this license is in:
+%
+% http://www.latex-project.org/lppl.txt
+%
+% and version 1.2 or later is part of all distributions of LaTeX
+% version 1999/12/01 or later.
+%
+% \fi
+%
+% \iffalse
+%<*driver>
+\ProvidesFile{todonotes.dtx}
+%</driver>
+%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+%<package>\ProvidesPackage{todonotes}
+%<*package>
+ [2008/08/11 .dtx Todonotes source and documentation.]
+%</package>
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage[colorlinks, linkcolor=black]{hyperref}
+\usepackage[colorinlistoftodos]{todonotes}[2008/08/11]
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\begin{document}
+ \DocInput{todonotes.dtx}
+%\iffalse
+% \PrintChanges
+% \PrintIndex
+%\fi
+\end{document}
+%</driver>
+% \fi
+%
+% \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
+% Lower-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
+% Digits \0\1\2\3\4\5\6\7\8\9
+% Exclamation \! Double quote \" Hash (number) \#
+% Dollar \$ Percent \% Ampersand \&
+% Acute accent \' Left paren \( Right paren \)
+% Asterisk \* Plus \+ Comma \,
+% Minus \- Point \. Solidus \/
+% Colon \: Semicolon \; Less than \<
+% Equals \= Greater than \> Question mark \?
+% Commercial at \@ Left bracket \[ Backslash \\
+% Right bracket \] Circumflex \^ Underscore \_
+% Grave accent \` Left brace \{ Vertical bar \|
+% Right brace \} Tilde \~}
+%
+%
+% \changes{0.1}{2008/04/17}{The first version of the package}
+% \changes{0.2}{2008/05/15}{Updated the option handling of the package}
+% \changes{0.2.1}{2008/05/16}{Slightly modified by Kjell Magne Fauske to
+% support notes in the left margin (for documentstyle book).}
+% \changes{0.2.2}{2008/05/28}{Added a missingfigure command}
+% \changes{0.2.3}{2008/06/10}{Made a dependency on the calc package}
+% \changes{0.3}{2008/07/11}{Delayed the requirements for the hyperref package
+% untill begin document and added an optional argument
+% to the todo command for adding inline todonotes (Idea
+% from Patrick Toche)}
+% \changes{}{2008/07/15}{Added some options to the todo macro (Idea: Patrick
+% Toche) and made the \\listoftodos point at the inserted
+% todos and not only the current / previous section,
+% subsection or figure using the \\phantomsection macro.}
+% \changes{0.4}{2008/07/28}{Modified the behaviour of the inline todonotes, to
+% avoid empty lines around the inline todonotes.}
+% \changes{0.4.1}{2008/07/28}{
+% Added the option colorinlistoftodos which inserts a
+% small box with the used fillcolor of the todonotes in
+% 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
+% code and documentation of the package}
+%
+% \GetFileInfo{todonotes.dtx}
+%
+% \DoNotIndex{\newcommand,\newenvironment}
+%
+%
+% \title{The \textsf{todonotes} package\thanks{This document
+% corresponds to \textsf{todonotes}~\fileversion, dated \filedate.}}
+% \author{Henrik Skov Midtiby \\ \texttt{henrikmidtiby@gmail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The |todonotes| package allows you to insert to--do items in your
+% document. At any point in the document a list of all the inserted
+% to--do items can be listed with the |\listoftodos| command.
+% \end{abstract}
+%
+%
+% \section{Introduction}
+%
+% The |todonotes| package makes three 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).
+% I developed the basic functionality of the package while I worked
+% on my bachelor project.
+%
+%
+%
+%
+% \subsection{Usage}
+%
+% \DescribeMacro{\todo}
+% My \index{\todo}most common usage of the todonotes package, is to
+% insert an uncustomized todonotes somewhere in a latex document.
+% An example of this usage is the command
+%
+% |\todo{Make a cake \ldots}|,
+%
+% \noindent
+% which renders like\todo{Make a cake \ldots}.
+% The |\todo| command has this structure:
+% |\todo|\oarg{options}\marg{todo text}.
+% The |todo text| is the text that will be shown in the todonote and
+% in the list of todos. The optional argument |options|, allows the
+% user to customize the appearance of the inserted todonotes.
+% For a description of all the options see section
+% \ref{subsecTodoOptions}.
+%
+%
+% \DescribeMacro{\missingfigure}
+% The |\missingfigure| command inserts an image containing an
+% attention sign and the given text.
+% The command takes only one argument
+% |\missingfigure|\marg{text}, a text string that could
+% describe what the figure should consist of.
+% An example of its usage could be
+%
+% |\missingfigure{Make a sketch of the structure of a trebuchet.}|
+%
+% \noindent
+% which renders like.
+%
+% \missingfigure{Make a sketch of the structure of a trebuchet.}
+%
+%
+% \DescribeMacro{\listoftodos}
+% The |\listoftodos| command inserts a list of all the todos in the
+% current document. |\listoftodos| takes no arguments.
+% For this document the list of to--do's looks like.
+% \listoftodos
+%
+%
+% \subsection{Package options}
+% \DescribeMacro{disable}
+% If the option |disable| is passed to the package, the macros
+% usually defined by the package (|\todo|, |\listoftodos| and
+% |\missingfigure|) are defined as macros with no effect, and thus
+% all inserted notes are removed.
+%
+% \DescribeMacro{colorinlistoftodos}
+% Adds a small colored square in front of all items in the Todo
+% list. The color of the square is the same as the fill color of the
+% inserted todonote.
+% This can be usefull if there are different types of todos
+% (insert reference, explain in detail, \ldots) where the color of
+% the inserted todonote marks the type of todo.
+%
+% \DescribeMacro{color}
+% |color=val| sets the default background color of the inserted
+% todonotes to |val|. The default value is |color=orange|.
+% |val| must be a color understood by the |xcolor| package.
+%
+% \DescribeMacro{bordercolor}
+% |bordercolor=val| sets the default border color of the inserted
+% todonotes to |val|. The default value is |color=black|. |val| must
+% be a color understood by the |xcolor| package.
+%
+% \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.
+%
+% \DescribeMacro{dvistyle}
+% When a document with todonotes is compiled with plain latex (to a
+% dvi-file), there is an issue with the visual
+% appearance\footnote{The problem is placement of text inside the
+% colored boxes.}.
+% The option |dvistyle| changes the appearance of the inserted
+% todonotes to avoid this problem.
+%
+%
+%
+% \subsection{Options for the todo command}
+% \label{subsecTodoOptions}
+% There are several options that can be given to the |\todo|
+% command. All the options are described here and often I have
+% included examples of the change in visual appearance.
+%
+% \DescribeMacro{color}
+% |color=val| sets the background color of the inserted
+% \todo[color=red!40]{A red note.}%
+% todonotes to |val|. The default value can be set by the color
+% option when the todonotes package is loaded.
+% The todo notes inserted in this paragraph is created with the
+% commands
+% |\todo[color=red!40]{A red note.}| and
+% \todo[color=green!40]{And a green note}%
+% |\todo[color=green!40]{And a green note}|.
+% The color of the inserted note could be used to mark different
+% types of tasks (insert references, explain something in detail,
+% \ldots), this could be streamlined by defining new commands like
+% below.
+% \begin{verbatim}
+% \newcommand{\insertref}[1]{\todo[color=green!40]{#1}}
+% \newcommand{\explainindetail}[1]{\todo[color=red!40]{#1}}
+% \end{verbatim}
+%
+% \DescribeMacro{line / noline}
+% If you want to get rid of the line connecting the inserted note
+% with the place in the text where the note occurs in the latex
+% code, the option |noline| can be used.
+% \todo[noline]{A note with no line connecting it to the placement
+% in the original text.}
+% |\todo[noline]{A note with no line ...}|
+% \vspace{1.0cm}
+%
+% \DescribeMacro{inline / noinline}
+% It is possible to place a todonote inside the text instead of
+% placing it in the margin, this could be desireable if the text in
+% the note has a considerable length.
+% |\todo[inline]{A todonote placed in the text}|
+% \todo[inline]{A todonote placed in the text}
+%
+% \DescribeMacro{size}
+% |size=val| changes the size of the text inside the todonote.
+% The commands used to create the notes below are
+% |\todo[size=\Large]{A note with a large fontsize.}| and
+% |\todo[inline, size=\tiny]{Note with very small fontsize.}|.
+% \todo[size=\Large]{A note with a large fontsize.}
+% \todo[inline, size=\footnotesize]{Note with very small fontsize.}
+%
+% \DescribeMacro{list / nolist}
+% When the option |nolist| is given, the todo item will not appear in
+% the list of todos.
+%
+% \subsection{Options for the missingfigure command}
+% Currently the missingfigure command takes no optional arguments.
+%
+% \subsection{Options for the listoftodos command}
+% Currently the listoftodos command takes no optional arguments.
+%
+% \iffalse
+% \StopEventually{\PrintChanges\PrintIndex}
+% \fi
+% \StopEventually{\PrintChanges}
+%
+% \section{Implementation}
+%
+% Identifies the package and loads the packages dependences.
+% \begin{macrocode}
+\ProvidesPackage{todonotes}[2008/08/11]
+\RequirePackage{ifthen}
+\RequirePackage{xkeyval}
+\RequirePackage{hyperref}
+\RequirePackage{xcolor}
+\RequirePackage{tikz}
+\RequirePackage{calc}
+% \end{macrocode}
+% Some default values are set
+% \begin{macrocode}
+\newcommand{\@backgroundcolor}{orange}
+\newcommand{\@bordercolor}{black}
+\newcommand{\@textwidth}{\marginparwidth}
+% \end{macrocode}
+%
+% \subsection{Declaration of options for the package}
+% In this part the various options for
+% the package are defined.
+
+% Make it possible to disable the functionality
+% of the package. If this option is given, the
+% commands |\todo{}| and |\listoftodos| are defined
+% as commands with no effect. (But you can still
+% compile you document with these commands).
+% \begin{macrocode}
+\newif{\ifdisabled}
+\DeclareOptionX{disable}{\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}
+% \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}
+% \end{macrocode}
+% Make the background color of the notes as
+% an option.
+% \begin{macrocode}
+\define@key{todonotes.sty}%
+ {color}{\renewcommand{\@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}}
+% \end{macrocode}
+% Make the text width as an option.
+% \begin{macrocode}
+\define@key{todonotes.sty}%
+ {textwidth}{\renewcommand{\@textwidth}{#1}}
+% \end{macrocode}
+% Finally process the given options.
+% \begin{macrocode}
+\ProcessOptionsX
+% \end{macrocode}
+
+
+% \subsection{Options for the todo command}
+%
+% In this part the various options for
+% commands in the package are defined.
+% Set an arbitrarily fill color
+% \begin{macrocode}
+\newcommand{\fillcolor}{}%
+\define@key{todonotes}{color}{\renewcommand{\fillcolor}{#1}}%
+% \end{macrocode}
+% Set a relative font size
+% \begin{macrocode}
+\newcommand{\sizecommand}{}%
+\define@key{todonotes}{size}{\renewcommand{\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}%
+% \end{macrocode}
+% Should the todo item be displayed inline?
+% \begin{macrocode}
+\newif\ifinlinenote%
+\define@key{todonotes}{inline}[]{\inlinenotetrue}%
+\define@key{todonotes}{noinline}[]{\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}%
+% \end{macrocode}
+% Preset values of the options
+% \begin{macrocode}
+\presetkeys
+ {todonotes}
+ {color=\@backgroundcolor, noinline,
+ line, list, size=\normalsize}{}%
+% \end{macrocode}
+
+
+% \subsection{The main code part}
+% Here is the actual macros defined.
+% If the option "disable" was passed to the package
+% define empty commands.
+% \begin{macrocode}
+\ifdisabled
+ \newcommand{\listoftodos}{}
+ \newcommand{\todo}[2][]{}
+ \newcommand{\missingfigure}[1]{}
+\else % \ifdisabled
+% \end{macrocode}
+% Define the |\listoftodos| command and define the
+% appearance of the list of todos.
+% \begin{macrocode}
+\newcommand{\listoftodos}
+ {\section*{Todo list} \@starttoc{tdo}}
+\newcommand{\l@todo}
+ {\@dottedtocline{1}{0em}{2.3em}}
+% \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{notestyleleft} = [notestyle, left]
+\tikzstyle{connectstyle} = [thick]
+\tikzstyle{inlinenotestyle} = [notestyle, text width=\textwidth - 1.6 ex - 1 pt]
+% \end{macrocode}
+%
+% \begin{macro}{\todo}
+% Define the todo command
+% \begin{macrocode}
+\newcommand{\todo}[2][]{%
+\setkeys{todonotes}{#1}%
+% \end{macrocode}
+% Add the item to the list of todos. When the option
+% |colorinlistoftodos| is given to the package a small colored
+% square is added in front of the text.
+% \begin{macrocode}
+\ifappendtolistoftodos%
+ \phantomsection%
+ \ifcolorinlistoftodos%
+ \addcontentsline{tdo}{todo}{\protect{%
+ \colorbox{\fillcolor}{\textcolor{\fillcolor}{\tiny i}} %
+ #2}}%
+ \else%
+ \addcontentsline{tdo}{todo}{\protect{#2}}%
+ \fi%
+\fi%
+% \end{macrocode}
+% 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%
+ {\par\noindent\tikz[remember picture] \draw node[inlinenotestyle, %
+ fill=\fillcolor] {};\par}%
+ {\noindent \sizecommand #2}%
+ {\par\noindent\tikz[remember picture] \draw node[inlinenotestyle, %
+ fill=\fillcolor] {};\par}%
+ \else%
+ {\par\noindent\tikz[remember picture] \draw node[inlinenotestyle, %
+ fill=\fillcolor] {\sizecommand #2};\par}%
+ \fi%
+\else%
+% \end{macrocode}
+% When the todonote should be placed inside a marginpar, the code
+% below is applied.
+% First is the current location in the document stored, this enables
+% us later to connect this point with the inserted todonote.
+% \begin{macrocode}
+\begin{tikzpicture}[remember picture, baseline=-0.75ex]%
+ \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%
+ \end{minipage} \\%
+ \tikz[remember picture] \draw node[notestyle, fill=\fillcolor] (inNote) {};%
+ \ifline%
+ \begin{tikzpicture}[remember picture, overlay]%
+ \draw[connectstyle, draw=\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%
+ \begin{tikzpicture}[remember picture, overlay]%
+ \draw[connectstyle, draw=\fillcolor]%
+ ([yshift=-0.2cm] inText)%
+ -| ([xshift=0.2cm] inNote.east)%
+ -| (inNote.east);%
+ \end{tikzpicture}%
+ \fi%
+\fi%
+% \end{macrocode}
+% In the book documentclass (which is a twoside layout), the
+% |\marginpar| marginpar macro takes two arguments |\marginpar[]|,
+% it is possible to let latex decide in
+% which
+% \begin{macrocode}
+}]{% Draw note in right margin
+\ifdviStyle%
+ \tikz[remember picture] \draw node[notestyle, fill=\fillcolor] {}; \\ %
+ \begin{minipage}{\@textwidth}%
+ \sizecommand #2%
+ \end{minipage} \\%
+ \tikz[remember picture] \draw node[notestyle, fill=\fillcolor] (inNote) {};%
+ \ifline%
+ \begin{tikzpicture}[remember picture, overlay]%
+ \draw[connectstyle, draw=\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%
+ \begin{tikzpicture}[remember picture, overlay]%
+ \draw[connectstyle, draw=\fillcolor]%
+ ([yshift=-0.2cm] inText)%
+ -| ([xshift=-0.2cm] inNote.west)%
+ -| (inNote.west);%
+ \end{tikzpicture}%
+ \fi%
+\fi%
+}%
+\fi%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\missingfigure}
+% Defines the |\missingfigure| macro.
+% \begin{macrocode}
+\newcommand{\missingfigure}[1]{
+\addcontentsline{tdo}{todo}{Figure: \protect{#1}}%
+\par
+\noindent
+\begin{tikzpicture}
+\draw[fill=black!40, draw = white, line width=0pt]
+ (-3, -2.5) rectangle +(\textwidth, 4cm);
+\draw (3, 0) node[right, text width=4cm] {#1};
+\draw[red, fill=white, rounded corners = 5pt, line width=10pt]
+ (30:2cm) -- (150:2cm) -- (270:2cm) -- cycle;
+\draw (0, 0.3) node {Missing};
+\draw (0, -0.3) node {figure};
+\end{tikzpicture}
+}% Ending \missingfigure command
+\fi % Ending \ifdisabled
+% \end{macrocode}
+% \end{macro}
+%
+% \Finale
+\endinput
+
diff --git a/Master/texmf-dist/source/latex/todonotes/todonotes.ins b/Master/texmf-dist/source/latex/todonotes/todonotes.ins
new file mode 100644
index 00000000000..e93a714c23e
--- /dev/null
+++ b/Master/texmf-dist/source/latex/todonotes/todonotes.ins
@@ -0,0 +1,56 @@
+%%
+%% Copyright (C) 2008 by Henrik Skov Midtiby <henrikmidtiby@gmail.com>
+%%
+%% This file may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.2 of this license
+%% or (at your option) any later version. The latest version of this
+%% license is in:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.2 or later is part of all distributions of LaTeX version
+%% 1999/12/01 or later.
+%%
+
+\input docstrip.tex
+\keepsilent
+
+\usedir{tex/latex/todonotes}
+
+\preamble
+
+This is a generated file.
+
+Copyright (C) 2008 by Henrik Skov Midtiby <henrikmidtiby@gmail.com>
+
+This file may be distributed and/or modified under the conditions of
+the LaTeX Project Public License, either version 1.2 of this license
+or (at your option) any later version. The latest version of this
+license is in:
+
+ http://www.latex-project.org/lppl.txt
+
+and version 1.2 or later is part of all distributions of LaTeX version
+1999/12/01 or later.
+
+\endpreamble
+
+\generate{\file{todonotes.sty}{\from{todonotes.dtx}{package}}}
+
+\obeyspaces
+\Msg{*************************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* file into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* todonotes.sty *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file todonotes.dtx *}
+\Msg{* through LaTeX. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{*************************************************************}
+
+\endbatchfile
+