latex 引用公式

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.

显示效果:


中文排版时一般需要编译两次才能正确引用。

评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

心态与习惯

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值