I'm trying to create the list of figures and list of tables necessary for my thesis. Unfortunately both refuse to work. I can compile the latex first time, which inserts an empty List of Figures. But upon second compilation, that list refuses to populate and the document will not compile.

The error I get is the following:

/Thesis.lot.4:Undefined control sequence.
\l@table #1#2->\ifnum \c@lotdepth

See below for an image of the output.

Error output

This error persists for every single table within the thesis, so I think this is a general issue, not a local problem.

The table code looks like this:

\textbf{Country of Residence} & \textbf{Number of Participants} \\ \midrule
United Kingdom                & 94                              \\ 
\caption{Countries of residence...}

I'm aware the error message and table code I have posted may not be enough, but I am genuinely stumped as to where this error might be coming from. A similar message appears when I attempt the list of figures. If you would like to see any more code then please do let me know.

I could not seem to see this issue elsewhere (without it being fixed by a simple TrashAux, something which will not work in this situation).

Thanks very much for any help.


Document class is

  • floats like figures and tables are defined (or not) by the document class. You've given no indication which class you are using so it is hard to help. – David Carlisle Sep 16 '14 at 13:49
  • Great, thanks for pointing that out. Have added to the post now. It's \documentclass[a4paper,twoside]{report} – SarahW Sep 16 '14 at 13:53
  • every question should really have a complete small document from \documentclass to \end{document} that demonstrates the problem. It looks like your aux file is using tocloft package which hasn't been loaded, or used incorrectly or... – David Carlisle Sep 16 '14 at 14:08
  • @SarahW: Please click on the link to see what is meant by a minimal working example (MWE). – Werner Sep 16 '14 at 14:11
  • have you tried simply deleting the .lot file? – David Carlisle Sep 16 '14 at 17:11

Very likely you are using package tocloft with option subfigure. In this case tocloft assumes you have loaded package subfigure (or its successor subfig), which would have defined counter lotdepth (and lofdepth). But the latter package is not loaded apparently, thus the counter is not defined and you see the error message because of its usage.

Either remove option subfigure from tocloft:


Then the counters are defined by package tocloft. Or load subfig, e.g.:

  • Thank you very much for your help. This has solved this issue. – SarahW Sep 16 '14 at 17:50

\documentclass[14pt]{article} \begin{document} \begin{table}[h] \begin{center} \begin{tabular}{l|l}\hline \textbf{Country of Residence} & \textbf{Number of Participants} \\hline United Kingdom & 94 \ \hline

\end{tabular} \caption{Countries of residence...} \label{tab:Residence} \end{center} \end{table}

\end{document} % I have made it simple. No need to add midrule and bottomrule. Just \hline will do

  • 1
    Please explain how removing the horizontal lines from booktabs in the table solves the problem that was related to options of the tocloft package? – leandriis Apr 16 '20 at 6:13

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.