I am using the subcaption package with hyperref. If I allow hyperref to redefine LaTeX internals (implicit option set to true), everything works fine. If, however, I do not want a hyperlinked document and set hyperref's implicit=false option, subcaption's \subref macro generates errors. Problem exists both in pdfLaTeX and XeLaTeX. The \ref macro is unaffected.
The obvious answer is "don't want hyperlinks -> don't use hyperref", but the problem is, hyperref's rich options are also good for other things, like controlling pdf metadata using the \hypersetup{pdfinfo={...}}.
I found some old topics from 2011--2012 that dealt with hyperref--subcaption issues that were patched shortly thereafter, but it seems only behaviour with the default implicit=true was addressed.
Does anyone have an idea how to make \usepackage[implicit=false]{hyperref} work with subcaption's facilities? I would greatly appreciate any advice.
MWE:
Code: Select all
Code, edit and compile here:
\documentclass[final,a4paper]{article}\usepackage{caption}\usepackage[position=below]{subcaption}\usepackage[final,implicit=false]{hyperref}\begin{document}Reference to Table: \ref{tab:one}Reference to first subtable: \ref{subtab:one}Subreference to first subtable: \subref{subtab:one}% Error if implicit=false, works otherwise.\begin{table}\centering\caption{Table caption 1}\label{tab:one}\subcaptionbox{\strut\label{subtab:one}}{First subfloat}\bigskip\subcaptionbox{\strut\label{subtab:two}}{Second subfloat}\end{table}\end{document}