找回密码
 快速注册
搜索
查看: 46|回复: 4

LaTeX行内公式用$開\)閉

[复制链接]

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

hbghlyj 发表于 2024-2-24 06:52 |阅读模式
在LaTeX中,行内公式可以用$\)
  1. \documentclass{article}
  2. \begin{document}
  3. $3^2+4^2=5^2\)
  4. \end{document}
复制代码
正常編譯:texlive.net/run?%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocum ... %5Cend%7Bdocument%7D
但在MathJax中不能。但MathJax可以额外設置?

730

主题

1万

回帖

9万

积分

积分
93593
QQ

显示全部楼层

kuing 发表于 2024-2-24 14:26
  1. <script>
  2. window.MathJax = {
  3.   tex: {
  4.     inlineMath: [ ['$','$'], ['`','`'], ["\\(","\\)"] ],
  5. ...
  6. ...
复制代码

或许可以在这里设吧,但我没试过。

这种问题,我只能说真逗😅

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

 楼主| hbghlyj 发表于 2024-2-25 00:47
kuing 发表于 2024-2-24 06:26
或许可以在这里设吧,但我没试过。


這樣不行吧,如果重複2個相同的開始符,後者會覆蓋前者。
測試:
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.   <script>
  5.   MathJax = {
  6.     tex: {inlineMath: [ ['$','$'],['$','\\)'] ]}
  7.   };
  8.   </script>
  9.   <script async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
  10. </head>
  11. <body>
  12.   $1\)
  13.   $1$
  14. </body>
  15. </html>
复制代码

結果是$1\)被識别,而$1$不會。

点评

噢,好吧😕  发表于 2024-2-25 13:45

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

 楼主| hbghlyj 发表于 2024-2-25 00:50
“開始符不能重複”好像是因為FindTeX的key是開始符(當然,用同一個key重複設置就會覆蓋)。

手机版|悠闲数学娱乐论坛(第3版)

GMT+8, 2025-3-4 12:12

Powered by Discuz!

× 快速回复 返回顶部 返回列表