[Tex/LaTex] How to make nomenclature entries indent

nomenclaturespacing

The nomenclature entries is left align without indent by default:

 \printnomenclature[2.5 cm] 

See e.g. Nom

I want to make these symbols indent from left margin for 1 ex or 1 em. But I have just lost in the package manual nomenclature.

So how can I redefine the indent value?


nomgroup is redefined as:

\usepackage[intoc]{nomencl}
 \makenomenclature
  \renewcommand\nomgroup[1]{%
   \ifthenelse{\equal{#1}{A}}{%
    \item[\textbf{Acronyms}] }{% A - Acronyms
     \ifthenelse{\equal{#1}{R}}{%
      \item[\textbf{Roman Symbols}]}{% R - Roman
       \ifthenelse{\equal{#1}{G}}{%
        \item[\textbf{Greek Symbols }]}{% G - Greek
         \ifthenelse{\equal{#1}{S}}{%
          \item[\textbf{Superscripts  }]}{{% S - Superscripts
       \ifthenelse{\equal{#1}{U}}{%
        \item[\textbf{Subscripts }]}{{% U - Subscripts
         \ifthenelse{\equal{#1}{X}}{%
          \item[\textbf{Other Symbols }]}% X - Other Symbols
                    {{}}}}}}}}}}

Examples of nomenclature input:

\nomenclature[rV]{$V$ }{Fluid control volume}
\nomenclature[ruf]{$\bm{u}_f$ }{Fluid velocity}
\nomenclature[gepsilonf]{$\epsilon_f$ }{Fluid porosity}
\nomenclature[rfb]{$\bm{f}_b$ }{Body force per unit volume}
\nomenclature[gepsilonf]{$\epsilon_f$ }{Fluid porosity}
\nomenclature[gsigma]{$\bm{\sigma} $ }{Cauchy stress tensor}

Best Answer

Patch \thenomenclature to do also \itemindent 1em:

\documentclass{article}
\usepackage{nomencl}

\usepackage{xpatch}
\patchcmd{\thenomenclature}
  {\leftmargin\labelwidth}
  {\leftmargin\labelwidth\itemindent 1em }
  {}{}

\makenomenclature
\begin{document}
a\nomenclature{ALE}{Arbitrary Lagrangian-Eulerian Method}
b\nomenclature{AOR}{Angle of repose}
\printnomenclature
\end{document}

enter image description here

Since your group labels are typeset with \item, then you have also to change them so they skip back by the current \itemindent:

\newcommand{\nomenclheader}[1]{\item[\hspace*{-\itemindent}#1]}
\renewcommand\nomgroup[1]{%
  \ifthenelse{\equal{#1}{A}}{%
   \nomenclheader{\textbf{Acronyms}}}{%                   A - Acronyms
    \ifthenelse{\equal{#1}{R}}{%
     \nomenclheader{\textbf{Roman Symbols}}}{%            R - Roman
      \ifthenelse{\equal{#1}{G}}{%
        \nomenclheader{\textbf{Greek Symbols}}}{%          G - Greek
          \ifthenelse{\equal{#1}{S}}{%
           \nomenclheader{\textbf{Superscripts}}}{{%      S - Superscripts
        \ifthenelse{\equal{#1}{U}}{%
         \nomenclheader{\textbf{Subscripts}}}{{%           U - Subscripts
        \ifthenelse{\equal{#1}{X}}{%
         \nomenclheader{\textbf{Other Symbols}}}%          X - Other Symbols
                       {{}}}}}}}}}}

You'll probably have less problem in maintaining the code above if you say

\usepackage{xstring}

and then

\newcommand{\nomenclheader}[1]{%
  \item[\hspace*{-\itemindent}\normalfont\bfseries #1]}
\renewcommand\nomgroup[1]{%
  \IfStrEqCase{#1}{%
   {A}{\nomenclheader{Acronyms}}%      A - Acronyms
   {R}{\nomenclheader{Roman Symbols}}% R - Roman
   {G}{\nomenclheader{Greek Symbols}}% G - Greek
   {S}{\nomenclheader{Superscripts}}%  S - Superscripts
   {U}{\nomenclheader{Subscripts}}%    U - Subscripts
   {X}{\nomenclheader{Other Symbols}}% X - Other Symbols
  }%
}

Complete example

\documentclass{article}
\usepackage[intoc]{nomencl}
\usepackage{bm}

\usepackage{xstring}
\usepackage{xpatch}
\patchcmd{\thenomenclature}
  {\leftmargin\labelwidth}
  {\leftmargin\labelwidth\itemindent 1em }
  {}{}

\newcommand{\nomenclheader}[1]{%
  \item[\hspace*{-\itemindent}\normalfont\bfseries#1]}
\renewcommand\nomgroup[1]{%
  \IfStrEqCase{#1}{%
   {A}{\nomenclheader{Acronyms}}%      A - Acronyms
   {R}{\nomenclheader{Roman Symbols}}% R - Roman
   {G}{\nomenclheader{Greek Symbols}}% G - Greek
   {S}{\nomenclheader{Superscripts}}%  S - Superscripts
   {U}{\nomenclheader{Subscripts}}%    U - Subscripts
   {X}{\nomenclheader{Other Symbols}}% X - Other Symbols
  }%
}

\begin{document}
Some text for getting output.

\nomenclature[rV]{$V$}{Fluid control volume}
\nomenclature[ruf]{$\bm{u}_f$}{Fluid velocity}
\nomenclature[gepsilonf]{$\epsilon_f$}{Fluid porosity}
\nomenclature[rfb]{$\bm{f}_b$}{Body force per unit volume}
\nomenclature[gepsilonf]{$\epsilon_f$}{Fluid porosity}
\nomenclature[gsigma]{$\bm{\sigma}$}{Cauchy stress tensor}

\printnomenclature
\end{document}

enter image description here