LaTeX forum ⇒ Document Classesamsbook and listoftheorems (thmtools)

Information and discussion about specific document classes and how to create your own document classes.
Posts: 1
Joined: Thu Nov 11, 2010 2:33 pm

amsbook and listoftheorems (thmtools)

Postby tsx » Thu Nov 11, 2010 2:59 pm


I'm having difficulties creating a list of theorems via thmtools when using amsbook as documentclass. The code looks as follows:
  1. \documentclass{amsbook}
  3. \usepackage{amsthm}
  4. \usepackage{thmtools}
  6. \declaretheorem{theorem}
  8. \begin{document}
  9. \begin{theorem}[Theorem A]This is a theorem.\end{theorem}
  11. \listoftheorems
  12. \end{document}

Running the code results in the following error message:
  1. ! Undefined control sequence.
  2. \@dottedtocline ... \hbox {$\m@th \mkern \@dotsep
  3. mu\hbox {.}\mkern \@dotsep...
  4. l.2 ... {t}heorem\thmtformatoptarg {Theorem A}}{1}

It seems to be related to the integration of amsthm into amsbook. If I remove amsthm from the list of packages, the same error message occurs (obviously). Yet, by changing the documentclass to any other (e.g. scrreprt) and using the amsthm package, the list of theorems works perfectly. How can I use amsbook in combination with thmtools?

Thanks in advance for any help given


Posts: 1
Joined: Fri Sep 16, 2016 11:56 am

Postby natema » Fri Sep 16, 2016 11:58 am

I had the same issue and posted a question here:

User avatar
Stefan Kottwitz
Site Admin
Posts: 8735
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany

Postby Stefan Kottwitz » Fri Sep 16, 2016 3:06 pm

Hi natema,

welcome to the forum!
That question here was posted before TeX StackExchange was opened. :-) Our forum has a long history, back to 2007.

So, a good occasion to answer it! I would do it differently to the suggestions at StackExchange.
  • defining the undefined \@dotsep would remove the error, yes, but the lists would be inconsistent: the list of theorems would have dots, list of tables and figures would not have dots.
  • copying and editing the corresponding internal macros takes time and space (53 lines there), and can lead to an error if thmstools would be changed.
So, instead of patching, we could (re)define \@dottedtocline to behave like ams book's \@tocline, that is, to call that one. We won't have dotted toc lines anyway.

Simple solution, 1 line plus the usual \makeatletter/other:

  1. \makeatletter
  2. \def\@dottedtocline#1#2#3#4#5{\@tocline{#1}{0pt}{#2}{#3}{}{#4}{#5}}
  3. \makeatother

Complete code:

  1. \documentclass{amsbook}
  2. \usepackage[english]{babel}
  3. \usepackage{thmtools}
  4. \declaretheorem{theorem}
  5. \makeatletter
  6. \def\@dottedtocline#1#2#3#4#5{% redefined for consistency
  7. \@tocline{#1}{0pt}{#2}{#3}{}{#4}{#5}}
  8. \makeatother
  9. \begin{document}
  10. \listoftables
  11. \listoftheorems
  12. \begin{theorem}
  13. This is my favorite theorem.
  14. \end{theorem}
  15. \begin{table}
  16. \caption{This is my favorite table}
  17. \end{table}
  18. \end{document}

Site admin

Return to “Document Classes”

Who is online

Users browsing this forum: No registered users and 4 guests