# How to label Table and Figure side-by-side with combined caption

Adapted from Thorsten Donigs answer in Table and figure side-by-side with independent captions

The Caption correctly numbers the figure and table but how does the correct setup of the labels independently for the figure and the table for referencing in the text work in this example?

\documentclass[11pt,a4paper,english]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[font=small,labelfont=bf]{caption}
\usepackage{hyperref}
\usepackage{graphicx}

\DeclareCaptionLabelFormat{andtable}{#1~#2  \&  \tablename~\thetable}

\begin{document}

\begin{figure}[!ht]
\centering
\rule{3cm}{3cm}
\caption{pic1}
\end{figure}

\autoref{tab:table123} %will give Figure 2 instead of Table 1.

\begin{figure}[!ht]
\centering
\rule{3cm}{3cm}
\hfill
\begin{tabular}[b]{cc}\hline
Some values & Some values \\
Some values & Some values \\\hline
\end{tabular}
\captionlistentry[table]{entry for table}
\captionsetup{labelformat=andtable}
\caption{some caption for both.}
\label{tab:table123}
\label{fig:pic2}
\end{figure}

\end{document}

• @DavidCarlisle: captionlistentry probably increases the table counter. – mpy Sep 19 '13 at 9:43

\captionlistentry[figure]{entry for figure}

• hyperref is missing ;-) – Marco Daniel Sep 19 '13 at 10:18
• @Dircandis did you copy rather than move the \label If you just have one for the table and one for the figure they should not clash – David Carlisle Sep 19 '13 at 11:23
• @Dircandis OK then the label for figure needs to be after \caption – David Carlisle Sep 19 '13 at 13:19