diff --git a/slides.yml b/slides.yml index b68790c..aa16aa8 100644 --- a/slides.yml +++ b/slides.yml @@ -15,5 +15,5 @@ - chapter-13 - chapter-14 - chapter-15 -- chapter-16 + \ No newline at end of file diff --git a/slides/chapter-06.de.md b/slides/chapter-06.de.md index a35e6c3..bea63c0 100644 --- a/slides/chapter-06.de.md +++ b/slides/chapter-06.de.md @@ -199,3 +199,55 @@ Text hervorheben * Macht die **URL** im Text anklickbar. * Probiert euch gerne auch an den anderen Textauszeichnungs-Möglichkeiten, die ihr kennengelernt habt. Löscht diese aber wieder, wenn ihr ein sauberes Dokument haben wollt. +@slide(layout=extra-content-and-preview) + +@title +Flattersatz + +@content +Standardmäßig setzt LaTeX Fließtext im Blocksatz, aber auch Flattersatz ist möglich. + +``` {.lang-tex .hljs} +\raggedright … \raggedleft … +\centering … +``` + +Alternativ einsetzbare Umgebungen: + +``` {.lang-tex .hljs} +\begin{flushleft} Text \end{flushleft} +\begin{flushright} Text \end{flushright} +\begin{center} Text \end{center} +``` + +

Guter Flattersatz ist noch schwieriger als guter Blocksatz, daher lieber vermeiden!

+ +@preview +![](svg/chapter-07/ausrichtung-crop.svg) + + +@slide(layout=extra-content-and-preview) + +@title +Einzüge und Abstände + +@content +* Absätze werden standardmäßig durch Erstzeileneinzüge (`\parindent`) verdeutlicht +* Stattdessen (!) können auch Abstände (`\parskip`) verwendet werden +* Die beiden Parameter sind beliebig einstellbar: + +``` {.lang-tex .hljs} +\setlength{\parindent}{0pt} +\setlength{\parskip}{1em + plus .5em % erlaubte Dehnung + minus .5em % erlaubte Stauchung +} +``` + +* Mit `\noindent` kann für nur einen Absatz der Einzug abgeschaltet werden + +@preview +![](./svg/chapter-07/einzüge-abstände-orig.svg) + + + diff --git a/slides/chapter-06.en.md b/slides/chapter-06.en.md index c67fd6c..bbb47ec 100644 --- a/slides/chapter-06.en.md +++ b/slides/chapter-06.en.md @@ -197,3 +197,55 @@ Emphasising text * Of course, you can also experiment with the other **text markup** possibilities. However, remove them afterwards, if you want to have a clean document. +@slide(layout=extra-content-and-preview) + +@title +Ragged alignment + +@content +By default, LaTeX sets text in full justification, but it is possible to activate ragged alignment. + +``` {.lang-tex .hljs} +\raggedright … \raggedleft … +\centering … +``` + +Alternatively, we can use dedicated environments: + +``` {.lang-tex .hljs} +\begin{flushleft} Text \end{flushleft} +\begin{flushright} Text \end{flushright} +\begin{center} Text \end{center} +``` + +

Proper ragged alignment is even more difficult than good justification, so better avoid it.

+ +@preview +![](svg/chapter-07/ausrichtung-crop.svg) + + +@slide(layout=extra-content-and-preview) + +@title +Indentation and spacing + +@content +* paragraphs are usually indicated by first-line indentation (`\parindent`) +* we can decide to use paragraph spacing (`\parskip`) instead (!) +* both parameters are customisable: + +``` {.lang-tex .hljs} +\setlength{\parindent}{0pt} +\setlength{\parskip}{1em + plus .5em % permitted stretch + minus .5em % permitted compression +} +``` + +* `\noindent` allows us to disable first-line indentation for a given paragraph + +@preview +![](./svg/chapter-07/indentation-spacing-orig.svg) + + + diff --git a/slides/chapter-07.de.md b/slides/chapter-07.de.md index 264dd07..e94c732 100644 --- a/slides/chapter-07.de.md +++ b/slides/chapter-07.de.md @@ -4,55 +4,161 @@ 7 @title -Absatz­formatierung +Aufzählungen @slide(layout=content-and-preview) @title -Flattersatz +Ungeordnete Listen 📜 @content -Standardmäßig setzt LaTeX Fließtext im Blocksatz, aber auch Flattersatz ist möglich. - ``` {.lang-tex .hljs} -\raggedright … \raggedleft … -\centering … +\begin{itemize} + \item Nudelplatten + \item Passierte Tomaten, % … + \item Oregano, Basilikum, % … + \item Mozzarella + \item Mehl + \item Milch +\end{itemize} ``` -Alternativ einsetzbare Umgebungen: - -``` {.lang-tex .hljs} -\begin{flushleft} Text \end{flushleft} -\begin{flushright} Text \end{flushright} -\begin{center} Text \end{center} -``` - -

Guter Flattersatz ist noch schwieriger als guter Blocksatz, daher lieber vermeiden!

+Die einzelnen Stichpunkte werden in jeder Aufzählungsumgebung durch den Befehl `\item` gekennzeichnet. @preview -![](svg/chapter-07/ausrichtung-crop.svg) - +![](svg/chapter-08/itemize-crop.svg) @slide(layout=content-and-preview) @title -Einzüge und Abstände +Geordnete Listen und Definitionslisten @content -* Absätze werden standardmäßig durch Erstzeileneinzüge (`\parindent`) verdeutlicht -* Stattdessen (!) können auch Abstände (`\parskip`) verwendet werden -* Die beiden Parameter sind beliebig einstellbar: - ``` {.lang-tex .hljs} -\setlength{\parindent}{0pt} -\setlength{\parskip}{1em - plus .5em % erlaubte Dehnung - minus .5em % erlaubte Stauchung -} +\begin{enumerate} + \item die Zwiebeln in einem Topf % … + \item passierte Tomaten, Möhren % … + \item mit Kräutern und Gewürzen % … + % \item … +\end{enumerate} ``` -* Mit `\noindent` kann für nur einen Absatz der Einzug abgeschaltet werden +``` {.lang-tex .hljs .fragment} +\begin{description} + \item [Béchamelsauce] Béchamel % … + \item [Lasagne] Als Lasagne % … +\end{description} +``` @preview -![](./svg/chapter-07/einzüge-abstände-orig.svg) + + +@slide(layout=content-and-preview) + +@title +Verschachtelte Listen + +@content +``` {.lang-tex .hljs} +\begin{itemize} + % … + \item Gemüse \begin{itemize} + \item Passierte Tomaten + \item Möhren + \end{itemize} + \item Kräuter \begin{enumerate} + \item Oregano + \item Basilikum + \end{enumerate} + % … +\end{itemize} +``` + +@preview +![](svg/chapter-08/nested-lists-crop.svg) + +@slide(layout=task) + +@task-number +7 + +@title +Aufzählungen einfügen + +@content +* Formatiert das Rezept in `lists.tex` im Ordner `exercises/lists` als **ungeordnete Liste** mit den Elementen *Ingredients* und *Instructions*. Nutzt dafür den Befehl `\itemize`. +* Benutzt innerhalb dieser Liste für die Zutaten eine **ungeordnete Liste** und für die Arbeitsschritte eine **geordnete Liste**. + + +@slide(layout=extra-content-and-preview) + +@title +Kompakte Listen + +@content +Das Paket `paralist` stellt Aufzählungen ohne riesige Zwischenräume zur Verfügung. + +``` {.lang-tex .hljs} +\section{Zutaten} +\begin{compactitem} + % \item … +\end{compactitem} +\section{Zubereitung} +\begin{compactenum} + % \item … +\end{compactenum} +\section{Glossar} +\begin{compactdesc} + % \item … +\end{compactdesc} +``` + +@preview +![](svg/chapter-08/compact-crop.svg) + +@slide(layout=extra-content-and-preview) + +@title +Aufzählungen im Absatz + +@content +Neben den kompakten Listen stellt `paralist` auch Listen zur Verfügung, die in einem Absatz stehen. + +``` {.lang-tex .hljs} +Folgende Kräuter sind für % … +\begin{inparaitem} + \item Liebstöckel + \item Petersilie + \item Schnittlauch +\end{inparaitem} +``` + +Natürlich gibt es auch hier ein Pendant namens `inparaenum` für geordnete Listen. + +@preview + + + +@slide(layout=extra-content-and-preview) + +@title +Aufzählungsarten + +@content +Die Art der Aufzählung lässt sich über den optionalen Parameter `label` ändern. Hierfür ist das Paket `enumitem` notwendig. + +``` {.lang-tex .hljs} +% Römische Zahlen +\begin{enumerate}[label=\roman*] +% … +% Arabische Zahlen +\begin{enumerate}[label=\arabic*] +% … +% Alphabetisch +\begin{enumerate}[label=\alph*] +% … +``` + +@preview +![](svg/chapter-08/list-style-types-crop.svg) \ No newline at end of file diff --git a/slides/chapter-07.en.md b/slides/chapter-07.en.md index c865782..90d4f87 100644 --- a/slides/chapter-07.en.md +++ b/slides/chapter-07.en.md @@ -4,55 +4,164 @@ 7 @title -Formatting paragraphs +Enumerations @slide(layout=content-and-preview) @title -Ragged alignment +Unordered lists 📜 @content -By default, LaTeX sets text in full justification, but it is possible to activate ragged alignment. - ``` {.lang-tex .hljs} -\raggedright … \raggedleft … -\centering … +\begin{itemize} + \item lasagna noodles + \item crushed tomatoes, % … + \item oregano, basil, % … + \item mozzarella cheese + \item flour + \item milk +\end{itemize} ``` -Alternatively, we can use dedicated environments: - -``` {.lang-tex .hljs} -\begin{flushleft} Text \end{flushleft} -\begin{flushright} Text \end{flushright} -\begin{center} Text \end{center} -``` - -

Proper ragged alignment is even more difficult than good justification, so better avoid it.

+We mark each bullet point with `\item`. +This pattern is the same for all kinds of enumerations. @preview -![](svg/chapter-07/ausrichtung-crop.svg) - +![](svg/chapter-08/itemize-english-crop.svg) @slide(layout=content-and-preview) @title -Indentation and spacing +Ordered and definition lists @content -* paragraphs are usually indicated by first-line indentation (`\parindent`) -* we can decide to use paragraph spacing (`\parskip`) instead (!) -* both parameters are customisable: - ``` {.lang-tex .hljs} -\setlength{\parindent}{0pt} -\setlength{\parskip}{1em - plus .5em % permitted stretch - minus .5em % permitted compression -} +\begin{enumerate} + \item cook onions over medium % … + \item add crushed tomatoes, carrots % … + \item add herbs and spices % … + % \item … +\end{enumerate} ``` -* `\noindent` allows us to disable first-line indentation for a given paragraph +``` {.lang-tex .hljs .fragment} +\begin{description} + \item [Béchamel sauce] Béchamel % … + \item [Lasagne] Lasagne (singular % … +\end{description} +``` @preview -![](./svg/chapter-07/indentation-spacing-orig.svg) + + +@slide(layout=content-and-preview) + +@title +Nested lists + +@content +``` {.lang-tex .hljs} +\begin{itemize} + % … + \item vegetables \begin{itemize} + \item crushed tomatoes + \item carrots + \end{itemize} + \item herbs \begin{enumerate} + \item oregano + \item basil + \end{enumerate} + % … +\end{itemize} +``` + +@preview +![](svg/chapter-08/nested-lists-english-crop.svg) + + +@slide(layout=task) + +@task-number +7 + +@title +Adding enumerations + +@content +* Turn the recipe in `lists.tex` into an **unordered list** consisting of the elements *Ingredients* and *Instructions*. You can find the file in the directory `exercises/lists`. Use the `itemize` command. +* Within this list, create a **unordered list** for the ingredients and a **ordered list** for the instructions. + + +@slide(layout=extra-content-and-preview) + +@title +Compact lists + +@content +The package `paralist` offers enumerations with less line spacing. + +``` {.lang-tex .hljs} +\section{Ingredients} +\begin{compactitem} + % \item … +\end{compactitem} +\section{Preparation} +\begin{compactenum} + % \item … +\end{compactenum} +\section{Glossary} +\begin{compactdesc} + % \item … +\end{compactdesc} +``` + +@preview +![](svg/chapter-08/compact-english-crop.svg) + +@slide(layout=extra-content-and-preview) + +@title +In-line enumerations + +@content +Another feature provided by `paralist` enables us to integrate enumerations into paragraphs. + +``` {.lang-tex .hljs} +The following herbs are % … +\begin{inparaitem} + \item lovage + \item parsley + \item chives +\end{inparaitem} +``` + +Of course, there is an accompanying list type called `inparaenum` for ordered lists. + +@preview + + + +@slide(layout=extra-content-and-preview) + +@title +List styles + +@content +The list style type can be set using the optional parameter `label`. +To accomplish this, we need to include the package `enumitem` first. + +``` {.lang-tex .hljs} +% Roman numerals +\begin{enumerate}[label=\roman*] +% … +% Arabic numerals +\begin{enumerate}[label=\arabic*] +% … +% Alphabetical +\begin{enumerate}[label=\alph*] +% … +``` + +@preview +![](svg/chapter-08/list-style-types-english-crop.svg) \ No newline at end of file diff --git a/slides/chapter-08.de.md b/slides/chapter-08.de.md index c257631..f4bd27c 100644 --- a/slides/chapter-08.de.md +++ b/slides/chapter-08.de.md @@ -4,161 +4,225 @@ 8 @title -Aufzählungen +Mathematische Formeln @slide(layout=content-and-preview) @title -Ungeordnete Listen 📜 +Formel-Umgebungen 🧮 @content ``` {.lang-tex .hljs} -\begin{itemize} - \item Nudelplatten - \item Passierte Tomaten, % … - \item Oregano, Basilikum, % … - \item Mozzarella - \item Mehl - \item Milch -\end{itemize} +$2 \sqrt{\frac{\pi^2}{3} \cdot c_2}$ ``` -Die einzelnen Stichpunkte werden in jeder Aufzählungsumgebung durch den Befehl `\item` gekennzeichnet. +Mathematische Formeln können **nur im sogenannten Mathmode** gesetzt werden, der inline durch zwei Dollarzeichen aktiviert wird. Außerdem gibt es eine Blockumgebung: + +``` {.lang-tex .hljs} +\begin{equation} + 2 \sqrt{\frac{\pi^2}{3} \cdot c_2} +\end{equation} +``` + +Pakete: `amsmath`, `amsthm`, `amssymb`, `mathtools` @preview -![](svg/chapter-08/itemize-crop.svg) +![](svg/chapter-09/simple-maths-crop.svg) + +@slide(layout=content-only) + +@title +Einige Beispiele + +@content + + + + + + + + + + + + + + + + + +
QuelltextErgebnis
`\sum_{i=1}^{n}x^2`$\sum_{i=1}^{n} x^2$
`12 \leq 4 x^2 + 13`$12 \leq 4 x^2 + 13$
`{n \choose k}`${n \choose k}$
+ @slide(layout=content-and-preview) @title -Geordnete Listen und Definitionslisten +Ausrichtung von mehreren Gleichungen @content +Die Umgebung `align` erlaubt es, Gleichungen zum Beispiel am › = ‹ auszurichten. + ``` {.lang-tex .hljs} -\begin{enumerate} - \item die Zwiebeln in einem Topf % … - \item passierte Tomaten, Möhren % … - \item mit Kräutern und Gewürzen % … - % \item … -\end{enumerate} +\begin{align} + 13 \cdot (4a - 3)^2 &= 13 … \\ + &= 208a^2 - 312a + 117 +\end{align} ``` -``` {.lang-tex .hljs .fragment} -\begin{description} - \item [Béchamelsauce] Béchamel % … - \item [Lasagne] Als Lasagne % … -\end{description} -``` +* ++ Ausgerichtet wird am ›`&`‹-Zeichen. +* ++ Zeilenumbrüche werden mit ›`\\`‹ markiert. +* ++ Die Nummerierung kann bei `align` und `equation` durch durch ein Sternchen nach dem Umgebungsnamen (z. B. `\begin{align*}` und `\end{align*}`) unterdrückt werden. @preview - - +![](svg/chapter-09/alignment-crop.svg) -@slide(layout=content-and-preview) -@title -Verschachtelte Listen - -@content -``` {.lang-tex .hljs} -\begin{itemize} - % … - \item Gemüse \begin{itemize} - \item Passierte Tomaten - \item Möhren - \end{itemize} - \item Kräuter \begin{enumerate} - \item Oregano - \item Basilikum - \end{enumerate} - % … -\end{itemize} -``` - -@preview -![](svg/chapter-08/nested-lists-crop.svg) - -@slide(layout=task) +@slide(layout=task-without-number) @task-number -8 +8a @title -Aufzählungen einfügen +Formeln setzen @content -* Formatiert das Rezept in `lists.tex` im Ordner `exercises/lists` als **ungeordnete Liste** mit den Elementen *Ingredients* und *Instructions*. Nutzt dafür den Befehl `\itemize`. -* Benutzt innerhalb dieser Liste für die Zutaten eine **ungeordnete Liste** und für die Arbeitsschritte eine **geordnete Liste**. +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 +8b + +@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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QuelltextErgebnis
`(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=extra-content-only) + +@title +Mitwachsende Klammern + +@content + + + + + + + + + + + + + + + + + +
QuelltextErgebnis
`\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$
+ + +``` {.lang-tex .hljs} +$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=extra-content-and-preview) @title -Kompakte Listen +Darstellung von Grenzen @content -Das Paket `paralist` stellt Aufzählungen ohne riesige Zwischenräume zur Verfügung. +Mit dem Befehl `\limits` lassen sich die Grenzen von Integralen unter und über dem Integralzeichen darstellen. Bei Summen, Produkten und Grenzwerten geschieht das automatisch. ``` {.lang-tex .hljs} -\section{Zutaten} -\begin{compactitem} - % \item … -\end{compactitem} -\section{Zubereitung} -\begin{compactenum} - % \item … -\end{compactenum} -\section{Glossar} -\begin{compactdesc} - % \item … -\end{compactdesc} +\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) ``` -@preview -![](svg/chapter-08/compact-crop.svg) +

Der Einsatz von `\limits` sollte im Fließtext vermieden werden.

-@slide(layout=extra-content-and-preview) +@preview +![](svg/chapter-09/limits-crop.svg) + + +@slide(layout=extra-content-only) @title -Aufzählungen im Absatz +Mengenschreibweise @content -Neben den kompakten Listen stellt `paralist` auch Listen zur Verfügung, die in einem Absatz stehen. +Manchmal ist es notwendig, im Zusammenhang mit der Mengenschreibweise Prädikate unter Verwendung von textuellen Beschreibungen oder längeren Funktionsnamen zu definieren. + +Für diesen Fall gibt es den Befehl `\mathrm{}`. + +

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

+

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

``` {.lang-tex .hljs} -Folgende Kräuter sind für % … -\begin{inparaitem} - \item Liebstöckel - \item Petersilie - \item Schnittlauch -\end{inparaitem} -``` - -Natürlich gibt es auch hier ein Pendant namens `inparaenum` für geordnete Listen. - -@preview - - - -@slide(layout=extra-content-and-preview) - -@title -Aufzählungsarten - -@content -Die Art der Aufzählung lässt sich über den optionalen Parameter `label` ändern. Hierfür ist das Paket `enumitem` notwendig. - -``` {.lang-tex .hljs} -% Römische Zahlen -\begin{enumerate}[label=\roman*] -% … -% Arabische Zahlen -\begin{enumerate}[label=\arabic*] -% … -% Alphabetisch -\begin{enumerate}[label=\alph*] -% … -``` - -@preview -![](svg/chapter-08/list-style-types-crop.svg) \ No newline at end of file +$\left\lbrace x \mid \mathrm{tiefe}(x) … +``` \ No newline at end of file diff --git a/slides/chapter-08.en.md b/slides/chapter-08.en.md index 779aa6f..3c2281f 100644 --- a/slides/chapter-08.en.md +++ b/slides/chapter-08.en.md @@ -4,164 +4,230 @@ 8 @title -Enumerations +Typesetting mathematics @slide(layout=content-and-preview) @title -Unordered lists 📜 +Formula environments 🧮 @content ``` {.lang-tex .hljs} -\begin{itemize} - \item lasagna noodles - \item crushed tomatoes, % … - \item oregano, basil, % … - \item mozzarella cheese - \item flour - \item milk -\end{itemize} +$2 \sqrt{\frac{\pi^2}{3} \cdot c_2}$ ``` -We mark each bullet point with `\item`. -This pattern is the same for all kinds of enumerations. +Mathematical formulas are only accepted in the so-called **math mode.** +In-line formulas must therefor be guarded by two dollar signs. +We can also use the `equation` block environment: + +``` {.lang-tex .hljs} +\begin{equation} + 2 \sqrt{\frac{\pi^2}{3} \cdot c_2} +\end{equation} +``` + +Packages: `amsmath`, `amsthm`, `amssymb`, `mathtools` @preview -![](svg/chapter-08/itemize-english-crop.svg) +![](svg/chapter-09/simple-maths-crop.svg) + +@slide(layout=content-only) + +@title +Examples + +@content + + + + + + + + + + + + + + + + + +
source coderesult
`\sum_{i=1}^{n}x^2`$\sum_{i=1}^{n} x^2$
`12 \leq 4 x^2 + 13`$12 \leq 4 x^2 + 13$
`{n \choose k}`${n \choose k}$
+ @slide(layout=content-and-preview) @title -Ordered and definition lists +Aligning a group of equations @content +The `align` environment permits us to align equations at certain positions like the ‘ = ’ character. + ``` {.lang-tex .hljs} -\begin{enumerate} - \item cook onions over medium % … - \item add crushed tomatoes, carrots % … - \item add herbs and spices % … - % \item … -\end{enumerate} +\begin{align} + 13 \cdot (4a - 3)^2 &= 13 … \\ + &= 208a^2 - 312a + 117 +\end{align} ``` -``` {.lang-tex .hljs .fragment} -\begin{description} - \item [Béchamel sauce] Béchamel % … - \item [Lasagne] Lasagne (singular % … -\end{description} -``` +* ++ 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-and-preview) - -@title -Nested lists - -@content -``` {.lang-tex .hljs} -\begin{itemize} - % … - \item vegetables \begin{itemize} - \item crushed tomatoes - \item carrots - \end{itemize} - \item herbs \begin{enumerate} - \item oregano - \item basil - \end{enumerate} - % … -\end{itemize} -``` - -@preview -![](svg/chapter-08/nested-lists-english-crop.svg) +![](svg/chapter-09/alignment-crop.svg) -@slide(layout=task) +@slide(layout=task-without-number) @task-number -8 +8a @title -Adding enumerations +Typesetting mathematics @content -* Turn the recipe in `lists.tex` into an **unordered list** consisting of the elements *Ingredients* and *Instructions*. You can find the file in the directory `exercises/lists`. Use the `itemize` command. -* Within this list, create a **unordered list** for the ingredients and a **ordered list** for the instructions. +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 +8b + +@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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
source coderesult
`(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=extra-content-only) + +@title +Height-adapting braces + +@content + + + + + + + + + + + + + + + + + +
source coderesult
`\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$
+ + +``` {.lang-tex .hljs} +$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=extra-content-and-preview) @title -Compact lists +Depicting boundaries @content -The package `paralist` offers enumerations with less line spacing. +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} -\section{Ingredients} -\begin{compactitem} - % \item … -\end{compactitem} -\section{Preparation} -\begin{compactenum} - % \item … -\end{compactenum} -\section{Glossary} -\begin{compactdesc} - % \item … -\end{compactdesc} +\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) ``` -@preview -![](svg/chapter-08/compact-english-crop.svg) +

Don't use `\limits` inline.

-@slide(layout=extra-content-and-preview) + +@preview +![](svg/chapter-09/limits-crop.svg) + + +@slide(layout=extra-content-only) @title -In-line enumerations +Set-builder notation @content -Another feature provided by `paralist` enables us to integrate enumerations into paragraphs. +In certain situations, it is more adequate to use textual predicates or long function names within the set builder notation. -``` {.lang-tex .hljs} -The following herbs are % … -\begin{inparaitem} - \item lovage - \item parsley - \item chives -\end{inparaitem} -``` +This is where `\mathrm{}` comes into play. -Of course, there is an accompanying list type called `inparaenum` for ordered lists. +

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

+

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

-@preview - - - -@slide(layout=extra-content-and-preview) - -@title -List styles - -@content -The list style type can be set using the optional parameter `label`. -To accomplish this, we need to include the package `enumitem` first. - -``` {.lang-tex .hljs} -% Roman numerals -\begin{enumerate}[label=\roman*] -% … -% Arabic numerals -\begin{enumerate}[label=\arabic*] -% … -% Alphabetical -\begin{enumerate}[label=\alph*] -% … -``` - -@preview -![](svg/chapter-08/list-style-types-english-crop.svg) \ No newline at end of file +``` {.lang-tex .hljs .fragment} +$\left\lbrace x \mid \mathrm{frequency} … +``` \ No newline at end of file diff --git a/slides/chapter-09.de.md b/slides/chapter-09.de.md index 81d94e9..c261788 100644 --- a/slides/chapter-09.de.md +++ b/slides/chapter-09.de.md @@ -4,225 +4,110 @@ 9 @title -Mathematische Formeln +Grafiken -@slide(layout=content-and-preview) - -@title -Formel-Umgebungen 🧮 - -@content -``` {.lang-tex .hljs} -$2 \sqrt{\frac{\pi^2}{3} \cdot c_2}$ -``` - -Mathematische Formeln können **nur im sogenannten Mathmode** gesetzt werden, der inline durch zwei Dollarzeichen aktiviert wird. Außerdem gibt es eine Blockumgebung: - -``` {.lang-tex .hljs} -\begin{equation} - 2 \sqrt{\frac{\pi^2}{3} \cdot c_2} -\end{equation} -``` - -Pakete: `amsmath`, `amsthm`, `amssymb`, `mathtools` - -@preview -![](svg/chapter-09/simple-maths-crop.svg) @slide(layout=content-only) @title -Einige Beispiele +Grafiken abbilden 🖼️ @content +Um Grafiken darzustellen, muss das Paket `graphicx` eingebunden werden. + +``` {.lang-tex .hljs} +\begin{figure} + \includegraphics{} + \caption[]{} +\end{figure} +``` + +Bildgröße angeben: + +``` {.lang-tex .hljs} +\includegraphics[width=0.5\textwidth, +height=5cm]{} +``` + + +@slide(layout=content-only) + +@title +Positionierung auf der Seite + +@content + +``` {.lang-tex .hljs} +\begin{figure}[] +``` + +LaTeX positioniert Grafiken automatisch. Durch Kürzel können wir unsere Präferenzen (auch in Kombination) angeben. + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + +
QuelltextErgebnis
`\sum_{i=1}^{n}x^2`$\sum_{i=1}^{n} x^2$
`12 \leq 4 x^2 + 13`$12 \leq 4 x^2 + 13$
`{n \choose k}`${n \choose k}$
KürzelPosition
hhier, wenn es dir recht ist
toberer Seitenrand (top)
bunterer Seitenrand (bottom)
pauf einer eigenen Seite (page)
HHier, verdammt noch mal!
(benötigt Paket `float`)
-@slide(layout=content-and-preview) +@slide(layout=content-only) @title -Ausrichtung von mehreren Gleichungen +Zentrierte Anordnung @content -Die Umgebung `align` erlaubt es, Gleichungen zum Beispiel am › = ‹ auszurichten. - ``` {.lang-tex .hljs} -\begin{align} - 13 \cdot (4a - 3)^2 &= 13 … \\ - &= 208a^2 - 312a + 117 -\end{align} +\begin{figure}[] + \begin{center} + \includegraphics{} + \end{center} +\end{figure} ``` -* ++ Ausgerichtet wird am ›`&`‹-Zeichen. -* ++ Zeilenumbrüche werden mit ›`\\`‹ markiert. -* ++ Die Nummerierung kann bei `align` und `equation` durch durch ein Sternchen nach dem Umgebungsnamen (z. B. `\begin{align*}` und `\end{align*}`) unterdrückt werden. +Alternativ: -@preview -![](svg/chapter-09/alignment-crop.svg) +``` {.lang-tex .hljs} +\begin{figure}[] + \centering + \includegraphics{} +\end{figure} +``` -@slide(layout=task-without-number) +@slide(layout=task) @task-number -9a +9 @title -Formeln setzen +Grafiken einfügen @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 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QuelltextErgebnis
`(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=extra-content-only) - -@title -Mitwachsende Klammern - -@content - - - - - - - - - - - - - - - - - -
QuelltextErgebnis
`\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$
- - -``` {.lang-tex .hljs} -$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=extra-content-and-preview) - -@title -Darstellung von Grenzen - -@content -Mit dem Befehl `\limits` lassen sich die Grenzen von Integralen unter und über dem Integralzeichen darstellen. Bei Summen, Produkten und Grenzwerten geschieht das automatisch. - -``` {.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) -``` - -

Der Einsatz von `\limits` sollte im Fließtext vermieden werden.

- -@preview -![](svg/chapter-09/limits-crop.svg) - - -@slide(layout=extra-content-only) - -@title -Mengenschreibweise - -@content -Manchmal ist es notwendig, im Zusammenhang mit der Mengenschreibweise Prädikate unter Verwendung von textuellen Beschreibungen oder längeren Funktionsnamen zu definieren. - -Für diesen Fall gibt es den Befehl `\mathrm{}`. - -

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

-

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

- -``` {.lang-tex .hljs} -$\left\lbrace x \mid \mathrm{tiefe}(x) … -``` \ No newline at end of file +* Im Ordner `exercises/graphics` findet ihr eine Bilddatei namens `latex-logo.png`. +* Fügt sie **genau** unterhalb dieser Aufgabenstellung im Skript ein. +* Das Bild soll **zentriert** auf der Seite eingebunden werden. +* Fügt außerdem eine **Bildunterschrift** ein. +* Passt die **Größe** des Bildes an Breite der Seite (`\textwidth`) an. diff --git a/slides/chapter-09.en.md b/slides/chapter-09.en.md index 80dca87..155d4f2 100644 --- a/slides/chapter-09.en.md +++ b/slides/chapter-09.en.md @@ -4,230 +4,110 @@ 9 @title -Typesetting mathematics +Graphics -@slide(layout=content-and-preview) - -@title -Formula environments 🧮 - -@content -``` {.lang-tex .hljs} -$2 \sqrt{\frac{\pi^2}{3} \cdot c_2}$ -``` - -Mathematical formulas are only accepted in the so-called **math mode.** -In-line formulas must therefor be guarded by two dollar signs. -We can also use the `equation` block environment: - -``` {.lang-tex .hljs} -\begin{equation} - 2 \sqrt{\frac{\pi^2}{3} \cdot c_2} -\end{equation} -``` - -Packages: `amsmath`, `amsthm`, `amssymb`, `mathtools` - -@preview -![](svg/chapter-09/simple-maths-crop.svg) @slide(layout=content-only) @title -Examples +Including graphics 🖼️ @content +To display graphics, we need the `graphicx` package. + +``` {.lang-tex .hljs} +\begin{figure} + \includegraphics{} + \caption[]{} +\end{figure} +``` + +Specifying the size: + +``` {.lang-tex .hljs} +\includegraphics[width=0.5\textwidth, +height=5cm]{} +``` + + +@slide(layout=content-only) + +@title +Layout on the page + +@content + +``` {.lang-tex .hljs} +\begin{figure}[] +``` + +LaTeX places graphics automatically. With position codes, we can express our preferences (they can be combined as well). + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + +
source coderesult
`\sum_{i=1}^{n}x^2`$\sum_{i=1}^{n} x^2$
`12 \leq 4 x^2 + 13`$12 \leq 4 x^2 + 13$
`{n \choose k}`${n \choose k}$
codeposition
hhere, if you don’t mind
ttop of the page
bbottom of the page
pon its own page
HHere, for God’s sake!
(`float` package required)
-@slide(layout=content-and-preview) +@slide(layout=content-only) @title -Aligning a group of equations +Centred alignment @content -The `align` environment permits us to align equations at certain positions like the ‘ = ’ character. - ``` {.lang-tex .hljs} -\begin{align} - 13 \cdot (4a - 3)^2 &= 13 … \\ - &= 208a^2 - 312a + 117 -\end{align} +\begin{figure}[] + \begin{center} + \includegraphics{} + \end{center} +\end{figure} ``` -* ++ 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*}`). +Alternatively: -@preview -![](svg/chapter-09/alignment-crop.svg) +``` {.lang-tex .hljs} +\begin{figure}[] + \centering + \includegraphics{} +\end{figure} +``` -@slide(layout=task-without-number) +@slide(layout=task) @task-number -9a +9 @title -Typesetting mathematics +Inserting graphics @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 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
source coderesult
`(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=extra-content-only) - -@title -Height-adapting braces - -@content - - - - - - - - - - - - - - - - - -
source coderesult
`\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$
- - -``` {.lang-tex .hljs} -$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=extra-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) -``` - -

Don't use `\limits` inline.

- - -@preview -![](svg/chapter-09/limits-crop.svg) - - -@slide(layout=extra-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$

- -``` {.lang-tex .hljs .fragment} -$\left\lbrace x \mid \mathrm{frequency} … -``` \ No newline at end of file +* In the directory `exercises/graphics` you can find an image file named `latex-logo.png`. +* **Include** the figure in `exercises/graphics/graphics.tex` and place it **exactly** where you include it. +* The image shall be **centered**. +* Additionally, add a **caption** for the figure. +* Adapt the **width** of the image to the width of the text (`\textwidth`). diff --git a/slides/chapter-10.de.md b/slides/chapter-10.de.md index d9784b2..54b9948 100644 --- a/slides/chapter-10.de.md +++ b/slides/chapter-10.de.md @@ -4,110 +4,230 @@ 10 @title -Grafiken +Tabellen @slide(layout=content-only) @title -Grafiken abbilden 🖼️ +Grundstruktur 🗒️ @content -Um Grafiken darzustellen, muss das Paket `graphicx` eingebunden werden. +Für typografisch schöne Tabellen nutzen wir das Paket `booktabs`. -``` {.lang-tex .hljs} -\begin{figure} - \includegraphics{} - \caption[]{} -\end{figure} +``` {.hljs .lang-tex} +\usepackage{booktabs} ``` -Bildgröße angeben: - -``` {.lang-tex .hljs} -\includegraphics[width=0.5\textwidth, -height=5cm]{} +``` {.hljs .lang-tex} +\begin{table}[] + \begin{tabular}{} + % Tabelleninhalt + \end{tabular} + \caption{} +\end{table} ``` +Die Positionierung erfolgt analog zu Grafiken. -@slide(layout=content-only) + +@slide(layout=content-and-preview) @title -Positionierung auf der Seite +Spaltendefinitionen @content - -``` {.lang-tex .hljs} -\begin{figure}[] +``` {.hljs .lang-tex} +\begin{tabular}{lrcl} + % Tabelleninhalt +\end{tabular} ``` -LaTeX positioniert Grafiken automatisch. Durch Kürzel können wir unsere Präferenzen (auch in Kombination) angeben. - - - - + + - - + + - - + + - - - - - - - - - - + +
KürzelPositionKürzelBedeutung
hhier, wenn es dir recht istllinksbündige Spalte
toberer Seitenrand (top)czentrierte Spalte
bunterer Seitenrand (bottom)
pauf einer eigenen Seite (page)
HHier, verdammt noch mal!
(benötigt Paket `float`)
rrechtsbündige Spalte
+++ Vertikale Trennlinien und doppelte horizontale Linien sind unter Typograph\*innen nicht gern gesehen und sollten vermieden werden. + +@preview +![](svg/chapter-12/tabelle-beispiel-crop.svg){.thin-padding} + + +@slide(layout=content-and-preview) + +@title +Tabelleninhalt + +@content +``` {.hljs .lang-tex} +\begin{tabular}{lll} + \toprule + Spalte 1 & Spalte 2 & Spalte 3 \\ + \midrule + Inhalt a & Inhalt b & Inhalt c \\ + Inhalt e & Inhalt f & Inhalt g \\ + Inhalt i & Inhalt j & Inhalt k \\ + \bottomrule +\end{tabular} +``` +* ++ Zellen werden durch ›`&`‹ abgetrennt. +* ++ Reihen werden durch ›`\\`‹ beendet. +* ++ `\toprule`, `\midrule` und `\bottomrule` strukturieren die Tabelle. + +@preview +![](svg/chapter-12/tabelle-inhalt-beispiel-crop.svg){.thin-padding} + + +@slide(layout=wide-content) + +@title +Die gesamte Tabelle + +@content +``` {.hljs .lang-tex} +\begin{table}[h] + \begin{tabular}{lrcl} + \toprule + Sprache & Autor & Erscheinungsjahr & Dateiendung \\ + \midrule + C++ & Bjarne Stroustrup & 1985 & .cpp \\ + Java & James Gosling & 1998 & .java \\ + Python & Guido van Rossum & 1991 & .py \\ + \bottomrule + \end{tabular} + \caption{Bekannte Programmiersprachen} +\end{table} +``` + +

Mit `@{}` vor und nach einer Spaltendefinition wird der umgebende Weißraum unterdrückt.

+ +

`\begin{tabular}{@{}lrcl@{}}` beschränkt die Linien auf die Breite des Tabelleninhalts.

+ @slide(layout=content-only) @title -Zentrierte Anordnung +Mehr Komfort @content -``` {.lang-tex .hljs} -\begin{figure}[] - \begin{center} - \includegraphics{} - \end{center} -\end{figure} -``` +Der [Tables Generator](https://tablesgenerator.com/) ist ein wunderbares Werkzeug, um schnell Tabellen verschiedener Formate zu erstellen. -Alternativ: - -``` {.lang-tex .hljs} -\begin{figure}[] - \centering - \includegraphics{} -\end{figure} -``` +[![](svg/chapter-12/tables-generator.png)](https://tablesgenerator.com/) @slide(layout=task) @task-number -11 +10 @title -Grafiken einfügen +Tabellen setzen @content -* Im Ordner `exercises/graphics` findet ihr eine Bilddatei namens `latex-logo.png`. -* Fügt sie **genau** unterhalb dieser Aufgabenstellung im Skript ein. -* Das Bild soll **zentriert** auf der Seite eingebunden werden. -* Fügt außerdem eine **Bildunterschrift** ein. -* Passt die **Größe** des Bildes an Breite der Seite (`\textwidth`) an. +* 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 +Besonders lange Tabellen + +@content +Tabellen, die über eine Seite hinaus gehen, werden von `tabular` einfach abgeschnitten. Die Lösung bietet hier das Paket `longtable`: + +``` {.hljs .lang-tex} +\usepackage{longtable} +``` + +``` {.hljs .lang-tex} +\begin{longtable}{} + % Tabelleninhalt + \caption{} + \label{