Tx · LaTeX & TikZ

How to Align Two Text Blocks Side by Side in LaTeX

Published By the 9to5Science editorial team

At a glance

  1. 1. Choose the layout

    Use minipages for two separate blocks; use multicols when one continuous text should flow between columns.

  2. 2. Set the widths

    Give each minipage a width that fits, leaving room for the horizontal space between them.

  3. 3. Align the tops

    Use the [t] option and start each minipage with \vspace{0pt} for reliable top alignment.

  4. 4. Check the result

    Compile and adjust widths or vertical spacing if the blocks do not fit the page.

To place two separate pieces of text next to each other at the same vertical level, use two minipage environments. The [t] option aligns their tops, and \hfill puts flexible horizontal space between them. This is usually the right approach for independent columns such as translations, comparisons, or paired notes.

The multicol package solves a different problem: it typesets one continuous body of text across multiple columns. The text fills one column and then continues into the next, so it is not the best tool for positioning two independent blocks side by side.

Align independent text blocks with minipages

A minipage acts like a small page inside the main page. You can set its width and put paragraphs, headings, lists, or other ordinary LaTeX material inside it. For two blocks that should start at the same height, use [t] for top alignment.

Here is a complete example that compiles with standard LaTeX:

\documentclass{article}

\begin{document}

\noindent
\begin{minipage}[t]{0.47\textwidth}
\vspace{0pt}
\textbf{First block}

This is the first piece of text. It can continue for several lines
without changing the position where the second block begins.
\end{minipage}
\hfill
\begin{minipage}[t]{0.47\textwidth}
\vspace{0pt}
\textbf{Second block}

This is a separate piece of text. Its first line starts at the same
height as the first line in the left-hand block.
\end{minipage}

\end{document}

The two widths total 0.94\textwidth, leaving space for \hfill to stretch between the blocks. The \noindent prevents paragraph indentation before the first minipage. The \vspace{0pt} at the start of each one helps ensure that the top alignment is consistent, including when the content starts with something other than a normal line of text.

Change 0.47\textwidth to suit your margins and the gap you want. Keep the sum of both widths below \textwidth; otherwise, the blocks may wrap onto separate lines. Within a minipage, \textwidth refers to the width of that minipage, so it is often convenient to size material inside each block relative to its local width.

When to use multicols

If you want a long passage to fill one column and continue automatically in the next, use multicols from the multicol package:

\documentclass{article}
\usepackage{multicol}

\begin{document}

\begin{multicols}{2}
This is one continuous passage. LaTeX fills the first column and then
continues the text in the second column. Add enough text to see the
columns fill; the package can balance the columns at the end of the
multicols environment.
\end{multicols}

\end{document}

Here, {2} requests two columns. Unlike the minipage example, you do not assign each column separate content: LaTeX flows the passage between them. If you need a particular sentence or paragraph to begin in the right column, a column-break command such as \columnbreak can control where the flow continues.

Common alignment problems

  • The blocks appear one below the other. Their combined widths, plus any fixed horizontal space, may exceed the available line width. Reduce the minipage widths or use stretchable space such as \hfill.
  • The tops do not look aligned. Check that both environments use [t], and place \vspace{0pt} immediately after each \begin{minipage}. Different material at the start of a block can otherwise make the alignment look uneven.
  • The columns have unequal lengths. That is expected with minipages: each is an independent block and ends when its own content ends. Add content or adjust spacing if you need their bottoms to line up; use multicols if you want continuous text balanced across columns.
  • You used \begin{multicols}{2} for two unrelated texts. multicols is designed for flowing text, not for assigning one fixed text block to each column. Use minipages when you need separate content in each side.

For fixed, side-by-side content, start with top-aligned minipages. Choose multicols when your goal is columnar page layout rather than a pair of independently positioned text blocks.

References

  1. The multicol package

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