1

I'm using a longtable for the nomenclature produced by the nomencl package. Here, the longtable serves as a tabluar replacement. Unfortunately, the usage confuses the totalcount package resulting in an uncorrect table count.

MWE:

\documentclass{report}
\usepackage{longtable}
\usepackage[figure,table]{totalcount}

\begin{document}
\verb|\totaltables| is \totaltables, but should be 2.

\begin{table}One\caption{Table One}\end{table} % ONE
\begin{table}Two\caption{Table Two}\end{table} % TWO

\begin{longtable}{cc}
Long & Bla
\end{longtable}

\end{document}

Result:

enter image description here

quinmars
  • 5,477

1 Answers1

2

longtable increments the table counter and then arranges that \caption does not increment it. (So not like table which relies on \caption to increment the counter.)

This simplifies some aspects of having multiple captions for continued page heads in longtable, but it's not that brilliant a design really.

Since you know you haven't used \caption in this longtable you can set the counter back one to make up for longtable having incremented it:

\documentclass{report}
\usepackage{longtable}
\usepackage[figure,table]{totalcount}

\begin{document}
\verb|\totaltables| is \totaltables, but should be 2.

\begin{table}One\caption{Table One}\end{table} % ONE
\begin{table}Two\caption{Table Two}\end{table} % TWO

\begin{longtable}{cc}
Long & Bla
\end{longtable}
\addtocounter{table}{-1}

\end{document}
David Carlisle
  • 757,742