LaTeX is a high-quality typesetting system mostly used for stuff like academic papers and lets you do cool math equations like this:
and underneath the compiler, is this:
x = \frac{-b\pm\sqrt{b^{2}- 4ac}}{2a}
LaTeX is also commonly used in apps such as notion or obsidian for your math notes, or web blogs for math snippets with KaTeX or MathJax. (This website is running KaTeX.)
Even though LaTeX can be used for text, we're mainly going to focus on math here. For more in depth LaTeX commands and extensions, you can scroll to the bottom.
Inline vs. Block
Usually, on apps like notion or obsidian, you get to choose between using inline() or block:
to display the formula differently. and this is typically done with a single '$' sign for $inline$
and a double '$$' for
$$
block
$$
I like to use blocks for equations that are more important, and inline for constants or less important equations.
Symbols and Functions
Operators
some operators, like and can be typed normally, but others like \times
or \div
can't. So you will have to check the cheat sheet if you want to know if your operator can be typed with a command or not.
Trigonometry
instead of just typing 'tan' or 'sin', use \tan
or \sin
. LaTeX fanboys get very salty about this.
with backslash \sin(360)
:
without sin(360)
:
Greek Letters
for greek symbols, use the backslash before typing the name of the letter.
e.g. \eta
:
for upper case, just capitalize the first letter:
e.g. \Sigma
:
Super and subscripts
base^{superscript}
base_{subscript}
Radicals
\sqrt[index]{radicand}
Fractions
\frac{numerator}{denominator}
Matrices
Here are different ways to make matrices in LaTeX. The &
is used to separate values into columns and the \\
is for denoting a new line (row). These examples were taken from https://www.overleaf.com/learn/latex/Matrices.
Plain
\begin{matrix} 1 & 2 & 3 \\ a & b & c \end{matrix}
Parentheses (Round)
\begin{pmatrix} 1 & 2 & 3 \\ a & b & c \end{pmatrix}
Brackets (Square)
\begin{bmatrix} 1 & 2 & 3 \\ a & b & c \end{bmatrix}
Braces (Curly)
\begin{Bmatrix} 1 & 2 & 3 \\ a & b & c \end{Bmatrix}
Pipes
\begin{vmatrix} 1 & 2 & 3 \\ a & b & c \end{vmatrix}
\ce for Chem Equations
if you want to write chemical equations, you can use the mhchem package.
\ce{NaOH + HCl -> H2O + NaCl}