I have a 2 part table that I wish to label as "a" and "b", that also includes the section number and the table number within the section (e.g., "Table 4.1a" and Table "4.1b").
I use the basic approach to produce a caption which includes the section number (the \counterwithin{table}{section}
command). However, when I try to integrate a subcaption, I can only produce "Table 1a" and "Table 1b", which does not include the section number.
\documentclass{article}
\setcounter{totalnumber}{4}
\begin{document}
\begin{table}
\renewcommand{\thetable}{\arabic{table}a}
\caption{First caption}\label{first}
\end{table}
\begin{table}
\addtocounter{table}{-1}
\renewcommand{\thetable}{\arabic{table}b}
\caption{Second caption}\label{second}
\end{table}
\end{document}
How can I integrate the \counterwithin{table}{section}
command so that section numbers are also included?
Thanks
Best Answer
The result:
Remarks
A new counter
mysubtable
was defined.A helping command
\modcounter
was also defined to (ref)step themysubtable
counter and to redefine\thetable
to preppend the section counter.To restart the counter, add
at the appropriate location.