3

I need help aligning the subcaptions of my figures. I want it to be vertically and horizontally aligned. Thank you in advance.

how it looks

    \documentclass[a4paper, 12pt]{report}
    \usepackage[utf8]{inputenc}
    \usepackage{graphicx}
    \usepackage{subcaption}
    \usepackage{subfig}
    \usepackage{floatrow}

    \captionsetup{labelfont=bf}

    \renewcommand\thesubfigure{\Alph{subfigure}}
    \begin{figure}[!h]
    \captionsetup[subfigure]{position=b}
    \centering

    \subcaptionbox{\label{fig:backbone}}{\includegraphics[width=.3\linewidth]{backbone2}}\hfil
    \subcaptionbox{\label{fig:lipassemble}}{\includegraphics[width=.6\linewidth]{lipids}}\\
    \par\vspace{2em}
    \subcaptionbox{\label{fig:micelle}}{\includegraphics[width=.2\linewidth, height=0.2\columnwidth]{micelle}}\hfil
    \subcaptionbox{\label{fig:invmicelle}}{\includegraphics[width=.2\linewidth, height=0.2\columnwidth]{inverted_micelle}}\hfil
    \caption{\textbf{(A)}-General chemical formula for lipid and superimposed ball-and-stick structure showing hydrophilic and hydrophobic regions, \textbf{(B)}-Breakdown of phospholipid structure that assembles into a lipid bilayer and liposome, respectively \cite{phospho}, \textbf{(C)}-structure of micelle, \textbf{(D)}-structure of inverse micelle \cite{Lasic1}}

    \end{figure}
3

If I understood your question correctly, for the horizontal alignment you can use a tabular with two c columns; the vertical alignment comes from \subcaptionbox:

\documentclass[a4paper, 12pt]{report}
    \usepackage[utf8]{inputenc}
    \usepackage{graphicx}
    \usepackage{subcaption}
    \usepackage{subfig}
    \usepackage{floatrow}

    \captionsetup{labelfont=bf}

    \renewcommand\thesubfigure{\Alph{subfigure}}

\begin{document}

\begin{figure}[!h]
    \captionsetup[subfigure]{position=b}
    \centering

    \begin{tabular}{@{}cc@{}}
    \subcaptionbox{\label{fig:backbone}}{\includegraphics[width=.3\linewidth]{example-image}} &
    \subcaptionbox{\label{fig:lipassemble}}{\includegraphics[width=.6\linewidth]{example-image-a}} \\[2em]
    \subcaptionbox{\label{fig:micelle}}{\includegraphics[width=.2\linewidth, height=0.2\columnwidth]{example-image-b}} &
    \subcaptionbox{\label{fig:invmicelle}}{\includegraphics[width=.2\linewidth, height=0.2\columnwidth]{example-image-c}}
    \end{tabular}
    \caption{\textbf{(A)}-General chemical formula for lipid and superimposed ball-and-stick structure showing hydrophilic and hydrophobic regions, \textbf{(B)}-Breakdown of phospholipid structure that assembles into a lipid bilayer and liposome, respectively \cite{phospho}, \textbf{(C)}-structure of micelle, \textbf{(D)}-structure of inverse micelle \cite{Lasic1}}

\end{figure}
\end{document}

The result:

enter image description here

  • thank you so much, that's a neat trick, as you can tell from my coding, im quite new to latex. cheers! – Spencer Trinh Jun 19 '15 at 20:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.