2

I use oxford bioinfomatics latex template available at:

http://www.oxfordjournals.org/our_journals/bioinformatics/for_authors/cabios-template.zip

Main file content is modified only by adding packages and an empty table in method section.

If I load hyperref package (line 6) an error is raised: Package calc Error: 'D' invalid at this point.

Is it possible to use hyperref on this latex template?

Thanks for your help

Note: I put the template on sharelatex you can live test it (2 compilations are needed): https://fr.sharelatex.com/project/582c3477343d34b37017330e

\documentclass{bioinfo}
\usepackage{caption, slashbox,multirow}
\usepackage{algorithm,algorithmicx}
\usepackage{amsmath,mathtools}
\usepackage{lmodern,microtype}
%\usepackage[unicode,colorlinks,citecolor={blue},urlcolor={blue},breaklinks]{hyperref}
\usepackage{hypcap}
\copyrightyear{2015} \pubyear{2015}
\access{Advance Access Publication Date: Day Month Year}
\appnotes{Manuscript Category}

\begin{document}
\firstpage{1}

\subtitle{Subject Section}

\title[short Title]{This is a title}
\author[Foo \textit{et~al}]{Foo\,$^{\text{\sfb1,2,3,}*}$ \footnote{to whom correspondence should be addressed}}
\address{Bar}


\corresp{$^\ast$To whom correspondence should be addressed.}

\history{Received on XXXXX; revised on XXXXX; accepted on XXXXX}

\editor{Associate Editor: XXXXXXX}

\abstract{\textbf{Motivation:} Text Text Text Text Text Text Text Text Text Text Text Text Text
Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text
Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text
Text Text Text Text Text Text
Text Text Text Text Text.\\
\textbf{Results:} Text  Text Text Text Text Text Text Text Text Text  Text Text Text Text Text
Text Text Text Text Text Text Text Text Text Text Text Text Text  Text Text Text Text Text Text\\
\textbf{Availability:} Text  Text Text Text Text Text Text Text Text Text  Text Text Text Text
Text Text Text Text Text Text Text Text Text Text Text Text Text Text  Text\\
\textbf{Contact:} \href{name@bio.com}{name@bio.com}\\
\textbf{Supplementary information:} Supplementary data are available at \textit{Bioinformatics}
online.}

\maketitle

\section{Introduction}

\section{Approach}


\begin{methods}
\section{Methods}

Table~\ref{table:new}

\begin{table*}[!ht]
    \processtable{A table \label{table:new}}{}{This is a footnote}
\end{table*}

\end{methods}



\section{Discussion}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%     please remove the " % " symbol from \centerline{\includegraphics{fig01.eps}}
%     as it may ignore the figures.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\section{Conclusion}



\section*{Acknowledgements}

\section*{Funding}

This work has been supported by the... Text Text  Text Text.\vspace*{-12pt}

\bibliographystyle{natbib}
%\bibliographystyle{achemnat}
%\bibliographystyle{plainnat}
%\bibliographystyle{abbrv}
%\bibliographystyle{bioinformatics}
%
%\bibliographystyle{plain}
%
%\bibliography{Document}
\bibliography{document}

\end{document}
4
  • Off-topic: There is no bibliography style called natbib. If you plan on generating a bibliography using BibTeX and the natbib citation management package, you should delete all instances of \bibliographystyle{natbib}, provide the instruction \usepackage{natbib} in the preamble, and uncomment one of the other \bibliographystyle{...} directives.
    – Mico
    Nov 16, 2016 at 10:26
  • @Mico For some reason the journal lumps a natbib.bst file with the LaTeX templates (and requests authors use \bibliographystyle{natbib}) and the journal class file loads the natbib package, so while the journal has chosen a terrible name for the bst file, the template given above is technically correct for producing the desired output.
    – Dai Bowen
    Nov 16, 2016 at 10:51
  • Interesting, \documentclass{bioinfo} \usepackage{hyperref} \begin{document} Foo \end{document} is in fact a sufficient MWE - must be something internal to the bioinfo class file.
    – Dai Bowen
    Nov 17, 2016 at 0:16
  • 1
    I note bioinfo.cls includes the line \newcommand{\href}[2]{#2} which makes it seem like they don't want any hyperlinks in the generated PDF, maybe there's some deliberate clash between hyperref and bioinfo although that seems a bit silly. You may be best of contacting the journal itself with this problem.
    – Dai Bowen
    Nov 17, 2016 at 0:23

4 Answers 4

3

Add

\let\href\undefined

right before \usepackage{hyperref}.


Thanks to Dai Bowen for identifying the problem, and Stefan Kottwitz for providing a similar solution in "How to patch a package".

1

Just a comment to solution #3: (\let\href\undefined): it does NOT work if you compile with pdflatex. The hyperref package conflicts with the bioinfo.cls and margins are unset which totally unformats the paper.

The solution I have found is this:

\let\href\undefined
\usepckage[divpdfm]{hyperref}

and then, compile with LaTeX and later make dvipdfm your_file.dvi. An additional side-effect is that, if you use the graphicx package, you will have to use .eps as graphical format for your figures (not .png, .jpg, etc.). One of the many programs you may use to change format is the convert command in the ImakeMagik package.

0
1

Overleaf provides a template of the Bioinformatics journal and it seems to work well with the hyperref package.

I compared it with the .zip template which was downloaded from the Bioinformatics website, and then realized it's the chngpage.sty to blame. (It's still an old version v1.1b while its v1.2 made some changes for hyperref.)

So the advice is to delete all the .sty files in the downloaded template.

0

The accepted solution did not work for me. However, I have found the easiest way to tackle this problem is by changing the citation color manually like the following:

\renewcommand{\cite}[1]{{\color{blue} \textsc{\citeauthor{#1}} (\citeyear{#1})}} \renewcommand{\citep}[1]{({\color{blue} \textsc{\citeauthor{#1}} \citeyear{#1}})}

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.