假设我想要引用多个方程 (1)、(2)、(3)、(4)、(5) 和 (7),使得它们显示为 (1-5, 7):
\documentclass[fleqn,preprint,10pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\begin{document}
\begin{align}
\label{1}\psi([e_1,e_2]) = \psi(e_2) = e_2 = (e_2,2e_3) = (-2e_3,e_2) = (\psi(e_1), \psi(e_2))\\
\label{2}\psi([e_1,e_3]) = \psi(2e_3) = 2e_1 = (e_1,2e_3) = (-2e_3,e_1) = (\psi(e_1),\psi(e_3))\\
\label{3}\psi([e_2,e_3]) = 0 = (e_2,e_1) = (\psi(e_2),\psi(e_3)),\\
\label{4}\left\{e_4, e_1\right\},\,\,\,\left\{e_4, e_2\right\},\,\,\,\left\{e_4, e_3\right\},\,\,\,\left\{e_4, e_1+\epsilon\,e_2\right\},\\
\label{5}\left\{e_1, e_2\right\},\,\,\,\left\{e_3, e_1\right\},\,\,\,\left\{e_3, e_2\right\},\\
\label{6}\left\{e_4, e_1\right\},\,\,\,\left\{e_4, e_2\right\},\,\,\,\left\{e_4, e_3\right\},\,\,\,\left\{e_4, e_1+\epsilon\,e_2\right\},\\
\label{7}\text{Nor}_{L_4\oplus L_3}\left(\{e_2\}\right)/\{e_2\}=\,\{e_1, e_3, e_4\}
\end{align}
\end{document}
答案1
命令\cref
(或其大写版本\Cref
)cleveref
默认对参考文献列表进行排序和压缩。您可以创建组并在它们之间插入一对逗号。此外,它e/Equation(s)
根据上下文添加单词,并默认使用缩写形式e/Eq(s)
。如果使用文档的活动语言,则可以通过cleveref.cfg
文件轻松自定义术语。最后一条评论:如果您使用hyperref
,则必须加载它后它。
\documentclass[fleqn,preprint,10pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage[colorlinks]{hyperref}
\usepackage[noabbrev]{cleveref}
\newcommand\crefrangeconjunction{\textendash}
\begin{document}
\begin{align}
\label{1}\psi([e_1,e_2]) = \psi(e_2) = e_2 = (e_2,2e_3) = (-2e_3,e_2) = (\psi(e_1), \psi(e_2))\\
\label{2}\psi([e_1,e_3]) = \psi(2e_3) = 2e_1 = (e_1,2e_3) = (-2e_3,e_1) = (\psi(e_1),\psi(e_3))\\
\label{3}\psi([e_2,e_3]) = 0 = (e_2,e_1) = (\psi(e_2),\psi(e_3)),\\
\label{4}\left\{e_4, e_1\right\},\,\,\,\left\{e_4, e_2\right\},\,\,\,\left\{e_4, e_3\right\},\,\,\,\left\{e_4, e_1+\epsilon\,e_2\right\},\\
\label{5}\left\{e_1, e_2\right\},\,\,\,\left\{e_3, e_1\right\},\,\,\,\left\{e_3, e_2\right\},\\
\label{6}\left\{e_4, e_1\right\},\,\,\,\left\{e_4, e_2\right\},\,\,\,\left\{e_4, e_3\right\},\,\,\,\left\{e_4, e_1+\epsilon\,e_2\right\},\\
\label{7}\text{Nor}_{L_4\oplus L_3}\left(\{e_2\}\right)/\{e_2\}=\,\{e_1, e_3, e_4\}
\end{align}
We see from \cref{1,4,3,2,5,,7} …
\Cref{1,2,3,,6} show that …
\end{document}
答案2
一个例子:使用\crefrange
或\Crefrange
或\cref
或\Cref
理解 CSV 参考列表的命令。
确保省略 CSV 列表中的空格字符\cref
等。
\documentclass[fleqn,preprint,10pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{cleveref}
\begin{document}
\begin{align}
\psi([e_1,e_2]) = \psi(e_2) = e_2 = (e_2,2e_3) = (-2e_3,e_2) = (\psi(e_1), \psi(e_2)) \label{eq:some} \\
\psi([e_1,e_3]) = \psi(2e_3) = 2e_1 = (e_1,2e_3) = (-2e_3,e_1) = (\psi(e_1),\psi(e_3)) \label{eq:foo}\\
\psi([e_2,e_3]) = 0 = (e_2,e_1) = (\psi(e_2),\psi(e_3)),\label{eq:foobar}\\
\left\{e_4, e_1\right\},\,\,\,\left\{e_4, e_2\right\},\,\,\,\left\{e_4, e_3\right\},\,\,\,\left\{e_4, e_1+\epsilon\,e_2\right\},\label{eq:foobarfoo}\\
\left\{e_1, e_2\right\},\,\,\,\left\{e_3, e_1\right\},\,\,\,\left\{e_3, e_2\right\},\label{eq:foobarfoobar}\\
\left\{e_4, e_1\right\},\,\,\,\left\{e_4, e_2\right\},\,\,\,\left\{e_4, e_3\right\},\,\,\,\left\{e_4, e_1+\epsilon\,e_2\right\}\label{eq:foobarother}\\
\text{Nor}_{L_4\oplus L_3}\left(\{e_2\}\right)/\{e_2\}=\,\{e_1, e_3, e_4\}\label{eq:foobarnew}
\end{align}
\Crefrange{eq:some}{eq:foobarfoobar}
or \cref{eq:some,,eq:foobar,eq:foobarfoo,eq:foobarfoobar,eq:foobarnew}% eq:otherfoobar}
\end{document}