summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/easy-todo
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-01-15 00:30:42 +0000
committerKarl Berry <karl@freefriends.org>2014-01-15 00:30:42 +0000
commita4268e90f9d9013767d4aee201908389ccc22120 (patch)
treefc8a3a3778acea955d07f0c25617cf920c876c0f /Master/texmf-dist/tex/latex/easy-todo
parent6c1d55d86cd79dc40f66222e8dcb23a12ae00200 (diff)
easy-todo (14jan14)
git-svn-id: svn://tug.org/texlive/trunk@32677 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/easy-todo')
-rw-r--r--Master/texmf-dist/tex/latex/easy-todo/easy-todo.sty30
1 files changed, 18 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/easy-todo/easy-todo.sty b/Master/texmf-dist/tex/latex/easy-todo/easy-todo.sty
index a4bbeec7d4f..359475fe23c 100644
--- a/Master/texmf-dist/tex/latex/easy-todo/easy-todo.sty
+++ b/Master/texmf-dist/tex/latex/easy-todo/easy-todo.sty
@@ -1,25 +1,27 @@
% Created by Juan Rada-Vilela
+% jcrada@fuzzylite.com
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{easy-todo}[2013/11/15]
+\ProvidesPackage{easy-todo}[2014/01/01]
-\def\@todoindexas{chapter}
+\def\@todoindexas{section}
\newcommand{\todoindexas}[1]{\def\@todoindexas{#1}}
\def\@todoenable{true}
\newcommand{\todoenable}[1]{\def\@todoenable{#1}}
+\def\@todoobeyfinal{false}
+\newcommand{\todoobeyfinal}[1]{\def\@todoobeyfinal{#1}}
\DeclareOption{chapter}{\todoindexas{chapter}}
\DeclareOption{section}{\todoindexas{section}}
-\DeclareOption{final}{\todoenable{false}}
-\DeclareOption{enabled}{\todoenable{true}}
+\DeclareOption{obeyFinal}{\todoobeyfinal{true}}
\DeclareOption{enable}{\todoenable{true}}
-\DeclareOption{disabled}{\todoenable{false}}
\DeclareOption{disable}{\todoenable{false}}
+
\DeclareOption*{%
- \PackageError{easy-todo}{What is \CurrentOption ?}{Options available: final, enable(d), disable(d), chapter, section}%
+ \PackageError{easy-todo}{What is \CurrentOption ?}{Options available: enable, disable, obeyFinal, chapter, section}%
\todoindexas{chapter}
}
@@ -27,7 +29,8 @@
\RequirePackage{color} %to add colour
\RequirePackage{tocloft} %to create index
-\RequirePackage{ifthen}
+\RequirePackage{ifthen} %to ifthenelse conditions
+\RequirePackage{ifdraft} %to detect draft/final options
\newcommand{\todoindextitle}{ToDo}
\newcommand{\todoindexpagetitle}{P.}
@@ -62,25 +65,28 @@
%Description: Creates a todo note with the number and information
%Parameter: TODO note
\newcommand{\todo}[1]{%
-\todoii{#1}{#1}%
+\todoii{#1}{#1}\unskip%
}
%Command: todoi
%Description: Creates a todo note with just a number
%Parameters: [1] the information to show at the list
-\newcommand{\todoi}[1]{
-\todoii{}{#1}
+\newcommand{\todoi}[1]{%
+\todoii{}{#1}\unskip%
}
%Command: todoii
%Description: Creates a todo note
%Parameters: [1] the note to show, [2] the information to show at the list
-\newcommand{\todoii}[2]{
+\newcommand{\todoii}[2]{%
+\ifthenelse{\equal{\@todoobeyfinal}{true}}{%
+ \ifoptionfinal{\todoenable{false}}{\todoenable{true}}%
+}{}%
\ifthenelse{\equal{\@todoenable}{true}}{%
\refstepcounter{todos}%
\noindent{\todocolor\normalfont\scriptsize{\bfseries{\thetodos.#1}}}%
\addcontentsline{lod}{todos}{\protect{\thetodos. }#2}%
-}{}
+}{}%
}