Graphics, Figures & Tablesmemoir, caption, hyperref | Problem with unnumbered Captions

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
arobase
Posts: 33
Joined: Sat Apr 14, 2012 7:46 pm

memoir, caption, hyperref | Problem with unnumbered Captions

Post by arobase »

Code: Select all

\documentclass{memoir}
\usepackage[
colorlinks=true
]{hyperref}
\usepackage{caption}

\begin{document}

\begin{table}
\centering
\caption{Name}
\begin{tabular}{cccccc}
&c1 & c2 & c3 & c4 & c5\\
r1 & a & b & c & d & e\\
r2 & f  & g  & h & i & j
\end{tabular}
\caption*{legend}
\end{table}
\end{document}
Produces a second numbered caption followed by * and 'legend'. I expected only 'legend'. That works by replacing memoir by article or not using package hyperref.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

memoir, caption, hyperref | Problem with unnumbered Captions

Post by sommerfee »

The caption package isn't adapted to the recent version of memhfixc package yet. (memhfixc is offered by the memoir document class and will be loaded automatically if hyperref is detected.)

This will be fixed in the upcoming version 3.3 of the caption package.

As a workaround you can swap the load order of the packages hyperref and caption, i.e. just load caption before hyperref:

Code: Select all

\documentclass{memoir}
\usepackage{caption}
\usepackage[
colorlinks=true
]{hyperref}

\begin{document}

\begin{table}
\centering
\caption{Name}
\begin{tabular}{cccccc}
&c1 & c2 & c3 & c4 & c5\\
r1 & a & b & c & d & e\\
r2 & f  & g  & h & i & j
\end{tabular}
\caption*{legend}
\end{table}
\end{document}
arobase
Posts: 33
Joined: Sat Apr 14, 2012 7:46 pm

memoir, caption, hyperref | Problem with unnumbered Captions

Post by arobase »

Thanks, but I copy pasted this entirely in replacement of the previous code, and it executes just the same, with a caption like this:
Table 0.2: *
legend
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

memoir, caption, hyperref | Problem with unnumbered Captions

Post by sommerfee »

What version of the caption package are you using?

(Either use \listfiles to show up the versions of the files used, or take a look at the log file which should contain a line like this one:

Code: Select all

Package: caption 2012/02/19 v3.2f Customizing captions (AR)
)
arobase
Posts: 33
Joined: Sat Apr 14, 2012 7:46 pm

Re: memoir, caption, hyperref | Problem with unnumbered Capt

Post by arobase »

It worked by upgrading. Thanks.
Post Reply