1

How can I make a common numbering for my figures and tables?

For instance, I want to obtain in Section 1 something like: Table 1.1, Figure 1.2, Table 1.3, Table 1.4, Figure 1.5

4
  • 2
    Possible duplicate: Slave duplicate counter; \makeatletter\let\c@figure\c@table\makeatother – Werner Feb 27 '20 at 23:46
  • @Werner Thx! It worked for me! – T. G. Feb 28 '20 at 1:58
  • @Werner that does not really work for floats it makes figure and tables use the same counter but they will float out of order. I'm voting to re-open – David Carlisle Feb 28 '20 at 9:36
  • @PhelypeOleinik ^^ – David Carlisle Feb 28 '20 at 9:56
2

You could make the figure and table environments use the same counter simply by

\let\c@figure\c@table

But if you do that, they are still independent float types so they can float past each other resulting in the floats being numbered in arbitrary order, eg

enter image description here

\documentclass{article}


\makeatletter
\let\c@figure\c@table
\makeatother 
\begin{document}

\begin{table}[p]
  \centering
  
  \caption{ttttt}
\end{table}


zzzzz


\begin{figure}[t]
  \centering
  
ffff
   \caption{ffff}
\end{figure}
\end{document}

If you add

\let\ftype@figure\ftype@table

Then the figure environment will use the same float sequence as tables, so be kept in sequence.

enter image description here

That may be enough, however the figures and tables will be listed separately showing "gaps" in the numbering as here:

enter image description here


\listoffigures

\listoftables

So you may prefer to use a combined list in \listoftables by using




\makeatletter
\let\c@figure\c@table
\let\ftype@figure\ftype@table
\let\ext@figure\ext@table
\renewcommand\listtablename{List of Tables and Figures}
\makeatother 

enter image description here

1
  • Thank you so much for the explanation! – T. G. Feb 29 '20 at 4:11

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.