Forgot password
 Register account
View 387|Reply 3

$\verb|\cases|$,$\verb|\begin{cases}...\end{cases}|$在第二列有区别?

[Copy link]

3204

Threads

7842

Posts

48

Reputation

Show all posts

hbghlyj posted 2022-4-24 15:24 |Read mode
为什么$\verb|\cases|$的第二列是文本模式而$\verb|\begin{cases}...\end{cases}|$是数学模式
$f(x)=\cases{0&-π≤x<0\\x&0≤x<π}$
$f(x)=\begin{cases}0&-π≤x<0\\x&0≤x<π\end{cases}$
  1. $f(x)=\cases{0&-π≤x<0\\x&0≤x<π}$
  2. $f(x)=\begin{cases}0&-π≤x<0\\x&0≤x<π\end{cases}$
Copy the Code

677

Threads

110K

Posts

214

Reputation

Show all posts

kuing posted 2022-4-24 17:02
\cases 命令在最初的 TeX 里就已经有了:
\def\cases#1{\left\{\,\vcenter{\normalbaselines\m@th
\ialign{$##\hfil$&\quad##\hfil\crcr#1\crcr}}\right.}
(这段代码来自《The TEXbook》)
可以看到它的第二列是没加美元符的,所以就是文本模式。

后来 LaTeX 也继承了这一点:
\DeclareRobustCommand\cases[1]{\left\{\,\vcenter{\normalbaselines\m@th
\ialign{$##\hfil$&\quad{##}\hfil\crcr#1\crcr}}\right.}
(这段代码来自 source2e.pdf)

而 cases 环境是 amsmath 宏包定义的,而且加载该宏包后,\cases 命令不能再用。
Explanation: When the amsmath package is used, the old forms of \pmatrix, \matrix, and \cases cannot be used any longer because of naming conflicts. Their syntax did not conform with standard LATEX syntax in any case.
(来自 amsldoc.pdf)

而在这里竟然两个都能用,看来还是因为 MathJax 够宽容。

677

Threads

110K

Posts

214

Reputation

Show all posts

kuing posted 2022-4-24 17:22
再后来,mathtools 宏包又给出了带 * 的 cases 环境,第二列为文本模式。
还有更多的:
QQ截图20220424172250.png
d 的就是 displaystyle;
r 的就是括号在右边。
推荐使用。(本论坛也已支持)

3204

Threads

7842

Posts

48

Reputation

Show all posts

original poster hbghlyj posted 2022-4-24 19:08
测试一下
$\begin{rcases}y=x^2\\z=y^2\end{rcases}⇒z=x^4$

Quick Reply

Advanced Mode
B Color Image Link Quote Code Smilies
You have to log in before you can reply Login | Register account

$\LaTeX$ formula tutorial

Mobile version

2025-7-6 10:40 GMT+8

Powered by Discuz!

Processed in 0.015017 seconds, 25 queries