1

I have a figure with two subfigures of different heights. I'd like the subcaptions to align at the bottom. This could probably be done with some kind of alignment stuff, or by creating a phantom '[RTR]' branch of the left subfigure's tree. I'm unsure how to do either of these.

\usepackage[linguistics]{forest}
\begin{figure}
\centering
\begin{subfigure}[t]{.45\textwidth}
  \centering
\begin{forest}
 [, GP1, s sep=2em
[\large{è} [open [close [rtr]]]]
  ]
\end{forest}
\caption{left caption}
\end{subfigure}%
\hfill
\begin{subfigure}[t]{.4\textwidth}
  \centering
\begin{forest}
 [, GP1, s sep=2em
[\large{ɛ́ɛ̀} [open [close [rtr, calign=child, calign primary child=2 [{[RTR]}] ]]]]
  ]
\end{forest}}
\caption{right caption}
\end{subfigure}%
\caption{Figure caption} 
\end{figure}

misaligned subcaptions

1

Maybe not the most elegant solution, but you could use minipages to get the desired alignment:

enter image description here

\documentclass{article}
\usepackage{subcaption}

\usepackage[linguistics]{forest}
\begin{document}
\begin{figure}
\centering
\begin{minipage}[t]{.45\textwidth}
  \centering
\begin{forest}
 [, GP1, s sep=2em
[\large{ee} [open [close [rtr]]]]
  ]
\end{forest}

\end{minipage}%
\hfill
\begin{minipage}[t]{.4\textwidth}
  \centering
\begin{forest}
 [, GP1, s sep=2em
[\large{e} [open [close [rtr, calign=child, calign primary child=2 [{[RTR]}] ]]]]
  ]
\end{forest}%}
\end{minipage}

\begin{subfigure}[t]{.45\textwidth}
\caption{right caption}
\end{subfigure}
\hfill
\begin{subfigure}[t]{.4\textwidth}
\caption{left caption}
\end{subfigure}
\caption{Figure caption} 
\end{figure}

\end{document}
  • Interesting, but it works perfectly thanks! – user9974638 Mar 11 at 11:42
0

Unfortunately I can't get your code to work fully but you could try adding a negative space before your second "tree", something like the following to align the trees at the bottom instead of adding space between the tree and its caption.

Edit: you can change the \subfigure[t] to \subfigure[b] to achieve the same.

enter image description here

\documentclass{article}
\usepackage{subcaption}
\usepackage[linguistics]{forest}

\begin{document}
\begin{figure}
\centering
\begin{subfigure}[t]{.45\textwidth}
  \centering
\begin{forest}
 [, GP1, s sep=2em
[\large{è} [open [close [rtr]]]]
  ]
\end{forest}
\caption{left caption}
\end{subfigure}%
\hfill
\begin{subfigure}[t]{.4\textwidth}
\vspace{-1.1cm}  %                  <---- added here. Adjust spacing to your needs
  \centering
\begin{forest}
 [, GP1, s sep=2em
[\large{ɛ́ɛ̀} [open [close [rtr, calign=child, calign primary child=2 [{[RTR]}] ]]]]
  ]
\end{forest}}
\caption{right caption}
\end{subfigure}%
\caption{Figure caption} 
\end{figure}
\end{document}

OR

\documentclass{article}
\usepackage{subcaption}
\usepackage[linguistics]{forest}

\begin{document}
\begin{figure}
    \centering
    \begin{subfigure}[b]{.45\textwidth}
        \centering
        \begin{forest}
            [, GP1, s sep=2em
            [\large{è} [open [close [rtr]]]]
            ]
        \end{forest}
        \caption{left caption}
    \end{subfigure}%
    \hfill
    \begin{subfigure}[b]{.4\textwidth}
        \centering
        \begin{forest}
            [, GP1, s sep=2em
            [\large{ɛ́ɛ̀} [open [close [rtr, calign=child, calign primary child=2 [{[RTR]}] ]]]]
            ]
    \end{forest}
    \caption{right caption}
\end{subfigure}%
\caption{Figure caption} 
\end{figure}
\end{document}
  • 3
    Why not use \begin{subfigure}[b] to achieve bottom aligned subfigures? – leandriis Mar 8 at 20:07

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.