Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
    
Maybe \renewcommand{\nomlabel}[1]{\hspace{1em}#1}? Seems to be a bit of a hack, though... –  cgnieder Jan 19 '13 at 17:17
    
@cgnieder It did work. but the group name Acronyms is also indent. As I have redefined the \nomgroup, how do I only make the symbols indent? –  KOF Jan 19 '13 at 17:24

1 Answer 1

up vote 5 down vote accepted

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

share|improve this answer
    
The command \renewcommand{\nomlabel}[1]{\hspace{1em}#1} does work. But What I want to do is to keep Symbol group-name, e.g. Acronyms shown in the above figure not indent. –  KOF Jan 19 '13 at 17:59
1  
@KOF Please, make a new question with a complete compilable example that shows the problem. Note that this question has nothing like a complete compilable example. –  egreg Jan 19 '13 at 18:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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