2

I would like to have the unit closer to the symbol description in my nomenclature list. But when I use the command from the help file and add a space after the unit:

\newcommand{\nomunit}[1]{\renewcommand{\nomentryend}{\hspace*{\fill}[#1]\hspace{2cm}}}

only the last entry is moved. How can I move all entries by 2cm to the left?

\documentclass{article}
\usepackage{nomencl}
\usepackage{siunitx}

\makenomenclature
\begin{document}

\newcommand{\nomunit}[1]{\renewcommand{\nomentryend}{\hspace*{\fill}[#1]\hspace{2cm}}}


\nomenclature[C]{$  m   $}{ mass    \nomunit{$\si{  kg  }$}}
\nomenclature[C]{$  \omega\_{m} $}{ mechanical angular frequency    \nomunit{$\si{  Hz  }$}}
\nomenclature[C]{$  \omega\_{el}    $}{ electrical angular frequency    \nomunit{$\si{  Hz  }$}}

Here comes the nomenclature:

\printnomenclature

\end{document}
3

Spaces are gobbled when they are at a line break; add \mbox{} after the \hspace{2cm}; I actually used \hspace* and \nolinebreak to ensure this space is not used for a line break in any case.

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

\documentclass{article}
\usepackage{nomencl}
\usepackage{siunitx}

\makenomenclature
\begin{document}

\newcommand{\nomunit}[1]{%
  \renewcommand{\nomentryend}{\hspace*{\fill}[#1]\nolinebreak\hspace*{2cm}\mbox{}}%
}


\nomenclature[C]{$m$}{mass \nomunit{$\si{kg}$}}
\nomenclature[C]{$\omega_{\mathrm{m}}$}{mechanical angular frequency \nomunit{$\si{Hz}$}}
\nomenclature[C]{$\omega_{\mathrm{el}}$}{electrical angular frequency \nomunit{$\si{Hz}$}}

Here comes the nomenclature:

\printnomenclature

\end{document}

enter image description here

Note also the fixes to the symbols.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.