2

I would like to have two mini pages side by side, vertically aligned on top.

The left hand mini page features a table, the right hand side simple text. Alas, the right mini page is a little lower compared to the left one.

\documentclass{article}
\setlength{\parindent}{0pt}
\begin{document}
\begin{minipage}[t]{.5\textwidth}%
%\hrule
\begin{tabular}{rl}
abc & def \\
abc & def \\
\end{tabular}
\end{minipage}%
\begin{minipage}[t]{.5\textwidth}%
%\hrule
abc

def

ghi

jkl
\end{minipage}
\end{document}

If you comment in the two \hrule commands, they are on par. How come? What am I doing wrong?

BTW: if the table only features one line, the mini pages are on par, even without the hrule commands.

3

You need

 \begin{tabular}[t]{rl}

Otherwise the baseline of the first line of the minipage goes through the centre of the tabular.

  • Thanks, this helped to have the first line of the table on par with the first line of the right mini page. If I encapsulate each of the two mini pages with fbox{}, the right frame is again a little lower, though the text lines remain on par. What's wrong this time? – Markus Nißl Jun 19 '14 at 12:01
  • no idea, fbox should not change the baseline alignment at all. You would have to reduce the width of the minipages (by 2\fboxsep+2\fboxrule) to make space for the rules and padding. Oh add a \strut to your line of text in the left frame to make sure the line has full height – David Carlisle Jun 19 '14 at 12:24

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.