The nag package used with the l2tabu option complains when \label is used in a float without following a \caption. Unfortunately, it does not understand that the first argument of \subcaptionbox from the subcaption package is a caption. It therefore complains here when it should not:
\RequirePackage[l2tabu]{nag}
\documentclass{article}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\subcaptionbox{Subfigure caption\label{example}}{subfigure content}
\caption{Main figure caption}
\end{figure}
\end{document}
Sample output:
Package nag Warning: \label in float, but not after \caption on input line 7.
(Warning repeats four times.)
Any suggestions on how I can teach nag that \subcaptionbox creates a caption, and therefore that \label should be allowed here?
naginabortmode. And if I do that, then ignoring these nags is no longer an option. – Ben Liblit Dec 14 '11 at 23:38