Graphics, Figures & TablesReorganize Table Numbering

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
zgjiangtoby
Posts: 3
Joined: Mon Oct 21, 2013 2:03 pm

Reorganize Table Numbering

Post by zgjiangtoby »

Hi,

I have a table numbered as "4(a)" and I want my next table to be numbered as "4(b)", but the result is "5(a)" instead. Any idea would be appreciate, many thanks!

ZG

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Reorganize Table Numbering

Post by Johannes_B »

There are many possible reasons for this behaviour. I guess you put the second picture into an extra {figure} environment. If this is not the case, please provide a minimal working example. We need to see some code, or everybody would just guess.


Best regards
Johannes
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
zgjiangtoby
Posts: 3
Joined: Mon Oct 21, 2013 2:03 pm

Reorganize Table Numbering

Post by zgjiangtoby »

Here is my code. The second table is just named as "Table 5(b)" rather than "Table 4(b)".

Code: Select all

\begin{table}
  \renewcommand{\thetable}{\arabic{table}(a)}
  \small
  \caption{This is table 4(a)}
  \label{t:4(a)}
  \begin{tabular}{r|rrrrr|rrrrr}\hline
    ~ & \multicolumn{5}{c|}{1}& \multicolumn{5}{|c}{2)} \\ \hline
      & & & & & & & & & &
  \end{tabular}
\end{table}

\begin{table}
  \renewcommand{\thetable}{\arabic{table}(b)}
  \caption{This is table 4(b).}
  \label{t:4(b)}
  \begin{tabular}{r|rrrr|rrrr}\hline
    ~ & \multicolumn{4}{c|}{1)}& \multicolumn{4}{|c}{2)} \\ \hline
      & & & & & & & &
  \end{tabular}
\end{table}

Many thanks!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Reorganize Table Numbering

Post by localghost »

Seems to me as if you want some kind of sub-numbering for floats (tables here). This can be done by the subfloat package.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{caption}              % customization of float captions
\usepackage[countmax]{subfloat}   % subnumbering of floats

\renewcommand*\thesubfloatfigure{\themainfigure(\alph{subfloatfigure})}
\renewcommand*\thesubfloattable{\themaintable(\alph{subfloattable})}

\begin{document}
  \begin{subtables}\label{tabs:dummy}
    \begin{table}[!ht]
      \caption{Dummy table}
      \label{tab:dummy-a}
      \centering
      \rule{4in}{2.25in}  % replace with actual table code
    \end{table}

    \begin{table}[!ht]
      \caption{Dummy table}
      \label{tab:dummy-b}
      \centering
      \rule{4in}{2.25in}  % replace with actual table code
    \end{table}
  \end{subtables}
\end{document}
For details please refer to the package manual. Click on "Open in writeLaTeX" in the head of the above code box to see the output instantly.


Best regards and welcome to the board
Thorsten
Post Reply