LaTeX (pronounced Lay-Tech) is a document preparation system that creates beautiful documents and makes it easy to write mathematical equations. Nearly all process control, computer science and math research papers are written using $\LaTeX$ (notice the stylized text, this is done with LaTeX).
LaTeX allows you to write your content first and handle the document's design later with a programmatic and consistent approach. Recall all your sleepless nights in CHBE, fighting with Microsoft Word over the formatting of your lab reports. LaTeX solves those problems by allowing you to focus on the report's content and generate the final formatted document using a template.
To write LaTeX in Jupyter, make sure your cell is in Markdown mode first. You can then write LaTeX expressions by enclosing them in single dollar signs. For example, writing $ax+b=c$
would give you $ax+b=c$. This is called inline math mode.
You can also have your equations on a separate line by enclosing them in double dollar signs. This is called display math mode. For example, writing $$y=mx+b$$
would give you:
Try it yourself in the next cell. Remember to switch to Markdown mode!
^
. For example, $x^2$
would give you $x^2$._
. For example, $x_i$
would give you $x_i$.{}
. For example $2^{a+b+c}$
would give you:Now you try:
Write your symbols using a backslash and their names.
For example: \alpha
, \beta
and \gamma
would show up as $\alpha, \beta, \gamma$. Uppercase works too: \Phi
, \Delta
and \Omega
: $\Phi, \Delta, \Omega$
Here are some common ones:
\pm
, $\pm$\times
, $\times$\infty
, $\infty$\leq
, \geq
, \neq
, $\leq, \geq, \neq$\sqrt{25}
, $\sqrt{25}$You can easily Google for the full list of symbols, or check out this table.
Write fractions using \frac{}{}
with the numerator in the first bracket and the denominator in the second bracket.
For example, H(s) = \frac{1}{2s+1}
:
Try adding brackets to the equation above. Notice that they are too small to cover the fraction:
$$ H(s) = (\frac{1}{2s+1}) $$You can control the size of brackets and parentheses by using \big(
and \big)
.
To make it even bigger, use capital Big:
$$ H(s) = \Big(\frac{1}{2s+1}\Big) $$Or even bigger with bigg:
$$ H(s) = \bigg(\frac{1}{2s+1}\bigg) $$and Bigg:
$$ H(s) = \Bigg(\frac{1}{2s+1}\Bigg) $$
Do integration with \int{}
. For example \int{f(x)dx}
:
Set the limits using exponents and underscores:
$$ \int^{\infty}_{-\infty}{f(x)dx} $$
Those should be enough to get you started. The best way to learn LaTeX is by practicing.