0

I prepared the following example:

\documentclass{article}

\usepackage{calc}
\usepackage{multicol}
\usepackage{lipsum}

\begin{document}
\begin{multicols}{2}
    \begin{tabular}{l r}
        item: & super very long item spanning a lot of space and very long other stuff \\
        item: & super very long item spanning a lot of space and very long other stuff \\
    \end{tabular}
\lipsum{}
\end{multicols}
\end{document}

However as you can see, the table overlaps the next column and flows off the page and does not break as expected.

overlapping tables

No messing around with minipages, tabular* and tabularx seems to fix this.

2

r does not check the width of the column. As you use it it will adapt to its content's width without breaking lines or something else. Hence it overlaps into the new column as it would into the margin in a "normal" document.

Using f.i. p{.5\linewidth} or X (tabularx) solves that, because it will enable line breaks and fixes the width. Use one of those solutions to get rid of the overflow.

That tabular* works for you is just because it will let the table occupy a given width. Therefore you do not see the overflow, although it's there.

  • p{.5\linewidth} works with my example doc but fails catastrophically with my real doc with no pattern hm, I'll have to see if I can reproduce it – Azsgy Jun 5 '17 at 16:44
  • Try with \noindent\begin{tabularx}{\columnwidth}{lX}. But why not a description environment? – Bernard Jun 5 '17 at 16:49
  • Turns out that was just my script messing up and trying to put images in the table. Works fine now! – Azsgy Jun 5 '17 at 17:49

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.