todonotes & amsart

338 views
Skip to first unread message

Joris

unread,
Jan 12, 2009, 4:29:46 PM1/12/09
to
Hello,

\listoftodos of the otherwise wonderful todonotes package doesn't work
with the amsart document class; it fails with error "Paragraph ended
before \@starttoc was complete." This always happens, even if one
changes the document class of the example document
todonotesexample.tex to amsart. Any quick work arounds (while keeping
the amsart document class)?

Thanks,

J.

Lars Madsen

unread,
Jan 12, 2009, 4:43:34 PM1/12/09
to

amsart apparently uses a non standard toc syntax, todonotes use the
internal \@startytoc to typeset the list of todos, but amsart redefines
this and expect the contents to be in a special format.

Best bet is to contact the author of todonotes and have him write a
workaround.

/daleif

Joris

unread,
Jan 12, 2009, 6:53:58 PM1/12/09
to
Thanks for the explanation Lars; have done that. Will post the answer
if helpful. Best, J.

Dan Luecking

unread,
Jan 13, 2009, 12:42:01 PM1/13/09
to
On Mon, 12 Jan 2009 22:43:34 +0100, Lars Madsen <dal...@imf.au.dk>
wrote:

>Joris wrote:
>> Hello,
>>
>> \listoftodos of the otherwise wonderful todonotes package doesn't work
>> with the amsart document class; it fails with error "Paragraph ended
>> before \@starttoc was complete." This always happens, even if one
>> changes the document class of the example document
>> todonotesexample.tex to amsart. Any quick work arounds (while keeping
>> the amsart document class)?
>>
>> Thanks,
>>
>> J.
>
>amsart apparently uses a non standard toc syntax, todonotes use the
>internal \@startytoc to typeset the list of todos, but amsart redefines
>this and expect the contents to be in a special format.

The amsart version of \@starttoc takes a second
argument. I haven't worked out exactly what it
ought to, but writing
\listoftodos\relax
provides it with \relax as that argument.
Unfortunately, another problem occurs later: amsart
doesn't use \addcontentsline and so doesn't define one
of its necessary values, \@dotsep. Putting
\makeatletter
\providecommand\@dotsep{5}
\makeatother
\listoftodos\relax

Allows the compilation of the example file to proceed
to completion. I don't know if anything else would break
in a more complete document.

The value of \@dotsep is used in front of the
dimension mu (math units, typically about 1/18em, or
about .56pt in a 10pt) so 5mu (about 2.8pt) is a
reaasonable default. However, it might not match what
amsart uses in other \listof's. That's not terribly
important, as one would not usually keep the list of
todos in the final document.

This problem with \@dotsep occurs from time to time: some
package employs \addcontentsline (which is defined in the
LaTeX kernel) but is then used with a class (amsart) that
doesn't define \@dotsep or a class that defines \@dotsep,
but in an incompatible way (revtex4). (I have not tested
todomotes with revtex4 at all. Someone who uses it
should do that.)

Until latex provides a default definition of \@dotsep,
package writers need to be wary of using \addcontentsline.


Dan
To reply by email, change LookInSig to luecking

Robin Fairbairns

unread,
Jan 13, 2009, 3:25:13 PM1/13/09
to
Dan Luecking <Look...@uark.edu> writes:
>On Mon, 12 Jan 2009 22:43:34 +0100, Lars Madsen <dal...@imf.au.dk>
>wrote:
>>Joris wrote:
>>> \listoftodos of the otherwise wonderful todonotes package doesn't work
>>> with the amsart document class; it fails with error "Paragraph ended
>>> before \@starttoc was complete." This always happens, even if one
>>> changes the document class of the example document
>>> todonotesexample.tex to amsart. Any quick work arounds (while keeping
>>> the amsart document class)?
>>
>>amsart apparently uses a non standard toc syntax, todonotes use the
>>internal \@startytoc to typeset the list of todos, but amsart redefines
>>this and expect the contents to be in a special format.

this is the second problem with amsart's toc mechanisms, in a couple
of days (i'm dealing with one which i think appeared here earlier,
about the parskip package).

>The amsart version of \@starttoc takes a second
>argument. I haven't worked out exactly what it
>ought to, but writing
> \listoftodos\relax
>provides it with \relax as that argument.

and so on. perhaps there's scope for a "make amsart[*] look like
latex" package?

(i've never used it for my own work, but people seem to like it...)

[*] actually, the article, report and book classes are much of a
muchness, like the standard latex ones. though the table of contents
stuff is different for books, which keeps us on our toes...
--
Robin Fairbairns, Cambridge

Dan Luecking

unread,
Jan 13, 2009, 3:48:13 PM1/13/09
to
On Tue, 13 Jan 2009 11:42:01 -0600, Dan Luecking <Look...@uark.edu>
wrote:

>On Mon, 12 Jan 2009 22:43:34 +0100, Lars Madsen <dal...@imf.au.dk>
>wrote:
>
>>Joris wrote:
>>> Hello,
>>>
>>> \listoftodos of the otherwise wonderful todonotes package doesn't work
>>> with the amsart document class; it fails with error "Paragraph ended
>>> before \@starttoc was complete." This always happens, even if one
>>> changes the document class of the example document
>>> todonotesexample.tex to amsart. Any quick work arounds (while keeping
>>> the amsart document class)?
>>>
>>> Thanks,
>>>
>>> J.
>>
>>amsart apparently uses a non standard toc syntax, todonotes use the
>>internal \@startytoc to typeset the list of todos, but amsart redefines
>>this and expect the contents to be in a special format.
>
>The amsart version of \@starttoc takes a second
>argument. I haven't worked out exactly what it
>ought to, but writing
> \listoftodos\relax
>provides it with \relax as that argument.

The amsart class uses the second argument for
\contentsname (or the equivalent). For example,
\tableofcontents is defined via
\@starttoc{toc}{\contentsname}
which ultimately does
\section*{\contentsname}
Putting an empty argument there (or \relax)
makes an empty \section*{}, but
\listoftodos provides its own
\section*{\@todonotes@todolistname}
so the result is reasonable.

However this led me to discover another problem with
todonotes: There is no user level method to change
the title heading of the list of todos. \todolistname
is not used, only the above internal command. (I would
prefer "List of things to do" instead of "Todo list".)

Checking to be sure I had the latest version, I discovered
a problem with TeX Live 2008: the package (todonotes.sty)
and the source (todonotes.dtx) do not match. The former
is version 2008/12/27 while the latter is 2009/01/04.
(The most recent is 2009/01/09, so I expect this will
get sorted out in the normal course of events.)

Joris

unread,
Jan 13, 2009, 5:11:25 PM1/13/09
to
Thank you all for your comments. Dan, your suggestion works fine.
Thank you very much! Best, J.

On Jan 13, 3:48 pm, Dan Luecking <LookIn...@uark.edu> wrote:
> On Tue, 13 Jan 2009 11:42:01 -0600, Dan Luecking <LookIn...@uark.edu>

Reply all
Reply to author
Forward
0 new messages