5

There seems to be an issue with todonotes. I've been using \todo{}s that span multiple paragraphs for some time and never noticed any problems. Now I've tried to add a \listoftodos to my document - and failed. Here is a MWE that demonstrates the issue:

\documentclass{article}
\usepackage{todonotes}

\begin{document}
\listoftodos

\section*{Whatever}
Some text\todo{Do this.}

\todo[inline]{Do that.}

A litle more text.

\todo[inline]{%
Oh, and by the way:

Remember the milk.}

\end{document}

The second compilation run fails with

Runaway argument?
{Oh, and by the way: 
! Paragraph ended before \@dottedtocline was complete.
<to be read again> 
                   \par 
l.3 \contentsline {todo}{Oh, and by the way: \par
                                                  Remember the milk.}{1}

Is there some kind of magic that I could apply to todonotes or do I have to reformat all of my todo notes?

2
  • This line generates a \par --Oh, and by the way: ... Remember the milk. Simply remove the double enter will solve the problem.
    – Jesse
    Commented Aug 29, 2013 at 14:26
  • 1
    As mentioned above, he is using multiple paragraphs into his todo-notes. The double enter here is just simulating that case.
    – LaRiFaRi
    Commented Aug 29, 2013 at 15:00

1 Answer 1

7

Would it be OK for you, to add one more option to every note? I think it makes sense, not to print a whole chapter in the Todo List so something like \caption[short for LoF]{long for display} would be a good solution.

Therefore you should use the caption={...} option.

For your MWE this would look like:

% arara: pdflatex
% arara: pdflatex

\documentclass{article}
\usepackage{todonotes}

\begin{document}
\listoftodos    
\section*{Whatever}
Some text\todo{Do this.}

\todo[inline]{Do that.}

A litle more text.

\todo[inline, caption={short for LoTds}]{%
Oh, and by the way:

Remember the milk.}
\end{document}
2
  • Is there a way to automate this - like, having \todo only consider stuff before the first \par?
    – vwegert
    Commented Aug 29, 2013 at 19:19
  • 2
    As the author of the todonotes package I know it quite well. But I'm not aware of a method for automating this. If a decent method exists let me know and it might be added to the package.
    – midtiby
    Commented Sep 3, 2013 at 8:38

You must log in to answer this question.

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