latex 运用引用功能,给公式添加标签 \label,不用自己手动更改数字的。
1. 一般情况下,可以用 \ref 命令
\ begin{
equation}
I_{
t}=I_{
0}+\sum_{
i=1}^{
t}(Q_{
i}-d_{
i})\label{
con:inventoryflow}
\ end{
equation}
Equation \ ref{
con:inventoryflow} is the inventory flow formula.
2. 若要在引用的编号两边显示括号或中括号,则可以用 (\ref) 或 [\ref] 命令:
\ begin{
equation}
I_{
t}=I_{
0}+\sum_{
i=1}^{
t}(Q_{
i}-d_{
i})\label{
con:inventoryflow}
\ end{
equation}
Equation (\ ref{
con:inventoryflow}) is the inventory flow formula.
3. 或加载 amsmath 工具包,使用 \eqref 命令:
\ begin{
equation}
I_{
t}=I_{
0}+\sum_{
i=1}^{
t}(Q_{
i}-d_{
i})\label{
con:inventoryflow}
\ end{
equation}
Constraint \ eqref{
con:inventoryflow} is the inventory flow formula.
4. 自定义引用样式,可以用 newcommand 自定义一个引用样式。
newcommand 函数的格式为:\newcommand{新命令}[参数数量][默认值]{定义内容}。默认值一般可以省略,只给出参数数量。#1表示参数内容。
\newcommand{
\myref}[1]{
Eq.\ ref{
#1}}
\ myref{
con:inventoryflow} is the inventory flow formula.