latex-wochenende/slides/chapter-09.en.md

4.9 KiB
Raw Blame History

@slide(layout=chapter-slide)

@title Typesetting mathematics

@slide(layout=content-and-preview)

@title Formula environments 🧮

@content

$2 \sqrt{\frac{\pi^2}{3} \cdot c_2}$

Mathematical formulas are only accepted in the so-called math mode. In-line formulas must therefore be guarded by two dollar signs. We can also use the equation block environment:

\begin{equation}
  2 \sqrt{\frac{\pi^2}{3} \cdot c_2}
\end{equation}

Packages: amsmath, amsthm, amssymb, mathtools

@preview

@slide(layout=content-only)

@title Examples

@content

source code result
`\sqrt{16}` $\sqrt{16}$
`\frac{3}{4}` $\frac{3}{4}$
`e^{\pi}` $e^{\pi}$
`\sum_{i=1}\^{n}x^2` $\sum_{i=1}^{n} x^2$
`12 \leq 4 x^2 + 13` $12 \leq 4 x^2 + 13$

++ ^{…} and _{…} make the content between the braces appear as sub- or superscripted.

@slide(layout=content-only)

@title Examples

@content

source code result
`(x)`, `[x]`, `\lbrace x \rbrace`, `\lvert x \rvert` $(x), [x], \lbrace x\rbrace, \lvert x\rvert$
`\exists`, `\forall`, `\in`,
`\notin`, `\infty`
$\exists,\forall,\in,\notin,\infty$
`\alpha`, `\beta`, `\Gamma`,
`\Delta`, `\varepsilon`, `\pi`
$\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi$
`\rightarrow`, `\leftarrow`, `\Rightarrow`, `\Leftarrow`, `\Leftrightarrow` $\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow$
`(A \cup B) \cap C` $(A \cup B) \cap C$
`(A \lor B) \land C` $(A \lor B) \land C$
`(A \cdot B) \times C` $(A \cdot B) \times C$

@slide(layout=content-only)

@title Height-adapting braces

@content

source code result
`\left( \frac{1}{2} \right)` $\left( \frac{1}{2} \right)$
`\left[ \frac{1}{2} \right]` $\left[ \frac{1}{2} \right]$
`\left\lbrace \frac{1}{2} \right\rbrace` $\left\lbrace \frac{1}{2} \right\rbrace$
$4 \cdot \left( \frac{1}{2} % …

$4 \cdot \left(\frac{1}{2} +\frac{3}{ 12 \cdot \left( 2 + \frac{1}{86 \cdot \left(\frac{1}{2} + 24 \right)} \right)} \right)$

@slide(layout=content-and-preview)

@title Depicting boundaries

@content The bounds of an integral can be enforced to appear above and below the integral symbol using the \limits command. This is the standard behaviour for sums, products and limits.

\sum_{i=1}^{n^2}(x+2)
\prod_{j=1}^{100}(3 \cdot x)
\lim_{x \rightarrow \infty}(14x^3 - 12)
\int\limits_{-12}^{4}(14x^3 - 12)

Don't use `\limits` inline.

@preview

@slide(layout=content-and-preview)

@title Aligning a group of equations

@content The align environment permits us to align equations at certain positions like the = character.

\begin{align}
  13 \cdot (4a - 3)^2 &= 13 … \\
      &= 208a^2 - 312a + 117
\end{align}
  • ++ The equations will be aligned with respect to the ampersands (&).
  • ++ We can mark a new line using \\.
  • ++ align and equation will not be numbered if we add an asterisk after their names (e.g. \begin{align*} and \end{align*}).

@preview

@slide(layout=content-only)

@title Set-builder notation

@content In certain situations, it is more adequate to use textual predicates or long function names within the set builder notation.

This is where \mathrm{} comes into play.

$\left\lbrace x \mid frequency(x) \geq 20\right\rbrace$

$\left\lbrace x \mid \mathrm{frequency}(x) \geq 20\right\rbrace$

$\left\lbrace x \mid \mathrm{frequency} …

@slide(layout=task)

@task-number 8

@title Typesetting mathematics

@content

  • Reinclude eingabefile.tex, textsatz.tex, and mathematik.tex by adjusting the \includeonly command in l2kurz.tex.
  • Compile the entire project once again.
  • Have a look at chapter 4: Insert your personal favourite formula in section 4.5.