0

My third row in my Nomenclature has shifted into the wrong line and i can't figure out how to fix this. I hope somebody might help me out.

\usepackage{nomencl}
\usepackage{xpatch}
\makenomenclature

\usepackage{etoolbox}
\renewcommand\nomgroup[1]{%
  \item[\bfseries
  \ifstrequal{#1}{A}{Latein}{%
  \ifstrequal{#1}{B}{Griechisch}{%
  \ifstrequal{#1}{C}{Abkürzungen}{}}}%
]}
\newcommand{\nomunit}[1]{%#



\renewcommand{\nomentryend}{\hspace*{\fill}#1}}

\newlength{\nomitemorigsep}
\setlength{\nomitemorigsep}{\nomitemsep}
\setlength{\nomitemsep}{-\parsep}
\setlength{\nomlabelwidth}{3.5cm}

\renewcommand{\nomgroup}[1]{%
  \itemsep\nomitemorigsep%u
  \ifthenelse{%
    \equal{#1}{A}%
  }{%
  \item[\textbf{Latein}]%

  }{%
    \ifthenelse{\equal{#1}{B}}{%
    \item[\textbf{Griechisch}]%

    }{}%

    \ifthenelse{\equal{#1}{C}}{%
    \item[\textbf{Abkürzungen}]%

    }{}%
  }%
  \itemsep\nomitemsep% Restore spacing
} 

Thanks a lot in advance.

Here's a screenshot of how it looks right now: enter image description here

1 Answer 1

1

When defining \nomunit you have too many new lines which TeX is registering as a new paragraph.

Also you don't need to renew \nomgroup just to redefine the spacing, you can simply combine them into one declaration

In the future please provide a MWE not just the preamble.

The below should fix your issues

MWE

\documentclass{article}
\usepackage{nomencl}
\usepackage{xpatch}
\makenomenclature

\usepackage{etoolbox}

\newlength{\nomitemorigsep}
\setlength{\nomitemorigsep}{\nomitemsep}
\setlength{\nomitemsep}{-\parsep}
\setlength{\nomlabelwidth}{3.5cm}

\renewcommand\nomgroup[1]{
\itemsep\nomitemorigsep %spacing change
  \item[\bfseries
  \ifstrequal{#1}{A}{Latein}{%
  \ifstrequal{#1}{B}{Griechisch}{%
  \ifstrequal{#1}{C}{Abkürzungen}{}}}%
]
\itemsep\nomitemsep %spacing reset
}

\newcommand{\nomunit}[1]{
\renewcommand{\nomentryend}{\hspace*{\fill}#1}}% I've removed the blank lines here


\begin{document}

\nomenclature[A]{$c$}{Speed of light in a vacuum inertial system \nomunit{$ms^{-1}$}}
\nomenclature[B]{$E$}{Energy \nomunit{$J$}}
\printnomenclature

\end{document}

You must log in to answer this question.

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