Multiple columns

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:

\documentclassarticle> \usepackageblindtext> \usepackagemulticol> \titleMulticols Demo> \authorOverleaf> \dateApril 2021> \begindocument> \maketitle \beginmulticols>3> [ \sectionFirst Section> All human things are subject to decay. And when fate summons, Monarchs must obey. ] \blindtext\blindtext \endmulticols> \enddocument> 


3 column example

To import the package, the line

\usepackagemulticol> 

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

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

Column separation

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

\documentclassarticle> \usepackageblindtext> \usepackagemulticol> \setlength\columnsep>1cm> \titleSecond multicols Demo> \authorOverleaf> \dateApril 2021> \begindocument> \maketitle \beginmulticols>2> [ \sectionFirst Section> All human things are subject to decay. And when fate summons, Monarchs must obey. ] \blindtext\blindtext \endmulticols> \enddocument> 


A two column example

Here, the command \setlength sets the column separation to 1cm. See Lengths in LaTeX 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* :

\documentclassarticle> \usepackageblindtext> \usepackagemulticol> \setlength\columnsep>1cm> \titleSecond multicols Demo> \authorOverleaf> \dateApril 2021> \begindocument> \maketitle \beginmulticols*>3> [ \sectionFirst Section> All human things are subject to decay. And when fate summons, Monarchs must obey. ] \blindtext\blindtext \endmulticols*> \enddocument> 


3 column demo

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.

\beginmulticols>2> [ \sectionFirst 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 \beginwrapfigure>l>0.7\linewidth> \includegraphics[width=\linewidth]overleaf-logo> \captionThis is the Overleaf logo> \endwrapfigure> 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. \beginwraptable>l>0.7\linewidth> \centering \begintabular>|c|c|> \hline Name & ISO \\ \hline Afghanistan & AF \\ Aland Islands & AX \\ Albania &AL \\ Algeria &DZ \\ American Samoa & AS \\ Andorra & AD \\ Angola & AO \\ \hline \endtabular> \captionTable, floating element> \labeltable:ta> \endwraptable> \endmulticols> 

MulticolumnsEx4OverleafV2.png


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:

Inserting vertical rulers

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

\documentclassarticle> \usepackageblindtext> \usepackagemulticol> \usepackagecolor> \setlength\columnseprule>1pt> \def\columnseprulecolor\colorblue>> \begindocument> \beginmulticols>3> [ \sectionFirst 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. \endmulticols> \blindtext \enddocument> 


rule between columns example

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 . This line is inserted in the preamble to enable the use of several colours within the document. \setlength 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> The colour of the separator ruler is set to blue. See the article about using colours in L a T e X 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: