LaTeX two column layouts and rubber lengths

Today I gave my advisor the draft of the final chapter of my dissertation, which I have been working on fervently for the last week or so. I decided that I deserved a little break before getting back to the grindstone of implementing comments from my advisor. I decided to spend some time working on the two column layout of my dissertation.

Two columns! You may be thinking that I am crazy. Certainly my institution wouldn’t allow me to use a two column layout for my dissertation! That is indeed correct. The requirements set by the University of Michigan produce a pretty ugly document — one-sided, double-spaced (or 1.5), and running headers aren’t allowed. They actually don’t specify if you can use two columns or not, but I didn’t even bother asking, because I am pretty certain the answer is no. Now, just because the official copy that I hand in has to look boring doesn’t mean that I can’t make a nice copy for myself, and for other people I give a copy, like the members of my committee. And with LaTeX, that is relatively easy to do.

original format two column format
one column layout one column layout

Many scholarly journals, especially scientific journals use a two column layout. There are good reasons for this. When reading text, one of the most difficult tasks is to move down a line. Most languages of the world (but not all) are read either right to left or left to right, which means that moving down a line means moving your eyes all the way across the width of the text. As the width of a text gets wider, so does this task. For this reason, many books use relatively small paper. A common novel usually has paper sized about 6in x 8in. This is fine for books which are professionally printed, but the printing of a dissertation is usually restricted to standard 8.5 x 11 inch paper. Having a one column format (with reasonable margins of 0.5 to 1 inch) on 8.5 x 11 inch paper is very hard to read. A two column layout is much easier for readers.

For the most part, making a two column layout in LaTeX is extremely easy. Simply specify twocolumn in the document class definition:

\documentclass[letterpaper, twosided, twocolumn]{book}

However, one quickly notices that some things need adjusting. First off, equations, figures, and tables which are too wide to fit in one column need to be specified as double column width. For figures and tables, simply use table* and figure* environments. Equations can be a bit trickier, but luckily I didn’t have any really long equations. In addition, using table* in a one-column document doesn’t have any effect, which makes it very easy to switch back and forth between one and two column layouts. (Note that LaTeX only allows two-column floats at the top of the page by default, though some different class files, such as JASAtex, get around this somehow).

Some of the main jobs of LaTeX are:

  1. format text into fully justified paragraphs, hyphenating when necessary
  2. Break pages at appropriate places (i.e. don’t start a new section at the bottom of a page, or leave one line stranded on an otherwise blank page
  3. place tables and figures in appropriate positions

In a two column layout, all of these jobs get a little trickier. LaTeX uses several parameters which controls the behavior of the processes that handle these jobs. LaTeX realizes that hyphenating words at line breaks should be avoided if possible, but sometimes it is necessary in order to have justified text which has approximately equal inter-word spacing. In a two column layout, each column usually has fewer characters than in a one column layout, which means that more words will be hyphenated. If you don’t like this, you can increase the \hypenpenalty, which will cause LaTeX to hyphenate fewer words, and instead be a little sloppier about inter-word spacing

% don't hyphenate so much - default = 200, max (never hyphenate) = 10,000

You may also wish to alter float placement a bit. By default, LaTeX puts figures and tables on their own page if they take up more than 70% of a page, and says that float pages should be at least 70% full of floats. I would prefer to squeeze a bit more onto a page, so I increase these values a bit:

%two column float page must be 90% full
%two column top float can cover up to 80% of page
%float page must be 90% full
%top float can cover up to 80% of page
%bottom float can cover up to 80% of page
%at least 10% of a normal page must contain text

There are a few more parameters which you can tweak to save a little space. Now that we have big floats on a page, we might need to make a little more room for text, so we can decrease the textfloatsep from the default value of 20pt

%separation between floats and text
\setlength\dbltextfloatsep{9pt plus 5pt minus 3pt }
%separation between two column floats and text
\setlength\textfloatsep{10pt plus 4pt minus 3pt}

Now those rubber lengths. Notice that the above lengths include plus and minus. What this says is that the dbltextfloatsep should be 9pt, but can be anywhere between 6pt and 14pt. Rubber lengths allow LaTeX to adjust spacing (in this case vertical spacing), to make better page breaks. Looking at the code from the standard book.cls, we will also find rubber lengths in the definition of sectioning commands, e.g.:

\newcommand\section{\@startsection {section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%

While I still have yet to find exactly what all this means, I am pretty sure that the two middle lines specify how much space should come before and after the section heading. This says that there should be between -4.5ex and -3.3ex before the heading, and 2.3ex to 2.5ex after the heading, before the beginning of the section text. It also says that the font of the heading should be Large and bold. While this looks quite nice by default, I found the spacing too large for a two column layout, so I redefined some of these commands:

\renewcommand\section{\@startsection {section}{1}{\z@}%
{-1.5ex \@plus -.5ex \@minus -.8ex}%
{1.5ex \@plus.2ex \@minus .2ex}%
{-1ex\@plus -.4ex \@minus -.4ex}%
{1ex \@plus .2ex \@minus .2ex}%
{2ex \@plus1ex \@minus.3ex}%

Notice that for subsubsection, the lengths seem to be reversed, in that the first length is positive, and the second is negative. This has the effect that the heading is placed on the same line as the text, instead of on a separate line. Paragraphs and subparagraphs are formatted like this, but I wanted it for subsubsection, which is the lowest level of sectioning I use in my dissertation.

I made one additional modification to all these parameters. The default space between columns seems to be about .1in, which is not very much. I increased this to .25in.


With just a little tweaking, I turned the default formatting into a very professional looking document.

Addendum — equations

Several people have asked about how to handle long equations. There is no great way, and it will depend on your equation. If you absolutely need the whole page, you have to put the equation in a figure* or table* environment, which means that it can only appear at the top of a page. Other options are to split the equation up into multiple lines, make the font a bit smaller, or go into the margins a bit. I used all of these techniques for one equation in my dissertation. Here is the code:

\frac{\displaystyle\prod_{i=1}^{n} p(PS_i|PS_i)\cdot Freq_S}
{\left\{\left[\displaystyle\prod_{i=1}^{n} p(PS_i|PS_i)\right]\cdot
Freq_S\right\} +
\displaystyle\sum_{j=1}^{nn} \left\{\left[\displaystyle\prod_{i=1}^{n}
p(PN_{ij}|PS_i)\right]\cdot Freq_{Nj}\right\}

And the resulting output.

screenshot of a long equation

screenshot of a long equation that uses the margins a bit, has smaller font, and uses multiple lines

It is not perfect, but I am pretty happy with the results.

55 Replies to “LaTeX two column layouts and rubber lengths”

  1. [url=]hips and thighs diet[/url] ocellaris clownfish diet diet plan for a runner [url=]eat of blood type diet a[/url] using ensure for a diet liquid shake diets [url=]dietetics studies[/url] weight loss program for teenagers in mississippi weight watchers how points lose weight [url=]diet stalls[/url] balanced diets for athletes articles on dietary supplements [url=]how t olose stomach fat without diet[/url] natural diet recipes consumer reviews best diet pills [url=]song from diet coke with lime commercial[/url] ibs dietary guidelines a healthy diet at [url=]urge incontinence diet[/url] braks diet smoothie for weight loss [url=]suppressant diet[/url] first national bank of dieterich biliary colic diet [url=]christianity dietary laws[/url] broccoli diet brain mediterranean diet daily menu [url=]raquel welchs diet secrets[/url] chinese weight loss on abc change in stool color while on diet [url=]diet as tolerated for dengue patient[/url] monaslim diet pill no rx order weight loss clinical research [url=]dieta gastrite[/url] diaic diet donts weight gain diet plan for women [url=]post pardom diet[/url] jewish dietary laws origin dietary level [url=]la weight loss eating[/url] lo carb diet menstral cycle carol vorderman 30 day cellulite diet
    [url=]healthy mexican diet plans dietetica a [/url]
    [url=]are there safe diet pills diet mountin dew [/url]
    [url=]loss 10 pound diet n diethyl p phenylenediamine [/url]
    [url=]diet food delivered bonita california best lifed diet mag [/url]
    [url=]37.5 diet mg phentermine pill modified fat diet [/url]

  2. I loved up to you’ll receive carried out proper here. The sketch is attractive, your authored material stylish. however, you command get bought an nervousness over that you would like be turning in the following. sick unquestionably come further until now again since precisely the same just about very steadily within case you shield this increase.

Comments are closed.