Math and Science Formulas Using LaTeX

Pressbooks supports LaTeX code, a typesetting language that is often used to format complex science and math equations, using MathJax built into the software.

How to Add LaTeX Equations

LaTeX can be added using the LaTeX option in the visual text editor when editing a chapter or section, or by writing out shortcodes as shown.

Note: The LaTeX shortcodes below are coloured to show examples. Actual formulas and shortcodes have to be the same color and style.

  • [la​tex]latex code here[/lat​ex]
  • $latex latex code here$

Example 1:

[latex]\left(1+x\right)^n=1+\frac{nx}{1!}+\frac{n\left(n-1\right)x^2}{2!}+\ldots[/latex]

[latex]\left(1+x\right)^n=1+\frac{nx}{1!}+\frac{n\left(n-1\right)x^2}{2!}+\ldots[/latex]

Example 2:

$latex \left(1+x\right)^n=1+\frac{nx}{1!}+\frac{n\left(n-1\right)x^2}{2!}+\ldots$

[latex]\left(1+x\right)^n=1+\frac{nx}{1!}+\frac{n\left(n-1\right)x^2}{2!}+\ldots[/latex]

Using LaTeX syntax in H5P elements

If you would like to use LaTeX in H5P elements, email us at digitalscholarship@macewan.ca and we will activate this option for you.

You can draft equations inside of H5P elements in Pressbooks with MathJax LaTeX.

For H5P elements, use these LaTeX shortcodes:

  • \(some LaTeX\)
  • $$some LaTeX$$
  • \[some LaTeX\] 

Additional Resources

Content adapted from “Math and Science Formulas Using LaTeX” from the B.C. Open Textbook Authoring Guide (archived version) by Lauri Aesoph and Amanda Coolidge, and from the SPSCC Pressbooks Tutorial on MathJax by Alaka Pradhan, each licensed under a Creative Commons Attribution 4.0 International License,

License

Icon for the Creative Commons Attribution 4.0 International License

MacEwan Open Textbook Authoring Guide Copyright © 2019 by MacEwan University Library is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.

Share This Book