From 5305dbb9244b395aa56a1032ba234d3aa41b18aa Mon Sep 17 00:00:00 2001 From: Jochen Mehlich Date: Sat, 18 Nov 2023 01:26:09 +0100 Subject: [PATCH] latex weekend update --- latex-weekend-wise-2023/index.html | 169 +++---- .../slides/basic-document-structure.de.md | 412 ++++++++++++++++++ .../slides/basic-document-structure.en.md | 411 +++++++++++++++++ .../slides/basic-functionality.de.md | 91 ++++ .../slides/basic-functionality.en.md | 93 ++++ latex-weekend-wise-2023/slides/graphics.de.md | 113 +++++ latex-weekend-wise-2023/slides/graphics.en.md | 113 +++++ latex-weekend-wise-2023/slides/intro.de.md | 67 +++ latex-weekend-wise-2023/slides/intro.en.md | 67 +++ latex-weekend-wise-2023/slides/lists.de.md | 164 +++++++ latex-weekend-wise-2023/slides/lists.en.md | 167 +++++++ .../slides/literature.de.md | 114 +++++ .../slides/literature.en.md | 114 +++++ latex-weekend-wise-2023/slides/maths.de.md | 228 ++++++++++ latex-weekend-wise-2023/slides/maths.en.md | 233 ++++++++++ latex-weekend-wise-2023/slides/packages.de.md | 214 +++++++++ latex-weekend-wise-2023/slides/packages.en.md | 215 +++++++++ .../slides/project-structure.de.md | 196 +++++++++ .../slides/project-structure.en.md | 195 +++++++++ .../slides/references-and-footnotes.de.md | 211 +++++++++ .../slides/references-and-footnotes.en.md | 213 +++++++++ .../slides/source-code-listings.de.md | 110 +++++ .../slides/source-code-listings.en.md | 110 +++++ .../slides/special-characters.de.md | 331 ++++++++++++++ .../slides/special-characters.en.md | 327 ++++++++++++++ latex-weekend-wise-2023/slides/support.de.md | 103 +++++ latex-weekend-wise-2023/slides/support.en.md | 104 +++++ latex-weekend-wise-2023/slides/tables.de.md | 233 ++++++++++ latex-weekend-wise-2023/slides/tables.en.md | 236 ++++++++++ .../slides/text-markup.de.md | 172 ++++++++ .../slides/text-markup.en.md | 172 ++++++++ .../slides/titlepage.de.md | 8 + .../slides/titlepage.en.md | 8 + .../slides/why-use-latex.de.md | 128 ++++++ .../slides/why-use-latex.en.md | 127 ++++++ latex-weekend/index.html | 169 +++---- .../slides/basic-document-structure.de.md | 412 ++++++++++++++++++ .../slides/basic-document-structure.en.md | 411 +++++++++++++++++ .../slides/basic-functionality.de.md | 91 ++++ .../slides/basic-functionality.en.md | 93 ++++ latex-weekend/slides/graphics.de.md | 113 +++++ latex-weekend/slides/graphics.en.md | 113 +++++ latex-weekend/slides/intro.de.md | 67 +++ latex-weekend/slides/intro.en.md | 67 +++ latex-weekend/slides/lists.de.md | 164 +++++++ latex-weekend/slides/lists.en.md | 167 +++++++ latex-weekend/slides/literature.de.md | 114 +++++ latex-weekend/slides/literature.en.md | 114 +++++ latex-weekend/slides/maths.de.md | 228 ++++++++++ latex-weekend/slides/maths.en.md | 233 ++++++++++ latex-weekend/slides/packages.de.md | 214 +++++++++ latex-weekend/slides/packages.en.md | 215 +++++++++ latex-weekend/slides/project-structure.de.md | 196 +++++++++ latex-weekend/slides/project-structure.en.md | 195 +++++++++ .../slides/references-and-footnotes.de.md | 211 +++++++++ .../slides/references-and-footnotes.en.md | 213 +++++++++ .../slides/source-code-listings.de.md | 110 +++++ .../slides/source-code-listings.en.md | 110 +++++ latex-weekend/slides/special-characters.de.md | 331 ++++++++++++++ latex-weekend/slides/special-characters.en.md | 327 ++++++++++++++ latex-weekend/slides/support.de.md | 103 +++++ latex-weekend/slides/support.en.md | 104 +++++ latex-weekend/slides/tables.de.md | 233 ++++++++++ latex-weekend/slides/tables.en.md | 236 ++++++++++ latex-weekend/slides/text-markup.de.md | 172 ++++++++ latex-weekend/slides/text-markup.en.md | 172 ++++++++ latex-weekend/slides/titlepage.de.md | 8 + latex-weekend/slides/titlepage.en.md | 8 + latex-weekend/slides/why-use-latex.de.md | 128 ++++++ latex-weekend/slides/why-use-latex.en.md | 127 ++++++ latex-wochenende-wise-2023/index.html | 170 ++++---- .../slides/basic-document-structure.de.md | 412 ++++++++++++++++++ .../slides/basic-document-structure.en.md | 411 +++++++++++++++++ .../slides/basic-functionality.de.md | 91 ++++ .../slides/basic-functionality.en.md | 93 ++++ .../slides/graphics.de.md | 113 +++++ .../slides/graphics.en.md | 113 +++++ latex-wochenende-wise-2023/slides/intro.de.md | 67 +++ latex-wochenende-wise-2023/slides/intro.en.md | 67 +++ latex-wochenende-wise-2023/slides/lists.de.md | 164 +++++++ latex-wochenende-wise-2023/slides/lists.en.md | 167 +++++++ .../slides/literature.de.md | 114 +++++ .../slides/literature.en.md | 114 +++++ latex-wochenende-wise-2023/slides/maths.de.md | 228 ++++++++++ latex-wochenende-wise-2023/slides/maths.en.md | 233 ++++++++++ .../slides/packages.de.md | 214 +++++++++ .../slides/packages.en.md | 215 +++++++++ .../slides/project-structure.de.md | 196 +++++++++ .../slides/project-structure.en.md | 195 +++++++++ .../slides/references-and-footnotes.de.md | 211 +++++++++ .../slides/references-and-footnotes.en.md | 213 +++++++++ .../slides/source-code-listings.de.md | 110 +++++ .../slides/source-code-listings.en.md | 110 +++++ .../slides/special-characters.de.md | 331 ++++++++++++++ .../slides/special-characters.en.md | 327 ++++++++++++++ .../slides/support.de.md | 103 +++++ .../slides/support.en.md | 104 +++++ .../slides/tables.de.md | 233 ++++++++++ .../slides/tables.en.md | 236 ++++++++++ .../slides/text-markup.de.md | 172 ++++++++ .../slides/text-markup.en.md | 172 ++++++++ .../slides/titlepage.de.md | 8 + .../slides/titlepage.en.md | 8 + .../slides/why-use-latex.de.md | 128 ++++++ .../slides/why-use-latex.en.md | 127 ++++++ latex-wochenende/index.html | 170 ++++---- .../slides/basic-document-structure.de.md | 412 ++++++++++++++++++ .../slides/basic-document-structure.en.md | 411 +++++++++++++++++ .../slides/basic-functionality.de.md | 91 ++++ .../slides/basic-functionality.en.md | 93 ++++ latex-wochenende/slides/graphics.de.md | 113 +++++ latex-wochenende/slides/graphics.en.md | 113 +++++ latex-wochenende/slides/intro.de.md | 67 +++ latex-wochenende/slides/intro.en.md | 67 +++ latex-wochenende/slides/lists.de.md | 164 +++++++ latex-wochenende/slides/lists.en.md | 167 +++++++ latex-wochenende/slides/literature.de.md | 114 +++++ latex-wochenende/slides/literature.en.md | 114 +++++ latex-wochenende/slides/maths.de.md | 228 ++++++++++ latex-wochenende/slides/maths.en.md | 233 ++++++++++ latex-wochenende/slides/packages.de.md | 214 +++++++++ latex-wochenende/slides/packages.en.md | 215 +++++++++ .../slides/project-structure.de.md | 196 +++++++++ .../slides/project-structure.en.md | 195 +++++++++ .../slides/references-and-footnotes.de.md | 211 +++++++++ .../slides/references-and-footnotes.en.md | 213 +++++++++ .../slides/source-code-listings.de.md | 110 +++++ .../slides/source-code-listings.en.md | 110 +++++ .../slides/special-characters.de.md | 331 ++++++++++++++ .../slides/special-characters.en.md | 327 ++++++++++++++ latex-wochenende/slides/support.de.md | 103 +++++ latex-wochenende/slides/support.en.md | 104 +++++ latex-wochenende/slides/tables.de.md | 233 ++++++++++ latex-wochenende/slides/tables.en.md | 236 ++++++++++ latex-wochenende/slides/text-markup.de.md | 172 ++++++++ latex-wochenende/slides/text-markup.en.md | 172 ++++++++ latex-wochenende/slides/titlepage.de.md | 8 + latex-wochenende/slides/titlepage.en.md | 8 + latex-wochenende/slides/why-use-latex.de.md | 128 ++++++ latex-wochenende/slides/why-use-latex.en.md | 127 ++++++ 140 files changed, 23544 insertions(+), 334 deletions(-) create mode 100644 latex-weekend-wise-2023/slides/basic-document-structure.de.md create mode 100644 latex-weekend-wise-2023/slides/basic-document-structure.en.md create mode 100644 latex-weekend-wise-2023/slides/basic-functionality.de.md create mode 100644 latex-weekend-wise-2023/slides/basic-functionality.en.md create mode 100644 latex-weekend-wise-2023/slides/graphics.de.md create mode 100644 latex-weekend-wise-2023/slides/graphics.en.md create mode 100644 latex-weekend-wise-2023/slides/intro.de.md create mode 100644 latex-weekend-wise-2023/slides/intro.en.md create mode 100644 latex-weekend-wise-2023/slides/lists.de.md create mode 100644 latex-weekend-wise-2023/slides/lists.en.md create mode 100644 latex-weekend-wise-2023/slides/literature.de.md create mode 100644 latex-weekend-wise-2023/slides/literature.en.md create mode 100644 latex-weekend-wise-2023/slides/maths.de.md create mode 100644 latex-weekend-wise-2023/slides/maths.en.md create mode 100644 latex-weekend-wise-2023/slides/packages.de.md create mode 100644 latex-weekend-wise-2023/slides/packages.en.md create mode 100644 latex-weekend-wise-2023/slides/project-structure.de.md create mode 100644 latex-weekend-wise-2023/slides/project-structure.en.md create mode 100644 latex-weekend-wise-2023/slides/references-and-footnotes.de.md create mode 100644 latex-weekend-wise-2023/slides/references-and-footnotes.en.md create mode 100644 latex-weekend-wise-2023/slides/source-code-listings.de.md create mode 100644 latex-weekend-wise-2023/slides/source-code-listings.en.md create mode 100644 latex-weekend-wise-2023/slides/special-characters.de.md create mode 100644 latex-weekend-wise-2023/slides/special-characters.en.md create mode 100644 latex-weekend-wise-2023/slides/support.de.md create mode 100644 latex-weekend-wise-2023/slides/support.en.md create mode 100644 latex-weekend-wise-2023/slides/tables.de.md create mode 100644 latex-weekend-wise-2023/slides/tables.en.md create mode 100644 latex-weekend-wise-2023/slides/text-markup.de.md create mode 100644 latex-weekend-wise-2023/slides/text-markup.en.md create mode 100644 latex-weekend-wise-2023/slides/titlepage.de.md create mode 100644 latex-weekend-wise-2023/slides/titlepage.en.md create mode 100644 latex-weekend-wise-2023/slides/why-use-latex.de.md create mode 100644 latex-weekend-wise-2023/slides/why-use-latex.en.md create mode 100644 latex-weekend/slides/basic-document-structure.de.md create mode 100644 latex-weekend/slides/basic-document-structure.en.md create mode 100644 latex-weekend/slides/basic-functionality.de.md create mode 100644 latex-weekend/slides/basic-functionality.en.md create mode 100644 latex-weekend/slides/graphics.de.md create mode 100644 latex-weekend/slides/graphics.en.md create mode 100644 latex-weekend/slides/intro.de.md create mode 100644 latex-weekend/slides/intro.en.md create mode 100644 latex-weekend/slides/lists.de.md create mode 100644 latex-weekend/slides/lists.en.md create mode 100644 latex-weekend/slides/literature.de.md create mode 100644 latex-weekend/slides/literature.en.md create mode 100644 latex-weekend/slides/maths.de.md create mode 100644 latex-weekend/slides/maths.en.md create mode 100644 latex-weekend/slides/packages.de.md create mode 100644 latex-weekend/slides/packages.en.md create mode 100644 latex-weekend/slides/project-structure.de.md create mode 100644 latex-weekend/slides/project-structure.en.md create mode 100644 latex-weekend/slides/references-and-footnotes.de.md create mode 100644 latex-weekend/slides/references-and-footnotes.en.md create mode 100644 latex-weekend/slides/source-code-listings.de.md create mode 100644 latex-weekend/slides/source-code-listings.en.md create mode 100644 latex-weekend/slides/special-characters.de.md create mode 100644 latex-weekend/slides/special-characters.en.md create mode 100644 latex-weekend/slides/support.de.md create mode 100644 latex-weekend/slides/support.en.md create mode 100644 latex-weekend/slides/tables.de.md create mode 100644 latex-weekend/slides/tables.en.md create mode 100644 latex-weekend/slides/text-markup.de.md create mode 100644 latex-weekend/slides/text-markup.en.md create mode 100644 latex-weekend/slides/titlepage.de.md create mode 100644 latex-weekend/slides/titlepage.en.md create mode 100644 latex-weekend/slides/why-use-latex.de.md create mode 100644 latex-weekend/slides/why-use-latex.en.md create mode 100644 latex-wochenende-wise-2023/slides/basic-document-structure.de.md create mode 100644 latex-wochenende-wise-2023/slides/basic-document-structure.en.md create mode 100644 latex-wochenende-wise-2023/slides/basic-functionality.de.md create mode 100644 latex-wochenende-wise-2023/slides/basic-functionality.en.md create mode 100644 latex-wochenende-wise-2023/slides/graphics.de.md create mode 100644 latex-wochenende-wise-2023/slides/graphics.en.md create mode 100644 latex-wochenende-wise-2023/slides/intro.de.md create mode 100644 latex-wochenende-wise-2023/slides/intro.en.md create mode 100644 latex-wochenende-wise-2023/slides/lists.de.md create mode 100644 latex-wochenende-wise-2023/slides/lists.en.md create mode 100644 latex-wochenende-wise-2023/slides/literature.de.md create mode 100644 latex-wochenende-wise-2023/slides/literature.en.md create mode 100644 latex-wochenende-wise-2023/slides/maths.de.md create mode 100644 latex-wochenende-wise-2023/slides/maths.en.md create mode 100644 latex-wochenende-wise-2023/slides/packages.de.md create mode 100644 latex-wochenende-wise-2023/slides/packages.en.md create mode 100644 latex-wochenende-wise-2023/slides/project-structure.de.md create mode 100644 latex-wochenende-wise-2023/slides/project-structure.en.md create mode 100644 latex-wochenende-wise-2023/slides/references-and-footnotes.de.md create mode 100644 latex-wochenende-wise-2023/slides/references-and-footnotes.en.md create mode 100644 latex-wochenende-wise-2023/slides/source-code-listings.de.md create mode 100644 latex-wochenende-wise-2023/slides/source-code-listings.en.md create mode 100644 latex-wochenende-wise-2023/slides/special-characters.de.md create mode 100644 latex-wochenende-wise-2023/slides/special-characters.en.md create mode 100644 latex-wochenende-wise-2023/slides/support.de.md create mode 100644 latex-wochenende-wise-2023/slides/support.en.md create mode 100644 latex-wochenende-wise-2023/slides/tables.de.md create mode 100644 latex-wochenende-wise-2023/slides/tables.en.md create mode 100644 latex-wochenende-wise-2023/slides/text-markup.de.md create mode 100644 latex-wochenende-wise-2023/slides/text-markup.en.md create mode 100644 latex-wochenende-wise-2023/slides/titlepage.de.md create mode 100644 latex-wochenende-wise-2023/slides/titlepage.en.md create mode 100644 latex-wochenende-wise-2023/slides/why-use-latex.de.md create mode 100644 latex-wochenende-wise-2023/slides/why-use-latex.en.md create mode 100644 latex-wochenende/slides/basic-document-structure.de.md create mode 100644 latex-wochenende/slides/basic-document-structure.en.md create mode 100644 latex-wochenende/slides/basic-functionality.de.md create mode 100644 latex-wochenende/slides/basic-functionality.en.md create mode 100644 latex-wochenende/slides/graphics.de.md create mode 100644 latex-wochenende/slides/graphics.en.md create mode 100644 latex-wochenende/slides/intro.de.md create mode 100644 latex-wochenende/slides/intro.en.md create mode 100644 latex-wochenende/slides/lists.de.md create mode 100644 latex-wochenende/slides/lists.en.md create mode 100644 latex-wochenende/slides/literature.de.md create mode 100644 latex-wochenende/slides/literature.en.md create mode 100644 latex-wochenende/slides/maths.de.md create mode 100644 latex-wochenende/slides/maths.en.md create mode 100644 latex-wochenende/slides/packages.de.md create mode 100644 latex-wochenende/slides/packages.en.md create mode 100644 latex-wochenende/slides/project-structure.de.md create mode 100644 latex-wochenende/slides/project-structure.en.md create mode 100644 latex-wochenende/slides/references-and-footnotes.de.md create mode 100644 latex-wochenende/slides/references-and-footnotes.en.md create mode 100644 latex-wochenende/slides/source-code-listings.de.md create mode 100644 latex-wochenende/slides/source-code-listings.en.md create mode 100644 latex-wochenende/slides/special-characters.de.md create mode 100644 latex-wochenende/slides/special-characters.en.md create mode 100644 latex-wochenende/slides/support.de.md create mode 100644 latex-wochenende/slides/support.en.md create mode 100644 latex-wochenende/slides/tables.de.md create mode 100644 latex-wochenende/slides/tables.en.md create mode 100644 latex-wochenende/slides/text-markup.de.md create mode 100644 latex-wochenende/slides/text-markup.en.md create mode 100644 latex-wochenende/slides/titlepage.de.md create mode 100644 latex-wochenende/slides/titlepage.en.md create mode 100644 latex-wochenende/slides/why-use-latex.de.md create mode 100644 latex-wochenende/slides/why-use-latex.en.md diff --git a/latex-weekend-wise-2023/index.html b/latex-weekend-wise-2023/index.html index d903fae..70988d3 100644 --- a/latex-weekend-wise-2023/index.html +++ b/latex-weekend-wise-2023/index.html @@ -182,13 +182,13 @@ Computer Programming
- +
Donald Knuth
- +
Leslie Lamport
@@ -197,7 +197,7 @@ Leslie Lamport
- +
@@ -498,27 +498,27 @@ it look like an actual paragraph. }
-

+

☹ slanted (distorted)

-

+

☺ straight

-

+

☺ italic (separate font)

-

+

☹ small font scaled up

-

+

☺ separate appropriate fonts

-

+

☹ big font scaled down

@@ -571,7 +571,7 @@ it look like an actual paragraph.
- +
@@ -617,7 +617,7 @@ Image source: xkcd
- +
@@ -627,7 +627,7 @@ Image source: xkcd
-How to get the final document +How to get the final document
@@ -729,7 +729,7 @@ Hello world!
- +
@@ -809,7 +809,7 @@ within continuous text.
- +
@@ -833,7 +833,7 @@ Place of birth: Milwaukee, Wisconsin
- +
@@ -854,7 +854,7 @@ instead.

- +
@@ -878,7 +878,7 @@ Always available:

- +
@@ -933,7 +933,7 @@ My favorite recipe
- +
@@ -982,7 +982,7 @@ My favorite recipe
- +
@@ -1089,7 +1089,7 @@ books
- +
@@ -1110,7 +1110,7 @@ contents:

- +
@@ -1163,7 +1163,7 @@ environment, and the table of contents.

- +
@@ -1194,7 +1194,7 @@ environment, and the table of contents.

- +
@@ -1225,7 +1225,7 @@ of section 2.
- +
@@ -1252,7 +1252,7 @@ those from here on.
- +
@@ -1275,7 +1275,7 @@ could also write praeamble.tex here.

- +
@@ -1294,7 +1294,7 @@ could also write praeamble.tex here.

- +
@@ -1306,8 +1306,11 @@ could also write praeamble.tex here.

Specifying file paths 👣

-task.texgraphics.raw.tex (while -task.tex is imported into main-exercises.tex) +basic-functionality.texgraphics.raw.tex +

+

+(basic-functionality.tex is imported into +main-exercises.tex)

./exercises/graphics/graphics.raw.tex
@@ -1319,7 +1322,7 @@ as fragments.
- +
@@ -1408,7 +1411,7 @@ gaps after full stops.
- +
@@ -1479,7 +1482,7 @@ a dash — mostly in American English
- +
@@ -1501,7 +1504,7 @@ Zitat.}
- +
@@ -1576,7 +1579,7 @@ check the results and intervene where needed by

- +
@@ -1646,7 +1649,7 @@ Some of the codes only work when you use the babel package.
- +
@@ -2103,8 +2106,8 @@ underlined
- - + +
@@ -2145,7 +2148,7 @@ command that reproduces URLs

- +
@@ -2191,7 +2194,7 @@ want to have a clean document.
- +
@@ -2217,7 +2220,7 @@ so better avoid it.
- +
@@ -2248,7 +2251,7 @@ for a given paragraph
- +
@@ -2287,7 +2290,7 @@ the same for all kinds of enumerations.

- +
@@ -2311,8 +2314,8 @@ the same for all kinds of enumerations.

- - + +
@@ -2338,7 +2341,7 @@ the same for all kinds of enumerations.

- +
@@ -2385,7 +2388,7 @@ spacing.

- +
@@ -2409,7 +2412,7 @@ integrate enumerations into paragraphs.

- +
@@ -2435,7 +2438,7 @@ integrate enumerations into paragraphs.

- +
@@ -2473,7 +2476,7 @@ signs. We can also use the equation block environment:

- +
@@ -2545,7 +2548,7 @@ if we add an asterisk after their names (e. g.
- +
@@ -2794,7 +2797,7 @@ Don’t use \limits inline.
- +
@@ -3043,7 +3046,7 @@ upon by typographers and should be avoided.

- +
@@ -3072,7 +3075,7 @@ upon by typographers and should be avoided.

- +
@@ -3115,7 +3118,7 @@ the width of the table content

The Tables Generator is a wonderful tool to quickly create tables of different formats.

-

+

@@ -3224,7 +3227,7 @@ landscape orientation:

- +
@@ -3265,7 +3268,7 @@ wiki/Wild_boar}}
- +
@@ -3290,7 +3293,7 @@ As you can see in figure
- +
@@ -3365,7 +3368,7 @@ prefixes.

- +
@@ -3456,7 +3459,7 @@ the \usepackage command.

- +
@@ -3483,7 +3486,7 @@ sec:section3,sec:section5}.
- +
@@ -3581,7 +3584,7 @@ styles.Unknown

-Citing in Alpha style +Citing in Alpha style
@@ -3593,7 +3596,7 @@ styles.Unknown

-Citing in Natdin style +Citing in Natdin style
@@ -3605,7 +3608,7 @@ styles.Unknown

-Finding ready-made BibTeX entries – University of Bamberg Library +Finding ready-made BibTeX entries – University of Bamberg Library
@@ -3618,7 +3621,7 @@ University of Bamberg Library
-Finding ready-made BibTeX entries – Google Scholar +Finding ready-made BibTeX entries – Google Scholar
@@ -3631,7 +3634,7 @@ Google Scholar
-Finding ready-made BibTeX entries – Google Scholar +Finding ready-made BibTeX entries – Google Scholar
@@ -3644,7 +3647,7 @@ Google Scholar
-Finding ready-made BibTeX entries – dblp.org +Finding ready-made BibTeX entries – dblp.org
@@ -3712,7 +3715,7 @@ Squares of all even % …
- +
@@ -3734,7 +3737,7 @@ Squares of all even % …
- +
@@ -3861,7 +3864,7 @@ popular.
- +
@@ -3894,7 +3897,7 @@ themes.

- +
@@ -3937,7 +3940,7 @@ child { node {home}
- +
@@ -3955,7 +3958,7 @@ trees:

- +
@@ -4015,7 +4018,7 @@ package.

- +
@@ -4107,7 +4110,7 @@ Table tuning

The LaTeX Wikibook offers numerous interesting articles and is available in English and German (among others).

-

+

@@ -4121,7 +4124,7 @@ available in English and German (among others).

The “Comprehensive TeX Archive Network” is the central source for LaTeX packages and their documentation.

-

+

@@ -4137,7 +4140,7 @@ LaTeX packages and their documentation.

It also offers a multiple tutorials and templates for different occasions (CV, theses, …): »Templates«.

-

+

@@ -4150,7 +4153,7 @@ occasions (CV, theses, …): StackExchange

Question-and-answer website for LaTeX.

-

+

@@ -4163,7 +4166,7 @@ occasions (CV, theses, …): TeXample

A collection of LaTeX examples, especially with TikZ.

-

+

@@ -4173,7 +4176,7 @@ occasions (CV, theses, …):
-Classic (source) +Classic (source)
@@ -4185,7 +4188,7 @@ occasions (CV, theses, …):
-More classic (source) +More classic (source)
@@ -4197,7 +4200,7 @@ occasions (CV, theses, …):
-Different (source) +Different (source)
@@ -4218,7 +4221,7 @@ an e-mail! ☎️0951 863 1219
📧fachschaft-wiai.stuve@uni-bamberg.de

-

+

@@ -4242,7 +4245,7 @@ an e-mail!
-

+

diff --git a/latex-weekend-wise-2023/slides/basic-document-structure.de.md b/latex-weekend-wise-2023/slides/basic-document-structure.de.md new file mode 100644 index 0000000..736f352 --- /dev/null +++ b/latex-weekend-wise-2023/slides/basic-document-structure.de.md @@ -0,0 +1,412 @@ +@slide(layout=chapter-slide) + +@number +3 + +@title +Grundstruktur eines LATEX-Dokuments + + +@slide(layout=content-and-preview) + +@title +Präambel & Dokumentumgebung + +@content +

👁 Ein mit LaTeX gesetztes Dokument besteht aus:

+ +* **Präambel:** globale Einstellungen (Dokumentklasse, Kodierung, Sprache, Seitenformat, zusäzliche Pakete, …) und +* **Dokumentumgebung:** Inhalt des Dokuments. + +``` {.lang-tex .hljs .fragment} +\documentclass[ngerman]{article} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage[ngerman]{babel} + +\begin{document} +Hallo, Welt! +\end{document} +``` + +@preview +![](svg/chapter-03/hallo-crop.svg) + + +@slide(layout=wide-content) + +@title +Dokumentenklasse + +@content +``` {.lang-tex .hljs} +\documentclass[]{} +``` + +Konkret zum Beispiel + +``` {.lang-tex .hljs} +\documentclass[10pt,a5paper,landscape]{article} +``` + + +@slide(layout=content-only) + +@title +Kodierung + +@content +``` {.lang-tex .hljs} +\usepackage[utf8]{inputenc} +\usepackage[t1]{fontenc} +``` + +* Die Zeichenkodierung bestimmt, welche Zeichen verfügbar sind. +* **ASCII** enthält kaum Sonderzeichen wie deutsche Umlaute. +* **UTF-8** ist eine universelle Kodierung. + + +@slide(layout=content-only) + +@title +Sprache + +@content +``` {.lang-tex .hljs} +\usepackage[ngerman]{babel} +``` + +* Das Paket **`babel`** stellt sprachspezifische Informationen (z. B. Silbentrennung, Sonderzeichen, Wechsel zwischen Fonts, Übersetzung von Labels wie ›Kapitel‹, ›Inhaltsverzeichnis‹ oder ›Abbildung‹) bereit. +* **`ngerman`** steht für die neue deutsche Rechschreibung. + + +@slide(layout=content-and-preview) + +@title +Fließtext + +@content +``` {.lang-tex .hljs} +Fließtext kann direkt in den Quelltext ↲ +geschrieben werden. ↲ +Einfache Zeilenumbrüche ↲ +werden dabei ignoriert, ↲ +genau wie mehrere Leerzeichen. ↲ +↲ +Leerzeilen erzeugen einen neuen Absatz,↲ +standardmäßig mit Einzug. ↲ +Manuelle Zeilenumbrüche können mit ↲ +zwei Backslashes erzwungen werden, ↲ +haben in Fließtext aber eigentlich \\ ↲ +nichts verloren. +``` + +@preview +![](svg/chapter-03/absätze-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Kommentare + +@content +Nach einem Prozentzeichen wird der Rest der Zeile vom Compiler ignoriert. Der Kommentartext erscheint also nicht im fertigen Dokument. + +``` {.lang-tex .hljs} +% Beginn Steckbrief +Name: Donald Knuth \\ +Geburtsdatum: \\ % TODO: einfügen +Geburtsort: Milwaukee, Wisconsin +% Ende Steckbrief +``` + +Tastenkombinationen: Strg + T und Strg + U + +@preview +![](svg/chapter-02/kommentare-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Achtung! + +@title +Reservierte Zeichen + +@content +Bestimmte Zeichen lösen in LaTeX Dinge aus: + +`# $ % ^ & _ { } ~ \` + +``` {.lang-tex .hljs} +50% sind die Hälfte. +``` + +Lösung: »`\`« voranstellen: + +``` {.lang-tex .hljs} +50\% sind die Hälfte. +``` + +Funktioniert nicht mit »`\\`«, nutzt `\textbackslash` stattdessen. + +@preview +![](svg/chapter-03/reservierte-zeichen-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Abschnitte und Kapitel + +@content +Texte werden durch Überschriften in Abschnitte und Kapitel unterteilt. Immer verfügbar: + +``` {.lang-tex .hljs} +\section{Ebene 1} +\subsection{Ebene 2} +\subsubsection{Ebene 3} +\paragraph{Ebene 4} +\subparagraph{Ebene 5} +``` + +Je nach Dokumentenklasse zusätzlich: + +``` {.lang-tex .hljs} +\chapter{Kapitel} +\part{Teil} +``` + +@preview +![](svg/chapter-03/abschnitte-crop.svg) + + +@slide(layout=wide-content) + +@title +Titelei + +@content +``` {.lang-tex .hljs data-source=title.tex} +\title{Die Welt der Trüffel} +\author{Fooboar Rüssel \and Fachschaft WIAI} +\date{\today} +\begin{document} +\maketitle +\end{document} +``` + +* In der Präambel werden die Werte für die Einträge gespeichert. +* Das Setzen des Titels erfolgt in der Dokumentumgebung mit dem Befehl `\maketitle`. +* Die genaue Gestaltung hängt ab von der verwendeten Dokumentklasse. +* Mehrere Autoren werden mit `\and` verbunden. +* Wird kein Datum angegeben, wird per default das aktuelle Datum gesetzt. Ein abweichendes Datum kann mit `\date{}` definiert werden. + + +@slide(layout=content-and-preview) + +@title +Titelei + +@content +``` {.lang-tex .hljs data-source=title.tex} +\documentclass[ngerman]{scrartcl} +\usepackage{babel} +\title{Die Welt der Trüffel} +\author{Fooboar Rüssel \and +Fachschaft WIAI} +\date{\today} +\begin{document} +\maketitle +\section{Trüffelsuche} +\subsection{Suche mit Schwein} +\subsection{Suche ohne Schwein} +Wer macht denn sowas? +\section{Trüffelrezepte} +Mein Lieblingsrezept +\end{document} +``` + +@preview +![](svg/chapter-03/titel-orig.svg) + + +@slide(layout=content-only) + +@title +Verzeichnisse + +@content +``` {.lang-tex .hljs} +\tableofcontents % Inhaltsverzeichnis +\listoffigures % Abbildungsverzeichnis +\listoftables % Tabellenverzeichnis +``` + +* Nummerierung erfolgt automatisch +* Elemente, die nicht im Verzeichnis aufgeführt werden sollen, werden mit einem »`*`« versehen, also z. B. `\section*{}`. +* **am besten zweimal kompilieren** + + +@slide(layout=content-and-preview) + +@title +Inhaltsverzeichnis + +@content +``` {.lang-tex .hljs data-source=title.tex} +\documentclass[ngerman]{scrartcl} +\usepackage{babel} +\begin{document} +\tableofcontents +\section{Trüffelsuche} +Der erste Abschnitt. +\subsection{Suche mit Schwein} +Ein Unterabschnitt. +\subsection{Suche ohne Schwein} +Ein weiterer Unterabschitt. +\subsubsection[But why?] + {Wer macht denn sowas?} +Unter-Unterabschnitt. +\section{Trüffelrezepte} +Mein Lieblingsrezept +\end{document} +``` + +@preview +![](svg/chapter-03/inhalt-crop.svg) + + + +@slide(layout=wide-task) + +@task-number +3 + +@title +Dokument und Text gliedern + +@content +* Öffnet die Datei `document-structure.tex`, die im Ordner `exercises/basic-document-structure` liegt. +* Packt den gesamten Text in der Datei in eine **Document**-Umgebung und schreibt darüber folgende **Präambel**. Kompiliert die Datei. + +``` {.lang-tex .hljs .fragment} +\documentclass{scrartcl} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage[ngerman]{babel} +``` + +* Wie ihr sehen könnt, sind in der Datei die Absätze im Dokument mit `\\` erstellt worden. Ersetzt diese durch richtige Absätze. +* Zeit für etwas Struktur! Verwendet für die **Überschriften** die passenden LaTeX-Befehle (`\section` u. ä.). +* Fügt anschließend ein **Inhaltsverzeichnis** in euer Dokument ein. + + +@slide(layout=extra-wide-content) + +@title +Dokumentenklassen + +@content +* Natürlich gibt es auch andere Dokumentenklassen als `article`. +* Je nachdem, welche Dokumentenklasse man verwendet, ändert sich das Layout der generierten PDF. +* Die korrekt geschriebenen Dokumentenklassen richten sich nach US-amerikanischen Layout-Normen. +* **`src`**-Dokumentenklassen versuchen europäische Normen abzubilden. + +Folgende Dokumentenklassen stehen zur Verfügung: + +* **`scrartcl`, `article`** für kurze Dokumente +* **`scrreprt`, `report`** für lange Dokumente +* **`scrbook`, `book`** für Bücher +* **`beamer`** für Präsentationen + + +@slide(layout=extra-wide-content) + +@title +Sprachen + +@content +Es können auch mehrere Sprachen im Dokument verwendet werden: + +``` {.lang-tex .hljs} +\usepackage[ngerman, swedish, ukrainian, greek, english]{babel} +``` + +Umschalten zwischen Sprachen: + +``` {.lang-tex .hljs} +\selectlanguage{} +\selectlanguage{} +``` + +Eingebetteter Text in anderer Sprache: + +``` {.lang-tex .hljs} +\selectlanguage{} +\foreignlanguage{}{Hier steht Text in Sprache B in einem Text in Sprache A} +``` + + +@slide(layout=extra-content-and-preview) + +@title +Sprachen – ein Beispiel + +@content +``` {.lang-tex .hljs} +\today +\selectlanguage{ngerman} +\today +\selectlanguage{swedish} +\today +\selectlanguage{ukrainian} +\today +\selectlanguage{greek} +\today +\selectlanguage{english} +\today +``` + +@preview +![](svg/chapter-03/languages-crop.svg) + + +@slide(layout=extra-content-and-preview) + +@title +Überschriften und das Inhaltsverzeichnis + +@content +Mit Sternchen fallen bei allen diesen Befehlen die Nummerierung und der Eintrag im Inhaltsverzeichnis weg: + +``` {.lang-tex .hljs} +\section*{Kein Verzeichniseintrag} +``` + +Außerdem kann für das Inhaltsverzeichnis ein alternativer Titel angegeben werden: + +``` {.lang-tex .hljs} +\section[Titel im Verzeichnis] +{Kapitelüberschrift} +``` + +@preview +![](svg/chapter-03/abschnitte-anders-crop.svg) + + +@slide(layout=content-only) + +@title +Bevor wir fortfahren können … + +@content +
+**Kommentiert** zuletzt die Präambel, die Dokumentenumgebung und das Inhaltsverzeichnis **wieder aus**. + +Nur so kann eure Lösung auch ins Skript eingebunden werden (Schnelles Auskommentieren kann in TeXstudio mit dem Shortcut Strg + T erreicht werden). +
+ +Im nächsten Kapitel erklären wir, warum das notwendig ist. \ No newline at end of file diff --git a/latex-weekend-wise-2023/slides/basic-document-structure.en.md b/latex-weekend-wise-2023/slides/basic-document-structure.en.md new file mode 100644 index 0000000..c7ac5d3 --- /dev/null +++ b/latex-weekend-wise-2023/slides/basic-document-structure.en.md @@ -0,0 +1,411 @@ +@slide(layout=chapter-slide) + +@number +3 + +@title +Basic structure of a LATEX document + + +@slide(layout=content-and-preview) + +@title +Preamble & document environment + +@content +

👁 Every LaTeX document is composed of

+ +* a **preamble:** global settings (document class, encoding, language, page format, additional packages, …) and +* a **document environment:** content of the document. + +``` {.lang-tex .hljs .fragment} +\documentclass{article} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{babel} + +\begin{document} +Hello world! +\end{document} +``` + +@preview +![](svg/chapter-03/hello-crop.svg) + + +@slide(layout=wide-content) + +@title +Document class + +@content +``` {.lang-tex .hljs} +\documentclass[]{} +``` + +For example: + +``` {.lang-tex .hljs} +\documentclass[10pt,a5paper,landscape]{article} +``` + + +@slide(layout=content-only) + +@title +Encoding + +@content +``` {.lang-tex .hljs} +\usepackage[utf8]{inputenc} +\usepackage[t1]{fontenc} +``` + +* The character encoding determines which characters are available. +* **ASCII** contains no special characters like German umlauts. +* **UTF-8** is a universal encoding. + + +@slide(layout=content-only) + +@title +Language + +@content +``` {.lang-tex .hljs} +\usepackage[ngerman]{babel} +``` + +* The package **`babel`** provides language-specific information (e. g., hyphenation, special characters, font changes, translated labels like ‘chapter,’ ‘table of contents’ or ‘figure’). +* **`ngerman`** is the German new spelling. + + +@slide(layout=content-and-preview) + +@title +Continuous Text + +@content +``` {.lang-tex .hljs} +Continous text can be written directly ↲ +in the source code. ↲ +Simple line breaks ↲ +are ignored, ↲ +just as multiple space characters. ↲ +↲ +An empty line creates a new paragraph ↲ +which has an indentation by default. ↲ +Manual line breaks can be forced ↲ +using two backslashes, but this use ↲ +is strongly discouraged \\ ↲ +within continuous text. +``` + +@preview +![](svg/chapter-03/paragraphs-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Comments + +@content +After a percent sign, the rest of the line is ignored by the compiler. It is called a comment and does not appear in the resulting document. + +``` {.lang-tex .hljs} +% profile start +Name: Donald Knuth \\ +Date of birth: \\ % TODO: insert +Place of birth: Milwaukee, Wisconsin +% profile end +``` + +Shortcuts: Ctrl + T and Ctrl + U + +@preview +![](svg/chapter-02/comments-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Caution! + +@title +Reserved characters + +@content +Some characters do things in LaTeX: + +`# $ % ^ & _ { } ~ \` + +``` {.lang-tex .hljs} +50% is one half. +``` + +Solution: prefix with ‘`\`’: + +``` {.lang-tex .hljs} +50\% is one half. +``` + +Does not work for ‘`\\`’, use `\textbackslash` instead. + +@preview +![](svg/chapter-03/reserved-characters-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Sections and chapters + +@content +Texts are structured by beeing subdivided in sections and chapters. Always available: + +``` {.lang-tex .hljs} +\section{Level 1} +\subsection{Level 2} +\subsubsection{Level 3} +\paragraph{Level 4} +\subparagraph{Level 5} +``` + +Additionally, for some document classes: + +``` {.lang-tex .hljs} +\chapter{Chapter} +\part{Part} +``` + +@preview +![](svg/chapter-03/sections-crop.svg) + + +@slide(layout=wide-content) + +@title +Front matter + +@content +``` {.lang-tex .hljs data-source=title.tex} +\title{The World of Truffles} +\author{Fooboar Rüssel \and Fachschaft WIAI} +\date{\today} +\begin{document} +\maketitle +\end{document} +``` + +* The values for the entries are stored in the preamble. +* `\maketitle` typesets the front matter within the document environment. +* The exact appearance depends on the document class. +* Multiple authors can be joined with `\and`. +* If no date is given, the current date will be used. A different date can be defined with `\date{}`. + + +@slide(layout=content-and-preview) + +@title +Front matter + +@content +``` {.lang-tex .hljs data-source=title.tex} +\documentclass{article} +\usepackage{babel} +\title{The World of Truffles} +\author{Fooboar Rüssel +\and Fachschaft WIAI} +\date{\today} +\begin{document} +\maketitle +\section{Truffle hunt} +\subsection{Hunt with a pig} +\subsection{Hunt without a pig} +Why would you do that? +\section{Truffle recipes} +My favorite recipe +\end{document} +``` + +@preview +![](svg/chapter-03/title-orig.svg) + + +@slide(layout=content-only) + +@title +Registers + +@content +``` {.lang-tex .hljs} +\tableofcontents +\listoffigures +\listoftables +``` + +* automatic numbering +* elements with an asterisk (`*`) are hidden from the register: e. g. `\section*{}`. +* **generally requires two rounds of compilation** + + +@slide(layout=content-and-preview) + +@title +Table of contents + +@content +``` {.lang-tex .hljs data-source=title.tex} +\documentclass{article} +\usepackage{babel} +\begin{document} +\tableofcontents +\section{Truffle hunt} +The first section. +\subsection{Hunt with a pig} +A subsection. +\subsection{Hunt without a pig} +Another subsection. +\subsubsection[But why?] + {Why would you do that?} +Sub-subsection. +\section{Truffle recipes} +My favorite recipe +\end{document} +``` + +@preview +![](svg/chapter-03/contents-crop.svg) + + +@slide(layout=wide-task) + +@task-number +3 + +@title +Structure your document and text + +@content +* Open the file `document-structure.tex`. It is located in the directory `exercises/basic-document-structure`. +* Wrap the entire text in a **document** environment and insert the following **preamble**. Compile the document. + +``` {.lang-tex .hljs .fragment} +\documentclass{scrartcl} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage[english]{babel} +``` + +* As you may already have noticed, **paragraphs** are marked as ‘`\\`’. Use real paragraphs instead. +* Time to structure our document! Use LaTex commands to declare all **headings** (`\section`, `\subsubsection`, etc.). +* Add a **table of contents** to your document. + + +@slide(layout=extra-wide-content) + +@title +Document classes + +@content +* There are also other document classes than `article`. +* Based on the document class, the layout of the generated pdf file changes. +* Normally speled classes adhere to American English layout norms. +* **`src`** document classes usually adhere to European layout norms. + +Following document classes are available: + +* **`scrartcl`, `article`** for short documents +* **`scrreprt`, `report`** for longer documents +* **`scrbook`, `book`** for books +* **`beamer`** for presentations + + +@slide(layout=extra-wide-content) + +@title +Languages + +@content +A document can use multiple languages at once: + +``` {.lang-tex .hljs} +\usepackage[ngerman, swedish, ukrainian, greek, english]{babel} +``` + +To switch languages: + +``` {.lang-tex .hljs} +\selectlanguage{} +\selectlanguage{} +``` + +Embedded Text in another language: + +``` {.lang-tex .hljs} +\selectlanguage{} +\foreignlanguage{}{Text of language B in a Text of language A} +``` + + +@slide(layout=extra-content-and-preview) + +@title +Languages — an example + +@content +``` {.lang-tex .hljs} +\today +\selectlanguage{ngerman} +\today +\selectlanguage{swedish} +\today +\selectlanguage{ukrainian} +\today +\selectlanguage{greek} +\today +\selectlanguage{english} +\today +``` + +@preview +![](svg/chapter-03/languages-crop.svg) + + +@slide(layout=extra-content-and-preview) + +@title +Headlines and the table of contents + +@content +With an asterisk, there is no numbering and no entry in the table of contents: + +``` {.lang-tex .hljs} +\section*{No entry in table of contents} +``` + +You can also provide an alternative title for the table of contents: + +``` {.lang-tex .hljs} +\section[Entry in table of contents] +{Actual chapter heading} +``` + +@preview +![](svg/chapter-03/sections-differently-crop.svg) + + +@slide(layout=content-only) + +@title +Before we can continue … + +@content +
+Finally, **comment out** the preamble, the document environment, and the table of contents. + +Only this way, your solution can be embedded in the script itself. (In TeXstudio, comments can be achieved by the shortcut Strg + T.) +
+ +We will learn in the following chapter why this is the case. \ No newline at end of file diff --git a/latex-weekend-wise-2023/slides/basic-functionality.de.md b/latex-weekend-wise-2023/slides/basic-functionality.de.md new file mode 100644 index 0000000..c6f7320 --- /dev/null +++ b/latex-weekend-wise-2023/slides/basic-functionality.de.md @@ -0,0 +1,91 @@ +@slide(layout=chapter-slide) + +@number +2 + +@title +Wie funktioniert LATEX? + + +@slide(layout=content-and-preview) + +@title +WYSIWaaas? + +@content +### What You See Is What You Get {data-category=Word} + +* Formatierung mit unmittelbarem optischen Feedback + +
+### What You See Is What You Mean {data-category=LaTeX} + +* Trennung von Inhalt und Struktur +* Formatierung erst am Ende ersichtlich +
+ +

+ Bildquelle: xkcd +

+ +@preview +![](svg/chapter-02/xkcd-types-of-editors.png) + + +@slide(layout=preview-only) + +@preview +![Der Weg zum fertigen Dokument](svg/chapter-02/wysiwyg.svg){} + + +@slide(layout=two-columns) + +@title +Was brauchen wir dazu? + +@column-one +### Editor +zum Schreiben unseres Quelltextes mit allen Befehlen zur semantischen Gliederung + +[TeXstudio](http://www.texstudio.org/), [TeXMaker](https://www.xm1math.net/texmaker/) + +@column-two +### Compiler +erstellt aus dem Quelltext ein fertig formatiertes PDF-Dokument + +[MiKTeX](http://miktex.org/), [MacTeX](http://tug.org/mactex/), [TeX Live](https://tug.org/texlive/) + + +@slide(layout=wide-content) + +@title +Befehle + +@content +Allgemeiner Aufbau eine Befehls: + +``` {.hljs .lang-txt} +\[]{} +``` + +++ Ein paar Beispiele: + +``` {.lang-tex .tex .hljs .fragment} +\newpage % fügt eine neue Seite ein +\textbf{fetter Text} % schreibt den übergebenen Text fett +\documentclass[10pt,a5paper,landscape]{article} % konfiguriert die Dokumentenklasse +\frac{1}{4} % fügt den mathematischen Bruch ein +``` + + +@slide(layout=content-only) + +@title +Backslash + +@content +Den Backslash erzeugt ihr mit folgender Tastenkombination: + +AltGr + ß (Windows/Linux) + +Alt + Shift + 7 (MacOS) diff --git a/latex-weekend-wise-2023/slides/basic-functionality.en.md b/latex-weekend-wise-2023/slides/basic-functionality.en.md new file mode 100644 index 0000000..0cf5521 --- /dev/null +++ b/latex-weekend-wise-2023/slides/basic-functionality.en.md @@ -0,0 +1,93 @@ +@slide(layout=chapter-slide) + +@number +2 + +@title +How does
LATEX work? + + +@slide(layout=content-and-preview) + +@title +WYSIWhat? + +@content +### What You See Is What You Get {data-category=Word} + +* Formatting with immediate visual feedback + +
+### What You See Is What You Mean {data-category=LaTeX} + +* Separation of content and structure +* Formatting only visible afterwards +
+ +

+ Image source: xkcd +

+ +@preview +![](svg/chapter-02/xkcd-types-of-editors.png) + + +@slide(layout=preview-only) + +@preview +![How to get the final document](svg/chapter-02/wysiwyg.svg){} + + +@slide(layout=two-columns) + +@title +What do we need? + +@column-one +### Editor +writing our source code including all the commands that structure the text semantically + +[TeXstudio](http://www.texstudio.org/), [TeXMaker](https://www.xm1math.net/texmaker/) + +@column-two +### Compiler +takes the source code and creates a PDF document ready for publication + +[MiKTeX](http://miktex.org/), [MacTeX](http://tug.org/mactex/), [TeX Live](https://tug.org/texlive/) + + +@slide(layout=wide-content) + +@title +Commands + +@content +General structure of a command: + +``` {.hljs .lang-txt} +\[]{} +``` + +++ A few examples: + +``` {.lang-tex .tex .hljs .fragment} +\newpage % inserts a new page +\textbf{bold text} % formats the text bold +\documentclass[a4paper,12pt, landscape]{article} % configures the document class +\frac{1}{4} % inserts a mathematical fraction +``` + + +@slide(layout=content-only) + +@title +Backslash + +@content +You get the backslash by pressing + +AltGr + ß (Windows/Linux) + +Alt + Shift + 7 (MacOS) + + diff --git a/latex-weekend-wise-2023/slides/graphics.de.md b/latex-weekend-wise-2023/slides/graphics.de.md new file mode 100644 index 0000000..c261788 --- /dev/null +++ b/latex-weekend-wise-2023/slides/graphics.de.md @@ -0,0 +1,113 @@ +@slide(layout=chapter-slide) + +@number +9 + +@title +Grafiken + + +@slide(layout=content-only) + +@title +Grafiken abbilden 🖼️ + +@content +Um Grafiken darzustellen, muss das Paket `graphicx` eingebunden werden. + +``` {.lang-tex .hljs} +\begin{figure} + \includegraphics{} + \caption[]{} +\end{figure} +``` + +Bildgröße angeben: + +``` {.lang-tex .hljs} +\includegraphics[width=0.5\textwidth, +height=5cm]{} +``` + + +@slide(layout=content-only) + +@title +Positionierung auf der Seite + +@content + +``` {.lang-tex .hljs} +\begin{figure}[] +``` + +LaTeX positioniert Grafiken automatisch. Durch Kürzel können wir unsere Präferenzen (auch in Kombination) angeben. + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KürzelPosition
hhier, wenn es dir recht ist
toberer Seitenrand (top)
bunterer Seitenrand (bottom)
pauf einer eigenen Seite (page)
HHier, verdammt noch mal!
(benötigt Paket `float`)
+ + +@slide(layout=content-only) + +@title +Zentrierte Anordnung + +@content +``` {.lang-tex .hljs} +\begin{figure}[] + \begin{center} + \includegraphics{} + \end{center} +\end{figure} +``` + +Alternativ: + +``` {.lang-tex .hljs} +\begin{figure}[] + \centering + \includegraphics{} +\end{figure} +``` + + +@slide(layout=task) + +@task-number +9 + +@title +Grafiken einfügen + +@content +* Im Ordner `exercises/graphics` findet ihr eine Bilddatei namens `latex-logo.png`. +* Fügt sie **genau** unterhalb dieser Aufgabenstellung im Skript ein. +* Das Bild soll **zentriert** auf der Seite eingebunden werden. +* Fügt außerdem eine **Bildunterschrift** ein. +* Passt die **Größe** des Bildes an Breite der Seite (`\textwidth`) an. diff --git a/latex-weekend-wise-2023/slides/graphics.en.md b/latex-weekend-wise-2023/slides/graphics.en.md new file mode 100644 index 0000000..155d4f2 --- /dev/null +++ b/latex-weekend-wise-2023/slides/graphics.en.md @@ -0,0 +1,113 @@ +@slide(layout=chapter-slide) + +@number +9 + +@title +Graphics + + +@slide(layout=content-only) + +@title +Including graphics 🖼️ + +@content +To display graphics, we need the `graphicx` package. + +``` {.lang-tex .hljs} +\begin{figure} + \includegraphics{} + \caption[]{} +\end{figure} +``` + +Specifying the size: + +``` {.lang-tex .hljs} +\includegraphics[width=0.5\textwidth, +height=5cm]{} +``` + + +@slide(layout=content-only) + +@title +Layout on the page + +@content + +``` {.lang-tex .hljs} +\begin{figure}[] +``` + +LaTeX places graphics automatically. With position codes, we can express our preferences (they can be combined as well). + + + + + + + + + + + + + + + + + + + + + + + + + + + +
codeposition
hhere, if you don’t mind
ttop of the page
bbottom of the page
pon its own page
HHere, for God’s sake!
(`float` package required)
+ + +@slide(layout=content-only) + +@title +Centred alignment + +@content +``` {.lang-tex .hljs} +\begin{figure}[] + \begin{center} + \includegraphics{} + \end{center} +\end{figure} +``` + +Alternatively: + +``` {.lang-tex .hljs} +\begin{figure}[] + \centering + \includegraphics{} +\end{figure} +``` + + +@slide(layout=task) + +@task-number +9 + +@title +Inserting graphics + +@content +* In the directory `exercises/graphics` you can find an image file named `latex-logo.png`. +* **Include** the figure in `exercises/graphics/graphics.tex` and place it **exactly** where you include it. +* The image shall be **centered**. +* Additionally, add a **caption** for the figure. +* Adapt the **width** of the image to the width of the text (`\textwidth`). diff --git a/latex-weekend-wise-2023/slides/intro.de.md b/latex-weekend-wise-2023/slides/intro.de.md new file mode 100644 index 0000000..72f677b --- /dev/null +++ b/latex-weekend-wise-2023/slides/intro.de.md @@ -0,0 +1,67 @@ +@slide(layout=chapter-slide) + +@number +0 + +@title +Erste Schritte mit LATEX + +@content +Um das Skript für das Tutorium kompilieren zu können, müssen zunächst ein paar Konfigurationgen gemacht werden, die in den nächsten Folien erklärt werden. + +@slide(layout=content-only) + +@title +Exkurs: Eine Kommandozeile öffnen + +@content +* Für die kommenden Aufgaben brauchen wir eine Kommandozeile +* Je nach Betriebssystem, das verwendet wird, gibt es unteschiedliche Wege, sie zu öffnen +* **Windows**: Drückt die Windows-Taste, tippt *cmd* und drückt Enter +* **MacOS**: Drückt die *Command*-Taste und die Leertaste gleichzeitig, tippt danach *Terminal* und macht einen Doppelklick auf *Terminal* +* **Linux**: Drückt ``Strg + Alt + T`` + +@slide(layout=content-only) + +@title +Den Compiler installieren + +@content +* Der Compiler übersetzt unseren LaTeX-Code in ein PDF +* Je nach Betriebssystem stehen unterschiedliche Compiler zur Verfügung: +* Windows: MikTEX +* Linux-Distributionen: TEXLive + * Debian-basierte Distros: Führt `sudo apt install texlive-full` aus + * Andere Distributionen: Folgt den anweisungen auf der TEXLive-Website + +
+Bitte achtet darauf, die full version mit allen Paketen zu installieren, wenn ihr die Auswahl habt! +
+ +@slide(layout=content-only) + +@title +Installieren des Editors + +@content +* Ein Editor kann heruntergeladen werden, sobald die Installation des Compilers fertig ist +* Es funktioniert jeglicher Text-Editor, wie etwa Notepad++ oder VSCode +* Für Anfänger:innen empfehlen wir jedoch TEXstudio, da es LaTeX-spezifische Features bietet +* Ladet TEXstudio herunter und installiert es + + + +@slide(layout=content-only) +@title +Kompilieren des Skriptes + +@content +* Ladet das Projektarchiv aus dem VC herunter +* Entpackt das Archiv +* Öffnet die Datei main-exercises.tex in TeXstudio. Ihr findet es im Wurzelverzeichnis des Archivs +* Kompiliert die Datei, indem ihr klickt +* Einige neue Dateien sollten nun durch das Kompilieren generiert werden + +
+Windows-Nutzer:innen: Um Dateiendungen zu aktivieren, klickt auf das Ansichts-Tab im Dateiexplorer und wählt *Dateiendungen*. So könnt ihr besser zwischen den einzelnen main-Files unterscheiden. +
diff --git a/latex-weekend-wise-2023/slides/intro.en.md b/latex-weekend-wise-2023/slides/intro.en.md new file mode 100644 index 0000000..fa418c5 --- /dev/null +++ b/latex-weekend-wise-2023/slides/intro.en.md @@ -0,0 +1,67 @@ +@slide(layout=chapter-slide) + +@number +0 + +@title +First steps with LATEX + +@content +In order to compile the script for this tutorial, a few steps have to be followed, which are explained in the next slides. + +@slide(layout=content-only) + +@title +Digression: Opening a command prompt + +@content +* For the following tasks, we are going to need a command prompt +* It can be opened in different ways, depending on your operating system + + * **Windows**: Press the Windows key and type in *cmd*, press Enter + * **MacOS**: Press the *Command* key and the *space bar* simultaneously, then type in *Terminal* and double click on *Terminal* + * **Linux**: Press ``Ctrl + Alt + T`` + +@slide(layout=content-only) + +@title +Installing the compiler + +@content +* The compiler translates our LATEX code into a PDF +* Depending on your operating system, different compilers are available +* Windows: MikTEX +* macOS: MacTEX +* Linux distributions: TEXLive + * Debian-based distributions: run `sudo apt install texlive-full` + * other distributions: see the TEXLive website + +
+Make sure to install the full version with all packages, if you can! +
+ +@slide(layout=content-only) + +@title +Installing the editor + +@content +* An editor can downloaded once the compiler has been installed +* For editing LaTeX documents, any text editor works fine, e.g., Notepad++, VSCode +* For beginners, TEXstudio is recommended due to its LaTeX-specific features +* Download and install TEXstudio + +@slide(layout=content-only) +@title +Compile the script for the first time + +@content +* Download the project archive from the VC. +* Unzip the archive. +* Open the file `main-exercises.tex` in TEXstudio. It is located in the root directory of the archive. +* Compile `main-exercises.tex` by pressing +* A few new files will be generated by the compilation. + +
+Windows users: In order to enable file endings, click the view tab in the file explorer, and select *file name extensions*. This helps differentiating the different ``main`` files. +
diff --git a/latex-weekend-wise-2023/slides/lists.de.md b/latex-weekend-wise-2023/slides/lists.de.md new file mode 100644 index 0000000..e94c732 --- /dev/null +++ b/latex-weekend-wise-2023/slides/lists.de.md @@ -0,0 +1,164 @@ +@slide(layout=chapter-slide) + +@number +7 + +@title +Aufzählungen + +@slide(layout=content-and-preview) + +@title +Ungeordnete Listen 📜 + +@content +``` {.lang-tex .hljs} +\begin{itemize} + \item Nudelplatten + \item Passierte Tomaten, % … + \item Oregano, Basilikum, % … + \item Mozzarella + \item Mehl + \item Milch +\end{itemize} +``` + +Die einzelnen Stichpunkte werden in jeder Aufzählungsumgebung durch den Befehl `\item` gekennzeichnet. + +@preview +![](svg/chapter-08/itemize-crop.svg) + +@slide(layout=content-and-preview) + +@title +Geordnete Listen und Definitionslisten + +@content +``` {.lang-tex .hljs} +\begin{enumerate} + \item die Zwiebeln in einem Topf % … + \item passierte Tomaten, Möhren % … + \item mit Kräutern und Gewürzen % … + % \item … +\end{enumerate} +``` + +``` {.lang-tex .hljs .fragment} +\begin{description} + \item [Béchamelsauce] Béchamel % … + \item [Lasagne] Als Lasagne % … +\end{description} +``` + +@preview + + + +@slide(layout=content-and-preview) + +@title +Verschachtelte Listen + +@content +``` {.lang-tex .hljs} +\begin{itemize} + % … + \item Gemüse \begin{itemize} + \item Passierte Tomaten + \item Möhren + \end{itemize} + \item Kräuter \begin{enumerate} + \item Oregano + \item Basilikum + \end{enumerate} + % … +\end{itemize} +``` + +@preview +![](svg/chapter-08/nested-lists-crop.svg) + +@slide(layout=task) + +@task-number +7 + +@title +Aufzählungen einfügen + +@content +* Formatiert das Rezept in `lists.tex` im Ordner `exercises/lists` als **ungeordnete Liste** mit den Elementen *Ingredients* und *Instructions*. Nutzt dafür den Befehl `\itemize`. +* Benutzt innerhalb dieser Liste für die Zutaten eine **ungeordnete Liste** und für die Arbeitsschritte eine **geordnete Liste**. + + +@slide(layout=extra-content-and-preview) + +@title +Kompakte Listen + +@content +Das Paket `paralist` stellt Aufzählungen ohne riesige Zwischenräume zur Verfügung. + +``` {.lang-tex .hljs} +\section{Zutaten} +\begin{compactitem} + % \item … +\end{compactitem} +\section{Zubereitung} +\begin{compactenum} + % \item … +\end{compactenum} +\section{Glossar} +\begin{compactdesc} + % \item … +\end{compactdesc} +``` + +@preview +![](svg/chapter-08/compact-crop.svg) + +@slide(layout=extra-content-and-preview) + +@title +Aufzählungen im Absatz + +@content +Neben den kompakten Listen stellt `paralist` auch Listen zur Verfügung, die in einem Absatz stehen. + +``` {.lang-tex .hljs} +Folgende Kräuter sind für % … +\begin{inparaitem} + \item Liebstöckel + \item Petersilie + \item Schnittlauch +\end{inparaitem} +``` + +Natürlich gibt es auch hier ein Pendant namens `inparaenum` für geordnete Listen. + +@preview + + + +@slide(layout=extra-content-and-preview) + +@title +Aufzählungsarten + +@content +Die Art der Aufzählung lässt sich über den optionalen Parameter `label` ändern. Hierfür ist das Paket `enumitem` notwendig. + +``` {.lang-tex .hljs} +% Römische Zahlen +\begin{enumerate}[label=\roman*] +% … +% Arabische Zahlen +\begin{enumerate}[label=\arabic*] +% … +% Alphabetisch +\begin{enumerate}[label=\alph*] +% … +``` + +@preview +![](svg/chapter-08/list-style-types-crop.svg) \ No newline at end of file diff --git a/latex-weekend-wise-2023/slides/lists.en.md b/latex-weekend-wise-2023/slides/lists.en.md new file mode 100644 index 0000000..90d4f87 --- /dev/null +++ b/latex-weekend-wise-2023/slides/lists.en.md @@ -0,0 +1,167 @@ +@slide(layout=chapter-slide) + +@number +7 + +@title +Enumerations + +@slide(layout=content-and-preview) + +@title +Unordered lists 📜 + +@content +``` {.lang-tex .hljs} +\begin{itemize} + \item lasagna noodles + \item crushed tomatoes, % … + \item oregano, basil, % … + \item mozzarella cheese + \item flour + \item milk +\end{itemize} +``` + +We mark each bullet point with `\item`. +This pattern is the same for all kinds of enumerations. + +@preview +![](svg/chapter-08/itemize-english-crop.svg) + +@slide(layout=content-and-preview) + +@title +Ordered and definition lists + +@content +``` {.lang-tex .hljs} +\begin{enumerate} + \item cook onions over medium % … + \item add crushed tomatoes, carrots % … + \item add herbs and spices % … + % \item … +\end{enumerate} +``` + +``` {.lang-tex .hljs .fragment} +\begin{description} + \item [Béchamel sauce] Béchamel % … + \item [Lasagne] Lasagne (singular % … +\end{description} +``` + +@preview + + + +@slide(layout=content-and-preview) + +@title +Nested lists + +@content +``` {.lang-tex .hljs} +\begin{itemize} + % … + \item vegetables \begin{itemize} + \item crushed tomatoes + \item carrots + \end{itemize} + \item herbs \begin{enumerate} + \item oregano + \item basil + \end{enumerate} + % … +\end{itemize} +``` + +@preview +![](svg/chapter-08/nested-lists-english-crop.svg) + + +@slide(layout=task) + +@task-number +7 + +@title +Adding enumerations + +@content +* Turn the recipe in `lists.tex` into an **unordered list** consisting of the elements *Ingredients* and *Instructions*. You can find the file in the directory `exercises/lists`. Use the `itemize` command. +* Within this list, create a **unordered list** for the ingredients and a **ordered list** for the instructions. + + +@slide(layout=extra-content-and-preview) + +@title +Compact lists + +@content +The package `paralist` offers enumerations with less line spacing. + +``` {.lang-tex .hljs} +\section{Ingredients} +\begin{compactitem} + % \item … +\end{compactitem} +\section{Preparation} +\begin{compactenum} + % \item … +\end{compactenum} +\section{Glossary} +\begin{compactdesc} + % \item … +\end{compactdesc} +``` + +@preview +![](svg/chapter-08/compact-english-crop.svg) + +@slide(layout=extra-content-and-preview) + +@title +In-line enumerations + +@content +Another feature provided by `paralist` enables us to integrate enumerations into paragraphs. + +``` {.lang-tex .hljs} +The following herbs are % … +\begin{inparaitem} + \item lovage + \item parsley + \item chives +\end{inparaitem} +``` + +Of course, there is an accompanying list type called `inparaenum` for ordered lists. + +@preview + + + +@slide(layout=extra-content-and-preview) + +@title +List styles + +@content +The list style type can be set using the optional parameter `label`. +To accomplish this, we need to include the package `enumitem` first. + +``` {.lang-tex .hljs} +% Roman numerals +\begin{enumerate}[label=\roman*] +% … +% Arabic numerals +\begin{enumerate}[label=\arabic*] +% … +% Alphabetical +\begin{enumerate}[label=\alph*] +% … +``` + +@preview +![](svg/chapter-08/list-style-types-english-crop.svg) \ No newline at end of file diff --git a/latex-weekend-wise-2023/slides/literature.de.md b/latex-weekend-wise-2023/slides/literature.de.md new file mode 100644 index 0000000..5c3689d --- /dev/null +++ b/latex-weekend-wise-2023/slides/literature.de.md @@ -0,0 +1,114 @@ +@slide(layout=chapter-slide) + +@number +12 + +@title +Literatur­verwaltung + + +@slide(layout=content-only) + +@title +Was brauchen wir dafür? + +@content +* eine **Bibliographiedatei** (nachfolgend `.bib`-Datei) zur Speicherung von Literaturverweisen +* **BibTeX** als Schnittstelle zwischen der Literatur und LaTeX + + +@slide(layout=wide-content) + +@title +Was ist diese ominöse `.bib`-Datei? + +@content +* Sammlung von Literatureinträgen im BibTeX-Format +* Beispielhafter Literatureintrag: + +``` {.hljs .lang-tex} +@article{turing1990, % Art des Dokuments und Bezeichner für den \cite Befehl + title={The chemical basis of morphogenesis}, % Titel + 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 +} +``` + + +@slide(layout=content-only) + +@title +Wie wird das verwendet? + +@content +Durch BibTeX wird LaTeX um einige Befehle zum Zitieren erweitert. Außerdem benötigt wird das Paket `natbib`. + +* ++ Zitieren eines Autors: `\citeauthor{}` +* ++ Zitieren einer Quelle: `\cite{}` +* ++ Zitieren einer Seite: `\cite[S. 15]{}` +* ++ Zitieren mit weiteren Zusätzen:
`\cite[][]{}` +* ++ Verweis auf die genutzte `.bib`-Datei: `\bibliography{<.bib-datei>}` +* ++ Angabe des genutzten Zitierstils:
`\bibliographystyle{}` + +> Zwei Dinge sind unendlich. Das Universum und die Auswahl an Zitierstilen.Unbekannt + + +@slide(layout=preview-only) + +@preview +![Zitieren im Alpha-Zitierstil](svg/chapter-14/bibtex-alpha-crop.svg){.large .thin-padding} + + +@slide(layout=preview-only) + +@preview +![Zitieren im Natdin-Zitierstil](svg/chapter-14/bibtex-natdin-crop.svg){.large .thin-padding} + + +@slide(layout=preview-only) + +@preview +![Finden von fertigen BibTeX-Einträgen – Bamberger Katalog](svg/chapter-14/bamberger_katalog_bibtex.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finden von fertigen BibTeX-Einträgen – Google Scholar](svg/chapter-14/google_bibtex1.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finden von fertigen BibTeX-Einträgen – Google Scholar](svg/chapter-14/google_bibtex2.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finden von fertigen BibTeX-Einträgen – dblp.org](svg/chapter-14/dblp.jpg){.large} + + +@slide(layout=wide-task) + +@task-number +12 + +@title +Ein Literaturverzeichnis erstellen und einfügen + +@content +* Erstellt im Ordner `exercises/literature` eine neue BibTeX-Datei `literature.bib`. +* Sucht bei Google Scholar oder dblp.org die BibTeX-Einträge für folgende $\LaTeX$-Handbücher: + * Dilip Datta (2017): $\LaTeX$ in 24 Hours. A Practical Guide for Scientific Writing. + * Frank Mittelbach / Michel Goossens (2012): Der $\LaTeX$-Begleiter. +* Fügt die BibTeX-Einträge in die BibTeX-Datei ein. +* Vergebt aussagekräftige BibTeX-Keys. +* Bindet die BibTeX-Datei an einer geeigneten Stelle ein, an der später auch das Literaturverzeichnis zu sehen sein soll. +* Zitiert die zwei Handbücher im Text in der Datei `exercises/literature/literature.tex`. +* Wählt den Bibliographiestil `plain`. + diff --git a/latex-weekend-wise-2023/slides/literature.en.md b/latex-weekend-wise-2023/slides/literature.en.md new file mode 100644 index 0000000..79325df --- /dev/null +++ b/latex-weekend-wise-2023/slides/literature.en.md @@ -0,0 +1,114 @@ +@slide(layout=chapter-slide) + +@number +12 + +@title +Reference management + + +@slide(layout=content-only) + +@title +What do we need? + +@content +* a **bibliography file** (hereafter `.bib` file) for storing references +* **BibTeX** as an interface between the references and LaTeX + + +@slide(layout=wide-content) + +@title +What is this mysterious `.bib` file? + +@content +* collection of references in BibTeX format +* example: + +``` {.hljs .lang-tex} +@article{turing1990, % the type of the document and an identifier for the \cite command + title={The chemical basis of morphogenesis}, % information + author={Turing, Alan Mathison}, % about + journal={Bulletin of mathematical biology}, % the + volume={52}, % literature + pages={153--197}, % work + year={1990}, % follows + publisher={Springer} % … +} +``` + + +@slide(layout=content-only) + +@title +How is it used? + +@content +BibTeX adds some citation commands to LaTeX. In addition, we need the `natbib` package. + +* ++ Citing an author: `\citeauthor{}` +* ++ Citing a source: `\cite{}` +* ++ Citing a page: `\cite[p. 15]{}` +* ++ Citing with additional text:
`\cite[][]{}` +* ++ Referencing the `.bib` file: `\bibliography{<.bib file>}` +* ++ Choosing a citation style:
`\bibliographystyle{}` + +> Two things are infinite: the universe and the assortment of citation styles.Unknown + + +@slide(layout=preview-only) + +@preview +![Citing in Alpha style](svg/chapter-14/bibtex-alpha-example-crop.svg){.large .thin-padding} + + +@slide(layout=preview-only) + +@preview +![Citing in Natdin style](svg/chapter-14/bibtex-natdin-example-crop.svg){.large .thin-padding} + + +@slide(layout=preview-only) + +@preview +![Finding ready-made BibTeX entries – University of Bamberg Library](svg/chapter-14/bamberg_catalogue_bibtex.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finding ready-made BibTeX entries – Google Scholar](svg/chapter-14/google_bibtex1.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finding ready-made BibTeX entries – Google Scholar](svg/chapter-14/google_bibtex2.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finding ready-made BibTeX entries – dblp.org](svg/chapter-14/dblp.jpg){.large} + + +@slide(layout=wide-task) + +@task-number +12 + +@title + +Creating and inserting references + +@content +* Create a new BibTeX file called `literature.bib` in the `exercises/literature` folder. +* Use Google Scholar or dblp.org to retrieve BibTeX references for the following $\LaTeX$ handbooks: + * Dilip Datta (2017): $\LaTeX$ in 24 Hours. A Practical Guide for Scientific Writing. + * Frank Mittelbach / Michel Goossens (2012): Der $\LaTeX$-Begleiter. +* Add the BibTeX entries to the BibTeX file. +* Assign unique and meaningful BibTeX keys. +* Include the BibTeX file in a suitable location, where later on the references should be listed. +* Cite the two handbooks in the file `exercises/literature/literature.tex`. +* Make use of the `plain` bibliography style. diff --git a/latex-weekend-wise-2023/slides/maths.de.md b/latex-weekend-wise-2023/slides/maths.de.md new file mode 100644 index 0000000..43f00eb --- /dev/null +++ b/latex-weekend-wise-2023/slides/maths.de.md @@ -0,0 +1,228 @@ +@slide(layout=chapter-slide) + +@number +8 + +@title +Mathematische Formeln + +@slide(layout=content-and-preview) + +@title +Formel-Umgebungen 🧮 + +@content +``` {.lang-tex .hljs} +$2 \sqrt{\frac{\pi^2}{3} \cdot c_2}$ +``` + +Mathematische Formeln können **nur im sogenannten Mathmode** gesetzt werden, der inline durch zwei Dollarzeichen aktiviert wird. Außerdem gibt es eine Blockumgebung: + +``` {.lang-tex .hljs} +\begin{equation} + 2 \sqrt{\frac{\pi^2}{3} \cdot c_2} +\end{equation} +``` + +Pakete: `amsmath`, `amsthm`, `amssymb`, `mathtools` + +@preview +![](svg/chapter-09/simple-maths-crop.svg) + +@slide(layout=content-only) + +@title +Einige Beispiele + +@content + + + + + + + + + + + + + + + + + +
QuelltextErgebnis
`\sum_{i=1}^{n}x^2`$\sum_{i=1}^{n} x^2$
`12 \leq 4 x^2 + 13`$12 \leq 4 x^2 + 13$
`{n \choose k}`${n \choose k}$
+ + +@slide(layout=content-and-preview) + +@title +Ausrichtung von mehreren Gleichungen + +@content +Die Umgebung `align` erlaubt es, Gleichungen zum Beispiel am › = ‹ auszurichten. + +``` {.lang-tex .hljs} +\begin{align} + 13 \cdot (4a - 3)^2 &= 13 … \\ + &= 208a^2 - 312a + 117 +\end{align} +``` + +* ++ Ausgerichtet wird am ›`&`‹-Zeichen. +* ++ Zeilenumbrüche werden mit ›`\\`‹ markiert. +* ++ Die Nummerierung kann bei `align` und `equation` durch durch ein Sternchen nach dem Umgebungsnamen (z. B. `\begin{align*}` und `\end{align*}`) unterdrückt werden. + +@preview +![](svg/chapter-09/alignment-crop.svg) + + +@slide(layout=task-without-number) + +@task-number +8a + +@title +Formeln setzen + +@content +Setzt die folgenden Formeln in der Datei `exercises/maths/math-formulas.tex`. + +| Bedeutung | Ergebnis | +|-----------|----------| +| Fallbeschleunigung (Deutschland) | $9,81\,\frac{m}{s^2}$ | +| pq-Formel | $x_{1,2} = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}$ | +| Mitternachtsformel | $x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ | +| Catalansche Zahlen | $C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!}$ | + +@slide(layout=task-without-number) + +@task-number +8b + +@title +Formeln setzen + +@content +Setzt die folgenden Formeln in der Datei `exercises/maths/math-formulas.tex`. + +| Bedeutung | Ergebnis | +|-----------|----------| +| Definition der Fakultät | $n! = \prod_{i=1}^{n} i$ | +| Menge aller ungeraden natürlichen Zahlen | $\{ x \mid x \in \mathbb{N}, \text{ungerade}(x) \}$ | +| Elimination $\neg\exists x$ | $\neg\exists x . p(x) \Leftrightarrow \forall x . \neg p(x)$ | + + + +@slide(layout=extra-content-only) + +@title +Weitere Beispiele + +@content + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QuelltextErgebnis
`(x)`, `[x]`, `\lbrace x \rbrace`, `\lvert x \rvert`$(x), [x], \lbrace x\rbrace, \lvert x\rvert$
`\exists`, `\forall`, `\in`,
`\notin`, `\infty`
$\exists,\forall,\in,\notin,\infty$
`\alpha`, `\beta`, `\Gamma`,
`\Delta`, `\varepsilon`, `\pi`
$\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi$
`\rightarrow`, `\leftarrow`, `\Rightarrow`, `\Leftarrow`, `\Leftrightarrow`$\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow$
`(A \cup B) \cap C`$(A \cup B) \cap C$
`(A \lor B) \land C`$(A \lor B) \land C$
`(A \cdot B) \times C`$(A \cdot B) \times C$
+ +@slide(layout=extra-content-only) + +@title +Mitwachsende Klammern + +@content + + + + + + + + + + + + + + + + + +
QuelltextErgebnis
`\left( \frac{1}{2} \right)`$\left( \frac{1}{2} \right)$
`\left[ \frac{1}{2} \right]`$\left[ \frac{1}{2} \right]$
`\left\lbrace \frac{1}{2} \right\rbrace`$\left\lbrace \frac{1}{2} \right\rbrace$
+ + +``` {.lang-tex .hljs} +$4 \cdot \left( \frac{1}{2} % … +``` + +

$4 \cdot \left(\frac{1}{2} +\frac{3}{ 12 \cdot \left( 2 + \frac{1}{86 \cdot \left(\frac{1}{2} + 24 \right)} \right)} \right)$

+ + +@slide(layout=extra-content-and-preview) + +@title +Darstellung von Grenzen + +@content +Mit dem Befehl `\limits` lassen sich die Grenzen von Integralen unter und über dem Integralzeichen darstellen. Bei Summen, Produkten und Grenzwerten geschieht das automatisch. + +``` {.lang-tex .hljs} +\sum_{i=1}^{n^2}(x+2) +\prod_{j=1}^{100}(3 \cdot x) +\lim_{x \rightarrow \infty}(14x^3 - 12) +\int\limits_{-12}^{4}(14x^3 - 12) +``` + +

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

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

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

+

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

+ +``` {.lang-tex .hljs} +$\left\lbrace x \mid \text{tiefe}(x) … +``` \ No newline at end of file diff --git a/latex-weekend-wise-2023/slides/maths.en.md b/latex-weekend-wise-2023/slides/maths.en.md new file mode 100644 index 0000000..c8734ce --- /dev/null +++ b/latex-weekend-wise-2023/slides/maths.en.md @@ -0,0 +1,233 @@ +@slide(layout=chapter-slide) + +@number +8 + +@title +Typesetting mathematics + +@slide(layout=content-and-preview) + +@title +Formula environments 🧮 + +@content +``` {.lang-tex .hljs} +$2 \sqrt{\frac{\pi^2}{3} \cdot c_2}$ +``` + +Mathematical formulas are only accepted in the so-called **math mode.** +In-line formulas must therefor be guarded by two dollar signs. +We can also use the `equation` block environment: + +``` {.lang-tex .hljs} +\begin{equation} + 2 \sqrt{\frac{\pi^2}{3} \cdot c_2} +\end{equation} +``` + +Packages: `amsmath`, `amsthm`, `amssymb`, `mathtools` + +@preview +![](svg/chapter-09/simple-maths-crop.svg) + +@slide(layout=content-only) + +@title +Examples + +@content + + + + + + + + + + + + + + + + + +
source coderesult
`\sum_{i=1}^{n}x^2`$\sum_{i=1}^{n} x^2$
`12 \leq 4 x^2 + 13`$12 \leq 4 x^2 + 13$
`{n \choose k}`${n \choose k}$
+ + +@slide(layout=content-and-preview) + +@title +Aligning a group of equations + +@content +The `align` environment permits us to align equations at certain positions like the ‘ = ’ character. + +``` {.lang-tex .hljs} +\begin{align} + 13 \cdot (4a - 3)^2 &= 13 … \\ + &= 208a^2 - 312a + 117 +\end{align} +``` + +* ++ The equations will be aligned with respect to the ampersands (‘`&`’). +* ++ We can mark a new line using ‘`\\`’. +* ++ `align` and `equation` will not be numbered if we add an asterisk after their names (e. g. `\begin{align*}` and `\end{align*}`). + +@preview +![](svg/chapter-09/alignment-crop.svg) + + +@slide(layout=task-without-number) + +@task-number +8a + +@title +Typesetting mathematics + +@content +Code up the following formulas in the file `exercises/maths/math-formulas.tex`. + +| Meaning | Result | +|---------|--------| +| Gravitational acceleration | $9,81\,\frac{m}{s^2}$ | +| Formula to solve quadratic equations | $x_{1,2} = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}$ | +| Another formula to solve quadratic equations | $x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ | +| Catalan numbers | $C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!}$ | + + +@slide(layout=task-without-number) + +@task-number +8b + +@title +Typesetting mathematics + +@content +Code up the following formulas in the file `exercises/maths/math-formulas.tex`. + +| Meaning | Result | +|---------|--------| +| Definition of factorial | $n! = \prod_{i=1}^{n} i$ | +| Set of all odd natural numbers | $\{ x \mid x \in \mathbb{N}, \text{odd}(x) \}$ | +| Elimination $\neg\exists x$ | $\neg\exists x . p(x) \Leftrightarrow \forall x . \neg p(x)$ | + + + +@slide(layout=extra-content-only) + +@title +More examples + +@content + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
source coderesult
`(x)`, `[x]`, `\lbrace x \rbrace`, `\lvert x \rvert`$(x), [x], \lbrace x\rbrace, \lvert x\rvert$
`\exists`, `\forall`, `\in`,
`\notin`, `\infty`
$\exists,\forall,\in,\notin,\infty$
`\alpha`, `\beta`, `\Gamma`,
`\Delta`, `\varepsilon`, `\pi`
$\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi$
`\rightarrow`, `\leftarrow`, `\Rightarrow`, `\Leftarrow`, `\Leftrightarrow`$\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow$
`(A \cup B) \cap C`$(A \cup B) \cap C$
`(A \lor B) \land C`$(A \lor B) \land C$
`(A \cdot B) \times C`$(A \cdot B) \times C$
+ +@slide(layout=extra-content-only) + +@title +Height-adapting braces + +@content + + + + + + + + + + + + + + + + + +
source coderesult
`\left( \frac{1}{2} \right)`$\left( \frac{1}{2} \right)$
`\left[ \frac{1}{2} \right]`$\left[ \frac{1}{2} \right]$
`\left\lbrace \frac{1}{2} \right\rbrace`$\left\lbrace \frac{1}{2} \right\rbrace$
+ + +``` {.lang-tex .hljs} +$4 \cdot \left( \frac{1}{2} % … +``` + +

$4 \cdot \left(\frac{1}{2} +\frac{3}{ 12 \cdot \left( 2 + \frac{1}{86 \cdot \left(\frac{1}{2} + 24 \right)} \right)} \right)$

+ + +@slide(layout=extra-content-and-preview) + +@title +Depicting boundaries + +@content +The bounds of an integral can be enforced to appear above and below the integral symbol using the `\limits` command. +This is the standard behaviour for sums, products and limits. + +``` {.lang-tex .hljs} +\sum_{i=1}^{n^2}(x+2) +\prod_{j=1}^{100}(3 \cdot x) +\lim_{x \rightarrow \infty}(14x^3 - 12) +\int\limits_{-12}^{4}(14x^3 - 12) +``` + +

Don't use `\limits` inline.

+ + +@preview +![](svg/chapter-09/limits-crop.svg) + + +@slide(layout=extra-content-only) + +@title +Set-builder notation + +@content +In certain situations, it is more adequate to use textual predicates or long function names within the set builder notation. + +This is where `\text{}` comes into play. + +

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

+

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

+ +``` {.lang-tex .hljs .fragment} +$\left\lbrace x \mid \text{frequency} … +``` \ No newline at end of file diff --git a/latex-weekend-wise-2023/slides/packages.de.md b/latex-weekend-wise-2023/slides/packages.de.md new file mode 100644 index 0000000..959fc1e --- /dev/null +++ b/latex-weekend-wise-2023/slides/packages.de.md @@ -0,0 +1,214 @@ +@slide(layout=chapter-slide) + +@number +14 + +@title +Paket in Sicht! + +@slide(layout=content-and-preview) + +@title +Stichwortverzeichnis anlegen + +@content +```{.lang-tex .hljs} +\usepackage{makeidx} +\makeindex +\begin{document} +\maketitle +\section{Was ist LaTeX\index{LaTeX}?} +LaTeX\index{LaTeX} ist ein +Textsatzsystem\index{Textsatzsystem}. +\newpage \section{TeX\index{TeX} vs. +LaTeX\index{LaTeX}} Es basiert auf +TeX\index{TeX}, einer Erfindung von +Donald Knuth\index{Knuth, Donald}. +Da TeX\index{TeX} in seiner Syntax sehr +viel komplexer als LaTeX\index{LaTeX} +ist, ist LaTeX\index{LaTeX} wesentlich +weiter verbreitet. +\printindex +``` + +@preview +![](svg/chapter-15/index.png) + +@slide(layout=content-and-preview) + +@title +Präsentationen gestalten + +@content +Für Präsentationen gibt es die Dokumentenklasse `beamer` sowie zahlreiche [Vorlagen und Themes](https://www.overleaf.com/learn/latex/Beamer). + +```{.lang-tex .hljs .small-text} +\documentclass{beamer} +\usetheme{Frankfurt} +\usecolortheme{seahorse} +\usepackage[utf8]{inputenc} + +\begin{document} +\begin{frame} + \frametitle{Zitronensorbet} + \framesubtitle{Inkarnation des Guten?} + \begin{definition} + Ein Zitronensorbet ist eine + halbgefrorene \textbf{Speiseeiscreme} + auf Basis von \textit{Zitronen}. + \end{definition} +\end{frame} +\end{document} +``` + +@preview + + + +@slide(layout=content-and-preview) + +@title +Grafiken erstellen + +@content +`TikZ` (»TikZ ist kein Zeichenprogramm«) ist ein umfangreiches Paket zur Erstellung von Vektorgrafiken. + +```{.lang-tex .hljs .small-text .scroll-one-half} +% … +\tikzstyle{every node}=[draw=black,thick,anchor=west] +\tikzstyle{selected}=[draw=red,fill=red!30] +\tikzstyle{dir}=[fill=gray!50] +\tikzstyle{relativeTo}=[fill=blue!70] +\begin{tikzpicture}[% +grow via +three points={one child at (0.5,-0.7) and +two children at +(0.5,-0.7) and (0.5,-1.4)}, +edge from +parent path={(\tikzparentnode.south) + |- (\tikzchildnode.west)}] +\node {/ oder C:} +child { node {home} + child { node {knut} + child { node {pictures}} + child { node {docs} + child { node [dir] {latex} + child { node [relativeTo] {main.tex} + child { node [selected] {part1.tex} + } + } + } +}; +\end{tikzpicture} +``` + +@preview +![](svg/chapter-04/relative-path-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Linguistik + +@content +Mit dem Paket `qtree` lassen sich Konstituentenbäume erstellen: + +```{.lang-tex .hljs} +\Tree [.S [.NP LaTeX ] +[.VP [.V is ] [.NP fun ] ] ] +``` + +@preview +![](svg/chapter-15/constituency-tree-crop.svg) + +@slide(layout=content-and-preview) + +@title +Mathematische Beweisführung + +@content +Beweisbäume lassen sich mit dem Paket `prftree` einwandfrei darstellen. + +```{.hljs .lang-tex .small-text .scroll-one-half} +\begin{displaymath} +\prftree[l,r]{}{[comp$\_{ns}$]} +{ + \prftree[l,r]{}{[comp$\_{ns}$]} + { + \prftree[l,r]{}{[ass$\_{ns}$]} + { + - + } + { + (\texttt{m:=a}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{48,\bot} + } + } + { + \prftree[l,r]{}{[ass$\_{ns}$]} + { + - + } + { + (\texttt{n:=b}, \sigma\_{48,\bot}) + \rightarrow \sigma\_{48,18} + } + } + { + (\texttt{m:=a; n:=b}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{48,18} + } +} +{ + \prftree[l,r]{}{} + { + \dots + } + { + \textbf{[1]}\ (\texttt{LOOP}, \sigma\_{48,18}) + \rightarrow \sigma\_{6,6} + } +} +{ + (\texttt{m:=a; n:=b; LOOP}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{6,6} +} +\end{displaymath} +``` + +@preview + + +@slide(layout=content-only) + +@title +Weitere nützliche Pakete + +@content + + + + + + + + + + + + + + + + + + + + + + + + + +
PaketAnwendung
xcolorMach’s mit Farbe
todonotesToDo-Markierungen und Liste der ToDos
pdfpagesEinbinden von PDF-Dateien
subcaptionVerschachtelte Abbildungen und ausgefeilte Bildunterschriften
colortbl, tabularx, multirow, makecellGestalten von Tabellen
diff --git a/latex-weekend-wise-2023/slides/packages.en.md b/latex-weekend-wise-2023/slides/packages.en.md new file mode 100644 index 0000000..859519b --- /dev/null +++ b/latex-weekend-wise-2023/slides/packages.en.md @@ -0,0 +1,215 @@ +@slide(layout=chapter-slide) + +@number +14 + +@title +Package in sight! + +@slide(layout=content-and-preview) + +@title +Creating an index + +@content +```{.lang-tex .hljs} +\usepackage{makeidx} +\makeindex +\begin{document} +\maketitle +\section{What is LaTeX\index{LaTeX}?} +LaTeX\index{LaTeX} is a typesetting +system\index{Typesetting system}. +\newpage \section{TeX\index{TeX} vs. +LaTeX\index{LaTeX}} It is based on +TeX\index{TeX}, an invention by +Donald Knuth\index{Knuth, Donald}. +As TeX\index{TeX} is way more complex +syntactically than LaTeX\index{LaTeX}, +LaTeX\index{LaTeX} is much more +popular. +\printindex +``` + +@preview +![](svg/chapter-15/index_en-crop.svg) + +@slide(layout=content-and-preview) + +@title +Designing presentation slides + +@content +For slides, there is the `beamer` document class, as well as numerous [templates and themes](https://www.overleaf.com/learn/latex/Beamer). + +```{.lang-tex .hljs .small-text} +\documentclass{beamer} +\usetheme{Frankfurt} +\usecolortheme{seahorse} +\usepackage[utf8]{inputenc} + +\begin{document} +\begin{frame} + \frametitle{Lemon sorbet} + \framesubtitle{Incarnation of good?} + \begin{definition} + A lemon sorbet is a + semi-frozen \textbf{dessert} + on \textit{lemon} base. + \end{definition} +\end{frame} +\end{document} +``` + +@preview + + + +@slide(layout=content-and-preview) + +@title +Drawing images + +@content +`TikZ` (“TikZ ist kein Zeichenprogramm” — “TikZ is no drawing software”) is a powerful package for drawing vector graphics. + +```{.lang-tex .hljs .small-text .scroll-one-half} +% … +\tikzstyle{every node}=[draw=black,thick,anchor=west] +\tikzstyle{selected}=[draw=red,fill=red!30] +\tikzstyle{dir}=[fill=gray!50] +\tikzstyle{relativeTo}=[fill=blue!70] +\begin{tikzpicture}[% +grow via +three points={one child at (0.5,-0.7) and +two children at +(0.5,-0.7) and (0.5,-1.4)}, +edge from +parent path={(\tikzparentnode.south) + |- (\tikzchildnode.west)}] +\node {/ or C:} +child { node {home} + child { node {knut} + child { node {pictures}} + child { node {docs} + child { node [dir] {latex} + child { node [relativeTo] {main.tex} + child { node [selected] {part1.tex} + } + } + } +}; +\end{tikzpicture} +``` + +@preview +![](svg/chapter-04/relative-path-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Linguistics + +@content +The `qtree` package can render constituent-based parse trees: + +```{.lang-tex .hljs} +\Tree [.S [.NP LaTeX ] +[.VP [.V is ] [.NP fun ] ] ] +``` + +@preview +![](svg/chapter-15/constituency-tree-crop.svg) + +@slide(layout=content-and-preview) + +@title +Mathematical proofs + +@content +Logical tableaux can be renderd using the `prftree` package. + +```{.hljs .lang-tex .small-text .scroll-one-half} +\begin{displaymath} +\prftree[l,r]{}{[comp$\_{ns}$]} +{ + \prftree[l,r]{}{[comp$\_{ns}$]} + { + \prftree[l,r]{}{[ass$\_{ns}$]} + { + - + } + { + (\texttt{m:=a}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{48,\bot} + } + } + { + \prftree[l,r]{}{[ass$\_{ns}$]} + { + - + } + { + (\texttt{n:=b}, \sigma\_{48,\bot}) + \rightarrow \sigma\_{48,18} + } + } + { + (\texttt{m:=a; n:=b}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{48,18} + } +} +{ + \prftree[l,r]{}{} + { + \dots + } + { + \textbf{[1]}\ (\texttt{LOOP}, \sigma\_{48,18}) + \rightarrow \sigma\_{6,6} + } +} +{ + (\texttt{m:=a; n:=b; LOOP}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{6,6} +} +\end{displaymath} +``` + +@preview + + +@slide(layout=content-only) + +@title +Other useful packages + +@content + + + + + + + + + + + + + + + + + + + + + + + + + +
PackageUse case
xcolorcolours
todonotestodo annotations and index
pdfpagesembedding PDF files
subcaptionNested figures and fine-tuned captions
colortbl, tabularx, multirow, makecellTable tuning
+ diff --git a/latex-weekend-wise-2023/slides/project-structure.de.md b/latex-weekend-wise-2023/slides/project-structure.de.md new file mode 100644 index 0000000..ea81b7f --- /dev/null +++ b/latex-weekend-wise-2023/slides/project-structure.de.md @@ -0,0 +1,196 @@ +@slide(layout=chapter-slide) + +@number +4 + +@title +Projektstruktur + + +@slide(layout=content-and-preview) + +@title +Zielsetzung + +@content +Ein größeres LaTeX-Projekt anlegen und dabei … + +* verhindern, dass LaTeX-Dokumente zu monströser Größe anwachsen 👹 +* den Überblick über die Struktur eines Projekts behalten + +@preview +![](svg/chapter-04/langes-dokument.jpg){style="padding: .2em; height: 100vh"} + + +@slide(layout=content-and-preview) + +@title +Hauptdatei 👑 + +@content +* enthält Grundgerüst, Titel, Inhaltsverzeichnis etc. +* bindet einzelne Kapitel ein mit \ + `\input{pfad/zur/datei}` + +``` {.lang-tex .hljs data-sourcefile=main.tex} +\documentclass{article} +\usepackage[ngerman]{babel} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\title{Ein Titel} +\begin{document} + \maketitle + \tableofcontents + \input{abschnitt1.tex} + \input{abschnitt2.tex} +\end{document} +``` + +@preview +![](svg/chapter-04/hauptdatei-orig.svg) + + +@slide(layout=content-and-preview) + +@title +Datei mit Teilabschnitt + +@content +* enthält **keine Präambel** +* enthält **kein** `\begin{document}` und `\end{document}` + +``` {.hljs .lang-tex data-sourcefile=part1.tex} +\section{Dies ist Abschnitt 1} +Hier ein Absatz zum +Inhalt von Abschnitt 1. + +% … +``` + +``` {.hljs .lang-tex data-sourcefile=part2.tex} +\section{Dies ist Abschnitt 2} +Hier ein Absatz zum +Inhalt von Abschnitt 2. + +% … +``` + +@preview +![](svg/chapter-04/hauptdatei-teile-crop.svg){.thin-padding} + + +@slide(layout=content-and-preview-with-category) + +@category +Exkurs + +@title +Dateipfade angeben 👣 + +@content +* wichtig für `\input{}` sowie später für das Einbinden von Bildern und anderen Medien +* Datei- und Ordnerstruktur = Baumstruktur 🌳 +* bei `\input{}` kann der Pfad zu einer Unterdatei relativ zur Hauptdatei angeben werden + +

Bei LaTeX muss stets die **Unix-Syntax** für Pfadangaben verwendet werden. Pfadelemente werden durch einen Schrägstrich getrennt: `pfad/zur/datei`. Deshalb werden wir im Folgenden diese Schreibweise verwenden.

+ +@preview +![](svg/chapter-04/tree-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Exkurs + +@title +Dateipfade angeben 👣 + +@content +

`main-exercises.tex` → `praeamble.tex`

+ +
+`./praeamle.tex` + +Der **einfache Punkt »`.`«** bezieht sich bei relativen Pfaden auf den aktuellen Ordner (hier: `latex-skript`). Er ist optional, es könnte also auch nur `praeamble.tex` geschrieben werden. +
+ +@preview +![](svg/chapter-04/relative-path-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Exkurs + +@title +Dateipfade angeben 👣 + +@content +

`main-exercises.tex` → `basic-document-structure.tex` (in einem Unterordner)

+ +
+`./content/basic-document-structure.tex` +
+ +@preview +![](svg/chapter-04/relative-path-subdir-crop.svg) + + + +@slide(layout=content-and-preview-with-category) + +@category +Exkurs + +@title +Dateipfade angeben 👣 + +@content +

`basic-functionality.tex` → `graphics.raw.tex`

+

(wenn `basic-functionality.tex` von `main-exercises.tex` importiert wird)

+ +
+
./exercises/graphics/graphics.raw.tex
+

Pfade sind immer relativ zum Wurzelelement, auch wenn dieses noch andere Dateien einbindet, die wiederum andere Dateien referenzieren.

+
+ +@preview +![](svg/chapter-04/relative-path-transitive-crop.svg) + + + +@slide(layout=content-only-with-category) + +@category +Demo + +@title +Kompilieren des Projekts + +@content +* **Nur die Hauptdatei** wird kompiliert, um das fertige PDF-Dokument zu erhalten. +* ++ Fehlermeldungen enthalten dann Verweis, in welcher Unterdatei sie aufgetreten sind. +* ++ Die Unterdateien können wegen ihrer fehlenden Präambel nicht selbstständig kompiliert werden. + +
+Von nun an kompilieren wir die Datei `main-exercises.tex` im Wurzelverzeichnis des Projektordners. Klickt hierzu in TeXstudio mit der rechten Maustaste auf die Datei und wählt **„Explizit als Root-Dokument setzen“**. Anschließend könnt ihr wie gewohnt kompilieren. +
+ + +@slide(layout=task) + +@task-number +4 + +@title +Ein strukturiertes Projekt + +@content +Im Ordner `exercises/project-structure` findet ihr eine Datei namens `main.tex`. + +* Erstellt neue Dateien (z. B. `section1.tex` und `section2.tex` und verschiebt die Abschnitte in diese. +* Importiert die Fragmente anschließend mit Hilfe des `\input`-Befehls. +* Lagert die Präambel auf demselben Weg in eine eigene Datei aus. +* Schaut euch abschließend die Gesamtstruktur unseres Projektarchivs an, beginnend mit `main-exercises.tex` im Wurzelverzeichnis. Wie binden wir hier die einzelnen Abschnitte ein? \ No newline at end of file diff --git a/latex-weekend-wise-2023/slides/project-structure.en.md b/latex-weekend-wise-2023/slides/project-structure.en.md new file mode 100644 index 0000000..990f1ed --- /dev/null +++ b/latex-weekend-wise-2023/slides/project-structure.en.md @@ -0,0 +1,195 @@ +@slide(layout=chapter-slide) + +@number +4 + +@title +Project structure + +@slide(layout=content-and-preview) + +@title +Goal + +@content +Create a bigger LaTeX project and … + +* prevent LaTeX documents from growing monstrously 👹 +* keep the overview over the project structure + +@preview +![](svg/chapter-04/langes-dokument.jpg){style="padding: .2em; height: 100vh"} + + +@slide(layout=content-and-preview) + +@title +Main file 👑 + +@content +* contains basic structure +* includes separate sections with \ + `\input{path/to/file}` + +``` {.lang-tex .hljs data-sourcefile=main.tex} +\documentclass{article} +\usepackage{babel} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\title{A Title} +\begin{document} + \maketitle + \tableofcontents + \input{section1.tex} + \input{section2.tex} +\end{document} +``` + +@preview +![](svg/chapter-04/main-orig.svg) + + +@slide(layout=content-and-preview) + +@title +File with a section + +@content +* contains **no preamble** +* contains **no** `\begin{document}` or `\end{document}` + +``` {.hljs .lang-tex data-sourcefile=part1.tex} +\section{This is section 1} +A paragraph about the content +of section 1. + +% … +``` + +``` {.hljs .lang-tex data-sourcefile=part2.tex} +\section{This is section 2} +A paragraph about the content +of section 2. + +% … +``` + +@preview +![](svg/chapter-04/main-parts-crop.svg){.thin-padding} + + +@slide(layout=content-and-preview-with-category) + +@category +Excursion + +@title +Specifying file paths 👣 + +@content +* important for `\input{}`, but later also for other media types +* file and folder structure = tree structure 🌳 +* with `\input{}`, you can specify the path relative to the main file + +

In **LaTeX,** you have to use UNIX-style paths. They are separated by a forward slash: `path/to/file`. We will use those from here on.

+ +@preview +![](svg/chapter-04/tree-english-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Excursion + +@title +Specifying file paths 👣 + +@content +

`main-exercises.tex` → `praeamble.tex`

+ +
+`./praeamble.tex` + +A **single dot ‘`.`’** represents the current folder (in this case: `latex-skript`). It is optional, you could also write `praeamble.tex` here. +
+ +@preview +![](svg/chapter-04/relative-path-english-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Excursion + +@title +Specifying file paths 👣 + +@content +

`main-exercises.tex` → `basic-document-structure.tex` (in a subfolder)

+ +
./content/basic-document-structure.tex
+ +@preview +![](svg/chapter-04/relative-path-subdir-english-crop.svg) + + + +@slide(layout=content-and-preview-with-category) + +@category +Excursion + +@title +Specifying file paths 👣 + +@content +

`basic-functionality.tex` → `graphics.raw.tex`

+

(`basic-functionality.tex` is imported into `main-exercises.tex`)

+ +
+
./exercises/graphics/graphics.raw.tex
+

Paths are always relative to the root document that imports other files as fragments.

+
+ +@preview +![](svg/chapter-04/relative-path-transitive-english-crop.svg) + + + +@slide(layout=content-only-with-category) + +@category +Demo + +@title +Compiling the project + +@content +* **Only the main file** has to be compiled to get the complete PDF document. +* ++ Error messages include a reference to the corresponding subfile. +* ++ Subfiles cannot be compiled on their own as they don’t have a preamble. + +
+From now on, we will compile the file `main-exercises.tex` in the project root. +To do so, right click on the file in TeXstudio and choose **“Select as explicit root document”** from the dropdown. +Next, compile as usual. +
+ + +@slide(layout=task) + +@task-number +4 + +@title +A structured project + +@content +You will find a file named `main.tex` in the folder `exercises/project-structure`. + +* Put the sections of the file into separate files, named `section1.tex` and `section2.tex`. +* Include them using the `\input` command. +* Move the preamble to its own file in a similar fashion. +* Finally, have a look at the general project archive, starting from `main-exercises.tex` (in the root folder of the project archive). How do we include the different sections here? \ No newline at end of file diff --git a/latex-weekend-wise-2023/slides/references-and-footnotes.de.md b/latex-weekend-wise-2023/slides/references-and-footnotes.de.md new file mode 100644 index 0000000..cb6f1ca --- /dev/null +++ b/latex-weekend-wise-2023/slides/references-and-footnotes.de.md @@ -0,0 +1,211 @@ +@slide(layout=chapter-slide) + +@number +11 + +@title +Referenzen und Fußnoten + + +@slide(layout=content-and-preview) + +@title +Fußnoten 📎 + +@content +``` {.hljs .lang-tex} +\usepackage{hyperref} +``` + +Die Nummerierung erfolgt automatisch und ist fortlaufend, unabhängig davon, ob ein neuer Abschnitt beginnt. + +``` {.hljs .lang-tex} +Eber, beim Hausschwein insbesondere +oberdeutsch Saubär, beim Wildschwein +Keiler, bezeichnet das männliche +Geschlecht des Schweins. +\footnote{\url{https://de.wikipedia.org/ +wiki/Eber}} +``` + +@preview +![](svg/chapter-13/fußnotenbeispiel-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Querverweise + +@content +Manuell (Just don’t!) + +``` {.hljs .lang-tex} +Wie man in Abbildung 23 sieht, … +``` + +Mit dem Befehl `\ref`: + +``` {.hljs .lang-tex} +\begin{figure}[H] + \includegraphics % … + \caption{Unser Maskottchen Fooboar} + \label{img:fooboar} +\end{figure} + +Wie man in Abbildung \ref{img:fooboar} … +``` + +@preview +![](svg/chapter-13/ref-beispiel-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Referenzen + +@content +Mit dem Paket `cleveref` (mit *einem* ›r‹!): + +``` {.hljs .lang-tex} +\begin{figure}[H] + \includegraphics % … + \caption{Unser Maskottchen Fooboar} + \label{img:fooboar} +\end{figure} + +Fooboar ist ein sehr engagierter +Jungeber (siehe \Cref{img:fooboar}). +``` + +Der Befehl `\cref` fügt selbstständig die passende Abkürzung ein. + +@preview +![](svg/chapter-13/cref-beispiel-crop.svg) + + +@slide(layout=content-only) + +@title +Label vergeben + +@content +Beide Referenzierungsbefehle funktionieren mit **Abschnitten, Bildern, Tabellen, Listings und Gleichungen,** sofern die richtigen Label vergeben wurden. + +Label müssen **eindeutig** sein. Zur Strukturierung ist das Voranstellen von Kürzeln üblich, denn einige Pakete ziehen aus den Kürzeln Informationen. + + + + + + + + + + + + + + + + + + +
`fig:` Abbildungen`tbl:` Tabellen
`sec:` Abschnitte`subsec:` Unter­abschnitte
`ch:` Kapitel`itm:` Aufzählungs­elemente
`eq:` Gleichungen`lst:` Quelltext­listings
+ + +@slide(layout=content-only) + +@title +Dinge, die zu beachten sind + +@content +* ++ Durch `\cref` eingefügte Passagen tauchen in einigen Dokumentklassen erst dann auf Deutsch auf, wenn bereits in der Dokumentklasse die Sprache festgelegt wurde: + + ``` {.hljs .lang-tex} + \documentclass[ngerman]{article} + ``` + +* ++ Beschriftungen (`\caption{…}`) müssen, von Abschnitten abgesehen, **immer und vor dem Label** vergeben werden. + +* ++ Bei Abschnitten wird das Label direkt hinter dem Befehl angefügt. + + ``` {.hljs .lang-tex} + \section{Hinweise}\label{sec:hinweise} + ``` + + +@slide(layout=task) + +@task-number +11a + +@title +Fußnoten einfügen + +@content +* Pack den Text *March 2023* in der Datei `exercises/footnotes/footnotes.tex` in eine **Fußnote**. +* Fügt zusätzlich eine **klickbare URL**, die zur Download-Seite des Java Development Kit führt (`https://www.oracle.com/java/technologies/javase-downloads.html`), als Fußnote ein. + + + +@slide(layout=task) + +@task-number +11b + +@title +Referenzen einfügen + +@content +* Ersetzt im Text in der Datei `references.tex` im Ordner `exercises/references` *In the figure* und *The following source code listing* durch eine **Referenz** auf das Bild bzw. auf das Quelltext-Listing. +* Nutzt dafür den Befehl `\Cref`. +* Achtet darauf, zuerst **Labels** für die Elemente, die ihr referenzieren wollt, zu vergeben. +* Bei **Quelltext-Listings** funktioniert die Angabe von Labels und Captions leicht anders. Nutzt euer bisheriges Wissen und das Internet, um herauszufinden, wie ihr den Befehl `\lstinputlisting` anpassen müsst, um beides zu vergeben. + + +@slide(layout=extra-content-and-preview) + +@title +Konfiguration von Fußnoten + +@content +Das Paket `footmisc` stellt verschiedene weitere Optionen für die Darstellung von Fußnoten zur Verfügung, die als optionale Parameter an den Befehl `\usepackage` übergeben werden können. + +``` {.hljs .lang-tex} +% Zählung auf jeder Seite neu beginnen: +\usepackage[perpage]{footmisc} + +% Fußnoten inline anzeigen lassen: +\usepackage[para]{footmisc} + +% Symbole statt Nummerierung verwenden: +\usepackage[symbol]{footmisc} +``` + +@preview +![](svg/chapter-13/footmisc-de-crop.svg){.thin-padding} + + +@slide(layout=extra-content-and-preview) + +@title +Weiterführend + +@content +* Wurde vor dem Paket `cleveref` das Paket `hyperref` eingebunden, entsteht ein **klickbarer Link** im fertigen PDF. +* Mehrere Referenzen können in `\cref` kommagetrennt angegeben werden. + +``` {.hljs .lang-tex} +\section{Ein Einstieg} +\label{sec:section1} +% … +Hier sei verwiesen auf +\cref{sec:section1,sec:section2, +sec:section3,sec:section5}. +``` + +@preview +![](svg/chapter-13/cref-multiple-beispiel-crop.svg) + diff --git a/latex-weekend-wise-2023/slides/references-and-footnotes.en.md b/latex-weekend-wise-2023/slides/references-and-footnotes.en.md new file mode 100644 index 0000000..187c634 --- /dev/null +++ b/latex-weekend-wise-2023/slides/references-and-footnotes.en.md @@ -0,0 +1,213 @@ +@slide(layout=chapter-slide) + +@number +11 + +@title +References and footnotes + + +@slide(layout=content-and-preview) + +@title +Footnotes 📎 + +@content +``` {.hljs .lang-tex} +\usepackage{hyperref} +``` + +Footnotes are automatically numbered consecutively, independent of sections. + +(Here, `hyperref` is used for the `\url` command, it is not necessary for footnotes per se.) + +``` {.hljs .lang-tex} +The wild boar (\textit{Sus scrofa}), also +known as the wild swine, common wild pig, +or simply wild pig, is a suid native to +much of Eurasia and North Africa, and has +been introduced to the Americas and Oceania. +\footnote{\url{https://en.wikipedia.org/ +wiki/Wild_boar}} +``` + +@preview +![](svg/chapter-13/footnote-example-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Cross-references + +@content +Manually (just don’t!) + +``` {.hljs .lang-tex} +As you can see in figure 23, … +``` + +Using the `\ref` command: + +``` {.hljs .lang-tex} +\begin{figure}[H] + \includegraphics % … + \caption{Our mascot Fooboar} + \label{img:fooboar} +\end{figure} + +As you can see in figure +\ref{img:fooboar}, … +``` + +@preview +![](svg/chapter-13/ref-example-crop.svg) +@slide(layout=content-only) + +@title +Assigning labels + +@content +Both cross-reference commands work with **sections, figures, tables, listings, and equations,** as long as you use correct labels. + +Labels have to be **unambiguous.** For clarity, certain prefixes are common, and some packages use them to derive information. + + + + + + + + + + + + + + + + + + +
`fig:` Figures`tbl:` Tables
`sec:` Sections`subsec:` Subsections
`ch:` Chapters`itm:` Enumeration items
`eq:` Equations`lst:` Source code listings
+ + + +@slide(layout=content-and-preview) + +@title +Cross-references + +@content +Using the `cleveref` package (with *one* ‘r’!): + +``` {.hljs .lang-tex} +\begin{figure}[H] + \includegraphics % … + \caption{Our mascot Fooboar} + \label{img:fooboar} +\end{figure} + +Fooboar is a young and highly engaged +boar (see \Cref{img:fooboar}). +``` + +The `\cref` command automatically inserts suitable prefixes. + +@preview +![](svg/chapter-13/cref-example-crop.svg) + + +@slide(layout=content-only) + +@title +Things to consider + +@content +* Terms inserted by `\cref` use the language specified with the document class (or `babel`): + + ``` {.hljs .lang-tex} + \documentclass[english]{article} + ``` + +* Apart from sections, referenced elements need captions (`\caption{…}`), and the **captions have to be placed before the label.** + +* For sectioning commands, the label is inserted directly after the section command. + + ``` {.hljs .lang-tex} + \section{Notes}\label{sec:notes} + ``` + + +@slide(layout=task) + +@task-number +11a + +@title +Inserting footnotes + +@content +* Make the text *March 2023* in file `exercises/footnotes/footnotes.tex` appear as a **footnote**. +* Additionally, insert a **clickable URL** that leads to the download page for the Java Development Kit (`https://www.oracle.com/java/technologies/javase-downloads.html`). + + +@slide(layout=task) + +@task-number +11b + +@title +Inserting references + +@content +* In file `exercises/references/references.tex`, replace *In the figure* and *The following source code listing* by **references** to the figure and to the source code listing. +* Use the command `\Cref` for the references. +* Make sure to add **labels** to the elements that you want to create a reference for. +* For source code listings, adding labels and captions is a bit different. Try to apply the knowledge you gained so far to retrieve the correct version of the `\lstinputlisting` command. Use the Internet, if necessary. + + +@slide(layout=extra-content-and-preview) + +@title +Configuring footnotes + +@content +The `footmisc` package provides additional options for the presentation of footnotes that can be activated by adding parameters to the `\usepackage` command. + +``` {.hljs .lang-tex} +% Reset the counter on each page: +\usepackage[perpage]{footmisc} + +% Display footnotes in-line: +\usepackage[para]{footmisc} + +% Use symbols instead of numbers: +\usepackage[symbol]{footmisc} +``` + +@preview +![](svg/chapter-13/footmisc-en-crop.svg){.thin-padding} + + + +@slide(layout=extra-content-and-preview) + +@title +A few more things + +@content +* It is recommended that you include the package `hyperref` before `cleveref`. +* `\cref` can take multiple references at once, separated by commas. + +``` {.hljs .lang-tex} +\section{An introduction} +\label{sec:section1} +% … +Reference be made to +\cref{sec:section1,sec:section2, +sec:section3,sec:section5}. +``` + +@preview +![](svg/chapter-13/cref-multiple-example-crop.svg) \ No newline at end of file diff --git a/latex-weekend-wise-2023/slides/source-code-listings.de.md b/latex-weekend-wise-2023/slides/source-code-listings.de.md new file mode 100644 index 0000000..cc03a20 --- /dev/null +++ b/latex-weekend-wise-2023/slides/source-code-listings.de.md @@ -0,0 +1,110 @@ +@slide(layout=chapter-slide) + +@number +13 + +@title +Quelltext-Listings + + +@slide(layout=content-and-preview) + +@title +Direkt im LaTeX-Quelltext + +@content +Das Paket `listings` bietet zum Einfügen von Code eine eigene Umgebung: + +``` {.lang-tex .hljs} +\section*{Haskell-Magie} +Quadrate aller geraden % … +\begin{lstlisting}[language=Haskell] +[x^2 | x <- [1..200], even x] +\end{lstlisting} +``` + +@preview +![](svg/chapter-10/listings-haskell-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Externer Code + +@content +Praktischerweise bietet `listings` einen Befehl zum Einfügen externen Codes: + +``` {.lang-tex .hljs} +\section*{Einfache Java-Anwendung} +\lstinputlisting[language=Java]{Test.java} +``` + +``` {.lang-java .hljs data-sourcefile="Test.java"} +public class Test { + public static void main(/*…*/) { + System.out.println(/*…*/); + } +} +``` + +@preview +![](svg/chapter-10/listings-java-crop.svg) + + +@slide(layout=content-only) + +@title +Themen und Stile + +@content +`listings` stellt keine eigenen Themes zur Verfügung. Dies kann aber durch die vielen Konfigurationsoptionen ausgeglichen werden. + +``` {.lang-tex .hljs} +\begin{lstlisting}[ + language=Java, + basicstyle=\footnotesize\ttfamily, + breaklines=true, + keywordstyle=\color{ForestGreen}, + commentstyle=\color{DarkGray}, + literate={ö}{{\"o}}1 +] +% … +\end{lstlisting} +``` + +Für die Erstellung eigener Themes ist der Befehl `\lstset` nützlich. + + +@slide(layout=content-only) + +@title +Weitere Materialien + +@content +* [Einführung](https://www.overleaf.com/learn/latex/Code_listing#Reference_guide) in das Paket +* offizielle [Dokumentation](https://www.overleaf.com/learn/latex/Code_listing#Reference_guide) +* vordefinierte [UTF-8-Konfiguration](https://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings#Encoding_issue) +* das Paket [`xcolor`](https://www.overleaf.com/learn/latex/Using_colours_in_LaTeX) für Farben +* zwei [Themes](https://github.com/jez/latex-solarized) im solarized-Stil für `listings` + + +@slide(layout=task) + +@task-number +13 + +@title +Listings + +@content +* Im Ordner `exercises/source-code-listings` findet ihr eine Datei namens `Source.java`. +* **Bindet** den Java-Quelltext in der Datei `source-code-listings.tex` **ein**. (Beachtet, dass der Dateipfad relativ zu `main-exercises.tex` ist.) +* Erlaubt die Verwendung von **Sonderzeichen** durch Angabe der `literate`-Option. +* Aktiviert das **Syntax-Highlighting** durch Angabe der Sprache Java. +* **Nummeriert** die Zeilen und aktiviert **Umbrüche**. +* Setzt mit dem Parameter `basicstyle` eine dicktengleiche Schrift (`\ttfamily \small`). +* Ändert die Schlüsselwortfarbe zu Blau. +* Verbergt die Sonderzeichen, die **Leerzeichen in Zeichenketten** markieren. + +Seht bei Fragen in der Dokumentation des Paketes `listings` nach. diff --git a/latex-weekend-wise-2023/slides/source-code-listings.en.md b/latex-weekend-wise-2023/slides/source-code-listings.en.md new file mode 100644 index 0000000..82e1b27 --- /dev/null +++ b/latex-weekend-wise-2023/slides/source-code-listings.en.md @@ -0,0 +1,110 @@ +@slide(layout=chapter-slide) + +@number +13 + +@title +Source code listings + + +@slide(layout=content-and-preview) + +@title +In-situ listings + +@content +The `listings` package provides a dedicated environment: + +``` {.lang-tex .hljs} +\section*{Haskell Magic} +Squares of all even % … +\begin{lstlisting}[language=Haskell] +[x^2 | x <- [1..200], even x] +\end{lstlisting} +``` + +@preview +![](svg/chapter-10/listings-haskell-english-crop.svg) + + +@slide(layout=content-and-preview) + +@title +External source code + +@content +Conveniently, `listings` offers an import command: + +``` {.lang-tex .hljs} +\section*{Simple Java Application} +\lstinputlisting[language=Java]{Test.java} +``` + +``` {.lang-java .hljs data-sourcefile="Test.java"} +public class Test { + public static void main(/*…*/) { + System.out.println(/*…*/); + } +} +``` + +@preview +![](svg/chapter-10/listings-java-english-crop.svg) + + +@slide(layout=content-only) + +@title +Themes and styles + +@content +`listings` does not provide any themes by default, but can be configured extensively. + +``` {.lang-tex .hljs} +\begin{lstlisting}[ + language=Java, + basicstyle=\footnotesize\ttfamily, + breaklines=true, + keywordstyle=\color{ForestGreen}, + commentstyle=\color{DarkGray}, + literate={ö}{{\"o}}1 +] +% … +\end{lstlisting} +``` + +Have a look at the `\lstset` command for creating your own themes. + + +@slide(layout=content-only) + +@title +Further resources + +@content +* [introduction](https://www.overleaf.com/learn/latex/Code_listing#Reference_guide) to the package +* official [documentation](https://www.overleaf.com/learn/latex/Code_listing#Reference_guide) +* predefined [UTF-8 configuration](https://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings#Encoding_issue) +* [`xcolor` package](https://www.overleaf.com/learn/latex/Using_colours_in_LaTeX) for colors +* two [solarized themes](https://github.com/jez/latex-solarized) for `listings` + + +@slide(layout=task) + +@task-number +13 + +@title +Listings + +@content +* In the directory `exercises/source-code-listings` you can find a file named `Source.java`. +* **Include** it in the file `source-code-listings.tex`. (Keep in mind that the file path is relative to the main LaTeX document, i. e., to `main-exercises.tex`.) +* Enable **special characters** via the `literate` option. +* Activate **syntax highlighting** by stating the programming language Java. +* **Number** the code lines. +* Set the `basicstyle` to a proper mono-spaced font (`\ttfamily \small`) +* Change the **keyword color** to blue. +* Don't show special characters for **spaces in strings**. + +If you have questions, try to consult the documentation of the `listings` package. diff --git a/latex-weekend-wise-2023/slides/special-characters.de.md b/latex-weekend-wise-2023/slides/special-characters.de.md new file mode 100644 index 0000000..ba81773 --- /dev/null +++ b/latex-weekend-wise-2023/slides/special-characters.de.md @@ -0,0 +1,331 @@ +@slide(layout=chapter-slide) + +@number +5 + +@title +Sonderzeichen + + +@slide(layout=content-and-preview) + +@title +Leerzeichen + +@content + +* Nutzt schmale Leerzeichen (`\,`) und geschützte Leerzeichen (`~`) an den geeigneten Stellen. + +``` {.hljs .lang-tex} +Schmale Leerzeichen werden z.\,B. in +Abkürzungen und zwischen Zahlen und +Einheiten verwendet: 10\,s. +Normalbreite, aber geschützte +Leerzeichen können u.\,a. +dabei helfen, Titel und Namen in +einer Zeile zu halten: Dr.~Fooboar. +``` + +* ++ Nutzt French Spacing (`\frenchspacing`), um riesige Freiräume nach Satzzeichen zu verhindern. + +@preview +![](svg/chapter-05/leerzeichen-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Striche + +@content + + + + + + + + + + + + + + + + + + + + + + + + + +
NameVerwendungCode
-Bindestrich *(hypen)*LaTeX-Wochenende`-`
Halbgeviert­strich
*(en dash)*
als Gedankenstrich – oder als Bis-Strich: 10 – 12 Uhr.`--`
Geviertstrich
*(em dash)*
a dash — mostly in American English`---`
+ +@preview +![](svg/chapter-05/striche-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Zitate + +@content +Das Paket `csquotes` stellt u. a. den Befehl `\enquote` zur Verfügung: + +``` {.lang-tex .hljs} +\enquote{Ein \enquote{verschachteltes} +Zitat.} +``` + +Wenn das Paket mit `autostyle=true` eingebunden wird, werden bei fremdsprachigen Zitaten die entsprechenden Anführungszeichen verwendet: + +``` {.lang-tex .hljs} +\foreignquote{english}{An English +quote.} +``` + +@preview +![](svg/chapter-05/zitate-crop.svg) + + +@slide(layout=content-only) + +@title +Sonderzeichen & Symbole + +@content +### Detexify to the rescue! ⛑️ +* Ausführliche Liste an verwendbaren Symbolen: + [PDF auf der CTAN-Website](http://tug.ctan.org/info/symbols/comprehensive/symbols-a4.pdf) +* Symbole malen und erkennen lassen: + [Detexify](http://detexify.kirelabs.org/classify.html) + + +@slide(layout=task) + +@task-number +5 + +@title +Sonderzeichen einfügen + +@content +
+Kompiliert von nun an immer die Datei `main-exercises.tex`, um eure Änderungen im Übungsskript zu sehen (in diesem Fall im Abschnitt zu Übung 5). +
+ +* Ersetzt die Leerzeichen innerhalb der Abkürzungen in `exercises/special-characters.tex` durch **schmale Leerzeichen**. +* Die Bindestriche bei den Öffnungszeiten der ERBA sollen durch **Halbgeviertstriche** ersetzt werden, optional mit schmalen Leerzeichen außenrum. +* Nutzt den Befehl `\enquote`, um die Wörter *Studi-Ticket* und *Studi-Karte* in **Anführungszeichen** zu setzen. + + +@slide(layout=extra-content-and-preview) + +@title +English spacing + +@content +In englischsprachigen Dokumenten verwendet LaTeX das traditionelle *English spacing,* also doppelte Leerzeichen nach dem Satzende. + +Das kann mit `\frenchspacing` vor dem ersten Absatz verhindert werden. `\nonfrenchspacing` schaltet wieder zurück. + +Bei *English spacing* versucht LaTeX, nach Abkürzungen trotzdem normale Wortzwischenräume zu setzen. Das sollte aber kontrolliert werden. Eingreifen können wir mit + +* erzwungenen Wortzwischenräumen: `.\␣` +* erzwungenen Satzenden: `\@.␣` + +@preview +![](svg/chapter-05/french-spacing-crop.svg) + + +@slide(layout=extra-content-and-preview) + +@title +Silbentrennung + +@content +LaTeX trennt Wörter im Normalfall automatisch richtig, wenn die richtige Sprache konfiguriert ist. Manchmal muss aber auch manuell eingegriffen werden. + + + + + + + + + + + + + + + + + + + + + + + + + + +
Ausschließliche Trennung`\-`
Zusätzliche Trennstelle`"-`
Bindestrich (verbietet andere Trennstellen)`-`
Bindestrich (erlaubt andere Trennstellen)`"=`
Trennstelle ohne Strich`""`
Strich ohne Trennstelle`"~`
+ +

Einige der Codes funktionieren nur mit eingebundenem `babel`-Paket.

+ + +@preview +![](svg/chapter-05/silbentrennung-crop.svg) + + + +@slide(layout=extra-content-only) + +@title +Anführungszeichen + +@content + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpracheBefehlErgebnis
Deutsch`\glqq … \grqq`„ … “
 2. Ebene` \glq … \grq `‚ … ‘
Deutsch altern.`\frqq … \flqq`» … «
 2. Ebene` \frq … \flq `› … ‹
Englisch (A. E.)\`\`…\'\'“ … ”
 2. Ebene \`…\' ‘ … ’
Englisch (B. E.) \`…\' ‘ … ’
 2. Ebene\`\`…\'\'“ … ”
+ +Für andere Sprachen können andere Regeln gelten, meistens aber mit den gleichen Zeichen, nur in anderer Zusammensetzung. + + +@slide(layout=extra-content-only) + +@title +Diakritika + +@content +Buchstaben mit Diakritika können entweder direkt über die Tastatur eingegeben werden oder über Escape-Codes: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\\\`{o}ò  `\c{c}` ç  `\d{u}`
`\'{o}` ó`\k{a}` ą`\r{a}` å
`\^{o}` ô`\l{}` ł`\u{o}` ŏ
`\"{o}` ö`\={o}` ō`\v{s}` š
`\H{o}` ő`\b{o}` o`\t{oo}`o͡o
`\~{o}` õ`\.{o}` ȯ`\o` ø
+ + +@slide(layout=extra-content-only) + +@title +Sonderzeichen & Symbole + +@content +Auch andere Sonderzeichen können entweder direkt eingegeben werden oder per Befehl: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
¿ ?\`¡ !\`
^ `\textasciicircum`~ `\textasciitilde`
`\textasteriskcentered`\\ `\textbackslash`
| `\textbar` `\textbullet`
`\textcopyright` `\textdagger`
`\textdaggerdbl` `\textellipsis`
< `\textless`> `\textgreater`
`\textperthousand`§ `\textsection`
+ +… und so ziemlich alles andere. \ No newline at end of file diff --git a/latex-weekend-wise-2023/slides/special-characters.en.md b/latex-weekend-wise-2023/slides/special-characters.en.md new file mode 100644 index 0000000..0df2074 --- /dev/null +++ b/latex-weekend-wise-2023/slides/special-characters.en.md @@ -0,0 +1,327 @@ +@slide(layout=chapter-slide) + +@number +5 + +@title +Special characters + + +@slide(layout=content-and-preview) + +@title +Spaces + +@content +* Use thin spaces (`\,`) and non-breaking spaces (`~`), where appropriate. + +``` {.hljs .lang-tex} +Thin spaces are used in abbreviations +and before units, e.\,g., 10\,s. +Normal-width non-breaking spaces can help +keep honorary titles and names on one +line: Dr.~Fooboar. +``` + +* ++ Use french spacing (`\frenchspacing`) to avoid giant gaps after full stops. + +@preview +![](svg/chapter-05/spaces-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Hyphens and dashes + +@content + + + + + + + + + + + + + + + + + + + + + + + + + +
NameUseCode
-Hyphencompound-forming hyphen`-`
En dash *(Halbgeviert­strich)*a dash – or a range: 12 – 2 p.m.`--`
Em dash *(Geviertstrich)*a dash — mostly in American English`---`
+ +@preview +![](svg/chapter-05/hyphens-and-dashes-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Quotes + +@content +The `csquotes` package provides, amongst others, the command `\enquote`. + +``` {.lang-tex .hljs} +\enquote{A \enquote{nested} +quote.} +``` + +When included with `autostyle=true`, foreign-language quotes use the according quotation marks: + +``` {.lang-tex .hljs} +\foreignquote{ngerman}{Ein deutsches +Zitat.} +``` + +@preview +![](svg/chapter-05/quotes-crop.svg) + + +@slide(layout=content-only) + +@title +Special characters & symbols + +@content +### Detexify to the rescue! ⛑️ +* A long list of symbols to use: + [PDF on the CTAN website](http://tug.ctan.org/info/symbols/comprehensive/symbols-a4.pdf) +* Draw symbols and have them recognised: + [Detexify](http://detexify.kirelabs.org/classify.html) + + +@slide(layout=task) + +@task-number +5 + +@title +Insert special characters + +@content +
+From now on, compile the file `main-exercises.tex` to see your changes appear in the exercise script (in this task, see exercise 5). +
+ +* Replace the spaces in `exercises/special-characters.tex` within the abbreviations (“e. g.”, “i. a.”) by **thin spaces**. +* Replace the hyphens separating the opening hours by **en dashes** (`--`), optionally surrounded by thin spaces. +* Add **quotation marks** around the words *Studi-Ticket* and *Studi-Karte* using the `\enquote` command. + + +@slide(layout=extra-content-and-preview) + +@title +English and French spacing + +@content +In English, LaTeX uses the old-fashioned *English spacing,* i. e., double sentence spacing. + +If you want to be more modern, you can use `\frenchspacing` above your first paragraph. `\nonfrenchspacing` goes back to default. + +If you actually use *English spacing,* LaTeX will still try and put normal word spacing after abbreviations. However, you should check the results and intervene where needed by + +* forcing normal spaces: `.\␣` +* manually ending sentences: `\@.␣` + +@preview +![](svg/chapter-05/french-spacing-crop.svg) + + +@slide(layout=extra-content-and-preview) + +@title +Hyphenation + +@content +Most of the time, LaTeX hyphenates words correctly, if the correct language is configured. +Sometimes, however, manual intervention is necessary. + + + + + + + + + + + + + + + + + + + + + + + + + + +
Exclusive hyphenation`\-`
Additional hyphenation`"-`
Hyphen (suppressing other hyphenation)`-`
Hyphen (allowing other hyphenation)`"=`
Possible separation without hyphen`""`
Non-breaking hyphen`"~`
+ +

Some of the codes only work when you use the `babel` package.

+ +@preview +![](svg/chapter-05/hyphenation-crop.svg) + + +@slide(layout=extra-content-only) + +@title +Manual quotation + +@content + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LanguageCommandResult
English (B. E.) \`…\' ‘ … ’
 2nd Level\`\`…\'\'“ … ”
English (A. E.)\`\`…\'\'“ … ”
 2nd Level \`…\' ‘ … ’
German`\glqq … \grqq`„ … “
 2nd Level` \glq … \grq `‚ … ‘
German altern.`\frqq … \flqq`» … «
 2nd Level` \frq … \flq `› … ‹
+ +Other rules my apply for other languages, but most of the time it’s the same characters, only combined differently. + + +@slide(layout=extra-content-only) + +@title +Diacritics + +@content +Letters with diacritics can either by typed directly on the keyboard or via escape codes: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\\\`{o}ò  `\c{c}` ç  `\d{u}`
`\'{o}` ó`\k{a}` ą`\r{a}` å
`\^{o}` ô`\l{}` ł`\u{o}` ŏ
`\"{o}` ö`\={o}` ō`\v{s}` š
`\H{o}` ő`\b{o}` o`\t{oo}`o͡o
`\~{o}` õ`\.{o}` ȯ`\o` ø
+ + +@slide(layout=extra-content-only) + +@title +Special characters + +@content +The same is true for special characters: They can either be typed directly or created via escape codes and commands: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
¿ ?\`¡ !\`
^ `\textasciicircum`~ `\textasciitilde`
`\textasteriskcentered`\\ `\textbackslash`
| `\textbar` `\textbullet`
`\textcopyright` `\textdagger`
`\textdaggerdbl` `\textellipsis`
< `\textless`> `\textgreater`
`\textperthousand`§ `\textsection`
+ +… and pretty much anything else. \ No newline at end of file diff --git a/latex-weekend-wise-2023/slides/support.de.md b/latex-weekend-wise-2023/slides/support.de.md new file mode 100644 index 0000000..cde1415 --- /dev/null +++ b/latex-weekend-wise-2023/slides/support.de.md @@ -0,0 +1,103 @@ +@slide(layout=chapter-slide) + +@number +15 + +@title +Hilfe und Informationen + +@slide(layout=content-only) + +@title +[Wikibooks](https://de.wikibooks.org/wiki/LaTeX-Kompendium) + +@content +Das Wikibook zu LaTeX enthält eine große Anzahl interessanter Artikel und ist auch in deutscher Sprache verfügbar. + +![](svg/chapter-16/wikibooks-latex.jpg) + +@slide(layout=content-only) + +@title +[CTAN](https://ctan.org) + +@content +Das »Comprehensive TeX Archive Network« ist die zentrale Quelle für LaTeX-Pakete und ihre Dokumentation. + +![](svg/chapter-16/ctan.jpg) + +@slide(layout=content-only) + +@title +[Overleaf](https://www.overleaf.com) + +@content +Ein Online-LaTeX-Editor, der das kollaboratives Arbeiten an Dokumenten ermöglicht. + +Außerdem findest du auf der Seite verschiedene Tutorials und unter »Templates« LaTeX-Vorlagen für viele Gelegenheiten (Lebenslauf, Abschlussarbeiten, …). + +![](svg/chapter-16/overleaf.jpg) + +@slide(layout=content-only) + +@title +[StackExchange](https://tex.stackexchange.com) + +@content +Frage-Forum zu LaTeX. + +![](svg/chapter-16/stackexchange.jpg) + +@slide(layout=content-only) + +@title +[TeXample](https://www.texample.net) + +@content +Webseite mit zahlreichen LaTeX-Beispielvorlagen, vor allem zu TikZ. + +![](svg/chapter-16/texample.jpg) + +@slide(layout=preview-only) + +@preview +![Klassisch ([Quelle](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/klassisches-beispiel-2.jpeg){.large} + +@slide(layout=preview-only) + +@preview +![Noch klassischer ([Quelle](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/klassischeres-beispiel.jpg) + +@slide(layout=preview-only) + +@preview +![Anders ([Quelle](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/anderes-beispiel.png){.large} + +@slide(layout=content-only) + +@title +[Fachschaft WIAI](https://www.uni-bamberg.de/wiai/fs/) + +@content +Wenn ihr sonst noch Fragen oder Probleme habt, kommt gerne bei uns vorbei oder schreibt uns eine Mail! +

📍WE5/02.104
+☎️0951 863 1219
+📧fachschaft-wiai.stuve@uni-bamberg.de +

+ + +@slide(layout=content-only) + +@title +Kurzes Feedback + +@content +* Was hat euch gut gefallen? +* Was hätten wir besser machen können? +* Was hättet ihr euch gewünscht? + +@slide(layout=preview-only) + +@preview + diff --git a/latex-weekend-wise-2023/slides/support.en.md b/latex-weekend-wise-2023/slides/support.en.md new file mode 100644 index 0000000..32ff2e9 --- /dev/null +++ b/latex-weekend-wise-2023/slides/support.en.md @@ -0,0 +1,104 @@ +@slide(layout=chapter-slide) + +@number +15 + +@title +Getting help and information + +@slide(layout=content-only) + +@title +[Wikibooks](https://en.wikibooks.org/wiki/LaTeX) + +@content +The LaTeX Wikibook offers numerous interesting articles and is available in English and German (among others). + +![](svg/chapter-16/wikibooks-latex_en.jpg) + +@slide(layout=content-only) + +@title +[CTAN](https://ctan.org) + +@content +The “Comprehensive TeX Archive Network” is the central source for LaTeX packages and their documentation. + +![](svg/chapter-16/ctan.jpg) + +@slide(layout=content-only) + +@title +[Overleaf](https://www.overleaf.com) + +@content +Overleaf is a collaborative online LaTeX editor. + +It also offers a multiple tutorials and templates for different occasions (CV, theses, …): »Templates«. + +![](svg/chapter-16/overleaf.jpg) + +@slide(layout=content-only) + +@title +[StackExchange](https://tex.stackexchange.com) + +@content +Question-and-answer website for LaTeX. + +![](svg/chapter-16/stackexchange.jpg) + +@slide(layout=content-only) + +@title +[TeXample](https://www.texample.net) + +@content +A collection of LaTeX examples, especially with TikZ. + +![](svg/chapter-16/texample.jpg) + +@slide(layout=preview-only) + +@preview +![Classic ([source](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/klassisches-beispiel-2.jpeg){.large} + +@slide(layout=preview-only) + +@preview +![More classic ([source](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/klassischeres-beispiel.jpg) + +@slide(layout=preview-only) + +@preview +![Different ([source](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/anderes-beispiel.png){.large} + +@slide(layout=content-only) + +@title +[Fachschaft WIAI](https://www.uni-bamberg.de/wiai/fs/) + +@content +If you have any other questions or problems, just come over or write us an e-mail! +

📍WE5/02.104
+☎️0951 863 1219
+📧fachschaft-wiai.stuve@uni-bamberg.de +

+ + +@slide(layout=content-only) + +@title +A short feedback round + +@content +* What did you like? +* What could we have done better? +* What did you wish for? + +@slide(layout=preview-only) + +@preview + + diff --git a/latex-weekend-wise-2023/slides/tables.de.md b/latex-weekend-wise-2023/slides/tables.de.md new file mode 100644 index 0000000..54b9948 --- /dev/null +++ b/latex-weekend-wise-2023/slides/tables.de.md @@ -0,0 +1,233 @@ +@slide(layout=chapter-slide) + +@number +10 + +@title +Tabellen + + +@slide(layout=content-only) + +@title +Grundstruktur 🗒️ + +@content +Für typografisch schöne Tabellen nutzen wir das Paket `booktabs`. + +``` {.hljs .lang-tex} +\usepackage{booktabs} +``` + +``` {.hljs .lang-tex} +\begin{table}[] + \begin{tabular}{} + % Tabelleninhalt + \end{tabular} + \caption{} +\end{table} +``` + +Die Positionierung erfolgt analog zu Grafiken. + + +@slide(layout=content-and-preview) + +@title +Spaltendefinitionen + +@content +``` {.hljs .lang-tex} +\begin{tabular}{lrcl} + % Tabelleninhalt +\end{tabular} +``` + + + + + + + + + + + + + + + + + + +
KürzelBedeutung
llinksbündige Spalte
czentrierte Spalte
rrechtsbündige Spalte
+ +++ Vertikale Trennlinien und doppelte horizontale Linien sind unter Typograph\*innen nicht gern gesehen und sollten vermieden werden. + +@preview +![](svg/chapter-12/tabelle-beispiel-crop.svg){.thin-padding} + + +@slide(layout=content-and-preview) + +@title +Tabelleninhalt + +@content +``` {.hljs .lang-tex} +\begin{tabular}{lll} + \toprule + Spalte 1 & Spalte 2 & Spalte 3 \\ + \midrule + Inhalt a & Inhalt b & Inhalt c \\ + Inhalt e & Inhalt f & Inhalt g \\ + Inhalt i & Inhalt j & Inhalt k \\ + \bottomrule +\end{tabular} +``` +* ++ Zellen werden durch ›`&`‹ abgetrennt. +* ++ Reihen werden durch ›`\\`‹ beendet. +* ++ `\toprule`, `\midrule` und `\bottomrule` strukturieren die Tabelle. + +@preview +![](svg/chapter-12/tabelle-inhalt-beispiel-crop.svg){.thin-padding} + + +@slide(layout=wide-content) + +@title +Die gesamte Tabelle + +@content +``` {.hljs .lang-tex} +\begin{table}[h] + \begin{tabular}{lrcl} + \toprule + Sprache & Autor & Erscheinungsjahr & Dateiendung \\ + \midrule + C++ & Bjarne Stroustrup & 1985 & .cpp \\ + Java & James Gosling & 1998 & .java \\ + Python & Guido van Rossum & 1991 & .py \\ + \bottomrule + \end{tabular} + \caption{Bekannte Programmiersprachen} +\end{table} +``` + +

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

+ +

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

+ + +@slide(layout=content-only) + +@title +Mehr Komfort + +@content +Der [Tables Generator](https://tablesgenerator.com/) ist ein wunderbares Werkzeug, um schnell Tabellen verschiedener Formate zu erstellen. + +[![](svg/chapter-12/tables-generator.png)](https://tablesgenerator.com/) + + +@slide(layout=task) + +@task-number +10 + +@title +Tabellen setzen + +@content +* Die Liste in der Datei `exercises/tables/tables.tex` enthält Infos zu ein paar Lehrveranstaltung an der Fakultät WIAI. +* Wandelt die Liste in eine **Tabelle** um. +* Die Tabelle soll Spalten für den *Namen*, das *Kürzel* und das *Semester* der Vorlesungen haben. +* Fügt außerdem eine **zentrierte Spalte** ganz links in der Tabelle hinzu, in der ihr die Lehrveranstaltungen **nummeriert**. + + + +@slide(layout=extra-content-only) + +@title +Besonders lange Tabellen + +@content +Tabellen, die über eine Seite hinaus gehen, werden von `tabular` einfach abgeschnitten. Die Lösung bietet hier das Paket `longtable`: + +``` {.hljs .lang-tex} +\usepackage{longtable} +``` + +``` {.hljs .lang-tex} +\begin{longtable}{} + % Tabelleninhalt + \caption{} + \label{
@@ -498,27 +498,27 @@ it look like an actual paragraph. }
-

+

☹ slanted (distorted)

-

+

☺ straight

-

+

☺ italic (separate font)

-

+

☹ small font scaled up

-

+

☺ separate appropriate fonts

-

+

☹ big font scaled down

@@ -571,7 +571,7 @@ it look like an actual paragraph.
- +
@@ -617,7 +617,7 @@ Image source: xkcd
- +
@@ -627,7 +627,7 @@ Image source: xkcd
-How to get the final document +How to get the final document
@@ -729,7 +729,7 @@ Hello world!
- +
@@ -809,7 +809,7 @@ within continuous text.
- +
@@ -833,7 +833,7 @@ Place of birth: Milwaukee, Wisconsin
- +
@@ -854,7 +854,7 @@ instead.

- +
@@ -878,7 +878,7 @@ Always available:

- +
@@ -933,7 +933,7 @@ My favorite recipe
- +
@@ -982,7 +982,7 @@ My favorite recipe
- +
@@ -1089,7 +1089,7 @@ books
- +
@@ -1110,7 +1110,7 @@ contents:

- +
@@ -1163,7 +1163,7 @@ environment, and the table of contents.

- +
@@ -1194,7 +1194,7 @@ environment, and the table of contents.

- +
@@ -1225,7 +1225,7 @@ of section 2.
- +
@@ -1252,7 +1252,7 @@ those from here on.
- +
@@ -1275,7 +1275,7 @@ could also write praeamble.tex here.

- +
@@ -1294,7 +1294,7 @@ could also write praeamble.tex here.

- +
@@ -1306,8 +1306,11 @@ could also write praeamble.tex here.

Specifying file paths 👣

-task.texgraphics.raw.tex (while -task.tex is imported into main-exercises.tex) +basic-functionality.texgraphics.raw.tex +

+

+(basic-functionality.tex is imported into +main-exercises.tex)

./exercises/graphics/graphics.raw.tex
@@ -1319,7 +1322,7 @@ as fragments.
- +
@@ -1408,7 +1411,7 @@ gaps after full stops.
- +
@@ -1479,7 +1482,7 @@ a dash — mostly in American English
- +
@@ -1501,7 +1504,7 @@ Zitat.}
- +
@@ -1576,7 +1579,7 @@ check the results and intervene where needed by

- +
@@ -1646,7 +1649,7 @@ Some of the codes only work when you use the babel package.
- +
@@ -2103,8 +2106,8 @@ underlined
- - + +
@@ -2145,7 +2148,7 @@ command that reproduces URLs

- +
@@ -2191,7 +2194,7 @@ want to have a clean document.
- +
@@ -2217,7 +2220,7 @@ so better avoid it.
- +
@@ -2248,7 +2251,7 @@ for a given paragraph
- +
@@ -2287,7 +2290,7 @@ the same for all kinds of enumerations.

- +
@@ -2311,8 +2314,8 @@ the same for all kinds of enumerations.

- - + +
@@ -2338,7 +2341,7 @@ the same for all kinds of enumerations.

- +
@@ -2385,7 +2388,7 @@ spacing.

- +
@@ -2409,7 +2412,7 @@ integrate enumerations into paragraphs.

- +
@@ -2435,7 +2438,7 @@ integrate enumerations into paragraphs.

- +
@@ -2473,7 +2476,7 @@ signs. We can also use the equation block environment:

- +
@@ -2545,7 +2548,7 @@ if we add an asterisk after their names (e. g.
- +
@@ -2794,7 +2797,7 @@ Don’t use \limits inline.
- +
@@ -3043,7 +3046,7 @@ upon by typographers and should be avoided.

- +
@@ -3072,7 +3075,7 @@ upon by typographers and should be avoided.

- +
@@ -3115,7 +3118,7 @@ the width of the table content

The Tables Generator is a wonderful tool to quickly create tables of different formats.

-

+

@@ -3224,7 +3227,7 @@ landscape orientation:

- +
@@ -3265,7 +3268,7 @@ wiki/Wild_boar}}
- +
@@ -3290,7 +3293,7 @@ As you can see in figure
- +
@@ -3365,7 +3368,7 @@ prefixes.

- +
@@ -3456,7 +3459,7 @@ the \usepackage command.

- +
@@ -3483,7 +3486,7 @@ sec:section3,sec:section5}.
- +
@@ -3581,7 +3584,7 @@ styles.Unknown

-Citing in Alpha style +Citing in Alpha style
@@ -3593,7 +3596,7 @@ styles.Unknown

-Citing in Natdin style +Citing in Natdin style
@@ -3605,7 +3608,7 @@ styles.Unknown

-Finding ready-made BibTeX entries – University of Bamberg Library +Finding ready-made BibTeX entries – University of Bamberg Library
@@ -3618,7 +3621,7 @@ University of Bamberg Library
-Finding ready-made BibTeX entries – Google Scholar +Finding ready-made BibTeX entries – Google Scholar
@@ -3631,7 +3634,7 @@ Google Scholar
-Finding ready-made BibTeX entries – Google Scholar +Finding ready-made BibTeX entries – Google Scholar
@@ -3644,7 +3647,7 @@ Google Scholar
-Finding ready-made BibTeX entries – dblp.org +Finding ready-made BibTeX entries – dblp.org
@@ -3712,7 +3715,7 @@ Squares of all even % …
- +
@@ -3734,7 +3737,7 @@ Squares of all even % …
- +
@@ -3861,7 +3864,7 @@ popular.
- +
@@ -3894,7 +3897,7 @@ themes.

- +
@@ -3937,7 +3940,7 @@ child { node {home}
- +
@@ -3955,7 +3958,7 @@ trees:

- +
@@ -4015,7 +4018,7 @@ package.

- +
@@ -4107,7 +4110,7 @@ Table tuning

The LaTeX Wikibook offers numerous interesting articles and is available in English and German (among others).

-

+

@@ -4121,7 +4124,7 @@ available in English and German (among others).

The “Comprehensive TeX Archive Network” is the central source for LaTeX packages and their documentation.

-

+

@@ -4137,7 +4140,7 @@ LaTeX packages and their documentation.

It also offers a multiple tutorials and templates for different occasions (CV, theses, …): »Templates«.

-

+

@@ -4150,7 +4153,7 @@ occasions (CV, theses, …): StackExchange

Question-and-answer website for LaTeX.

-

+

@@ -4163,7 +4166,7 @@ occasions (CV, theses, …): TeXample

A collection of LaTeX examples, especially with TikZ.

-

+

@@ -4173,7 +4176,7 @@ occasions (CV, theses, …):
-Classic (source) +Classic (source)
@@ -4185,7 +4188,7 @@ occasions (CV, theses, …):
-More classic (source) +More classic (source)
@@ -4197,7 +4200,7 @@ occasions (CV, theses, …):
-Different (source) +Different (source)
@@ -4218,7 +4221,7 @@ an e-mail! ☎️0951 863 1219
📧fachschaft-wiai.stuve@uni-bamberg.de

-

+

@@ -4242,7 +4245,7 @@ an e-mail!
-

+

diff --git a/latex-weekend/slides/basic-document-structure.de.md b/latex-weekend/slides/basic-document-structure.de.md new file mode 100644 index 0000000..736f352 --- /dev/null +++ b/latex-weekend/slides/basic-document-structure.de.md @@ -0,0 +1,412 @@ +@slide(layout=chapter-slide) + +@number +3 + +@title +Grundstruktur eines LATEX-Dokuments + + +@slide(layout=content-and-preview) + +@title +Präambel & Dokumentumgebung + +@content +

👁 Ein mit LaTeX gesetztes Dokument besteht aus:

+ +* **Präambel:** globale Einstellungen (Dokumentklasse, Kodierung, Sprache, Seitenformat, zusäzliche Pakete, …) und +* **Dokumentumgebung:** Inhalt des Dokuments. + +``` {.lang-tex .hljs .fragment} +\documentclass[ngerman]{article} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage[ngerman]{babel} + +\begin{document} +Hallo, Welt! +\end{document} +``` + +@preview +![](svg/chapter-03/hallo-crop.svg) + + +@slide(layout=wide-content) + +@title +Dokumentenklasse + +@content +``` {.lang-tex .hljs} +\documentclass[]{} +``` + +Konkret zum Beispiel + +``` {.lang-tex .hljs} +\documentclass[10pt,a5paper,landscape]{article} +``` + + +@slide(layout=content-only) + +@title +Kodierung + +@content +``` {.lang-tex .hljs} +\usepackage[utf8]{inputenc} +\usepackage[t1]{fontenc} +``` + +* Die Zeichenkodierung bestimmt, welche Zeichen verfügbar sind. +* **ASCII** enthält kaum Sonderzeichen wie deutsche Umlaute. +* **UTF-8** ist eine universelle Kodierung. + + +@slide(layout=content-only) + +@title +Sprache + +@content +``` {.lang-tex .hljs} +\usepackage[ngerman]{babel} +``` + +* Das Paket **`babel`** stellt sprachspezifische Informationen (z. B. Silbentrennung, Sonderzeichen, Wechsel zwischen Fonts, Übersetzung von Labels wie ›Kapitel‹, ›Inhaltsverzeichnis‹ oder ›Abbildung‹) bereit. +* **`ngerman`** steht für die neue deutsche Rechschreibung. + + +@slide(layout=content-and-preview) + +@title +Fließtext + +@content +``` {.lang-tex .hljs} +Fließtext kann direkt in den Quelltext ↲ +geschrieben werden. ↲ +Einfache Zeilenumbrüche ↲ +werden dabei ignoriert, ↲ +genau wie mehrere Leerzeichen. ↲ +↲ +Leerzeilen erzeugen einen neuen Absatz,↲ +standardmäßig mit Einzug. ↲ +Manuelle Zeilenumbrüche können mit ↲ +zwei Backslashes erzwungen werden, ↲ +haben in Fließtext aber eigentlich \\ ↲ +nichts verloren. +``` + +@preview +![](svg/chapter-03/absätze-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Kommentare + +@content +Nach einem Prozentzeichen wird der Rest der Zeile vom Compiler ignoriert. Der Kommentartext erscheint also nicht im fertigen Dokument. + +``` {.lang-tex .hljs} +% Beginn Steckbrief +Name: Donald Knuth \\ +Geburtsdatum: \\ % TODO: einfügen +Geburtsort: Milwaukee, Wisconsin +% Ende Steckbrief +``` + +Tastenkombinationen: Strg + T und Strg + U + +@preview +![](svg/chapter-02/kommentare-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Achtung! + +@title +Reservierte Zeichen + +@content +Bestimmte Zeichen lösen in LaTeX Dinge aus: + +`# $ % ^ & _ { } ~ \` + +``` {.lang-tex .hljs} +50% sind die Hälfte. +``` + +Lösung: »`\`« voranstellen: + +``` {.lang-tex .hljs} +50\% sind die Hälfte. +``` + +Funktioniert nicht mit »`\\`«, nutzt `\textbackslash` stattdessen. + +@preview +![](svg/chapter-03/reservierte-zeichen-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Abschnitte und Kapitel + +@content +Texte werden durch Überschriften in Abschnitte und Kapitel unterteilt. Immer verfügbar: + +``` {.lang-tex .hljs} +\section{Ebene 1} +\subsection{Ebene 2} +\subsubsection{Ebene 3} +\paragraph{Ebene 4} +\subparagraph{Ebene 5} +``` + +Je nach Dokumentenklasse zusätzlich: + +``` {.lang-tex .hljs} +\chapter{Kapitel} +\part{Teil} +``` + +@preview +![](svg/chapter-03/abschnitte-crop.svg) + + +@slide(layout=wide-content) + +@title +Titelei + +@content +``` {.lang-tex .hljs data-source=title.tex} +\title{Die Welt der Trüffel} +\author{Fooboar Rüssel \and Fachschaft WIAI} +\date{\today} +\begin{document} +\maketitle +\end{document} +``` + +* In der Präambel werden die Werte für die Einträge gespeichert. +* Das Setzen des Titels erfolgt in der Dokumentumgebung mit dem Befehl `\maketitle`. +* Die genaue Gestaltung hängt ab von der verwendeten Dokumentklasse. +* Mehrere Autoren werden mit `\and` verbunden. +* Wird kein Datum angegeben, wird per default das aktuelle Datum gesetzt. Ein abweichendes Datum kann mit `\date{}` definiert werden. + + +@slide(layout=content-and-preview) + +@title +Titelei + +@content +``` {.lang-tex .hljs data-source=title.tex} +\documentclass[ngerman]{scrartcl} +\usepackage{babel} +\title{Die Welt der Trüffel} +\author{Fooboar Rüssel \and +Fachschaft WIAI} +\date{\today} +\begin{document} +\maketitle +\section{Trüffelsuche} +\subsection{Suche mit Schwein} +\subsection{Suche ohne Schwein} +Wer macht denn sowas? +\section{Trüffelrezepte} +Mein Lieblingsrezept +\end{document} +``` + +@preview +![](svg/chapter-03/titel-orig.svg) + + +@slide(layout=content-only) + +@title +Verzeichnisse + +@content +``` {.lang-tex .hljs} +\tableofcontents % Inhaltsverzeichnis +\listoffigures % Abbildungsverzeichnis +\listoftables % Tabellenverzeichnis +``` + +* Nummerierung erfolgt automatisch +* Elemente, die nicht im Verzeichnis aufgeführt werden sollen, werden mit einem »`*`« versehen, also z. B. `\section*{}`. +* **am besten zweimal kompilieren** + + +@slide(layout=content-and-preview) + +@title +Inhaltsverzeichnis + +@content +``` {.lang-tex .hljs data-source=title.tex} +\documentclass[ngerman]{scrartcl} +\usepackage{babel} +\begin{document} +\tableofcontents +\section{Trüffelsuche} +Der erste Abschnitt. +\subsection{Suche mit Schwein} +Ein Unterabschnitt. +\subsection{Suche ohne Schwein} +Ein weiterer Unterabschitt. +\subsubsection[But why?] + {Wer macht denn sowas?} +Unter-Unterabschnitt. +\section{Trüffelrezepte} +Mein Lieblingsrezept +\end{document} +``` + +@preview +![](svg/chapter-03/inhalt-crop.svg) + + + +@slide(layout=wide-task) + +@task-number +3 + +@title +Dokument und Text gliedern + +@content +* Öffnet die Datei `document-structure.tex`, die im Ordner `exercises/basic-document-structure` liegt. +* Packt den gesamten Text in der Datei in eine **Document**-Umgebung und schreibt darüber folgende **Präambel**. Kompiliert die Datei. + +``` {.lang-tex .hljs .fragment} +\documentclass{scrartcl} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage[ngerman]{babel} +``` + +* Wie ihr sehen könnt, sind in der Datei die Absätze im Dokument mit `\\` erstellt worden. Ersetzt diese durch richtige Absätze. +* Zeit für etwas Struktur! Verwendet für die **Überschriften** die passenden LaTeX-Befehle (`\section` u. ä.). +* Fügt anschließend ein **Inhaltsverzeichnis** in euer Dokument ein. + + +@slide(layout=extra-wide-content) + +@title +Dokumentenklassen + +@content +* Natürlich gibt es auch andere Dokumentenklassen als `article`. +* Je nachdem, welche Dokumentenklasse man verwendet, ändert sich das Layout der generierten PDF. +* Die korrekt geschriebenen Dokumentenklassen richten sich nach US-amerikanischen Layout-Normen. +* **`src`**-Dokumentenklassen versuchen europäische Normen abzubilden. + +Folgende Dokumentenklassen stehen zur Verfügung: + +* **`scrartcl`, `article`** für kurze Dokumente +* **`scrreprt`, `report`** für lange Dokumente +* **`scrbook`, `book`** für Bücher +* **`beamer`** für Präsentationen + + +@slide(layout=extra-wide-content) + +@title +Sprachen + +@content +Es können auch mehrere Sprachen im Dokument verwendet werden: + +``` {.lang-tex .hljs} +\usepackage[ngerman, swedish, ukrainian, greek, english]{babel} +``` + +Umschalten zwischen Sprachen: + +``` {.lang-tex .hljs} +\selectlanguage{} +\selectlanguage{} +``` + +Eingebetteter Text in anderer Sprache: + +``` {.lang-tex .hljs} +\selectlanguage{} +\foreignlanguage{}{Hier steht Text in Sprache B in einem Text in Sprache A} +``` + + +@slide(layout=extra-content-and-preview) + +@title +Sprachen – ein Beispiel + +@content +``` {.lang-tex .hljs} +\today +\selectlanguage{ngerman} +\today +\selectlanguage{swedish} +\today +\selectlanguage{ukrainian} +\today +\selectlanguage{greek} +\today +\selectlanguage{english} +\today +``` + +@preview +![](svg/chapter-03/languages-crop.svg) + + +@slide(layout=extra-content-and-preview) + +@title +Überschriften und das Inhaltsverzeichnis + +@content +Mit Sternchen fallen bei allen diesen Befehlen die Nummerierung und der Eintrag im Inhaltsverzeichnis weg: + +``` {.lang-tex .hljs} +\section*{Kein Verzeichniseintrag} +``` + +Außerdem kann für das Inhaltsverzeichnis ein alternativer Titel angegeben werden: + +``` {.lang-tex .hljs} +\section[Titel im Verzeichnis] +{Kapitelüberschrift} +``` + +@preview +![](svg/chapter-03/abschnitte-anders-crop.svg) + + +@slide(layout=content-only) + +@title +Bevor wir fortfahren können … + +@content +
+**Kommentiert** zuletzt die Präambel, die Dokumentenumgebung und das Inhaltsverzeichnis **wieder aus**. + +Nur so kann eure Lösung auch ins Skript eingebunden werden (Schnelles Auskommentieren kann in TeXstudio mit dem Shortcut Strg + T erreicht werden). +
+ +Im nächsten Kapitel erklären wir, warum das notwendig ist. \ No newline at end of file diff --git a/latex-weekend/slides/basic-document-structure.en.md b/latex-weekend/slides/basic-document-structure.en.md new file mode 100644 index 0000000..c7ac5d3 --- /dev/null +++ b/latex-weekend/slides/basic-document-structure.en.md @@ -0,0 +1,411 @@ +@slide(layout=chapter-slide) + +@number +3 + +@title +Basic structure of a LATEX document + + +@slide(layout=content-and-preview) + +@title +Preamble & document environment + +@content +

👁 Every LaTeX document is composed of

+ +* a **preamble:** global settings (document class, encoding, language, page format, additional packages, …) and +* a **document environment:** content of the document. + +``` {.lang-tex .hljs .fragment} +\documentclass{article} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{babel} + +\begin{document} +Hello world! +\end{document} +``` + +@preview +![](svg/chapter-03/hello-crop.svg) + + +@slide(layout=wide-content) + +@title +Document class + +@content +``` {.lang-tex .hljs} +\documentclass[]{} +``` + +For example: + +``` {.lang-tex .hljs} +\documentclass[10pt,a5paper,landscape]{article} +``` + + +@slide(layout=content-only) + +@title +Encoding + +@content +``` {.lang-tex .hljs} +\usepackage[utf8]{inputenc} +\usepackage[t1]{fontenc} +``` + +* The character encoding determines which characters are available. +* **ASCII** contains no special characters like German umlauts. +* **UTF-8** is a universal encoding. + + +@slide(layout=content-only) + +@title +Language + +@content +``` {.lang-tex .hljs} +\usepackage[ngerman]{babel} +``` + +* The package **`babel`** provides language-specific information (e. g., hyphenation, special characters, font changes, translated labels like ‘chapter,’ ‘table of contents’ or ‘figure’). +* **`ngerman`** is the German new spelling. + + +@slide(layout=content-and-preview) + +@title +Continuous Text + +@content +``` {.lang-tex .hljs} +Continous text can be written directly ↲ +in the source code. ↲ +Simple line breaks ↲ +are ignored, ↲ +just as multiple space characters. ↲ +↲ +An empty line creates a new paragraph ↲ +which has an indentation by default. ↲ +Manual line breaks can be forced ↲ +using two backslashes, but this use ↲ +is strongly discouraged \\ ↲ +within continuous text. +``` + +@preview +![](svg/chapter-03/paragraphs-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Comments + +@content +After a percent sign, the rest of the line is ignored by the compiler. It is called a comment and does not appear in the resulting document. + +``` {.lang-tex .hljs} +% profile start +Name: Donald Knuth \\ +Date of birth: \\ % TODO: insert +Place of birth: Milwaukee, Wisconsin +% profile end +``` + +Shortcuts: Ctrl + T and Ctrl + U + +@preview +![](svg/chapter-02/comments-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Caution! + +@title +Reserved characters + +@content +Some characters do things in LaTeX: + +`# $ % ^ & _ { } ~ \` + +``` {.lang-tex .hljs} +50% is one half. +``` + +Solution: prefix with ‘`\`’: + +``` {.lang-tex .hljs} +50\% is one half. +``` + +Does not work for ‘`\\`’, use `\textbackslash` instead. + +@preview +![](svg/chapter-03/reserved-characters-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Sections and chapters + +@content +Texts are structured by beeing subdivided in sections and chapters. Always available: + +``` {.lang-tex .hljs} +\section{Level 1} +\subsection{Level 2} +\subsubsection{Level 3} +\paragraph{Level 4} +\subparagraph{Level 5} +``` + +Additionally, for some document classes: + +``` {.lang-tex .hljs} +\chapter{Chapter} +\part{Part} +``` + +@preview +![](svg/chapter-03/sections-crop.svg) + + +@slide(layout=wide-content) + +@title +Front matter + +@content +``` {.lang-tex .hljs data-source=title.tex} +\title{The World of Truffles} +\author{Fooboar Rüssel \and Fachschaft WIAI} +\date{\today} +\begin{document} +\maketitle +\end{document} +``` + +* The values for the entries are stored in the preamble. +* `\maketitle` typesets the front matter within the document environment. +* The exact appearance depends on the document class. +* Multiple authors can be joined with `\and`. +* If no date is given, the current date will be used. A different date can be defined with `\date{}`. + + +@slide(layout=content-and-preview) + +@title +Front matter + +@content +``` {.lang-tex .hljs data-source=title.tex} +\documentclass{article} +\usepackage{babel} +\title{The World of Truffles} +\author{Fooboar Rüssel +\and Fachschaft WIAI} +\date{\today} +\begin{document} +\maketitle +\section{Truffle hunt} +\subsection{Hunt with a pig} +\subsection{Hunt without a pig} +Why would you do that? +\section{Truffle recipes} +My favorite recipe +\end{document} +``` + +@preview +![](svg/chapter-03/title-orig.svg) + + +@slide(layout=content-only) + +@title +Registers + +@content +``` {.lang-tex .hljs} +\tableofcontents +\listoffigures +\listoftables +``` + +* automatic numbering +* elements with an asterisk (`*`) are hidden from the register: e. g. `\section*{}`. +* **generally requires two rounds of compilation** + + +@slide(layout=content-and-preview) + +@title +Table of contents + +@content +``` {.lang-tex .hljs data-source=title.tex} +\documentclass{article} +\usepackage{babel} +\begin{document} +\tableofcontents +\section{Truffle hunt} +The first section. +\subsection{Hunt with a pig} +A subsection. +\subsection{Hunt without a pig} +Another subsection. +\subsubsection[But why?] + {Why would you do that?} +Sub-subsection. +\section{Truffle recipes} +My favorite recipe +\end{document} +``` + +@preview +![](svg/chapter-03/contents-crop.svg) + + +@slide(layout=wide-task) + +@task-number +3 + +@title +Structure your document and text + +@content +* Open the file `document-structure.tex`. It is located in the directory `exercises/basic-document-structure`. +* Wrap the entire text in a **document** environment and insert the following **preamble**. Compile the document. + +``` {.lang-tex .hljs .fragment} +\documentclass{scrartcl} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage[english]{babel} +``` + +* As you may already have noticed, **paragraphs** are marked as ‘`\\`’. Use real paragraphs instead. +* Time to structure our document! Use LaTex commands to declare all **headings** (`\section`, `\subsubsection`, etc.). +* Add a **table of contents** to your document. + + +@slide(layout=extra-wide-content) + +@title +Document classes + +@content +* There are also other document classes than `article`. +* Based on the document class, the layout of the generated pdf file changes. +* Normally speled classes adhere to American English layout norms. +* **`src`** document classes usually adhere to European layout norms. + +Following document classes are available: + +* **`scrartcl`, `article`** for short documents +* **`scrreprt`, `report`** for longer documents +* **`scrbook`, `book`** for books +* **`beamer`** for presentations + + +@slide(layout=extra-wide-content) + +@title +Languages + +@content +A document can use multiple languages at once: + +``` {.lang-tex .hljs} +\usepackage[ngerman, swedish, ukrainian, greek, english]{babel} +``` + +To switch languages: + +``` {.lang-tex .hljs} +\selectlanguage{} +\selectlanguage{} +``` + +Embedded Text in another language: + +``` {.lang-tex .hljs} +\selectlanguage{} +\foreignlanguage{}{Text of language B in a Text of language A} +``` + + +@slide(layout=extra-content-and-preview) + +@title +Languages — an example + +@content +``` {.lang-tex .hljs} +\today +\selectlanguage{ngerman} +\today +\selectlanguage{swedish} +\today +\selectlanguage{ukrainian} +\today +\selectlanguage{greek} +\today +\selectlanguage{english} +\today +``` + +@preview +![](svg/chapter-03/languages-crop.svg) + + +@slide(layout=extra-content-and-preview) + +@title +Headlines and the table of contents + +@content +With an asterisk, there is no numbering and no entry in the table of contents: + +``` {.lang-tex .hljs} +\section*{No entry in table of contents} +``` + +You can also provide an alternative title for the table of contents: + +``` {.lang-tex .hljs} +\section[Entry in table of contents] +{Actual chapter heading} +``` + +@preview +![](svg/chapter-03/sections-differently-crop.svg) + + +@slide(layout=content-only) + +@title +Before we can continue … + +@content +
+Finally, **comment out** the preamble, the document environment, and the table of contents. + +Only this way, your solution can be embedded in the script itself. (In TeXstudio, comments can be achieved by the shortcut Strg + T.) +
+ +We will learn in the following chapter why this is the case. \ No newline at end of file diff --git a/latex-weekend/slides/basic-functionality.de.md b/latex-weekend/slides/basic-functionality.de.md new file mode 100644 index 0000000..c6f7320 --- /dev/null +++ b/latex-weekend/slides/basic-functionality.de.md @@ -0,0 +1,91 @@ +@slide(layout=chapter-slide) + +@number +2 + +@title +Wie funktioniert LATEX? + + +@slide(layout=content-and-preview) + +@title +WYSIWaaas? + +@content +### What You See Is What You Get {data-category=Word} + +* Formatierung mit unmittelbarem optischen Feedback + +
+### What You See Is What You Mean {data-category=LaTeX} + +* Trennung von Inhalt und Struktur +* Formatierung erst am Ende ersichtlich +
+ +

+ Bildquelle: xkcd +

+ +@preview +![](svg/chapter-02/xkcd-types-of-editors.png) + + +@slide(layout=preview-only) + +@preview +![Der Weg zum fertigen Dokument](svg/chapter-02/wysiwyg.svg){} + + +@slide(layout=two-columns) + +@title +Was brauchen wir dazu? + +@column-one +### Editor +zum Schreiben unseres Quelltextes mit allen Befehlen zur semantischen Gliederung + +[TeXstudio](http://www.texstudio.org/), [TeXMaker](https://www.xm1math.net/texmaker/) + +@column-two +### Compiler +erstellt aus dem Quelltext ein fertig formatiertes PDF-Dokument + +[MiKTeX](http://miktex.org/), [MacTeX](http://tug.org/mactex/), [TeX Live](https://tug.org/texlive/) + + +@slide(layout=wide-content) + +@title +Befehle + +@content +Allgemeiner Aufbau eine Befehls: + +``` {.hljs .lang-txt} +\[]{} +``` + +++ Ein paar Beispiele: + +``` {.lang-tex .tex .hljs .fragment} +\newpage % fügt eine neue Seite ein +\textbf{fetter Text} % schreibt den übergebenen Text fett +\documentclass[10pt,a5paper,landscape]{article} % konfiguriert die Dokumentenklasse +\frac{1}{4} % fügt den mathematischen Bruch ein +``` + + +@slide(layout=content-only) + +@title +Backslash + +@content +Den Backslash erzeugt ihr mit folgender Tastenkombination: + +AltGr + ß (Windows/Linux) + +Alt + Shift + 7 (MacOS) diff --git a/latex-weekend/slides/basic-functionality.en.md b/latex-weekend/slides/basic-functionality.en.md new file mode 100644 index 0000000..0cf5521 --- /dev/null +++ b/latex-weekend/slides/basic-functionality.en.md @@ -0,0 +1,93 @@ +@slide(layout=chapter-slide) + +@number +2 + +@title +How does
LATEX work? + + +@slide(layout=content-and-preview) + +@title +WYSIWhat? + +@content +### What You See Is What You Get {data-category=Word} + +* Formatting with immediate visual feedback + +
+### What You See Is What You Mean {data-category=LaTeX} + +* Separation of content and structure +* Formatting only visible afterwards +
+ +

+ Image source: xkcd +

+ +@preview +![](svg/chapter-02/xkcd-types-of-editors.png) + + +@slide(layout=preview-only) + +@preview +![How to get the final document](svg/chapter-02/wysiwyg.svg){} + + +@slide(layout=two-columns) + +@title +What do we need? + +@column-one +### Editor +writing our source code including all the commands that structure the text semantically + +[TeXstudio](http://www.texstudio.org/), [TeXMaker](https://www.xm1math.net/texmaker/) + +@column-two +### Compiler +takes the source code and creates a PDF document ready for publication + +[MiKTeX](http://miktex.org/), [MacTeX](http://tug.org/mactex/), [TeX Live](https://tug.org/texlive/) + + +@slide(layout=wide-content) + +@title +Commands + +@content +General structure of a command: + +``` {.hljs .lang-txt} +\[]{} +``` + +++ A few examples: + +``` {.lang-tex .tex .hljs .fragment} +\newpage % inserts a new page +\textbf{bold text} % formats the text bold +\documentclass[a4paper,12pt, landscape]{article} % configures the document class +\frac{1}{4} % inserts a mathematical fraction +``` + + +@slide(layout=content-only) + +@title +Backslash + +@content +You get the backslash by pressing + +AltGr + ß (Windows/Linux) + +Alt + Shift + 7 (MacOS) + + diff --git a/latex-weekend/slides/graphics.de.md b/latex-weekend/slides/graphics.de.md new file mode 100644 index 0000000..c261788 --- /dev/null +++ b/latex-weekend/slides/graphics.de.md @@ -0,0 +1,113 @@ +@slide(layout=chapter-slide) + +@number +9 + +@title +Grafiken + + +@slide(layout=content-only) + +@title +Grafiken abbilden 🖼️ + +@content +Um Grafiken darzustellen, muss das Paket `graphicx` eingebunden werden. + +``` {.lang-tex .hljs} +\begin{figure} + \includegraphics{} + \caption[]{} +\end{figure} +``` + +Bildgröße angeben: + +``` {.lang-tex .hljs} +\includegraphics[width=0.5\textwidth, +height=5cm]{} +``` + + +@slide(layout=content-only) + +@title +Positionierung auf der Seite + +@content + +``` {.lang-tex .hljs} +\begin{figure}[] +``` + +LaTeX positioniert Grafiken automatisch. Durch Kürzel können wir unsere Präferenzen (auch in Kombination) angeben. + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KürzelPosition
hhier, wenn es dir recht ist
toberer Seitenrand (top)
bunterer Seitenrand (bottom)
pauf einer eigenen Seite (page)
HHier, verdammt noch mal!
(benötigt Paket `float`)
+ + +@slide(layout=content-only) + +@title +Zentrierte Anordnung + +@content +``` {.lang-tex .hljs} +\begin{figure}[] + \begin{center} + \includegraphics{} + \end{center} +\end{figure} +``` + +Alternativ: + +``` {.lang-tex .hljs} +\begin{figure}[] + \centering + \includegraphics{} +\end{figure} +``` + + +@slide(layout=task) + +@task-number +9 + +@title +Grafiken einfügen + +@content +* Im Ordner `exercises/graphics` findet ihr eine Bilddatei namens `latex-logo.png`. +* Fügt sie **genau** unterhalb dieser Aufgabenstellung im Skript ein. +* Das Bild soll **zentriert** auf der Seite eingebunden werden. +* Fügt außerdem eine **Bildunterschrift** ein. +* Passt die **Größe** des Bildes an Breite der Seite (`\textwidth`) an. diff --git a/latex-weekend/slides/graphics.en.md b/latex-weekend/slides/graphics.en.md new file mode 100644 index 0000000..155d4f2 --- /dev/null +++ b/latex-weekend/slides/graphics.en.md @@ -0,0 +1,113 @@ +@slide(layout=chapter-slide) + +@number +9 + +@title +Graphics + + +@slide(layout=content-only) + +@title +Including graphics 🖼️ + +@content +To display graphics, we need the `graphicx` package. + +``` {.lang-tex .hljs} +\begin{figure} + \includegraphics{} + \caption[]{} +\end{figure} +``` + +Specifying the size: + +``` {.lang-tex .hljs} +\includegraphics[width=0.5\textwidth, +height=5cm]{} +``` + + +@slide(layout=content-only) + +@title +Layout on the page + +@content + +``` {.lang-tex .hljs} +\begin{figure}[] +``` + +LaTeX places graphics automatically. With position codes, we can express our preferences (they can be combined as well). + + + + + + + + + + + + + + + + + + + + + + + + + + + +
codeposition
hhere, if you don’t mind
ttop of the page
bbottom of the page
pon its own page
HHere, for God’s sake!
(`float` package required)
+ + +@slide(layout=content-only) + +@title +Centred alignment + +@content +``` {.lang-tex .hljs} +\begin{figure}[] + \begin{center} + \includegraphics{} + \end{center} +\end{figure} +``` + +Alternatively: + +``` {.lang-tex .hljs} +\begin{figure}[] + \centering + \includegraphics{} +\end{figure} +``` + + +@slide(layout=task) + +@task-number +9 + +@title +Inserting graphics + +@content +* In the directory `exercises/graphics` you can find an image file named `latex-logo.png`. +* **Include** the figure in `exercises/graphics/graphics.tex` and place it **exactly** where you include it. +* The image shall be **centered**. +* Additionally, add a **caption** for the figure. +* Adapt the **width** of the image to the width of the text (`\textwidth`). diff --git a/latex-weekend/slides/intro.de.md b/latex-weekend/slides/intro.de.md new file mode 100644 index 0000000..72f677b --- /dev/null +++ b/latex-weekend/slides/intro.de.md @@ -0,0 +1,67 @@ +@slide(layout=chapter-slide) + +@number +0 + +@title +Erste Schritte mit LATEX + +@content +Um das Skript für das Tutorium kompilieren zu können, müssen zunächst ein paar Konfigurationgen gemacht werden, die in den nächsten Folien erklärt werden. + +@slide(layout=content-only) + +@title +Exkurs: Eine Kommandozeile öffnen + +@content +* Für die kommenden Aufgaben brauchen wir eine Kommandozeile +* Je nach Betriebssystem, das verwendet wird, gibt es unteschiedliche Wege, sie zu öffnen +* **Windows**: Drückt die Windows-Taste, tippt *cmd* und drückt Enter +* **MacOS**: Drückt die *Command*-Taste und die Leertaste gleichzeitig, tippt danach *Terminal* und macht einen Doppelklick auf *Terminal* +* **Linux**: Drückt ``Strg + Alt + T`` + +@slide(layout=content-only) + +@title +Den Compiler installieren + +@content +* Der Compiler übersetzt unseren LaTeX-Code in ein PDF +* Je nach Betriebssystem stehen unterschiedliche Compiler zur Verfügung: +* Windows: MikTEX +* Linux-Distributionen: TEXLive + * Debian-basierte Distros: Führt `sudo apt install texlive-full` aus + * Andere Distributionen: Folgt den anweisungen auf der TEXLive-Website + +
+Bitte achtet darauf, die full version mit allen Paketen zu installieren, wenn ihr die Auswahl habt! +
+ +@slide(layout=content-only) + +@title +Installieren des Editors + +@content +* Ein Editor kann heruntergeladen werden, sobald die Installation des Compilers fertig ist +* Es funktioniert jeglicher Text-Editor, wie etwa Notepad++ oder VSCode +* Für Anfänger:innen empfehlen wir jedoch TEXstudio, da es LaTeX-spezifische Features bietet +* Ladet TEXstudio herunter und installiert es + + + +@slide(layout=content-only) +@title +Kompilieren des Skriptes + +@content +* Ladet das Projektarchiv aus dem VC herunter +* Entpackt das Archiv +* Öffnet die Datei main-exercises.tex in TeXstudio. Ihr findet es im Wurzelverzeichnis des Archivs +* Kompiliert die Datei, indem ihr klickt +* Einige neue Dateien sollten nun durch das Kompilieren generiert werden + +
+Windows-Nutzer:innen: Um Dateiendungen zu aktivieren, klickt auf das Ansichts-Tab im Dateiexplorer und wählt *Dateiendungen*. So könnt ihr besser zwischen den einzelnen main-Files unterscheiden. +
diff --git a/latex-weekend/slides/intro.en.md b/latex-weekend/slides/intro.en.md new file mode 100644 index 0000000..fa418c5 --- /dev/null +++ b/latex-weekend/slides/intro.en.md @@ -0,0 +1,67 @@ +@slide(layout=chapter-slide) + +@number +0 + +@title +First steps with LATEX + +@content +In order to compile the script for this tutorial, a few steps have to be followed, which are explained in the next slides. + +@slide(layout=content-only) + +@title +Digression: Opening a command prompt + +@content +* For the following tasks, we are going to need a command prompt +* It can be opened in different ways, depending on your operating system + + * **Windows**: Press the Windows key and type in *cmd*, press Enter + * **MacOS**: Press the *Command* key and the *space bar* simultaneously, then type in *Terminal* and double click on *Terminal* + * **Linux**: Press ``Ctrl + Alt + T`` + +@slide(layout=content-only) + +@title +Installing the compiler + +@content +* The compiler translates our LATEX code into a PDF +* Depending on your operating system, different compilers are available +* Windows: MikTEX +* macOS: MacTEX +* Linux distributions: TEXLive + * Debian-based distributions: run `sudo apt install texlive-full` + * other distributions: see the TEXLive website + +
+Make sure to install the full version with all packages, if you can! +
+ +@slide(layout=content-only) + +@title +Installing the editor + +@content +* An editor can downloaded once the compiler has been installed +* For editing LaTeX documents, any text editor works fine, e.g., Notepad++, VSCode +* For beginners, TEXstudio is recommended due to its LaTeX-specific features +* Download and install TEXstudio + +@slide(layout=content-only) +@title +Compile the script for the first time + +@content +* Download the project archive from the VC. +* Unzip the archive. +* Open the file `main-exercises.tex` in TEXstudio. It is located in the root directory of the archive. +* Compile `main-exercises.tex` by pressing +* A few new files will be generated by the compilation. + +
+Windows users: In order to enable file endings, click the view tab in the file explorer, and select *file name extensions*. This helps differentiating the different ``main`` files. +
diff --git a/latex-weekend/slides/lists.de.md b/latex-weekend/slides/lists.de.md new file mode 100644 index 0000000..e94c732 --- /dev/null +++ b/latex-weekend/slides/lists.de.md @@ -0,0 +1,164 @@ +@slide(layout=chapter-slide) + +@number +7 + +@title +Aufzählungen + +@slide(layout=content-and-preview) + +@title +Ungeordnete Listen 📜 + +@content +``` {.lang-tex .hljs} +\begin{itemize} + \item Nudelplatten + \item Passierte Tomaten, % … + \item Oregano, Basilikum, % … + \item Mozzarella + \item Mehl + \item Milch +\end{itemize} +``` + +Die einzelnen Stichpunkte werden in jeder Aufzählungsumgebung durch den Befehl `\item` gekennzeichnet. + +@preview +![](svg/chapter-08/itemize-crop.svg) + +@slide(layout=content-and-preview) + +@title +Geordnete Listen und Definitionslisten + +@content +``` {.lang-tex .hljs} +\begin{enumerate} + \item die Zwiebeln in einem Topf % … + \item passierte Tomaten, Möhren % … + \item mit Kräutern und Gewürzen % … + % \item … +\end{enumerate} +``` + +``` {.lang-tex .hljs .fragment} +\begin{description} + \item [Béchamelsauce] Béchamel % … + \item [Lasagne] Als Lasagne % … +\end{description} +``` + +@preview + + + +@slide(layout=content-and-preview) + +@title +Verschachtelte Listen + +@content +``` {.lang-tex .hljs} +\begin{itemize} + % … + \item Gemüse \begin{itemize} + \item Passierte Tomaten + \item Möhren + \end{itemize} + \item Kräuter \begin{enumerate} + \item Oregano + \item Basilikum + \end{enumerate} + % … +\end{itemize} +``` + +@preview +![](svg/chapter-08/nested-lists-crop.svg) + +@slide(layout=task) + +@task-number +7 + +@title +Aufzählungen einfügen + +@content +* Formatiert das Rezept in `lists.tex` im Ordner `exercises/lists` als **ungeordnete Liste** mit den Elementen *Ingredients* und *Instructions*. Nutzt dafür den Befehl `\itemize`. +* Benutzt innerhalb dieser Liste für die Zutaten eine **ungeordnete Liste** und für die Arbeitsschritte eine **geordnete Liste**. + + +@slide(layout=extra-content-and-preview) + +@title +Kompakte Listen + +@content +Das Paket `paralist` stellt Aufzählungen ohne riesige Zwischenräume zur Verfügung. + +``` {.lang-tex .hljs} +\section{Zutaten} +\begin{compactitem} + % \item … +\end{compactitem} +\section{Zubereitung} +\begin{compactenum} + % \item … +\end{compactenum} +\section{Glossar} +\begin{compactdesc} + % \item … +\end{compactdesc} +``` + +@preview +![](svg/chapter-08/compact-crop.svg) + +@slide(layout=extra-content-and-preview) + +@title +Aufzählungen im Absatz + +@content +Neben den kompakten Listen stellt `paralist` auch Listen zur Verfügung, die in einem Absatz stehen. + +``` {.lang-tex .hljs} +Folgende Kräuter sind für % … +\begin{inparaitem} + \item Liebstöckel + \item Petersilie + \item Schnittlauch +\end{inparaitem} +``` + +Natürlich gibt es auch hier ein Pendant namens `inparaenum` für geordnete Listen. + +@preview + + + +@slide(layout=extra-content-and-preview) + +@title +Aufzählungsarten + +@content +Die Art der Aufzählung lässt sich über den optionalen Parameter `label` ändern. Hierfür ist das Paket `enumitem` notwendig. + +``` {.lang-tex .hljs} +% Römische Zahlen +\begin{enumerate}[label=\roman*] +% … +% Arabische Zahlen +\begin{enumerate}[label=\arabic*] +% … +% Alphabetisch +\begin{enumerate}[label=\alph*] +% … +``` + +@preview +![](svg/chapter-08/list-style-types-crop.svg) \ No newline at end of file diff --git a/latex-weekend/slides/lists.en.md b/latex-weekend/slides/lists.en.md new file mode 100644 index 0000000..90d4f87 --- /dev/null +++ b/latex-weekend/slides/lists.en.md @@ -0,0 +1,167 @@ +@slide(layout=chapter-slide) + +@number +7 + +@title +Enumerations + +@slide(layout=content-and-preview) + +@title +Unordered lists 📜 + +@content +``` {.lang-tex .hljs} +\begin{itemize} + \item lasagna noodles + \item crushed tomatoes, % … + \item oregano, basil, % … + \item mozzarella cheese + \item flour + \item milk +\end{itemize} +``` + +We mark each bullet point with `\item`. +This pattern is the same for all kinds of enumerations. + +@preview +![](svg/chapter-08/itemize-english-crop.svg) + +@slide(layout=content-and-preview) + +@title +Ordered and definition lists + +@content +``` {.lang-tex .hljs} +\begin{enumerate} + \item cook onions over medium % … + \item add crushed tomatoes, carrots % … + \item add herbs and spices % … + % \item … +\end{enumerate} +``` + +``` {.lang-tex .hljs .fragment} +\begin{description} + \item [Béchamel sauce] Béchamel % … + \item [Lasagne] Lasagne (singular % … +\end{description} +``` + +@preview + + + +@slide(layout=content-and-preview) + +@title +Nested lists + +@content +``` {.lang-tex .hljs} +\begin{itemize} + % … + \item vegetables \begin{itemize} + \item crushed tomatoes + \item carrots + \end{itemize} + \item herbs \begin{enumerate} + \item oregano + \item basil + \end{enumerate} + % … +\end{itemize} +``` + +@preview +![](svg/chapter-08/nested-lists-english-crop.svg) + + +@slide(layout=task) + +@task-number +7 + +@title +Adding enumerations + +@content +* Turn the recipe in `lists.tex` into an **unordered list** consisting of the elements *Ingredients* and *Instructions*. You can find the file in the directory `exercises/lists`. Use the `itemize` command. +* Within this list, create a **unordered list** for the ingredients and a **ordered list** for the instructions. + + +@slide(layout=extra-content-and-preview) + +@title +Compact lists + +@content +The package `paralist` offers enumerations with less line spacing. + +``` {.lang-tex .hljs} +\section{Ingredients} +\begin{compactitem} + % \item … +\end{compactitem} +\section{Preparation} +\begin{compactenum} + % \item … +\end{compactenum} +\section{Glossary} +\begin{compactdesc} + % \item … +\end{compactdesc} +``` + +@preview +![](svg/chapter-08/compact-english-crop.svg) + +@slide(layout=extra-content-and-preview) + +@title +In-line enumerations + +@content +Another feature provided by `paralist` enables us to integrate enumerations into paragraphs. + +``` {.lang-tex .hljs} +The following herbs are % … +\begin{inparaitem} + \item lovage + \item parsley + \item chives +\end{inparaitem} +``` + +Of course, there is an accompanying list type called `inparaenum` for ordered lists. + +@preview + + + +@slide(layout=extra-content-and-preview) + +@title +List styles + +@content +The list style type can be set using the optional parameter `label`. +To accomplish this, we need to include the package `enumitem` first. + +``` {.lang-tex .hljs} +% Roman numerals +\begin{enumerate}[label=\roman*] +% … +% Arabic numerals +\begin{enumerate}[label=\arabic*] +% … +% Alphabetical +\begin{enumerate}[label=\alph*] +% … +``` + +@preview +![](svg/chapter-08/list-style-types-english-crop.svg) \ No newline at end of file diff --git a/latex-weekend/slides/literature.de.md b/latex-weekend/slides/literature.de.md new file mode 100644 index 0000000..5c3689d --- /dev/null +++ b/latex-weekend/slides/literature.de.md @@ -0,0 +1,114 @@ +@slide(layout=chapter-slide) + +@number +12 + +@title +Literatur­verwaltung + + +@slide(layout=content-only) + +@title +Was brauchen wir dafür? + +@content +* eine **Bibliographiedatei** (nachfolgend `.bib`-Datei) zur Speicherung von Literaturverweisen +* **BibTeX** als Schnittstelle zwischen der Literatur und LaTeX + + +@slide(layout=wide-content) + +@title +Was ist diese ominöse `.bib`-Datei? + +@content +* Sammlung von Literatureinträgen im BibTeX-Format +* Beispielhafter Literatureintrag: + +``` {.hljs .lang-tex} +@article{turing1990, % Art des Dokuments und Bezeichner für den \cite Befehl + title={The chemical basis of morphogenesis}, % Titel + 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 +} +``` + + +@slide(layout=content-only) + +@title +Wie wird das verwendet? + +@content +Durch BibTeX wird LaTeX um einige Befehle zum Zitieren erweitert. Außerdem benötigt wird das Paket `natbib`. + +* ++ Zitieren eines Autors: `\citeauthor{}` +* ++ Zitieren einer Quelle: `\cite{}` +* ++ Zitieren einer Seite: `\cite[S. 15]{}` +* ++ Zitieren mit weiteren Zusätzen:
`\cite[][]{}` +* ++ Verweis auf die genutzte `.bib`-Datei: `\bibliography{<.bib-datei>}` +* ++ Angabe des genutzten Zitierstils:
`\bibliographystyle{}` + +> Zwei Dinge sind unendlich. Das Universum und die Auswahl an Zitierstilen.Unbekannt + + +@slide(layout=preview-only) + +@preview +![Zitieren im Alpha-Zitierstil](svg/chapter-14/bibtex-alpha-crop.svg){.large .thin-padding} + + +@slide(layout=preview-only) + +@preview +![Zitieren im Natdin-Zitierstil](svg/chapter-14/bibtex-natdin-crop.svg){.large .thin-padding} + + +@slide(layout=preview-only) + +@preview +![Finden von fertigen BibTeX-Einträgen – Bamberger Katalog](svg/chapter-14/bamberger_katalog_bibtex.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finden von fertigen BibTeX-Einträgen – Google Scholar](svg/chapter-14/google_bibtex1.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finden von fertigen BibTeX-Einträgen – Google Scholar](svg/chapter-14/google_bibtex2.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finden von fertigen BibTeX-Einträgen – dblp.org](svg/chapter-14/dblp.jpg){.large} + + +@slide(layout=wide-task) + +@task-number +12 + +@title +Ein Literaturverzeichnis erstellen und einfügen + +@content +* Erstellt im Ordner `exercises/literature` eine neue BibTeX-Datei `literature.bib`. +* Sucht bei Google Scholar oder dblp.org die BibTeX-Einträge für folgende $\LaTeX$-Handbücher: + * Dilip Datta (2017): $\LaTeX$ in 24 Hours. A Practical Guide for Scientific Writing. + * Frank Mittelbach / Michel Goossens (2012): Der $\LaTeX$-Begleiter. +* Fügt die BibTeX-Einträge in die BibTeX-Datei ein. +* Vergebt aussagekräftige BibTeX-Keys. +* Bindet die BibTeX-Datei an einer geeigneten Stelle ein, an der später auch das Literaturverzeichnis zu sehen sein soll. +* Zitiert die zwei Handbücher im Text in der Datei `exercises/literature/literature.tex`. +* Wählt den Bibliographiestil `plain`. + diff --git a/latex-weekend/slides/literature.en.md b/latex-weekend/slides/literature.en.md new file mode 100644 index 0000000..79325df --- /dev/null +++ b/latex-weekend/slides/literature.en.md @@ -0,0 +1,114 @@ +@slide(layout=chapter-slide) + +@number +12 + +@title +Reference management + + +@slide(layout=content-only) + +@title +What do we need? + +@content +* a **bibliography file** (hereafter `.bib` file) for storing references +* **BibTeX** as an interface between the references and LaTeX + + +@slide(layout=wide-content) + +@title +What is this mysterious `.bib` file? + +@content +* collection of references in BibTeX format +* example: + +``` {.hljs .lang-tex} +@article{turing1990, % the type of the document and an identifier for the \cite command + title={The chemical basis of morphogenesis}, % information + author={Turing, Alan Mathison}, % about + journal={Bulletin of mathematical biology}, % the + volume={52}, % literature + pages={153--197}, % work + year={1990}, % follows + publisher={Springer} % … +} +``` + + +@slide(layout=content-only) + +@title +How is it used? + +@content +BibTeX adds some citation commands to LaTeX. In addition, we need the `natbib` package. + +* ++ Citing an author: `\citeauthor{}` +* ++ Citing a source: `\cite{}` +* ++ Citing a page: `\cite[p. 15]{}` +* ++ Citing with additional text:
`\cite[][]{}` +* ++ Referencing the `.bib` file: `\bibliography{<.bib file>}` +* ++ Choosing a citation style:
`\bibliographystyle{}` + +> Two things are infinite: the universe and the assortment of citation styles.Unknown + + +@slide(layout=preview-only) + +@preview +![Citing in Alpha style](svg/chapter-14/bibtex-alpha-example-crop.svg){.large .thin-padding} + + +@slide(layout=preview-only) + +@preview +![Citing in Natdin style](svg/chapter-14/bibtex-natdin-example-crop.svg){.large .thin-padding} + + +@slide(layout=preview-only) + +@preview +![Finding ready-made BibTeX entries – University of Bamberg Library](svg/chapter-14/bamberg_catalogue_bibtex.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finding ready-made BibTeX entries – Google Scholar](svg/chapter-14/google_bibtex1.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finding ready-made BibTeX entries – Google Scholar](svg/chapter-14/google_bibtex2.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finding ready-made BibTeX entries – dblp.org](svg/chapter-14/dblp.jpg){.large} + + +@slide(layout=wide-task) + +@task-number +12 + +@title + +Creating and inserting references + +@content +* Create a new BibTeX file called `literature.bib` in the `exercises/literature` folder. +* Use Google Scholar or dblp.org to retrieve BibTeX references for the following $\LaTeX$ handbooks: + * Dilip Datta (2017): $\LaTeX$ in 24 Hours. A Practical Guide for Scientific Writing. + * Frank Mittelbach / Michel Goossens (2012): Der $\LaTeX$-Begleiter. +* Add the BibTeX entries to the BibTeX file. +* Assign unique and meaningful BibTeX keys. +* Include the BibTeX file in a suitable location, where later on the references should be listed. +* Cite the two handbooks in the file `exercises/literature/literature.tex`. +* Make use of the `plain` bibliography style. diff --git a/latex-weekend/slides/maths.de.md b/latex-weekend/slides/maths.de.md new file mode 100644 index 0000000..43f00eb --- /dev/null +++ b/latex-weekend/slides/maths.de.md @@ -0,0 +1,228 @@ +@slide(layout=chapter-slide) + +@number +8 + +@title +Mathematische Formeln + +@slide(layout=content-and-preview) + +@title +Formel-Umgebungen 🧮 + +@content +``` {.lang-tex .hljs} +$2 \sqrt{\frac{\pi^2}{3} \cdot c_2}$ +``` + +Mathematische Formeln können **nur im sogenannten Mathmode** gesetzt werden, der inline durch zwei Dollarzeichen aktiviert wird. Außerdem gibt es eine Blockumgebung: + +``` {.lang-tex .hljs} +\begin{equation} + 2 \sqrt{\frac{\pi^2}{3} \cdot c_2} +\end{equation} +``` + +Pakete: `amsmath`, `amsthm`, `amssymb`, `mathtools` + +@preview +![](svg/chapter-09/simple-maths-crop.svg) + +@slide(layout=content-only) + +@title +Einige Beispiele + +@content + + + + + + + + + + + + + + + + + +
QuelltextErgebnis
`\sum_{i=1}^{n}x^2`$\sum_{i=1}^{n} x^2$
`12 \leq 4 x^2 + 13`$12 \leq 4 x^2 + 13$
`{n \choose k}`${n \choose k}$
+ + +@slide(layout=content-and-preview) + +@title +Ausrichtung von mehreren Gleichungen + +@content +Die Umgebung `align` erlaubt es, Gleichungen zum Beispiel am › = ‹ auszurichten. + +``` {.lang-tex .hljs} +\begin{align} + 13 \cdot (4a - 3)^2 &= 13 … \\ + &= 208a^2 - 312a + 117 +\end{align} +``` + +* ++ Ausgerichtet wird am ›`&`‹-Zeichen. +* ++ Zeilenumbrüche werden mit ›`\\`‹ markiert. +* ++ Die Nummerierung kann bei `align` und `equation` durch durch ein Sternchen nach dem Umgebungsnamen (z. B. `\begin{align*}` und `\end{align*}`) unterdrückt werden. + +@preview +![](svg/chapter-09/alignment-crop.svg) + + +@slide(layout=task-without-number) + +@task-number +8a + +@title +Formeln setzen + +@content +Setzt die folgenden Formeln in der Datei `exercises/maths/math-formulas.tex`. + +| Bedeutung | Ergebnis | +|-----------|----------| +| Fallbeschleunigung (Deutschland) | $9,81\,\frac{m}{s^2}$ | +| pq-Formel | $x_{1,2} = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}$ | +| Mitternachtsformel | $x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ | +| Catalansche Zahlen | $C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!}$ | + +@slide(layout=task-without-number) + +@task-number +8b + +@title +Formeln setzen + +@content +Setzt die folgenden Formeln in der Datei `exercises/maths/math-formulas.tex`. + +| Bedeutung | Ergebnis | +|-----------|----------| +| Definition der Fakultät | $n! = \prod_{i=1}^{n} i$ | +| Menge aller ungeraden natürlichen Zahlen | $\{ x \mid x \in \mathbb{N}, \text{ungerade}(x) \}$ | +| Elimination $\neg\exists x$ | $\neg\exists x . p(x) \Leftrightarrow \forall x . \neg p(x)$ | + + + +@slide(layout=extra-content-only) + +@title +Weitere Beispiele + +@content + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QuelltextErgebnis
`(x)`, `[x]`, `\lbrace x \rbrace`, `\lvert x \rvert`$(x), [x], \lbrace x\rbrace, \lvert x\rvert$
`\exists`, `\forall`, `\in`,
`\notin`, `\infty`
$\exists,\forall,\in,\notin,\infty$
`\alpha`, `\beta`, `\Gamma`,
`\Delta`, `\varepsilon`, `\pi`
$\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi$
`\rightarrow`, `\leftarrow`, `\Rightarrow`, `\Leftarrow`, `\Leftrightarrow`$\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow$
`(A \cup B) \cap C`$(A \cup B) \cap C$
`(A \lor B) \land C`$(A \lor B) \land C$
`(A \cdot B) \times C`$(A \cdot B) \times C$
+ +@slide(layout=extra-content-only) + +@title +Mitwachsende Klammern + +@content + + + + + + + + + + + + + + + + + +
QuelltextErgebnis
`\left( \frac{1}{2} \right)`$\left( \frac{1}{2} \right)$
`\left[ \frac{1}{2} \right]`$\left[ \frac{1}{2} \right]$
`\left\lbrace \frac{1}{2} \right\rbrace`$\left\lbrace \frac{1}{2} \right\rbrace$
+ + +``` {.lang-tex .hljs} +$4 \cdot \left( \frac{1}{2} % … +``` + +

$4 \cdot \left(\frac{1}{2} +\frac{3}{ 12 \cdot \left( 2 + \frac{1}{86 \cdot \left(\frac{1}{2} + 24 \right)} \right)} \right)$

+ + +@slide(layout=extra-content-and-preview) + +@title +Darstellung von Grenzen + +@content +Mit dem Befehl `\limits` lassen sich die Grenzen von Integralen unter und über dem Integralzeichen darstellen. Bei Summen, Produkten und Grenzwerten geschieht das automatisch. + +``` {.lang-tex .hljs} +\sum_{i=1}^{n^2}(x+2) +\prod_{j=1}^{100}(3 \cdot x) +\lim_{x \rightarrow \infty}(14x^3 - 12) +\int\limits_{-12}^{4}(14x^3 - 12) +``` + +

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

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

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

+

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

+ +``` {.lang-tex .hljs} +$\left\lbrace x \mid \text{tiefe}(x) … +``` \ No newline at end of file diff --git a/latex-weekend/slides/maths.en.md b/latex-weekend/slides/maths.en.md new file mode 100644 index 0000000..c8734ce --- /dev/null +++ b/latex-weekend/slides/maths.en.md @@ -0,0 +1,233 @@ +@slide(layout=chapter-slide) + +@number +8 + +@title +Typesetting mathematics + +@slide(layout=content-and-preview) + +@title +Formula environments 🧮 + +@content +``` {.lang-tex .hljs} +$2 \sqrt{\frac{\pi^2}{3} \cdot c_2}$ +``` + +Mathematical formulas are only accepted in the so-called **math mode.** +In-line formulas must therefor be guarded by two dollar signs. +We can also use the `equation` block environment: + +``` {.lang-tex .hljs} +\begin{equation} + 2 \sqrt{\frac{\pi^2}{3} \cdot c_2} +\end{equation} +``` + +Packages: `amsmath`, `amsthm`, `amssymb`, `mathtools` + +@preview +![](svg/chapter-09/simple-maths-crop.svg) + +@slide(layout=content-only) + +@title +Examples + +@content + + + + + + + + + + + + + + + + + +
source coderesult
`\sum_{i=1}^{n}x^2`$\sum_{i=1}^{n} x^2$
`12 \leq 4 x^2 + 13`$12 \leq 4 x^2 + 13$
`{n \choose k}`${n \choose k}$
+ + +@slide(layout=content-and-preview) + +@title +Aligning a group of equations + +@content +The `align` environment permits us to align equations at certain positions like the ‘ = ’ character. + +``` {.lang-tex .hljs} +\begin{align} + 13 \cdot (4a - 3)^2 &= 13 … \\ + &= 208a^2 - 312a + 117 +\end{align} +``` + +* ++ The equations will be aligned with respect to the ampersands (‘`&`’). +* ++ We can mark a new line using ‘`\\`’. +* ++ `align` and `equation` will not be numbered if we add an asterisk after their names (e. g. `\begin{align*}` and `\end{align*}`). + +@preview +![](svg/chapter-09/alignment-crop.svg) + + +@slide(layout=task-without-number) + +@task-number +8a + +@title +Typesetting mathematics + +@content +Code up the following formulas in the file `exercises/maths/math-formulas.tex`. + +| Meaning | Result | +|---------|--------| +| Gravitational acceleration | $9,81\,\frac{m}{s^2}$ | +| Formula to solve quadratic equations | $x_{1,2} = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}$ | +| Another formula to solve quadratic equations | $x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ | +| Catalan numbers | $C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!}$ | + + +@slide(layout=task-without-number) + +@task-number +8b + +@title +Typesetting mathematics + +@content +Code up the following formulas in the file `exercises/maths/math-formulas.tex`. + +| Meaning | Result | +|---------|--------| +| Definition of factorial | $n! = \prod_{i=1}^{n} i$ | +| Set of all odd natural numbers | $\{ x \mid x \in \mathbb{N}, \text{odd}(x) \}$ | +| Elimination $\neg\exists x$ | $\neg\exists x . p(x) \Leftrightarrow \forall x . \neg p(x)$ | + + + +@slide(layout=extra-content-only) + +@title +More examples + +@content + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
source coderesult
`(x)`, `[x]`, `\lbrace x \rbrace`, `\lvert x \rvert`$(x), [x], \lbrace x\rbrace, \lvert x\rvert$
`\exists`, `\forall`, `\in`,
`\notin`, `\infty`
$\exists,\forall,\in,\notin,\infty$
`\alpha`, `\beta`, `\Gamma`,
`\Delta`, `\varepsilon`, `\pi`
$\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi$
`\rightarrow`, `\leftarrow`, `\Rightarrow`, `\Leftarrow`, `\Leftrightarrow`$\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow$
`(A \cup B) \cap C`$(A \cup B) \cap C$
`(A \lor B) \land C`$(A \lor B) \land C$
`(A \cdot B) \times C`$(A \cdot B) \times C$
+ +@slide(layout=extra-content-only) + +@title +Height-adapting braces + +@content + + + + + + + + + + + + + + + + + +
source coderesult
`\left( \frac{1}{2} \right)`$\left( \frac{1}{2} \right)$
`\left[ \frac{1}{2} \right]`$\left[ \frac{1}{2} \right]$
`\left\lbrace \frac{1}{2} \right\rbrace`$\left\lbrace \frac{1}{2} \right\rbrace$
+ + +``` {.lang-tex .hljs} +$4 \cdot \left( \frac{1}{2} % … +``` + +

$4 \cdot \left(\frac{1}{2} +\frac{3}{ 12 \cdot \left( 2 + \frac{1}{86 \cdot \left(\frac{1}{2} + 24 \right)} \right)} \right)$

+ + +@slide(layout=extra-content-and-preview) + +@title +Depicting boundaries + +@content +The bounds of an integral can be enforced to appear above and below the integral symbol using the `\limits` command. +This is the standard behaviour for sums, products and limits. + +``` {.lang-tex .hljs} +\sum_{i=1}^{n^2}(x+2) +\prod_{j=1}^{100}(3 \cdot x) +\lim_{x \rightarrow \infty}(14x^3 - 12) +\int\limits_{-12}^{4}(14x^3 - 12) +``` + +

Don't use `\limits` inline.

+ + +@preview +![](svg/chapter-09/limits-crop.svg) + + +@slide(layout=extra-content-only) + +@title +Set-builder notation + +@content +In certain situations, it is more adequate to use textual predicates or long function names within the set builder notation. + +This is where `\text{}` comes into play. + +

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

+

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

+ +``` {.lang-tex .hljs .fragment} +$\left\lbrace x \mid \text{frequency} … +``` \ No newline at end of file diff --git a/latex-weekend/slides/packages.de.md b/latex-weekend/slides/packages.de.md new file mode 100644 index 0000000..959fc1e --- /dev/null +++ b/latex-weekend/slides/packages.de.md @@ -0,0 +1,214 @@ +@slide(layout=chapter-slide) + +@number +14 + +@title +Paket in Sicht! + +@slide(layout=content-and-preview) + +@title +Stichwortverzeichnis anlegen + +@content +```{.lang-tex .hljs} +\usepackage{makeidx} +\makeindex +\begin{document} +\maketitle +\section{Was ist LaTeX\index{LaTeX}?} +LaTeX\index{LaTeX} ist ein +Textsatzsystem\index{Textsatzsystem}. +\newpage \section{TeX\index{TeX} vs. +LaTeX\index{LaTeX}} Es basiert auf +TeX\index{TeX}, einer Erfindung von +Donald Knuth\index{Knuth, Donald}. +Da TeX\index{TeX} in seiner Syntax sehr +viel komplexer als LaTeX\index{LaTeX} +ist, ist LaTeX\index{LaTeX} wesentlich +weiter verbreitet. +\printindex +``` + +@preview +![](svg/chapter-15/index.png) + +@slide(layout=content-and-preview) + +@title +Präsentationen gestalten + +@content +Für Präsentationen gibt es die Dokumentenklasse `beamer` sowie zahlreiche [Vorlagen und Themes](https://www.overleaf.com/learn/latex/Beamer). + +```{.lang-tex .hljs .small-text} +\documentclass{beamer} +\usetheme{Frankfurt} +\usecolortheme{seahorse} +\usepackage[utf8]{inputenc} + +\begin{document} +\begin{frame} + \frametitle{Zitronensorbet} + \framesubtitle{Inkarnation des Guten?} + \begin{definition} + Ein Zitronensorbet ist eine + halbgefrorene \textbf{Speiseeiscreme} + auf Basis von \textit{Zitronen}. + \end{definition} +\end{frame} +\end{document} +``` + +@preview + + + +@slide(layout=content-and-preview) + +@title +Grafiken erstellen + +@content +`TikZ` (»TikZ ist kein Zeichenprogramm«) ist ein umfangreiches Paket zur Erstellung von Vektorgrafiken. + +```{.lang-tex .hljs .small-text .scroll-one-half} +% … +\tikzstyle{every node}=[draw=black,thick,anchor=west] +\tikzstyle{selected}=[draw=red,fill=red!30] +\tikzstyle{dir}=[fill=gray!50] +\tikzstyle{relativeTo}=[fill=blue!70] +\begin{tikzpicture}[% +grow via +three points={one child at (0.5,-0.7) and +two children at +(0.5,-0.7) and (0.5,-1.4)}, +edge from +parent path={(\tikzparentnode.south) + |- (\tikzchildnode.west)}] +\node {/ oder C:} +child { node {home} + child { node {knut} + child { node {pictures}} + child { node {docs} + child { node [dir] {latex} + child { node [relativeTo] {main.tex} + child { node [selected] {part1.tex} + } + } + } +}; +\end{tikzpicture} +``` + +@preview +![](svg/chapter-04/relative-path-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Linguistik + +@content +Mit dem Paket `qtree` lassen sich Konstituentenbäume erstellen: + +```{.lang-tex .hljs} +\Tree [.S [.NP LaTeX ] +[.VP [.V is ] [.NP fun ] ] ] +``` + +@preview +![](svg/chapter-15/constituency-tree-crop.svg) + +@slide(layout=content-and-preview) + +@title +Mathematische Beweisführung + +@content +Beweisbäume lassen sich mit dem Paket `prftree` einwandfrei darstellen. + +```{.hljs .lang-tex .small-text .scroll-one-half} +\begin{displaymath} +\prftree[l,r]{}{[comp$\_{ns}$]} +{ + \prftree[l,r]{}{[comp$\_{ns}$]} + { + \prftree[l,r]{}{[ass$\_{ns}$]} + { + - + } + { + (\texttt{m:=a}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{48,\bot} + } + } + { + \prftree[l,r]{}{[ass$\_{ns}$]} + { + - + } + { + (\texttt{n:=b}, \sigma\_{48,\bot}) + \rightarrow \sigma\_{48,18} + } + } + { + (\texttt{m:=a; n:=b}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{48,18} + } +} +{ + \prftree[l,r]{}{} + { + \dots + } + { + \textbf{[1]}\ (\texttt{LOOP}, \sigma\_{48,18}) + \rightarrow \sigma\_{6,6} + } +} +{ + (\texttt{m:=a; n:=b; LOOP}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{6,6} +} +\end{displaymath} +``` + +@preview + + +@slide(layout=content-only) + +@title +Weitere nützliche Pakete + +@content + + + + + + + + + + + + + + + + + + + + + + + + + +
PaketAnwendung
xcolorMach’s mit Farbe
todonotesToDo-Markierungen und Liste der ToDos
pdfpagesEinbinden von PDF-Dateien
subcaptionVerschachtelte Abbildungen und ausgefeilte Bildunterschriften
colortbl, tabularx, multirow, makecellGestalten von Tabellen
diff --git a/latex-weekend/slides/packages.en.md b/latex-weekend/slides/packages.en.md new file mode 100644 index 0000000..859519b --- /dev/null +++ b/latex-weekend/slides/packages.en.md @@ -0,0 +1,215 @@ +@slide(layout=chapter-slide) + +@number +14 + +@title +Package in sight! + +@slide(layout=content-and-preview) + +@title +Creating an index + +@content +```{.lang-tex .hljs} +\usepackage{makeidx} +\makeindex +\begin{document} +\maketitle +\section{What is LaTeX\index{LaTeX}?} +LaTeX\index{LaTeX} is a typesetting +system\index{Typesetting system}. +\newpage \section{TeX\index{TeX} vs. +LaTeX\index{LaTeX}} It is based on +TeX\index{TeX}, an invention by +Donald Knuth\index{Knuth, Donald}. +As TeX\index{TeX} is way more complex +syntactically than LaTeX\index{LaTeX}, +LaTeX\index{LaTeX} is much more +popular. +\printindex +``` + +@preview +![](svg/chapter-15/index_en-crop.svg) + +@slide(layout=content-and-preview) + +@title +Designing presentation slides + +@content +For slides, there is the `beamer` document class, as well as numerous [templates and themes](https://www.overleaf.com/learn/latex/Beamer). + +```{.lang-tex .hljs .small-text} +\documentclass{beamer} +\usetheme{Frankfurt} +\usecolortheme{seahorse} +\usepackage[utf8]{inputenc} + +\begin{document} +\begin{frame} + \frametitle{Lemon sorbet} + \framesubtitle{Incarnation of good?} + \begin{definition} + A lemon sorbet is a + semi-frozen \textbf{dessert} + on \textit{lemon} base. + \end{definition} +\end{frame} +\end{document} +``` + +@preview + + + +@slide(layout=content-and-preview) + +@title +Drawing images + +@content +`TikZ` (“TikZ ist kein Zeichenprogramm” — “TikZ is no drawing software”) is a powerful package for drawing vector graphics. + +```{.lang-tex .hljs .small-text .scroll-one-half} +% … +\tikzstyle{every node}=[draw=black,thick,anchor=west] +\tikzstyle{selected}=[draw=red,fill=red!30] +\tikzstyle{dir}=[fill=gray!50] +\tikzstyle{relativeTo}=[fill=blue!70] +\begin{tikzpicture}[% +grow via +three points={one child at (0.5,-0.7) and +two children at +(0.5,-0.7) and (0.5,-1.4)}, +edge from +parent path={(\tikzparentnode.south) + |- (\tikzchildnode.west)}] +\node {/ or C:} +child { node {home} + child { node {knut} + child { node {pictures}} + child { node {docs} + child { node [dir] {latex} + child { node [relativeTo] {main.tex} + child { node [selected] {part1.tex} + } + } + } +}; +\end{tikzpicture} +``` + +@preview +![](svg/chapter-04/relative-path-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Linguistics + +@content +The `qtree` package can render constituent-based parse trees: + +```{.lang-tex .hljs} +\Tree [.S [.NP LaTeX ] +[.VP [.V is ] [.NP fun ] ] ] +``` + +@preview +![](svg/chapter-15/constituency-tree-crop.svg) + +@slide(layout=content-and-preview) + +@title +Mathematical proofs + +@content +Logical tableaux can be renderd using the `prftree` package. + +```{.hljs .lang-tex .small-text .scroll-one-half} +\begin{displaymath} +\prftree[l,r]{}{[comp$\_{ns}$]} +{ + \prftree[l,r]{}{[comp$\_{ns}$]} + { + \prftree[l,r]{}{[ass$\_{ns}$]} + { + - + } + { + (\texttt{m:=a}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{48,\bot} + } + } + { + \prftree[l,r]{}{[ass$\_{ns}$]} + { + - + } + { + (\texttt{n:=b}, \sigma\_{48,\bot}) + \rightarrow \sigma\_{48,18} + } + } + { + (\texttt{m:=a; n:=b}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{48,18} + } +} +{ + \prftree[l,r]{}{} + { + \dots + } + { + \textbf{[1]}\ (\texttt{LOOP}, \sigma\_{48,18}) + \rightarrow \sigma\_{6,6} + } +} +{ + (\texttt{m:=a; n:=b; LOOP}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{6,6} +} +\end{displaymath} +``` + +@preview + + +@slide(layout=content-only) + +@title +Other useful packages + +@content + + + + + + + + + + + + + + + + + + + + + + + + + +
PackageUse case
xcolorcolours
todonotestodo annotations and index
pdfpagesembedding PDF files
subcaptionNested figures and fine-tuned captions
colortbl, tabularx, multirow, makecellTable tuning
+ diff --git a/latex-weekend/slides/project-structure.de.md b/latex-weekend/slides/project-structure.de.md new file mode 100644 index 0000000..ea81b7f --- /dev/null +++ b/latex-weekend/slides/project-structure.de.md @@ -0,0 +1,196 @@ +@slide(layout=chapter-slide) + +@number +4 + +@title +Projektstruktur + + +@slide(layout=content-and-preview) + +@title +Zielsetzung + +@content +Ein größeres LaTeX-Projekt anlegen und dabei … + +* verhindern, dass LaTeX-Dokumente zu monströser Größe anwachsen 👹 +* den Überblick über die Struktur eines Projekts behalten + +@preview +![](svg/chapter-04/langes-dokument.jpg){style="padding: .2em; height: 100vh"} + + +@slide(layout=content-and-preview) + +@title +Hauptdatei 👑 + +@content +* enthält Grundgerüst, Titel, Inhaltsverzeichnis etc. +* bindet einzelne Kapitel ein mit \ + `\input{pfad/zur/datei}` + +``` {.lang-tex .hljs data-sourcefile=main.tex} +\documentclass{article} +\usepackage[ngerman]{babel} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\title{Ein Titel} +\begin{document} + \maketitle + \tableofcontents + \input{abschnitt1.tex} + \input{abschnitt2.tex} +\end{document} +``` + +@preview +![](svg/chapter-04/hauptdatei-orig.svg) + + +@slide(layout=content-and-preview) + +@title +Datei mit Teilabschnitt + +@content +* enthält **keine Präambel** +* enthält **kein** `\begin{document}` und `\end{document}` + +``` {.hljs .lang-tex data-sourcefile=part1.tex} +\section{Dies ist Abschnitt 1} +Hier ein Absatz zum +Inhalt von Abschnitt 1. + +% … +``` + +``` {.hljs .lang-tex data-sourcefile=part2.tex} +\section{Dies ist Abschnitt 2} +Hier ein Absatz zum +Inhalt von Abschnitt 2. + +% … +``` + +@preview +![](svg/chapter-04/hauptdatei-teile-crop.svg){.thin-padding} + + +@slide(layout=content-and-preview-with-category) + +@category +Exkurs + +@title +Dateipfade angeben 👣 + +@content +* wichtig für `\input{}` sowie später für das Einbinden von Bildern und anderen Medien +* Datei- und Ordnerstruktur = Baumstruktur 🌳 +* bei `\input{}` kann der Pfad zu einer Unterdatei relativ zur Hauptdatei angeben werden + +

Bei LaTeX muss stets die **Unix-Syntax** für Pfadangaben verwendet werden. Pfadelemente werden durch einen Schrägstrich getrennt: `pfad/zur/datei`. Deshalb werden wir im Folgenden diese Schreibweise verwenden.

+ +@preview +![](svg/chapter-04/tree-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Exkurs + +@title +Dateipfade angeben 👣 + +@content +

`main-exercises.tex` → `praeamble.tex`

+ +
+`./praeamle.tex` + +Der **einfache Punkt »`.`«** bezieht sich bei relativen Pfaden auf den aktuellen Ordner (hier: `latex-skript`). Er ist optional, es könnte also auch nur `praeamble.tex` geschrieben werden. +
+ +@preview +![](svg/chapter-04/relative-path-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Exkurs + +@title +Dateipfade angeben 👣 + +@content +

`main-exercises.tex` → `basic-document-structure.tex` (in einem Unterordner)

+ +
+`./content/basic-document-structure.tex` +
+ +@preview +![](svg/chapter-04/relative-path-subdir-crop.svg) + + + +@slide(layout=content-and-preview-with-category) + +@category +Exkurs + +@title +Dateipfade angeben 👣 + +@content +

`basic-functionality.tex` → `graphics.raw.tex`

+

(wenn `basic-functionality.tex` von `main-exercises.tex` importiert wird)

+ +
+
./exercises/graphics/graphics.raw.tex
+

Pfade sind immer relativ zum Wurzelelement, auch wenn dieses noch andere Dateien einbindet, die wiederum andere Dateien referenzieren.

+
+ +@preview +![](svg/chapter-04/relative-path-transitive-crop.svg) + + + +@slide(layout=content-only-with-category) + +@category +Demo + +@title +Kompilieren des Projekts + +@content +* **Nur die Hauptdatei** wird kompiliert, um das fertige PDF-Dokument zu erhalten. +* ++ Fehlermeldungen enthalten dann Verweis, in welcher Unterdatei sie aufgetreten sind. +* ++ Die Unterdateien können wegen ihrer fehlenden Präambel nicht selbstständig kompiliert werden. + +
+Von nun an kompilieren wir die Datei `main-exercises.tex` im Wurzelverzeichnis des Projektordners. Klickt hierzu in TeXstudio mit der rechten Maustaste auf die Datei und wählt **„Explizit als Root-Dokument setzen“**. Anschließend könnt ihr wie gewohnt kompilieren. +
+ + +@slide(layout=task) + +@task-number +4 + +@title +Ein strukturiertes Projekt + +@content +Im Ordner `exercises/project-structure` findet ihr eine Datei namens `main.tex`. + +* Erstellt neue Dateien (z. B. `section1.tex` und `section2.tex` und verschiebt die Abschnitte in diese. +* Importiert die Fragmente anschließend mit Hilfe des `\input`-Befehls. +* Lagert die Präambel auf demselben Weg in eine eigene Datei aus. +* Schaut euch abschließend die Gesamtstruktur unseres Projektarchivs an, beginnend mit `main-exercises.tex` im Wurzelverzeichnis. Wie binden wir hier die einzelnen Abschnitte ein? \ No newline at end of file diff --git a/latex-weekend/slides/project-structure.en.md b/latex-weekend/slides/project-structure.en.md new file mode 100644 index 0000000..990f1ed --- /dev/null +++ b/latex-weekend/slides/project-structure.en.md @@ -0,0 +1,195 @@ +@slide(layout=chapter-slide) + +@number +4 + +@title +Project structure + +@slide(layout=content-and-preview) + +@title +Goal + +@content +Create a bigger LaTeX project and … + +* prevent LaTeX documents from growing monstrously 👹 +* keep the overview over the project structure + +@preview +![](svg/chapter-04/langes-dokument.jpg){style="padding: .2em; height: 100vh"} + + +@slide(layout=content-and-preview) + +@title +Main file 👑 + +@content +* contains basic structure +* includes separate sections with \ + `\input{path/to/file}` + +``` {.lang-tex .hljs data-sourcefile=main.tex} +\documentclass{article} +\usepackage{babel} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\title{A Title} +\begin{document} + \maketitle + \tableofcontents + \input{section1.tex} + \input{section2.tex} +\end{document} +``` + +@preview +![](svg/chapter-04/main-orig.svg) + + +@slide(layout=content-and-preview) + +@title +File with a section + +@content +* contains **no preamble** +* contains **no** `\begin{document}` or `\end{document}` + +``` {.hljs .lang-tex data-sourcefile=part1.tex} +\section{This is section 1} +A paragraph about the content +of section 1. + +% … +``` + +``` {.hljs .lang-tex data-sourcefile=part2.tex} +\section{This is section 2} +A paragraph about the content +of section 2. + +% … +``` + +@preview +![](svg/chapter-04/main-parts-crop.svg){.thin-padding} + + +@slide(layout=content-and-preview-with-category) + +@category +Excursion + +@title +Specifying file paths 👣 + +@content +* important for `\input{}`, but later also for other media types +* file and folder structure = tree structure 🌳 +* with `\input{}`, you can specify the path relative to the main file + +

In **LaTeX,** you have to use UNIX-style paths. They are separated by a forward slash: `path/to/file`. We will use those from here on.

+ +@preview +![](svg/chapter-04/tree-english-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Excursion + +@title +Specifying file paths 👣 + +@content +

`main-exercises.tex` → `praeamble.tex`

+ +
+`./praeamble.tex` + +A **single dot ‘`.`’** represents the current folder (in this case: `latex-skript`). It is optional, you could also write `praeamble.tex` here. +
+ +@preview +![](svg/chapter-04/relative-path-english-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Excursion + +@title +Specifying file paths 👣 + +@content +

`main-exercises.tex` → `basic-document-structure.tex` (in a subfolder)

+ +
./content/basic-document-structure.tex
+ +@preview +![](svg/chapter-04/relative-path-subdir-english-crop.svg) + + + +@slide(layout=content-and-preview-with-category) + +@category +Excursion + +@title +Specifying file paths 👣 + +@content +

`basic-functionality.tex` → `graphics.raw.tex`

+

(`basic-functionality.tex` is imported into `main-exercises.tex`)

+ +
+
./exercises/graphics/graphics.raw.tex
+

Paths are always relative to the root document that imports other files as fragments.

+
+ +@preview +![](svg/chapter-04/relative-path-transitive-english-crop.svg) + + + +@slide(layout=content-only-with-category) + +@category +Demo + +@title +Compiling the project + +@content +* **Only the main file** has to be compiled to get the complete PDF document. +* ++ Error messages include a reference to the corresponding subfile. +* ++ Subfiles cannot be compiled on their own as they don’t have a preamble. + +
+From now on, we will compile the file `main-exercises.tex` in the project root. +To do so, right click on the file in TeXstudio and choose **“Select as explicit root document”** from the dropdown. +Next, compile as usual. +
+ + +@slide(layout=task) + +@task-number +4 + +@title +A structured project + +@content +You will find a file named `main.tex` in the folder `exercises/project-structure`. + +* Put the sections of the file into separate files, named `section1.tex` and `section2.tex`. +* Include them using the `\input` command. +* Move the preamble to its own file in a similar fashion. +* Finally, have a look at the general project archive, starting from `main-exercises.tex` (in the root folder of the project archive). How do we include the different sections here? \ No newline at end of file diff --git a/latex-weekend/slides/references-and-footnotes.de.md b/latex-weekend/slides/references-and-footnotes.de.md new file mode 100644 index 0000000..cb6f1ca --- /dev/null +++ b/latex-weekend/slides/references-and-footnotes.de.md @@ -0,0 +1,211 @@ +@slide(layout=chapter-slide) + +@number +11 + +@title +Referenzen und Fußnoten + + +@slide(layout=content-and-preview) + +@title +Fußnoten 📎 + +@content +``` {.hljs .lang-tex} +\usepackage{hyperref} +``` + +Die Nummerierung erfolgt automatisch und ist fortlaufend, unabhängig davon, ob ein neuer Abschnitt beginnt. + +``` {.hljs .lang-tex} +Eber, beim Hausschwein insbesondere +oberdeutsch Saubär, beim Wildschwein +Keiler, bezeichnet das männliche +Geschlecht des Schweins. +\footnote{\url{https://de.wikipedia.org/ +wiki/Eber}} +``` + +@preview +![](svg/chapter-13/fußnotenbeispiel-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Querverweise + +@content +Manuell (Just don’t!) + +``` {.hljs .lang-tex} +Wie man in Abbildung 23 sieht, … +``` + +Mit dem Befehl `\ref`: + +``` {.hljs .lang-tex} +\begin{figure}[H] + \includegraphics % … + \caption{Unser Maskottchen Fooboar} + \label{img:fooboar} +\end{figure} + +Wie man in Abbildung \ref{img:fooboar} … +``` + +@preview +![](svg/chapter-13/ref-beispiel-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Referenzen + +@content +Mit dem Paket `cleveref` (mit *einem* ›r‹!): + +``` {.hljs .lang-tex} +\begin{figure}[H] + \includegraphics % … + \caption{Unser Maskottchen Fooboar} + \label{img:fooboar} +\end{figure} + +Fooboar ist ein sehr engagierter +Jungeber (siehe \Cref{img:fooboar}). +``` + +Der Befehl `\cref` fügt selbstständig die passende Abkürzung ein. + +@preview +![](svg/chapter-13/cref-beispiel-crop.svg) + + +@slide(layout=content-only) + +@title +Label vergeben + +@content +Beide Referenzierungsbefehle funktionieren mit **Abschnitten, Bildern, Tabellen, Listings und Gleichungen,** sofern die richtigen Label vergeben wurden. + +Label müssen **eindeutig** sein. Zur Strukturierung ist das Voranstellen von Kürzeln üblich, denn einige Pakete ziehen aus den Kürzeln Informationen. + + + + + + + + + + + + + + + + + + +
`fig:` Abbildungen`tbl:` Tabellen
`sec:` Abschnitte`subsec:` Unter­abschnitte
`ch:` Kapitel`itm:` Aufzählungs­elemente
`eq:` Gleichungen`lst:` Quelltext­listings
+ + +@slide(layout=content-only) + +@title +Dinge, die zu beachten sind + +@content +* ++ Durch `\cref` eingefügte Passagen tauchen in einigen Dokumentklassen erst dann auf Deutsch auf, wenn bereits in der Dokumentklasse die Sprache festgelegt wurde: + + ``` {.hljs .lang-tex} + \documentclass[ngerman]{article} + ``` + +* ++ Beschriftungen (`\caption{…}`) müssen, von Abschnitten abgesehen, **immer und vor dem Label** vergeben werden. + +* ++ Bei Abschnitten wird das Label direkt hinter dem Befehl angefügt. + + ``` {.hljs .lang-tex} + \section{Hinweise}\label{sec:hinweise} + ``` + + +@slide(layout=task) + +@task-number +11a + +@title +Fußnoten einfügen + +@content +* Pack den Text *March 2023* in der Datei `exercises/footnotes/footnotes.tex` in eine **Fußnote**. +* Fügt zusätzlich eine **klickbare URL**, die zur Download-Seite des Java Development Kit führt (`https://www.oracle.com/java/technologies/javase-downloads.html`), als Fußnote ein. + + + +@slide(layout=task) + +@task-number +11b + +@title +Referenzen einfügen + +@content +* Ersetzt im Text in der Datei `references.tex` im Ordner `exercises/references` *In the figure* und *The following source code listing* durch eine **Referenz** auf das Bild bzw. auf das Quelltext-Listing. +* Nutzt dafür den Befehl `\Cref`. +* Achtet darauf, zuerst **Labels** für die Elemente, die ihr referenzieren wollt, zu vergeben. +* Bei **Quelltext-Listings** funktioniert die Angabe von Labels und Captions leicht anders. Nutzt euer bisheriges Wissen und das Internet, um herauszufinden, wie ihr den Befehl `\lstinputlisting` anpassen müsst, um beides zu vergeben. + + +@slide(layout=extra-content-and-preview) + +@title +Konfiguration von Fußnoten + +@content +Das Paket `footmisc` stellt verschiedene weitere Optionen für die Darstellung von Fußnoten zur Verfügung, die als optionale Parameter an den Befehl `\usepackage` übergeben werden können. + +``` {.hljs .lang-tex} +% Zählung auf jeder Seite neu beginnen: +\usepackage[perpage]{footmisc} + +% Fußnoten inline anzeigen lassen: +\usepackage[para]{footmisc} + +% Symbole statt Nummerierung verwenden: +\usepackage[symbol]{footmisc} +``` + +@preview +![](svg/chapter-13/footmisc-de-crop.svg){.thin-padding} + + +@slide(layout=extra-content-and-preview) + +@title +Weiterführend + +@content +* Wurde vor dem Paket `cleveref` das Paket `hyperref` eingebunden, entsteht ein **klickbarer Link** im fertigen PDF. +* Mehrere Referenzen können in `\cref` kommagetrennt angegeben werden. + +``` {.hljs .lang-tex} +\section{Ein Einstieg} +\label{sec:section1} +% … +Hier sei verwiesen auf +\cref{sec:section1,sec:section2, +sec:section3,sec:section5}. +``` + +@preview +![](svg/chapter-13/cref-multiple-beispiel-crop.svg) + diff --git a/latex-weekend/slides/references-and-footnotes.en.md b/latex-weekend/slides/references-and-footnotes.en.md new file mode 100644 index 0000000..187c634 --- /dev/null +++ b/latex-weekend/slides/references-and-footnotes.en.md @@ -0,0 +1,213 @@ +@slide(layout=chapter-slide) + +@number +11 + +@title +References and footnotes + + +@slide(layout=content-and-preview) + +@title +Footnotes 📎 + +@content +``` {.hljs .lang-tex} +\usepackage{hyperref} +``` + +Footnotes are automatically numbered consecutively, independent of sections. + +(Here, `hyperref` is used for the `\url` command, it is not necessary for footnotes per se.) + +``` {.hljs .lang-tex} +The wild boar (\textit{Sus scrofa}), also +known as the wild swine, common wild pig, +or simply wild pig, is a suid native to +much of Eurasia and North Africa, and has +been introduced to the Americas and Oceania. +\footnote{\url{https://en.wikipedia.org/ +wiki/Wild_boar}} +``` + +@preview +![](svg/chapter-13/footnote-example-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Cross-references + +@content +Manually (just don’t!) + +``` {.hljs .lang-tex} +As you can see in figure 23, … +``` + +Using the `\ref` command: + +``` {.hljs .lang-tex} +\begin{figure}[H] + \includegraphics % … + \caption{Our mascot Fooboar} + \label{img:fooboar} +\end{figure} + +As you can see in figure +\ref{img:fooboar}, … +``` + +@preview +![](svg/chapter-13/ref-example-crop.svg) +@slide(layout=content-only) + +@title +Assigning labels + +@content +Both cross-reference commands work with **sections, figures, tables, listings, and equations,** as long as you use correct labels. + +Labels have to be **unambiguous.** For clarity, certain prefixes are common, and some packages use them to derive information. + + + + + + + + + + + + + + + + + + +
`fig:` Figures`tbl:` Tables
`sec:` Sections`subsec:` Subsections
`ch:` Chapters`itm:` Enumeration items
`eq:` Equations`lst:` Source code listings
+ + + +@slide(layout=content-and-preview) + +@title +Cross-references + +@content +Using the `cleveref` package (with *one* ‘r’!): + +``` {.hljs .lang-tex} +\begin{figure}[H] + \includegraphics % … + \caption{Our mascot Fooboar} + \label{img:fooboar} +\end{figure} + +Fooboar is a young and highly engaged +boar (see \Cref{img:fooboar}). +``` + +The `\cref` command automatically inserts suitable prefixes. + +@preview +![](svg/chapter-13/cref-example-crop.svg) + + +@slide(layout=content-only) + +@title +Things to consider + +@content +* Terms inserted by `\cref` use the language specified with the document class (or `babel`): + + ``` {.hljs .lang-tex} + \documentclass[english]{article} + ``` + +* Apart from sections, referenced elements need captions (`\caption{…}`), and the **captions have to be placed before the label.** + +* For sectioning commands, the label is inserted directly after the section command. + + ``` {.hljs .lang-tex} + \section{Notes}\label{sec:notes} + ``` + + +@slide(layout=task) + +@task-number +11a + +@title +Inserting footnotes + +@content +* Make the text *March 2023* in file `exercises/footnotes/footnotes.tex` appear as a **footnote**. +* Additionally, insert a **clickable URL** that leads to the download page for the Java Development Kit (`https://www.oracle.com/java/technologies/javase-downloads.html`). + + +@slide(layout=task) + +@task-number +11b + +@title +Inserting references + +@content +* In file `exercises/references/references.tex`, replace *In the figure* and *The following source code listing* by **references** to the figure and to the source code listing. +* Use the command `\Cref` for the references. +* Make sure to add **labels** to the elements that you want to create a reference for. +* For source code listings, adding labels and captions is a bit different. Try to apply the knowledge you gained so far to retrieve the correct version of the `\lstinputlisting` command. Use the Internet, if necessary. + + +@slide(layout=extra-content-and-preview) + +@title +Configuring footnotes + +@content +The `footmisc` package provides additional options for the presentation of footnotes that can be activated by adding parameters to the `\usepackage` command. + +``` {.hljs .lang-tex} +% Reset the counter on each page: +\usepackage[perpage]{footmisc} + +% Display footnotes in-line: +\usepackage[para]{footmisc} + +% Use symbols instead of numbers: +\usepackage[symbol]{footmisc} +``` + +@preview +![](svg/chapter-13/footmisc-en-crop.svg){.thin-padding} + + + +@slide(layout=extra-content-and-preview) + +@title +A few more things + +@content +* It is recommended that you include the package `hyperref` before `cleveref`. +* `\cref` can take multiple references at once, separated by commas. + +``` {.hljs .lang-tex} +\section{An introduction} +\label{sec:section1} +% … +Reference be made to +\cref{sec:section1,sec:section2, +sec:section3,sec:section5}. +``` + +@preview +![](svg/chapter-13/cref-multiple-example-crop.svg) \ No newline at end of file diff --git a/latex-weekend/slides/source-code-listings.de.md b/latex-weekend/slides/source-code-listings.de.md new file mode 100644 index 0000000..cc03a20 --- /dev/null +++ b/latex-weekend/slides/source-code-listings.de.md @@ -0,0 +1,110 @@ +@slide(layout=chapter-slide) + +@number +13 + +@title +Quelltext-Listings + + +@slide(layout=content-and-preview) + +@title +Direkt im LaTeX-Quelltext + +@content +Das Paket `listings` bietet zum Einfügen von Code eine eigene Umgebung: + +``` {.lang-tex .hljs} +\section*{Haskell-Magie} +Quadrate aller geraden % … +\begin{lstlisting}[language=Haskell] +[x^2 | x <- [1..200], even x] +\end{lstlisting} +``` + +@preview +![](svg/chapter-10/listings-haskell-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Externer Code + +@content +Praktischerweise bietet `listings` einen Befehl zum Einfügen externen Codes: + +``` {.lang-tex .hljs} +\section*{Einfache Java-Anwendung} +\lstinputlisting[language=Java]{Test.java} +``` + +``` {.lang-java .hljs data-sourcefile="Test.java"} +public class Test { + public static void main(/*…*/) { + System.out.println(/*…*/); + } +} +``` + +@preview +![](svg/chapter-10/listings-java-crop.svg) + + +@slide(layout=content-only) + +@title +Themen und Stile + +@content +`listings` stellt keine eigenen Themes zur Verfügung. Dies kann aber durch die vielen Konfigurationsoptionen ausgeglichen werden. + +``` {.lang-tex .hljs} +\begin{lstlisting}[ + language=Java, + basicstyle=\footnotesize\ttfamily, + breaklines=true, + keywordstyle=\color{ForestGreen}, + commentstyle=\color{DarkGray}, + literate={ö}{{\"o}}1 +] +% … +\end{lstlisting} +``` + +Für die Erstellung eigener Themes ist der Befehl `\lstset` nützlich. + + +@slide(layout=content-only) + +@title +Weitere Materialien + +@content +* [Einführung](https://www.overleaf.com/learn/latex/Code_listing#Reference_guide) in das Paket +* offizielle [Dokumentation](https://www.overleaf.com/learn/latex/Code_listing#Reference_guide) +* vordefinierte [UTF-8-Konfiguration](https://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings#Encoding_issue) +* das Paket [`xcolor`](https://www.overleaf.com/learn/latex/Using_colours_in_LaTeX) für Farben +* zwei [Themes](https://github.com/jez/latex-solarized) im solarized-Stil für `listings` + + +@slide(layout=task) + +@task-number +13 + +@title +Listings + +@content +* Im Ordner `exercises/source-code-listings` findet ihr eine Datei namens `Source.java`. +* **Bindet** den Java-Quelltext in der Datei `source-code-listings.tex` **ein**. (Beachtet, dass der Dateipfad relativ zu `main-exercises.tex` ist.) +* Erlaubt die Verwendung von **Sonderzeichen** durch Angabe der `literate`-Option. +* Aktiviert das **Syntax-Highlighting** durch Angabe der Sprache Java. +* **Nummeriert** die Zeilen und aktiviert **Umbrüche**. +* Setzt mit dem Parameter `basicstyle` eine dicktengleiche Schrift (`\ttfamily \small`). +* Ändert die Schlüsselwortfarbe zu Blau. +* Verbergt die Sonderzeichen, die **Leerzeichen in Zeichenketten** markieren. + +Seht bei Fragen in der Dokumentation des Paketes `listings` nach. diff --git a/latex-weekend/slides/source-code-listings.en.md b/latex-weekend/slides/source-code-listings.en.md new file mode 100644 index 0000000..82e1b27 --- /dev/null +++ b/latex-weekend/slides/source-code-listings.en.md @@ -0,0 +1,110 @@ +@slide(layout=chapter-slide) + +@number +13 + +@title +Source code listings + + +@slide(layout=content-and-preview) + +@title +In-situ listings + +@content +The `listings` package provides a dedicated environment: + +``` {.lang-tex .hljs} +\section*{Haskell Magic} +Squares of all even % … +\begin{lstlisting}[language=Haskell] +[x^2 | x <- [1..200], even x] +\end{lstlisting} +``` + +@preview +![](svg/chapter-10/listings-haskell-english-crop.svg) + + +@slide(layout=content-and-preview) + +@title +External source code + +@content +Conveniently, `listings` offers an import command: + +``` {.lang-tex .hljs} +\section*{Simple Java Application} +\lstinputlisting[language=Java]{Test.java} +``` + +``` {.lang-java .hljs data-sourcefile="Test.java"} +public class Test { + public static void main(/*…*/) { + System.out.println(/*…*/); + } +} +``` + +@preview +![](svg/chapter-10/listings-java-english-crop.svg) + + +@slide(layout=content-only) + +@title +Themes and styles + +@content +`listings` does not provide any themes by default, but can be configured extensively. + +``` {.lang-tex .hljs} +\begin{lstlisting}[ + language=Java, + basicstyle=\footnotesize\ttfamily, + breaklines=true, + keywordstyle=\color{ForestGreen}, + commentstyle=\color{DarkGray}, + literate={ö}{{\"o}}1 +] +% … +\end{lstlisting} +``` + +Have a look at the `\lstset` command for creating your own themes. + + +@slide(layout=content-only) + +@title +Further resources + +@content +* [introduction](https://www.overleaf.com/learn/latex/Code_listing#Reference_guide) to the package +* official [documentation](https://www.overleaf.com/learn/latex/Code_listing#Reference_guide) +* predefined [UTF-8 configuration](https://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings#Encoding_issue) +* [`xcolor` package](https://www.overleaf.com/learn/latex/Using_colours_in_LaTeX) for colors +* two [solarized themes](https://github.com/jez/latex-solarized) for `listings` + + +@slide(layout=task) + +@task-number +13 + +@title +Listings + +@content +* In the directory `exercises/source-code-listings` you can find a file named `Source.java`. +* **Include** it in the file `source-code-listings.tex`. (Keep in mind that the file path is relative to the main LaTeX document, i. e., to `main-exercises.tex`.) +* Enable **special characters** via the `literate` option. +* Activate **syntax highlighting** by stating the programming language Java. +* **Number** the code lines. +* Set the `basicstyle` to a proper mono-spaced font (`\ttfamily \small`) +* Change the **keyword color** to blue. +* Don't show special characters for **spaces in strings**. + +If you have questions, try to consult the documentation of the `listings` package. diff --git a/latex-weekend/slides/special-characters.de.md b/latex-weekend/slides/special-characters.de.md new file mode 100644 index 0000000..ba81773 --- /dev/null +++ b/latex-weekend/slides/special-characters.de.md @@ -0,0 +1,331 @@ +@slide(layout=chapter-slide) + +@number +5 + +@title +Sonderzeichen + + +@slide(layout=content-and-preview) + +@title +Leerzeichen + +@content + +* Nutzt schmale Leerzeichen (`\,`) und geschützte Leerzeichen (`~`) an den geeigneten Stellen. + +``` {.hljs .lang-tex} +Schmale Leerzeichen werden z.\,B. in +Abkürzungen und zwischen Zahlen und +Einheiten verwendet: 10\,s. +Normalbreite, aber geschützte +Leerzeichen können u.\,a. +dabei helfen, Titel und Namen in +einer Zeile zu halten: Dr.~Fooboar. +``` + +* ++ Nutzt French Spacing (`\frenchspacing`), um riesige Freiräume nach Satzzeichen zu verhindern. + +@preview +![](svg/chapter-05/leerzeichen-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Striche + +@content + + + + + + + + + + + + + + + + + + + + + + + + + +
NameVerwendungCode
-Bindestrich *(hypen)*LaTeX-Wochenende`-`
Halbgeviert­strich
*(en dash)*
als Gedankenstrich – oder als Bis-Strich: 10 – 12 Uhr.`--`
Geviertstrich
*(em dash)*
a dash — mostly in American English`---`
+ +@preview +![](svg/chapter-05/striche-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Zitate + +@content +Das Paket `csquotes` stellt u. a. den Befehl `\enquote` zur Verfügung: + +``` {.lang-tex .hljs} +\enquote{Ein \enquote{verschachteltes} +Zitat.} +``` + +Wenn das Paket mit `autostyle=true` eingebunden wird, werden bei fremdsprachigen Zitaten die entsprechenden Anführungszeichen verwendet: + +``` {.lang-tex .hljs} +\foreignquote{english}{An English +quote.} +``` + +@preview +![](svg/chapter-05/zitate-crop.svg) + + +@slide(layout=content-only) + +@title +Sonderzeichen & Symbole + +@content +### Detexify to the rescue! ⛑️ +* Ausführliche Liste an verwendbaren Symbolen: + [PDF auf der CTAN-Website](http://tug.ctan.org/info/symbols/comprehensive/symbols-a4.pdf) +* Symbole malen und erkennen lassen: + [Detexify](http://detexify.kirelabs.org/classify.html) + + +@slide(layout=task) + +@task-number +5 + +@title +Sonderzeichen einfügen + +@content +
+Kompiliert von nun an immer die Datei `main-exercises.tex`, um eure Änderungen im Übungsskript zu sehen (in diesem Fall im Abschnitt zu Übung 5). +
+ +* Ersetzt die Leerzeichen innerhalb der Abkürzungen in `exercises/special-characters.tex` durch **schmale Leerzeichen**. +* Die Bindestriche bei den Öffnungszeiten der ERBA sollen durch **Halbgeviertstriche** ersetzt werden, optional mit schmalen Leerzeichen außenrum. +* Nutzt den Befehl `\enquote`, um die Wörter *Studi-Ticket* und *Studi-Karte* in **Anführungszeichen** zu setzen. + + +@slide(layout=extra-content-and-preview) + +@title +English spacing + +@content +In englischsprachigen Dokumenten verwendet LaTeX das traditionelle *English spacing,* also doppelte Leerzeichen nach dem Satzende. + +Das kann mit `\frenchspacing` vor dem ersten Absatz verhindert werden. `\nonfrenchspacing` schaltet wieder zurück. + +Bei *English spacing* versucht LaTeX, nach Abkürzungen trotzdem normale Wortzwischenräume zu setzen. Das sollte aber kontrolliert werden. Eingreifen können wir mit + +* erzwungenen Wortzwischenräumen: `.\␣` +* erzwungenen Satzenden: `\@.␣` + +@preview +![](svg/chapter-05/french-spacing-crop.svg) + + +@slide(layout=extra-content-and-preview) + +@title +Silbentrennung + +@content +LaTeX trennt Wörter im Normalfall automatisch richtig, wenn die richtige Sprache konfiguriert ist. Manchmal muss aber auch manuell eingegriffen werden. + + + + + + + + + + + + + + + + + + + + + + + + + + +
Ausschließliche Trennung`\-`
Zusätzliche Trennstelle`"-`
Bindestrich (verbietet andere Trennstellen)`-`
Bindestrich (erlaubt andere Trennstellen)`"=`
Trennstelle ohne Strich`""`
Strich ohne Trennstelle`"~`
+ +

Einige der Codes funktionieren nur mit eingebundenem `babel`-Paket.

+ + +@preview +![](svg/chapter-05/silbentrennung-crop.svg) + + + +@slide(layout=extra-content-only) + +@title +Anführungszeichen + +@content + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpracheBefehlErgebnis
Deutsch`\glqq … \grqq`„ … “
 2. Ebene` \glq … \grq `‚ … ‘
Deutsch altern.`\frqq … \flqq`» … «
 2. Ebene` \frq … \flq `› … ‹
Englisch (A. E.)\`\`…\'\'“ … ”
 2. Ebene \`…\' ‘ … ’
Englisch (B. E.) \`…\' ‘ … ’
 2. Ebene\`\`…\'\'“ … ”
+ +Für andere Sprachen können andere Regeln gelten, meistens aber mit den gleichen Zeichen, nur in anderer Zusammensetzung. + + +@slide(layout=extra-content-only) + +@title +Diakritika + +@content +Buchstaben mit Diakritika können entweder direkt über die Tastatur eingegeben werden oder über Escape-Codes: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\\\`{o}ò  `\c{c}` ç  `\d{u}`
`\'{o}` ó`\k{a}` ą`\r{a}` å
`\^{o}` ô`\l{}` ł`\u{o}` ŏ
`\"{o}` ö`\={o}` ō`\v{s}` š
`\H{o}` ő`\b{o}` o`\t{oo}`o͡o
`\~{o}` õ`\.{o}` ȯ`\o` ø
+ + +@slide(layout=extra-content-only) + +@title +Sonderzeichen & Symbole + +@content +Auch andere Sonderzeichen können entweder direkt eingegeben werden oder per Befehl: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
¿ ?\`¡ !\`
^ `\textasciicircum`~ `\textasciitilde`
`\textasteriskcentered`\\ `\textbackslash`
| `\textbar` `\textbullet`
`\textcopyright` `\textdagger`
`\textdaggerdbl` `\textellipsis`
< `\textless`> `\textgreater`
`\textperthousand`§ `\textsection`
+ +… und so ziemlich alles andere. \ No newline at end of file diff --git a/latex-weekend/slides/special-characters.en.md b/latex-weekend/slides/special-characters.en.md new file mode 100644 index 0000000..0df2074 --- /dev/null +++ b/latex-weekend/slides/special-characters.en.md @@ -0,0 +1,327 @@ +@slide(layout=chapter-slide) + +@number +5 + +@title +Special characters + + +@slide(layout=content-and-preview) + +@title +Spaces + +@content +* Use thin spaces (`\,`) and non-breaking spaces (`~`), where appropriate. + +``` {.hljs .lang-tex} +Thin spaces are used in abbreviations +and before units, e.\,g., 10\,s. +Normal-width non-breaking spaces can help +keep honorary titles and names on one +line: Dr.~Fooboar. +``` + +* ++ Use french spacing (`\frenchspacing`) to avoid giant gaps after full stops. + +@preview +![](svg/chapter-05/spaces-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Hyphens and dashes + +@content + + + + + + + + + + + + + + + + + + + + + + + + + +
NameUseCode
-Hyphencompound-forming hyphen`-`
En dash *(Halbgeviert­strich)*a dash – or a range: 12 – 2 p.m.`--`
Em dash *(Geviertstrich)*a dash — mostly in American English`---`
+ +@preview +![](svg/chapter-05/hyphens-and-dashes-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Quotes + +@content +The `csquotes` package provides, amongst others, the command `\enquote`. + +``` {.lang-tex .hljs} +\enquote{A \enquote{nested} +quote.} +``` + +When included with `autostyle=true`, foreign-language quotes use the according quotation marks: + +``` {.lang-tex .hljs} +\foreignquote{ngerman}{Ein deutsches +Zitat.} +``` + +@preview +![](svg/chapter-05/quotes-crop.svg) + + +@slide(layout=content-only) + +@title +Special characters & symbols + +@content +### Detexify to the rescue! ⛑️ +* A long list of symbols to use: + [PDF on the CTAN website](http://tug.ctan.org/info/symbols/comprehensive/symbols-a4.pdf) +* Draw symbols and have them recognised: + [Detexify](http://detexify.kirelabs.org/classify.html) + + +@slide(layout=task) + +@task-number +5 + +@title +Insert special characters + +@content +
+From now on, compile the file `main-exercises.tex` to see your changes appear in the exercise script (in this task, see exercise 5). +
+ +* Replace the spaces in `exercises/special-characters.tex` within the abbreviations (“e. g.”, “i. a.”) by **thin spaces**. +* Replace the hyphens separating the opening hours by **en dashes** (`--`), optionally surrounded by thin spaces. +* Add **quotation marks** around the words *Studi-Ticket* and *Studi-Karte* using the `\enquote` command. + + +@slide(layout=extra-content-and-preview) + +@title +English and French spacing + +@content +In English, LaTeX uses the old-fashioned *English spacing,* i. e., double sentence spacing. + +If you want to be more modern, you can use `\frenchspacing` above your first paragraph. `\nonfrenchspacing` goes back to default. + +If you actually use *English spacing,* LaTeX will still try and put normal word spacing after abbreviations. However, you should check the results and intervene where needed by + +* forcing normal spaces: `.\␣` +* manually ending sentences: `\@.␣` + +@preview +![](svg/chapter-05/french-spacing-crop.svg) + + +@slide(layout=extra-content-and-preview) + +@title +Hyphenation + +@content +Most of the time, LaTeX hyphenates words correctly, if the correct language is configured. +Sometimes, however, manual intervention is necessary. + + + + + + + + + + + + + + + + + + + + + + + + + + +
Exclusive hyphenation`\-`
Additional hyphenation`"-`
Hyphen (suppressing other hyphenation)`-`
Hyphen (allowing other hyphenation)`"=`
Possible separation without hyphen`""`
Non-breaking hyphen`"~`
+ +

Some of the codes only work when you use the `babel` package.

+ +@preview +![](svg/chapter-05/hyphenation-crop.svg) + + +@slide(layout=extra-content-only) + +@title +Manual quotation + +@content + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LanguageCommandResult
English (B. E.) \`…\' ‘ … ’
 2nd Level\`\`…\'\'“ … ”
English (A. E.)\`\`…\'\'“ … ”
 2nd Level \`…\' ‘ … ’
German`\glqq … \grqq`„ … “
 2nd Level` \glq … \grq `‚ … ‘
German altern.`\frqq … \flqq`» … «
 2nd Level` \frq … \flq `› … ‹
+ +Other rules my apply for other languages, but most of the time it’s the same characters, only combined differently. + + +@slide(layout=extra-content-only) + +@title +Diacritics + +@content +Letters with diacritics can either by typed directly on the keyboard or via escape codes: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\\\`{o}ò  `\c{c}` ç  `\d{u}`
`\'{o}` ó`\k{a}` ą`\r{a}` å
`\^{o}` ô`\l{}` ł`\u{o}` ŏ
`\"{o}` ö`\={o}` ō`\v{s}` š
`\H{o}` ő`\b{o}` o`\t{oo}`o͡o
`\~{o}` õ`\.{o}` ȯ`\o` ø
+ + +@slide(layout=extra-content-only) + +@title +Special characters + +@content +The same is true for special characters: They can either be typed directly or created via escape codes and commands: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
¿ ?\`¡ !\`
^ `\textasciicircum`~ `\textasciitilde`
`\textasteriskcentered`\\ `\textbackslash`
| `\textbar` `\textbullet`
`\textcopyright` `\textdagger`
`\textdaggerdbl` `\textellipsis`
< `\textless`> `\textgreater`
`\textperthousand`§ `\textsection`
+ +… and pretty much anything else. \ No newline at end of file diff --git a/latex-weekend/slides/support.de.md b/latex-weekend/slides/support.de.md new file mode 100644 index 0000000..cde1415 --- /dev/null +++ b/latex-weekend/slides/support.de.md @@ -0,0 +1,103 @@ +@slide(layout=chapter-slide) + +@number +15 + +@title +Hilfe und Informationen + +@slide(layout=content-only) + +@title +[Wikibooks](https://de.wikibooks.org/wiki/LaTeX-Kompendium) + +@content +Das Wikibook zu LaTeX enthält eine große Anzahl interessanter Artikel und ist auch in deutscher Sprache verfügbar. + +![](svg/chapter-16/wikibooks-latex.jpg) + +@slide(layout=content-only) + +@title +[CTAN](https://ctan.org) + +@content +Das »Comprehensive TeX Archive Network« ist die zentrale Quelle für LaTeX-Pakete und ihre Dokumentation. + +![](svg/chapter-16/ctan.jpg) + +@slide(layout=content-only) + +@title +[Overleaf](https://www.overleaf.com) + +@content +Ein Online-LaTeX-Editor, der das kollaboratives Arbeiten an Dokumenten ermöglicht. + +Außerdem findest du auf der Seite verschiedene Tutorials und unter »Templates« LaTeX-Vorlagen für viele Gelegenheiten (Lebenslauf, Abschlussarbeiten, …). + +![](svg/chapter-16/overleaf.jpg) + +@slide(layout=content-only) + +@title +[StackExchange](https://tex.stackexchange.com) + +@content +Frage-Forum zu LaTeX. + +![](svg/chapter-16/stackexchange.jpg) + +@slide(layout=content-only) + +@title +[TeXample](https://www.texample.net) + +@content +Webseite mit zahlreichen LaTeX-Beispielvorlagen, vor allem zu TikZ. + +![](svg/chapter-16/texample.jpg) + +@slide(layout=preview-only) + +@preview +![Klassisch ([Quelle](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/klassisches-beispiel-2.jpeg){.large} + +@slide(layout=preview-only) + +@preview +![Noch klassischer ([Quelle](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/klassischeres-beispiel.jpg) + +@slide(layout=preview-only) + +@preview +![Anders ([Quelle](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/anderes-beispiel.png){.large} + +@slide(layout=content-only) + +@title +[Fachschaft WIAI](https://www.uni-bamberg.de/wiai/fs/) + +@content +Wenn ihr sonst noch Fragen oder Probleme habt, kommt gerne bei uns vorbei oder schreibt uns eine Mail! +

📍WE5/02.104
+☎️0951 863 1219
+📧fachschaft-wiai.stuve@uni-bamberg.de +

+ + +@slide(layout=content-only) + +@title +Kurzes Feedback + +@content +* Was hat euch gut gefallen? +* Was hätten wir besser machen können? +* Was hättet ihr euch gewünscht? + +@slide(layout=preview-only) + +@preview + diff --git a/latex-weekend/slides/support.en.md b/latex-weekend/slides/support.en.md new file mode 100644 index 0000000..32ff2e9 --- /dev/null +++ b/latex-weekend/slides/support.en.md @@ -0,0 +1,104 @@ +@slide(layout=chapter-slide) + +@number +15 + +@title +Getting help and information + +@slide(layout=content-only) + +@title +[Wikibooks](https://en.wikibooks.org/wiki/LaTeX) + +@content +The LaTeX Wikibook offers numerous interesting articles and is available in English and German (among others). + +![](svg/chapter-16/wikibooks-latex_en.jpg) + +@slide(layout=content-only) + +@title +[CTAN](https://ctan.org) + +@content +The “Comprehensive TeX Archive Network” is the central source for LaTeX packages and their documentation. + +![](svg/chapter-16/ctan.jpg) + +@slide(layout=content-only) + +@title +[Overleaf](https://www.overleaf.com) + +@content +Overleaf is a collaborative online LaTeX editor. + +It also offers a multiple tutorials and templates for different occasions (CV, theses, …): »Templates«. + +![](svg/chapter-16/overleaf.jpg) + +@slide(layout=content-only) + +@title +[StackExchange](https://tex.stackexchange.com) + +@content +Question-and-answer website for LaTeX. + +![](svg/chapter-16/stackexchange.jpg) + +@slide(layout=content-only) + +@title +[TeXample](https://www.texample.net) + +@content +A collection of LaTeX examples, especially with TikZ. + +![](svg/chapter-16/texample.jpg) + +@slide(layout=preview-only) + +@preview +![Classic ([source](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/klassisches-beispiel-2.jpeg){.large} + +@slide(layout=preview-only) + +@preview +![More classic ([source](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/klassischeres-beispiel.jpg) + +@slide(layout=preview-only) + +@preview +![Different ([source](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/anderes-beispiel.png){.large} + +@slide(layout=content-only) + +@title +[Fachschaft WIAI](https://www.uni-bamberg.de/wiai/fs/) + +@content +If you have any other questions or problems, just come over or write us an e-mail! +

📍WE5/02.104
+☎️0951 863 1219
+📧fachschaft-wiai.stuve@uni-bamberg.de +

+ + +@slide(layout=content-only) + +@title +A short feedback round + +@content +* What did you like? +* What could we have done better? +* What did you wish for? + +@slide(layout=preview-only) + +@preview + + diff --git a/latex-weekend/slides/tables.de.md b/latex-weekend/slides/tables.de.md new file mode 100644 index 0000000..54b9948 --- /dev/null +++ b/latex-weekend/slides/tables.de.md @@ -0,0 +1,233 @@ +@slide(layout=chapter-slide) + +@number +10 + +@title +Tabellen + + +@slide(layout=content-only) + +@title +Grundstruktur 🗒️ + +@content +Für typografisch schöne Tabellen nutzen wir das Paket `booktabs`. + +``` {.hljs .lang-tex} +\usepackage{booktabs} +``` + +``` {.hljs .lang-tex} +\begin{table}[] + \begin{tabular}{} + % Tabelleninhalt + \end{tabular} + \caption{} +\end{table} +``` + +Die Positionierung erfolgt analog zu Grafiken. + + +@slide(layout=content-and-preview) + +@title +Spaltendefinitionen + +@content +``` {.hljs .lang-tex} +\begin{tabular}{lrcl} + % Tabelleninhalt +\end{tabular} +``` + + + + + + + + + + + + + + + + + + +
KürzelBedeutung
llinksbündige Spalte
czentrierte Spalte
rrechtsbündige Spalte
+ +++ Vertikale Trennlinien und doppelte horizontale Linien sind unter Typograph\*innen nicht gern gesehen und sollten vermieden werden. + +@preview +![](svg/chapter-12/tabelle-beispiel-crop.svg){.thin-padding} + + +@slide(layout=content-and-preview) + +@title +Tabelleninhalt + +@content +``` {.hljs .lang-tex} +\begin{tabular}{lll} + \toprule + Spalte 1 & Spalte 2 & Spalte 3 \\ + \midrule + Inhalt a & Inhalt b & Inhalt c \\ + Inhalt e & Inhalt f & Inhalt g \\ + Inhalt i & Inhalt j & Inhalt k \\ + \bottomrule +\end{tabular} +``` +* ++ Zellen werden durch ›`&`‹ abgetrennt. +* ++ Reihen werden durch ›`\\`‹ beendet. +* ++ `\toprule`, `\midrule` und `\bottomrule` strukturieren die Tabelle. + +@preview +![](svg/chapter-12/tabelle-inhalt-beispiel-crop.svg){.thin-padding} + + +@slide(layout=wide-content) + +@title +Die gesamte Tabelle + +@content +``` {.hljs .lang-tex} +\begin{table}[h] + \begin{tabular}{lrcl} + \toprule + Sprache & Autor & Erscheinungsjahr & Dateiendung \\ + \midrule + C++ & Bjarne Stroustrup & 1985 & .cpp \\ + Java & James Gosling & 1998 & .java \\ + Python & Guido van Rossum & 1991 & .py \\ + \bottomrule + \end{tabular} + \caption{Bekannte Programmiersprachen} +\end{table} +``` + +

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

+ +

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

+ + +@slide(layout=content-only) + +@title +Mehr Komfort + +@content +Der [Tables Generator](https://tablesgenerator.com/) ist ein wunderbares Werkzeug, um schnell Tabellen verschiedener Formate zu erstellen. + +[![](svg/chapter-12/tables-generator.png)](https://tablesgenerator.com/) + + +@slide(layout=task) + +@task-number +10 + +@title +Tabellen setzen + +@content +* Die Liste in der Datei `exercises/tables/tables.tex` enthält Infos zu ein paar Lehrveranstaltung an der Fakultät WIAI. +* Wandelt die Liste in eine **Tabelle** um. +* Die Tabelle soll Spalten für den *Namen*, das *Kürzel* und das *Semester* der Vorlesungen haben. +* Fügt außerdem eine **zentrierte Spalte** ganz links in der Tabelle hinzu, in der ihr die Lehrveranstaltungen **nummeriert**. + + + +@slide(layout=extra-content-only) + +@title +Besonders lange Tabellen + +@content +Tabellen, die über eine Seite hinaus gehen, werden von `tabular` einfach abgeschnitten. Die Lösung bietet hier das Paket `longtable`: + +``` {.hljs .lang-tex} +\usepackage{longtable} +``` + +``` {.hljs .lang-tex} +\begin{longtable}{} + % Tabelleninhalt + \caption{} + \label{
@@ -504,27 +504,27 @@ aussieht. }
-

+

☹ schräg (verzerrt)

-

+

☺ gerade

-

+

☺ kursiv (eigener Schnitt)

-

+

☹ kleine Schrift vergrößert

-

+

☺ jeweils passender Schriftgrad

-

+

☹ große Schrift verkleinert

@@ -577,7 +577,7 @@ das ihr nach dem Workshop als kompakte Referenz verwenden könnt.

- +
@@ -622,7 +622,7 @@ Bildquelle: xkcd
- +
@@ -632,7 +632,7 @@ Bildquelle: xkcd
-Der Weg zum fertigen Dokument +Der Weg zum fertigen Dokument
@@ -734,7 +734,7 @@ Hallo, Welt!
- +
@@ -813,7 +813,7 @@ nichts verloren.
- +
@@ -837,7 +837,7 @@ Geburtsort: Milwaukee, Wisconsin
- +
@@ -858,7 +858,7 @@ Geburtsort: Milwaukee, Wisconsin
- +
@@ -882,7 +882,7 @@ unterteilt. Immer verfügbar:

- +
@@ -938,7 +938,7 @@ Mein Lieblingsrezept
- +
@@ -988,7 +988,7 @@ Mein Lieblingsrezept
- +
@@ -1097,7 +1097,7 @@ Bücher
- +
@@ -1118,7 +1118,7 @@ angegeben werden:

- +
@@ -1172,7 +1172,7 @@ Auskommentieren kann in TeXstudio mit dem Shortcut Strg +
- +
@@ -1203,7 +1203,7 @@ Auskommentieren kann in TeXstudio mit dem Shortcut Strg +
- +
@@ -1234,7 +1234,7 @@ Inhalt von Abschnitt 2.
- +
@@ -1262,7 +1262,7 @@ Schreibweise verwenden.
- +
@@ -1286,7 +1286,7 @@ relativen Pfaden auf den aktuellen Ordner (hier:
- +
@@ -1307,7 +1307,7 @@ relativen Pfaden auf den aktuellen Ordner (hier:
- +
@@ -1319,9 +1319,11 @@ relativen Pfaden auf den aktuellen Ordner (hier:

Dateipfade angeben 👣

-task.texgraphics.raw.tex (wenn -task.tex von main-exercises.tex importiert -wird) +basic-functionality.texgraphics.raw.tex +

+

+(wenn basic-functionality.tex von +main-exercises.tex importiert wird)

./exercises/graphics/graphics.raw.tex
@@ -1333,7 +1335,7 @@ Dateien einbindet, die wiederum andere Dateien referenzieren.
- +
@@ -1426,7 +1428,7 @@ Freiräume nach Satzzeichen zu verhindern.
- +
@@ -1497,7 +1499,7 @@ a dash — mostly in American English
- +
@@ -1520,7 +1522,7 @@ quote.}
- +
@@ -1596,7 +1598,7 @@ kontrolliert werden. Eingreifen können wir mit

- +
@@ -1667,7 +1669,7 @@ Einige der Codes funktionieren nur mit eingebundenem
- +
@@ -2124,8 +2126,8 @@ unterstrichen
- - + +
@@ -2167,7 +2169,7 @@ bereit, der URLs

- +
@@ -2212,7 +2214,7 @@ Schriftgrößen
- +
@@ -2238,7 +2240,7 @@ vermeiden!
- +
@@ -2268,7 +2270,7 @@ abgeschaltet werden
- +
@@ -2307,7 +2309,7 @@ den Befehl \item gekennzeichnet.

- +
@@ -2331,8 +2333,8 @@ den Befehl \item gekennzeichnet.

- - + +
@@ -2358,7 +2360,7 @@ den Befehl \item gekennzeichnet.

- +
@@ -2405,7 +2407,7 @@ Zwischenräume zur Verfügung.

- +
@@ -2429,7 +2431,7 @@ zur Verfügung, die in einem Absatz stehen.

- +
@@ -2455,7 +2457,7 @@ notwendig.

- +
@@ -2493,7 +2495,7 @@ aktiviert wird. Außerdem gibt es eine Blockumgebung:

- +
@@ -2565,7 +2567,7 @@ unterdrückt werden.
- +
@@ -2815,7 +2817,7 @@ werden.
- +
@@ -3065,7 +3067,7 @@ Typograph*innen nicht gern gesehen und sollten vermieden werden.

- +
@@ -3094,7 +3096,7 @@ Typograph*innen nicht gern gesehen und sollten vermieden werden.

- +
@@ -3138,7 +3140,7 @@ Breite des Tabelleninhalts.

Der Tables Generator ist ein wunderbares Werkzeug, um schnell Tabellen verschiedener Formate zu erstellen.

-

+

@@ -3245,7 +3247,7 @@ auch im Querformat dargestellt werden:

- +
@@ -3283,7 +3285,7 @@ wiki/Eber}}
- +
@@ -3307,7 +3309,7 @@ Wie man in Abbildung \ref{img:fooboar} …
- +
@@ -3332,7 +3334,7 @@ Abkürzung ein.

- +
@@ -3477,7 +3479,7 @@ können.

- +
@@ -3504,7 +3506,7 @@ sec:section3,sec:section5}.
- +
@@ -3604,7 +3606,7 @@ Zitierstilen.Unbekannt

-Zitieren im Alpha-Zitierstil +Zitieren im Alpha-Zitierstil
@@ -3616,7 +3618,7 @@ Zitierstilen.Unbekannt

-Zitieren im Natdin-Zitierstil +Zitieren im Natdin-Zitierstil
@@ -3629,7 +3631,7 @@ Natdin-Zitierstil
-Finden von fertigen BibTeX-Einträgen – Bamberger Katalog +Finden von fertigen BibTeX-Einträgen – Bamberger Katalog
@@ -3642,7 +3644,7 @@ Bamberger Katalog
-Finden von fertigen BibTeX-Einträgen – Google Scholar +Finden von fertigen BibTeX-Einträgen – Google Scholar
@@ -3655,7 +3657,7 @@ Google Scholar
-Finden von fertigen BibTeX-Einträgen – Google Scholar +Finden von fertigen BibTeX-Einträgen – Google Scholar
@@ -3668,7 +3670,7 @@ Google Scholar
-Finden von fertigen BibTeX-Einträgen – dblp.org +Finden von fertigen BibTeX-Einträgen – dblp.org
@@ -3736,7 +3738,7 @@ Quadrate aller geraden % …
- +
@@ -3759,7 +3761,7 @@ Einfügen externen Codes:

- +
@@ -3885,7 +3887,7 @@ weiter verbreitet.
- +
@@ -3918,7 +3920,7 @@ Themes.

- +
@@ -3960,7 +3962,7 @@ child { node {home}
- +
@@ -3978,7 +3980,7 @@ erstellen:

- +
@@ -4038,7 +4040,7 @@ einwandfrei darstellen.

- +
@@ -4130,7 +4132,7 @@ Gestalten von Tabellen

Das Wikibook zu LaTeX enthält eine große Anzahl interessanter Artikel und ist auch in deutscher Sprache verfügbar.

-

+

@@ -4144,7 +4146,7 @@ und ist auch in deutscher Sprache verfügbar.

Das »Comprehensive TeX Archive Network« ist die zentrale Quelle für LaTeX-Pakete und ihre Dokumentation.

-

+

@@ -4162,7 +4164,7 @@ Dokumenten ermöglicht.

»Templates« LaTeX-Vorlagen für viele Gelegenheiten (Lebenslauf, Abschlussarbeiten, …).

-

+

@@ -4175,7 +4177,7 @@ LaTeX-Vorlagen für viele Gelegenheiten (Lebenslauf, Abschlussarbeiten, StackExchange

Frage-Forum zu LaTeX.

-

+

@@ -4189,7 +4191,7 @@ LaTeX-Vorlagen für viele Gelegenheiten (Lebenslauf, Abschlussarbeiten,

Webseite mit zahlreichen LaTeX-Beispielvorlagen, vor allem zu TikZ.

-

+

@@ -4199,7 +4201,7 @@ TikZ.

-Klassisch (Quelle) +Klassisch (Quelle)
@@ -4211,7 +4213,7 @@ TikZ.

-Noch klassischer (Quelle) +Noch klassischer (Quelle)
@@ -4223,7 +4225,7 @@ TikZ.

-Anders (Quelle) +Anders (Quelle)
@@ -4244,7 +4246,7 @@ vorbei oder schreibt uns eine Mail! ☎️0951 863 1219
📧fachschaft-wiai.stuve@uni-bamberg.de

-

+

@@ -4268,7 +4270,7 @@ vorbei oder schreibt uns eine Mail!
-

+

diff --git a/latex-wochenende-wise-2023/slides/basic-document-structure.de.md b/latex-wochenende-wise-2023/slides/basic-document-structure.de.md new file mode 100644 index 0000000..736f352 --- /dev/null +++ b/latex-wochenende-wise-2023/slides/basic-document-structure.de.md @@ -0,0 +1,412 @@ +@slide(layout=chapter-slide) + +@number +3 + +@title +Grundstruktur eines LATEX-Dokuments + + +@slide(layout=content-and-preview) + +@title +Präambel & Dokumentumgebung + +@content +

👁 Ein mit LaTeX gesetztes Dokument besteht aus:

+ +* **Präambel:** globale Einstellungen (Dokumentklasse, Kodierung, Sprache, Seitenformat, zusäzliche Pakete, …) und +* **Dokumentumgebung:** Inhalt des Dokuments. + +``` {.lang-tex .hljs .fragment} +\documentclass[ngerman]{article} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage[ngerman]{babel} + +\begin{document} +Hallo, Welt! +\end{document} +``` + +@preview +![](svg/chapter-03/hallo-crop.svg) + + +@slide(layout=wide-content) + +@title +Dokumentenklasse + +@content +``` {.lang-tex .hljs} +\documentclass[]{} +``` + +Konkret zum Beispiel + +``` {.lang-tex .hljs} +\documentclass[10pt,a5paper,landscape]{article} +``` + + +@slide(layout=content-only) + +@title +Kodierung + +@content +``` {.lang-tex .hljs} +\usepackage[utf8]{inputenc} +\usepackage[t1]{fontenc} +``` + +* Die Zeichenkodierung bestimmt, welche Zeichen verfügbar sind. +* **ASCII** enthält kaum Sonderzeichen wie deutsche Umlaute. +* **UTF-8** ist eine universelle Kodierung. + + +@slide(layout=content-only) + +@title +Sprache + +@content +``` {.lang-tex .hljs} +\usepackage[ngerman]{babel} +``` + +* Das Paket **`babel`** stellt sprachspezifische Informationen (z. B. Silbentrennung, Sonderzeichen, Wechsel zwischen Fonts, Übersetzung von Labels wie ›Kapitel‹, ›Inhaltsverzeichnis‹ oder ›Abbildung‹) bereit. +* **`ngerman`** steht für die neue deutsche Rechschreibung. + + +@slide(layout=content-and-preview) + +@title +Fließtext + +@content +``` {.lang-tex .hljs} +Fließtext kann direkt in den Quelltext ↲ +geschrieben werden. ↲ +Einfache Zeilenumbrüche ↲ +werden dabei ignoriert, ↲ +genau wie mehrere Leerzeichen. ↲ +↲ +Leerzeilen erzeugen einen neuen Absatz,↲ +standardmäßig mit Einzug. ↲ +Manuelle Zeilenumbrüche können mit ↲ +zwei Backslashes erzwungen werden, ↲ +haben in Fließtext aber eigentlich \\ ↲ +nichts verloren. +``` + +@preview +![](svg/chapter-03/absätze-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Kommentare + +@content +Nach einem Prozentzeichen wird der Rest der Zeile vom Compiler ignoriert. Der Kommentartext erscheint also nicht im fertigen Dokument. + +``` {.lang-tex .hljs} +% Beginn Steckbrief +Name: Donald Knuth \\ +Geburtsdatum: \\ % TODO: einfügen +Geburtsort: Milwaukee, Wisconsin +% Ende Steckbrief +``` + +Tastenkombinationen: Strg + T und Strg + U + +@preview +![](svg/chapter-02/kommentare-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Achtung! + +@title +Reservierte Zeichen + +@content +Bestimmte Zeichen lösen in LaTeX Dinge aus: + +`# $ % ^ & _ { } ~ \` + +``` {.lang-tex .hljs} +50% sind die Hälfte. +``` + +Lösung: »`\`« voranstellen: + +``` {.lang-tex .hljs} +50\% sind die Hälfte. +``` + +Funktioniert nicht mit »`\\`«, nutzt `\textbackslash` stattdessen. + +@preview +![](svg/chapter-03/reservierte-zeichen-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Abschnitte und Kapitel + +@content +Texte werden durch Überschriften in Abschnitte und Kapitel unterteilt. Immer verfügbar: + +``` {.lang-tex .hljs} +\section{Ebene 1} +\subsection{Ebene 2} +\subsubsection{Ebene 3} +\paragraph{Ebene 4} +\subparagraph{Ebene 5} +``` + +Je nach Dokumentenklasse zusätzlich: + +``` {.lang-tex .hljs} +\chapter{Kapitel} +\part{Teil} +``` + +@preview +![](svg/chapter-03/abschnitte-crop.svg) + + +@slide(layout=wide-content) + +@title +Titelei + +@content +``` {.lang-tex .hljs data-source=title.tex} +\title{Die Welt der Trüffel} +\author{Fooboar Rüssel \and Fachschaft WIAI} +\date{\today} +\begin{document} +\maketitle +\end{document} +``` + +* In der Präambel werden die Werte für die Einträge gespeichert. +* Das Setzen des Titels erfolgt in der Dokumentumgebung mit dem Befehl `\maketitle`. +* Die genaue Gestaltung hängt ab von der verwendeten Dokumentklasse. +* Mehrere Autoren werden mit `\and` verbunden. +* Wird kein Datum angegeben, wird per default das aktuelle Datum gesetzt. Ein abweichendes Datum kann mit `\date{}` definiert werden. + + +@slide(layout=content-and-preview) + +@title +Titelei + +@content +``` {.lang-tex .hljs data-source=title.tex} +\documentclass[ngerman]{scrartcl} +\usepackage{babel} +\title{Die Welt der Trüffel} +\author{Fooboar Rüssel \and +Fachschaft WIAI} +\date{\today} +\begin{document} +\maketitle +\section{Trüffelsuche} +\subsection{Suche mit Schwein} +\subsection{Suche ohne Schwein} +Wer macht denn sowas? +\section{Trüffelrezepte} +Mein Lieblingsrezept +\end{document} +``` + +@preview +![](svg/chapter-03/titel-orig.svg) + + +@slide(layout=content-only) + +@title +Verzeichnisse + +@content +``` {.lang-tex .hljs} +\tableofcontents % Inhaltsverzeichnis +\listoffigures % Abbildungsverzeichnis +\listoftables % Tabellenverzeichnis +``` + +* Nummerierung erfolgt automatisch +* Elemente, die nicht im Verzeichnis aufgeführt werden sollen, werden mit einem »`*`« versehen, also z. B. `\section*{}`. +* **am besten zweimal kompilieren** + + +@slide(layout=content-and-preview) + +@title +Inhaltsverzeichnis + +@content +``` {.lang-tex .hljs data-source=title.tex} +\documentclass[ngerman]{scrartcl} +\usepackage{babel} +\begin{document} +\tableofcontents +\section{Trüffelsuche} +Der erste Abschnitt. +\subsection{Suche mit Schwein} +Ein Unterabschnitt. +\subsection{Suche ohne Schwein} +Ein weiterer Unterabschitt. +\subsubsection[But why?] + {Wer macht denn sowas?} +Unter-Unterabschnitt. +\section{Trüffelrezepte} +Mein Lieblingsrezept +\end{document} +``` + +@preview +![](svg/chapter-03/inhalt-crop.svg) + + + +@slide(layout=wide-task) + +@task-number +3 + +@title +Dokument und Text gliedern + +@content +* Öffnet die Datei `document-structure.tex`, die im Ordner `exercises/basic-document-structure` liegt. +* Packt den gesamten Text in der Datei in eine **Document**-Umgebung und schreibt darüber folgende **Präambel**. Kompiliert die Datei. + +``` {.lang-tex .hljs .fragment} +\documentclass{scrartcl} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage[ngerman]{babel} +``` + +* Wie ihr sehen könnt, sind in der Datei die Absätze im Dokument mit `\\` erstellt worden. Ersetzt diese durch richtige Absätze. +* Zeit für etwas Struktur! Verwendet für die **Überschriften** die passenden LaTeX-Befehle (`\section` u. ä.). +* Fügt anschließend ein **Inhaltsverzeichnis** in euer Dokument ein. + + +@slide(layout=extra-wide-content) + +@title +Dokumentenklassen + +@content +* Natürlich gibt es auch andere Dokumentenklassen als `article`. +* Je nachdem, welche Dokumentenklasse man verwendet, ändert sich das Layout der generierten PDF. +* Die korrekt geschriebenen Dokumentenklassen richten sich nach US-amerikanischen Layout-Normen. +* **`src`**-Dokumentenklassen versuchen europäische Normen abzubilden. + +Folgende Dokumentenklassen stehen zur Verfügung: + +* **`scrartcl`, `article`** für kurze Dokumente +* **`scrreprt`, `report`** für lange Dokumente +* **`scrbook`, `book`** für Bücher +* **`beamer`** für Präsentationen + + +@slide(layout=extra-wide-content) + +@title +Sprachen + +@content +Es können auch mehrere Sprachen im Dokument verwendet werden: + +``` {.lang-tex .hljs} +\usepackage[ngerman, swedish, ukrainian, greek, english]{babel} +``` + +Umschalten zwischen Sprachen: + +``` {.lang-tex .hljs} +\selectlanguage{} +\selectlanguage{} +``` + +Eingebetteter Text in anderer Sprache: + +``` {.lang-tex .hljs} +\selectlanguage{} +\foreignlanguage{}{Hier steht Text in Sprache B in einem Text in Sprache A} +``` + + +@slide(layout=extra-content-and-preview) + +@title +Sprachen – ein Beispiel + +@content +``` {.lang-tex .hljs} +\today +\selectlanguage{ngerman} +\today +\selectlanguage{swedish} +\today +\selectlanguage{ukrainian} +\today +\selectlanguage{greek} +\today +\selectlanguage{english} +\today +``` + +@preview +![](svg/chapter-03/languages-crop.svg) + + +@slide(layout=extra-content-and-preview) + +@title +Überschriften und das Inhaltsverzeichnis + +@content +Mit Sternchen fallen bei allen diesen Befehlen die Nummerierung und der Eintrag im Inhaltsverzeichnis weg: + +``` {.lang-tex .hljs} +\section*{Kein Verzeichniseintrag} +``` + +Außerdem kann für das Inhaltsverzeichnis ein alternativer Titel angegeben werden: + +``` {.lang-tex .hljs} +\section[Titel im Verzeichnis] +{Kapitelüberschrift} +``` + +@preview +![](svg/chapter-03/abschnitte-anders-crop.svg) + + +@slide(layout=content-only) + +@title +Bevor wir fortfahren können … + +@content +
+**Kommentiert** zuletzt die Präambel, die Dokumentenumgebung und das Inhaltsverzeichnis **wieder aus**. + +Nur so kann eure Lösung auch ins Skript eingebunden werden (Schnelles Auskommentieren kann in TeXstudio mit dem Shortcut Strg + T erreicht werden). +
+ +Im nächsten Kapitel erklären wir, warum das notwendig ist. \ No newline at end of file diff --git a/latex-wochenende-wise-2023/slides/basic-document-structure.en.md b/latex-wochenende-wise-2023/slides/basic-document-structure.en.md new file mode 100644 index 0000000..c7ac5d3 --- /dev/null +++ b/latex-wochenende-wise-2023/slides/basic-document-structure.en.md @@ -0,0 +1,411 @@ +@slide(layout=chapter-slide) + +@number +3 + +@title +Basic structure of a LATEX document + + +@slide(layout=content-and-preview) + +@title +Preamble & document environment + +@content +

👁 Every LaTeX document is composed of

+ +* a **preamble:** global settings (document class, encoding, language, page format, additional packages, …) and +* a **document environment:** content of the document. + +``` {.lang-tex .hljs .fragment} +\documentclass{article} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{babel} + +\begin{document} +Hello world! +\end{document} +``` + +@preview +![](svg/chapter-03/hello-crop.svg) + + +@slide(layout=wide-content) + +@title +Document class + +@content +``` {.lang-tex .hljs} +\documentclass[]{} +``` + +For example: + +``` {.lang-tex .hljs} +\documentclass[10pt,a5paper,landscape]{article} +``` + + +@slide(layout=content-only) + +@title +Encoding + +@content +``` {.lang-tex .hljs} +\usepackage[utf8]{inputenc} +\usepackage[t1]{fontenc} +``` + +* The character encoding determines which characters are available. +* **ASCII** contains no special characters like German umlauts. +* **UTF-8** is a universal encoding. + + +@slide(layout=content-only) + +@title +Language + +@content +``` {.lang-tex .hljs} +\usepackage[ngerman]{babel} +``` + +* The package **`babel`** provides language-specific information (e. g., hyphenation, special characters, font changes, translated labels like ‘chapter,’ ‘table of contents’ or ‘figure’). +* **`ngerman`** is the German new spelling. + + +@slide(layout=content-and-preview) + +@title +Continuous Text + +@content +``` {.lang-tex .hljs} +Continous text can be written directly ↲ +in the source code. ↲ +Simple line breaks ↲ +are ignored, ↲ +just as multiple space characters. ↲ +↲ +An empty line creates a new paragraph ↲ +which has an indentation by default. ↲ +Manual line breaks can be forced ↲ +using two backslashes, but this use ↲ +is strongly discouraged \\ ↲ +within continuous text. +``` + +@preview +![](svg/chapter-03/paragraphs-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Comments + +@content +After a percent sign, the rest of the line is ignored by the compiler. It is called a comment and does not appear in the resulting document. + +``` {.lang-tex .hljs} +% profile start +Name: Donald Knuth \\ +Date of birth: \\ % TODO: insert +Place of birth: Milwaukee, Wisconsin +% profile end +``` + +Shortcuts: Ctrl + T and Ctrl + U + +@preview +![](svg/chapter-02/comments-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Caution! + +@title +Reserved characters + +@content +Some characters do things in LaTeX: + +`# $ % ^ & _ { } ~ \` + +``` {.lang-tex .hljs} +50% is one half. +``` + +Solution: prefix with ‘`\`’: + +``` {.lang-tex .hljs} +50\% is one half. +``` + +Does not work for ‘`\\`’, use `\textbackslash` instead. + +@preview +![](svg/chapter-03/reserved-characters-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Sections and chapters + +@content +Texts are structured by beeing subdivided in sections and chapters. Always available: + +``` {.lang-tex .hljs} +\section{Level 1} +\subsection{Level 2} +\subsubsection{Level 3} +\paragraph{Level 4} +\subparagraph{Level 5} +``` + +Additionally, for some document classes: + +``` {.lang-tex .hljs} +\chapter{Chapter} +\part{Part} +``` + +@preview +![](svg/chapter-03/sections-crop.svg) + + +@slide(layout=wide-content) + +@title +Front matter + +@content +``` {.lang-tex .hljs data-source=title.tex} +\title{The World of Truffles} +\author{Fooboar Rüssel \and Fachschaft WIAI} +\date{\today} +\begin{document} +\maketitle +\end{document} +``` + +* The values for the entries are stored in the preamble. +* `\maketitle` typesets the front matter within the document environment. +* The exact appearance depends on the document class. +* Multiple authors can be joined with `\and`. +* If no date is given, the current date will be used. A different date can be defined with `\date{}`. + + +@slide(layout=content-and-preview) + +@title +Front matter + +@content +``` {.lang-tex .hljs data-source=title.tex} +\documentclass{article} +\usepackage{babel} +\title{The World of Truffles} +\author{Fooboar Rüssel +\and Fachschaft WIAI} +\date{\today} +\begin{document} +\maketitle +\section{Truffle hunt} +\subsection{Hunt with a pig} +\subsection{Hunt without a pig} +Why would you do that? +\section{Truffle recipes} +My favorite recipe +\end{document} +``` + +@preview +![](svg/chapter-03/title-orig.svg) + + +@slide(layout=content-only) + +@title +Registers + +@content +``` {.lang-tex .hljs} +\tableofcontents +\listoffigures +\listoftables +``` + +* automatic numbering +* elements with an asterisk (`*`) are hidden from the register: e. g. `\section*{}`. +* **generally requires two rounds of compilation** + + +@slide(layout=content-and-preview) + +@title +Table of contents + +@content +``` {.lang-tex .hljs data-source=title.tex} +\documentclass{article} +\usepackage{babel} +\begin{document} +\tableofcontents +\section{Truffle hunt} +The first section. +\subsection{Hunt with a pig} +A subsection. +\subsection{Hunt without a pig} +Another subsection. +\subsubsection[But why?] + {Why would you do that?} +Sub-subsection. +\section{Truffle recipes} +My favorite recipe +\end{document} +``` + +@preview +![](svg/chapter-03/contents-crop.svg) + + +@slide(layout=wide-task) + +@task-number +3 + +@title +Structure your document and text + +@content +* Open the file `document-structure.tex`. It is located in the directory `exercises/basic-document-structure`. +* Wrap the entire text in a **document** environment and insert the following **preamble**. Compile the document. + +``` {.lang-tex .hljs .fragment} +\documentclass{scrartcl} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage[english]{babel} +``` + +* As you may already have noticed, **paragraphs** are marked as ‘`\\`’. Use real paragraphs instead. +* Time to structure our document! Use LaTex commands to declare all **headings** (`\section`, `\subsubsection`, etc.). +* Add a **table of contents** to your document. + + +@slide(layout=extra-wide-content) + +@title +Document classes + +@content +* There are also other document classes than `article`. +* Based on the document class, the layout of the generated pdf file changes. +* Normally speled classes adhere to American English layout norms. +* **`src`** document classes usually adhere to European layout norms. + +Following document classes are available: + +* **`scrartcl`, `article`** for short documents +* **`scrreprt`, `report`** for longer documents +* **`scrbook`, `book`** for books +* **`beamer`** for presentations + + +@slide(layout=extra-wide-content) + +@title +Languages + +@content +A document can use multiple languages at once: + +``` {.lang-tex .hljs} +\usepackage[ngerman, swedish, ukrainian, greek, english]{babel} +``` + +To switch languages: + +``` {.lang-tex .hljs} +\selectlanguage{} +\selectlanguage{} +``` + +Embedded Text in another language: + +``` {.lang-tex .hljs} +\selectlanguage{} +\foreignlanguage{}{Text of language B in a Text of language A} +``` + + +@slide(layout=extra-content-and-preview) + +@title +Languages — an example + +@content +``` {.lang-tex .hljs} +\today +\selectlanguage{ngerman} +\today +\selectlanguage{swedish} +\today +\selectlanguage{ukrainian} +\today +\selectlanguage{greek} +\today +\selectlanguage{english} +\today +``` + +@preview +![](svg/chapter-03/languages-crop.svg) + + +@slide(layout=extra-content-and-preview) + +@title +Headlines and the table of contents + +@content +With an asterisk, there is no numbering and no entry in the table of contents: + +``` {.lang-tex .hljs} +\section*{No entry in table of contents} +``` + +You can also provide an alternative title for the table of contents: + +``` {.lang-tex .hljs} +\section[Entry in table of contents] +{Actual chapter heading} +``` + +@preview +![](svg/chapter-03/sections-differently-crop.svg) + + +@slide(layout=content-only) + +@title +Before we can continue … + +@content +
+Finally, **comment out** the preamble, the document environment, and the table of contents. + +Only this way, your solution can be embedded in the script itself. (In TeXstudio, comments can be achieved by the shortcut Strg + T.) +
+ +We will learn in the following chapter why this is the case. \ No newline at end of file diff --git a/latex-wochenende-wise-2023/slides/basic-functionality.de.md b/latex-wochenende-wise-2023/slides/basic-functionality.de.md new file mode 100644 index 0000000..c6f7320 --- /dev/null +++ b/latex-wochenende-wise-2023/slides/basic-functionality.de.md @@ -0,0 +1,91 @@ +@slide(layout=chapter-slide) + +@number +2 + +@title +Wie funktioniert LATEX? + + +@slide(layout=content-and-preview) + +@title +WYSIWaaas? + +@content +### What You See Is What You Get {data-category=Word} + +* Formatierung mit unmittelbarem optischen Feedback + +
+### What You See Is What You Mean {data-category=LaTeX} + +* Trennung von Inhalt und Struktur +* Formatierung erst am Ende ersichtlich +
+ +

+ Bildquelle: xkcd +

+ +@preview +![](svg/chapter-02/xkcd-types-of-editors.png) + + +@slide(layout=preview-only) + +@preview +![Der Weg zum fertigen Dokument](svg/chapter-02/wysiwyg.svg){} + + +@slide(layout=two-columns) + +@title +Was brauchen wir dazu? + +@column-one +### Editor +zum Schreiben unseres Quelltextes mit allen Befehlen zur semantischen Gliederung + +[TeXstudio](http://www.texstudio.org/), [TeXMaker](https://www.xm1math.net/texmaker/) + +@column-two +### Compiler +erstellt aus dem Quelltext ein fertig formatiertes PDF-Dokument + +[MiKTeX](http://miktex.org/), [MacTeX](http://tug.org/mactex/), [TeX Live](https://tug.org/texlive/) + + +@slide(layout=wide-content) + +@title +Befehle + +@content +Allgemeiner Aufbau eine Befehls: + +``` {.hljs .lang-txt} +\[]{} +``` + +++ Ein paar Beispiele: + +``` {.lang-tex .tex .hljs .fragment} +\newpage % fügt eine neue Seite ein +\textbf{fetter Text} % schreibt den übergebenen Text fett +\documentclass[10pt,a5paper,landscape]{article} % konfiguriert die Dokumentenklasse +\frac{1}{4} % fügt den mathematischen Bruch ein +``` + + +@slide(layout=content-only) + +@title +Backslash + +@content +Den Backslash erzeugt ihr mit folgender Tastenkombination: + +AltGr + ß (Windows/Linux) + +Alt + Shift + 7 (MacOS) diff --git a/latex-wochenende-wise-2023/slides/basic-functionality.en.md b/latex-wochenende-wise-2023/slides/basic-functionality.en.md new file mode 100644 index 0000000..0cf5521 --- /dev/null +++ b/latex-wochenende-wise-2023/slides/basic-functionality.en.md @@ -0,0 +1,93 @@ +@slide(layout=chapter-slide) + +@number +2 + +@title +How does
LATEX work? + + +@slide(layout=content-and-preview) + +@title +WYSIWhat? + +@content +### What You See Is What You Get {data-category=Word} + +* Formatting with immediate visual feedback + +
+### What You See Is What You Mean {data-category=LaTeX} + +* Separation of content and structure +* Formatting only visible afterwards +
+ +

+ Image source: xkcd +

+ +@preview +![](svg/chapter-02/xkcd-types-of-editors.png) + + +@slide(layout=preview-only) + +@preview +![How to get the final document](svg/chapter-02/wysiwyg.svg){} + + +@slide(layout=two-columns) + +@title +What do we need? + +@column-one +### Editor +writing our source code including all the commands that structure the text semantically + +[TeXstudio](http://www.texstudio.org/), [TeXMaker](https://www.xm1math.net/texmaker/) + +@column-two +### Compiler +takes the source code and creates a PDF document ready for publication + +[MiKTeX](http://miktex.org/), [MacTeX](http://tug.org/mactex/), [TeX Live](https://tug.org/texlive/) + + +@slide(layout=wide-content) + +@title +Commands + +@content +General structure of a command: + +``` {.hljs .lang-txt} +\[]{} +``` + +++ A few examples: + +``` {.lang-tex .tex .hljs .fragment} +\newpage % inserts a new page +\textbf{bold text} % formats the text bold +\documentclass[a4paper,12pt, landscape]{article} % configures the document class +\frac{1}{4} % inserts a mathematical fraction +``` + + +@slide(layout=content-only) + +@title +Backslash + +@content +You get the backslash by pressing + +AltGr + ß (Windows/Linux) + +Alt + Shift + 7 (MacOS) + + diff --git a/latex-wochenende-wise-2023/slides/graphics.de.md b/latex-wochenende-wise-2023/slides/graphics.de.md new file mode 100644 index 0000000..c261788 --- /dev/null +++ b/latex-wochenende-wise-2023/slides/graphics.de.md @@ -0,0 +1,113 @@ +@slide(layout=chapter-slide) + +@number +9 + +@title +Grafiken + + +@slide(layout=content-only) + +@title +Grafiken abbilden 🖼️ + +@content +Um Grafiken darzustellen, muss das Paket `graphicx` eingebunden werden. + +``` {.lang-tex .hljs} +\begin{figure} + \includegraphics{} + \caption[]{} +\end{figure} +``` + +Bildgröße angeben: + +``` {.lang-tex .hljs} +\includegraphics[width=0.5\textwidth, +height=5cm]{} +``` + + +@slide(layout=content-only) + +@title +Positionierung auf der Seite + +@content + +``` {.lang-tex .hljs} +\begin{figure}[] +``` + +LaTeX positioniert Grafiken automatisch. Durch Kürzel können wir unsere Präferenzen (auch in Kombination) angeben. + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KürzelPosition
hhier, wenn es dir recht ist
toberer Seitenrand (top)
bunterer Seitenrand (bottom)
pauf einer eigenen Seite (page)
HHier, verdammt noch mal!
(benötigt Paket `float`)
+ + +@slide(layout=content-only) + +@title +Zentrierte Anordnung + +@content +``` {.lang-tex .hljs} +\begin{figure}[] + \begin{center} + \includegraphics{} + \end{center} +\end{figure} +``` + +Alternativ: + +``` {.lang-tex .hljs} +\begin{figure}[] + \centering + \includegraphics{} +\end{figure} +``` + + +@slide(layout=task) + +@task-number +9 + +@title +Grafiken einfügen + +@content +* Im Ordner `exercises/graphics` findet ihr eine Bilddatei namens `latex-logo.png`. +* Fügt sie **genau** unterhalb dieser Aufgabenstellung im Skript ein. +* Das Bild soll **zentriert** auf der Seite eingebunden werden. +* Fügt außerdem eine **Bildunterschrift** ein. +* Passt die **Größe** des Bildes an Breite der Seite (`\textwidth`) an. diff --git a/latex-wochenende-wise-2023/slides/graphics.en.md b/latex-wochenende-wise-2023/slides/graphics.en.md new file mode 100644 index 0000000..155d4f2 --- /dev/null +++ b/latex-wochenende-wise-2023/slides/graphics.en.md @@ -0,0 +1,113 @@ +@slide(layout=chapter-slide) + +@number +9 + +@title +Graphics + + +@slide(layout=content-only) + +@title +Including graphics 🖼️ + +@content +To display graphics, we need the `graphicx` package. + +``` {.lang-tex .hljs} +\begin{figure} + \includegraphics{} + \caption[]{} +\end{figure} +``` + +Specifying the size: + +``` {.lang-tex .hljs} +\includegraphics[width=0.5\textwidth, +height=5cm]{} +``` + + +@slide(layout=content-only) + +@title +Layout on the page + +@content + +``` {.lang-tex .hljs} +\begin{figure}[] +``` + +LaTeX places graphics automatically. With position codes, we can express our preferences (they can be combined as well). + + + + + + + + + + + + + + + + + + + + + + + + + + + +
codeposition
hhere, if you don’t mind
ttop of the page
bbottom of the page
pon its own page
HHere, for God’s sake!
(`float` package required)
+ + +@slide(layout=content-only) + +@title +Centred alignment + +@content +``` {.lang-tex .hljs} +\begin{figure}[] + \begin{center} + \includegraphics{} + \end{center} +\end{figure} +``` + +Alternatively: + +``` {.lang-tex .hljs} +\begin{figure}[] + \centering + \includegraphics{} +\end{figure} +``` + + +@slide(layout=task) + +@task-number +9 + +@title +Inserting graphics + +@content +* In the directory `exercises/graphics` you can find an image file named `latex-logo.png`. +* **Include** the figure in `exercises/graphics/graphics.tex` and place it **exactly** where you include it. +* The image shall be **centered**. +* Additionally, add a **caption** for the figure. +* Adapt the **width** of the image to the width of the text (`\textwidth`). diff --git a/latex-wochenende-wise-2023/slides/intro.de.md b/latex-wochenende-wise-2023/slides/intro.de.md new file mode 100644 index 0000000..72f677b --- /dev/null +++ b/latex-wochenende-wise-2023/slides/intro.de.md @@ -0,0 +1,67 @@ +@slide(layout=chapter-slide) + +@number +0 + +@title +Erste Schritte mit LATEX + +@content +Um das Skript für das Tutorium kompilieren zu können, müssen zunächst ein paar Konfigurationgen gemacht werden, die in den nächsten Folien erklärt werden. + +@slide(layout=content-only) + +@title +Exkurs: Eine Kommandozeile öffnen + +@content +* Für die kommenden Aufgaben brauchen wir eine Kommandozeile +* Je nach Betriebssystem, das verwendet wird, gibt es unteschiedliche Wege, sie zu öffnen +* **Windows**: Drückt die Windows-Taste, tippt *cmd* und drückt Enter +* **MacOS**: Drückt die *Command*-Taste und die Leertaste gleichzeitig, tippt danach *Terminal* und macht einen Doppelklick auf *Terminal* +* **Linux**: Drückt ``Strg + Alt + T`` + +@slide(layout=content-only) + +@title +Den Compiler installieren + +@content +* Der Compiler übersetzt unseren LaTeX-Code in ein PDF +* Je nach Betriebssystem stehen unterschiedliche Compiler zur Verfügung: +* Windows: MikTEX +* Linux-Distributionen: TEXLive + * Debian-basierte Distros: Führt `sudo apt install texlive-full` aus + * Andere Distributionen: Folgt den anweisungen auf der TEXLive-Website + +
+Bitte achtet darauf, die full version mit allen Paketen zu installieren, wenn ihr die Auswahl habt! +
+ +@slide(layout=content-only) + +@title +Installieren des Editors + +@content +* Ein Editor kann heruntergeladen werden, sobald die Installation des Compilers fertig ist +* Es funktioniert jeglicher Text-Editor, wie etwa Notepad++ oder VSCode +* Für Anfänger:innen empfehlen wir jedoch TEXstudio, da es LaTeX-spezifische Features bietet +* Ladet TEXstudio herunter und installiert es + + + +@slide(layout=content-only) +@title +Kompilieren des Skriptes + +@content +* Ladet das Projektarchiv aus dem VC herunter +* Entpackt das Archiv +* Öffnet die Datei main-exercises.tex in TeXstudio. Ihr findet es im Wurzelverzeichnis des Archivs +* Kompiliert die Datei, indem ihr klickt +* Einige neue Dateien sollten nun durch das Kompilieren generiert werden + +
+Windows-Nutzer:innen: Um Dateiendungen zu aktivieren, klickt auf das Ansichts-Tab im Dateiexplorer und wählt *Dateiendungen*. So könnt ihr besser zwischen den einzelnen main-Files unterscheiden. +
diff --git a/latex-wochenende-wise-2023/slides/intro.en.md b/latex-wochenende-wise-2023/slides/intro.en.md new file mode 100644 index 0000000..fa418c5 --- /dev/null +++ b/latex-wochenende-wise-2023/slides/intro.en.md @@ -0,0 +1,67 @@ +@slide(layout=chapter-slide) + +@number +0 + +@title +First steps with LATEX + +@content +In order to compile the script for this tutorial, a few steps have to be followed, which are explained in the next slides. + +@slide(layout=content-only) + +@title +Digression: Opening a command prompt + +@content +* For the following tasks, we are going to need a command prompt +* It can be opened in different ways, depending on your operating system + + * **Windows**: Press the Windows key and type in *cmd*, press Enter + * **MacOS**: Press the *Command* key and the *space bar* simultaneously, then type in *Terminal* and double click on *Terminal* + * **Linux**: Press ``Ctrl + Alt + T`` + +@slide(layout=content-only) + +@title +Installing the compiler + +@content +* The compiler translates our LATEX code into a PDF +* Depending on your operating system, different compilers are available +* Windows: MikTEX +* macOS: MacTEX +* Linux distributions: TEXLive + * Debian-based distributions: run `sudo apt install texlive-full` + * other distributions: see the TEXLive website + +
+Make sure to install the full version with all packages, if you can! +
+ +@slide(layout=content-only) + +@title +Installing the editor + +@content +* An editor can downloaded once the compiler has been installed +* For editing LaTeX documents, any text editor works fine, e.g., Notepad++, VSCode +* For beginners, TEXstudio is recommended due to its LaTeX-specific features +* Download and install TEXstudio + +@slide(layout=content-only) +@title +Compile the script for the first time + +@content +* Download the project archive from the VC. +* Unzip the archive. +* Open the file `main-exercises.tex` in TEXstudio. It is located in the root directory of the archive. +* Compile `main-exercises.tex` by pressing +* A few new files will be generated by the compilation. + +
+Windows users: In order to enable file endings, click the view tab in the file explorer, and select *file name extensions*. This helps differentiating the different ``main`` files. +
diff --git a/latex-wochenende-wise-2023/slides/lists.de.md b/latex-wochenende-wise-2023/slides/lists.de.md new file mode 100644 index 0000000..e94c732 --- /dev/null +++ b/latex-wochenende-wise-2023/slides/lists.de.md @@ -0,0 +1,164 @@ +@slide(layout=chapter-slide) + +@number +7 + +@title +Aufzählungen + +@slide(layout=content-and-preview) + +@title +Ungeordnete Listen 📜 + +@content +``` {.lang-tex .hljs} +\begin{itemize} + \item Nudelplatten + \item Passierte Tomaten, % … + \item Oregano, Basilikum, % … + \item Mozzarella + \item Mehl + \item Milch +\end{itemize} +``` + +Die einzelnen Stichpunkte werden in jeder Aufzählungsumgebung durch den Befehl `\item` gekennzeichnet. + +@preview +![](svg/chapter-08/itemize-crop.svg) + +@slide(layout=content-and-preview) + +@title +Geordnete Listen und Definitionslisten + +@content +``` {.lang-tex .hljs} +\begin{enumerate} + \item die Zwiebeln in einem Topf % … + \item passierte Tomaten, Möhren % … + \item mit Kräutern und Gewürzen % … + % \item … +\end{enumerate} +``` + +``` {.lang-tex .hljs .fragment} +\begin{description} + \item [Béchamelsauce] Béchamel % … + \item [Lasagne] Als Lasagne % … +\end{description} +``` + +@preview + + + +@slide(layout=content-and-preview) + +@title +Verschachtelte Listen + +@content +``` {.lang-tex .hljs} +\begin{itemize} + % … + \item Gemüse \begin{itemize} + \item Passierte Tomaten + \item Möhren + \end{itemize} + \item Kräuter \begin{enumerate} + \item Oregano + \item Basilikum + \end{enumerate} + % … +\end{itemize} +``` + +@preview +![](svg/chapter-08/nested-lists-crop.svg) + +@slide(layout=task) + +@task-number +7 + +@title +Aufzählungen einfügen + +@content +* Formatiert das Rezept in `lists.tex` im Ordner `exercises/lists` als **ungeordnete Liste** mit den Elementen *Ingredients* und *Instructions*. Nutzt dafür den Befehl `\itemize`. +* Benutzt innerhalb dieser Liste für die Zutaten eine **ungeordnete Liste** und für die Arbeitsschritte eine **geordnete Liste**. + + +@slide(layout=extra-content-and-preview) + +@title +Kompakte Listen + +@content +Das Paket `paralist` stellt Aufzählungen ohne riesige Zwischenräume zur Verfügung. + +``` {.lang-tex .hljs} +\section{Zutaten} +\begin{compactitem} + % \item … +\end{compactitem} +\section{Zubereitung} +\begin{compactenum} + % \item … +\end{compactenum} +\section{Glossar} +\begin{compactdesc} + % \item … +\end{compactdesc} +``` + +@preview +![](svg/chapter-08/compact-crop.svg) + +@slide(layout=extra-content-and-preview) + +@title +Aufzählungen im Absatz + +@content +Neben den kompakten Listen stellt `paralist` auch Listen zur Verfügung, die in einem Absatz stehen. + +``` {.lang-tex .hljs} +Folgende Kräuter sind für % … +\begin{inparaitem} + \item Liebstöckel + \item Petersilie + \item Schnittlauch +\end{inparaitem} +``` + +Natürlich gibt es auch hier ein Pendant namens `inparaenum` für geordnete Listen. + +@preview + + + +@slide(layout=extra-content-and-preview) + +@title +Aufzählungsarten + +@content +Die Art der Aufzählung lässt sich über den optionalen Parameter `label` ändern. Hierfür ist das Paket `enumitem` notwendig. + +``` {.lang-tex .hljs} +% Römische Zahlen +\begin{enumerate}[label=\roman*] +% … +% Arabische Zahlen +\begin{enumerate}[label=\arabic*] +% … +% Alphabetisch +\begin{enumerate}[label=\alph*] +% … +``` + +@preview +![](svg/chapter-08/list-style-types-crop.svg) \ No newline at end of file diff --git a/latex-wochenende-wise-2023/slides/lists.en.md b/latex-wochenende-wise-2023/slides/lists.en.md new file mode 100644 index 0000000..90d4f87 --- /dev/null +++ b/latex-wochenende-wise-2023/slides/lists.en.md @@ -0,0 +1,167 @@ +@slide(layout=chapter-slide) + +@number +7 + +@title +Enumerations + +@slide(layout=content-and-preview) + +@title +Unordered lists 📜 + +@content +``` {.lang-tex .hljs} +\begin{itemize} + \item lasagna noodles + \item crushed tomatoes, % … + \item oregano, basil, % … + \item mozzarella cheese + \item flour + \item milk +\end{itemize} +``` + +We mark each bullet point with `\item`. +This pattern is the same for all kinds of enumerations. + +@preview +![](svg/chapter-08/itemize-english-crop.svg) + +@slide(layout=content-and-preview) + +@title +Ordered and definition lists + +@content +``` {.lang-tex .hljs} +\begin{enumerate} + \item cook onions over medium % … + \item add crushed tomatoes, carrots % … + \item add herbs and spices % … + % \item … +\end{enumerate} +``` + +``` {.lang-tex .hljs .fragment} +\begin{description} + \item [Béchamel sauce] Béchamel % … + \item [Lasagne] Lasagne (singular % … +\end{description} +``` + +@preview + + + +@slide(layout=content-and-preview) + +@title +Nested lists + +@content +``` {.lang-tex .hljs} +\begin{itemize} + % … + \item vegetables \begin{itemize} + \item crushed tomatoes + \item carrots + \end{itemize} + \item herbs \begin{enumerate} + \item oregano + \item basil + \end{enumerate} + % … +\end{itemize} +``` + +@preview +![](svg/chapter-08/nested-lists-english-crop.svg) + + +@slide(layout=task) + +@task-number +7 + +@title +Adding enumerations + +@content +* Turn the recipe in `lists.tex` into an **unordered list** consisting of the elements *Ingredients* and *Instructions*. You can find the file in the directory `exercises/lists`. Use the `itemize` command. +* Within this list, create a **unordered list** for the ingredients and a **ordered list** for the instructions. + + +@slide(layout=extra-content-and-preview) + +@title +Compact lists + +@content +The package `paralist` offers enumerations with less line spacing. + +``` {.lang-tex .hljs} +\section{Ingredients} +\begin{compactitem} + % \item … +\end{compactitem} +\section{Preparation} +\begin{compactenum} + % \item … +\end{compactenum} +\section{Glossary} +\begin{compactdesc} + % \item … +\end{compactdesc} +``` + +@preview +![](svg/chapter-08/compact-english-crop.svg) + +@slide(layout=extra-content-and-preview) + +@title +In-line enumerations + +@content +Another feature provided by `paralist` enables us to integrate enumerations into paragraphs. + +``` {.lang-tex .hljs} +The following herbs are % … +\begin{inparaitem} + \item lovage + \item parsley + \item chives +\end{inparaitem} +``` + +Of course, there is an accompanying list type called `inparaenum` for ordered lists. + +@preview + + + +@slide(layout=extra-content-and-preview) + +@title +List styles + +@content +The list style type can be set using the optional parameter `label`. +To accomplish this, we need to include the package `enumitem` first. + +``` {.lang-tex .hljs} +% Roman numerals +\begin{enumerate}[label=\roman*] +% … +% Arabic numerals +\begin{enumerate}[label=\arabic*] +% … +% Alphabetical +\begin{enumerate}[label=\alph*] +% … +``` + +@preview +![](svg/chapter-08/list-style-types-english-crop.svg) \ No newline at end of file diff --git a/latex-wochenende-wise-2023/slides/literature.de.md b/latex-wochenende-wise-2023/slides/literature.de.md new file mode 100644 index 0000000..5c3689d --- /dev/null +++ b/latex-wochenende-wise-2023/slides/literature.de.md @@ -0,0 +1,114 @@ +@slide(layout=chapter-slide) + +@number +12 + +@title +Literatur­verwaltung + + +@slide(layout=content-only) + +@title +Was brauchen wir dafür? + +@content +* eine **Bibliographiedatei** (nachfolgend `.bib`-Datei) zur Speicherung von Literaturverweisen +* **BibTeX** als Schnittstelle zwischen der Literatur und LaTeX + + +@slide(layout=wide-content) + +@title +Was ist diese ominöse `.bib`-Datei? + +@content +* Sammlung von Literatureinträgen im BibTeX-Format +* Beispielhafter Literatureintrag: + +``` {.hljs .lang-tex} +@article{turing1990, % Art des Dokuments und Bezeichner für den \cite Befehl + title={The chemical basis of morphogenesis}, % Titel + 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 +} +``` + + +@slide(layout=content-only) + +@title +Wie wird das verwendet? + +@content +Durch BibTeX wird LaTeX um einige Befehle zum Zitieren erweitert. Außerdem benötigt wird das Paket `natbib`. + +* ++ Zitieren eines Autors: `\citeauthor{}` +* ++ Zitieren einer Quelle: `\cite{}` +* ++ Zitieren einer Seite: `\cite[S. 15]{}` +* ++ Zitieren mit weiteren Zusätzen:
`\cite[][]{}` +* ++ Verweis auf die genutzte `.bib`-Datei: `\bibliography{<.bib-datei>}` +* ++ Angabe des genutzten Zitierstils:
`\bibliographystyle{}` + +> Zwei Dinge sind unendlich. Das Universum und die Auswahl an Zitierstilen.Unbekannt + + +@slide(layout=preview-only) + +@preview +![Zitieren im Alpha-Zitierstil](svg/chapter-14/bibtex-alpha-crop.svg){.large .thin-padding} + + +@slide(layout=preview-only) + +@preview +![Zitieren im Natdin-Zitierstil](svg/chapter-14/bibtex-natdin-crop.svg){.large .thin-padding} + + +@slide(layout=preview-only) + +@preview +![Finden von fertigen BibTeX-Einträgen – Bamberger Katalog](svg/chapter-14/bamberger_katalog_bibtex.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finden von fertigen BibTeX-Einträgen – Google Scholar](svg/chapter-14/google_bibtex1.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finden von fertigen BibTeX-Einträgen – Google Scholar](svg/chapter-14/google_bibtex2.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finden von fertigen BibTeX-Einträgen – dblp.org](svg/chapter-14/dblp.jpg){.large} + + +@slide(layout=wide-task) + +@task-number +12 + +@title +Ein Literaturverzeichnis erstellen und einfügen + +@content +* Erstellt im Ordner `exercises/literature` eine neue BibTeX-Datei `literature.bib`. +* Sucht bei Google Scholar oder dblp.org die BibTeX-Einträge für folgende $\LaTeX$-Handbücher: + * Dilip Datta (2017): $\LaTeX$ in 24 Hours. A Practical Guide for Scientific Writing. + * Frank Mittelbach / Michel Goossens (2012): Der $\LaTeX$-Begleiter. +* Fügt die BibTeX-Einträge in die BibTeX-Datei ein. +* Vergebt aussagekräftige BibTeX-Keys. +* Bindet die BibTeX-Datei an einer geeigneten Stelle ein, an der später auch das Literaturverzeichnis zu sehen sein soll. +* Zitiert die zwei Handbücher im Text in der Datei `exercises/literature/literature.tex`. +* Wählt den Bibliographiestil `plain`. + diff --git a/latex-wochenende-wise-2023/slides/literature.en.md b/latex-wochenende-wise-2023/slides/literature.en.md new file mode 100644 index 0000000..79325df --- /dev/null +++ b/latex-wochenende-wise-2023/slides/literature.en.md @@ -0,0 +1,114 @@ +@slide(layout=chapter-slide) + +@number +12 + +@title +Reference management + + +@slide(layout=content-only) + +@title +What do we need? + +@content +* a **bibliography file** (hereafter `.bib` file) for storing references +* **BibTeX** as an interface between the references and LaTeX + + +@slide(layout=wide-content) + +@title +What is this mysterious `.bib` file? + +@content +* collection of references in BibTeX format +* example: + +``` {.hljs .lang-tex} +@article{turing1990, % the type of the document and an identifier for the \cite command + title={The chemical basis of morphogenesis}, % information + author={Turing, Alan Mathison}, % about + journal={Bulletin of mathematical biology}, % the + volume={52}, % literature + pages={153--197}, % work + year={1990}, % follows + publisher={Springer} % … +} +``` + + +@slide(layout=content-only) + +@title +How is it used? + +@content +BibTeX adds some citation commands to LaTeX. In addition, we need the `natbib` package. + +* ++ Citing an author: `\citeauthor{}` +* ++ Citing a source: `\cite{}` +* ++ Citing a page: `\cite[p. 15]{}` +* ++ Citing with additional text:
`\cite[][]{}` +* ++ Referencing the `.bib` file: `\bibliography{<.bib file>}` +* ++ Choosing a citation style:
`\bibliographystyle{}` + +> Two things are infinite: the universe and the assortment of citation styles.Unknown + + +@slide(layout=preview-only) + +@preview +![Citing in Alpha style](svg/chapter-14/bibtex-alpha-example-crop.svg){.large .thin-padding} + + +@slide(layout=preview-only) + +@preview +![Citing in Natdin style](svg/chapter-14/bibtex-natdin-example-crop.svg){.large .thin-padding} + + +@slide(layout=preview-only) + +@preview +![Finding ready-made BibTeX entries – University of Bamberg Library](svg/chapter-14/bamberg_catalogue_bibtex.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finding ready-made BibTeX entries – Google Scholar](svg/chapter-14/google_bibtex1.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finding ready-made BibTeX entries – Google Scholar](svg/chapter-14/google_bibtex2.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finding ready-made BibTeX entries – dblp.org](svg/chapter-14/dblp.jpg){.large} + + +@slide(layout=wide-task) + +@task-number +12 + +@title + +Creating and inserting references + +@content +* Create a new BibTeX file called `literature.bib` in the `exercises/literature` folder. +* Use Google Scholar or dblp.org to retrieve BibTeX references for the following $\LaTeX$ handbooks: + * Dilip Datta (2017): $\LaTeX$ in 24 Hours. A Practical Guide for Scientific Writing. + * Frank Mittelbach / Michel Goossens (2012): Der $\LaTeX$-Begleiter. +* Add the BibTeX entries to the BibTeX file. +* Assign unique and meaningful BibTeX keys. +* Include the BibTeX file in a suitable location, where later on the references should be listed. +* Cite the two handbooks in the file `exercises/literature/literature.tex`. +* Make use of the `plain` bibliography style. diff --git a/latex-wochenende-wise-2023/slides/maths.de.md b/latex-wochenende-wise-2023/slides/maths.de.md new file mode 100644 index 0000000..43f00eb --- /dev/null +++ b/latex-wochenende-wise-2023/slides/maths.de.md @@ -0,0 +1,228 @@ +@slide(layout=chapter-slide) + +@number +8 + +@title +Mathematische Formeln + +@slide(layout=content-and-preview) + +@title +Formel-Umgebungen 🧮 + +@content +``` {.lang-tex .hljs} +$2 \sqrt{\frac{\pi^2}{3} \cdot c_2}$ +``` + +Mathematische Formeln können **nur im sogenannten Mathmode** gesetzt werden, der inline durch zwei Dollarzeichen aktiviert wird. Außerdem gibt es eine Blockumgebung: + +``` {.lang-tex .hljs} +\begin{equation} + 2 \sqrt{\frac{\pi^2}{3} \cdot c_2} +\end{equation} +``` + +Pakete: `amsmath`, `amsthm`, `amssymb`, `mathtools` + +@preview +![](svg/chapter-09/simple-maths-crop.svg) + +@slide(layout=content-only) + +@title +Einige Beispiele + +@content + + + + + + + + + + + + + + + + + +
QuelltextErgebnis
`\sum_{i=1}^{n}x^2`$\sum_{i=1}^{n} x^2$
`12 \leq 4 x^2 + 13`$12 \leq 4 x^2 + 13$
`{n \choose k}`${n \choose k}$
+ + +@slide(layout=content-and-preview) + +@title +Ausrichtung von mehreren Gleichungen + +@content +Die Umgebung `align` erlaubt es, Gleichungen zum Beispiel am › = ‹ auszurichten. + +``` {.lang-tex .hljs} +\begin{align} + 13 \cdot (4a - 3)^2 &= 13 … \\ + &= 208a^2 - 312a + 117 +\end{align} +``` + +* ++ Ausgerichtet wird am ›`&`‹-Zeichen. +* ++ Zeilenumbrüche werden mit ›`\\`‹ markiert. +* ++ Die Nummerierung kann bei `align` und `equation` durch durch ein Sternchen nach dem Umgebungsnamen (z. B. `\begin{align*}` und `\end{align*}`) unterdrückt werden. + +@preview +![](svg/chapter-09/alignment-crop.svg) + + +@slide(layout=task-without-number) + +@task-number +8a + +@title +Formeln setzen + +@content +Setzt die folgenden Formeln in der Datei `exercises/maths/math-formulas.tex`. + +| Bedeutung | Ergebnis | +|-----------|----------| +| Fallbeschleunigung (Deutschland) | $9,81\,\frac{m}{s^2}$ | +| pq-Formel | $x_{1,2} = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}$ | +| Mitternachtsformel | $x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ | +| Catalansche Zahlen | $C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!}$ | + +@slide(layout=task-without-number) + +@task-number +8b + +@title +Formeln setzen + +@content +Setzt die folgenden Formeln in der Datei `exercises/maths/math-formulas.tex`. + +| Bedeutung | Ergebnis | +|-----------|----------| +| Definition der Fakultät | $n! = \prod_{i=1}^{n} i$ | +| Menge aller ungeraden natürlichen Zahlen | $\{ x \mid x \in \mathbb{N}, \text{ungerade}(x) \}$ | +| Elimination $\neg\exists x$ | $\neg\exists x . p(x) \Leftrightarrow \forall x . \neg p(x)$ | + + + +@slide(layout=extra-content-only) + +@title +Weitere Beispiele + +@content + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QuelltextErgebnis
`(x)`, `[x]`, `\lbrace x \rbrace`, `\lvert x \rvert`$(x), [x], \lbrace x\rbrace, \lvert x\rvert$
`\exists`, `\forall`, `\in`,
`\notin`, `\infty`
$\exists,\forall,\in,\notin,\infty$
`\alpha`, `\beta`, `\Gamma`,
`\Delta`, `\varepsilon`, `\pi`
$\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi$
`\rightarrow`, `\leftarrow`, `\Rightarrow`, `\Leftarrow`, `\Leftrightarrow`$\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow$
`(A \cup B) \cap C`$(A \cup B) \cap C$
`(A \lor B) \land C`$(A \lor B) \land C$
`(A \cdot B) \times C`$(A \cdot B) \times C$
+ +@slide(layout=extra-content-only) + +@title +Mitwachsende Klammern + +@content + + + + + + + + + + + + + + + + + +
QuelltextErgebnis
`\left( \frac{1}{2} \right)`$\left( \frac{1}{2} \right)$
`\left[ \frac{1}{2} \right]`$\left[ \frac{1}{2} \right]$
`\left\lbrace \frac{1}{2} \right\rbrace`$\left\lbrace \frac{1}{2} \right\rbrace$
+ + +``` {.lang-tex .hljs} +$4 \cdot \left( \frac{1}{2} % … +``` + +

$4 \cdot \left(\frac{1}{2} +\frac{3}{ 12 \cdot \left( 2 + \frac{1}{86 \cdot \left(\frac{1}{2} + 24 \right)} \right)} \right)$

+ + +@slide(layout=extra-content-and-preview) + +@title +Darstellung von Grenzen + +@content +Mit dem Befehl `\limits` lassen sich die Grenzen von Integralen unter und über dem Integralzeichen darstellen. Bei Summen, Produkten und Grenzwerten geschieht das automatisch. + +``` {.lang-tex .hljs} +\sum_{i=1}^{n^2}(x+2) +\prod_{j=1}^{100}(3 \cdot x) +\lim_{x \rightarrow \infty}(14x^3 - 12) +\int\limits_{-12}^{4}(14x^3 - 12) +``` + +

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

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

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

+

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

+ +``` {.lang-tex .hljs} +$\left\lbrace x \mid \text{tiefe}(x) … +``` \ No newline at end of file diff --git a/latex-wochenende-wise-2023/slides/maths.en.md b/latex-wochenende-wise-2023/slides/maths.en.md new file mode 100644 index 0000000..c8734ce --- /dev/null +++ b/latex-wochenende-wise-2023/slides/maths.en.md @@ -0,0 +1,233 @@ +@slide(layout=chapter-slide) + +@number +8 + +@title +Typesetting mathematics + +@slide(layout=content-and-preview) + +@title +Formula environments 🧮 + +@content +``` {.lang-tex .hljs} +$2 \sqrt{\frac{\pi^2}{3} \cdot c_2}$ +``` + +Mathematical formulas are only accepted in the so-called **math mode.** +In-line formulas must therefor be guarded by two dollar signs. +We can also use the `equation` block environment: + +``` {.lang-tex .hljs} +\begin{equation} + 2 \sqrt{\frac{\pi^2}{3} \cdot c_2} +\end{equation} +``` + +Packages: `amsmath`, `amsthm`, `amssymb`, `mathtools` + +@preview +![](svg/chapter-09/simple-maths-crop.svg) + +@slide(layout=content-only) + +@title +Examples + +@content + + + + + + + + + + + + + + + + + +
source coderesult
`\sum_{i=1}^{n}x^2`$\sum_{i=1}^{n} x^2$
`12 \leq 4 x^2 + 13`$12 \leq 4 x^2 + 13$
`{n \choose k}`${n \choose k}$
+ + +@slide(layout=content-and-preview) + +@title +Aligning a group of equations + +@content +The `align` environment permits us to align equations at certain positions like the ‘ = ’ character. + +``` {.lang-tex .hljs} +\begin{align} + 13 \cdot (4a - 3)^2 &= 13 … \\ + &= 208a^2 - 312a + 117 +\end{align} +``` + +* ++ The equations will be aligned with respect to the ampersands (‘`&`’). +* ++ We can mark a new line using ‘`\\`’. +* ++ `align` and `equation` will not be numbered if we add an asterisk after their names (e. g. `\begin{align*}` and `\end{align*}`). + +@preview +![](svg/chapter-09/alignment-crop.svg) + + +@slide(layout=task-without-number) + +@task-number +8a + +@title +Typesetting mathematics + +@content +Code up the following formulas in the file `exercises/maths/math-formulas.tex`. + +| Meaning | Result | +|---------|--------| +| Gravitational acceleration | $9,81\,\frac{m}{s^2}$ | +| Formula to solve quadratic equations | $x_{1,2} = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}$ | +| Another formula to solve quadratic equations | $x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ | +| Catalan numbers | $C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!}$ | + + +@slide(layout=task-without-number) + +@task-number +8b + +@title +Typesetting mathematics + +@content +Code up the following formulas in the file `exercises/maths/math-formulas.tex`. + +| Meaning | Result | +|---------|--------| +| Definition of factorial | $n! = \prod_{i=1}^{n} i$ | +| Set of all odd natural numbers | $\{ x \mid x \in \mathbb{N}, \text{odd}(x) \}$ | +| Elimination $\neg\exists x$ | $\neg\exists x . p(x) \Leftrightarrow \forall x . \neg p(x)$ | + + + +@slide(layout=extra-content-only) + +@title +More examples + +@content + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
source coderesult
`(x)`, `[x]`, `\lbrace x \rbrace`, `\lvert x \rvert`$(x), [x], \lbrace x\rbrace, \lvert x\rvert$
`\exists`, `\forall`, `\in`,
`\notin`, `\infty`
$\exists,\forall,\in,\notin,\infty$
`\alpha`, `\beta`, `\Gamma`,
`\Delta`, `\varepsilon`, `\pi`
$\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi$
`\rightarrow`, `\leftarrow`, `\Rightarrow`, `\Leftarrow`, `\Leftrightarrow`$\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow$
`(A \cup B) \cap C`$(A \cup B) \cap C$
`(A \lor B) \land C`$(A \lor B) \land C$
`(A \cdot B) \times C`$(A \cdot B) \times C$
+ +@slide(layout=extra-content-only) + +@title +Height-adapting braces + +@content + + + + + + + + + + + + + + + + + +
source coderesult
`\left( \frac{1}{2} \right)`$\left( \frac{1}{2} \right)$
`\left[ \frac{1}{2} \right]`$\left[ \frac{1}{2} \right]$
`\left\lbrace \frac{1}{2} \right\rbrace`$\left\lbrace \frac{1}{2} \right\rbrace$
+ + +``` {.lang-tex .hljs} +$4 \cdot \left( \frac{1}{2} % … +``` + +

$4 \cdot \left(\frac{1}{2} +\frac{3}{ 12 \cdot \left( 2 + \frac{1}{86 \cdot \left(\frac{1}{2} + 24 \right)} \right)} \right)$

+ + +@slide(layout=extra-content-and-preview) + +@title +Depicting boundaries + +@content +The bounds of an integral can be enforced to appear above and below the integral symbol using the `\limits` command. +This is the standard behaviour for sums, products and limits. + +``` {.lang-tex .hljs} +\sum_{i=1}^{n^2}(x+2) +\prod_{j=1}^{100}(3 \cdot x) +\lim_{x \rightarrow \infty}(14x^3 - 12) +\int\limits_{-12}^{4}(14x^3 - 12) +``` + +

Don't use `\limits` inline.

+ + +@preview +![](svg/chapter-09/limits-crop.svg) + + +@slide(layout=extra-content-only) + +@title +Set-builder notation + +@content +In certain situations, it is more adequate to use textual predicates or long function names within the set builder notation. + +This is where `\text{}` comes into play. + +

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

+

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

+ +``` {.lang-tex .hljs .fragment} +$\left\lbrace x \mid \text{frequency} … +``` \ No newline at end of file diff --git a/latex-wochenende-wise-2023/slides/packages.de.md b/latex-wochenende-wise-2023/slides/packages.de.md new file mode 100644 index 0000000..959fc1e --- /dev/null +++ b/latex-wochenende-wise-2023/slides/packages.de.md @@ -0,0 +1,214 @@ +@slide(layout=chapter-slide) + +@number +14 + +@title +Paket in Sicht! + +@slide(layout=content-and-preview) + +@title +Stichwortverzeichnis anlegen + +@content +```{.lang-tex .hljs} +\usepackage{makeidx} +\makeindex +\begin{document} +\maketitle +\section{Was ist LaTeX\index{LaTeX}?} +LaTeX\index{LaTeX} ist ein +Textsatzsystem\index{Textsatzsystem}. +\newpage \section{TeX\index{TeX} vs. +LaTeX\index{LaTeX}} Es basiert auf +TeX\index{TeX}, einer Erfindung von +Donald Knuth\index{Knuth, Donald}. +Da TeX\index{TeX} in seiner Syntax sehr +viel komplexer als LaTeX\index{LaTeX} +ist, ist LaTeX\index{LaTeX} wesentlich +weiter verbreitet. +\printindex +``` + +@preview +![](svg/chapter-15/index.png) + +@slide(layout=content-and-preview) + +@title +Präsentationen gestalten + +@content +Für Präsentationen gibt es die Dokumentenklasse `beamer` sowie zahlreiche [Vorlagen und Themes](https://www.overleaf.com/learn/latex/Beamer). + +```{.lang-tex .hljs .small-text} +\documentclass{beamer} +\usetheme{Frankfurt} +\usecolortheme{seahorse} +\usepackage[utf8]{inputenc} + +\begin{document} +\begin{frame} + \frametitle{Zitronensorbet} + \framesubtitle{Inkarnation des Guten?} + \begin{definition} + Ein Zitronensorbet ist eine + halbgefrorene \textbf{Speiseeiscreme} + auf Basis von \textit{Zitronen}. + \end{definition} +\end{frame} +\end{document} +``` + +@preview + + + +@slide(layout=content-and-preview) + +@title +Grafiken erstellen + +@content +`TikZ` (»TikZ ist kein Zeichenprogramm«) ist ein umfangreiches Paket zur Erstellung von Vektorgrafiken. + +```{.lang-tex .hljs .small-text .scroll-one-half} +% … +\tikzstyle{every node}=[draw=black,thick,anchor=west] +\tikzstyle{selected}=[draw=red,fill=red!30] +\tikzstyle{dir}=[fill=gray!50] +\tikzstyle{relativeTo}=[fill=blue!70] +\begin{tikzpicture}[% +grow via +three points={one child at (0.5,-0.7) and +two children at +(0.5,-0.7) and (0.5,-1.4)}, +edge from +parent path={(\tikzparentnode.south) + |- (\tikzchildnode.west)}] +\node {/ oder C:} +child { node {home} + child { node {knut} + child { node {pictures}} + child { node {docs} + child { node [dir] {latex} + child { node [relativeTo] {main.tex} + child { node [selected] {part1.tex} + } + } + } +}; +\end{tikzpicture} +``` + +@preview +![](svg/chapter-04/relative-path-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Linguistik + +@content +Mit dem Paket `qtree` lassen sich Konstituentenbäume erstellen: + +```{.lang-tex .hljs} +\Tree [.S [.NP LaTeX ] +[.VP [.V is ] [.NP fun ] ] ] +``` + +@preview +![](svg/chapter-15/constituency-tree-crop.svg) + +@slide(layout=content-and-preview) + +@title +Mathematische Beweisführung + +@content +Beweisbäume lassen sich mit dem Paket `prftree` einwandfrei darstellen. + +```{.hljs .lang-tex .small-text .scroll-one-half} +\begin{displaymath} +\prftree[l,r]{}{[comp$\_{ns}$]} +{ + \prftree[l,r]{}{[comp$\_{ns}$]} + { + \prftree[l,r]{}{[ass$\_{ns}$]} + { + - + } + { + (\texttt{m:=a}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{48,\bot} + } + } + { + \prftree[l,r]{}{[ass$\_{ns}$]} + { + - + } + { + (\texttt{n:=b}, \sigma\_{48,\bot}) + \rightarrow \sigma\_{48,18} + } + } + { + (\texttt{m:=a; n:=b}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{48,18} + } +} +{ + \prftree[l,r]{}{} + { + \dots + } + { + \textbf{[1]}\ (\texttt{LOOP}, \sigma\_{48,18}) + \rightarrow \sigma\_{6,6} + } +} +{ + (\texttt{m:=a; n:=b; LOOP}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{6,6} +} +\end{displaymath} +``` + +@preview + + +@slide(layout=content-only) + +@title +Weitere nützliche Pakete + +@content + + + + + + + + + + + + + + + + + + + + + + + + + +
PaketAnwendung
xcolorMach’s mit Farbe
todonotesToDo-Markierungen und Liste der ToDos
pdfpagesEinbinden von PDF-Dateien
subcaptionVerschachtelte Abbildungen und ausgefeilte Bildunterschriften
colortbl, tabularx, multirow, makecellGestalten von Tabellen
diff --git a/latex-wochenende-wise-2023/slides/packages.en.md b/latex-wochenende-wise-2023/slides/packages.en.md new file mode 100644 index 0000000..859519b --- /dev/null +++ b/latex-wochenende-wise-2023/slides/packages.en.md @@ -0,0 +1,215 @@ +@slide(layout=chapter-slide) + +@number +14 + +@title +Package in sight! + +@slide(layout=content-and-preview) + +@title +Creating an index + +@content +```{.lang-tex .hljs} +\usepackage{makeidx} +\makeindex +\begin{document} +\maketitle +\section{What is LaTeX\index{LaTeX}?} +LaTeX\index{LaTeX} is a typesetting +system\index{Typesetting system}. +\newpage \section{TeX\index{TeX} vs. +LaTeX\index{LaTeX}} It is based on +TeX\index{TeX}, an invention by +Donald Knuth\index{Knuth, Donald}. +As TeX\index{TeX} is way more complex +syntactically than LaTeX\index{LaTeX}, +LaTeX\index{LaTeX} is much more +popular. +\printindex +``` + +@preview +![](svg/chapter-15/index_en-crop.svg) + +@slide(layout=content-and-preview) + +@title +Designing presentation slides + +@content +For slides, there is the `beamer` document class, as well as numerous [templates and themes](https://www.overleaf.com/learn/latex/Beamer). + +```{.lang-tex .hljs .small-text} +\documentclass{beamer} +\usetheme{Frankfurt} +\usecolortheme{seahorse} +\usepackage[utf8]{inputenc} + +\begin{document} +\begin{frame} + \frametitle{Lemon sorbet} + \framesubtitle{Incarnation of good?} + \begin{definition} + A lemon sorbet is a + semi-frozen \textbf{dessert} + on \textit{lemon} base. + \end{definition} +\end{frame} +\end{document} +``` + +@preview + + + +@slide(layout=content-and-preview) + +@title +Drawing images + +@content +`TikZ` (“TikZ ist kein Zeichenprogramm” — “TikZ is no drawing software”) is a powerful package for drawing vector graphics. + +```{.lang-tex .hljs .small-text .scroll-one-half} +% … +\tikzstyle{every node}=[draw=black,thick,anchor=west] +\tikzstyle{selected}=[draw=red,fill=red!30] +\tikzstyle{dir}=[fill=gray!50] +\tikzstyle{relativeTo}=[fill=blue!70] +\begin{tikzpicture}[% +grow via +three points={one child at (0.5,-0.7) and +two children at +(0.5,-0.7) and (0.5,-1.4)}, +edge from +parent path={(\tikzparentnode.south) + |- (\tikzchildnode.west)}] +\node {/ or C:} +child { node {home} + child { node {knut} + child { node {pictures}} + child { node {docs} + child { node [dir] {latex} + child { node [relativeTo] {main.tex} + child { node [selected] {part1.tex} + } + } + } +}; +\end{tikzpicture} +``` + +@preview +![](svg/chapter-04/relative-path-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Linguistics + +@content +The `qtree` package can render constituent-based parse trees: + +```{.lang-tex .hljs} +\Tree [.S [.NP LaTeX ] +[.VP [.V is ] [.NP fun ] ] ] +``` + +@preview +![](svg/chapter-15/constituency-tree-crop.svg) + +@slide(layout=content-and-preview) + +@title +Mathematical proofs + +@content +Logical tableaux can be renderd using the `prftree` package. + +```{.hljs .lang-tex .small-text .scroll-one-half} +\begin{displaymath} +\prftree[l,r]{}{[comp$\_{ns}$]} +{ + \prftree[l,r]{}{[comp$\_{ns}$]} + { + \prftree[l,r]{}{[ass$\_{ns}$]} + { + - + } + { + (\texttt{m:=a}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{48,\bot} + } + } + { + \prftree[l,r]{}{[ass$\_{ns}$]} + { + - + } + { + (\texttt{n:=b}, \sigma\_{48,\bot}) + \rightarrow \sigma\_{48,18} + } + } + { + (\texttt{m:=a; n:=b}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{48,18} + } +} +{ + \prftree[l,r]{}{} + { + \dots + } + { + \textbf{[1]}\ (\texttt{LOOP}, \sigma\_{48,18}) + \rightarrow \sigma\_{6,6} + } +} +{ + (\texttt{m:=a; n:=b; LOOP}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{6,6} +} +\end{displaymath} +``` + +@preview + + +@slide(layout=content-only) + +@title +Other useful packages + +@content + + + + + + + + + + + + + + + + + + + + + + + + + +
PackageUse case
xcolorcolours
todonotestodo annotations and index
pdfpagesembedding PDF files
subcaptionNested figures and fine-tuned captions
colortbl, tabularx, multirow, makecellTable tuning
+ diff --git a/latex-wochenende-wise-2023/slides/project-structure.de.md b/latex-wochenende-wise-2023/slides/project-structure.de.md new file mode 100644 index 0000000..ea81b7f --- /dev/null +++ b/latex-wochenende-wise-2023/slides/project-structure.de.md @@ -0,0 +1,196 @@ +@slide(layout=chapter-slide) + +@number +4 + +@title +Projektstruktur + + +@slide(layout=content-and-preview) + +@title +Zielsetzung + +@content +Ein größeres LaTeX-Projekt anlegen und dabei … + +* verhindern, dass LaTeX-Dokumente zu monströser Größe anwachsen 👹 +* den Überblick über die Struktur eines Projekts behalten + +@preview +![](svg/chapter-04/langes-dokument.jpg){style="padding: .2em; height: 100vh"} + + +@slide(layout=content-and-preview) + +@title +Hauptdatei 👑 + +@content +* enthält Grundgerüst, Titel, Inhaltsverzeichnis etc. +* bindet einzelne Kapitel ein mit \ + `\input{pfad/zur/datei}` + +``` {.lang-tex .hljs data-sourcefile=main.tex} +\documentclass{article} +\usepackage[ngerman]{babel} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\title{Ein Titel} +\begin{document} + \maketitle + \tableofcontents + \input{abschnitt1.tex} + \input{abschnitt2.tex} +\end{document} +``` + +@preview +![](svg/chapter-04/hauptdatei-orig.svg) + + +@slide(layout=content-and-preview) + +@title +Datei mit Teilabschnitt + +@content +* enthält **keine Präambel** +* enthält **kein** `\begin{document}` und `\end{document}` + +``` {.hljs .lang-tex data-sourcefile=part1.tex} +\section{Dies ist Abschnitt 1} +Hier ein Absatz zum +Inhalt von Abschnitt 1. + +% … +``` + +``` {.hljs .lang-tex data-sourcefile=part2.tex} +\section{Dies ist Abschnitt 2} +Hier ein Absatz zum +Inhalt von Abschnitt 2. + +% … +``` + +@preview +![](svg/chapter-04/hauptdatei-teile-crop.svg){.thin-padding} + + +@slide(layout=content-and-preview-with-category) + +@category +Exkurs + +@title +Dateipfade angeben 👣 + +@content +* wichtig für `\input{}` sowie später für das Einbinden von Bildern und anderen Medien +* Datei- und Ordnerstruktur = Baumstruktur 🌳 +* bei `\input{}` kann der Pfad zu einer Unterdatei relativ zur Hauptdatei angeben werden + +

Bei LaTeX muss stets die **Unix-Syntax** für Pfadangaben verwendet werden. Pfadelemente werden durch einen Schrägstrich getrennt: `pfad/zur/datei`. Deshalb werden wir im Folgenden diese Schreibweise verwenden.

+ +@preview +![](svg/chapter-04/tree-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Exkurs + +@title +Dateipfade angeben 👣 + +@content +

`main-exercises.tex` → `praeamble.tex`

+ +
+`./praeamle.tex` + +Der **einfache Punkt »`.`«** bezieht sich bei relativen Pfaden auf den aktuellen Ordner (hier: `latex-skript`). Er ist optional, es könnte also auch nur `praeamble.tex` geschrieben werden. +
+ +@preview +![](svg/chapter-04/relative-path-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Exkurs + +@title +Dateipfade angeben 👣 + +@content +

`main-exercises.tex` → `basic-document-structure.tex` (in einem Unterordner)

+ +
+`./content/basic-document-structure.tex` +
+ +@preview +![](svg/chapter-04/relative-path-subdir-crop.svg) + + + +@slide(layout=content-and-preview-with-category) + +@category +Exkurs + +@title +Dateipfade angeben 👣 + +@content +

`basic-functionality.tex` → `graphics.raw.tex`

+

(wenn `basic-functionality.tex` von `main-exercises.tex` importiert wird)

+ +
+
./exercises/graphics/graphics.raw.tex
+

Pfade sind immer relativ zum Wurzelelement, auch wenn dieses noch andere Dateien einbindet, die wiederum andere Dateien referenzieren.

+
+ +@preview +![](svg/chapter-04/relative-path-transitive-crop.svg) + + + +@slide(layout=content-only-with-category) + +@category +Demo + +@title +Kompilieren des Projekts + +@content +* **Nur die Hauptdatei** wird kompiliert, um das fertige PDF-Dokument zu erhalten. +* ++ Fehlermeldungen enthalten dann Verweis, in welcher Unterdatei sie aufgetreten sind. +* ++ Die Unterdateien können wegen ihrer fehlenden Präambel nicht selbstständig kompiliert werden. + +
+Von nun an kompilieren wir die Datei `main-exercises.tex` im Wurzelverzeichnis des Projektordners. Klickt hierzu in TeXstudio mit der rechten Maustaste auf die Datei und wählt **„Explizit als Root-Dokument setzen“**. Anschließend könnt ihr wie gewohnt kompilieren. +
+ + +@slide(layout=task) + +@task-number +4 + +@title +Ein strukturiertes Projekt + +@content +Im Ordner `exercises/project-structure` findet ihr eine Datei namens `main.tex`. + +* Erstellt neue Dateien (z. B. `section1.tex` und `section2.tex` und verschiebt die Abschnitte in diese. +* Importiert die Fragmente anschließend mit Hilfe des `\input`-Befehls. +* Lagert die Präambel auf demselben Weg in eine eigene Datei aus. +* Schaut euch abschließend die Gesamtstruktur unseres Projektarchivs an, beginnend mit `main-exercises.tex` im Wurzelverzeichnis. Wie binden wir hier die einzelnen Abschnitte ein? \ No newline at end of file diff --git a/latex-wochenende-wise-2023/slides/project-structure.en.md b/latex-wochenende-wise-2023/slides/project-structure.en.md new file mode 100644 index 0000000..990f1ed --- /dev/null +++ b/latex-wochenende-wise-2023/slides/project-structure.en.md @@ -0,0 +1,195 @@ +@slide(layout=chapter-slide) + +@number +4 + +@title +Project structure + +@slide(layout=content-and-preview) + +@title +Goal + +@content +Create a bigger LaTeX project and … + +* prevent LaTeX documents from growing monstrously 👹 +* keep the overview over the project structure + +@preview +![](svg/chapter-04/langes-dokument.jpg){style="padding: .2em; height: 100vh"} + + +@slide(layout=content-and-preview) + +@title +Main file 👑 + +@content +* contains basic structure +* includes separate sections with \ + `\input{path/to/file}` + +``` {.lang-tex .hljs data-sourcefile=main.tex} +\documentclass{article} +\usepackage{babel} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\title{A Title} +\begin{document} + \maketitle + \tableofcontents + \input{section1.tex} + \input{section2.tex} +\end{document} +``` + +@preview +![](svg/chapter-04/main-orig.svg) + + +@slide(layout=content-and-preview) + +@title +File with a section + +@content +* contains **no preamble** +* contains **no** `\begin{document}` or `\end{document}` + +``` {.hljs .lang-tex data-sourcefile=part1.tex} +\section{This is section 1} +A paragraph about the content +of section 1. + +% … +``` + +``` {.hljs .lang-tex data-sourcefile=part2.tex} +\section{This is section 2} +A paragraph about the content +of section 2. + +% … +``` + +@preview +![](svg/chapter-04/main-parts-crop.svg){.thin-padding} + + +@slide(layout=content-and-preview-with-category) + +@category +Excursion + +@title +Specifying file paths 👣 + +@content +* important for `\input{}`, but later also for other media types +* file and folder structure = tree structure 🌳 +* with `\input{}`, you can specify the path relative to the main file + +

In **LaTeX,** you have to use UNIX-style paths. They are separated by a forward slash: `path/to/file`. We will use those from here on.

+ +@preview +![](svg/chapter-04/tree-english-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Excursion + +@title +Specifying file paths 👣 + +@content +

`main-exercises.tex` → `praeamble.tex`

+ +
+`./praeamble.tex` + +A **single dot ‘`.`’** represents the current folder (in this case: `latex-skript`). It is optional, you could also write `praeamble.tex` here. +
+ +@preview +![](svg/chapter-04/relative-path-english-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Excursion + +@title +Specifying file paths 👣 + +@content +

`main-exercises.tex` → `basic-document-structure.tex` (in a subfolder)

+ +
./content/basic-document-structure.tex
+ +@preview +![](svg/chapter-04/relative-path-subdir-english-crop.svg) + + + +@slide(layout=content-and-preview-with-category) + +@category +Excursion + +@title +Specifying file paths 👣 + +@content +

`basic-functionality.tex` → `graphics.raw.tex`

+

(`basic-functionality.tex` is imported into `main-exercises.tex`)

+ +
+
./exercises/graphics/graphics.raw.tex
+

Paths are always relative to the root document that imports other files as fragments.

+
+ +@preview +![](svg/chapter-04/relative-path-transitive-english-crop.svg) + + + +@slide(layout=content-only-with-category) + +@category +Demo + +@title +Compiling the project + +@content +* **Only the main file** has to be compiled to get the complete PDF document. +* ++ Error messages include a reference to the corresponding subfile. +* ++ Subfiles cannot be compiled on their own as they don’t have a preamble. + +
+From now on, we will compile the file `main-exercises.tex` in the project root. +To do so, right click on the file in TeXstudio and choose **“Select as explicit root document”** from the dropdown. +Next, compile as usual. +
+ + +@slide(layout=task) + +@task-number +4 + +@title +A structured project + +@content +You will find a file named `main.tex` in the folder `exercises/project-structure`. + +* Put the sections of the file into separate files, named `section1.tex` and `section2.tex`. +* Include them using the `\input` command. +* Move the preamble to its own file in a similar fashion. +* Finally, have a look at the general project archive, starting from `main-exercises.tex` (in the root folder of the project archive). How do we include the different sections here? \ No newline at end of file diff --git a/latex-wochenende-wise-2023/slides/references-and-footnotes.de.md b/latex-wochenende-wise-2023/slides/references-and-footnotes.de.md new file mode 100644 index 0000000..cb6f1ca --- /dev/null +++ b/latex-wochenende-wise-2023/slides/references-and-footnotes.de.md @@ -0,0 +1,211 @@ +@slide(layout=chapter-slide) + +@number +11 + +@title +Referenzen und Fußnoten + + +@slide(layout=content-and-preview) + +@title +Fußnoten 📎 + +@content +``` {.hljs .lang-tex} +\usepackage{hyperref} +``` + +Die Nummerierung erfolgt automatisch und ist fortlaufend, unabhängig davon, ob ein neuer Abschnitt beginnt. + +``` {.hljs .lang-tex} +Eber, beim Hausschwein insbesondere +oberdeutsch Saubär, beim Wildschwein +Keiler, bezeichnet das männliche +Geschlecht des Schweins. +\footnote{\url{https://de.wikipedia.org/ +wiki/Eber}} +``` + +@preview +![](svg/chapter-13/fußnotenbeispiel-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Querverweise + +@content +Manuell (Just don’t!) + +``` {.hljs .lang-tex} +Wie man in Abbildung 23 sieht, … +``` + +Mit dem Befehl `\ref`: + +``` {.hljs .lang-tex} +\begin{figure}[H] + \includegraphics % … + \caption{Unser Maskottchen Fooboar} + \label{img:fooboar} +\end{figure} + +Wie man in Abbildung \ref{img:fooboar} … +``` + +@preview +![](svg/chapter-13/ref-beispiel-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Referenzen + +@content +Mit dem Paket `cleveref` (mit *einem* ›r‹!): + +``` {.hljs .lang-tex} +\begin{figure}[H] + \includegraphics % … + \caption{Unser Maskottchen Fooboar} + \label{img:fooboar} +\end{figure} + +Fooboar ist ein sehr engagierter +Jungeber (siehe \Cref{img:fooboar}). +``` + +Der Befehl `\cref` fügt selbstständig die passende Abkürzung ein. + +@preview +![](svg/chapter-13/cref-beispiel-crop.svg) + + +@slide(layout=content-only) + +@title +Label vergeben + +@content +Beide Referenzierungsbefehle funktionieren mit **Abschnitten, Bildern, Tabellen, Listings und Gleichungen,** sofern die richtigen Label vergeben wurden. + +Label müssen **eindeutig** sein. Zur Strukturierung ist das Voranstellen von Kürzeln üblich, denn einige Pakete ziehen aus den Kürzeln Informationen. + + + + + + + + + + + + + + + + + + +
`fig:` Abbildungen`tbl:` Tabellen
`sec:` Abschnitte`subsec:` Unter­abschnitte
`ch:` Kapitel`itm:` Aufzählungs­elemente
`eq:` Gleichungen`lst:` Quelltext­listings
+ + +@slide(layout=content-only) + +@title +Dinge, die zu beachten sind + +@content +* ++ Durch `\cref` eingefügte Passagen tauchen in einigen Dokumentklassen erst dann auf Deutsch auf, wenn bereits in der Dokumentklasse die Sprache festgelegt wurde: + + ``` {.hljs .lang-tex} + \documentclass[ngerman]{article} + ``` + +* ++ Beschriftungen (`\caption{…}`) müssen, von Abschnitten abgesehen, **immer und vor dem Label** vergeben werden. + +* ++ Bei Abschnitten wird das Label direkt hinter dem Befehl angefügt. + + ``` {.hljs .lang-tex} + \section{Hinweise}\label{sec:hinweise} + ``` + + +@slide(layout=task) + +@task-number +11a + +@title +Fußnoten einfügen + +@content +* Pack den Text *March 2023* in der Datei `exercises/footnotes/footnotes.tex` in eine **Fußnote**. +* Fügt zusätzlich eine **klickbare URL**, die zur Download-Seite des Java Development Kit führt (`https://www.oracle.com/java/technologies/javase-downloads.html`), als Fußnote ein. + + + +@slide(layout=task) + +@task-number +11b + +@title +Referenzen einfügen + +@content +* Ersetzt im Text in der Datei `references.tex` im Ordner `exercises/references` *In the figure* und *The following source code listing* durch eine **Referenz** auf das Bild bzw. auf das Quelltext-Listing. +* Nutzt dafür den Befehl `\Cref`. +* Achtet darauf, zuerst **Labels** für die Elemente, die ihr referenzieren wollt, zu vergeben. +* Bei **Quelltext-Listings** funktioniert die Angabe von Labels und Captions leicht anders. Nutzt euer bisheriges Wissen und das Internet, um herauszufinden, wie ihr den Befehl `\lstinputlisting` anpassen müsst, um beides zu vergeben. + + +@slide(layout=extra-content-and-preview) + +@title +Konfiguration von Fußnoten + +@content +Das Paket `footmisc` stellt verschiedene weitere Optionen für die Darstellung von Fußnoten zur Verfügung, die als optionale Parameter an den Befehl `\usepackage` übergeben werden können. + +``` {.hljs .lang-tex} +% Zählung auf jeder Seite neu beginnen: +\usepackage[perpage]{footmisc} + +% Fußnoten inline anzeigen lassen: +\usepackage[para]{footmisc} + +% Symbole statt Nummerierung verwenden: +\usepackage[symbol]{footmisc} +``` + +@preview +![](svg/chapter-13/footmisc-de-crop.svg){.thin-padding} + + +@slide(layout=extra-content-and-preview) + +@title +Weiterführend + +@content +* Wurde vor dem Paket `cleveref` das Paket `hyperref` eingebunden, entsteht ein **klickbarer Link** im fertigen PDF. +* Mehrere Referenzen können in `\cref` kommagetrennt angegeben werden. + +``` {.hljs .lang-tex} +\section{Ein Einstieg} +\label{sec:section1} +% … +Hier sei verwiesen auf +\cref{sec:section1,sec:section2, +sec:section3,sec:section5}. +``` + +@preview +![](svg/chapter-13/cref-multiple-beispiel-crop.svg) + diff --git a/latex-wochenende-wise-2023/slides/references-and-footnotes.en.md b/latex-wochenende-wise-2023/slides/references-and-footnotes.en.md new file mode 100644 index 0000000..187c634 --- /dev/null +++ b/latex-wochenende-wise-2023/slides/references-and-footnotes.en.md @@ -0,0 +1,213 @@ +@slide(layout=chapter-slide) + +@number +11 + +@title +References and footnotes + + +@slide(layout=content-and-preview) + +@title +Footnotes 📎 + +@content +``` {.hljs .lang-tex} +\usepackage{hyperref} +``` + +Footnotes are automatically numbered consecutively, independent of sections. + +(Here, `hyperref` is used for the `\url` command, it is not necessary for footnotes per se.) + +``` {.hljs .lang-tex} +The wild boar (\textit{Sus scrofa}), also +known as the wild swine, common wild pig, +or simply wild pig, is a suid native to +much of Eurasia and North Africa, and has +been introduced to the Americas and Oceania. +\footnote{\url{https://en.wikipedia.org/ +wiki/Wild_boar}} +``` + +@preview +![](svg/chapter-13/footnote-example-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Cross-references + +@content +Manually (just don’t!) + +``` {.hljs .lang-tex} +As you can see in figure 23, … +``` + +Using the `\ref` command: + +``` {.hljs .lang-tex} +\begin{figure}[H] + \includegraphics % … + \caption{Our mascot Fooboar} + \label{img:fooboar} +\end{figure} + +As you can see in figure +\ref{img:fooboar}, … +``` + +@preview +![](svg/chapter-13/ref-example-crop.svg) +@slide(layout=content-only) + +@title +Assigning labels + +@content +Both cross-reference commands work with **sections, figures, tables, listings, and equations,** as long as you use correct labels. + +Labels have to be **unambiguous.** For clarity, certain prefixes are common, and some packages use them to derive information. + + + + + + + + + + + + + + + + + + +
`fig:` Figures`tbl:` Tables
`sec:` Sections`subsec:` Subsections
`ch:` Chapters`itm:` Enumeration items
`eq:` Equations`lst:` Source code listings
+ + + +@slide(layout=content-and-preview) + +@title +Cross-references + +@content +Using the `cleveref` package (with *one* ‘r’!): + +``` {.hljs .lang-tex} +\begin{figure}[H] + \includegraphics % … + \caption{Our mascot Fooboar} + \label{img:fooboar} +\end{figure} + +Fooboar is a young and highly engaged +boar (see \Cref{img:fooboar}). +``` + +The `\cref` command automatically inserts suitable prefixes. + +@preview +![](svg/chapter-13/cref-example-crop.svg) + + +@slide(layout=content-only) + +@title +Things to consider + +@content +* Terms inserted by `\cref` use the language specified with the document class (or `babel`): + + ``` {.hljs .lang-tex} + \documentclass[english]{article} + ``` + +* Apart from sections, referenced elements need captions (`\caption{…}`), and the **captions have to be placed before the label.** + +* For sectioning commands, the label is inserted directly after the section command. + + ``` {.hljs .lang-tex} + \section{Notes}\label{sec:notes} + ``` + + +@slide(layout=task) + +@task-number +11a + +@title +Inserting footnotes + +@content +* Make the text *March 2023* in file `exercises/footnotes/footnotes.tex` appear as a **footnote**. +* Additionally, insert a **clickable URL** that leads to the download page for the Java Development Kit (`https://www.oracle.com/java/technologies/javase-downloads.html`). + + +@slide(layout=task) + +@task-number +11b + +@title +Inserting references + +@content +* In file `exercises/references/references.tex`, replace *In the figure* and *The following source code listing* by **references** to the figure and to the source code listing. +* Use the command `\Cref` for the references. +* Make sure to add **labels** to the elements that you want to create a reference for. +* For source code listings, adding labels and captions is a bit different. Try to apply the knowledge you gained so far to retrieve the correct version of the `\lstinputlisting` command. Use the Internet, if necessary. + + +@slide(layout=extra-content-and-preview) + +@title +Configuring footnotes + +@content +The `footmisc` package provides additional options for the presentation of footnotes that can be activated by adding parameters to the `\usepackage` command. + +``` {.hljs .lang-tex} +% Reset the counter on each page: +\usepackage[perpage]{footmisc} + +% Display footnotes in-line: +\usepackage[para]{footmisc} + +% Use symbols instead of numbers: +\usepackage[symbol]{footmisc} +``` + +@preview +![](svg/chapter-13/footmisc-en-crop.svg){.thin-padding} + + + +@slide(layout=extra-content-and-preview) + +@title +A few more things + +@content +* It is recommended that you include the package `hyperref` before `cleveref`. +* `\cref` can take multiple references at once, separated by commas. + +``` {.hljs .lang-tex} +\section{An introduction} +\label{sec:section1} +% … +Reference be made to +\cref{sec:section1,sec:section2, +sec:section3,sec:section5}. +``` + +@preview +![](svg/chapter-13/cref-multiple-example-crop.svg) \ No newline at end of file diff --git a/latex-wochenende-wise-2023/slides/source-code-listings.de.md b/latex-wochenende-wise-2023/slides/source-code-listings.de.md new file mode 100644 index 0000000..cc03a20 --- /dev/null +++ b/latex-wochenende-wise-2023/slides/source-code-listings.de.md @@ -0,0 +1,110 @@ +@slide(layout=chapter-slide) + +@number +13 + +@title +Quelltext-Listings + + +@slide(layout=content-and-preview) + +@title +Direkt im LaTeX-Quelltext + +@content +Das Paket `listings` bietet zum Einfügen von Code eine eigene Umgebung: + +``` {.lang-tex .hljs} +\section*{Haskell-Magie} +Quadrate aller geraden % … +\begin{lstlisting}[language=Haskell] +[x^2 | x <- [1..200], even x] +\end{lstlisting} +``` + +@preview +![](svg/chapter-10/listings-haskell-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Externer Code + +@content +Praktischerweise bietet `listings` einen Befehl zum Einfügen externen Codes: + +``` {.lang-tex .hljs} +\section*{Einfache Java-Anwendung} +\lstinputlisting[language=Java]{Test.java} +``` + +``` {.lang-java .hljs data-sourcefile="Test.java"} +public class Test { + public static void main(/*…*/) { + System.out.println(/*…*/); + } +} +``` + +@preview +![](svg/chapter-10/listings-java-crop.svg) + + +@slide(layout=content-only) + +@title +Themen und Stile + +@content +`listings` stellt keine eigenen Themes zur Verfügung. Dies kann aber durch die vielen Konfigurationsoptionen ausgeglichen werden. + +``` {.lang-tex .hljs} +\begin{lstlisting}[ + language=Java, + basicstyle=\footnotesize\ttfamily, + breaklines=true, + keywordstyle=\color{ForestGreen}, + commentstyle=\color{DarkGray}, + literate={ö}{{\"o}}1 +] +% … +\end{lstlisting} +``` + +Für die Erstellung eigener Themes ist der Befehl `\lstset` nützlich. + + +@slide(layout=content-only) + +@title +Weitere Materialien + +@content +* [Einführung](https://www.overleaf.com/learn/latex/Code_listing#Reference_guide) in das Paket +* offizielle [Dokumentation](https://www.overleaf.com/learn/latex/Code_listing#Reference_guide) +* vordefinierte [UTF-8-Konfiguration](https://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings#Encoding_issue) +* das Paket [`xcolor`](https://www.overleaf.com/learn/latex/Using_colours_in_LaTeX) für Farben +* zwei [Themes](https://github.com/jez/latex-solarized) im solarized-Stil für `listings` + + +@slide(layout=task) + +@task-number +13 + +@title +Listings + +@content +* Im Ordner `exercises/source-code-listings` findet ihr eine Datei namens `Source.java`. +* **Bindet** den Java-Quelltext in der Datei `source-code-listings.tex` **ein**. (Beachtet, dass der Dateipfad relativ zu `main-exercises.tex` ist.) +* Erlaubt die Verwendung von **Sonderzeichen** durch Angabe der `literate`-Option. +* Aktiviert das **Syntax-Highlighting** durch Angabe der Sprache Java. +* **Nummeriert** die Zeilen und aktiviert **Umbrüche**. +* Setzt mit dem Parameter `basicstyle` eine dicktengleiche Schrift (`\ttfamily \small`). +* Ändert die Schlüsselwortfarbe zu Blau. +* Verbergt die Sonderzeichen, die **Leerzeichen in Zeichenketten** markieren. + +Seht bei Fragen in der Dokumentation des Paketes `listings` nach. diff --git a/latex-wochenende-wise-2023/slides/source-code-listings.en.md b/latex-wochenende-wise-2023/slides/source-code-listings.en.md new file mode 100644 index 0000000..82e1b27 --- /dev/null +++ b/latex-wochenende-wise-2023/slides/source-code-listings.en.md @@ -0,0 +1,110 @@ +@slide(layout=chapter-slide) + +@number +13 + +@title +Source code listings + + +@slide(layout=content-and-preview) + +@title +In-situ listings + +@content +The `listings` package provides a dedicated environment: + +``` {.lang-tex .hljs} +\section*{Haskell Magic} +Squares of all even % … +\begin{lstlisting}[language=Haskell] +[x^2 | x <- [1..200], even x] +\end{lstlisting} +``` + +@preview +![](svg/chapter-10/listings-haskell-english-crop.svg) + + +@slide(layout=content-and-preview) + +@title +External source code + +@content +Conveniently, `listings` offers an import command: + +``` {.lang-tex .hljs} +\section*{Simple Java Application} +\lstinputlisting[language=Java]{Test.java} +``` + +``` {.lang-java .hljs data-sourcefile="Test.java"} +public class Test { + public static void main(/*…*/) { + System.out.println(/*…*/); + } +} +``` + +@preview +![](svg/chapter-10/listings-java-english-crop.svg) + + +@slide(layout=content-only) + +@title +Themes and styles + +@content +`listings` does not provide any themes by default, but can be configured extensively. + +``` {.lang-tex .hljs} +\begin{lstlisting}[ + language=Java, + basicstyle=\footnotesize\ttfamily, + breaklines=true, + keywordstyle=\color{ForestGreen}, + commentstyle=\color{DarkGray}, + literate={ö}{{\"o}}1 +] +% … +\end{lstlisting} +``` + +Have a look at the `\lstset` command for creating your own themes. + + +@slide(layout=content-only) + +@title +Further resources + +@content +* [introduction](https://www.overleaf.com/learn/latex/Code_listing#Reference_guide) to the package +* official [documentation](https://www.overleaf.com/learn/latex/Code_listing#Reference_guide) +* predefined [UTF-8 configuration](https://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings#Encoding_issue) +* [`xcolor` package](https://www.overleaf.com/learn/latex/Using_colours_in_LaTeX) for colors +* two [solarized themes](https://github.com/jez/latex-solarized) for `listings` + + +@slide(layout=task) + +@task-number +13 + +@title +Listings + +@content +* In the directory `exercises/source-code-listings` you can find a file named `Source.java`. +* **Include** it in the file `source-code-listings.tex`. (Keep in mind that the file path is relative to the main LaTeX document, i. e., to `main-exercises.tex`.) +* Enable **special characters** via the `literate` option. +* Activate **syntax highlighting** by stating the programming language Java. +* **Number** the code lines. +* Set the `basicstyle` to a proper mono-spaced font (`\ttfamily \small`) +* Change the **keyword color** to blue. +* Don't show special characters for **spaces in strings**. + +If you have questions, try to consult the documentation of the `listings` package. diff --git a/latex-wochenende-wise-2023/slides/special-characters.de.md b/latex-wochenende-wise-2023/slides/special-characters.de.md new file mode 100644 index 0000000..ba81773 --- /dev/null +++ b/latex-wochenende-wise-2023/slides/special-characters.de.md @@ -0,0 +1,331 @@ +@slide(layout=chapter-slide) + +@number +5 + +@title +Sonderzeichen + + +@slide(layout=content-and-preview) + +@title +Leerzeichen + +@content + +* Nutzt schmale Leerzeichen (`\,`) und geschützte Leerzeichen (`~`) an den geeigneten Stellen. + +``` {.hljs .lang-tex} +Schmale Leerzeichen werden z.\,B. in +Abkürzungen und zwischen Zahlen und +Einheiten verwendet: 10\,s. +Normalbreite, aber geschützte +Leerzeichen können u.\,a. +dabei helfen, Titel und Namen in +einer Zeile zu halten: Dr.~Fooboar. +``` + +* ++ Nutzt French Spacing (`\frenchspacing`), um riesige Freiräume nach Satzzeichen zu verhindern. + +@preview +![](svg/chapter-05/leerzeichen-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Striche + +@content + + + + + + + + + + + + + + + + + + + + + + + + + +
NameVerwendungCode
-Bindestrich *(hypen)*LaTeX-Wochenende`-`
Halbgeviert­strich
*(en dash)*
als Gedankenstrich – oder als Bis-Strich: 10 – 12 Uhr.`--`
Geviertstrich
*(em dash)*
a dash — mostly in American English`---`
+ +@preview +![](svg/chapter-05/striche-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Zitate + +@content +Das Paket `csquotes` stellt u. a. den Befehl `\enquote` zur Verfügung: + +``` {.lang-tex .hljs} +\enquote{Ein \enquote{verschachteltes} +Zitat.} +``` + +Wenn das Paket mit `autostyle=true` eingebunden wird, werden bei fremdsprachigen Zitaten die entsprechenden Anführungszeichen verwendet: + +``` {.lang-tex .hljs} +\foreignquote{english}{An English +quote.} +``` + +@preview +![](svg/chapter-05/zitate-crop.svg) + + +@slide(layout=content-only) + +@title +Sonderzeichen & Symbole + +@content +### Detexify to the rescue! ⛑️ +* Ausführliche Liste an verwendbaren Symbolen: + [PDF auf der CTAN-Website](http://tug.ctan.org/info/symbols/comprehensive/symbols-a4.pdf) +* Symbole malen und erkennen lassen: + [Detexify](http://detexify.kirelabs.org/classify.html) + + +@slide(layout=task) + +@task-number +5 + +@title +Sonderzeichen einfügen + +@content +
+Kompiliert von nun an immer die Datei `main-exercises.tex`, um eure Änderungen im Übungsskript zu sehen (in diesem Fall im Abschnitt zu Übung 5). +
+ +* Ersetzt die Leerzeichen innerhalb der Abkürzungen in `exercises/special-characters.tex` durch **schmale Leerzeichen**. +* Die Bindestriche bei den Öffnungszeiten der ERBA sollen durch **Halbgeviertstriche** ersetzt werden, optional mit schmalen Leerzeichen außenrum. +* Nutzt den Befehl `\enquote`, um die Wörter *Studi-Ticket* und *Studi-Karte* in **Anführungszeichen** zu setzen. + + +@slide(layout=extra-content-and-preview) + +@title +English spacing + +@content +In englischsprachigen Dokumenten verwendet LaTeX das traditionelle *English spacing,* also doppelte Leerzeichen nach dem Satzende. + +Das kann mit `\frenchspacing` vor dem ersten Absatz verhindert werden. `\nonfrenchspacing` schaltet wieder zurück. + +Bei *English spacing* versucht LaTeX, nach Abkürzungen trotzdem normale Wortzwischenräume zu setzen. Das sollte aber kontrolliert werden. Eingreifen können wir mit + +* erzwungenen Wortzwischenräumen: `.\␣` +* erzwungenen Satzenden: `\@.␣` + +@preview +![](svg/chapter-05/french-spacing-crop.svg) + + +@slide(layout=extra-content-and-preview) + +@title +Silbentrennung + +@content +LaTeX trennt Wörter im Normalfall automatisch richtig, wenn die richtige Sprache konfiguriert ist. Manchmal muss aber auch manuell eingegriffen werden. + + + + + + + + + + + + + + + + + + + + + + + + + + +
Ausschließliche Trennung`\-`
Zusätzliche Trennstelle`"-`
Bindestrich (verbietet andere Trennstellen)`-`
Bindestrich (erlaubt andere Trennstellen)`"=`
Trennstelle ohne Strich`""`
Strich ohne Trennstelle`"~`
+ +

Einige der Codes funktionieren nur mit eingebundenem `babel`-Paket.

+ + +@preview +![](svg/chapter-05/silbentrennung-crop.svg) + + + +@slide(layout=extra-content-only) + +@title +Anführungszeichen + +@content + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpracheBefehlErgebnis
Deutsch`\glqq … \grqq`„ … “
 2. Ebene` \glq … \grq `‚ … ‘
Deutsch altern.`\frqq … \flqq`» … «
 2. Ebene` \frq … \flq `› … ‹
Englisch (A. E.)\`\`…\'\'“ … ”
 2. Ebene \`…\' ‘ … ’
Englisch (B. E.) \`…\' ‘ … ’
 2. Ebene\`\`…\'\'“ … ”
+ +Für andere Sprachen können andere Regeln gelten, meistens aber mit den gleichen Zeichen, nur in anderer Zusammensetzung. + + +@slide(layout=extra-content-only) + +@title +Diakritika + +@content +Buchstaben mit Diakritika können entweder direkt über die Tastatur eingegeben werden oder über Escape-Codes: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\\\`{o}ò  `\c{c}` ç  `\d{u}`
`\'{o}` ó`\k{a}` ą`\r{a}` å
`\^{o}` ô`\l{}` ł`\u{o}` ŏ
`\"{o}` ö`\={o}` ō`\v{s}` š
`\H{o}` ő`\b{o}` o`\t{oo}`o͡o
`\~{o}` õ`\.{o}` ȯ`\o` ø
+ + +@slide(layout=extra-content-only) + +@title +Sonderzeichen & Symbole + +@content +Auch andere Sonderzeichen können entweder direkt eingegeben werden oder per Befehl: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
¿ ?\`¡ !\`
^ `\textasciicircum`~ `\textasciitilde`
`\textasteriskcentered`\\ `\textbackslash`
| `\textbar` `\textbullet`
`\textcopyright` `\textdagger`
`\textdaggerdbl` `\textellipsis`
< `\textless`> `\textgreater`
`\textperthousand`§ `\textsection`
+ +… und so ziemlich alles andere. \ No newline at end of file diff --git a/latex-wochenende-wise-2023/slides/special-characters.en.md b/latex-wochenende-wise-2023/slides/special-characters.en.md new file mode 100644 index 0000000..0df2074 --- /dev/null +++ b/latex-wochenende-wise-2023/slides/special-characters.en.md @@ -0,0 +1,327 @@ +@slide(layout=chapter-slide) + +@number +5 + +@title +Special characters + + +@slide(layout=content-and-preview) + +@title +Spaces + +@content +* Use thin spaces (`\,`) and non-breaking spaces (`~`), where appropriate. + +``` {.hljs .lang-tex} +Thin spaces are used in abbreviations +and before units, e.\,g., 10\,s. +Normal-width non-breaking spaces can help +keep honorary titles and names on one +line: Dr.~Fooboar. +``` + +* ++ Use french spacing (`\frenchspacing`) to avoid giant gaps after full stops. + +@preview +![](svg/chapter-05/spaces-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Hyphens and dashes + +@content + + + + + + + + + + + + + + + + + + + + + + + + + +
NameUseCode
-Hyphencompound-forming hyphen`-`
En dash *(Halbgeviert­strich)*a dash – or a range: 12 – 2 p.m.`--`
Em dash *(Geviertstrich)*a dash — mostly in American English`---`
+ +@preview +![](svg/chapter-05/hyphens-and-dashes-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Quotes + +@content +The `csquotes` package provides, amongst others, the command `\enquote`. + +``` {.lang-tex .hljs} +\enquote{A \enquote{nested} +quote.} +``` + +When included with `autostyle=true`, foreign-language quotes use the according quotation marks: + +``` {.lang-tex .hljs} +\foreignquote{ngerman}{Ein deutsches +Zitat.} +``` + +@preview +![](svg/chapter-05/quotes-crop.svg) + + +@slide(layout=content-only) + +@title +Special characters & symbols + +@content +### Detexify to the rescue! ⛑️ +* A long list of symbols to use: + [PDF on the CTAN website](http://tug.ctan.org/info/symbols/comprehensive/symbols-a4.pdf) +* Draw symbols and have them recognised: + [Detexify](http://detexify.kirelabs.org/classify.html) + + +@slide(layout=task) + +@task-number +5 + +@title +Insert special characters + +@content +
+From now on, compile the file `main-exercises.tex` to see your changes appear in the exercise script (in this task, see exercise 5). +
+ +* Replace the spaces in `exercises/special-characters.tex` within the abbreviations (“e. g.”, “i. a.”) by **thin spaces**. +* Replace the hyphens separating the opening hours by **en dashes** (`--`), optionally surrounded by thin spaces. +* Add **quotation marks** around the words *Studi-Ticket* and *Studi-Karte* using the `\enquote` command. + + +@slide(layout=extra-content-and-preview) + +@title +English and French spacing + +@content +In English, LaTeX uses the old-fashioned *English spacing,* i. e., double sentence spacing. + +If you want to be more modern, you can use `\frenchspacing` above your first paragraph. `\nonfrenchspacing` goes back to default. + +If you actually use *English spacing,* LaTeX will still try and put normal word spacing after abbreviations. However, you should check the results and intervene where needed by + +* forcing normal spaces: `.\␣` +* manually ending sentences: `\@.␣` + +@preview +![](svg/chapter-05/french-spacing-crop.svg) + + +@slide(layout=extra-content-and-preview) + +@title +Hyphenation + +@content +Most of the time, LaTeX hyphenates words correctly, if the correct language is configured. +Sometimes, however, manual intervention is necessary. + + + + + + + + + + + + + + + + + + + + + + + + + + +
Exclusive hyphenation`\-`
Additional hyphenation`"-`
Hyphen (suppressing other hyphenation)`-`
Hyphen (allowing other hyphenation)`"=`
Possible separation without hyphen`""`
Non-breaking hyphen`"~`
+ +

Some of the codes only work when you use the `babel` package.

+ +@preview +![](svg/chapter-05/hyphenation-crop.svg) + + +@slide(layout=extra-content-only) + +@title +Manual quotation + +@content + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LanguageCommandResult
English (B. E.) \`…\' ‘ … ’
 2nd Level\`\`…\'\'“ … ”
English (A. E.)\`\`…\'\'“ … ”
 2nd Level \`…\' ‘ … ’
German`\glqq … \grqq`„ … “
 2nd Level` \glq … \grq `‚ … ‘
German altern.`\frqq … \flqq`» … «
 2nd Level` \frq … \flq `› … ‹
+ +Other rules my apply for other languages, but most of the time it’s the same characters, only combined differently. + + +@slide(layout=extra-content-only) + +@title +Diacritics + +@content +Letters with diacritics can either by typed directly on the keyboard or via escape codes: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\\\`{o}ò  `\c{c}` ç  `\d{u}`
`\'{o}` ó`\k{a}` ą`\r{a}` å
`\^{o}` ô`\l{}` ł`\u{o}` ŏ
`\"{o}` ö`\={o}` ō`\v{s}` š
`\H{o}` ő`\b{o}` o`\t{oo}`o͡o
`\~{o}` õ`\.{o}` ȯ`\o` ø
+ + +@slide(layout=extra-content-only) + +@title +Special characters + +@content +The same is true for special characters: They can either be typed directly or created via escape codes and commands: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
¿ ?\`¡ !\`
^ `\textasciicircum`~ `\textasciitilde`
`\textasteriskcentered`\\ `\textbackslash`
| `\textbar` `\textbullet`
`\textcopyright` `\textdagger`
`\textdaggerdbl` `\textellipsis`
< `\textless`> `\textgreater`
`\textperthousand`§ `\textsection`
+ +… and pretty much anything else. \ No newline at end of file diff --git a/latex-wochenende-wise-2023/slides/support.de.md b/latex-wochenende-wise-2023/slides/support.de.md new file mode 100644 index 0000000..cde1415 --- /dev/null +++ b/latex-wochenende-wise-2023/slides/support.de.md @@ -0,0 +1,103 @@ +@slide(layout=chapter-slide) + +@number +15 + +@title +Hilfe und Informationen + +@slide(layout=content-only) + +@title +[Wikibooks](https://de.wikibooks.org/wiki/LaTeX-Kompendium) + +@content +Das Wikibook zu LaTeX enthält eine große Anzahl interessanter Artikel und ist auch in deutscher Sprache verfügbar. + +![](svg/chapter-16/wikibooks-latex.jpg) + +@slide(layout=content-only) + +@title +[CTAN](https://ctan.org) + +@content +Das »Comprehensive TeX Archive Network« ist die zentrale Quelle für LaTeX-Pakete und ihre Dokumentation. + +![](svg/chapter-16/ctan.jpg) + +@slide(layout=content-only) + +@title +[Overleaf](https://www.overleaf.com) + +@content +Ein Online-LaTeX-Editor, der das kollaboratives Arbeiten an Dokumenten ermöglicht. + +Außerdem findest du auf der Seite verschiedene Tutorials und unter »Templates« LaTeX-Vorlagen für viele Gelegenheiten (Lebenslauf, Abschlussarbeiten, …). + +![](svg/chapter-16/overleaf.jpg) + +@slide(layout=content-only) + +@title +[StackExchange](https://tex.stackexchange.com) + +@content +Frage-Forum zu LaTeX. + +![](svg/chapter-16/stackexchange.jpg) + +@slide(layout=content-only) + +@title +[TeXample](https://www.texample.net) + +@content +Webseite mit zahlreichen LaTeX-Beispielvorlagen, vor allem zu TikZ. + +![](svg/chapter-16/texample.jpg) + +@slide(layout=preview-only) + +@preview +![Klassisch ([Quelle](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/klassisches-beispiel-2.jpeg){.large} + +@slide(layout=preview-only) + +@preview +![Noch klassischer ([Quelle](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/klassischeres-beispiel.jpg) + +@slide(layout=preview-only) + +@preview +![Anders ([Quelle](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/anderes-beispiel.png){.large} + +@slide(layout=content-only) + +@title +[Fachschaft WIAI](https://www.uni-bamberg.de/wiai/fs/) + +@content +Wenn ihr sonst noch Fragen oder Probleme habt, kommt gerne bei uns vorbei oder schreibt uns eine Mail! +

📍WE5/02.104
+☎️0951 863 1219
+📧fachschaft-wiai.stuve@uni-bamberg.de +

+ + +@slide(layout=content-only) + +@title +Kurzes Feedback + +@content +* Was hat euch gut gefallen? +* Was hätten wir besser machen können? +* Was hättet ihr euch gewünscht? + +@slide(layout=preview-only) + +@preview + diff --git a/latex-wochenende-wise-2023/slides/support.en.md b/latex-wochenende-wise-2023/slides/support.en.md new file mode 100644 index 0000000..32ff2e9 --- /dev/null +++ b/latex-wochenende-wise-2023/slides/support.en.md @@ -0,0 +1,104 @@ +@slide(layout=chapter-slide) + +@number +15 + +@title +Getting help and information + +@slide(layout=content-only) + +@title +[Wikibooks](https://en.wikibooks.org/wiki/LaTeX) + +@content +The LaTeX Wikibook offers numerous interesting articles and is available in English and German (among others). + +![](svg/chapter-16/wikibooks-latex_en.jpg) + +@slide(layout=content-only) + +@title +[CTAN](https://ctan.org) + +@content +The “Comprehensive TeX Archive Network” is the central source for LaTeX packages and their documentation. + +![](svg/chapter-16/ctan.jpg) + +@slide(layout=content-only) + +@title +[Overleaf](https://www.overleaf.com) + +@content +Overleaf is a collaborative online LaTeX editor. + +It also offers a multiple tutorials and templates for different occasions (CV, theses, …): »Templates«. + +![](svg/chapter-16/overleaf.jpg) + +@slide(layout=content-only) + +@title +[StackExchange](https://tex.stackexchange.com) + +@content +Question-and-answer website for LaTeX. + +![](svg/chapter-16/stackexchange.jpg) + +@slide(layout=content-only) + +@title +[TeXample](https://www.texample.net) + +@content +A collection of LaTeX examples, especially with TikZ. + +![](svg/chapter-16/texample.jpg) + +@slide(layout=preview-only) + +@preview +![Classic ([source](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/klassisches-beispiel-2.jpeg){.large} + +@slide(layout=preview-only) + +@preview +![More classic ([source](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/klassischeres-beispiel.jpg) + +@slide(layout=preview-only) + +@preview +![Different ([source](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/anderes-beispiel.png){.large} + +@slide(layout=content-only) + +@title +[Fachschaft WIAI](https://www.uni-bamberg.de/wiai/fs/) + +@content +If you have any other questions or problems, just come over or write us an e-mail! +

📍WE5/02.104
+☎️0951 863 1219
+📧fachschaft-wiai.stuve@uni-bamberg.de +

+ + +@slide(layout=content-only) + +@title +A short feedback round + +@content +* What did you like? +* What could we have done better? +* What did you wish for? + +@slide(layout=preview-only) + +@preview + + diff --git a/latex-wochenende-wise-2023/slides/tables.de.md b/latex-wochenende-wise-2023/slides/tables.de.md new file mode 100644 index 0000000..54b9948 --- /dev/null +++ b/latex-wochenende-wise-2023/slides/tables.de.md @@ -0,0 +1,233 @@ +@slide(layout=chapter-slide) + +@number +10 + +@title +Tabellen + + +@slide(layout=content-only) + +@title +Grundstruktur 🗒️ + +@content +Für typografisch schöne Tabellen nutzen wir das Paket `booktabs`. + +``` {.hljs .lang-tex} +\usepackage{booktabs} +``` + +``` {.hljs .lang-tex} +\begin{table}[] + \begin{tabular}{} + % Tabelleninhalt + \end{tabular} + \caption{} +\end{table} +``` + +Die Positionierung erfolgt analog zu Grafiken. + + +@slide(layout=content-and-preview) + +@title +Spaltendefinitionen + +@content +``` {.hljs .lang-tex} +\begin{tabular}{lrcl} + % Tabelleninhalt +\end{tabular} +``` + + + + + + + + + + + + + + + + + + +
KürzelBedeutung
llinksbündige Spalte
czentrierte Spalte
rrechtsbündige Spalte
+ +++ Vertikale Trennlinien und doppelte horizontale Linien sind unter Typograph\*innen nicht gern gesehen und sollten vermieden werden. + +@preview +![](svg/chapter-12/tabelle-beispiel-crop.svg){.thin-padding} + + +@slide(layout=content-and-preview) + +@title +Tabelleninhalt + +@content +``` {.hljs .lang-tex} +\begin{tabular}{lll} + \toprule + Spalte 1 & Spalte 2 & Spalte 3 \\ + \midrule + Inhalt a & Inhalt b & Inhalt c \\ + Inhalt e & Inhalt f & Inhalt g \\ + Inhalt i & Inhalt j & Inhalt k \\ + \bottomrule +\end{tabular} +``` +* ++ Zellen werden durch ›`&`‹ abgetrennt. +* ++ Reihen werden durch ›`\\`‹ beendet. +* ++ `\toprule`, `\midrule` und `\bottomrule` strukturieren die Tabelle. + +@preview +![](svg/chapter-12/tabelle-inhalt-beispiel-crop.svg){.thin-padding} + + +@slide(layout=wide-content) + +@title +Die gesamte Tabelle + +@content +``` {.hljs .lang-tex} +\begin{table}[h] + \begin{tabular}{lrcl} + \toprule + Sprache & Autor & Erscheinungsjahr & Dateiendung \\ + \midrule + C++ & Bjarne Stroustrup & 1985 & .cpp \\ + Java & James Gosling & 1998 & .java \\ + Python & Guido van Rossum & 1991 & .py \\ + \bottomrule + \end{tabular} + \caption{Bekannte Programmiersprachen} +\end{table} +``` + +

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

+ +

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

+ + +@slide(layout=content-only) + +@title +Mehr Komfort + +@content +Der [Tables Generator](https://tablesgenerator.com/) ist ein wunderbares Werkzeug, um schnell Tabellen verschiedener Formate zu erstellen. + +[![](svg/chapter-12/tables-generator.png)](https://tablesgenerator.com/) + + +@slide(layout=task) + +@task-number +10 + +@title +Tabellen setzen + +@content +* Die Liste in der Datei `exercises/tables/tables.tex` enthält Infos zu ein paar Lehrveranstaltung an der Fakultät WIAI. +* Wandelt die Liste in eine **Tabelle** um. +* Die Tabelle soll Spalten für den *Namen*, das *Kürzel* und das *Semester* der Vorlesungen haben. +* Fügt außerdem eine **zentrierte Spalte** ganz links in der Tabelle hinzu, in der ihr die Lehrveranstaltungen **nummeriert**. + + + +@slide(layout=extra-content-only) + +@title +Besonders lange Tabellen + +@content +Tabellen, die über eine Seite hinaus gehen, werden von `tabular` einfach abgeschnitten. Die Lösung bietet hier das Paket `longtable`: + +``` {.hljs .lang-tex} +\usepackage{longtable} +``` + +``` {.hljs .lang-tex} +\begin{longtable}{} + % Tabelleninhalt + \caption{} + \label{
@@ -504,27 +504,27 @@ aussieht. }
-

+

☹ schräg (verzerrt)

-

+

☺ gerade

-

+

☺ kursiv (eigener Schnitt)

-

+

☹ kleine Schrift vergrößert

-

+

☺ jeweils passender Schriftgrad

-

+

☹ große Schrift verkleinert

@@ -577,7 +577,7 @@ das ihr nach dem Workshop als kompakte Referenz verwenden könnt.

- +
@@ -622,7 +622,7 @@ Bildquelle: xkcd
- +
@@ -632,7 +632,7 @@ Bildquelle: xkcd
-Der Weg zum fertigen Dokument +Der Weg zum fertigen Dokument
@@ -734,7 +734,7 @@ Hallo, Welt!
- +
@@ -813,7 +813,7 @@ nichts verloren.
- +
@@ -837,7 +837,7 @@ Geburtsort: Milwaukee, Wisconsin
- +
@@ -858,7 +858,7 @@ Geburtsort: Milwaukee, Wisconsin
- +
@@ -882,7 +882,7 @@ unterteilt. Immer verfügbar:

- +
@@ -938,7 +938,7 @@ Mein Lieblingsrezept
- +
@@ -988,7 +988,7 @@ Mein Lieblingsrezept
- +
@@ -1097,7 +1097,7 @@ Bücher
- +
@@ -1118,7 +1118,7 @@ angegeben werden:

- +
@@ -1172,7 +1172,7 @@ Auskommentieren kann in TeXstudio mit dem Shortcut Strg +
- +
@@ -1203,7 +1203,7 @@ Auskommentieren kann in TeXstudio mit dem Shortcut Strg +
- +
@@ -1234,7 +1234,7 @@ Inhalt von Abschnitt 2.
- +
@@ -1262,7 +1262,7 @@ Schreibweise verwenden.
- +
@@ -1286,7 +1286,7 @@ relativen Pfaden auf den aktuellen Ordner (hier:
- +
@@ -1307,7 +1307,7 @@ relativen Pfaden auf den aktuellen Ordner (hier:
- +
@@ -1319,9 +1319,11 @@ relativen Pfaden auf den aktuellen Ordner (hier:

Dateipfade angeben 👣

-task.texgraphics.raw.tex (wenn -task.tex von main-exercises.tex importiert -wird) +basic-functionality.texgraphics.raw.tex +

+

+(wenn basic-functionality.tex von +main-exercises.tex importiert wird)

./exercises/graphics/graphics.raw.tex
@@ -1333,7 +1335,7 @@ Dateien einbindet, die wiederum andere Dateien referenzieren.
- +
@@ -1426,7 +1428,7 @@ Freiräume nach Satzzeichen zu verhindern.
- +
@@ -1497,7 +1499,7 @@ a dash — mostly in American English
- +
@@ -1520,7 +1522,7 @@ quote.}
- +
@@ -1596,7 +1598,7 @@ kontrolliert werden. Eingreifen können wir mit

- +
@@ -1667,7 +1669,7 @@ Einige der Codes funktionieren nur mit eingebundenem
- +
@@ -2124,8 +2126,8 @@ unterstrichen
- - + +
@@ -2167,7 +2169,7 @@ bereit, der URLs

- +
@@ -2212,7 +2214,7 @@ Schriftgrößen
- +
@@ -2238,7 +2240,7 @@ vermeiden!
- +
@@ -2268,7 +2270,7 @@ abgeschaltet werden
- +
@@ -2307,7 +2309,7 @@ den Befehl \item gekennzeichnet.

- +
@@ -2331,8 +2333,8 @@ den Befehl \item gekennzeichnet.

- - + +
@@ -2358,7 +2360,7 @@ den Befehl \item gekennzeichnet.

- +
@@ -2405,7 +2407,7 @@ Zwischenräume zur Verfügung.

- +
@@ -2429,7 +2431,7 @@ zur Verfügung, die in einem Absatz stehen.

- +
@@ -2455,7 +2457,7 @@ notwendig.

- +
@@ -2493,7 +2495,7 @@ aktiviert wird. Außerdem gibt es eine Blockumgebung:

- +
@@ -2565,7 +2567,7 @@ unterdrückt werden.
- +
@@ -2815,7 +2817,7 @@ werden.
- +
@@ -3065,7 +3067,7 @@ Typograph*innen nicht gern gesehen und sollten vermieden werden.

- +
@@ -3094,7 +3096,7 @@ Typograph*innen nicht gern gesehen und sollten vermieden werden.

- +
@@ -3138,7 +3140,7 @@ Breite des Tabelleninhalts.

Der Tables Generator ist ein wunderbares Werkzeug, um schnell Tabellen verschiedener Formate zu erstellen.

-

+

@@ -3245,7 +3247,7 @@ auch im Querformat dargestellt werden:

- +
@@ -3283,7 +3285,7 @@ wiki/Eber}}
- +
@@ -3307,7 +3309,7 @@ Wie man in Abbildung \ref{img:fooboar} …
- +
@@ -3332,7 +3334,7 @@ Abkürzung ein.

- +
@@ -3477,7 +3479,7 @@ können.

- +
@@ -3504,7 +3506,7 @@ sec:section3,sec:section5}.
- +
@@ -3604,7 +3606,7 @@ Zitierstilen.Unbekannt

-Zitieren im Alpha-Zitierstil +Zitieren im Alpha-Zitierstil
@@ -3616,7 +3618,7 @@ Zitierstilen.Unbekannt

-Zitieren im Natdin-Zitierstil +Zitieren im Natdin-Zitierstil
@@ -3629,7 +3631,7 @@ Natdin-Zitierstil
-Finden von fertigen BibTeX-Einträgen – Bamberger Katalog +Finden von fertigen BibTeX-Einträgen – Bamberger Katalog
@@ -3642,7 +3644,7 @@ Bamberger Katalog
-Finden von fertigen BibTeX-Einträgen – Google Scholar +Finden von fertigen BibTeX-Einträgen – Google Scholar
@@ -3655,7 +3657,7 @@ Google Scholar
-Finden von fertigen BibTeX-Einträgen – Google Scholar +Finden von fertigen BibTeX-Einträgen – Google Scholar
@@ -3668,7 +3670,7 @@ Google Scholar
-Finden von fertigen BibTeX-Einträgen – dblp.org +Finden von fertigen BibTeX-Einträgen – dblp.org
@@ -3736,7 +3738,7 @@ Quadrate aller geraden % …
- +
@@ -3759,7 +3761,7 @@ Einfügen externen Codes:

- +
@@ -3885,7 +3887,7 @@ weiter verbreitet.
- +
@@ -3918,7 +3920,7 @@ Themes.

- +
@@ -3960,7 +3962,7 @@ child { node {home}
- +
@@ -3978,7 +3980,7 @@ erstellen:

- +
@@ -4038,7 +4040,7 @@ einwandfrei darstellen.

- +
@@ -4130,7 +4132,7 @@ Gestalten von Tabellen

Das Wikibook zu LaTeX enthält eine große Anzahl interessanter Artikel und ist auch in deutscher Sprache verfügbar.

-

+

@@ -4144,7 +4146,7 @@ und ist auch in deutscher Sprache verfügbar.

Das »Comprehensive TeX Archive Network« ist die zentrale Quelle für LaTeX-Pakete und ihre Dokumentation.

-

+

@@ -4162,7 +4164,7 @@ Dokumenten ermöglicht.

»Templates« LaTeX-Vorlagen für viele Gelegenheiten (Lebenslauf, Abschlussarbeiten, …).

-

+

@@ -4175,7 +4177,7 @@ LaTeX-Vorlagen für viele Gelegenheiten (Lebenslauf, Abschlussarbeiten, StackExchange

Frage-Forum zu LaTeX.

-

+

@@ -4189,7 +4191,7 @@ LaTeX-Vorlagen für viele Gelegenheiten (Lebenslauf, Abschlussarbeiten,

Webseite mit zahlreichen LaTeX-Beispielvorlagen, vor allem zu TikZ.

-

+

@@ -4199,7 +4201,7 @@ TikZ.

-Klassisch (Quelle) +Klassisch (Quelle)
@@ -4211,7 +4213,7 @@ TikZ.

-Noch klassischer (Quelle) +Noch klassischer (Quelle)
@@ -4223,7 +4225,7 @@ TikZ.

-Anders (Quelle) +Anders (Quelle)
@@ -4244,7 +4246,7 @@ vorbei oder schreibt uns eine Mail! ☎️0951 863 1219
📧fachschaft-wiai.stuve@uni-bamberg.de

-

+

@@ -4268,7 +4270,7 @@ vorbei oder schreibt uns eine Mail!
-

+

diff --git a/latex-wochenende/slides/basic-document-structure.de.md b/latex-wochenende/slides/basic-document-structure.de.md new file mode 100644 index 0000000..736f352 --- /dev/null +++ b/latex-wochenende/slides/basic-document-structure.de.md @@ -0,0 +1,412 @@ +@slide(layout=chapter-slide) + +@number +3 + +@title +Grundstruktur eines LATEX-Dokuments + + +@slide(layout=content-and-preview) + +@title +Präambel & Dokumentumgebung + +@content +

👁 Ein mit LaTeX gesetztes Dokument besteht aus:

+ +* **Präambel:** globale Einstellungen (Dokumentklasse, Kodierung, Sprache, Seitenformat, zusäzliche Pakete, …) und +* **Dokumentumgebung:** Inhalt des Dokuments. + +``` {.lang-tex .hljs .fragment} +\documentclass[ngerman]{article} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage[ngerman]{babel} + +\begin{document} +Hallo, Welt! +\end{document} +``` + +@preview +![](svg/chapter-03/hallo-crop.svg) + + +@slide(layout=wide-content) + +@title +Dokumentenklasse + +@content +``` {.lang-tex .hljs} +\documentclass[]{} +``` + +Konkret zum Beispiel + +``` {.lang-tex .hljs} +\documentclass[10pt,a5paper,landscape]{article} +``` + + +@slide(layout=content-only) + +@title +Kodierung + +@content +``` {.lang-tex .hljs} +\usepackage[utf8]{inputenc} +\usepackage[t1]{fontenc} +``` + +* Die Zeichenkodierung bestimmt, welche Zeichen verfügbar sind. +* **ASCII** enthält kaum Sonderzeichen wie deutsche Umlaute. +* **UTF-8** ist eine universelle Kodierung. + + +@slide(layout=content-only) + +@title +Sprache + +@content +``` {.lang-tex .hljs} +\usepackage[ngerman]{babel} +``` + +* Das Paket **`babel`** stellt sprachspezifische Informationen (z. B. Silbentrennung, Sonderzeichen, Wechsel zwischen Fonts, Übersetzung von Labels wie ›Kapitel‹, ›Inhaltsverzeichnis‹ oder ›Abbildung‹) bereit. +* **`ngerman`** steht für die neue deutsche Rechschreibung. + + +@slide(layout=content-and-preview) + +@title +Fließtext + +@content +``` {.lang-tex .hljs} +Fließtext kann direkt in den Quelltext ↲ +geschrieben werden. ↲ +Einfache Zeilenumbrüche ↲ +werden dabei ignoriert, ↲ +genau wie mehrere Leerzeichen. ↲ +↲ +Leerzeilen erzeugen einen neuen Absatz,↲ +standardmäßig mit Einzug. ↲ +Manuelle Zeilenumbrüche können mit ↲ +zwei Backslashes erzwungen werden, ↲ +haben in Fließtext aber eigentlich \\ ↲ +nichts verloren. +``` + +@preview +![](svg/chapter-03/absätze-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Kommentare + +@content +Nach einem Prozentzeichen wird der Rest der Zeile vom Compiler ignoriert. Der Kommentartext erscheint also nicht im fertigen Dokument. + +``` {.lang-tex .hljs} +% Beginn Steckbrief +Name: Donald Knuth \\ +Geburtsdatum: \\ % TODO: einfügen +Geburtsort: Milwaukee, Wisconsin +% Ende Steckbrief +``` + +Tastenkombinationen: Strg + T und Strg + U + +@preview +![](svg/chapter-02/kommentare-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Achtung! + +@title +Reservierte Zeichen + +@content +Bestimmte Zeichen lösen in LaTeX Dinge aus: + +`# $ % ^ & _ { } ~ \` + +``` {.lang-tex .hljs} +50% sind die Hälfte. +``` + +Lösung: »`\`« voranstellen: + +``` {.lang-tex .hljs} +50\% sind die Hälfte. +``` + +Funktioniert nicht mit »`\\`«, nutzt `\textbackslash` stattdessen. + +@preview +![](svg/chapter-03/reservierte-zeichen-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Abschnitte und Kapitel + +@content +Texte werden durch Überschriften in Abschnitte und Kapitel unterteilt. Immer verfügbar: + +``` {.lang-tex .hljs} +\section{Ebene 1} +\subsection{Ebene 2} +\subsubsection{Ebene 3} +\paragraph{Ebene 4} +\subparagraph{Ebene 5} +``` + +Je nach Dokumentenklasse zusätzlich: + +``` {.lang-tex .hljs} +\chapter{Kapitel} +\part{Teil} +``` + +@preview +![](svg/chapter-03/abschnitte-crop.svg) + + +@slide(layout=wide-content) + +@title +Titelei + +@content +``` {.lang-tex .hljs data-source=title.tex} +\title{Die Welt der Trüffel} +\author{Fooboar Rüssel \and Fachschaft WIAI} +\date{\today} +\begin{document} +\maketitle +\end{document} +``` + +* In der Präambel werden die Werte für die Einträge gespeichert. +* Das Setzen des Titels erfolgt in der Dokumentumgebung mit dem Befehl `\maketitle`. +* Die genaue Gestaltung hängt ab von der verwendeten Dokumentklasse. +* Mehrere Autoren werden mit `\and` verbunden. +* Wird kein Datum angegeben, wird per default das aktuelle Datum gesetzt. Ein abweichendes Datum kann mit `\date{}` definiert werden. + + +@slide(layout=content-and-preview) + +@title +Titelei + +@content +``` {.lang-tex .hljs data-source=title.tex} +\documentclass[ngerman]{scrartcl} +\usepackage{babel} +\title{Die Welt der Trüffel} +\author{Fooboar Rüssel \and +Fachschaft WIAI} +\date{\today} +\begin{document} +\maketitle +\section{Trüffelsuche} +\subsection{Suche mit Schwein} +\subsection{Suche ohne Schwein} +Wer macht denn sowas? +\section{Trüffelrezepte} +Mein Lieblingsrezept +\end{document} +``` + +@preview +![](svg/chapter-03/titel-orig.svg) + + +@slide(layout=content-only) + +@title +Verzeichnisse + +@content +``` {.lang-tex .hljs} +\tableofcontents % Inhaltsverzeichnis +\listoffigures % Abbildungsverzeichnis +\listoftables % Tabellenverzeichnis +``` + +* Nummerierung erfolgt automatisch +* Elemente, die nicht im Verzeichnis aufgeführt werden sollen, werden mit einem »`*`« versehen, also z. B. `\section*{}`. +* **am besten zweimal kompilieren** + + +@slide(layout=content-and-preview) + +@title +Inhaltsverzeichnis + +@content +``` {.lang-tex .hljs data-source=title.tex} +\documentclass[ngerman]{scrartcl} +\usepackage{babel} +\begin{document} +\tableofcontents +\section{Trüffelsuche} +Der erste Abschnitt. +\subsection{Suche mit Schwein} +Ein Unterabschnitt. +\subsection{Suche ohne Schwein} +Ein weiterer Unterabschitt. +\subsubsection[But why?] + {Wer macht denn sowas?} +Unter-Unterabschnitt. +\section{Trüffelrezepte} +Mein Lieblingsrezept +\end{document} +``` + +@preview +![](svg/chapter-03/inhalt-crop.svg) + + + +@slide(layout=wide-task) + +@task-number +3 + +@title +Dokument und Text gliedern + +@content +* Öffnet die Datei `document-structure.tex`, die im Ordner `exercises/basic-document-structure` liegt. +* Packt den gesamten Text in der Datei in eine **Document**-Umgebung und schreibt darüber folgende **Präambel**. Kompiliert die Datei. + +``` {.lang-tex .hljs .fragment} +\documentclass{scrartcl} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage[ngerman]{babel} +``` + +* Wie ihr sehen könnt, sind in der Datei die Absätze im Dokument mit `\\` erstellt worden. Ersetzt diese durch richtige Absätze. +* Zeit für etwas Struktur! Verwendet für die **Überschriften** die passenden LaTeX-Befehle (`\section` u. ä.). +* Fügt anschließend ein **Inhaltsverzeichnis** in euer Dokument ein. + + +@slide(layout=extra-wide-content) + +@title +Dokumentenklassen + +@content +* Natürlich gibt es auch andere Dokumentenklassen als `article`. +* Je nachdem, welche Dokumentenklasse man verwendet, ändert sich das Layout der generierten PDF. +* Die korrekt geschriebenen Dokumentenklassen richten sich nach US-amerikanischen Layout-Normen. +* **`src`**-Dokumentenklassen versuchen europäische Normen abzubilden. + +Folgende Dokumentenklassen stehen zur Verfügung: + +* **`scrartcl`, `article`** für kurze Dokumente +* **`scrreprt`, `report`** für lange Dokumente +* **`scrbook`, `book`** für Bücher +* **`beamer`** für Präsentationen + + +@slide(layout=extra-wide-content) + +@title +Sprachen + +@content +Es können auch mehrere Sprachen im Dokument verwendet werden: + +``` {.lang-tex .hljs} +\usepackage[ngerman, swedish, ukrainian, greek, english]{babel} +``` + +Umschalten zwischen Sprachen: + +``` {.lang-tex .hljs} +\selectlanguage{} +\selectlanguage{} +``` + +Eingebetteter Text in anderer Sprache: + +``` {.lang-tex .hljs} +\selectlanguage{} +\foreignlanguage{}{Hier steht Text in Sprache B in einem Text in Sprache A} +``` + + +@slide(layout=extra-content-and-preview) + +@title +Sprachen – ein Beispiel + +@content +``` {.lang-tex .hljs} +\today +\selectlanguage{ngerman} +\today +\selectlanguage{swedish} +\today +\selectlanguage{ukrainian} +\today +\selectlanguage{greek} +\today +\selectlanguage{english} +\today +``` + +@preview +![](svg/chapter-03/languages-crop.svg) + + +@slide(layout=extra-content-and-preview) + +@title +Überschriften und das Inhaltsverzeichnis + +@content +Mit Sternchen fallen bei allen diesen Befehlen die Nummerierung und der Eintrag im Inhaltsverzeichnis weg: + +``` {.lang-tex .hljs} +\section*{Kein Verzeichniseintrag} +``` + +Außerdem kann für das Inhaltsverzeichnis ein alternativer Titel angegeben werden: + +``` {.lang-tex .hljs} +\section[Titel im Verzeichnis] +{Kapitelüberschrift} +``` + +@preview +![](svg/chapter-03/abschnitte-anders-crop.svg) + + +@slide(layout=content-only) + +@title +Bevor wir fortfahren können … + +@content +
+**Kommentiert** zuletzt die Präambel, die Dokumentenumgebung und das Inhaltsverzeichnis **wieder aus**. + +Nur so kann eure Lösung auch ins Skript eingebunden werden (Schnelles Auskommentieren kann in TeXstudio mit dem Shortcut Strg + T erreicht werden). +
+ +Im nächsten Kapitel erklären wir, warum das notwendig ist. \ No newline at end of file diff --git a/latex-wochenende/slides/basic-document-structure.en.md b/latex-wochenende/slides/basic-document-structure.en.md new file mode 100644 index 0000000..c7ac5d3 --- /dev/null +++ b/latex-wochenende/slides/basic-document-structure.en.md @@ -0,0 +1,411 @@ +@slide(layout=chapter-slide) + +@number +3 + +@title +Basic structure of a LATEX document + + +@slide(layout=content-and-preview) + +@title +Preamble & document environment + +@content +

👁 Every LaTeX document is composed of

+ +* a **preamble:** global settings (document class, encoding, language, page format, additional packages, …) and +* a **document environment:** content of the document. + +``` {.lang-tex .hljs .fragment} +\documentclass{article} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{babel} + +\begin{document} +Hello world! +\end{document} +``` + +@preview +![](svg/chapter-03/hello-crop.svg) + + +@slide(layout=wide-content) + +@title +Document class + +@content +``` {.lang-tex .hljs} +\documentclass[]{} +``` + +For example: + +``` {.lang-tex .hljs} +\documentclass[10pt,a5paper,landscape]{article} +``` + + +@slide(layout=content-only) + +@title +Encoding + +@content +``` {.lang-tex .hljs} +\usepackage[utf8]{inputenc} +\usepackage[t1]{fontenc} +``` + +* The character encoding determines which characters are available. +* **ASCII** contains no special characters like German umlauts. +* **UTF-8** is a universal encoding. + + +@slide(layout=content-only) + +@title +Language + +@content +``` {.lang-tex .hljs} +\usepackage[ngerman]{babel} +``` + +* The package **`babel`** provides language-specific information (e. g., hyphenation, special characters, font changes, translated labels like ‘chapter,’ ‘table of contents’ or ‘figure’). +* **`ngerman`** is the German new spelling. + + +@slide(layout=content-and-preview) + +@title +Continuous Text + +@content +``` {.lang-tex .hljs} +Continous text can be written directly ↲ +in the source code. ↲ +Simple line breaks ↲ +are ignored, ↲ +just as multiple space characters. ↲ +↲ +An empty line creates a new paragraph ↲ +which has an indentation by default. ↲ +Manual line breaks can be forced ↲ +using two backslashes, but this use ↲ +is strongly discouraged \\ ↲ +within continuous text. +``` + +@preview +![](svg/chapter-03/paragraphs-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Comments + +@content +After a percent sign, the rest of the line is ignored by the compiler. It is called a comment and does not appear in the resulting document. + +``` {.lang-tex .hljs} +% profile start +Name: Donald Knuth \\ +Date of birth: \\ % TODO: insert +Place of birth: Milwaukee, Wisconsin +% profile end +``` + +Shortcuts: Ctrl + T and Ctrl + U + +@preview +![](svg/chapter-02/comments-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Caution! + +@title +Reserved characters + +@content +Some characters do things in LaTeX: + +`# $ % ^ & _ { } ~ \` + +``` {.lang-tex .hljs} +50% is one half. +``` + +Solution: prefix with ‘`\`’: + +``` {.lang-tex .hljs} +50\% is one half. +``` + +Does not work for ‘`\\`’, use `\textbackslash` instead. + +@preview +![](svg/chapter-03/reserved-characters-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Sections and chapters + +@content +Texts are structured by beeing subdivided in sections and chapters. Always available: + +``` {.lang-tex .hljs} +\section{Level 1} +\subsection{Level 2} +\subsubsection{Level 3} +\paragraph{Level 4} +\subparagraph{Level 5} +``` + +Additionally, for some document classes: + +``` {.lang-tex .hljs} +\chapter{Chapter} +\part{Part} +``` + +@preview +![](svg/chapter-03/sections-crop.svg) + + +@slide(layout=wide-content) + +@title +Front matter + +@content +``` {.lang-tex .hljs data-source=title.tex} +\title{The World of Truffles} +\author{Fooboar Rüssel \and Fachschaft WIAI} +\date{\today} +\begin{document} +\maketitle +\end{document} +``` + +* The values for the entries are stored in the preamble. +* `\maketitle` typesets the front matter within the document environment. +* The exact appearance depends on the document class. +* Multiple authors can be joined with `\and`. +* If no date is given, the current date will be used. A different date can be defined with `\date{}`. + + +@slide(layout=content-and-preview) + +@title +Front matter + +@content +``` {.lang-tex .hljs data-source=title.tex} +\documentclass{article} +\usepackage{babel} +\title{The World of Truffles} +\author{Fooboar Rüssel +\and Fachschaft WIAI} +\date{\today} +\begin{document} +\maketitle +\section{Truffle hunt} +\subsection{Hunt with a pig} +\subsection{Hunt without a pig} +Why would you do that? +\section{Truffle recipes} +My favorite recipe +\end{document} +``` + +@preview +![](svg/chapter-03/title-orig.svg) + + +@slide(layout=content-only) + +@title +Registers + +@content +``` {.lang-tex .hljs} +\tableofcontents +\listoffigures +\listoftables +``` + +* automatic numbering +* elements with an asterisk (`*`) are hidden from the register: e. g. `\section*{}`. +* **generally requires two rounds of compilation** + + +@slide(layout=content-and-preview) + +@title +Table of contents + +@content +``` {.lang-tex .hljs data-source=title.tex} +\documentclass{article} +\usepackage{babel} +\begin{document} +\tableofcontents +\section{Truffle hunt} +The first section. +\subsection{Hunt with a pig} +A subsection. +\subsection{Hunt without a pig} +Another subsection. +\subsubsection[But why?] + {Why would you do that?} +Sub-subsection. +\section{Truffle recipes} +My favorite recipe +\end{document} +``` + +@preview +![](svg/chapter-03/contents-crop.svg) + + +@slide(layout=wide-task) + +@task-number +3 + +@title +Structure your document and text + +@content +* Open the file `document-structure.tex`. It is located in the directory `exercises/basic-document-structure`. +* Wrap the entire text in a **document** environment and insert the following **preamble**. Compile the document. + +``` {.lang-tex .hljs .fragment} +\documentclass{scrartcl} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage[english]{babel} +``` + +* As you may already have noticed, **paragraphs** are marked as ‘`\\`’. Use real paragraphs instead. +* Time to structure our document! Use LaTex commands to declare all **headings** (`\section`, `\subsubsection`, etc.). +* Add a **table of contents** to your document. + + +@slide(layout=extra-wide-content) + +@title +Document classes + +@content +* There are also other document classes than `article`. +* Based on the document class, the layout of the generated pdf file changes. +* Normally speled classes adhere to American English layout norms. +* **`src`** document classes usually adhere to European layout norms. + +Following document classes are available: + +* **`scrartcl`, `article`** for short documents +* **`scrreprt`, `report`** for longer documents +* **`scrbook`, `book`** for books +* **`beamer`** for presentations + + +@slide(layout=extra-wide-content) + +@title +Languages + +@content +A document can use multiple languages at once: + +``` {.lang-tex .hljs} +\usepackage[ngerman, swedish, ukrainian, greek, english]{babel} +``` + +To switch languages: + +``` {.lang-tex .hljs} +\selectlanguage{} +\selectlanguage{} +``` + +Embedded Text in another language: + +``` {.lang-tex .hljs} +\selectlanguage{} +\foreignlanguage{}{Text of language B in a Text of language A} +``` + + +@slide(layout=extra-content-and-preview) + +@title +Languages — an example + +@content +``` {.lang-tex .hljs} +\today +\selectlanguage{ngerman} +\today +\selectlanguage{swedish} +\today +\selectlanguage{ukrainian} +\today +\selectlanguage{greek} +\today +\selectlanguage{english} +\today +``` + +@preview +![](svg/chapter-03/languages-crop.svg) + + +@slide(layout=extra-content-and-preview) + +@title +Headlines and the table of contents + +@content +With an asterisk, there is no numbering and no entry in the table of contents: + +``` {.lang-tex .hljs} +\section*{No entry in table of contents} +``` + +You can also provide an alternative title for the table of contents: + +``` {.lang-tex .hljs} +\section[Entry in table of contents] +{Actual chapter heading} +``` + +@preview +![](svg/chapter-03/sections-differently-crop.svg) + + +@slide(layout=content-only) + +@title +Before we can continue … + +@content +
+Finally, **comment out** the preamble, the document environment, and the table of contents. + +Only this way, your solution can be embedded in the script itself. (In TeXstudio, comments can be achieved by the shortcut Strg + T.) +
+ +We will learn in the following chapter why this is the case. \ No newline at end of file diff --git a/latex-wochenende/slides/basic-functionality.de.md b/latex-wochenende/slides/basic-functionality.de.md new file mode 100644 index 0000000..c6f7320 --- /dev/null +++ b/latex-wochenende/slides/basic-functionality.de.md @@ -0,0 +1,91 @@ +@slide(layout=chapter-slide) + +@number +2 + +@title +Wie funktioniert LATEX? + + +@slide(layout=content-and-preview) + +@title +WYSIWaaas? + +@content +### What You See Is What You Get {data-category=Word} + +* Formatierung mit unmittelbarem optischen Feedback + +
+### What You See Is What You Mean {data-category=LaTeX} + +* Trennung von Inhalt und Struktur +* Formatierung erst am Ende ersichtlich +
+ +

+ Bildquelle: xkcd +

+ +@preview +![](svg/chapter-02/xkcd-types-of-editors.png) + + +@slide(layout=preview-only) + +@preview +![Der Weg zum fertigen Dokument](svg/chapter-02/wysiwyg.svg){} + + +@slide(layout=two-columns) + +@title +Was brauchen wir dazu? + +@column-one +### Editor +zum Schreiben unseres Quelltextes mit allen Befehlen zur semantischen Gliederung + +[TeXstudio](http://www.texstudio.org/), [TeXMaker](https://www.xm1math.net/texmaker/) + +@column-two +### Compiler +erstellt aus dem Quelltext ein fertig formatiertes PDF-Dokument + +[MiKTeX](http://miktex.org/), [MacTeX](http://tug.org/mactex/), [TeX Live](https://tug.org/texlive/) + + +@slide(layout=wide-content) + +@title +Befehle + +@content +Allgemeiner Aufbau eine Befehls: + +``` {.hljs .lang-txt} +\[]{} +``` + +++ Ein paar Beispiele: + +``` {.lang-tex .tex .hljs .fragment} +\newpage % fügt eine neue Seite ein +\textbf{fetter Text} % schreibt den übergebenen Text fett +\documentclass[10pt,a5paper,landscape]{article} % konfiguriert die Dokumentenklasse +\frac{1}{4} % fügt den mathematischen Bruch ein +``` + + +@slide(layout=content-only) + +@title +Backslash + +@content +Den Backslash erzeugt ihr mit folgender Tastenkombination: + +AltGr + ß (Windows/Linux) + +Alt + Shift + 7 (MacOS) diff --git a/latex-wochenende/slides/basic-functionality.en.md b/latex-wochenende/slides/basic-functionality.en.md new file mode 100644 index 0000000..0cf5521 --- /dev/null +++ b/latex-wochenende/slides/basic-functionality.en.md @@ -0,0 +1,93 @@ +@slide(layout=chapter-slide) + +@number +2 + +@title +How does
LATEX work? + + +@slide(layout=content-and-preview) + +@title +WYSIWhat? + +@content +### What You See Is What You Get {data-category=Word} + +* Formatting with immediate visual feedback + +
+### What You See Is What You Mean {data-category=LaTeX} + +* Separation of content and structure +* Formatting only visible afterwards +
+ +

+ Image source: xkcd +

+ +@preview +![](svg/chapter-02/xkcd-types-of-editors.png) + + +@slide(layout=preview-only) + +@preview +![How to get the final document](svg/chapter-02/wysiwyg.svg){} + + +@slide(layout=two-columns) + +@title +What do we need? + +@column-one +### Editor +writing our source code including all the commands that structure the text semantically + +[TeXstudio](http://www.texstudio.org/), [TeXMaker](https://www.xm1math.net/texmaker/) + +@column-two +### Compiler +takes the source code and creates a PDF document ready for publication + +[MiKTeX](http://miktex.org/), [MacTeX](http://tug.org/mactex/), [TeX Live](https://tug.org/texlive/) + + +@slide(layout=wide-content) + +@title +Commands + +@content +General structure of a command: + +``` {.hljs .lang-txt} +\[]{} +``` + +++ A few examples: + +``` {.lang-tex .tex .hljs .fragment} +\newpage % inserts a new page +\textbf{bold text} % formats the text bold +\documentclass[a4paper,12pt, landscape]{article} % configures the document class +\frac{1}{4} % inserts a mathematical fraction +``` + + +@slide(layout=content-only) + +@title +Backslash + +@content +You get the backslash by pressing + +AltGr + ß (Windows/Linux) + +Alt + Shift + 7 (MacOS) + + diff --git a/latex-wochenende/slides/graphics.de.md b/latex-wochenende/slides/graphics.de.md new file mode 100644 index 0000000..c261788 --- /dev/null +++ b/latex-wochenende/slides/graphics.de.md @@ -0,0 +1,113 @@ +@slide(layout=chapter-slide) + +@number +9 + +@title +Grafiken + + +@slide(layout=content-only) + +@title +Grafiken abbilden 🖼️ + +@content +Um Grafiken darzustellen, muss das Paket `graphicx` eingebunden werden. + +``` {.lang-tex .hljs} +\begin{figure} + \includegraphics{} + \caption[]{} +\end{figure} +``` + +Bildgröße angeben: + +``` {.lang-tex .hljs} +\includegraphics[width=0.5\textwidth, +height=5cm]{} +``` + + +@slide(layout=content-only) + +@title +Positionierung auf der Seite + +@content + +``` {.lang-tex .hljs} +\begin{figure}[] +``` + +LaTeX positioniert Grafiken automatisch. Durch Kürzel können wir unsere Präferenzen (auch in Kombination) angeben. + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KürzelPosition
hhier, wenn es dir recht ist
toberer Seitenrand (top)
bunterer Seitenrand (bottom)
pauf einer eigenen Seite (page)
HHier, verdammt noch mal!
(benötigt Paket `float`)
+ + +@slide(layout=content-only) + +@title +Zentrierte Anordnung + +@content +``` {.lang-tex .hljs} +\begin{figure}[] + \begin{center} + \includegraphics{} + \end{center} +\end{figure} +``` + +Alternativ: + +``` {.lang-tex .hljs} +\begin{figure}[] + \centering + \includegraphics{} +\end{figure} +``` + + +@slide(layout=task) + +@task-number +9 + +@title +Grafiken einfügen + +@content +* Im Ordner `exercises/graphics` findet ihr eine Bilddatei namens `latex-logo.png`. +* Fügt sie **genau** unterhalb dieser Aufgabenstellung im Skript ein. +* Das Bild soll **zentriert** auf der Seite eingebunden werden. +* Fügt außerdem eine **Bildunterschrift** ein. +* Passt die **Größe** des Bildes an Breite der Seite (`\textwidth`) an. diff --git a/latex-wochenende/slides/graphics.en.md b/latex-wochenende/slides/graphics.en.md new file mode 100644 index 0000000..155d4f2 --- /dev/null +++ b/latex-wochenende/slides/graphics.en.md @@ -0,0 +1,113 @@ +@slide(layout=chapter-slide) + +@number +9 + +@title +Graphics + + +@slide(layout=content-only) + +@title +Including graphics 🖼️ + +@content +To display graphics, we need the `graphicx` package. + +``` {.lang-tex .hljs} +\begin{figure} + \includegraphics{} + \caption[]{} +\end{figure} +``` + +Specifying the size: + +``` {.lang-tex .hljs} +\includegraphics[width=0.5\textwidth, +height=5cm]{} +``` + + +@slide(layout=content-only) + +@title +Layout on the page + +@content + +``` {.lang-tex .hljs} +\begin{figure}[] +``` + +LaTeX places graphics automatically. With position codes, we can express our preferences (they can be combined as well). + + + + + + + + + + + + + + + + + + + + + + + + + + + +
codeposition
hhere, if you don’t mind
ttop of the page
bbottom of the page
pon its own page
HHere, for God’s sake!
(`float` package required)
+ + +@slide(layout=content-only) + +@title +Centred alignment + +@content +``` {.lang-tex .hljs} +\begin{figure}[] + \begin{center} + \includegraphics{} + \end{center} +\end{figure} +``` + +Alternatively: + +``` {.lang-tex .hljs} +\begin{figure}[] + \centering + \includegraphics{} +\end{figure} +``` + + +@slide(layout=task) + +@task-number +9 + +@title +Inserting graphics + +@content +* In the directory `exercises/graphics` you can find an image file named `latex-logo.png`. +* **Include** the figure in `exercises/graphics/graphics.tex` and place it **exactly** where you include it. +* The image shall be **centered**. +* Additionally, add a **caption** for the figure. +* Adapt the **width** of the image to the width of the text (`\textwidth`). diff --git a/latex-wochenende/slides/intro.de.md b/latex-wochenende/slides/intro.de.md new file mode 100644 index 0000000..72f677b --- /dev/null +++ b/latex-wochenende/slides/intro.de.md @@ -0,0 +1,67 @@ +@slide(layout=chapter-slide) + +@number +0 + +@title +Erste Schritte mit LATEX + +@content +Um das Skript für das Tutorium kompilieren zu können, müssen zunächst ein paar Konfigurationgen gemacht werden, die in den nächsten Folien erklärt werden. + +@slide(layout=content-only) + +@title +Exkurs: Eine Kommandozeile öffnen + +@content +* Für die kommenden Aufgaben brauchen wir eine Kommandozeile +* Je nach Betriebssystem, das verwendet wird, gibt es unteschiedliche Wege, sie zu öffnen +* **Windows**: Drückt die Windows-Taste, tippt *cmd* und drückt Enter +* **MacOS**: Drückt die *Command*-Taste und die Leertaste gleichzeitig, tippt danach *Terminal* und macht einen Doppelklick auf *Terminal* +* **Linux**: Drückt ``Strg + Alt + T`` + +@slide(layout=content-only) + +@title +Den Compiler installieren + +@content +* Der Compiler übersetzt unseren LaTeX-Code in ein PDF +* Je nach Betriebssystem stehen unterschiedliche Compiler zur Verfügung: +* Windows: MikTEX +* Linux-Distributionen: TEXLive + * Debian-basierte Distros: Führt `sudo apt install texlive-full` aus + * Andere Distributionen: Folgt den anweisungen auf der TEXLive-Website + +
+Bitte achtet darauf, die full version mit allen Paketen zu installieren, wenn ihr die Auswahl habt! +
+ +@slide(layout=content-only) + +@title +Installieren des Editors + +@content +* Ein Editor kann heruntergeladen werden, sobald die Installation des Compilers fertig ist +* Es funktioniert jeglicher Text-Editor, wie etwa Notepad++ oder VSCode +* Für Anfänger:innen empfehlen wir jedoch TEXstudio, da es LaTeX-spezifische Features bietet +* Ladet TEXstudio herunter und installiert es + + + +@slide(layout=content-only) +@title +Kompilieren des Skriptes + +@content +* Ladet das Projektarchiv aus dem VC herunter +* Entpackt das Archiv +* Öffnet die Datei main-exercises.tex in TeXstudio. Ihr findet es im Wurzelverzeichnis des Archivs +* Kompiliert die Datei, indem ihr klickt +* Einige neue Dateien sollten nun durch das Kompilieren generiert werden + +
+Windows-Nutzer:innen: Um Dateiendungen zu aktivieren, klickt auf das Ansichts-Tab im Dateiexplorer und wählt *Dateiendungen*. So könnt ihr besser zwischen den einzelnen main-Files unterscheiden. +
diff --git a/latex-wochenende/slides/intro.en.md b/latex-wochenende/slides/intro.en.md new file mode 100644 index 0000000..fa418c5 --- /dev/null +++ b/latex-wochenende/slides/intro.en.md @@ -0,0 +1,67 @@ +@slide(layout=chapter-slide) + +@number +0 + +@title +First steps with LATEX + +@content +In order to compile the script for this tutorial, a few steps have to be followed, which are explained in the next slides. + +@slide(layout=content-only) + +@title +Digression: Opening a command prompt + +@content +* For the following tasks, we are going to need a command prompt +* It can be opened in different ways, depending on your operating system + + * **Windows**: Press the Windows key and type in *cmd*, press Enter + * **MacOS**: Press the *Command* key and the *space bar* simultaneously, then type in *Terminal* and double click on *Terminal* + * **Linux**: Press ``Ctrl + Alt + T`` + +@slide(layout=content-only) + +@title +Installing the compiler + +@content +* The compiler translates our LATEX code into a PDF +* Depending on your operating system, different compilers are available +* Windows: MikTEX +* macOS: MacTEX +* Linux distributions: TEXLive + * Debian-based distributions: run `sudo apt install texlive-full` + * other distributions: see the TEXLive website + +
+Make sure to install the full version with all packages, if you can! +
+ +@slide(layout=content-only) + +@title +Installing the editor + +@content +* An editor can downloaded once the compiler has been installed +* For editing LaTeX documents, any text editor works fine, e.g., Notepad++, VSCode +* For beginners, TEXstudio is recommended due to its LaTeX-specific features +* Download and install TEXstudio + +@slide(layout=content-only) +@title +Compile the script for the first time + +@content +* Download the project archive from the VC. +* Unzip the archive. +* Open the file `main-exercises.tex` in TEXstudio. It is located in the root directory of the archive. +* Compile `main-exercises.tex` by pressing +* A few new files will be generated by the compilation. + +
+Windows users: In order to enable file endings, click the view tab in the file explorer, and select *file name extensions*. This helps differentiating the different ``main`` files. +
diff --git a/latex-wochenende/slides/lists.de.md b/latex-wochenende/slides/lists.de.md new file mode 100644 index 0000000..e94c732 --- /dev/null +++ b/latex-wochenende/slides/lists.de.md @@ -0,0 +1,164 @@ +@slide(layout=chapter-slide) + +@number +7 + +@title +Aufzählungen + +@slide(layout=content-and-preview) + +@title +Ungeordnete Listen 📜 + +@content +``` {.lang-tex .hljs} +\begin{itemize} + \item Nudelplatten + \item Passierte Tomaten, % … + \item Oregano, Basilikum, % … + \item Mozzarella + \item Mehl + \item Milch +\end{itemize} +``` + +Die einzelnen Stichpunkte werden in jeder Aufzählungsumgebung durch den Befehl `\item` gekennzeichnet. + +@preview +![](svg/chapter-08/itemize-crop.svg) + +@slide(layout=content-and-preview) + +@title +Geordnete Listen und Definitionslisten + +@content +``` {.lang-tex .hljs} +\begin{enumerate} + \item die Zwiebeln in einem Topf % … + \item passierte Tomaten, Möhren % … + \item mit Kräutern und Gewürzen % … + % \item … +\end{enumerate} +``` + +``` {.lang-tex .hljs .fragment} +\begin{description} + \item [Béchamelsauce] Béchamel % … + \item [Lasagne] Als Lasagne % … +\end{description} +``` + +@preview + + + +@slide(layout=content-and-preview) + +@title +Verschachtelte Listen + +@content +``` {.lang-tex .hljs} +\begin{itemize} + % … + \item Gemüse \begin{itemize} + \item Passierte Tomaten + \item Möhren + \end{itemize} + \item Kräuter \begin{enumerate} + \item Oregano + \item Basilikum + \end{enumerate} + % … +\end{itemize} +``` + +@preview +![](svg/chapter-08/nested-lists-crop.svg) + +@slide(layout=task) + +@task-number +7 + +@title +Aufzählungen einfügen + +@content +* Formatiert das Rezept in `lists.tex` im Ordner `exercises/lists` als **ungeordnete Liste** mit den Elementen *Ingredients* und *Instructions*. Nutzt dafür den Befehl `\itemize`. +* Benutzt innerhalb dieser Liste für die Zutaten eine **ungeordnete Liste** und für die Arbeitsschritte eine **geordnete Liste**. + + +@slide(layout=extra-content-and-preview) + +@title +Kompakte Listen + +@content +Das Paket `paralist` stellt Aufzählungen ohne riesige Zwischenräume zur Verfügung. + +``` {.lang-tex .hljs} +\section{Zutaten} +\begin{compactitem} + % \item … +\end{compactitem} +\section{Zubereitung} +\begin{compactenum} + % \item … +\end{compactenum} +\section{Glossar} +\begin{compactdesc} + % \item … +\end{compactdesc} +``` + +@preview +![](svg/chapter-08/compact-crop.svg) + +@slide(layout=extra-content-and-preview) + +@title +Aufzählungen im Absatz + +@content +Neben den kompakten Listen stellt `paralist` auch Listen zur Verfügung, die in einem Absatz stehen. + +``` {.lang-tex .hljs} +Folgende Kräuter sind für % … +\begin{inparaitem} + \item Liebstöckel + \item Petersilie + \item Schnittlauch +\end{inparaitem} +``` + +Natürlich gibt es auch hier ein Pendant namens `inparaenum` für geordnete Listen. + +@preview + + + +@slide(layout=extra-content-and-preview) + +@title +Aufzählungsarten + +@content +Die Art der Aufzählung lässt sich über den optionalen Parameter `label` ändern. Hierfür ist das Paket `enumitem` notwendig. + +``` {.lang-tex .hljs} +% Römische Zahlen +\begin{enumerate}[label=\roman*] +% … +% Arabische Zahlen +\begin{enumerate}[label=\arabic*] +% … +% Alphabetisch +\begin{enumerate}[label=\alph*] +% … +``` + +@preview +![](svg/chapter-08/list-style-types-crop.svg) \ No newline at end of file diff --git a/latex-wochenende/slides/lists.en.md b/latex-wochenende/slides/lists.en.md new file mode 100644 index 0000000..90d4f87 --- /dev/null +++ b/latex-wochenende/slides/lists.en.md @@ -0,0 +1,167 @@ +@slide(layout=chapter-slide) + +@number +7 + +@title +Enumerations + +@slide(layout=content-and-preview) + +@title +Unordered lists 📜 + +@content +``` {.lang-tex .hljs} +\begin{itemize} + \item lasagna noodles + \item crushed tomatoes, % … + \item oregano, basil, % … + \item mozzarella cheese + \item flour + \item milk +\end{itemize} +``` + +We mark each bullet point with `\item`. +This pattern is the same for all kinds of enumerations. + +@preview +![](svg/chapter-08/itemize-english-crop.svg) + +@slide(layout=content-and-preview) + +@title +Ordered and definition lists + +@content +``` {.lang-tex .hljs} +\begin{enumerate} + \item cook onions over medium % … + \item add crushed tomatoes, carrots % … + \item add herbs and spices % … + % \item … +\end{enumerate} +``` + +``` {.lang-tex .hljs .fragment} +\begin{description} + \item [Béchamel sauce] Béchamel % … + \item [Lasagne] Lasagne (singular % … +\end{description} +``` + +@preview + + + +@slide(layout=content-and-preview) + +@title +Nested lists + +@content +``` {.lang-tex .hljs} +\begin{itemize} + % … + \item vegetables \begin{itemize} + \item crushed tomatoes + \item carrots + \end{itemize} + \item herbs \begin{enumerate} + \item oregano + \item basil + \end{enumerate} + % … +\end{itemize} +``` + +@preview +![](svg/chapter-08/nested-lists-english-crop.svg) + + +@slide(layout=task) + +@task-number +7 + +@title +Adding enumerations + +@content +* Turn the recipe in `lists.tex` into an **unordered list** consisting of the elements *Ingredients* and *Instructions*. You can find the file in the directory `exercises/lists`. Use the `itemize` command. +* Within this list, create a **unordered list** for the ingredients and a **ordered list** for the instructions. + + +@slide(layout=extra-content-and-preview) + +@title +Compact lists + +@content +The package `paralist` offers enumerations with less line spacing. + +``` {.lang-tex .hljs} +\section{Ingredients} +\begin{compactitem} + % \item … +\end{compactitem} +\section{Preparation} +\begin{compactenum} + % \item … +\end{compactenum} +\section{Glossary} +\begin{compactdesc} + % \item … +\end{compactdesc} +``` + +@preview +![](svg/chapter-08/compact-english-crop.svg) + +@slide(layout=extra-content-and-preview) + +@title +In-line enumerations + +@content +Another feature provided by `paralist` enables us to integrate enumerations into paragraphs. + +``` {.lang-tex .hljs} +The following herbs are % … +\begin{inparaitem} + \item lovage + \item parsley + \item chives +\end{inparaitem} +``` + +Of course, there is an accompanying list type called `inparaenum` for ordered lists. + +@preview + + + +@slide(layout=extra-content-and-preview) + +@title +List styles + +@content +The list style type can be set using the optional parameter `label`. +To accomplish this, we need to include the package `enumitem` first. + +``` {.lang-tex .hljs} +% Roman numerals +\begin{enumerate}[label=\roman*] +% … +% Arabic numerals +\begin{enumerate}[label=\arabic*] +% … +% Alphabetical +\begin{enumerate}[label=\alph*] +% … +``` + +@preview +![](svg/chapter-08/list-style-types-english-crop.svg) \ No newline at end of file diff --git a/latex-wochenende/slides/literature.de.md b/latex-wochenende/slides/literature.de.md new file mode 100644 index 0000000..5c3689d --- /dev/null +++ b/latex-wochenende/slides/literature.de.md @@ -0,0 +1,114 @@ +@slide(layout=chapter-slide) + +@number +12 + +@title +Literatur­verwaltung + + +@slide(layout=content-only) + +@title +Was brauchen wir dafür? + +@content +* eine **Bibliographiedatei** (nachfolgend `.bib`-Datei) zur Speicherung von Literaturverweisen +* **BibTeX** als Schnittstelle zwischen der Literatur und LaTeX + + +@slide(layout=wide-content) + +@title +Was ist diese ominöse `.bib`-Datei? + +@content +* Sammlung von Literatureinträgen im BibTeX-Format +* Beispielhafter Literatureintrag: + +``` {.hljs .lang-tex} +@article{turing1990, % Art des Dokuments und Bezeichner für den \cite Befehl + title={The chemical basis of morphogenesis}, % Titel + 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 +} +``` + + +@slide(layout=content-only) + +@title +Wie wird das verwendet? + +@content +Durch BibTeX wird LaTeX um einige Befehle zum Zitieren erweitert. Außerdem benötigt wird das Paket `natbib`. + +* ++ Zitieren eines Autors: `\citeauthor{}` +* ++ Zitieren einer Quelle: `\cite{}` +* ++ Zitieren einer Seite: `\cite[S. 15]{}` +* ++ Zitieren mit weiteren Zusätzen:
`\cite[][]{}` +* ++ Verweis auf die genutzte `.bib`-Datei: `\bibliography{<.bib-datei>}` +* ++ Angabe des genutzten Zitierstils:
`\bibliographystyle{}` + +> Zwei Dinge sind unendlich. Das Universum und die Auswahl an Zitierstilen.Unbekannt + + +@slide(layout=preview-only) + +@preview +![Zitieren im Alpha-Zitierstil](svg/chapter-14/bibtex-alpha-crop.svg){.large .thin-padding} + + +@slide(layout=preview-only) + +@preview +![Zitieren im Natdin-Zitierstil](svg/chapter-14/bibtex-natdin-crop.svg){.large .thin-padding} + + +@slide(layout=preview-only) + +@preview +![Finden von fertigen BibTeX-Einträgen – Bamberger Katalog](svg/chapter-14/bamberger_katalog_bibtex.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finden von fertigen BibTeX-Einträgen – Google Scholar](svg/chapter-14/google_bibtex1.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finden von fertigen BibTeX-Einträgen – Google Scholar](svg/chapter-14/google_bibtex2.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finden von fertigen BibTeX-Einträgen – dblp.org](svg/chapter-14/dblp.jpg){.large} + + +@slide(layout=wide-task) + +@task-number +12 + +@title +Ein Literaturverzeichnis erstellen und einfügen + +@content +* Erstellt im Ordner `exercises/literature` eine neue BibTeX-Datei `literature.bib`. +* Sucht bei Google Scholar oder dblp.org die BibTeX-Einträge für folgende $\LaTeX$-Handbücher: + * Dilip Datta (2017): $\LaTeX$ in 24 Hours. A Practical Guide for Scientific Writing. + * Frank Mittelbach / Michel Goossens (2012): Der $\LaTeX$-Begleiter. +* Fügt die BibTeX-Einträge in die BibTeX-Datei ein. +* Vergebt aussagekräftige BibTeX-Keys. +* Bindet die BibTeX-Datei an einer geeigneten Stelle ein, an der später auch das Literaturverzeichnis zu sehen sein soll. +* Zitiert die zwei Handbücher im Text in der Datei `exercises/literature/literature.tex`. +* Wählt den Bibliographiestil `plain`. + diff --git a/latex-wochenende/slides/literature.en.md b/latex-wochenende/slides/literature.en.md new file mode 100644 index 0000000..79325df --- /dev/null +++ b/latex-wochenende/slides/literature.en.md @@ -0,0 +1,114 @@ +@slide(layout=chapter-slide) + +@number +12 + +@title +Reference management + + +@slide(layout=content-only) + +@title +What do we need? + +@content +* a **bibliography file** (hereafter `.bib` file) for storing references +* **BibTeX** as an interface between the references and LaTeX + + +@slide(layout=wide-content) + +@title +What is this mysterious `.bib` file? + +@content +* collection of references in BibTeX format +* example: + +``` {.hljs .lang-tex} +@article{turing1990, % the type of the document and an identifier for the \cite command + title={The chemical basis of morphogenesis}, % information + author={Turing, Alan Mathison}, % about + journal={Bulletin of mathematical biology}, % the + volume={52}, % literature + pages={153--197}, % work + year={1990}, % follows + publisher={Springer} % … +} +``` + + +@slide(layout=content-only) + +@title +How is it used? + +@content +BibTeX adds some citation commands to LaTeX. In addition, we need the `natbib` package. + +* ++ Citing an author: `\citeauthor{}` +* ++ Citing a source: `\cite{}` +* ++ Citing a page: `\cite[p. 15]{}` +* ++ Citing with additional text:
`\cite[][]{}` +* ++ Referencing the `.bib` file: `\bibliography{<.bib file>}` +* ++ Choosing a citation style:
`\bibliographystyle{}` + +> Two things are infinite: the universe and the assortment of citation styles.Unknown + + +@slide(layout=preview-only) + +@preview +![Citing in Alpha style](svg/chapter-14/bibtex-alpha-example-crop.svg){.large .thin-padding} + + +@slide(layout=preview-only) + +@preview +![Citing in Natdin style](svg/chapter-14/bibtex-natdin-example-crop.svg){.large .thin-padding} + + +@slide(layout=preview-only) + +@preview +![Finding ready-made BibTeX entries – University of Bamberg Library](svg/chapter-14/bamberg_catalogue_bibtex.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finding ready-made BibTeX entries – Google Scholar](svg/chapter-14/google_bibtex1.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finding ready-made BibTeX entries – Google Scholar](svg/chapter-14/google_bibtex2.jpg){.large} + + +@slide(layout=preview-only) + +@preview +![Finding ready-made BibTeX entries – dblp.org](svg/chapter-14/dblp.jpg){.large} + + +@slide(layout=wide-task) + +@task-number +12 + +@title + +Creating and inserting references + +@content +* Create a new BibTeX file called `literature.bib` in the `exercises/literature` folder. +* Use Google Scholar or dblp.org to retrieve BibTeX references for the following $\LaTeX$ handbooks: + * Dilip Datta (2017): $\LaTeX$ in 24 Hours. A Practical Guide for Scientific Writing. + * Frank Mittelbach / Michel Goossens (2012): Der $\LaTeX$-Begleiter. +* Add the BibTeX entries to the BibTeX file. +* Assign unique and meaningful BibTeX keys. +* Include the BibTeX file in a suitable location, where later on the references should be listed. +* Cite the two handbooks in the file `exercises/literature/literature.tex`. +* Make use of the `plain` bibliography style. diff --git a/latex-wochenende/slides/maths.de.md b/latex-wochenende/slides/maths.de.md new file mode 100644 index 0000000..43f00eb --- /dev/null +++ b/latex-wochenende/slides/maths.de.md @@ -0,0 +1,228 @@ +@slide(layout=chapter-slide) + +@number +8 + +@title +Mathematische Formeln + +@slide(layout=content-and-preview) + +@title +Formel-Umgebungen 🧮 + +@content +``` {.lang-tex .hljs} +$2 \sqrt{\frac{\pi^2}{3} \cdot c_2}$ +``` + +Mathematische Formeln können **nur im sogenannten Mathmode** gesetzt werden, der inline durch zwei Dollarzeichen aktiviert wird. Außerdem gibt es eine Blockumgebung: + +``` {.lang-tex .hljs} +\begin{equation} + 2 \sqrt{\frac{\pi^2}{3} \cdot c_2} +\end{equation} +``` + +Pakete: `amsmath`, `amsthm`, `amssymb`, `mathtools` + +@preview +![](svg/chapter-09/simple-maths-crop.svg) + +@slide(layout=content-only) + +@title +Einige Beispiele + +@content + + + + + + + + + + + + + + + + + +
QuelltextErgebnis
`\sum_{i=1}^{n}x^2`$\sum_{i=1}^{n} x^2$
`12 \leq 4 x^2 + 13`$12 \leq 4 x^2 + 13$
`{n \choose k}`${n \choose k}$
+ + +@slide(layout=content-and-preview) + +@title +Ausrichtung von mehreren Gleichungen + +@content +Die Umgebung `align` erlaubt es, Gleichungen zum Beispiel am › = ‹ auszurichten. + +``` {.lang-tex .hljs} +\begin{align} + 13 \cdot (4a - 3)^2 &= 13 … \\ + &= 208a^2 - 312a + 117 +\end{align} +``` + +* ++ Ausgerichtet wird am ›`&`‹-Zeichen. +* ++ Zeilenumbrüche werden mit ›`\\`‹ markiert. +* ++ Die Nummerierung kann bei `align` und `equation` durch durch ein Sternchen nach dem Umgebungsnamen (z. B. `\begin{align*}` und `\end{align*}`) unterdrückt werden. + +@preview +![](svg/chapter-09/alignment-crop.svg) + + +@slide(layout=task-without-number) + +@task-number +8a + +@title +Formeln setzen + +@content +Setzt die folgenden Formeln in der Datei `exercises/maths/math-formulas.tex`. + +| Bedeutung | Ergebnis | +|-----------|----------| +| Fallbeschleunigung (Deutschland) | $9,81\,\frac{m}{s^2}$ | +| pq-Formel | $x_{1,2} = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}$ | +| Mitternachtsformel | $x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ | +| Catalansche Zahlen | $C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!}$ | + +@slide(layout=task-without-number) + +@task-number +8b + +@title +Formeln setzen + +@content +Setzt die folgenden Formeln in der Datei `exercises/maths/math-formulas.tex`. + +| Bedeutung | Ergebnis | +|-----------|----------| +| Definition der Fakultät | $n! = \prod_{i=1}^{n} i$ | +| Menge aller ungeraden natürlichen Zahlen | $\{ x \mid x \in \mathbb{N}, \text{ungerade}(x) \}$ | +| Elimination $\neg\exists x$ | $\neg\exists x . p(x) \Leftrightarrow \forall x . \neg p(x)$ | + + + +@slide(layout=extra-content-only) + +@title +Weitere Beispiele + +@content + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QuelltextErgebnis
`(x)`, `[x]`, `\lbrace x \rbrace`, `\lvert x \rvert`$(x), [x], \lbrace x\rbrace, \lvert x\rvert$
`\exists`, `\forall`, `\in`,
`\notin`, `\infty`
$\exists,\forall,\in,\notin,\infty$
`\alpha`, `\beta`, `\Gamma`,
`\Delta`, `\varepsilon`, `\pi`
$\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi$
`\rightarrow`, `\leftarrow`, `\Rightarrow`, `\Leftarrow`, `\Leftrightarrow`$\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow$
`(A \cup B) \cap C`$(A \cup B) \cap C$
`(A \lor B) \land C`$(A \lor B) \land C$
`(A \cdot B) \times C`$(A \cdot B) \times C$
+ +@slide(layout=extra-content-only) + +@title +Mitwachsende Klammern + +@content + + + + + + + + + + + + + + + + + +
QuelltextErgebnis
`\left( \frac{1}{2} \right)`$\left( \frac{1}{2} \right)$
`\left[ \frac{1}{2} \right]`$\left[ \frac{1}{2} \right]$
`\left\lbrace \frac{1}{2} \right\rbrace`$\left\lbrace \frac{1}{2} \right\rbrace$
+ + +``` {.lang-tex .hljs} +$4 \cdot \left( \frac{1}{2} % … +``` + +

$4 \cdot \left(\frac{1}{2} +\frac{3}{ 12 \cdot \left( 2 + \frac{1}{86 \cdot \left(\frac{1}{2} + 24 \right)} \right)} \right)$

+ + +@slide(layout=extra-content-and-preview) + +@title +Darstellung von Grenzen + +@content +Mit dem Befehl `\limits` lassen sich die Grenzen von Integralen unter und über dem Integralzeichen darstellen. Bei Summen, Produkten und Grenzwerten geschieht das automatisch. + +``` {.lang-tex .hljs} +\sum_{i=1}^{n^2}(x+2) +\prod_{j=1}^{100}(3 \cdot x) +\lim_{x \rightarrow \infty}(14x^3 - 12) +\int\limits_{-12}^{4}(14x^3 - 12) +``` + +

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

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

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

+

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

+ +``` {.lang-tex .hljs} +$\left\lbrace x \mid \text{tiefe}(x) … +``` \ No newline at end of file diff --git a/latex-wochenende/slides/maths.en.md b/latex-wochenende/slides/maths.en.md new file mode 100644 index 0000000..c8734ce --- /dev/null +++ b/latex-wochenende/slides/maths.en.md @@ -0,0 +1,233 @@ +@slide(layout=chapter-slide) + +@number +8 + +@title +Typesetting mathematics + +@slide(layout=content-and-preview) + +@title +Formula environments 🧮 + +@content +``` {.lang-tex .hljs} +$2 \sqrt{\frac{\pi^2}{3} \cdot c_2}$ +``` + +Mathematical formulas are only accepted in the so-called **math mode.** +In-line formulas must therefor be guarded by two dollar signs. +We can also use the `equation` block environment: + +``` {.lang-tex .hljs} +\begin{equation} + 2 \sqrt{\frac{\pi^2}{3} \cdot c_2} +\end{equation} +``` + +Packages: `amsmath`, `amsthm`, `amssymb`, `mathtools` + +@preview +![](svg/chapter-09/simple-maths-crop.svg) + +@slide(layout=content-only) + +@title +Examples + +@content + + + + + + + + + + + + + + + + + +
source coderesult
`\sum_{i=1}^{n}x^2`$\sum_{i=1}^{n} x^2$
`12 \leq 4 x^2 + 13`$12 \leq 4 x^2 + 13$
`{n \choose k}`${n \choose k}$
+ + +@slide(layout=content-and-preview) + +@title +Aligning a group of equations + +@content +The `align` environment permits us to align equations at certain positions like the ‘ = ’ character. + +``` {.lang-tex .hljs} +\begin{align} + 13 \cdot (4a - 3)^2 &= 13 … \\ + &= 208a^2 - 312a + 117 +\end{align} +``` + +* ++ The equations will be aligned with respect to the ampersands (‘`&`’). +* ++ We can mark a new line using ‘`\\`’. +* ++ `align` and `equation` will not be numbered if we add an asterisk after their names (e. g. `\begin{align*}` and `\end{align*}`). + +@preview +![](svg/chapter-09/alignment-crop.svg) + + +@slide(layout=task-without-number) + +@task-number +8a + +@title +Typesetting mathematics + +@content +Code up the following formulas in the file `exercises/maths/math-formulas.tex`. + +| Meaning | Result | +|---------|--------| +| Gravitational acceleration | $9,81\,\frac{m}{s^2}$ | +| Formula to solve quadratic equations | $x_{1,2} = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}$ | +| Another formula to solve quadratic equations | $x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ | +| Catalan numbers | $C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!}$ | + + +@slide(layout=task-without-number) + +@task-number +8b + +@title +Typesetting mathematics + +@content +Code up the following formulas in the file `exercises/maths/math-formulas.tex`. + +| Meaning | Result | +|---------|--------| +| Definition of factorial | $n! = \prod_{i=1}^{n} i$ | +| Set of all odd natural numbers | $\{ x \mid x \in \mathbb{N}, \text{odd}(x) \}$ | +| Elimination $\neg\exists x$ | $\neg\exists x . p(x) \Leftrightarrow \forall x . \neg p(x)$ | + + + +@slide(layout=extra-content-only) + +@title +More examples + +@content + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
source coderesult
`(x)`, `[x]`, `\lbrace x \rbrace`, `\lvert x \rvert`$(x), [x], \lbrace x\rbrace, \lvert x\rvert$
`\exists`, `\forall`, `\in`,
`\notin`, `\infty`
$\exists,\forall,\in,\notin,\infty$
`\alpha`, `\beta`, `\Gamma`,
`\Delta`, `\varepsilon`, `\pi`
$\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi$
`\rightarrow`, `\leftarrow`, `\Rightarrow`, `\Leftarrow`, `\Leftrightarrow`$\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow$
`(A \cup B) \cap C`$(A \cup B) \cap C$
`(A \lor B) \land C`$(A \lor B) \land C$
`(A \cdot B) \times C`$(A \cdot B) \times C$
+ +@slide(layout=extra-content-only) + +@title +Height-adapting braces + +@content + + + + + + + + + + + + + + + + + +
source coderesult
`\left( \frac{1}{2} \right)`$\left( \frac{1}{2} \right)$
`\left[ \frac{1}{2} \right]`$\left[ \frac{1}{2} \right]$
`\left\lbrace \frac{1}{2} \right\rbrace`$\left\lbrace \frac{1}{2} \right\rbrace$
+ + +``` {.lang-tex .hljs} +$4 \cdot \left( \frac{1}{2} % … +``` + +

$4 \cdot \left(\frac{1}{2} +\frac{3}{ 12 \cdot \left( 2 + \frac{1}{86 \cdot \left(\frac{1}{2} + 24 \right)} \right)} \right)$

+ + +@slide(layout=extra-content-and-preview) + +@title +Depicting boundaries + +@content +The bounds of an integral can be enforced to appear above and below the integral symbol using the `\limits` command. +This is the standard behaviour for sums, products and limits. + +``` {.lang-tex .hljs} +\sum_{i=1}^{n^2}(x+2) +\prod_{j=1}^{100}(3 \cdot x) +\lim_{x \rightarrow \infty}(14x^3 - 12) +\int\limits_{-12}^{4}(14x^3 - 12) +``` + +

Don't use `\limits` inline.

+ + +@preview +![](svg/chapter-09/limits-crop.svg) + + +@slide(layout=extra-content-only) + +@title +Set-builder notation + +@content +In certain situations, it is more adequate to use textual predicates or long function names within the set builder notation. + +This is where `\text{}` comes into play. + +

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

+

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

+ +``` {.lang-tex .hljs .fragment} +$\left\lbrace x \mid \text{frequency} … +``` \ No newline at end of file diff --git a/latex-wochenende/slides/packages.de.md b/latex-wochenende/slides/packages.de.md new file mode 100644 index 0000000..959fc1e --- /dev/null +++ b/latex-wochenende/slides/packages.de.md @@ -0,0 +1,214 @@ +@slide(layout=chapter-slide) + +@number +14 + +@title +Paket in Sicht! + +@slide(layout=content-and-preview) + +@title +Stichwortverzeichnis anlegen + +@content +```{.lang-tex .hljs} +\usepackage{makeidx} +\makeindex +\begin{document} +\maketitle +\section{Was ist LaTeX\index{LaTeX}?} +LaTeX\index{LaTeX} ist ein +Textsatzsystem\index{Textsatzsystem}. +\newpage \section{TeX\index{TeX} vs. +LaTeX\index{LaTeX}} Es basiert auf +TeX\index{TeX}, einer Erfindung von +Donald Knuth\index{Knuth, Donald}. +Da TeX\index{TeX} in seiner Syntax sehr +viel komplexer als LaTeX\index{LaTeX} +ist, ist LaTeX\index{LaTeX} wesentlich +weiter verbreitet. +\printindex +``` + +@preview +![](svg/chapter-15/index.png) + +@slide(layout=content-and-preview) + +@title +Präsentationen gestalten + +@content +Für Präsentationen gibt es die Dokumentenklasse `beamer` sowie zahlreiche [Vorlagen und Themes](https://www.overleaf.com/learn/latex/Beamer). + +```{.lang-tex .hljs .small-text} +\documentclass{beamer} +\usetheme{Frankfurt} +\usecolortheme{seahorse} +\usepackage[utf8]{inputenc} + +\begin{document} +\begin{frame} + \frametitle{Zitronensorbet} + \framesubtitle{Inkarnation des Guten?} + \begin{definition} + Ein Zitronensorbet ist eine + halbgefrorene \textbf{Speiseeiscreme} + auf Basis von \textit{Zitronen}. + \end{definition} +\end{frame} +\end{document} +``` + +@preview + + + +@slide(layout=content-and-preview) + +@title +Grafiken erstellen + +@content +`TikZ` (»TikZ ist kein Zeichenprogramm«) ist ein umfangreiches Paket zur Erstellung von Vektorgrafiken. + +```{.lang-tex .hljs .small-text .scroll-one-half} +% … +\tikzstyle{every node}=[draw=black,thick,anchor=west] +\tikzstyle{selected}=[draw=red,fill=red!30] +\tikzstyle{dir}=[fill=gray!50] +\tikzstyle{relativeTo}=[fill=blue!70] +\begin{tikzpicture}[% +grow via +three points={one child at (0.5,-0.7) and +two children at +(0.5,-0.7) and (0.5,-1.4)}, +edge from +parent path={(\tikzparentnode.south) + |- (\tikzchildnode.west)}] +\node {/ oder C:} +child { node {home} + child { node {knut} + child { node {pictures}} + child { node {docs} + child { node [dir] {latex} + child { node [relativeTo] {main.tex} + child { node [selected] {part1.tex} + } + } + } +}; +\end{tikzpicture} +``` + +@preview +![](svg/chapter-04/relative-path-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Linguistik + +@content +Mit dem Paket `qtree` lassen sich Konstituentenbäume erstellen: + +```{.lang-tex .hljs} +\Tree [.S [.NP LaTeX ] +[.VP [.V is ] [.NP fun ] ] ] +``` + +@preview +![](svg/chapter-15/constituency-tree-crop.svg) + +@slide(layout=content-and-preview) + +@title +Mathematische Beweisführung + +@content +Beweisbäume lassen sich mit dem Paket `prftree` einwandfrei darstellen. + +```{.hljs .lang-tex .small-text .scroll-one-half} +\begin{displaymath} +\prftree[l,r]{}{[comp$\_{ns}$]} +{ + \prftree[l,r]{}{[comp$\_{ns}$]} + { + \prftree[l,r]{}{[ass$\_{ns}$]} + { + - + } + { + (\texttt{m:=a}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{48,\bot} + } + } + { + \prftree[l,r]{}{[ass$\_{ns}$]} + { + - + } + { + (\texttt{n:=b}, \sigma\_{48,\bot}) + \rightarrow \sigma\_{48,18} + } + } + { + (\texttt{m:=a; n:=b}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{48,18} + } +} +{ + \prftree[l,r]{}{} + { + \dots + } + { + \textbf{[1]}\ (\texttt{LOOP}, \sigma\_{48,18}) + \rightarrow \sigma\_{6,6} + } +} +{ + (\texttt{m:=a; n:=b; LOOP}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{6,6} +} +\end{displaymath} +``` + +@preview + + +@slide(layout=content-only) + +@title +Weitere nützliche Pakete + +@content + + + + + + + + + + + + + + + + + + + + + + + + + +
PaketAnwendung
xcolorMach’s mit Farbe
todonotesToDo-Markierungen und Liste der ToDos
pdfpagesEinbinden von PDF-Dateien
subcaptionVerschachtelte Abbildungen und ausgefeilte Bildunterschriften
colortbl, tabularx, multirow, makecellGestalten von Tabellen
diff --git a/latex-wochenende/slides/packages.en.md b/latex-wochenende/slides/packages.en.md new file mode 100644 index 0000000..859519b --- /dev/null +++ b/latex-wochenende/slides/packages.en.md @@ -0,0 +1,215 @@ +@slide(layout=chapter-slide) + +@number +14 + +@title +Package in sight! + +@slide(layout=content-and-preview) + +@title +Creating an index + +@content +```{.lang-tex .hljs} +\usepackage{makeidx} +\makeindex +\begin{document} +\maketitle +\section{What is LaTeX\index{LaTeX}?} +LaTeX\index{LaTeX} is a typesetting +system\index{Typesetting system}. +\newpage \section{TeX\index{TeX} vs. +LaTeX\index{LaTeX}} It is based on +TeX\index{TeX}, an invention by +Donald Knuth\index{Knuth, Donald}. +As TeX\index{TeX} is way more complex +syntactically than LaTeX\index{LaTeX}, +LaTeX\index{LaTeX} is much more +popular. +\printindex +``` + +@preview +![](svg/chapter-15/index_en-crop.svg) + +@slide(layout=content-and-preview) + +@title +Designing presentation slides + +@content +For slides, there is the `beamer` document class, as well as numerous [templates and themes](https://www.overleaf.com/learn/latex/Beamer). + +```{.lang-tex .hljs .small-text} +\documentclass{beamer} +\usetheme{Frankfurt} +\usecolortheme{seahorse} +\usepackage[utf8]{inputenc} + +\begin{document} +\begin{frame} + \frametitle{Lemon sorbet} + \framesubtitle{Incarnation of good?} + \begin{definition} + A lemon sorbet is a + semi-frozen \textbf{dessert} + on \textit{lemon} base. + \end{definition} +\end{frame} +\end{document} +``` + +@preview + + + +@slide(layout=content-and-preview) + +@title +Drawing images + +@content +`TikZ` (“TikZ ist kein Zeichenprogramm” — “TikZ is no drawing software”) is a powerful package for drawing vector graphics. + +```{.lang-tex .hljs .small-text .scroll-one-half} +% … +\tikzstyle{every node}=[draw=black,thick,anchor=west] +\tikzstyle{selected}=[draw=red,fill=red!30] +\tikzstyle{dir}=[fill=gray!50] +\tikzstyle{relativeTo}=[fill=blue!70] +\begin{tikzpicture}[% +grow via +three points={one child at (0.5,-0.7) and +two children at +(0.5,-0.7) and (0.5,-1.4)}, +edge from +parent path={(\tikzparentnode.south) + |- (\tikzchildnode.west)}] +\node {/ or C:} +child { node {home} + child { node {knut} + child { node {pictures}} + child { node {docs} + child { node [dir] {latex} + child { node [relativeTo] {main.tex} + child { node [selected] {part1.tex} + } + } + } +}; +\end{tikzpicture} +``` + +@preview +![](svg/chapter-04/relative-path-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Linguistics + +@content +The `qtree` package can render constituent-based parse trees: + +```{.lang-tex .hljs} +\Tree [.S [.NP LaTeX ] +[.VP [.V is ] [.NP fun ] ] ] +``` + +@preview +![](svg/chapter-15/constituency-tree-crop.svg) + +@slide(layout=content-and-preview) + +@title +Mathematical proofs + +@content +Logical tableaux can be renderd using the `prftree` package. + +```{.hljs .lang-tex .small-text .scroll-one-half} +\begin{displaymath} +\prftree[l,r]{}{[comp$\_{ns}$]} +{ + \prftree[l,r]{}{[comp$\_{ns}$]} + { + \prftree[l,r]{}{[ass$\_{ns}$]} + { + - + } + { + (\texttt{m:=a}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{48,\bot} + } + } + { + \prftree[l,r]{}{[ass$\_{ns}$]} + { + - + } + { + (\texttt{n:=b}, \sigma\_{48,\bot}) + \rightarrow \sigma\_{48,18} + } + } + { + (\texttt{m:=a; n:=b}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{48,18} + } +} +{ + \prftree[l,r]{}{} + { + \dots + } + { + \textbf{[1]}\ (\texttt{LOOP}, \sigma\_{48,18}) + \rightarrow \sigma\_{6,6} + } +} +{ + (\texttt{m:=a; n:=b; LOOP}, \sigma\_{\bot,\bot}) + \rightarrow \sigma\_{6,6} +} +\end{displaymath} +``` + +@preview + + +@slide(layout=content-only) + +@title +Other useful packages + +@content + + + + + + + + + + + + + + + + + + + + + + + + + +
PackageUse case
xcolorcolours
todonotestodo annotations and index
pdfpagesembedding PDF files
subcaptionNested figures and fine-tuned captions
colortbl, tabularx, multirow, makecellTable tuning
+ diff --git a/latex-wochenende/slides/project-structure.de.md b/latex-wochenende/slides/project-structure.de.md new file mode 100644 index 0000000..ea81b7f --- /dev/null +++ b/latex-wochenende/slides/project-structure.de.md @@ -0,0 +1,196 @@ +@slide(layout=chapter-slide) + +@number +4 + +@title +Projektstruktur + + +@slide(layout=content-and-preview) + +@title +Zielsetzung + +@content +Ein größeres LaTeX-Projekt anlegen und dabei … + +* verhindern, dass LaTeX-Dokumente zu monströser Größe anwachsen 👹 +* den Überblick über die Struktur eines Projekts behalten + +@preview +![](svg/chapter-04/langes-dokument.jpg){style="padding: .2em; height: 100vh"} + + +@slide(layout=content-and-preview) + +@title +Hauptdatei 👑 + +@content +* enthält Grundgerüst, Titel, Inhaltsverzeichnis etc. +* bindet einzelne Kapitel ein mit \ + `\input{pfad/zur/datei}` + +``` {.lang-tex .hljs data-sourcefile=main.tex} +\documentclass{article} +\usepackage[ngerman]{babel} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\title{Ein Titel} +\begin{document} + \maketitle + \tableofcontents + \input{abschnitt1.tex} + \input{abschnitt2.tex} +\end{document} +``` + +@preview +![](svg/chapter-04/hauptdatei-orig.svg) + + +@slide(layout=content-and-preview) + +@title +Datei mit Teilabschnitt + +@content +* enthält **keine Präambel** +* enthält **kein** `\begin{document}` und `\end{document}` + +``` {.hljs .lang-tex data-sourcefile=part1.tex} +\section{Dies ist Abschnitt 1} +Hier ein Absatz zum +Inhalt von Abschnitt 1. + +% … +``` + +``` {.hljs .lang-tex data-sourcefile=part2.tex} +\section{Dies ist Abschnitt 2} +Hier ein Absatz zum +Inhalt von Abschnitt 2. + +% … +``` + +@preview +![](svg/chapter-04/hauptdatei-teile-crop.svg){.thin-padding} + + +@slide(layout=content-and-preview-with-category) + +@category +Exkurs + +@title +Dateipfade angeben 👣 + +@content +* wichtig für `\input{}` sowie später für das Einbinden von Bildern und anderen Medien +* Datei- und Ordnerstruktur = Baumstruktur 🌳 +* bei `\input{}` kann der Pfad zu einer Unterdatei relativ zur Hauptdatei angeben werden + +

Bei LaTeX muss stets die **Unix-Syntax** für Pfadangaben verwendet werden. Pfadelemente werden durch einen Schrägstrich getrennt: `pfad/zur/datei`. Deshalb werden wir im Folgenden diese Schreibweise verwenden.

+ +@preview +![](svg/chapter-04/tree-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Exkurs + +@title +Dateipfade angeben 👣 + +@content +

`main-exercises.tex` → `praeamble.tex`

+ +
+`./praeamle.tex` + +Der **einfache Punkt »`.`«** bezieht sich bei relativen Pfaden auf den aktuellen Ordner (hier: `latex-skript`). Er ist optional, es könnte also auch nur `praeamble.tex` geschrieben werden. +
+ +@preview +![](svg/chapter-04/relative-path-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Exkurs + +@title +Dateipfade angeben 👣 + +@content +

`main-exercises.tex` → `basic-document-structure.tex` (in einem Unterordner)

+ +
+`./content/basic-document-structure.tex` +
+ +@preview +![](svg/chapter-04/relative-path-subdir-crop.svg) + + + +@slide(layout=content-and-preview-with-category) + +@category +Exkurs + +@title +Dateipfade angeben 👣 + +@content +

`basic-functionality.tex` → `graphics.raw.tex`

+

(wenn `basic-functionality.tex` von `main-exercises.tex` importiert wird)

+ +
+
./exercises/graphics/graphics.raw.tex
+

Pfade sind immer relativ zum Wurzelelement, auch wenn dieses noch andere Dateien einbindet, die wiederum andere Dateien referenzieren.

+
+ +@preview +![](svg/chapter-04/relative-path-transitive-crop.svg) + + + +@slide(layout=content-only-with-category) + +@category +Demo + +@title +Kompilieren des Projekts + +@content +* **Nur die Hauptdatei** wird kompiliert, um das fertige PDF-Dokument zu erhalten. +* ++ Fehlermeldungen enthalten dann Verweis, in welcher Unterdatei sie aufgetreten sind. +* ++ Die Unterdateien können wegen ihrer fehlenden Präambel nicht selbstständig kompiliert werden. + +
+Von nun an kompilieren wir die Datei `main-exercises.tex` im Wurzelverzeichnis des Projektordners. Klickt hierzu in TeXstudio mit der rechten Maustaste auf die Datei und wählt **„Explizit als Root-Dokument setzen“**. Anschließend könnt ihr wie gewohnt kompilieren. +
+ + +@slide(layout=task) + +@task-number +4 + +@title +Ein strukturiertes Projekt + +@content +Im Ordner `exercises/project-structure` findet ihr eine Datei namens `main.tex`. + +* Erstellt neue Dateien (z. B. `section1.tex` und `section2.tex` und verschiebt die Abschnitte in diese. +* Importiert die Fragmente anschließend mit Hilfe des `\input`-Befehls. +* Lagert die Präambel auf demselben Weg in eine eigene Datei aus. +* Schaut euch abschließend die Gesamtstruktur unseres Projektarchivs an, beginnend mit `main-exercises.tex` im Wurzelverzeichnis. Wie binden wir hier die einzelnen Abschnitte ein? \ No newline at end of file diff --git a/latex-wochenende/slides/project-structure.en.md b/latex-wochenende/slides/project-structure.en.md new file mode 100644 index 0000000..990f1ed --- /dev/null +++ b/latex-wochenende/slides/project-structure.en.md @@ -0,0 +1,195 @@ +@slide(layout=chapter-slide) + +@number +4 + +@title +Project structure + +@slide(layout=content-and-preview) + +@title +Goal + +@content +Create a bigger LaTeX project and … + +* prevent LaTeX documents from growing monstrously 👹 +* keep the overview over the project structure + +@preview +![](svg/chapter-04/langes-dokument.jpg){style="padding: .2em; height: 100vh"} + + +@slide(layout=content-and-preview) + +@title +Main file 👑 + +@content +* contains basic structure +* includes separate sections with \ + `\input{path/to/file}` + +``` {.lang-tex .hljs data-sourcefile=main.tex} +\documentclass{article} +\usepackage{babel} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\title{A Title} +\begin{document} + \maketitle + \tableofcontents + \input{section1.tex} + \input{section2.tex} +\end{document} +``` + +@preview +![](svg/chapter-04/main-orig.svg) + + +@slide(layout=content-and-preview) + +@title +File with a section + +@content +* contains **no preamble** +* contains **no** `\begin{document}` or `\end{document}` + +``` {.hljs .lang-tex data-sourcefile=part1.tex} +\section{This is section 1} +A paragraph about the content +of section 1. + +% … +``` + +``` {.hljs .lang-tex data-sourcefile=part2.tex} +\section{This is section 2} +A paragraph about the content +of section 2. + +% … +``` + +@preview +![](svg/chapter-04/main-parts-crop.svg){.thin-padding} + + +@slide(layout=content-and-preview-with-category) + +@category +Excursion + +@title +Specifying file paths 👣 + +@content +* important for `\input{}`, but later also for other media types +* file and folder structure = tree structure 🌳 +* with `\input{}`, you can specify the path relative to the main file + +

In **LaTeX,** you have to use UNIX-style paths. They are separated by a forward slash: `path/to/file`. We will use those from here on.

+ +@preview +![](svg/chapter-04/tree-english-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Excursion + +@title +Specifying file paths 👣 + +@content +

`main-exercises.tex` → `praeamble.tex`

+ +
+`./praeamble.tex` + +A **single dot ‘`.`’** represents the current folder (in this case: `latex-skript`). It is optional, you could also write `praeamble.tex` here. +
+ +@preview +![](svg/chapter-04/relative-path-english-crop.svg) + + +@slide(layout=content-and-preview-with-category) + +@category +Excursion + +@title +Specifying file paths 👣 + +@content +

`main-exercises.tex` → `basic-document-structure.tex` (in a subfolder)

+ +
./content/basic-document-structure.tex
+ +@preview +![](svg/chapter-04/relative-path-subdir-english-crop.svg) + + + +@slide(layout=content-and-preview-with-category) + +@category +Excursion + +@title +Specifying file paths 👣 + +@content +

`basic-functionality.tex` → `graphics.raw.tex`

+

(`basic-functionality.tex` is imported into `main-exercises.tex`)

+ +
+
./exercises/graphics/graphics.raw.tex
+

Paths are always relative to the root document that imports other files as fragments.

+
+ +@preview +![](svg/chapter-04/relative-path-transitive-english-crop.svg) + + + +@slide(layout=content-only-with-category) + +@category +Demo + +@title +Compiling the project + +@content +* **Only the main file** has to be compiled to get the complete PDF document. +* ++ Error messages include a reference to the corresponding subfile. +* ++ Subfiles cannot be compiled on their own as they don’t have a preamble. + +
+From now on, we will compile the file `main-exercises.tex` in the project root. +To do so, right click on the file in TeXstudio and choose **“Select as explicit root document”** from the dropdown. +Next, compile as usual. +
+ + +@slide(layout=task) + +@task-number +4 + +@title +A structured project + +@content +You will find a file named `main.tex` in the folder `exercises/project-structure`. + +* Put the sections of the file into separate files, named `section1.tex` and `section2.tex`. +* Include them using the `\input` command. +* Move the preamble to its own file in a similar fashion. +* Finally, have a look at the general project archive, starting from `main-exercises.tex` (in the root folder of the project archive). How do we include the different sections here? \ No newline at end of file diff --git a/latex-wochenende/slides/references-and-footnotes.de.md b/latex-wochenende/slides/references-and-footnotes.de.md new file mode 100644 index 0000000..cb6f1ca --- /dev/null +++ b/latex-wochenende/slides/references-and-footnotes.de.md @@ -0,0 +1,211 @@ +@slide(layout=chapter-slide) + +@number +11 + +@title +Referenzen und Fußnoten + + +@slide(layout=content-and-preview) + +@title +Fußnoten 📎 + +@content +``` {.hljs .lang-tex} +\usepackage{hyperref} +``` + +Die Nummerierung erfolgt automatisch und ist fortlaufend, unabhängig davon, ob ein neuer Abschnitt beginnt. + +``` {.hljs .lang-tex} +Eber, beim Hausschwein insbesondere +oberdeutsch Saubär, beim Wildschwein +Keiler, bezeichnet das männliche +Geschlecht des Schweins. +\footnote{\url{https://de.wikipedia.org/ +wiki/Eber}} +``` + +@preview +![](svg/chapter-13/fußnotenbeispiel-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Querverweise + +@content +Manuell (Just don’t!) + +``` {.hljs .lang-tex} +Wie man in Abbildung 23 sieht, … +``` + +Mit dem Befehl `\ref`: + +``` {.hljs .lang-tex} +\begin{figure}[H] + \includegraphics % … + \caption{Unser Maskottchen Fooboar} + \label{img:fooboar} +\end{figure} + +Wie man in Abbildung \ref{img:fooboar} … +``` + +@preview +![](svg/chapter-13/ref-beispiel-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Referenzen + +@content +Mit dem Paket `cleveref` (mit *einem* ›r‹!): + +``` {.hljs .lang-tex} +\begin{figure}[H] + \includegraphics % … + \caption{Unser Maskottchen Fooboar} + \label{img:fooboar} +\end{figure} + +Fooboar ist ein sehr engagierter +Jungeber (siehe \Cref{img:fooboar}). +``` + +Der Befehl `\cref` fügt selbstständig die passende Abkürzung ein. + +@preview +![](svg/chapter-13/cref-beispiel-crop.svg) + + +@slide(layout=content-only) + +@title +Label vergeben + +@content +Beide Referenzierungsbefehle funktionieren mit **Abschnitten, Bildern, Tabellen, Listings und Gleichungen,** sofern die richtigen Label vergeben wurden. + +Label müssen **eindeutig** sein. Zur Strukturierung ist das Voranstellen von Kürzeln üblich, denn einige Pakete ziehen aus den Kürzeln Informationen. + + + + + + + + + + + + + + + + + + +
`fig:` Abbildungen`tbl:` Tabellen
`sec:` Abschnitte`subsec:` Unter­abschnitte
`ch:` Kapitel`itm:` Aufzählungs­elemente
`eq:` Gleichungen`lst:` Quelltext­listings
+ + +@slide(layout=content-only) + +@title +Dinge, die zu beachten sind + +@content +* ++ Durch `\cref` eingefügte Passagen tauchen in einigen Dokumentklassen erst dann auf Deutsch auf, wenn bereits in der Dokumentklasse die Sprache festgelegt wurde: + + ``` {.hljs .lang-tex} + \documentclass[ngerman]{article} + ``` + +* ++ Beschriftungen (`\caption{…}`) müssen, von Abschnitten abgesehen, **immer und vor dem Label** vergeben werden. + +* ++ Bei Abschnitten wird das Label direkt hinter dem Befehl angefügt. + + ``` {.hljs .lang-tex} + \section{Hinweise}\label{sec:hinweise} + ``` + + +@slide(layout=task) + +@task-number +11a + +@title +Fußnoten einfügen + +@content +* Pack den Text *March 2023* in der Datei `exercises/footnotes/footnotes.tex` in eine **Fußnote**. +* Fügt zusätzlich eine **klickbare URL**, die zur Download-Seite des Java Development Kit führt (`https://www.oracle.com/java/technologies/javase-downloads.html`), als Fußnote ein. + + + +@slide(layout=task) + +@task-number +11b + +@title +Referenzen einfügen + +@content +* Ersetzt im Text in der Datei `references.tex` im Ordner `exercises/references` *In the figure* und *The following source code listing* durch eine **Referenz** auf das Bild bzw. auf das Quelltext-Listing. +* Nutzt dafür den Befehl `\Cref`. +* Achtet darauf, zuerst **Labels** für die Elemente, die ihr referenzieren wollt, zu vergeben. +* Bei **Quelltext-Listings** funktioniert die Angabe von Labels und Captions leicht anders. Nutzt euer bisheriges Wissen und das Internet, um herauszufinden, wie ihr den Befehl `\lstinputlisting` anpassen müsst, um beides zu vergeben. + + +@slide(layout=extra-content-and-preview) + +@title +Konfiguration von Fußnoten + +@content +Das Paket `footmisc` stellt verschiedene weitere Optionen für die Darstellung von Fußnoten zur Verfügung, die als optionale Parameter an den Befehl `\usepackage` übergeben werden können. + +``` {.hljs .lang-tex} +% Zählung auf jeder Seite neu beginnen: +\usepackage[perpage]{footmisc} + +% Fußnoten inline anzeigen lassen: +\usepackage[para]{footmisc} + +% Symbole statt Nummerierung verwenden: +\usepackage[symbol]{footmisc} +``` + +@preview +![](svg/chapter-13/footmisc-de-crop.svg){.thin-padding} + + +@slide(layout=extra-content-and-preview) + +@title +Weiterführend + +@content +* Wurde vor dem Paket `cleveref` das Paket `hyperref` eingebunden, entsteht ein **klickbarer Link** im fertigen PDF. +* Mehrere Referenzen können in `\cref` kommagetrennt angegeben werden. + +``` {.hljs .lang-tex} +\section{Ein Einstieg} +\label{sec:section1} +% … +Hier sei verwiesen auf +\cref{sec:section1,sec:section2, +sec:section3,sec:section5}. +``` + +@preview +![](svg/chapter-13/cref-multiple-beispiel-crop.svg) + diff --git a/latex-wochenende/slides/references-and-footnotes.en.md b/latex-wochenende/slides/references-and-footnotes.en.md new file mode 100644 index 0000000..187c634 --- /dev/null +++ b/latex-wochenende/slides/references-and-footnotes.en.md @@ -0,0 +1,213 @@ +@slide(layout=chapter-slide) + +@number +11 + +@title +References and footnotes + + +@slide(layout=content-and-preview) + +@title +Footnotes 📎 + +@content +``` {.hljs .lang-tex} +\usepackage{hyperref} +``` + +Footnotes are automatically numbered consecutively, independent of sections. + +(Here, `hyperref` is used for the `\url` command, it is not necessary for footnotes per se.) + +``` {.hljs .lang-tex} +The wild boar (\textit{Sus scrofa}), also +known as the wild swine, common wild pig, +or simply wild pig, is a suid native to +much of Eurasia and North Africa, and has +been introduced to the Americas and Oceania. +\footnote{\url{https://en.wikipedia.org/ +wiki/Wild_boar}} +``` + +@preview +![](svg/chapter-13/footnote-example-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Cross-references + +@content +Manually (just don’t!) + +``` {.hljs .lang-tex} +As you can see in figure 23, … +``` + +Using the `\ref` command: + +``` {.hljs .lang-tex} +\begin{figure}[H] + \includegraphics % … + \caption{Our mascot Fooboar} + \label{img:fooboar} +\end{figure} + +As you can see in figure +\ref{img:fooboar}, … +``` + +@preview +![](svg/chapter-13/ref-example-crop.svg) +@slide(layout=content-only) + +@title +Assigning labels + +@content +Both cross-reference commands work with **sections, figures, tables, listings, and equations,** as long as you use correct labels. + +Labels have to be **unambiguous.** For clarity, certain prefixes are common, and some packages use them to derive information. + + + + + + + + + + + + + + + + + + +
`fig:` Figures`tbl:` Tables
`sec:` Sections`subsec:` Subsections
`ch:` Chapters`itm:` Enumeration items
`eq:` Equations`lst:` Source code listings
+ + + +@slide(layout=content-and-preview) + +@title +Cross-references + +@content +Using the `cleveref` package (with *one* ‘r’!): + +``` {.hljs .lang-tex} +\begin{figure}[H] + \includegraphics % … + \caption{Our mascot Fooboar} + \label{img:fooboar} +\end{figure} + +Fooboar is a young and highly engaged +boar (see \Cref{img:fooboar}). +``` + +The `\cref` command automatically inserts suitable prefixes. + +@preview +![](svg/chapter-13/cref-example-crop.svg) + + +@slide(layout=content-only) + +@title +Things to consider + +@content +* Terms inserted by `\cref` use the language specified with the document class (or `babel`): + + ``` {.hljs .lang-tex} + \documentclass[english]{article} + ``` + +* Apart from sections, referenced elements need captions (`\caption{…}`), and the **captions have to be placed before the label.** + +* For sectioning commands, the label is inserted directly after the section command. + + ``` {.hljs .lang-tex} + \section{Notes}\label{sec:notes} + ``` + + +@slide(layout=task) + +@task-number +11a + +@title +Inserting footnotes + +@content +* Make the text *March 2023* in file `exercises/footnotes/footnotes.tex` appear as a **footnote**. +* Additionally, insert a **clickable URL** that leads to the download page for the Java Development Kit (`https://www.oracle.com/java/technologies/javase-downloads.html`). + + +@slide(layout=task) + +@task-number +11b + +@title +Inserting references + +@content +* In file `exercises/references/references.tex`, replace *In the figure* and *The following source code listing* by **references** to the figure and to the source code listing. +* Use the command `\Cref` for the references. +* Make sure to add **labels** to the elements that you want to create a reference for. +* For source code listings, adding labels and captions is a bit different. Try to apply the knowledge you gained so far to retrieve the correct version of the `\lstinputlisting` command. Use the Internet, if necessary. + + +@slide(layout=extra-content-and-preview) + +@title +Configuring footnotes + +@content +The `footmisc` package provides additional options for the presentation of footnotes that can be activated by adding parameters to the `\usepackage` command. + +``` {.hljs .lang-tex} +% Reset the counter on each page: +\usepackage[perpage]{footmisc} + +% Display footnotes in-line: +\usepackage[para]{footmisc} + +% Use symbols instead of numbers: +\usepackage[symbol]{footmisc} +``` + +@preview +![](svg/chapter-13/footmisc-en-crop.svg){.thin-padding} + + + +@slide(layout=extra-content-and-preview) + +@title +A few more things + +@content +* It is recommended that you include the package `hyperref` before `cleveref`. +* `\cref` can take multiple references at once, separated by commas. + +``` {.hljs .lang-tex} +\section{An introduction} +\label{sec:section1} +% … +Reference be made to +\cref{sec:section1,sec:section2, +sec:section3,sec:section5}. +``` + +@preview +![](svg/chapter-13/cref-multiple-example-crop.svg) \ No newline at end of file diff --git a/latex-wochenende/slides/source-code-listings.de.md b/latex-wochenende/slides/source-code-listings.de.md new file mode 100644 index 0000000..cc03a20 --- /dev/null +++ b/latex-wochenende/slides/source-code-listings.de.md @@ -0,0 +1,110 @@ +@slide(layout=chapter-slide) + +@number +13 + +@title +Quelltext-Listings + + +@slide(layout=content-and-preview) + +@title +Direkt im LaTeX-Quelltext + +@content +Das Paket `listings` bietet zum Einfügen von Code eine eigene Umgebung: + +``` {.lang-tex .hljs} +\section*{Haskell-Magie} +Quadrate aller geraden % … +\begin{lstlisting}[language=Haskell] +[x^2 | x <- [1..200], even x] +\end{lstlisting} +``` + +@preview +![](svg/chapter-10/listings-haskell-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Externer Code + +@content +Praktischerweise bietet `listings` einen Befehl zum Einfügen externen Codes: + +``` {.lang-tex .hljs} +\section*{Einfache Java-Anwendung} +\lstinputlisting[language=Java]{Test.java} +``` + +``` {.lang-java .hljs data-sourcefile="Test.java"} +public class Test { + public static void main(/*…*/) { + System.out.println(/*…*/); + } +} +``` + +@preview +![](svg/chapter-10/listings-java-crop.svg) + + +@slide(layout=content-only) + +@title +Themen und Stile + +@content +`listings` stellt keine eigenen Themes zur Verfügung. Dies kann aber durch die vielen Konfigurationsoptionen ausgeglichen werden. + +``` {.lang-tex .hljs} +\begin{lstlisting}[ + language=Java, + basicstyle=\footnotesize\ttfamily, + breaklines=true, + keywordstyle=\color{ForestGreen}, + commentstyle=\color{DarkGray}, + literate={ö}{{\"o}}1 +] +% … +\end{lstlisting} +``` + +Für die Erstellung eigener Themes ist der Befehl `\lstset` nützlich. + + +@slide(layout=content-only) + +@title +Weitere Materialien + +@content +* [Einführung](https://www.overleaf.com/learn/latex/Code_listing#Reference_guide) in das Paket +* offizielle [Dokumentation](https://www.overleaf.com/learn/latex/Code_listing#Reference_guide) +* vordefinierte [UTF-8-Konfiguration](https://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings#Encoding_issue) +* das Paket [`xcolor`](https://www.overleaf.com/learn/latex/Using_colours_in_LaTeX) für Farben +* zwei [Themes](https://github.com/jez/latex-solarized) im solarized-Stil für `listings` + + +@slide(layout=task) + +@task-number +13 + +@title +Listings + +@content +* Im Ordner `exercises/source-code-listings` findet ihr eine Datei namens `Source.java`. +* **Bindet** den Java-Quelltext in der Datei `source-code-listings.tex` **ein**. (Beachtet, dass der Dateipfad relativ zu `main-exercises.tex` ist.) +* Erlaubt die Verwendung von **Sonderzeichen** durch Angabe der `literate`-Option. +* Aktiviert das **Syntax-Highlighting** durch Angabe der Sprache Java. +* **Nummeriert** die Zeilen und aktiviert **Umbrüche**. +* Setzt mit dem Parameter `basicstyle` eine dicktengleiche Schrift (`\ttfamily \small`). +* Ändert die Schlüsselwortfarbe zu Blau. +* Verbergt die Sonderzeichen, die **Leerzeichen in Zeichenketten** markieren. + +Seht bei Fragen in der Dokumentation des Paketes `listings` nach. diff --git a/latex-wochenende/slides/source-code-listings.en.md b/latex-wochenende/slides/source-code-listings.en.md new file mode 100644 index 0000000..82e1b27 --- /dev/null +++ b/latex-wochenende/slides/source-code-listings.en.md @@ -0,0 +1,110 @@ +@slide(layout=chapter-slide) + +@number +13 + +@title +Source code listings + + +@slide(layout=content-and-preview) + +@title +In-situ listings + +@content +The `listings` package provides a dedicated environment: + +``` {.lang-tex .hljs} +\section*{Haskell Magic} +Squares of all even % … +\begin{lstlisting}[language=Haskell] +[x^2 | x <- [1..200], even x] +\end{lstlisting} +``` + +@preview +![](svg/chapter-10/listings-haskell-english-crop.svg) + + +@slide(layout=content-and-preview) + +@title +External source code + +@content +Conveniently, `listings` offers an import command: + +``` {.lang-tex .hljs} +\section*{Simple Java Application} +\lstinputlisting[language=Java]{Test.java} +``` + +``` {.lang-java .hljs data-sourcefile="Test.java"} +public class Test { + public static void main(/*…*/) { + System.out.println(/*…*/); + } +} +``` + +@preview +![](svg/chapter-10/listings-java-english-crop.svg) + + +@slide(layout=content-only) + +@title +Themes and styles + +@content +`listings` does not provide any themes by default, but can be configured extensively. + +``` {.lang-tex .hljs} +\begin{lstlisting}[ + language=Java, + basicstyle=\footnotesize\ttfamily, + breaklines=true, + keywordstyle=\color{ForestGreen}, + commentstyle=\color{DarkGray}, + literate={ö}{{\"o}}1 +] +% … +\end{lstlisting} +``` + +Have a look at the `\lstset` command for creating your own themes. + + +@slide(layout=content-only) + +@title +Further resources + +@content +* [introduction](https://www.overleaf.com/learn/latex/Code_listing#Reference_guide) to the package +* official [documentation](https://www.overleaf.com/learn/latex/Code_listing#Reference_guide) +* predefined [UTF-8 configuration](https://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings#Encoding_issue) +* [`xcolor` package](https://www.overleaf.com/learn/latex/Using_colours_in_LaTeX) for colors +* two [solarized themes](https://github.com/jez/latex-solarized) for `listings` + + +@slide(layout=task) + +@task-number +13 + +@title +Listings + +@content +* In the directory `exercises/source-code-listings` you can find a file named `Source.java`. +* **Include** it in the file `source-code-listings.tex`. (Keep in mind that the file path is relative to the main LaTeX document, i. e., to `main-exercises.tex`.) +* Enable **special characters** via the `literate` option. +* Activate **syntax highlighting** by stating the programming language Java. +* **Number** the code lines. +* Set the `basicstyle` to a proper mono-spaced font (`\ttfamily \small`) +* Change the **keyword color** to blue. +* Don't show special characters for **spaces in strings**. + +If you have questions, try to consult the documentation of the `listings` package. diff --git a/latex-wochenende/slides/special-characters.de.md b/latex-wochenende/slides/special-characters.de.md new file mode 100644 index 0000000..ba81773 --- /dev/null +++ b/latex-wochenende/slides/special-characters.de.md @@ -0,0 +1,331 @@ +@slide(layout=chapter-slide) + +@number +5 + +@title +Sonderzeichen + + +@slide(layout=content-and-preview) + +@title +Leerzeichen + +@content + +* Nutzt schmale Leerzeichen (`\,`) und geschützte Leerzeichen (`~`) an den geeigneten Stellen. + +``` {.hljs .lang-tex} +Schmale Leerzeichen werden z.\,B. in +Abkürzungen und zwischen Zahlen und +Einheiten verwendet: 10\,s. +Normalbreite, aber geschützte +Leerzeichen können u.\,a. +dabei helfen, Titel und Namen in +einer Zeile zu halten: Dr.~Fooboar. +``` + +* ++ Nutzt French Spacing (`\frenchspacing`), um riesige Freiräume nach Satzzeichen zu verhindern. + +@preview +![](svg/chapter-05/leerzeichen-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Striche + +@content + + + + + + + + + + + + + + + + + + + + + + + + + +
NameVerwendungCode
-Bindestrich *(hypen)*LaTeX-Wochenende`-`
Halbgeviert­strich
*(en dash)*
als Gedankenstrich – oder als Bis-Strich: 10 – 12 Uhr.`--`
Geviertstrich
*(em dash)*
a dash — mostly in American English`---`
+ +@preview +![](svg/chapter-05/striche-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Zitate + +@content +Das Paket `csquotes` stellt u. a. den Befehl `\enquote` zur Verfügung: + +``` {.lang-tex .hljs} +\enquote{Ein \enquote{verschachteltes} +Zitat.} +``` + +Wenn das Paket mit `autostyle=true` eingebunden wird, werden bei fremdsprachigen Zitaten die entsprechenden Anführungszeichen verwendet: + +``` {.lang-tex .hljs} +\foreignquote{english}{An English +quote.} +``` + +@preview +![](svg/chapter-05/zitate-crop.svg) + + +@slide(layout=content-only) + +@title +Sonderzeichen & Symbole + +@content +### Detexify to the rescue! ⛑️ +* Ausführliche Liste an verwendbaren Symbolen: + [PDF auf der CTAN-Website](http://tug.ctan.org/info/symbols/comprehensive/symbols-a4.pdf) +* Symbole malen und erkennen lassen: + [Detexify](http://detexify.kirelabs.org/classify.html) + + +@slide(layout=task) + +@task-number +5 + +@title +Sonderzeichen einfügen + +@content +
+Kompiliert von nun an immer die Datei `main-exercises.tex`, um eure Änderungen im Übungsskript zu sehen (in diesem Fall im Abschnitt zu Übung 5). +
+ +* Ersetzt die Leerzeichen innerhalb der Abkürzungen in `exercises/special-characters.tex` durch **schmale Leerzeichen**. +* Die Bindestriche bei den Öffnungszeiten der ERBA sollen durch **Halbgeviertstriche** ersetzt werden, optional mit schmalen Leerzeichen außenrum. +* Nutzt den Befehl `\enquote`, um die Wörter *Studi-Ticket* und *Studi-Karte* in **Anführungszeichen** zu setzen. + + +@slide(layout=extra-content-and-preview) + +@title +English spacing + +@content +In englischsprachigen Dokumenten verwendet LaTeX das traditionelle *English spacing,* also doppelte Leerzeichen nach dem Satzende. + +Das kann mit `\frenchspacing` vor dem ersten Absatz verhindert werden. `\nonfrenchspacing` schaltet wieder zurück. + +Bei *English spacing* versucht LaTeX, nach Abkürzungen trotzdem normale Wortzwischenräume zu setzen. Das sollte aber kontrolliert werden. Eingreifen können wir mit + +* erzwungenen Wortzwischenräumen: `.\␣` +* erzwungenen Satzenden: `\@.␣` + +@preview +![](svg/chapter-05/french-spacing-crop.svg) + + +@slide(layout=extra-content-and-preview) + +@title +Silbentrennung + +@content +LaTeX trennt Wörter im Normalfall automatisch richtig, wenn die richtige Sprache konfiguriert ist. Manchmal muss aber auch manuell eingegriffen werden. + + + + + + + + + + + + + + + + + + + + + + + + + + +
Ausschließliche Trennung`\-`
Zusätzliche Trennstelle`"-`
Bindestrich (verbietet andere Trennstellen)`-`
Bindestrich (erlaubt andere Trennstellen)`"=`
Trennstelle ohne Strich`""`
Strich ohne Trennstelle`"~`
+ +

Einige der Codes funktionieren nur mit eingebundenem `babel`-Paket.

+ + +@preview +![](svg/chapter-05/silbentrennung-crop.svg) + + + +@slide(layout=extra-content-only) + +@title +Anführungszeichen + +@content + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpracheBefehlErgebnis
Deutsch`\glqq … \grqq`„ … “
 2. Ebene` \glq … \grq `‚ … ‘
Deutsch altern.`\frqq … \flqq`» … «
 2. Ebene` \frq … \flq `› … ‹
Englisch (A. E.)\`\`…\'\'“ … ”
 2. Ebene \`…\' ‘ … ’
Englisch (B. E.) \`…\' ‘ … ’
 2. Ebene\`\`…\'\'“ … ”
+ +Für andere Sprachen können andere Regeln gelten, meistens aber mit den gleichen Zeichen, nur in anderer Zusammensetzung. + + +@slide(layout=extra-content-only) + +@title +Diakritika + +@content +Buchstaben mit Diakritika können entweder direkt über die Tastatur eingegeben werden oder über Escape-Codes: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\\\`{o}ò  `\c{c}` ç  `\d{u}`
`\'{o}` ó`\k{a}` ą`\r{a}` å
`\^{o}` ô`\l{}` ł`\u{o}` ŏ
`\"{o}` ö`\={o}` ō`\v{s}` š
`\H{o}` ő`\b{o}` o`\t{oo}`o͡o
`\~{o}` õ`\.{o}` ȯ`\o` ø
+ + +@slide(layout=extra-content-only) + +@title +Sonderzeichen & Symbole + +@content +Auch andere Sonderzeichen können entweder direkt eingegeben werden oder per Befehl: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
¿ ?\`¡ !\`
^ `\textasciicircum`~ `\textasciitilde`
`\textasteriskcentered`\\ `\textbackslash`
| `\textbar` `\textbullet`
`\textcopyright` `\textdagger`
`\textdaggerdbl` `\textellipsis`
< `\textless`> `\textgreater`
`\textperthousand`§ `\textsection`
+ +… und so ziemlich alles andere. \ No newline at end of file diff --git a/latex-wochenende/slides/special-characters.en.md b/latex-wochenende/slides/special-characters.en.md new file mode 100644 index 0000000..0df2074 --- /dev/null +++ b/latex-wochenende/slides/special-characters.en.md @@ -0,0 +1,327 @@ +@slide(layout=chapter-slide) + +@number +5 + +@title +Special characters + + +@slide(layout=content-and-preview) + +@title +Spaces + +@content +* Use thin spaces (`\,`) and non-breaking spaces (`~`), where appropriate. + +``` {.hljs .lang-tex} +Thin spaces are used in abbreviations +and before units, e.\,g., 10\,s. +Normal-width non-breaking spaces can help +keep honorary titles and names on one +line: Dr.~Fooboar. +``` + +* ++ Use french spacing (`\frenchspacing`) to avoid giant gaps after full stops. + +@preview +![](svg/chapter-05/spaces-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Hyphens and dashes + +@content + + + + + + + + + + + + + + + + + + + + + + + + + +
NameUseCode
-Hyphencompound-forming hyphen`-`
En dash *(Halbgeviert­strich)*a dash – or a range: 12 – 2 p.m.`--`
Em dash *(Geviertstrich)*a dash — mostly in American English`---`
+ +@preview +![](svg/chapter-05/hyphens-and-dashes-crop.svg) + + +@slide(layout=content-and-preview) + +@title +Quotes + +@content +The `csquotes` package provides, amongst others, the command `\enquote`. + +``` {.lang-tex .hljs} +\enquote{A \enquote{nested} +quote.} +``` + +When included with `autostyle=true`, foreign-language quotes use the according quotation marks: + +``` {.lang-tex .hljs} +\foreignquote{ngerman}{Ein deutsches +Zitat.} +``` + +@preview +![](svg/chapter-05/quotes-crop.svg) + + +@slide(layout=content-only) + +@title +Special characters & symbols + +@content +### Detexify to the rescue! ⛑️ +* A long list of symbols to use: + [PDF on the CTAN website](http://tug.ctan.org/info/symbols/comprehensive/symbols-a4.pdf) +* Draw symbols and have them recognised: + [Detexify](http://detexify.kirelabs.org/classify.html) + + +@slide(layout=task) + +@task-number +5 + +@title +Insert special characters + +@content +
+From now on, compile the file `main-exercises.tex` to see your changes appear in the exercise script (in this task, see exercise 5). +
+ +* Replace the spaces in `exercises/special-characters.tex` within the abbreviations (“e. g.”, “i. a.”) by **thin spaces**. +* Replace the hyphens separating the opening hours by **en dashes** (`--`), optionally surrounded by thin spaces. +* Add **quotation marks** around the words *Studi-Ticket* and *Studi-Karte* using the `\enquote` command. + + +@slide(layout=extra-content-and-preview) + +@title +English and French spacing + +@content +In English, LaTeX uses the old-fashioned *English spacing,* i. e., double sentence spacing. + +If you want to be more modern, you can use `\frenchspacing` above your first paragraph. `\nonfrenchspacing` goes back to default. + +If you actually use *English spacing,* LaTeX will still try and put normal word spacing after abbreviations. However, you should check the results and intervene where needed by + +* forcing normal spaces: `.\␣` +* manually ending sentences: `\@.␣` + +@preview +![](svg/chapter-05/french-spacing-crop.svg) + + +@slide(layout=extra-content-and-preview) + +@title +Hyphenation + +@content +Most of the time, LaTeX hyphenates words correctly, if the correct language is configured. +Sometimes, however, manual intervention is necessary. + + + + + + + + + + + + + + + + + + + + + + + + + + +
Exclusive hyphenation`\-`
Additional hyphenation`"-`
Hyphen (suppressing other hyphenation)`-`
Hyphen (allowing other hyphenation)`"=`
Possible separation without hyphen`""`
Non-breaking hyphen`"~`
+ +

Some of the codes only work when you use the `babel` package.

+ +@preview +![](svg/chapter-05/hyphenation-crop.svg) + + +@slide(layout=extra-content-only) + +@title +Manual quotation + +@content + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LanguageCommandResult
English (B. E.) \`…\' ‘ … ’
 2nd Level\`\`…\'\'“ … ”
English (A. E.)\`\`…\'\'“ … ”
 2nd Level \`…\' ‘ … ’
German`\glqq … \grqq`„ … “
 2nd Level` \glq … \grq `‚ … ‘
German altern.`\frqq … \flqq`» … «
 2nd Level` \frq … \flq `› … ‹
+ +Other rules my apply for other languages, but most of the time it’s the same characters, only combined differently. + + +@slide(layout=extra-content-only) + +@title +Diacritics + +@content +Letters with diacritics can either by typed directly on the keyboard or via escape codes: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\\\`{o}ò  `\c{c}` ç  `\d{u}`
`\'{o}` ó`\k{a}` ą`\r{a}` å
`\^{o}` ô`\l{}` ł`\u{o}` ŏ
`\"{o}` ö`\={o}` ō`\v{s}` š
`\H{o}` ő`\b{o}` o`\t{oo}`o͡o
`\~{o}` õ`\.{o}` ȯ`\o` ø
+ + +@slide(layout=extra-content-only) + +@title +Special characters + +@content +The same is true for special characters: They can either be typed directly or created via escape codes and commands: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
¿ ?\`¡ !\`
^ `\textasciicircum`~ `\textasciitilde`
`\textasteriskcentered`\\ `\textbackslash`
| `\textbar` `\textbullet`
`\textcopyright` `\textdagger`
`\textdaggerdbl` `\textellipsis`
< `\textless`> `\textgreater`
`\textperthousand`§ `\textsection`
+ +… and pretty much anything else. \ No newline at end of file diff --git a/latex-wochenende/slides/support.de.md b/latex-wochenende/slides/support.de.md new file mode 100644 index 0000000..cde1415 --- /dev/null +++ b/latex-wochenende/slides/support.de.md @@ -0,0 +1,103 @@ +@slide(layout=chapter-slide) + +@number +15 + +@title +Hilfe und Informationen + +@slide(layout=content-only) + +@title +[Wikibooks](https://de.wikibooks.org/wiki/LaTeX-Kompendium) + +@content +Das Wikibook zu LaTeX enthält eine große Anzahl interessanter Artikel und ist auch in deutscher Sprache verfügbar. + +![](svg/chapter-16/wikibooks-latex.jpg) + +@slide(layout=content-only) + +@title +[CTAN](https://ctan.org) + +@content +Das »Comprehensive TeX Archive Network« ist die zentrale Quelle für LaTeX-Pakete und ihre Dokumentation. + +![](svg/chapter-16/ctan.jpg) + +@slide(layout=content-only) + +@title +[Overleaf](https://www.overleaf.com) + +@content +Ein Online-LaTeX-Editor, der das kollaboratives Arbeiten an Dokumenten ermöglicht. + +Außerdem findest du auf der Seite verschiedene Tutorials und unter »Templates« LaTeX-Vorlagen für viele Gelegenheiten (Lebenslauf, Abschlussarbeiten, …). + +![](svg/chapter-16/overleaf.jpg) + +@slide(layout=content-only) + +@title +[StackExchange](https://tex.stackexchange.com) + +@content +Frage-Forum zu LaTeX. + +![](svg/chapter-16/stackexchange.jpg) + +@slide(layout=content-only) + +@title +[TeXample](https://www.texample.net) + +@content +Webseite mit zahlreichen LaTeX-Beispielvorlagen, vor allem zu TikZ. + +![](svg/chapter-16/texample.jpg) + +@slide(layout=preview-only) + +@preview +![Klassisch ([Quelle](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/klassisches-beispiel-2.jpeg){.large} + +@slide(layout=preview-only) + +@preview +![Noch klassischer ([Quelle](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/klassischeres-beispiel.jpg) + +@slide(layout=preview-only) + +@preview +![Anders ([Quelle](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/anderes-beispiel.png){.large} + +@slide(layout=content-only) + +@title +[Fachschaft WIAI](https://www.uni-bamberg.de/wiai/fs/) + +@content +Wenn ihr sonst noch Fragen oder Probleme habt, kommt gerne bei uns vorbei oder schreibt uns eine Mail! +

📍WE5/02.104
+☎️0951 863 1219
+📧fachschaft-wiai.stuve@uni-bamberg.de +

+ + +@slide(layout=content-only) + +@title +Kurzes Feedback + +@content +* Was hat euch gut gefallen? +* Was hätten wir besser machen können? +* Was hättet ihr euch gewünscht? + +@slide(layout=preview-only) + +@preview + diff --git a/latex-wochenende/slides/support.en.md b/latex-wochenende/slides/support.en.md new file mode 100644 index 0000000..32ff2e9 --- /dev/null +++ b/latex-wochenende/slides/support.en.md @@ -0,0 +1,104 @@ +@slide(layout=chapter-slide) + +@number +15 + +@title +Getting help and information + +@slide(layout=content-only) + +@title +[Wikibooks](https://en.wikibooks.org/wiki/LaTeX) + +@content +The LaTeX Wikibook offers numerous interesting articles and is available in English and German (among others). + +![](svg/chapter-16/wikibooks-latex_en.jpg) + +@slide(layout=content-only) + +@title +[CTAN](https://ctan.org) + +@content +The “Comprehensive TeX Archive Network” is the central source for LaTeX packages and their documentation. + +![](svg/chapter-16/ctan.jpg) + +@slide(layout=content-only) + +@title +[Overleaf](https://www.overleaf.com) + +@content +Overleaf is a collaborative online LaTeX editor. + +It also offers a multiple tutorials and templates for different occasions (CV, theses, …): »Templates«. + +![](svg/chapter-16/overleaf.jpg) + +@slide(layout=content-only) + +@title +[StackExchange](https://tex.stackexchange.com) + +@content +Question-and-answer website for LaTeX. + +![](svg/chapter-16/stackexchange.jpg) + +@slide(layout=content-only) + +@title +[TeXample](https://www.texample.net) + +@content +A collection of LaTeX examples, especially with TikZ. + +![](svg/chapter-16/texample.jpg) + +@slide(layout=preview-only) + +@preview +![Classic ([source](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/klassisches-beispiel-2.jpeg){.large} + +@slide(layout=preview-only) + +@preview +![More classic ([source](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/klassischeres-beispiel.jpg) + +@slide(layout=preview-only) + +@preview +![Different ([source](https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends))](svg/chapter-16/anderes-beispiel.png){.large} + +@slide(layout=content-only) + +@title +[Fachschaft WIAI](https://www.uni-bamberg.de/wiai/fs/) + +@content +If you have any other questions or problems, just come over or write us an e-mail! +

📍WE5/02.104
+☎️0951 863 1219
+📧fachschaft-wiai.stuve@uni-bamberg.de +

+ + +@slide(layout=content-only) + +@title +A short feedback round + +@content +* What did you like? +* What could we have done better? +* What did you wish for? + +@slide(layout=preview-only) + +@preview + + diff --git a/latex-wochenende/slides/tables.de.md b/latex-wochenende/slides/tables.de.md new file mode 100644 index 0000000..54b9948 --- /dev/null +++ b/latex-wochenende/slides/tables.de.md @@ -0,0 +1,233 @@ +@slide(layout=chapter-slide) + +@number +10 + +@title +Tabellen + + +@slide(layout=content-only) + +@title +Grundstruktur 🗒️ + +@content +Für typografisch schöne Tabellen nutzen wir das Paket `booktabs`. + +``` {.hljs .lang-tex} +\usepackage{booktabs} +``` + +``` {.hljs .lang-tex} +\begin{table}[] + \begin{tabular}{} + % Tabelleninhalt + \end{tabular} + \caption{} +\end{table} +``` + +Die Positionierung erfolgt analog zu Grafiken. + + +@slide(layout=content-and-preview) + +@title +Spaltendefinitionen + +@content +``` {.hljs .lang-tex} +\begin{tabular}{lrcl} + % Tabelleninhalt +\end{tabular} +``` + + + + + + + + + + + + + + + + + + +
KürzelBedeutung
llinksbündige Spalte
czentrierte Spalte
rrechtsbündige Spalte
+ +++ Vertikale Trennlinien und doppelte horizontale Linien sind unter Typograph\*innen nicht gern gesehen und sollten vermieden werden. + +@preview +![](svg/chapter-12/tabelle-beispiel-crop.svg){.thin-padding} + + +@slide(layout=content-and-preview) + +@title +Tabelleninhalt + +@content +``` {.hljs .lang-tex} +\begin{tabular}{lll} + \toprule + Spalte 1 & Spalte 2 & Spalte 3 \\ + \midrule + Inhalt a & Inhalt b & Inhalt c \\ + Inhalt e & Inhalt f & Inhalt g \\ + Inhalt i & Inhalt j & Inhalt k \\ + \bottomrule +\end{tabular} +``` +* ++ Zellen werden durch ›`&`‹ abgetrennt. +* ++ Reihen werden durch ›`\\`‹ beendet. +* ++ `\toprule`, `\midrule` und `\bottomrule` strukturieren die Tabelle. + +@preview +![](svg/chapter-12/tabelle-inhalt-beispiel-crop.svg){.thin-padding} + + +@slide(layout=wide-content) + +@title +Die gesamte Tabelle + +@content +``` {.hljs .lang-tex} +\begin{table}[h] + \begin{tabular}{lrcl} + \toprule + Sprache & Autor & Erscheinungsjahr & Dateiendung \\ + \midrule + C++ & Bjarne Stroustrup & 1985 & .cpp \\ + Java & James Gosling & 1998 & .java \\ + Python & Guido van Rossum & 1991 & .py \\ + \bottomrule + \end{tabular} + \caption{Bekannte Programmiersprachen} +\end{table} +``` + +

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

+ +

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

+ + +@slide(layout=content-only) + +@title +Mehr Komfort + +@content +Der [Tables Generator](https://tablesgenerator.com/) ist ein wunderbares Werkzeug, um schnell Tabellen verschiedener Formate zu erstellen. + +[![](svg/chapter-12/tables-generator.png)](https://tablesgenerator.com/) + + +@slide(layout=task) + +@task-number +10 + +@title +Tabellen setzen + +@content +* Die Liste in der Datei `exercises/tables/tables.tex` enthält Infos zu ein paar Lehrveranstaltung an der Fakultät WIAI. +* Wandelt die Liste in eine **Tabelle** um. +* Die Tabelle soll Spalten für den *Namen*, das *Kürzel* und das *Semester* der Vorlesungen haben. +* Fügt außerdem eine **zentrierte Spalte** ganz links in der Tabelle hinzu, in der ihr die Lehrveranstaltungen **nummeriert**. + + + +@slide(layout=extra-content-only) + +@title +Besonders lange Tabellen + +@content +Tabellen, die über eine Seite hinaus gehen, werden von `tabular` einfach abgeschnitten. Die Lösung bietet hier das Paket `longtable`: + +``` {.hljs .lang-tex} +\usepackage{longtable} +``` + +``` {.hljs .lang-tex} +\begin{longtable}{} + % Tabelleninhalt + \caption{} + \label{