> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/formatting/09-multiple-columns.md).

# Multiple columns

## Introduction

Two-column documents can be easily created by passing the parameter `\twocolumn` to the document class statement. If you need more flexibility in the column layout, or to create a document with multiple columns, the package `multicol` provides a set of commands for that. This article explains how use the `multicol` package, starting with this basic example:

```latex
\documentclass{article}
\usepackage{blindtext}
\usepackage{multicol}
\title{Multicols Demo}
\author{Overleaf}
\date{April 2021}

\begin{document}
\maketitle

\begin{multicols}{3}
[
\section{First Section}
All human things are subject to decay. And when fate summons, Monarchs must obey.
]
\blindtext\blindtext
\end{multicols}

\end{document}
```

[Open this `multicols` example in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=multicols+package+demo\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bblindtext%7D%0A%5Cusepackage%7Bmulticol%7D%0A%5Ctitle%7BMulticols+Demo%7D%0A%5Cauthor%7BOverleaf%7D%0A%5Cdate%7BApril+2021%7D%0A%0A%5Cbegin%7Bdocument%7D%0A%5Cmaketitle%0A%0A%5Cbegin%7Bmulticols%7D%7B3%7D%0A%5B%0A%5Csection%7BFirst+Section%7D%0AAll+human+things+are+subject+to+decay.+And+when+fate+summons%2C+Monarchs+must+obey.%0A%5D%0A%5Cblindtext%5Cblindtext%0A%5Cend%7Bmulticols%7D%0A%0A%5Cend%7Bdocument%7D)

![3 column example](/files/engPns4zJgdfQQx0VLmK)

To import the package, the line

```latex
\usepackage{multicol}
```

is added to the preamble. Once the package is imported, the environment `multicols` can be used. The environment takes two parameters:

* Number of columns. This parameter must be passed inside braces, and its value is 3 in the example.
* "Header text", which is inserted in between square brackets. This is optional and will be displayed on top of the multicolumn text. Any LaTeX command can be used here, except for floating elements such as figures and tables. In the example, the section title and a small paragraph are set here.

The text enclosed inside the tags `\begin{multicols}` and `\end{multicols}` is printed in multicolumn format.

## Column separation

The column separation is determined by `\columnsep`. See the example below:

```latex
\documentclass{article}
\usepackage{blindtext}
\usepackage{multicol}
\setlength{\columnsep}{1cm}
\title{Second multicols Demo}
\author{Overleaf}
\date{April 2021}

\begin{document}
\maketitle

\begin{multicols}{2}
[
\section{First Section}
All human things are subject to decay. And when fate summons, Monarchs must obey.
]
\blindtext\blindtext
\end{multicols}

\end{document}
```

[Open this `multicols` example in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=multicols+package+demo\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bblindtext%7D%0A%5Cusepackage%7Bmulticol%7D%0A%5Csetlength%7B%5Ccolumnsep%7D%7B1cm%7D%0A%5Ctitle%7BSecond+multicols+Demo%7D%0A%5Cauthor%7BOverleaf%7D%0A%5Cdate%7BApril+2021%7D%0A%0A%5Cbegin%7Bdocument%7D%0A%5Cmaketitle%0A%0A%5Cbegin%7Bmulticols%7D%7B2%7D%0A%5B%0A%5Csection%7BFirst+Section%7D%0AAll+human+things+are+subject+to+decay.+And+when+fate+summons%2C+Monarchs+must+obey.%0A%5D%0A%5Cblindtext%5Cblindtext%0A%5Cend%7Bmulticols%7D%0A%0A%5Cend%7Bdocument%7D)

![A two column example](/files/ckTUDgRimJmLW9fWhvp4)

Here, the command `\setlength{\columnsep}{1cm}` sets the column separation to 1cm. See [Lengths in LaTeX](/latex/formatting/01-lengths-in-latex.md) for a list of available units.

## Unbalanced columns

In the default `multicols` environment the columns are balanced so each one contains the same amount of text. This default format can be changed by the starred environment `multicols*`:

```latex
\documentclass{article}
\usepackage{blindtext}
\usepackage{multicol}
\setlength{\columnsep}{1cm}
\title{Second multicols Demo}
\author{Overleaf}
\date{April 2021}
\begin{document}
\maketitle
\begin{multicols*}{3}
[
\section{First Section}
All human things are subject to decay. And when fate summons, Monarchs must obey.
]
\blindtext\blindtext
\end{multicols*}

\end{document}
```

[Open this `multicols` example in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=multicols+package+demo\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bblindtext%7D%0A%5Cusepackage%7Bmulticol%7D%0A%5Csetlength%7B%5Ccolumnsep%7D%7B1cm%7D%0A%5Ctitle%7BSecond+multicols+Demo%7D%0A%5Cauthor%7BOverleaf%7D%0A%5Cdate%7BApril+2021%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cmaketitle%0A%5Cbegin%7Bmulticols%2A%7D%7B3%7D%0A%5B%0A%5Csection%7BFirst+Section%7D%0AAll+human+things+are+subject+to+decay.+And+when+fate+summons%2C+Monarchs+must+obey.%0A%5D%0A%5Cblindtext%5Cblindtext%0A%5Cend%7Bmulticols%2A%7D%0A%0A%5Cend%7Bdocument%7D)

![3 column demo](/files/wvr7zpgxfKjbiETasUEU)

If you open this example on Overleaf you'll see that the text is printed in a column till the end of the page is reached, then the in continues in the next column, and so on.

## Inserting floating elements

Floating elements (tables and figures) can be inserted in a multicolumn document with `wrapfig` and `wraptable`. The following LaTeX code fragment, which is not a complete LaTeX document, shows how to use floating elements. Please use the link below the code to open a full LaTeX document that you can compile on Overleaf.

```latex
\begin{multicols}{2}
[
\section{First Section}
All human things are subject to decay. And when fate summons, Monarchs must obey.
]

Hello, here is some text without a meaning.  This text should show what
a printed text will look like at this place.
If you read this text, you will get no information.  Really?  Is there
no information?  Is there.

\vfill

\begin{wrapfigure}{l}{0.7\linewidth}
\includegraphics[width=\linewidth]{overleaf-logo}
\caption{This is the Overleaf logo}
\end{wrapfigure}

A blind text like this gives you information about the selected font, how
the letters are written and an impression of the look.  This text should
contain all...

\begin{wraptable}{l}{0.7\linewidth}
\centering
\begin{tabular}{|c|c|}
\hline
Name & ISO \\
\hline
Afghanistan & AF \\
Aland Islands & AX \\
Albania    &AL  \\
Algeria   &DZ \\
American Samoa & AS \\
Andorra & AD   \\
Angola & AO \\
\hline
\end{tabular}
\caption{Table, floating element}
\label{table:ta}
\end{wraptable}

\end{multicols}
```

![MulticolumnsEx4OverleafV2.png](/files/k8Ih3p5C8rjGFRmZov0Y)

[Open this `multicols` example in an Overleaf LaTeX project](https://www.overleaf.com/project/new/template/19510?id=65969509\&templateName=A+multicols+demo\&latexEngine=pdflatex\&texImage=texlive-full%3A2020.1\&mainFile=)

Floats in the **multicol** package are poorly supported in the current version. Elements inserted with the conventional `figure*` and `table*` environments will show up only at the top or bottom of the next page after they are inserted, and will break the layout. The example presented here is a workaround, but you may expect some rough edges. For instance, if the float width is set to `\linewidth` it causes a weird text overlapping. This said, below is a brief description of the commands:

* `\usepackage{wrapfig}`. Put this line in the preamble to import the package **wrapfig**
* The environment `wrapfigure` will insert a figure wrapped in the text. For more information and further examples about this environment see [Positioning images and tables](/latex/figures-and-tables/02-positioning-images-and-tables.md).
* The environment `wraptable` is the equivalent to *wrapfigure* but for tables. See [Positioning images and tables](/latex/figures-and-tables/02-positioning-images-and-tables.md) for more information.

## Inserting vertical rulers

A vertical ruler can be inserted as column separator to may improve readability in some documents:

```latex
\documentclass{article}
\usepackage{blindtext}
\usepackage{multicol}
\usepackage{color}
\setlength{\columnseprule}{1pt}
\def\columnseprulecolor{\color{blue}}

\begin{document}

\begin{multicols}{3}
[
\section{First Section}
All human things are subject to decay. And when fate summons, Monarchs must obey.
]
Hello, here is some text without a meaning.  This text should show what
a printed text will look like at this place.

If you read this text, you will get no information.  Really?  Is there
no information?  Is there.

\columnbreak
\blindtext
This will be in a new column, here is some text without a meaning.  This text
should show what a printed text will look like at this place.

If you read this text, you will get no information.  Really?  Is there
no information?  Is there...
\end{multicols}

\blindtext

\end{document}
```

[Open this `multicols` example in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=multicols+package+demo\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bblindtext%7D%0A%5Cusepackage%7Bmulticol%7D%0A%5Cusepackage%7Bcolor%7D%0A%5Csetlength%7B%5Ccolumnseprule%7D%7B1pt%7D%0A%5Cdef%5Ccolumnseprulecolor%7B%5Ccolor%7Bblue%7D%7D%0A%0A%5Cbegin%7Bdocument%7D%0A%0A%5Cbegin%7Bmulticols%7D%7B3%7D%0A%5B%0A%5Csection%7BFirst+Section%7D%0AAll+human+things+are+subject+to+decay.+And+when+fate+summons%2C+Monarchs+must+obey.%0A%5D%0AHello%2C+here+is+some+text+without+a+meaning.++This+text+should+show+what+%0Aa+printed+text+will+look+like+at+this+place.%0A%0AIf+you+read+this+text%2C+you+will+get+no+information.++Really%3F++Is+there+%0Ano+information%3F++Is+there.%0A%0A%5Ccolumnbreak%0A%5Cblindtext%0AThis+will+be+in+a+new+column%2C+here+is+some+text+without+a+meaning.++This+text+%0Ashould+show+what+a+printed+text+will+look+like+at+this+place.%0A%0AIf+you+read+this+text%2C+you+will+get+no+information.++Really%3F++Is+there+%0Ano+information%3F++Is+there...%0A%5Cend%7Bmulticols%7D%0A%0A%5Cblindtext%0A%0A%5Cend%7Bdocument%7D)

![rule between columns example](/files/LAtNq5eeGdsVXPWW2mxk)

If you open this example on Overleaf you will see the column separator can be set to a specific colour also. Below a description of each command:

**\usepackage{color}.**

This line is inserted in the preamble to enable the use of several colours within the document.

**\setlength{\columnseprule}{1pt}**

This determines the width of the ruler to be used as column separator, it's set to 0 by default. In the example a column whose width is 1pt is printed.

**\def\columnseprulecolor{\color{blue}}**

The colour of the separator ruler is set to blue. See the article about using colours in LaTeX for more information on colour manipulation.

**\columnbreak**

This command inserts a column breakpoint. In this case, the behaviour of the text is different from what you may expect. The column break is inserted, then the paragraphs before the breakpoint are evenly distributed to fill all available space. In the example, the second paragraph is at the bottom of the column and a blank space is inserted in between the second and the first paragraphs.

## Further reading

For more information see:

* [Paragraphs and new lines](/latex/latex-basics/02-paragraphs-and-new-lines.md)
* [Bold, italics and underlining](/latex/latex-basics/03-bold-italics-and-underlining.md)
* [Lists](/latex/latex-basics/04-lists.md)
* [Inserting Images](/latex/more-topics/27-inserting-images.md)
* [Tables](/latex/figures-and-tables/01-tables.md)
* [Positioning images and tables](/latex/figures-and-tables/02-positioning-images-and-tables.md)
* [Lengths in LaTeX](/latex/formatting/01-lengths-in-latex.md)
* [Paragraph formatting](/latex/formatting/04-articles-how-to-change-paragraph-spacing-in-latex.md)
* [Page size and margins](/latex/formatting/07-page-size-and-margins.md)
* [Single sided and double sided documents](/latex/formatting/08-single-sided-and-double-sided-documents.md)
* [Using colours in LaTeX](/latex/formatting/13-using-colors-in-latex.md)
* [Footnotes](/latex/formatting/14-footnotes.md)
* [Margin notes](/latex/formatting/15-margin-notes.md)
* [**multicols** package documentation](http://mirrors.ctan.org/macros/latex/required/tools/multicol.pdf).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/formatting/09-multiple-columns.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
