This is specific for classicthesis
. Add the following code to the preamble
\usepackage{xpatch}
\xapptocmd{\Chap}{%
\addtocontents{tdo}{%
\vskip\bigskipamount\noindent\textbf{Chapter \thechapter}\par\nobreak\vskip\medskipamount}}{}{}
If you really need a more complicated approach, printing the line only if there are notes, then here it is:
\usepackage{xpatch}
\xapptocmd{\Chap}{\addtocontents{tdo}{\protect\todoline{\thechapter}}}{}{}
\makeatletter
\newcommand{\todoline}[1]{\@ifnextchar\Endoftdo{}{\@todoline{#1}}}
\newcommand{\@todoline}[1]{%
\@ifnextchar\todoline
{}
{\vskip\bigskipamount\noindent\textbf{Chapter #1}\par\nobreak\vskip\medskipamount}}
\makeatother
\newcommand{\Endoftdo}{}
\AtEndDocument{\addtocontents{tdo}{\string\Endoftdo}}
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:
\documentclass{scrreprt}
\usepackage{classicthesis}
\usepackage{todonotes}
\usepackage{tocloft}
\usepackage{lipsum}
\hypersetup{colorlinks=true,linktocpage=true}
\usepackage{xpatch}
\xapptocmd{\Chap}{\addtocontents{tdo}{\protect\todoline{\thechapter}}}{}{}
\makeatletter
\newcommand{\todoline}[1]{\@ifnextchar\Endoftdo{}{\@todoline{#1}}}
\newcommand{\@todoline}[1]{%
\@ifnextchar\todoline
{}
{\vskip\bigskipamount\noindent\spacedlowsmallcaps{Chapter #1}\par\nobreak\vskip\medskipamount}}
\let\l@todo\l@section
\makeatother
\newcommand{\Endoftdo}{}
\AtEndDocument{\addtocontents{tdo}{\string\Endoftdo}}
\begin{document}
\tableofcontents
\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}
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 following
\usepackage{regexpatch}
\xapptocmd{\Chap}{\addtocontents{tdo}{\protect\todoline{\thechapter}{\spacedlowsmallcaps{#1}}{\thepage}}}{}{}
\makeatletter
\newcommand{\todoline}[1]{\@ifnextchar\Endoftdo{}{\@todoline{#1}}}
\newcommand{\@todoline}[3]{%
\@ifnextchar\todoline
{}
{\contentsline{chapter}{\numberline{#1}#2}{#3}{}{}}%
}
\let\l@todo\l@section
\makeatother
\newcommand{\Endoftdo}{}
\AtEndDocument{\addtocontents{tdo}{\string\Endoftdo}}
It may be possible to make the chapter page number into a link. Be happy with this version. :)
You can patch the \l@section
(and friends) macros - they are responsible for setting the section/subsection titles in the ToC - to \MakeUppercase
the first argument it receives (which includes the number and title):
\documentclass{article}
\usepackage{tocloft,etoolbox}% http://ctan.org/pkg/{tocloft,etoolbox}
\makeatletter
% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\patchcmd{\l@section}{#1}{\MakeUppercase{#1}}{}{}% Sections use UPPERCASE in ToC
\patchcmd{\l@subsection}{#1}{\MakeUppercase{#1}}{}{}% Subsections use UPPERCASE in ToC
\makeatother
\begin{document}
\tableofcontents
\section{Section One}
\subsection{Subsection}
\section{Section Two}
\end{document}
The above patch is suggested based on the construction of \l@section
(and friends) (from tocloft.dtx
):
\renewcommand*{\l@section}[2]{%
\ifnum \c@tocdepth >\z@
% <snip>
{\cftsecfont #1}\nobreak
\cftsecfillnum{#2}}%
\fi}
After the patch, \l@section
resembles
\renewcommand*{\l@section}[2]{%
\ifnum \c@tocdepth >\z@
% <snip>
{\cftsecfont \MakeUppercase{#1}}\nobreak
\cftsecfillnum{#2}}%
\fi}
which forces an UPPERCASE title to be set.
Best Answer
Since the article class has no chapters, the solution is to (a) use a different document class, or (b) use \cftsecfont.