# Forcing subfigure caption to right-middle of figure

I want to plot say two figures with their respective sub captions on right-middle side of the figure. Any help?

\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\def\LW{\dimexpr.25\linewidth-.5em}
\begin{document}
\begin{figure}
\parbox{\LW}{\includegraphics[width=\linewidth]{example-image-a}}\hfill%
\parbox{\LW}{\subcaption{This is the A example image}}\hfill%
\parbox{\LW}{\includegraphics[width=\linewidth]{example-image-b}}\hfill%
\parbox{\LW}{\subcaption{The B example image.}}
\caption{Example figures A \& B from the \texttt{mwe} package. Use a full
width caption here, because a centered-little caption with side
subcaptions look awful.}
\end{figure}
\end{document}

• +1. A minor suggestion: since the subcaptions are narrow, it would be better to locally use something like \captionsetup[subfigure]{justification=raggedright} to prevent ugly spacing issues in the subcaptions (which you will see if you change the second subcation to, for example, \subcaption{Another ugly image.}) – Gonzalo Medina Jan 31 '15 at 16:18
• @GonzaloMedina I agree, I do not pay attention to this or hyphenation issues for the example. However in a real work my preference would be a wider side caption, a small sans serif and use microtype rather that allow a ragged margin. – Fran Jan 31 '15 at 18:39
• Thanks @Fran: The solution really works for me. However i was getting package conflicts with subcaption. But without subcaption it also works. – Astro Feb 2 '15 at 7:17

\documentclass{article}

\usepackage{graphicx}

\begin{document}

\begin{figure}

\includegraphics[width=.2\textwidth,valign=m]{example-image-a}
\begin{minipage}{.2\textwidth}
\caption{an image}
\end{minipage}
\hfill
\includegraphics[width=.2\textwidth,valign=m]{example-image-b}
\begin{minipage}{.2\textwidth}
\caption{another image}
\end{minipage}

\end{figure}

\end{document}

• Thanks @David : The solution works but the sub-cations aligns at bottom-right of figure. I want them in middle. Anyway solution was simple and interesting. – Astro Feb 2 '15 at 7:23
• @VinayakAbrol no. Look at the image I posted, they are middle aligned. – David Carlisle Feb 2 '15 at 9:16
A simple modification to Frank's answer

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\def\LW{\dimexpr.9\linewidth-.5em}
\def\LWW{\dimexpr.1\linewidth-.5em}
\begin{figure}
\graphicspath{ {./images/} }
\centering
\parbox{\LW}{\includegraphics[width=\linewidth,height=3cm]  {1.eps}}
\parbox{\LWW}{(a)}\\
\parbox{\LW}{\includegraphics[width=\linewidth,height=3cm]{2.eps}}
\parbox{\LWW}{(b)}\\
\parbox{\LW}{\includegraphics[width=\linewidth,height=3cm]{mdct_d1.eps}}
\parbox{\LWW}{(c)}
\caption{Example figures A \& B from the package.}
\end{figure}
\end{document}