I want to add text, such as (a), at a particular location, in the northeast corner, inside a figure with a subfigure environment. I am using the \subcaption package.
\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\begin{center}
\begin{subfigure}{.48\textwidth}
\centering
\includegraphics[width=1\textwidth]{figure1}
\caption{}
\label{fig:capa}
\end{subfigure}
\begin{subfigure}{.48\textwidth}
\centering
\includegraphics[width=1\textwidth]{figure2}
\caption{}
\label{fig:capb}
\end{subfigure}
\caption{(a) My first figure, (b) my second figure.}
\label{fig:caption}
\end{center}
\end{figure}
\end{document}
overpicpackage or usingtikz. Unrelated: you shoudl not be using the centerenvironment to center stuff inside a figure. Use\centeringinstead of\begin{center}and remove\end{center}. Reason: figure adds space above and below the image, as does thecenterenv sofigure+center` gives excessive vertical space. – daleif Oct 01 '20 at 10:34overpic: https://tex.stackexchange.com/questions/20792/how-to-superimpose-latex-on-a-picture – John Oct 01 '20 at 12:39