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?


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



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

      Table head & Table head \\ \hline
      Some values & Some values \\
      Some values & Some values \\\hline
    \captionlistentry[table]{entry for table}
    \caption{some caption for both.}

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

You need to label the point at which the relevant counter is incremented, and tell hyperref you are labelling a table even though it is a figure environment.

\captionlistentry[figure]{entry for figure}
\captionlistentry[table]{entry for table}
  • hyperref is missing ;-) – Marco Daniel Sep 19 '13 at 10:18
  • 3
    @MarcoDaniel yes I know, but people should test their MWE:( – David Carlisle Sep 19 '13 at 10:30
  • @DavidCarlisle: oops. (edited above now). the counter is correct now, but it still says "Figure 1" instead of "Table 1" – Dircandis Sep 19 '13 at 10:48
  • 1
    @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
  • 1
    @Dircandis OK then the label for figure needs to be after \caption – David Carlisle Sep 19 '13 at 13:19

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.