我正在尝试获取一个不对符号进行分组的命名法(例如罗马和希腊符号等)。
我认为这是一个非常简单的解决方案,但我对代码的理解不够,无法自己找到它。有人能帮我吗?我放了一张图片和我找到的代码的副本(感谢 Andrew Swann他的例子)
\documentclass{article}
\usepackage{nomencl,etoolbox,ragged2e,siunitx,mathtools}
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\newcommand{\DimensUnits}[2]{\hfill\makebox[8em]{#1\hfill}%
\makebox[4em]{#2\hfill}\ignorespaces}
\newcommand{\DefinitionCol}[1]{\hfill\parbox[t]{12em}{#1}\ignorespaces}
\newcommand{\nomsubtitle}[1]{\item[\large\bfseries #1]}
\renewcommand\nomgroup[1]{\def\nomtemp{\csname nomstart#1\endcsname}\nomtemp}
\newcommand{\nomstartR}{\nomsubtitle{Roman Symbols}%
\item[\bfseries Symbol]%
\textbf{Description}\DimensUnits{\textbf{Dimensions}}{\textbf{Units}}}
\newcommand{\nomstartG}{\nomsubtitle{Greek Symbols}%
\item[\bfseries Symbol]%
\textbf{Description}\DimensUnits{\textbf{Dimensions}}{\textbf{Units}}}
\newcommand{\nomstartD}{\nomsubtitle{Dimensionless Numbers}%
\item[\bfseries Symbol]\textbf{Description}\DefinitionCol{\textbf{Definition}}}
\renewcommand*{\nompreamble}{\markboth{\nomname}{\nomname}}
\newcommand{\nomdescr}[1]{\parbox[t]{4cm}{\RaggedRight #1}}
\newcommand{\nomwithdim}[5]{\nomenclature[#1]{#2}%
{\nomdescr{#3}\DimensUnits{#4}{#5}}}
\newcommand{\nomtypeR}[5][]{\nomwithdim{R#1}{#2}{#3}{#4}{#5}}
\newcommand{\nomtypeG}[5][]{\nomwithdim{G#1}{#2}{#3}{#4}{#5}}
\newcommand{\nomtypeD}[4][]{\nomenclature[D#1]{#2}{\nomdescr{#3}\DefinitionCol{#4}}}
\makenomenclature
\begin{document}
\mbox{}
\nomtypeR[abc]{\(a,b,c\)}{half axes of ellipsoid}{L}{\si{m}}
\nomtypeR[C]{\(C\)}{dimensionless coefficient (e.g.\ for drag model)}{--}{1}
\nomtypeG{\( \varepsilon_0 \)}{vacuum permittivity}{F/L}{\si{F.m^{-1}}}
\nomtypeD{\( \mathcal A_r \)}{Archimedes number}{\(\displaystyle
\frac{d^3g\rho_c\abs{\Delta\rho}}{\mu_c^2} = \sqrt{\frac{\mathcal
E_0^3}{\mathcal M_0}} \)}
\nomtypeR[CC]{\(\mathbf{C}\)}{another dimensionless coefficient}{--}{1}
\nomtypeR[A]{\(A\)}{a dimensionless coefficient}{--}{1}
\nomtypeR[Z]{\(Z\)}{a dimensionless coefficient}{--}{1}
\printnomenclature[6em]
\end{document}
这将给出如下结果
我希望有人能帮助我。
谢谢!
答案1
的当前版本nomenclature
提供了nomentbl
选项,这使得这些事情变得相当简单。默认情况下,表格的格式为“符号、描述、单位、注释、参考”。使用默认格式,我们有
\documentclass{article}
\usepackage[nomentbl]{nomencl}
\usepackage{etoolbox,ragged2e,siunitx,mathtools}
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\renewcommand*{\nompreamble}{\markboth{\nomname}{\nomname}}
\makenomenclature
\begin{document}
\null
\pagestyle{empty}
\nomenclature[abc]{$a,b,c$}{half axes of ellipsoid}{\meter}{$L$}
\nomenclature[C]{$C$}{dimensionless coefficient (e.g.\ for drag model)}{{dimensionless}}{}
\nomenclature{$ \varepsilon_0 $}{vacuum permittivity}{F\per\meter}{$F/L$}
\nomenclature{$ \mathcal A_r $}{Archimedes number}{{dimensionless}}{$ \frac{d^3g\rho_c\abs{\Delta\rho}}{\mu_c^2} = \sqrt{\frac{\mathcal
E_0^3}{\mathcal M_0}}$}
\nomenclature[CC]{$\mathbf{C}$}{another dimensionless coefficient}{{dimensionless}}{}
\nomenclature[A]{$A$}{a dimensionless coefficient}{{dimensionless}}{}
\nomenclature[Z]{$Z$}{a dimensionless coefficient}{{dimensionless}}{}
\printnomenclature
\end{document}