Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to use todonotes with amsbook documentclass. I can add a todo (using \todo{fix this}) to part of the text and I can generate a Todo list for the table of contents using \todototoc, but the compilation has some problems.

From looking at the todonotes documentation I have seen that the package has a known conflict with amsart and a fix is supplied in the documentation. The fix doesn't quite work for amsbook and I don't know enough about what it's doing to edit it.

The problems are that whilst compiling the LaTeX I get the warning that \todototoc is an undefined control sequence. Ignoring the warning and continuing the compilation, I see that the \todo I have created is not put on the same page as the heading for the list.

A smallish working example follows.

\documentclass[a4paper,10pt]{amsbook}  

 \usepackage[linktocpage]{hyperref} % for links
 \usepackage{todonotes} 


  \begin{document}

  \title{A sample book in amsbook style}
   \author{me}
   \maketitle

   \tableofcontents
    \todototoc  % put an entry for the list of todos in the  table of contents

    % \listoftodos   This is the usual command for making a list of to dos

   % The following was taken from the todonotes documentation on how to resolve a problem with the amsart class.
   % It doesn't quite work for amsbook as the list entries are put on the page after the "Todo list" heading.

   \makeatletter
   \providecommand\@dotsep{5}
   \makeatother
   \listoftodos\relax


    \chapter{The test chapter}
    Some text\todo{really need some more text!}

    \end{document}   

Does anyone have any ideas? Thanks.

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

The problem is that amsbook defines \@starttoc with two arguments (I don't think it was a wise decision). So you have to redefine \listoftodos to pass correctly what \@starttoc wants:

\documentclass[a4paper,10pt]{amsbook}

\usepackage{todonotes}
\usepackage[linktocpage]{hyperref} % for links

\makeatletter
\providecommand\@dotsep{5}
\renewcommand{\listoftodos}[1][\@todonotes@todolistname]{%
  \@starttoc{tdo}{#1}}
\makeatother

\begin{document}

\title{A sample book in amsbook style}
\author{me}
\maketitle

\tableofcontents

\listoftodos

\chapter{The test chapter}
Some text\todo{really need some more text!}

\end{document}

\todototoc is not needed as amsbook takes care of it.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.