214 lines
5.3 KiB
Markdown
214 lines
5.3 KiB
Markdown
@slide(layout=chapter-slide)
|
|
|
|
@title
|
|
Typesetting mathematics
|
|
|
|
@slide(layout=content-and-preview)
|
|
|
|
@title
|
|
Formula environments 🧮
|
|
|
|
@content
|
|
``` {.lang-tex .hljs}
|
|
$2 \sqrt{\frac{\pi^2}{3} \cdot c_2}$
|
|
```
|
|
|
|
Mathematic formulas are only accepted in the so-called **math mode**.
|
|
Inline-formulas must therefore be guarded by two dollar signs.
|
|
We can also use the `equation` environment.
|
|
|
|
``` {.lang-tex .hljs}
|
|
\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
|
|
<table>
|
|
<tr>
|
|
<th>source code</th>
|
|
<th>result</th>
|
|
</tr>
|
|
<tr class="fragment">
|
|
<td><code>\sqrt{16}</code></td>
|
|
<td>$\sqrt{16}$</td>
|
|
</tr>
|
|
<tr class="fragment">
|
|
<td><code>\frac{3}{4}</code></td>
|
|
<td>$\frac{3}{4}$</td>
|
|
</tr>
|
|
<tr class="fragment">
|
|
<td><code>e^{\pi}</code></td>
|
|
<td>$e^{\pi}$</td>
|
|
</tr>
|
|
<tr class="fragment">
|
|
<td><code>\sum_{i=1}\^{n}x^2</code></td>
|
|
<td>$\sum_{i=1}^{n} x^2$</td>
|
|
</tr>
|
|
<tr class="fragment">
|
|
<td><code>12 \leq 4 x^2 + 13</code></td>
|
|
<td>$12 \leq 4 x^2 + 13$</td>
|
|
</tr>
|
|
</table>
|
|
|
|
++ `^{…}` and `_{…}` make the content between the braces appear as super- or subscript.
|
|
|
|
@slide(layout=content-only)
|
|
|
|
@title
|
|
Examples
|
|
|
|
@content
|
|
<table>
|
|
<tr>
|
|
<th>source code</th>
|
|
<th>result</th>
|
|
</tr>
|
|
<tr>
|
|
<td><code>(x), [x], \lbrace x\rbrace, \lvert x\rvert</code></td>
|
|
<td>$(x), [x], \lbrace x\rbrace, \lvert x\rvert$</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>\exists, \forall, \in, \notin, \infty</code></td>
|
|
<td>$\exists,\forall,\in,\notin,\infty$</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi</code></td>
|
|
<td>$\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi$</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow</code></td>
|
|
<td>$\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow$</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>(A \cup B) \cap C</code></td>
|
|
<td>$(A \cup B) \cap C$</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>(A \lor B) \land C</code></td>
|
|
<td>$(A \lor B) \land C$</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>(A \cdot B) \times C</code></td>
|
|
<td>$(A \cdot B) \times C$</td>
|
|
</tr>
|
|
</table>
|
|
|
|
@slide(layout=content-only)
|
|
|
|
@title
|
|
Height-adapting braces
|
|
|
|
@content
|
|
<table>
|
|
<tr>
|
|
<th>source code</th>
|
|
<th>result</th>
|
|
</tr>
|
|
<tr class="fragment">
|
|
<td><code>\left( \frac{1}{2} \right)</code></td>
|
|
<td>$\left(\frac{1}{2} \right)$</td>
|
|
</tr>
|
|
<tr class="fragment">
|
|
<td><code>\left\lbrace \frac{1}{2} \right\rbrace</code></td>
|
|
<td>$\left\lbrace\frac{1}{2} \right\rbrace$</td>
|
|
</tr>
|
|
<tr class="fragment">
|
|
<td><code>\left[ \frac{1}{2} \right]</code></td>
|
|
<td>$\left[\frac{1}{2} \right]$</td>
|
|
</tr>
|
|
</table>
|
|
|
|
|
|
``` {.lang-tex .hljs .fragment}
|
|
$4 \cdot \left( \frac{1}{2} % …
|
|
```
|
|
|
|
<p class="fragment" style="text-align: center;">$4 \cdot \left(\frac{1}{2} +\frac{3}{ 12 \cdot \left( 2 + \frac{1}{86 \cdot \left(\frac{1}{2} + 24 \right)} \right)} \right)$</p>
|
|
|
|
|
|
@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.
|
|
|
|
``` {.lang-tex .hljs}
|
|
\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)
|
|
```
|
|
|
|
Caution: Don't use `\limits` inline.
|
|
|
|
@preview
|
|

|
|
|
|
@todo
|
|
Caution-Label
|
|
|
|
@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 »=«.
|
|
|
|
``` {.lang-tex .hljs}
|
|
\begin{align}
|
|
13 \cdot (4a - 3)^2 &= 13 … \\
|
|
&= 208a^2 - 312a + 117
|
|
\end{align}
|
|
```
|
|
|
|
* ++ The equations will be aligned with regard to the ampersands (»&«).
|
|
* ++ We can mark a new line using two »\«.
|
|
* ++ `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.
|
|
|
|
<p style="text-align: center;">$\left\lbrace x \mid frequency(x) \geq 20\right\rbrace$</p>
|
|
<p style="text-align: center;" class="fragment">$\left\lbrace x \mid \mathrm{frequency}(x) \geq 20\right\rbrace$</p>
|
|
|
|
``` {.lang-tex .hljs .fragment}
|
|
$\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. |