todonotes
todonotes copied to clipboard
[RFE] a todo list organized by chapter/section could be useful
(but I don't know the implementation complexity)
I agree !
I found an easy workaround simply by putting \thesection command in a wrapper like so :
\newcommand{\todome}[1]{\todo[color=SpringGreen]{$\bullet$ \thesection: #1}}
You might want to do something like this.
\documentclass{article}
\usepackage{todonotes}
\usepackage{xparse}
\makeatletter
\let\original@section=\section
\RenewDocumentCommand\section{s O{} m}{%
\IfBooleanTF{#1}{%
\original@section*{#3}%
}{%
\original@section{#3}%
\addcontentsline{tdo}{section}{\thesection{} #3}
}
}
\makeatother
\begin{document}
\section{A}
\todo{First todo}
\section{C}
\section{B}
\todo{Second todo}
\vfill
\listoftodos
\end{document}
I tried to use the latex hook mechanism, as shown below, but it repeated the section entries in the listoftodos.
\makeatletter
\AddToHook{cmd/section/before}{\addcontentsline{tdo}{section}{section}}
\makeatother