我目前正在我的论文中做一个“命名法”类型的列表(附图)。
我正在使用大学为这一特定部分提供的模板:
\usepackage{usnomencl}
:
\chapter{Terminology and Nomenclature}
\begin{Nomencl}
\NomGroup{Constants}%-----------------------------------------------
\item[$\mathscr{F}$] Faraday\textquotesingle s constant, 96,485 C mol$^{-1}$
\item[${g}_{\mathrm{n}}$] Gravitational acceleration, 9.81 m s$^{-2}$
\item[$R$] Universal gas constant, 8.314 J K$^{-1}$ mol$^{-1}$
\NomGroup{Variables}%-----------------------------------------------
\item[$E_{\mathrm{a}}$]
\UnitLine{Activation energy}{kJ\,mol^{-1}}
\item[$E$] \UnitLine{Oxidation-reduction potential}{V}
\item[$E$\textdegree] \UnitLine{Standard oxidation-reduction potential (25 \textcelsius, $P_{\mathrm{H}_2}=1$ bar)}{V}
\item[$T$] \UnitLine{Temperature}{K}
\item[$\ddot{x}$] \UnitLine{Acceleration }{m/s^2}\\
\item[$\theta$] \UnitLine{Rotation angle }{rad}
\item[$\tau$] \UnitLine{Moment }{N{\cdot}m}
\NomGroup{Abbreviations and acronyms}%-------------------------------------
\item[ATR-FTIR]Attenuated total reflectance-Fourier-transform infrared
\item[EPR]Electron paramagnetic resonance
\item[GC-MS]Gas chromatography---mass spectrometry
\item[HPLC]High-performance liquid chromatography
\item[ICP-OES]Inductively-coupled plasma---optical emission spectroscopy
\NomGroup{Subscripts}%----------------------------------------------
\item[$\mathrm{a}$] Adiabatic
\item[$a$] Coordinate
\end{Nomencl}
该模板基于名为 usnomencl.sty 的样式文件。
我希望能够更好地对齐文本中的缩写和首字母缩略词部分。有些术语比模板最初提供的空间要长,所以我想将定义稍微向右对齐,以容纳所有术语。
我尝试过使用类似制表环境的东西,但最终出现错误而没有输出。
我是 LaTeX 的新手,因此查看实际的样式文件内部真是令人难以置信。:)
任何建议都将不胜感激,如果之前已经回答过类似的问题,我深表歉意。
答案1
只需将“缩写和首字母缩略词”组用其自己的 Nomencl 环境(在内部,仅排版为列表)包装起来,然后赋予它自己的标签宽度。
\begin{Nomencl}[<width>]
<nomenclature content>
\end{Nomencl}
默认宽度为 2em。
梅威瑟:
\documentclass{report}
\usepackage{usnomencl} % https://www.ctan.org/pkg/stellenbosch?lang=en
\begin{document}
\chapter{Terminology and Nomenclature}
\begin{Nomencl}
\NomGroup{Constants}%-----------------------------------------------
\item[$F$] Faraday's constant, 96,485 C mol$^{-1}$
\item[${g}_{\mathrm{n}}$] Gravitational acceleration, 9.81 m s$^{-2}$
\item[$R$] Universal gas constant, 8.314 J K$^{-1}$ mol$^{-1}$
\NomGroup{Variables}%-----------------------------------------------
\item[$E_{\mathrm{a}}$]
\UnitLine{Activation energy}{kJ\,mol^{-1}}
\item[$E$] \UnitLine{Oxidation-reduction potential}{V}
\item[$E$d] \UnitLine{Standard oxidation-reduction potential (25 C, $P_{\mathrm{H}_2}=1$ bar)}{V}
\item[$T$] \UnitLine{Temperature}{K}
\item[$\ddot{x}$] \UnitLine{Acceleration }{m/s^2}\\
\item[$\theta$] \UnitLine{Rotation angle }{rad}
\item[$\tau$] \UnitLine{Moment }{N{\cdot}m}
\end{Nomencl}
\begin{Nomencl}[5em]
\NomGroup{Abbreviations and acronyms}%-------------------------------------
\item[ATR-FTIR] Attenuated total reflectance-Fourier-transform infrared
\item[EPR] Electron paramagnetic resonance
\item[GC-MS]Gas chromatography---mass spectrometry
\item[HPLC]High-performance liquid chromatography
\item[ICP-OES]Inductively-coupled plasma---optical emission spectroscopy
\end{Nomencl}
\begin{Nomencl}
\NomGroup{Subscripts}%----------------------------------------------
\item[$\mathrm{a}$] Adiabatic
\item[$a$] Coordinate
\end{Nomencl}
\end{document}
答案2
对于那些感兴趣的人,这里是该样式文件的原始内容:
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{usnomencl}[2008/05/30
v1.1
Stellenbosh Thesis Nomenclature (DNJ ELS)]
\RequirePackage{calc}
\newlength{\USN@tdima}
\newlength{\USN@NomGrpSep}
\newlength{\NomGrpSep}
\newlength{\NomItmSep}
\newlength{\NomItmMrg}
\newlength{\NomLblSep}
\setlength{\NomGrpSep}{\baselineskip}
\setlength{\NomItmSep}{\smallskipamount}
\setlength{\NomItmMrg}{1em}
\setlength{\NomLblSep}{1em}
\newcommand{\NomGrpLabel}[1]{\textbf{#1}}
\setlength{\USN@NomGrpSep}{0pt}
\newcommand\NomGroup[1]{%<-Group Headings
\vspace{\USN@NomGrpSep}%
\setlength{\USN@NomGrpSep}{\NomGrpSep}%
\item[\hspace*{-\NomItmMrg}\NomGrpLabel{#1}]}
\newcommand{\NomLabel}[1]{#1\hfil}
\newenvironment{Nomencl}[1][2em]%<- Nomenclature list environment
{\list{}{%
\setlength{\labelwidth}{#1}%
\setlength{\labelsep}{\NomLblSep}%
\setlength{\itemindent}{0pt}%
\setlength{\leftmargin}{\labelwidth+\labelsep-\itemindent+\NomItmMrg}%
\setlength{\listparindent}{\parindent}%
\setlength{\itemsep}{\NomItmSep}%
\setlength{\parsep}{\parskip}%
\let\makelabel\NomLabel}}%
{\endlist}
\newcommand*{\UnitLabel}[1]{~[\,\ensuremath{\mathrm{#1}}\,]}
\newlength{\UnitLabelWdth}
\setlength{\UnitLabelWdth}{2cm}
\newcommand{\UnitLine}[3][\UnitLabelWdth]{{%
\setlength{\USN@tdima}{#1}%
\rightskip\USN@tdima\relax
\parfillskip -\rightskip
\leavevmode
{#2}\nobreak
\leaders\hbox{$\m@th\mkern \@dotsep mu\hbox{\tiny.}\mkern \@dotsep mu$}%
\hfill
\nobreak
\makebox[\USN@tdima][l]{\UnitLabel{#3}}%
}}
\endinput
%%
%% End of file `usnomencl.sty'.