[Tex/LaTex] Remove title in nomenclature

elsarticlenomenclature

I am using the nomencl environment within the elsarticle class to produce an overview of mathematical variables used in the paper. As this nomenclature should be part of the appendix, I would like to suppress its title.
I have found how to change nomenclature titles, but not how to remove it altogether. Here is what I have so far in my TeX Code:

\documentclass[authoryear, review]{elsarticle} %preprint
\special{papersize=210mm,297mm}
\usepackage{nomencl} 
\makenomenclature 
\RequirePackage{ifthen}
\renewcommand{\nomname}{This is the title that should not appear}
\begin{document}
    Bla bla
\begin{frontmatter}
\end{frontmatter}
\section{Section example}
This is my text, where variables appear.
\nomenclature[1]{$\mu$}{Example variable}
\appendix
\section{Definition of model variables}
\printnomenclature[0.9in]
\end{document}

If I just use \renewcommand{\nomname}{}, LaTeX produces a large gap where the title used to be, which also does not look nice.

Thank you very much for any hints or pieces of advice!

Best

Christian

Best Answer

nomencl package uses \thenomenclature with this code

\def\thenomenclature{%
  \@ifundefined{chapter}%
  {
    \section*{\nomname}
    \if@intoc\addcontentsline{toc}{section}{\nomname}\fi%
  }%
  {
    \chapter*{\nomname}
    \if@intoc\addcontentsline{toc}{chapter}{\nomname}\fi%
  }%
 ... % and some more code not relevant for this solution

i.e. there is either a \section*{\nomname} or \chapter*{\nomname} command. which should be avoided here.

If the intoc option is used, the \addcontentsline should be omitted as well, but this was not requested.

\documentclass[authoryear, review]{elsarticle} %preprint

\usepackage{xpatch}
\special{papersize=210mm,297mm}
\usepackage{nomencl} 

\xpatchcmd{\thenomenclature}{%
  \section*{\nomname}% Look for `\section*... etc.
}{% Replace it by 'nothing'
}{\typeout{Success}}{\typeout{Failure}}


\makenomenclature 
\RequirePackage{ifthen}
%\renewcommand{\nomname}{This is the title that should not appear}
\begin{document}
    Bla bla
\begin{frontmatter}
\end{frontmatter}
\section{Section example}
This is my text, where variables appear.
\nomenclature[1]{$\mu$}{Example variable}
\appendix
\section{Definition of model variables}
\printnomenclature[0.9in]
\end{document}

enter image description here

Related Question