Consider the following
\documentclass{article}
\usepackage{subcaption}
\usepackage{graphicx}
\begin{document}
\begin{figure}[htpb]
\centering
\begin{minipage}{0.3\linewidth}
\begin{subfigure}[t]{\textwidth}
\includegraphics[width=\linewidth]{example-image-a}
\caption{}
\label{figa}
\end{subfigure}
\end{minipage}
\begin{minipage}{0.3\linewidth}
\begin{subfigure}[t]{\textwidth}
\includegraphics[width=\linewidth]{example-image-b}
\caption{}
\label{figb}
\end{subfigure}
\end{minipage}
\par\medskip
\caption{Example caption.}
\label{fig}
\end{figure}
\end{document}
which gives
How can I position the captions of the subfigures, (a) and (b), in any position overlapping the image? For example, how can I get
Edit: For example, using something like
\captionsetup[subfigure]{font={bf,small}, skip=-100pt, margin=0.1cm, singlelinecheck=false}
almost does the trick
but not quite. Putting \caption before \includegraphics also does not seem to help, as the caption moves to the back layer. Any ideas?




tikswould be appreciated. – sam wolfe Aug 17 '23 at 14:24