1

A while ago I need to create a nomenclature with a "=" separator for aiaa paper. I got my answer here. This worked well, until I tried to seperate the nomenclature into two groups. The result I got was this:

enter image description here

I would like to get rid of the separator in the group title.

And here is my MWE

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{nomencl}
% the following is useful when we have the old nomencl.sty package
\providecommand{\printnomenclature}{\printglossary}
\providecommand{\makenomenclature}{\makeglossary}
\makenomenclature

\makeatletter


\renewcommand{\nomlabel}[1]{#1\hfill\hspace{\labelsep}$=$}
\newlength{\nomwidest}

\RequirePackage{ifthen}
\renewcommand{\nomgroup}[1]{%
\ifthenelse{\equal{#1}{S}}{\item[\textbf{Symbols}]}{
\ifthenelse{\equal{#1}{A}}{\item[\textbf{Acronyms}]}{}}}

\makeatother

\usepackage{babel}
\begin{document}
\settowidth{\nomwidest}{\nomlabel{that other one}} 
\printnomenclature[\nomwidest]

\nomenclature[ATO]{TO}{this one}\nomenclature[ATOO]{TOO}{that other one}\nomenclature[Sa]{$\alpha$}{alpha}\nomenclature[Sb]{$\beta$}{beta}
\end{document}
Elad Den
  • 3,941

1 Answers1

1

The package nomencl does a redefinition of \makelabel inside the thenomenclature environment, making it do \nomlabel, so at every \item you get the =.

Solution: make the = obey a conditional that you set to false in headings.

% arara: pdflatex
% arara: nomencl
% arara: pdflatex

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}

\usepackage{nomencl}
\usepackage{ifthen}

\makenomenclature

\newif\ifnomentry
\renewcommand{\nomlabel}[1]{#1\hfill\hspace{\labelsep}\ifnomentry$=$\fi}
\newlength{\nomwidest}

\renewcommand{\nomgroup}[1]{%
  \nomentryfalse
  \ifthenelse{\equal{#1}{S}}
    {\item[\textbf{Symbols}]}
    {\ifthenelse{\equal{#1}{A}}
      {\item[\textbf{Acronyms}]}
      {}%
    }%
  \nomentrytrue
}

\begin{document}
x

\settowidth{\nomwidest}{\nomlabel{that other one}}
\printnomenclature[\nomwidest]

\nomenclature[ATO]{TO}{this one}
\nomenclature[ATOO]{TOO}{that other one}
\nomenclature[Sa]{$\alpha$}{alpha}
\nomenclature[Sb]{$\beta$}{beta}

\end{document}

The x is just for producing the nomenclature (a page must be output). I also changed the order of packages. However, I'm not sure about

\settowidth{\nomwidest}{\nomlabel{that other one}}

because \nomwidest will set the space on the left of the equals sign.

enter image description here

egreg
  • 1,121,712
  • Thanks ! that works, and indeed \nomwidest sets the space left of the "=" so that all seperators are aligned. – Elad Den Apr 24 '16 at 16:54