I wanted to add the \listoffigures and \listoftables to my table of contents. I found this post where a user shared his/her code to add the \listoffigures. I implemented it and it worked as intendend. I then proceeded to replace "figure" with "table" to hopefully get the same result but for the list of tables. Even though the ToC looked as intended, the actual list of tables at the end of my document was empty. Now I am here writing this post.

This is the code that I copy+pasted to successfully add the listoffigures to my ToC:

\newcommand{\insertfigure}{\begin{figure}\caption{A figure caption}\end{figure}}
    \section{\listfigurename}% Used to be \section*{\listfigurename}

The following is my modified code (figure->table) that I had hoped would work for the list of tables, but as outlined above, doesn't:

\newcommand{\inserttable}{\begin{table}\caption{A table caption}\end{table}}
    \section{\listtablename}% Used to be \section*{\listfigurename}

This is the result I would like, but the actual list of tables should also appear at the end of my document:

enter image description here


  • B. Appendix 2
  • B.1. List of figures
  • B.2. List of tables

Any suggestions?

  • You must use \@starttoc{lot} (lot is for list of tables) instead of \@starttoc{lof} (lof is list of figures). Nov 15, 2021 at 14:10
  • Wonderful, it works now. Much thanks!
    – elliot_mmm
    Nov 15, 2021 at 14:19
  • In the answer you link to, \insertfigure is simply used to make sure there's something to put in the list of figures in the first place. You wouldn't want that in your actual document, so you don't need that command.
    – Teepeemm
    Nov 15, 2021 at 14:55

1 Answer 1


You must use \@starttoc{lot} (lot is list of tables) instead of \@starttoc{lof} (lof is list of figures).

You must log in to answer this question.

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