[Tex/LaTex] Minipage and multicols, vertical alignment

minipagemulticolvertical alignment

I want to create two columns next to each other. The left side contains a text in two columns using the multicol package. On the left side is some other content.

I've tried minipage, but in combination with multicol it fails in vertical aligning both minipages correctly.
Minimal working example:

\documentclass{article}

\usepackage{multicol}
\usepackage{blindtext}

\begin{document}
   \begin{minipage}[t]{0.5\linewidth}
        \noindent
        \begin{multicols}{2}
            \blindtext
        \end{multicols}
    \end{minipage}
    \begin{minipage}[t]{0.5\linewidth}
            \blindtext
    \end{minipage}
\end{document}

The result, with a vertical misalignment of the top of both texts:
misaligned minipages

Am I doing something wrong here?

Best Answer

You have to set an anchor at the top for [t] to take effect, because the top line inside the multicols environment is not the top line in the enveloping minipage: \vspace{0pt} is sufficient. Also you need to countermand the insertion of a glob of glue (we need to back up by the difference between \topskip and the height of a strut) and to set an initial \strut to ensure good alignment between the baselines.

\documentclass{article}

\usepackage{multicol,calc}
\usepackage{blindtext}

\begin{document}

\noindent % or the indent would apply
\begin{minipage}[t]{0.5\linewidth-0.5em} % some separation
  \vspace{0pt} % anchor for [t]
  \vspace{\dimexpr\ht\strutbox-\topskip}% remove excess glue
  \begin{multicols}{2}
    \strut\makebox[0pt][l]{\vrule width 10cm height 0pt depth 0.1pt}%
    \blindtext
  \end{multicols}
\end{minipage}\hfill
\begin{minipage}[t]{0.5\linewidth-0.5em} % some separation
  \vspace{0pt} % anchor for [t]
  \strut\blindtext
\end{minipage}

\end{document}

enter image description here

The rule shows the alignment. Thanks to Frank Mittelbach for spotting a mistake.