# Vertically align two side-by-side minipages at the bottom of the page

MWE:

% !TeX program = xelatex
\documentclass[paper=A4,fontsize=12pt,titlepage]{scrartcl}

\usepackage{showframe}

\begin{document}
\begin{titlepage}
\raggedright
{
Some text
}
\vfill
{
\begin{minipage}[t][][b]{.5\textwidth}
\begin{flushleft}
More text \\
Second\\
Line
\end{flushleft}%
\end{minipage}%
\hfill
\begin{minipage}[t][][b]{.5\textwidth}
\begin{flushright}
fin\\
\end{flushright}%
\end{minipage}%
}
\end{titlepage}
\end{document}


I want the last line of the left minipage to be vertically aligned at the bottom of the page. The first line of the right minipage should be in line with the first line of the left minipage.

In the MWE the last line overshoots the bottom border. No combination of minipage alignment settings I have tried worked. Wrapping one large minipage around everything did not help either. Either the alignment stays the same as in the MWE or the left inner minipage is aligned perfectly and the right one floats beneath the left.

NEW:

It appears that the number of lines may change and that this example was simply one possible situation. Here is the the content under \vfill that you could use which is more flexible:

\vfill
{
\begin{minipage}[b][][t]{\textwidth}
\begin{minipage}[t]{.5\textwidth}
More text \\
Second\\
Line\\
Test\\
Test2
\end{minipage}%
\hfill
\begin{minipage}[t]{.5\textwidth}
\raggedleft
fin
\end{minipage}%
\end{minipage}%
}


Which looks like this:

The trick is to wrap them in another minipage where the contents are top-aligned (and it is anchored to its baseline).

If we modify the text to have some assorted font sizes (such as the code below), this overall structure will still work:

\vfill
{
\begin{minipage}[b][][t]{\textwidth}
\begin{minipage}[t]{.5\textwidth}
More text \\
Second\\
Line\\
{\Huge Test}\\
Test2
\end{minipage}%
\hfill
\begin{minipage}[t]{.5\textwidth}
\raggedleft
{\Large fin}
\end{minipage}%
\end{minipage}%
}


ORIGINAL:

To clarify, the first image is what you are seeing, while the second image is what you want, correct?

If I understood you correctly, you can change:

\begin{minipage}[t][][b]{.5\textwidth}


to:

\begin{minipage}[b][][t]{.5\textwidth}


EDIT:

If you want the extra gap under fin, you'll need the \strut that @esdd used for his answer. The reason for this is that the blank line at the end (defined by fin\\ is ignored). That's why the second image has both Line and fin flush with the bottom. If you add \strut (e.g. fin\\\strut) in addition to the \begin{minipage}[b][][t]{.5\textwidth} change I provided above, you will get this:

You may notice that the left side text is a bit lower than the right side, however. The issue is that \strut on the right side uses the maximum vertical space (for the line) whereas the left side doesn't require the maximum (due to the text on the line not having any depth [e.g. the space below baseline that letters like j, g, p, etc. require]). If you want them to be identical, you'll need that \strut on the left side also.

The differences will be largely stylistic, depending on which option looks/feels better for you.

• Thanks. I tried your first suggestion before posting here and I could not get the top of the right minipage to align vertically with the top of the left minipage. Unfortunately your second suggestion does not work for my use case. See my comment to the other post. – pomeloy Dec 16 '18 at 21:46
• @YoungUn so, you want to have any number of lines in the left minipage or the right minipage? (e.g. 5 lines on the left and 1 on the right or 2 lines on the left and 4 on the right, etc.) And have it be top-aligned, regardless of the number of lines? If I understand correctly, check my edit momentarily. – whatisit Dec 16 '18 at 22:00
• That is correct. Also, not only with a varying number of lines but with different font sizes as well. – pomeloy Dec 16 '18 at 22:03
• Yes, the edit allows this situation also. If it helps, I can provide a screenshot with some select text which has a different size. – whatisit Dec 16 '18 at 22:07
• I just tried it and it works just fine. Awesome! Thank you so much for your help! I played around with an outer minipage before but I just could not figure out the right alignment options. – pomeloy Dec 16 '18 at 22:13

You could use a \strut in the third line and \begin{minipage}[b]{.5\textwidth} for both minipages:

\documentclass[paper=A4,fontsize=12pt,titlepage]{scrartcl}

\usepackage{showframe}

\begin{document}
\begin{titlepage}
\raggedright
{
Some text
}
\vfill
{%
\begin{minipage}[b]{.5\textwidth}
\raggedright
More text \\
Second\\
Line\strut
\par
\end{minipage}%
\hfill
\begin{minipage}[b]{.5\textwidth}
\raggedleft