TransWikia.com

Elsevier cas-dc class hyperref warning: ignoring empty anchor on input line

TeX - LaTeX Asked on June 1, 2021

I’m trying to compile the Elsevier CAS double column template which is provided at:

http://mirrors.ctan.org/macros/latex/contrib/els-cas-templates.zip

When I compile with pdfLatex on Overleaf, I get the following warning with respect to the maketitle call

Package hyperref Warning: Ignoring empty anchor on input line 15.

What is the reason for this warning and how can it be fixed?

Below is a highly reduced version of the template .tex file cas-dc-template.tex:

documentclass[a4paper,fleqn]{cas-dc}
usepackage[numbers]{natbib}
begin{document}
shorttitle{Silly Walks}  
shortauthors{Smith et~al.}
title[ mode = title ] {Silly Walks and their Place in Modern Society}
author{Steve Johnson}
ead{[email protected]}
author{John Stevenson}
ead{[email protected]}
address{Ministry of Silly Walks, High Pressure Silly Walk Testing Facility, London, England}
begin{abstract}
This is the abstract
end{abstract}
maketitle
section{Introduction}
This is the intro with ref cite{Fortunato2010} and cite{NewmanGirvan2004} and cite{Vehlowetal2013}.
bibliographystyle{cas-model2-names}
bibliography{cas-refs}
end{document}

The full CAS template is also available as a ready-to-go Overleaf template here:

https://www.overleaf.com/latex/templates/elseviers-cas-latex-double-column-template/hhzpymgjmxfk

One Answer

To make the compilation possible and the warning disappear I made two thing:

1- I put the directory thumbnails/ that comes with the distribution (.zip), but is not installed!, in the same directory of the LaTeX document.

2- In the file cas-dc.cls I moved the package hyperref to the end of the file, after geometry.

%
% Page geometry
%
usepackage[%
   paperwidth=210mm,
   paperheight=280mm,
   vmargin={19.5mm,18.2mm},
   hmargin={18.1mm,18.1mm},
   headsep=12pt,
   footskip=12pt,
   columnsep=18pt
]{geometry}

RequirePackage[colorlinks]{hyperref}
colorlet{scolor}{black}
colorlet{hscolor}{DarkSlateGrey}
hypersetup{%
  pdftitle={csuse{__short_title:}},
  pdfauthor={csuse{__short_authors:}},
  pdfcreator={LaTeX3; cas-sc.cls; hyperref.sty},
  pdfproducer={pdfTeX;},
  linkcolor={hscolor},
  urlcolor={hscolor},
  citecolor={hscolor},
  filecolor={hscolor},
  menucolor={hscolor},
 }

endinput
  
%
% End of class 'cas-sc'
%

Then I got the Silly Walks including the email icon. (I also commented the lines after Introduction).

out2

This a comparison of the logs after and before the changes.

logi

So this is the fix. It seems that the reason for the warning is that the class does not follow the recommendation to load hyperref as the last package.

Correct answer by Simon Dispa on June 1, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP