TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The Oxford Bioinformatics journal's template is one of my favorites and I use it for many of my school assignments. The template uses a two-column layout, but in an appendix at the end of the document I would like to include some source code. This of course looks horrible in the two-column layout, but I have been unable to suppress the two-column mode using multicol macros. Is there any way I can do this?

share|improve this question
Try the \figure* environment and put your source code inside. – Harish Kumar Mar 24 '12 at 14:43
@HarishKumar Excellent idea. I tried it myself, and it would have worked...except that the source code is longer than a single page. :( – Daniel Standage Mar 24 '12 at 15:23
up vote 7 down vote accepted

Just put \onecolumn before the appendix. Note that the commands \onecolumn and \twocolumn start a new page.

share|improve this answer
This worked. Thanks! – Daniel Standage Mar 25 '12 at 3:27

You can put your source code inside a starred version of figure which will span both the columns in a two column document ( a misuse but for good).

  Your source code here.
  \caption{The source code for bla bla bla}

But these starred versions will either put the figure in a new page of their own or at the top of the page. (htbp do not work so neatly) To cure this one can load


in the preamble. Then the place holders option [tbp] can be used to put the figure at top, bottom of the page or in a new page. But [h] will still not be available.

Reference: wikibook

share|improve this answer

Insert the following in the preamble to be able to have full width code, and multicolumn text:

     showspaces=false,  % shows spacing symbol
     aboveskip=0pt, % compact the code looks ugly in type
     belowskip=0pt,  % user responsible to insert any skips
      backgroundcolor=\color{gray!15}, #1
%% Hack to have one column environments for Code

In the Appendix code is written as:


enter image description here

As a general suggestion add text in between code fragments rather than a long code listing it will look better.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.