Forgot password?
 Create new account
View 132|Reply 4

LaTeX行内公式用$開\)閉

[Copy link]

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2024-2-24 06:52:42 |Read mode
在LaTeX中,行内公式可以用$\)
  1. \documentclass{article}
  2. \begin{document}
  3. $3^2+4^2=5^2\)
  4. \end{document}
Copy the Code
正常編譯:texlive.net/run?%5Cdocumentclass%7Barticle%7D … %5Cend%7Bdocument%7D
但在MathJax中不能。但MathJax可以额外設置?

701

Threads

110K

Posts

910K

Credits

Credits
94172
QQ

Show all posts

kuing Posted at 2024-2-24 14:26:04
  1. <script>
  2. window.MathJax = {
  3.   tex: {
  4.     inlineMath: [ ['$','$'], ['`','`'], ["\\(","\\)"] ],
  5. ...
  6. ...
Copy the Code

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

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

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

 Author| hbghlyj Posted at 2024-2-25 00:47:28
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>
Copy the Code

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

Comment

噢,好吧😕  Posted at 2024-2-25 13:45

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

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

手机版Mobile version|Leisure Math Forum

2025-4-20 22:18 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list