When using David Carlisle's answer (thank you!) to Balancing long table inside multicol in LaTeX, I stumble upon "Overfull \vbox
" error when there is some non-multicol
text before the table, and the table is long enough to begin wrapping around into the second column.
Here's the code:
\documentclass[11pt, a4paper]{article}
\usepackage[margin=3cm]{geometry}
\usepackage{longtable}
\usepackage{multicol}
\newsavebox\ltmcbox
\def\shortlipsum{\par Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque.\par}
\newcounter{entryno}
\setcounter{entryno}{1}
\def\tabline{Test & \the\value{entryno} & Description\addtocounter{entryno}{1}\\}
\def\tablines{\tabline\tabline\tabline\tabline\tabline}
\begin{document}
\shortlipsum
\shortlipsum
\shortlipsum
\shortlipsum
\begin{multicols}{2}
\medskip
\setbox\ltmcbox\vbox{
\makeatletter\col@number\@ne
\begin{longtable}{|l|l|l|}
\tablines\tablines\tablines\tablines\tablines\tablines
\tablines\tablines\tablines\tablines\tablines\tablines
\tablines\tablines\tablines\tablines\tablines\tablines
\tablines\tablines\tablines\tablines\tablines\tablines
\tablines\tablines\tablines\tablines\tablines\tablines
\end{longtable}
\unskip
\unpenalty
\unpenalty
}
\unvbox\ltmcbox
\medskip
\end{multicols}
\shortlipsum
\end{document}
And here's what I get:

Ideally, I'd like the first part of the table (on the first page) to properly wrap into the second column, however, I am not savvy enough to figure this one out myself. How can this be done?