# customize vertical space of entries and subgroup names in nomenclature

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.

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}

• Try defining the \nompreamble macro to control the space between the title and the first entry, as referenced in nomencl section 4.1. – Mike Renfro Jul 26 '15 at 12:31
• I have added this command: \renewcommand{\nompreamble}{\vspace{2em}} in the preamble. However, it does not work. Any ideas to achieve that? – Nick Jul 27 '15 at 13:08
• Just now getting back to this. Using the code from Figure 1 of the nomencl documentation and adding \renewcommand{\nompreamble}{\vspace{2in}} in the preamble, I can control the space between the "Nomenclature" header and the nomenclature itself. On re-reading your question, I see that's not exactly what you were asking for. Can you make a MWE with just the four variables you reference above, so I can see how you're sorting them into groups? – Mike Renfro Aug 2 '15 at 13:12
• @MikeRenfro I have edited the problem and attached the code. Thank you. – Nick Aug 3 '15 at 2:28
• @MikeRenfro I edited the problem. And your suggestion works. One more thing, could I customize the vertical space between the entry big-M Paremeters and subgroup name Variables? Just see my MWE. Thanks. – Nick Aug 5 '15 at 2:52

## 2 Answers

\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

versus

by default.

• it does not work in my MWE. – Nick Aug 3 '15 at 8:39
• Won't be able to look at this for a bit, but you'll need to be more specific and make a compact MWE to narrow things down. Does my MWE work for you? Can you cut your MWE down to two symbols in two groups and the required nomgroup command? What doesn't work: you get an error, the spaces are wrong, are unchanged, etc.? – Mike Renfro Aug 3 '15 at 14:32
• I've slightly modified my solution to make it easier to add additional nomenclature groups. I get identical results from before, but this one should be easier to extend. – Mike Renfro Aug 5 '15 at 1:11

You can achieve the vertical space between the last entry and the following subgroup name by rearranging \nomgroup. The \item and \textbf statements have to be inside of \ifstrequal. There you can add the vertical space for the subgroup Variables to increase the vertical space.

\renewcommand{\nomgroup}[1]{%
\ifstrequal{#1}{M}{\item[\textbf{Parameters}]}{%
\ifstrequal{#1}{N}{\vspace{20pt} \item[\textbf{Variables}]}{}}%
}