8 LaTeX
LaTeX is a high-quality typesetting system; it includes features designed for the production of technical and scientific documentation. The brilliant thing about Pressbooks is that it allows you to use LaTex within your book to make mathematical, scientific, and technical notation.
In this chapter, you’ll learn:
- Where you can generate LaTex code
- How to take that code and use it in Pressbooks
LaTex Code
LaTex rendered looks like this:
[latex]\frac{-b\pm\sqrt{b^2-4ac}}{2a}[/latex]
If you want to create mathematical, scientific, and technical notation and formulas, but do not know how to code LaTex, we recommend that you go to:
There you’ll find a WYSIWYG interface where you can build your notation and then generate the LaTex code to copy and paste into your chapters. As you’ll see in the screenshot below, the LaTex is in the top pane, and how the actual notation will display in your chapter is in the bottom pane. HostMath offers an easy drag-and-drop interface where you can build your LaTex with ease.
Putting LaTex in your Pressbook
If the code it generates does not automatically transfer itself into LaTex, you’ll need to add an opening tag and an end tag.
For example, I copied and pasted the code in the generator above, and it looks exactly the same. It doesn’t render into LaTex.
\frac{-b\pm\sqrt{b^2-4ac}}{2a}
However, adding the opening and closing tags to the code causes the code to render properly.
Turns into this:
[latex]\frac{-b\pm\sqrt{b^2-4ac}}{2a}[/latex]
For more guidance on using mathematical expressions and LaTeX in your book, we recommend referring to the chapter on equations and formulae in the Pressbooks user’s guide .