Compare commits

..

109 Commits

Author SHA1 Message Date
4aabd15076 remove typo 2022-01-21 14:19:18 +01:00
4251abb989 adapt basic-document-structure exercise to presentation 2022-01-20 20:40:39 +01:00
0037368ab3 Improving a few line breaks, possibly destroying everything language-related in doing so. 2022-01-20 19:50:00 +01:00
68ff85c26d Fix left-over in task 2022-01-18 13:51:05 +01:00
41f7ba74dd Fix indentation 2022-01-18 13:50:52 +01:00
7d37c51f94 Refactor first page 2022-01-18 12:27:58 +01:00
44e094811b Minor changes to the listingsmode introduction 2022-01-12 12:27:42 +01:00
bf2194d534 add section on switching listings mode 2022-01-12 11:49:49 +01:00
56db9b28d7 Fix minted style 2022-01-12 08:41:06 +01:00
ffc0bb9cea Revising source code chapter, improving lstlistings. 2022-01-11 22:26:13 +01:00
44b6e36815 Update release date 2022-01-10 17:31:12 +01:00
ad8139d623 Update README 2022-01-10 17:14:52 +01:00
6ecf6267bd Include txt files in the publication script 2022-01-10 10:34:00 +01:00
1ee3d6c36e Add setup.tex to the publication script 2022-01-10 10:22:29 +01:00
f8cacd2e10 Fix line-wrap 2022-01-10 10:14:44 +01:00
cc88aff49b Merge branch '2021-translate-script' of git.stuve-bamberg.de:latex/latex-skript into 2021-translate-script 2022-01-10 10:12:40 +01:00
9df4071888 Create minted-free alternative to the minted chapter 2022-01-10 10:07:35 +01:00
5a9cc630bb include minted in preamble only when minted is defined as listingsmode 2022-01-10 09:27:09 +01:00
c9f0bee905 include minted in preamble only when minted is defined as listingsmode 2022-01-10 09:26:45 +01:00
b9d6c531a9 Make minted import optional 2022-01-10 09:21:01 +01:00
8c6a782cfc Update python tutorial 2022-01-10 09:05:15 +01:00
d4df68bc99 Merge branch '2021-translate-script' of git.stuve-bamberg.de:latex/latex-skript into 2021-translate-script 2022-01-10 08:13:30 +01:00
6ebf564ee2 replace minted with shell command 2022-01-10 01:40:04 +01:00
fccedb63b0 exclude change-compiler section from chapter 0 2022-01-10 01:27:52 +01:00
4eae1b1f67 add float package to preamble 2022-01-09 21:11:01 +01:00
2b23cf4290 Merge branch '2021-translate-script' of git.stuve-bamberg.de:latex/latex-skript into 2021-translate-script 2022-01-08 17:42:14 +01:00
56f2f42cc9 replaced minted in continuous text with codeblock commands 2022-01-08 17:40:16 +01:00
16480cd7f9 replaced minted in continuous text with codeblock commands 2022-01-08 17:35:48 +01:00
1626e79ea9 Remove TODO 2022-01-08 16:32:49 +01:00
211f1af408 Rework the source code chapter 2022-01-08 16:28:10 +01:00
658ca6a689 Merge branch '2021-translate-script' of git.stuve-bamberg.de:latex/latex-skript into 2021-translate-script 2022-01-08 15:17:07 +01:00
efdae30d72 Add text description of the listings package 2022-01-08 15:17:03 +01:00
03e95d1e99 Merge branch '2021-translate-script' of git.stuve-bamberg.de:latex/latex-skript into 2021-translate-script 2022-01-08 15:05:17 +01:00
fcc38b3f6d set latex as language for listings 2022-01-08 15:05:10 +01:00
6d6e7e6ab9 Fix title case 2022-01-08 14:15:50 +01:00
fa4f63aedb Remove remaining \mintinline calls 2022-01-08 14:15:29 +01:00
ff281eea38 Merge branch '2021-translate-script' of git.stuve-bamberg.de:latex/latex-skript into 2021-translate-script 2022-01-08 14:03:15 +01:00
1897770361 Fix semantics of the \sh command by adding a \mono command 2022-01-08 14:01:10 +01:00
fae350c6df delete commented out line in codeblock command 2022-01-08 13:51:25 +01:00
c5dac27ce9 Use lstlistings in codeblocks 2022-01-08 13:50:03 +01:00
d0ff1e467e update project structure exercise 2022-01-08 13:49:12 +01:00
eec4b468c2 update listings command and code examples 2022-01-08 12:32:48 +01:00
70e4227534 add codeblock command and include it into some exercises 2022-01-03 15:06:40 +01:00
f18ed4ab9c Adding compiling option for listings. 2021-11-17 21:54:36 +01:00
be170abc01 Add the file command 2021-11-17 14:40:00 +01:00
e378b99733 add code and sh commands in exercises 2021-11-05 16:35:29 +01:00
b67fedc413 Unify commands 2021-11-01 12:14:40 +01:00
633e55906a Add english lectures 2021-10-04 13:43:15 +02:00
27e862eaca Remove TODO 2021-10-04 13:36:45 +02:00
fc15b0a296 Integrated corrections as discussed, chapters 5–16. 2021-09-30 20:01:19 +02:00
bfb3fee06c Integrated corrections as discussed, chapters 0–4 2021-09-29 00:05:31 +02:00
984b492dfb Merge branch '2021-translate-script' of git.stuve-bamberg.de:latex/latex-skript into 2021-translate-script 2021-09-24 16:04:19 +02:00
d66cd35472 Reviewed sections 10–16. 2021-09-23 23:24:19 +02:00
6f7554f748 Reviewed sections 10–11. 2021-09-10 13:58:09 +02:00
0e22caed01 Reviewed sections 3–9. 2021-09-10 13:43:08 +02:00
8984cb90da Minor fixes 2021-09-10 10:39:12 +02:00
a89148f53a Add some missing translations 2021-09-09 22:02:16 +02:00
43c4487702 Add missing translations 2021-09-09 21:36:58 +02:00
b497cacd1a Minor fixes 2021-09-09 21:25:51 +02:00
574838b080 Minor corrections 2021-09-09 21:16:51 +02:00
e9c410f139 minor changes regarding punctuation, upper and lower case, etc. 2021-09-05 18:33:28 +02:00
a017c5b8b4 translate exercise on project structure 2021-09-05 17:46:15 +02:00
a7e734a5e2 translate document-structure example and make other minor changes 2021-09-05 11:07:52 +02:00
36c5dd0ac8 Minor corrections to chapter 0. 2021-08-13 13:18:22 +02:00
c90332c0e5 Minor improvements on chapter 1–2. 2021-08-13 13:12:53 +02:00
156d0efecd Minor improvements on "Basic document structure" 2021-08-10 22:41:48 +02:00
b59b1d7831 Minor improvements on "Basic document structure" 2021-08-10 22:10:11 +02:00
a90ca6f9a4 Minor improvements on "What is LaTeX" 2021-08-10 21:39:17 +02:00
d4b618bb67 Minor improvements on "First steps …" 2021-08-10 21:10:23 +02:00
f16307ce8f Fix casing 2021-08-10 20:54:31 +02:00
78bed6ebe9 Fix minor mistakes in license statement 2021-08-10 20:50:53 +02:00
69c341325a fix cmp to cf 2021-07-23 14:18:43 +02:00
0ead420670 Merge branch '2021-translate-script' of git.stuve-bamberg.de:latex/latex-skript into 2021-translate-script 2021-07-23 14:12:06 +02:00
ac18657d88 Revised Details in project structure 2021-07-23 14:12:00 +02:00
9c2ba96e03 Merge branch '2021-translate-script' of git.stuve-bamberg.de:latex/latex-skript into 2021-translate-script 2021-07-23 14:08:17 +02:00
fd09dc9b5f Translate exercise toc line. 2021-07-23 14:08:07 +02:00
46421f3f8c Translated Project-Structure 2021-07-23 13:49:21 +02:00
b4ba69d9b4 translate references 2021-07-23 12:37:40 +02:00
dd87033b2b translate footnotes exercises 2021-07-23 11:52:47 +02:00
429a8e167d translate footnotes 2021-07-23 11:34:30 +02:00
5d6ef668f6 translate prospect chapter 2021-07-23 11:20:02 +02:00
7fc4292c48 Translate exercise 10. 2021-07-20 21:06:25 +02:00
329e639f9f Merge branch '2021-translate-script' of git.stuve-bamberg.de:latex/latex-skript into 2021-translate-script 2021-07-20 20:53:37 +02:00
7c13411361 Translite chapter 9. 2021-07-20 20:53:23 +02:00
308a0da7db Merge branch '2021-translate-script' of git.stuve-bamberg.de:latex/latex-skript into 2021-translate-script 2021-07-19 22:13:04 +02:00
8b5bfa6144 Translate the literature section 2021-07-19 22:12:46 +02:00
f20b039b80 Translate chapter 0. 2021-07-18 23:02:49 +02:00
5de5d729c1 Translate exercise 12. 2021-07-18 22:32:01 +02:00
29acc52b92 Translate chapter 12. 2021-07-18 22:20:47 +02:00
77a5f4236e Translate exercise 6. 2021-07-18 21:31:58 +02:00
0d7239443c Translate chapter 6. 2021-07-18 00:08:42 +02:00
ce626899fd Translate excercise 5. 2021-07-17 23:19:18 +02:00
8fe25a8633 Bluedtke: Wie Funktioniert LaTeX übersetzt 2021-07-08 17:32:29 +02:00
300aa2fdb6 translate graphics exercise solution 2021-07-08 11:55:47 +02:00
4ec34c575b translate graphics chapter and exercise material 2021-07-08 11:54:32 +02:00
f5a754fb0d translate graphics chapter (without exercise) 2021-07-08 11:33:17 +02:00
29bc4678f0 translate task for basic document structure 2021-07-08 10:19:18 +02:00
e0e3bb6366 translate basic document structure 2021-07-08 10:07:06 +02:00
166e01dcf9 Translate chapter 5. 2021-07-07 21:54:58 +02:00
8586f36b04 Translate figure caption 2021-07-07 18:08:57 +02:00
180a35c8ac Translate lists chapter 2021-07-07 18:08:43 +02:00
6e0942fb21 first translation of formatting paragraphs.tex 2021-06-26 00:29:45 +02:00
10e543c239 Fixing typos. 2021-06-25 16:05:05 +02:00
3edbaf43c1 Translate chapter 1. 2021-06-25 00:11:17 +02:00
974bc647e2 improvements on translatin of basic document structure 2021-06-24 18:48:00 +02:00
2c2f6090fc modify first version of translated basic-document-structure 2021-06-24 18:15:57 +02:00
fd9336f7f5 translate basic document structure 2021-06-24 18:09:01 +02:00
2942af9253 Translate meta info 2021-06-23 10:16:08 +02:00
ee9d97c138 Translate the source code listings part and add note on shell escape 2021-06-23 10:02:12 +02:00
154 changed files with 1755 additions and 1191 deletions

1
.gitignore vendored
View File

@ -80,6 +80,7 @@ _minted*
*.swo *.swo
main.pdf main.pdf
listings-mode.tex
exercise-mode.tex exercise-mode.tex
public public
exercises/*/*.pdf exercises/*/*.pdf

View File

@ -23,6 +23,7 @@ tasks: exercises/**/*
# Compile a preview PDF containing all contents # Compile a preview PDF containing all contents
preview: main.tex preview: main.tex
echo "\newcommand\exercisemode{any}" > exercise-mode.tex echo "\newcommand\exercisemode{any}" > exercise-mode.tex
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
pdflatex -shell-escape main.tex pdflatex -shell-escape main.tex
@echo @echo
@echo @echo
@ -43,6 +44,7 @@ publication-dir:
# Compile a printable PDF without exercises # Compile a printable PDF without exercises
publication-pdf-without-exercises: clean publication-dir main.tex publication-pdf-without-exercises: clean publication-dir main.tex
echo "\newcommand\exercisemode{none}" > exercise-mode.tex echo "\newcommand\exercisemode{none}" > exercise-mode.tex
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
pdflatex -shell-escape -jobname=script-only main.tex pdflatex -shell-escape -jobname=script-only main.tex
pdflatex -shell-escape -jobname=script-only main.tex pdflatex -shell-escape -jobname=script-only main.tex
pdflatex -shell-escape -jobname=script-only main.tex pdflatex -shell-escape -jobname=script-only main.tex
@ -51,6 +53,7 @@ publication-pdf-without-exercises: clean publication-dir main.tex
# Compile a printable PDF with exercises and without solutions # Compile a printable PDF with exercises and without solutions
publication-pdf-with-exercises: clean publication-dir main.tex publication-pdf-with-exercises: clean publication-dir main.tex
echo "\newcommand\exercisemode{exercises}" > exercise-mode.tex echo "\newcommand\exercisemode{exercises}" > exercise-mode.tex
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
pdflatex -shell-escape -jobname=script-with-exercises main.tex pdflatex -shell-escape -jobname=script-with-exercises main.tex
pdflatex -shell-escape -jobname=script-with-exercises main.tex pdflatex -shell-escape -jobname=script-with-exercises main.tex
pdflatex -shell-escape -jobname=script-with-exercises main.tex pdflatex -shell-escape -jobname=script-with-exercises main.tex
@ -59,6 +62,7 @@ publication-pdf-with-exercises: clean publication-dir main.tex
# Compile a printable PDF with exercises and solutions # Compile a printable PDF with exercises and solutions
publication-pdf-with-solutions: clean publication-dir main.tex publication-pdf-with-solutions: clean publication-dir main.tex
echo "\newcommand\exercisemode{solutions}" > exercise-mode.tex echo "\newcommand\exercisemode{solutions}" > exercise-mode.tex
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
pdflatex -shell-escape -jobname=script-with-solutions main.tex pdflatex -shell-escape -jobname=script-with-solutions main.tex
pdflatex -shell-escape -jobname=script-with-solutions main.tex pdflatex -shell-escape -jobname=script-with-solutions main.tex
pdflatex -shell-escape -jobname=script-with-solutions main.tex pdflatex -shell-escape -jobname=script-with-solutions main.tex
@ -67,7 +71,7 @@ publication-pdf-with-solutions: clean publication-dir main.tex
# Build a ZIP file with tasks and without solutions # Build a ZIP file with tasks and without solutions
publication-zip-with-exercises: clean publication-dir main.tex publication-zip-with-exercises: clean publication-dir main.tex
rm -rf temp/* rm -rf temp/*
cp --parents main.tex praeamble.tex commands.tex content/* graphics/* listings/**/*.{tex,pdf,bib,java} temp/ cp --parents main.tex praeamble.tex commands.tex setup.tex content/* graphics/* listings/**/*.{tex,pdf,bib,java,txt} temp/
cp --parents exercises/**/* temp/ cp --parents exercises/**/* temp/
rm -f temp/exercises/**/*.done.{tex,bib} rm -f temp/exercises/**/*.done.{tex,bib}
rm -f temp/exercises/**/*.rend.tex rm -f temp/exercises/**/*.rend.tex
@ -78,7 +82,7 @@ publication-zip-with-exercises: clean publication-dir main.tex
# Build a ZIP file with tasks and solutions # Build a ZIP file with tasks and solutions
publication-zip-with-solutions: clean publication-dir main.tex publication-zip-with-solutions: clean publication-dir main.tex
rm -rf temp/* rm -rf temp/*
cp --parents main.tex praeamble.tex commands.tex content/* graphics/* listings/**/*.{tex,pdf,bib,java} temp/ cp --parents main.tex praeamble.tex commands.tex setup.tex content/* graphics/* listings/**/*.{tex,pdf,bib,java,txt} temp/
cp --parents exercises/**/* temp/ cp --parents exercises/**/* temp/
rm -f temp/exercises/**/*.raw.{tex,bib} rm -f temp/exercises/**/*.raw.{tex,bib}
find temp/ -name '*.done.*' -exec bash -c 'sed "s/\.done\./\./g" <<<{} | xargs mv {}' \; find temp/ -name '*.done.*' -exec bash -c 'sed "s/\.done\./\./g" <<<{} | xargs mv {}' \;

View File

@ -1,6 +1,6 @@
# LaTeX Script by Fachschaft WIAI # LaTeX Script by Fachschaft WIAI
This script introduces the most fundamental LaTeX mechanisms to get learners started. It is used both as a reference and as exercise material for our [LaTeX workshop](https://wiai.stuve-bamberg.de/latex-weekend), a **two-day tutorial aimed at students from various backgrounds**. At the moment, it is only available in German. The following topics are covered: This script introduces the most fundamental LaTeX mechanisms to get learners started. It is used both as a reference and as exercise material for our [LaTeX workshop](https://wiai.stuve-bamberg.de/latex-weekend), a **two-day tutorial aimed at students from various backgrounds**. The following topics are covered:
* general introduction to the LaTeX system * general introduction to the LaTeX system
* basic document structure * basic document structure
@ -10,7 +10,7 @@ This script introduces the most fundamental LaTeX mechanisms to get learners sta
* formatting paragraphs * formatting paragraphs
* lists * lists
* maths and formulas * maths and formulas
* sourcecode listings * source code listings (`minted` + `listings`)
* graphics * graphics
* tables * tables
* footnotes * footnotes
@ -19,17 +19,40 @@ This script introduces the most fundamental LaTeX mechanisms to get learners sta
Most chapters contain exercises to be performed within the script itself, practically teaching the aspects that are introduced by the text. Most chapters contain exercises to be performed within the script itself, practically teaching the aspects that are introduced by the text.
## Requirements ## Getting started
Compiling the script requires a working [LaTeX installation](https://tug.org/texlive/). ### For beginners
For sourcecode listings, we are using [Pygments](https://pygments.org/) and [Python3](https://www.python.org/). A PDF version of the script can be found [in the “releases” section](https://github.com/fs-wiai/latex-script/releases). It will give you an overview of how to approach any, but especially this LaTeX project. For this, have a look at the “First steps with LaTeX” section.
The Makefile comes in handy for compiling the different versions of the script (see usage section).
For learners, we recommend using [TeXstudio](https://www.texstudio.org/) to compile the script. **Optionally**, the `minted` package can be used for source code listings. This requires some additional configuration (including the installation of [Python3](https://www.python.org/)). Please refer to the chapter on “Source code listings” in the aforementioned PDF file.
### Command line usage
The project can be compiled by running a LaTeX compiler on `main.tex`. A simple command would be:
```sh
$ pdflatex main.tex
```
Run the command twice to generate the table of contents and other registers. Once the literature tasks are being worked on, compilation requires an additional call to BibTeX:
```sh
$ pdflatex main.tex
$ bibtex main.aux
$ pdflatex main.tex
$ pdflatex main.tex
```
If you decide to use the optional `minted` package (see section above), don't forget to add the `--shell-escape` flag:
```sh
$ pdflatex --shell-escape main.tex
```
## Project Structure ## Project Structure
``` ```
latex-skript/ latex-script/
├── commands.tex ├── commands.tex
├── compile_listings ├── compile_listings
├── compile_tasks ├── compile_tasks
@ -53,33 +76,31 @@ latex-skript/
├── Makefile ├── Makefile
├── praeamble.tex ├── praeamble.tex
├── public ├── public
├── setup.tex
└── README.md └── README.md
``` ```
* **`main.tex`** is the entrypoint. It includes the preamble (`preamble.tex`), our custom commands (`commands.tex`) as well as all sections. ## Relevant files for learners
* **`main.tex`** is the entry point. It includes the preamble (`preamble.tex`), our custom commands (`commands.tex`) as well as all sections.
* **`content`** comprises the individual chapters of this script. * **`content`** comprises the individual chapters of this script.
* Most chapters include a task that can be found in the **`exercises`** folder. * Most chapters include a task that can be found in the **`exercises`** folder.
* **`public`** is the folder where all packed-up versions of the script are moved to, once they have been created using the `Makefile` and the command `make publication`. There are two zip archives of this repository (one containing only the exercises and one with solutions included) as well as three PDF versions (one with the content only, one with exercises, and one with exercises and solutions).
* `compile_listings` and `compile_commands` are two **utility bash scripts**. They produce a rendered and cropped PDF version of all `.tex` files within the `listings`/`exercises` folders and their subfolders. Rendered listings remain in `listings` whereas tasks are moved to the **`graphics`** folder afterwards. The compiled tasks are necessary for students who receive the project archive, but should not be given the sourcecode of tasks, e.g., if an exercise demands them to code up a table based on a pre-coded example.
## Usage Please don't feel overwhelmed by the amount of files in this repository. You will get to know the most important parts of the project step by step by [following the script](https://github.com/fs-wiai/latex-script/releases) or our workshop. What's more, by using this larger projects you get accustomed to the complexity of real LaTeX projects bachelor's/master's theses and the like.
**For beginners**: A PDF version of the script can be found in the “releases” section. It will give you an overview of how to use any LaTeX project. For this, have a look at the “Erste Schritte mit LaTeX” section. ## Further information for maintainers
**Commandline usage**: The project can be compiled by running a LaTeX compiler on `main.tex`. Note that we make (heavy) use of the Pygments package, which requires additional installation (see section above) and a flag (`--shell-escape`) that has to be passed to the compiler. To configure TeXstudio with Pygments, see the chapter “Quelltext-Listings” (especially “10.2 Compilerbefehl ändern”) in the script. A simple command would be: ### Listings mode
**`setup.tex`** is used to configure which package to use for source code listings. All listings in the script are set using custom commands that can internally switch between the `listings` and the `minted` package.
```sh **`listings-mode.tex`** is the file that determines the listings mode. If this file is non-existent or contains the line `\newcommand\listingsmode{default}`, `listings` is used. `\newcommand\listingsmode{minted}` switches it to `minted`. We decided to add this abstraction to deal with learners having trouble to install Pygments on their machine.
$ pdflatex --shell-escape main.tex
```
Run the command twice to generate the table of contents and other registers. Once the literature tasks are being worked on, compilation requires an additional call to BibTeX: ### Including rendered images of source code
**`compile_listings`** and **`compile_commands`** are two utility bash scripts. They produce a rendered and cropped PDF version of all `.tex` files within the `listings`/`exercises` folders and their sub folders. Rendered listings remain in `listings` whereas exercise renderings are moved to the **`graphics`** folder afterwards.
```sh The compiled tasks are necessary for students who receive the project archive, but should not be given the source code of tasks, e.&thinsp;g., if an exercise demands them to code up a table based on a pre-coded example.
$ pdflatex --shell-escape main.tex
$ bibtex main.aux ### Publishing the script
$ pdflatex --shell-escape main.tex **`public`** is the folder where all packed-up versions of the script are moved to, once they have been created using the `Makefile` and the command `make publication`. There are two zip archives of this repository (one containing only the exercises and one with solutions included) as well as three PDF versions (one with the content only, one with exercises, and one with exercises and solutions).
$ pdflatex --shell-escape main.tex
```
## Contributing ## Contributing
@ -93,4 +114,4 @@ These are the main contributors so far:
## License ## License
The LaTeX Script was created by Fachschaft WIAI, the Student Council of the faculty of Information Systems and Applied Computer Sciences at University of Bamberg. It is licensed under the creative commons licence “Attribution-ShareAlike 4.0 International” (CC BY-SA 4.0): http://creativecommons.org/licenses/by-sa/4.0/. Usage permissions beyond the scope of this license might be granted upon request. The LaTeX Script has been assembled by the Student Council of the Faculty of Information Systems and Applied Computer Sciences (Fachschaft WIAI) at University of Bamberg. It is licensed under Creative Commons “Attribution-ShareAlike 4.0 International” (CC BY-SA 4.0): http://creativecommons.org/licenses/by-sa/4.0/. Upon request, allowances exceeding the limitations of this license may be granted.

View File

@ -34,6 +34,150 @@
\rule{\widefigurewidth}{0.4pt} \rule{\widefigurewidth}{0.4pt}
} }
% Shell command
% ==============
% Mono-spaced text without syntax highlighting.
% Intended for full commands. Wrapped by empty lines.
\newcommand\shell[1]{%
\vspace{.5cm}
\noindent \hspace*{-1em}{\color{lightgray}\texttt{\$ }}\texttt{#1}
\vspace{.5cm}
}
% Command parts
% ===================
% Mono-spaced text without syntax highlighting.
% Intended for parts of shell commands.
% Displayed inline.
\newcommand\sh[1]{%
\texttt{#1}%
}
% Package names
% =============
% Mono-spaced text without syntax highlighting.
% Intended for LaTeX package names.
\newcommand\pkg[1]{%
\ifthenelse{\equal{\listingsmode}{minted}}{%
\texttt{#1}%
}{%
\texttt{#1}%
}%
}
% File paths
% ==========
% Mono-spaced text without syntax highlighting.
% Intended for file names and paths.
\newcommand\file[1]{%
\texttt{#1}%
}
% Mono-spaced words
% =================
% Mono-spaced text without syntax highlighting.
% Intended for single words or small passages without special meaning.
% These can be environments, file extensions, and many more.
\newcommand\mono[1]{%
\texttt{#1}%
}
% Inline code
% ===========
% Code snippets with syntax highlighting.
% TODO: Fix special character mess.
%
% Arguments:
% 1. Language.
% 2. Source code.
\newcommand\code[2]{%
% \mintinline{#1}{#2}
\texttt{#2}%
}
% Code block
% ==========
% Pastes in a non-inline code block using minted or lstlistings
% first parameter: programming language
% path to code file
\lstdefinelanguage{latex}{%
language=[LaTeX]TeX
}
\lstdefinelanguage{csharp}{%
language=[Sharp]C
}
\lstdefinelanguage{bibtex}
{keywords={%
@article,@book,@collectedbook,@conference,@electronic,@ieeetranbstctl,%
@inbook,@incollectedbook,@incollection,@injournal,@inproceedings,%
@manual,@mastersthesis,@misc,@patent,@periodical,@phdthesis,@preamble,%
@proceedings,@standard,@string,@techreport,@unpublished%
},
comment=[l][\itshape]{@comment},
sensitive=false,
}
\newcommand\codeblock[2]{%
\ifthenelse{\equal{\listingsmode}{minted}}{%
\inputminted[breaklines]{#1}{#2}
}{%
\ifthenelse{\equal{#1}{latex}}{%
\lstset{language=#1,
basicstyle=\footnotesize\ttfamily,
breaklines=true,
keywordstyle=\color{ForestGreen}\bfseries,
emph={%
subsection, subsubsection, url, includegraphics, toprule,
midrule, bottomrule, cref, setlength, maketitle,
tableofcontents, foreignlanguage, paragraph, subparagraph,
mint, mintinline, inputminted, usemintedstyle, definecolor,
citep, enquote, lstinputlisting%
},
postbreak=\mbox{{$\hookrightarrow$}\space},
emphstyle={\color{ForestGreen}\bfseries},
commentstyle=\color{darkgray},
% Allow special characters in lstlistings.
literate=
{Ö}{{\"O}}1
{Ä}{{\"A}}1
{Ü}{{\"U}}1
{ß}{{\ss}}2
{ü}{{\"u}}1
{ä}{{\"a}}1
{ö}{{\"o}}1
{é}{{\'e}}1
{}{\textellipsis}1
}
\lstinputlisting{#2}%
%
}{%
\lstset{
language=#1,
% Allow special characters in lstlistings.
literate=
{Ö}{{\"O}}1
{Ä}{{\"A}}1
{Ü}{{\"U}}1
{ß}{{\ss}}2
{ü}{{\"u}}1
{ä}{{\"a}}1
{ö}{{\"o}}1
{é}{{\'e}}1
{}{\textellipsis}1
}
\lstinputlisting{#2}
}
}
}
% Simple code examples % Simple code examples
% ==================== % ====================
% Box for example code next to the rendered example. % Box for example code next to the rendered example.
@ -64,7 +208,7 @@
\colrules \colrules
% Left content: code listing: % Left content: code listing:
\begin{subfigure}{\widefigurewidth} \begin{subfigure}{\widefigurewidth}
\inputminted[breaklines]{tex}{listings/#2.tex} \codeblock{latex}{listings/#2.tex}
\end{subfigure} \end{subfigure}
\hspace{\widefiguregap} \hspace{\widefiguregap}
% Right content: image or rendered example: % Right content: image or rendered example:
@ -87,7 +231,7 @@
\hspace{\widefiguregap} \hspace{\widefiguregap}
% Right caption: % Right caption:
\begin{subfigure}[t]{\widefigurewidth} \begin{subfigure}[t]{\widefigurewidth}
\caption{Ergebnis} \caption{Result}
\label{#1-result} \label{#1-result}
\end{subfigure} \end{subfigure}
} }
@ -122,8 +266,8 @@
\definecolor{latexblue}{rgb}{0.9,0.925,0.95} \definecolor{latexblue}{rgb}{0.9,0.925,0.95}
\pagecolor{latexblue} \pagecolor{latexblue}
%\definecolor{latexblue}{rgb}{0.73,0.84,0.92} %\definecolor{latexblue}{rgb}{0.73,0.84,0.92}
\section*{Übung \thechapter} \section*{Exercise \thechapter}
\addcontentsline{toc}{section}{Übung}% \addcontentsline{toc}{section}{Exercise}%
\input{exercises/#1/task.tex} \input{exercises/#1/task.tex}
\newpage \newpage
\nopagecolor \nopagecolor
@ -150,13 +294,13 @@
\ifthenelse{\equal{\exercisemode}{any}}{ \ifthenelse{\equal{\exercisemode}{any}}{
\IfFileExists{#1.raw.tex}{ \IfFileExists{#1.raw.tex}{
\IfFileExists{#1.done.tex}{ \IfFileExists{#1.done.tex}{
\subsubsection*{Vorschau des ungelösten Materials} \subsubsection*{Preview of the raw material}
}{} }{}
\input{#1.raw.tex} \input{#1.raw.tex}
}{} }{}
\IfFileExists{#1.done.tex}{ \IfFileExists{#1.done.tex}{
\IfFileExists{#1.raw.tex}{ \IfFileExists{#1.raw.tex}{
\subsubsection*{Vorschau des gelösten Materials} \subsubsection*{Preview of the solution}
}{} }{}
\input{#1.done.tex} \input{#1.done.tex}
}{} }{}

View File

@ -2,22 +2,30 @@
for D in listings/*; do for D in listings/*; do
if [ -d "${D}" ]; then if [ -d "${D}" ]; then
# Compile without cropping. # Compile without cropping.
# References to other files are interpreted relative to the
# root directory.
for F in ${D}/*_page.tex; do for F in ${D}/*_page.tex; do
if [ -f "${F}" ]; then if [ -f "${F}" ]; then
echo "###### Compiling ${F} ######" echo "###### Compiling ${F} ######"
pdflatex --output-directory "${D}" "${F}" pdflatex --shell-escape --output-directory "${D}" "${F}"
fi fi
done done
# Compile with cropping. # Compile with cropping.
# Careful: References to other files are interpreted relative
# to the file, not to the root directory.
for F in ${D}/*_crop.tex; do for F in ${D}/*_crop.tex; do
if [ -f "${F}" ]; then if [ -f "${F}" ]; then
echo "###### Compiling and cropping ${F} ######" echo "###### Compiling and cropping ${F} ######"
pdflatex --output-directory "${D}" "${F}" pushd "${D}"
pdfcrop "${D}/$(basename -s .tex ${F}).pdf" \ pdflatex --shell-escape "$(basename $F)"
"${D}/$(basename -s .tex ${F}).pdf" pdfcrop "$(basename -s .tex ${F}).pdf" \
"$(basename -s .tex ${F}).pdf"
popd
fi fi
done done
# Compile with BibTeX and cropping. # Compile with BibTeX and cropping.
# References to other files are interpreted relative to the
# root directory.
for F in ${D}/*_bib.tex; do for F in ${D}/*_bib.tex; do
if [ -f "${F}" ]; then if [ -f "${F}" ]; then
echo "###### Compiling and cropping ${F} ######" echo "###### Compiling and cropping ${F} ######"

View File

@ -1,133 +1,131 @@
\chapter{Grundstruktur} \chapter{Basic document structure}
\label{sec:basic-document-structure} \label{sec:basic-document-structure}
Wie sieht so ein \LaTeX-Dokument jetzt eigentlich aus? In essence, every \LaTeX{} document is composed of two parts:
Im Kern besteht es immer aus zwei Teilen: einer Präambel zu Beginn sowie der unmittelbar folgenden Dokumentumgebung. We call the first commands within our \LaTeX{} document the \emph{preamble}.
Als \emph{Präambel} bezeichnen wir die ersten Befehle eines \LaTeX-Dokumentes, mit denen globale Einstellungen wie die Dokumentklasse, die Zeichenkodierung, die Sprache und das Seitenformat festgelegt werden. It specifies global properties of our document, such as the document class, the encoding, the language, the page format, and additional packages that we want to use.
Die \emph{Dokumentumgebung} hingegen enthält den Inhalt, der später in der fertigen \acro{PDF}-Datei erscheinen soll. The \emph{document environment}, on the other hand, contains the actual content of our document, i.\,e., the things that we will later see in our generated \acro{PDF} file.
\Example{lst:latex-document-basic-structure}{basic-document-structure/hello-world}{basic-document-structure/hello-world_crop}{Beispielhafter Aufbau eines einfachen \LaTeX-Dokuments mit Präambel und Dokumentumgebung} \Example{lst:latex-document-basic-structure}{basic-document-structure/hello-world}{basic-document-structure/hello-world_crop}{Exemplary structure of a simple \LaTeX{} document with preamble and document environment}
\section{Präambel} \section{Preamble}
Beginnen wir mit der Präambel. Let's take a closer look at the preamble.
Eine minimale Präambel sollte die folgenden Festlegungen treffen: A minimal preamble should contain the following specifications:
\subsection{Dokumentklasse}\label{sec:document-class} \subsection{Document class}\label{sec:document-class}
\mintinline{latex}|\documentclass[<parameter>]{<dokumentklasse>}| We can define a document class by using the command \code{latex}{\textbackslash documentclass[<para- meter>]\{<document class>\}}.
definiert die Dokumentklasse. The most commonly used document classes that are supported by default are \pkg{article} for short documents, and \pkg{report} for longer ones.
Die verbreitetsten von \LaTeX\ standardmäßig unterstützten Dokumentklassen sind \mintinline{latex}{article} für kurze und \mintinline{latex}{report} für längere Dokumente, \mintinline{latex}{book} für Bücher, \mintinline{latex}{beamer}\footnote{Präsentationen in \LaTeX\ sind ein Thema für sich, auf das wir nicht näher eingehen. Bei Interesse sei diese Einführung von Overleaf empfohlen: \url{https://www.overleaf.com/learn/latex/Beamer}} für Präsentationen sowie \mintinline{latex}{letter}\footnote{Auch auf Briefe wird in diesem Skript nicht weiter eingegangen. WikiBooks gibt eine Einführung: \url{https://en.wikibooks.org/wiki/LaTeX/Letters}} für Briefe. Furthermore, you can use \pkg{book} for books, \pkg{beamer}\footnote{We do not cover making presentations in \LaTeX{} in this tutorial. However, if you are interested in the topic, we recommend this introduction on Overleaf: \url{https://www.overleaf.com/learn/latex/Beamer}} for presentations, and \pkg{letter}\footnote{We also do not cover letters in this script. An introduction can be found on WikiBooks: \url{https://en.wikibooks.org/wiki/LaTeX/Letters}} for letters.
Zusätzlich zu den Standard-Dokumentklassen entwickelten sich die \acro{KOMA}-Script-Klassen.\footnote{Einen umfassenden Überblick über die Möglichkeiten von \acro{KOMA}-Script gibt folgendes Handbuch: \url{https://komascript.de/~mkohm/scrguide.pdf}} In addition to the standard document classes, the \acro{KOMA} script classes have been developed.
Als Alternative zum \mintinline{latex}{article} steht \mintinline{latex}{scrartcl} bereit, \mintinline{latex}{report} wird durch \mintinline{latex}{scrreport} ersetzt, \mintinline{latex}{scrbook} kann anstelle von \mintinline{latex}{book} verwendet werden und \mintinline{latex}{scrlttr2} ist als Ersatz für \mintinline{latex}{letter} entstanden. They provide alternatives to the document classes mentioned above:
Eine vollständige Liste aller möglichen \acro{KOMA}-Script-Dokumentklassen ist online\footnote{Erreichbar unter \url{https://komascript.de/komascriptbestandteile}} verfügbar. In lieu of \pkg{article} you can use \pkg{scrartcl}, \pkg{report} is replaced by \pkg{scrreprt},\footnote{Those vowels are indeed missing, do not try to insert them.} and \pkg{scrbook} can be used instead of \pkg{book}.
Die \acro{KOMA}-Klassen ändern das Layout des fertigen \acro {PDF}-Dokuments und bringen zusätzliche Funktionalitäten mit. As a replacement for \pkg{letter}, one can use \pkg{scrlttr2}.
Während die Standard-Klassen für den Gebrauch in Amerika gedacht sind, folgen \acro{KOMA}-Klassen europäischen Normen, etwa bei Brief"|formaten. A complete list of all \acro{KOMA} script classes is available online.\footnote{Available at: \url{https://komascript.de/komascriptbestandteile}}
By using \acro{KOMA} document classes, the layout of the generated \acro{PDF} document is changed.
On top of that, they provide additional functionalities.
The standard document classes are designed according to US-American conventions
whereas \acro{KOMA} classes adhere to European norms, e.\,g., for
writing letters.
Dem \mintinline{latex}{\documentclass}-Befehl können verschiedene optionale Parameter übergeben werden. Each \code{latex}{\textbackslash documentclass} command can hold optional parameters in
\mintinline{latex}{\documentclass[10pt,a5paper,landscape]{scrartcl}} etwa konfiguriert einen \acro{KOMA}-Script-Artikel mit Schriftgröße 10\,pt\footnote{Die Standardschriftgröße wäre hier 12\,pt.} auf A5-Papier\footnote{In der Voreinstellung handelte es sich um A4-Papier.} im Querformat. square brackets.
Auch die Sprache kann mit übergeben werden (vgl. dazu \cref{sec:language}). \code{latex}{\textbackslash documentclass[10pt,a5paper,landscape]scrartcl\}},
for instance, configures a \acro{KOMA} script article and sets its font size to
10\,pt,\footnote{The standard font size is 12\,pt.} the page size to
A5,\footnote{The default case would be A4.} and the orientation of the page to
landscape.
The language can be passed as an optional parameter, too (cf. \cref{sec:language}).
\subsection{Exkurs: Pakete} \subsection{Digression: packages}
\label{sec:packages} \label{sec:packages}
\begin{minted}{latex}
\usepackage[<optionen>]{<paketname>}
\end{minted}
Pakete sind \LaTeX-Erweiterungen, die zusätzliche Befehle und Funktionalitäten zur Verfügung stellen.
Es existieren verschiedene Pakete für verschiedene Anwendungsfälle (z.\,B. Formelsatz, Listen, \textellipsis).
Bevor sie verwendet werden können, müssen sie in der Präambel eingebunden werden.
Hierfür wird der obige Befehl verwendet.
Die wichtigsten \LaTeX-Pakete sind im Comprehensive \TeX\ Archive Network,\footnote{Erreichbar unter \url{https://www.ctan.org/}} kurz \acro{CTAN}, abgelegt.
Hier finden sich auch Dokumentationen zu den einzelnen Funktionalitäten.
\subsection{Kodierung} \codeblock{latex}{listings/basic-document-structure/packages.tex}
\begin{minted}{latex} Packages provide additional commands and functionalities that we can use within our \LaTeX{} source code.
\usepackage[utf8]{inputenc} There are numerous packages for different use cases (e.\,g., typesetting formulas, lists, \textellipsis).
\usepackage[t1]{fontenc} In order to use a package, it must be included within the preamble.
\end{minted} To do so, the above-mentioned command is used.
Pakete werden zum Beispiel zur Auswahl der Zeichenkodierung benötigt. The most important \LaTeX{} packages can be found in the Comprehensive \TeX\ Archive Network, short: \acro{CTAN}.\footnote{Available at: \url{https://www.ctan.org/}}
Die Zeichenkodierung\footnote{Vgl. \url{https://de.wikipedia.org/wiki/Zeichenkodierung}} entscheidet darüber, welcher Zeichensatz zur Verfügung steht. You can also find documentation for the packages there.
Der Standardzeichensatz in \LaTeX\ ist \acro{ASCII}.\footnote{Vgl. \url{https://de.wikipedia.org/wiki/American_Standard_Code_for_Information_Interchange}}
Dieser amerikanische Standard enthält beispielsweise keine Umlaute und ist daher für die meisten Einsätze wenig geeignet.
Als universelle Zeichenkodierung kann \acro{UTF-8}\footnote{Vgl. \url{https://de.wikipedia.org/wiki/UTF-8}} verwendet werden.
In \LaTeX-Dokumenten sind zwei verschiedene Zeichenkodierungen von Belang. \subsection{Encoding}
Das Input Encoding (kurz: \mintinline{latex}{inputenc}) bezieht sich auf den Quelltext, den wir eingeben, während das Font Encoding (kurz: \mintinline{latex}{fontenc}) das fertige \acro{PDF}-Dokument beeinflusst. \codeblock{latex}{listings/basic-document-structure/encoding.tex}
Konkret beeinflusst \mintinline{latex}{fontenc} die Wahl der Schriftartdatei, die verwendet wird, um den Inhalt des Dokuments darzustellen, denn auch diese muss natürlich Sonderzeichen beinhalten.\footnote{Details zur Arbeitsweise von \mintinline{latex}{fontenc} gibt dieser Beitrag: \url{https://www.texwelt.de/fragen/5537/was-macht-eigentlich-usepackaget1fontenc}} One use case for packages is specifying the encoding of our \LaTeX{} document.
\mintinline{latex}{T1} ist eine Kodierung, die mit einer begrenzten Anzahl an Zeichen europäische Sprachen abzubilden versucht. The character encoding\footnote{cf. \url{https://en.wikipedia.org/wiki/Character_encoding}} determines the available character set.
The standard encoding in \LaTeX{} is \acro{ASCII}.\footnote{cf. \url{https://en.wikipedia.org/wiki/ASCII}}
It is an American character encoding and therefore does not contain German umlauts or most other special characters, which makes it unsuitable at least for non-english use cases.
Instead, \acro{UTF-8}\footnote{cf. \url{https://en.wikipedia.org/wiki/UTF-8}} can be used as a universal character encoding.
\subsection{Sprache}\label{sec:language} In \LaTeX{}, we need to specify two character encodings:
\begin{minted}{latex} The input encoding (\mono{inputenc}), which refers to our source code, and the font encoding (\mono{fontenc}), which determines what the content of our \acro{PDF} document looks like.\footnote{Details on \mono{fontenc} can be found at: \url{https://tex.stackexchange.com/questions/108417/font-encoding-in-latex}}
\usepackage[ngerman]{babel} \pkg{T1} is an encoding that tries to cover most European languages with a limited number of characters.
\end{minted}
Das Paket \mintinline{latex}{babel} stellt sprachspezifische Informationen (z.\,B. Silbentrennung, Sonderzeichen, Wechsel zwischen Fonts, Übersetzung von Labels\footnote{Vgl. \cref{sec:references}} wie \enquote{Kapitel}, \enquote{Inhaltsverzeichnis} oder \enquote{Abbildung}) bereit. \subsection{Language}\label{sec:language}
Als optionaler Parameter kann die Sprache übergeben werden. \codeblock{latex}{listings/basic-document-structure/language.tex}
\mintinline{latex}{ngerman} steht hierbei für die Neue Deutsche Rechtschreibung. The package \pkg{babel} provides language-specific information (e.\,g., on hyphenation, special characters, changing fonts, translation of labels\footnote{cf. \cref{sec:references}} like \enquote{Chapter,} \enquote{Table of Contents,} or \enquote{Figure.}
Manche Pakete erfordern es, dass die Sprachangabe schon als optionaler Parameter dem \mintinline{latex}{\documentclass}-Befehl\footnote{Vgl. \cref{sec:document-class}} übergeben wird. The desired language can be passed as an optional parameter.
In diesem Fall wird der optionale Parameter beim Einbinden von \mintinline{latex}{babel} einfach weggelassen. \pkg{ngerman}, for instance, is used for the new German spelling.
Some packages require that the language is already passed as an optional parameter in the \code{latex}{\textbackslash documentclass} command.
In this case, just leave out the optional parameter for the language within the \pkg{babel} inclusion command.
In einem Dokument können auch mehrere Sprachen verwendet werden. We can also use multiple languages in our document.
Sie können einfach kommagetrennt als optionale Parameter aufgelistet werden. To do so, we pass the languages, separated by commas, as an optional parameter to the babel inclusion command.
Im Dokument kann mit dem Befehl \mintinline{latex}{\selectlanguage{<sprache>}} zwischen den Sprachen umgeschaltet werden. Within our document, we can switch between languages with the \code{latex}{\textbackslash selectlanguage\{<language>\}} command.
Fremdsprachiger Text lässt sich alternativ auch über folgenden Befehl einbinden: Alternatively, foreign-language text can be declared by using the following command:
\begin{minted}{latex}
\foreignlanguage{<sprache>}{<text>}
\end{minted}
\section{Dokumentumgebung} \codeblock{latex}{listings/basic-document-structure/foreign-language.tex}
Zwischen \mintinline{latex}{\begin{document}} und \mintinline{latex}{\end{document}} gehören die Inhalte, die tatsächlich im Dokument erscheinen sollen. \section{Document environment}
The actual content of the \acro{PDF} document needs to be put inside of an environment starting with \code{latex}{\textbackslash begin\{document\}} and ending with \code{latex}{\textbackslash end\{document\}}.
\subsection{Fließtext} \subsection{Continuous text}
Der einfachste Inhalt der Dokumentumgebung ist Fließtext. The easiest content that we can integrate into the document environment is continuous text.
Er kann direkt in den Quelltext geschrieben werden. We can write it directly into our source code.
Zeilenumbrüche und zu mehreren auftretende Leerzeichen werden dabei ignoriert. Line breaks and multiple consecutive spaces are ignored by \LaTeX{}.
Leerzeilen erzeugen einen neuen Absatz, der standardmäßig mit einem Einzug beginnt.\footnote{Der Befehl \mintinline{latex}{\noindent} verhindert dies.} Blank lines create a new paragraph, that is indented by default.\footnote{The automatic indentation of new paragraphs can be prevented by using the command \code{latex}{\textbackslash noindent}.}
Manuelle Umbrüche können mit zwei Backslashes (\textbackslash\textbackslash) erzwungen werden. Manual line breaks can be enforced with two backslashes (\textbackslash\textbackslash).
Dies sollte jedoch vermieden werden. This should be avoided, though.
\subsection{Kommentare} \subsection{Comments}
Einige Zeichen sind für besondere Funktionen reserviert. Some characters are reserved for \LaTeX-specific commands, for instance, the percent sign.
So bewirkt ein Prozent-Zeichen beispielsweise, dass der Rest einer Zeile vom Compiler ignoriert wird. Using a percent sign tells the \LaTeX{} compiler to ignore the rest of the line, so the text after the percent character will not appear in the generated \acro{PDF} document.
Der Text erscheint also nicht im fertigen \acro{PDF}-Dokument. This is called a \emph{comment}\textit{,}
Dies kann nützlich sein, um während der Bearbeitung Notizen festzuhalten, ohne Einfluss auf das fertige Dokument zu nehmen. and it can be useful to take notes while working on a document without affecting the document itself.
Wir sprechen hier von einem Kommentar.
Falls tatsächlich ein Prozentzeichen erscheinen soll, könnt ihr dies durch einen Backslash erreichen: \mintinline{latex}{\%}. There are a few more of these reserved characters, as we will see and learn to deal with in \cref{sec:more-special-characters}.
Diese Lösung, die auch als Escaping bezeichnet wird, funktioniert auch für die Zeichen \#, \$, \&, \_, \{ und \}.
Für den Backslash muss der Befehl \mintinline{latex}{\textbackslash} verwendet werden.\footnote{Eine Übersicht weiterer Sonderzeichen ist im zugehörigen \cref{sec:special-characters} zu finden.}
\subsection{Abschnitte und Kapitel} \subsection{Sections and chapters}
Texte werden durch Überschriften in Abschnitte und Kapitel unterteilt. Continuous text can be structured by headings that divide the document into sections and chapters.
Immer nutzbar sind die in \cref{lst:headlines} dargestellten Befehle. Needless to say, \LaTeX{} provides us with commands for that.
\Example{lst:headlines}{basic-document-structure/headlines}{basic-document-structure/headlines_crop}{Überschriftenebenen} The commands that are depicted in \cref{lst:headlines} can be used with any document class.
Je nach Dokumentklasse sind außerdem \mintinline{latex}{\chapter{Kapitel}} und \mintinline{latex}{\part{Teil}} verfügbar -- beispielsweise in Büchern.
Mit Sternchen fallen bei allen diesen Befehlen die Nummerierung und der Eintrag im Inhaltsverzeichnis\footnote{Vgl. \cref{sec:table-of-contents}} weg:
\begin{minted}{latex} \Example{lst:headlines}{basic-document-structure/headlines}{basic-document-structure/headlines_crop}{Heading Levels}
\section*{Kommt nicht im Inhaltsverzeichnis vor}
\end{minted}
Ein alternativer Titel im Inhaltsverzeichnis kann als optionaler Parameter in eckigen Klammern zwischen dem Befehl und dem eigentlichen Titel angegeben werden. Some document classes provide additional commands. In a \pkg{report}, you get \code{late}{\textbackslash chapter\{Chapter\}}, and in a \pkg{book}, additionally \code{latex}{\textbackslash part\{Part\}}.
You can mark the command with an asterisk if you want to omit the numbering of a section and exclude it from the table of contents:\footnote{cf. \cref{sec:table-of-contents}}
\begin{minted}{latex} \codeblock{latex}{listings/basic-document-structure/section.tex}
\section[Titel im Verzeichnis]{Kapitelüberschrift}
\end{minted}
\subsection{Titelei} An alternative title for the table of contents can be declared as an optional
Ein einfacher Titel lässt sich im Dokument mit dem Befehl \mintinline{latex}{\maketitle} erzeugen. parameter in square brackets between the command and the actual title:
Die Werte für die Einträge müssen in der Präambel festgelegt werden.
Mehrere Autoren werden dabei mit \mintinline{latex}{\and} verbunden.
Fehlt der Befehl \mintinline{latex}{\date}, wird per default das aktuelle Datum gesetzt.
Die genaue Gestaltung hängt von der verwendeten Dokumentklasse ab.
\Example{lst:titles}{basic-document-structure/titles}{basic-document-structure/titles_crop}{Die Titelei} \codeblock{latex}{listings/basic-document-structure/title-in-toc.tex}
\subsection{Verzeichnisse}\label{sec:table-of-contents} \subsection{Front matter}
A simple front matter can be created by using the command \code{latex}{\textbackslash maketitle}.
The values to be inserted into the front matter must be specified within the preamble.
Multiple authors are joined by \code{latex}{\textbackslash and}.
If the date is not specified by the \code{latex}{\textbackslash date} command, the current date will be inserted by default.
The design of the front matter depends on the specified document class.
Aus allen mit den oben genannten Befehlen eingefügten Abschnitten fügt der Befehl \mintinline{latex}{\tableofcontents} ein automatisch nummeriertes Inhaltsverzeichnis zusammen (wie zum Beispiel in \cref{lst:main-file} auf \cpageref{lst:main-file} zu sehen). \Example{lst:titles}{basic-document-structure/titles}{basic-document-structure/titles_crop}{The front matter}
Die Aufzählungszeichen, die Tiefe der Aufzählung und viele weitere Gestaltungselemente sind frei anpassbar.\footnote{Ein empfehlenswerter Blogpost hierzu ist unter \url{https://texblog.org/2011/09/09/10-ways-to-customize-tocloflot/} verfügbar.}
Damit \LaTeX\ das Inhaltsverzeichnis vollständig baut, muss das Projekt zweimal kompiliert werden.
Neben dem Inhaltsverzeichnis stehen auch eine \mintinline{latex}{\listoffigures} (Abbildungsverzeichnis) und eine \mintinline{latex}{\listoftables} (Tabellenverzeichnis) zur Verfügung. \subsection{Indices}\label{sec:table-of-contents}
Aufgeführt werden jeweils die Bild- oder Tabellenunterschriften.\footnote{Siehe hierzu \cref{sec:graphics} (Grafiken) und \cref{sec:tables} (Tabellen).}
The command \code{latex}{\textbackslash tableofcontents} generates an automatically numbered table of contents by making use of the above-mentioned commands for dividing our text into sections and chapters (this can bee seen in \cref{lst:main-file} on \cpageref{lst:main-file}).
The numbering style and depth, and many other options can, of course, be specified manually.\footnote{We recommend the following blogpost: \url{https://texblog.org/2011/09/09/10-ways-to-customize-tocloflot/}}
For \LaTeX{} to create our table of contents properly, the project has to be compiled twice.
Besides the table of contents, you can also generate a \code{latex}{\textbackslash listoffigures} (list of figures) and a \code{latex}{\textbackslash listoftables} (list of tables).
The captions of your figures and tables will appear within those indices.\footnote{cf. \cref{sec:graphics} (Graphics) and \cref{sec:tables} (Tables) for more information on captions}

View File

@ -1,77 +1,102 @@
\chapter{Wie funktioniert \LaTeX?} \chapter{How does \LaTeX{} work?}
\label{sec:basic-functionality} \label{sec:basic-functionality}
Programme zur Textverarbeitung und Dokumentenerstellung nutzen unterschiedliche Vorgehensweisen, um basierend auf einer bearbeiteten Datei ein Dokument zu erstellen. Word processing and document creation programs have to decide how to translate user input into a document layout.
Bei der Arbeit mit Microsoft Word gilt die Regel: Ein als \acro{PDF} exportiertes Dokument sieht genauso aus wie das Quelldokument in Word. Dort wo eine Grafik in Word platziert wird, ist sie auch im \acro{PDF} aufzufinden. Anpassungen der Darstellung in MS Word und anderen bekannten Programmen führen also zu einer direkten optischen Veränderung im resultierenden Export. Diese Art der Formatierung wird \emph{What you see is what you get} genannt (kurz: \acro{WYSIWYG}). Inhalt und Struktur sind eng miteinander verbunden. There are different concepts to approach this topic.
When working with Microsoft Word, the rule is: a document exported as \acro{PDF} looks exactly like the source document in Word.
Where a graphic is placed in Word, it is also found in the \acro{PDF}.
Adjustments to the appearance in Word and other popular programs thus result in a direct visual change.
This type of formatting is called \emph{What you see is what you get} (\acro{WYSIWYG} for short).
Content and formatting are closely linked.
\LaTeX{} arbeitet hingegen nach dem Prinzip \emph{What you get is what you mean} (kurz: \acro{WYGIWYM}). Inhalt und Struktur sind stärker getrennt. \LaTeX{}, on the other hand, works according to the principle \emph{What you get is what you mean} (\acro{WYGIWYM} for short).
Der Inhalt wird in einem Dokument in einfacher Textform platziert, zusammen mit sogenannten \emph{Befehlen}\textit{.} Die Kombination von inhaltlichem Text und Befehlen nennen wir auch Quelltext. Um die Darstellung des Inhalts anzupassen, ändern wir nicht den Text selbst, sondern fügen entsprechende Befehle hinzu. Diese werden von einem \emph{Compiler} verarbeitet, welcher die Darstellung je nach Befehl anpasst. Zeile für Zeile verarbeitet der Compiler Text und Befehle aus unserem Quelltext. Wenn der gesamte Quelltext von dem Compiler verarbeitet wurde, erhalten wir das finale Dokument. Es gibt zwar unterschiedliche Exportmöglichkeiten, meistens lassen wir uns das Dokument aber als \acro{PDF} ausgeben -- wie auch bei Word. Content and formatting are separated more clearly.
% Alter Paragraph: The content is placed in a document in plain text form, together with so-called \emph{commands}.
%Der Compiler nimmt besagten Quelltext entgegen und liest ihn Zeile für Zeile. The combination of text content and commands is also called \emph{source} code.
%Erkennt er einen Befehl, wird dieser verarbeitet. Verschiedene Befehle haben verschiedene Einflüsse auf das Endresultat, dazu später mehr. Wenn der gesamte Quelltext von dem Compiler verarbeitet wurde, erhalten wir das finale Dokument. Es gibt zwar unterschiedliche Exportmöglichkeiten, meistens lassen wir uns das Dokument aber als \acro{PDF} ausgeben -- wie auch bei Word.
Als kurzes Beispiel für einen Befehl dient uns hier das Hervorheben von Wörtern oder Sätzen. Der Befehl lautet \mintinline{latex}{\emph{}}. Den Text, den wir hervorheben möchten, schreiben wir im Quellcode innerhalb der geschweiften Klammern, etwa so: \mintinline{latex}{\emph{Guten Tag!}}. Im resultierenden \acro{PDF} erscheint dieser Text dann kursiv: \emph{Guten Tag!} Von dem Befehlsbezeichner und den Sonderzeichen ist keine Spur mehr zu sehen. Wir schreiben also keinen kursiven Text innerhalb des Quellcodes, sondern teilen dem Compiler einfach mit, dass bestimmte Wörter doch bitte hervorgehoben werden sollen. To customize the presentation of the content, we do not set the text appearance itself but add appropriate commands instead.
These are processed by a \emph{compiler}, which adjusts the resulting appearance depending on the command.
Line by line, the compiler processes text and commands from our source code.
When all the source code has been processed by the compiler, we get the final document.
There are different export options, but most of the time we output the document as a \acro{PDF}\,---\,just like in Word.
Dieses einfache Beispiel verdeutlicht eine Stärke des \acro{WYGIWYM}-Prinzips. As a brief example for a command, we shall use the emphasis of words or sentences.
Wir markieren Textelemente auf der semantischen Ebene und können die zugehörigen typographischen Anpassungen an zentraler Stelle vornehmen -- oder lassen \LaTeX{} die Konfiguration selbst erledigen. The command is \code{latex}{\textbackslash emph\{\}}.
Wenn wir etwa die Art und Weise des Hervorhebens ändern möchten, dann können wir dies zentral konfigurieren. An allen Stellen, wo \mintinline{latex}{\emph{}} verwendet wird, wird das Endresultat entsprechend angepasst. Es besteht keine Notwendigkeit, an jeder einzelnen Stelle Anpassungen vorzunehmen. Das Prinzip ist ähnlich zu Formatvorlagen in Office-Programmen, wenn auch konsequenter und mächtiger. We write the text we want to emphasize inside the curly braces in the source code, like this:
% Überleitung zum nächsten Abschnitt?? \code{latex}{\textbackslash emph\{Good morning!\}}.
In the resulting \acro{PDF}, this text will appear in italics: \emph{Good morning!}
There is no trace of the command identifier and the special characters.
You can see, we are not writing italic text inside the source code, we just tell the compiler that certain words should be emphasized by the use of a command.
% TEMP/UNSURE This simple example illustrates a strength of the \acro{WYGIWYM} principle.
%Wie man mit Word oder anderen Programmen ein \acro{PDF} generiert, wisst ihr vermutlich. Besonders kompliziert ist es nicht. Im Grunde benötigen wir nur das Programm selbst. We mark text elements on a semantic level and can make the associated typographic adjustments centrally\,---\,or let \LaTeX{} do the configuration itself.
% OLD For instance, if we want to change the way highlighting is done, we can configure this once.
%Dieses einfache Beispiel verdeutlicht eine Stärke des \acro{WYGIWYM}-Prinzips. At all places where \code{latex}{\textbackslash emph\{\}} is used, the final result will be adjusted accordingly.
%Wir markieren Textelemente auf der semantischen Ebene (\enquote{Dieser Text soll hervorgehoben werden.}) und können die zugehörigen typographischen Anpassungen (\enquote{Hervorgehobener Text wird kursiv gedruckt.}) an zentraler Stelle festlegen -- oder gleich \LaTeX{} überlassen. There is no need to make adjustments at each occurrence of an emphasized word.
%Das Prinzip ist ähnlich zu Formatvorlagen in Office-Programmen, wenn auch konsequenter und mächtiger. The principle is similar to style sheets in office programs, although more consistent and powerful.
%Basierend auf dem Text, den Befehlen und den Standard-Einstellungen des Compilers entsteht so das finale Dokument.
\section{Was brauchen wir dazu?} \section{What do we need to use \LaTeX{}?}
\label{subsec:what-we-need} \label{subsec:what-we-need}
Möchten wir mit \LaTeX{} ein \acro{PDF}-Dokument generieren, so benötigen wir zumindest zwei Programme. Eines, um den Quelltext zu erstellen, und ein zweites, um den Quelltext zu verarbeiten. Letzteres ist der bereits erwähnte Compiler. If we want to generate a \acro{PDF} document with \LaTeX{}, we need at least two programs.
One to create the source code, and a second one to process the source code.
The latter is the already mentioned compiler.
Grundsätzlich ist ein einfaches Textbearbeitungsprogramm zur Erstellung des Quelltextes ausreichend. Die meisten Betriebssysteme beinhalten solche Programme bereits. Vielleicht seid ihr schon mit Anwendungen wie Notepad++\footnote{Verfügbar unter \url{https://notepad-plus-plus.org/}.} vertraut, auch diese sind geeignet. In principle, a simple text editing program is sufficient for creating the source code.
Fortgeschrittene Programme wie TeXstudio\footnote{Verfügbar unter \url{https://www.texstudio.org/}.} oder Texmaker\footnote{Verfügbar unter \url{https://www.xm1math.net/texmaker/}.} integrieren zusätzliche Funktionen, welche die Verwendung von Befehlen erleichtern. Hier habt ihr freie Wahl. Most operating systems provide such programs out of the box.
% Letzten Paragraphen irgendwie weniger abrupt beenden? Maybe you are already used to applications like Notepad++,\footnote{Available at \url{https://notepad-plus-plus.org/}.} these are usable as well.
Then there are advanced programs like \TeX{}studio\footnote{Available at \url{https://www.texstudio.org/}.} or Texmaker\footnote{Available at \url{https://www.xm1math.net/texmaker/}.} which integrate additional functions that facilitate the use of commands.
You are free to choose, but we recommend to use \TeX{}studio.
Zum Kompilieren des Quelltexts wird, wie bereits erwähnt, ein Compiler benötigt. As mentioned before, we need a compiler to be able to compile our source code.
Der Compiler ist meist Teil einer Sammlung von Programmen und Paketen, die zusammen eine \LaTeX-Distribution bilden. The compiler is usually part of a collection of \emph{programs} and \emph{packages} which are together called a \LaTeX{} \emph{distribution}\textit{.}
Auf die Hilfsprogramme werden wir für den Moment nicht näher eingehen.\footnote{Eines dieser Hilfsprogramme kommt später im Kapitel \ref{sec:literature} zum Einsatz, wenn wir Literatur referenzieren.} Die enthaltenen Pakete stellen verschiedene Befehle zur Verfügung. The included packages provide various additional commands.
For now, we will skip over the many programs.\footnote{We will get to know one of these helper programs later on, in \ref{sec:literature}, when we are citing literature.}
Wir verwenden den Compiler einer Distribution unserer Wahl. Bekannte Distributionen sind MiK\TeX,\footnote{Für Windows, macOS und Linux. Verfügbar unter \url{https://miktex.org/}.} Mac\TeX\footnote{Für macOS und Linux. Verfügbar unter \url{https://www.tug.org/mactex/}.} und \TeX{} Live.\footnote{Für Windows, macOS und Linux. Verfügbar unter \url{https://www.tug.org/texlive/}.} Multiple different \LaTeX{} distributions exist.
Installiert euch am besten gleich eine davon. Die Installation kann unter Umständen mehrere Stunden dauern. Manche Distributionen gibt es daher als kleine und als vollständige Variante zum Download. Some of the well-known ones are MiK\TeX,\footnote{For Windows, macOS and Linux. Available at \url{https://miktex.org/}.} Mac\TeX,\footnote{For macOS and Linux. Available at \url{https://www.tug.org/mactex/}.} and \TeX{} Live.\footnote{For Windows, macOS, and Linux. Available at \url{https://www.tug.org/texlive/}.}
Die vollständige Variante enthält alle Pakete, während in der normalen Version Pakete erst dann heruntergeladen werden, wenn sie benötigt werden. It is best to install one of them right away.
Die Entscheidung, ob ihr lieber zu Beginn oder später während des Arbeitens auf den Download wartet, können wir euch leider nicht abnehmen. The installation may take several hours.
For this reason, some distributions are available for download in a small and a full version.
The full version contains all packages, while the small version downloads packages only when they are needed.
Unfortunately, we cannot take away the decision if you would rather wait for the download at the beginning or later while you are working.
\section{Die Befehle} \section{The commands}
\label{subsec:command-structure} \label{subsec:command-structure}
Die in Quelltext verwendeten Befehle folgen einem allgemeinen Aufbau: The commands used in source code follow a general structure:
\begin{minted}{xml} \codeblock{xml}{listings/basic-functionality/command-structure.txt}
\<befehl>[<optionale_parameter>]{<obligatorische_parameter>}
\end{minted} A command can use several optional and/or mandatory parameters.
Ein Befehl kann mehrere optionale und/oder obligatorische Parameter verwenden. Manche Befehle besitzen keine obligatorischen Parameter. Ein paar Beispiele sind in \cref{tbl:latex-commands} dargestellt. Some commands have no mandatory parameters at all.
Some examples are shown in \cref{tbl:latex-commands}.
\begin{table}[h!] \begin{table}[h!]
\widebox{ \widebox{
\begin{tabular}{@{}p{\widefigurewidth}p{\widefigurewidth}@{}} \begin{tabular}{@{}p{\widefigurewidth}p{\widefigurewidth}@{}}
\toprule \toprule
Befehl & Effekt \\ Command & Effect \\
\midrule \midrule
\mintinline{latex}{\newpage} & fügt eine neue Seite ein \\ \code{latex}{\textbackslash newpage} & inserts a new page \\
\mintinline{latex}{\textbf{Text}} & schreibt den übergebenen Text fett \\ \code{latex}{\textbackslash textbf\{Text\}} & prints the text in bold font \\
\mintinline{latex}{\usepackage[utf8]{inputenc}} & setzt die Textkodierung auf \acro{UTF-8} \\ \code{latex}{\textbackslash usepackage[utf8]\{inputenc\}} & sets the text encoding to \acro{UTF-8} \\
\mintinline{latex}{\documentclass[a4paper,12pt]{article}} & setzt die Dokumentenklasse \\ \code{latex}{\textbackslash documentclass[a4paper,12pt]\{article\}} & specifies the document class \\
\mintinline{latex}{\frac{3}{4}} & fügt den mathematischen Bruch ein \\ \code{latex}{\textbackslash frac\{3\}\{4\}} & inserts a mathematical fraction \\
\bottomrule \bottomrule
\end{tabular} \end{tabular}
} }
\caption{Beispiele für \LaTeX-Befehle} \caption{Examples for \LaTeX-commands}
\label{tbl:latex-commands} \label{tbl:latex-commands}
\end{table} \end{table}
Sollte ein Befehl mehrere optionale Parameter erlauben, welche gleiche Eingabetypen akzeptieren, muss angegeben werden, welcher Parameter gemeint ist. Beispielsweise akzeptiert der Befehl für das Einbinden von Grafiken optionale Parameter für Breite und Höhe. Bei einer Eingabe von \mintinline{tex}|[12cm, 4cm]| wäre unklar, welcher Wert für welchen Parameter bestimmt ist. Um die Zuweisung zu konkretisieren, können die Parameter explizit angegeben werden: If a command allows multiple optional parameters that accept similar inputs, it is sometimes necessary to specify which parameter is meant.
\begin{minted}{tex} For example, the command for embedding graphics accepts optional parameters for width and height.
\includegraphics[width=12cm, height=4cm]{bild.png} If \mono{[12cm, 4cm]} were entered, it would be unclear which value is intended for which parameter.
\end{minted} To make the assignment more concrete, it is possible to specify the parameters
explicitly:
\codeblock{latex}{listings/basic-functionality/parameters.tex}
As the examples already show, many different commands can be used.
Some are intended for use in mathematical formulas, others allow the inclusion of graphics.
In the beginning, it will take some getting used to.
However, you dont have to learn every single command by heart: As soon as you remember the most important commands, you can easily create simple documents and look up everything else.
Wie die Beispiele bereits zeigen, können Befehle sehr unterschiedlich sein. Manche sind für Verwendung in mathematischen Formeln bestimmt, andere ermöglichen das Einbinden von Grafiken. Zu Anfang wird es gewöhnungsbedürftig sein, sich alle häufig vorkommenden Befehle zu merken -- aller Anfang ist bekanntlich schwer. Nach etwas Übung und Geduld sind einfache Dokumente aber im Handumdrehen erstellt.

View File

@ -1,44 +1,38 @@
\chapter*{Erste Schritte mit \LaTeX} \newpage
\addcontentsline{toc}{section}{Erste Schritte mit \LaTeX} \definecolor{latexblue}{rgb}{0.9,0.925,0.95}
\pagecolor{latexblue}
Dieses Skript dient als kurze Referenz zum Umgang mit LateX und als Übungsbeispiel für das LaTeX-Tutorium der Fachschaft WIAI. \chapter*{First steps with \LaTeX}
Viele Aufgaben erfordern es, das Skript selbst anzupassen. \addcontentsline{toc}{section}{First steps with \LaTeX}
Das dafür benötigte Projektarchiv mit allen Quelltextdateien sowie die aktuellste Version dieses Skriptes sind auf Github\footnote{\url{https://github.com/fs-wiai/latex-script/releases}} zu finden.
Bevor wir ins Arbeiten mit \LaTeX{} einsteigen können, müssen wir es natürlich zunächst installieren. This script serves as a short \LaTeX{} reference and as exercise material for the Fachschaft \acro{WIAI} \LaTeX{} workshop.
Außerdem müssen wir einige Anpassungen vornehmen, um mit diesem Projekt arbeiten zu können. All of the source files and the latest version of this script can be found on Github.\footnote{\url{https://github.com/fs-wiai/latex-script/releases}}
Alle Schritte erläutern wir in den folgenden Kapiteln näher.
Nach und nach werdet ihr so ein Verständnis der Arbeitsweise mit \LaTeX{} aufbauen. The following instructions will equip you with the programs necessary to create documents with \LaTeX{}---they will be explained in the following chapters.
Für den Anfang folgt einfach der Anleitung. Please, make sure to install the \emph{compiler first} and the \emph{editor afterwards}\textit{.}
Achtet bitte darauf, dass ihr \emph{zuerst} den Compiler und \emph{danach} einen Editor installiert.
\section*{Compiler} \section*{Compiler}
Zunächst zum Compiler. Ihn brauchen wir, um den Quelltext, den wir schreiben, in ein \acro{PDF} umzuwandeln. Hier gibt es für verschiedene Betriebssysteme unterschiedliche Compiler, wie etwa MikTeX für Windows,\footnote{\url{https://miktex.org/download}} MacTex für MacOS\footnote{\url{http://tug.org/mactex/}} und TeXLive für Linux-Distributionen.\footnote{Sofern ihr eine debianbasierte Linux-Distribution verwendet, kann der Compiler mittels \mintinline{bash}{sudo apt install texlive-full} installiert werden. Für andere Distributionen findet ihr eine Anleitung unter \url{https://tug.org/texlive/doc/texlive-en/texlive-en.html\#installation}.} Bestenfalls installiert ihr die volle Version mit allen Paketen. Lets start with the compiler.
(Seriously!)
We will need it to convert our \LaTeX{} documents into \acro{PDF}s.
There are different compilers for different operating systems;
for example, MikTeX for Windows,\footnote{\url{https://miktex.org/download}} Mac\TeX{} for macOS,\footnote{\url{http://tug.org/mactex/}} and \TeX{}Live for Linux distributions.\footnote{On Debian-based Linux distributions, install the compiler by executing \sh{sudo apt install texlive-full.}
For other distributions, see \url{https://tug.org/texlive/doc/texlive-en/texlive-en.html\#installation}.}
In case you get to choose, it is best to install the full version with all packages.
\section*{Editor} \section*{Editor}
Sobald ihr das gemacht habt, könnt ihr euch auch schon einen Editor As soon as you have installed the compiler, you can download an editor that you are going to use to write your \LaTeX{} documents.
herunterladen, in dem ihr eure \LaTeX-Dokumente gerne schreiben möchtet. Dafür Any editor will do (notepad++, Atom, VS Code, etc.).
ist eigentlich jeder Editor geeignet (notepad++, Atom, VS Code, usw.). Wir However, for beginners, we recommend using \TeX{}studio,\footnote{You find the latest version on \url{https://www.texstudio.org/}.} a program that supports you with \LaTeX-specific features.
empfehlen für Anfänger jedoch ein Programm, das \LaTeX-spezfische Funktionen
besitzt, wie etwa TeXstudio.\footnote{Eine aktuelle Version findet ihr unter
\url{https://www.texstudio.org/}.}
\section*{Compilerbefehl ändern} \section*{Compiling for the first time}
Damit es beim Kompilieren dieses Dokuments nicht zu Fehlern kommt, müsst ihr Open up the file \file{main.tex} in \TeX{}studio.
nun den Compilerbefehl ändern. Klickt dazu in TeXstudio zunächst auf die It can be found in our project directory.
Schaltfläche \emph{Optionen} und anschließend auf \emph{TeXstudio By pressing \faForward, it is converted into a a file called \file{main.pdf}.
konfigurieren \textellipsis}. Danach wird sich ein neues Fenster öffnen. Dort navigiert You should be able to find the latter by looking at the project directory in your file explorer.
ihr zum Bereich \emph{Befehle} und setzt bei \emph{PdfLaTeX} das Flag If your installation is not working yet, \TeX{}studio will show you an error message.
\mintinline{bash}{-shell-escape}. In anderen Worten: Der Text bei Feel free to contact us in this case.\footnote{Find us at \url{https://www.uni-bamberg.de/wiai/fs}.}
\emph{PdfLaTeX} sollte folgendermaßen lauten: Otherwise, you are now ready to go!
\mint{bash}{pdflatex -synctex=1 -interaction=nonstopmode -shell-escape
%.tex}
\newpage
\section*{Das erste Mal kompilieren} \nopagecolor
Öffnet nun die Datei \mintinline{bash}{main.tex} im Wurzelverzeichnis des
Projektes und kompiliert sie durch Druck auf \faForward.
In dem Ordner, in dem die Datei liegt, sollten verschiedene neue Dateien erschienen sein.
Die Datei \mintinline{bash}{main.pdf} enthält das kompilierte Dokument.
Außerdem sind einige Hilfsdateien aufgetaucht, die der Compiler zum Beispiel nutzt, um das Inhaltsverzeichnis zu generieren.
Damit seid ihr startklar!

View File

@ -1,15 +1,18 @@
\chapter{Fußnoten} \chapter{Footnotes}
\label{sec:footnotes} \label{sec:footnotes}
Für Fußnoten gibt es den Befehl \mintinline{latex}{\footnote{text}}, der an der Stelle des Aufrufs automatisch die richtige Ziffer einfügt und den übergebenen Text in der Fußzeile erscheinen lässt. Whenever we want to include footnotes into our \LaTeX{} document, we can use
In Kombination mit dem Paket \mintinline{latex}{hyperref} sind die Fußnoten sowie URLs\footnote{Sofern sie über den Befehl \mintinline{latex}{\url{}} gesetzt wurden.} zudem anklickbar. the command \code{latex}{\textbackslash footnote{<text>}}. At the position where we use
Beispiele findet ihr im gesamten Dokument. the command, the correct number will be inserted automatically, and the text
within the curly braces will appear in the footer. In combination with the
Das Paket \mintinline{latex}{footmisc} stellt verschiedene weitere Optionen für die Darstellung von Fußnoten zur Verfügung, die als optionale Parameter an den Befehl \mintinline{latex}{\usepackage} übergeben werden können: package \pkg{hyperref}, \acro{URL}s within footnotes become
clickable.\footnote{if we use the command \code{latex}{\textbackslash url{}}}
We can see examples for that in the whole document.
The package \pkg{footmisc} provides us with additional options for how to display footnotes. They can be passed as optional parameters to the command \code{latex}{\textbackslash usepackage}:
\begin{itemize} \begin{itemize}
\item \mintinline{latex}{\usepackage[perpage]{footmisc}} sorgt dafür, dass die Zählung der Fußnoten auf jeder Seite neu beginnt. \item \code{latex}{\textbackslash usepackage[perpage]\{footmisc\}} ensures that the count of footnotes begins at 1 for each new page.
\item \mintinline{latex}{\usepackage[para]{footmisc}} lässt die Fußnoten in der Fußzeile als Fließtext (gegebenenfalls auch nebeneinander) erscheinen. \item \code{latex}{\textbackslash usepackage[para]\{footmisc\}} lets the footnotes within the footer appear as continuous text (i.\,e., the footnotes can also appear next to each other).
\item \mintinline{latex}{\usepackage[symbol]{footmisc}} bewirkt eine Nummerierung mit Symbolen (z.\,B. \textdagger, \textdaggerdbl) statt Ziffern. \item \code{latex}{\textbackslash usepackage[symbol]\{footmisc\}} causes a numbering with symbols (e.\,g., \textdagger, \textdaggerdbl) instead of numbers.
\end{itemize} \end{itemize}

View File

@ -1,29 +1,32 @@
\chapter{Absatzformatierung} % (fold) \chapter{Formatting Paragraphs} % (fold)
\label{sec:formatting-paragraphs} \label{sec:formatting-paragraphs}
\section*{Flattersatz} \section*{Ragged alignment}
\label{sec:ragged-alignment} \label{sec:ragged-alignment}
Standardmäßig setzt \LaTeX{} Fließtext im Blocksatz. By default, \LaTeX{} sets continuous text in full justification.
Flattersatz\footnote{Bekannt als links, rechts oder zentriert ausgerichteter Text in Programmen wie Word.} ist aber auch möglich. However, we can also switch to ragged alignment by using the commands
Die Befehle \mintinline{tex}|\raggedright|, \mintinline{tex}|\raggedleft| und \mintinline{tex}|\centering| können dazu verwendet werden. \code{latex}{\textbackslash raggedright}, \code{latex}{\textbackslash raggedleft}, and
Diese Befehle beeinflussen die Umgebung, in der sie verwendet werden. \code{latex}{\textbackslash centering}.
Dies kann zum Beispiel die \texttt{document}-Umgebung sein, dementsprechend würde sämtlicher Text des Dokuments beeinflusst werden. These commands influence the environment that they are used in, e.\,g., the
Alternativ existieren Umgebungen, welche die Absatzformatierung beeinflussen (\cref{lst:ragged-alignment}). \mono{document} environment. Correspondingly, the text within the whole
document is affected.
Alternatively, we can use dedicated environments in order to influence the
formatting
of certain paragraphs (\cref{lst:ragged-alignment}).
\example{lst:ragged-alignment}{formatting-paragraphs/ragged-alignment}{Flattersatz} \example{lst:ragged-alignment}{formatting-paragraphs/ragged-alignment}{Ragged
alignment}
\section*{Einzüge und Abstände} \section*{Indentation and spacing}
\label{sec:indents-and-parskips} \label{sec:indents-and-parskips}
Absätze werden standardmäßig durch Einzüge in der ersten Zeile des Absatzes verdeutlicht (\mintinline{tex}{\parindent}). Usually, we illustrate a new paragraph by indenting the first line of it
Stattdessen können auch vertikale Abstände zwischen den Absätzen verwendet werden (\mintinline{tex}{\parskip}). (\code{latex}{\textbackslash parindent}).
Für beide Varianten gibt es einstellbare Parameter: Alternatively, paragraph spacing, i.\,e., vertical space between paragraphs,
\begin{minted}{tex} can be used (\code{latex}{\textbackslash parskip}).
\setlength{\parindent}{0pt} For both variants, there are adjustable parameters:
\setlength{\parskip}{1em \codeblock{latex}{listings/formatting-paragraphs/indentation.tex}
plus .5em % erlaubte Dehnung
minus .5em % erlaubte Stauchung \noindent We can use \code{latex}{\textbackslash noindent} to turn off the indentation for only one
} paragraph.
\end{minted} For the first paragraph after a heading, there is usually no indentation.
Mit dem Befehl \mintinline{tex}{\noindent} kann für nur einen Absatz der Einzug abgeschaltet werden.
Für den ersten Absatz nach einer Überschrift wird standardmäßig automatisch kein Einzug eingefügt.

View File

@ -1,64 +1,50 @@
\chapter{Grafiken} \chapter{Graphics}
\label{sec:graphics} \label{sec:graphics}
Da wir in \LaTeX{} mit Plaintext-Dateien arbeiten, können wir Grafiken nicht wie von Textverarbeitungsprogrammen gewohnt einfach einbetten. Since in \LaTeX{} we work with plain text, we cannot simply embed graphics into our text as we may be used to from other word processing programs.
Stattdessen werden externe Bilddateien über Befehle referenziert und dann erst beim Kompilieren eingebunden und positioniert. Instead, we reference external image files by a command. The figure is then embedded and positioned at compile time.
\section{Grafiken einfügen} \section{Inserting graphics}
\label{sec:display-graphics} \label{sec:display-graphics}
Damit Grafiken referenziert werden können, muss das Paket \texttt{graphicx} eingebunden werden. Zum Einfügen können dann folgende Befehle verwendet werden: In order to be able to reference graphics, the package \texttt{graphicx} has to be included. For inserting a figure, we can use the following commands:
\begin{minted}[tabsize=4]{latex} \codeblock{latex}{listings/graphics/insert-graphics.tex}
\begin{figure}
\includegraphics{<dateipfad>}
\caption[<kurztitel>]{<bildunterschrift>}
\end{figure}
\end{minted}
\noindent Soll die Bildgröße angepasst werden, kann der \texttt{includegraphics}-Befehl abgeändert werden. \noindent The command \mono{includegraphics} can be used to change the image size. The desired height and width of the figure can be indicated separately, as illustrated by the following example:
Die erwünschte Höhe und Breite können hier separat angegeben werden, etwa wie folgt:
\begin{minted}{latex} \codeblock{latex}{listings/graphics/image-size.tex}
\includegraphics[width=0.5\textwidth,height=5cm]{<dateipfad>}
\end{minted}
\section{Platzierung} \section{Positioning}
\label{sec:graphics-placement} \label{sec:graphics-placement}
Ein interessanter Aspekt des What-you-get-is-what-you-mean-Paradigmas ist die Art und Weise, wie Grafiken positioniert werden können. One interesting aspect of the what-you-get-is-what-you-mean paradigm is the way how graphics can be positioned.
Standardmäßig erfolgt eine automatische Platzierung an einer vom Compiler berechneten, potenziell optimalen Stelle. The compiler creates multiple layouts and evaluates them.
Dabei werden verschiedene Layouts erstellt und danach bewertet, wie ansprechend das Ergebnis ist. By default, graphics are placed at the potentially optimal position that is calculated by the compiler.
Durch das Verschieben von Grafiken können typografische Schönheitsfehler wie Schusterjungen und Hurenkinder\footnote{Die erste (letzte) Zeile eines Absatzes steht allein als letzte (erste) Zeile auf der vorherigen (nächsten) Seite, vgl. \url{https://de.wikipedia.org/wiki/Hurenkind_und_Schusterjunge}.} weitestgehend vermieden werden. By moving them around, typographic blemishes like widows and orphans\footnote{The first (last) line of a paragraph appears alone as last (first) line on the previous (next) page, cf. \url{https://en.wikipedia.org/wiki/Widows_and_orphans}.} can be avoided.
Dies bedeutet aber auch, dass eine Grafik nicht notwendigerweise zwischen den zwei Textblöcken wie im Quelltext erscheint, sondern an anderer Stelle. As a consequence, graphics are not necessarily placed between the two text blocks that we specify, but at another position.
Um im Text einen klaren Bezug zu einer gegebenenfalls anderswo platzierten Grafik herzustellen, können wir Labels verwenden, die wir in \cref{sec:references} erklären. In order to reference a picture, that possibly is placed on another page, we can use labels, which are covered in \cref{sec:references}.
Wir können diese Verschiebungen außerdem durch Hinzufügen eines optionalen Parameters zur \mintinline{latex}{figure}-Umgebung mehr oder minder rigoros begrenzen. On top of that, we can limit the positioning of our image more or less rigorously by adding optional parameters to the \texttt{figure} environment. The available positioning shortcuts can be found in \cref{tbl:placement-abbreviations}.
Die verfügbaren Positionskürzel werden in \cref{tbl:placement-abbreviations} aufgelistet.
\begin{table}[h!] \begin{table}[h!]
\center \centering
\begin{tabular}{cl} \begin{tabular}{cl}
\toprule \toprule
Kürzel & Position \\ Shortcut & Position \\
\midrule \midrule
h & möglichst hier, wenn es gefällt \\ h & here, if possible \\
t & oberer Seitenrand \emph{(top)} \\ t & on top of the page \emph{(top)} \\
b & unterer Seitenrand \emph{(bottom)} \\ b & at the bottom of the page \emph{(bottom)} \\
p & auf einer eigenen Seite \emph{(page)} \\ p & on its own page \emph{(page)} \\
H & Definitiv an dieser Stelle! (benötigt Paket \texttt{float}) \\ H & definitely here (requires package \texttt{float}) \\
\bottomrule \bottomrule
\end{tabular} \end{tabular}
\caption{Kürzel zur Platzierung von Abbildungen} \caption{Shortcuts for positioning graphics}
\label{tbl:placement-abbreviations} \label{tbl:placement-abbreviations}
\end{table} \end{table}
\begin{minted}[tabsize=4]{latex} \codeblock{latex}{listings/graphics/positioning.tex}
\begin{figure}[<positionskürzel>]
\centering
\includegraphics{<dateipfad>}
\end{figure}
\end{minted}
Neben der vertikalen Positionierung spielt gegebenenfalls auch die horizontale Ausrichtung eine Rolle. Besides the vertical positioning, also the horizontal orientation may be of importance.
Standardmäßig sind Grafiken linksbündig orientiert. By default, graphics are left-justified.
Der Befehl \mintinline{latex}{\centering} zentriert alle folgenden Objekte bis zum Ende der aktuellen Umgebung. The command \code{latex}{\textbackslash centering} centers all following objects in the current environment.
Soll sich die Zentrierung nur auf ein Objekt beziehen, kann dieses stattdessen mit \mintinline{latex}{\begin{center}} und \mintinline{latex}{\end{center}} umschlossen werden. If we want the centering to affect only one object, we can alternatively wrap it with \code{latex}{\textbackslash begin\{center\}} and \code{latex}{\textbackslash end\{center\}}.

View File

@ -1,22 +1,23 @@
\chapter{Aufzählungen} \chapter{Lists}
\label{sec:lists} \label{sec:lists}
Von Haus aus unterstützt \LaTeX\ drei Aufzählungstypen: ungeordnete und geordnete Listen sowie Definitionslisten. Inherently, \LaTeX{} supports three types of lists: unordered, ordered, and description lists.
Zu jedem dieser Typen existieren eigene Umgebungen, die aber grundsätzlich gleich aufgebaut sind. For each of these types, there are dedicated environments whose structure is very similar.
\example{lst:unordered-list}{lists/nested-list}{Beispielhafte ungeordnete Aufzählung} \example{lst:unordered-list}{lists/nested-list}{Examplary unordered list}
In \cref{lst:unordered-list-code} werden verschiedene Listenelemente (\mintinline{latex}{\item}) von einer \mintinline{latex}{itemize}-Umgebung eingerahmt. In \cref{lst:unordered-list-code}, different list items (\code{latex}{\textbackslash item}) are framed by an \mono{itemize} environment.
Innerhalb eines Listenelements kann eine neue Listen\-umgebung eröffnet werden, um eine verschachtelte Liste zu erhalten. Within a list item, we can open a new list environment to create a nested list.
Ersetzt man \mintinline{latex}{itemize} durch \mintinline{latex}{enumerate}, erhält man bei sonst gleichem Quelltext eine geordnete Liste. If we replace \mono{itemize} by \mono{enumerate}, the list becomes ordered without changing the source code any further.
Für etwas weniger gebräuchliche Definitionslisten muss die Umgebung \mintinline{latex}{description} verwendet werden. To make use of the less common description lists, we have to specify the environment \mono{description}.
Außerdem erhalten die Elemente in eckigen Klammern den zu definierenden Begriff (\cref{lst:definition-list}). Moreover, the items need to be extended by the term to be defined, put in brackets (\cref{lst:description-list}).
\Example{lst:definition-list}{lists/definition-list}{lists/definition-list_crop}{Beispielhafte Definitionsliste} \Example{lst:description-list}{lists/description-list}{lists/description-list_crop}{Exemplary description list}
Die sehr großen Abstände zwischen einzelnen Listenelementen können durch das Paket \mintinline{latex}{paralist}\footnote{\url{https://www.ctan.org/pkg/paralist}} verringert werden. The exuberant spacing between list items can be reduced by utilizing the \mono{paralist}\footnote{\url{https://www.ctan.org/pkg/paralist}} package.
Hierzu wird nur der Umgebungsname ersetzt: \mintinline{latex}{compactitem} statt \mintinline{latex}{itemize}, \mintinline{latex}{compactenum} statt \mintinline{latex}{enumerate} und \mintinline{latex}{compactdesc} statt \mintinline{latex}{description}. To do so, we simply adjust the environment name: sh{compactitem} replaces sh{itemize}, sh{compactenum} replaces sh{enumerate}, and sh{compactdesc} replaces sh{description}.
Soll die Aufzählung im Fließtext erscheinen, bringt \mintinline{latex}{paralist} dafür die Umgebungen \mintinline{latex}{inparaenum} und \mintinline{latex}{inparaitem} mit. If the list ought to appear within a text body, \pkg{paralist} provides the extra environments \mono{inparaenum} and \mono{inparaitem}.
Um das Aufzählungszeichen oder die Nummerierung anzupassen, kann das Paket \mintinline{latex}{enumitem}\footnote{\url{https://www.ctan.org/pkg/enumitem}} verwendet werden. We can customize bullet and list numbering styles via the \pkg{enumitem}\footnote{\url{https://www.ctan.org/pkg/enumitem}} package.
\mintinline{latex}{\begin{enumerate}[label=\roman*]} erzeugt eine Liste mit römischen Zahlen. Für alphabetische Nummerierung sorgt der Parameter \mintinline{latex}{[label=\alph*]}. \code{latex}{\textbackslash begin\{enumerate\}[label=\textbackslash roman*]} produces a list with Roman numerals.
The parameter \code{latex}{[label=\textbackslash alph*]} inserts alphabetical numbering.

View File

@ -1,74 +1,68 @@
\chapter{Literaturverwaltung} \chapter{Reference management}
\label{sec:literature} \label{sec:literature}
Um die ersten Studien- oder Abschlussarbeiten in \LaTeX\ zu setzen, fehlt uns jetzt nur noch eine Möglichkeit, Literatur zu referenzieren. For typesetting our first thesis in \LaTeX{}, the last core functionality to learn is citing literature.
Unsere Literatursammlung liegt in der sogenannten .bib-Datei. Our references are gathered in a bibliography file.
Wenn wir aus unserem \LaTeX-Dokument darauf verweisen, kann uns das Programm Bib\TeX{} (ähnlich zum Compiler \acro{PDF}\LaTeX) an der richtigen Stelle die richtigen Zitationen in einem vorher festgelegten Bibliografiestil einfügen. Once we reference one of its entries from our \LaTeX{} document, Bib\TeX{} (a
program similar to the standard \sh{pdflatex} compiler)
can insert automatically generated citations.
It will format them in a bibliography style of our choice.
\section{Die Bibliografie-Datei} \section{The bibliography file}
In der .bib-Datei sammeln wir unsere Literatureinträge in einem Format, das durch Bib\TeX{} verarbeitbar ist. Our \textbf{bibliography collection} consists of multiple literature entries in a pre-defined format, such that they can be processed by Bib\TeX{}.
Einen beispielhaften Eintrag aus einer .bib-Datei zeigt \cref{lst:bibfile-sample-entry}. An exemplary item can be seen in \cref{lst:bibfile-sample-entry}.
\begin{figure}[H] \begin{figure}[H]
\begin{minted}[autogobble]{latex} \codeblock{bibtex}{listings/literature/bibliography-entry.bib}
@article{turing1990, % Dokumentenart und Bezeichner für den \cite-Befehl
title={The chemical basis of morphogenesis}, % Titel \caption{Exemplary bibliography entry}
author={Turing, Alan Mathison}, % Autor
journal={Bulletin of mathematical biology}, % Titel des Journals
volume={52}, % Band des Journals
pages={153--197}, % Seitenzahl im Journal
year={1990}, % Erscheinungsjahr
publisher={Springer} % Verleger des Journals
}
\end{minted}
\caption{Beispielhafter Eintrag einer .bib-Datei}
\label{lst:bibfile-sample-entry} \label{lst:bibfile-sample-entry}
\end{figure} \end{figure}
Nach einem \texttt{@}-Zeichen wird die Art des Literaturverzeichniseintrags angegeben (z.\,B. article, book, proceedings). The type of the bibliography entry is specified after the opening \mono{@} sign (article, book, proceedings, …).
Es folgt eine Auflistung wichtiger Attribute wie Titel, Autor:in und abhängig vom Eintragstyp weiterer Felder. What follows is a list of important attributes like title and author.
Der erste Eintrag nach der öffnenden geschwungenen Klammer ist der wichtigste: Whether they are required or not depends on the type of the entry.
Unter diesem Kürzel wird der Eintrag später in \LaTeX{} angesprochen. In any case, we will need the first entry after the opening braces: the Bib\TeX{} key.
Diese sogenannten Bib\TeX-Keys müssen eindeutig sein und können frei vergeben werden. This is the identifier that we will use to reference the entry in our \LaTeX{} document.
Üblich sind Kombinationen aus Autor:innen, Publikationsjahren und Themen. Bib\TeX{} keys can be chosen freely, but have to be unique.
Typically, they will consist of a combination of authors, publication dates, and topics.\newpage
Die .bib-Datei kann manuell zusammengetragen werden. \textbf{Bibliography files} can be compiled manually, yet it is more common to use programs like JabRef,\footnote{Cf. \url{https://www.jabref.org/}.} Zotero\footnote{Cf. \url{https://www.zotero.org/}.} or the widely-used software Citavi\footnote{Vgl. \url{https://www.citavi.com/de}.}.
Viel häufiger allerdings werden dafür Programme wie JabRef,\footnote{Vgl. \url{https://www.jabref.org/}.} Zotero\footnote{Vgl. \url{https://www.zotero.org/}.} oder das weit verbreitete Citavi\footnote{Vgl. \url{https://www.citavi.com/de}.} verwendet. While JabRef operates directly on your bibliography file, Zotero and Citavi projects\footnote{Vgl. \url{https://www1.citavi.com/sub/manual5/de/exporting_to_bibtex.html}.} can be exported to bibliography files to use them in \LaTeX{} documents.
Während JabRef direkt eine .bib-Datei als Datenbank verwendet, lassen sich Zotero- und Citavi-Projekte\footnote{Vgl. \url{https://www1.citavi.com/sub/manual5/de/exporting_to_bibtex.html}.} in .bib-Dateien exportieren.
.bib-Datei-Einträge werden unter anderem auch von Google Scholar zur Verfügung gestellt (vgl. \cref{fig:google-scholar-bibtex}). \textbf{Bibliography entries} are provided by many academic search engines, including Google Scholar (cf. \cref{fig:google-scholar-bibtex}).
Hierbei ist es wichtig, darauf zu achten, dass die Einträge einheitlich und möglichst vollständig sind. When using them, make sure that the entries are cohesive across your reference collection and complete with regard to their attributes.
Als hochwertige (wenn auch leider nicht vollständige) Quelle für Bib\TeX-Einträge kann die dblp Computer Science Library\footnote{Verfügbar unter \url{https://dblp.org/search}.} dienen. A high-quality (although, unfortunately, incomplete) source for Bib\TeX{} entries is the dblp computer science bibliography.\footnote{Available at \url{https://dblp.org/search}.}
\begin{figure}[H] \begin{figure}[H]
\includegraphics[width=\textwidth]{graphics/google_bibtex1.jpg} \includegraphics[width=\textwidth]{graphics/google_bibtex1.jpg}
\includegraphics[width=\textwidth]{graphics/google_bibtex2.jpg} \includegraphics[width=\textwidth]{graphics/google_bibtex2.jpg}
\caption{Bib\TeX-Einträge in Google Scholar abrufen} \caption{Loading Bib\TeX{} entries from Google Scholar}
\label{fig:google-scholar-bibtex} \label{fig:google-scholar-bibtex}
\end{figure} \end{figure}
\section{Zitieren} \section{Citing}
Durch Bib\TeX{} wird \LaTeX{} um einige Befehle zum Zitieren erweitert (vgl. \cref{tbl:bibtex-commands}). Bib\TeX{} extends \LaTeX{} by several commands (cf. \cref{tbl:bibtex-commands}).
Zusätzlich benötigt wird das Paket \mintinline{sh}{natbib}. Make sure to include the \pkg{natbib} package for this purpose.
\begin{table}[H] \begin{table}[H]
\centering \centering
\begin{tabular}{ll} \begin{tabular}{ll}
\toprule \toprule
Funktion & Befehl \\ \midrule Function & Command \\ \midrule
Quelle zitieren & \mintinline{latex}{\cite{<quelle>}} \\ Citing sources & \code{latex}{\textbackslash cite\{<source>\}} \\
Seite zitieren & \mintinline{latex}{\cite[S. 15]{<quelle>}} \\ Citing pages & \code{latex}{\textbackslash cite[p. 15]\{<source>\}} \\
Weitere Zusätze zitieren & \mintinline{latex}{\cite[<präfix>][<suffix>]{<quelle>}} \\ Custom citations & \code{latex}{\textbackslash cite[<prefix>][<suffix>]\{<source>\}} \\
.bib-Datei einbinden & \mintinline{latex}{\bibliography{<.bib-datei>}} \\ Including the bibliography & \code{latex}{\textbackslash bibliography\{<bibliographyfile>\}} \\
Zitierstil ändern & \mintinline{latex}{\bibliographystyle{<zitierstil>}} \\ \bottomrule Setting the bibliography style & \code{latex}{\textbackslash bibliographystyle\{<style>\}} \\ \bottomrule
\end{tabular} \end{tabular}
\caption{Befehle zum Zitieren von Literatur} \caption{Commands for citations}
\label{tbl:bibtex-commands} \label{tbl:bibtex-commands}
\end{table} \end{table}
Als \mintinline{latex}{<quelle>} einer Zitation wird immer der Bib\TeX-Key angegeben. The \code{latex}{<source>} of a citation is always a Bib\TeX key.
Verfügbare Zitierstile\footnote{Eine vollständigere Liste ist bei Overleaf zu finden: \url{https://www.overleaf.com/learn/latex/Biblatex_citation_styles}} sind zum Beispiel alpha, natdin und apa. The list of available citation styles\footnote{Head to Overleaf for a rather complete list: \url{https://www.overleaf.com/learn/latex/Biblatex_citation_styles}} includes \mono{alpha}, \mono{natdin}, and \mono{apa}.
Das Literaturverzeichnis erscheint immer an der Stelle, an der der Befehl \mintinline{latex}{\bibliography{}} aufgerufen wurde. The table of references will always appear where the \code{latex}{\textbackslash bibliography\{\}} command was put.
Zum Befehl \mintinline{latex}{\cite} existieren zahlreiche weitere Varianten.\footnote{Vgl. \url{https://www.economics.utoronto.ca/osborne/latex/BIBTEX.HTM.}} The \code{latex}{\textbackslash cite} command comes with many variants.\footnote{cf. \url{https://www.economics.utoronto.ca/osborne/latex/BIBTEX.HTM}}
\Example{lst:natdin-example}{literature/natdin-example}{literature/natdin-example_bib}{Beispiel für Zitationen im Stil \mintinline{latex}{natdin}.} \Example{lst:natdin-example}{literature/natdin-example}{literature/natdin-example_bib}{Exemplary citations in the \mono{natdin} style.}

View File

@ -1,30 +1,33 @@
\chapter{Mathematische Formeln} \chapter{Mathematical formulas}
\label{sec:maths} \label{sec:maths}
Mathematische Formeln können nur im sogenannten Mathmode gesetzt werden, der innerhalb einer Zeile (auch als inline bekannt) durch zwei Dollarzeichen aktiviert wird. Mathematical formulas are always set in \emph{math mode}, which, within a paragraph (referred to as \emph{inline}), can be turned on or off with a dollar sign.
Außerdem gibt es eine Blockumgebung (vgl. \cref{lst:sample-math-environment}). There is also a \emph{block} environment (cf. \cref{lst:sample-math-environment}).
Wichtige Pakete für mathematische Zeichen sind \mintinline{latex}{amsmath}, \mintinline{latex}{amsthm} und \mintinline{latex}{amssymb} der American Mathematical Society sowie \mintinline{latex}{mathtools}. Important packages for mathematical features are the \texttt{amsmath},
Wie bei allen Umgebungen kann durch Angabe eines Asterisks (\textasteriskcentered) die Nummerierung der Gleichungen ausgeschaltet werden. \pkg{amsthm}, and \pkg{amssymb} packages of the American Mathematical
Society, as well as \pkg{mathtools}.
As with many other environments, adding an asterisk turns off the numbering.
\example{lst:sample-math-environment}{maths/sample-math-environment}{Beispielhafte Matheumgebungen} \example{lst:sample-math-environment}{maths/sample-math-environment}{Exemplary math environments}
\section{Einige Beispiele} \section{A few examples}
%Die \cref{tbl:maths-common-commands,tbl:maths-logic-sets-braces} listen einige häufig in Formeln verwendeten Befehle auf. %Die \cref{tbl:maths-common-commands,tbl:maths-logic-sets-braces} listen einige häufig in Formeln verwendeten Befehle auf.
\begin{table}[H] \begin{table}[H]
\centering \centering
\begin{tabular}{ll} \begin{tabular}{ll}
\toprule \toprule
Quelltext & Ergebnis \\ \midrule Source code & Result \\ \midrule
\mintinline{latex}{\sqrt{16}} & $\sqrt{16}$ \\ \code{latex}{\textbackslash sqrt\{16\}} & $\sqrt{16}$ \\
\mintinline{latex}{\frac{3}{4}} & $\frac{3}{4}$ \\ \code{latex}{\textbackslash frac\{3\}\{4\}} & $\frac{3}{4}$ \\
\mintinline{latex}{e^{\pi}} & $e^{\pi}$ \\ \code{latex}{e\textasciicircum\{\textbackslash pi\}} & $e^{\pi}$ \\
\mintinline{latex}{\sum_{i=1}\^{n}x^2} & $\sum_{i=1}^{n}x^2$ \\ \code{latex}{\textbackslash sum\_\{i=1\}\textasciicircum\{n\}x\textasciicircum 2} & $\sum_{i=1}^{n}x^2$ \\
\mintinline{latex}{12 \leq 4 x^2 + 13} & $12 \leq 4 x^2 + 13$ \\ \code{latex}{12 \textbackslash leq 4 x\textasciicircum 2 + 13} & $12 \leq 4 x^2 + 13$ \\
\mintinline{latex}{{n \choose k}} & ${n \choose k}$ \\ \code{latex}{{n \textbackslash choose k}} & ${n \choose k}$ \\
\bottomrule \bottomrule
\end{tabular} \end{tabular}
\caption{Häufig verwendete Befehle (Wurzel, Bruch, Exponent, Summe, Vergleichszeichen, Binomialkoeffizient). Durch \mintinline{latex}{^{}} und \mintinline{latex}{_{}} werden die Inhalte in den Klammern hoch- oder tiefgestellt.} \caption{Frequently used commands (square root, fraction, power, sum, inequation, binomial coefficient).
By \code{latex}{\textasciicircum\{\}} and \code{latex}{\_\{\}}, the content is set in super- or subscript.}
\label{tbl:maths-common-commands} \label{tbl:maths-common-commands}
\end{table} \end{table}
@ -33,47 +36,48 @@ Wie bei allen Umgebungen kann durch Angabe eines Asterisks (\textasteriskcentere
\centering \centering
\begin{tabular}{ll} \begin{tabular}{ll}
\toprule \toprule
Quelltext & Ergebnis \\ \midrule Source code & Result \\ \midrule
\mintinline{latex}{(x), [x], \lbrace x \rbrace, \lvert x \rvert} & $(x), [x], \lbrace x\rbrace, \lvert x\rvert$\\ \code{latex}{(x), [x], \textbackslash lbrace x \textbackslash rbrace, \textbackslash lvert x \textbackslash rvert} & $(x), [x], \lbrace x\rbrace, \lvert x\rvert$\\
\mintinline{latex}{\exists,\forall,\in,\notin,\infty} & $\exists,\forall,\in,\notin,\infty$ \\ \code{latex}{\textbackslash exists,\textbackslash forall,\textbackslash in,\textbackslash notin,\textbackslash infty} & $\exists,\forall,\in,\notin,\infty$ \\
\mintinline{latex}{\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi} & $\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi$ \\ \code{latex}{\textbackslash alpha, \textbackslash beta, \textbackslash Gamma, \textbackslash Delta, \textbackslash varepsilon, \textbackslash pi} & $\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi$ \\
\mintinline{latex}{\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow} & $\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow$ \\ \code{latex}{\textbackslash rightarrow, \textbackslash leftarrow, \textbackslash Rightarrow, \textbackslash Leftarrow, \textbackslash Leftrightarrow} & $\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow$ \\
\mintinline{latex}{(A \cup B) \cap C} & $(A \cup B) \cap C$ \\ \code{latex}{(A \textbackslash cup B) \textbackslash cap C} & $(A \cup B) \cap C$ \\
\mintinline{latex}{(A \lor B) \land C} & $(A \lor B) \land C$ \\ \code{latex}{(A \textbackslash lor B) \textbackslash land C} & $(A \lor B) \land C$ \\
\mintinline{latex}{(A \cdot B) \times C} & $(A \cdot B) \times C$ \\ \bottomrule \code{latex}{(A \textbackslash cdot B) \textbackslash times C} & $(A \cdot B) \times C$ \\ \bottomrule
\end{tabular} \end{tabular}
\caption{Klammerungen, Quantoren, griechische Buchstaben, Pfeile, Operatoren} \caption{Brackets, quantifiers, greek letters, arrows, operators}
\label{tbl:maths-logic-sets-braces} \label{tbl:maths-logic-sets-braces}
} }
\end{table} \end{table}
\section{Mitwachsende Klammern} \section{Growing brackets}
Im Zusammenspiel mit Brüchen kommt es vor, dass Klammern mit ihrem Inhalt wachsen sollen. Especially in combination with fractions, brackets should grow according to their content.
Hierfür muss dem Befehl zum Erzeugen der Klammern (\mintinline{latex}{(}, \mintinline{latex}{)}, \mintinline{latex}{[}, \mintinline{latex}{]}, \mintinline{latex}{\lbrace} und \mintinline{latex}{\rbrace}) jeweils ein Positionsmarker (\mintinline{latex}{\left} oder \mintinline{latex}{\right}) vorangestellt werden. This can be achieved by pre-pending each bracket (\code{latex}{(}, \code{latex}{)}, \code{latex}{[}, \code{latex}{]}, \code{latex}{\textbackslash lbrace} and \code{latex}{\textbackslash rbrace}) with a position marker (\code{latex}{\textbackslash left} or \code{latex}{\textbackslash right}).
\example{lst:growing-brackets}{maths/growing-brackets}{Beispiel für mitwachsende Klammern} \example{lst:growing-brackets}{maths/growing-brackets}{Example for growing brackets}
\section{Darstellung von Grenzen} \section{Lower and upper bounds}
Mit dem Befehl \mintinline{latex}{\limits} lassen sich die Grenzen von Integralen unter und über dem Integralzeichen darstellen. The \code{latex}{\textbackslash limits} command renders lower and upper bounds of integrals above and below the integral sign.
Bei Summen, Produkten und Grenzwerten geschieht das automatisch (vgl. \cref{lst:limits}). Sums, products, and limits do this
Im Fließtext eignet sich \mintinline{latex}{\limits} nur bedingt. automatically (cf. \cref{lst:limits}).
For inline formulas, \code{latex}{\textbackslash limits} are of bounded suitability.
\example{lst:limits}{maths/limits}{Grenzen von Summen, Produkten, Grenzwerten und Integralen} \example{lst:limits}{maths/limits}{Lower and upper bounds of sums, products, limits and integrals}
\section{Ausrichtung mehrerer Gleichungen} \section{Aligning equations}
Die Umgebung \mintinline{latex}{align} erlaubt es, Gleichungen zum Beispiel am \texttt{=}-Zeichen auszurichten (vgl. \cref{lst:math-alignment-example}). The \mono{align} environment allows to align multiple equations horizontally, e.\,g., at the \mono{=} sign (\cref{lst:math-alignment-example}).
Ausgerichtet wird dabei analog zu Tabellen am \texttt{\&}-Zeichen. As in tables, the \mono{\&} sign is used to specify anchorage points.
Zeilenumbrüche werden durch zwei Backslashes markiert. Line breaks are denoted by two backslashes.
\Example{lst:math-alignment-example}{maths/align-example}{maths/align-example_crop}{Am Gleichheitszeichen ausgerichtete Gleichungen} \Example{lst:math-alignment-example}{maths/align-example}{maths/align-example_crop}{Equations aligned at equals signs}
\section{Mengenschreibweise} \section{Text in math mode}
Manchmal ist es notwendig, im Zusammenhang mit der Mengenschreibweise Prädikate unter Verwendung von textuellen Beschreibungen oder längeren Funktionsnamen zu definieren. Sometimes sets have to be defined in terms of textual descriptions or longer function names.
Im Mathmode wird die Zeichensetzung von \LaTeX{} nicht auf Fließtext, sondern auf Formeln ausgerichtet, was zu ungünstigen Anordnungen zusammenhängender Buchstabenketten führt. The \LaTeX{} math mode assumes that letters are variables rather than text, which creates problems when they are indeed supposed to be entire words.
Für diesen Fall gibt es den Befehl \mintinline{latex}{\mathrm{}} (\enquote{math roman}, vgl. \cref{lst:set-builder-notation}). For this case, there is the \code{latex}{\textbackslash mathrm\{\}} command (\enquote{math roman}, c.\,f. \cref{lst:set-builder-notation}).
\example{lst:set-builder-notation}{maths/set-builder-notation}{Probleme in der Mengenschreibweise und ihre Lösung} \example{lst:set-builder-notation}{maths/set-builder-notation}{Problems arising from intensional set notation and their solution}

View File

@ -1,21 +1,26 @@
\chapter{Projektstruktur} \chapter{Project structure}
\label{sec:project-structure} \label{sec:project-structure}
In den bisherigen Kapiteln haben wir nur sehr kurze \LaTeX{}-Beispiele gesehen. Natürlich kann \LaTeX{} aber auch verwendet werden, um größere Dokumente und Projekte zu erstellen, wie etwa eine Abschlussarbeit. In the previous chapters, we have only seen very short \LaTeX{} examples. \LaTeX{} can of course also be used to create larger documents and projects, such as a thesis.
Um nicht den Überblick im Quellcode zu verlieren und zu vermeiden, dass Quelldateien zu lang werden, ist eine sinnvolle Strukturierung eines größeren \LaTeX{}-Projektes ratsam. Hierfür wird der Quellcode in verschiedene Dateien aufgeteilt, welche in den folgenden Abschnitten näher beleuchtet werden. In order not to lose the overview in the source code and to avoid that source files become too long, a reasonable structuring of a larger \LaTeX{} project is advisable. For this purpose, the source code is divided into different files, which will be discussed in more detail in the following sections.
\section{Hauptdatei} Typischerweise wird bei größeren Projekten mit einer Hauptdatei gearbeitet, die gerne \texttt{main.tex} genannt wird. Sie ist sozusagen das Skelett des Projektes und enthält damit dessen Grundgerüst inklusive der Präambel. In dieser Hauptdatei werden Titel, Inhaltsverzeichnis sowie die einzelnen Kapitel einer Arbeit eingebunden (vgl. \cref{lst:main-file}). Die Einbindung der einzelnen Abschnitte kann entweder mittels \mintinline{latex}{\input{...}} oder \mintinline{latex}{\include{...}} erfolgen. Beide verlangen als Argument den Pfad zur Datei, die eingebunden werden soll. Auf die Unterschiede zwischen den beiden Befehlen gehen wir später noch ein (vgl. \cref{sec:input-vs-include}). \section{Main file}
\example{lst:main-file}{project-structure/main-file}{Typische Struktur einer Hauptdatei in \LaTeX{}} In large projects, we typically use one main file, which is often called \file{main.tex}. It is, in a sense, the structural skeleton of the project, as it contains the basic structure including the preamble. The title, table of contents, as well as the individual chapters of a work are integrated in this main file (cf.\ \cref{lst:main-file}). The inclusion of the individual sections can be done either by \code{latex}{\textbackslash input\{...\}} or \code{latex}{\textbackslash include\{\textellipsis\}}. Both require the path to the file to be included as an argument. We will discuss the differences between the two commands later (see \cref{sec:input-vs-include}).
\section{Abschnittsdateien} \example{lst:main-file}{project-structure/main-file}{Typical structure in a main file \LaTeX{}}
Abschnittsdateien sind Dateien, die innerhalb der Hauptdatei eingebunden werden. Diese können in einer Abschlussarbeit beispielsweise einzelne Kapitel sein. Grundsätzlich ist man aber ganz frei in der Entscheidung, wie granular die Aufteilung des Inhaltes in einzelne Dateien gestaltet werden soll.
Die Dateien, die durch die Hauptdatei eingebunden werden, enthalten keine Präambel, da diese ja schon in der Hauptdatei vorhanden ist. Auch die Befehle \mintinline{latex}{\begin{document}} und \mintinline{latex}{\end{document}} tauchen nicht noch mal auf.
\section{Input oder Include?} \section{Section files}
Section files are files that are included within the main file. In a thesis, for example, these can be individual chapters. You are free to decide how granular the division of the content into individual files should be.
The files that are included by the main file do not contain a preamble, since this is already present in the main file. Neither do the commands \code{latex}{\textbackslash begin\{document\}} and \code{latex}{\textbackslash end\{document\}} appear again.
\section{Input or include?}
\label{sec:input-vs-include} \label{sec:input-vs-include}
Kommen wir nun zu den Unterschieden zwischen den beiden möglichen Befehlen zum Einbinden von \LaTeX-Dateien. Kurz zusammengefasst weisen \mintinline{latex}{\include} und \mintinline{latex}{\input} Unterschiede in den folgenden drei Aspekten auf: Die Art und Weise, wie der Pfad zur einzubindenden Datei angegeben wird, die Möglichkeit der Schachtelung von Einbindungen und ob für jeden Abschnitt eine neue Seite angefangen wird.
Benutzt man den Befehl \mintinline{latex}{\input}, kann die Dateiendung \texttt{.tex} angegeben werden, sie ist aber nicht zwingend notwendig. Außerdem kann man die Einbindung von Dateien schachteln: Eine Datei, die mit \mintinline{latex}{\input} eingebunden wurde, kann wiederum mit dem gleichen Befehl eine andere Datei einbinden. Die Dateien, die eingebunden wurden, werden im fertigen Dokument eingefügt, ohne dass dabei eine neue Seite für den eingebundenen Abschnitt angefangen wird (vgl. \cref{lst:main-file}). Let us now turn to the differences between the two possible commands for including \LaTeX{} files. Briefly summarized, \code{latex}{\textbackslash include} and \code{latex}{\textbackslash input} have differences in the following three aspects: The way in which the path to the file to be included is specified, the possibility of nesting inclusions, and whether a new page is started for each section.
Anders verhält sich der Befehl \mintinline{latex}{\include}: Hier wird die Dateiendung \texttt{.tex} für die eingebundenen Kapitel \emph{nicht} mit angegeben. Die Schachtelung von Einbindungen ist nicht möglich. Für jede eingebundene Datei wird außerdem eine neue Seite erzeugt. If you use the command \code{latex}{\textbackslash input}, you can specify the file extension \mono{.tex}, but it is not mandatory. It is also possible to nest the inclusion of files: A file included with \code{latex}{\textbackslash input} can in turn include another file with the same command. The files that have been included are inserted in the finished document without starting a new page for the included section (cf. \cref{lst:main-file}).
The command \code{latex}{\textbackslash include} behaves differently: Here, the file
extension \mono{.tex} \emph{must} be omitted. Nesting of embeddings is not
possible. Also, a new page is created for each included file.

View File

@ -1,13 +1,12 @@
\chapter{Ausblick} \chapter{Prospects}
\label{sec:prospects} \label{sec:prospects}
Natürlich konnten wir euch in diesem knappen Rahmen nicht ansatzweise zeigen, was \LaTeX{} alles zu bieten hat. Obviously, in this script, we were not able to show you the least of what \LaTeX{} has to offer.
In diesem letzten Abschnitt haben wir daher ein paar Informationen gesammelt, die euch dabei helfen sollen, selbständig tiefer einzusteigen. Therefore, in this last section, we gathered some information to help you to go further into depth by yourself.
\section{Pakete} \section{Packages}
Eine Auswahl an Paketen haben wir euch bereits vorgestellt, es gibt aber noch ein paar tausend weitere. We already have presented a selection of packages. However, there are thousands more of them. In the following sections we have put together some packages for frequently needed features:
Für einige häufig benötigte Features haben wir euch hier eine kurze Liste passender Pakete zusammengestellt:
\begin{figure}[p] \begin{figure}[p]
\widebox{ \widebox{
@ -26,14 +25,14 @@ Für einige häufig benötigte Features haben wir euch hier eine kurze Liste pas
\colrules \colrules
% Left caption: % Left caption:
\begin{subfigure}[t]{\widefigurewidth} \begin{subfigure}[t]{\widefigurewidth}
\caption{Vektorgrafiken mit TikZ} \caption{Vector graphics with \pkg{TikZ}}
\centering\tiny{\url{https://texample.net/tikz/examples/coffee-cup/}} \centering\tiny{\url{https://texample.net/tikz/examples/coffee-cup/}}
\label{fig:tikz-example} \label{fig:tikz-example}
\end{subfigure} \end{subfigure}
\hspace{\widefiguregap} \hspace{\widefiguregap}
% Right caption: % Right caption:
\begin{subfigure}[t]{\widefigurewidth} \begin{subfigure}[t]{\widefigurewidth}
\caption{Konstituentenbäume mit qtree} \caption{Parse trees with \pkg{qtree}}
\centering\tiny{\url{https://www.ling.upenn.edu/advice/latex/qtree/}} \centering\tiny{\url{https://www.ling.upenn.edu/advice/latex/qtree/}}
\label{fig:qtree-example} \label{fig:qtree-example}
\end{subfigure} \end{subfigure}
@ -54,87 +53,90 @@ Für einige häufig benötigte Features haben wir euch hier eine kurze Liste pas
\colrules \colrules
% Left caption: % Left caption:
\begin{subfigure}[t]{\widefigurewidth} \begin{subfigure}[t]{\widefigurewidth}
\caption{Beweisbäume mit prftree} \caption{Proof trees with \pkg{prftree}}
\centering\tiny{\url{https://ftp.gwdg.de/pub/ctan/macros/latex/contrib/prftree/}} \centering\tiny{\url{https://ftp.gwdg.de/pub/ctan/macros/latex/contrib/prftree/}}
\label{fig:prftree-example} \label{fig:prftree-example}
\end{subfigure} \end{subfigure}
\hspace{\widefiguregap} \hspace{\widefiguregap}
% Right caption: % Right caption:
\begin{subfigure}[t]{\widefigurewidth} \begin{subfigure}[t]{\widefigurewidth}
\caption{Chemische Strukturformeln mit chemfig} \caption{Chemical structural formulas with \pkg{chemfig}}
\centering\tiny{\url{http://latex-cookbook.net/cookbook/examples/benzene-ring/}} \centering\tiny{\url{http://latex-cookbook.net/cookbook/examples/benzene-ring/}}
\label{fig:chemfig-example} \label{fig:chemfig-example}
\end{subfigure} \end{subfigure}
\medskip \medskip
} }
% General caption: % General caption:
\caption{Beispiele zu verschiedenen Paketen} \caption{Examples for some packages}
\label{fig:package-examples} \label{fig:package-examples}
\end{figure} \end{figure}
\begin{description} \begin{description}
\item[Stichwortverzeichnisse] \item[Indices]
können mit \texttt{makeidx} automatisiert erstellt werden.\footnote{\url{https://www.ctan.org/pkg/makeidx}} can be created automatically with \pkg{makeidx}.\footnote{\url{https://www.ctan.org/pkg/makeidx}}
Mit \mintinline{tex}{\index{}} werden im Text einzelne Stichwörter ausgezeichnet, der Befehl \mintinline{tex}{\printindex} sammelt sie in einem Verzeichnis mit Referenzen. By using \code{latex}{\textbackslash index\{\}}, one can mark entries for the index. With \code{latex}{\textbackslash printindex}, an index with references is compiled out of them.
\item[Vektorgrafiken] \item[Vector graphics]
(\cref{fig:tikz-example}) (\cref{fig:tikz-example})
lassen sich mit \texttt{TikZ} (rekursives Akronym für \emph{TikZ ist kein Zeichenprogramm}) direkt im \LaTeX{}-Code erstellen.\footnote{\url{https://www.ctan.org/pkg/pgf}} can be \enquote{drawn} directly in the \LaTeX{} source code with \pkg{TikZ} (recursive acronym for \emph{TikZ ist kein Zeichenprogramm}, in English: \emph{TikZ is not a drawing program}).\footnote{\url{https://www.ctan.org/pkg/pgf}}
Achtung: Dieses Paket ist sehr mächtig, aber nicht unbedingt einsteigerfreundlich. Caution: This package is very powerful, but not necessarily beginner-friendly.
Bevor ihr damit etwas von Grund auf selbst gestaltet, empfehlen wir euch, mit einigen der Beispiele bei \TeX{}ample\footnote{\url{https://texample.net/tikz/examples/}} zu experimentieren. Before creating vector graphics from scratch, we recommend you to experiment with some of the examples at \TeX{}ample\footnote{\url{https://texample.net/tikz/examples/}}.
Für bestimmte Anwendungsfälle gibt es aber auch spezielle Pakete, die dann meist einfacher zu handhaben sind: Also, for certain use cases, there are special packages that are easier to handle than \enquote{raw} TikZ:
\item[Konstituentenbäume,] \item[Parse trees]
die Sätze in ihre grammatikalischen Bestandteile zerlegen (\cref{fig:qtree-example}), erzeugt \texttt{qtree}.\footnote{\url{https://ctan.org/pkg/qtree}} that divide sentences into their grammatical components (\cref{fig:qtree-example}) can be created with \pkg{qtree}.\footnote{\url{https://ctan.org/pkg/qtree}}
\item[Beweisbäume,] \item[Proof trees,]
wie sie in der Logik benötigt werden (\cref{fig:prftree-example}), erzeugt \texttt{prftree}.\footnote{\url{https://www.ctan.org/pkg/prftree}} that are often used in logics (\cref{fig:prftree-example}), can be drawn with the package \pkg{prftree}.\footnote{\url{https://www.ctan.org/pkg/prftree}}
\item[Chemische Strukturformeln] \item[Chemical structural formulas]
(\cref{fig:chemfig-example}) (\cref{fig:chemfig-example})
können unter anderem mit dem Paket \texttt{chemfig} erzeugt werden.\footnote{\url{https://www.ctan.org/pkg/chemfig}} can, amongst others, be created with \pkg{chemfig}.\footnote{\url{https://www.ctan.org/pkg/chemfig}}
\item[Farbe] \item[Colors]
bringt \texttt{xcolor} in eure Dokumente.\footnote{\url{https://www.ctan.org/pkg/xcolor}} for your documents are provided by \pkg{xcolor}.\footnote{\url{https://www.ctan.org/pkg/xcolor}}
\item[Notizen,] \item[Notes]
die ihr bei der Abgabe garantiert nicht überseht, fügt \texttt{todonotes} ein.\footnote{\url{https://www.ctan.org/pkg/todonotes}} that you cannot overlook can be created with \pkg{todonotes}.\footnote{\url{https://www.ctan.org/pkg/todonotes}}
Damit könnt ihr markieren, was ihr noch \todo{Nicht ändern, das ist ein Beispiel.}ändern oder einfügen wollt. With this package, you can mark what you still \todo{Please do not change. This is an example.} have to change within your document.
\item[Seiten aus anderen \acro{PDF}-Dateien] \item[Pages of other \acro{PDF} files]
integriert ihr mit \texttt{pdfpages}.\footnote{\url{https://www.ctan.org/pkg/pdfpages}} can be integrated into the source code with the \texttt{pdfpages}\footnote{\url{https://www.ctan.org/pkg/pdfpages}} package.
Das eignet sich sehr gut, um Ausgaben anderer Programme in eure Arbeit zu integrieren, beispielsweise in einem Anhang. It comes in very handy whenever one needs the output of external programs in the document, for example, in the appendix.
Einmal kompilieren, und schon ist auch der Anhang wieder auf dem neuesten Stand, wenn das externe Programm etwas geändert hat. Just compile the document one more time and the appendix is up to date again, if the external program has changed something.
\item[Verschachtelte Abbildungen] \item[Nested graphics]
und die nahezu beliebige Positionierung von Bildunterschriften ermöglicht \texttt{subcaption}.\footnote{\url{https://www.ctan.org/pkg/subcaption}} and the positioning of captions at almost any place are provided by
Davon haben wir auch in diesem Dokument ausgiebig Gebrauch gemacht. \pkg{subcaption}.\footnote{\url{https://www.ctan.org/pkg/subcaption}}
\item[Tabellen] We also made extensive use of this package.
können noch sehr viel flexibler gestaltet werden, als wir es hier gezeigt haben. \item[Tables]
Dabei helfen unter anderem die Pakete can be designed much more flexibly than what we have shown here.
\texttt{colortbl},\footnote{\url{https://www.ctan.org/pkg/colortbl}} The following packages can help you with that:
\texttt{tabularx},\footnote{\url{https://www.ctan.org/pkg/tabularx}} \pkg{colortbl},\footnote{\url{https://www.ctan.org/pkg/colortbl}}
\texttt{multirow},\footnote{\url{https://www.ctan.org/pkg/multirow}} \pkg{tabularx},\footnote{\url{https://www.ctan.org/pkg/tabularx}}
\texttt{makecell}.\footnote{\url{https://www.ctan.org/pkg/makecell}} \pkg{multirow},\footnote{\url{https://www.ctan.org/pkg/multirow}}
\pkg{makecell}.\footnote{\url{https://www.ctan.org/pkg/makecell}}
\end{description} \end{description}
\noindent Eigentlich kein Paket, sondern eine weitere Dokumentenklasse ist \textbf{beamer:} Damit könnt ihr \textbf{Bildschirmpräsentationen} mit \LaTeX{} erstellen. \noindent \mono{beamer}, which is not a package, but another document class, can be used to create \textbf{slide shows}
Informationen und Beispiele dazu gibt es bei Overleaf\footnote{\url{https://www.overleaf.com/learn/latex/Beamer}} with \LaTeX{}. Information on the document class and examples are available at Overleaf,\footnote{\url{https://www.overleaf.com/learn/latex/Beamer}} which brings us to the next section:
womit wir schon beim nächsten Abschnitt sind:
\section{Hilfe und Informationen} \section{Help and information}
Eine deutlich ausführlichere Einführung in \LaTeX{} bieten die \textbf{Wikibooks.} \textbf{Wikibooks} provides you with a much more detailed introduction into \LaTeX{}. Note that the German version\footnote{\url{https://de.wikibooks.org/wiki/LaTeX-Kompendium}} is less complete than the English one.\footnote{\url{https://en.wikibooks.org/wiki/LaTeX}}
Das deutschsprachige Wikibook\footnote{\url{https://de.wikibooks.org/wiki/LaTeX-Kompendium}} ist dabei noch etwas unvollständiger als das englischsprachige.\footnote{\url{https://en.wikibooks.org/wiki/LaTeX}} If required, both refer to additional packages.
Beide verweisen bei Bedarf auf zusätzliche Pakete.
Falls ihr mehr Informationen zu einem bestimmten Paket sucht, ist \acro{\textbf{CTAN}}\footnote{\url{https://ctan.org/}} die zentrale Anlaufstelle. Whenever you need information on certain packages, \acro{\textbf{CTAN}}\footnote{\url{https://ctan.org/}} is your place to go.
Dort findet ihr zu jedem Paket die offizielle Dokumentation als \acro{PDF}-Dokument. For each package, you can find the official documentation as a \acro{PDF} file there.
Darin sind vor allem die ersten Abschnitte interessant, weiter hinten folgen Implementierungsdetails, die ihr normalerweise nicht braucht. Within this file, the first paragraphs are usually the most interesting. They are
followed by implementation details, that you normally do not need.
Wenn die Dokumentation zu theoretisch ist und ihr auf der Suche nach praktischen Beispielen seid, kann \textbf{Overleaf}\footnote{\url{https://www.overleaf.com/}} weiterhelfen. If the official documentation is too theoretical, and you prefer a more hands-on approach, \textbf{Overleaf}\footnote{\url{https://www.overleaf.com/}} can help you out.
Das Portal ist primär ein kollaborativer Online-\LaTeX-Editor, ihr findet dort aber auch einige Vorlagen\footnote{\url{https://www.overleaf.com/latex/templates}} für verschiedene Arten von Dokumenten (Lebensläufe, Abschlussarbeiten u.\,v.\,m.). Primarily, it is a collaborative online \LaTeX{} editor. However, you can find
Speziell zu TikZ bietet \textbf{\TeX{}ample}\footnote{\url{https://texample.net/}} eine Vielzahl an Beispielen. multiple templates\footnote{\url{https://www.overleaf.com/latex/templates}} for
different types of documents (CVs, theses, \textellipsis) there.
Bei konkreten Fragen oder Problemen hilft wie üblich die Frage-Antwort-Plattform \textbf{Stackexchange} weiter: If you are looking for examples dedicated to TikZ, \textbf{\TeX{}ample}\footnote{\url{https://texample.net/}} provides you with multiple of them.
Es gibt dort auch eine \TeX-Community.\footnote{\url{https://tex.stackexchange.com/}}
Und selbstverständlich könnt ihr euch auch immer gerne uns wenden: For concrete questions, the question-answering platform \textbf{Stackexchange} is a good place to go: There even is a \TeX{} community there.\footnote{\url{https://tex.stackexchange.com/}}
~\newline\noindent Of course, you can always contact us with your questions:
\begin{compactitem} \begin{compactitem}
\item per Mail an \href{mailto:fachschaft-wiai.stuve@uni-bamberg.de}{fachschaft-wiai.stuve@uni-bamberg.de}, \item via mail to \href{mailto:fachschaft-wiai.stuve@uni-bamberg.de}{fachschaft-wiai.stuve@uni-bamberg.de},
\item telefonisch unter +49951\,863\,1219 \item via phone at +49951\,863\,1219,
\item oder in unserem Büro in WE5/02.104. \item or just come to our bureau at WE5/02.104.
\end{compactitem} \end{compactitem}

View File

@ -1,45 +1,41 @@
\chapter{Referenzen} \chapter{References}
\label{sec:references} \label{sec:references}
Für Querverweise der Form \enquote{Wie man in Abbildung 23 sieht, \textellipsis} bringt \LaTeX\ von Haus aus den Befehl \mintinline{latex}{\ref{label}} mit, der lästige Anpassungen an der Nummerierung der Grafiken, Tabellen etc. erspart. If we want to make references, like \enquote{\textellipsis , which you can see in figure 21, \textellipsis}, \LaTeX{} by default provides us with the command \code{latex}{\textbackslash ref\{<label>\}}. No more adapting of the numbering for graphics, tables, etc. needed!
Er erhält als Argument ein eindeutiges Label, das auch dem referenzierten Element zugeordnet werden muss. The command expects a unique label as argument, that needs to be assigned to
Anschließend erscheint an der Stelle des Befehlsaufrufs die fortlaufende Nummer des referenzierten Elements. the referenced element. After that, wherever we call the command, the number of
our referenced object appears in the text.
\Example{lst:fooboar-learning-latex}{references/ref}{references/ref_crop}{Example for a reference}
\Example{lst:fooboar-learning-latex}{references/ref}{references/ref_crop}{Beispiel für eine Referenzierung} A smarter package for references is \pkg{cleverref}.\footnote{with only one \enquote{r}!}
It provides us with the command \code{latex}{\textbackslash cref\{<label>\}}, which can also handle multiple labels separated by commas.
This automatically generates elegant references like \enquote{sections 1 to 3, and 5.}\footnote{for the source code \code{latex}{\textbackslash cref\{sec:section1,sec:section2,
sec:section3,sec:section5\}}}
Furthermore, \code{latex}{\textbackslash ref\{<label>\}} automatically inserts a suited abbreviation, e.\,g., \enquote{fig.} for figures.
Noch smarter ist das Paket \mintinline{latex}{cleveref}.\footnote{mit nur einem \enquote{r}!} We can reference graphics, tables, sections, chapters, source code listings, and equations.
Es bringt den Befehl \mintinline{latex}{\cref{label}} mit, dem auch -- durch Kommata getrennt -- mehrere Labels übergeben werden können. Many packages use the label in order to find out the object type of the referenced element.
Daraus entstehen dann automatisiert Angaben wie \enquote{Abschnitte 1 bis 3 und 5}.\footnote{für den Quelltext \mintinline{latex}{\cref{sec:section1,sec:section2, For this reason, it is common to insert a prefix before each label (\cref{lst:reference-prefixes}).
sec:section3,sec:section5}}}
Zudem fügt \mintinline{latex}{\cref{label}} eigenständig die richtige Abkürzung ein, beispielsweise \enquote{Abb.} für Grafiken.
Referenziert werden können neben Grafiken und Tabellen unter anderem auch Abschnitte, Bilder, Quelltext-Listings und Gleichungen.
Viele Pakete nutzen das Label, um herauszufinden, zu welchem Objekttyp es gehört.
Aus diesem Grund ist es üblich, jedem Label ein Präfix voranzustellen (\cref{lst:reference-prefixes}).
\begin{table}[H] \begin{table}[H]
\centering \centering
\begin{tabular}{@{}llll@{}} \begin{tabular}{@{}llll@{}}
\toprule \toprule
Präfix & Objekttyp & Präfix & Objekttyp \\ \midrule Prefix & Object type & Prefix & Object type \\ \midrule
fig: & Abbildungen & tbl: & Tabellen \\ fig: & figures & tbl: & tables \\
sec: & Abschnitte & subsec: & Unterabschnitte \\ sec: & sections & subsec: & subsections \\
ch: & Kapitel & itm: & Aufzählungselemente \\ ch: & chapters & itm: & items \\
eq: & Gleichungen & lst: & Quelltext-Listings \\ \bottomrule eq: & equations & lst: & source code listings \\ \bottomrule
\end{tabular} \end{tabular}
\caption{Präfixe für Labels} \caption{Prefixes for labels}
\label{lst:reference-prefixes} \label{lst:reference-prefixes}
\end{table} \end{table}
Bei der Verwendung von \mintinline{latex}{\cref{label}} ist zu beachten, dass die generierten Passagen in einigen Dokumentklassen erst dann auf Deutsch erscheinen, wenn bereits in der Dokumentklasse die Sprache festgelegt wurde: Note that if we use \code{latex}{\textbackslash cref\{<label>\}}\,---\,for some document classes\,---\,the generated passages only appear in the desired language (e.\,g., German) when the language is specified already within the document class command:
\begin{minted}{latex} \codeblock{latex}{listings/references/set-language.tex}
\documentclass[ngerman]{article}
\end{minted}
\noindent Von Abschnitten abgesehen, müssen Beschriftungen\footnote{\mintinline{latex}{\caption{}}} außerdem \emph{immer vergeben und vor dem Label platziert} werden, damit sie anschließend referenziert werden können. \noindent Except for sections, captions\footnote{\code{latex}{\textbackslash caption\{\}}} \emph{always need to be specified and positioned before the label}\textit{.} Otherwise, they cannot be referenced later on in the text.
Bei Abschnitten wird das Label direkt hinter dem Befehl angefügt: Labels for sections are inserted directly after the command:
\begin{minted}{latex} \codeblock{latex}{listings/references/sections.tex}
\section{Hinweise}\label{sec:hints}
\end{minted}

View File

@ -0,0 +1,32 @@
\newpage
\section{Using listings}
\subsection{Installation}
\pkg{listings} is a \LaTeX{} package of itself and does not require any additional installation as long as the \pkg{xcolor} package is installed as well.
We can therefore jump straight into typesetting source code.
\subsection{Defining listings}
Similar to \pkg{minted}, you can define listings using a dedicated environment (cf.\ \cref{lst:listings-environment}) and you can use another command to import source code directly from external files (cf.\ \cref{lst:listings-external}).
\example{lst:listings-environment}{source-code-listings/listings-environment}{Exemplary source code listing}
\example{lst:listings-external}{source-code-listings/listings-import}{Including from a separate file}
\noindent Both commands need a language specification\footnote{See this guide on Overleaf for a list of all languages: \url{https://www.overleaf.com/learn/latex/Code_listing\#Reference_guide}} as an optional parameter to apply syntax highlighting.
\subsection{Configuring listings}
The \pkg{listings} package can also be tweaked in an almost infinite number of ways.
Numerous optional parameters give you a lot of freedom.
Once again, Overleaf and the package documentation\footnote{Available at \url{https://www.overleaf.com/learn/latex/Code_listing\#Code_styles_and_colours} and \url{https://ctan.org/pkg/listings}, respectively.} come in handy.
\example{lst:listings-external-styled}{source-code-listings/listings-import-styled}{Themes and further options}
\subsection{Drawbacks and caveats}
As mentioned earlier, \pkg{listings} is not our first choice for source code listings.
Its renderings are of rather peculiar appearance.
With some amount of configuration, we can overcome the most disturbing default settings.
Although \pkg{listings} is not shipped with any pre-defined themes, you can define your own and use them throughout your project with the \mono{lstdefinestyle} command.\footnote{Have a look at it in the package documentation. For the very impatient, here is a solarized theme for \pkg{listings}: \url{https://github.com/jez/latex-solarized}}
The package is also a bit older than its alternative, causing \acro{UTF8} special characters to break.
If this happens to you, have a look at the \mono{literate} option of the \pkg{listings} commands.

View File

@ -0,0 +1,95 @@
\section{Using minted}
\subsection{Installation}
Using \pkg{minted} requires a working installation of the programming language Python 3 (henceforth referred to as Python).
On some operating systems, Python comes pre-installed, in which case entering the command \sh{python -{}-version} or \sh{python3 -{}-version} in a terminal of your choice\footnote{Opening a terminal on Windows: \faWindows\ + R → Type \enquote{cmd} → Enter} should print out the installed Python version.
If Python is yet to be installed, then you can find the installation files on the project website\footnote{Available at \url{https://www.python.org/downloads/}.}.
There are extensive articles that cover all relevant steps to install Python on
Windows,\footnote{Pawandeep, How to install Python in Windows?. Tutorialspoint. March 10, 2021. Available at
\url{https://www.tutorialspoint.com/how-to-install-python-in-windows}.
Windows users will have to adjust the system path during the installation process. Forgetting this step has
been the number one installation problem in past workshops.}
Linux,\footnote{\url{https://docs.python-guide.org/starting/install3/linux/}}
or macOS.\footnote{\url{https://docs.python-guide.org/starting/install3/osx/}}
After a successful installation, you should be able to execute the aforementioned command in a terminal, confirm by pressing Enter, and see approximately the following result:
\shell{python -{}-version \\ Python 3.8.5}
\noindent If the version number is equal to the one stated here, or higher, then everything should be set up correctly.
Next, enter the command \sh{pip install Pygments}\footnote{On some operating systems, you might have to use the command \sh{pip3 install Pygments}} in the same terminal window to install the Pygments package for Python.
Once the installation is complete, you are ready to include the \LaTeX{} package \pkg{minted} into your documents by adding \code{latex}{\textbackslash usepackage\{minted\}} to your preamble.
\subsection{Changing the compiler command}
There is one last adjustment needed before you can actually compile your documents---we will have to adjust the compile command.
Out of the box, your editor will probably execute the following command after you clicked the green compile arrow:
\shell{pdflatex main.tex}
\noindent The exact command can be found and configured in \TeX{}studio under Options\,\,Configure \TeX{}studio\,\,Commands.
It is stated next to the Pdf\LaTeX{} label.
The file that is to be compiled will replace the placeholder \sh{\%.tex} upon compilation.
Typically, there are two additional options configured.
You can recognize them by the hyphen before their names (\sh{-synctex=1} and \sh{-interaction=\allowbreak{}nonstopmode}).
These options are called flags and they configure the program \sh{pdflatex}.
We will have to add another flag.
Place the string \sh{-shell-escape} before the file placeholder (\sh{\%.tex}):
\shell{pdflatex -synctex=1 -interaction=nonstopmode -shell-escape \%.tex}
\noindent After a click on \enquote{Okay} the configuration is finished.
Other editors usually provide similar options to configure the compilation command.
We recommend you to have a look at the settings or to use of a search engine to figure it out.
\paragraph{An important note on the shell-escape flag.} \pkg{minted}'s syntax highlighting is done by a Python package, which adds the necessity to communicate between the compiler and the Python runtime.
The shell-escape flag adds this communication path.
When enabled, \LaTeX{} can execute any command in a terminal, which can be very useful.
Nonetheless, it would also be possible to execute malign code on your computer via \LaTeX{}, especially when you are compiling unknown documents from the Internet.
Therefore, do not compile downloaded documents with the shell-escape flag if you do not trust the authors and did not check the packages and commands they include.
\subsection{Defining listings}
We are finally ready to marvel at the aesthetic quality of the listings \pkg{minted} produces.
You can define listings using a dedicated environment:
% Render listing directly, if minted is available.
% Otherwise, include pre-rendered images.
\ifthenelse{\equal{\listingsmode}{minted}}{%
\example{lst:minted-environment}{source-code-listings/minted-environment}{Exemplary source code listing}
}{%
\Example{lst:minted-environment}{source-code-listings/minted-environment}{source-code-listings/minted-environment_crop}{Exemplary source code listing}
}
% Render listing directly, if minted is available.
% Otherwise, include pre-rendered images.
\ifthenelse{\equal{\listingsmode}{minted}}{%
\example{lst:minted-variants}{source-code-listings/minted-variants}{Shorthand and inline listing}
}{%
\Example{lst:minted-variants}{source-code-listings/minted-variants}{source-code-listings/minted-variants_crop}{Shorthand and inline listing}
}
\noindent There is also a shorthand and an inline variant of the command (cf.\ \cref{lst:minted-variants}).
To avoid redundancy, it may be practical to import source code directly from the source file.
To accomplish this, we only have to pass the programming language and the file path to the \code{latex}{\textbackslash inputminted} command (cf.\ \cref{lst:minted-external}).
% Render listing directly, if minted is available.
% Otherwise, include pre-rendered images.
\ifthenelse{\equal{\listingsmode}{minted}}{%
\example{lst:minted-external}{source-code-listings/minted-import}{Including from a separate file}
}{%
\Example{lst:minted-external}{source-code-listings/minted-import}{source-code-listings/minted-import_crop}{Including from a separate file}
}
\subsection{Configuring minted}
Optional parameters allow us to add line numbers, line breaks, and colors.
Moreover, there are numerous themes available (\cref{lst:minted-external-styled}).
The introduction on Overleaf and the package documentation\footnote{Available at \url{https://www.overleaf.com/learn/latex/Code_Highlighting_with_minted} and \url{https://ctan.kako-dev.de/macros/latex/contrib/minted/minted.pdf}, respectively.} give an extensive overview.
% Render listing directly, if minted is available.
% Otherwise, include pre-rendered images.
\ifthenelse{\equal{\listingsmode}{minted}}{%
\example{lst:minted-external-styled}{source-code-listings/minted-import-styled}{Themes and further options}
}{%
\Example{lst:minted-external-styled}{source-code-listings/minted-import-styled}{source-code-listings/minted-import-styled_crop}{Themes and further options}
}

View File

@ -1,69 +1,25 @@
\chapter{Quelltext-Listings} \chapter{Source code listings}
\label{sec:source-code-listings} \label{sec:source-code-listings}
Um Quelltext in eigenen Arbeiten darzustellen, gibt es in \LaTeX verschiedene Wege. There are many ways in \LaTeX{} to display source code.
Wir verwenden hierfür gern das Paket \mintinline{latex}{minted}, das zwar etwas zusätzlichen Installationsaufwand verursacht, dafür aber ansprechende Ergebnisse generiert und gut zu handhaben ist. We have come to appreciate the package \pkg{minted}, which causes some additional installation overhead, but generates very appealing source code renderings.
\section{Installation} However, especially on macOS, the installation of \pkg{minted} has caused a lot of headache in the early days of this workshop.
Zur Verwendung von \mintinline{latex}{minted} ist eine Installation der Programmiersprache Python 3 notwendig. Je nachdem, welches Betriebsystem ihr nutzt, kann es sein, dass Python 3 bei euch schon installiert ist. Das könnt ihr durch die Engabe des Befehls \mintinline{bash}{python --version} oder \mintinline{bash}{python3 --version} in einem Terminal\footnote{Navigation unter Windows: \faWindows\ + R → \enquote{cmd} eingeben → Enter} herausfinden That's why we will also have a look at an alternative called \pkg{listings}.
Sollte Python bei euch noch nicht installiert sein, sind die Installationsdateien auf der Projekt-Website\footnote{Verfügbar unter \url{https://www.python.org/downloads/}.} zu finden. \paragraph{A note on colors.} Both of these packages require you to define colors.
Ein ausführlicherer Beitrag zur Installation unter Windows,\footnote{Jason Fitzpatrick, How to Install Python on Windows. How-To Geek. July 11, 2017. Verfügbar unter \url{https://www.howtogeek.com/197947/how-to-install-python-on-windows/}.} Linux\footnote{ \url{https://docs.python-guide.org/starting/install3/linux/}} oder MacOS\footnote{\url{https://docs.python-guide.org/starting/install3/osx/}} führt euch durch die verschiedenen Schritte, die speziell für euer Betriebssystem notwendig sind.\footnote{Insbesondere das Anpassen des Systempfads sollte unter Windows nicht vergessen werden.} We can recommend using the \pkg{xcolor} package.
There are very helpful resources\footnote{If you would like to specify your own colors , these pages might help you: \url{https://www.overleaf.com/learn/latex/Using_colours_in_LaTeX} for a list of pre-defined colors in the \pkg{xcolor} package, \url{https://mmoredo.github.io/latex-color-converter/} for defining your own colors} available online such that we will not go into details here.
Nach der erfolgreichen Installation solltet ihr, je nach Betriebssystem, in der Eingabeaufforderung den oben genannten Befehl noch mal eingeben und mit Enter bestätigen können und in etwa folgendes Ergebnis erhalten: \section*{Source code listings within this script}
\begin{minted}[]{bash} This script uses the package \pkg{listings} as default way for displaying source code listings, since, as mentioned above, it causes less headache, especially on macOS. As we introduce \pkg{minted} as an alternative package, naturally, this script can also display source code listings rendered by \pkg{minted}.
$ python --version
Python 3.8.5
\end{minted}
\noindent Sollte die Versionsnummer höher sein, ist alles bestens. To switch between the packages, you can change the listings mode to \pkg{minted} like so: First of all, follow the respective installation instructions. Afterwards, create a new file called \file{listings-mode.tex} in the root directory of this project, and insert the following line into the newly created file:
Im gleichen Fenster gebt ihr jetzt den Befehl \mintinline{bash}{pip install Pygments}\footnote{Achtung: In einigen Betriebssystem lautet der Befehl \mintinline{bash}{pip3 install Pygments}} ein, womit das Pygments-Paket für Python installiert wird.
Nach Abschluss dieses Vorgangs könnt ihr das \LaTeX-Paket \mintinline{latex}{minted} über \mintinline{latex}{\usepackage{minted}} einbinden.
\codeblock{latex}{./listings/source-code-listings/change-listings-mode.tex}
\section{Compiler-Befehl ändern} After compiling the script, you should see differently rendered source code listings. If you want to return to \pkg{listings} as package for rendering your source code listings, just replace \sh{minted} with \sh{default} in the \file{listings-mode.tex} file. Source code listings within this script are then displayed using the \pkg{listings} package again.
Bevor es allerdings richtig losgehen kann, müssen wir noch eine Kleinigkeit im Compile-Prozess anpassen.
Normalerweise ruft euer Editor beim Klick auf den grünen Pfeil etwa den folgenden Befehl auf:
\begin{minted}[]{bash} \input{./content/source-code-listings-minted}
$ pdflatex main.tex \input{./content/source-code-listings-listings}
\end{minted}
\noindent Welcher Befehl das bei euch genau ist, könnt ihr in \TeX{}studio unter \enquote{Optionen → \TeX{}studio konfigurieren → Befehle} einsehen.
Neben Pdf\LaTeX{} seht ihr den Befehl.
Die Datei, die kompiliert werden soll, wird hier durch \mintinline{bash}{%.tex} angegeben.
Außerdem sind üblicherweise noch zwei zusätzliche Angaben enthalten, jeweils mit einem Bindestrich davor (\mintinline{bash}{-synctex=1 -interaction=nonstopmode}).
Diese Angaben heißen Flags und konfigurieren das Programm \mintinline{bash}{pdflatex}.
Eine solche Flag müssen wir ergänzen.
Platziert die Angabe \mintinline{bash}{-shell-escape} vor der Datei-Angabe (\mintinline{bash}{%.tex}):
\begin{minted}[]{bash}
pdflatex -synctex=1 -interaction=nonstopmode -shell-escape %.tex
\end{minted}
\noindent Nach Klick auf \enquote{Okay} ist der Einrichtungsschritt abgeschlossen.
Auch andere Editoren bieten die Möglichkeit, den Kompilierbefehl anzupassen.
Schaut am besten mal in die Einstellungen oder bemüht eine Suchmaschine.
\section{Quelltext setzen}
Jetzt kann der eigentliche Spaß losgehen.
Quelltext könnt ihr von nun an unter Angabe der Sprache in einer eigenen Umgebung setzen:
\example{lst:minted-environment}{source-code-listings/minted-environment}{Beispielhaftes Quelltext-Listing}
\example{lst:minted-variants}{source-code-listings/minted-variants}{Kurzschreibweise und Inline-Listing}
\noindent Außerdem gibt es eine Kurzschreibweise und eine Inline-Variante des Befehls (vgl. \cref{lst:minted-variants}).
Um Redundanz zu vermeiden, ist es manchmal praktisch, den Quelltext direkt aus der Quelldatei einzulesen.
Hierzu müssen nur die verwendete Programmiersprache und der Dateipfad an den Befehl \mintinline{latex}{\inputminted} übergeben werden (vgl. \cref{lst:minted-external}).
\example{lst:minted-external}{source-code-listings/minted-import}{Einbinden aus einer externen Datei}
\section{Minted konfigurieren}
Durch optionale Parameter können Zeilennummerierung, Umbrüche und Farben ausgewählt werden.
Außerdem sind zahlreiche Themes verfügbar (\cref{lst:minted-external-styled}).
Einen umfänglichen Überblick geben die Einführung von Overleaf und die Dokumentation.\footnote{Verfügbar unter \url{https://www.overleaf.com/learn/latex/Code_Highlighting_with_minted} bzw. \url{https://ctan.kako-dev.de/macros/latex/contrib/minted/minted.pdf}.}
\example{lst:minted-external-styled}{source-code-listings/minted-import-styled}{Themes und weitere Optionen}

View File

@ -1,142 +1,146 @@
\chapter{Sonderzeichen} \chapter{Special characters}
\label{sec:special-characters} \label{sec:special-characters}
\section{Leerzeichen} \section{Spaces}
Das am häufigsten benötigte Sonderzeichen ist ein einfaches Leerzeichen als Wortzwischenraum. The special character used most frequently is a simple space between words.
Dieses Zeichen entsteht in \LaTeX, wenn im Quellcode zwischen anderen Zeichen Leerzeichen oder einzelne Zeilenumbrüche stehen. \LaTeX{} creates it whenever the source code contains spaces or single newlines (by hitting the enter key once) between other characters.
Es gibt aber auch einige andere Arten von Leerzeichen. The word space is not the only one, though\,---\,there are a few more types of spaces.
Wie sie verwendet werden können, wird in \cref{lst:spaces} veranschaulicht. \Cref{lst:spaces} illustrates how they are used.
\example{lst:spaces}{special-characters/spaces}{Unterschiedliche Leerzeichen in \LaTeX} \example{lst:spaces}{special-characters/spaces}{Different spaces in \LaTeX}
\paragraph{English Spacing} \paragraph{English Spacing}
In englischsprachigen Dokumenten verwendet LaTeX das traditionelle English Spacing, also doppelte Leerzeichen nach dem Satzende. In documents written in English, \LaTeX{} uses traditional English Spacing by default. That is, double spaces after each sentence.
Der Befehl \mintinline{tex}|\frenchspacing| vor dem ersten Absatz verhindert das. We can prevent this by using the command \code{tex}{\textbackslash frenchspacing} above the first paragraph.
Der Befehl \mintinline{tex}|\nonfrenchspacing| schaltet wieder zurück. With \code{latex}{\textbackslash nonfrenchspacing}, we can reset the behavior.
Bei English Spacing versucht \LaTeX, Abkürzungen zu erkennen und danach trotzdem normale Wortzwischenräume zu setzen. When using English Spacing, \LaTeX{} tries to recognize abbreviations and to use normal spaces after those.
Das solltet ihr aber kontrollieren und, wo nötig, We should still check this and\,---\,where necessary\,---\,enforce word spaces (\mono{.\textbackslash}) or sentence spaces (\mono{\textbackslash @.␣}).
Wortzwischenräume (\mintinline[showspaces]{tex}{.\ }) oder Satzenden (\mintinline[showspaces]{tex}{\@. }) erzwingen.
\section{Striche} \section{Hyphens and dashes}
Es gibt verschiedene horizontale Striche. There are different kinds of horizontal lines being used as punctuation,
Am häufigsten werden der Bindestrich (-), der Halbgeviertstrich () und der Geviertstrich\footnote{Ein Geviert ist die Zeilenhöhe, die eine Bleiletter aus dem Buchdruck einnimmt.} (—) verwendet. most frequently the hyphen (-), the en dash () and the em dash (—).\footnote{They are named after the letters N and M,
Diese drei Striche werden in \LaTeX{} durch unterschiedlich viele Bindestriche im Quelltext erzeugt, wie \cref{tbl:bars} zeigt. that occupy roughly the same space.
The letter M is also about as wide as it is tall, and the amount is called a \emph{Geviert} in German, hence the German terms \emph{Halbgeviertstrich} and \emph{Geviertstrich} for the two dashes.}
These three characters are created in \LaTeX{} by different numbers of consecutive hyphens in the source code,
as shown in \cref{tbl:bars}.
\begin{longtable}{@{}llp{7.8cm}@{}} \begin{longtable}{@{}llp{7.8cm}@{}}
\toprule \toprule
Code & Strich & Verwendung \\ Code & Character & Usage \\
\midrule \midrule
\mintinline{tex}|-| & Bindestrich & \LaTeX-Wochenende \\ \code{latex}{-} & Hyphen & a small-sized stroke \\
\mintinline{tex}|--| & Halbgeviertstrich & als Gedankenstrich mit Leerzeichen außenrum oder als Bis-Strich: 10\,\,12 Uhr \\ \code{latex}{--} & En dash & a range mark (8\,--\,10\,am) or an interruptor at sentence level the latter surrounded by spaces and used in most European languages (including British English) \\
\mintinline{tex}|---| & Geviertstrich & a dash\,\,mostly used in American English \\ \code{latex}{---} & Em dash & an interrupter at sentence level\,---\,mostly used in American English and without or with thin spaces \\
\bottomrule \bottomrule
\caption{Striche in \LaTeX} \caption{Hyphens and dashes in \LaTeX}
\label{tbl:bars} \label{tbl:bars}
\end{longtable} \end{longtable}
Der Bindestrich wird zwar auch zur Silbentrennung verwendet, ihr solltet ihn dafür aber nicht explizit im Quellcode eingeben. The hyphen is obviously also used for hyphenation, but for this purpose, we should not insert it explicitly in our source code.
An den meisten Stellen trennt \LaTeX{} automatisch richtig, wenn ihr das passende \texttt{babel}-Paket eingebunden habt.\footnote{Vgl. \cref{sec:language}.} In most places, \LaTeX{} does the hyphenation automatically if we are using the correct \texttt{babel} configuration.\footnote{c.\,f. \cref{sec:language}.}
Wenn dabei etwas schiefgeht, könnt ihr mit den Codes in \cref{tbl:separators} eingreifen:\footnote{Auch dafür muss \texttt{babel} eingebunden sein.} In case something goes wrong, we can intervene using the codes from \cref{tbl:separators}:\footnote{Those also require the \texttt{babel} package.}
\begin{longtable}{@{}lp{11cm}@{}} \begin{longtable}{@{}lp{11cm}@{}}
\toprule \toprule
Code & Erläuterung \\ Code & Explanation \\
\midrule \midrule
\endhead \endhead
\mintinline{tex}|\-| & Ausschließliche Trennstelle: Das Wort darf nur an dieser Stelle getrennt werden (kann auch mehrfach in einem Wort vorkommen, dann sind alle Stellen erlaubt). \\ \code{latex}{\textbackslash -} & Exclusive hyphenation: The word may only be hyphenated at this position (can also be used multiple times within one word\,---\,all of those positions are then allowed). \\
\mintinline{tex}|"-| & Zusätzliche Trennstelle: Das Wort darf neben den von \LaTeX{} erkannten Trennstellen auch hier getrennt werden. \\ \code{latex}{"-} & Additional hyphenation: The word may be hyphenated here, as well as at the default positions. \\
\mintinline{tex}|-| & Exklusiver Bindestrich: Wird für Komposita verwendet und unterbindet die automatische Silbentrennung im Wort (das ist typografisch erwünscht). \\ \code{latex}{-} & Exclusive hyphen: Is only used for compound words and prevents the automatic hyphenation for the rest of the word (which is typographically desirable). \\
\mintinline{tex}|"=| & Nichtexklusiver Bindestrich: Wird für lange Komposita verwendet, bei denen die Silbentrennung aktiv bleiben soll, weil der Umbruch sonst nicht klappt. \\ \code{latex}{"=} & Non-exclusive hyphen: Is used for long compound words when the text wrapping would not work without additional automatic hyphenation. \\
\mintinline{tex}|""| & Trennstelle ohne Strich: Kann beispielsweise verwendet werden, um \textsc{url}s ohne Bindestrich zu trennen. \\ \code{latex}{""} & Cut-off point without a hyphen: Allows something like a \acro{url} to wrap without inserting a potentially misleading hyphen. \\
\mintinline{tex}|"~| & Bindestrich ohne Trennstelle: Wird verwendet, um den Bindestrich zusammen mit dem folgenden Wort umbrechen zu lassen: \emph{Vorlesungszeit und "~raum} \\ \code{latex}{"~} & Non-wrapping hyphen: Keeps the hyphen together with the following word, very useful in German: \foreignlanguage{ngerman}{\emph{Vorlesungszeit und "~raum}} \\
\bottomrule \bottomrule
\caption{Ausnahmen für die Silbentrennung} \caption{Exceptions for hyphenation}
\label{tbl:separators} \label{tbl:separators}
\end{longtable} \end{longtable}
\section{Anführungszeichen} \section{Quotation marks}
Anführungszeichen können grundsätzlich mit den Codes in \cref{tbl:quotation-marks} erzeugt werden. Quotation marks can generally be created using the codes from \cref{tbl:quotation-marks}.
Entscheidend ist dabei jeweils das Aussehen und nicht die Semantik, weshalb zum Beispiel im Deutschen die französichen Guillemets verkehrt herum verwendet werden (»french left quoation mark« rechts und umgekehrt). The decisive factor is the appearance, not the semantics, which is why the French Guillemets are used the wrong way around in German
(the \emph{french left quotation mark} on the right and vice versa).
\begin{table}[H] \begin{table}[H]
\center \center
\begin{tabular}{lcccc} \begin{tabular}{lcccc}
\toprule \toprule
Sprache & \multicolumn{2}{c}{Erste Ebene} & \multicolumn{2}{c}{Zweite Ebene} \\ Language & \multicolumn{2}{c}{First level} & \multicolumn{2}{c}{Second level} \\
\cmidrule(lr){2-3} \cmidrule(lr){4-5} \cmidrule(lr){2-3} \cmidrule(lr){4-5}
& Code & Ergebnis & Code & Ergebnis \\ & Code & Result & Code & Result \\
\midrule \midrule
Deutsch & \mintinline{tex}|\glqq...\grqq| & \glqq\grqq & \mintinline{tex}|\glq\grq| & \glq\grq \\ English (\acro{A.\,E.}) & \code{latex}{``...''} & ``…'' & \code{latex}{`...'} & `…' \\
Deutsch alternativ & \mintinline{tex}|\frqq...\flqq| & \frqq\flqq & \mintinline{tex}|\frq\flq| & \frq\flq \\ English (\acro{B.\,E.}) & \code{latex}{`...'} & `…' & \code{latex}{``...''} & ``…'' \\
Englisch (\acro{A.\,E.}) & \mintinline{tex}|``...''| & ``…'' & \mintinline{tex}|`...'| & `…' \\ German & \code{latex}{\glqq...\grqq} & \glqq\grqq & \code{latex}{\glq\grq} & \glq\grq \\
Englisch (\acro{B.\,E.}) & \mintinline{tex}|`...'| & `…' & \mintinline{tex}|``...''| & ``…'' \\ German (alternatively) & \code{latex}{\frqq...\flqq} & \frqq\flqq & \code{latex}{\frq\flq} & \frq\flq \\
\bottomrule \bottomrule
\end{tabular} \end{tabular}
\caption{Anführungszeichen} \caption{Quotation marks}
\label{tbl:quotation-marks} \label{tbl:quotation-marks}
\end{table} \end{table}
Deutlich flexibler seid ihr aber mit dem Paket \mintinline{tex}{csquotes}, das den Befehl \mintinline{tex}|\enquote{<zitat>}| zur Verfügung stellt. We can get more flexibility using the \pkg{csquote} package, which provides the \code{latex}{\enquote{<quote>}} command.
Abhängig von der Sprache werden die passenden Anführungszeichen verwendet; bei verschachtelten \texttt{enquote}s wird zwischen erster und zweiter Ebene gewechselt. It chooses the correct quotation marks depending on the language being used; also, nested \texttt{enquote}s automatically switch back and forth between first and second level.
Mit der Option \mintinline{tex}|autostyle=true| beim Paketimport setzt der Befehl \mintinline{tex}|\foreignquote{<sprache>}{<zitat>}| je nach Sprache abweichende Anführungszeichen. When enabling the \code{latex}{autostyle=true} option on package import, \code{latex}{\textbackslash foreignquote\{<language>\}\{<quote>\}} selects varying quotation marks for each quotation.
\section{Diakritika} \section{Diacritics}
Wenn ihr Buchstaben mit diakritischen Zeichen direkt über die Tastatur eingeben könnt beispielsweise die deutschen Umlaute oder gängige Akzente auf einer deutschen Tastatur , könnt ihr das auch direkt im Quelltext tun. If we are able to insert letters with diacritics via our keyboard\,---\,e.\,g., the German Umlauts or common accents\,---\,we can do this within our source code, as well:
Die Zeichen bleiben dann im Output erhalten. The characters will remain intact in the output.
Ansonsten können die Diakritika auch per Escape-Codes erzeugt werden. If not, we can also create the diacritics via escape codes.
\cref{tbl:diacritics} gibt nur einige Beispiele an die Buchstaben lassen sich natürlich austauschen, es gibt aber auch noch viele andere Diakritika. \Cref{tbl:diacritics} shows just a few examples\,---\,the letters can of course be swapped out, but there is still a huge amount of different diacritics.
\begin{table}[H] \begin{table}[H]
\center \center
\begin{tabular}{lccclccclcc} \begin{tabular}{lccclccclcc}
\toprule \toprule
\verb|\`{o}| & -- & \`{o} & $\quad$ & \verb|\c{c}| & -- & \c{c} & $\quad$ & \verb|\d{u}| & -- & \d{u} \\ \code{latex}{\textbackslash `{o}} & -- & \`{o} & $\quad$ & \code{latex}{\textbackslash c{c}} & -- & \c{c} & $\quad$ & \code{latex}{\textbackslash d{u}} & -- & \d{u} \\
\verb|\'{o}| & -- & \'{o} & & \verb|\k{a}| & -- & \k{a} & & \verb|\r{a}| & -- & \r{a} \\ \code{latex}{\textbackslash '\{o\}} & -- & \'{o} & & \code{latex}{\textbackslash k\{a\}} & -- & \k{a} & & \code{latex}{\textbackslash r\{a\}} & -- & \r{a} \\
\verb|\^{o}| & -- & \^{o} & & \verb|\l{}| & -- & \l{} & & \verb|\u{o}| & -- & \u{o} \\ \code{latex}{\textbackslash \^\{o\}} & -- & \^{o} & & \code{latex}{\textbackslash l\{\}} & -- & \l{} & & \code{latex}{\textbackslash u\{o\}} & -- & \u{o} \\
\verb|\"{o}| & -- & \"{o} & & \verb|\={o}| & -- & \={o} & & \verb|\v{s}| & -- & \v{s} \\ \code{latex}{\textbackslash "\{o\}} & -- & \"{o} & & \code{latex}{\textbackslash =\{o\}} & -- & \={o} & & \code{latex}{\textbackslash v\{s\}} & -- & \v{s} \\
\verb|\H{o}| & -- & \H{o} & & \verb|\b{o}| & -- & \b{o} & & \verb|\t{oo}| & -- & \t{oo} \\ \code{latex}{\textbackslash H\{o\}} & -- & \H{o} & & \code{latex}{\textbackslash b\{o\}} & -- & \b{o} & & \code{latex}{\textbackslash t\{oo\}} & -- & \t{oo} \\
\verb|\~{o}| & -- & \~{o} & & \verb|\.{o}| & -- & \.{o} & & \verb|\o| & -- & \o \\ \code{latex}{\textbackslash ~\{o\}} & -- & \~{o} & & \code{latex}{\textbackslash .\{o\}} & -- & \.{o} & & \code{latex}{\textbackslash o} & -- & \o \\
\bottomrule \bottomrule
\end{tabular} \end{tabular}
\caption{Diakritika} \caption{Diacritics}
\label{tbl:diacritics} \label{tbl:diacritics}
\end{table} \end{table}
\section{Andere Sonderzeichen} \section{More special characters}\label{sec:more-special-characters}
Einige Sonderzeichen, beispielsweise das Prozentzeichen, sind für die \LaTeX{}-Syntax reserviert und können nicht als normale Zeichen verwendet werden. Some special characters, like the percent sign, are reserved as part of the \LaTeX{} syntax and cannot be used as normal characters.
Diese und viele, viele weitere Sonderzeichen können über eigene Befehle erzeugt werden. These and many, many more can be created by their own commands.
Dabei ist zu beachten, dass manche Sonderzeichen nur in Mathe-Umgebungen (siehe \cref{sec:maths}) funktionieren, andere brauchen zusätzliche Pakete. Please note that some of them only work in maths environments (c.\,f. \cref{sec:maths}), others might require additional packages.
\begin{table}[H] \begin{table}[H]
\center \center
\begin{tabular}{cll} \begin{tabular}{cll}
\toprule \toprule
Zeichen & Code & Bemerkung \\ Sign & Code & Remarks \\
\midrule \midrule
?`/!` & \verb|?`/!`| & \\ ?`/!` & \verb|?`/!`| & \\
\textasciicircum & \verb|\textasciicircum| & \\ \textasciicircum & \code{latex}{\textbackslash textasciicircum} & \\
\textasciitilde & \verb|\textasciitilde| & \\ \textasciitilde & \code{latex}{\textbackslash textasciitilde} & \\
\textasteriskcentered & \verb|\textasteriskcentered| & \\ \textasteriskcentered & \code{latex}{\textbackslash textasteriskcentered} & \\
\textbackslash & \verb|\textbackslash| & \\ \textbackslash & \code{latex}{\textbackslash textbackslash} & \\
%\textbar & \verb|\textbar| & \\ %\textbar & \code{latex}{\textbackslash textbar} & \\
%\textbullet & \verb|\textbullet| & \\ %\textbullet & \code{latex}{\textbackslash textbullet} & \\
\textcopyright & \verb|\textcopyright| & \\ \textcopyright & \code{latex}{\textbackslash textcopyright} & \\
\textdagger & \verb|\textdagger| & \\ \textdagger & \code{latex}{\textbackslash textdagger} & \\
%\textdaggerdbl & \verb|\textdaggerdbl| & \\ %\textdaggerdbl & \code{latex}{\textbackslash textdaggerdbl} & \\
\textellipsis & \verb|\textellipsis| & \\ \textellipsis & \code{latex}{\textbackslash textellipsis} & \\
\textless/\textgreater & \verb|\textless/\textgreater| & \\ \textless/\textgreater & \code{latex}{\textbackslash textless/\textbackslash textgreater} & \\
\textperthousand & \verb|\textperthousand| & \\ \textperthousand & \code{latex}{\textbackslash textperthousand} & \\
\textsection & \verb|\textsection| & \\ \textsection & \code{latex}{\textbackslash textsection} & \\
$\delta, \pi, \Sigma$ & \verb|\delta, \pi, \Sigma|, … & nur in Mathe-Umgebung \\ $\delta, \pi, \Sigma$ & \verb|\delta, \pi, \Sigma|, … & only in maths environments \\
\euro & \verb|\euro| & nur mit Paket \texttt{eurosym} \\ \euro & \code{latex}{\textbackslash euro} & requires the \pkg{eurosym} package \\
\textteshlig & \verb|\textteshlig| & nur mit Paket \texttt{tipa} \\ \textteshlig & \code{latex}{\textbackslash textteshlig} & requires the \pkg{tipa} package \\
\textmusicalnote & \verb|\textmusicalnote| & nur mit Paket \texttt{textcomp} \\ \textmusicalnote & \code{latex}{\textbackslash textmusicalnote} & requires the \pkg{textcomp} package \\
\bottomrule \bottomrule
\end{tabular} \end{tabular}
\caption{Einige Sonderzeichen} \caption{Some special characters}
\label{tbl:special-characters} \label{tbl:special-characters}
\end{table} \end{table}
Falls ihr mal ein Sonderzeichen braucht, von dem ihr nicht genau wisst, wie es heißt, hilft euch \emph{Detexify}\footnote{\url{http://detexify.kirelabs.org/classify.html}} ihr könnt das Symbol zeichnen und bekommt alle nötigen Infos. Whenever you need a certain symbol and dont know its name, \emph{Detexify}\footnote{\url{http://detexify.kirelabs.org/classify.html}} comes to the rescue: You can draw the symbol and get all necessery information.
Dass es von Keilschrift bis zu technischen Symbolen wirklich \emph{alles} gibt, stellt ihr fest, wenn ihr durch die \emph{Comprehensive \LaTeX{} Symbol List}\footnote{\url{http://tug.ctan.org/info/symbols/comprehensive/symbols-a4.pdf}} blättert. From cuneiforms to technical symbols, there is absolutely \emph{everything}\textit{,} as you can see scrolling through the \emph{Comprehensive \LaTeX{} Symbol List}\textit{.}\footnote{\url{http://tug.ctan.org/info/symbols/comprehensive/symbols-a4.pdf}}

View File

@ -1,50 +1,50 @@
\chapter{Tabellen} \chapter{Tables}
\label{sec:tables} \label{sec:tables}
Für Tabellen gibt es zwei grundlegende Umgebungen. There are two fundamental environments for tables.
Die erste, \texttt{table}, ist dafür zuständig, die Tabelle insgesamt in das übrige Dokument einzubauen. The first one, called \mono{table}, is responsible for integrating the table as a whole into the document.
Die Positionierung erfolgt dabei analog zur Positionierung von Grafiken. Positioning is done the same way as it is with graphics.
Auch bei Tabellen kann der Befehl \mintinline{tex}{\caption} verwendet werden, um der Tabelle eine Beschriftung zuzuordnen. The \code{latex}{\textbackslash caption} command is the same, as well.
Beim Tabelleninhalt hören die Gemeinsamkeiten auf: At the table \emph{content}, the similarities end:
Während Grafiken aus externen Dateien stammen und nicht durch \LaTeX{} interpretiert werden, muss die innere Struktur von Tabellen im Code aufgeschlüsselt werden. While graphics are embedded from external files and not interpreted by \LaTeX{},
Dazu dient die Umgebung \texttt{tabular}, die als verpflichtenden Parameter eine Spaltendefinition erwartet. the inner structure of tables has to be encoded explicitly.
Die Spaltendefinition besteht aus je einem Buchstaben pro Tabellenspalte, der die Textausrichtung der Spalte angibt: This is done with the \mono{tabular} environment that expects a column definition as an obligatory parameter.
\texttt{l} für linksbündig, \texttt{r} für rechtsbündig, \texttt{c} für zentriert. The column definition consists of one letter per column specifying its text alignment:
\mono{l} for left-justified, \mono{r} for right-justified, \mono{c} for centered.
Innerhalb der \texttt{tabular}-Umgebung folgt dann der eigentliche Tabelleninhalt. Within the \mono{tabular} environment, the actual table content follows.
Dabei werden Tabellenzeilen genau wie Zeilenumbrüche durch \mintinline{tex}{\\} markiert, Zellengrenzen durch \mintinline{tex}{&}. Table rows are separated by \code{latex}{\textbackslash \textbackslash}, just like line breaks, and cells by an \code{latex}{\&}.
Für typografisch ansprechende Tabellen empfehlen wir das Paket \texttt{booktabs}.\footnote{Alle bisher genannten Befehle funktionieren auch ohne dieses Paket, das Ergebnis sieht dann aber deutlich unprofessioneller aus.} For typographically pleasing tables, we recommend the \pkg{booktabs} package.\footnote{All commands previously mentioned also work without this package, but the result will look far less professional.}
Dieses Paket bringt die Befehle \mintinline{tex}{\toprule}, \mintinline{tex}{\midrule} und \mintinline{tex}{\bottomrule} mit, die jeweils passende horizontale Linien für den Tabellenbegin, für Gruppierungen innerhalb der Tabelle sowie für das Tabellenende zeichnen. This package brings along the commands \code{latex}{\textbackslash toprule}, \code{tex}{\textbackslash midrule} and \code{tex}{\textbackslash bottomrule} that draw appropriate horizontal lines above, within and below the table, respectively.
Vertikale Linien können als senkrechter Strich (\texttt{|}) in die Spaltendefinition eingefügt werden, davon ist aber abzuraten. Vertical lines can be inserted as a vertical bar character (\mono{|}) in the column definition, but this is \emph{not} recommended.\footnote{The
Wenn ihr den zusätzlichen Weißraum entfernen möchtet, der standardmäßig die Spalten umgibt, könnt ihr ebenfalls zwischen den Buchstaben der Spaltendefinition die Zeichenkette \mintinline{tex}{@{}} einfügen. whitespace within the table separates the columns clearly enough, additional lines just make for visual clutter.}
If you want to remove the additional whitespace that surrounds the columns by default (e.\,g., to the left of the first column and to the right of the last), you can add the string \mono{@\{\}} at the corresponding places within the column definition.
Die komplette Tabelle kann dann beispielsweise so aussehen wie in \cref{lst:sample-table} abgebildet. A complete table can then look like the one shown in \cref{lst:sample-table}.
\Example{lst:sample-table}{tables/table-example}{tables/table-example-renderable}{Eine komplette Tabelle} \Example{lst:sample-table}{tables/table-example}{tables/table-example-renderable}{A complete table}
\paragraph{Überlänge} \paragraph{Excess length}
Für Tabellen, die über eine Seite hinausgehen, oder die Zeilenumbrüche innerhalb einzelner Tabellenzellen erfordern, kann zusätzlich das Paket \texttt{longtable} eingebunden werden, mit dem \texttt{booktabs} ebenfalls kompatibel ist. For tables exceeding one page or requiring line breaks within individual cells,
Die \texttt{longtable}-Umgebung vereint die \texttt{table}- und die \texttt{tabular}-Umgebung. the \pkg{longtable} package can be used additionally (also supported by \pkg{booktabs}).
Damit ergibt sich folgende Grundstruktur: The \pkg{longtable} environment combines the \mono{table} and \mono{tabular} environments.
With it, you get the following basic structure:
\begin{minted}{latex} \begin{samepage}
\begin{longtable} \codeblock{latex}{listings/tables/excess-length.tex}
% Inhalte \end{samepage}
\caption{<Beschriftung>}
\end{longtable}
\end{minted}
\paragraph{Überbreite} \paragraph{Excess width}
Soll stattdessen eine sehr breite Tabelle dargestellt werden, empfiehlt es sich auf hochkant ausgerichteten Seiten, die Tabelle um 90\textdegree{} zu drehen. If you want to present a very wide table instead, it is preferable on pages in portrait orientation to turn the table by 90\textdegree{}.
Das geht mithilfe des Pakets \texttt{rotating}. This can be done with the help of the \pkg{rotating} package.
Der einzige Unterschied zu einer normalen Tabelle ist, dass die \texttt{table}- Umgebung durch eine \texttt{sidewaystable}-Umgebung ersetzt wird. The only difference between this and a normal table is that the \mono{table} environment gets replaced by a \mono{sidewaystable} environment.
Die Positionierung und die enthaltene \texttt{tabular}"=Umgebung funktionieren unverändert. Positioning and the \mono{tabular} stay unaffected.
\paragraph{Weitere Möglichkeiten} \paragraph{More possibilities}
Natürlich bietet \LaTeX{} noch viele weitere Features für ausgefeiltere Tabellen, beispielsweise zeilen- oder spaltenübergreifende Zellen. Of course, \LaTeX{} offers lots of additional features for sophisticated tables, e.\,g., row- or column-spanning cells.
Dafür, oder wenn ihr euch einfach Tipparbeit sparen wollt, empfehlen wir euch den \emph{Tables Generator,}\footnote{\url{https://tablesgenerator.com/}} in dem ihr Tabellen in \textsc{wysiwyg}-Manier zusammenklicken könnt und kopierfertigen \LaTeX-Code erhaltet. For something like this\,---\,or just to save some typing\,---\,we recommend the \emph{Tables Generator}\textit{,}\footnote{\url{https://tablesgenerator.com/}} that allows you to click your tables together in \textsc{wysiwyg} style and provides you with \LaTeX{} code ready for copying into your document.

View File

@ -1,67 +1,68 @@
\chapter{Textauszeichnung} \chapter{Text markup}
Bei der Textauszeichnung wird zwischen semantischer und optischer Hervorhebung unterschieden. Text markup can be done in two ways: semantically or visually.
Wir empfehlen, so oft wie möglich semantische Auszeichnung zu verwenden, die nur angibt, \emph{warum} etwas ausgezeichnet wird, und \LaTeX{} überlässt, \emph{wie} es aussehen soll. We recommend that you use semantic markup whenever possible.
Die einfachste semantische Auszeichnung, die auch im vorherigen Satz verwendet wurde, ist eine Betonung mit \mintinline{latex}{\emph{}}. In contrast to visual markup, it only states \emph{why} something is special and entrusts to \LaTeX{} \emph{how} it is going to look.
Der Befehl lässt sich auch schachteln und setzt Text normalerweise kursiv bzw. in zweiter Ebene wieder gerade. The simplest semantic markup, that was also used in the previous sentence, is an emphasis: \code{latex}{\textbackslash emph\{\}}.
Diese Art der Hervorhebung wird erst beim Lesen wahrgenommen und zieht nicht schon vorher Aufmerksamkeit an, wie es der farbige Befehl in diesem Absatz tut, oder Fettsatz, der eher zur Gliederung geeignet ist. By default, this command sets text in italics.
When it is nested, the second level of emphasis is set straight again.
This kind of formatting is only perceived when reading the text and does not attract attention beforehand, as colored or bold text does (which is more appropriate for higher-level structuring purposes).
Einige optische Auszeichnungen werden in \cref{tbl:visual-markup} aufgelistet, sollten aber sehr vorsichtig verwendet werden. Some types of visual markup are listed in \cref{tbl:visual-markup}, but you should use them very carefully.
Grundsätzlich lassen sie sich auch untereinander schachteln, bei einigen Kombinationen werden aber die passenden Schriftschnitte fehlen. In principle, they can also be nested, however, for some combinations, the corresponding fonts will be missing.
Viele andere Programme fangen in solchen Fällen an, vorhandene Schnitte zu verzerren, um den fehlenden Schnitt zu imitieren. Many other programs try to distort existing fonts to imitate the missing one.
Gut sieht so etwas aber nicht aus, deshalb verzichtet \LaTeX{} darauf. As this does not look particularly good, \LaTeX{} will not do it.
So do not be surprised when your carefully nested selection of four different markups is just ignored and does not do anything at all.
\begin{table}[H] \begin{table}[H]
\center \center
\begin{tabular}{lll} \begin{tabular}{lll}
\toprule \toprule
Auszeichnung & Befehl & Darstellung \\ Markup & Command & Rendering \\
\midrule \midrule
fett & \mintinline{latex}{\textbf{bold face}} & \textbf{bold face} \\ bold & \code{latex}{\textbackslash textbf\{bold face\}} & \textbf{bold face} \\
kursiv & \mintinline{latex}{\textit{italics}} & \textit{italics} \\ italics & \code{latex}{\textbackslash textit\{italics\}} & \textit{italics} \\
Kapitälchen & \mintinline{latex}{\textsc{small caps}} & \textsc{small caps} \\ small caps & \code{latex}{\textbackslash textsc\{small caps\}} & \textsc{small caps} \\
dicktengleich & \mintinline{latex}{\texttt{typewriter text}} & \texttt{typewriter text} \\ monospaced & \code{latex}{\textbackslash texttt\{typewriter text\}} & \texttt{typewriter text} \\
schräg & \mintinline{latex}{\texttt{slanted}} & \textsl{slanted} (bitte nicht!) \\ slanted & \code{latex}{\textbackslash textsl\{slanted\}} & \textsl{slanted} (please, dont!) \\
unterstrichen & \mintinline{latex}{\underline{underlined}} & \underline{underlined} \\ underlined & \code{latex}{\textbackslash underline\{underlined\}} & \underline{underlined} \\
tiefgestellt & \mintinline{latex}{\textsubscript{subscript}} & x\textsubscript{subscript} \\ subscript & \code{latex}{\textbackslash textsubscript\{subscript\}} & x\textsubscript{subscript} \\
hochgestellt & \mintinline{latex}{\textsubscript{superscript}} & x\textsuperscript{superscript} \\ superscript & \code{latex}{\textbackslash textsubscript\{superscript\}} & x\textsuperscript{superscript} \\
\bottomrule \bottomrule
\end{tabular} \end{tabular}
\caption{Befehle zur optischen Textauszeichnung} \caption{Visual markup commands}
\label{tbl:visual-markup} \label{tbl:visual-markup}
\end{table} \end{table}
Normalerweise solltet ihr diese Befehle kaum brauchen, denn da, wo diese Auszeichnungen angebracht sind, tauchen sie meistens von selbst auf, wenn ihr semantische Befehle verwendet. Usually, you should not need these commands too often, as they appear by themselves when you are using semantic markup.
Beispielsweise stellt das Paket \texttt{hyperref} den Befehl \mintinline{latex}{\url{}} bereit. For instance, the \pkg{hyperref} package provides the \code{latex}{\textbackslash url\{\}} command.
Damit werden \textsc{url}s nicht nur mit einer dickten\-gleichen Schrift gesetzt, sondern sie sind auch anklickbar und werden bei Bedarf umgebrochen, ohne dass Bindestriche eingefügt werden. This command does not only use a mono-spaced font for \acro{URL}s, it also makes them clickable and, if necessary, wraps them without adding hyphens.
Das gleiche gilt für unterschiedliche Schriftgrößen: The same applies for different font sizes.
Die Größe der Schrift im Fließtext könnt ihr mit einer Option der Dokumentenklasse festlegen: You can specify the body text font size with an option at the document class:
\begin{minted}{latex} \codeblock{latex}{listings/text-markup/font-size.tex}
\documentclass[9pt]{article} Building upon this, \LaTeX{} generates different font sizes that can be called via the commands in \cref{tbl:type-sizes}.
\end{minted} It is, however, best to restrict those to title pages and similar things.
Darauf aufbauend erzeugt \LaTeX{} verschiedene Schriftgrade, die durch die Befehle in \cref{tbl:type-sizes} gesetzt werden können. For the rest, you can trust the default settings and avoid the visual clutter.
Beschränkt so etwas aber besser auf Titelseiten und ähnliches.
Für den Rest könnt ihr auf die Standardeinstellungen vertrauen und euch das visuelle Durcheinander sparen.
\begin{table}[H] \begin{table}[H]
\center \center
\begin{tabular}{ll} \begin{tabular}{ll}
\toprule \toprule
Befehl & Darstellung \\ Command & Rendering \\
\midrule \midrule
\mintinline{latex}{{\tiny winzig}} & {\tiny winzig} \\ \code{latex}{\{\textbackslash tiny tiny\}} & {\tiny tiny} \\
\mintinline{latex}{{\footnotesize Fußnotengröße}} & {\footnotesize Fußnotengröße} \\ \code{latex}{\{\textbackslash footnotesize footnote size\}} & {\footnotesize footnote size} \\
\mintinline{latex}{{\small klein}} & {\small klein} \\ \code{latex}{\{\textbackslash small small\}} & {\small small} \\
\mintinline{latex}{{\normalsize normal}} & {\normalsize normal} \\ \code{latex}{\{\textbackslash normalsize normal\}} & {\normalsize normal} \\
\mintinline{latex}{{\large groß}} & {\large groß} \\ \code{latex}{\{\textbackslash large large\}} & {\large large} \\
\mintinline{latex}{{\Large größer}} & {\Large größer} \\ \code{latex}{\{\textbackslash Large larger\}} & {\Large larger} \\
\mintinline{latex}{{\LARGE am größten}} & {\LARGE am größten} \\ \code{latex}{\{\textbackslash LARGE largest\}} & {\LARGE largest} \\
\mintinline{latex}{{\huge am allergrößten}} & {\huge am allergrößten} \\ \code{latex}{\{\textbackslash huge largest of all\}} & {\huge largest of all} \\
\mintinline{latex}{{\Huge Größenwahn}} & {\Huge Größenwahn} \\ \code{latex}{\{\textbackslash Huge megalomania\}} & {\Huge megalomania} \\
\bottomrule \bottomrule
\end{tabular} \end{tabular}
\caption{Befehle zur optischen Textauszeichnung} \caption{Font size commands}
\label{tbl:type-sizes} \label{tbl:type-sizes}
\end{table} \end{table}

View File

@ -4,7 +4,7 @@
\vspace{3em} \vspace{3em}
\rule{\textwidth}{1pt}\par \rule{\textwidth}{1pt}\par
\vspace{0.8\baselineskip} \vspace{0.8\baselineskip}
\Huge\bfseries Skript zum \LaTeX-Tutorium der Fachschaft \acro{WIAI} \Huge\bfseries Script for the Fachschaft \acro{WIAI} \LaTeX{} Workshop
\rule{\textwidth}{1pt}\par \rule{\textwidth}{1pt}\par
%{\large \today} %{\large \today}
\vfill \vfill
@ -21,9 +21,9 @@
\vfill \vfill
\begin{tabular}{@{}lp{9cm}} \begin{tabular}{@{}lp{9cm}}
& \subsubsection*{Impressum} \\ & \subsubsection*{Imprint} \\
& Das \LaTeX-Skript (Version 1.0 vom 28.~Mai 2021) wurde von der Fachschaft \acro{WIAI} der Otto-Friedrich-Universität Bamberg zusammengestellt. \\ & The \LaTeX{} Script (version 1.1 from January 21st, 2022) has been assembled by the Student Council of the Information Systems and Applied Computer Sciences Faculty (Fachschaft \acro{WIAI}) at the University of Bamberg. \\
& Es ist unterliegt der Creative-Commons-Lizenz \enquote{Namens"-nennung Weitergabe unter gleichen Bedingungen 4.0 International} (CC BY-SA 4.0): \\ & It is licensed under Creative Commons \enquote{Attribution-ShareAlike 4.0 International} (CC BY-SA 4.0): \\
\href{http://creativecommons.org/licenses/by-sa/4.0/}{\includegraphics[height=.5cm]{graphics/cc-by-sa}} & \url{http://creativecommons.org/licenses/by-sa/4.0/} \\ \\ \href{http://creativecommons.org/licenses/by-sa/4.0/}{\includegraphics[height=.5cm]{graphics/cc-by-sa}} & \url{http://creativecommons.org/licenses/by-sa/4.0/} \\ \\
& Auf Nachfrage können auch über diese Lizenz hinausgehende Erlaubnisse gewährt werden. & Upon request, allowances exceeding the limitations of this license may be granted.
\end{tabular} \end{tabular}

View File

@ -1,40 +0,0 @@
\chapter{Was ist \LaTeX?}
\label{sec:what-is-latex}
Anfang der 1960er-Jahre bekam ein ziemlich begabter amerikanischer PhD-Student den Auftrag, ein Buch über Compiler zu schreiben.
Nachdem er mit der Arbeit begonnen hatte, fragte er seinen Verleger, ob das Buch ein bisschen länger werden dürfe, da er auch die Grundlagen vorstellen wolle.
Der Verleger antwortete, er solle das Buch so lange machen, wie er es für nötig halte.
1968 erschien der erste Band, damals noch in Bleisatz gedruckt.
Der Bleisatz wurde zu dieser Zeit durch andere Verfahren verdrängt, mit deren Qualität der Autor aber nicht zufrieden war.
Er begann deshalb Ende der 70er-Jahre mit der Entwicklung seines eigenen Textsatzsystems \TeX, \emph{tech} ausgesprochen nach dem altgriechischen Wort \texttau$\mathrm{\acute{\varepsilon}}$\textchi\textnu\texteta{} (technē) für \emph{Kunst}.
Inzwischen ist Donald Knuth (so heißt der ehemalige Student) emeritierter Informatikprofessor und sein Compilerbuch auf das mehrbändige Standardwerk \emph{The Art of Computer Programming} angewachsen von dem allerdings drei Bände noch ausstehen, darunter auch der über Compiler.
Im Gegensatz zum Buch ist \TeX{} heute die seltene Erscheinung eines Softwaresystems, das man als \emph{fertig} bezeichnen darf, ohne damit \emph{tot} zu meinen.
Zwei Buchstaben fehlen noch zu \LaTeX:
Es sind die Anfangsbuchstaben des Nachnamens von Leslie Lamport, der in den 80er-Jahren basierend auf \TeX{} eine Sammlung von kleinen Programmen geschrieben hat, die das System für uns Endanwender nutzbar machten und so zu seiner Verbreitung beitrugen.
Die aktuelle Version \LaTeXe{} gibt es seit Mitte der 90er.
Wozu erzählen wir euch das?
Weil es einige der Vorteile begründet, die \LaTeX{} heute noch auszeichnen:
Es ist ein ausgereiftes, stabiles, verlässliches System,
das weitgehend automatisch typografisch hochwertigen Textsatz erzeugt.
Da der \TeX-Code in Plaintext-Dateien abgelegt wird (siehe \cref{sec:basic-functionality}), ergeben sich weitere Vorteile:
Ihr könnt eure Projekte übersichtlich strukturieren (\cref{sec:project-structure}),
und wann immer ihr Änderungen im Quelltext rückgängig macht, könnt ihr euch darauf verlassen, wieder die gleiche Ausgabe wie vorher zu erhalten.
Das klappt in größerem Maßstab natürlich auch in Verbindung mit Git oder anderen Quelltextversionierungstools.
Außerdem bleibt euer Quelltext langfristig zuverlässig lesbar, ohne dass ihr bestimmte Programme dafür benötigt.
Gleichzeitig ist der Austausch mit allen Programmen, die Plaintext unterstützen, sehr einfach.
% Quellen:
% https://en.wikipedia.org/wiki/Donald_Knuth
% https://de.wikipedia.org/wiki/Donald_E._Knuth
% https://en.wikipedia.org/wiki/The_Art_of_Computer_Programming
% https://de.wikipedia.org/wiki/The_Art_of_Computer_Programming
% https://en.wikipedia.org/wiki/TeX
% https://de.wikipedia.org/wiki/TeX
% https://de.wikipedia.org/wiki/LaTeX
% https://en.wikipedia.org/wiki/LaTeX

45
content/why-use-latex.tex Normal file
View File

@ -0,0 +1,45 @@
\chapter{Why use \LaTeX?}
\label{sec:why-uses-latex}
In the early 1960s, a rather talented American Ph.D. student was asked by a big publishing company whether he wanted to write a book on compilers.
He did.
Soon after he had begun with his research, he realized that he wanted to start with some foundations of computer science, so he asked the publishers if the book might be a little longer.
They replied, \enquote{make it as long as you feel necessary.}
In 1968, the first volume was published, at that time still printed using mechanical typesetting.
This method was just disappearing then, and being replaced by new methods.
However, the author did not like the results of those new methods, so,
at the end of the 70s, he began to develop his own typesetting system \TeX{}
(pronounced as \textipa{[tEx]}, \textipa{[tE\c{c}]} or \textipa{[tEk]}, named after the ancient Greek word \texttau$\mathrm{\acute{\varepsilon}}$\textchi\textnu\texteta{} \textipa{['tExnE:]} meaning \emph{art, craft}).
Today, Donald Knuth (that is the former students name) is a retired professor of computer science and his compiler book has grown to become the multi-volume standard work \emph{The Art of Computer Programming}\,\,three volumes of which are still to be written, among them the one on compilers.
Unlike the book, however, \TeX{} is the rare occurrence of a software system that may actually be called \emph{complete} without meaning \emph{dead}.
Two more letters are needed for \LaTeX:
They are the initial two letters of the last name of Leslie Lamport, who, in the 80s, extended \TeX{} by a collection of small programs that made the entire system usable for us end-users and are responsible for its widespread adoption.
The current version dates from the mid~90s.
Why are we telling you all of that?
It explains some of the advantages that still distinguish \LaTeX{} today:
It is a mature, stable, and reliable system
that does typesetting in a typographically sophisticated way and mostly automatically.
As the \TeX{} code is stored in plain text files (cf. \cref{sec:basic-functionality}),
even more advantages arise:
You can structure your projects clearly (cf. \cref{sec:project-structure}),
and whenever you undo changes in the source code, you can always rely on getting exactly the same output as before
rather than some more or less similar reconstruction.
On a larger scale, this does also work in connection with Git or other source code versioning tools.
Furthermore, you can trust your source code to be readable long-term, without any specific software.
It can always be opened with any program that supports plain text.
% Quellen:
% https://en.wikipedia.org/wiki/Donald_Knuth
% https://de.wikipedia.org/wiki/Donald_E._Knuth
% https://en.wikipedia.org/wiki/The_Art_of_Computer_Programming
% https://de.wikipedia.org/wiki/The_Art_of_Computer_Programming
% https://en.wikipedia.org/wiki/TeX
% https://de.wikipedia.org/wiki/TeX
% https://de.wikipedia.org/wiki/LaTeX
% https://en.wikipedia.org/wiki/LaTeX

View File

@ -0,0 +1,41 @@
% \documentclass{scrartcl}
% \usepackage[utf8]{inputenc}
% \usepackage[T1]{fontenc}
% \usepackage[english]{babel}
% \usepackage[hidelinks]{hyperref}
% \begin{document}
% \tableofcontents
\section{Beverages}
\subsection{Pink Lemonade}
We all know and love it in summer: a cold lemonade. The pink variant of our favorite summer drink is traditionally achieved by adding food coloring to the lemonade.
However, we changed things up a little and decided to go for a variant with berries instead of food coloring, which also makes the drink less sour.
\subsubsection{Ingredients}
For making the lemonade we need 400\,g of berries. You can use either frozen or fresh ones. You can, of course, adjust the choice of berries to your likings: raspberries, blueberries, blackberries, or a mixture work excellently for making the lemonade.
To make the drink sweeter we use 50\,ml of maple syrup. Needless to say, you can also use less, if you want your lemonade to be more sour. By the way, other sweeteners, such as agave syrup, or coconut sugar also work fine.
Additionally, we need the juice of four freshly-squeezed lemons, one litre worth of cold water and 400\,g of ice cubes to keep the drink cold.
\subsubsection{Instructions}
Put the berries along with the maple syrup into a large bowl and cook them at medium-high heat for around three to four minutes. When the berries start to soften, reduce the heat a little. Now mash the berries with the end of a wooden spoon until there are almost no big chunks anymore. The less chunks the better!
Place a sieve over the container that you want to store the lemonade in. Put the berries into the sieve. With the end of the wooden spoon, try to press out as much liquid of the berry mixture as possible. Let the juice sit until it is completely cold.
When the liquid is cold, add the lemon juice, the cold water, and the ice cubes and stir everything.
Your lemonade is now ready to enjoy!
\subsection{Hot Chocolate}
Coming soon!
\section{Breakfast}
\subsubsection{Buckwheat Overnight Oats}
Coming soon!
% \end{document}

View File

@ -1,40 +1 @@
\begin{minted}[breaklines]{latex} \codeblock{latex}{./exercises/basic-document-structure/document-structure.code.tex}
% \documentclass{scrartcl}
% \usepackage[utf8]{inputenc}
% \usepackage[T1]{fontenc}
% \usepackage[ngerman]{babel}
% \usepackage[hidelinks]{hyperref}
% \begin{document}
% \tableofcontents
\section{Getränke}
\subsection{Pink Lemonade}
Wir alle kennen und lieben sie im Sommer: eine kühle Limonade. Die pinke Variante wurde traditionell zubereitet, indem man der Limonade Lebensmittelfarbe hinzugefügt hat. Wir haben das Ganze etwas abgewandelt und uns für eine Variante mit Beeren entschieden, um den sauren Geschmack der Zitronen auszugleichen. Dadurch wird die Limonade ein perfekter und erfrischender Sommer-Drink!
\subsubsection{Zutaten}
Für die Zubereitung der Limonade braucht ihr 400 g Beeren. Sie können entweder gefroren oder frisch sein. Bei der Wahl der Beeren könnt ihr euch austoben: Himbeeren, Heidelbeeren, Brombeeren oder auch eine Mischung aus verschiedenen Beeren eignen sich hervorragend.
Für ein wenig Süße nutzen wir 50 ml Ahornsirup, natürlich könnt ihr auch mehr oder weniger nehmen, je nachdem, wie sauer ihr eure Limonade haben wollt. Übrigens eignen sich auch andere Süßungsmittel wie etwa Agavendicksaft oder Kokosblütensirup wunderbar.
Außerdem benötigen wir noch 4 gepresste Zitronen, ungefähr einen Liter kaltes Wasser und 400 g Eiswürfel, damit das Getränk auch schön kühl bleibt.
\subsubsection{Zubereitung}
Die Beeren zusammen mit dem Ahornsirup in einen Kochtopf geben und bei mittlerer Hitze für drei bis vier Minuten kochen. Sobald die Beeren anfangen, weich zu werden, könnt ihr die Hitze etwas reduzieren. Mit dem Ende eines Holzlöffels zerdrückt ihr nun die Beeren, bis so gut wie keine großen Stücke mehr vorhanden sind. Je weniger Stücke, desto besser!
Nun platziert ihr ein Sieb über dem Gefäß, in dem ihr eure Limonade aufbewahren wollt, und gebt die Himbeeren in das Sieb. Mit der Rückseite eines Löffels versucht ihr, so viel Saft wie möglich aus der Beeren-Mixtur zu pressen. Den Saft danach abkühlen lassen.
Sobald eure Beeren-Flüssigkeit abgekühlt ist, gebt den Zitronensaft, das kalte Wasser und die Eiswürfel hinzu und rührt alles ordentlich um.
Eure Limonade ist nun fertig zum genießen und bereit, in Gläser gefüllt zu werden!
\subsection{Heiße Schokolade}
Coming soon!
\section{Frühstücksgerichte}
\subsubsection{Overnight Oats aus Couscous}
Coming soon!
% \end{document}
\end{minted}

View File

@ -1,25 +1,25 @@
1. Getränke 1. Beverages
1.1 Pink Lemonade 1.1 Pink Lemonade
Wir alle kennen und lieben sie im Sommer: eine kühle Limonade. Die pinke Variante wurde traditionell zubereitet, indem man der Limonade Lebensmittelfarbe hinzugefügt hat. Wir haben das Ganze etwas abgewandelt und uns für eine Variante mit Beeren entschieden, um den sauren Geschmack der Zitronen auszugleichen. Dadurch wird die Limonade ein perfekter und erfrischender Sommer-Drink! We all know and love it in summer: a cold lemonade. The pink variant of our favorite summer drink is traditionally achieved by adding food coloring to the lemonade. However, we changed things up a little and decided to go for a variant with berries instead of food coloring, which also makes the drink less sour.
1.1.1 Zutaten 1.1.1 Ingredients
Für die Zubereitung der Limonade braucht ihr 400 g Beeren. Sie können entweder gefroren oder frisch sein. Bei der Wahl der Beeren könnt ihr euch austoben: Himbeeren, Heidelbeeren, Brombeeren oder auch eine Mischung aus verschiedenen Beeren eignen sich hervorragend. \\ For making the lemonade we need 400\,g of berries. You can use either frozen or fresh ones. You can, of course, adjust the choice of berries to your likings: raspberries, blueberries, blackberries, or a mixture work excellently for making the lemonade. \\
Für ein wenig Süße nutzen wir 50 ml Ahornsirup, natürlich könnt ihr auch mehr oder weniger nehmen, je nachdem, wie sauer ihr eure Limonade haben wollt. Übrigens eignen sich auch andere Süßungsmittel wie etwa Agavendicksaft oder Kokosblütensirup wunderbar. \\ To make the drink sweeter we use 50\,ml of maple syrup. Needless to say, you can also use less, if you want your lemonade to be more sour. By the way, other sweeteners, such as agave syrup, or coconut sugar also work fine. \\
Außerdem benötigen wir noch 4 gepresste Zitronen, ungefähr einen Liter kaltes Wasser und 400 g Eiswürfel, damit das Getränk auch schön kühl bleibt. Additionally, we need the juice of four freshly-squeezed lemons, one litre worth of cold water and 400\,g of ice cubes to keep the drink cold.
1.1.2 Zubereitung 1.1.2 Instructions
Die Beeren zusammen mit dem Ahornsirup in einen Kochtopf geben und bei mittlerer Hitze für drei bis vier Minuten kochen. Sobald die Beeren anfangen, weich zu werden, könnt ihr die Hitze etwas reduzieren. Mit dem Ende eines Holzlöffels zerdrückt ihr nun die Beeren, bis so gut wie keine großen Stücke mehr vorhanden sind. Je weniger Stücke, desto besser! \\ Put the berries along with the maple syrup into a large bowl and cook them at medium-high heat for around three to four minutes. When the berries start to soften, reduce the heat a little. Now mash the berries with the end of a wooden spoon until there are almost no big chunks anymore. The less chunks the better! \\
Nun platziert ihr ein Sieb über dem Gefäß, in dem ihr eure Limonade aufbewahren wollt, und gebt die Himbeeren in das Sieb. Mit der Rückseite eines Löffels versucht ihr, so viel Saft wie möglich aus der Beeren-Mixtur zu pressen. Den Saft danach abkühlen lassen. \\ Place a sieve over the container that you want to store the lemonade in. Put the berries into the sieve. With the end of the wooden spoon, try to press out as much liquid of the berry mixture as possible. Let the juice sit until it is completely cold. \\
Sobald eure Beeren-Flüssigkeit abgekühlt ist, gebt den Zitronensaft, das kalte Wasser und die Eiswürfel hinzu und rührt alles ordentlich um. \\ When the liquid is cold, add the lemon juice, the cold water, and the ice cubes and stir everything. \\
Eure Limonade ist nun fertig zum genießen und bereit, in Gläser gefüllt zu werden! Your lemonade is now ready to enjoy!
1.2 Heiße Schokolade 1.2 Hot Chocolate
Coming soon! Coming soon!
2. Frühstücksgerichte 2. Breakfast
2.1 Overnight Oats aus Couscous 2.1 Buckwheat Porridge
Coming soon! Coming soon!

View File

@ -0,0 +1,4 @@
\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}

View File

@ -1,7 +1,17 @@
\begin{enumerate} \begin{enumerate}
\item Im Ordner \mintinline{latex}{exercises/basic-document-structure} findet ihr eine Datei namens \mintinline{latex}{document-structure.tex}. Öffnet die Datei, kopiert den Text und fügt ihn in eine neue Datei ein, die ihr beispielsweise \mintinline[breaklines, breakbytokenanywhere]{latex}{document- structure-solution.tex} nennt. Packt den Text in der neuen Datei in eine \mintinline{latex}{document}-Umgebung und fügt eine Präambel ein, um euer erstes \LaTeX -Dokument anschließend kompilieren zu können. Kompiliert nun das neue Dokument. \item In the directory \file{exercises/basic-document-structure}, you can find a file named \file{document-structure.tex}. Wrap the text of the file in a \code{latex}{document} environment and add the following preamble. Afterwards, compile the document.
\item Herzlichen Glückwunsch, ihr habt euer erstes eigenes \LaTeX -Dokument erstellt und kompiliert. Wie euch vielleicht aufgefallen ist, sind die Absätze im Dokument mit \mintinline{latex}{\\} erstellt worden. Ersetzt diese durch richtige Absätze. \codeblock{latex}{./exercises/basic-document-structure/preamble.code.tex}
\item Nun ist es an der Zeit, das Dokument etwas zu strukturieren. Verwendet für die Überschriften die passenden \LaTeX -Befehle (\mintinline{latex}{\section}, \mintinline{latex}{\subsection}, usw.) und fügt anschließend ein Inhaltsverzeichnis in euer Dokument ein. \item Congratulations! You have created and compiled your first \LaTeX{}
\item Kommentiert im Anschluss die Präambel, die Dokumentenumgebung und das Inhaltsverzeichnis wieder aus. Nur so kann eure Lösung auch ins Skript eingebunden werden. document. Maybe you have noticed that paragraphs within the text were
created by using \code{latex}{\textbackslash\textbackslash}. Replace the
two backslashes by real paragraphs.
\item It is time to structure your first document. Use the \LaTeX{}
commands \code{latex}{\textbackslash section},
\code{latex}{\textbackslash subsection}, etc. to structure the text.
Also,
include
a table of contents for your document.
\item Afterwards, comment out the preamble, the document environment, and the table of contents.
\end{enumerate} \end{enumerate}
\exercisematerial{exercises/basic-document-structure/document-structure} \exercisematerial{exercises/basic-document-structure/document-structure}

View File

@ -0,0 +1,7 @@
Java is an object-oriented programming language, that appeared in
1995. The most recent version of the programming language is
version 16\footnote{March 2021}. In order to write Java programs,
one needs to install the so-called \emph{Java Development Kit
(JDK)}.\footnote{\url{https://www.oracle.com/java/technologies/javase-downloads.html}}
Java programs can be written independently from the operating
system that one uses.

View File

@ -1,5 +1 @@
\begin{minted}[breaklines,breakanywhere]{latex} \codeblock{latex}{./exercises/footnotes/footnotes.code.tex}
Java ist eine objektorientierte Programmiersprache, die im Jahr 1995 erschienen ist. Die aktuellste Variante der Programmiersprache befindet sich mittlerweile in der Version 16\footnote{Stand: März 2021}. Um ein Java-Programm zu schreiben benötigt man, unter anderem, das sogenannte \emph{Java Development Kit (JDK)}.\footnote{\url{https://www.oracle.com/java/technologies/javase-downloads.html}} Java-Programme lassen sich unabhängig vom Betriebssystem, auf dem man sich befindet, schreiben.
\end{minted}

View File

@ -1 +1 @@
Java ist eine objektorientierte Programmiersprache, die im Jahr 1995 erschienen ist. Die aktuellste Variante der Programmiersprache befindet sich mittlerweile in der Version 16 (Stand: März 2021). Um ein Java-Programm zu schreiben benötigt man, unter anderem, das sogenannte \emph{Java Development Kit (JDK)}. Java-Programme lassen sich unabhängig vom Betriebssystem, auf dem man sich befindet, schreiben. Java is an object-oriented programming language, that appeared in 1995. The most recent version of the programming language is version 16 (March 2021). In order to write Java programs, one needs to install the so-called \emph{Java Development Kit (JDK)}. Java programs can be written independently from the operating system that one uses.

View File

@ -1,4 +1,10 @@
Integriert im Text der Datei \mintinline{bash}{exercises/footnotes/footnotes.tex} das Statement \glqq{}Stand: März 2021\grqq{} in eine Fußnote. Fügt außerdem eine klickbare URL als Fußnote zum Download des Java Development Kits ein:\\ Make the text \enquote{March 2021} of the file
\file{exercises/footnotes/footnotes.tex} appear as a footnote instead of in
parentheses. Additionally, insert a clickable URL to the Java Development Kit
as footnote.
\todo{Sollten wir dieses Beispiel aus Faulheitsgründen vielleicht ersetzen?}
\texttt{https://www.oracle.com/java/technologies/javase-downloads.html} \texttt{https://www.oracle.com/java/technologies/javase-downloads.html}
\exercisematerial{exercises/footnotes/footnotes} \exercisematerial{exercises/footnotes/footnotes}

View File

@ -0,0 +1,5 @@
\begin{figure}[H]
\centering
\includegraphics[width=\textwidth]{exercises/graphics/latex-logo.png}
\caption{The \LaTeX{} Project Logo}
\end{figure}

View File

@ -1,7 +1 @@
\begin{minted}[breaklines,breakanywhere]{latex} \codeblock{latex}{./exercises/graphics/graphics.code.tex}
\begin{figure}[H]
\centering
\includegraphics[width=\textwidth]{exercises/graphics/latex-logo.png}
\caption{Das \LaTeX{}-Projekt-Logo}
\end{figure}
\end{minted}

View File

@ -1 +1 @@
Bitte hier das Bild einfügen. Please insert the image here.

View File

@ -1,3 +1,9 @@
Bei den Übungsaufgaben findet ihr im Ordner \mintinline{latex}{graphics} eine Bilddatei namens \mintinline{latex}{latex-logo.png}. Fügt das Bild in die Datei \mintinline{bash}{exercises/graphics/graphics.tex} ein. Sorgt dafür, dass das Bild genau unter diesem Text erscheint. Das Bild soll außerdem zentriert eingebunden werden und über eine Bildunterschrift verfügen. Passt die Größe außerdem an die Breite der Seite (\mintinline{latex}{\textwidth}) an. In the \file{exercises/graphics} directory you can find an image file
\file{latex-logo.png}. Insert the image into the
\file{exercises/graphics/graphics.tex} file. Make sure that the image is placed
exactly where you have specified it. On top of that, the picture shall be
centered, and a caption shall be added. Adapt the image width to the text width
(\code{latex}{\textbackslash textwidth}).
\exercisematerial{exercises/graphics/graphics} \exercisematerial{exercises/graphics/graphics}

View File

@ -0,0 +1,24 @@
Ingredients:
400 g berries, 50 ml maple syrup, 4 lemons, 1 l cold water, 400 g ice cubes
\noindent Instructions: Boil and shred the berries, add maple syrup, squeeze the lemons and add their juice, add the remaining ingredients, scramble thoroughly
\begin{itemize}
\item Ingredients:
\begin{compactitem}
\item 400 g berries
\item 50 ml maple sirup
\item 4 lemons
\item 1 l cold water
\item 400 g ice cubes
\end{compactitem}
\item Instructions:
\begin{compactenum}
\item boil and shred the berries
\item add maple sirup
\item squeeze the lemons and add their juice
\item add the remaining ingredients
\item scramble thoroughly
\end{compactenum}
\end{itemize}

View File

@ -1,20 +1 @@
\begin{minted}{latex} \codeblock{latex}{./exercises/lists/lists.code.tex}
\begin{itemize}
\item Zutaten:
\begin{compactitem}
\item 400 g Beeren
\item 50 ml Ahornsirup
\item 4 gepresste Zitronen
\item 1 Liter kales Wasser
\item 400 g Eiswürfel
\end{compactitem}
\item Arbeitsschritte:
\begin{compactenum}
\item Beeren kochen und zu Saft verarbeiten
\item Ahornsirup hinzufügen
\item Zitronensaft auspressen
\item restliche Zutaten zusammenfügen und verrühren
\end{compactenum}
\end{itemize}
\end{minted}

View File

@ -1,4 +1,4 @@
Zutaten: Ingredients:
400 g Beeren, 50 ml Ahornsirup, 4 gepresste Zitronen, 1 Liter kaltes Wasser, 400 g Eiswürfel 400~g berries, 50~ml maple sirup, 4~lemons, 1~l cold water, 400~g ice cubes
\noindent Arbeitsschritte: Beeren kochen und zu Saft verarbeiten, Ahornsirup hinzufügen, Zitronensaft auspressen, restliche Zutaten zusammenfügen und verrühren \noindent Instructions: Boil and shred the berries, add maple sirup, squeeze the lemons and add their juice, add the remaining ingredients, scramble thoroughly

View File

@ -1,3 +1,9 @@
Formatiert das Rezept in der Datei \mintinline{bash}{exercises/lists/lists.tex} als ungeordnete Liste (\mintinline{latex}{itemize}) mit den Elementen \emph{Zutaten} und \emph{Arbeitsschritte}. Innerhalb dieser soll eine kompakte, ungeordnete Liste (\mintinline{latex}{compactitem}) der Zutaten erstellt werden. Die Arbeitsschritte hingegen sollen als kompakte, geordnete Liste dargestellt werden. % TODO:
Format the recipe you can find in \file{exercises/lists/lists.tex} as an
unordered list (\code{latex}{itemize}) with sub-lists \emph{Ingredients}
and \emph{Instructions}.
Within these, there shall be a compact, unordered list
(\code{latex}{compactitem}) of ingredients and a compact, ordered list of
instructions, respectively.
\exercisematerial{exercises/lists/lists} \exercisematerial{exercises/lists/lists}

View File

@ -0,0 +1,4 @@
The first-mentioned book \citep{lamport1994} has been written by the creator of \LaTeX{}, Leslie Lamport himself. A more recent publication is \enquote{\LaTeX\ in 24 Hours} \citep{datta2017}. There is a plethora of further handbooks \citep*[e.\,g.,][]{goossensmittelbach2002}.
\bibliographystyle{natdin}
\bibliography{exercises/literature/literature.done.bib}

View File

@ -1,10 +1,4 @@
\inputminted[breaklines]{bibtex}{exercises/literature/literature.done.bib} %\inputminted[breaklines]{bibtex}{exercises/literature/literature.done.bib}
\codeblock{bibtex}{./exercises/literature/literature.done.bib}
\begin{minted}[breaklines]{latex} \codeblock{latex}{./exercises/literature/exercise-solution.tex}
Das erstgenannte Buch \citep{lamport1994} wurde vom Schöpfer von LaTeX, Leslie Lamport, selbst verfasst.
Da es bereits etwas betagter ist, geben wir euch mit \glqq{}\LaTeX\ in 24 Hours\grqq{} \citep{datta2017} noch ein aktuelleres Buch in die Hand.
Es gibt eine Unmenge weiterer Handbücher \citep*[u.\thinspace a.][]{goossensmittelbach2002}.
\bibliographystyle{natdin}
\bibliography{exercises/literature/literature.done.bib}
\end{minted}

View File

@ -1,6 +1,6 @@
Das erstgenannte Buch (Lamport, 1994) wurde vom Schöpfer von LaTeX, Leslie Lamport, selbst verfasst. The first-mentioned book (Lamport, 1994) has been written by the creator of \LaTeX{}, Leslie Lamport himself.
Da es bereits etwas betagter ist, geben wir euch mit \glqq{}\LaTeX\ in 24 Hours\grqq{} (Datta, 2017) noch ein aktuelleres Buch in die Hand. A more recent publication is \enquote{\LaTeX\ in 24 Hours} (Datta, 2017).
Es gibt eine Unmenge weiterer Handbücher (u.\thinspace a. Goossens, Mittelbach u. Samarin, 2002). There is a plethora of further handbooks (e.\,g., Goossens, Mittelbach and Samarin, 2002).
~\\ ~\\

View File

@ -1,18 +1,22 @@
\begin{enumerate} \begin{enumerate}
\item Sucht bei Google Scholar die Bib\TeX-Einträge für folgende \LaTeX"=Handbücher: \item Use Google Scholar to retrieve Bib\TeX{} entries for the following \LaTeX{}
handbooks:
\begin{itemize} \begin{itemize}
\item Leslie Lamport (1994): \LaTeX. A Document Preparation System. \item Leslie Lamport (1994): \LaTeX. A Document Preparation System.
\item Dilip Datta (2017): \LaTeX\ in 24 Hours. A Practical Guide for Scientific Writing. \item Dilip Datta (2017): \LaTeX\ in 24 Hours. A Practical Guide for Scientific Writing.
\item Frank Mittelbach / Michel Goossens (2002): Der \LaTeX-Begleiter. \item Frank Mittelbach / Michel Goossens (2002): Der \LaTeX-Begleiter.
\end{itemize} \end{itemize}
\item Vergleicht die Einträge mit den Ergebnissen, die euch \url{dblp.org} für dieselben Bücher liefert. \item Compare the entries with the results that \url{dblp.org} finds for the same titles.
\item Erstellt im Ordner \mintinline{latex}{exercises/literature} eine neue Bib\TeX-Datei mit dem Namen \mintinline{sh}{literature.bib}. \item Create a new Bib\TeX{} file called \file{literature.bib} in the
\item Fügt die Bib\TeX-Einträge in die Bib\TeX-Datei ein. Wählt hierfür aus Google Scholar und dblp die aus eurer Sicht geeigneteren Einträge. \file{exercises/literature} folder.
\item Vergebt aussagekräftige Bib\TeX-Keys. \item Add the Bib\TeX{} entries to the newly created Bib\TeX{} files. For this, select your preferred source among Google Scholar and dblp.
\item Bindet die Bib\TeX-Datei an einer geeigneten Stelle ein, an der später auch das Literaturverzeichnis zu sehen sein soll. \item Assign unique and meaningful Bib\TeX{} keys.
\item Zitiert die drei Handbücher in der Datei\\\mintinline{sh}{exercises/literature/literature.tex}. \item Include the Bib\TeX{} file in a suitable location, where later on the references should be listed.
\item Wählt den Bibliographiestil \mintinline{sh}{natdin}. \item Cite the three handbooks in the
\item \textbf{Hinweis}: Sollte das Kompilieren fehlschlagen, kann es hilfreich sein, einmal alle Hilfsdateien (\mintinline{sh}{main.aux/bbl/blg/loc/out/pdf/soc/toc}) zu löschen und neu zu kompilieren. file\\\file{exercises/literature/literature.tex}.
\item Make use of the \mono{natdin} biliography style.
\item \textbf{Note}: If compiling fails, it may help to remove all auxiliary
files \\(\mono{main.aux/bbl/blg/loc/out/pdf/soc/toc}) before compiling again.
\end{enumerate} \end{enumerate}
\exercisematerial{exercises/literature/literature} \exercisematerial{exercises/literature/literature}

View File

@ -0,0 +1,22 @@
% Gravitational acceleration in Germany
$$9,81\,\frac{m}{s^2}$$
% pq formula
$$x_{1,2} = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}$$
% Quadratic formula
$$x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$
% Catalan numbers
\begin{equation*}
C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!}
\end{equation*}
% Definition of a factorial
$$n! = \prod_{i=1}^{n} i$$
% Set of all odd natural numbers
$$\{ x \mid x \in \mathds{N}, \mathrm{odd}(x) \}$$
% Elimination $\neg\exists x$
$$\neg\exists x . p(x) \Leftrightarrow \forall x . \neg p(x)$$

View File

@ -1,25 +1 @@
\begin{minted}{latex} \codeblock{latex}{./exercises/maths/math-formulas.code.tex}
% Fallbeschleunigung in 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
\begin{equation*}
C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!}
\end{equation*}
% Definition der Fakultät
$$n! = \prod_{i=1}^{n} i$$
% Menge aller ungeraden natürlichen Zahlen
$$\{ x \mid x \in \mathds{N}, \mathrm{ungerade}(x) \}$$
% Elimination $\neg\exists x$
$$\neg\exists x . p(x) \Leftrightarrow \forall x . \neg p(x)$$
\end{minted}

View File

@ -1,2 +1,2 @@
% Ersetzt diese Grafik durch die entsprechenden Formeln: % Replace this graphic by the corresponding formulas:
\includegraphics{graphics/math-formulas.rend-crop.pdf} \includegraphics{graphics/math-formulas.rend-crop.pdf}

View File

@ -15,28 +15,28 @@
\hrule \hrule
\begin{center} \begin{center}
\textbf{Fallbeschleunigung in Deutschland} \textbf{Gravitational acceleration in Germany}
$$9,81\,\frac{m}{s^2}$$ \\ $$9,81\,\frac{m}{s^2}$$ \\
~ \\ ~ \\
\textbf {pq-Formel} \textbf {\textit{pq} formula}
$$x_{1,2} = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}$$ \\ $$x_{1,2} = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}$$ \\
~ \\ ~ \\
\textbf{Mitternachtsformel} \textbf{Quadratic formula}
$$x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$ \\ $$x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$ \\
~ \\ ~ \\
\textbf{Catalansche Zahlen} \textbf{Catalan numbers}
\begin{equation*} C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!} \end{equation*} \\ \begin{equation*} C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!} \end{equation*} \\
~ \\ ~ \\
\textbf{Definition der Fakultät} \textbf{Definition of a factorial}
$$n! = \prod_{i=1}^{n} i$$ \\ $$n! = \prod_{i=1}^{n} i$$ \\
~ \\ ~ \\
\textbf{Menge aller ungeraden natürlichen Zahlen} \textbf{Set of all odd natural numbers}
$$\{ x \mid x \in \mathds{N}, \mathrm{ungerade}(x) \}$$ $$\{ x \mid x \in \mathds{N}, \mathrm{odd}(x) \}$$
~ \\ ~ \\
\textbf{Elimination $\neg\exists x$} \textbf{Elimination $\neg\exists x$}

View File

@ -1,3 +1,4 @@
Setzt die folgenden Formeln und beachtet dabei die Größe der Klammern. Use \LaTeX{} math mode to typeset the following formulas.
Pay attention to the size of brackets.
\exercisematerial{exercises/maths/math-formulas} \exercisematerial{exercises/maths/math-formulas}

View File

@ -3,7 +3,7 @@
\usepackage[utf8]{inputenc} \usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc} \usepackage[T1]{fontenc}
\title{Übung zur Projektstruktur} \title{Exercise on Project Structure}
\begin{document} \begin{document}
\maketitle \maketitle

View File

@ -1,16 +1,16 @@
\documentclass{article} \documentclass{article}
\usepackage[ngerman]{babel} \usepackage[english]{babel}
\usepackage[utf8]{inputenc} \usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc} \usepackage[T1]{fontenc}
\title{Übung zur Projektstruktur} \title{Exercise on Project Structure}
\begin{document} \begin{document}
\maketitle \maketitle
\tableofcontents \tableofcontents
\newpage \newpage
\section{Erster Abschnitt} \section{First section}
Jelly beans tiramisu chocolate bar chupa chups candy canes lollipop liquorice cheesecake tootsie roll. Marshmallow sugar plum cake tiramisu jelly cake bear claw. Croissant liquorice jelly lollipop carrot cake. Cheesecake danish chocolate halvah. Candy canes jujubes chupa chups jujubes candy canes tootsie roll toffee danish sesame snaps. Sugar plum gummi bears lollipop chocolate bar. Ice cream soufflé sweet lemon drops chocolate soufflé gingerbread cookie muffin. Jelly beans tiramisu chocolate bar chupa chups candy canes lollipop liquorice cheesecake tootsie roll. Marshmallow sugar plum cake tiramisu jelly cake bear claw. Croissant liquorice jelly lollipop carrot cake. Cheesecake danish chocolate halvah. Candy canes jujubes chupa chups jujubes candy canes tootsie roll toffee danish sesame snaps. Sugar plum gummi bears lollipop chocolate bar. Ice cream soufflé sweet lemon drops chocolate soufflé gingerbread cookie muffin.
Sugar plum danish halvah jujubes pastry donut carrot cake dessert donut. Sweet gingerbread gingerbread wafer gummi bears pastry. Tootsie roll donut powder cake. Brownie halvah lollipop gummi bears. Liquorice pie caramels jelly beans. Halvah danish brownie danish toffee cotton candy lemon drops. Sugar plum danish halvah jujubes pastry donut carrot cake dessert donut. Sweet gingerbread gingerbread wafer gummi bears pastry. Tootsie roll donut powder cake. Brownie halvah lollipop gummi bears. Liquorice pie caramels jelly beans. Halvah danish brownie danish toffee cotton candy lemon drops.
@ -18,7 +18,7 @@ Sugar plum danish halvah jujubes pastry donut carrot cake dessert donut. Sweet g
Donut jelly beans candy canes muffin lemon drops carrot cake sugar plum. Sesame snaps pie bonbon cotton candy cookie caramels. Chupa chups dessert tootsie roll carrot cake candy cookie sweet roll jelly beans. Oat cake halvah gingerbread bonbon sweet sesame snaps dragée carrot cake. Bonbon pastry chupa chups. Chocolate cake macaroon jelly-o. Pastry pastry sugar plum jujubes lemon drops gummi bears sugar plum cheesecake fruitcake. Chocolate cake chocolate candy. Wafer carrot cake chocolate cake jujubes cupcake soufflé gingerbread chocolate cake donut. Donut jelly beans candy canes muffin lemon drops carrot cake sugar plum. Sesame snaps pie bonbon cotton candy cookie caramels. Chupa chups dessert tootsie roll carrot cake candy cookie sweet roll jelly beans. Oat cake halvah gingerbread bonbon sweet sesame snaps dragée carrot cake. Bonbon pastry chupa chups. Chocolate cake macaroon jelly-o. Pastry pastry sugar plum jujubes lemon drops gummi bears sugar plum cheesecake fruitcake. Chocolate cake chocolate candy. Wafer carrot cake chocolate cake jujubes cupcake soufflé gingerbread chocolate cake donut.
\newpage \newpage
\section{Zweiter Abschnitt} \section{Second section}
Sweet roll tart chocolate bar cotton candy jelly beans cheesecake. Ice cream pastry halvah tart dragée jelly beans chocolate toffee wafer. Pie tootsie roll wafer halvah jelly cake donut cheesecake. Caramels tiramisu candy canes tootsie roll danish apple pie topping topping. Gingerbread carrot cake chocolate cake liquorice jujubes caramels cupcake apple pie macaroon. Sweet roll tart chocolate bar cotton candy jelly beans cheesecake. Ice cream pastry halvah tart dragée jelly beans chocolate toffee wafer. Pie tootsie roll wafer halvah jelly cake donut cheesecake. Caramels tiramisu candy canes tootsie roll danish apple pie topping topping. Gingerbread carrot cake chocolate cake liquorice jujubes caramels cupcake apple pie macaroon.
@ -27,7 +27,7 @@ Marzipan marzipan cupcake pastry tart sesame snaps sweet roll pie. Marshmallow p
Carrot cake cotton candy toffee jelly-o chocolate toffee cookie sweet roll. Pastry tootsie roll marzipan apple pie lollipop gingerbread sweet. Fruitcake gummies bear claw croissant. Pie cotton candy cheesecake powder bonbon candy canes lemon drops sweet. Carrot cake cotton candy toffee jelly-o chocolate toffee cookie sweet roll. Pastry tootsie roll marzipan apple pie lollipop gingerbread sweet. Fruitcake gummies bear claw croissant. Pie cotton candy cheesecake powder bonbon candy canes lemon drops sweet.
\newpage \newpage
\section{Dritter Abschnitt} \section{Third ection}
Tart dragée bear claw icing fruitcake. Caramels marzipan jujubes bonbon. Fruitcake danish cookie halvah cake. Cheesecake sesame snaps jelly beans. Macaroon powder pie biscuit biscuit croissant cotton candy. Chocolate bar chupa chups tart cheesecake gingerbread tart. Ice cream muffin chupa chups sugar plum dragée topping marshmallow dragée. Tart dragée bear claw icing fruitcake. Caramels marzipan jujubes bonbon. Fruitcake danish cookie halvah cake. Cheesecake sesame snaps jelly beans. Macaroon powder pie biscuit biscuit croissant cotton candy. Chocolate bar chupa chups tart cheesecake gingerbread tart. Ice cream muffin chupa chups sugar plum dragée topping marshmallow dragée.

View File

@ -1,6 +1,6 @@
\documentclass{article} \documentclass{article}
\usepackage[ngerman]{babel} \usepackage[english]{babel}
\usepackage[utf8]{inputenc} \usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc} \usepackage[T1]{fontenc}
\title{Übung zur Projektstruktur} \title{Exercise on Project Structure}

View File

@ -1,4 +1,4 @@
\section{Erster Abschnitt} \section{First section}
Jelly beans tiramisu chocolate bar chupa chups candy canes lollipop liquorice cheesecake tootsie roll. Marshmallow sugar plum cake tiramisu jelly cake bear claw. Croissant liquorice jelly lollipop carrot cake. Cheesecake danish chocolate halvah. Candy canes jujubes chupa chups jujubes candy canes tootsie roll toffee danish sesame snaps. Sugar plum gummi bears lollipop chocolate bar. Ice cream soufflé sweet lemon drops chocolate soufflé gingerbread cookie muffin. Jelly beans tiramisu chocolate bar chupa chups candy canes lollipop liquorice cheesecake tootsie roll. Marshmallow sugar plum cake tiramisu jelly cake bear claw. Croissant liquorice jelly lollipop carrot cake. Cheesecake danish chocolate halvah. Candy canes jujubes chupa chups jujubes candy canes tootsie roll toffee danish sesame snaps. Sugar plum gummi bears lollipop chocolate bar. Ice cream soufflé sweet lemon drops chocolate soufflé gingerbread cookie muffin.
Sugar plum danish halvah jujubes pastry donut carrot cake dessert donut. Sweet gingerbread gingerbread wafer gummi bears pastry. Tootsie roll donut powder cake. Brownie halvah lollipop gummi bears. Liquorice pie caramels jelly beans. Halvah danish brownie danish toffee cotton candy lemon drops. Sugar plum danish halvah jujubes pastry donut carrot cake dessert donut. Sweet gingerbread gingerbread wafer gummi bears pastry. Tootsie roll donut powder cake. Brownie halvah lollipop gummi bears. Liquorice pie caramels jelly beans. Halvah danish brownie danish toffee cotton candy lemon drops.

View File

@ -1,4 +1,4 @@
\section{Zweiter Abschnitt} \section{Second section}
Sweet roll tart chocolate bar cotton candy jelly beans cheesecake. Ice cream pastry halvah tart dragée jelly beans chocolate toffee wafer. Pie tootsie roll wafer halvah jelly cake donut cheesecake. Caramels tiramisu candy canes tootsie roll danish apple pie topping topping. Gingerbread carrot cake chocolate cake liquorice jujubes caramels cupcake apple pie macaroon. Sweet roll tart chocolate bar cotton candy jelly beans cheesecake. Ice cream pastry halvah tart dragée jelly beans chocolate toffee wafer. Pie tootsie roll wafer halvah jelly cake donut cheesecake. Caramels tiramisu candy canes tootsie roll danish apple pie topping topping. Gingerbread carrot cake chocolate cake liquorice jujubes caramels cupcake apple pie macaroon.

View File

@ -1,4 +1,4 @@
\section{Dritter Abschnitt} \section{Third section}
Tart dragée bear claw icing fruitcake. Caramels marzipan jujubes bonbon. Fruitcake danish cookie halvah cake. Cheesecake sesame snaps jelly beans. Macaroon powder pie biscuit biscuit croissant cotton candy. Chocolate bar chupa chups tart cheesecake gingerbread tart. Ice cream muffin chupa chups sugar plum dragée topping marshmallow dragée. Tart dragée bear claw icing fruitcake. Caramels marzipan jujubes bonbon. Fruitcake danish cookie halvah cake. Cheesecake sesame snaps jelly beans. Macaroon powder pie biscuit biscuit croissant cotton candy. Chocolate bar chupa chups tart cheesecake gingerbread tart. Ice cream muffin chupa chups sugar plum dragée topping marshmallow dragée.

View File

@ -1,3 +1,4 @@
Im Ordner \mintinline{text}{exercises/project-structure} findet ihr die Datei \mintinline{text}{main.tex}. Within the directory \file{exercises/project-structure} you can find the file
\file{main.tex}.
\exercisematerial{exercises/project-structure/tasks} \exercisematerial{exercises/project-structure/tasks}

View File

@ -1,23 +1,49 @@
\begin{enumerate} \begin{enumerate}
\item \item
\textbf{Lagert die einzelnen Abschnitte in eigene Dateien \mintinline{latex}{section1.tex}, \mintinline{latex}{section2.tex} und \mintinline{latex}{section3.tex} aus und bindet sie mittels \mintinline{latex}{\include} ein.} \textbf{Put the sections of the file into separate files, named
\begin{figure}[H] \file{section1.tex}, \file{section2.tex}, and \file{section3.tex}. Include
\inputminted[linenos=true]{latex}{exercises/project-structure/main-with-preamble.done.tex} them using the \code{latex}{\textbackslash include} command.}
\caption{\mintinline{latex}{main.tex}}
\end{figure}
\begin{figure}[H]
\inputminted[linenos=true,breaklines=true]{latex}{exercises/project-structure/section1.done.tex}
\caption{\mintinline{latex}{section1.tex} (analog für die anderen Abschnitte)}
\end{figure}
\item
\textbf{Welcher Befehl wird durch \mintinline{latex}{\include} überflüssig?} \\
\mintinline{latex}{\include} sorgt eigenständig dafür, dass der Inhalt jeder eingebundener Datei auf einer eigenen Seite erscheint. Der Befehl \mintinline{latex}{\newpage} ist somit überflüssig.
\item
\textbf{Kann auch die Präambel ausgelagert werden? Wenn nicht, warum? Wenn doch, wofür ist diese Vorgehensweise eventuell nützlich?} \\
Auch die Präambel kann ausgelagert werden. Das Vorgehen entspricht dem aus Aufgabe 1 bekannten. In realen \LaTeX-Projekten sind häufig sehr viele Pakete eingebunden, die oftmals mit zusätzlichen Befehlen in der Präambel konfiguriert werden müssen. Es ist daher gute Praxis, die Präambel auszulagern. Das hat zudem den Vorteil, dass wir eine Datei mit den am häufigsten verwendeten Paketen einfach von einem Projekt ins andere mitnehmen können, ohne unsere Präambel immer wieder neu zu schreiben.
\item
\textbf{Ergänzt in der Präambel den Befehl \mintinline{latex}{\includeonly{section2}}. Kompiliert das Dokument und prüft, was sich geändert hat. Welche Funktion hat dieser Befehl und wofür könnte er bei einem größeren Projekt hilfreich sein? } \\
Der Befehl \mintinline{latex}{\includeonly{section2}} tut genau, was er sagt. Beim Kompilieren werden unter allen \mintinline{latex}{\include}-Statements nur noch diejenigen beachtet, deren Dateinamen auch in \mintinline{latex}{\includeonly{datei1,datei2,…}} vorkommen.
Wenn in größeren Projekten die Kompilierzeit mit jeder Seite länger wird, ist \mintinline{latex}{\includeonly} sehr nützlich. Mit der richtigen Einstellung wird nur kompiliert, woran wir gerade arbeiten. Vor dem finalen Kompiliervorgang können wir dann das \mintinline{latex}{\includeonly}-Statement entfernen und erhalten unser vollständiges PDF. \begin{figure}[H]
\codeblock{latex}{exercises/project-structure/main-with-preamble.done.tex}
\caption{\file{main.tex}}
\end{figure}
\begin{figure}[H]
\codeblock{latex}{exercises/project-structure/section1.done.tex}
\caption{\file{section1.tex} (analogous for the other
sections)}
\end{figure}
\item \textbf{Which command becomes superfluous when you use
\code{latex}{\textbackslash include}?} \\
\code{latex}{\textbackslash include} makes every included file appear on a
new page. Hence the command \code{latex}{\textbackslash newpage} becomes
superfluous.
\item \textbf{Can the preamble also be excluded? If no, why? If yes, when
can outsourcing the preamble be useful?}
The preamble can also be outsourced, like in task 1. In real-world
\LaTeX{} projects we often make use of numerous packages that need to be
configured by additional commands within the preamble. Therefore, it is
advisable to outsource the preamble. On top of that, this is useful
because the file with the most-commonly used packages can be moved from
one project to another without needing to rewrite the preamble every time.
\item
\textbf{Add the command \code{latex}{\textbackslash
includeonly\{section2\}} to the preamble. Compile the document again, and
check what has changed. What does the command do and how can it be helpful
in a larger project? }
The command \code{latex}{\textbackslash includeonly\{section2\}} does
exactly what the name already says. During compilation, only the
\code{latex}{\textbackslash include} statements that contain file names
that appear in \code{latex}{\textbackslash includeonly\{file1,file2, …\}}
are included.
This can be useful for larger projects, when the compile time becomes
longer since by using the \code{latex}{\textbackslash includeonly} only the
files can be included which we are currently working in. Before the final
compilation we can delete the \code{latex}{\textbackslash includeonly}
command and end up with our complete \acro{PDF}.
\end{enumerate} \end{enumerate}

View File

@ -1,6 +1,13 @@
\begin{enumerate} \begin{enumerate}
\item Lagert die einzelnen Abschnitte in eigene Dateien namens \mintinline{latex}{section1.tex}, \mintinline{latex}{section2.tex} und \mintinline{latex}{section3.tex} aus und bindet sie mittels \mintinline{latex}{\include} ein. \item \textbf{Put the sections of the file into separate files, named
\item Welcher Befehl wird durch \mintinline{latex}{\include} überflüssig? \texttt{section1.tex}, \texttt{section2.tex}, and \texttt{section3.tex}.
\item Kann auch die Präambel ausgelagert werden? Wenn nicht, warum? Wenn doch, wofür ist diese Vorgehensweise eventuell nützlich? Include them using the \code{\textbackslash include} command.}
\item Ergänzt in der Präambel den Befehl \mintinline{latex}{\includeonly{section2}}. Kompiliert das Dokument und prüft, was sich geändert hat. Welche Funktion hat dieser Befehl und wofür könnte er bei einem größeren Projekt hilfreich sein? \item \textbf{Which command becomes superfluous when you use
\code{\textbackslash include}}
\item \textbf{Can the preamble also be excluded? If no, why? If yes, why can
outsourcing the preamble be useful?}
\item \textbf{Add the command \code{\textbackslash includeonly\{section2\}} to
the
preamble. Compile the document again, and check what has changed. What does
the command do and why can it be helpful in a larger project? }
\end{enumerate} \end{enumerate}

View File

@ -0,0 +1,17 @@
C\# is an object-oriented programming language that was developed by Microsoft in 2011. In \cref{fig:csharp} we can see the logo of the programming language.
\begin{figure}[H]
\caption{The logo of C\#}
\label{fig:csharp}
\centering
\includegraphics[width=2cm]{exercises/references/csharp.png}
\end{figure}
\cref{lst:csharphelloworld} shows a program that prints the text \enquote{Hello LaTeX friends!} to the console. Like Java, C\# makes use of classes and main methods to build executable applications.
\begin{listing}[H]
\caption{A simple C\# program}
\label{lst:csharphelloworld}
\inputminted[breaklines,
linenos=true]{csharp}{exercises/references/HelloLateXFriends.cs}
\end{listing}

View File

@ -1,24 +1 @@
\begin{minted}[breaklines]{latex} \codeblock{latex}{./exercises/references/references.code.tex}
C\# ist eine objektorientierte Programmiersprache, die im Auftrag von Microsoft entwickelt wurde und die es bereits seit 2001 gibt. In \cref{fig:csharp} seht ihr das Logo der Programmiersprache.
\begin{figure}[H]
\caption{Das Logo der Programmiersprache C\#}
\label{fig:csharp}
\centering
\includegraphics[width=2cm]{exercises/references/csharp.png}
\end{figure}
\cref{lst:csharphelloworld} zeigt ein Programm, das den Text \enquote{Hello LaTeX friends!} auf der Konsole ausgibt. Ähnlich wie bei Java werden auch in C\# Klassen und eine Main-Methode verwendet, um eine ausführbare Anwendung zu bauen.
\begin{listing}[H]
\caption{Ein einfaches Programm in der Programmiersprache C\#}
\label{lst:csharphelloworld}
\inputminted[breaklines, linenos=true]{csharp}{exercises/references/HelloLateXFriends.cs}
\end{listing}
\end{minted}

View File

@ -1,14 +1,14 @@
C\# ist eine objektorientierte Programmiersprache, die im Auftrag von Microsoft entwickelt wurde und die es bereits seit 2001 gibt. In der Abbildung seht ihr das Logo der Programmiersprache. C\# is an object-oriented programming language that was developed by Microsoft in 2011. In the figure we can see the logo of the programming language.
\begin{figure}[H] \begin{figure}[H]
\caption{Das Logo der Programmiersprache C\#} \caption{The logo of C\#}
\centering \centering
\includegraphics[width=2cm]{exercises/references/csharp.png} \includegraphics[width=2cm]{exercises/references/csharp.png}
\end{figure} \end{figure}
Das nachstehende Quelltext-Listing zeigt ein Programm, das den Text \enquote{Hello LaTeX friends!} auf der Konsole ausgibt. Ähnlich wie bei Java werden auch in C\# Klassen und eine Main-Methode verwendet, um eine ausführbare Anwendung zu bauen. The following source code listing shows a program that prints the text \enquote{Hello LaTeX friends!} to the console. Like Java, C\# makes use of classes and main methods to build executable applications.
\inputminted[breaklines, linenos=true]{csharp}{exercises/references/HelloLateXFriends.cs} \codeblock{csharp}{exercises/references/HelloLateXFriends.cs}

View File

@ -1,3 +1,10 @@
Ersetzt im Text in der Datei \mintinline{bash}{exercises/references/references.tex} die Phrasen \enquote{in der Abbildung} und \enquote{Das nachstehende Quelltext-Listing} jeweils durch eine Referenz auf das Bild und auf das Quelltext-Listing. Nutzt dafür den Befehl \mintinline{latex}{\cref}. Achtet darauf, dass ihr zunächst Labels für die Elemente, die ihr referenzieren wollt, vergeben müsst. Hüllt das Quelltext-Listing dafür zunächst in eine Umgebung namens \mintinline{latex}{listing} und fügt noch eine Beschriftung hinzu. Achtet auch auf geeignete Präfixe vor den Labels. In file \file{exercises/references/references.tex}, replace \enquote{in the
figure} and \enquote{the following source code listing} with suited references.
Use the command \code{latex}{\textbackslash cref}. Do not forget to first
introduce
labels for the elements that you want to reference. To do so, first of all,
wrap the source code listing in a \code{latex}{listing} environment. Also
insert a caption for the source code listing.
Make sure to use suitable prefixes before the labels.
\exercisematerial{exercises/references/references} \exercisematerial{exercises/references/references}

View File

@ -0,0 +1,7 @@
\lstinputlisting[
language=Java,
numbers=left, % line numbers
showstringspaces=false, % spaces in strings
keywordstyle=\color{blue}, % keyword color
basicstyle=\ttfamily\small % overall font and size
]{exercises/source-code-listings/Source.java}

View File

@ -0,0 +1,13 @@
\usemintedstyle{native}
\definecolor{ourBackgroundColor}{rgb}{0.1,0.1,0.2}
\inputminted[
breaklines, % line breaks
linenos=true, % line numbers
bgcolor=ourBackgroundColor, % background color
firstline=5, % first line to be included
lastline=7, % last line to be included
gobble=4 % remove leading spaces
]{java}{exercises/source-code-listings/Source.java}
\usemintedstyle{default}

View File

@ -1,26 +1,15 @@
\usemintedstyle{native} % Show rendering with respect to the installed software
\definecolor{ourBackgroundColor}{rgb}{0.1,0.1,0.2} \ifthenelse{\equal{\listingsmode}{minted}}{%
\subsubsection{Minted rendering}
\input{exercises/source-code-listings/minted.done.tex}
}{%
\subsubsection{Listings rendering}
\input{exercises/source-code-listings/listings.done.tex}
}
\inputminted[ \subsubsection{Minted solution}
breaklines, \codeblock{latex}{./exercises/source-code-listings/minted.done.tex}
linenos=true,
bgcolor=ourBackgroundColor,
firstline=5,
lastline=7,
gobble=4
]{java}{exercises/source-code-listings/Source.java}
\usemintedstyle{default} \subsubsection{Listings solution}
\begin{minted}{latex} \codeblock{latex}{./exercises/source-code-listings/listings.done.tex}
\usemintedstyle{native}
\definecolor{ourBackgroundColor}{rgb}{0.1,0.1,0.2}
\inputminted[
breaklines, % Zeilenumbrüche
linenos=true, % Zeilennummerierung
bgcolor=ourBackgroundColor, % Hintergrundfarbe
firstline=5, % erste Zeile
lastline=7, % letzte Zeile
gobble=4 % Leerzeichen entfernen
]{java}{exercises/source-code-listings/Source.java}
\end{minted}

View File

@ -1,19 +1,36 @@
Im Ordner \mintinline{text}{exercises/source-code-listings} findet ihr eine Datei namens \mintinline{text}{Source.java}. In the folder \file{exercises/source-code-listings}, you will find a file called \file{Source.java}.
Wir werden diese im Folgenden in unser Dokument einbinden und das Aussehen unseren Wünschen anpassen. We will now include it into our document and adjust its display to fit our needs.
If you have questions, consult the \pkg{minted} or \pkg{listings} package documentation.
\section*{Minted tasks}
\begin{enumerate} \begin{enumerate}
\item Bindet die Datei an dieser Stelle ein. \item Include the file into \\
\item Aktiviert Syntax-Highlighting durch Angabe der Sprache Java. \file{exercises/source-code-listings/source-code-listings.tex}.
\item Lasst LaTeX zu lange Zeilen automatisch umbrechen. \item Activate syntax highlighting by stating the programming language Java.
\item Die Zeilen sollen nummeriert sein. \item Add line breaks and line numbers.
\item Nutzt das Theme \mintinline{latex}|native|. \item Use the theme \code{latex}{native}.
\item Dieses Theme ist für einen dunklen Hintergrund optimiert. Ändert die Hintergrundfarbe des Themes zu dunkelblau. \item This theme is optimized for a dark background. Change the background color to dark blue.
\item Bindet jetzt ausschließlich die Zeilen 5 bis 7 ein. \item Include only lines 5 to 7.
\item Entfernt die Leerzeichen am Anfang der Zeilen durch Angabe der richtigen Option. (Hinweis: Die Dokumentation spricht hier von \mintinline{latex}|gobble|.) \item Delete the spaces at the beginning of the lines by using a suitable
option. (Hint: The documentation speaks of \code{latex}{gobble}.)
\end{enumerate} \end{enumerate}
Konsultiert bei Fragen die Dokumentation des Paketes Minted. \section*{Listings tasks}
\begin{enumerate}
\item Include the file into \\
\file{exercises/source-code-listings/source-code-listings.tex}.
\item Activate syntax highlighting by stating the programming language Java.
\item Set the \mono{basicstyle} to a proper mono-spaced font (\mono{\textbackslash ttfamily \textbackslash small})
\item Add line numbers.
\item Change the keyword color to blue.
\item Don't show special characters for spaces in strings.
\end{enumerate}
\exercisematerial{exercises/source-code-listings/source-code-listings} \exercisematerial{exercises/source-code-listings/source-code-listings}
\usemintedstyle{} % Reset experiments from exercise material
% Reset experiments from exercise material if minted is used
\ifthenelse{\equal{\listingsmode}{minted}}{%
\usemintedstyle{default}
}{}

View File

@ -0,0 +1,7 @@
What is a semester ticket?
It is also known as \enquote{Studi-Ticket} or \enquote{Studi-Karte} and allows you to use the local public transport around Bamberg for free.
In Bamberg, your student card (Studierenden\-ausweis) is used, i.\,a., as a semester ticket.
To be able to use it, you should validate the student card in one of the university buildings.
This is possible after you have paid the semester fees (101,50\,\euro).
A validation printers are located in multiple university buildings, e.\,g., in the foyer of the Erba building, in front of the library.
This building is opened Monday\,--\,Friday, 7am\,--\,10pm.

View File

@ -1,4 +1 @@
\begin{minted}[breaklines]{latex} \codeblock{latex}{./exercises/special-characters/special-characters.code.tex}
Was ist eigentlich ein Semesterticket? Es ist auch als \enquote{Studi-Ticket} oder \enquote{Studi-Karte} bekannt und ermöglicht es euch, kostenlos die öffentlichen Verkehrsmittel in und um Bamberg zu nutzen. In Bamberg wird euer Studierenden\-ausweis u.\,a. als Semesterticket genutzt. Um es nutzen zu können, solltet ihr den Studierenden\-ausweis in einem der Universitätsgebäude validieren. Dies ist möglich, sobald ihr die Semestergebühr von 101,50\,\euro{} bezahlt habt. Ein Validierungsdrucker befindet sich z.\,B. im ERBA-Gebäude im Foyer vor der Bibliothek. Die Öffnungszeiten des Uni-Gebäudes an der Weberei sind Mo.\,--\,Fr., 7.00\,--\,22.00 Uhr.
\end{minted}

View File

@ -1 +1,7 @@
Was ist eigentlich ein Semesterticket? Es ist auch als Studi-Ticket oder Studi-Karte bekannt und ermöglicht es euch, kostenlos die öffentlichen Verkehrsmittel in und um Bamberg zu nutzen. In Bamberg wird euer Studierendenausweis u. a. als Semesterticket genutzt. Um es nutzen zu können, solltet ihr den Studierendenausweis in einem der Universitätsgebäude validieren. Dies ist möglich, sobald ihr die Semestergebühr von 101,50 Euro bezahlt habt. Ein Validierungsdrucker befindet sich z. B. im ERBA-Gebäude im Foyer vor der Bibliothek. Die Öffnungszeiten des Uni-Gebäudes an der Weberei sind Mo. - Fr., 7.00 - 22.00 Uhr. What is a semester ticket?
It is also known as Studi-Ticket or Studi-Karte and allows you to use the local public transport around Bamberg for free.
In Bamberg, your student card (Studierendenausweis) is used, i. a., as a semester ticket.
To be able to use it, you should validate the student card in one of the university buildings.
This is possible after you have paid the semester fees (101,50 EUR).
A validation printers are located in multiple university buildings, e. g., in the foyer of the Erba building, in front of the library.
This building is opened Monday - Friday, 7am - 10pm.

View File

@ -1,15 +1,16 @@
% Don't copy this ugly texttt line break hack. % breakanywhere doesn't seem to work.
Für diese Aufgabe arbeiten wir mit der Datei \texttt{exercises/}""\texttt{special-characters/}""\texttt{special-characters.tex}. For this task, we are using the file \file{exercises/special-characters.tex}.
Die Ergebnisse seht ihr im Skript bei Übung 5. To be able to see your results here within the script,
Kompiliert deshalb zur Prüfung eurer Lösung die Datei \mintinline{bash}{main.tex}. compile the \file{main.tex} file.
Dies gilt auch für die folgenden Aufgaben. This applies for the subsequent tasks, as well.
\begin{enumerate} \begin{enumerate}
\item Im Text findet ihr eine Reihe an Abkürzungen. Ersetzt die Leerzeichen innerhalb der Abkürzungen durch schmale Leerzeichen. Setzt außerdem ein schmales Leerzeichen vor das Wort \emph{Euro}. \item In the text, you find a bunch of abbreviations. Replace the spaces within the abbreviations by thin spaces. Put a thin space in front of the word \emph{EUR}.
\item Ersetzt die Bindestriche bei den Öffnungszeiten der ERBA durch Halbgeviertstriche. \item Replace the hyphens within the Erba opening hours by en dashes.
\item Setzt beim Wort \emph{Studierendenausweis} eine ausschließliche Trennstelle nach \enquote{Studierenden-}. \item Restrict the hyphenation of word \emph{Studierendenausweis} to one position: \\\emph{Studierenden-ausweis}.
\item Setzt die Wörter \emph{Studi-Ticket} und \emph{Studi-Karte} in Anführungszeichen. Nutzt dafür den Befehl \mintinline{latex}{\enquote}. \item Add quotation marks around the words \emph{Studi-Ticket} and
\item Ersetzt das Wort \emph{Euro} durch ein Euro-Zeichen. \emph{Studi-Karte} using the \code{latex}{\textbackslash enquote} command.
\item Replace the word \emph{EUR} by a Euro symbol (hence the thin space).
\end{enumerate} \end{enumerate}
\exercisematerial{exercises/special-characters/special-characters} \exercisematerial{exercises/special-characters/special-characters}

View File

@ -0,0 +1,13 @@
\begin{table}[h]
\centering
\begin{tabular}{clll}
\toprule
No. & Name & Abbreviation & Term \\
\midrule
1 & Foundations of Software Engineering & SWT-FSE-B & summer \\
2 & Information Retrieval & MI-IR-M & summer \\
3 & International Outsourcing Management & ISM-IOM-M & winter \\
\bottomrule
\end{tabular}
\caption{Overview over some courses}
\end{table}

View File

@ -1,29 +1,15 @@
\begin{minted}[breaklines]{latex} \codeblock{latex}{./exercises/tables/tables.code.tex}
\begin{table}[h]
\centering
\begin{tabular}{clll}
\toprule
Nr. & Name & Kürzel & Semester \\
\midrule
1 & Mathematik für Informatik 1 & GdI-MfI1-B & Winter \\
2 & Datenbanksysteme & MOBI-DBS-B & Sommer \\
3 & Einführung in die Medieninformatik & MI-EMI-B & Winter \\
\bottomrule
\end{tabular}
\caption{Übersicht über einige Veranstaltungen}
\end{table}
\end{minted}
\begin{table}[h] \begin{table}[h]
\centering \centering
\begin{tabular}{clll} \begin{tabular}{clll}
\toprule \toprule
Nr. & Name & Kürzel & Semester \\ No. & Name & Abbreviation & Term \\
\midrule \midrule
1 & Mathematik für Informatik 1 & GdI-MfI1-B & Winter \\ 1 & Foundations of Software Engineering & SWT-FSE-B & summer \\
2 & Datenbanksysteme & MOBI-DBS-B & Sommer \\ 2 & Information Retrieval & MI-IR-M & summer \\
3 & Einführung in die Medieninformatik & MI-EMI-B & Winter \\ 3 & International Outsourcing Management & ISM-IOM-M & winter \\
\bottomrule \bottomrule
\end{tabular} \end{tabular}
\caption{Übersicht über einige Veranstaltungen} \caption{Overview over some courses}
\end{table} \end{table}

View File

@ -1,11 +1,11 @@
\begin{itemize} \begin{itemize}
\item Mathematik für Informatik \item Foundations of Software Engineering
\subitem Kürzel: GdI-MfI1-B \subitem abbreviation: SWT-FSE-B
\subitem Semester: Winter \subitem term: summer
\item Datenbanksysteme \item Information Retrieval
\subitem Kürzel: MOBI-DBS-B \subitem abbreviation: MI-IR-M
\subitem Semester: Sommer \subitem term: summer
\item Einführung in die Medieninformatik \item International Outsourcing Management
\subitem Kürzel: MI-EMI-B \subitem abbreviation: ISM-IOM-M
\subitem Semester: Winter \subitem term: winter
\end{itemize} \end{itemize}

View File

@ -1,4 +1,9 @@
Die folgende Liste zeigt ein paar Eckdaten über einige Lehrveranstaltungen an der Fakultät WIAI. Die Übersicht ist allerdings etwas unschön geraten. Wandelt deshalb die Liste in eine Tabelle mit den Spalten \emph{Name}, \emph{Kürzel} und \emph{Semester} um. Fügt zusätzlich eine \emph{zentrierte Spalte} ein, in denen ihr die Veranstaltungen nummeriert. Fügt außerdem eine Tabellenunterschrift hinzu. Arbeitet hierfür bitte in der Datei \mintinline{bash}{exercises/tables/tables.tex}. The following list shows some key data about a few courses of the \acro{WIAI} faculty.
However, the overview is not as clear as it could be.
To improve it, convert the list into a table with columns for \emph{name}, \emph{abbreviation} and \emph{term}.
Insert an additional \emph{centered column} that numbers the courses.
Add a caption to the table.
You find the table in \file{exercises/tables/tables.tex}.
\exercisematerial{exercises/tables/tables} \exercisematerial{exercises/tables/tables}

View File

@ -0,0 +1,5 @@
``\emph{Recursion} (adjective: \emph{recursive}) occurs when a thing is defined in terms of itself or of its type.
\emph{Recursion} is used in a variety of disciplines ranging from linguistics to logic.
The most common application of \emph{recursion} is in mathematics and computer science, where a function being defined is applied within its own definition.''
Source and more information: \url{https://en.wikipedia.org/wiki/Recursion}

View File

@ -1,5 +1 @@
\begin{minted}[breaklines]{latex} \codeblock{latex}{./exercises/text-markup/markup.code.tex}
Die \emph{Rekursion} ist eine bekannte Problemlösestrategie in der Informatik. Dabei wird ein großes Problem zerlegt und zunächst nur ein Teil der Aufgabe gelöst. Oft wird \emph{Rekursion} innerhalb von Programmcode umgesetzt, indem eine Methode sich immer wieder selbst aufruft, bis eine bestimmte Abbruchbedingung erfüllt ist. Das heißt, dass das Programm theoretisch bis ins Unendliche weiterlaufen kann, wenn es \emph{rekursiv} ist.
Weitere Informationen findet ihr im Wikipedia-Artikel zur Rekursion unter \url{https://de.wikipedia.org/wiki/Rekursion}.
\end{minted}

View File

@ -1,3 +1,7 @@
Die Rekursion ist eine bekannte Problemlösestrategie in der Informatik. Dabei wird ein großes Problem zerlegt und zunächst nur ein Teil der Aufgabe gelöst. Oft wird Rekursion innerhalb von Programmcode umgesetzt, indem eine Methode sich immer wieder selbst aufruft, bis eine bestimmte Abbruchbedingung erfüllt ist. Das heißt, dass das Programm theoretisch bis ins Unendliche weiterlaufen kann, wenn es rekursiv ist. ``Recursion (adjective: recursive) occurs when a thing is defined in terms of itself or of its type.
Recursion is used in a variety of disciplines ranging from linguistics to logic.
The most common application of recursion is in mathematics and computer science,
where a function being defined is applied within its own definition.''
Source and more information: https://en.wikipedia.org/wiki/Recursion
Weitere Informationen findet ihr im Wikipedia-Artikel zur Rekursion unter https://de.wikipedia.org/wiki/Rekursion.

View File

@ -1,7 +1,8 @@
\begin{enumerate} \begin{enumerate}
\item Hebt im Text in der Datei \mintinline{bash}{exercies/text-markup/markup.tex} die Wörter \glqq{}Rekursion\grqq{} und \glqq{}rekursiv\grqq{} hervor. \item In \file{exercies/text-markup/markup.tex}, emphasize the words
\item Macht die URL im Text anklickbar. ``recursion'' and ``recursive.''
\item Natürlich könnt ihr auch die anderen Befehle, die ihr zur Textauszeichnung gelernt habt, ausprobieren. Entfernt sie allerdings im Anschluss wieder, um das Dokument sauber zu halten. \item Make the \textsc{url} clickable.
\item Of course, you can also experiment with the other commands that you learned for text markup. However, you might want to remove them afterwards to keep your document nice and tidy.
\end{enumerate} \end{enumerate}
\exercisematerial{exercises/text-markup/markup} \exercisematerial{exercises/text-markup/markup}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,2 @@
\usepackage[utf8]{inputenc}
\usepackage[t1]

View File

@ -0,0 +1 @@
\foreignlanguage{<language>}{<text>}

View File

@ -1,10 +1,10 @@
\section{Ebene 1} \section{Level 1}
Lorem ipsum % Lorem ipsum %
\subsection{Ebene 2} \subsection{Level 2}
Lorem ipsum % Lorem ipsum %
\subsubsection{Ebene 3} \subsubsection{Level 3}
Lorem ipsum % Lorem ipsum %
\paragraph{Ebene 4} \paragraph{Level 4}
Lorem ipsum % Lorem ipsum %
\subparagraph{Ebene 5} \subparagraph{Level 5}
Lorem ipsum % Lorem ipsum %

View File

@ -5,15 +5,15 @@
\begin{document} \begin{document}
\thispagestyle{empty} \thispagestyle{empty}
\section{Ebene 1} \section{Level 1}
Lorem ipsum dolor sit amet, consectetur adipisici elit. Lorem ipsum dolor sit amet, consectetur adipisici elit.
\subsection{Ebene 2} \subsection{Level 2}
Lorem ipsum dolor sit amet, consectetur adipisici elit. Lorem ipsum dolor sit amet, consectetur adipisici elit.
\subsubsection{Ebene 3} \subsubsection{Level 3}
Lorem ipsum dolor sit amet, consectetur adipisici elit. Lorem ipsum dolor sit amet, consectetur adipisici elit.
\paragraph{Ebene 4} \paragraph{Level 4}
Lorem ipsum dolor sit amet, consectetur adipisici elit. Lorem ipsum dolor sit amet, consectetur adipisici elit.
\subparagraph{Ebene 5} \subparagraph{Level 5}
Lorem ipsum dolor sit amet, consectetur adipisici elit. Lorem ipsum dolor sit amet, consectetur adipisici elit.
\end{document} \end{document}

View File

@ -4,5 +4,5 @@
\usepackage[ngerman]{babel} \usepackage[ngerman]{babel}
\begin{document} \begin{document}
Hallo, Welt! Hello World!
\end{document} \end{document}

View File

@ -5,5 +5,5 @@
\begin{document} \begin{document}
\thispagestyle{empty} \thispagestyle{empty}
Hallo, Welt! Hello World!
\end{document} \end{document}

View File

@ -0,0 +1 @@
\usepackage[ngerman]{babel}

View File

@ -0,0 +1 @@
\usepackage[<options>]{<packagename>}

View File

@ -0,0 +1 @@
\section[Title in the TOC]{Actual Chapter Title}

View File

@ -1,9 +1,9 @@
\documentclass[ngerman]{article} \documentclass[english]{article}
\usepackage[utf8]{inputenc} \usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc} \usepackage[T1]{fontenc}
\usepackage[ngerman]{babel} \usepackage[english]{babel}
\title{Die Welt der Trüffel} \title{The World of Truffles}
\author{Fooboar Rüssel \and Fachschaft WIAI} \author{Fooboar Rüssel \and Fachschaft WIAI}
\date{\today} \date{\today}

View File

@ -1,9 +1,9 @@
\documentclass[ngerman]{article} \documentclass[english]{article}
\usepackage[utf8]{inputenc} \usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc} \usepackage[T1]{fontenc}
\usepackage[ngerman]{babel} \usepackage[english]{babel}
\title{Die Welt der Trüffel} \title{The World of Truffles}
\author{Fooboar Rüssel \and Fachschaft WIAI} \author{Fooboar Rüssel \and Fachschaft WIAI}
\date{\today} \date{\today}

View File

@ -0,0 +1 @@
\<command>[<optional_parameters>]{<mandatory_parameters>}

Some files were not shown because too many files have changed in this diff Show More