I use the todonotes
package extensively to mark and comment my projects. So, for a large project, I have dozens of todo-notes and the list of todos, which I insert at the beginning of a document, get's very cluttered.
I'm looking for a way to group the list of todos by chapter, so essentially something like:
List of Todos
Chapter 1
Chapter 1 note ... 2
Chapter 1, section 1 note ... 2
Chapter 1, section 2 note ... 3
Chapter 2
Chapter 2, section 1 note ... 4
Chapter 2, section 2 note ... 4
The following MWE gives a starting point for modification:
\documentclass{scrreprt}
\usepackage{todonotes}
% \usepackage{classicthesis}
\usepackage{tocloft}
\usepackage{lipsum}
\usepackage[colorlinks=true,linktocpage=true]{hyperref}
\begin{document}
\listoftodos
\chapter{My first chapter}
\lipsum[1]
\todo{Chapter 1 note}
\section{A first section}
\lipsum[1]
\todo{Chapter 1, section 1 note}
\section{Another section}
\lipsum[1]
\todo{Chapter 1, section 2 note}
\chapter{My second chapter}
\section{A first section}
\lipsum[1]
\todo{Chapter 2, section 1 note}
\section{Another section}
\lipsum[1]
\todo{Chapter 2, section 2 note}
\end{document}
This post tries something similar, but just adds the section next to the page number, which would not remove the clutter I have.
I'm using the classicthesis
template which uses titlesec
for tableofcontents appearance, in case it matters. A second point would be to remove the "dots" in the list of todos. I believe todonotes
formats the appearance with this command:
\newcommand{\l@todo}
{\@dottedtocline{1}{0em}{2.3em}}
but I don't know how to modify it to remove the dots and show page numbers at the end of each TOC entry.
Best Answer
This is specific for
classicthesis
. Add the following code to the preambleIf you really need a more complicated approach, printing the line only if there are notes, then here it is:
But why doing something so complicated when the Todo List is only for working copies?
Here is a complete example, where the todo notes in the Todo List are typeset in the same way as sections in the table of contents:
In case you want the chapter title in the Todo List, a slightly different approach should be used. Change the code from
\usepackage{xpatch}
up to the\AtEndDocument
line with the followingIt may be possible to make the chapter page number into a link. Be happy with this version. :)