LaTeX Questions Answered: Should LaTeX Be Used For All Expressions?

The following is an excerpt from the chapter LaTeX Questions Answered in Pressbooks Guide: A reference for open textbook authors using Pressbooks by Lauri M. Aesoph

Should LaTeX be used for all expressions, including simple ones?

Not necessarily. If the numbers, symbols and letters needed for an equation are available on a standard keyboard and can be entered in a clear manner, then LaTeX is not required. Instead, LaTeX can be reserved for complex formulas and equations, including fractions.

The Pressbooks User Guide makes this suggestion:

If LaTeX is a bit much for you or you’d rather look at other options, you can always use special characters, symbols, and the sub/superscript buttons on the toolbar to compose your equations.

If you are fluent in HTML+CSS, you can also look at constructing and formatting your formulas that way.

Is there a simple website or application that I can use to test my LaTeX before adding it to Pressbooks?

It can be tedious to make an attempt at an equation in LaTeX while working in Pressbooks, especially if you’re writing a particularly complex equation or you’re still getting the hang of LaTeX and need to trial and error a lot. You may find yourself repeatedly writing and hitting Preview. To avoid this, you can use an external LaTeX editor, which may be in the form of a web-based or desktop application.

The Interactive LaTeX Editor by Paul Lutus is a web-based editor that quickly renders LaTeX using up to three different renderers, including MathJax. This is particularly useful to Pressbooks users, since you can see exactly which commands do and do not work with MathJax. The editor also allows you to see examples of symbols, Greek letters, and common science and math expressions written in LaTeX.

MiKTeX is a free distribution of TeX/LaTeX. When downloaded, MiKTeX also comes with the editor TeXworks. This option is less ideal than Paul Lutus’s editor, as you must use some basic LaTeX document structuring for anything to compile correctly, which is not necessary in Pressbooks. However, all the bare-bones formatting you need is the following:

\documentclass{article}

\begin{document}

Write your equations here.

\end{document}

The advantage of MiKTeX is that, if you try to use a command from a package that is not currently being used by your installation of LaTeX, MiKTeX will offer to download it for you. This helps to circumvent some of the mystifying errors that can appear when you try out a command found online without realizing that it’s from a package that you need to explicitly call on.

If you are a Mac user, a recommended program is LaTeXiT. The graphical interface of this equation editor allows you just to focus on equations, which is great for beginners who don’t want to be bogged down in the details of document formatting, but the program also allows for further customization from those who do want to control things like what packages are used.

Learn more:


The featured image for this post (viewable in the BCcampus News section at the bottom of our homepage) is by Deepak Gautam from Pexels