Preparing documents in mathematics is an important skill, but it can have its challenges.
There are generally three approaches
- Word processor with graphical interface (Microsoft Word, LibreOffice, etc)
- The LaTeX typesetting language
- A powerful language that produces beautiful output
- Universally adopted format for typing mathematics
- User writes a text file, runs a program to produce a graphical output
- Markdown
- A simple way to format text
- User writes a text file that is 'marked up'. This file can also be used to generate various output formats (word, pdf, web)
- Quick overview of the 'mark up' language
- More complete tutorial
There are apparently also hybrid options like https://github.com/witiko/markdown, but I haven't looked into any of them.
Getting Started with LaTeX Mathematics
LaTeX is particularly important because of its nice way of typing mathematics.
In a graphical interface (like word), you will just type the matheamtics. When using LaTeX or Markdown, you will need to specify whether your equation should be inline or display.
An inline equation shows up in the middle of a paragraph of text.
This is useful when you want to let , and then observe that .
- You can typeset inline mathematics by putting your formula inside
$ ... $
or\( ... \)
- For example,
$a^2 + b^2 = c^2$
or\(a^2 + b^2 = c^2\)
both produce
A display equation interrupts a paragraph, and is displayed on its own line. This is useful when you want to highlight something important like and use it to derive the equation
- You can typeset display mathematics by putting your formula inside
$$ ... $$
or\[ ... \]
- For example,
$$a^2 + b^2 = c^2 $$
or\[ a^2 + b^2 = c^2 \]
both produce
The tables below were drafted with the assistance of o3, and then edited and expanded.
Arithmetic and Algebra
Concept | LaTeX you type | Renders as |
---|---|---|
Sum | 3 + 4 |
|
Product | 3 \cdot 4 |
|
Fraction | \frac{3}{4} |
|
Exponent | x^{n} |
|
Subscript | y_{0} |
|
Square Root | \sqrt{x} |
|
Change | \Delta |
|
nth-Root | \sqrt[3]{x} |
|
Function Evaluation | f(2) = 5 |
|
Absolute value | |-5| or \lvert -5 \rvert |
Interval | LaTeX you type | Renders as |
---|---|---|
x > 3 |
||
x \leq -4 |
||
-1 \leq x < 2 |
||
0 < x \leq 5 |
||
\lvert x\rvert < 1 |
Functions and Calculus
Named Function | LaTeX you type | Renders as |
---|---|---|
Linear | f(x)=mx+b |
|
Quadratic | f(x)=ax^2+bx+c |
|
Exponential | f(x)=a\cdot e^{k\cdot x} |
|
Logarithm | f(x)=\log_b x |
|
Natural Log | f(x)=\ln x |
|
Sine | f(x)=\sin x |
|
Tangent | f(x)=\tan x |
Calculus I Concept | LaTeX you type | Renders as |
---|---|---|
Limit | \lim_{x \to a} f(x) |
|
Derivative | \frac{d}{dx} f(x) |
|
Integral (definite) | \int_{a}^{b} f(x)\,dx |
|
Sum (series) | \sum_{n=1}^{\infty} a_n |
Calculus III Concept | LaTeX you type | Renders as |
---|---|---|
Partial derivative | \frac{\partial f}{\partial x} |
|
Double integral | \iint_D f(x,y)\,dA |
|
Triple integral | \iiint_V f(x,y,z)\,dV |
|
Path (line) integral | \int_{\mathcal{C}} \mathbf{F}\cdot d\mathbf{r} |
Linear Algebra
-
Create matrices using the
\begin{bmatrix} ... \end{bmatrix}
environment- List out the entries from left to right, and top to bottom
- Separate columns using
&
and separate rows using\\
- For example,
\begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}
creates the matrix
-
Create a system of equations using the
\begin{cases} ... \end{cases}
environment.- List the equations inside the environment
- Include a
\\
after each equation - Place a
&
symbol next to the equal signs to make the equations line up - For example
\begin{cases} 2x - y &= 5 \\ x + y = 1 &= \\ x &=-2 \\ y = 3 \end{cases}
produces the output
-
Create an aligned sequence of equations using the
\begin{align} ... \end{align}
environment.- This is like the 'cases' environment, but you can use multiple
&
symbols to specify multiple points to align. - For example
\begin{align} 2&x - &y &= 5 \\ &x + &y &= 1 \\ &x & &=-2 \\ & &y &= 3 \end{align}
produces the output
- Wrap the aligned equations in
\begin{cases} ... \end{cases}
to get a standard system of equations - For example,
\begin{cases}\begin{align} 2&x - &y &= 5 \\ &x + &y &= 1 \\ &x & &=-2 \\ & &y &= 3 \end{align}\end{cases}
produces the output
- This is like the 'cases' environment, but you can use multiple
% System of equations (aligned at =)
\begin{align}
2x + y &= 5\\
-x + 3y &= 4
\end{align}
Finding an Editor
-
LaTeX
-
Overleaf is a popular browser-based LaTeX editor
- They also have very helpful documentation
-
MiKTeX is a LaTeX distribution for Windows, Linux, and MacOS
-
-
Markdown
-
Pandoc is a program that converts between various file formats.
-
You can run it locally on your computer as a command line program
-
You can try Pandoc using an Online Document Converter
-
You can select your options from drop down lists
-
It tells you the command you can run locally in the top right corner of the page
-
-
-
MkDocs is a python-based site generator
-
Creates a simple static website from a directory of Markdown files.
-
Originally designed for building project documentation
-
Helpful for taking and organizing notes (used to write this website).
-
-
If you already have it installed, VSCode has built-in support for MarkDown.
- There is also apparently a Markdown PDF extension that converts Markdown files to pdf and html, though I have not used it myself.
-