Forgot password?
 Register account
Author: kuing

本论坛的 $\rm\LaTeX$ 公式的基本输入[2025-5-10更新为双版]

[Copy link]

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

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

768

Threads

4685

Posts

310K

Credits

Credits
35004

Show all posts

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


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

13

Threads

901

Posts

110K

Credits

Credits
12272

Show all posts

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

嗯,这的确是

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

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

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

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

768

Threads

4685

Posts

310K

Credits

Credits
35004

Show all posts

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

不整除 \nmid(大小不变)

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

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

加上了。

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

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2022-6-2 00:00
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

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2022-7-13 21:12
刚发现,括号的字号呈等差数列,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$$

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

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

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

 Author| kuing Posted 2022-7-16 14:40
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

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2022-7-16 15:22
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).

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2022-7-16 15:26
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+} $$

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2022-7-18 08:31
More Math Into LaTeX C.2.2 Typesetting (top of page 507)
LaTeX reads the source file one line at a time. It converts the characters of each line into a token sequence. A token is either a character—together with an indication of what role the character plays—or a command. The argument of a command is the token following it unless a group enclosed in braces follows it, in which case the contents of the group becomes the argument.

An example of this behavior can be seen when you specify an exponent. LaTeX looks for the next token as the exponent unless a group enclosed in braces follows the ^ symbol. This explains why \$2^3\$ and \$2^\alpha\$ work, but \$2^\mathfrak{m}\$ does not. Indeed, 3 and \alpha each become a single token but \mathfrak{m} becomes more than one, four, in fact. Of course, if you always use braces, as in
\$2^{3}\$, \$2^{\alpha}\$, \$2^{\mathfrak{m}}\$
then you never have to think about tokens to type such expressions.

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2022-10-10 02:49
kuing 发表于 2013-6-13 17:11
...
中文尽量放公式外,若必须放入公式内,请用 \text{中文} 来输入。
补充:
尽管显示效果一样(MathJax ≥ v3.2), 但是生成的MathML不同: 第一个是<mtext>, 第二个是两个<mi>.
  1. $$a+\text{中文}+a$$
  2. $$a+中文+a$$
Copy the Code
$$a+\text{中文}+a$$
$$a+中文+a$$

Font is italic for unicode text
Chinese should be convert to <mi> not <mo>
output of expression (with unicode chars) overlaps with following text

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

 Author| kuing Posted 2022-10-10 04:59
hbghlyj 发表于 2022-10-10 02:49
补充:
尽管显示效果一样(MathJax ≥ v3.2), 但是生成的MathML不同: 第一个是, 第二个是两个.

在别的页面效果就不一定相同了,比如我自个用的本地草稿本里后者的中文就会变成斜体。
为什么论坛上效果会一样,我不清楚。

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2022-10-10 20:21
kuing 发表于 2022-10-9 21:59
在别的页面效果就不一定相同了,比如我自个用的本地草稿本里后者的中文就会变成斜体。
为什么论坛上效果 ...
可能是本地草稿本MathJax不是latest version?

论坛上version: "3.2.2"直体.
demo version: "3.2.2"直体.
在Github上version: "3.2.0"斜体,见Font is italic for unicode text

682

Threads

110K

Posts

910K

Credits

Credits
90973
QQ

Show all posts

 Author| kuing Posted 2022-10-10 20:47
hbghlyj 发表于 2022-10-10 20:21
可能是本地草稿本MathJax不是latest version?

论坛上version: "3.2.2"直体.
圆奶乳齿,我本地草稿本是用之前下载下来的 mathjax,这样不依赖网络,看了下确实是 3.2.0 版本。

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2022-10-22 22:13
双竖线的四种输入方法:
\|


\Vert
\begin{gathered}\|\\
∥\\
‖\\
\Vert\\
\end{gathered}

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2022-10-25 22:29

补充

kuing 发表于 2013-6-13 17:08
环境

环境是指 \begin{...} ... \end{...} 这样的代码,环境在真 LaTeX 中不一定要用来打公式,但这里我们 ...
\tag* 可以加不带括号的标签
  1. $$1\tag*{1}$$
Copy the Code
$$1\tag*{1}$$
竖直虚线分隔 :
水平虚线分隔 \hdashline
\begin{array}{c:cc}1&1&1\\\hdashline1&1&1\\1&1&1\end{array}

3152

Threads

7905

Posts

610K

Credits

Credits
64068
QQ

Show all posts

hbghlyj Posted 2022-10-25 22:32
运算符:
  1. \DeclareMathOperator{Si}
  2. \DeclareMathOperator*{min}
Copy the Code
加星号生成<mo>就可以在displaystyle把上/下标显示正上/下方

分式:
  1. a+1 \above 1pt b
  2. a+1 \atop b
  3. a+1 \over b
  4. \genfrac(]{0pt}{2}{a+b}{c+d}
Copy the Code


  1. \mathop \mathbin \mathrel \mathpunct
Copy the Code
forces the argument to be treated in the 'operator/binary/relation/punctuation' class.

文字:
  1. \mbox{text}
  2. \text{text}
  3. \framebox[width][position]{text}
  4. \mathmakebox[width][position]{text}
Copy the Code

Mobile version|Discuz Math Forum

2025-6-4 17:03 GMT+8

Powered by Discuz!

× Quick Reply To Top Edit