SmarterEd

Aussie Maths & Science Teachers: Save your time with SmarterEd

  • Login
  • Get Help
  • About

Mathjax latex/tex like alternative to asciimath with chemistry physics and tables example

Asciimath uses backticks for inline maths, e.g. `x^2`

Latex/tex can be used now also e.g. \(x^2\), and instead of backticks, uses:

  • A backslash and left round bracket to start, and a backslack and right round bracket to end for inline "small" formula such as \(f_k = f(x_k),\: x_k = x^*+kh,\: k=-\frac{N-1}{2},\dots,\frac{N-1}{2}\)
  • Two dollar signs to start, and two to end, for "display" or "large" formula which always display on their own line such as below:

$$f_k = f(x_k),\: x_k = x^*+kh,\: k=-\frac{N-1}{2},\dots,\frac{N-1}{2}$$

 

For us, latex/tex works like a superset of asciimath.  For example, with the extra capabilities (via ams [which includes alignment] and mathtools [which includes special math symbols, arrow, etc.] with further mathtools detail here) that latex/tex gives us, we can auto-align the equals signs in equations with the following (note for these special items, the begin/end elements are sufficient to indicate math formula):

\begin{align}
3x-1 &= -10 \\
3x &= -9 \\
x &= -3
\end{align}

Or use simple array formatting with a single indent, such as:

\begin{array}{cc}
a & b \\
c & c
\end{array}

Two more examples of inline (small) and display (large) are the following:

\(\int_0^\infty \frac{x^3}{e^x-1}\,dx = \frac{\pi^4}{15}\)

$$\int_0^\infty \frac{x^3}{e^x-1}\,dx = \frac{\pi^4}{15}$$

 

We can also insert chemistry formula via the mhchem extension such as:

Example 1: \(\ce{C6H5-CHO}\)

Example 2: \(\ce{$A$ ->[\ce{+H2O}] $B$}\)

Example 3: \(\ce{SO4^2- + Ba^2+ -> BaSO4 v}\)

Example 4: \(\ce{Zn^2+ <=>[+ 2OH-][+ 2H+] $\underset{\text{amphoteres Hydroxid}}{\ce{Zn(OH)2 v}}$ <=>[+ 2OH-][+ 2H+] $\underset{\text{Hydroxozikat}}{\ce{[Zn(OH)4]^2-}}$}\)

 

And physics capabilities/special symbols via another extension such as:

\( -{1\over2}\nabla^2\psi({\bf x})+V(r)\psi({\bf x})=E\psi({\bf x}) \)

 

You can also mix and match all these elements such as formula alignment (see https://teacher.smartermaths.com.au/tables-built-with-mathjax-array/ for further detail) from the ams package with chemistry:

\begin{align}
\ce{C6H5-CHO} &= \ce{C6H5-CHO} \\
 &= \ce{C6H5-CHO}
\end{align}

Note: There are also extensions for physics and many other topics: please see tex/latex extensions

Show Answers Only

\(\ce{C6H5-CHO}\)

Show Worked Solution

\begin{align}
\ce{C6H5-CHO} &= \ce{C6H5-CHO} \\
 &= \ce{C6H5-CHO}
\end{align}

 

 

Filed Under: Docs

Copyright © 2014–2025 SmarterEd.com.au · Log in