Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
6  
Have a look at the package subcaption or subfig –  Marco Daniel Jun 9 '12 at 16:57
    
@MarcoDaniel:Thanks, +1 –  Abhimanyu Arora Jun 9 '12 at 17:08
add comment

1 Answer

up vote 2 down vote accepted

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

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.