1

I am using the bio.cls style file from OUP. However, there is a conflict which happens when i use hyperref.

I use:

 \usepackage[colorlinks=true]{hyperref}

and the compilation gives the following familiar error see this link and here also

between hyperref and newlabel.

Runaway argument?
{{}{1}{}{page.
! Paragraph ended before \@newl@bel was complete.
<to be read again> 
                   \par 
l.20 \newlabel{firstpage}{{}{1}{}{page.\par
                                            }{}}

From what i understand, this is caused by hyperref. Is there a way to protect the newlabel (which I do not appear to have control over) and still use hyperref?

Here is a sort of MWE.

Here is the example using the journals style file available here.

\documentclass[oupdraft]{bio}
\usepackage[colorlinks=true, urlcolor=citecolor, linkcolor=citecolor, citecolor=citecolor]{hyperref}

% Add history information for the article if required \history{Received August 1, 2010; revised October 1, 2010; accepted for publication November 1, 2010}

\begin{document}

% Title of paper \title{Exploration of empirical Bayes hierarchical modeling for the analysis of genome-wide association study data}

% List of authors, with corresponding author marked by asterisk \author{ELIZABETH A. HERON$^\ast$, COLM O'DUSHLAINE, RICARDO SEGURADO,\ LOUISE GALLAGHER, MICHAEL GILL\[4pt] % Author addresses \textit{Neuropsychiatric Genetics Research Group and Department of Psychiatry, Trinity College Dublin, Trinity Centre for Health Sciences, James's Street, Dublin 8, Ireland} \[2pt] % E-mail address for correspondence {eaheron@tcd.ie}}

% Running headers of paper: \markboth% % First field is the short list of authors {E. A. Heron and others} % Second field is the short title of the paper {Empirical Bayes hierarchical modeling for GWAS}

\maketitle

% Add a footnote for the corresponding author if one has been % identified in the author list \footnotetext{To whom correspondence should be addressed.}

\begin{abstract} {Jus some text.} {Coronary artery disease; Crohn's disease; Multilevel model; Rheumatoid arthritis; Semi-Bayes; Type 2 diabetes.} \end{abstract}

\section{Introduction} \label{sec1} Not important

\end{document}

Here is the bio.cls file: bio.cls

So, latexmk -pdf samplebibtex.text (which is the file with that MWE) gives....

......
(/usr/share/texlive/texmf-dist/tex/latex/atveryend/atveryend.sty)
(/usr/share/texlive/texmf-dist/tex/latex/rerunfilecheck/rerunfilecheck.sty
(/usr/share/texlive/texmf-dist/tex/generic/uniquecounter/uniquecounter.sty)))
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def)
(./samplebibtex.aux
Runaway argument?
{{}{1}{}{page.
! Paragraph ended before \@newl@bel was complete.
<to be read again> 
                   \par 
l.19 \newlabel{firstpage}{{}{1}{}{page.\par
                                            }{}}
? 

Hitting enter gets me to:

! Extra }, or forgotten \endgroup.
l.19 \newlabel{firstpage}{{}{1}{}{page.\par }

However, commenting out the hyperref package makes it compile just fine.

%\usepackage[colorlinks=true, urlcolor=citecolor, linkcolor=citecolor, citecolor=citecolor]{hyperref}

Here is the end of the output.

...
(see the transcript file for additional information){/usr/share/texlive/texmf-d
ist/fonts/enc/dvips/cm-super/cm-super-ts1.enc}</usr/share/texlive/texmf-dist/fo
nts/type1/public/amsfonts/cm/cmbx12.pfb></usr/share/texlive/texmf-dist/fonts/ty
pe1/public/amsfonts/cm/cmbx9.pfb></usr/share/texlive/texmf-dist/fonts/type1/pub
lic/amsfonts/cm/cmcsc10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/a
msfonts/cm/cmr10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts
/cm/cmr6.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr8
.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr9.pfb></u
sr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy7.pfb></usr/shar
e/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmti10.pfb></usr/share/texl
ive/texmf-dist/fonts/type1/public/amsfonts/cm/cmti9.pfb></usr/share/texlive/tex
mf-dist/fonts/type1/public/cm-super/sfrm0600.pfb>
Output written on samplebibtex.pdf (1 page, 123097 bytes).
Transcript written on samplebibtex.log.
Latexmk: Examining 'samplebibtex.log'
=== TeX engine is 'pdfTeX'
Latexmk: Log file says output to 'samplebibtex.pdf'
Latexmk: All targets (samplebibtex.pdf) are up-to-date

My thanks in advance for any suggestions and help!

  • this is not a "familiar" error, I never saw an error from a \par in a newlabel. So make a MWE and include also a link to the class. – Ulrike Fischer Mar 27 '21 at 22:46
  • Hi Ulrike, example added. It seems based on the links that hyperref overwrites some parts of newlabel from what i understood. – user3236841 Mar 28 '21 at 00:38
  • This looks like a closing brace has been lost from a \label{... and LaTeX has kept reading until it hits a blank line. Look in your file for a paragraph that ends with "page." and then search backwards for \label. (Maybe you typed a closing parenthesis instead of a closing brace. I do that entirely too often, and it just doesn't work!) – barbara beeton Mar 28 '21 at 01:50
  • @barbarabeeton, thanks! While I make lots of errors too, this is not the problem here. Simply commenting out the usepackage for hyperref makes the file compile without error. Example added to show that it works. – user3236841 Mar 28 '21 at 02:23

1 Answers1

1

The class defines a command \label@firstpage and uses this in \maketitle. The definition of this command is

\def\label@firstpage{%
   \@ifundefined{Hy@Warning}{% hyperref not loaded
     \immediate\write\@auxout{\string
    \newlabel{firstpage}{{}{\thepage}}}
  }{
    \immediate\write\@auxout{\string
    \newlabel{firstpage}{{}{\thepage}{}{%
     \ifHy@pageanchor page.\Hy@temp\fi}{}}}
  }
}

That definition is simply wrong, the class shouldn't use \Hy@temp. That is an internal command of hyperref used to store temporary code, and the class has not control over its actual content.

Report this bug to the class author. As a work around add in the preamble

\makeatletter
\def\label@firstpage{\label{firstpage}}
\makeatother
Ulrike Fischer
  • 327,261