QP QuickLaTeX Plugin
QuickLaTeX
QuickLaTeX is a plugin that allows users to write native LaTeX syntax directly into their books without wrapping shortcodes around every part of every equation. Its is a free service that looks at LaTeX code and creates an image to represent it. With this plug-in, any LaTeX written in Pressbooks on a page set to read LaTeX is automatically sent to QuickLaTeX.com. QuickLaTeX can be used as an optional replacement for MathJax within individual books on other networks.
Activating QuickLaTeX
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
Once you’ve enabled the QuickLaTeX plugin, you can format equations with any of the following syntaxes:
- $ … $
- [ … ]
- ( … )
- $ $ … $ $
- Environments: equation, align, displaymath, eqnarray, multline, flalign, gather, and alignat
The QuickLaTeX plugin also supports TikZ graphics and other commands that may not be supported using regular LaTeX. For more information about commands and notation in LaTeX, see Brown University’s LaTeX guide.
There are three ways to render equations with the QuickLaTeX plugin. Their availability is dependent on which installation your currently work in (BCcampus? Institutional?)
1. Add the [latexpage] shortcode to the top of your chapter. Once you’ve written [latexpage] at the top of a chapter, LaTeX is active for that entire chapter, and everything written in LaTeX syntax will be translate by QuickLaTex. For example if you were to input the following:
[latexpage] At first, we sample $f(x)$ in the $N$ ($N$ is odd) equidistant points around $x^*$: \[ f_k = f(x_k),\: x_k = x^*+kh,\: k=-\frac{N-1}{2},\dots,\frac{N-1}{2} \] where $h$ is some step. Then we interpolate points $\{(x_k,f_k)\}$ by polynomial \begin{equation} \label{eq:poly} P_{N-1}(x)=\sum_{j=0}^{N-1}{a_jx^j} \end{equation} Its coefficients $\{a_j\}$ are found as a solution of system of linear equations: \begin{equation} \label{eq:sys} \left\{ P_{N-1}(x_k) = f_k\right\},\quad k=-\frac{N-1}{2},\dots,\frac{N-1}{2} \end{equation} Here are references to existing equations: (\ref{eq:poly}), (\ref{eq:sys}). Here is reference to non-existing equation (\ref{eq:unknown}).
WP QuickLaTeX would render something which looks like this:
2. Enable the “Use LaTeX Syntax Sitewide” setting. Go to Settings > QuickLaTeX from the left sidebar, then select the Advanced tab. Turn on the “Use LaTeX Syntax Sitewide” setting so that all LaTeX expressions throughout your entire book are rendered by QuickLaTeX.
3. Use the [latex]
shortcode for your equations. Anything wrapped in the [latex]
shortcode will render in QuickLaTeX once the plugin has been activated. Because the allowed syntaxes for denoting mathematical expressions can differ between MathJax and QuickLaTeX, this is our recommended method if you think you may want to switch from using MathJax to QuickLaTex or vice versa, since any equation wrapped in latex shortcodes will display in MathJax and QuickLaTeX.
Customizing QuickLaTeX
To customize your QuickLaTex, navigate to Settings > QuickLaTeX on the left-hand menu of your book’s dashboard.
You can customize QuickLaTeX settings available from the Basic Settings tab or the Advanced tab.
Basic Settings:
- Font size
- Font color
- Background color
- Equation alignment
- Equation number position
Advanced Settings:
- Use LaTeX syntax sitewide
- Exclude $ from syntax interpretation
- Set LaTeX preambles
For more information on QuickLaTeX, visit the website for the plugin.