Forgot password?
 Create new account
Author: kuing

本论坛的 $\mathrm\LaTeX$ 公式的基本输入[2021-9-26更新]

[Copy link]

1

Threads

10

Posts

61

Credits

Credits
61

Show all posts

周险峰 Posted at 2017-5-20 09:35:05
Last edited by 周险峰 at 2017-5-20 09:54:00行内试试看:\(a^2=b^2+bc\)
行间试试看:\[e^x\geqslant ex+(x-1)^2\]
复杂点的试试:\[\frac c{b}+\frac b{c}=\frac {b^2+c^2-a^2}{bc}+\frac {a^2}{bc}=2\cos A+2\sin A\]
来个分段函数:\[f(x)=\begin{cases}x^2+2x+3&x\geqslant2\\e^x-x&x<0\end{cases}\]
来个换行等号:\begin{align*}
\frac c{b}+\frac b{c}&=\frac {b^2+c^2-a^2}{bc}+\frac {a^2}{bc}\\&=2\cos A+2\sin A\\&=2\sqrt2 \sin(A+\frac{\pi}{4})\end{align*}

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

 Author| kuing Posted at 2017-5-20 12:43:10
回复 41# 周险峰

你也可以在页面下方的“草稿本”中测试。

30

Threads

52

Posts

675

Credits

Credits
675

Show all posts

wanhuihua Posted at 2018-2-23 14:23:10
可以按照Latex格式完全复制某人的证明吗?谢谢

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

 Author| kuing Posted at 2018-2-23 17:40:28
回复 43# wanhuihua

办法是有的,但我建议你还是先试着自己输入。

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

 Author| kuing Posted at 2020-7-19 00:58:53
回复 46# hbghlyj

提到 dots ,我就多扯几句……

在真 LaTeX 中,不加载 amsmath 的话,\dots 和 \ldots 是一样的,就是在基线上的(与普通句点相同高度的)三点,\cdots 则是相对高一点的(与点乘号相同高度的)三点。

加载 amsmath 的话,该宏包改变了 \dots ,会视情况给出适当的三点,手册原文:
For most situations, the undifferentiated \dots can be used, and amsmath will output the most suitable form based on the immediate context; if an inappropriate form results, it can be corrected after examining the output.
google 翻译一下:
在大多数情况下,可以使用未区分的\dots,并且amsmath会根据当前上下文输出最合适的形式;如果结果不正确,则可以在检查输出后进行更正。
没说具体的判断规则,我也没细究,一向都是自己手工选择 \ldots 或 \cdots 。

闲来无事,想搞清楚,就去看 amsmath.sty 的代码,可惜太复杂了,超出我的能力范围,只好做做测试吧……

本论坛的 mathjax 是有 amsmath 的,所以可以在论坛上测试,以下省略号全是用 \dots
\begin{gather*}
a+\dots+z \\[1ex]
a,\dots,z \\[1ex]
S=a+b+\dots \\[1ex]
a+b+\dots=S \\[1ex]
a,b,\dots \\[1ex]
a,b,\dots=0 \\[1ex]
ab\dots z \\[1ex]
a,\dots\sum\dots\sum\dots \\[1ex]
a,\dots\int\dots\int\dots \\[1ex]
\end{gather*}看起来,似乎只有当 \dots 的后面是运算符或关系符的时候才会是居中的三点

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

 Author| kuing Posted at 2020-7-19 01:13:09
回复 47# kuing

我错了,mathjax 和真 LaTeX 有区别,在真 LaTeX 里 \dots 后跟 \sum 或 \int 之类的也是会居中的。

也用 KaTeX 测试一下,看看是不是如我一向的感觉:KaTeX 总是更接近真 LaTeX
QQ截图20210926175509.png
果然如此!

801

Threads

4889

Posts

310K

Credits

Credits
36169

Show all posts

isee Posted at 2020-7-20 19:02:16
论坛代码要求好“松”,e^x_0 都能显示出是要表达的式子

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

 Author| kuing Posted at 2020-7-20 19:16:10
论坛代码要求好“松”,e^x_0 都能显示出是要表达的式子
isee 发表于 2020-7-20 19:02
e^x_0 get $e^x_0$,这不是正常结果吗?

801

Threads

4889

Posts

310K

Credits

Credits
36169

Show all posts

isee Posted at 2020-7-20 22:38:02
回复 50# kuing


表达有误,应该是指这类 e^\sqrt 2

15

Threads

948

Posts

110K

Credits

Credits
12412

Show all posts

色k Posted at 2020-7-20 23:09:11
回复 51# isee

嗯,这的确是

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

 Author| kuing Posted at 2020-7-21 00:56:35
回复 51# isee

真 LaTeX 里,连 f_\max 都不行……

说到这个,我记得我曾经在 CTEX 论坛上问过,为啥 f_\alpha 可以但 f_\max 却不行,回答是怎样我不记得了,反正对此我现在还不太清楚。

801

Threads

4889

Posts

310K

Credits

Credits
36169

Show all posts

isee Posted at 2021-8-10 00:34:06
整除符号 \mid  

不整除 \nmid(大小不变)

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

 Author| kuing Posted at 2021-9-26 12:46:48
回复 33# isee

加上了。

最近有新人入坛,更新了一下置顶帖

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

 Author| kuing Posted at 2022-4-15 15:29:59
回复 35# hbghlyj

你是怎么发现的?

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

hbghlyj Posted at 2022-6-2 00:00:26
kuing 发表于 2020-7-18 17:58 回复 46# hbghlyj 提到 dots ,我就多扯几句……
SymbolCommand
$\cdot$\cdot
$\cdotp$\cdotp
$\centerdot$\centerdot
$\bullet$\bullet
$\dots$\dots
$\cdots$\cdots
$\ldots$\ldots
$\dotsb$\dotsb
$\dotsc$\dotsc
$\dotsi$\dotsi
$\dotsm$\dotsm
$\dotso$\dotso
$\mathellipsis$\mathellipsis
$\ddots$\ddots
$\vdots$\vdots
$\iddots$\iddots
在KaTeX中提供了\mathellipsis:见KaTeX issue 596
$value[1].jpg
\iddots是由mathdots提供的,
在MathJax中,可以直接使用Unicode字符⋰或者\unicode{x22f0},参见math.meta.stackexchange.com

测试
\[1 \cdot 2 \cdotp 3 \centerdot 4 \bullet\]
\[1 \cdot 2 \cdotp 3 \centerdot 4 \bullet\]
\[1 \dots 2 \cdots 3 \ldots4\]
\[1 \dots 2 \cdots 3 \ldots4\]
\[1 \dotsb 2 \dotsc 3 \dotsi 4 \dotsm 5 \dotso 6\]
\[1 \dotsb 2 \dotsc 3 \dotsi 4 \dotsm 5 \dotso 6\]
在KaTeX中,可以看到3后面的\dotsi和3的距离非常近 Screenshot 2022-06-01 at 17-22-50 KaTeX – The fastest math typesetting library .png

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

hbghlyj Posted at 2022-7-13 21:12:20
刚发现,括号的字号呈等差数列,0.423em为公差
$\big($\big(1.2em
$\Big($\Big(1.623em
$\bigg($\bigg(2.047em
$\Bigg($\Bigg(2.470em


刚发现\bigl\langle\bigl<效果一样$$\bigl\langle$$
$$\bigl<$$
生成的MathML都是
  <mrow data-mjx-texclass="OPEN">
    <mo minsize="1.2em" maxsize="1.2em">&#x27E8;</mo>
  </mrow>




另外\big\langle\big<效果一样
$$\big<$$
$$\big\langle$$
生成的MathML都是
  <mrow data-mjx-texclass="ORD">
    <mo minsize="1.2em" maxsize="1.2em">&#x27E8;</mo>
  </mrow>



还有\left\langle\left<效果一样
$$\left<\prod^n_{i=1}\right.$$
$$\left\langle\prod^n_{i=1}\right.$$
生成的MathML都是
  <mrow data-mjx-texclass="INNER">
    <mo data-mjx-texclass="OPEN">&#x27E8;</mo>
    (⋯ nodes in the bracket ⋯)
  </mrow>




还可以把\langle>配对使用:
\left<123\right\rangle
$$\left<123\right\rangle$$

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

hbghlyj Posted at 2022-7-16 03:12:41
脚标在前面, 使用\sideset或者{}_{...}的效果不同:
$\sideset{_\mathcal{B}}{_\mathcal{B}}{[T]}$ vs ${}_\mathcal{B}[T]_\mathcal{B}$

701

Threads

110K

Posts

910K

Credits

Credits
94145
QQ

Show all posts

 Author| kuing Posted at 2022-7-16 14:40:03
hbghlyj 发表于 2022-7-16 03:12
脚标在前面, 使用\sideset或者{}_{...}的效果不同:
$\sideset{_\mathcal{B}}{_\mathcal{B}}{[T]}$ vs ${}_\ ...
\sideset{_\mathcal{B}}{_\mathcal{B}}{[T]}
这个写法有问题,在真 latex 里是会报错的。

\sideset 的第三个参数必须是一个 math operator,比如 \sum、\int、\max 之类。

所以如果确实需要作用于 [T] ,那就应该用 \mathop 来包住它,即
\sideset{_\mathcal{B}}{_\mathcal{B}}{\mathop{[T]}}

在真 latex 里:
  1. \documentclass{article}
  2. \usepackage{amsmath,amssymb}
  3. \begin{document}
  4. $\sideset{_\mathcal{B}}{_\mathcal{B}}{\mathop{[T]}}$
  5. vs
  6. ${}_\mathcal{B}[T]_\mathcal{B}$
  7. \end{document}
Copy the Code
效果是:
QQ截图20220716144131.png

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

hbghlyj Posted at 2022-7-16 15:22:31
tex.stackexchange.com/a/159308
MathML has a prescripts mechanism using <mmultiscripts> and <mprescripts> so in MathJaX you also have the possibility of directly accessing those rather than relying on conversion from some "standard" LaTeX package markup. You can generate any MathML element from the TeX MathJax syntax using \mmlToken.

蓝色字好像有错: MathJax中只能用\mmlToken生成token element,而<mmultiscripts>不是token element
3 Presentation Markup
The primary MathML token element types are identifiers (e.g. variables or function names), numbers, and operators (including fences, such as parentheses, and separators, such as commas).

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

hbghlyj Posted at 2022-7-16 15:26:58
tex.stackexchange.com/a/25978
However, for chemistry typesetting you should use one of the specialized packages, such as  mhchem . This example is taken from  mhchem  documentation: \$\$ \ce{^{227}_{90}Th+} \$\$ $$ \ce{^{227}_{90}Th+} $$

手机版Mobile version|Leisure Math Forum

2025-4-20 12:07 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list