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:

http://www.hostmath.com/

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.

display with equation symbols on the left, an equation preview window at the bottom, and a string of LaTex characters at the top

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.

The opening tag is: LaTtex opening tag "latex" in square brackets

The closing tag is:  latex closing tag "/latex" in square brackets

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.

latex code string with formatting wrappers
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 .

 

 

License

Icon for the Creative Commons Attribution 4.0 International License

Pressbooks 101: Democracy in Action Copyright © 2017 by L & S Learning Support Services is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.

Share This Book