From 7756c5526f4c3c970871a3623583bfbdd9ee2c36 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 14 Jan 2011 00:19:45 +0000 Subject: new latex package easy-todo 1.0 (14jan11) git-svn-id: svn://tug.org/texlive/trunk@21056 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/easy-todo/easy-todo.sty | 69 ++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/easy-todo/easy-todo.sty (limited to 'Master/texmf-dist/tex/latex/easy-todo') diff --git a/Master/texmf-dist/tex/latex/easy-todo/easy-todo.sty b/Master/texmf-dist/tex/latex/easy-todo/easy-todo.sty new file mode 100644 index 00000000000..ea07fbd0fe6 --- /dev/null +++ b/Master/texmf-dist/tex/latex/easy-todo/easy-todo.sty @@ -0,0 +1,69 @@ +% Created by Juan Rada-Vilela + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{easy-todo}[2011/01/01] + +\def\@todoindexas{chapter} +\newcommand{\todoindexas}[1]{\def\@todoindexas{#1}} + +\def\@todoenable{true} +\newcommand{\todoenable}[1]{\def\@todoenable{#1}} + + +\DeclareOption{chapter}{\todoindexas{chapter}} +\DeclareOption{section}{\todoindexas{section}} +\DeclareOption{final}{\todoenable{false}} +\DeclareOption{enabled}{\todoenable{true}} +\DeclareOption{disabled}{\todoenable{false}} +\DeclareOption*{% + \PackageError{easy-todo}{What is \CurrentOption ?}{Options available: final, enabled, disabled, chapter, section}% + \todoindexas{chapter} +} + +\ProcessOptions + +% \RequirePackage[colorlinks]{hyperref} %Para hipervínculos en el documento (ver \iniciar) +\RequirePackage{color} %Para poner color en notas y pendientes +\RequirePackage{tocloft} %Para configurar índice general, de figuras y cuadros +\RequirePackage{ifthen} + +\newcommand{\todoindextitle}{ToDo} +\newcommand{\todoindexpagetitle}{P.} +\newcommand{\todocolor}{\color{red}} + +%Índice de Pendientes +\newcommand{\listoftodosname}{\todoindextitle} +\newlistof[part]{todos}{lod}{\listoftodosname} + +%Comando: listoftodos +%Descripción: Crea el índice de pendientes. +\renewcommand{\listoftodos}{ + { + \ifthenelse{\equal{\@todoenable}{true}} + { + \todocolor + \ifthenelse{\equal{\@todoindexas}{chapter}} + {\chapter*{\todoindextitle}} + { + \ifthenelse{\equal{\@todoindexas}{section}} + {\centering\section*{\todoindextitle}} + {\PackageError{easy-todo}{Index as \@todoindexas NOT valid}{Choose between chapter or section}} + } + \flushright{\textbf{\todoindexpagetitle}} + \@starttoc{lod}} + \newpage + } + {} +} + +\renewcommand{\thetodos}{\@arabic\c@todos} +%Comando: pendiente +%Descripción: Agrega una anotación al índice de pendientes y la muestra en el lugar donde fue agregada. Para mostrar los pendientes, ejecutar antes de \configurar \habilitarpendientes +%Parámetros: [1] Texto del pendiente (e.g. Mejorar redacción) +\newcommand{\todo}[1]{ + \ifthenelse{\equal{\@todoenable}{true}}{ + \refstepcounter{todos} + \noindent{\todocolor\normalfont\scriptsize{\bfseries{\thetodos. }#1}} + \addcontentsline{lod}{todos}{\protect{\thetodos. }#1} + }{} +} -- cgit v1.2.3