Compare commits
4 Commits
7a8d188b1c
...
39ce749036
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39ce749036 | ||
|
|
774d9cdccd | ||
|
|
3b9b628d94 | ||
|
|
8419a3f89e |
@ -326,17 +326,20 @@ Inhaltsverzeichnis
|
||||
Dokument und Text gliedern
|
||||
|
||||
@content
|
||||
* Öffnet die Datei `document-structure.tex`, die im Ordner `exercises/basic-document-structure` liegt.
|
||||
* Packt den gesamten Text in der Datei in eine **Document**-Umgebung und schreibt darüber folgende **Präambel**.
|
||||
::: {.box .warning}
|
||||
**Schließt alle offenen Tabs** aus vorherigen Aufgaben.
|
||||
:::
|
||||
|
||||
``` {.lang-tex .hljs .fragment}
|
||||
* Öffnet die Datei `document-structure.tex`, die im Ordner `exercises/basic-document-structure` liegt.
|
||||
* Packt den gesamten Text in der Datei in eine **document**-Umgebung und schreibt darüber folgende **Präambel**.
|
||||
|
||||
``` {.lang-tex .hljs}
|
||||
\documentclass{article}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage[ngerman]{babel}
|
||||
```
|
||||
|
||||
* Öffnet mittels Rechtsklick auf die Datei das Kontextmenü und setzt die Datei als explizites Root-Dokument. Kompiliert sie anschließend.
|
||||
* Wie ihr sehen könnt, sind in der Datei die Absätze im Dokument mit `\\` erstellt worden. Ersetzt diese durch richtige Absätze.
|
||||
* Zeit für etwas Struktur! Verwendet für die **Überschriften** die passenden LaTeX-Befehle (`\section` u. ä.).
|
||||
* Fügt anschließend ein **Inhaltsverzeichnis** in euer Dokument ein.
|
||||
|
||||
@ -323,17 +323,20 @@ Table of contents
|
||||
Structure your document and text
|
||||
|
||||
@content
|
||||
::: {.box .warning}
|
||||
**Close all open tabs** from previous tasks.
|
||||
:::
|
||||
|
||||
* Open the file `document-structure.tex`. It is located in the directory `exercises/basic-document-structure`.
|
||||
* Wrap the entire text in a **document** environment and insert the following **preamble**.
|
||||
|
||||
``` {.lang-tex .hljs .fragment}
|
||||
``` {.lang-tex .hljs}
|
||||
\documentclass{article}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage[english]{babel}
|
||||
```
|
||||
|
||||
* In TeXstudio, right click on the file and select “Set as explicit root document.” Next, compile the file.
|
||||
* As you may already have noticed, **paragraphs** are marked as ‘`\\`’. Use real paragraphs instead.
|
||||
* Time to structure our document! Use LaTex commands to declare all **headings** (`\section`, `\subsubsection`, etc.).
|
||||
* Add a **table of contents** to your document.
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
Ablauf des Workshops
|
||||
|
||||
@content
|
||||
**Ziel:** Wir arbeiten zusammen unser [LaTeX-Skript](https://github.com/fs-wiai/latex-script/) durch, das ihr nach dem Workshop als kompakte Referenz verwenden könnt.
|
||||
**Ziel:** Wir arbeiten zusammen unser [LaTeX-Skript](https://git.stuve-bamberg.de/latex/latex-skript/) durch, das ihr nach dem Workshop als kompakte Referenz verwenden könnt.
|
||||
|
||||
* Learning by Doing
|
||||
* Verstehen, wie LaTeX funktioniert
|
||||
@ -133,7 +133,7 @@ erstellt aus dem Quelltext ein fertig formatiertes PDF-Dokument
|
||||
### Editor
|
||||
zum Schreiben unseres Quelltextes mit allen Befehlen zur semantischen Gliederung
|
||||
|
||||
[TeXstudio](http://www.texstudio.org/) (Empfehlung), [VS Codium](https://vscodium.com) (für Fortgeschrittene, Anleitung auf [Github](https://github.com/fs-wiai/latex-script/blob/github/vs-code-instructions.md))
|
||||
[TeXstudio](http://www.texstudio.org/) (Empfehlung), [VS Codium](https://vscodium.com) (für Fortgeschrittene, Anleitung auf [Github](https://git.stuve-bamberg.de/latex/latex-skript/src/branch/master/docs/vs-code-instructions.md))
|
||||
:::
|
||||
|
||||
@slide(layout=task)
|
||||
@ -147,9 +147,9 @@ Erstmaliges Kompilieren des Skriptes
|
||||
@content
|
||||
* Ladet das Projektarchiv aus dem VC herunter.
|
||||
* Entpackt das Archiv.
|
||||
* Öffnet die Datei `install-verification/main.tex` in TeXstudio. Ihr findet es im Wurzelverzeichnis des Archivs.
|
||||
* Öffnet die Datei `install-verification/main.tex` in TeXstudio.
|
||||
* Kompiliert die Datei, indem ihr <span class="emoji">⏩</span> klickt.
|
||||
* Einige neue Dateien sollten nun durch das Kompilieren generiert werden.
|
||||
* Schaut euch die neuen Dateien an, die durch das Kompilieren generiert werden.
|
||||
|
||||
::: {.box .warning}
|
||||
**Windows**: Um Dateiendungen zu aktivieren, klickt auf das Ansichts-Tab im Dateiexplorer und wählt *Dateiendungen*. So könnt ihr besser zwischen den einzelnen `main`-Dateien unterscheiden.
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
Procedure of this workshop
|
||||
|
||||
@content
|
||||
**Goal:** You are going to build your own little <br />LaTeX manual based on our [LaTeX Script](https://github.com/fs-wiai/latex-script/).
|
||||
**Goal:** You are going to build your own little <br />LaTeX manual based on our [LaTeX Script](https://git.stuve-bamberg.de/latex/latex-skript/).
|
||||
|
||||
* learning by doing
|
||||
* understanding how LaTeX works
|
||||
@ -133,7 +133,7 @@ On **Windows**, please open the MikT<sub style="font-size: 100%; margin-left: -.
|
||||
### Editor
|
||||
writing our source code including all the commands that structure the text semantically
|
||||
|
||||
[TeXstudio](http://www.texstudio.org/) (recommended), [VS Codium](https://vscodium.com) (for advanced users, instructions on [Github](https://github.com/fs-wiai/latex-script/blob/github/vs-code-instructions.md))
|
||||
[TeXstudio](http://www.texstudio.org/) (recommended), [VS Codium](https://vscodium.com) (for advanced users, instructions on [Github](https://git.stuve-bamberg.de/latex/latex-skript/src/branch/master/docs/vs-code-instructions.md))
|
||||
:::
|
||||
|
||||
@slide(layout=task)
|
||||
@ -147,9 +147,9 @@ Compile the script for the first time
|
||||
@content
|
||||
* Download the project archive from the VC.
|
||||
* Unzip the archive.
|
||||
* Open the file `install-verification/main.tex` in T<sub style="font-size: 100%; margin-left: -.1em">E</sub>Xstudio. It is located in the root directory of the archive.
|
||||
* Open the file `install-verification/main.tex` in T<sub style="font-size: 100%; margin-left: -.1em">E</sub>Xstudio.
|
||||
* Compile the file by pressing <span class="emoji">⏩</span>
|
||||
* A few new files will be generated by the compilation.
|
||||
* Have a look at the new files that will be generated by the compilation.
|
||||
|
||||
::: {.box .warning}
|
||||
**Windows**: In order to enable file endings, click the view tab in the file explorer, and select *file name extensions*. This helps differentiating the different ``main`` files.
|
||||
|
||||
@ -79,6 +79,74 @@ Inhalt von Abschnitt 2.
|
||||
{.thin-padding}
|
||||
|
||||
|
||||
@slide(layout=content-only)
|
||||
|
||||
@title
|
||||
Kompilieren des Projekts
|
||||
|
||||
@content
|
||||
* **Nur die Hauptdatei** wird kompiliert, um das fertige PDF-Dokument zu erhalten.
|
||||
* ++ Fehlermeldungen enthalten dann Verweis, in welcher Unterdatei sie aufgetreten sind.
|
||||
* ++ Die Unterdateien können wegen ihrer fehlenden Präambel nicht selbstständig kompiliert werden.
|
||||
|
||||
|
||||
@slide(layout=task)
|
||||
|
||||
@task-number
|
||||
3
|
||||
|
||||
@title
|
||||
Ein strukturiertes Projekt
|
||||
|
||||
@content
|
||||
::: {.box .warning}
|
||||
**Schließt alle offenen Tabs** aus vorherigen Aufgaben.
|
||||
:::
|
||||
|
||||
Im Ordner `exercises/project-structure` findet ihr eine Datei namens `main.tex`.
|
||||
|
||||
* Erstellt neue Dateien (z. B. `section1.tex` und `section2.tex` und verschiebt die Abschnitte in diese.
|
||||
* Importiert die Fragmente anschließend mit Hilfe des `\input`-Befehls.
|
||||
* Lagert die Präambel auf demselben Weg in eine eigene Datei aus.
|
||||
* Schaut euch abschließend die Gesamtstruktur unseres Projektarchivs an, beginnend mit `main-exercises.tex` im Wurzelverzeichnis. Wie binden wir hier die einzelnen Abschnitte ein?
|
||||
|
||||
|
||||
@slide(layout=extra-content-only)
|
||||
|
||||
@title
|
||||
PDF-Dokumente einbetten
|
||||
|
||||
@content
|
||||
Das Paket `pdfpages` erlaubt das Einbetten ganzer PDF-Dokumente.
|
||||
|
||||
``` {.lang-tex .hljs}
|
||||
\includepdf[pages={<from>-<to>}]{<file>}
|
||||
```
|
||||
|
||||
Weitere Parameter lassen mehrere Seiten in Kacheln nebeneinander erscheinen oder ändern die Ausrichtung zu Querformat. Die [Paket-Dokumentation](https://www.ctan.org/pkg/pdfpages) enthält eine abschließende Liste aller Möglichkeiten.
|
||||
|
||||
|
||||
@slide(layout=extra-wide-content)
|
||||
|
||||
@title
|
||||
Makros
|
||||
|
||||
@content
|
||||
Manchmal ist es nützlich, oft genutzten Codes durch Makros zu vereinfachen.
|
||||
|
||||
``` {.lang-tex .hljs}
|
||||
\newcommand{\<name>}[<parameter_count>][<default>]{<content>}
|
||||
```
|
||||
|
||||
Im Skript haben wir solche Makros unter anderem verwendet, um Abstände und Akronyme zu definieren (siehe `commands.tex` für weitere Beispiele):
|
||||
|
||||
``` {.lang-tex .hljs}
|
||||
\newcommand{\widefiguremargin}{-.22\textwidth}
|
||||
\newcommand{\acro}[1]{\textsc{\lowercase{#1}}}
|
||||
```
|
||||
|
||||
Es ist auch möglich, bestehende Befehle anzupassen. $\LaTeX$ erlaubt es sogar, Programmierkonstrukte wie Variablen, Verzweigungen und Schleifen zu nutzen. Für weitere Einblicke dient [dieses Kapitel des WikiBooks](https://en.wikibooks.org/wiki/LaTeX/Macros).
|
||||
|
||||
@slide(layout=content-and-preview-with-category)
|
||||
|
||||
@category
|
||||
@ -163,73 +231,6 @@ Dateipfade angeben <span class="emoji">👣</span>
|
||||
|
||||
|
||||
|
||||
@slide(layout=content-only-with-category)
|
||||
|
||||
@category
|
||||
Demo
|
||||
|
||||
@title
|
||||
Kompilieren des Projekts
|
||||
|
||||
@content
|
||||
* **Nur die Hauptdatei** wird kompiliert, um das fertige PDF-Dokument zu erhalten.
|
||||
* ++ Fehlermeldungen enthalten dann Verweis, in welcher Unterdatei sie aufgetreten sind.
|
||||
* ++ Die Unterdateien können wegen ihrer fehlenden Präambel nicht selbstständig kompiliert werden.
|
||||
|
||||
|
||||
@slide(layout=task)
|
||||
|
||||
@task-number
|
||||
3
|
||||
|
||||
@title
|
||||
Ein strukturiertes Projekt
|
||||
|
||||
@content
|
||||
Im Ordner `exercises/project-structure` findet ihr eine Datei namens `main.tex`.
|
||||
|
||||
* Erstellt neue Dateien (z. B. `section1.tex` und `section2.tex` und verschiebt die Abschnitte in diese.
|
||||
* Importiert die Fragmente anschließend mit Hilfe des `\input`-Befehls.
|
||||
* Lagert die Präambel auf demselben Weg in eine eigene Datei aus.
|
||||
* Schaut euch abschließend die Gesamtstruktur unseres Projektarchivs an, beginnend mit `main-exercises.tex` im Wurzelverzeichnis. Wie binden wir hier die einzelnen Abschnitte ein?
|
||||
|
||||
|
||||
@slide(layout=extra-content-only)
|
||||
|
||||
@title
|
||||
PDF-Dokumente einbetten
|
||||
|
||||
@content
|
||||
Das Paket `pdfpages` erlaubt das Einbetten ganzer PDF-Dokumente.
|
||||
|
||||
``` {.lang-tex .hljs}
|
||||
\includepdf[pages={<from>-<to>}]{<file>}
|
||||
```
|
||||
|
||||
Weitere Parameter lassen mehrere Seiten in Kacheln nebeneinander erscheinen oder ändern die Ausrichtung zu Querformat. Die [Paket-Dokumentation](https://www.ctan.org/pkg/pdfpages) enthält eine abschließende Liste aller Möglichkeiten.
|
||||
|
||||
|
||||
@slide(layout=extra-wide-content)
|
||||
|
||||
@title
|
||||
Makros
|
||||
|
||||
@content
|
||||
Manchmal ist es nützlich, oft genutzten Codes durch Makros zu vereinfachen.
|
||||
|
||||
``` {.lang-tex .hljs}
|
||||
\newcommand{\<name>}[<parameter_count>][<default>]{<content>}
|
||||
```
|
||||
|
||||
Im Skript haben wir solche Makros unter anderem verwendet, um Abstände und Akronyme zu definieren (siehe `commands.tex` für weitere Beispiele):
|
||||
|
||||
``` {.lang-tex .hljs}
|
||||
\newcommand{\widefiguremargin}{-.22\textwidth}
|
||||
\newcommand{\acro}[1]{\textsc{\lowercase{#1}}}
|
||||
```
|
||||
|
||||
Es ist auch möglich, bestehende Befehle anzupassen. $\LaTeX$ erlaubt es sogar, Programmierkonstrukte wie Variablen, Verzweigungen und Schleifen zu nutzen. Für weitere Einblicke dient [dieses Kapitel des WikiBooks](https://en.wikibooks.org/wiki/LaTeX/Macros).
|
||||
|
||||
@slide(layout=content-only)
|
||||
|
||||
@title
|
||||
|
||||
@ -78,6 +78,74 @@ of section 2.
|
||||
{.thin-padding}
|
||||
|
||||
|
||||
@slide(layout=content-only)
|
||||
|
||||
@title
|
||||
Compiling the project
|
||||
|
||||
@content
|
||||
* **Only the main file** has to be compiled to get the complete PDF document.
|
||||
* ++ Error messages include a reference to the corresponding subfile.
|
||||
* ++ Subfiles cannot be compiled on their own as they don’t have a preamble.
|
||||
|
||||
|
||||
@slide(layout=task)
|
||||
|
||||
@task-number
|
||||
3
|
||||
|
||||
@title
|
||||
A structured project
|
||||
|
||||
@content
|
||||
::: {.box .warning}
|
||||
**Close all open tabs** from previous tasks.
|
||||
:::
|
||||
|
||||
You will find a file named `main.tex` in the folder `exercises/project-structure`.
|
||||
|
||||
* Put the sections of the file into separate files, named `section1.tex` and `section2.tex`.
|
||||
* Include them using the `\input` command.
|
||||
* Move the preamble to its own file in a similar fashion.
|
||||
* Finally, have a look at the general project archive, starting from `main-exercises.tex` (in the root folder of the project archive). How do we include the different sections here?
|
||||
|
||||
|
||||
@slide(layout=extra-content-only)
|
||||
|
||||
@title
|
||||
Embedding PDF documents
|
||||
|
||||
@content
|
||||
The `pdfpages` package allows for embedding entire PDF documents.
|
||||
|
||||
``` {.lang-tex .hljs}
|
||||
\includepdf[pages={<from>-<to>}]{<file>}
|
||||
```
|
||||
|
||||
Further options make multiple pages appear in tiles and change the orientation to landscape, among other things. See the [package documentation](https://www.ctan.org/pkg/pdfpages) for a complete list.
|
||||
|
||||
|
||||
@slide(layout=extra-wide-content)
|
||||
|
||||
@title
|
||||
Macros
|
||||
|
||||
@content
|
||||
It may be helpful to specify custom macros for often-used code.
|
||||
|
||||
``` {.lang-tex .hljs}
|
||||
\newcommand{\<name>}[<parameter_count>][<default>]{<content>}
|
||||
```
|
||||
|
||||
In the script, we used these macros for margins and acronyms (see `commands.tex` for more examples):
|
||||
|
||||
``` {.lang-tex .hljs}
|
||||
\newcommand{\widefiguremargin}{-.22\textwidth}
|
||||
\newcommand{\acro}[1]{\textsc{\lowercase{#1}}}
|
||||
```
|
||||
|
||||
It is also possible to customize existing commands. $\LaTeX$ even allows you to use programming patterns like variables, conditionals, and loops. To learn more, have a look at [this WikiBook chapter](https://en.wikibooks.org/wiki/LaTeX/Macros).
|
||||
|
||||
@slide(layout=content-and-preview-with-category)
|
||||
|
||||
@category
|
||||
@ -159,75 +227,6 @@ Specifying file paths <span class="emoji">👣</span>
|
||||

|
||||
|
||||
|
||||
|
||||
@slide(layout=content-only-with-category)
|
||||
|
||||
@category
|
||||
Demo
|
||||
|
||||
@title
|
||||
Compiling the project
|
||||
|
||||
@content
|
||||
* **Only the main file** has to be compiled to get the complete PDF document.
|
||||
* ++ Error messages include a reference to the corresponding subfile.
|
||||
* ++ Subfiles cannot be compiled on their own as they don’t have a preamble.
|
||||
|
||||
|
||||
@slide(layout=task)
|
||||
|
||||
@task-number
|
||||
3
|
||||
|
||||
@title
|
||||
A structured project
|
||||
|
||||
@content
|
||||
You will find a file named `main.tex` in the folder `exercises/project-structure`.
|
||||
|
||||
* Put the sections of the file into separate files, named `section1.tex` and `section2.tex`.
|
||||
* Include them using the `\input` command.
|
||||
* Move the preamble to its own file in a similar fashion.
|
||||
* Finally, have a look at the general project archive, starting from `main-exercises.tex` (in the root folder of the project archive). How do we include the different sections here?
|
||||
|
||||
|
||||
@slide(layout=extra-content-only)
|
||||
|
||||
@title
|
||||
Embedding PDF documents
|
||||
|
||||
@content
|
||||
The `pdfpages` package allows for embedding entire PDF documents.
|
||||
|
||||
``` {.lang-tex .hljs}
|
||||
\includepdf[pages={<from>-<to>}]{<file>}
|
||||
```
|
||||
|
||||
Further options make multiple pages appear in tiles and change the orientation to landscape, among other things. See the [package documentation](https://www.ctan.org/pkg/pdfpages) for a complete list.
|
||||
|
||||
|
||||
@slide(layout=extra-wide-content)
|
||||
|
||||
@title
|
||||
Macros
|
||||
|
||||
@content
|
||||
It may be helpful to specify custom macros for often-used code.
|
||||
|
||||
``` {.lang-tex .hljs}
|
||||
\newcommand{\<name>}[<parameter_count>][<default>]{<content>}
|
||||
```
|
||||
|
||||
In the script, we used these macros for margins and acronyms (see `commands.tex` for more examples):
|
||||
|
||||
``` {.lang-tex .hljs}
|
||||
\newcommand{\widefiguremargin}{-.22\textwidth}
|
||||
\newcommand{\acro}[1]{\textsc{\lowercase{#1}}}
|
||||
```
|
||||
|
||||
It is also possible to customize existing commands. $\LaTeX$ even allows you to use programming patterns like variables, conditionals, and loops. To learn more, have a look at [this WikiBook chapter](https://en.wikibooks.org/wiki/LaTeX/Macros).
|
||||
|
||||
|
||||
@slide(layout=content-only)
|
||||
|
||||
@title
|
||||
|
||||
@ -4,5 +4,5 @@
|
||||
L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X-Wochenende
|
||||
|
||||
@subscript
|
||||
Ein Workshop der Fachschaft WIAI. Präsentiert von Laetitia Hilgendorf, Jessica Klarmann, Florian Knoch, Theresa Knoll, Jochen Mehlich und Hannah Rattenberger.
|
||||
Ein Workshop der Fachschaft WIAI. Präsentiert von Alice, Christian, Clara, Evelyn, Fabian, Florian, Jochen, Katharina, Kilian, Paul und Sandra.
|
||||
|
||||
|
||||
@ -4,5 +4,5 @@
|
||||
L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X Weekend
|
||||
|
||||
@subscript
|
||||
A Fachschaft WIAI workshop. Presented by Laetitia Hilgendorf, Jessica Klarmann, Florian Knoch, Theresa Knoll, Jochen Mehlich, and Hannah Rattenberger.
|
||||
A Fachschaft WIAI workshop. Presented by Alice, Christian, Clara, Evelyn, Fabian, Florian, Jochen, Katharina, Kilian, Paul, and Sandra.
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user