Info - Latex Upgrade - Physics Forum Powered by MathJax v3 | Physics Forum
Description: 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...

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.

# Info Latex Upgrade - Physics Forum Powered by MathJax v3

- Thread starter chip
- Start date Mar 24, 2024

#### chip

Joined Oct 2019
34 Posts | 39+
Washington

Discussion Starter
- Mar 24, 2024

- #1

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:

Reactions: 2 users

#### chip

Joined Oct 2019
34 Posts | 39+
Washington

Discussion Starter
- Mar 24, 2024

- #2

### 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]
    ##          ##

Reactions: 1 users

#### chip

Joined Oct 2019
34 Posts | 39+
Washington

Discussion Starter
- Mar 24, 2024
- Last edited: Mar 25, 2024

- #3

Last edited: Mar 25, 2024
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)

Reactions: 2 users

#### chip

Joined Oct 2019
34 Posts | 39+
Washington

Discussion Starter
- Mar 25, 2024

- #4

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*}

Reactions: 2 users

#### chip

Joined Oct 2019
34 Posts | 39+
Washington

Discussion Starter
- Mar 25, 2024

- #5

### 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)

Reactions: 1 users

#### benit13

Joined Oct 2017
1K Posts | 768+
Glasgow

- Mar 27, 2024

- #6

This is awesome!

Reactions: 2 users
K

#### kiwiheretic

Joined Nov 2013
852 Posts | 104+
New Zealand

- Mar 27, 2024

- #7

That looks nice!

Reactions: 2 users
Login or Register / Reply