# How to format the name of a nomenclature

I am using the nomencl package to make a list of abbreviations.

I would like the name of the nomenclature, "Abbreviations", to be formatted and numbered in the same way as a \section{}.

For example:

\documentclass{article}

\usepackage{nomencl}
\makenomenclature

\begin{document}

\section{Introduction}

\nomenclature{A}{First one}
\nomenclature{B}{Second one}
\renewcommand{\nomname}{Abbreviations}
\printnomenclature

\section{Methods}
\end{document}


I would like this to produce:

1 Introduction

2 Abbreviations

A First one

B Second one

3 Methods

How can I do that ?

-
–  Werner Jul 18 '13 at 20:17

The package uses \section* (if \chapter is not available in the current document class) to format the title as an unnumbered section; you can patch (using, for example, the etoolbox package) the \thenomenclature command to use \section instead:

\documentclass{article}
\usepackage{nomencl}
\usepackage{etoolbox}
\makenomenclature

\makeatletter
\patchcmd{\thenomenclature}{\section*}{\section}{}{}
\makeatother

\begin{document}

\section{Introduction}
\nomenclature{A}{First one}
\nomenclature{B}{Second one}
\renewcommand{\nomname}{Abbreviations}
\printnomenclature
\section{Methods}

\end{document}


If you don't want to use additional packages, you'll need to make the change in the definition of \thenomenclature:

\documentclass{article}
\usepackage{nomencl}
\makenomenclature

\makeatletter
\def\thenomenclature{%
\@ifundefined{chapter}%
{
\section{\nomname}
}%
{
\chapter{\nomname}
}%

\nompreamble
\list{}{%
\labelwidth\nom@tempdim
\leftmargin\labelwidth
\itemsep\nomitemsep
\let\makelabel\nomlabel}}
\makeatother

\begin{document}

\section{Introduction}

\nomenclature{A}{First one}
\nomenclature{B}{Second one}
\renewcommand{\nomname}{Abbreviations}
\printnomenclature

\section{Methods}
\end{document}

-
+1 Thanks for these tips - would never have worked that out !! –  Joe King Jul 19 '13 at 8:03