0

I have a long document with many tables. I was checking the list of tables and observed that the tables were incorrectly numbered, i.e.

Table 3.7 and the next table was Table 3.9. I looked for any table between those but I didn't find nothing. Anyone knows why?. all the tables has caption and are in the table environment.

I'm not using a MWE because is too long

EDIT:

I reproduced the error

There is the basic structure of my text with every package that I use (maybe some package is the problem)

As you can see, there is only one table, but it's starting its numeration in 4.2 instead 4.1, the numbering in the previous section was good

\documentclass[12pt,a4paper]{article}
\usepackage{blindtext}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{xfrac}
\usepackage{textcomp}
\usepackage[bitstream-charter]{mathdesign}
\usepackage{makeidx}
\usepackage{graphicx,graphics}
\usepackage{bookmark}
\usepackage[%
    left=3.00cm,
    right=2.00cm,
    top=3.00cm,
    bottom=2.00cm
]{geometry}
\usepackage[none]{hyphenat}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{pdflscape}
\usepackage{tabularx}
\usepackage{subcaption}
\usepackage{tocloft}
\usepackage[parfill]{parskip}
\usepackage{icomma}
\usepackage[%
    inline,     
    shortlabels     
]{enumitem}
\usepackage{bigstrut}
\usepackage{booktabs}
\usepackage{afterpage}
\usepackage{rotating}
\usepackage{microtype}
\usepackage{tabto}
\usepackage{acro}
\usepackage[%
    font=footnotesize,
    justification=centering,
    figurewithin=section,
    tablewithin=section
]{caption}
\usepackage{setspace}
\usepackage{siunitx}
\usepackage{sectsty}
\usepackage{secdot}
\usepackage{mfirstuc}
\usepackage[export]{adjustbox}
\usepackage{array}
\usepackage{colortbl}
\usepackage{makecell}
\usepackage{ltablex}
\usepackage{threeparttable}
\usepackage[referable]{threeparttablex}
\usepackage{pdfpages}
\usepackage{chemformula}
\usepackage[%
backend=biber,
citestyle=authoryear-comp,  
bibstyle=authoryear,        
giveninits=true,        
maxcitenames=2,         
uniquelist=false,           
sorting=ynt,            
sortcites,              
maxbibnames=99,         
url=false,              
eprint=false,           
dashed=false,           
]{biblatex}
\usepackage{hyperref}
\usepackage[%
noabbrev,
nameinlink
]{cleveref} 
\keepXColumns
\sloppy


\partfont{\centering}
\sectionfont{\raggedright\large\MakeUppercase}
\subsectionfont{\raggedright\normalsize\MakeUppercase}
\subsubsectionfont{\raggedright}
\paragraphfont{\raggedright\normalfont\em}
\setlength{\intextsep}{1.5\baselineskip}

\sectiondot{section}
\sectiondot{subsection}
\sectiondot{subsubsection}
\sectiondot{paragraph}

\setchemformula{radical-space = {0.4em}}

\linespread{1.3}


\assignrefcontextentries[]{*}



%%%%%%%%%%
\begin{document}
\listoftables
\section{Sec 1}%
\acresetall
%
\blindtext
%
\section{Sec 2}%
%
\blindtext
%
\section{Sec 3}%
\blindtext
\begin{table}[htb]
    \footnotesize
    \centering
    \caption{Table 3.1}
    \begin{tabular}{lccc}
        \midrule
        A & B & C & D\\
        \midrule
    \end{tabular}
    \label{tab:3.1}
\end{table}%
%
\section{Sec 4: Atention}%
\acresetall
%
\begin{figure}[htb]
\footnotesize
\centering
\includegraphics[width=0.5\textwidth]{example-image-a}
\begin{tabularx}{\linewidth}{rX}
\textbf{Item 1}     & Description \\
\textbf{Item 2}     & Long description \blindtext
\end{tabularx}
\caption{First figure}
\label{fig:1}
\end{figure}
%
\blindtext
%
\begin{figure}[htb]
\centering
\includegraphics[width=0.5\textwidth]{example-image-a}
\caption{Second figure}
\label{fig:2}
\end{figure}
%
\begin{table}[htb]
\footnotesize
\centering
\caption{Wrong numbered table}
\begin{tabular}{cccc}
\midrule
A & B & C & D\\
\midrule
\end{tabular}
\label{tab:4.1}
\end{table}%
%
\begin{table}[htb]
    \footnotesize
    \centering
    \caption{Table 2}
    \begin{tabular}{lccc}
\midrule
A & B & C & D\\
\midrule
    \end{tabular}
    \label{tab:4.2}
\end{table}%
%
\begin{table}[htb]
    \footnotesize
    \centering
    \caption{Table 4}
    \begin{tabular}{lccc}
        \midrule
        A & B & C & D\\
        \midrule
    \end{tabular}
    \label{tab:4}
\end{table}%

\end{document}

enter image description here

1 Answers1

1

The problem is caused by the tabularx within the figure (in combination with the ltablex package).

  • As a quick hack you could add -1 to the table counter

or

  • (my preferred option) use a description for the description:

\documentclass[12pt,a4paper]{article}

\usepackage{tabularx}
\usepackage{ltablex}

\begin{document}

\listoftables

\begin{figure}[htb]
\begin{tabularx}{\linewidth}{rX}
\textbf{Item 1}     & Description \\
\textbf{Item 2}     & Long description\\
\end{tabularx}
\caption{First figure}
\addtocounter{table}{-1}
\end{figure}

\begin{figure}[htb]
\begin{description}
\item[Item 1] Description
\item[Item 2] Long description
\end{description}
\caption{First figure}
\end{figure}

\begin{table}[htb]
\caption{Wrong numbered table}
\end{table}%

\end{document}