6

Note: Please do not mark it as a duplicate entry although it may appear similar to already answered questions on figures spanning two columns.

I am using the latest latex template provided by the Oxford bioinformatics Journal. I have a figure which spans two columns. The figure is placed correctly on the page, however, the figure caption appears in the first column of the page and text from the second column overlaps the figure. I tried using Figure*, but this makes the figure and the caption completely disappear from the document. I checked the bioinfo.cls file, but was not sure where to make changes. How should I correct this?

Here is the part of the class file which deals with figures and tables:

\def\thefigure{\@arabic\c@figure}
\def\fps@figure{tbp}
\def\ftype@figure{1}
\def\ext@figure{lof}
\def\fnum@figure{\figurename~\thefigure}
\def\figure{\@float{figure}}
\let\endfigure\end@float
\@namedef{figure*}{\@dblfloat{figure}}
\@namedef{endfigure*}{\end@dblfloat}
\def\thetable{\@arabic\c@table}
\def\fps@table{tbp}
\def\ftype@table{2}
\def\ext@table{lot}
\def\fnum@table{Table~\thetable}
\def\table{\let\@makecaption\@tablecaption\let\source\tablesource\@float{table}}
\def\endtable{\end@float}
\@namedef{table*}{\let\@makecaption\@tablecaption\@dblfloat{table}}
\@namedef{endtable*}{\end@dblfloat}

And, here is the code for my figure

\begin{figure}{!tbp}%figure1
    {\includegraphics[width=1.0\textwidth]{ToolInterface.png}}
    \caption{Tool caption here}\label{fig:01}
\end{figure}
9
  • 3
    Did you try with \begin{figure*}...\end{figure*}?
    – Ignasi
    Jul 19 '16 at 10:19
  • 3
    Possible duplicate of How to make a figure span on two columns in a scientific paper?
    – Ignasi
    Jul 19 '16 at 10:20
  • Yes. I did try it. And on doing this, the figure and do not appear on the file at all.
    – novicegeek
    Jul 19 '16 at 10:30
  • 1
    Did yo try the split environment, from cuted, possibly dropping figure, and using center and \captionof{figure}{…} instead?
    – Bernard
    Jul 19 '16 at 10:34
  • 1
    \captionof requires loading caption (recommended anyway if you put table captions above tables – as it should).
    – Bernard
    Jul 19 '16 at 12:06
9

This minimal example will definitely work [now edited so that it also works with the latest bioinfo.cls]:

\documentclass{bioinfo}
\copyrightyear{2005}
\pubyear{2005}

\access{Advance Access Publication Date: Day Month Year}
\appnotes{Manuscript Category}

\begin{document}

\firstpage{1}

\subtitle{Subject Section}
\title[Long title]{Long and boring title} 
\author[Author et al.]{The authors}
\address{Research Institute}
\history{Received on XXXXX; revised on XXXXX; accepted on XXXXX} 
\editor{Associate Editor: XXXXXXX}
\corresp{To whom correspondence should be addressed.}
\abstract{The abstract.}

\maketitle

Science!

\begin{figure*}
  \includegraphics[width=\textwidth]{example-image-a}
  \caption{A caption.}
\end{figure*}

\end{document}

Also, I wouldn't recommend changing the bioinfo.cls file if you're intending to submit this to the journal, as their submission system will use the original class file for compiling your latex document.

11
  • Thank you for the minimal example. But, I think I am doing something terribly wrong. First, for the minimal example, I get an error at \maketitle. The error is Undefined control sequence \maketitle. So, I cannot check if the minimal example is working for me. Secondly, I tried using \begin{figure*} in my code, and as reported earlier, the figure and caption completely disappeared from the document.
    – novicegeek
    Jul 19 '16 at 12:40
  • 1
    Sorry, my fault, I didn't realise that there had been a new version of the bioinfo.cls that requires more fields for the \maketitle command. I've edited the minimal example so that it works with the newer version.
    – FrankD
    Jul 19 '16 at 13:26
  • The minimal example works now. But, again. No figure visible. I un-commented the \includegraphics and name of the image file. No image visible :(
    – novicegeek
    Jul 19 '16 at 13:45
  • 1
    Perhaps try removing that file and installing the ly1 font definition using your package manager (e.g. if you're using texlive on Linux Mint, it's in the texlive-fonts-extra package).
    – FrankD
    Jul 19 '16 at 14:46
  • 1
    @novicegeek I suspect a bad installation, but this is a different problem than getting a two column figure. By the way, the class file has a typo and \renewcommand{\sfdefault}{phv} should be issued in the document in order to fix it.
    – egreg
    Jul 19 '16 at 15:54
8

So I can't seem to comment since my reputation isn't high enough, but I ran into the same problem and was able to solve it using FrankD's solution.

The problem is, figures seem to be pushed to the next page they appear in by the template. However, the template also forces pages to end when the text ends. So if the figure appears in the code on page 1, it wants to display it on page 2. But if the text ends at page 1 as FrankD's minimal example does, then page 2 is removed along with the figure. However, if you have enough text to make it to page 2, then the figure will show.

The following example will show the figure on page 2.

\documentclass{bioinfo}
\usepackage{lipsum} %Dummy text

\copyrightyear{2005}
\pubyear{2005}

\access{Advance Access Publication Date: Day Month Year}
\appnotes{Manuscript Category}

\begin{document}

\firstpage{1}

\subtitle{Subject Section}
\title[Long title]{Long and boring title} 
\author[Author et al.]{The authors}
\address{Research Institute}
\history{Received on XXXXX; revised on XXXXX; accepted on XXXXX} 
\editor{Associate Editor: XXXXXXX}
\corresp{To whom correspondence should be addressed.}
\abstract{The abstract.}

\maketitle

\lipsum[1-2] %Dummy text

\begin{figure*}
  \includegraphics[width=\textwidth]{workflow.png}
  \caption{ A caption.}
\end{figure*}

\lipsum[3-12] %Dummy text

\end{document}

If you put \lipsum[3-12] above \begin{figure*}, the figure will disappear (since it is being pushed to page 3).

2
  • 2
    Very helpful explanation :) I moved the figure description before all the text. And the figure was there on page 2 spanning both the columns. :)
    – novicegeek
    Aug 8 '16 at 7:42
  • This only partially works - I got several figures to fill up page 2 (out of 5), but any additional figure disappears entirely (As sleepyzelaot did, I put all of them before any text, but still only those that fit into a single page appear, all the rest just vanish, despite having 3 more text pages on which to display them.) Any advice would be appreciated.
    – Anon
    Dec 1 '20 at 9:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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