I have modified the LOT and LOF within the amsbook class so that the numbering reads, e.g., "Table 1.1" instead of just "1". My MWE below does this. However, it messes up the alignment of the captions: the first and second lines are not indented the same amount.

My questions are:

  1. How can I align the captions in the LOT and LOF?
  2. How can I also put in dots ... leading to the page numbers? (e.g., \@dottedtocline)

Please note that I must use amsbook, so I cannot use the tocloft package. Thank you for your advice.

\documentclass[12pt, oneside]{amsbook}

% Customize list of tables and list of figures
\usepackage{chngcntr} \counterwithin{figure}{chapter}
\def\l@figure#1#2{\@tocline{0}{3pt plus2pt}{0pt}{3pc}{}{Figure #1}{#2}}  
\def\l@table#1#2{\@tocline{0}{3pt plus2pt}{0pt}{3pc}{}{Table #1}{#2}} 



\caption[Caption in the LOF extends beyond one line, but the second line is not aligned with the first line.]{Long caption...}

  • What is the problem with the tocloft package when using the amsbook class? – user94293 May 19 '16 at 4:51
  • Does tocloft work by adding in the preamble: \makeatletter \renewcommand{\@starttoc}[1]{\begingroup \makeatletter \@input {\jobname .#1}\if@filesw \expandafter \newwrite \csname tf@#1\endcsname \immediate \openout \csname tf@#1\endcsname \jobname .#1\relax \fi \@nobreakfalse \endgroup} \makeatother – user94293 May 19 '16 at 5:10
  • Crosspost – Johannes_B May 19 '16 at 5:36
  • @user94293 -- tocloft was developed to adapt the "standard" latex toc conventions for a particular purpose. other document classes use different conventions for the toc and related lists; the koma and ams classes are examples of classes using different conventions. tocloft incorporates code to deal with the differences in the koma classes, but there is no evidence that similar checks have been made for the ams classes. so basically, any existing incompatibilities are not known. if an ams author tries to use it and has problems, no support will be offered. – barbara beeton May 19 '16 at 15:03
  • @user94293 -- i have just made a test with amsbook plus tocloft. it fails ignominiously with ! Missing } inserted. at the first encounter with actual text after \begin{document}. i am not inclined to try to figure out why. – barbara beeton May 19 '16 at 15:58

here is an example that should give the results you want with amsbook.


% Leader dots in toc
%\renewcommand\@pnumwidth{1em} % <-- depending on total number of pages
% Insert "Figure" or "Table" in "list of" entries
\def\numberline#1{\hb@xt@\@tempdima{\numberprefix #1\hfil}}
\def\l@figure#1#2{\@tocline{0}{3pt plus2pt}{0pt}{5pc}{}%
\def\l@table#1#2{\@tocline{0}{3pt plus2pt}{0pt}{5pc}{}%




For TeX.sx question \#310359.

some text

some figure stuff
\caption{Test figure.  Make this a very long caption so that it will
  be forced to a second line in the list of figures, to check

\caption{Test table}
some table stuff

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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