![命名法排序:按数字排序](https://linux22.com/image/249383/%E5%91%BD%E5%90%8D%E6%B3%95%E6%8E%92%E5%BA%8F%EF%BC%9A%E6%8C%89%E6%95%B0%E5%AD%97%E6%8E%92%E5%BA%8F.png)
我如何使用命名法来显示按页码而不是符号字母排序的符号列表。
以下代码用于生成此符号列表。但是,我正在尝试弄清楚如何按页码排序。
===
\documentclass[11pt,oneside,a4paper,onecolumn]{article}
\usepackage[left=1.5in,top=1.25in,bottom=1.25in,right=1.25in,papersize={8.50in,11.00in}]{geometry} % Sets the proper margins.
\usepackage{amsmath, amssymb, amsthm,mathtools} % AMS packages
\usepackage{hyperref}
\usepackage{appendix}
\usepackage[refpage]{nomencl}
\renewcommand{\nomname}{List of Notations}
\renewcommand*{\pagedeclaration}[1]{\unskip\dotfill\hyperpage{#1}}
\makenomenclature
\usepackage{makeidx}
\makeindex
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Begin List of Notation Page
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\phantomsection % Create a phantom section such that the 'List of Notation' may be properly added to the table of contents.
\addcontentsline{toc}{section}{List of Notation}
\printnomenclature[1.5cm] % This command automatically generates the list of tables based on tables in the document.
\pagebreak[4]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% End List of Notation Page
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{equation*}
F=ma
\end{equation*}
$\nomenclature{$F$}{Force}
$\nomenclature{$a$}{Acceleration}
\pagebreak[4]
\begin{equation*}
E=MC^2
\end{equation*}
$\nomenclature{$E$}{Energy}
$\nomenclature{$M$}{Mass}
$\nomenclature{$c$}{Speed of Light}
\end{document}
答案1
并非与 egreg 相矛盾(这仍然是一个奇怪的请求),但既然你问了,你可以向命名法条目添加一个可选的排序键。通常这用于几个排序类别(大写希腊文 vs 小写希腊文 vs 首字母缩略词 vs ...),但你可以将页码设为排序前缀:
\documentclass[11pt,oneside,a4paper,onecolumn]{article}
\usepackage{hyperref}
\usepackage{amsmath}
\usepackage[refpage]{nomencl}
\renewcommand{\nomname}{List of Notations}
\renewcommand*{\pagedeclaration}[1]{\unskip\dotfill\hyperpage{#1}}
\makenomenclature
\usepackage{lipsum}
\makeatletter
\newcommand{\nomentry}[2]{% to sort by pages
\nomenclature[\two@digits{\value{page}}]{#1}{#2}%
} % Ref: https://tex.stackexchange.com/questions/30930/how-to-output-a-counter-with-leading-zeros
%\newcommand{\nomentry}[2]{% to sort normally
% \nomenclature{#1}{#2}%
%}
\makeatother
\begin{document}
\printnomenclature[1.5cm]
\clearpage
\begin{equation*}
F=ma
\end{equation*}
\nomentry{$F$}{Force}
\nomentry{$a$}{Acceleration}
\clearpage
\begin{equation*}
E=MC^2
\end{equation*}
\nomentry{$E$}{Energy}
\nomentry{$M$}{Mass}
\nomentry{$c$}{Speed of Light}
\lipsum
\lipsum
\lipsum
\lipsum
\lipsum
\lipsum
\lipsum
\lipsum
Also, in some cases, \(m\ddot{x} + + k x = 0\)
\nomentry{$m$}{Mass (also)}
\nomentry{$k$}{Spring Stiffness}
\nomentry{$x$}{Displacement}
\end{document}
这有一个限制,就是超过 99 页就不能正确排序了,而且你仍然会按区分大小写的字母对每一页进行排序,而不是按顺序排序。我希望有办法整合fmtcount
使用任意数量的零填充来修复页面限制,但我还没有弄清楚。