I'm trying to submit an article to an IFAC conference by using their template: https://www.ifac-control.org/events/author-guide/copy_of_ifacconf_latex.zip/view.
I also want to use the hyperref
package to add links to the document, in addition to the autoref
macros, among other features.
My document compiles just fine using latexmk
before adding the hyperref
package, but generates the following errors when it is added:
Errors:
./mwe-delete.tex:33: Illegal unit of measure (pt inserted). [\begin{ack}]
./mwe-delete.bbl:1: Illegal unit of measure (pt inserted). [\begin{thebibliography}{1}]
For clarity, I work with the following files:
mwe-delete.tex
MWE main tex file.refs-test-delete.bib
MWE bibliography file.
Additionally, the file mwe-delete.bbl
is generated by natbib
.
These are the contents of mwe-delete.tex
:
\documentclass{ifacconf}
\usepackage{natbib}
\usepackage{hyperref}
\begin{document}
\begin{frontmatter}
\title{Paper Title\thanksref{titlenote}}
\thanks[titlenote]{
Titlenote.
}
\author[First]{First Author}
\address[First]{First Author contact info.}
\begin{abstract}
The abstract.
\end{abstract}
\begin{keyword}
Keyword
\end{keyword}
\end{frontmatter}
\section{Introduction}
\label{sec:introduction}
Introduction.
This is based on the work of \citet{bibref1}.
\begin{ack}
Acknowledgement.
\end{ack}
\bibliography{refs-test-delete}
\end{document}
The contents of refs-test-delete.bib
:
@Article{bibref1,
author = {Firstname M. Lastname},
title = {PaperTitle},
journal = {Journal of Journals},
year = {2009},
volume = {32},
number = {3},
pages = {1039--1045},
month = {5},
publisher = {Publisher},
}
The generated contents in mwe-delete.bbl
:
\begin{thebibliography}{1}
\providecommand{\natexlab}[1]{#1}
\providecommand{\url}[1]{\texttt{#1}}
\providecommand{\urlprefix}{URL }
\expandafter\ifx\csname urlstyle\endcsname\relax
\providecommand{\doi}[1]{doi:\discretionary{}{}{}#1}\else
\providecommand{\doi}{doi:\discretionary{}{}{}\begingroup
\urlstyle{rm}\Url}\fi
\bibitem[{Lastname(2009)}]{bibref1}
Lastname, F.M. (2009).
\newblock Papertitle.
\newblock \emph{Journal of Journals}, 32(3), 1039--1045.
\end{thebibliography}
Does anyone have any experience using the IFAC template together with hyperref
?
I'm using TexLive 2017 with the latest updated packages.
The contents of ifacconf.cls
are found here (direct link to .zip-file of 460 kB).
Best Answer
The fundamental difference here is that
ifacconf
updates the way sections are formatted/presented by introducing a new internal argument aimed at distinguishing between certain headings. Specifically, "headings at a level lower than 1" are formatted one way, while "headings at a level of 1 or higher" are formatted differently. And, sincehyperref
loadsnameref
in order to grab sectional unit titles, there is some confusion between the usual way and theifacconf
way.A more direct explanation: LaTeX handles
\section*
via the macro\@ssect
:Note that it has/takes 5 arguments.
ifacconf
redefines\@ssect
to take 6 arguments:hyperref
doesn't know that this, since it assumes the regular protocol (5 argument) exists even though packages/classes could (re)define their own sectional unit styles. It would be an unattainable task to accommodate for all possible versions of function (re)definitions.The following approach stores
\@ssect
beforehyperref
redefines it. Then it's restored afterhyperref
is loaded, together with an insertion to accommodate fornameref
's title gab: