Forgot password
 Register account
View 258|Reply 4

LaTeX行内公式用$開\)閉

[Copy link]

3211

Threads

7832

Posts

52

Reputation

Show all posts

hbghlyj posted 2024-2-24 06:52 |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?\documentclass{article}
\begi … 5^2\)
\end{document}

但在MathJax中不能。但MathJax可以额外設置?

673

Threads

110K

Posts

218

Reputation

Show all posts

kuing posted 2024-2-24 14:26
  1. <script>
  2. window.MathJax = {
  3.   tex: {
  4.     inlineMath: [ ['$','$'], ['`','`'], ["\\(","\\)"] ],
  5. ...
  6. ...
Copy the Code
或许可以在这里设吧,但我没试过。

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

3211

Threads

7832

Posts

52

Reputation

Show all posts

original poster hbghlyj posted 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>
Copy the Code
結果是$1\)被識别,而$1$不會。

Comment

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

3211

Threads

7832

Posts

52

Reputation

Show all posts

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

Quick Reply

Advanced Mode
B Color Image Link Quote Code Smilies
You have to log in before you can reply Login | Register account

$\LaTeX$ formula tutorial

Mobile version

2025-7-20 05:54 GMT+8

Powered by Discuz!

Processed in 0.011473 seconds, 23 queries