Latex 方程式序列与条件表达式

您所在的位置:网站首页 如何输入条件格式 Latex 方程式序列与条件表达式

Latex 方程式序列与条件表达式

2024-07-13 18:47:21| 来源: 网络整理| 查看: 265

方程式序列使用参考 如何输入一个方程式序列

人们经常想要一列整齐且居中的方程式序列。使用 \begin{align}…\end{align} 来创造一列方程式,其中在每行结尾处使用 \\ 。

使用方程式序列无需声明公式符号 $ 或 $$ (Markdown 中需声明)。

请注意 {align} 语句是 自动编号 的。

示例:

123456789 $$\begin{align}\sqrt{37} & = \sqrt{\frac{73^2-1}{12^2}} \\& = \sqrt{\frac{73^2}{12^2}\cdot\frac{73^2-1}{73^2}} \\ & = \sqrt{\frac{73^2}{12^2}}\sqrt{\frac{73^2-1}{73^2}} \\& = \frac{73}{12}\sqrt{1 - \frac{1}{73^2}} \\ & \approx \frac{73}{12}\left(1 - \frac{1}{2\cdot73^2}\right)\end{align}$$

显示:

\[ \begin{align} \sqrt{37} & = \sqrt{\frac{73^2-1}{12^2}} \\ & = \sqrt{\frac{73^2}{12^2}\cdot\frac{73^2-1}{73^2}} \\ & = \sqrt{\frac{73^2}{12^2}}\sqrt{\frac{73^2-1}{73^2}} \\ & = \frac{73}{12}\sqrt{1 - \frac{1}{73^2}} \\ & \approx \frac{73}{12}\left(1 - \frac{1}{2\cdot73^2}\right) \end{align} \]

在一个方程式序列的每一行中注明条件

在 {align} 中灵活组合 \text 和 \tag 语句。\tag 语句编号优先级高于自动编号。

示例:

12345 \begin{align}v + w & = 0 &\text{Given} \tag 1\\-w & = -w + 0 & \text{additive identity} \tag 2\\-w + 0 & = -w + (v + w) & \text{equations $(1)$ and $(2)$}\end{align}

显示:

\[ \begin{align} v + w & = 0 &\text{Given} \tag 1\\ -w & = -w + 0 & \text{additive identity} \tag 2\\ -w + 0 & = -w + (v + w) & \text{equations $(1)$ and $(2)$} \end{align} \]

本例中第一、第二行的自动编号被 \tag 语句覆盖,第三行的编号为自动编号。

条件表达式使用参考 如何输入一个条件表达式

使用 begin{cases} 来创造一组条件表达式,在每一行条件中插入 & 来指定需要对齐的内容,并在每一行结尾处使用 \\,以 end{cases} 结束。

条件表达式无需声明 $ 或 $$ (Markdown 中需声明)。

示例:

1234567 $$f(n) =\begin{cases}n/2, & \text{if $n$ is even} \\3n+1, & \text{if $n$ is odd}\end{cases}$$

显示:

\[ f(n) = \begin{cases} n/2, & \text{if $n$ is even} \\ 3n+1, & \text{if $n$ is odd} \end{cases} \]

条件表达式左侧对齐

若想让文字在 左侧对齐显示 ,则有如下方式:

示例:

123456789 $$\left.\begin{array}{l}\text{if $n$ is even:}&n/2\\\text{if $n$ is odd:}&3n+1\end{array}\right\}=f(n)$$

显示:

\[ \left. \begin{array}{l} \text{if $n$ is even:}&n/2\\ \text{if $n$ is odd:}&3n+1 \end{array} \right\} =f(n) \]

条件表达式适配行高

在一些情况下,条件表达式中某些行的行高为非标准高度,此时使用 \\[2ex] 语句代替该行末尾的 \\ 来让编辑器适配。

示例:

不适配[2ex]

1234567 $$f(n) = \begin{cases}\frac{n}{2}, & \text{if $n$ is even} \\3n+1, & \text{if $n$ is odd}\end{cases}$$

适配[2ex]

1234567 $$f(n) = \begin{cases}\frac{n}{2}, & \text{if $n$ is even} \\[2ex]3n+1, & \text{if $n$ is odd}\end{cases}$$

显示:

不适配[2ex] \[ f(n) = \begin{cases} \displaystyle\frac{n}{2}, & \text{if $n$ is even} \\ 3n+1, & \text{if $n$ is odd} \end{cases} \]

适配[2ex] \[ f(n) = \begin{cases} \displaystyle\frac{n}{2}, & \text{if $n$ is even} \\[2ex] 3n+1, & \text{if $n$ is odd} \end{cases} \]

一个 [ex] 指一个 "X-Height",即 x 字母高度。可以根据情况指定多个 [ex],如 [3ex]、[4ex] 等。

其实可以在任何地方使用 \\[2ex] 语句,只要你觉得合适。

Writing Enriches Life.



【本文地址】

公司简介

联系我们

今日新闻


点击排行

实验室常用的仪器、试剂和
说到实验室常用到的东西,主要就分为仪器、试剂和耗
不用再找了,全球10大实验
01、赛默飞世尔科技(热电)Thermo Fisher Scientif
三代水柜的量产巅峰T-72坦
作者:寞寒最近,西边闹腾挺大,本来小寞以为忙完这
通风柜跟实验室通风系统有
说到通风柜跟实验室通风,不少人都纠结二者到底是不
集消毒杀菌、烘干收纳为一
厨房是家里细菌较多的地方,潮湿的环境、没有完全密
实验室设备之全钢实验台如
全钢实验台是实验室家具中较为重要的家具之一,很多

推荐新闻


图片新闻

实验室药品柜的特性有哪些
实验室药品柜是实验室家具的重要组成部分之一,主要
小学科学实验中有哪些教学
计算机 计算器 一般 打孔器 打气筒 仪器车 显微镜
实验室各种仪器原理动图讲
1.紫外分光光谱UV分析原理:吸收紫外光能量,引起分
高中化学常见仪器及实验装
1、可加热仪器:2、计量仪器:(1)仪器A的名称:量
微生物操作主要设备和器具
今天盘点一下微生物操作主要设备和器具,别嫌我啰嗦
浅谈通风柜使用基本常识
 众所周知,通风柜功能中最主要的就是排气功能。在

专题文章

    CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭