5

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

2
  • A really bad and hackish solution could be to use \vspace{-2cm} or another value of course Nov 24, 2015 at 13:42
  • @RomainPicot: I'll remove your mortarboard badge for this proposition :-P
    – user31729
    Nov 24, 2015 at 13:43

1 Answer 1

5

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

7
  • I have one follow-up question: the "\xpatchcmd..." command leads to two effects: the words \xpatchcmd, \thenomenclature and \nomname are all marked red with the hint that the command is unknown. Nonetheless, the command drops the header in the nomenclature as wanten. Secondly, that line of command creates a new section \nomname within the structure of my document (as first section). Do you have any thoughts on this? Thanks!
    – Christian
    Nov 25, 2015 at 9:48
  • @Christian: Do you use an editor such as LyX or TeXMaker etc? The fact that \xpatchcmd is unknown to them has nothing to do with my solution -- this is an editor feature -- I don't like such editors since they distract me. Second: I don't know what you mean by a new section? Have you used intoc option? Yes? Then remove it. I explicitly stated in my answer that if intoc is used, more has to be done.
    – user31729
    Nov 25, 2015 at 15:32
  • I use TexStudio. After a Google-search which suggested \patchcmd in combination with Texstudio, I just tried to remove the "x" and it works better. The nomenclature title is still gone (what was the original goal), there is no section created (it previously was only shown in the document outline provided by TexStudio, but was not visible in the document). Just the "nomname" in the \patchcmd... command is still highlighted as a command not recognized. Maybe I should not worry about it as long as it works.
    – Christian
    Nov 25, 2015 at 19:46
  • Which x did you remove? I don't understand what you mean
    – user31729
    Nov 25, 2015 at 19:48
  • By the way: I am new to this forum and am having trouble to use the @Name - way of mentioning you so that you are notified about my comment. It is always deleted after I publish the comment. Any idea what I am doing wrong? Tried only Christian, your full name without space, First name with first letter of surname as suggested in the comments on mini-markdown formatting...
    – Christian
    Nov 25, 2015 at 19:49

You must log in to answer this question.

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