 |
数学符号的语义 |
 |
TeXmacs中的数学符号都有一些属性,这些属性对应于他们想要表示的含义。例如,
TeXmacs能够知道\(+\)是一个中缀运算符,!是一个后缀,以及分隔符。
重要的数学常量\(\mathrm{e} =
2.71828 \cdots\), \(\pi = 3.14159
\cdots\)和\(\mathrm{i}\)在TeXmacs中是用特殊的符号表示的。这些符号和纯粹的字符\(e\),
\(\pi\)和\(i\)有着不同的字形,可以通过快捷键E⇥⇥,
P⇥⇥和I⇥⇥来输入。我们建议系统性地使用这些快捷键。
相反,语义上不同的符号可能在字形上很相像。比如\(f
(x,
y)\)中的逗号分隔符,与\(3
{,} 14159
\cdots\)中的小数逗号意义完全不同。请注意,这两个符号的间距规则是不一样的。语义不同但字形相同的符号称作同形字符。
注意我们的语义是纯语法的:例如,\(+\)中缀通常用于加法,但有时也用来连接字符串。然而,这两种用法在语法上没有区别,因为\(+\)符号仍然是一个二元中缀,在与其他符号的优先级上,两者也是一致的。
最容易混淆的同形字符是TeXmacs支持的非可见字符:
-
乘积,输入*。例如:\(ab\)。
-
函数,输入␣。例如:\(\sin
x\)。
-
非可见分隔符,输入,⇥⇥。例如:矩阵\(A
= (a_{i j})\)。
-
非可见加法,输入+⇥⇥⇥⇥。例如:\(17
{}^3 /_8\)。
-
非可见符号,输入.⇥⇥⇥。例如:递增
\(\ensuremath{\mathord{}} + 1\)。
-
非可见括号(主要用于内部情况)。一组匹配的非可见括号用(⇥输入。
再一次建议大家输入这些非可见符号的时候格外小心。尤其是区分乘法和函数的时候要注意,因为没有100%准确的方法来区分这二者(我们前面已经提到了\(a
(b + c)\)和\(f (x + y)\))。
TeXmacs支持两种非常通用的输入同形字符的方式。一方面,我们依赖于标准变体系统。例如,\(\times\)和\(\ast\)分别通过*⇥和*⇥⇥来得到。在表
?中我们给出了TeXmacs支持的同形字符的完整列表。
表格 1. TeXmacs支持的同形异义字符.
|
|
| 快捷键 |
字形 |
例子 |
语义 |
| * |
|
\(ab\) |
乘法 |
| ␣ |
|
\(\sin x\) |
函数 |
| ,⇥⇥ |
|
\(a_{i j} = a_{j i}\) |
不可见分隔符 |
| +⇥⇥⇥⇥ |
|
\(17 {}^3 /_8\) |
不可见加法 |
| .⇥⇥⇥ |
|
\(\ensuremath{\mathord{}} + 1\) |
不可见符号 |
| (⇥ |
|
\(\Phi \equiv \forall x, P (x) \) |
不可见括号 |
| | |
\(|\) |
\(| - x | = | x |\) |
绝对值 |
| |⇥ |
\(|\) |
\(\{ x \in \mathbb{R}|x > 0 \}\) |
分隔竖线 |
| |⇥⇥ |
\(|\) |
\(\langle a_i^2 | a_j^2 \rangle\) |
可拉伸的中间竖线 |
| |⇥⇥⇥⇥ |
\(|\) |
\(11 \mathrel{|} 1001\) |
整除关系 |
| , |
, |
\(f (x, y)\) |
逗号分隔符 |
| ,⇥ |
, |
\(123 {,} 456\) |
十进制数字逗号 |
| . |
. |
\(123.456\) |
十进制数字小数点 |
| .⇥ |
. |
\(\lambda x . x^2\) |
点号连接符 |
| *⇥⇥⇥ |
\(\cdot\) |
\(\boldsymbol{v} \cdot \boldsymbol{w}\) |
点乘 |
| .⇥⇥ |
\(\cdot\) |
\(\cdot + 1\) |
Dummy通配符 |
| : |
\(:\) |
\(\{ x \in E : P (x) \}\) |
分隔符 |
| :⇥ |
\(:\) |
\(x : \textsf{Int}\) |
类型满足 |
| /⇥ |
\(:\) |
\(121 : 11 = 11\) |
除法 |
| \⇥ |
\(\backslash\) |
\(\backslash x\) |
反斜杠 |
| \⇥⇥ |
\(\backslash\) |
\(\mathbb{N}^{>} =\mathbb{N} \setminus \{ 0
\}\) |
集合减法 |
| & |
\(\wedge\) |
\(1 = 1 \wedge 2 = 2\) |
逻辑与 |
| *& |
\(\wedge\) |
\(\mathrm{d} x \wedge \mathrm{d} y\) |
楔积 |
|
© 2018 Joris van der Hoeven, Alexander Misel
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license is included in the section entitled
"GNU Free Documentation License".