7

The following (not quite) MWE

\documentclass{acmart}
\usepackage{todonotes}
\begin{document}
\title{ACM Class and the todonotes package}
\author{Author}
\maketitle
\todo{A todo.}
\listoftodos
\end{document}

yields the following error:

! Missing \endcsname inserted.
<to be read again> 
                   \@@par 
l.9 \end
        {document}

while the following code

\documentclass{acmart}
\usepackage{todonotes}
\begin{document}
\title{ACM Class and the todonotes package}
\author{Author}
\maketitle
\todo{A todo.}
\listoftodos\\
\end{document}

compiles nicely (using TeX Live 2017).

With the article class I don't have to add a line break \\ or, more generally, a {} after \listoftodos as a workaround. It seems there is an incompatibility? Can this be seen as a bug in either the acmart class or the todonotes package? Thank you!

1 Answer 1

5

enter image description here

acmart somewhat bravely redefines the internal \@starttoc command to take two arguments rather than one, the second one being some kind of subheading in the list. You can put that text (or just {}) after \listof...

\documentclass{acmart}
\usepackage{todonotes}
\begin{document}
\title{ACM Class and the todonotes package}
\author{Author}
\maketitle
\todo{A todo.}


\listoftodos{list of todos}

\end{document}
6
  • Reminds me of amsart
    – egreg
    Jan 14, 2019 at 22:14
  • @egreg so it is, the code is almost identical. Jan 14, 2019 at 22:15
  • @davidcarlisle and egreg It turns out that listoftodos is not working at all (and without error!) in my second MWE.
    – mfg
    Jan 16, 2019 at 10:57
  • @Mario I don't have llncs and that edit seems to be a completely different question and should be asked as a new question, unless llncs uses the same definition of \@starttoc in which case your llncs example should be \listoftodos{} not \\listoftodos. Jan 16, 2019 at 11:02
  • 1
    @Mario oh that egreg bloke and the answer worked? amazing:-) Jan 16, 2019 at 16:37

You must log in to answer this question.

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