I'm stumped by an error I'm getting, when I try to render a Tufte-LaTeX document using hypcap and hyperref. For example, even a minimal document consisting of
\documentclass[nohyper]{tufte-handout}
\makeatletter
\let\tufte@caption\@caption % Protect caption from hyperref
\RequirePackage{hyperref}
\let\@caption\tufte@caption % See -- http://tex.stackexchange.com/a/46838
\makeatother
\RequirePackage[all]{hypcap} % See -- http://tex.stackexchange.com/a/27349
\begin{document}
\begin{figure}\caption{An empty figure.}\end{figure}
\end{document}
causes an error:
Package hypcap Error: You have forgotten to use \caption.
What is causing this error, and how can I avoid it?
If it comes to it, I'd settle for giving up some features provided by either hypcap of hyperref (e.g., linking to figures) if that's what it takes to keep things stable. I don't want to give up the visible effects of the Tufte style.
hypcapis upset about\captionnot being defined as expected. – egreg May 22 '12 at 20:18hypcapnot work with Tufte at all then? Or hashyperrefdone something? – orome May 22 '12 at 23:50hypcapuses the interface ofhyperreflocated in the definition of\@captionpatched byhyperref, sohypcapis dependent on this redefinition. But your code prevents the redefinition of\@captionby thehyperrefpackage and therefore thehypcappackage is doomed to fail. Remedy: Do not suppress the redefinition of\@captionbut offer a new definition of\@captionwhich works with both,tufteandhyperref. (Unfortunately I'm too short on time at the moment to code this for you, but I'm confident that someone here will...) – May 23 '12 at 04:27\@captiondone by thehyperrefpackage) – May 23 '12 at 04:31\@captionhere. I could do that, but will not able to code it until week-end. – May 24 '12 at 05:24