When I place a subfigure caption using \captionof, the format differs from the one appearing when placed via \caption inside a subfigure environment.
I suppose this is a bug in the \captionof command? Trying to force it via \captionsetup doesn't work either.
\documentclass{article}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\begin{subfigure}{\textwidth}
\caption{A}
\end{subfigure}
\end{figure}
\captionsetup[sub]{labelformat=parens}
\captionof{subfigure}{B}
\end{document}
\captionsetup[subfigure]{labelformat=parens,labelsep=space}(note the use ofsubfigure, not justsub) in the preamble and then use\begingroup \captionof{subfigure}{B} \endgroup. Note the use of the group. – Werner May 18 '16 at 20:12size=smallto the\captionsetup. – Werner May 18 '16 at 20:19\captionuses\@captypeto know what caption to set.\captionofredefines\@captypeand then sets a usual\caption. Without a limited scope, you could use\captionoutside a float. It's unlikely to happen, but you'll see a warning to that effect in the.logwhen compiling without grouping\captionof. – Werner May 18 '16 at 20:52subfigureinstead ofsubpart already did the trick! Should have read thesubcaptionmanual more carefully. Also, maybe I should have been more clear: I do not plan on placing the subcaption somewhere outside a float, it was just the most simple way to reproduce the error. I actually use it in an xlabel of a PGFplot, so no need for a grouping there. Adding \captionsetup[subfigure]{labelformat=parens,labelsep=space} to the preamble solved it globally, although I still consider it odd behavior that two formats exist otherwise. You could put it as an answer – Niclas May 19 '16 at 01:18