I'm currently using a package for placing the caption on a separate page, CaptionAfterwards, and the hypcap package gives me the following error:
"Package hypcap Error: You have forgotten to use \caption."
I've tried reading and applying answers to a similar question, but without any success.
How do I get these packages to work together nicely? I have a number of large, full-page figures which need to have captions on the following page. Additionally, the captions need to be recognized as such in order to be correctly included in the list of figures.
Is there an alternative method? The comment on this answer suggests to me that the fltpage package is a poor choice, while others partly recommend it.
Below is my minimum working example:
\documentclass[12pt, letterpaper]{report}
% PDF hyperlinks
\usepackage[colorlinks]{hyperref}
\usepackage[figure,table]{hypcap}
\usepackage{textcomp}
\usepackage{fontspec}
%\setmainfont{Droid Serif}
%Figures
\usepackage[CaptionAfterwards]{fltpage}
\begin{document}
This is an example which returns:
"Package hypcap Error: You have forgotten to use \textbackslash caption."
\begin{FPfigure}
\centering
\includegraphics[width=4.5in]{Temp_figure.png}
\caption[Short caption for TOC]{Long caption to describe figure}
\label{figure1}
\end{FPfigure}
\end{document}
Best Answer
Package
hypcap
is outdated. Better use packagecaption
with optionhypcap=true
.Please test the following MWE:
Remark: I used picture
example-image-a
, part of packagemwe
that must be installed but not called.