LaTeX for my specific use case

A biased beginners guide to some of LaTeX

LaTeX is an extremely poweful typesetting system and markup language. You can use it to write full papers, and many people do, but it's also incredibly valuable as a tool for advanced text formatting, especially for writing math equations.

For an example, take writing something like the square root of 5x+4 in a standard text editor. You could just try to write it like I just did, with only text, but that can get pretty unclear for longer or more complex equations (like the square root of a fraction). You could also try to use the square root symbol in unicode (√), but that also isn't great for complex equations, or if you need anything more than ∜. Even something as simple as a fraction can get pretty complicated to write clearly in a standard text formatting program.

LaTeX can easily handle both of these problems, and countless more beyond that. A square root is as simple as typing \sqrt{a+b-12c}, a fraction is just \frac{1}{2}, and all of these will render beautifily in any app that supports LaTeX (of which there are suprisingly many).

In short; if you've ever felt like normal text formatting just doesn't fit your needs then you can definitely get value out of LaTeX.

Getting Started

This guide goes over what I belive to be soome of the most useful bits of LaTeX formatting for every day use. This is an incredibly biased list, so if you have a problem with it, download the HTML and make your own list.

I arbitrarily organized dfferent foratting patterns into catergories based on general similarity, and overall complexity. The first few sections cover the basic formatting patterns I use most often, and towards the end there are examples how you can actually combine and apply things. There are also some extra challenges towards the bottom, that give you some equations to try and match. (these can be turned off with the toggle below). If you want to view this guide offline, either download the HTML or save as a PDF. Only the HTML version will work for the interactive formulas.

Almost all of the LaTeX formulas are interactive, update the text in the text-box and the rendered formula below will update as well. If you'd prefer, disabling the "Live Preview" option will make it so you have to submit the equation by pressing >Enter ⏎ for it to update


Basic Math

Simple equations

LaTeX

Type it: a + b = c
For multiplication: 12a \cdot 3b
Fractions: \frac{numerator}{denominator}
Superscripts (exponents): x^{2}
Subscripts — use _
Square root: \sqrt{x}
Nth root: \sqrt[n]{x}

Common Symbols

Times: \times or \cdot
Dot (multiplication): \cdot or \times
Divide: \div
Plus-minus: \pm
Infinity: \infty

Relations

This equals that, that equals this (or not)

Not equal: \neq
Less than or equal: \leq
Greater than or equal: \geq
Approximately equal: \approx

Text formatting

Use \text{} for words inside a formula, you can wrap a whole set of formulas in \text{} or \mathrm{} to prevent words from getting italicized, and preserve spacing

Text in math: \text{...}
Bold math: \mathbf{...}
Roman (upright): \mathrm{...}

Chemistry

All the Superscripts and Subscripts used to write formulas make latex a pretty good tool. Use \to for reactions.

Combustion — methane: 2\text{H}_2 + \text{O}_2 \rightarrow 2\text{H}_2\text{O}
Try it:
Match this:
Combustion — propane: \text{CH}_4 + 2\text{O}_2 \rightarrow \text{CO}_2 + 2\text{H}_2\text{O}
Try it:
Match this:
Equilibrium — Haber: \text{N}_2 + 3\text{H}_2 \rightleftharpoons 2\text{NH}_3
Try it:
Match this:
Decomposition: \text{CaCO}_3 \rightarrow \text{CaO} + \text{CO}_2
Try it:
Match this:
Ions: \text{S}^{2-}
Try it:
Match this:
Proton & hydroxide: \text{H}^+ and \text{OH}^-
Try it:
Match this:
pH: \text{pH} = -\log([\text{H}^+])
Try it:
Match this:
Chemistry problem: multi-line with \\

Physics

Here's some common physics formulas that I've run into.

Wave equation: v = \lambda f
Try it:
Match this:
Period & frequency: T = \frac{1}{f}
Try it:
Match this:
Index of refraction: n = \frac{c}{v}
Try it:
Match this:
Snell's law: n_1 \sin(\theta_1) = n_2 \sin(\theta_2)
Try it:
Match this:
Kinematics: v_f = v_i + at
Try it:
Match this:
Displacement: d = v_i t + \tfrac{1}{2}at^2
Try it:
Match this:
Newton's 2nd law: F_{\text{net}} = ma
Try it:
Match this:
Gravitational field: F_g = mg
Try it:
Match this:
Friction: F_{fr} = \mu F_N
Try it:
Match this:
Kinetic energy: E_k = \tfrac{1}{2}mv^2
Try it:
Match this:
Work: W = Fd
Try it:
Match this:
Heat: Q = mc\Delta T
Try it:
Match this:
Ohm's law: V = IR
Try it:
Match this:
Terminal voltage: V_{\text{terminal}} = \mathcal{E} - Ir
Try it:
Match this:
Density: \rho = \frac{m}{V}
Try it:
Match this:

Reference Card

Symbol LaTeX
\times
\cdot
\div
\pm
\neq
\leq
\geq
\approx
\equiv
\sim
\alpha
\beta
\gamma
\delta
\epsilon
\lambda
\mu
\pi
\theta
\sigma
\omega
\Delta
\Omega
\sum
\prod
\int
\lim
\partial
\infty
\sin
\cos
\tan
\log
\ln
\rightarrow
\forall
\exists
\nabla
\perp
\degree
\checkmark
\star
\ast
\cdot
\therefore
\because
\neg
\mapsto
\to
\gets
\land
\lor
\cup
\cap
\in
\subset
\emptyset

What's Next

There's a lot more to LaTeX than what this guide touches on. I mainly focused on small snippets that can be used in for quick formatting across a variety of editors. If you use a dedicated LaTeX editor, you can use it to write and format entire documents (a popular web-based editor is called Overleaf). LaTeX also has a robust plugins system, which can expand or simpfy it's usage. (For example, the mhchem package makes formatting chemistry equations far easier). If you like the idea of LaTeX but not the specific formatting, you could always try an alternative like Typst.

Thanks for taking some time out of your day to try and learn something new from me. If you want to keep learning more, two great placed to start are the LaTeX wikibook, and the Not So Short Introduction to LaTeX.