| 1 |
\documentclass{book} |
| 2 |
|
| 3 |
\usepackage{todonotes} |
| 4 |
\usepackage{lipsum} |
| 5 |
\makeatletter |
| 6 |
\def\myaddcontentsline#1#2#3{% |
| 7 |
\addtocontents{#1}{\protect\contentsline{#2}{#3}{see \thesection\ at p. \thepage}{}}} |
| 8 |
\renewcommand{\@todonotes@addElementToListOfTodos}{% |
| 9 |
\if@todonotes@colorinlistoftodos% |
| 10 |
\myaddcontentsline{tdo}{todo}{{% |
| 11 |
\colorbox{\@todonotes@currentbackgroundcolor}% |
| 12 |
{\textcolor{\@todonotes@currentbackgroundcolor}{o}}% |
| 13 |
\ \@todonotes@caption}}% |
| 14 |
\else% |
| 15 |
\myaddcontentsline{tdo}{todo}{{\@todonotes@caption}}% |
| 16 |
\fi}% |
| 17 |
\newcommand*\mylistoftodos{% |
| 18 |
\begingroup |
| 19 |
\setbox\@tempboxa\hbox{see 9.9 at p. 99}% |
| 20 |
\renewcommand*\@tocrmarg{\the\wd\@tempboxa}% |
| 21 |
\renewcommand*\@pnumwidth{\the\wd\@tempboxa}% |
| 22 |
\listoftodos% |
| 23 |
\endgroup |
| 24 |
} |
| 25 |
\makeatother |
| 26 |
|
| 27 |
\begin{document} |
| 28 |
\chapter{My first chapter} |
| 29 |
\section{A first section} |
| 30 |
\lipsum |
| 31 |
\todo{This is a note} |
| 32 |
\section{Another section} |
| 33 |
\lipsum |
| 34 |
\todo{This is another note} |
| 35 |
|
| 36 |
\tableofcontents |
| 37 |
\mylistoftodos |
| 38 |
\end{document} |