如何使命名法条目缩进?

如何使命名法条目缩进?

命名法条目默认左对齐,不缩进:

 \printnomenclature[2.5 cm] 

例如名称

我想indent 从左边距将这些符号设为1 ex1 em。但我刚刚在包装手册中丢失了nomenclature

那么我该如何重新定义indent价值呢?


nomgroup重新定义为:

\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
                    {{}}}}}}}}}}

命名法输入示例:

\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}

答案1

补丁\thenomenclature还需执行\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}

在此处输入图片描述

由于您的组标签是使用 排版的\item,因此您还必须更改它们,以便它们按当前的 跳回\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
                       {{}}}}}}}}}}

如果你说

\usepackage{xstring}

进而

\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
  }%
}

完整示例

\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}

在此处输入图片描述

答案2

如果您只是想纠正间距: \usepackage{nomencl} \makenomenclature \setlength\nomlabelwidth{2cm} % your value that aligns items

相关内容