Tuesday, 25 May 2010

Switching to two-column layout in LaTeX

The default layout for an article in LaTeX is single-column, with quite large margins. The large margins are quite sensible, as they narrow the width of the column to make it easier for the reader to jump from one line to the next. However, when I write articles, I often include a lot of equations and figures, and these tend to create a lot of white space. The result is a massive number of pages which each has relatively little content, as illustrated by this example:



Switching to two-column layout is surprisingly easy -- just add the "twocolumn" option when declaring the document type, for example:

\documentclass[10pt,twocolumn]{article}

For figures, it is also useful to specify the width of the figure relative to the column width, like this:

\includegraphics[width=0.9\columnwidth]{Figures/figure1}

The result is a page with a lot mote information, which is also easier to read because of the columns are narrower than in the one-column layout. However, the pages also looks a bit crowded:



This is one of many cases where the geometry package comes in handy. Looking at the pages above, it seems that the separation between the columns is a bit too small, especially compared with the outer margins. We include the geometry package and increase both column separation and text width/height:

\usepackage[width = 18cm, height = 22cm, columnsep = 1cm]{geometry}

Note that these parameters are only a few of the parameters that can be set using the geometry package. Consult the documentation for further details. The end result is, in my opinion, quite pleasing compared with the initial one-column layout:



And, lastly, a small but useful detail: If you want a figure or table to span the width of both columns, add an asterisk when declaring the environment:

\begin{figure*}
...
\end{figure*}


If you found this interesting, check out Robert Felty's blog post on the same subject. Also, if you have any other tips concerning one-column versus two-column layouts - please share them here! :-)

0 comments:

Post a Comment