1

Used package subcaption to insert 2 photos. How to align each subfigure's caption to the right? The example code:

\documentclass[a4paper,12pt]{article}
\usepackage[demo]{graphicx}
\usepackage{lipsum}
\usepackage[list=true]{subcaption}

\begin{document}

\section{TEST}
\lipsum[1]
\begin{figure}
\centering
\captionsetup[subfigure]{labelformat=empty}
\begin{subfigure}[t]{1.0\linewidth}
    \includegraphics[width=1.0\linewidth]{example-image-a}
    \caption{This is figure A.}
\end{subfigure}%

\vspace{15pt}
\lipsum[1]  
\vspace{15pt}   

\begin{subfigure}[b]{1.0\linewidth}
    \caption{This is Figure B.}
    \includegraphics[width=1.0\linewidth]{example-image-b}
\end{subfigure}
\end{figure}

\end{document}

1 Answer 1

3

Try

\captionsetup[sub]{labelformat=empty,justification=raggedleft,singlelinecheck=false}
\begin{subfigure}[t]{1.0\linewidth}
    \includegraphics[width=1.0\linewidth]{example-image-a}
    \caption{This is figure A.}
\end{subfigure}%

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .