如何在 Latex 中引用多个方程式?

如何在 Latex 中引用多个方程式?

假设我想要引用多个方程 (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(或其大写版本\Crefcleveref默认对参考文献列表进行排序和压缩。您可以创建组并在它们之间插入一对逗号。此外,它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}

在此处输入图片描述

相关内容