[Tex/LaTex] customize vertical space of entries and subgroup names in nomenclature

nomenclaturespacing

I want customize the vertical space (marked by red lines in the picture) between final entry (M1 big-M parameter) and subgroup name (Variables) , say 20pt? How could I achieve that? Many thanks.

enter image description here

The following is my MWE which generates the nomenclature, as shown in the picture.

\documentclass[a4paper]{article}

\usepackage{amsmath}

\usepackage{etoolbox}

\usepackage[noprefix]{nomencl}

\makenomenclature

\renewcommand*{\nompreamble}{\vspace{10pt}}

\renewcommand{\nomgroup}[1]{%

\item[\textbf{%

\ifstrequal{#1}{M}{Parameters}{%

\ifstrequal{#1}{N}{Variables}{%

{}}}}]%

\hspace*{-\leftmargin}\vspace{20pt}}

\setlength{\nomitemsep}{1pt}

\begin{document}

Text% to produce a non-empty page
\\

\nomenclature[N]{$t$}{temperature}

\nomenclature[M]{M$_1$}{big-M parameters}

\printnomenclature[2cm]


\end{document}  

Best Answer

\nompreamble controls what goes between the main nomenclature title and the nomenclature itself. \nomgroup is a one-parameter macro that controls what goes at the start of each subgroup (section 4 and 5.1 of the nomencl documentation).

As an example:

\documentclass{article}
\usepackage[noprefix]{nomencl}
\usepackage{ifthen}

\renewcommand{\nompreamble}{\vspace{0.25in}} % code after main title
\renewcommand{\nomgroup}[1]{%
  \item[\textbf{%
    \ifthenelse{\equal{#1}{M}}{Parameters}{}%
    \ifthenelse{\equal{#1}{N}}{Variables}{}% add more groups as needed
    }]%
    \hspace*{-\leftmargin}\vspace{1in}%
}

\makenomenclature

\begin{document}

\nomenclature[M]{M$_1$}{big-M parameters}
\nomenclature[N]{$t$}{temperature}

\printnomenclature
\end{document}

yields

enter image description here

versus

enter image description here

by default.

Related Question