diff --git a/slides/chapter-04.de.md b/slides/chapter-04.de.md index 6b50481..c5e12ca 100644 --- a/slides/chapter-04.de.md +++ b/slides/chapter-04.de.md @@ -27,7 +27,7 @@ Hauptdatei 👑 @content * enthält Grundgerüst, Titel, Inhaltsverzeichnis etc. * 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} \documentclass{article} @@ -76,31 +76,6 @@ Inhalt von Abschnitt 2. {.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) @category @@ -110,7 +85,7 @@ Exkurs Dateipfade angeben 👣 @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 🌳 @preview @@ -155,7 +130,7 @@ Dateipfade angeben 👣 ### Relative Dateipfade * Pfad von einem bestimmten Ort irgendwo im Ordnerbaum bis zur jeweiligen Datei * kürzer + weniger Schreibarbeit! ☺ -* 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
Relativer Pfad \ @@ -236,16 +211,15 @@ Ein einfacher Weg, um die Hauptdatei noch übersichtlicher zu halten. {.thin-padding} -@slide(layout=task) +@slide(layout=content-only-with-category) -@task-number -4 +@category +Demo @title -Ein strukturiertes Projekt +Größere Projekte kompilieren @content -Im Ordner `exercises/project-structure` findet ihr eine Datei namens `main.tex`. - -* Lagert die einzelnen Abschnitte in eigene Dateien `section1.tex`, `section2.tex` und `section3.tex` aus und bindet sie mittels `\include` ein. -* Welcher Befehl wird durch `\include` überflüssig? +* 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“. +* Anschließend könnt ihr wie gewohnt kompilieren. \ No newline at end of file diff --git a/slides/chapter-04.en.md b/slides/chapter-04.en.md index 30b7f5e..267e277 100644 --- a/slides/chapter-04.en.md +++ b/slides/chapter-04.en.md @@ -26,8 +26,7 @@ Main file 👑 @content * contains basic structure and front matter * includes separate sections with \ - `\input{path/to/file}` or \ - `\include{path/to/file}` + `\input{path/to/file}` ``` {.lang-tex .hljs data-sourcefile=main.tex} \documentclass{article} @@ -76,32 +75,6 @@ of section 2. {.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) @category @@ -111,7 +84,7 @@ Excursion Specifying file paths 👣 @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 🌳 @preview @@ -158,7 +131,7 @@ Specifying file paths 👣 ### Relative paths * path from somewhere in the tree to a certain file * shorter + less typing! ☺ -* 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
Relative path \ @@ -249,6 +222,19 @@ A structured project @content 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. -* Which command is rendered superfluous by `\include`? +* Extract the sections into their own files (`section1.tex`, `section2.tex`, and `section3.tex`) and insert them using the `\input` command. +* 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.