# subsection command not working in elsevier LaTeX template

I am working on Elsevier template with a single column format, I am facing an issue with subsections command not working as they are displayed like a normal section with wrong numbering, for example

\documentclass[a4paper,fleqn]{cas-sc}
\begin{document}
\section{A}
\subsection{AA}
\subsubsection{BB}
\end{document}


Can anyone help me on how to fix this issue?

• @campa sorry, I could not understand your response. What is correct? – Noman Bashir Feb 15 at 16:01
• @campa I just googled it (after commenting) and found it. Would you look at that, Elsevier switched to expl3 :). Well, then I think this is the expected behaviour... – Phelype Oleinik Feb 15 at 16:01
• campa replied to a comment I deleted, so it looked out of context. – Phelype Oleinik Feb 15 at 16:02
• Okay, what is the final situation now? – Noman Bashir Feb 15 at 16:02
• Your example is minimal and there is nothing wrong with it, so it's not your fault. I think you'd need to contact the Elsevier support and ask it there. There are two possibilities: 1) This is a design choice and you have to live with it. 2) It's a bug and they need to fix it (looks more like it). Either way, only they know the answer, unfortunately. – Phelype Oleinik Feb 15 at 16:07

Yes, definitely a bug :)

The definition of \section, \subsection, and \subsubsection in cas-common.sty uses the same counter, section, for all three levels. (i.e.: \@startsection{section}...). If you copy that definition and use the correct counters the output looks correct:

\documentclass[a4paper,fleqn]{cas-sc}

\begin{document}

\makeatletter
\renewcommand\section{\@startsection{section}{1}{\z@}%
{15pt \@plus 3\p@ \@minus 3\p@}%
{4\p@}%
{%\let\@hangfrom\relax
\sectionfont\raggedright\hst[13pt]}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
{10pt \@plus 3\p@ \@minus 2\p@}%
{.1\p@}%
{%\let\@hangfrom\relax
\ssectionfont\raggedright }}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
{10pt \@plus 1\p@ \@minus .3\p@}%
{.1\p@}%
{%\let\@hangfrom\relax
\sssectionfont\raggedright}}
\makeatother

\section{A}
\subsection{AA}
\subsubsection{BB}

\end{document}