Tx · LaTeX & TikZ

How to Center Two Columns with the LaTeX multicol Package

Published By the 9to5Science editorial team

At a glance

  1. 1. Choose what to center

    Decide whether you want the column contents centered or the two-column block itself narrowed and centered.

  2. 2. Center item text

    Use a local centering declaration in each enumerate item; the labels will remain at the list margin.

  3. 3. Keep the full-width layout

    The multicols environment uses the available line width, so centering the environment does not move or narrow its columns.

  4. 4. Use a fixed-width layout

    For a narrower centered pair of columns, use a table-like layout rather than placing multicols inside a minipage.

The word “center” can mean two different things in a multicols layout: centering the text inside each column, or centering a narrower two-column block on the page. These need different approaches.

By default, multicols uses the full available line width and divides it into columns. The columns are already laid out symmetrically across that width. A surrounding center environment does not make the columns narrower; it only centers content that has a natural width smaller than the available width.

Center the text inside each column

For ordinary paragraphs, use \centering where you want centered paragraph alignment. If the columns contain an enumerate list, apply the declaration to each item’s text. This leaves the enumerate labels at the list margin while centering the item text in the space allotted to it.

Here is a complete example. It uses the multicol package; no additional package is required.

\documentclass{article}
\usepackage{multicol}

\begin{document}

\begin{multicols}{2}
  \begin{enumerate}
    \item {\centering First item\par}
    \item {\centering Second item, with a longer line of text\par}
    \item {\centering Third item\par}
    \item {\centering Fourth item\par}
  \end{enumerate}
\end{multicols}

\end{document}

The braces keep the centering declaration local to that item, and \par ends the centered paragraph. Without the braces, a declaration can affect following text in the list or document. For multi-paragraph items, apply centering to each paragraph you want centered.

To center regular paragraphs rather than list items, put \centering in a group around those paragraphs:

{\centering
Text in the first column.\par
More centered text.\par
}

The \par commands are needed because \centering sets paragraph formatting; it does not center text as an isolated inline object.

Center a narrower two-column block

multicols is designed to fill the width available to it. It is not a shrink-wrapped object that a surrounding center environment can position. In particular, putting multicols inside a minipage is not a reliable workaround: multicol uses LaTeX’s output routine to balance and construct columns, and it is not intended for use inside boxed contexts such as minipages.

If you need two narrow columns centered on the page, use a layout whose width you can specify. For a short, fixed set of entries, a tabular environment is a straightforward option:

\begin{center}
  \begin{tabular}{c@{\qquad}c}
    First entry  & Second entry \\
    Third entry  & Fourth entry
  \end{tabular}
\end{center}

Here, c centers the contents of each table column, and \qquad adds space between them. The table’s natural width is determined by its contents, so the center environment can center that narrower table. A table lays out entries row by row, however; it does not automatically split a long list vertically like multicols does.

If you want a long, vertically flowing list, keep multicols and adjust the surrounding page or list layout to provide the desired width. If the goal is a short two-column list with controlled spacing, a table-like list layout is usually simpler.

Common mistakes

  • Using \begin{center} around multicols to narrow the columns. The columns still use the available line width, so the environment has no narrower block to center.
  • Expecting \centering to center enumerate labels. It centers paragraph text; list labels are positioned separately by the list layout.
  • Applying \centering globally. The declaration can affect later paragraphs unless you limit its scope with braces or an environment.
  • Using \columnsep as a width control. This changes the gap between columns, not the overall width of the multicolumn block.
  • Putting multicols inside a minipage. The package relies on page-building behavior that boxed contexts do not provide in the usual way.

Choose the layout based on what should be centered: paragraph text, list-item text, or the entire two-column block.

References

  1. The multicol package documentation

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.