% 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} }{} }