AsciiMath 速查表
AsciiMath 书写公式的方式,就像你在聊天框里打数学:
sqrt(x^2+1)、a/b、sum_(n=1)^oo。
这里列出所有符号、它们的显示效果和对应的 LaTeX,还有一个可以自己
试试的输入框。
从 AsciiMath 到 LaTeX
示例:
\sum_{n = 1}^{\infty} \frac{1}{n^{2}} = \frac{\pi^{2}}{6}
转换在你的浏览器中完成,所用代码与排版 live-math 文稿时相同。
这里的十进制数使用小数点:3.14。
什么是 AsciiMath
AsciiMath 是一种为快速输入、且在排版前也易于阅读而设计的数学标记。
分数、幂和根号像计算器上那样写:(a+1)/(b+1)、x^(n+1)、
sqrt(x);符号则是简短的单词,oo 表示
,-> 表示 ,in
表示 。括号会自动变大,矩阵就是一串行。
它由 Peter Jipsen 创建,用于在网页上书写数学;MathJax 和 AsciiDoc 也能读取它。本页的符号来自 live-math,它额外加入了意大利教材中的 函数名和线性代数运算符。
AsciiMath 还是 LaTeX?
LaTeX 是印刷数学的标准,写论文或学位论文当然应该用它。但边讲边写时,
它太慢了:每一步都要写花括号、反斜杠和 \frac{}{}。
AsciiMath 用大约三分之二的字符就能表达同样的内容,而且它的输出就是
LaTeX:每个公式都可以转换,整份文稿也能导出为 LaTeX 文件。
live-math 正是建立在这之上:你在课堂上输入 AsciiMath,学生就能同步看到 排版好的结果,图像也能由一行文字画出。可以到首页看看, 或者打开编辑器。
全部符号
每一行依次是:可以输入的写法(任意一种形式均可)、显示效果和对应的
LaTeX。空格只起分隔作用:sinx 和 sin x 相同。
分数、上下标与根式
/ 会把紧邻它前后的内容变成分数:一个符号、一个数字,
或括号中的一组内容。^ 和 _ 分别用于指数和下标,
作用相同。分子、分母、指数或下标外面的括号不会显示:
(a+1)/(b+1) 显示为 ,x^(n+1)
显示为 。要保留括号,就写两重:
((a+b))/2 显示为 。在其他位置,括号会保留:
(a+b)^2 显示为 。
x^2x^{2}x_1x_{1}x_1^2x_{1}^{2}x^(n+1)x^{n + 1}a/b\frac{a}{b}(a+1)/(b+1)\frac{a + 1}{b + 1}frac(a)(b)\frac{a}{b}sqrt x Sqrt x\sqrt{x}sqrt(x+1)\sqrt{x + 1}root(3)(x)\sqrt[3]{x}stackrel(def)(=)\stackrel{d e f}{=}overset(*)(=)\overset{\cdot}{=}underset(x->0)(=)\underset{x \to 0}{=}cancel(x)\cancel{x}color(red)(x^2)\textcolor{red}{x^{2}}color 只给它的参数上色;颜色可以用名称指定(red、blue、green、orange、purple……)。
希腊字母
alpha\alphabeta\betagamma\gammaGamma\Gammadelta\deltaDelta\Deltaepsilon epsi\epsilonvarepsilon\varepsilonzeta\zetaeta\etatheta\thetaTheta\Thetavartheta\varthetaiota\iotakappa\kappalambda lamda\lambdaLambda Lamda\Lambdamu\munu\nuxi\xiXi\Xipi\piPi\Pirho\rhosigma\sigmaSigma\Sigmatau\tauupsilon\upsilonphi\phiPhi\Phivarphi\varphichi\chipsi\psiPsi\Psiomega\omegaOmega\Omega运算
a + ba + ba - ba - ba * b a cdot ba \cdot ba ** b a ast ba \ast ba *** b a star ba \star ba xx b a times ba \times ba -: b a div b a divide ba \div ba // ba / bA \\ B A backslash BA \backslash BA setminus BA \setminus Ba +- b a pm ba \pm bf @ g f circ gf \circ ga o+ b a oplus ba \oplus ba ox b a otimes ba \otimes ba o. b a odot ba \odot bp ^^ q p wedge qp \wedge qp vv q p vee qp \vee qA nn B A cap BA \cap BA uu B A cup BA \cup BA |>< B A ltimes BA \ltimes BA ><| B A rtimes BA \rtimes BA |><| B A bowtie BA \bowtie Ba mod na \operatorname{mod} n大型运算符、极限、积分
上下限写在 _ 和 ^ 之后;不止一个符号时要用括号。
单独成行时,它们会排在运算符的上下方。
sum_(n=1)^oo a_n\sum_{n = 1}^{\infty} a_{n}prod_(i=1)^n x_i\prod_{i = 1}^{n} x_{i}int_a^b f(x) dx\int_{a}^{b} f{{\left ( x \right )}} \mathop{}\!dxoint_gamma f(z) dz\oint_{\gamma} f{{\left ( z \right )}} \mathop{}\!dzlim_(x->0) f(x)\lim_{x \to 0} f{{\left ( x \right )}}Lim_(n->oo) a_n\operatorname{Lim}_{n \to \infty} a_{n}limsup_(n->oo) a_n\limsup_{n \to \infty} a_{n}liminf_(n->oo) a_n\liminf_{n \to \infty} a_{n}max_(x in A) f(x)\max_{x \in A} f{{\left ( x \right )}}min_(x in A) f(x)\min_{x \in A} f{{\left ( x \right )}}sup A\sup Ainf A\inf Alub A\operatorname{lub} Aglb A\operatorname{glb} Adim V\dim V^^^_(i in I) p_i bigwedge_(i in I) p_i\bigwedge_{i \in I} p_{i}vvv_(i in I) p_i bigvee_(i in I) p_i\bigvee_{i \in I} p_{i}nnn_(i in I) A_i bigcap_(i in I) A_i\bigcap_{i \in I} A_{i}uuu_(i in I) A_i bigcup_(i in I) A_i\bigcup_{i \in I} A_{i}关系符
a = ba = ba != b a ne ba \ne ba < b a lt ba < ba > b a gt ba > ba <= b a le ba \le ba lt= b a leq ba \leq ba >= b a ge ba \ge ba gt= b a geq ba \geq ba -< b a -lt b a prec ba \prec ba -<= b a preceq ba \preceq ba >- b a succ ba \succ ba >-= b a succeq ba \succeq bx in Ax \in Ax !in A x notin Ax \notin AA sub B A subset BA \subset BA sube B A subseteq BA \subseteq BA supset BA \supset BA supe B A supseteq BA \supseteq Ba -= b a equiv ba \equiv ba ~= b a cong ba \cong ba ~~ b a approx ba \approx ba prop b a propto ba \propto ba := ba := ba :|: ba \rvert : b逻辑
p and qp \quad\text{and}\quad qp or qp \quad\text{or}\quad qnot p neg p\neg pp => qp \Rightarrow qp implies qp \implies qp <=> qp \Leftrightarrow qp iff qp \iff qy = 1 if x > 0y = 1 \quad\text{if}\quad x > 0AA x forall x\forall xEE x exists x\exists x_|_ bot\botTT top\topp |-- q p vdash qp \vdash qp |== q p models qp \models q:. therefore\therefore:' because\because括号
括号会随内容自动变大。{: x :} 是一对不可见的括号,
适合用来分组;(: :) 是尖括号。|x| 表示绝对值:
竖线在括号内成对匹配,所以 |x - a| < delta 会按字面意思
正确排版。
(x){\left ( x \right )}[x]{\left [ x \right ]}{x}{\left \lbrace x \right \rbrace}|x|{\left \lvert x \right \rvert}(: x :) << x >> langle x rangle{\left \langle x \right \rangle}|: x :|{\left \lvert x \right \rvert}{: x :}{\left . x \right .}lbrace x rbrace{\left \lbrace x \right \rbrace}abs(x) Abs(x){\left | x \right |} norm(x){\left \| x \right \|} floor(x) |__ x __| lfloor x rfloor{\left \lfloor x \right \rfloor} ceil(x) |~ x ~| lceil x rceil lceiling x rceiling{\left \lceil x \right \rceil} 箭头
uarr uparrow\uparrowdarr downarrow\downarrowrarr rightarrow\rightarrow-> to\to>-> rightarrowtail\rightarrowtail->> twoheadrightarrow\twoheadrightarrow>->> twoheadrightarrowtail\twoheadrightarrowx |-> y x mapsto yx \mapsto ylarr leftarrow\leftarrowharr leftrightarrow\leftrightarrowrArr Rightarrow\RightarrowlArr Leftarrow\LeftarrowhArr Leftrightarrow\Leftrightarrow函数
函数名用正体排版,后面跟参数,可以带括号也可以不带:sin x、
sin(x)、sin^2 x。f 和 g
只有出现在括号前才是函数:f(x),而 f g 仍是乘积。
sin x\sin{x}cos x\cos{x}tan x\tan{x}cot x\cot{x}sec x\sec{x}csc x\csc{x}arcsin x\arcsin{x}arccos x\arccos{x}arctan x\arctan{x}sinh x\sinh{x}cosh x\cosh{x}tanh x\tanh{x}coth x\coth{x}sech x\operatorname{sech}{x}csch x\operatorname{csch}{x}exp x\exp{x}log x\log{x}ln x\ln{x}det A\det{A}gcd(a, b)\gcd{{\left ( a , b \right )}}lcm(a, b)\operatorname{lcm}{{\left ( a , b \right )}}f(x)f{{\left ( x \right )}}g(x)g{{\left ( x \right )}}首字母大写的名称
Sin x\operatorname{Sin}{x}Cos x\operatorname{Cos}{x}Tan x\operatorname{Tan}{x}Cot x\operatorname{Cot}{x}Sec x\operatorname{Sec}{x}Csc x\operatorname{Csc}{x}Arcsin x\operatorname{Arcsin}{x}Arccos x\operatorname{Arccos}{x}Arctan x\operatorname{Arctan}{x}Sinh x\operatorname{Sinh}{x}Cosh x\operatorname{Cosh}{x}Tanh x\operatorname{Tanh}{x}Log x\operatorname{Log}{x}Ln x\operatorname{Ln}{x}意大利语函数名与线性代数
意大利教材中使用的函数名,以及线性代数的运算符。
Im 只有出现在括号前才表示像:
Im(f),而 Im z 仍是乘积。
sen x\operatorname{sen}{x}arcsen x\operatorname{arcsen}{x}tg x\operatorname{tg}{x}arctg x\operatorname{arctg}{x}cotg x\operatorname{cotg}{x}arccotg x\operatorname{arccotg}{x}sh x\operatorname{sh}{x}ch x\operatorname{ch}{x}th x\operatorname{th}{x}settsh x\operatorname{settsh}{x}settch x\operatorname{settch}{x}rg A\operatorname{rg}{A}rank A\operatorname{rank}{A}Ker f\operatorname{Ker}{f}Im(f)\operatorname{Im}{{\left ( f \right )}}tr A\operatorname{tr}{A}span(v, w)\operatorname{span}{{\left ( v , w \right )}}重音符号
hat x\hat{x}bar x overline(x)\overline{x}vec v\vec{v}tilde x\tilde{x}dot x\dot{x}ddot x\ddot{x}ul(x) underline(x)\underline{x}ubrace(1+2)_3 underbrace(1+2)_3\underbrace{1 + 2}_{3}obrace(1+2)^3 overbrace(1+2)^3\overbrace{1 + 2}^{3}字体
bb(A) mathbf(A)\mathbf{A}bbb(R) mathbb(R)\mathbb{R}cc(F) mathcal(F)\mathcal{F}tt(x) mathtt(x)\mathtt{x}fr(g) mathfrak(g)\mathfrak{g}sf(x) mathsf(x)\mathsf{x}公式中的文本
双引号之间的文字保持为文字:x = 1 " 若 " y > 0。
文字紧贴符号时会自动加一个细空格,所以 "对所有"x 不会挤在一起。
and、or、if 作为单词时本身已有间距。
x = 1 "and" y = 2x = 1 \,\text{and}\, y = 2text(text) mbox(text)\text{text}矩阵、向量、方程组
矩阵就是一串行,每行放在括号中,用逗号分隔:
[[1,2],[3,4]] 用方括号,((1,2),(3,4)) 用圆括号,
|(a,b),(c,d)| 表示行列式。列向量就是只有一列的矩阵。方程组
是左侧带 {、右侧为空 :} 的矩阵:
A = [[1,2],[3,4]]
det A = |(1,2),(3,4)| = -2
vec v = ((x),(y),(z))
{(x + y = 1),(x - y = 2):}
|x| = {(x, " 若 " x >= 0),(-x, " 若 " x < 0):}其他符号
del partial\partialgrad nabla\nablaoo infty\inftyO/ emptyset\emptysetaleph\aleph/_ angle\angle/_\ triangle\trianglediamond\diamondsquare boxempty\squarefrown\frown... ldots\ldotscdots\cdotsvdots\vdotsddots\ddotsa quad ba \quad ba qquad ba \qquad ba \ ba \, b50%50 \%NN\mathbb{N}ZZ\mathbb{Z}QQ\mathbb{Q}RR\mathbb{R}CC\mathbb{C}f'(x) f prime(x)f ' {\left ( x \right )}f''(x)f '' {\left ( x \right )}f'''(x)f ''' {\left ( x \right )}x^2 dxx^{2} \mathop{}\!dxdy\mathop{}\!dydz\mathop{}\!dzdt\mathop{}\!dt