Apart from the fact that you should refrain from doing this when using a publisher class, because the formatting of titles, headings etc. is of course specified by the publisher, the whole thing does not work because the title is not only used for the title itself, but also elsewhere as a PDF string. However, \hl
cannot be used within PDF strings such as bookmarks. The standard solution is to specify an alternative for PDF strings:
\documentclass[a4paper,fleqn]{cas-dc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{lipsum}
\usepackage{color}
\usepackage{soul}
\begin{document}
\title [mode = title] {\texorpdfstring{\hl{paper title}}{paper title}}
\maketitle
\end{document}
Instead of using \texorpdfstring
each time it could be relevant, you could also define a general replacement of \hl
inside PDF strings:
\documentclass[a4paper,fleqn]{cas-dc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{lipsum}
\usepackage{color}
\usepackage{soul}
\pdfstringdefDisableCommands{\renewcommand\hl[1]{#1}}% In PDF strings use the
% \hl argument without highlighting
\begin{document}
\title [mode = title] {\hl{paper title}}
\maketitle
\end{document}
See the hyperref
manual, currently section 6.1.2 “Replacement macros”, for more information.
document
environment.cas-dc
is a publisher class and you should avoid extra formatting like highlighting in the title. The publisher does not like such changes. Usually publisher classes should be used as they are. Don't change any formatting.