0

I have been using lists inside multicols for a "condensed" typesetting of lists of short items. However, I do not like what happens if a page break occurs inside, and I couldn't find a way to automatically force a page break before multicols if it cannot fit onto the current page.

So I have been thinking about using some kind of a table environment to typeset a single-row table with lists in cells.

However, I would like to make the lists in cells spread vertically so that their tops and bottoms be aligned (except when this wouldn't make sense), like columns in multicols.

So far I do not see how to make a table whose height is determined by the maximal natural height of its cells, and where I could make the contents of any cell spread vertically to align top and bottom baselines. Is it possible? How?

This might look like not a very natural thing to do, but I am used to the behaviour of lists in multicols, and I would like to avoid situations where, despite having the same number of items, the bottoms are not aligned because of accumulation of minor height differences.

1 Answer 1

1

If I understand the problem, you have a 3-column list that is does not fit in the page:

Mwe

\documentclass{article}
\usepackage{lipsum}
\usepackage{multicol}
\begin{document}
\lipsum[1-4]
%\begin{table}
\begin{multicols}{3}
\begin{itemize}
\item foo \item bar \item baz
\item foo \item bar \item baz
\item foo \item bar \item baz
\item foo \item bar \item baz
\item foo \item bar \item baz
\item foo \item bar \item baz
\item foo \item bar \item baz
\item foo \item bar \item baz
\item foo \item bar \item baz
\end{itemize}
\end{multicols} 
%\end{table}
\lipsum[5-8]
\end{document}

So you want is pass to the next page. The solution is as simple as put in a table or figure float to move the whole list to the next page (Example: uncomment lines 6 and 20 of the above MWE et voilá. Of course, this can move more o less text after the list to before of the list, to avoid gaps due to the premature page break.

If this is a problem, then you can use the [H] option for the float (need the float package) or simpler, use any non-float box, for example \parbox{\linewidth}{your multicols here}.

Personally, I indeed will use the float without any option, even if the list move out far of the logical order, because numbered captions and cross references exist just for this cases while the alternative is redesign the text or allow a horrible gap much worse that allow the page break within the list.

5
  • Thanks, \parbox seems to do what I need. In my case I usually have a list in 2-3 columns and 2-3 rows, so I do not want it to float away.
    – Alexey
    Jun 20, 2023 at 7:16
  • I didn't try \parbox with multicols because I had an impression that it could not work: Prevent page break when using multicols at end of page, Avoid page break for multicols, filbreak and multicols.
    – Alexey
    Jun 20, 2023 at 7:19
  • @Alexey I guess than most people want list a part of the main text, but consider that if the list is unbreakable list soon or later will produce an ugly gap, and then is where treat it like a table or figure, beside the main text, could have (or not) some sense. If you use a float, change of mind is only change [h] to [H].
    – Fran
    Jun 20, 2023 at 7:40
  • Strangely, putting multicols inside parbox or minipage affects vertical spacing before and after. Do you know by any chance how to deal with it?
    – Alexey
    Jun 20, 2023 at 13:59
  • @Alexey No and yes. Use \fbox{} to frame these boxes and you can see better: if there a blank line (=\par) before and after the box, the outer space is by default the same that between paragraphs (i.e, controlled only by \parskip) but may also change by the vertical align of the box (compare with options [t],[b] and [c] in both cases) whereas inner spacing added by multicols is lost in the minipage but not in the \parbox. Note that a float with [H] will have another spacing rules but they cannot be tested in this way.
    – Fran
    Jun 20, 2023 at 20:13

You must log in to answer this question.

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