From 949e22a49859eaa58f121ea0ffcae369a3cf48f6 Mon Sep 17 00:00:00 2001 From: chupei Date: Mon, 17 Mar 2025 15:28:49 +0800 Subject: [PATCH 1/4] perf: optimize math --- llm_web_kit/extractor/html/recognizer/cc_math/common.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/llm_web_kit/extractor/html/recognizer/cc_math/common.py b/llm_web_kit/extractor/html/recognizer/cc_math/common.py index 4c69dfe8..af23378c 100644 --- a/llm_web_kit/extractor/html/recognizer/cc_math/common.py +++ b/llm_web_kit/extractor/html/recognizer/cc_math/common.py @@ -92,10 +92,10 @@ class MATH_TYPE_PATTERN: ['\\[', '\\]'], ['$$', '$$'], ['[tex]', '[/tex]'], # 这个网站自定义的分割,https://www.physicsforums.com/threads/turning-to-a-single-logarithm-then-simply.269419/ - ['\\begin{equation}', '\\end{equation}'], - ['\\begin{align}', '\\end{align}'], - ['\\begin{alignat}', '\\end{alignat}'], - ['\\begin{array}', '\\end{array}'], + # ['\\begin{equation}', '\\end{equation}'], + # ['\\begin{align}', '\\end{align}'], + # ['\\begin{alignat}', '\\end{alignat}'], + # ['\\begin{array}', '\\end{array}'], # 添加通用的begin/end匹配 ['\\begin{.*?}', '\\end{.*?}'], ], From 11e8de3fa4d8ab543f7f480cfef7647fa5486ab0 Mon Sep 17 00:00:00 2001 From: chupei Date: Tue, 18 Mar 2025 20:31:55 +0800 Subject: [PATCH 2/4] feat: math extract support mjx-container tag --- bench/data/all.json | 6 + .../groundtruth/math_physicsforums_2.jsonl | 1 + bench/data/origin/math_physicsforums_2.html | 5716 +++++++++++++++++ .../html/recognizer/cc_math/common.py | 1 + .../html/recognizer/cc_math/tag_mjx.py | 51 + .../extractor/html/recognizer/ccmath.py | 6 +- .../assets/ccmath/math_physicsforums_2.html | 5716 +++++++++++++++++ .../assets/ccmath/math_physicsforums_2_1.html | 21 + .../extractor/html/recognizer/test_math.py | 10 +- 9 files changed, 11524 insertions(+), 4 deletions(-) create mode 100644 bench/data/groundtruth/math_physicsforums_2.jsonl create mode 100644 bench/data/origin/math_physicsforums_2.html create mode 100644 llm_web_kit/extractor/html/recognizer/cc_math/tag_mjx.py create mode 100644 tests/llm_web_kit/extractor/html/recognizer/assets/ccmath/math_physicsforums_2.html create mode 100644 tests/llm_web_kit/extractor/html/recognizer/assets/ccmath/math_physicsforums_2_1.html diff --git a/bench/data/all.json b/bench/data/all.json index acf3a150..c6036997 100644 --- a/bench/data/all.json +++ b/bench/data/all.json @@ -257,6 +257,12 @@ "groundtruth_filepath":"groundtruth/math_physicsforums_1.jsonl", "layout_type": "forum" }, + "math_physicsforums_2": { + "url": "https://physicshelpforum.com/t/latex-upgrade-physics-forum-powered-by-mathjax-v3.17489/", + "origin_filepath":"origin/math_physicsforums_2.html", + "groundtruth_filepath":"groundtruth/math_physicsforums_2.jsonl", + "layout_type": "forum" + }, "table_1":{ "url": "https://grondwerken-overzicht.nl/noordwolde/gwy", "origin_filepath":"origin/table_1.html", diff --git a/bench/data/groundtruth/math_physicsforums_2.jsonl b/bench/data/groundtruth/math_physicsforums_2.jsonl new file mode 100644 index 00000000..69718801 --- /dev/null +++ b/bench/data/groundtruth/math_physicsforums_2.jsonl @@ -0,0 +1 @@ +{"content_list": [[{"type": "paragraph", "raw_content": "
The entire LaTeX rendering system has been upgraded to MathJax v3, and we have created a tool to see a preview render of your equations before posting them.

", "content": [{"c": "The entire LaTeX rendering system has been upgraded to MathJax v3, and we have created a tool to see a preview render of your equations before posting them.\n\n", "t": "text"}]}, {"type": "title", "raw_content": "

Insert Math Editor\u200b

In the toolbar, there is an Math Editor button, to make it easy for writing your equations in LaTeX and seeing the rendering in real time!", "content": {"title_content": "Insert Math Editor\u200b", "level": "3"}}, {"type": "paragraph", "raw_content": "
In the toolbar, there is an Math Editor button, to make it easy for writing your equations in LaTeX and seeing the rendering in real time!

\nAnd then you can insert the math as either a Block or Inline.

\nScreenshots below:

", "content": [{"c": "In the toolbar, there is an Math Editor button, to make it easy for writing your equations in LaTeX and seeing the rendering in real time!\n\n And then you can insert the math as either a Block or Inline.\n\n Screenshots below:\n\n", "t": "text"}]}, {"type": "image", "raw_content": "\"LaTeX", "content": {"url": "https://physicshelpforum.com/data/attachments/4/4740-7fe09219b74ce4ca36a512e8383c412c.jpg", "data": null, "alt": "LaTeX Math Editor", "title": "LaTeX Math Editor", "caption": null}}, {"type": "image", "raw_content": "\"LaTeX", "content": {"url": "https://physicshelpforum.com/data/attachments/4/4739-460ec05f3727868e315d20ce55ce9340.jpg", "data": null, "alt": "LaTeX Math Equations for Physics", "title": "LaTeX Math Equations for Physics", "caption": null}}, {"type": "paragraph", "raw_content": "
Reactions:
", "content": [{"c": "Reactions:", "t": "text"}]}, {"type": "paragraph", "raw_content": "
2 users
", "content": [{"c": "2 users", "t": "text"}]}, {"type": "title", "raw_content": "

Writing Math Equations\u200b

And when you want to write math equations directly in your post, you are not required to use the Insert Math button.", "content": {"title_content": "Writing Math Equations\u200b", "level": "3"}}, {"type": "paragraph", "raw_content": "
And when you want to write math equations directly in your post, you are not required to use the Insert Math button.

\nSame as before, you can wrap your Latex equations with any of the following tags:

", "content": [{"c": "And when you want to write math equations directly in your post, you are not required to use the Insert Math button.\n\n Same as before, you can wrap your Latex equations with any of the following tags:\n\n", "t": "text"}]}, {"type": "title", "raw_content": "

Block Math\u200b

", "content": {"title_content": "Block Math\u200b", "level": "4"}}, {"type": "paragraph", "raw_content": "
\n\t\tCode:\n\t
", "content": [{"c": "Code:", "t": "text"}]}, {"type": "code", "raw_content": "[MATH] [/MATH]\n[LATEX] [/LATEX]\n[TEX] [/TEX]\n$$ $$", "inline": false, "content": {"code_content": "[MATH] [/MATH]\n[LATEX] [/LATEX]\n[TEX] [/TEX]\n$$ $$", "by": "tag_pre_code"}}, {"type": "title", "raw_content": "

Inline Math\u200b

", "content": {"title_content": "Inline Math\u200b", "level": "4"}}, {"type": "paragraph", "raw_content": "
\n\t\tCode:\n\t
", "content": [{"c": "Code:", "t": "text"}]}, {"type": "code", "raw_content": "[IMATH] [/IMATH]\n[ILATEX] [/ILATEX]\n[ITEX] [/ITEX]\n## ##", "inline": false, "content": {"code_content": "[IMATH] [/IMATH]\n[ILATEX] [/ILATEX]\n[ITEX] [/ITEX]\n## ##", "by": "tag_pre_code"}}, {"type": "paragraph", "raw_content": "
Reactions:
", "content": [{"c": "Reactions:", "t": "text"}]}, {"type": "paragraph", "raw_content": "
1 users
", "content": [{"c": "1 users", "t": "text"}]}, {"type": "paragraph", "raw_content": "
\n\n\n Last edited: \n\n\n
", "content": [{"c": "Last edited:", "t": "text"}]}, {"type": "paragraph", "raw_content": "
And some example Latex Equations, with the math expressions used for writing, to see it working...

Newton's Second Law of Motion
[math]\\vec{F} = m\\vec{a}[/math]

", "content": [{"c": "And some example Latex Equations, with the math expressions used for writing, to see it working...\n\n Newton's Second Law of Motion\n", "t": "text"}, {"c": "[math]\\vec{F} = m\\vec{a}[/math]", "t": "code-inline"}, {"c": "\n\n", "t": "text"}]}, {"type": "equation-interline", "raw_content": "\\vec{F} = m\\vec{a}", "content": {"math_content": "\\vec{F} = m\\vec{a}", "math_type": "latex", "by": "mathjax"}}, {"type": "paragraph", "raw_content": "
Gauss's Law for Electrcity
", "content": [{"c": "Gauss's Law for Electrcity", "t": "text"}]}, {"type": "paragraph", "raw_content": "
[math]\\nabla \\cdot \\vec{E} = \\frac{\\rho}{\\varepsilon_0}[/math]
", "content": [{"c": "[math]\\nabla \\cdot \\vec{E} = \\frac{\\rho}{\\varepsilon_0}[/math]", "t": "code-inline"}]}, {"type": "equation-interline", "raw_content": "\\nabla \\cdot \\vec{E} = \\frac{\\rho}{\\varepsilon_0}", "content": {"math_content": "\\nabla \\cdot \\vec{E} = \\frac{\\rho}{\\varepsilon_0}", "math_type": "latex", "by": "mathjax"}}, {"type": "paragraph", "raw_content": "
Einstein's Field Equations of General Relativity
", "content": [{"c": "Einstein's Field Equations of General Relativity", "t": "text"}]}, {"type": "paragraph", "raw_content": "
[math]G_{\\mu\\nu} + \\Lambda g_{\\mu\\nu} = \\frac{8\\pi G}{c^4} T_{\\mu\\nu}[/math]
", "content": [{"c": "[math]G_{\\mu\\nu} + \\Lambda g_{\\mu\\nu} = \\frac{8\\pi G}{c^4} T_{\\mu\\nu}[/math]", "t": "code-inline"}]}, {"type": "equation-interline", "raw_content": "G_{\\mu\\nu} + \\Lambda g_{\\mu\\nu} = \\frac{8\\pi G}{c^4} T_{\\mu\\nu}", "content": {"math_content": "G_{\\mu\\nu} + \\Lambda g_{\\mu\\nu} = \\frac{8\\pi G}{c^4} T_{\\mu\\nu}", "math_type": "latex", "by": "mathjax"}}, {"type": "paragraph", "raw_content": "
The Dirac Equation
", "content": [{"c": "The Dirac Equation", "t": "text"}]}, {"type": "paragraph", "raw_content": "
[math](i\\gamma^\\mu \\partial_\\mu - m)\\psi = 0[/math]
", "content": [{"c": "[math](i\\gamma^\\mu \\partial_\\mu - m)\\psi = 0[/math]", "t": "code-inline"}]}, {"type": "equation-interline", "raw_content": "(i\\gamma^\\mu \\partial_\\mu - m)\\psi = 0", "content": {"math_content": "(i\\gamma^\\mu \\partial_\\mu - m)\\psi = 0", "math_type": "latex", "by": "mathjax"}}, {"type": "paragraph", "raw_content": "
The Schr\u00f6dinger Equation in Quantum Mechanics (Time-Dependent Form)
", "content": [{"c": "The Schr\u00f6dinger Equation in Quantum Mechanics (Time-Dependent Form)", "t": "text"}]}, {"type": "paragraph", "raw_content": "
[math]i\\hbar\\frac{\\partial}{\\partial t}\\Psi(\\mathbf{r}, t) = \\hat{H}\\Psi(\\mathbf{r}, t)[/math]
", "content": [{"c": "[math]i\\hbar\\frac{\\partial}{\\partial t}\\Psi(\\mathbf{r}, t) = \\hat{H}\\Psi(\\mathbf{r}, t)[/math]", "t": "code-inline"}]}, {"type": "equation-interline", "raw_content": "i\\hbar\\frac{\\partial}{\\partial t}\\Psi(\\mathbf{r}, t) = \\hat{H}\\Psi(\\mathbf{r}, t)", "content": {"math_content": "i\\hbar\\frac{\\partial}{\\partial t}\\Psi(\\mathbf{r}, t) = \\hat{H}\\Psi(\\mathbf{r}, t)", "math_type": "latex", "by": "mathjax"}}, {"type": "paragraph", "raw_content": "
Reactions:
", "content": [{"c": "Reactions:", "t": "text"}]}, {"type": "paragraph", "raw_content": "
2 users
", "content": [{"c": "2 users", "t": "text"}]}, {"type": "paragraph", "raw_content": "
Long Math Equations
\nFor very long equations, it's recommended to use line breaks appropriately. But if you don't add line breaks, and the equation is extremely long (or wider than the display you're using), a horizontal scrollbar will appear below the equation, to show that you can hover your pointer over the equation and scroll horizontally...

\nFor example, here is a very long equation without the align tags used in MathJax v3:

\n\t\tCode:\n\t
", "content": [{"c": "Long Math Equations\n For very long equations, it's recommended to use line breaks appropriately. But if you don't add line breaks, and the equation is extremely long (or wider than the display you're using), a horizontal scrollbar will appear below the equation, to show that you can hover your pointer over the equation and scroll horizontally...\n\n For example, here is a very long equation without the", "t": "text"}, {"c": "align", "t": "code-inline"}, {"c": "tags used in MathJax v3:\n\n Code:", "t": "text"}]}, {"type": "code", "raw_content": "[math]\nP(\\text{16 out of 20}) = \\frac{20!}{16! \\times 4!} \\times 0.85^{16} \\times 0.15^{4} = 0.182122 \\\\\nP(\\text{17 out of 20}) = \\frac{20!}{17! \\times 3!} \\times 0.85^{17} \\times 0.15^{3} = 0.242829 \\\\\nP(\\text{18 out of 20}) = \\frac{20!}{18! \\times 2!} \\times 0.85^{18} \\times 0.15^{2} = 0.229338 \\\\\nP(\\text{19 out of 20}) = \\frac{20!}{19! \\times 1!} \\times 0.85^{19} \\times 0.15^{1} = 0.136798 \\\\\nP(\\text{20 out of 20}) = \\frac{20!}{20! \\times 0!} \\times 0.85^{20} \\times 0.15^{0} = 0.0387595\n[/math]", "inline": false, "content": {"code_content": "[math]\nP(\\text{16 out of 20}) = \\frac{20!}{16! \\times 4!} \\times 0.85^{16} \\times 0.15^{4} = 0.182122 \\\\\nP(\\text{17 out of 20}) = \\frac{20!}{17! \\times 3!} \\times 0.85^{17} \\times 0.15^{3} = 0.242829 \\\\\nP(\\text{18 out of 20}) = \\frac{20!}{18! \\times 2!} \\times 0.85^{18} \\times 0.15^{2} = 0.229338 \\\\\nP(\\text{19 out of 20}) = \\frac{20!}{19! \\times 1!} \\times 0.85^{19} \\times 0.15^{1} = 0.136798 \\\\\nP(\\text{20 out of 20}) = \\frac{20!}{20! \\times 0!} \\times 0.85^{20} \\times 0.15^{0} = 0.0387595\n[/math]", "by": "tag_pre_code"}}, {"type": "paragraph", "raw_content": "

\nAnd this is how the equation looks with the horizontal scrollbar:

", "content": [{"c": "And this is how the equation looks with the horizontal scrollbar:\n\n", "t": "text"}]}, {"type": "equation-interline", "raw_content": "\nP(\\text{16 out of 20}) = \\frac{20!}{16! \\times 4!} \\times 0.85^{16} \\times 0.15^{4} = 0.182122 \\\\\nP(\\text{17 out of 20}) = \\frac{20!}{17! \\times 3!} \\times 0.85^{17} \\times 0.15^{3} = 0.242829 \\\\\nP(\\text{18 out of 20}) = \\frac{20!}{18! \\times 2!} \\times 0.85^{18} \\times 0.15^{2} = 0.229338 \\\\\nP(\\text{19 out of 20}) = \\frac{20!}{19! \\times 1!} \\times 0.85^{19} \\times 0.15^{1} = 0.136798 \\\\\nP(\\text{20 out of 20}) = \\frac{20!}{20! \\times 0!} \\times 0.85^{20} \\times 0.15^{0} = 0.0387595\n", "content": {"math_content": "P(\\text{16 out of 20}) = \\frac{20!}{16! \\times 4!} \\times 0.85^{16} \\times 0.15^{4} = 0.182122 \\\\\nP(\\text{17 out of 20}) = \\frac{20!}{17! \\times 3!} \\times 0.85^{17} \\times 0.15^{3} = 0.242829 \\\\\nP(\\text{18 out of 20}) = \\frac{20!}{18! \\times 2!} \\times 0.85^{18} \\times 0.15^{2} = 0.229338 \\\\\nP(\\text{19 out of 20}) = \\frac{20!}{19! \\times 1!} \\times 0.85^{19} \\times 0.15^{1} = 0.136798 \\\\\nP(\\text{20 out of 20}) = \\frac{20!}{20! \\times 0!} \\times 0.85^{20} \\times 0.15^{0} = 0.0387595", "math_type": "latex", "by": "mathjax"}}, {"type": "paragraph", "raw_content": "


\nThe better way to write the exact same equation would be to add the align tags used in MathJax v3, to recognize the \\\\ as line breaks:

\n\t\tCode:\n\t
", "content": [{"c": "The better way to write the exact same equation would be to add the", "t": "text"}, {"c": "align", "t": "code-inline"}, {"c": "tags used in MathJax v3, to recognize the", "t": "text"}, {"c": "\\\\", "t": "code-inline"}, {"c": "as line breaks:\n\n Code:", "t": "text"}]}, {"type": "code", "raw_content": "[math]\n\\begin{align*}\nP(\\text{16 out of 20}) &= \\frac{20!}{16! \\times 4!} \\times 0.85^{16} \\times 0.15^{4} = 0.182122 \\\\\nP(\\text{17 out of 20}) &= \\frac{20!}{17! \\times 3!} \\times 0.85^{17} \\times 0.15^{3} = 0.242829 \\\\\nP(\\text{18 out of 20}) &= \\frac{20!}{18! \\times 2!} \\times 0.85^{18} \\times 0.15^{2} = 0.229338 \\\\\nP(\\text{19 out of 20}) &= \\frac{20!}{19! \\times 1!} \\times 0.85^{19} \\times 0.15^{1} = 0.136798 \\\\\nP(\\text{20 out of 20}) &= \\frac{20!}{20! \\times 0!} \\times 0.85^{20} \\times 0.15^{0} = 0.0387595\n\\end{align*}\n[/math]", "inline": false, "content": {"code_content": "[math]\n\\begin{align*}\nP(\\text{16 out of 20}) &= \\frac{20!}{16! \\times 4!} \\times 0.85^{16} \\times 0.15^{4} = 0.182122 \\\\\nP(\\text{17 out of 20}) &= \\frac{20!}{17! \\times 3!} \\times 0.85^{17} \\times 0.15^{3} = 0.242829 \\\\\nP(\\text{18 out of 20}) &= \\frac{20!}{18! \\times 2!} \\times 0.85^{18} \\times 0.15^{2} = 0.229338 \\\\\nP(\\text{19 out of 20}) &= \\frac{20!}{19! \\times 1!} \\times 0.85^{19} \\times 0.15^{1} = 0.136798 \\\\\nP(\\text{20 out of 20}) &= \\frac{20!}{20! \\times 0!} \\times 0.85^{20} \\times 0.15^{0} = 0.0387595\n\\end{align*}\n[/math]", "by": "tag_pre_code"}}, {"type": "paragraph", "raw_content": "

\nAnd then it display in a more readable format, as seen here:

", "content": [{"c": "And then it display in a more readable format, as seen here:\n\n", "t": "text"}]}, {"type": "equation-interline", "raw_content": "\n\\begin{align*}\nP(\\text{16 out of 20}) &= \\frac{20!}{16! \\times 4!} \\times 0.85^{16} \\times 0.15^{4} = 0.182122 \\\\\nP(\\text{17 out of 20}) &= \\frac{20!}{17! \\times 3!} \\times 0.85^{17} \\times 0.15^{3} = 0.242829 \\\\\nP(\\text{18 out of 20}) &= \\frac{20!}{18! \\times 2!} \\times 0.85^{18} \\times 0.15^{2} = 0.229338 \\\\\nP(\\text{19 out of 20}) &= \\frac{20!}{19! \\times 1!} \\times 0.85^{19} \\times 0.15^{1} = 0.136798 \\\\\nP(\\text{20 out of 20}) &= \\frac{20!}{20! \\times 0!} \\times 0.85^{20} \\times 0.15^{0} = 0.0387595\n\\end{align*}\n", "content": {"math_content": "\\begin{align*}\nP(\\text{16 out of 20}) &= \\frac{20!}{16! \\times 4!} \\times 0.85^{16} \\times 0.15^{4} = 0.182122 \\\\\nP(\\text{17 out of 20}) &= \\frac{20!}{17! \\times 3!} \\times 0.85^{17} \\times 0.15^{3} = 0.242829 \\\\\nP(\\text{18 out of 20}) &= \\frac{20!}{18! \\times 2!} \\times 0.85^{18} \\times 0.15^{2} = 0.229338 \\\\\nP(\\text{19 out of 20}) &= \\frac{20!}{19! \\times 1!} \\times 0.85^{19} \\times 0.15^{1} = 0.136798 \\\\\nP(\\text{20 out of 20}) &= \\frac{20!}{20! \\times 0!} \\times 0.85^{20} \\times 0.15^{0} = 0.0387595\n\\end{align*}", "math_type": "latex", "by": "mathjax"}}, {"type": "paragraph", "raw_content": "
Reactions:
", "content": [{"c": "Reactions:", "t": "text"}]}, {"type": "paragraph", "raw_content": "
2 users
", "content": [{"c": "2 users", "t": "text"}]}, {"type": "title", "raw_content": "

Writing Physics Equations\u200b

We have also installed a physics science package into MathJax, for physics notation and equation support.", "content": {"title_content": "Writing Physics Equations\u200b", "level": "3"}}, {"type": "paragraph", "raw_content": "
We have also installed a physics science package into MathJax, for physics notation and equation support.

\nHere are a few physics-related examples:

Derivatives
\n\t\tCode:\n\t
", "content": [{"c": "We have also installed a physics science package into MathJax, for physics notation and equation support.\n\n Here are a few physics-related examples:\n\n Derivatives\n Code:", "t": "text"}]}, {"type": "code", "raw_content": "[math]\\frac{d}{dx} f(x) \\quad \\text{versus} \\quad \\dv{f}{x}[/math]", "inline": false, "content": {"code_content": "[math]\\frac{d}{dx} f(x) \\quad \\text{versus} \\quad \\dv{f}{x}[/math]", "by": "tag_pre_code"}}, {"type": "equation-interline", "raw_content": "\\frac{d}{dx} f(x) \\quad \\text{versus} \\quad \\dv{f}{x}", "content": {"math_content": "\\frac{d}{dx} f(x) \\quad \\text{versus} \\quad \\dv{f}{x}", "math_type": "latex", "by": "mathjax"}}, {"type": "paragraph", "raw_content": "
Partial Derivatives
", "content": [{"c": "Partial Derivatives", "t": "text"}]}, {"type": "paragraph", "raw_content": "
\n\t\tCode:\n\t
", "content": [{"c": "Code:", "t": "text"}]}, {"type": "code", "raw_content": "[math]\\frac{\\partial}{\\partial x} f(x,y) \\quad \\text{versus} \\quad \\pdv{f}{x}[/math]", "inline": false, "content": {"code_content": "[math]\\frac{\\partial}{\\partial x} f(x,y) \\quad \\text{versus} \\quad \\pdv{f}{x}[/math]", "by": "tag_pre_code"}}, {"type": "equation-interline", "raw_content": "\\frac{\\partial}{\\partial x} f(x,y) \\quad \\text{versus} \\quad \\pdv{f}{x}", "content": {"math_content": "\\frac{\\partial}{\\partial x} f(x,y) \\quad \\text{versus} \\quad \\pdv{f}{x}", "math_type": "latex", "by": "mathjax"}}, {"type": "paragraph", "raw_content": "
Vectors
", "content": [{"c": "Vectors", "t": "text"}]}, {"type": "paragraph", "raw_content": "
\n\t\tCode:\n\t
", "content": [{"c": "Code:", "t": "text"}]}, {"type": "code", "raw_content": "[math]\\vec{v} \\quad \\text{versus} \\quad \\vb{v} \\quad \\text{and} \\quad \\vec{v} \\cdot \\vec{w} \\quad \\text{versus} \\quad \\vb{v} \\vdot \\vb{w}[/math]", "inline": false, "content": {"code_content": "[math]\\vec{v} \\quad \\text{versus} \\quad \\vb{v} \\quad \\text{and} \\quad \\vec{v} \\cdot \\vec{w} \\quad \\text{versus} \\quad \\vb{v} \\vdot \\vb{w}[/math]", "by": "tag_pre_code"}}, {"type": "equation-interline", "raw_content": "\\vec{v} \\quad \\text{versus} \\quad \\vb{v} \\quad \\text{and} \\quad \\vec{v} \\cdot \\vec{w} \\quad \\text{versus} \\quad \\vb{v} \\vdot \\vb{w}", "content": {"math_content": "\\vec{v} \\quad \\text{versus} \\quad \\vb{v} \\quad \\text{and} \\quad \\vec{v} \\cdot \\vec{w} \\quad \\text{versus} \\quad \\vb{v} \\vdot \\vb{w}", "math_type": "latex", "by": "mathjax"}}, {"type": "paragraph", "raw_content": "
Gradient, Divergence, Curl
", "content": [{"c": "Gradient, Divergence, Curl", "t": "text"}]}, {"type": "paragraph", "raw_content": "
\n\t\tCode:\n\t
", "content": [{"c": "Code:", "t": "text"}]}, {"type": "code", "raw_content": "[math]\\vec{\\nabla} \\phi \\quad \\text{versus} \\quad \\grad{\\phi}[/math]\n[math]\\vec{\\nabla} \\cdot \\vec{v} \\quad \\text{versus} \\quad \\div{\\vb{v}}[/math]\n[math]\\vec{\\nabla} \\times \\vec{v} \\quad \\text{versus} \\quad \\curl{\\vb{v}}[/math]", "inline": false, "content": {"code_content": "[math]\\vec{\\nabla} \\phi \\quad \\text{versus} \\quad \\grad{\\phi}[/math]\n[math]\\vec{\\nabla} \\cdot \\vec{v} \\quad \\text{versus} \\quad \\div{\\vb{v}}[/math]\n[math]\\vec{\\nabla} \\times \\vec{v} \\quad \\text{versus} \\quad \\curl{\\vb{v}}[/math]", "by": "tag_pre_code"}}, {"type": "equation-interline", "raw_content": "\\vec{\\nabla} \\phi \\quad \\text{versus} \\quad \\grad{\\phi}", "content": {"math_content": "\\vec{\\nabla} \\phi \\quad \\text{versus} \\quad \\grad{\\phi}", "math_type": "latex", "by": "mathjax"}}, {"type": "equation-interline", "raw_content": "\\vec{\\nabla} \\cdot \\vec{v} \\quad \\text{versus} \\quad \\div{\\vb{v}}", "content": {"math_content": "\\vec{\\nabla} \\cdot \\vec{v} \\quad \\text{versus} \\quad \\div{\\vb{v}}", "math_type": "latex", "by": "mathjax"}}, {"type": "equation-interline", "raw_content": "\\vec{\\nabla} \\times \\vec{v} \\quad \\text{versus} \\quad \\curl{\\vb{v}}", "content": {"math_content": "\\vec{\\nabla} \\times \\vec{v} \\quad \\text{versus} \\quad \\curl{\\vb{v}}", "math_type": "latex", "by": "mathjax"}}, {"type": "paragraph", "raw_content": "
Bra-Ket Notation
", "content": [{"c": "Bra-Ket Notation", "t": "text"}]}, {"type": "paragraph", "raw_content": "
\n\t\tCode:\n\t
", "content": [{"c": "Code:", "t": "text"}]}, {"type": "code", "raw_content": "[math]\\langle \\psi | \\phi \\rangle \\quad \\text{versus} \\quad \\braket{\\psi}{\\phi}[/math]", "inline": false, "content": {"code_content": "[math]\\langle \\psi | \\phi \\rangle \\quad \\text{versus} \\quad \\braket{\\psi}{\\phi}[/math]", "by": "tag_pre_code"}}, {"type": "equation-interline", "raw_content": "\\langle \\psi | \\phi \\rangle \\quad \\text{versus} \\quad \\braket{\\psi}{\\phi}", "content": {"math_content": "\\langle \\psi | \\phi \\rangle \\quad \\text{versus} \\quad \\braket{\\psi}{\\phi}", "math_type": "latex", "by": "mathjax"}}, {"type": "paragraph", "raw_content": "
Commutators and Anticommutators
", "content": [{"c": "Commutators and Anticommutators", "t": "text"}]}, {"type": "paragraph", "raw_content": "
\n\t\tCode:\n\t
", "content": [{"c": "Code:", "t": "text"}]}, {"type": "code", "raw_content": "[math][\\hat{A}, \\hat{B}] \\quad \\text{versus} \\quad \\comm{\\hat{A}}{\\hat{B}}[/math]\n[math]\\{\\hat{A}, \\hat{B}\\} \\quad \\text{versus} \\quad \\acomm{\\hat{A}}{\\hat{B}}[/math]", "inline": false, "content": {"code_content": "[math][\\hat{A}, \\hat{B}] \\quad \\text{versus} \\quad \\comm{\\hat{A}}{\\hat{B}}[/math]\n[math]\\{\\hat{A}, \\hat{B}\\} \\quad \\text{versus} \\quad \\acomm{\\hat{A}}{\\hat{B}}[/math]", "by": "tag_pre_code"}}, {"type": "equation-interline", "raw_content": "[\\hat{A}, \\hat{B}] \\quad \\text{versus} \\quad \\comm{\\hat{A}}{\\hat{B}}", "content": {"math_content": "[\\hat{A}, \\hat{B}] \\quad \\text{versus} \\quad \\comm{\\hat{A}}{\\hat{B}}", "math_type": "latex", "by": "mathjax"}}, {"type": "equation-interline", "raw_content": "\\{\\hat{A}, \\hat{B}\\} \\quad \\text{versus} \\quad \\acomm{\\hat{A}}{\\hat{B}}", "content": {"math_content": "\\{\\hat{A}, \\hat{B}\\} \\quad \\text{versus} \\quad \\acomm{\\hat{A}}{\\hat{B}}", "math_type": "latex", "by": "mathjax"}}, {"type": "paragraph", "raw_content": "
Matrices
", "content": [{"c": "Matrices", "t": "text"}]}, {"type": "paragraph", "raw_content": "
\n\t\tCode:\n\t
", "content": [{"c": "Code:", "t": "text"}]}, {"type": "code", "raw_content": "[math]\n\\begin{pmatrix}\na & b \\\\\nc & d\n\\end{pmatrix} \\quad \\text{versus} \\quad \\mqty(a & b \\\\ c & d)\n[/math]", "inline": false, "content": {"code_content": "[math]\n\\begin{pmatrix}\na & b \\\\\nc & d\n\\end{pmatrix} \\quad \\text{versus} \\quad \\mqty(a & b \\\\ c & d)\n[/math]", "by": "tag_pre_code"}}, {"type": "equation-interline", "raw_content": "\n\\begin{pmatrix}\na & b \\\\\nc & d\n\\end{pmatrix} \\quad \\text{versus} \\quad \\mqty(a & b \\\\ c & d)\n", "content": {"math_content": "\\begin{pmatrix}\na & b \\\\\nc & d\n\\end{pmatrix} \\quad \\text{versus} \\quad \\mqty(a & b \\\\ c & d)", "math_type": "latex", "by": "mathjax"}}, {"type": "paragraph", "raw_content": "
Dirac Notation (Ket, Bra, Operators)
", "content": [{"c": "Dirac Notation (Ket, Bra, Operators)", "t": "text"}]}, {"type": "paragraph", "raw_content": "
\n\t\tCode:\n\t
", "content": [{"c": "Code:", "t": "text"}]}, {"type": "code", "raw_content": "[math]|\\psi\\rangle \\quad \\text{versus} \\quad \\ket{\\psi}[/math]\n[math]\\langle\\psi| \\quad \\text{versus} \\quad \\bra{\\psi}[/math]\n[math]\\hat{H}|\\psi\\rangle \\quad \\text{versus} \\quad \\op{H}{\\psi}[/math]", "inline": false, "content": {"code_content": "[math]|\\psi\\rangle \\quad \\text{versus} \\quad \\ket{\\psi}[/math]\n[math]\\langle\\psi| \\quad \\text{versus} \\quad \\bra{\\psi}[/math]\n[math]\\hat{H}|\\psi\\rangle \\quad \\text{versus} \\quad \\op{H}{\\psi}[/math]", "by": "tag_pre_code"}}, {"type": "equation-interline", "raw_content": "|\\psi\\rangle \\quad \\text{versus} \\quad \\ket{\\psi}", "content": {"math_content": "|\\psi\\rangle \\quad \\text{versus} \\quad \\ket{\\psi}", "math_type": "latex", "by": "mathjax"}}, {"type": "equation-interline", "raw_content": "\\langle\\psi| \\quad \\text{versus} \\quad \\bra{\\psi}", "content": {"math_content": "\\langle\\psi| \\quad \\text{versus} \\quad \\bra{\\psi}", "math_type": "latex", "by": "mathjax"}}, {"type": "equation-interline", "raw_content": "\\hat{H}|\\psi\\rangle \\quad \\text{versus} \\quad \\op{H}{\\psi}", "content": {"math_content": "\\hat{H}|\\psi\\rangle \\quad \\text{versus} \\quad \\op{H}{\\psi}", "math_type": "latex", "by": "mathjax"}}, {"type": "paragraph", "raw_content": "
Quick Quadratic Equation
", "content": [{"c": "Quick Quadratic Equation", "t": "text"}]}, {"type": "paragraph", "raw_content": "
\n\t\tCode:\n\t
", "content": [{"c": "Code:", "t": "text"}]}, {"type": "code", "raw_content": "[math]ax^2 + bx + c = 0 \\quad \\text{versus} \\quad \\qty(a x^2 + b x + c = 0)[/math]", "inline": false, "content": {"code_content": "[math]ax^2 + bx + c = 0 \\quad \\text{versus} \\quad \\qty(a x^2 + b x + c = 0)[/math]", "by": "tag_pre_code"}}, {"type": "equation-interline", "raw_content": "ax^2 + bx + c = 0 \\quad \\text{versus} \\quad \\qty(a x^2 + b x + c = 0)", "content": {"math_content": "ax^2 + bx + c = 0 \\quad \\text{versus} \\quad \\qty(a x^2 + b x + c = 0)", "math_type": "latex", "by": "mathjax"}}, {"type": "paragraph", "raw_content": "
Reactions:
", "content": [{"c": "Reactions:", "t": "text"}]}, {"type": "paragraph", "raw_content": "
1 users
", "content": [{"c": "1 users", "t": "text"}]}, {"type": "paragraph", "raw_content": "
This is awesome!
", "content": [{"c": "This is awesome!", "t": "text"}]}, {"type": "paragraph", "raw_content": "
Reactions:
", "content": [{"c": "Reactions:", "t": "text"}]}, {"type": "paragraph", "raw_content": "
2 users
", "content": [{"c": "2 users", "t": "text"}]}, {"type": "paragraph", "raw_content": "
Joined Nov 2013
", "content": [{"c": "Joined Nov 2013", "t": "text"}]}, {"type": "paragraph", "raw_content": "
852 Posts | 104+
", "content": [{"c": "852 Posts | 104+", "t": "text"}]}, {"type": "paragraph", "raw_content": "
New Zealand
", "content": [{"c": "New Zealand", "t": "text"}]}, {"type": "paragraph", "raw_content": "
That looks nice!
", "content": [{"c": "That looks nice!", "t": "text"}]}, {"type": "paragraph", "raw_content": "
Reactions:
", "content": [{"c": "Reactions:", "t": "text"}]}, {"type": "paragraph", "raw_content": "
2 users
", "content": [{"c": "2 users", "t": "text"}]}]], "main_html": "
The entire LaTeX rendering system has been upgraded to MathJax v3, and we have created a tool to see a preview render of your equations before posting them.

Insert Math Editor\u200b

In the toolbar, there is an Math Editor button, to make it easy for writing your equations in LaTeX and seeing the rendering in real time!
In the toolbar, there is an Math Editor button, to make it easy for writing your equations in LaTeX and seeing the rendering in real time!

\nAnd then you can insert the math as either a Block or Inline.

\nScreenshots below:

\"LaTeX\"LaTeX
Reactions:
2 users

Writing Math Equations\u200b

And when you want to write math equations directly in your post, you are not required to use the Insert Math button.
And when you want to write math equations directly in your post, you are not required to use the Insert Math button.

\nSame as before, you can wrap your Latex equations with any of the following tags:

Block Math\u200b

\n\t\tCode:\n\t
[MATH] [/MATH]\n[LATEX] [/LATEX]\n[TEX] [/TEX]\n$$ $$

Inline Math\u200b

\n\t\tCode:\n\t
[IMATH] [/IMATH]\n[ILATEX] [/ILATEX]\n[ITEX] [/ITEX]\n## ##
Reactions:
1 users
\n\n\n Last edited: \n\n\n
And some example Latex Equations, with the math expressions used for writing, to see it working...

Newton's Second Law of Motion
[math]\\vec{F} = m\\vec{a}[/math]

\\vec{F} = m\\vec{a}
Gauss's Law for Electrcity
[math]\\nabla \\cdot \\vec{E} = \\frac{\\rho}{\\varepsilon_0}[/math]
\\nabla \\cdot \\vec{E} = \\frac{\\rho}{\\varepsilon_0}
Einstein's Field Equations of General Relativity
[math]G_{\\mu\\nu} + \\Lambda g_{\\mu\\nu} = \\frac{8\\pi G}{c^4} T_{\\mu\\nu}[/math]
G_{\\mu\\nu} + \\Lambda g_{\\mu\\nu} = \\frac{8\\pi G}{c^4} T_{\\mu\\nu}
The Dirac Equation
[math](i\\gamma^\\mu \\partial_\\mu - m)\\psi = 0[/math]
(i\\gamma^\\mu \\partial_\\mu - m)\\psi = 0
The Schr\u00f6dinger Equation in Quantum Mechanics (Time-Dependent Form)
[math]i\\hbar\\frac{\\partial}{\\partial t}\\Psi(\\mathbf{r}, t) = \\hat{H}\\Psi(\\mathbf{r}, t)[/math]
i\\hbar\\frac{\\partial}{\\partial t}\\Psi(\\mathbf{r}, t) = \\hat{H}\\Psi(\\mathbf{r}, t)
Reactions:
2 users
Long Math Equations
\nFor very long equations, it's recommended to use line breaks appropriately. But if you don't add line breaks, and the equation is extremely long (or wider than the display you're using), a horizontal scrollbar will appear below the equation, to show that you can hover your pointer over the equation and scroll horizontally...

\nFor example, here is a very long equation without the align tags used in MathJax v3:

\n\t\tCode:\n\t
[math]\nP(\\text{16 out of 20}) = \\frac{20!}{16! \\times 4!} \\times 0.85^{16} \\times 0.15^{4} = 0.182122 \\\\\nP(\\text{17 out of 20}) = \\frac{20!}{17! \\times 3!} \\times 0.85^{17} \\times 0.15^{3} = 0.242829 \\\\\nP(\\text{18 out of 20}) = \\frac{20!}{18! \\times 2!} \\times 0.85^{18} \\times 0.15^{2} = 0.229338 \\\\\nP(\\text{19 out of 20}) = \\frac{20!}{19! \\times 1!} \\times 0.85^{19} \\times 0.15^{1} = 0.136798 \\\\\nP(\\text{20 out of 20}) = \\frac{20!}{20! \\times 0!} \\times 0.85^{20} \\times 0.15^{0} = 0.0387595\n[/math]

\nAnd this is how the equation looks with the horizontal scrollbar:

\nP(\\text{16 out of 20}) = \\frac{20!}{16! \\times 4!} \\times 0.85^{16} \\times 0.15^{4} = 0.182122 \\\\\nP(\\text{17 out of 20}) = \\frac{20!}{17! \\times 3!} \\times 0.85^{17} \\times 0.15^{3} = 0.242829 \\\\\nP(\\text{18 out of 20}) = \\frac{20!}{18! \\times 2!} \\times 0.85^{18} \\times 0.15^{2} = 0.229338 \\\\\nP(\\text{19 out of 20}) = \\frac{20!}{19! \\times 1!} \\times 0.85^{19} \\times 0.15^{1} = 0.136798 \\\\\nP(\\text{20 out of 20}) = \\frac{20!}{20! \\times 0!} \\times 0.85^{20} \\times 0.15^{0} = 0.0387595\n


\nThe better way to write the exact same equation would be to add the align tags used in MathJax v3, to recognize the \\\\ as line breaks:

\n\t\tCode:\n\t
[math]\n\\begin{align*}\nP(\\text{16 out of 20}) &= \\frac{20!}{16! \\times 4!} \\times 0.85^{16} \\times 0.15^{4} = 0.182122 \\\\\nP(\\text{17 out of 20}) &= \\frac{20!}{17! \\times 3!} \\times 0.85^{17} \\times 0.15^{3} = 0.242829 \\\\\nP(\\text{18 out of 20}) &= \\frac{20!}{18! \\times 2!} \\times 0.85^{18} \\times 0.15^{2} = 0.229338 \\\\\nP(\\text{19 out of 20}) &= \\frac{20!}{19! \\times 1!} \\times 0.85^{19} \\times 0.15^{1} = 0.136798 \\\\\nP(\\text{20 out of 20}) &= \\frac{20!}{20! \\times 0!} \\times 0.85^{20} \\times 0.15^{0} = 0.0387595\n\\end{align*}\n[/math]

\nAnd then it display in a more readable format, as seen here:

\n\\begin{align*}\nP(\\text{16 out of 20}) &= \\frac{20!}{16! \\times 4!} \\times 0.85^{16} \\times 0.15^{4} = 0.182122 \\\\\nP(\\text{17 out of 20}) &= \\frac{20!}{17! \\times 3!} \\times 0.85^{17} \\times 0.15^{3} = 0.242829 \\\\\nP(\\text{18 out of 20}) &= \\frac{20!}{18! \\times 2!} \\times 0.85^{18} \\times 0.15^{2} = 0.229338 \\\\\nP(\\text{19 out of 20}) &= \\frac{20!}{19! \\times 1!} \\times 0.85^{19} \\times 0.15^{1} = 0.136798 \\\\\nP(\\text{20 out of 20}) &= \\frac{20!}{20! \\times 0!} \\times 0.85^{20} \\times 0.15^{0} = 0.0387595\n\\end{align*}\n
Reactions:
2 users

Writing Physics Equations\u200b

We have also installed a physics science package into MathJax, for physics notation and equation support.
We have also installed a physics science package into MathJax, for physics notation and equation support.

\nHere are a few physics-related examples:

Derivatives
\n\t\tCode:\n\t
[math]\\frac{d}{dx} f(x) \\quad \\text{versus} \\quad \\dv{f}{x}[/math]\\frac{d}{dx} f(x) \\quad \\text{versus} \\quad \\dv{f}{x}
Partial Derivatives
\n\t\tCode:\n\t
[math]\\frac{\\partial}{\\partial x} f(x,y) \\quad \\text{versus} \\quad \\pdv{f}{x}[/math]\\frac{\\partial}{\\partial x} f(x,y) \\quad \\text{versus} \\quad \\pdv{f}{x}
Vectors
\n\t\tCode:\n\t
[math]\\vec{v} \\quad \\text{versus} \\quad \\vb{v} \\quad \\text{and} \\quad \\vec{v} \\cdot \\vec{w} \\quad \\text{versus} \\quad \\vb{v} \\vdot \\vb{w}[/math]\\vec{v} \\quad \\text{versus} \\quad \\vb{v} \\quad \\text{and} \\quad \\vec{v} \\cdot \\vec{w} \\quad \\text{versus} \\quad \\vb{v} \\vdot \\vb{w}
Gradient, Divergence, Curl
\n\t\tCode:\n\t
[math]\\vec{\\nabla} \\phi \\quad \\text{versus} \\quad \\grad{\\phi}[/math]\n[math]\\vec{\\nabla} \\cdot \\vec{v} \\quad \\text{versus} \\quad \\div{\\vb{v}}[/math]\n[math]\\vec{\\nabla} \\times \\vec{v} \\quad \\text{versus} \\quad \\curl{\\vb{v}}[/math]\\vec{\\nabla} \\phi \\quad \\text{versus} \\quad \\grad{\\phi}\\vec{\\nabla} \\cdot \\vec{v} \\quad \\text{versus} \\quad \\div{\\vb{v}}\\vec{\\nabla} \\times \\vec{v} \\quad \\text{versus} \\quad \\curl{\\vb{v}}
Bra-Ket Notation
\n\t\tCode:\n\t
[math]\\langle \\psi | \\phi \\rangle \\quad \\text{versus} \\quad \\braket{\\psi}{\\phi}[/math]\\langle \\psi | \\phi \\rangle \\quad \\text{versus} \\quad \\braket{\\psi}{\\phi}
Commutators and Anticommutators
\n\t\tCode:\n\t
[math][\\hat{A}, \\hat{B}] \\quad \\text{versus} \\quad \\comm{\\hat{A}}{\\hat{B}}[/math]\n[math]\\{\\hat{A}, \\hat{B}\\} \\quad \\text{versus} \\quad \\acomm{\\hat{A}}{\\hat{B}}[/math][\\hat{A}, \\hat{B}] \\quad \\text{versus} \\quad \\comm{\\hat{A}}{\\hat{B}}\\{\\hat{A}, \\hat{B}\\} \\quad \\text{versus} \\quad \\acomm{\\hat{A}}{\\hat{B}}
Matrices
\n\t\tCode:\n\t
[math]\n\\begin{pmatrix}\na & b \\\\\nc & d\n\\end{pmatrix} \\quad \\text{versus} \\quad \\mqty(a & b \\\\ c & d)\n[/math]\n\\begin{pmatrix}\na & b \\\\\nc & d\n\\end{pmatrix} \\quad \\text{versus} \\quad \\mqty(a & b \\\\ c & d)\n
Dirac Notation (Ket, Bra, Operators)
\n\t\tCode:\n\t
[math]|\\psi\\rangle \\quad \\text{versus} \\quad \\ket{\\psi}[/math]\n[math]\\langle\\psi| \\quad \\text{versus} \\quad \\bra{\\psi}[/math]\n[math]\\hat{H}|\\psi\\rangle \\quad \\text{versus} \\quad \\op{H}{\\psi}[/math]|\\psi\\rangle \\quad \\text{versus} \\quad \\ket{\\psi}\\langle\\psi| \\quad \\text{versus} \\quad \\bra{\\psi}\\hat{H}|\\psi\\rangle \\quad \\text{versus} \\quad \\op{H}{\\psi}
Quick Quadratic Equation
\n\t\tCode:\n\t
[math]ax^2 + bx + c = 0 \\quad \\text{versus} \\quad \\qty(a x^2 + b x + c = 0)[/math]ax^2 + bx + c = 0 \\quad \\text{versus} \\quad \\qty(a x^2 + b x + c = 0)
Reactions:
1 users
This is awesome!
Reactions:
2 users
Joined Nov 2013
852 Posts | 104+
New Zealand
That looks nice!
Reactions:
2 users
", "statics": {"paragraph": 55, "paragraph.text": 55, "title": 5, "image": 2, "code": 13, "paragraph.code-inline": 8, "equation-interline": 21}, "url": "https://physicshelpforum.com/t/latex-upgrade-physics-forum-powered-by-mathjax-v3.17489/", "content": "The entire LaTeX rendering system has been upgraded to MathJax v3, and we have created a tool to see a preview render of your equations before posting them.\n\n### Insert Math Editor\u200b\n\nIn the toolbar, there is an Math Editor button, to make it easy for writing your equations in LaTeX and seeing the rendering in real time!\n\n And then you can insert the math as either a Block or Inline.\n\n Screenshots below:\n\nReactions:\n\n2 users\n\n### Writing Math Equations\u200b\n\nAnd when you want to write math equations directly in your post, you are not required to use the Insert Math button.\n\n Same as before, you can wrap your Latex equations with any of the following tags:\n\n#### Block Math\u200b\n\nCode:\n\n```\n[MATH] [/MATH]\n[LATEX] [/LATEX]\n[TEX] [/TEX]\n$$ $$\n```\n\n#### Inline Math\u200b\n\nCode:\n\n```\n[IMATH] [/IMATH]\n[ILATEX] [/ILATEX]\n[ITEX] [/ITEX]\n## ##\n```\n\nReactions:\n\n1 users\n\nLast edited:\n\nAnd some example Latex Equations, with the math expressions used for writing, to see it working...\n\n Newton's Second Law of Motion `[math]\\vec{F} = m\\vec{a}[/math]`\n\n$$\n\\vec{F} = m\\vec{a}\n$$\n\nGauss's Law for Electrcity\n\n`[math]\\nabla \\cdot \\vec{E} = \\frac{\\rho}{\\varepsilon_0}[/math]`\n\n$$\n\\nabla \\cdot \\vec{E} = \\frac{\\rho}{\\varepsilon_0}\n$$\n\nEinstein's Field Equations of General Relativity\n\n`[math]G_{\\mu\\nu} + \\Lambda g_{\\mu\\nu} = \\frac{8\\pi G}{c^4} T_{\\mu\\nu}[/math]`\n\n$$\nG_{\\mu\\nu} + \\Lambda g_{\\mu\\nu} = \\frac{8\\pi G}{c^4} T_{\\mu\\nu}\n$$\n\nThe Dirac Equation\n\n`[math](i\\gamma^\\mu \\partial_\\mu - m)\\psi = 0[/math]`\n\n$$\n(i\\gamma^\\mu \\partial_\\mu - m)\\psi = 0\n$$\n\nThe Schr\u00f6dinger Equation in Quantum Mechanics (Time-Dependent Form)\n\n`[math]i\\hbar\\frac{\\partial}{\\partial t}\\Psi(\\mathbf{r}, t) = \\hat{H}\\Psi(\\mathbf{r}, t)[/math]`\n\n$$\ni\\hbar\\frac{\\partial}{\\partial t}\\Psi(\\mathbf{r}, t) = \\hat{H}\\Psi(\\mathbf{r}, t)\n$$\n\nReactions:\n\n2 users\n\nLong Math Equations\n For very long equations, it's recommended to use line breaks appropriately. But if you don't add line breaks, and the equation is extremely long (or wider than the display you're using), a horizontal scrollbar will appear below the equation, to show that you can hover your pointer over the equation and scroll horizontally...\n\n For example, here is a very long equation without the `align` tags used in MathJax v3:\n\n Code:\n\n```\n[math]\nP(\\text{16 out of 20}) = \\frac{20!}{16! \\times 4!} \\times 0.85^{16} \\times 0.15^{4} = 0.182122 \\\\\nP(\\text{17 out of 20}) = \\frac{20!}{17! \\times 3!} \\times 0.85^{17} \\times 0.15^{3} = 0.242829 \\\\\nP(\\text{18 out of 20}) = \\frac{20!}{18! \\times 2!} \\times 0.85^{18} \\times 0.15^{2} = 0.229338 \\\\\nP(\\text{19 out of 20}) = \\frac{20!}{19! \\times 1!} \\times 0.85^{19} \\times 0.15^{1} = 0.136798 \\\\\nP(\\text{20 out of 20}) = \\frac{20!}{20! \\times 0!} \\times 0.85^{20} \\times 0.15^{0} = 0.0387595\n[/math]\n```\n\nAnd this is how the equation looks with the horizontal scrollbar:\n\n$$\nP(\\text{16 out of 20}) = \\frac{20!}{16! \\times 4!} \\times 0.85^{16} \\times 0.15^{4} = 0.182122 \\\\\nP(\\text{17 out of 20}) = \\frac{20!}{17! \\times 3!} \\times 0.85^{17} \\times 0.15^{3} = 0.242829 \\\\\nP(\\text{18 out of 20}) = \\frac{20!}{18! \\times 2!} \\times 0.85^{18} \\times 0.15^{2} = 0.229338 \\\\\nP(\\text{19 out of 20}) = \\frac{20!}{19! \\times 1!} \\times 0.85^{19} \\times 0.15^{1} = 0.136798 \\\\\nP(\\text{20 out of 20}) = \\frac{20!}{20! \\times 0!} \\times 0.85^{20} \\times 0.15^{0} = 0.0387595\n$$\n\nThe better way to write the exact same equation would be to add the `align` tags used in MathJax v3, to recognize the `\\\\` as line breaks:\n\n Code:\n\n```\n[math]\n\\begin{align*}\nP(\\text{16 out of 20}) &= \\frac{20!}{16! \\times 4!} \\times 0.85^{16} \\times 0.15^{4} = 0.182122 \\\\\nP(\\text{17 out of 20}) &= \\frac{20!}{17! \\times 3!} \\times 0.85^{17} \\times 0.15^{3} = 0.242829 \\\\\nP(\\text{18 out of 20}) &= \\frac{20!}{18! \\times 2!} \\times 0.85^{18} \\times 0.15^{2} = 0.229338 \\\\\nP(\\text{19 out of 20}) &= \\frac{20!}{19! \\times 1!} \\times 0.85^{19} \\times 0.15^{1} = 0.136798 \\\\\nP(\\text{20 out of 20}) &= \\frac{20!}{20! \\times 0!} \\times 0.85^{20} \\times 0.15^{0} = 0.0387595\n\\end{align*}\n[/math]\n```\n\nAnd then it display in a more readable format, as seen here:\n\n$$\n\\begin{align*}\nP(\\text{16 out of 20}) &= \\frac{20!}{16! \\times 4!} \\times 0.85^{16} \\times 0.15^{4} = 0.182122 \\\\\nP(\\text{17 out of 20}) &= \\frac{20!}{17! \\times 3!} \\times 0.85^{17} \\times 0.15^{3} = 0.242829 \\\\\nP(\\text{18 out of 20}) &= \\frac{20!}{18! \\times 2!} \\times 0.85^{18} \\times 0.15^{2} = 0.229338 \\\\\nP(\\text{19 out of 20}) &= \\frac{20!}{19! \\times 1!} \\times 0.85^{19} \\times 0.15^{1} = 0.136798 \\\\\nP(\\text{20 out of 20}) &= \\frac{20!}{20! \\times 0!} \\times 0.85^{20} \\times 0.15^{0} = 0.0387595\n\\end{align*}\n$$\n\nReactions:\n\n2 users\n\n### Writing Physics Equations\u200b\n\nWe have also installed a physics science package into MathJax, for physics notation and equation support.\n\n Here are a few physics-related examples:\n\n Derivatives\n Code:\n\n```\n[math]\\frac{d}{dx} f(x) \\quad \\text{versus} \\quad \\dv{f}{x}[/math]\n```\n\n$$\n\\frac{d}{dx} f(x) \\quad \\text{versus} \\quad \\dv{f}{x}\n$$\n\nPartial Derivatives\n\nCode:\n\n```\n[math]\\frac{\\partial}{\\partial x} f(x,y) \\quad \\text{versus} \\quad \\pdv{f}{x}[/math]\n```\n\n$$\n\\frac{\\partial}{\\partial x} f(x,y) \\quad \\text{versus} \\quad \\pdv{f}{x}\n$$\n\nVectors\n\nCode:\n\n```\n[math]\\vec{v} \\quad \\text{versus} \\quad \\vb{v} \\quad \\text{and} \\quad \\vec{v} \\cdot \\vec{w} \\quad \\text{versus} \\quad \\vb{v} \\vdot \\vb{w}[/math]\n```\n\n$$\n\\vec{v} \\quad \\text{versus} \\quad \\vb{v} \\quad \\text{and} \\quad \\vec{v} \\cdot \\vec{w} \\quad \\text{versus} \\quad \\vb{v} \\vdot \\vb{w}\n$$\n\nGradient, Divergence, Curl\n\nCode:\n\n```\n[math]\\vec{\\nabla} \\phi \\quad \\text{versus} \\quad \\grad{\\phi}[/math]\n[math]\\vec{\\nabla} \\cdot \\vec{v} \\quad \\text{versus} \\quad \\div{\\vb{v}}[/math]\n[math]\\vec{\\nabla} \\times \\vec{v} \\quad \\text{versus} \\quad \\curl{\\vb{v}}[/math]\n```\n\n$$\n\\vec{\\nabla} \\phi \\quad \\text{versus} \\quad \\grad{\\phi}\n$$\n\n$$\n\\vec{\\nabla} \\cdot \\vec{v} \\quad \\text{versus} \\quad \\div{\\vb{v}}\n$$\n\n$$\n\\vec{\\nabla} \\times \\vec{v} \\quad \\text{versus} \\quad \\curl{\\vb{v}}\n$$\n\nBra-Ket Notation\n\nCode:\n\n```\n[math]\\langle \\psi | \\phi \\rangle \\quad \\text{versus} \\quad \\braket{\\psi}{\\phi}[/math]\n```\n\n$$\n\\langle \\psi | \\phi \\rangle \\quad \\text{versus} \\quad \\braket{\\psi}{\\phi}\n$$\n\nCommutators and Anticommutators\n\nCode:\n\n```\n[math][\\hat{A}, \\hat{B}] \\quad \\text{versus} \\quad \\comm{\\hat{A}}{\\hat{B}}[/math]\n[math]\\{\\hat{A}, \\hat{B}\\} \\quad \\text{versus} \\quad \\acomm{\\hat{A}}{\\hat{B}}[/math]\n```\n\n$$\n[\\hat{A}, \\hat{B}] \\quad \\text{versus} \\quad \\comm{\\hat{A}}{\\hat{B}}\n$$\n\n$$\n\\{\\hat{A}, \\hat{B}\\} \\quad \\text{versus} \\quad \\acomm{\\hat{A}}{\\hat{B}}\n$$\n\nMatrices\n\nCode:\n\n```\n[math]\n\\begin{pmatrix}\na & b \\\\\nc & d\n\\end{pmatrix} \\quad \\text{versus} \\quad \\mqty(a & b \\\\ c & d)\n[/math]\n```\n\n$$\n\\begin{pmatrix}\na & b \\\\\nc & d\n\\end{pmatrix} \\quad \\text{versus} \\quad \\mqty(a & b \\\\ c & d)\n$$\n\nDirac Notation (Ket, Bra, Operators)\n\nCode:\n\n```\n[math]|\\psi\\rangle \\quad \\text{versus} \\quad \\ket{\\psi}[/math]\n[math]\\langle\\psi| \\quad \\text{versus} \\quad \\bra{\\psi}[/math]\n[math]\\hat{H}|\\psi\\rangle \\quad \\text{versus} \\quad \\op{H}{\\psi}[/math]\n```\n\n$$\n|\\psi\\rangle \\quad \\text{versus} \\quad \\ket{\\psi}\n$$\n\n$$\n\\langle\\psi| \\quad \\text{versus} \\quad \\bra{\\psi}\n$$\n\n$$\n\\hat{H}|\\psi\\rangle \\quad \\text{versus} \\quad \\op{H}{\\psi}\n$$\n\nQuick Quadratic Equation\n\nCode:\n\n```\n[math]ax^2 + bx + c = 0 \\quad \\text{versus} \\quad \\qty(a x^2 + b x + c = 0)[/math]\n```\n\n$$\nax^2 + bx + c = 0 \\quad \\text{versus} \\quad \\qty(a x^2 + b x + c = 0)\n$$\n\nReactions:\n\n1 users\n\nThis is awesome!\n\nReactions:\n\n2 users\n\nJoined Nov 2013\n\n852 Posts | 104+\n\nNew Zealand\n\nThat looks nice!\n\nReactions:\n\n2 users\n", "html": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\n\t\t\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\t\n\t\t\n\t\t\n\n\n\n\t\tInfo - Latex Upgrade - Physics Forum Powered by MathJax v3 | Physics Forum\n\t\t\n\n\t\t\t\n\t\t\t\n\n\t\t\n\n\t\t\t\n\n\n\n\n\t\t\n\t\t\n\t\t\n\n\n\t\t\t\n\n\t\t\t\n\n\n\n\n\n\n\t\n\n\n\n\n\n\n\n\t\n\n\n\n\n\n\n\n\n\t\t\n\t\t\n\n\n\n\n\n\n\n\n\n\n\n\t\t\n\t\t\n\t\t\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\n\n\t\t\n\t\t\n\n\n\n\n\n\n\t\n\n\n\n\n\n\n\t\t\n\n\n\t\t\n\n\n\t\n\n\n\n\t\t\t\n\n\n\t\t\t\n\n\n\n\t\t\n\n\t\n\n\n\n\n\n\t\n\n\n\t\n\n\t\n\t\t\n\n\n\t\t
\n\n\n\n\t\t
\n\t\t\t
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\n\n\t\t\t\t\t\t\t
\n\n\n\n\n\t\n\n\n\n\n\n\t\t\t\t\t\t\t\t\t\t
\n\n\n\n\n\n\n\t\t\t\t\t
\n\n\n\n\n\n\n\n\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\n\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\n\n\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\n\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t

Search

\n\n\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\n\n\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t
\n\n\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t
\n\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\tBy:\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tAdvanced search\u2026\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\n\n\t\t\t\t
\n\t\t\t\t\t
\n\n\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\n\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\n\n\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t
\n\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\tBy:\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tAdvanced\u2026\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\n\n\n\n\n\t\t\t\t\t
\n\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t\t\t\t
\n\n\n\t\t\t\t\t\t\t
\n\n\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\n\n\n\n\n\n\n\n\n\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t
\n\n\n\t\t\t\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\n\t\t\t\t\t\t
\n\t
\n\n\t\t
\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\tMenu\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\n\n\n\t\t
\n\n\n\n\t
\n
\n\n\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
Install the app
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\n\n\n\n\n\t\t\t\t
\n\n\n\n\t\t\t\t\t
\n\n\t\t\t\t\t\t\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t
\n\t\t\t
\n\n\n\n\t\t\t\t\t\t\t\n\n\n\n\t\t\t
\n\t\t
\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\n\n\t
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.
\n\n\n\n\t\t\t\t\t\t
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t
\n\n\n\n\n\n\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t\t\t
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t
\n\t\t\t\t
\n\n\n\t\t\t\t\t\t\t
\n\n\n\t\t\t\t\t\t\t\t\t\t
\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t

Info Latex Upgrade - Physics Forum Powered by MathJax v3

\n\n\n\t\t\t\t\t\t\t\t\t\t
\n\n\n\n\t\t\t\t\t\t\t\t\t\t
\n\n\t
    \n\t\t
  • \n\t\t\t\n\t\t\tThread starter\n\n\t\t\tchip\n\t\t
  • \n\t\t
  • \n\t\t\t\n\t\t\tStart date\n\n\t\t\t\n\t\t
  • \n\n\t
\n
\n\n\n\t\t\t\t\t\t\t
\n\n\n\n\t\t\t\t
\n\t\t\t
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n\t\n\n\n\n\n\n\n\n\t
\n\n\n\n\n\n\t
\n\n\n\n\t
\n\n\t\t
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t
\n\n\n\n\t\t\n\n\n\t\t\t
\n\n\t\t\t\t\t
\n\n\n\t
\n\n\n\n\t\t
\n\t\t\t
\n\n\t\t\t\t\t\n\t\t\t\"chip\"\n\t\t\n\n\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\t
\n\t\t\t\t

chip

\n\n\t\t\t
\n\n\n\n\t\t\t\t
\n\n\t\t\t\t\t\t
Joined Oct 2019
\n\n\n\n\n\t\t\t\t\t\t
34 Posts | 39+
\n\n\n\t\t\t\t\t\t
Washington
\n\n\t\t\t\t
\n\n\t\t
\n\t\t\n\t
\n\n\t\t\t\t\t
\n\n\n\n\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\n\n\n\n\n\n\t
\n\t\t\n\n\t\t\n\t
\n\n\n\n\t\t\t\t\t\t\t\t
\n\n
\n\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t
\n\n\n\n\n\n\n\n\n\t\t
\n\n\n\n\n\t\t\t
\n\n\t\t\t\t\t
The entire LaTeX rendering system has been upgraded to MathJax v3, and we have created a tool to see a preview render of your equations before posting them.
\n
\n

Insert Math Editor​

In the toolbar, there is an Math Editor button, to make it easy for writing your equations in LaTeX and seeing the rendering in real time!
\n
\nAnd then you can insert the math as either a Block or Inline.
\n
\nScreenshots below:
\n
\n
\n
\n
\n\n\t\t\t
\n\n\t\t\t
 
\n\n\n\n\t\t
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t
\n\n\n\n\t\t
    \n\n\t\t\t
  • \"Like\"
  • \n\n\t\t
\n\n\n\nReactions:\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t2 users\n\n\n\n\n\t\t\t\t\t\t\t\t
\n\n\n\n\n\n\t
\n\n\n\n\n\n\n\t\t
\n\t
\n\n\n\t\t\t\t\t\t\t
\n\n\n\t\t\t\t\t
\n\n\t\t\t
\n\n\t
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t
\n\n\n\t\t\t\t\n\n\n\t\t\n\n\n\t\t\t
\n\n\t\t\t\t\t
\n\n\n\t
\n\n\n\t\t\t\n\n\n\t\t
\n\t\t\t
\n\n\t\t\t\t\t\n\t\t\t\"chip\"\n\t\t\n\n\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\t
\n\t\t\t\t

chip

\n\n\t\t\t
\n\n\n\n\t\t\t\t
\n\n\t\t\t\t\t\t
Joined Oct 2019
\n\n\n\n\n\t\t\t\t\t\t
34 Posts | 39+
\n\n\n\t\t\t\t\t\t
Washington
\n\n\t\t\t\t
\n\n\t\t
\n\t\t\n\t
\n\n\t\t\t\t\t
\n\n\n\n\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\n\n\n\n\n\n\t
\n\t\t\n\n\t\t\n\t
\n\n\n\n\t\t\t\t\t\t\t\t
\n\n
\n\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t
\n\n\n\n\t\t
\n\n\n\n\n\t\t\t
\n\n\t\t\t\t\t

Writing Math Equations​

And when you want to write math equations directly in your post, you are not required to use the Insert Math button.
\n
\nSame as before, you can wrap your Latex equations with any of the following tags:
\n
\n

Block Math​

\n\n\n\n\n
\n\t
\n\t\tCode:\n\t
\n\t
\n\t\t
[MATH]      [/MATH]\n[LATEX]     [/LATEX]\n[TEX]       [/TEX]\n$$          $$
\n\t
\n

\n

Inline Math​

\n\n\n\n\n
\n\t
\n\t\tCode:\n\t
\n\t
\n\t\t
[IMATH]     [/IMATH]\n[ILATEX]    [/ILATEX]\n[ITEX]      [/ITEX]\n##          ##
\n\t
\n
\n\n\t\t\t
\n\n\t\t\t
 
\n\n\n\n\t\t
\n\n\n\n\n\n\n\t
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t
\n\n\n\n\t\t
    \n\n\t\t\t
  • \"Like\"
  • \n\n\t\t
\n\n\n\nReactions:\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t1 users\n\n\n\n\n\t\t\t\t\t\t\t\t
\n\n\n\n\n\n\t
\n\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\n\n\n\n\n\n\t\t
\n\t
\n\n\n\t\t\t\t\t\t\t
\n\n\n\t\t\t\t\t
\n\n\t\t\t
\n\n\t
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t
\n\n\n\t\t\t\t\n\n\n\t\t\n\n\n\t\t\t
\n\n\t\t\t\t\t
\n\n\n\t
\n\n\n\t\t\t\n\n\n\t\t
\n\t\t\t
\n\n\t\t\t\t\t\n\t\t\t\"chip\"\n\t\t\n\n\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\t
\n\t\t\t\t

chip

\n\n\t\t\t
\n\n\n\n\t\t\t\t
\n\n\t\t\t\t\t\t
Joined Oct 2019
\n\n\n\n\n\t\t\t\t\t\t
34 Posts | 39+
\n\n\n\t\t\t\t\t\t
Washington
\n\n\t\t\t\t
\n\n\t\t
\n\t\t\n\t
\n\n\t\t\t\t\t
\n\n\n\n\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\n\n\n\n\n\n\t
\n\t\t\n\n\t\t\n\t
\n\n\n\n\t\t\t\t\t\t\t\t
\n\n
\n\n\n Last edited: \n\n\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t
\n\n\n\n\t\t
\n\n\n\n\n\t\t\t
\n\n\t\t\t\t\t
And some example Latex Equations, with the math expressions used for writing, to see it working...
\n
\nNewton's Second Law of Motion
\n[math]\\vec{F} = m\\vec{a}[/math]
\n
\n\n\t\\vec{F} = m\\vec{a}\n\n\n
\n
\nGauss's Law for Electrcity
\n[math]\\nabla \\cdot \\vec{E} = \\frac{\\rho}{\\varepsilon_0}[/math]
\n
\n\n\t\\nabla \\cdot \\vec{E} = \\frac{\\rho}{\\varepsilon_0}\n\n\n
\n
\nEinstein's Field Equations of General Relativity
\n[math]G_{\\mu\\nu} + \\Lambda g_{\\mu\\nu} = \\frac{8\\pi G}{c^4} T_{\\mu\\nu}[/math]
\n
\n\n\tG_{\\mu\\nu} + \\Lambda g_{\\mu\\nu} = \\frac{8\\pi G}{c^4} T_{\\mu\\nu}\n\n\n
\n
\nThe Dirac Equation
\n[math](i\\gamma^\\mu \\partial_\\mu - m)\\psi = 0[/math]
\n
\n\n\t(i\\gamma^\\mu \\partial_\\mu - m)\\psi = 0\n\n\n
\n
\nThe Schr\u00f6dinger Equation in Quantum Mechanics (Time-Dependent Form)
\n[math]i\\hbar\\frac{\\partial}{\\partial t}\\Psi(\\mathbf{r}, t) = \\hat{H}\\Psi(\\mathbf{r}, t)[/math]
\n
\n\n\ti\\hbar\\frac{\\partial}{\\partial t}\\Psi(\\mathbf{r}, t) = \\hat{H}\\Psi(\\mathbf{r}, t)\n\n\n
\n\n\t\t\t
\n\n\t\t\t
 
\n\n\n\n\t\t
\n\n\n\n\n\n\n\t
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t
\n\n\n\n\t\t
    \n\n\t\t\t
  • \"Like\"
  • \n\n\t\t
\n\n\n\nReactions:\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t2 users\n\n\n\n\n\t\t\t\t\t\t\t\t
\n\n\n\n\n\n\t
\n\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\n\n\n\n\n\n\t\t
\n\t
\n\n\n\t\t\t\t\t\t\t
\n\n\n\t\t\t\t\t
\n\n\t\t\t
\n\n\t
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t
\n\n\n\t\t\t\t\n\n\n\t\t\n\n\n\t\t\t
\n\n\t\t\t\t\t
\n\n\n\t
\n\n\n\t\t\t\n\n\n\t\t
\n\t\t\t
\n\n\t\t\t\t\t\n\t\t\t\"chip\"\n\t\t\n\n\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\t
\n\t\t\t\t

chip

\n\n\t\t\t
\n\n\n\n\t\t\t\t
\n\n\t\t\t\t\t\t
Joined Oct 2019
\n\n\n\n\n\t\t\t\t\t\t
34 Posts | 39+
\n\n\n\t\t\t\t\t\t
Washington
\n\n\t\t\t\t
\n\n\t\t
\n\t\t\n\t
\n\n\t\t\t\t\t
\n\n\n\n\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\n\n\n\n\n\n\t
\n\t\t\n\n\t\t\n\t
\n\n\n\n\t\t\t\t\t\t\t\t
\n\n
\n\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t
\n\n\n\n\t\t
\n\n\n\n\n\t\t\t
\n\n\t\t\t\t\t
Long Math Equations
\nFor very long equations, it's recommended to use line breaks appropriately. But if you don't add line breaks, and the equation is extremely long (or wider than the display you're using), a horizontal scrollbar will appear below the equation, to show that you can hover your pointer over the equation and scroll horizontally...
\n
\nFor example, here is a very long equation without the align tags used in MathJax v3:
\n
\n\n\n\n\n\n
\n\t
\n\t\tCode:\n\t
\n\t
\n\t\t
[math]\nP(\\text{16 out of 20}) = \\frac{20!}{16! \\times 4!} \\times 0.85^{16} \\times 0.15^{4} = 0.182122 \\\\\nP(\\text{17 out of 20}) = \\frac{20!}{17! \\times 3!} \\times 0.85^{17} \\times 0.15^{3} = 0.242829 \\\\\nP(\\text{18 out of 20}) = \\frac{20!}{18! \\times 2!} \\times 0.85^{18} \\times 0.15^{2} = 0.229338 \\\\\nP(\\text{19 out of 20}) = \\frac{20!}{19! \\times 1!} \\times 0.85^{19} \\times 0.15^{1} = 0.136798 \\\\\nP(\\text{20 out of 20}) = \\frac{20!}{20! \\times 0!} \\times 0.85^{20} \\times 0.15^{0} = 0.0387595\n[/math]
\n\t
\n

\nAnd this is how the equation looks with the horizontal scrollbar:
\n
\n\n\t\nP(\\text{16 out of 20}) = \\frac{20!}{16! \\times 4!} \\times 0.85^{16} \\times 0.15^{4} = 0.182122 \\\\\nP(\\text{17 out of 20}) = \\frac{20!}{17! \\times 3!} \\times 0.85^{17} \\times 0.15^{3} = 0.242829 \\\\\nP(\\text{18 out of 20}) = \\frac{20!}{18! \\times 2!} \\times 0.85^{18} \\times 0.15^{2} = 0.229338 \\\\\nP(\\text{19 out of 20}) = \\frac{20!}{19! \\times 1!} \\times 0.85^{19} \\times 0.15^{1} = 0.136798 \\\\\nP(\\text{20 out of 20}) = \\frac{20!}{20! \\times 0!} \\times 0.85^{20} \\times 0.15^{0} = 0.0387595\n\n\n\n
\n
\nThe better way to write the exact same equation would be to add the align tags used in MathJax v3, to recognize the \\\\ as line breaks:
\n
\n\n\n\n\n\n
\n\t
\n\t\tCode:\n\t
\n\t
\n\t\t
[math]\n\\begin{align*}\nP(\\text{16 out of 20}) &= \\frac{20!}{16! \\times 4!} \\times 0.85^{16} \\times 0.15^{4} = 0.182122 \\\\\nP(\\text{17 out of 20}) &= \\frac{20!}{17! \\times 3!} \\times 0.85^{17} \\times 0.15^{3} = 0.242829 \\\\\nP(\\text{18 out of 20}) &= \\frac{20!}{18! \\times 2!} \\times 0.85^{18} \\times 0.15^{2} = 0.229338 \\\\\nP(\\text{19 out of 20}) &= \\frac{20!}{19! \\times 1!} \\times 0.85^{19} \\times 0.15^{1} = 0.136798 \\\\\nP(\\text{20 out of 20}) &= \\frac{20!}{20! \\times 0!} \\times 0.85^{20} \\times 0.15^{0} = 0.0387595\n\\end{align*}\n[/math]
\n\t
\n

\nAnd then it display in a more readable format, as seen here:
\n
\n\n\t\n\\begin{align*}\nP(\\text{16 out of 20}) &= \\frac{20!}{16! \\times 4!} \\times 0.85^{16} \\times 0.15^{4} = 0.182122 \\\\\nP(\\text{17 out of 20}) &= \\frac{20!}{17! \\times 3!} \\times 0.85^{17} \\times 0.15^{3} = 0.242829 \\\\\nP(\\text{18 out of 20}) &= \\frac{20!}{18! \\times 2!} \\times 0.85^{18} \\times 0.15^{2} = 0.229338 \\\\\nP(\\text{19 out of 20}) &= \\frac{20!}{19! \\times 1!} \\times 0.85^{19} \\times 0.15^{1} = 0.136798 \\\\\nP(\\text{20 out of 20}) &= \\frac{20!}{20! \\times 0!} \\times 0.85^{20} \\times 0.15^{0} = 0.0387595\n\\end{align*}\n\n\n\n
\n\n\t\t\t
\n\n\t\t\t
 
\n\n\n\n\t\t
\n\n\n\n\n\n\n\t
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t
\n\n\n\n\t\t
    \n\n\t\t\t
  • \"Like\"
  • \n\n\t\t
\n\n\n\nReactions:\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t2 users\n\n\n\n\n\t\t\t\t\t\t\t\t
\n\n\n\n\n\n\t
\n\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\n\n\n\n\n\n\t\t
\n\t
\n\n\n\t\t\t\t\t\t\t
\n\n\n\t\t\t\t\t
\n\n\t\t\t
\n\n\t
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t
\n\n\n\t\t\t\t\n\n\n\t\t\n\n\n\t\t\t
\n\n\t\t\t\t\t
\n\n\n\t
\n\n\n\t\t\t\n\n\n\t\t
\n\t\t\t
\n\n\t\t\t\t\t\n\t\t\t\"chip\"\n\t\t\n\n\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\t
\n\t\t\t\t

chip

\n\n\t\t\t
\n\n\n\n\t\t\t\t
\n\n\t\t\t\t\t\t
Joined Oct 2019
\n\n\n\n\n\t\t\t\t\t\t
34 Posts | 39+
\n\n\n\t\t\t\t\t\t
Washington
\n\n\t\t\t\t
\n\n\t\t
\n\t\t\n\t
\n\n\t\t\t\t\t
\n\n\n\n\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\n\n\n\n\n\n\t
\n\t\t\n\n\t\t\n\t
\n\n\n\n\t\t\t\t\t\t\t\t
\n\n
\n\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t
\n\n\n\n\t\t
\n\n\n\n\n\t\t\t
\n\n\t\t\t\t\t

Writing Physics Equations​

We have also installed a physics science package into MathJax, for physics notation and equation support.
\n
\nHere are a few physics-related examples:
\n
\nDerivatives
\n\n\n\n\n\n
\n\t
\n\t\tCode:\n\t
\n\t
\n\t\t
[math]\\frac{d}{dx} f(x) \\quad \\text{versus} \\quad \\dv{f}{x}[/math]
\n\t
\n

\n\n\t\\frac{d}{dx} f(x) \\quad \\text{versus} \\quad \\dv{f}{x}\n\n\n
\n
\nPartial Derivatives
\n\n\n\n\n\n
\n\t
\n\t\tCode:\n\t
\n\t
\n\t\t
[math]\\frac{\\partial}{\\partial x} f(x,y) \\quad \\text{versus} \\quad \\pdv{f}{x}[/math]
\n\t
\n

\n\n\t\\frac{\\partial}{\\partial x} f(x,y) \\quad \\text{versus} \\quad \\pdv{f}{x}\n\n\n
\n
\nVectors
\n\n\n\n\n\n
\n\t
\n\t\tCode:\n\t
\n\t
\n\t\t
[math]\\vec{v} \\quad \\text{versus} \\quad \\vb{v} \\quad \\text{and} \\quad \\vec{v} \\cdot \\vec{w} \\quad \\text{versus} \\quad \\vb{v} \\vdot \\vb{w}[/math]
\n\t
\n

\n\n\t\\vec{v} \\quad \\text{versus} \\quad \\vb{v} \\quad \\text{and} \\quad \\vec{v} \\cdot \\vec{w} \\quad \\text{versus} \\quad \\vb{v} \\vdot \\vb{w}\n\n\n
\n
\nGradient, Divergence, Curl
\n\n\n\n\n\n
\n\t
\n\t\tCode:\n\t
\n\t
\n\t\t
[math]\\vec{\\nabla} \\phi \\quad \\text{versus} \\quad \\grad{\\phi}[/math]\n[math]\\vec{\\nabla} \\cdot \\vec{v} \\quad \\text{versus} \\quad \\div{\\vb{v}}[/math]\n[math]\\vec{\\nabla} \\times \\vec{v} \\quad \\text{versus} \\quad \\curl{\\vb{v}}[/math]
\n\t
\n

\n\n\t\\vec{\\nabla} \\phi \\quad \\text{versus} \\quad \\grad{\\phi}\n\n\n
\n\n\t\\vec{\\nabla} \\cdot \\vec{v} \\quad \\text{versus} \\quad \\div{\\vb{v}}\n\n\n
\n\n\t\\vec{\\nabla} \\times \\vec{v} \\quad \\text{versus} \\quad \\curl{\\vb{v}}\n\n\n
\n
\nBra-Ket Notation
\n\n\n\n\n\n
\n\t
\n\t\tCode:\n\t
\n\t
\n\t\t
[math]\\langle \\psi | \\phi \\rangle \\quad \\text{versus} \\quad \\braket{\\psi}{\\phi}[/math]
\n\t
\n

\n\n\t\\langle \\psi | \\phi \\rangle \\quad \\text{versus} \\quad \\braket{\\psi}{\\phi}\n\n\n
\n
\nCommutators and Anticommutators
\n\n\n\n\n\n
\n\t
\n\t\tCode:\n\t
\n\t
\n\t\t
[math][\\hat{A}, \\hat{B}] \\quad \\text{versus} \\quad \\comm{\\hat{A}}{\\hat{B}}[/math]\n[math]\\{\\hat{A}, \\hat{B}\\} \\quad \\text{versus} \\quad \\acomm{\\hat{A}}{\\hat{B}}[/math]
\n\t
\n

\n\n\t[\\hat{A}, \\hat{B}] \\quad \\text{versus} \\quad \\comm{\\hat{A}}{\\hat{B}}\n\n\n
\n\n\t\\{\\hat{A}, \\hat{B}\\} \\quad \\text{versus} \\quad \\acomm{\\hat{A}}{\\hat{B}}\n\n\n
\n
\nMatrices
\n\n\n\n\n\n
\n\t
\n\t\tCode:\n\t
\n\t
\n\t\t
[math]\n\\begin{pmatrix}\na & b \\\\\nc & d\n\\end{pmatrix} \\quad \\text{versus} \\quad \\mqty(a & b \\\\ c & d)\n[/math]
\n\t
\n

\n\n\t\n\\begin{pmatrix}\na & b \\\\\nc & d\n\\end{pmatrix} \\quad \\text{versus} \\quad \\mqty(a & b \\\\ c & d)\n\n\n\n
\n
\nDirac Notation (Ket, Bra, Operators)
\n\n\n\n\n\n
\n\t
\n\t\tCode:\n\t
\n\t
\n\t\t
[math]|\\psi\\rangle \\quad \\text{versus} \\quad \\ket{\\psi}[/math]\n[math]\\langle\\psi| \\quad \\text{versus} \\quad \\bra{\\psi}[/math]\n[math]\\hat{H}|\\psi\\rangle \\quad \\text{versus} \\quad \\op{H}{\\psi}[/math]
\n\t
\n

\n\n\t|\\psi\\rangle \\quad \\text{versus} \\quad \\ket{\\psi}\n\n\n
\n\n\t\\langle\\psi| \\quad \\text{versus} \\quad \\bra{\\psi}\n\n\n
\n\n\t\\hat{H}|\\psi\\rangle \\quad \\text{versus} \\quad \\op{H}{\\psi}\n\n\n
\n
\nQuick Quadratic Equation
\n\n\n\n\n\n
\n\t
\n\t\tCode:\n\t
\n\t
\n\t\t
[math]ax^2 + bx + c = 0 \\quad \\text{versus} \\quad \\qty(a x^2 + b x + c = 0)[/math]
\n\t
\n

\n\n\tax^2 + bx + c = 0 \\quad \\text{versus} \\quad \\qty(a x^2 + b x + c = 0)\n\n\n
\n\n\t\t\t
\n\n\t\t\t
 
\n\n\n\n\t\t
\n\n\n\n\n\n\n\t
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t
\n\n\n\n\t\t
    \n\n\t\t\t
  • \"Like\"
  • \n\n\t\t
\n\n\n\nReactions:\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t1 users\n\n\n\n\n\t\t\t\t\t\t\t\t
\n\n\n\n\n\n\t
\n\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\n\n\n\n\n\n\t\t
\n\t
\n\n\n\t\t\t\t\t\t\t
\n\n\n\t\t\t\t\t
\n\n\t\t\t
\n\n\t
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t
\n\n\n\t\t\t\t\n\n\n\t\t\n\n\n\t\t\t
\n\n\t\t\t\t\t
\n\n\n\t
\n\n\n\t\t\t\n\n\n\t\t
\n\t\t\t
\n\n\t\t\t\t\t\n\t\t\t\"benit13\"\n\t\t\n\n\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\t
\n\t\t\t\t

benit13

\n\n\t\t\t
\n\n\n\n\t\t\t\t
\n\n\t\t\t\t\t\t
Joined Oct 2017
\n\n\n\n\n\t\t\t\t\t\t
1K Posts | 768+
\n\n\n\t\t\t\t\t\t
Glasgow
\n\n\t\t\t\t
\n\n\t\t
\n\t\t\n\t
\n\n\t\t\t\t\t
\n\n\n\n\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\n\n\n\n\n\n\t
\n\t\t\n\n\t\t\n\t
\n\n\n\n\t\t\t\t\t\t\t\t
\n\n
\n\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t
\n\n\n\n\t\t
\n\n\n\n\n\t\t\t
\n\n\t\t\t\t\t
This is awesome!
\n\n\t\t\t
\n\n\t\t\t
 
\n\n\n\n\t\t
\n\n\n\n\n\n\n\t
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t
\n\n\n\n\t\t
    \n\n\t\t\t
  • \"Like\"
  • \n\n\t\t
\n\n\n\nReactions:\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t2 users\n\n\n\n\n\t\t\t\t\t\t\t\t
\n\n\n\n\n\n\t
\n\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\n\n\n\n\n\n\t\t
\n\t
\n\n\n\t\t\t\t\t\t\t
\n\n\n\t\t\t\t\t
\n\n\t\t\t
\n\n\t
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t
\n\n\n\t\t\t\t\n\n\n\t\t\n\n\n\t\t\t
\n\n\t\t\t\t\t
\n\n\n\t
\n\n\n\t\t\t\n\n\n\t\t
\n\t\t\t
\n\n\t\t\t\t\t\n\t\t\tK\n\t\t\n\n\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\t
\n\t\t\t\t

kiwiheretic

\n\n\t\t\t
\n\n\n\n\t\t\t\t
\n\n\t\t\t\t\t\t
Joined Nov 2013
\n\n\n\n\n\t\t\t\t\t\t
852 Posts | 104+
\n\n\n\t\t\t\t\t\t
New Zealand
\n\n\t\t\t\t
\n\n\t\t
\n\t\t\n\t
\n\n\t\t\t\t\t
\n\n\n\n\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\n\n\n\n\n\n\t
\n\t\t\n\n\t\t\n\t
\n\n\n\n\t\t\t\t\t\t\t\t
\n\n
\n\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t
\n\n\n\n\t\t
\n\n\n\n\n\t\t\t
\n\n\t\t\t\t\t
That looks nice!
\n\n\t\t\t
\n\n\t\t\t
 
\n\n\n\n\t\t
\n\n\n\n\n\n\n\t
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t
\n\n\n\n\t\t
    \n\n\t\t\t
  • \"Like\"
  • \n\n\t\t
\n\n\n\nReactions:\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t2 users\n\n\n\n\n\t\t\t\t\t\t\t\t
\n\n\n\n\n\n\t
\n\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\n\n\n\n\n\n\t\t
\n\t
\n\n\n\t\t\t\t\t\t\t
\n\n\n\t\t\t\t\t
\n\n\t\t\t
\n\n\t
\n\n\n\n\n\n\n\n\n\n\n\t\t
\n\t
\n\n\n\t\t
\n\n\n\n\n\n\t\t\t\t\t\n\n\n\t\t
\n\n\n\n\n\n
\n\n\n\n\n\t\n\t\n\n\n\t\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n\n\n\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\n\n\n\n\t\t\t\t\t\t\t\t
\n\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t
\n\n\n\n\t\t\t\t\t\t
\n\n\n\n\n\n\n\n\t\t
\n\t\t\t
\n\n\n\n\t\t\t\t\t\t\t\n\n\n\n\t\t\t
\n\t\t
\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\t
\n\t\t\t\t
\n\n\n\n\n\t\n\n\n\n\n\n\n\n\t\t\t
\n\t\t
\n\n\t\t
\n\n\n\t\t
\n\n\t\t\n\n\n\n\t\n\t\n\t\n\t\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\n\t\n\n\n\n\n\n\n\n\t\t\t\n\n\n\n\n\n\n\n\n\n\t\t\t\n\n\n\n\t\n\t\n\n"} diff --git a/bench/data/origin/math_physicsforums_2.html b/bench/data/origin/math_physicsforums_2.html new file mode 100644 index 00000000..7ff4da4f --- /dev/null +++ b/bench/data/origin/math_physicsforums_2.html @@ -0,0 +1,5716 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Info - Latex Upgrade - Physics Forum Powered by MathJax v3 | Physics Forum + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+
+ + +
+ + +
+ + +

Info Latex Upgrade - Physics Forum Powered by MathJax v3

+ + +
+ + + +
+ + +
+ + +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ +
+ + +
+ + + +
+
+ + + chip + + + +
+
+
+
+

chip

+ +
+ + + +
+ +
Joined Oct 2019
+ + + + +
34 Posts | 39+
+ + +
Washington
+ +
+ +
+ +
+ +
+ + + +
+ +
+ + + + + + +
+ + + +
+ + + +
+ +
+ +
+ + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + +
+ +
The entire LaTeX rendering system has been upgraded to MathJax v3, and we have created a tool to see a preview render of your equations before posting them.
+
+

Insert Math Editor​

In the toolbar, there is an Math Editor button, to make it easy for writing your equations in LaTeX and seeing the rendering in real time!
+
+And then you can insert the math as either a Block or Inline.
+
+Screenshots below:
+
+LaTeX Math Editor
+
+LaTeX Math Equations for Physics
+ +
+ +
 
+ + + +
+ + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + +
    + +
  • Like
  • + +
+ + + +Reactions: + + + + + + + + + + + + + + + + + 2 users + + + + +
+ + + + + +
+ + + + + + +
+
+ + +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ + + + + + +
+ + + +
+ + + +
+ +
+ +
+ + + + + + + + + + + + + + +
+ + + +
+ + + + +
+ +

Writing Math Equations​

And when you want to write math equations directly in your post, you are not required to use the Insert Math button.
+
+Same as before, you can wrap your Latex equations with any of the following tags:
+
+

Block Math​

+ + + + +
+
+ Code: +
+
+
[MATH]      [/MATH]
+[LATEX]     [/LATEX]
+[TEX]       [/TEX]
+$$          $$
+
+

+

Inline Math​

+ + + + +
+
+ Code: +
+
+
[IMATH]     [/IMATH]
+[ILATEX]    [/ILATEX]
+[ITEX]      [/ITEX]
+##          ##
+
+
+ +
+ +
 
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + +
    + +
  • Like
  • + +
+ + + +Reactions: + + + + + + + + + + + + + + + + + 1 users + + + + +
+ + + + + +
+ +
+ + +
+ + + + + + +
+
+ + +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ + + + + + +
+
    + +
    Discussion Starter
    + + +
  • + +
  • + + + +
  • + + Last edited: + +
  • + + +
+ + +
+ + + +
+ +
+ + + Last edited: + + +
+ + + + + + + + + + + + + + +
+ + + +
+ + + + +
+ +
And some example Latex Equations, with the math expressions used for writing, to see it working...
+
+Newton's Second Law of Motion
+[math]\vec{F} = m\vec{a}[/math]
+
+ + \vec{F} = m\vec{a} + + +
+
+Gauss's Law for Electrcity
+[math]\nabla \cdot \vec{E} = \frac{\rho}{\varepsilon_0}[/math]
+
+ + \nabla \cdot \vec{E} = \frac{\rho}{\varepsilon_0} + + +
+
+Einstein's Field Equations of General Relativity
+[math]G_{\mu\nu} + \Lambda g_{\mu\nu} = \frac{8\pi G}{c^4} T_{\mu\nu}[/math]
+
+ + G_{\mu\nu} + \Lambda g_{\mu\nu} = \frac{8\pi G}{c^4} T_{\mu\nu} + + +
+
+The Dirac Equation
+[math](i\gamma^\mu \partial_\mu - m)\psi = 0[/math]
+
+ + (i\gamma^\mu \partial_\mu - m)\psi = 0 + + +
+
+The Schrödinger Equation in Quantum Mechanics (Time-Dependent Form)
+[math]i\hbar\frac{\partial}{\partial t}\Psi(\mathbf{r}, t) = \hat{H}\Psi(\mathbf{r}, t)[/math]
+
+ + i\hbar\frac{\partial}{\partial t}\Psi(\mathbf{r}, t) = \hat{H}\Psi(\mathbf{r}, t) + + +
+ +
+ +
 
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + +
    + +
  • Like
  • + +
+ + + +Reactions: + + + + + + + + + + + + + + + + + 2 users + + + + +
+ + + + + +
+ +
+ + +
+ + + + + + +
+
+ + +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ + + + + + +
+ + + +
+ + + +
+ +
+ +
+ + + + + + + + + + + + + + +
+ + + +
+ + + + +
+ +
Long Math Equations
+For very long equations, it's recommended to use line breaks appropriately. But if you don't add line breaks, and the equation is extremely long (or wider than the display you're using), a horizontal scrollbar will appear below the equation, to show that you can hover your pointer over the equation and scroll horizontally...
+
+For example, here is a very long equation without the align tags used in MathJax v3:
+
+ + + + + +
+
+ Code: +
+
+
[math]
+P(\text{16 out of 20}) = \frac{20!}{16! \times 4!} \times 0.85^{16} \times 0.15^{4} = 0.182122 \\
+P(\text{17 out of 20}) = \frac{20!}{17! \times 3!} \times 0.85^{17} \times 0.15^{3} = 0.242829 \\
+P(\text{18 out of 20}) = \frac{20!}{18! \times 2!} \times 0.85^{18} \times 0.15^{2} = 0.229338 \\
+P(\text{19 out of 20}) = \frac{20!}{19! \times 1!} \times 0.85^{19} \times 0.15^{1} = 0.136798 \\
+P(\text{20 out of 20}) = \frac{20!}{20! \times 0!} \times 0.85^{20} \times 0.15^{0} = 0.0387595
+[/math]
+
+

+And this is how the equation looks with the horizontal scrollbar:
+
+ + +P(\text{16 out of 20}) = \frac{20!}{16! \times 4!} \times 0.85^{16} \times 0.15^{4} = 0.182122 \\ +P(\text{17 out of 20}) = \frac{20!}{17! \times 3!} \times 0.85^{17} \times 0.15^{3} = 0.242829 \\ +P(\text{18 out of 20}) = \frac{20!}{18! \times 2!} \times 0.85^{18} \times 0.15^{2} = 0.229338 \\ +P(\text{19 out of 20}) = \frac{20!}{19! \times 1!} \times 0.85^{19} \times 0.15^{1} = 0.136798 \\ +P(\text{20 out of 20}) = \frac{20!}{20! \times 0!} \times 0.85^{20} \times 0.15^{0} = 0.0387595 + + + +
+
+The better way to write the exact same equation would be to add the align tags used in MathJax v3, to recognize the \\ as line breaks:
+
+ + + + + +
+
+ Code: +
+
+
[math]
+\begin{align*}
+P(\text{16 out of 20}) &= \frac{20!}{16! \times 4!} \times 0.85^{16} \times 0.15^{4} = 0.182122 \\
+P(\text{17 out of 20}) &= \frac{20!}{17! \times 3!} \times 0.85^{17} \times 0.15^{3} = 0.242829 \\
+P(\text{18 out of 20}) &= \frac{20!}{18! \times 2!} \times 0.85^{18} \times 0.15^{2} = 0.229338 \\
+P(\text{19 out of 20}) &= \frac{20!}{19! \times 1!} \times 0.85^{19} \times 0.15^{1} = 0.136798 \\
+P(\text{20 out of 20}) &= \frac{20!}{20! \times 0!} \times 0.85^{20} \times 0.15^{0} = 0.0387595
+\end{align*}
+[/math]
+
+

+And then it display in a more readable format, as seen here:
+
+ + +\begin{align*} +P(\text{16 out of 20}) &= \frac{20!}{16! \times 4!} \times 0.85^{16} \times 0.15^{4} = 0.182122 \\ +P(\text{17 out of 20}) &= \frac{20!}{17! \times 3!} \times 0.85^{17} \times 0.15^{3} = 0.242829 \\ +P(\text{18 out of 20}) &= \frac{20!}{18! \times 2!} \times 0.85^{18} \times 0.15^{2} = 0.229338 \\ +P(\text{19 out of 20}) &= \frac{20!}{19! \times 1!} \times 0.85^{19} \times 0.15^{1} = 0.136798 \\ +P(\text{20 out of 20}) &= \frac{20!}{20! \times 0!} \times 0.85^{20} \times 0.15^{0} = 0.0387595 +\end{align*} + + + +
+ +
+ +
 
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + +
    + +
  • Like
  • + +
+ + + +Reactions: + + + + + + + + + + + + + + + + + 2 users + + + + +
+ + + + + +
+ +
+ + +
+ + + + + + +
+
+ + +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ + + + + + +
+ + + +
+ + + +
+ +
+ +
+ + + + + + + + + + + + + + +
+ + + +
+ + + + +
+ +

Writing Physics Equations​

We have also installed a physics science package into MathJax, for physics notation and equation support.
+
+Here are a few physics-related examples:
+
+Derivatives
+ + + + + +
+
+ Code: +
+
+
[math]\frac{d}{dx} f(x) \quad \text{versus} \quad \dv{f}{x}[/math]
+
+

+ + \frac{d}{dx} f(x) \quad \text{versus} \quad \dv{f}{x} + + +
+
+Partial Derivatives
+ + + + + +
+
+ Code: +
+
+
[math]\frac{\partial}{\partial x} f(x,y) \quad \text{versus} \quad \pdv{f}{x}[/math]
+
+

+ + \frac{\partial}{\partial x} f(x,y) \quad \text{versus} \quad \pdv{f}{x} + + +
+
+Vectors
+ + + + + +
+
+ Code: +
+
+
[math]\vec{v} \quad \text{versus} \quad \vb{v} \quad \text{and} \quad \vec{v} \cdot \vec{w} \quad \text{versus} \quad \vb{v} \vdot \vb{w}[/math]
+
+

+ + \vec{v} \quad \text{versus} \quad \vb{v} \quad \text{and} \quad \vec{v} \cdot \vec{w} \quad \text{versus} \quad \vb{v} \vdot \vb{w} + + +
+
+Gradient, Divergence, Curl
+ + + + + +
+
+ Code: +
+
+
[math]\vec{\nabla} \phi \quad \text{versus} \quad \grad{\phi}[/math]
+[math]\vec{\nabla} \cdot \vec{v} \quad \text{versus} \quad \div{\vb{v}}[/math]
+[math]\vec{\nabla} \times \vec{v} \quad \text{versus} \quad \curl{\vb{v}}[/math]
+
+

+ + \vec{\nabla} \phi \quad \text{versus} \quad \grad{\phi} + + +
+ + \vec{\nabla} \cdot \vec{v} \quad \text{versus} \quad \div{\vb{v}} + + +
+ + \vec{\nabla} \times \vec{v} \quad \text{versus} \quad \curl{\vb{v}} + + +
+
+Bra-Ket Notation
+ + + + + +
+
+ Code: +
+
+
[math]\langle \psi | \phi \rangle \quad \text{versus} \quad \braket{\psi}{\phi}[/math]
+
+

+ + \langle \psi | \phi \rangle \quad \text{versus} \quad \braket{\psi}{\phi} + + +
+
+Commutators and Anticommutators
+ + + + + +
+
+ Code: +
+
+
[math][\hat{A}, \hat{B}] \quad \text{versus} \quad \comm{\hat{A}}{\hat{B}}[/math]
+[math]\{\hat{A}, \hat{B}\} \quad \text{versus} \quad \acomm{\hat{A}}{\hat{B}}[/math]
+
+

+ + [\hat{A}, \hat{B}] \quad \text{versus} \quad \comm{\hat{A}}{\hat{B}} + + +
+ + \{\hat{A}, \hat{B}\} \quad \text{versus} \quad \acomm{\hat{A}}{\hat{B}} + + +
+
+Matrices
+ + + + + +
+
+ Code: +
+
+
[math]
+\begin{pmatrix}
+a & b \\
+c & d
+\end{pmatrix} \quad \text{versus} \quad \mqty(a & b \\ c & d)
+[/math]
+
+

+ + +\begin{pmatrix} +a & b \\ +c & d +\end{pmatrix} \quad \text{versus} \quad \mqty(a & b \\ c & d) + + + +
+
+Dirac Notation (Ket, Bra, Operators)
+ + + + + +
+
+ Code: +
+
+
[math]|\psi\rangle \quad \text{versus} \quad \ket{\psi}[/math]
+[math]\langle\psi| \quad \text{versus} \quad \bra{\psi}[/math]
+[math]\hat{H}|\psi\rangle \quad \text{versus} \quad \op{H}{\psi}[/math]
+
+

+ + |\psi\rangle \quad \text{versus} \quad \ket{\psi} + + +
+ + \langle\psi| \quad \text{versus} \quad \bra{\psi} + + +
+ + \hat{H}|\psi\rangle \quad \text{versus} \quad \op{H}{\psi} + + +
+
+Quick Quadratic Equation
+ + + + + +
+
+ Code: +
+
+
[math]ax^2 + bx + c = 0 \quad \text{versus} \quad \qty(a x^2 + b x + c = 0)[/math]
+
+

+ + ax^2 + bx + c = 0 \quad \text{versus} \quad \qty(a x^2 + b x + c = 0) + + +
+ +
+ +
 
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + +
    + +
  • Like
  • + +
+ + + +Reactions: + + + + + + + + + + + + + + + + + 1 users + + + + +
+ + + + + +
+ +
+ + +
+ + + + + + +
+
+ + +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ + + + + + +
+ + + +
+ + + +
+ +
+ +
+ + + + + + + + + + + + + + +
+ + + +
+ + + + +
+ +
This is awesome!
+ +
+ +
 
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + +
    + +
  • Like
  • + +
+ + + +Reactions: + + + + + + + + + + + + + + + + + 2 users + + + + +
+ + + + + +
+ +
+ + +
+ + + + + + +
+
+ + +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ + + + + + +
+ + + +
+ + + +
+ +
+ +
+ + + + + + + + + + + + + + +
+ + + +
+ + + + +
+ +
That looks nice!
+ +
+ +
 
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + +
    + +
  • Like
  • + +
+ + + +Reactions: + + + + + + + + + + + + + + + + + 2 users + + + + +
+ + + + + +
+ +
+ + +
+ + + + + + +
+
+ + +
+ + +
+ +
+ +
+ + + + + + + + + + +
+
+ + +
+ + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/llm_web_kit/extractor/html/recognizer/cc_math/common.py b/llm_web_kit/extractor/html/recognizer/cc_math/common.py index af23378c..338fd9eb 100644 --- a/llm_web_kit/extractor/html/recognizer/cc_math/common.py +++ b/llm_web_kit/extractor/html/recognizer/cc_math/common.py @@ -235,6 +235,7 @@ def get_equation_type(self, html: str) -> List[Tuple[str, str]]: >>> get_equation_type("这是行间公式 $$y=mx+b$$ 测试") ('equation-interline', 'latex') """ + def check_delimiters(delims_list, s): for start, end in delims_list: escaped_start = re.escape(start) diff --git a/llm_web_kit/extractor/html/recognizer/cc_math/tag_mjx.py b/llm_web_kit/extractor/html/recognizer/cc_math/tag_mjx.py new file mode 100644 index 00000000..51679234 --- /dev/null +++ b/llm_web_kit/extractor/html/recognizer/cc_math/tag_mjx.py @@ -0,0 +1,51 @@ +from lxml.html import HtmlElement + +from llm_web_kit.extractor.html.recognizer.cc_math.common import (CCMATH, + CCTag, + MathType, + text_strip) +from llm_web_kit.libs.html_utils import build_cc_element, replace_element + + +# +# \vec{F} = m\vec{a} +# +def modify_tree(cm: CCMATH, math_render: str, o_html: str, node: HtmlElement): + """修改HTML树中的数学公式节点. + + Args: + cm: CCMATH实例 + math_render: 数学公式渲染器类型 + o_html: 原始HTML + node: 当前节点 + """ + # 处理mjx-container标签 + if node.tag == 'mjx-container': + display = node.get('display', 'false').lower() == 'true' + if display: + new_tag = CCTag.CC_MATH_INTERLINE + else: + new_tag = CCTag.CC_MATH_INLINE + + # 获取jax类型 + jax_type = node.get('jax', '') + if jax_type == 'CHTML': + math_type = MathType.LATEX + elif jax_type == 'AsciiMath': + math_type = MathType.ASCIIMATH + else: + math_type = MathType.LATEX # 先默认是latex + + # 查找formula标签 + formula = node.find('.//formula') + if formula is not None and formula.text: + new_span = build_cc_element( + html_tag_name=new_tag, + text=formula.text, + tail=text_strip(formula.tail), + type=math_type, + by=math_render, + html=o_html + ) + replace_element(formula, new_span) + return diff --git a/llm_web_kit/extractor/html/recognizer/ccmath.py b/llm_web_kit/extractor/html/recognizer/ccmath.py index cef8357f..783d087a 100644 --- a/llm_web_kit/extractor/html/recognizer/ccmath.py +++ b/llm_web_kit/extractor/html/recognizer/ccmath.py @@ -7,7 +7,7 @@ from llm_web_kit.extractor.html.recognizer.cc_math import (tag_asciimath, tag_common_modify, tag_img, tag_math, - tag_script) + tag_mjx, tag_script) from llm_web_kit.extractor.html.recognizer.cc_math.common import CCMATH from llm_web_kit.extractor.html.recognizer.recognizer import ( BaseHTMLElementRecognizer, CCTag) @@ -143,8 +143,8 @@ def process_ccmath_html(self, cc_html: str, o_html: str, math_render: str, base_ tag_asciimath.modify_tree(self.cm, math_render, original_html, node, parent) # Remove any .MathJax_Preview spans - if node.tag == 'span' and node.get('class') and 'MathJax_Preview' in node.get('class'): - pass + if node.tag == 'mjx-container': + tag_mjx.modify_tree(self.cm, math_render, original_html, node) # img中的latex if node.tag == 'img': diff --git a/tests/llm_web_kit/extractor/html/recognizer/assets/ccmath/math_physicsforums_2.html b/tests/llm_web_kit/extractor/html/recognizer/assets/ccmath/math_physicsforums_2.html new file mode 100644 index 00000000..7ff4da4f --- /dev/null +++ b/tests/llm_web_kit/extractor/html/recognizer/assets/ccmath/math_physicsforums_2.html @@ -0,0 +1,5716 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Info - Latex Upgrade - Physics Forum Powered by MathJax v3 | Physics Forum + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+
+ + +
+ + +
+ + +

Info Latex Upgrade - Physics Forum Powered by MathJax v3

+ + +
+ + + +
+ + +
+ + +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ +
+ + +
+ + + +
+
+ + + chip + + + +
+
+
+
+

chip

+ +
+ + + +
+ +
Joined Oct 2019
+ + + + +
34 Posts | 39+
+ + +
Washington
+ +
+ +
+ +
+ +
+ + + +
+ +
+ + + + + + +
+ + + +
+ + + +
+ +
+ +
+ + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + +
+ +
The entire LaTeX rendering system has been upgraded to MathJax v3, and we have created a tool to see a preview render of your equations before posting them.
+
+

Insert Math Editor​

In the toolbar, there is an Math Editor button, to make it easy for writing your equations in LaTeX and seeing the rendering in real time!
+
+And then you can insert the math as either a Block or Inline.
+
+Screenshots below:
+
+LaTeX Math Editor
+
+LaTeX Math Equations for Physics
+ +
+ +
 
+ + + +
+ + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + +
    + +
  • Like
  • + +
+ + + +Reactions: + + + + + + + + + + + + + + + + + 2 users + + + + +
+ + + + + +
+ + + + + + +
+
+ + +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ + + + + + +
+ + + +
+ + + +
+ +
+ +
+ + + + + + + + + + + + + + +
+ + + +
+ + + + +
+ +

Writing Math Equations​

And when you want to write math equations directly in your post, you are not required to use the Insert Math button.
+
+Same as before, you can wrap your Latex equations with any of the following tags:
+
+

Block Math​

+ + + + +
+
+ Code: +
+
+
[MATH]      [/MATH]
+[LATEX]     [/LATEX]
+[TEX]       [/TEX]
+$$          $$
+
+

+

Inline Math​

+ + + + +
+
+ Code: +
+
+
[IMATH]     [/IMATH]
+[ILATEX]    [/ILATEX]
+[ITEX]      [/ITEX]
+##          ##
+
+
+ +
+ +
 
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + +
    + +
  • Like
  • + +
+ + + +Reactions: + + + + + + + + + + + + + + + + + 1 users + + + + +
+ + + + + +
+ +
+ + +
+ + + + + + +
+
+ + +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ + + + + + +
+
    + +
    Discussion Starter
    + + +
  • + +
  • + + + +
  • + + Last edited: + +
  • + + +
+ + +
+ + + +
+ +
+ + + Last edited: + + +
+ + + + + + + + + + + + + + +
+ + + +
+ + + + +
+ +
And some example Latex Equations, with the math expressions used for writing, to see it working...
+
+Newton's Second Law of Motion
+[math]\vec{F} = m\vec{a}[/math]
+
+ + \vec{F} = m\vec{a} + + +
+
+Gauss's Law for Electrcity
+[math]\nabla \cdot \vec{E} = \frac{\rho}{\varepsilon_0}[/math]
+
+ + \nabla \cdot \vec{E} = \frac{\rho}{\varepsilon_0} + + +
+
+Einstein's Field Equations of General Relativity
+[math]G_{\mu\nu} + \Lambda g_{\mu\nu} = \frac{8\pi G}{c^4} T_{\mu\nu}[/math]
+
+ + G_{\mu\nu} + \Lambda g_{\mu\nu} = \frac{8\pi G}{c^4} T_{\mu\nu} + + +
+
+The Dirac Equation
+[math](i\gamma^\mu \partial_\mu - m)\psi = 0[/math]
+
+ + (i\gamma^\mu \partial_\mu - m)\psi = 0 + + +
+
+The Schrödinger Equation in Quantum Mechanics (Time-Dependent Form)
+[math]i\hbar\frac{\partial}{\partial t}\Psi(\mathbf{r}, t) = \hat{H}\Psi(\mathbf{r}, t)[/math]
+
+ + i\hbar\frac{\partial}{\partial t}\Psi(\mathbf{r}, t) = \hat{H}\Psi(\mathbf{r}, t) + + +
+ +
+ +
 
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + +
    + +
  • Like
  • + +
+ + + +Reactions: + + + + + + + + + + + + + + + + + 2 users + + + + +
+ + + + + +
+ +
+ + +
+ + + + + + +
+
+ + +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ + + + + + +
+ + + +
+ + + +
+ +
+ +
+ + + + + + + + + + + + + + +
+ + + +
+ + + + +
+ +
Long Math Equations
+For very long equations, it's recommended to use line breaks appropriately. But if you don't add line breaks, and the equation is extremely long (or wider than the display you're using), a horizontal scrollbar will appear below the equation, to show that you can hover your pointer over the equation and scroll horizontally...
+
+For example, here is a very long equation without the align tags used in MathJax v3:
+
+ + + + + +
+
+ Code: +
+
+
[math]
+P(\text{16 out of 20}) = \frac{20!}{16! \times 4!} \times 0.85^{16} \times 0.15^{4} = 0.182122 \\
+P(\text{17 out of 20}) = \frac{20!}{17! \times 3!} \times 0.85^{17} \times 0.15^{3} = 0.242829 \\
+P(\text{18 out of 20}) = \frac{20!}{18! \times 2!} \times 0.85^{18} \times 0.15^{2} = 0.229338 \\
+P(\text{19 out of 20}) = \frac{20!}{19! \times 1!} \times 0.85^{19} \times 0.15^{1} = 0.136798 \\
+P(\text{20 out of 20}) = \frac{20!}{20! \times 0!} \times 0.85^{20} \times 0.15^{0} = 0.0387595
+[/math]
+
+

+And this is how the equation looks with the horizontal scrollbar:
+
+ + +P(\text{16 out of 20}) = \frac{20!}{16! \times 4!} \times 0.85^{16} \times 0.15^{4} = 0.182122 \\ +P(\text{17 out of 20}) = \frac{20!}{17! \times 3!} \times 0.85^{17} \times 0.15^{3} = 0.242829 \\ +P(\text{18 out of 20}) = \frac{20!}{18! \times 2!} \times 0.85^{18} \times 0.15^{2} = 0.229338 \\ +P(\text{19 out of 20}) = \frac{20!}{19! \times 1!} \times 0.85^{19} \times 0.15^{1} = 0.136798 \\ +P(\text{20 out of 20}) = \frac{20!}{20! \times 0!} \times 0.85^{20} \times 0.15^{0} = 0.0387595 + + + +
+
+The better way to write the exact same equation would be to add the align tags used in MathJax v3, to recognize the \\ as line breaks:
+
+ + + + + +
+
+ Code: +
+
+
[math]
+\begin{align*}
+P(\text{16 out of 20}) &= \frac{20!}{16! \times 4!} \times 0.85^{16} \times 0.15^{4} = 0.182122 \\
+P(\text{17 out of 20}) &= \frac{20!}{17! \times 3!} \times 0.85^{17} \times 0.15^{3} = 0.242829 \\
+P(\text{18 out of 20}) &= \frac{20!}{18! \times 2!} \times 0.85^{18} \times 0.15^{2} = 0.229338 \\
+P(\text{19 out of 20}) &= \frac{20!}{19! \times 1!} \times 0.85^{19} \times 0.15^{1} = 0.136798 \\
+P(\text{20 out of 20}) &= \frac{20!}{20! \times 0!} \times 0.85^{20} \times 0.15^{0} = 0.0387595
+\end{align*}
+[/math]
+
+

+And then it display in a more readable format, as seen here:
+
+ + +\begin{align*} +P(\text{16 out of 20}) &= \frac{20!}{16! \times 4!} \times 0.85^{16} \times 0.15^{4} = 0.182122 \\ +P(\text{17 out of 20}) &= \frac{20!}{17! \times 3!} \times 0.85^{17} \times 0.15^{3} = 0.242829 \\ +P(\text{18 out of 20}) &= \frac{20!}{18! \times 2!} \times 0.85^{18} \times 0.15^{2} = 0.229338 \\ +P(\text{19 out of 20}) &= \frac{20!}{19! \times 1!} \times 0.85^{19} \times 0.15^{1} = 0.136798 \\ +P(\text{20 out of 20}) &= \frac{20!}{20! \times 0!} \times 0.85^{20} \times 0.15^{0} = 0.0387595 +\end{align*} + + + +
+ +
+ +
 
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + +
    + +
  • Like
  • + +
+ + + +Reactions: + + + + + + + + + + + + + + + + + 2 users + + + + +
+ + + + + +
+ +
+ + +
+ + + + + + +
+
+ + +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ + + + + + +
+ + + +
+ + + +
+ +
+ +
+ + + + + + + + + + + + + + +
+ + + +
+ + + + +
+ +

Writing Physics Equations​

We have also installed a physics science package into MathJax, for physics notation and equation support.
+
+Here are a few physics-related examples:
+
+Derivatives
+ + + + + +
+
+ Code: +
+
+
[math]\frac{d}{dx} f(x) \quad \text{versus} \quad \dv{f}{x}[/math]
+
+

+ + \frac{d}{dx} f(x) \quad \text{versus} \quad \dv{f}{x} + + +
+
+Partial Derivatives
+ + + + + +
+
+ Code: +
+
+
[math]\frac{\partial}{\partial x} f(x,y) \quad \text{versus} \quad \pdv{f}{x}[/math]
+
+

+ + \frac{\partial}{\partial x} f(x,y) \quad \text{versus} \quad \pdv{f}{x} + + +
+
+Vectors
+ + + + + +
+
+ Code: +
+
+
[math]\vec{v} \quad \text{versus} \quad \vb{v} \quad \text{and} \quad \vec{v} \cdot \vec{w} \quad \text{versus} \quad \vb{v} \vdot \vb{w}[/math]
+
+

+ + \vec{v} \quad \text{versus} \quad \vb{v} \quad \text{and} \quad \vec{v} \cdot \vec{w} \quad \text{versus} \quad \vb{v} \vdot \vb{w} + + +
+
+Gradient, Divergence, Curl
+ + + + + +
+
+ Code: +
+
+
[math]\vec{\nabla} \phi \quad \text{versus} \quad \grad{\phi}[/math]
+[math]\vec{\nabla} \cdot \vec{v} \quad \text{versus} \quad \div{\vb{v}}[/math]
+[math]\vec{\nabla} \times \vec{v} \quad \text{versus} \quad \curl{\vb{v}}[/math]
+
+

+ + \vec{\nabla} \phi \quad \text{versus} \quad \grad{\phi} + + +
+ + \vec{\nabla} \cdot \vec{v} \quad \text{versus} \quad \div{\vb{v}} + + +
+ + \vec{\nabla} \times \vec{v} \quad \text{versus} \quad \curl{\vb{v}} + + +
+
+Bra-Ket Notation
+ + + + + +
+
+ Code: +
+
+
[math]\langle \psi | \phi \rangle \quad \text{versus} \quad \braket{\psi}{\phi}[/math]
+
+

+ + \langle \psi | \phi \rangle \quad \text{versus} \quad \braket{\psi}{\phi} + + +
+
+Commutators and Anticommutators
+ + + + + +
+
+ Code: +
+
+
[math][\hat{A}, \hat{B}] \quad \text{versus} \quad \comm{\hat{A}}{\hat{B}}[/math]
+[math]\{\hat{A}, \hat{B}\} \quad \text{versus} \quad \acomm{\hat{A}}{\hat{B}}[/math]
+
+

+ + [\hat{A}, \hat{B}] \quad \text{versus} \quad \comm{\hat{A}}{\hat{B}} + + +
+ + \{\hat{A}, \hat{B}\} \quad \text{versus} \quad \acomm{\hat{A}}{\hat{B}} + + +
+
+Matrices
+ + + + + +
+
+ Code: +
+
+
[math]
+\begin{pmatrix}
+a & b \\
+c & d
+\end{pmatrix} \quad \text{versus} \quad \mqty(a & b \\ c & d)
+[/math]
+
+

+ + +\begin{pmatrix} +a & b \\ +c & d +\end{pmatrix} \quad \text{versus} \quad \mqty(a & b \\ c & d) + + + +
+
+Dirac Notation (Ket, Bra, Operators)
+ + + + + +
+
+ Code: +
+
+
[math]|\psi\rangle \quad \text{versus} \quad \ket{\psi}[/math]
+[math]\langle\psi| \quad \text{versus} \quad \bra{\psi}[/math]
+[math]\hat{H}|\psi\rangle \quad \text{versus} \quad \op{H}{\psi}[/math]
+
+

+ + |\psi\rangle \quad \text{versus} \quad \ket{\psi} + + +
+ + \langle\psi| \quad \text{versus} \quad \bra{\psi} + + +
+ + \hat{H}|\psi\rangle \quad \text{versus} \quad \op{H}{\psi} + + +
+
+Quick Quadratic Equation
+ + + + + +
+
+ Code: +
+
+
[math]ax^2 + bx + c = 0 \quad \text{versus} \quad \qty(a x^2 + b x + c = 0)[/math]
+
+

+ + ax^2 + bx + c = 0 \quad \text{versus} \quad \qty(a x^2 + b x + c = 0) + + +
+ +
+ +
 
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + +
    + +
  • Like
  • + +
+ + + +Reactions: + + + + + + + + + + + + + + + + + 1 users + + + + +
+ + + + + +
+ +
+ + +
+ + + + + + +
+
+ + +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ + + + + + +
+ + + +
+ + + +
+ +
+ +
+ + + + + + + + + + + + + + +
+ + + +
+ + + + +
+ +
This is awesome!
+ +
+ +
 
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + +
    + +
  • Like
  • + +
+ + + +Reactions: + + + + + + + + + + + + + + + + + 2 users + + + + +
+ + + + + +
+ +
+ + +
+ + + + + + +
+
+ + +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ + + + + + +
+ + + +
+ + + +
+ +
+ +
+ + + + + + + + + + + + + + +
+ + + +
+ + + + +
+ +
That looks nice!
+ +
+ +
 
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + +
    + +
  • Like
  • + +
+ + + +Reactions: + + + + + + + + + + + + + + + + + 2 users + + + + +
+ + + + + +
+ +
+ + +
+ + + + + + +
+
+ + +
+ + +
+ +
+ +
+ + + + + + + + + + +
+
+ + +
+ + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/llm_web_kit/extractor/html/recognizer/assets/ccmath/math_physicsforums_2_1.html b/tests/llm_web_kit/extractor/html/recognizer/assets/ccmath/math_physicsforums_2_1.html new file mode 100644 index 00000000..c9790f6a --- /dev/null +++ b/tests/llm_web_kit/extractor/html/recognizer/assets/ccmath/math_physicsforums_2_1.html @@ -0,0 +1,21 @@ +\vec{F} = m\vec{a} +\nabla \cdot \vec{E} = \frac{\rho}{\varepsilon_0} +G_{\mu\nu} + \Lambda g_{\mu\nu} = \frac{8\pi G}{c^4} T_{\mu\nu} +(i\gamma^\mu \partial_\mu - m)\psi = 0 +i\hbar\frac{\partial}{\partial t}\Psi(\mathbf{r}, t) = \hat{H}\Psi(\mathbf{r}, t) +P(\text{16 out of 20}) = \frac{20!}{16! \times 4!} \times 0.85^{16} \times 0.15^{4} = 0.182122 \\P(\text{17 out of 20}) = \frac{20!}{17! \times 3!} \times 0.85^{17} \times 0.15^{3} = 0.242829 \\P(\text{18 out of 20}) = \frac{20!}{18! \times 2!} \times 0.85^{18} \times 0.15^{2} = 0.229338 \\P(\text{19 out of 20}) = \frac{20!}{19! \times 1!} \times 0.85^{19} \times 0.15^{1} = 0.136798 \\P(\text{20 out of 20}) = \frac{20!}{20! \times 0!} \times 0.85^{20} \times 0.15^{0} = 0.0387595 +\begin{align*}P(\text{16 out of 20}) &= \frac{20!}{16! \times 4!} \times 0.85^{16} \times 0.15^{4} = 0.182122 \\P(\text{17 out of 20}) &= \frac{20!}{17! \times 3!} \times 0.85^{17} \times 0.15^{3} = 0.242829 \\P(\text{18 out of 20}) &= \frac{20!}{18! \times 2!} \times 0.85^{18} \times 0.15^{2} = 0.229338 \\P(\text{19 out of 20}) &= \frac{20!}{19! \times 1!} \times 0.85^{19} \times 0.15^{1} = 0.136798 \\P(\text{20 out of 20}) &= \frac{20!}{20! \times 0!} \times 0.85^{20} \times 0.15^{0} = 0.0387595\end{align*} +\frac{d}{dx} f(x) \quad \text{versus} \quad \dv{f}{x} +\frac{\partial}{\partial x} f(x,y) \quad \text{versus} \quad \pdv{f}{x} +\vec{v} \quad \text{versus} \quad \vb{v} \quad \text{and} \quad \vec{v} \cdot \vec{w} \quad \text{versus} \quad \vb{v} \vdot \vb{w} +\vec{\nabla} \phi \quad \text{versus} \quad \grad{\phi} +\vec{\nabla} \cdot \vec{v} \quad \text{versus} \quad \div{\vb{v}} +\vec{\nabla} \times \vec{v} \quad \text{versus} \quad \curl{\vb{v}} +\langle \psi | \phi \rangle \quad \text{versus} \quad \braket{\psi}{\phi} +[\hat{A}, \hat{B}] \quad \text{versus} \quad \comm{\hat{A}}{\hat{B}} +\{\hat{A}, \hat{B}\} \quad \text{versus} \quad \acomm{\hat{A}}{\hat{B}} +\begin{pmatrix}a & b \\c & d\end{pmatrix} \quad \text{versus} \quad \mqty(a & b \\ c & d) +|\psi\rangle \quad \text{versus} \quad \ket{\psi} +\langle\psi| \quad \text{versus} \quad \bra{\psi} +\hat{H}|\psi\rangle \quad \text{versus} \quad \op{H}{\psi} +ax^2 + bx + c = 0 \quad \text{versus} \quad \qty(a x^2 + b x + c = 0) diff --git a/tests/llm_web_kit/extractor/html/recognizer/test_math.py b/tests/llm_web_kit/extractor/html/recognizer/test_math.py index d89b1bf8..e491fe25 100644 --- a/tests/llm_web_kit/extractor/html/recognizer/test_math.py +++ b/tests/llm_web_kit/extractor/html/recognizer/test_math.py @@ -185,6 +185,13 @@ 'base_url': 'https://mathjax.github.io/MathJax-demos-web/tex-chtml.html', 'expected': 'assets/ccmath/mathjax-mml-chtml_prefix_1.html' }, + { + 'input': [ + 'assets/ccmath/math_physicsforums_2.html', + ], + 'base_url': 'https://physicshelpforum.com/t/latex-upgrade-physics-forum-powered-by-mathjax-v3.17489/', + 'expected': 'assets/ccmath/math_physicsforums_2_1.html' + } ] TEST_EQUATION_TYPE = [ @@ -415,6 +422,7 @@ def test_math_recognizer_html(self): # print('answer::::::::', answer) # answers.append(answer) self.assertEqual(expect, answer) + # print('answers::::::::', answers) # self.write_to_html(answers, test_case['input'][0]) # 检查行内公式抽取正确性 if test_case.get('expected_inline', None): @@ -509,7 +517,7 @@ def test_mml_to_latex(self): if __name__ == '__main__': r = TestMathRecognizer() r.setUp() - r.test_math_recognizer() + # r.test_math_recognizer() r.test_math_recognizer_html() # r.test_math_recognizer() # r.test_to_content_list_node() From dbbec2ee7e0938209380ab8d21f41383624b1b9e Mon Sep 17 00:00:00 2001 From: chupei Date: Tue, 18 Mar 2025 20:35:32 +0800 Subject: [PATCH 3/4] x --- llm_web_kit/extractor/html/recognizer/cc_math/common.py | 8 ++++---- llm_web_kit/extractor/html/recognizer/ccmath.py | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/llm_web_kit/extractor/html/recognizer/cc_math/common.py b/llm_web_kit/extractor/html/recognizer/cc_math/common.py index 338fd9eb..8f7692bc 100644 --- a/llm_web_kit/extractor/html/recognizer/cc_math/common.py +++ b/llm_web_kit/extractor/html/recognizer/cc_math/common.py @@ -92,10 +92,10 @@ class MATH_TYPE_PATTERN: ['\\[', '\\]'], ['$$', '$$'], ['[tex]', '[/tex]'], # 这个网站自定义的分割,https://www.physicsforums.com/threads/turning-to-a-single-logarithm-then-simply.269419/ - # ['\\begin{equation}', '\\end{equation}'], - # ['\\begin{align}', '\\end{align}'], - # ['\\begin{alignat}', '\\end{alignat}'], - # ['\\begin{array}', '\\end{array}'], + ['\\begin{equation}', '\\end{equation}'], + ['\\begin{align}', '\\end{align}'], + ['\\begin{alignat}', '\\end{alignat}'], + ['\\begin{array}', '\\end{array}'], # 添加通用的begin/end匹配 ['\\begin{.*?}', '\\end{.*?}'], ], diff --git a/llm_web_kit/extractor/html/recognizer/ccmath.py b/llm_web_kit/extractor/html/recognizer/ccmath.py index 783d087a..778a27ee 100644 --- a/llm_web_kit/extractor/html/recognizer/ccmath.py +++ b/llm_web_kit/extractor/html/recognizer/ccmath.py @@ -142,7 +142,6 @@ def process_ccmath_html(self, cc_html: str, o_html: str, math_render: str, base_ if node.tag in ('p','div') and node.text and '`' in node.text: tag_asciimath.modify_tree(self.cm, math_render, original_html, node, parent) - # Remove any .MathJax_Preview spans if node.tag == 'mjx-container': tag_mjx.modify_tree(self.cm, math_render, original_html, node) From fbaf49711affc4736c80ed266aa9e2b3b33f16dd Mon Sep 17 00:00:00 2001 From: chupei Date: Tue, 18 Mar 2025 20:49:51 +0800 Subject: [PATCH 4/4] x --- .../html/recognizer/assets/ccmath/math_physicsforums_2.html | 2 +- .../html/recognizer/assets/ccmath/math_physicsforums_2_1.html | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/llm_web_kit/extractor/html/recognizer/assets/ccmath/math_physicsforums_2.html b/tests/llm_web_kit/extractor/html/recognizer/assets/ccmath/math_physicsforums_2.html index 7ff4da4f..6ce7c59c 100644 --- a/tests/llm_web_kit/extractor/html/recognizer/assets/ccmath/math_physicsforums_2.html +++ b/tests/llm_web_kit/extractor/html/recognizer/assets/ccmath/math_physicsforums_2.html @@ -3908,7 +3908,7 @@

[math]ax^2 + bx + c = 0 \quad \text{versus} \quad \qty(a x^2 + b x + c = 0)[/math]
- + ax^2 + bx + c = 0 \quad \text{versus} \quad \qty(a x^2 + b x + c = 0) diff --git a/tests/llm_web_kit/extractor/html/recognizer/assets/ccmath/math_physicsforums_2_1.html b/tests/llm_web_kit/extractor/html/recognizer/assets/ccmath/math_physicsforums_2_1.html index c9790f6a..b124687d 100644 --- a/tests/llm_web_kit/extractor/html/recognizer/assets/ccmath/math_physicsforums_2_1.html +++ b/tests/llm_web_kit/extractor/html/recognizer/assets/ccmath/math_physicsforums_2_1.html @@ -18,4 +18,3 @@ |\psi\rangle \quad \text{versus} \quad \ket{\psi} \langle\psi| \quad \text{versus} \quad \bra{\psi} \hat{H}|\psi\rangle \quad \text{versus} \quad \op{H}{\psi} -ax^2 + bx + c = 0 \quad \text{versus} \quad \qty(a x^2 + b x + c = 0)