2

I wanted to design a two column layout where one column was to host a table and the other normal text. I was confronted with two problems:

  1. The text in the second column overlaps with the frame of the table contained in the first one

  2. The text in the second column seems to start from a random position.

Here is the source code of the document:

\documentclass[11pt, hungarian, german]{article}
\usepackage[utf8]{inputenc}
\renewcommand*\rmdefault{ppl}
\usepackage{geometry}
% \usepackage{tasks} 
\usepackage{caption}
\usepackage{fixltx2e}
\usepackage[hang,flushmargin, norule]{footmisc}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{array}
\usepackage{verbatim}
\usepackage{lipsum} 
\usepackage{multicol}

\begin{document}

\pagenumbering{gobble}

\begin{center}
    \textsc{\Huge A számok}\\[.3cm]
    {\Large ( Die Zahlen )}\\[.8cm]
\end{center}

\begin{multicols}{2}

\begin{large}

\def\arraystretch{1.3} 
\begin{tabularx}{\columnwidth}{|c|X|}
    \hline
    0 & nulla \\
    1 & egy \\
    2 & kett\H{o} \footnotemark \\
    3 & három \\
    4 & negy \\
    5 & öt \\
    6 & hat \\
    7 & hét \\
    8 & nyolc \\
    9 & kilenc \\
    10 & tíz \\
    11 & tizenegy \\
    12 & tizenkett\H{o} \\
    13 & tizenhárom \\
    14 & tizennegy \\
    15 & tizenöt \\
    16 & tizenhat \\
    17 & tizenhét \\
    18 & tizennyolc \\
    19 & tizenkilenc \\
    20 & húsz \\
    21 & huszonegy \\
    22 & huszonkett\H{o} \\
    23 & huszonhárom \\
    24 & huszonnegy \\
    25 & huszonöt \\
    26 & huszonhat \\
    27 & huszonhét \\
    28 & huszonnyolc \\
    29 & huszonkilenc \\
    \hline
\end{tabularx}

\begin{center}
    \textbf{Bemerkungen}\\
\end{center}

\lipsum[1-1]

\end{large}

\end{multicols}

\end{document}

1 Answer 1

2

Issue 1

The first line of a paragraph is indented by \parindent. It moves the table to the right.

\noindent before \begin{tabularx} fixes this.

Issue 2

Package multicols tries to balance the columns. Since the large table cannot be broken across columns, the right column is stretched.

Solution (thanks Piet van Oostrum): Use the star form multicols* to get unbalanced columns.

(Workaround: Add \vspace*{\fill} at the end of the second column to get an unbalanced right column.)

BTW, the table is too large for the page layout.

2
  • Thank you very much! This solved the first problem. However, it does not change the fact that text starts at the middle of the column.
    – eslukas
    Nov 6, 2016 at 16:30
  • 1
    Use the multicols* environment. Nov 6, 2016 at 16:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .