2

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}
                Additional text\\
                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.

1

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
            Additional text\\
            fin
    \end{minipage}%
\end{minipage}%
}

Which looks like this:

Flexible and top-aligned version

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
            Additional text\\
            {\Large fin}
    \end{minipage}%
\end{minipage}%
}

Improved version with font size changes

ORIGINAL:

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

original

desired

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:

desired plus the extra blank line at bottom

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.

desired plus \strut changes

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. – Young Un 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. – Young Un 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. – Young Un Dec 16 '18 at 22:13
3

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
        Additional text\\
        fin\\
        \strut
        \par
      \end{minipage}%
    }
\end{titlepage}
\end{document}

Result:

enter image description here

  • Thanks. Sadly this requires inserting a strut for every additional line. Also it does not work when the font sizes differ between the minipages. – Young Un Dec 16 '18 at 21: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.