Tx · LaTeX & TikZ

How to Align Text on the Same Line in Two LaTeX Columns

Published By the 9to5Science editorial team

At a glance

  1. 1. Identify the layout

    Use multicol for continuous text flow, not for pairing corresponding lines across columns.

  2. 2. Choose a structure

    Use a table or aligned boxes when each left-hand item must match a right-hand item.

  3. 3. Set paired rows

    Put each pair in its own table row so both entries start at the same vertical position.

  4. 4. Check column widths

    Allow enough width for each entry, and use top-aligned paragraph columns when text wraps.

The multicol package is designed to make text flow from one column into the next. It does not treat the columns as two independent lists of corresponding lines, so a line on the left is not guaranteed to share a baseline with a related line on the right.

If you need labels, translations, comparisons, or other paired material to line up, use a structure that explicitly records each pair. A table is usually the most reliable choice. Use multicol when the text should read continuously across columns.

Why lines drift out of alignment

In a multicols environment, LaTeX lays out a continuous sequence of paragraphs and distributes it among the columns. The columns may have different line breaks because of their widths and content. The package can also balance the columns near the end of the environment. As a result, there is no rule that says the first line in one column must align with a particular line in the other.

A manual \columnbreak can choose where the next column begins, but it does not pair or synchronize the lines after the break. It is useful for controlling the flow of continuous text, not for making two lists line up row by row.

Align paired entries with a table

Put each left-right pair in a separate row. The example below uses tabularx so the two text columns divide the available width and wrap long entries. The p{...}-style columns are top-aligned, so when one entry wraps, the paired entry begins at the same row position.

\documentclass{article}
\usepackage{tabularx}
\usepackage{array}

\begin{document}

\noindent
\begin{tabularx}{\linewidth}{@{}>{\raggedright\arraybackslash}X
                                  >{\raggedright\arraybackslash}X@{}}
  First item in the left column & Matching item in the right column \\
  A longer left entry that wraps onto another line
    & Its paired right entry starts at the same row position \\
  Third item & Third matching item \\
\end{tabularx}

\end{document}

The X column type, provided by tabularx, expands to fill the available width. The >{...} declarations make the cell text ragged-right and restore the meaning of \\ inside paragraph columns. Each \\ ends a table row: entries in that row belong together, and the next pair starts below the taller cell in the previous row.

If the entries should not wrap, use ordinary l columns instead, but make sure their total width fits on the page. If you want visible separation between rows, add spacing such as \\[.5em] after a row.

Use two boxes for separate blocks

If you only need two blocks to start at the same height—not line-by-line correspondence—put them in top-aligned minipages:

\noindent
\begin{minipage}[t]{0.48\linewidth}
\vspace{0pt}
Left block of text. It can contain several lines or paragraphs.
\end{minipage}\hfill
\begin{minipage}[t]{0.48\linewidth}
\vspace{0pt}
Right block of text. It starts at the same height as the left block.
\end{minipage}

The [t] option requests top alignment, and \vspace{0pt} makes the top alignment reliable when the first material is ordinary text. These boxes align at their top edges; their later baselines will still differ if the text wraps differently. Choose a table with one row per pair when those later lines also need controlled alignment.

Common mistakes

  • Expecting multicols to behave like a table. It flows paragraphs between columns; it does not preserve row-by-row relationships.
  • Using \columnbreak as a line-alignment command. It controls where flow switches columns, but does not synchronize the content that follows.
  • Putting all paired content in one table cell. To align several pairs, make each pair a separate row.
  • Using fixed-width columns that are too narrow. Unexpected wrapping changes row heights and can make the layout look uneven. Adjust the widths or use tabularx to share the available line width.
  • Expecting top-aligned boxes to align every baseline. Minipages align their tops, not every line within them. Use table rows for paired lines.

In short, retain multicols for flowing prose. For content that must match across columns, encode the matches explicitly as rows or pairs of boxes.

References

  1. The multicol package — CTAN
  2. The tabularx package — CTAN

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