What is LaTex?
Latex is a programming language used for technical and scientific documents. It can also be used to easily create formulas and equations in Pressbooks. Each character has its own code, and there are functions for common formatting as well. By combining these character and formatting codes, you can create any formula or equation.
Inserting LaTeX equations into Pressbooks uses shortcodes. To write an equation in the visual editor you need to wrap it in the LaTeX shortcode shown below.
[latex]your formula here[/latex].
MathJax is automatically turned on and ready to render whatever you write between these shortcodes into clean and readable mathematical expressions. You won’t see it on the list of plugins because it is the default behaviour for Pressbooks. It can only be overridden if you turn on WP QuickLaTex. MatJax is a JavaSript display engine for mathematics that works in all browsers and display equations in accessible format.
We recommend using MathJax, as it has far superior accessibility features to QuickLaTeX. Some of the advanced accessibility features include the ability to collapse math, explore it in detail, and zoom in to a custom level.
Here are some examples of special character codes and formatting options using MathJax
All of the special characters can be created by adding a prefix backslash.
Command | Character |
[latex]\%[/latex]
|
[latex]\%[/latex] |
[latex]\pi[/latex]
|
[latex]\pi[/latex] |
[latex]\alpha[/latex]
|
[latex]\alpha[/latex] |
[latex]\sin[/latex]
|
[latex]\sin[/latex] |
[latex]\leq[/latex]
|
[latex]\leq[/latex] |
[latex]\_[/latex]
|
[latex]\_[/latex] |
Formatting Options | Output |
[latex]\sqrt{xyz}[/latex] |
[latex]\sqrt{xyz}[/latex] |
[latex]\frac{x}{yz}[/latex] |
[latex]\frac{x}{yz}[/latex] |
[latex]\overrightarrow{y}[/latex] |
[latex]\overrightarrow{y}[/latex] |
[latex]\sum{x}[/latex] |
[latex]\sum{x}[/latex] |
[latex]\int_{a}^{b} x^2 dx[/latex] |
[latex]\int_{a}^{b} x^2 dx[/latex] |
[latex]\lim_{x \to 0} f(x)=0[/latex] |
[latex]\lim_{x \to 0} f(x)=0[/latex] |
If you are creating your formula from scratch, you can use a guide/list of commonly used LaTeX symbols and formats HERE.
Quick LaTex (not used in this presentation)
QuickLaTeX is a plugin that allows users to publish formulas and graphics using native LaTeX syntax directly in the text. Inline formulas, displayed equations auto-numbering, labeling and referencing.
To enable the QuickLaTeX plugin:
- Go to your book’s dashboard
- Click the Plugins tab on the left-hand menu of your screen
- Scroll to WP QuickLaTeX
- Click Activate