3

How can I refer to 'coupled' tables (say different tables but referenced as table 5a and table 5b). If I \label them and use \ref, they would be referenced in the document as table 5 and table 6.

  • 6
    Have a look at the package subcaption or subfig – Marco Daniel Jun 9 '12 at 16:57
2

Here's a complete example using the packages subcaption and cleveref (the latter for automatic formatting of cross-references).

\documentclass{article}

\usepackage{subcaption}

\DeclareCaptionSubType*{table}
\captionsetup[subtable]{labelformat=simple,labelsep=colon}
\renewcommand*{\thesubtable}{\thetable(\alph{subtable})}

\usepackage{cleveref}
\crefname{subtable}{subtable}{subtables}

\begin{document}

\begin{table}
\begin{subtable}{\linewidth}
\centering
(Tabular material)
\subcaption{A subtable}\label{tab:foox}
\end{subtable}

\vspace{\floatsep}

\begin{subtable}{\linewidth}
\centering
(Tabular material)
\subcaption{A subtable}\label{tab:fooy}
\end{subtable}
\caption{A table}\label{tab:foo}
\end{table}

See \cref{tab:foo} and especially \cref{tab:foox,tab:fooy}.

\end{document}

enter image description here

  • My requirement is a bit different though, rather than side-by-side, is it possible to get the tables one after the other? Then naming them 1(a) and 1(b) both different captions. They show related data but there is a difference in the method, which explains my need. – Abhimanyu Arora Jun 10 '12 at 15:36
  • @AbhimanyuArora I updated my answer. – lockstep Jun 10 '12 at 17:06

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.