Replace exercise by demo

This commit is contained in:
Knoch 2022-05-09 16:01:41 +02:00
parent b3f59f70ac
commit aa15f951a2
2 changed files with 28 additions and 68 deletions

View File

@ -27,7 +27,7 @@ Hauptdatei <span class="emoji">👑</span>
@content @content
* enthält Grundgerüst, Titel, Inhaltsverzeichnis etc. * enthält Grundgerüst, Titel, Inhaltsverzeichnis etc.
* bindet einzelne Kapitel ein mit \ * bindet einzelne Kapitel ein mit \
`\input{pfad/zur/datei}` oder `\include{pfad/zur/datei}` `\input{pfad/zur/datei}`
``` {.lang-tex .hljs data-sourcefile=main.tex} ``` {.lang-tex .hljs data-sourcefile=main.tex}
\documentclass{article} \documentclass{article}
@ -76,31 +76,6 @@ Inhalt von Abschnitt 2.
![](svg/chapter-04/hauptdatei-teile-crop.svg){.thin-padding} ![](svg/chapter-04/hauptdatei-teile-crop.svg){.thin-padding}
@slide(layout=two-columns)
@title
`input` oder `include`?
@column-one
``` {.hljs .lang-tex}
\input{path/to/file}
```
* Dateiendung `.tex` **kann** angegeben werden
* **Schachtelung** möglich: Unterdateien können wiederum per `\input{}` andere Unterunterdateien einbinden
* Unterdatei wird im fertigen Dokument **ohne Sprung auf neue Seite** in Hauptdatei eingefügt
@column-two
``` {.hljs .lang-tex}
\include{path/to/file}
```
* Dateiendung `.tex` **nicht** angeben
* **Schachtelung** nicht möglich
* für jede Unterdatei wird im fertigen Dokument eine **neue Seite** angelegt
* Vorteil bei größeren Projekten: `\includeonly{file1,file2,...}` in die Präambel schreiben, um nur einzelne Unterdateien zu kompilieren (vorher muss mindestens einmal das gesamte Projekt kompiliert werden)
@slide(layout=content-and-preview-with-category) @slide(layout=content-and-preview-with-category)
@category @category
@ -110,7 +85,7 @@ Exkurs
Dateipfade angeben <span class="emoji">👣</span> Dateipfade angeben <span class="emoji">👣</span>
@content @content
* wichtig für `\input{}` und `\include{}` sowie später für das Einbinden von Bildern * wichtig für `\input{}` sowie später für das Einbinden von Bildern und anderen Medien
* Datei- und Ordnerstruktur = Baumstruktur <span class="emoji">🌳</span> * Datei- und Ordnerstruktur = Baumstruktur <span class="emoji">🌳</span>
@preview @preview
@ -155,7 +130,7 @@ Dateipfade angeben <span class="emoji">👣</span>
### Relative Dateipfade ### Relative Dateipfade
* Pfad von einem bestimmten Ort irgendwo im Ordnerbaum bis zur jeweiligen Datei * Pfad von einem bestimmten Ort irgendwo im Ordnerbaum bis zur jeweiligen Datei
* kürzer + weniger Schreibarbeit! <span class="emoji"></span> * kürzer + weniger Schreibarbeit! <span class="emoji"></span>
* bei `\input{}` und `\include{}` kann der Pfad zu einer Unterdatei relativ zur Hauptdatei angeben werden * bei `\input{}` kann der Pfad zu einer Unterdatei relativ zur Hauptdatei angeben werden
<div class="fragment"> <div class="fragment">
<p data-category="Beispiel">Relativer Pfad \ <p data-category="Beispiel">Relativer Pfad \
@ -236,16 +211,15 @@ Ein einfacher Weg, um die Hauptdatei noch übersichtlicher zu halten.
![](svg/chapter-04/main-parts-präambel-crop.svg){.thin-padding} ![](svg/chapter-04/main-parts-präambel-crop.svg){.thin-padding}
@slide(layout=task) @slide(layout=content-only-with-category)
@task-number @category
4 Demo
@title @title
Ein strukturiertes Projekt Größere Projekte kompilieren
@content @content
Im Ordner `exercises/project-structure` findet ihr eine Datei namens `main.tex`. * Von nun an kompilieren wir die Datei `main.tex` im Wurzelverzeichnis des Projektordners.
* Klickt hierzu in TeXstudio mit der rechten Maustaste auf die Datei und wählt „Explizit als Root-Dokument setzen“.
* Lagert die einzelnen Abschnitte in eigene Dateien `section1.tex`, `section2.tex` und `section3.tex` aus und bindet sie mittels `\include` ein. * Anschließend könnt ihr wie gewohnt kompilieren.
* Welcher Befehl wird durch `\include` überflüssig?

View File

@ -26,8 +26,7 @@ Main file <span class="emoji">👑</span>
@content @content
* contains basic structure and front matter * contains basic structure and front matter
* includes separate sections with \ * includes separate sections with \
`\input{path/to/file}` or \ `\input{path/to/file}`
`\include{path/to/file}`
``` {.lang-tex .hljs data-sourcefile=main.tex} ``` {.lang-tex .hljs data-sourcefile=main.tex}
\documentclass{article} \documentclass{article}
@ -76,32 +75,6 @@ of section 2.
![](svg/chapter-04/main-parts-crop.svg){.thin-padding} ![](svg/chapter-04/main-parts-crop.svg){.thin-padding}
@slide(layout=two-columns)
@title
`input` or `include`?
@column-one
``` {.hljs .lang-tex}
\input{path/to/file}
```
* file extension `.tex` **may** be added
* **nesting** possible: nested files can again be embedded using `\input{}`
* file is added to the resulting document **without a page break**
@column-two
``` {.hljs .lang-tex}
\include{path/to/file}
```
* file extension `.tex` **must not** be added
* **no nesting** possible
* each subfile starts a **new page** in the resulting document
* advantage for larger projects: `\includeonly{file1,file2,...}` can be used in the preable to compile only certain subfiles
(the entire project has to be compiled at least once before)
@slide(layout=content-and-preview-with-category) @slide(layout=content-and-preview-with-category)
@category @category
@ -111,7 +84,7 @@ Excursion
Specifying file paths <span class="emoji">👣</span> Specifying file paths <span class="emoji">👣</span>
@content @content
* important for `\input{}` and `\include{}`, later also for pictures * important for `\input{}`, but later also for other media types
* file and folder structure = tree structure <span class="emoji">🌳</span> * file and folder structure = tree structure <span class="emoji">🌳</span>
@preview @preview
@ -158,7 +131,7 @@ Specifying file paths <span class="emoji">👣</span>
### Relative paths ### Relative paths
* path from somewhere in the tree to a certain file * path from somewhere in the tree to a certain file
* shorter + less typing! <span class="emoji"></span> * shorter + less typing! <span class="emoji"></span>
* with `\input{}` and `\include{}`, you can specify the path relative to the main file * with `\input{}`, you can specify the path relative to the main file
<div class="fragment"> <div class="fragment">
<p data-category="Example">Relative path \ <p data-category="Example">Relative path \
@ -249,6 +222,19 @@ A structured project
@content @content
You will find a file named `main.tex` in the folder `exercises/project-structure`. You will find a file named `main.tex` in the folder `exercises/project-structure`.
* Extract the sections into their own files (`section1.tex`, `section2.tex`, and `section3.tex`) and insert them using the `\include` command. * Extract the sections into their own files (`section1.tex`, `section2.tex`, and `section3.tex`) and insert them using the `\input` command.
* Which command is rendered superfluous by `\include`? * Have a look at the project archive, starting from `main.tex`.
@slide(layout=content-only-with-category)
@category
Demo
@title
Compiling larger projects
@content
* From now on, we will compile the file `main.tex` in the project root.
* To do so, right click on the file in TeXstudio and choose “Select as explicit root document” from the dropdown.
* Next, compile as usual.