Columns (multicol/twocolumn)

Columns are not a house style; they are a reading aid. A line of text in a 10-point article runs 345pt wide — roughly 78 characters — while the typographer Robert Bringhurst puts the comfortable range at 45 to 75 characters and calls the 66-character line ideal. Split that page into two columns and every line lands back inside the range. That is why journals, proceedings and newspapers are set in columns, and LaTeX offers two tools of quite different temperament for the job: the twocolumn class option, and the multicols environment from the multicol package. They look interchangeable and are not. This page follows the differences that actually bite — how many columns you can have, whether the last page comes out balanced, and the two distinct ways a figure can silently disappear.

twocolumn or multicol: which one to use

Use twocolumn when the whole document is two-column and carries figures; use multicol when only part of the document is in columns, when you need three or more, or when the last page has to come out even. The dividing line is floats. twocolumn leaves LaTeX’s float machinery intact, so a figure still floats inside its column and figure* spans the page. multicol replaces the output routine wholesale, and in exchange for balancing it gives up in-column floats entirely. Nearly every argument on this page descends from that one trade.

FormColumnsWhat it does
twocolumn2Class option; the whole body is two-column and the last page is left uneven
\twocolumn[⟨text⟩]2Used in the body; forces a page break, then sets ⟨text⟩ full width above the columns
\onecolumn1Used in the body; forces a page break and returns to a single column
multicols2 to 10Environment; starts and ends mid-page and balances the closing columns
multicols*2 to 10The same, but the closing columns are filled from the left and left uneven

Setting the whole document in two columns with twocolumn

Add twocolumn to the class options and you are done: \documentclass[twocolumn]{article} sets the whole body in two columns (the default is onecolumn). Many academic classes are designed around this option internally. To change modes partway through, call \twocolumn and \onecolumn in the body — with two catches. Both commands start a new page, so the number of columns never changes mid-page. And \twocolumn produces exactly two columns, always. The moment a third one is needed, this tool has run out.

latex
\documentclass[twocolumn]{article}

That \twocolumn takes an optional argument, and it is usually what gives a paper its face. Writing \twocolumn[⟨full-width material⟩] sets that material alone in a single, full-width column above the two-column text. Title, authors, affiliation and abstract stretched across the page, with the body flowing in two columns underneath — the layout every conference paper wears is this one line.

document.tex
\documentclass[twocolumn]{article}
\begin{document}
\twocolumn[%
  \begin{center}
    {\LARGE A Study of Narrow Measures}\\[4pt]
    A. Author \quad Institute of Typography
  \end{center}
  \vspace{1em}
]
The body starts here and is set in two columns.
\end{document}

The gap between the columns is the length \columnsep and the thickness of a vertical rule inside it is \columnseprule. In the standard classes \columnsep defaults to 10pt and \columnseprule to 0pt, meaning no rule. Put numbers to it and the opening argument becomes concrete: a 10-point article has a \textwidth of 345pt, so one column is (345 − 10) ÷ 2 = 167.5pt, about 38 characters of English. That sits just under the 40-to-50 band Bringhurst recommends for multi-column work — which means every point added to \columnsep is taken from a measure that has none to spare. A rule is often the better trade: it separates the columns visually so the gap itself can stay narrow.

latex
\setlength{\columnsep}{20pt}      % wider gap between the columns
\setlength{\columnseprule}{0.4pt} % thin vertical rule inside the gap

Spanning a figure across both columns: figure* and table*

Use the starred environments. \begin{figure*} and \begin{table*} produce a float that spans both columns at the full page measure. One distinction inside them prevents most accidents: \columnwidth is the width of one column, while \textwidth is the whole text block — both columns plus the gap. A graphic meant for a single column takes width=\columnwidth; a spanning one takes width=\textwidth. Swap them and you get either an overfull box or a picture set oddly small.

document.tex
\documentclass[twocolumn]{article}
\usepackage{graphicx}
\begin{document}
% one column wide: an ordinary float
\begin{figure}
  \centering
  \includegraphics[width=\columnwidth]{plot}
  \caption{Fits inside a single column.}
\end{figure}

% spans both columns: starred float, default placement is [tp]
\begin{figure*}[t]
  \centering
  \includegraphics[width=\textwidth]{wide-plot}
  \caption{Spans the full text width.}
\end{figure*}
\end{document}

Complaints that a figure* “does not appear where I wrote it” or “jumped three pages ahead” make sense once you know its default. The LaTeX kernel sources state plainly that all double floats have the default placement tp. So \begin{figure*} is silently treated as [tp] — top of a page, or a dedicated float page — and never as htbp. Moreover, as the LaTeX2e reference manual notes, b is not allowed for full-width floats in double-column output. If the top of the next page is already taken, the float keeps sliding forward. When you really need one at the foot of a page, loading stfloats or dblfloatfix makes b work.

This queue harboured a long-lived and rather charming bug. Before the 2015 release, LaTeX kept pending floats in two separate deferral lists — one for single-column floats and one for double-column ones. Two queues mean overtaking: a one-column Figure 3 could pass a full-width Figure 2 written earlier and print ahead of it. The fix first shipped as the fixltx2e package, which amalgamated the two lists into one. In 2015 all of fixltx2e’s fixes were folded into the kernel itself, so on any current TeX installation there is nothing left to load. If you find an old post about figures coming out in the wrong order, check its date first.

Three or more columns, and columns that come out even: multicol

Load \usepackage{multicol}, wrap the region in a multicols environment and pass the number of columns as its argument. That alone gives you anything from 2 to 10 columns (the ceiling of ten has been there since version 1.5); the environment starts and ends mid-page, and when it ends it evens out the column heights by itself. multicols environments can even be nested. Because nothing forces a page break, dropping a three-column glossary or index into the middle of otherwise single-column text is entirely natural.

latex
\usepackage{multicol}
% ... later, in the body
\begin{multicols}{3}
  This text is broken into three balanced columns.
\end{multicols}

multicol exists because of an index. In 1989, while writing the macros for the doc package, Frank Mittelbach wanted the index and the bibliography of a documentation file to share one page. Standard two-column mode cannot do that: \twocolumn always starts a new page, and the last one ends with a half-empty right column. In the package documentation he records that the first version cost him a whole weekend, and that he started from the algorithm on page 417 of The TeXbook — adding that the remark dates from the initial release and that several hundred more hours have gone into the code since. Balancing, in other words, was conceived not as a cosmetic feature but as a way to save paper.

multicols takes two optional arguments after the column count. The first, [⟨preamble text⟩], is a heading or lead-in set full width immediately above the columns. The second, [⟨length⟩], is the minimum free space that must remain at the foot of the page for the columns to start there, overriding the default \premulticols (50pt) for this one occasion. If less than that remains, the environment begins on a fresh page. Omit it after a long preamble and the package can stop with the error Error saving partial page, followed by Some text may be lost! — and the instruction to increase \premulticols.

latex
\begin{multicols}{3}
    [\section{Glossary}
     This heading and this sentence run the full text width.]
    [6cm]
  Everything after the optional arguments is split into three columns.
\end{multicols}

Why the last page of a twocolumn document will not balance

Because LaTeX finishes each column before it knows there is a next one. In two-column mode the output routine \@outputdblcol runs once per column: when the left column fills, its contents are stowed in a box called \@leftcolumn and typesetting resumes; only when the right column fills is the page assembled and shipped. There is never a moment at which LaTeX holds the remaining text and gets to decide how to divide it in two. So whatever is left at \end{document} simply pours into the left column and stops, leaving the right one short. This is not a bug — it is what sequential page building necessarily produces.

multicol inverts that order, and that inversion is the whole trick. Its documentation describes the work in two steps: first collect the material of the environment, then, on reaching the end, balance. Because collecting comes first, the package can cut the resulting box with \vsplit and try different heights until the columns come out close to equal. Version 1.5 added a quality check on top: each candidate is measured on TeX’s badness scale (0 is perfect, 10000 infinitely bad) and solutions worse than the counter columnbadness — default 10000 — are rejected. A companion counter finalcolumnbadness, default 9999, decides that a thinly filled last column is better left short than stretched into something ugly.

  • \raggedcolumns — do not align the bottoms of the columns; the default is \flushcolumns, which does
  • counter unbalance — make every column but the last N lines longer; reset at the end of each environment
  • counter minrows (default 1) — the minimum number of lines in the first column, for avoiding one-line columns
  • counter columnbadness (default 10000) — reject any solution whose badness exceeds this value
  • counter finalcolumnbadness (default 9999) — the limit above which a short final column is left short instead of stretched
  • \maxbalancingoverflow (default 12pt) — if the balanced columns overrun by more than this, balancing is abandoned and a normal page is made

In practice that leaves three moves. If you want to stay with twocolumn and only even out the final page, the balance and flushend packages patch the output routine to do it. The TeX FAQ cautions that both are liable to get confused in the presence of floats, and that manual adjustment of the figures may be needed when they do. The sturdier options are to wrap just the tail of the document in a multicols environment, or to accept a short right column — most journal styles do.

Choosing where a column breaks: \columnbreak and the rule between columns

\columnbreak ends the current column exactly where you put it and pushes the rest into the next one; it arrived in version 1.5u. Since 1.9 it takes an optional argument shaped like \pagebreak’s, from \columnbreak[0] (a mild preference) to \columnbreak[4] (forced). The same 1.9 added \newcolumn, which breaks the column and lets it run short. The reason not to reach for \pagebreak here is equally clear: inside multicols it would end the collection phase itself, closing every column on that page at once.

latex
\setlength{\columnsep}{1.5em}      % gap between columns
\setlength{\columnseprule}{0.4pt}  % show a rule in the gap
\renewcommand{\columnseprulecolor}{\color{gray}}
\begin{multicols}{2}
  Text of the left column.
  \columnbreak                    % push the rest into the next column
  Text of the right column.
\end{multicols}

The gap and the rule use the same \columnsep and \columnseprule as twocolumn, and multicol adds \columnseprulecolor on top (default \normalcolor, the ordinary text colour). Set them before entering the environment. There is one more setting the package changes without saying so: the tolerance for breaking lines. LaTeX’s usual \tolerance is 200, the value behind \fussy, and that is far too strict for a 38-character measure. So inside the environment multicol switches to \multicoltolerance, default 9999 — one step short of the 10000 that means “anything goes”, a pragmatic compromise for narrow columns. If justified text still gapes, the standard cures are \raggedright inside the environment or better hyphenation patterns for your language.

Why a figure disappeared inside multicols

Because ordinary floats are not implemented there, and anything you put in is thrown away. Write a figure or table environment — or a \marginpar — inside multicols and the log carries the warning Floats and marginpars not allowed inside 'multicols' environment!. The package documentation is blunt about the consequence: such floats will disappear. It also explains why. Implementing floats would mean rewriting LaTeX’s output routine from scratch, which was well beyond the weekend the first version took. Because this is a warning and not an error, the document still compiles. When a figure is missing and nothing else in the log looks wrong, search for that line first.

ConstructIn twocolumn modeInside multicols
figure / tableFloats normally within its columnNot allowed; a warning appears and the float is gone
figure* / table*Spans the page; default [tp], and b is unavailableWorks; t, b and p all apply, but never on the page where it is written
\marginparWorksNot allowed; it vanishes with the same warning
\columnbreakNot available; a page break is the only leverEnds the column at that point (since 1.5u)
\pagebreakCloses the pageEnds the collection phase, so every column on the page closes at once
\columnsepruleA vertical rule in the gap; default 0ptThe same, plus \columnseprulecolor for its colour

Starred floats do work inside multicols, but not the way they do under twocolumn. According to the documentation, a figure* there is handled much like an ordinary float on a single-column page: t, b and p all apply, and it consults \topfraction rather than \dbltopfraction. One restriction is absolute, though — it will never appear on the page where it was written. The earliest slot it can take is the top of the next page, which makes h meaningless. That is the source of the odd inversion: b is unavailable under twocolumn and available inside multicols.

So how do you put a small picture inside a column? The answer is: do not make it a float. Drop \includegraphics straight into a center environment and it stays exactly where you wrote it (inside the environment \linewidth is the column width, so width=\linewidth is the natural setting). If it needs a numbered caption, \captionof{figure}{…} from the caption package supplies one, keeping the numbering and cross-references intact. To wrap text around it, wrapfig is the other route. But the moment you realise that in-column floats are needed throughout the document, that is the signal to choose twocolumn rather than multicol.

latex
\usepackage{multicol}
\usepackage{graphicx}
\usepackage{caption}   % provides \captionof
% ... in the body
\begin{multicols}{2}
  Text before the picture.
  \begin{center}
    \includegraphics[width=\linewidth]{plot}
    \captionof{figure}{Not a float, so it stays where it is written.}
  \end{center}
  Text after the picture.
\end{multicols}