26

I'm using the capt-of package to create a caption for my figures:

\newcommand\figureFrame[4]{%
    \begin{center}
        \includegraphics[#1]{#2}
        \captionof{figure}{#3}\label{#4}
    \end{center}
}

Now I get the following error whenever a cite is in my caption text:

pdflatex> Package caption Warning: The option `hypcap=true' will be ignored for this
pdflatex> (caption)                particular \caption on input line 112.

I looked at the documentation, but found nothing for "hypcap". How can I fix this or do I have to fix this?

(There's now minimum working example because I think the answer is only a hint to the correct place in documentation :-))

lockstep
  • 250,273
strauberry
  • 3,255
  • 2
    BTW: Loading the capt-of package has no effect when the caption package is loaded, too. But I must confess that I don't know if I have documented this, will take a look now... –  Oct 22 '11 at 11:48

2 Answers2

35

This warning comes from the caption package, not capt-of. See section 6.5 of the caption documentation for details of hypcap.

Martin Scharrer
  • 262,582
Ian Thompson
  • 43,767
  • 2
    Ok, this sounds like my problem :-) But what to do now? I need the hyperref package to use it for chapter links etc. and I want refs to a figure to be placed at the beginning of the figure and not the caption. Replace the hyperref package? – strauberry Oct 23 '11 at 08:21
  • 40
    Try putting \captionsetup{type=figure} immediately before the \includegraphics command. – Ian Thompson Oct 23 '11 at 08:48
  • 1
    looks like section 7.6 of the documentation now – Rainb Feb 03 '22 at 09:39
22

Quoting from pp. 37--38 of the documentation of the caption (!) package:

\captionof{htypei}{. . . } vs. \captionsetup{type=htypei}+\caption{. . .}

Without hyperref loaded, both will give you identical results. But with hyperref loaded, and with hypcap=true requested, the hyperlink anchor will be placed different. For example:

\begin{minipage}{\linewidth}
. . .
\captionof{figure}{A figure}
\end{minipage}

will place the hyperlink anchor at the caption. (And if hypcap=true is set, you will get a warning about this.)

lockstep
  • 250,273