Skip to content

Commit db3fc4f

Browse files
committed
L-more-10 translation
1 parent 8a7d094 commit db3fc4f

1 file changed

Lines changed: 197 additions & 0 deletions

File tree

zh-hant/more-10.md

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
---
2+
layout: "lesson"
3+
lang: "zh-hant"
4+
title: "更多內容:數學"
5+
description: "本課展示了更多`amsmath`對齊環境、如何使數學符號加粗、數學擴充套件宏包`mathtools`,以及在數學中使用 Unicode 輸入。"
6+
toc-anchor-text: "更多內容:數學"
7+
---
8+
9+
## 更多`amsmath`對齊
10+
11+
除了主課程中展示的`align*`環境外,`amsmath`還有幾個其他的數學顯示結構,特別是`gather`用於不需要對齊的多行顯示,以及`multline`用於將較大的單個表示式分成多行,將第一行左對齊,最後一行右對齊。在所有情況下,帶`*`的形式預設省略方程編號。
12+
13+
```latex
14+
% !TEX program=lualatex
15+
16+
\documentclass{ctexart}
17+
18+
19+
\usepackage{amsmath}
20+
21+
\begin{document}
22+
23+
Gather環境
24+
\begin{gather}
25+
P(x)=ax^{5}+bx^{4}+cx^{3}+dx^{2}+ex +f\\
26+
x^2+x=10
27+
\end{gather}
28+
29+
Multline環境
30+
\begin{multline*}
31+
(a+b+c+d)x^{5}+(b+c+d+e)x^{4} \\
32+
+(c+d+e+f)x^{3}+(d+e+f+a)x^{2}+(e+f+a+b)x\\
33+
+ (f+a+b+c)
34+
\end{multline*}
35+
\end{document}
36+
```
37+
38+
### 數學對齊中的列
39+
40+
`amsmath`的對齊環境設計為每對列的第一列右對齊,第二列左對齊。這允許顯示多個方程,每個方程都圍繞其關係符號對齊。
41+
42+
```latex
43+
% !TEX program=lualatex
44+
45+
\documentclass{ctexart}
46+
47+
\usepackage{amsmath}
48+
\begin{document}
49+
對齊的方程
50+
\begin{align*}
51+
a &= b+1 & c &= d+2 & e &= f+3 \\
52+
r &= s^{2} & t &=u^{3} & v &= w^{4}
53+
\end{align*}
54+
55+
\end{document}
56+
```
57+
58+
此外,還有以`ed`結尾的顯示環境變體,用於在更大的顯示中製作子項。
59+
例如,`aligned``gathered`分別是`align``gather`的變體。
60+
61+
```latex
62+
% !TEX program=lualatex
63+
64+
\documentclass{ctexart}
65+
66+
\usepackage{amsmath}
67+
\begin{document}
68+
Aligned:
69+
\[
70+
\left.\begin{aligned}
71+
a&=b\\
72+
c&=d
73+
\end{aligned}\right\}
74+
\Longrightarrow
75+
\left\{\begin{aligned}
76+
b&=a\\
77+
d&=c
78+
\end{aligned}\right.
79+
\]
80+
\end{document}
81+
```
82+
83+
`aligned`接受類似於`tabular`的位置可選參數。
84+
這在對齊內聯數學公式的頂行時經常有用;
85+
比較下面示例中列表中的項目。
86+
87+
```latex
88+
% !TEX program=lualatex
89+
90+
\documentclass{ctexart}
91+
92+
\usepackage{amsmath}
93+
\begin{document}
94+
\begin{itemize}
95+
\item
96+
$\begin{aligned}[t]
97+
a&=b\\
98+
c&=d
99+
\end{aligned}$
100+
\item
101+
$\begin{aligned}
102+
a&=b\\
103+
c&=d
104+
\end{aligned}$
105+
\end{itemize}
106+
\end{document}
107+
```
108+
109+
## 數學加粗
110+
標準 LaTeX 有兩種方法使數學符號加粗。要使整個表示式加粗,在進入表示式前使用`\boldmath`。命令`\mathbf`也可用於將單個字母或單詞設定為直立粗體羅馬字型。
111+
112+
```latex
113+
% !TEX program=lualatex
114+
115+
\documentclass{ctexart}
116+
117+
118+
\begin{document}
119+
120+
121+
$(x+y)(x-y)=x^{2}-y^{2}$
122+
123+
{\boldmath $(x+y)(x-y)=x^{2}-y^{2}$ $\pi r^2$}
124+
125+
$(x+\mathbf{y})(x-\mathbf{y})=x^{2}-{\mathbf{y}}^{2}$
126+
$\mathbf{\pi} r^2$ % 錯誤使用\mathbf
127+
\end{document}
128+
```
129+
130+
如果你想在普通權重表示式中訪問粗體符號(就像`\boldmath`使用的那樣),可以使用`bm`宏包中的命令`\bm`。注意`\bm`也適用於`=`和希臘字母等符號。(注意在上面的示例中,`\mathbf``\pi`沒有效果。)
131+
132+
```latex
133+
% !TEX program=lualatex
134+
135+
\documentclass{ctexart}
136+
137+
\usepackage{bm}
138+
139+
\begin{document}
140+
141+
$(x+\mathbf{y})(x-\mathbf{y})=x^{2}-{\mathbf{y}}^{2}$
142+
143+
$(x+\bm{y})(x-\bm{y}) \bm{=} x^{2}-{\bm{y}}^{2}$
144+
145+
$\alpha + \bm{\alpha} < \beta + \bm{\beta}$
146+
147+
\end{document}
148+
```
149+
150+
## Mathtools
151+
`mathtools`宏包載入`amsmath`並新增了一些額外功能,比如`amsmath`矩陣環境的變體,允許指定列對齊方式。
152+
```latex
153+
% !TEX program=lualatex
154+
155+
\documentclass{ctexart}
156+
157+
\usepackage{mathtools}
158+
159+
\begin{document}
160+
161+
\[
162+
\begin{pmatrix*}[r]
163+
10&11\\
164+
1&2\\
165+
-5&-6
166+
\end{pmatrix*}
167+
\]
168+
169+
\end{document}
170+
```
171+
172+
## Unicode數學
173+
174+
[第14課](lesson-14)所述,有一些變體 TeX 引擎使用 OpenType 字型。預設情況下,這些引擎仍然使用經典的 TeX 數學字型,但你可以使用`unicode-math`宏包來使用 OpenType 數學字型。這個宏包的細節超出了本課程的範圍,我們建議你參考[宏包文件](https://texdoc.org/pkg/unicode-math)
175+
但是,我們在這裡給出一個小示例。
176+
177+
```latex
178+
% !TEX program=lualatex
179+
180+
\documentclass{ctexart}
181+
182+
\usepackage{unicode-math}
183+
\setmainfont{TeX Gyre Pagella}
184+
\setmathfont{TeX Gyre Pagella Math}
185+
186+
\begin{document}
187+
188+
一二三
189+
\[
190+
\log \alpha + \log \beta = \log(\alpha\beta)
191+
\]
192+
193+
Unicode 數學字母數字符號
194+
\[A + \symfrak{A}+\symbf{A}+ \symcal{A} + \symscr{A}+ \symbb{A}\]
195+
196+
\end{document}
197+
```

0 commit comments

Comments
 (0)