2

I'm using Elsevier's CAS Latex Double-Column Template LaTeX package. There was a problem that I couldn't solve while writing the paper, so I posted this to ask experts for help. i want to highlight title of my paper. but using this command \title [mode = title] {\hl{paper title}}, cannot able to recompile and no pdf generated. cannot got title highlighted.the code used is shown here

\documentclass[a4paper,fleqn]{cas-dc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{lipsum}
\usepackage{color}
\usepackage{soul}
\begin{document}
\title [mode = title] {\hl{paper title}}
\end{document}

Is there a solution?

2
  • Please add a short, but compilable test file which allows us to reproduce the problem. It should include a class, the necessary packages and a document environment. Commented Aug 1 at 14:48
  • IMHO this is not supported or intended. 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.
    – cabohah
    Commented Aug 2 at 7:30

2 Answers 2

1

You could use lua-ul to highlight the title (this requires compilation with lualatex and is probably not supported by the publisher, but they probably also don't support adding such highlights, so it shouldn't matter too much):

% !TeX TS-program = lualatex

\documentclass[a4paper,fleqn]{cas-dc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{lipsum}
\usepackage{luacolor}
\usepackage{lua-ul}
\begin{document}
\title [mode = title] {\highLight{paper title}}

\maketitle
\end{document}

enter image description here

3
  • +1 Just a note: cas-dc.cls uses \RequirePackage[T1]{fontenc}. So I guess, that the publisher usually uses PDFLaTeX not LuaLaTeX. Maybe users, who want to use LuaLaTeX should contact the publisher first. Unfortunately, I have often found that publishers struggle with modern TeX approaches (be it XeLaTeX, LuaLaTeX or biblatex, for example) and prefer to work with what they have been used to for decades. :(
    – cabohah
    Commented Aug 11 at 10:23
  • @cabohah The publisher will probably use pdflatex, but they will probably also not accept changes to their template like the added highlighting, so it doesn't really matter. Commented Aug 11 at 10:28
  • About changes to the template see my comment to the question. My comment to your answer is not meant to be a fundamental criticism of your solution, just a more general hint that (in addition to changing the title formatting) switching to LuaLaTeX can also trigger a need for communication. Which you have already indicated somehow in your answer.
    – cabohah
    Commented Aug 11 at 10:33
1

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}

“paper title” (with yellow background)

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.

2
  • Thank you so much for all the replies.it works
    – DHANYA P K
    Commented Aug 10 at 9:03
  • @DHANYAPK If you like an answer and it was helpful, please consider upvoting (by clicking on the arrows next to the score) and/or marking it as the accepted answer (by clicking on the checkmark ✓).
    – cabohah
    Commented Aug 11 at 10:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .