I'm trying to center subcaption subfigures as outlined this answer.
However, compilation fails with
! Argument of \subcaption@minipage has an extra }.
<inserted text>
\par
l.6 \g@addto@macro\subcaption@minipage\centering
?
Process interrupted by user
Any ideas?
\documentclass{article}
\usepackage{subcaption}
\makeatletter
\g@addto@macro\subcaption@minipage\centering
\makeatother
\begin{document}
\begin{figure}
\begin{minipage}[b]{.5\linewidth}
\large A
\subcaption{A subfigure}\label{fig:1a}
\end{minipage}%
\begin{minipage}[b]{.5\linewidth}
\large B
\subcaption{Another subfigure}\label{fig:1b}
\end{minipage}
\caption{A figure}\label{fig:1}
\end{figure}
\end{document}


\g@addto@macrois for macro with no arguments. But,\subcaption@minipageis a macro with two arguments. Try (untested)\renewcommand*\subcaption@minipage[2]{\minipage#1{#2}\captionsetup{subtype}\centering}(check no spaces at all in definition after copy paste from here). Ok I tried (on an old TeX installation). It seems to work withusepackage{caption}added (maybe as old installtion) and the above withinmakeatletter...\makeatother– Nov 13 '13 at 18:01\subcaption@minipagehas changed since] – Nov 13 '13 at 18:07