0

I'm attempting to match the AIAA journal nomenclature formatting using the nomencl package. AIAA's nomenclature is a bit weird in that group names are only permitted for superscripts and subscripts, with the remaining English letters and Greek letters lumped together without a group name. See https://www.aiaa.org/publications/journals/Journal-Author/nomenclature-guidelines for an example nomenclature.

So far, I've had some luck getting the nomenclature formatted properly, but I'm having trouble making entries that are alphabetized correctly yet do not appear under a group name.

Here is my MWE:

% arara: pdflatex
% arara: nomencl
% arara: pdflatex
\documentclass[english]{article}
\usepackage[utf8]{inputenc}

\usepackage{nomencl, multicol, ifthen, etoolbox} %for nomenclature
\makenomenclature
\newif\ifnomentry
\renewcommand{\nomlabel}[1]{#1\hfill\hspace{\labelsep}\ifnomentry$=$\fi}
\setlength{\nomlabelwidth}{1cm} %space alotted to nomenclature 
\renewcommand\nomgroup[1]{%
    \nomentryfalse
    \item[%
    \ifstrequal{#1}{C}{Symbols}{%
        \ifstrequal{#1}{G}{Greek Symbols}{%
            \ifstrequal{#1}{X}{Superscripts}{%
                \ifstrequal{#1}{Y}{Subscripts}{%
                    {}}}}}%
    ]
    \nomentrytrue
}

\begin{document}
    
\mbox{}

\printnomenclature

\nomenclature[C]{$c$}{Test english}
\nomenclature[G]{$\gamma$}{Test greek}
\nomenclature[X]{$\alpha$}{Test superscript}
\nomenclature[Y]{$\beta$}{Test subscript}
    
\end{document}

This produces a nomenclature that looks like this image:

Example nomenclature

Essentially, I'd like to get rid of the group names for "Symbols" and "Greek Symbols" without leaving an empty line. I've tried replacing the word "Symbols" with \vspace{-\parsep}, but it doesn't seem to have any effect.

Thanks in advance for your help.

UPDATE:

I sorta figured out a way to do this while skimming the nomencl documentation. Using the following for \nomgroup

\renewcommand\nomgroup[1]{%
    \nomentryfalse
    \ifstrequal{#1}{C}{\item[]\vspace{-\baselineskip}}{%
    \ifstrequal{#1}{G}{\item[]\vspace{-\baselineskip}}{%
    \ifstrequal{#1}{X}{\item[Superscripts]}{%
    \ifstrequal{#1}{Y}{\item[Subscripts]}{%
    {}}}}}%
    \nomentrytrue
}

is giving me close to the right effect, but I can't nail down the amount of negative \vspace I should use to make the vertical spacing consistent. Could anyone who is more skilled at LaTeX spacing help me out here?

2 Answers 2

2

Just don't issue \item:

\renewcommand\nomgroup[1]{%
  \nomentryfalse
  \ifstrequal{#1}{X}{\item[Superscripts]}{%
    \ifstrequal{#1}{Y}{\item[Subscripts]}{%
  {}}}%
  \nomentrytrue
}

Anyway, I can't look at that code without my eyes bleeding. ;-)

% arara: pdflatex
% arara: nomencl
% arara: pdflatex
\documentclass{article}

\usepackage{nomencl,etoolbox}

\makenomenclature

\newif\ifnomentry
\renewcommand{\nomlabel}[1]{#1\hfill\hspace{\labelsep}\ifnomentry$=$\fi}
\setlength{\nomlabelwidth}{1cm} %space alotted to nomenclature 

\ExplSyntaxOn % define a user level interface to \str_case:nn
\NewExpandableDocumentCommand{\stringcase}{mm}
 {
  \str_case:nn { #1 } { #2 }
 }
\ExplSyntaxOff

\renewcommand\nomgroup[1]{%
  \nomentryfalse
  \stringcase{#1}{
    {X}{\item[Superscripts]}
    {Y}{\item[Subscripts]}
  }
  \nomentrytrue
}

\begin{document}
    
\mbox{}

\printnomenclature

\nomenclature[C]{$c$}{Test english}
\nomenclature[G]{$\gamma$}{Test greek}
\nomenclature[X]{$\alpha$}{Test superscript}
\nomenclature[Y]{$\beta$}{Test subscript}
    
\end{document}

Shorter, more expressive and easily maintainable, isn't it?

enter image description here

1
  • That looks much better than my own attempt. Thanks for your help!
    – jnrobinson
    Commented May 19, 2021 at 23:21
0

Alright, I accidentally answered my own question here. The following \nomgroup seems to do what I want. If someone knows a cleaner way than three \vspace commands in a row, let me know.

\renewcommand\nomgroup[1]{%
    \nomentryfalse
    \ifstrequal{#1}{C}{\item[]\vspace{-\baselineskip}\vspace{-\itemsep}\vspace{-\parsep}}{%
    \ifstrequal{#1}{G}{\item[]\vspace{-\baselineskip}\vspace{-\itemsep}\vspace{-\parsep}}{%
    \ifstrequal{#1}{X}{\item[Superscripts]}{%
    \ifstrequal{#1}{Y}{\item[Subscripts]}{%
    {}}}}}%
    \nomentrytrue
}

Final result:

enter image description here

You must log in to answer this question.

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