The error comes not directly from \maketitle
itself, but from the \thispagestyle{plain}
macro usage in \maketitle
.
The plain
page style is defined in comnet.cls
as
\def\ps@plain{%
\def\@oddfoot{\gridpl\hfill\fontsize{6.8}{9}\selectfont $\copyright$
The author \number\year. Published by Oxford University Press on behalf of
the Institute of Mathematics and its Applications. All rights reserved.}
% \let\@evenfoot\@empty
\def\@evnhead{\CROPMARKSA}%
\def\@oddhead{\CROPMARKSA\begin{tabular}{@{}l}\\[-1pt]\textit{IMA Journal of Complex Networks} (\number\year) Page \fpage\ of\hspace*{2pt} \lpage\\doi:10.1093/comnet/\@kxi\end{tabular}
}%
\let\@mkboth\markboth
}
Now, \fpage
and \lpage
(used in \@oddhead
) are shortcuts to
\AtBeginDocument{\label{FirstPage}}
\def\lpage{\pageref{LastPage}}
\def\fpage{\pageref{FirstPage}}
Here the real error comes in: \label{FirstPage}
is written at the start of the document, due to the \AtBeginDocument
hook, but hyperref
is loaded later on, redefining the \label
etc. macros with additional information on the labeling, meaning that \label{FirstPage}
writes too few information to the .aux
file for hyperref
to grab it with the redefined \pageref
command.
A look into the .aux
file after first compilation run of the document shows (unnecessary information not given here) -- the first run is 'ok', the second compilation shows the error then!
\newlabel{FirstPage}{{}{1}}
...
\newlabel{LastPage}{{}{2}{}{page.2}{}}
It is obvious, that LastPage
has more information 'slots' (especially the page.2
anchor) which is expected by hyperref
to be read, but this does not work for Firstpage
.
The solution is to change \fpage
to \def\fpage{\pageref{CorrectFirstPageLabel}}
and add the CorrectFirstPageLabel
after loading of hyperref
.
\documentclass{comnet} % class from journal of complex networks
\bibpunct{[}{]}{,}{n}{,}{;}
\usepackage[utf8]{inputenc}
\usepackage{microtype}
\usepackage{graphicx}
\usepackage{algorithmicx}
\usepackage{hyperref}
\usepackage{blindtext}
\AtBeginDocument{
\label{CorrectFirstPageLabel}
\def\fpage{\pageref{CorrectFirstPageLabel}}
}
\begin{document}
\title{Complicated title}
\shorttitle{Complicated title}
\shortauthorlist{author 1, author 2}
\author{%
\name{author 1}
\address{springfield}
\name{author 2}
\address{springfield}
}
\maketitle
\begin{abstract}
{abstract text}
{key words}
\end{abstract}
\section{Introduction}
\section{section 1}
\subsection{section 1.1}
\section{section 2}
\section{Conclusion}
\blindtext[5]
\bibliographystyle{comnet}
%\bibliography{mybib}
\end{document}
Another solution would be to redefine \ps@plain
in order to remove the \fpage
macro and replace it with 1
, but I don't recommend this, since other authors could make use of plain
style at places in the document other than for the title page as well.

The error vanishes of course if hyperref
is not loaded at all, whether the Journal of Complex Networks allows hyperref
ed document submissions is not known to me. In doubt omit hyperref
rather then.
Update
Here is a minimal non - working version that has the same issue by forcing a label in \AtBeginDocument
and loading the hyperref
package after that:
\documentclass{article}
\AtBeginDocument{%
\section{Foo}\label{foolabel}
}
\usepackage{hyperref}
\begin{document}
\ref{foolabel}
\section{Foo again}\label{fooagainlabel}
\ref{fooagainlabel}
\end{document}
The .aux
file contains
\newlabel{foolabel}{{1}{1}}
\newlabel{fooagainlabel}{{2}{1}{Foo again}{section.2}{}}
The foolabel
is from the regular \label
command as defined in latex.ltx
, storing the section number 1
for the first page, whereas the second label definition is extended by hyperref
to contain
- section number
2
- page number
1
- Section title
Foo again
, to be extracted with \nameref
or \nameref*
- ('unique') hyper anchor name
section.2
- 'unused' (empty)