Compare commits

...

2 Commits

Author SHA1 Message Date
33ff560a48 Refactor maths chapter 2022-10-11 20:56:54 +02:00
fffb6f14c7 Refactor tables chapter 2022-10-11 20:54:16 +02:00
4 changed files with 220 additions and 234 deletions

View File

@ -40,18 +40,6 @@ Einige Beispiele
<th>Quelltext</th> <th>Quelltext</th>
<th>Ergebnis</th> <th>Ergebnis</th>
</tr> </tr>
<tr class="fragment">
<td>`\sqrt{16}`</td>
<td>$\sqrt{16}$</td>
</tr>
<tr class="fragment">
<td>`\frac{3}{4}`</td>
<td>$\frac{3}{4}$</td>
</tr>
<tr class="fragment">
<td>`e^{\pi}`</td>
<td>$e^{\pi}$</td>
</tr>
<tr class="fragment"> <tr class="fragment">
<td>`\sum_{i=1}^{n}x^2`</td> <td>`\sum_{i=1}^{n}x^2`</td>
<td>$\sum_{i=1}^{n} x^2$</td> <td>$\sum_{i=1}^{n} x^2$</td>
@ -66,13 +54,71 @@ Einige Beispiele
</tr> </tr>
</table> </table>
++ Durch `^{…}` und `_{…}` werden die Inhalte in den Klammern hoch- oder tiefgestellt.
@slide(layout=content-and-preview)
@slide(layout=content-only)
@title @title
Einige Beispiele Ausrichtung von mehreren Gleichungen
@content
Die Umgebung `align` erlaubt es, Gleichungen zum Beispiel am &hairsp;=&hairsp; auszurichten.
``` {.lang-tex .hljs}
\begin{align}
13 \cdot (4a - 3)^2 &= 13 … \\
&= 208a^2 - 312a + 117
\end{align}
```
* ++ Ausgerichtet wird am `&`-Zeichen.
* ++ Zeilenumbrüche werden mit `\\` markiert.
* ++ Die Nummerierung kann bei `align` und `equation` durch durch ein Sternchen nach dem Umgebungsnamen (z.&thinsp;B. `\begin{align*}` und `\end{align*}`) unterdrückt werden.
@preview
![](svg/chapter-09/alignment-crop.svg)
@slide(layout=task-without-number)
@task-number
9a
@title
Formeln setzen
@content
Setzt die folgenden Formeln in der Datei `exercises/maths/math-formulas.tex`.
| Bedeutung | Ergebnis |
|-----------|----------|
| Fallbeschleunigung (Deutschland) | $9,81\,\frac{m}{s^2}$ |
| pq-Formel | $x_{1,2} = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}$ |
| Mitternachtsformel | $x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ |
| Catalansche Zahlen | $C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!}$ |
@slide(layout=task-without-number)
@task-number
9b
@title
Formeln setzen
@content
Setzt die folgenden Formeln in der Datei `exercises/maths/math-formulas.tex`.
| Bedeutung | Ergebnis |
|-----------|----------|
| Definition der Fakultät | $n! = \prod_{i=1}^{n} i$ |
| Menge aller ungeraden natürlichen Zahlen | $\{ x \mid x \in \mathbb{N}, \mathrm{ungerade}(x) \}$ |
| Elimination $\neg\exists x$ | $\neg\exists x . p(x) \Leftrightarrow \forall x . \neg p(x)$ |
@slide(layout=extra-content-only)
@title
Weitere Beispiele
@content @content
<table> <table>
@ -110,7 +156,7 @@ Einige Beispiele
</tr> </tr>
</table> </table>
@slide(layout=content-only) @slide(layout=extra-content-only)
@title @title
Mitwachsende Klammern Mitwachsende Klammern
@ -121,29 +167,29 @@ Mitwachsende Klammern
<th>Quelltext</th> <th>Quelltext</th>
<th>Ergebnis</th> <th>Ergebnis</th>
</tr> </tr>
<tr class="fragment"> <tr>
<td>`\left( \frac{1}{2} \right)`</td> <td>`\left( \frac{1}{2} \right)`</td>
<td>$\left( \frac{1}{2} \right)$</td> <td>$\left( \frac{1}{2} \right)$</td>
</tr> </tr>
<tr class="fragment"> <tr>
<td>`\left[ \frac{1}{2} \right]`</td> <td>`\left[ \frac{1}{2} \right]`</td>
<td>$\left[ \frac{1}{2} \right]$</td> <td>$\left[ \frac{1}{2} \right]$</td>
</tr> </tr>
<tr class="fragment"> <tr>
<td>`\left\lbrace \frac{1}{2} \right\rbrace`</td> <td>`\left\lbrace \frac{1}{2} \right\rbrace`</td>
<td>$\left\lbrace \frac{1}{2} \right\rbrace$</td> <td>$\left\lbrace \frac{1}{2} \right\rbrace$</td>
</tr> </tr>
</table> </table>
``` {.lang-tex .hljs .fragment} ``` {.lang-tex .hljs}
$4 \cdot \left( \frac{1}{2} % … $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> <p 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) @slide(layout=extra-content-and-preview)
@title @title
Darstellung von Grenzen Darstellung von Grenzen
@ -164,29 +210,7 @@ Mit dem Befehl `\limits` lassen sich die Grenzen von Integralen unter und über
![](svg/chapter-09/limits-crop.svg) ![](svg/chapter-09/limits-crop.svg)
@slide(layout=content-and-preview) @slide(layout=extra-content-only)
@title
Ausrichtung von mehreren Gleichungen
@content
Die Umgebung `align` erlaubt es, Gleichungen zum Beispiel am &hairsp;=&hairsp; auszurichten.
``` {.lang-tex .hljs}
\begin{align}
13 \cdot (4a - 3)^2 &= 13 … \\
&= 208a^2 - 312a + 117
\end{align}
```
* ++ Ausgerichtet wird am `&`-Zeichen.
* ++ Zeilenumbrüche werden mit `\\` markiert.
* ++ Die Nummerierung kann bei `align` und `equation` durch durch ein Sternchen nach dem Umgebungsnamen (z.&thinsp;B. `\begin{align*}` und `\end{align*}`) unterdrückt werden.
@preview
![](svg/chapter-09/alignment-crop.svg)
@slide(layout=content-only)
@title @title
Mengenschreibweise Mengenschreibweise
@ -197,43 +221,8 @@ Manchmal ist es notwendig, im Zusammenhang mit der Mengenschreibweise Prädikate
Für diesen Fall gibt es den Befehl `\mathrm{}`. Für diesen Fall gibt es den Befehl `\mathrm{}`.
<p style="text-align: center;">$\left\lbrace x \mid tiefe(x) \geq 20\right\rbrace$</p> <p style="text-align: center;">$\left\lbrace x \mid tiefe(x) \geq 20\right\rbrace$</p>
<p style="text-align: center;" class="fragment">$\left\lbrace x \mid \mathrm{tiefe}(x) \geq 20\right\rbrace$</p> <p style="text-align: center;">$\left\lbrace x \mid \mathrm{tiefe}(x) \geq 20\right\rbrace$</p>
``` {.lang-tex .hljs .fragment} ``` {.lang-tex .hljs}
$\left\lbrace x \mid \mathrm{tiefe}(x) … $\left\lbrace x \mid \mathrm{tiefe}(x) …
``` ```
@slide(layout=task-without-number)
@task-number
9a
@title
Formeln setzen
@content
Setzt die folgenden Formeln in der Datei `exercises/maths/math-formulas.tex`.
| Bedeutung | Ergebnis |
|-----------|----------|
| Fallbeschleunigung (Deutschland) | $9,81\,\frac{m}{s^2}$ |
| pq-Formel | $x_{1,2} = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}$ |
| Mitternachtsformel | $x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ |
| Catalansche Zahlen | $C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!}$ |
@slide(layout=task-without-number)
@task-number
9b
@title
Formeln setzen
@content
Setzt die folgenden Formeln in der Datei `exercises/maths/math-formulas.tex`.
| Bedeutung | Ergebnis |
|-----------|----------|
| Definition der Fakultät | $n! = \prod_{i=1}^{n} i$ |
| Menge aller ungeraden natürlichen Zahlen | $\{ x \mid x \in \mathbb{N}, \mathrm{ungerade}(x) \}$ |
| Elimination $\neg\exists x$ | $\neg\exists x . p(x) \Leftrightarrow \forall x . \neg p(x)$ |

View File

@ -42,18 +42,6 @@ Examples
<th>source code</th> <th>source code</th>
<th>result</th> <th>result</th>
</tr> </tr>
<tr class="fragment">
<td>`\sqrt{16}`</td>
<td>$\sqrt{16}$</td>
</tr>
<tr class="fragment">
<td>`\frac{3}{4}`</td>
<td>$\frac{3}{4}$</td>
</tr>
<tr class="fragment">
<td>`e^{\pi}`</td>
<td>$e^{\pi}$</td>
</tr>
<tr class="fragment"> <tr class="fragment">
<td>`\sum_{i=1}^{n}x^2`</td> <td>`\sum_{i=1}^{n}x^2`</td>
<td>$\sum_{i=1}^{n} x^2$</td> <td>$\sum_{i=1}^{n} x^2$</td>
@ -68,12 +56,72 @@ Examples
</tr> </tr>
</table> </table>
++ `^{…}` and `_{…}` make the content between the braces appear as sub- or superscripted.
@slide(layout=content-only) @slide(layout=content-and-preview)
@title @title
Examples Aligning a group of equations
@content
The `align` environment permits us to align equations at certain positions like the &hairsp;=&hairsp; character.
``` {.lang-tex .hljs}
\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.&thinsp;g. `\begin{align*}` and `\end{align*}`).
@preview
![](svg/chapter-09/alignment-crop.svg)
@slide(layout=task-without-number)
@task-number
9a
@title
Typesetting mathematics
@content
Code up the following formulas in the file `exercises/maths/math-formulas.tex`.
| Meaning | Result |
|---------|--------|
| Gravitational acceleration | $9,81\,\frac{m}{s^2}$ |
| Formula to solve quadratic equations | $x_{1,2} = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}$ |
| Another formula to solve quadratic equations | $x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ |
| Catalan numbers | $C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!}$ |
@slide(layout=task-without-number)
@task-number
9b
@title
Typesetting mathematics
@content
Code up the following formulas in the file `exercises/maths/math-formulas.tex`.
| Meaning | Result |
|---------|--------|
| Definition of factorial | $n! = \prod_{i=1}^{n} i$ |
| Set of all odd natural numbers | $\{ x \mid x \in \mathbb{N}, \mathrm{odd}(x) \}$ |
| Elimination $\neg\exists x$ | $\neg\exists x . p(x) \Leftrightarrow \forall x . \neg p(x)$ |
@slide(layout=extra-content-only)
@title
More examples
@content @content
<table> <table>
@ -111,7 +159,7 @@ Examples
</tr> </tr>
</table> </table>
@slide(layout=content-only) @slide(layout=extra-content-only)
@title @title
Height-adapting braces Height-adapting braces
@ -122,29 +170,29 @@ Height-adapting braces
<th>source code</th> <th>source code</th>
<th>result</th> <th>result</th>
</tr> </tr>
<tr class="fragment"> <tr>
<td>`\left( \frac{1}{2} \right)`</td> <td>`\left( \frac{1}{2} \right)`</td>
<td>$\left( \frac{1}{2} \right)$</td> <td>$\left( \frac{1}{2} \right)$</td>
</tr> </tr>
<tr class="fragment"> <tr>
<td>`\left[ \frac{1}{2} \right]`</td> <td>`\left[ \frac{1}{2} \right]`</td>
<td>$\left[ \frac{1}{2} \right]$</td> <td>$\left[ \frac{1}{2} \right]$</td>
</tr> </tr>
<tr class="fragment"> <tr>
<td>`\left\lbrace \frac{1}{2} \right\rbrace`</td> <td>`\left\lbrace \frac{1}{2} \right\rbrace`</td>
<td>$\left\lbrace \frac{1}{2} \right\rbrace$</td> <td>$\left\lbrace \frac{1}{2} \right\rbrace$</td>
</tr> </tr>
</table> </table>
``` {.lang-tex .hljs .fragment} ``` {.lang-tex .hljs}
$4 \cdot \left( \frac{1}{2} % … $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> <p 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) @slide(layout=extra-content-and-preview)
@title @title
Depicting boundaries Depicting boundaries
@ -162,33 +210,12 @@ This is the standard behaviour for sums, products and limits.
<p data-category="Caution!">Don't use `\limits` inline.</p> <p data-category="Caution!">Don't use `\limits` inline.</p>
@preview @preview
![](svg/chapter-09/limits-crop.svg) ![](svg/chapter-09/limits-crop.svg)
@slide(layout=content-and-preview) @slide(layout=extra-content-only)
@title
Aligning a group of equations
@content
The `align` environment permits us to align equations at certain positions like the &hairsp;=&hairsp; character.
``` {.lang-tex .hljs}
\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.&thinsp;g. `\begin{align*}` and `\end{align*}`).
@preview
![](svg/chapter-09/alignment-crop.svg)
@slide(layout=content-only)
@title @title
Set-builder notation Set-builder notation
@ -199,44 +226,8 @@ In certain situations, it is more adequate to use textual predicates or long fun
This is where `\mathrm{}` comes into play. 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;">$\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> <p style="text-align: center;">$\left\lbrace x \mid \mathrm{frequency}(x) \geq 20\right\rbrace$</p>
``` {.lang-tex .hljs .fragment} ``` {.lang-tex .hljs .fragment}
$\left\lbrace x \mid \mathrm{frequency} … $\left\lbrace x \mid \mathrm{frequency} …
``` ```
@slide(layout=task-without-number)
@task-number
9a
@title
Typesetting mathematics
@content
Code up the following formulas in the file `exercises/maths/math-formulas.tex`.
| Meaning | Result |
|---------|--------|
| Gravitational acceleration | $9,81\,\frac{m}{s^2}$ |
| Formula to solve quadratic equations | $x_{1,2} = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}$ |
| Another formula to solve quadratic equations | $x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ |
| Catalan numbers | $C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!}$ |
@slide(layout=task-without-number)
@task-number
9b
@title
Typesetting mathematics
@content
Code up the following formulas in the file `exercises/maths/math-formulas.tex`.
| Meaning | Result |
|---------|--------|
| Definition of factorial | $n! = \prod_{i=1}^{n} i$ |
| Set of all odd natural numbers | $\{ x \mid x \in \mathbb{N}, \mathrm{odd}(x) \}$ |
| Elimination $\neg\exists x$ | $\neg\exists x . p(x) \Leftrightarrow \forall x . \neg p(x)$ |

View File

@ -121,6 +121,33 @@ Die gesamte Tabelle
@slide(layout=content-only) @slide(layout=content-only)
@title
Mehr Komfort
@content
Der [Tables Generator](https://tablesgenerator.com/) ist ein wunderbares Werkzeug, um schnell Tabellen verschiedener Formate zu erstellen.
[![](svg/chapter-12/tables-generator.png)](https://tablesgenerator.com/)
@slide(layout=task)
@task-number
12
@title
Tabellen setzen
@content
* Die Liste in der Datei `exercises/tables/tables.tex` enthält Infos zu ein paar Lehrveranstaltung an der Fakultät WIAI.
* Wandelt die Liste in eine **Tabelle** um.
* Die Tabelle soll Spalten für den *Namen*, das *Kürzel* und das *Semester* der Vorlesungen haben.
* Fügt außerdem eine **zentrierte Spalte** ganz links in der Tabelle hinzu, in der ihr die Lehrveranstaltungen **nummeriert**.
@slide(layout=extra-content-only)
@title @title
Besonders lange Tabellen Besonders lange Tabellen
@ -140,7 +167,7 @@ Tabellen, die über eine Seite hinaus gehen, werden von `tabular` einfach abgesc
``` ```
@slide(layout=content-only) @slide(layout=extra-content-only)
@title @title
Hinweise zu `longtable` Hinweise zu `longtable`
@ -153,12 +180,12 @@ Hinweise zu `longtable`
\label{<label>} \label{<label>}
\end{longtable} \end{longtable}
``` ```
* ++ Die `longtable`-Umgebung vereint die `tabular`-Umgebung und die `table`-Umgebung. * Die `longtable`-Umgebung vereint die `tabular`-Umgebung und die `table`-Umgebung.
* ++ Titel und Label können deshalb direkt unter dem Tabelleninhalt stehen. * Titel und Label können deshalb direkt unter dem Tabelleninhalt stehen.
* ++ Sofern das Paket `booktabs` eingebunden ist, stehen seine Features auch in `longtable` zur Verfügung. * Sofern das Paket `booktabs` eingebunden ist, stehen seine Features auch in `longtable` zur Verfügung.
@slide(layout=content-only) @slide(layout=extra-content-only)
@title @title
Besonders breite Tabellen Besonders breite Tabellen
@ -178,7 +205,8 @@ Sollte die Tabelle einmal zu breit für eine Seite werden, kann sie auch im Quer
\end{sidewaystable} \end{sidewaystable}
``` ```
@slide(layout=content-and-preview)
@slide(layout=extra-content-and-preview)
@title @title
Weiterführendes Beispiel Weiterführendes Beispiel
@ -203,29 +231,3 @@ Weiterführendes Beispiel
@preview @preview
![](svg/chapter-12/tabelle-fortgeschritten-beispiel-crop.svg){.thin-padding} ![](svg/chapter-12/tabelle-fortgeschritten-beispiel-crop.svg){.thin-padding}
@slide(layout=content-only)
@title
Mehr Komfort
@content
Der [Tables Generator](https://tablesgenerator.com/) ist ein wunderbares Werkzeug, um schnell Tabellen verschiedener Formate zu erstellen.
[![](svg/chapter-12/tables-generator.png)](https://tablesgenerator.com/)
@slide(layout=task)
@task-number
12
@title
Tabellen setzen
@content
* Die Liste in der Datei `exercises/tables/tables.tex` enthält Infos zu ein paar Lehrveranstaltung an der Fakultät WIAI.
* Wandelt die Liste in eine **Tabelle** um.
* Die Tabelle soll Spalten für den *Namen*, das *Kürzel* und das *Semester* der Vorlesungen haben.
* Fügt außerdem eine **zentrierte Spalte** ganz links in der Tabelle hinzu, in der ihr die Lehrveranstaltungen **nummeriert**.

View File

@ -121,6 +121,34 @@ The entire table
@slide(layout=content-only) @slide(layout=content-only)
@title
More comfort
@content
The [Tables Generator](https://tablesgenerator.com/) is a wonderful tool to quickly create tables of different formats.
[![](svg/chapter-12/tables-generator.png)](https://tablesgenerator.com/)
@slide(layout=task)
@task-number
12
@title
Typesetting tables
@content
* The list in file `exercises/tables/tables.tex` stores information on a few modules of the WIAI faculty.
* Transform the list into a **table**.
* The table shall have colums for the *name*, the *abbreviation* (Kürzel) and the *semester* of the lectures.
* Add a **column** with **center-aligned text** on the left side of the table in order to **number** the lectures.
* Add a **caption** for the table.
@slide(layout=extra-content-only)
@title @title
Particularly long tables Particularly long tables
@ -140,7 +168,7 @@ Tables that exceed one page are simply cut off by `tabular`. A solution is offer
``` ```
@slide(layout=content-only) @slide(layout=extra-content-only)
@title @title
Notes on `longtable` Notes on `longtable`
@ -153,12 +181,12 @@ Notes on `longtable`
\label{<label>} \label{<label>}
\end{longtable} \end{longtable}
``` ```
* ++ The `longtable` environment merges the `tabular` and `table` environments. * The `longtable` environment merges the `tabular` and `table` environments.
* ++ Caption and label can therefore be inserted directly under the table content. * Caption and label can therefore be inserted directly under the table content.
* ++ As long as the `booktabs` package is used, its features are also provided in `longtable`. * As long as the `booktabs` package is used, its features are also provided in `longtable`.
@slide(layout=content-only) @slide(layout=extra-content-only)
@title @title
Particularly wide tables Particularly wide tables
@ -178,7 +206,10 @@ If you need a table to be wider than a page, you can display it in landscape ori
\end{sidewaystable} \end{sidewaystable}
``` ```
@slide(layout=content-and-preview)
@slide(layout=extra-content-and-preview)
@title @title
An advanced example An advanced example
@ -203,30 +234,3 @@ An advanced example
@preview @preview
![](svg/chapter-12/table-advanced-example-crop.svg){.thin-padding} ![](svg/chapter-12/table-advanced-example-crop.svg){.thin-padding}
@slide(layout=content-only)
@title
More comfort
@content
The [Tables Generator](https://tablesgenerator.com/) is a wonderful tool to quickly create tables of different formats.
[![](svg/chapter-12/tables-generator.png)](https://tablesgenerator.com/)
@slide(layout=task)
@task-number
12
@title
Typesetting tables
@content
* The list in file `exercises/tables/tables.tex` stores information on a few modules of the WIAI faculty.
* Transform the list into a **table**.
* The table shall have colums for the *name*, the *abbreviation* (Kürzel) and the *semester* of the lectures.
* Add a **column** with **center-aligned text** on the left side of the table in order to **number** the lectures.
* Add a **caption** for the table.