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]2\text{H}_2\text{O}(l) \rightarrow 2\text{H}_2(g) + \text{O}_2(g)[/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 seen 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.

The opening tag is: [latex]The closing tag is:[/latex]

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, by adding “$latex” to beginning of the code, and a “$” the end of the code it now renders properly.

Turns into this:

[latex]\frac{-b\pm\sqrt{b^2-4ac}}{2a}[/latex]

 

License

Icon for the Creative Commons Attribution 4.0 International License

Pressbooks 101 Copyright © 2018 by Amanda Larson and Julie Lang is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.

Share This Book