Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 ?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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}

enter image description here

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}
    \if@intoc\addcontentsline{toc}{section}{\nomname}\fi%
  }%
  {
    \chapter{\nomname}
    \if@intoc\addcontentsline{toc}{chapter}{\nomname}\fi%
  }%

  \nompreamble
  \list{}{%
    \labelwidth\nom@tempdim
    \leftmargin\labelwidth
    \advance\leftmargin\labelsep
    \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}
share|improve this answer
    
+1 Thanks for these tips - would never have worked that out !! –  Joe King Jul 19 '13 at 8:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.