3

with the minimal sample code

\documentclass{article}
\usepackage{hyperref}
\usepackage{easy-todo}

\begin{document}

\tableofcontents
\listoftodos

\section{one}
\todo{note1}

\section{two}
\todo{note2}
\end{document}

I get the following output

output of the sample code

I would like to see one item in the tableofcontents, so that I can click on the item to jump to the "TODO" section. The default value when you wrote the command \listoftodos is that it add a section. See: Pack­age doc­u­men­ta­tion, I want to let the "TODO" section be an unnumbered section, much similar to \section*{TODO}

Another issue is that if I could change the name "TODO" to some other words like "MY TODO lIST"

1 Answer 1

3
  1. You can use

    \phantomsection
    \addcontentsline{toc}{section}{\todoindextitle}
    \listoftodos
    

to add the entry in the ToC. I used \todoindextitle in the last argument so the entry and the name of the list will be equal but, of course, you can use any other string for the ToC entry.

  1. To redefine the name of the ToDos list, you can use

    \renewcommand\todoindextitle{My List of ToDos}
    
  2. By default (if no options are given), the List is typeset as

    \centering\section*{\todoindextitle}
    

    so it's not numbered, as you want it to be. If you don't want the title to be centered, the easiest way is to patch \listoftodos to remove the \centering:

    \usepackage{etoolbox}
    \patchcmd{\listoftodos}
      {\centering}
      {}
      {}
      {}
    

A complete example:

\documentclass{article}
\usepackage{hyperref}
\usepackage{easy-todo}

\renewcommand\todoindextitle{My List of ToDos}

\begin{document}
\tableofcontents

\phantomsection
\addcontentsline{toc}{section}{\todoindextitle}
\listoftodos

\section{one}
\todo{note1}

\section{two}
\todo{note2}
\end{document}

enter image description here

1
  • You even told me how to make the section title left aligned by using the \patchcmd command, thanks.
    – ollydbg23
    Sep 27, 2015 at 4:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .