7

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).

1
  • I got the same error when using \usepackage{pdfcomment}. – Tobias Feb 27 '18 at 9:07
7

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, since hyperref loads nameref in order to grab sectional unit titles, there is some confusion between the usual way and the ifacconf way.

A more direct explanation: LaTeX handles \section* via the macro \@ssect:

\def\@ssect#1#2#3#4#5{%
  \@tempskipa #3\relax
  \ifdim \@tempskipa>\z@
    \begingroup
      #4{%
        \@hangfrom{\hskip #1}%
          \interlinepenalty \@M #5\@@par}%
    \endgroup
  \else
    \def\@svsechd{#4{\hskip #1\relax #5}}%
  \fi
  \@xsect{#3}}

Note that it has/takes 5 arguments. ifacconf redefines \@ssect to take 6 arguments:

\def\@ssect#1#2#3#4#5#6{%
  \@tempskipa #4\relax
  \ifdim \@tempskipa>\z@
    \begingroup
      #5{%
        \@hangfrom{\hskip #2}%
          \interlinepenalty \@M \head@format{#1}{#6}\@@par}%
    \endgroup
  \else
    \def\@svsechd{#5{\hskip #2\relax \head@format{#1}{#6}}}%
  \fi
  \@xsect{#4}}

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 before hyperref redefines it. Then it's restored after hyperref is loaded, together with an insertion to accommodate for nameref's title gab:

enter image description here

\documentclass{ifacconf}

\usepackage{filecontents}
\begin{filecontents*}{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},
}
\end{filecontents*}

\makeatletter
\let\old@ssect\@ssect % Store how ifacconf defines \@ssect
\makeatother

\usepackage{natbib}
\usepackage{hyperref}

\makeatletter
\def\@ssect#1#2#3#4#5#6{%
  \NR@gettitle{#6}% Insert key \nameref title grab
  \old@ssect{#1}{#2}{#3}{#4}{#5}{#6}% Restore ifacconf's \@ssect
}
\makeatother

\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}

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