latex weekend update

This commit is contained in:
Jochen Mehlich 2023-11-18 01:26:09 +01:00
parent 55bd075e9e
commit 5305dbb924
140 changed files with 23544 additions and 334 deletions

View File

@ -182,13 +182,13 @@ Computer Programming</li>
</ul>
<div style="display: flex; justify-content: space-between; align-items: stretch;">
<figure>
<img src="svg/chapter-01/knuth.jpg" style="height: 13em">
<img data-src="svg/chapter-01/knuth.jpg" style="height: 13em">
<figcaption>
Donald Knuth
</figcaption>
</figure>
<figure>
<img src="svg/chapter-01/lamport.jpg" style="height: 13em">
<img data-src="svg/chapter-01/lamport.jpg" style="height: 13em">
<figcaption>
Leslie Lamport
</figcaption>
@ -197,7 +197,7 @@ Leslie Lamport
</div>
<div class="layout-preview">
<img src="svg/chapter-01/taocp.jpg">
<img data-src="svg/chapter-01/taocp.jpg">
</div>
</div>
@ -498,27 +498,27 @@ it look like an actual paragraph.
}
</style>
<div class="micro-typography">
<p class="example example1"><img src="svg/chapter-01/schriftschnitte-slanted.svg" style="height: 10vh"></p>
<p class="example example1"><img data-src="svg/chapter-01/schriftschnitte-slanted.svg" style="height: 10vh"></p>
<p class="caption ugly">☹ slanted (distorted)
</p>
<p class="example example1"><img src="svg/chapter-01/schriftschnitte-roman.svg" style="height: 10vh"></p>
<p class="example example1"><img data-src="svg/chapter-01/schriftschnitte-roman.svg" style="height: 10vh"></p>
<p class="caption good">☺ straight
</p>
<p class="example example1"><img src="svg/chapter-01/schriftschnitte-italic.svg" style="height: 10vh"></p>
<p class="example example1"><img data-src="svg/chapter-01/schriftschnitte-italic.svg" style="height: 10vh"></p>
<p class="caption good">☺ italic (separate font)
</p>
<p class="example example2"><img src="svg/chapter-01/schriftgrade-vergroessert.svg" style="height: 12vh"></p>
<p class="example example2"><img data-src="svg/chapter-01/schriftgrade-vergroessert.svg" style="height: 12vh"></p>
<p class="caption ugly">☹ small font scaled up
</p>
<p class="example example2"><img src="svg/chapter-01/schriftgrade-korrekt.svg" style="height: 12vh"></p>
<p class="example example2"><img data-src="svg/chapter-01/schriftgrade-korrekt.svg" style="height: 12vh"></p>
<p class="caption good">☺ separate appropriate fonts
</p>
<p class="example example2"><img src="svg/chapter-01/schriftgrade-verkleinert.svg" style="height: 12vh"></p>
<p class="example example2"><img data-src="svg/chapter-01/schriftgrade-verkleinert.svg" style="height: 12vh"></p>
<p class="caption ugly">☹ big font scaled down
</p>
</div>
@ -571,7 +571,7 @@ it look like an actual paragraph.
</div>
<div class="layout-preview">
<img src="svg/chapter-01/cover-script.jpeg">
<img data-src="svg/chapter-01/cover-script.jpeg">
</div>
</div>
@ -617,7 +617,7 @@ Image source: <a href="https://xkcd.com/1341/">xkcd</a>
</div>
<div class="layout-preview">
<img src="svg/chapter-02/xkcd-types-of-editors.png">
<img data-src="svg/chapter-02/xkcd-types-of-editors.png">
</div>
</div>
@ -627,7 +627,7 @@ Image source: <a href="https://xkcd.com/1341/">xkcd</a>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-02/wysiwyg.svg" alt="How to get the final document">
<img data-src="svg/chapter-02/wysiwyg.svg" alt="How to get the final document">
<figcaption aria-hidden="true">How to get the final
document</figcaption>
</figure>
@ -729,7 +729,7 @@ Hello world!
</div>
<div class="layout-preview">
<img src="svg/chapter-03/hello-crop.svg">
<img data-src="svg/chapter-03/hello-crop.svg">
</div>
</div>
@ -809,7 +809,7 @@ within continuous text.</code></pre>
</div>
<div class="layout-preview">
<img src="svg/chapter-03/paragraphs-crop.svg">
<img data-src="svg/chapter-03/paragraphs-crop.svg">
</div>
</div>
@ -833,7 +833,7 @@ Place of birth: Milwaukee, Wisconsin
</div>
<div class="layout-preview">
<img src="svg/chapter-02/comments-crop.svg">
<img data-src="svg/chapter-02/comments-crop.svg">
</div>
</div>
@ -854,7 +854,7 @@ instead.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-03/reserved-characters-crop.svg">
<img data-src="svg/chapter-03/reserved-characters-crop.svg">
</div>
</div>
@ -878,7 +878,7 @@ Always available:</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-03/sections-crop.svg">
<img data-src="svg/chapter-03/sections-crop.svg">
</div>
</div>
@ -933,7 +933,7 @@ My favorite recipe
</div>
<div class="layout-preview">
<img src="svg/chapter-03/title-orig.svg">
<img data-src="svg/chapter-03/title-orig.svg">
</div>
</div>
@ -982,7 +982,7 @@ My favorite recipe
</div>
<div class="layout-preview">
<img src="svg/chapter-03/contents-crop.svg">
<img data-src="svg/chapter-03/contents-crop.svg">
</div>
</div>
@ -1089,7 +1089,7 @@ books</li>
</div>
<div class="layout-preview">
<img src="svg/chapter-03/languages-crop.svg">
<img data-src="svg/chapter-03/languages-crop.svg">
</div>
</div>
@ -1110,7 +1110,7 @@ contents:</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-03/sections-differently-crop.svg">
<img data-src="svg/chapter-03/sections-differently-crop.svg">
</div>
</div>
@ -1163,7 +1163,7 @@ environment, and the table of contents.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-04/langes-dokument.jpg" style="padding: .2em; height: 100vh">
<img data-src="svg/chapter-04/langes-dokument.jpg" style="padding: .2em; height: 100vh">
</div>
</div>
@ -1194,7 +1194,7 @@ environment, and the table of contents.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-04/main-orig.svg">
<img data-src="svg/chapter-04/main-orig.svg">
</div>
</div>
@ -1225,7 +1225,7 @@ of section 2.
</div>
<div class="layout-preview">
<img src="svg/chapter-04/main-parts-crop.svg" class="thin-padding">
<img data-src="svg/chapter-04/main-parts-crop.svg" class="thin-padding">
</div>
</div>
@ -1252,7 +1252,7 @@ those from here on.
</div>
<div class="layout-preview">
<img src="svg/chapter-04/tree-english-crop.svg">
<img data-src="svg/chapter-04/tree-english-crop.svg">
</div>
</div>
@ -1275,7 +1275,7 @@ could also write <code>praeamble.tex</code> here.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-04/relative-path-english-crop.svg">
<img data-src="svg/chapter-04/relative-path-english-crop.svg">
</div>
</div>
@ -1294,7 +1294,7 @@ could also write <code>praeamble.tex</code> here.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-04/relative-path-subdir-english-crop.svg">
<img data-src="svg/chapter-04/relative-path-subdir-english-crop.svg">
</div>
</div>
@ -1306,8 +1306,11 @@ could also write <code>praeamble.tex</code> here.</p>
<h2 data-category="Excursion ">Specifying file paths <span class="emoji">👣</span>
</h2>
<p data-category="Example">
<code>task.tex</code><code>graphics.raw.tex</code> (while
<code>task.tex</code> is imported into <code>main-exercises.tex</code>)
<code>basic-functionality.tex</code><code>graphics.raw.tex</code>
</p>
<p>
(<code>basic-functionality.tex</code> is imported into
<code>main-exercises.tex</code>)
</p>
<div class="fragment">
<pre>./exercises/graphics/graphics.raw.tex</pre>
@ -1319,7 +1322,7 @@ as fragments.
</div>
<div class="layout-preview">
<img src="svg/chapter-04/relative-path-transitive-english-crop.svg">
<img data-src="svg/chapter-04/relative-path-transitive-english-crop.svg">
</div>
</div>
@ -1408,7 +1411,7 @@ gaps after full stops.</li>
</div>
<div class="layout-preview">
<img src="svg/chapter-05/spaces-crop.svg">
<img data-src="svg/chapter-05/spaces-crop.svg">
</div>
</div>
@ -1479,7 +1482,7 @@ a dashmostly in American English
</div>
<div class="layout-preview">
<img src="svg/chapter-05/hyphens-and-dashes-crop.svg">
<img data-src="svg/chapter-05/hyphens-and-dashes-crop.svg">
</div>
</div>
@ -1501,7 +1504,7 @@ Zitat.}</code></pre>
</div>
<div class="layout-preview">
<img src="svg/chapter-05/quotes-crop.svg">
<img data-src="svg/chapter-05/quotes-crop.svg">
</div>
</div>
@ -1576,7 +1579,7 @@ check the results and intervene where needed by</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-05/french-spacing-crop.svg">
<img data-src="svg/chapter-05/french-spacing-crop.svg">
</div>
</div>
@ -1646,7 +1649,7 @@ Some of the codes only work when you use the <code>babel</code> package.
</div>
<div class="layout-preview">
<img src="svg/chapter-05/hyphenation-crop.svg">
<img data-src="svg/chapter-05/hyphenation-crop.svg">
</div>
</div>
@ -2103,8 +2106,8 @@ underlined
</div>
<div class="layout-preview">
<img class="thin-padding" src="svg/chapter-06/emphases-crop.svg" style="margin-bottom: 0;">
<img class="thin-padding fragment" src="svg/chapter-06/optical-highlighting-crop.svg">
<img class="thin-padding" data-src="svg/chapter-06/emphases-crop.svg" style="margin-bottom: 0;">
<img class="thin-padding fragment" data-src="svg/chapter-06/optical-highlighting-crop.svg">
</div>
</div>
@ -2145,7 +2148,7 @@ command that reproduces URLs</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-06/url-crop.svg">
<img data-src="svg/chapter-06/url-crop.svg">
</div>
</div>
@ -2191,7 +2194,7 @@ want to have a clean document.</li>
</div>
<div class="layout-preview">
<img src="svg/chapter-06/font-size-optician-crop.svg" class="thin-padding">
<img data-src="svg/chapter-06/font-size-optician-crop.svg" class="thin-padding">
</div>
</div>
@ -2217,7 +2220,7 @@ so better avoid it.
</div>
<div class="layout-preview">
<img src="svg/chapter-07/ausrichtung-crop.svg">
<img data-src="svg/chapter-07/ausrichtung-crop.svg">
</div>
</div>
@ -2248,7 +2251,7 @@ for a given paragraph</li>
</div>
<div class="layout-preview">
<img src="./svg/chapter-07/indentation-spacing-orig.svg">
<img data-src="./svg/chapter-07/indentation-spacing-orig.svg">
</div>
</div>
@ -2287,7 +2290,7 @@ the same for all kinds of enumerations.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-08/itemize-english-crop.svg">
<img data-src="svg/chapter-08/itemize-english-crop.svg">
</div>
</div>
@ -2311,8 +2314,8 @@ the same for all kinds of enumerations.</p>
</div>
<div class="layout-preview">
<img class="thin-padding" src="svg/chapter-08/enumerate-english-crop.svg" style="margin-bottom: 0;">
<img class="thin-padding fragment" src="svg/chapter-08/definition-english-crop.svg">
<img class="thin-padding" data-src="svg/chapter-08/enumerate-english-crop.svg" style="margin-bottom: 0;">
<img class="thin-padding fragment" data-src="svg/chapter-08/definition-english-crop.svg">
</div>
</div>
@ -2338,7 +2341,7 @@ the same for all kinds of enumerations.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-08/nested-lists-english-crop.svg">
<img data-src="svg/chapter-08/nested-lists-english-crop.svg">
</div>
</div>
@ -2385,7 +2388,7 @@ spacing.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-08/compact-english-crop.svg">
<img data-src="svg/chapter-08/compact-english-crop.svg">
</div>
</div>
@ -2409,7 +2412,7 @@ integrate enumerations into paragraphs.</p>
</div>
<div class="layout-preview">
<img class="thin-padding" src="svg/chapter-08/paralist-extended-english-crop.svg">
<img class="thin-padding" data-src="svg/chapter-08/paralist-extended-english-crop.svg">
</div>
</div>
@ -2435,7 +2438,7 @@ integrate enumerations into paragraphs.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-08/list-style-types-english-crop.svg">
<img data-src="svg/chapter-08/list-style-types-english-crop.svg">
</div>
</div>
@ -2473,7 +2476,7 @@ signs. We can also use the <code>equation</code> block environment:</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-09/simple-maths-crop.svg">
<img data-src="svg/chapter-09/simple-maths-crop.svg">
</div>
</div>
@ -2545,7 +2548,7 @@ if we add an asterisk after their names (e.g.
</div>
<div class="layout-preview">
<img src="svg/chapter-09/alignment-crop.svg">
<img data-src="svg/chapter-09/alignment-crop.svg">
</div>
</div>
@ -2794,7 +2797,7 @@ Dont use <code>\limits</code> inline.
</div>
<div class="layout-preview">
<img src="svg/chapter-09/limits-crop.svg">
<img data-src="svg/chapter-09/limits-crop.svg">
</div>
</div>
@ -3043,7 +3046,7 @@ upon by typographers and should be avoided.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-12/table-example-crop.svg" class="thin-padding">
<img data-src="svg/chapter-12/table-example-crop.svg" class="thin-padding">
</div>
</div>
@ -3072,7 +3075,7 @@ upon by typographers and should be avoided.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-12/table-content-example-crop.svg" class="thin-padding">
<img data-src="svg/chapter-12/table-content-example-crop.svg" class="thin-padding">
</div>
</div>
@ -3115,7 +3118,7 @@ the width of the table content
</h2>
<p>The <a href="https://tablesgenerator.com/">Tables Generator</a> is a
wonderful tool to quickly create tables of different formats.</p>
<p><a href="https://tablesgenerator.com/"><img src="svg/chapter-12/tables-generator.png"></a></p>
<p><a href="https://tablesgenerator.com/"><img data-src="svg/chapter-12/tables-generator.png"></a></p>
</div>
</div>
@ -3224,7 +3227,7 @@ landscape orientation:</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-12/table-advanced-example-crop.svg" class="thin-padding">
<img data-src="svg/chapter-12/table-advanced-example-crop.svg" class="thin-padding">
</div>
</div>
@ -3265,7 +3268,7 @@ wiki/Wild_boar}}</code></pre>
</div>
<div class="layout-preview">
<img src="svg/chapter-13/footnote-example-crop.svg">
<img data-src="svg/chapter-13/footnote-example-crop.svg">
</div>
</div>
@ -3290,7 +3293,7 @@ As you can see in figure
</div>
<div class="layout-preview">
<img src="svg/chapter-13/ref-example-crop.svg">
<img data-src="svg/chapter-13/ref-example-crop.svg">
</div>
</div>
@ -3365,7 +3368,7 @@ prefixes.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-13/cref-example-crop.svg">
<img data-src="svg/chapter-13/cref-example-crop.svg">
</div>
</div>
@ -3456,7 +3459,7 @@ the <code>\usepackage</code> command.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-13/footmisc-en-crop.svg" class="thin-padding">
<img data-src="svg/chapter-13/footmisc-en-crop.svg" class="thin-padding">
</div>
</div>
@ -3483,7 +3486,7 @@ sec:section3,sec:section5}.</code></pre>
</div>
<div class="layout-preview">
<img src="svg/chapter-13/cref-multiple-example-crop.svg">
<img data-src="svg/chapter-13/cref-multiple-example-crop.svg">
</div>
</div>
@ -3581,7 +3584,7 @@ styles.<cite>Unknown</cite></p>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-14/bibtex-alpha-example-crop.svg" class="large thin-padding" alt="Citing in Alpha style">
<img data-src="svg/chapter-14/bibtex-alpha-example-crop.svg" class="large thin-padding" alt="Citing in Alpha style">
<figcaption aria-hidden="true">Citing in Alpha style</figcaption>
</figure>
@ -3593,7 +3596,7 @@ styles.<cite>Unknown</cite></p>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-14/bibtex-natdin-example-crop.svg" class="large thin-padding" alt="Citing in Natdin style">
<img data-src="svg/chapter-14/bibtex-natdin-example-crop.svg" class="large thin-padding" alt="Citing in Natdin style">
<figcaption aria-hidden="true">Citing in Natdin style</figcaption>
</figure>
@ -3605,7 +3608,7 @@ styles.<cite>Unknown</cite></p>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-14/bamberg_catalogue_bibtex.jpg" class="large" alt="Finding ready-made BibTeX entries University of Bamberg Library">
<img data-src="svg/chapter-14/bamberg_catalogue_bibtex.jpg" class="large" alt="Finding ready-made BibTeX entries University of Bamberg Library">
<figcaption aria-hidden="true">Finding ready-made BibTeX entries
University of Bamberg Library</figcaption>
</figure>
@ -3618,7 +3621,7 @@ University of Bamberg Library</figcaption>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-14/google_bibtex1.jpg" class="large" alt="Finding ready-made BibTeX entries Google Scholar">
<img data-src="svg/chapter-14/google_bibtex1.jpg" class="large" alt="Finding ready-made BibTeX entries Google Scholar">
<figcaption aria-hidden="true">Finding ready-made BibTeX entries
Google Scholar</figcaption>
</figure>
@ -3631,7 +3634,7 @@ Google Scholar</figcaption>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-14/google_bibtex2.jpg" class="large" alt="Finding ready-made BibTeX entries Google Scholar">
<img data-src="svg/chapter-14/google_bibtex2.jpg" class="large" alt="Finding ready-made BibTeX entries Google Scholar">
<figcaption aria-hidden="true">Finding ready-made BibTeX entries
Google Scholar</figcaption>
</figure>
@ -3644,7 +3647,7 @@ Google Scholar</figcaption>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-14/dblp.jpg" class="large" alt="Finding ready-made BibTeX entries dblp.org">
<img data-src="svg/chapter-14/dblp.jpg" class="large" alt="Finding ready-made BibTeX entries dblp.org">
<figcaption aria-hidden="true">Finding ready-made BibTeX entries
dblp.org</figcaption>
</figure>
@ -3712,7 +3715,7 @@ Squares of all even % …
</div>
<div class="layout-preview">
<img src="svg/chapter-10/listings-haskell-english-crop.svg">
<img data-src="svg/chapter-10/listings-haskell-english-crop.svg">
</div>
</div>
@ -3734,7 +3737,7 @@ Squares of all even % …
</div>
<div class="layout-preview">
<img src="svg/chapter-10/listings-java-english-crop.svg">
<img data-src="svg/chapter-10/listings-java-english-crop.svg">
</div>
</div>
@ -3861,7 +3864,7 @@ popular.
</div>
<div class="layout-preview">
<img src="svg/chapter-15/index_en-crop.svg">
<img data-src="svg/chapter-15/index_en-crop.svg">
</div>
</div>
@ -3894,7 +3897,7 @@ themes</a>.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-15/beamer-orig.svg" style="width: 100%; margin: 0;">
<img data-src="svg/chapter-15/beamer-orig.svg" style="width: 100%; margin: 0;">
</div>
</div>
@ -3937,7 +3940,7 @@ child { node {home}
</div>
<div class="layout-preview">
<img src="svg/chapter-04/relative-path-crop.svg">
<img data-src="svg/chapter-04/relative-path-crop.svg">
</div>
</div>
@ -3955,7 +3958,7 @@ trees:</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-15/constituency-tree-crop.svg">
<img data-src="svg/chapter-15/constituency-tree-crop.svg">
</div>
</div>
@ -4015,7 +4018,7 @@ package.</p>
</div>
<div class="layout-preview">
<img class="thin-padding" src="svg/chapter-15/prftree-crop.svg">
<img class="thin-padding" data-src="svg/chapter-15/prftree-crop.svg">
</div>
</div>
@ -4107,7 +4110,7 @@ Table tuning
</h2>
<p>The LaTeX Wikibook offers numerous interesting articles and is
available in English and German (among others).</p>
<p><img src="svg/chapter-16/wikibooks-latex_en.jpg"></p>
<p><img data-src="svg/chapter-16/wikibooks-latex_en.jpg"></p>
</div>
</div>
@ -4121,7 +4124,7 @@ available in English and German (among others).</p>
</h2>
<p>The “Comprehensive TeX Archive Network” is the central source for
LaTeX packages and their documentation.</p>
<p><img src="svg/chapter-16/ctan.jpg"></p>
<p><img data-src="svg/chapter-16/ctan.jpg"></p>
</div>
</div>
@ -4137,7 +4140,7 @@ LaTeX packages and their documentation.</p>
<p>It also offers a multiple tutorials and templates for different
occasions (CV, theses, …):
<a href="https://www.overleaf.com/templates">»Templates«</a>.</p>
<p><img src="svg/chapter-16/overleaf.jpg"></p>
<p><img data-src="svg/chapter-16/overleaf.jpg"></p>
</div>
</div>
@ -4150,7 +4153,7 @@ occasions (CV, theses, …):
<a href="https://tex.stackexchange.com">StackExchange</a>
</h2>
<p>Question-and-answer website for LaTeX.</p>
<p><img src="svg/chapter-16/stackexchange.jpg"></p>
<p><img data-src="svg/chapter-16/stackexchange.jpg"></p>
</div>
</div>
@ -4163,7 +4166,7 @@ occasions (CV, theses, …):
<a href="https://www.texample.net">TeXample</a>
</h2>
<p>A collection of LaTeX examples, especially with TikZ.</p>
<p><img src="svg/chapter-16/texample.jpg"></p>
<p><img data-src="svg/chapter-16/texample.jpg"></p>
</div>
</div>
@ -4173,7 +4176,7 @@ occasions (CV, theses, …):
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-16/klassisches-beispiel-2.jpeg" class="large" alt="Classic (source)">
<img data-src="svg/chapter-16/klassisches-beispiel-2.jpeg" class="large" alt="Classic (source)">
<figcaption aria-hidden="true">Classic (<a href="https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends">source</a>)</figcaption>
</figure>
@ -4185,7 +4188,7 @@ occasions (CV, theses, …):
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-16/klassischeres-beispiel.jpg" alt="More classic (source)">
<img data-src="svg/chapter-16/klassischeres-beispiel.jpg" alt="More classic (source)">
<figcaption aria-hidden="true">More classic (<a href="https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends">source</a>)</figcaption>
</figure>
@ -4197,7 +4200,7 @@ occasions (CV, theses, …):
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-16/anderes-beispiel.png" class="large" alt="Different (source)">
<img data-src="svg/chapter-16/anderes-beispiel.png" class="large" alt="Different (source)">
<figcaption aria-hidden="true">Different (<a href="https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends">source</a>)</figcaption>
</figure>
@ -4218,7 +4221,7 @@ an e-mail!
<span class="emoji" style="display: inline-block; width: 2em;">☎️</span>0951 863 1219 <br>
<span class="emoji" style="display: inline-block; width: 2em;">📧</span><a href="mailto:fachschaft-wiai.stuve@uni-bamberg.de">fachschaft-wiai.stuve@uni-bamberg.de</a>
</p>
<p><img src="images/logo-fachschaft.jpg" style="width:40%; margin: 0 auto; margin-top: 2em; display:block;"></p>
<p><img data-src="images/logo-fachschaft.jpg" style="width:40%; margin: 0 auto; margin-top: 2em; display:block;"></p>
</div>
</div>
@ -4242,7 +4245,7 @@ an e-mail!
<article>
<div class="layout-preview-only">
<div class="layout-preview">
<p><img src="svg/chapter-16/fooboar-latex-tut.jpg" style="width:100%; margin:0 auto; display: block;"></p>
<p><img data-src="svg/chapter-16/fooboar-latex-tut.jpg" style="width:100%; margin:0 auto; display: block;"></p>
</div>
</div>

View File

@ -0,0 +1,412 @@
@slide(layout=chapter-slide)
@number
3
@title
Grundstruktur eines L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X-Dokuments
@slide(layout=content-and-preview)
@title
Präambel & Dokumentumgebung
@content
<p style="text-indent: -1.3em"><span class="emoji">👁</span> Ein mit LaTeX gesetztes Dokument besteht aus:</p>
* **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[<parameter>]{<dokumentklasse>}
```
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.&thinsp;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: <kbd>Strg</kbd> + <kbd>T</kbd> und <kbd>Strg</kbd> + <kbd>U</kbd>
@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.&thinsp;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.&thinsp;ä.).
* 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{<sprache a>}
\selectlanguage{<sprache b>}
```
Eingebetteter Text in anderer Sprache:
``` {.lang-tex .hljs}
\selectlanguage{<sprache a>}
\foreignlanguage{<sprache b>}{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
<div class="box warning">
**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 <kbd>Strg</kbd> + <kbd>T</kbd> erreicht werden).
</div>
Im nächsten Kapitel erklären wir, warum das notwendig ist.

View File

@ -0,0 +1,411 @@
@slide(layout=chapter-slide)
@number
3
@title
Basic structure of a L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X document
@slide(layout=content-and-preview)
@title
Preamble & document environment
@content
<p style="text-indent: -1.3em"><span class="emoji">👁</span> Every LaTeX document is composed of</p>
* 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[<parameter>]{<document_class>}
```
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.&thinsp;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: <kbd>Ctrl</kbd> + <kbd>T</kbd> and <kbd>Ctrl</kbd> + <kbd>U</kbd>
@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.&thinsp;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{<language a>}
\selectlanguage{<language b>}
```
Embedded Text in another language:
``` {.lang-tex .hljs}
\selectlanguage{<language a>}
\foreignlanguage{<language b>}{Text of language B in a Text of language A}
```
@slide(layout=extra-content-and-preview)
@title
Languages&hairsp;&hairsp;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
<div class="box warning">
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 <kbd>Strg</kbd> + <kbd>T</kbd>.)
</div>
We will learn in the following chapter why this is the case.

View File

@ -0,0 +1,91 @@
@slide(layout=chapter-slide)
@number
2
@title
Wie funktioniert L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X?
@slide(layout=content-and-preview)
@title
WYSIWaaas?
@content
### What You See Is What You Get {data-category=Word}
* Formatierung mit unmittelbarem optischen Feedback
<div class="fragment">
### What You See Is What You Mean {data-category=LaTeX}
* Trennung von Inhalt und Struktur
* Formatierung erst am Ende ersichtlich
</div>
<p style="margin-top:calc(.25 * var(--square));">
Bildquelle: <a href="https://xkcd.com/1341/">xkcd</a>
</p>
@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}
\<befehl>[<optionale_parameter>]{<obligatorische_parameter>}
```
++ 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:
<kbd>AltGr</kbd>&nbsp;+&nbsp;<kbd>ß</kbd>&nbsp;(Windows/Linux)
<kbd>Alt</kbd>&nbsp;+&nbsp;<kbd>Shift</kbd>&nbsp;+&nbsp;<kbd>7</kbd>&nbsp;(MacOS)

View File

@ -0,0 +1,93 @@
@slide(layout=chapter-slide)
@number
2
@title
How does <br/>L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X work?
@slide(layout=content-and-preview)
@title
WYSIWhat?
@content
### What You See Is What You Get {data-category=Word}
* Formatting with immediate visual feedback
<div class="fragment">
### What You See Is What You Mean {data-category=LaTeX}
* Separation of content and structure
* Formatting only visible afterwards
</div>
<p style="margin-top:calc(.25 * var(--square));">
Image source: <a href="https://xkcd.com/1341/">xkcd</a>
</p>
@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}
\<command>[<optional_parameters>]{<obligatory_parameters>}
```
++ 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
<kbd>AltGr</kbd>&nbsp;+&nbsp;<kbd>ß</kbd>&nbsp;(Windows/Linux)
<kbd>Alt</kbd>&nbsp;+&nbsp;<kbd>Shift</kbd>&nbsp;+&nbsp;<kbd>7</kbd>&nbsp;(MacOS)

View File

@ -0,0 +1,113 @@
@slide(layout=chapter-slide)
@number
9
@title
Grafiken
@slide(layout=content-only)
@title
Grafiken abbilden <span class="emoji">🖼️</span>
@content
Um Grafiken darzustellen, muss das Paket `graphicx` eingebunden werden.
``` {.lang-tex .hljs}
\begin{figure}
\includegraphics{<dateipfad>}
\caption[<kurztitel (abbildungsver-
zeichnis)>]{<bildunterschrift>}
\end{figure}
```
Bildgröße angeben:
``` {.lang-tex .hljs}
\includegraphics[width=0.5\textwidth,
height=5cm]{<dateipfad>}
```
@slide(layout=content-only)
@title
Positionierung auf der Seite
@content
``` {.lang-tex .hljs}
\begin{figure}[<positionskürzel>]
```
LaTeX positioniert Grafiken automatisch. Durch Kürzel können wir unsere Präferenzen (auch in Kombination) angeben.
<table>
<tr>
<th style="min-width:4em">Kürzel</th>
<th>Position</th>
</tr>
<tr class="fragment">
<td>h</td>
<td>hier, wenn es dir recht ist</td>
</tr>
<tr class="fragment">
<td>t</td>
<td>oberer Seitenrand (top)</td>
</tr>
<tr class="fragment">
<td>b</td>
<td>unterer Seitenrand (bottom)</td>
</tr>
<tr class="fragment">
<td>p</td>
<td>auf einer eigenen Seite (page)</td>
</tr>
<tr class="fragment">
<td>H</td>
<td>Hier, verdammt noch mal! <br />(benötigt Paket `float`)</td>
</tr>
</table>
@slide(layout=content-only)
@title
Zentrierte Anordnung
@content
``` {.lang-tex .hljs}
\begin{figure}[<position>]
\begin{center}
\includegraphics{<dateipfad>}
\end{center}
\end{figure}
```
Alternativ:
``` {.lang-tex .hljs}
\begin{figure}[<position>]
\centering
\includegraphics{<dateipfad>}
\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.

View File

@ -0,0 +1,113 @@
@slide(layout=chapter-slide)
@number
9
@title
Graphics
@slide(layout=content-only)
@title
Including graphics <span class="emoji">🖼️</span>
@content
To display graphics, we need the `graphicx` package.
``` {.lang-tex .hljs}
\begin{figure}
\includegraphics{<file path>}
\caption[<short caption (table of
figures)>]{<full caption>}
\end{figure}
```
Specifying the size:
``` {.lang-tex .hljs}
\includegraphics[width=0.5\textwidth,
height=5cm]{<file path>}
```
@slide(layout=content-only)
@title
Layout on the page
@content
``` {.lang-tex .hljs}
\begin{figure}[<position code>]
```
LaTeX places graphics automatically. With position codes, we can express our preferences (they can be combined as well).
<table>
<tr>
<th style="min-width:4em">code</th>
<th>position</th>
</tr>
<tr class="fragment">
<td>h</td>
<td>here, if you dont mind</td>
</tr>
<tr class="fragment">
<td>t</td>
<td>top of the page</td>
</tr>
<tr class="fragment">
<td>b</td>
<td>bottom of the page</td>
</tr>
<tr class="fragment">
<td>p</td>
<td>on its own page</td>
</tr>
<tr class="fragment">
<td>H</td>
<td>Here, for Gods sake! <br />(`float` package required)</td>
</tr>
</table>
@slide(layout=content-only)
@title
Centred alignment
@content
``` {.lang-tex .hljs}
\begin{figure}[<position>]
\begin{center}
\includegraphics{<path-to-file>}
\end{center}
\end{figure}
```
Alternatively:
``` {.lang-tex .hljs}
\begin{figure}[<position>]
\centering
\includegraphics{<path-to-file>}
\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`).

View File

@ -0,0 +1,67 @@
@slide(layout=chapter-slide)
@number
0
@title
Erste Schritte mit&nbsp;L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X
@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: <a href="https://miktex.org/download">MikT<sub style="font-size: 100%; margin-left: -.1em">E</sub>X</a>
* Linux-Distributionen: <a href="https://tug.org/texlive/doc/texlive-en/texlive-en.html#installation">T<sub style="font-size: 100%; margin-left: -.1em">E</sub>XLive</a>
* Debian-basierte Distros: Führt `sudo apt install texlive-full` aus
* Andere Distributionen: Folgt den anweisungen auf der T<sub style="font-size: 100%; margin-left: -.1em">E</sub>XLive-Website
<div class="box warning">
Bitte achtet darauf, die full version mit allen Paketen zu installieren, wenn ihr die Auswahl habt!
</div>
@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 <a href="https://notepad-plus-plus.org/downloads/">Notepad++</a> oder <a href="https://code.visualstudio.com/download">VSCode</a>
* Für Anfänger:innen empfehlen wir jedoch <a href="https://www.texstudio.org/">T<sub style="font-size: 100%; margin-left: -.1em">E</sub>Xstudio</a>, da es LaTeX-spezifische Features bietet
* Ladet T<sub style="font-size: 100%; margin-left: -.1em">E</sub>Xstudio 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 <span class="emoji"></span> klickt
* Einige neue Dateien sollten nun durch das Kompilieren generiert werden
<div class="box warning">
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.
</div>

View File

@ -0,0 +1,67 @@
@slide(layout=chapter-slide)
@number
0
@title
First steps with&nbsp;L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X
@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&nbsp;a&nbsp;command&nbsp;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 L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X code into a PDF
* Depending on your operating system, different compilers are available
* Windows: <a href="https://miktex.org/download">MikT<sub style="font-size: 100%; margin-left: -.1em">E</sub>X</a>
* macOS: <a href="https://tug.org/mactex/">MacT<sub style="font-size: 100%; margin-left: -.1em">E</sub>X</a>
* Linux distributions: <a href="https://tug.org/texlive/doc/texlive-en/texlive-en.html#installation">T<sub style="font-size: 100%; margin-left: -.1em">E</sub>XLive</a>
* Debian-based distributions: run `sudo apt install texlive-full`
* other distributions: see the T<sub style="font-size: 100%; margin-left: -.1em">E</sub>XLive website
<div class="box warning">
Make sure to install the full version with all packages, if you can!
</div>
@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., <a href="https://notepad-plus-plus.org/downloads/">Notepad++</a>, <a href="https://code.visualstudio.com/download">VSCode</a>
* For beginners, <a href="https://www.texstudio.org/">T<sub style="font-size: 100%; margin-left: -.1em">E</sub>Xstudio</a> is recommended due to its LaTeX-specific features
* Download and install T<sub style="font-size: 100%; margin-left: -.1em">E</sub>Xstudio
@slide(layout=content-only)
@title
Compile the script for&nbsp;the&nbsp;first&nbsp;time
@content
* Download the project archive from the VC.
* Unzip the archive.
* Open the file `main-exercises.tex` in T<sub style="font-size: 100%; margin-left: -.1em">E</sub>Xstudio. It is located in the root directory of the archive.
* Compile `main-exercises.tex` by pressing <span class="emoji"></span>
* A few new files will be generated by the compilation.
<div class="box warning">
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.
</div>

View File

@ -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
<img class="thin-padding" src="svg/chapter-08/enumerate-crop.svg" style="margin-bottom: 0;"/>
<img class="thin-padding fragment" src="svg/chapter-08/definition-crop.svg"/>
@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
<img class="thin-padding" src="svg/chapter-08/paralist-extended-crop.svg"/>
@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)

View File

@ -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
<img class="thin-padding" src="svg/chapter-08/enumerate-english-crop.svg" style="margin-bottom: 0;"/>
<img class="thin-padding fragment" src="svg/chapter-08/definition-english-crop.svg"/>
@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
<img class="thin-padding" src="svg/chapter-08/paralist-extended-english-crop.svg"/>
@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)

View File

@ -0,0 +1,114 @@
@slide(layout=chapter-slide)
@number
12
@title
Literatur&shy;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{<quelle>}`
* ++ Zitieren einer Quelle: `\cite{<quelle>}`
* ++ Zitieren einer Seite: `\cite[S. 15]{<quelle>}`
* ++ Zitieren mit weiteren Zusätzen:<br/>`\cite[<präfix>][<suffix>]{<quelle>}`
* ++ Verweis auf die genutzte `.bib`-Datei: `\bibliography{<.bib-datei>}`
* ++ Angabe des genutzten Zitierstils: <br/>`\bibliographystyle{<zitierstil>}`
> Zwei Dinge sind unendlich. Das Universum und&nbsp;die&nbsp;Auswahl an Zitierstilen.<cite>Unbekannt</cite>
@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`.

View File

@ -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{<source>}`
* ++ Citing a source: `\cite{<source>}`
* ++ Citing a page: `\cite[p. 15]{<source>}`
* ++ Citing with additional text:<br/>`\cite[<prefix>][<suffix>]{<source>}`
* ++ Referencing the `.bib` file: `\bibliography{<.bib file>}`
* ++ Choosing a citation style: <br/>`\bibliographystyle{<citation style>}`
> Two things are infinite: the universe and&nbsp;the&nbsp;assortment of citation styles.<cite>Unknown</cite>
@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.

View File

@ -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
<table>
<tr>
<th>Quelltext</th>
<th>Ergebnis</th>
</tr>
<tr class="fragment">
<td>`\sum_{i=1}^{n}x^2`</td>
<td>$\sum_{i=1}^{n} x^2$</td>
</tr>
<tr class="fragment">
<td>`12 \leq 4 x^2 + 13`</td>
<td>$12 \leq 4 x^2 + 13$</td>
</tr>
<tr class="fragment">
<td>`{n \choose k}`</td>
<td>${n \choose k}$</td>
</tr>
</table>
@slide(layout=content-and-preview)
@title
Ausrichtung von mehreren Gleichungen
@content
Die Umgebung `align` erlaubt es, Gleichungen zum Beispiel am &hairsp;=&hairsp; 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.&thinsp;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
<table>
<tr>
<th>Quelltext</th>
<th>Ergebnis</th>
</tr>
<tr>
<td>`(x)`, `[x]`, `\lbrace x \rbrace`, `\lvert x \rvert`</td>
<td>$(x), [x], \lbrace x\rbrace, \lvert x\rvert$</td>
</tr>
<tr>
<td>`\exists`, `\forall`, `\in`, <br />`\notin`, `\infty`</td>
<td>$\exists,\forall,\in,\notin,\infty$</td>
</tr>
<tr>
<td>`\alpha`, `\beta`, `\Gamma`, <br />`\Delta`, `\varepsilon`, `\pi`</td>
<td>$\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi$</td>
</tr>
<tr>
<td>`\rightarrow`, `\leftarrow`, `\Rightarrow`, `\Leftarrow`, `\Leftrightarrow`</td>
<td>$\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow$</td>
</tr>
<tr>
<td>`(A \cup B) \cap C`</td>
<td>$(A \cup B) \cap C$</td>
</tr>
<tr>
<td>`(A \lor B) \land C`</td>
<td>$(A \lor B) \land C$</td>
</tr>
<tr>
<td>`(A \cdot B) \times C`</td>
<td>$(A \cdot B) \times C$</td>
</tr>
</table>
@slide(layout=extra-content-only)
@title
Mitwachsende Klammern
@content
<table>
<tr>
<th>Quelltext</th>
<th>Ergebnis</th>
</tr>
<tr>
<td>`\left( \frac{1}{2} \right)`</td>
<td>$\left( \frac{1}{2} \right)$</td>
</tr>
<tr>
<td>`\left[ \frac{1}{2} \right]`</td>
<td>$\left[ \frac{1}{2} \right]$</td>
</tr>
<tr>
<td>`\left\lbrace \frac{1}{2} \right\rbrace`</td>
<td>$\left\lbrace \frac{1}{2} \right\rbrace$</td>
</tr>
</table>
``` {.lang-tex .hljs}
$4 \cdot \left( \frac{1}{2} % …
```
<p style="text-align: center;">$4 \cdot \left(\frac{1}{2} +\frac{3}{ 12 \cdot \left( 2 + \frac{1}{86 \cdot \left(\frac{1}{2} + 24 \right)} \right)} \right)$</p>
@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)
```
<p data-category="Achtung!">Der Einsatz von `\limits` sollte im Fließtext vermieden werden.</p>
@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{}`.
<p style="text-align: center;">$\left\lbrace x \mid tiefe(x) \geq 20\right\rbrace$</p>
<p style="text-align: center;">$\left\lbrace x \mid \text{tiefe}(x) \geq 20\right\rbrace$</p>
``` {.lang-tex .hljs}
$\left\lbrace x \mid \text{tiefe}(x) …
```

View File

@ -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
<table>
<tr>
<th>source code</th>
<th>result</th>
</tr>
<tr class="fragment">
<td>`\sum_{i=1}^{n}x^2`</td>
<td>$\sum_{i=1}^{n} x^2$</td>
</tr>
<tr class="fragment">
<td>`12 \leq 4 x^2 + 13`</td>
<td>$12 \leq 4 x^2 + 13$</td>
</tr>
<tr class="fragment">
<td>`{n \choose k}`</td>
<td>${n \choose k}$</td>
</tr>
</table>
@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 &hairsp;=&hairsp; 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.&thinsp;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
<table>
<tr>
<th>source code</th>
<th>result</th>
</tr>
<tr>
<td>`(x)`, `[x]`, `\lbrace x \rbrace`, `\lvert x \rvert`</td>
<td>$(x), [x], \lbrace x\rbrace, \lvert x\rvert$</td>
</tr>
<tr>
<td>`\exists`, `\forall`, `\in`, <br />`\notin`, `\infty`</td>
<td>$\exists,\forall,\in,\notin,\infty$</td>
</tr>
<tr>
<td>`\alpha`, `\beta`, `\Gamma`, <br />`\Delta`, `\varepsilon`, `\pi`</td>
<td>$\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi$</td>
</tr>
<tr>
<td>`\rightarrow`, `\leftarrow`, `\Rightarrow`, `\Leftarrow`, `\Leftrightarrow`</td>
<td>$\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow$</td>
</tr>
<tr>
<td>`(A \cup B) \cap C`</td>
<td>$(A \cup B) \cap C$</td>
</tr>
<tr>
<td>`(A \lor B) \land C`</td>
<td>$(A \lor B) \land C$</td>
</tr>
<tr>
<td>`(A \cdot B) \times C`</td>
<td>$(A \cdot B) \times C$</td>
</tr>
</table>
@slide(layout=extra-content-only)
@title
Height-adapting braces
@content
<table>
<tr>
<th>source code</th>
<th>result</th>
</tr>
<tr>
<td>`\left( \frac{1}{2} \right)`</td>
<td>$\left( \frac{1}{2} \right)$</td>
</tr>
<tr>
<td>`\left[ \frac{1}{2} \right]`</td>
<td>$\left[ \frac{1}{2} \right]$</td>
</tr>
<tr>
<td>`\left\lbrace \frac{1}{2} \right\rbrace`</td>
<td>$\left\lbrace \frac{1}{2} \right\rbrace$</td>
</tr>
</table>
``` {.lang-tex .hljs}
$4 \cdot \left( \frac{1}{2} % …
```
<p style="text-align: center;">$4 \cdot \left(\frac{1}{2} +\frac{3}{ 12 \cdot \left( 2 + \frac{1}{86 \cdot \left(\frac{1}{2} + 24 \right)} \right)} \right)$</p>
@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)
```
<p data-category="Caution!">Don't use `\limits` inline.</p>
@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.
<p style="text-align: center;">$\left\lbrace x \mid frequency(x) \geq 20\right\rbrace$</p>
<p style="text-align: center;">$\left\lbrace x \mid \text{frequency}(x) \geq 20\right\rbrace$</p>
``` {.lang-tex .hljs .fragment}
$\left\lbrace x \mid \text{frequency} …
```

View File

@ -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
<img src="svg/chapter-15/beamer-orig.svg" style="width: 100%; margin: 0;"/>
@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
<img class="thin-padding" src="svg/chapter-15/prftree-crop.svg"/>
@slide(layout=content-only)
@title
Weitere nützliche Pakete
@content
<table>
<tr>
<th>Paket</th>
<th>Anwendung</th>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/xcolor"><code>xcolor</code></a></td>
<td>Machs mit Farbe</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/todonotes"><code>todonotes</code></a></td>
<td>ToDo-Markierungen und Liste der ToDos</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/pdfpages"><code>pdfpages</code></a></td>
<td>Einbinden von PDF-Dateien</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/subcaption"><code>subcaption</code></a></td>
<td>Verschachtelte Abbildungen und ausgefeilte Bildunterschriften</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/colortbl"><code>colortbl</code></a>, <a href="https://www.ctan.org/pkg/tabularx"><code>tabularx</code></a>, <a href="https://www.ctan.org/pkg/multirow"><code>multirow</code></a>, <a href="https://www.ctan.org/pkg/makecell"><code>makecell</code></a></td>
<td>Gestalten von Tabellen</td>
</tr>
</table>

View File

@ -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
<img src="svg/chapter-15/beamer-orig.svg" style="width: 100%; margin: 0;"/>
@slide(layout=content-and-preview)
@title
Drawing images
@content
`TikZ` (“TikZ ist kein Zeichenprogramm”&thinsp;&thinsp;“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
<img class="thin-padding" src="svg/chapter-15/prftree-crop.svg"/>
@slide(layout=content-only)
@title
Other useful packages
@content
<table>
<tr>
<th>Package</th>
<th>Use case</th>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/xcolor"><code>xcolor</code></a></td>
<td>colours</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/todonotes"><code>todonotes</code></a></td>
<td>todo&nbsp;annotations&nbsp;and&nbsp;index</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/pdfpages"><code>pdfpages</code></a></td>
<td>embedding PDF files</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/subcaption"><code>subcaption</code></a></td>
<td>Nested figures and fine-tuned captions</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/colortbl"><code>colortbl</code></a>, <a href="https://www.ctan.org/pkg/tabularx"><code>tabularx</code></a>, <a href="https://www.ctan.org/pkg/multirow"><code>multirow</code></a>, <a href="https://www.ctan.org/pkg/makecell"><code>makecell</code></a></td>
<td>Table tuning</td>
</tr>
</table>

View File

@ -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 <span class="emoji">👹</span>
* 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 <span class="emoji">👑</span>
@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 <span class="emoji">👣</span>
@content
* wichtig für `\input{}` sowie später für das Einbinden von Bildern und anderen Medien
* Datei- und Ordnerstruktur = Baumstruktur <span class="emoji">🌳</span>
* bei `\input{}` kann der Pfad zu einer Unterdatei relativ zur Hauptdatei angeben werden
<p data-category="Achtung!" class="fragment">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.</p>
@preview
![](svg/chapter-04/tree-crop.svg)
@slide(layout=content-and-preview-with-category)
@category
Exkurs
@title
Dateipfade angeben <span class="emoji">👣</span>
@content
<p data-category="Beispiel">`main-exercises.tex``praeamble.tex`</p>
<div class="fragment">
`./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.
</div>
@preview
![](svg/chapter-04/relative-path-crop.svg)
@slide(layout=content-and-preview-with-category)
@category
Exkurs
@title
Dateipfade angeben <span class="emoji">👣</span>
@content
<p data-category="Beispiel">`main-exercises.tex``basic-document-structure.tex` (in einem Unterordner)</p>
<div class="fragment">
`./content/basic-document-structure.tex`
</div>
@preview
![](svg/chapter-04/relative-path-subdir-crop.svg)
@slide(layout=content-and-preview-with-category)
@category
Exkurs
@title
Dateipfade angeben <span class="emoji">👣</span>
@content
<p data-category="Beispiel">`basic-functionality.tex``graphics.raw.tex`</p>
<p>(wenn `basic-functionality.tex` von `main-exercises.tex` importiert wird)</p>
<div class="fragment">
<pre>./exercises/graphics/graphics.raw.tex</pre>
<p data-category="Achtung!">Pfade sind immer relativ zum Wurzelelement, auch wenn dieses noch andere Dateien einbindet, die wiederum andere Dateien referenzieren.</p>
</div>
@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.
<div class="box warning fragment">
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.
</div>
@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.&thinsp;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?

View File

@ -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 <span class="emoji">👹</span>
* 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 <span class="emoji">👑</span>
@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 <span class="emoji">👣</span>
@content
* important for `\input{}`, but later also for other media types
* file and folder structure = tree structure <span class="emoji">🌳</span>
* with `\input{}`, you can specify the path relative to the main file
<p data-category="Caution!" class="fragment">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.</p>
@preview
![](svg/chapter-04/tree-english-crop.svg)
@slide(layout=content-and-preview-with-category)
@category
Excursion
@title
Specifying file paths <span class="emoji">👣</span>
@content
<p data-category="Example">`main-exercises.tex``praeamble.tex`</p>
<div class="fragment">
`./praeamble.tex`
A **single dot `.`** represents the current folder (in this case: `latex-skript`). It is optional, you could also write `praeamble.tex` here.
</div>
@preview
![](svg/chapter-04/relative-path-english-crop.svg)
@slide(layout=content-and-preview-with-category)
@category
Excursion
@title
Specifying file paths <span class="emoji">👣</span>
@content
<p data-category="Example">`main-exercises.tex``basic-document-structure.tex` (in a subfolder)</p>
<pre class="fragment">./content/basic-document-structure.tex</pre>
@preview
![](svg/chapter-04/relative-path-subdir-english-crop.svg)
@slide(layout=content-and-preview-with-category)
@category
Excursion
@title
Specifying file paths <span class="emoji">👣</span>
@content
<p data-category="Example">`basic-functionality.tex``graphics.raw.tex`</p>
<p>(`basic-functionality.tex` is imported into `main-exercises.tex`)</p>
<div class="fragment">
<pre>./exercises/graphics/graphics.raw.tex</pre>
<p data-category="Caution!">Paths are always relative to the root document that imports other files as fragments.</p>
</div>
@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 dont have a preamble.
<div class="box warning fragment">
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.
</div>
@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?

View File

@ -0,0 +1,211 @@
@slide(layout=chapter-slide)
@number
11
@title
Referenzen und&nbsp;Fußnoten
@slide(layout=content-and-preview)
@title
Fußnoten <span class="emoji">📎</span>
@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 dont!)
``` {.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.
<table>
<tr>
<td>`fig:` Abbildungen</td>
<td>`tbl:` Tabellen</td>
</tr>
<tr>
<td>`sec:` Abschnitte</td>
<td>`subsec:` Unter&shy;abschnitte</td>
</tr>
<tr>
<td>`ch:` Kapitel</td>
<td>`itm:` Aufzählungs&shy;elemente</td>
</tr>
<tr>
<td>`eq:` Gleichungen</td>
<td>`lst:` Quelltext&shy;listings</td>
</tr>
</table>
@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)

View File

@ -0,0 +1,213 @@
@slide(layout=chapter-slide)
@number
11
@title
References and&nbsp;footnotes
@slide(layout=content-and-preview)
@title
Footnotes <span class="emoji">📎</span>
@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 dont!)
``` {.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.
<table>
<tr>
<td>`fig:` Figures</td>
<td>`tbl:` Tables</td>
</tr>
<tr>
<td>`sec:` Sections</td>
<td>`subsec:` Subsections</td>
</tr>
<tr>
<td>`ch:` Chapters</td>
<td>`itm:` Enumeration items</td>
</tr>
<tr>
<td>`eq:` Equations</td>
<td>`lst:` Source code listings</td>
</tr>
</table>
@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)

View File

@ -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.

View File

@ -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.&thinsp;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.

View File

@ -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
<table>
<tr>
<th></th>
<th>Name</th>
<th>Verwendung</th>
<th>Code</th>
</tr>
<tr>
<td>-</td>
<td>Bindestrich *(hypen)*</td>
<td>LaTeX-Wochenende</td>
<td>`-`</td>
</tr>
<tr>
<td></td>
<td>Halbgeviert&shy;strich<br />*(en dash)*</td>
<td>als Gedankenstrich oder als Bis-Strich: 10&hairsp;&hairsp;12 Uhr.</td>
<td>`--`</td>
</tr>
<tr>
<td></td>
<td>Geviertstrich<br />*(em dash)*</td>
<td>a dash&hairsp;&hairsp;mostly in American English</td>
<td>`---`</td>
</tr>
</table>
@preview
![](svg/chapter-05/striche-crop.svg)
@slide(layout=content-and-preview)
@title
Zitate
@content
Das Paket `csquotes` stellt u.&thinsp;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! <span class="emoji">⛑️</span>
* 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
<div class="box warning">
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).
</div>
* 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&nbsp;spacing,* also&nbsp;doppelte Leerzeichen nach dem Satzende.
Das kann mit `\frenchspacing` vor dem ersten Absatz verhindert werden. `\nonfrenchspacing` schaltet wieder zurück.
Bei *English&nbsp;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.
<table>
<tr>
<td>Ausschließliche Trennung</td>
<td>`\-`</td>
</tr>
<tr>
<td>Zusätzliche Trennstelle</td>
<td>`"-`</td>
</tr>
<tr>
<td>Bindestrich (verbietet andere Trennstellen)</td>
<td>`-`</td>
</tr>
<tr>
<td>Bindestrich (erlaubt andere Trennstellen)</td>
<td>`"=`</td>
</tr>
<tr>
<td>Trennstelle ohne Strich</td>
<td>`""`</td>
</tr>
<tr>
<td>Strich ohne Trennstelle</td>
<td>`"~`</td>
</tr>
</table>
<p data-category="Achtung!">Einige der Codes funktionieren nur mit eingebundenem `babel`-Paket.</p>
@preview
![](svg/chapter-05/silbentrennung-crop.svg)
@slide(layout=extra-content-only)
@title
Anführungszeichen
@content
<table>
<tr>
<th>Sprache</th>
<th style="text-align: center;">Befehl</th>
<th style="text-align: center;">Ergebnis</th>
</tr>
<tr>
<td>Deutsch</td>
<td style="text-align: center;">`\glqq … \grqq`</td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>&emsp;2. Ebene</td>
<td style="text-align: center;">` \glq … \grq `</td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>Deutsch altern.</td>
<td style="text-align: center;">`\frqq … \flqq`</td>
<td style="text-align: center;">»&hairsp;&hairsp;«</td>
</tr>
<tr>
<td>&emsp;2. Ebene</td>
<td style="text-align: center;">` \frq … \flq `</td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>Englisch (A.&thinsp;E.)</td>
<td style="text-align: center;"><code>\`\`…\'\'</code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>&emsp;2. Ebene</td>
<td style="text-align: center;"><code> \`…\' </code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>Englisch (B.&thinsp;E.)</td>
<td style="text-align: center;"><code> \`…\' </code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>&emsp;2. Ebene</td>
<td style="text-align: center;"><code>\`\`…\'\'</code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
</table>
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:
<table>
<tr>
<td><code>\\\`{o}</code></td><td>ò&emsp;&emsp;</td>
<td>`\c{c}`</td> <td>ç&emsp;&emsp;</td>
<td>`\d{u}`</td> <td></td>
</tr>
<tr>
<td>`\'{o}`</td> <td>ó</td>
<td>`\k{a}`</td> <td>ą</td>
<td>`\r{a}`</td> <td>å</td>
</tr>
<tr>
<td>`\^{o}`</td> <td>ô</td>
<td>`\l{}`</td> <td>ł</td>
<td>`\u{o}`</td> <td>ŏ</td>
</tr>
<tr>
<td>`\"{o}`</td> <td>ö</td>
<td>`\={o}`</td> <td>ō</td>
<td>`\v{s}`</td> <td>š</td>
</tr>
<tr>
<td>`\H{o}`</td> <td>ő</td>
<td>`\b{o}`</td> <td>o</td>
<td>`\t{oo}`</td><td>o͡o</td>
</tr>
<tr>
<td>`\~{o}`</td> <td>õ</td>
<td>`\.{o}`</td> <td>ȯ</td>
<td>`\o`</td> <td>ø</td>
</tr>
</table>
@slide(layout=extra-content-only)
@title
Sonderzeichen & Symbole
@content
Auch andere Sonderzeichen können entweder direkt eingegeben werden oder per Befehl:
<table>
<tr>
<td style="text-align: center;">¿</td> <td><code>?\`</code></td>
<td style="text-align: center;">¡</td> <td><code>!\`</code></td>
</tr>
<tr>
<td style="text-align: center;">^</td> <td>`\textasciicircum`</td>
<td style="text-align: center;">~</td> <td>`\textasciitilde`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textasteriskcentered`</td>
<td style="text-align: center;">\\</td> <td>`\textbackslash`</td>
</tr>
<tr>
<td style="text-align: center;">|</td> <td>`\textbar`</td>
<td style="text-align: center;"></td> <td>`\textbullet`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textcopyright`</td>
<td style="text-align: center;"></td> <td>`\textdagger`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textdaggerdbl`</td>
<td style="text-align: center;"></td> <td>`\textellipsis`</td>
</tr>
<tr>
<td style="text-align: center;">&lt;</td> <td>`\textless`</td>
<td style="text-align: center;">&gt;</td> <td>`\textgreater`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textperthousand`</td>
<td style="text-align: center;">§</td> <td>`\textsection`</td>
</tr>
</table>
… und so ziemlich alles andere.

View File

@ -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
<table>
<tr>
<th></th>
<th>Name</th>
<th>Use</th>
<th>Code</th>
</tr>
<tr>
<td>-</td>
<td>Hyphen</td>
<td>compound-forming hyphen</td>
<td>`-`</td>
</tr>
<tr>
<td></td>
<td>En dash *(Halbgeviert&shy;strich)*</td>
<td>a dash or a range: 12&hairsp;&hairsp;2 p.m.</td>
<td>`--`</td>
</tr>
<tr>
<td></td>
<td>Em dash *(Geviertstrich)*</td>
<td>a dash&hairsp;&hairsp;mostly in American English</td>
<td>`---`</td>
</tr>
</table>
@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! <span class="emoji">⛑️</span>
* 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
<div class="box warning">
From now on, compile the file `main-exercises.tex` to see your changes appear in the exercise script (in this task, see exercise 5).
</div>
* Replace the spaces in `exercises/special-characters.tex` within the abbreviations (“e.&thinsp;g.”, “i.&thinsp;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&nbsp;spacing,* i.&thinsp;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&nbsp;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.
<table>
<tr>
<td>Exclusive hyphenation</td>
<td>`\-`</td>
</tr>
<tr>
<td>Additional hyphenation</td>
<td>`"-`</td>
</tr>
<tr>
<td>Hyphen (suppressing other hyphenation)</td>
<td>`-`</td>
</tr>
<tr>
<td>Hyphen (allowing other hyphenation)</td>
<td>`"=`</td>
</tr>
<tr>
<td>Possible separation without hyphen</td>
<td>`""`</td>
</tr>
<tr>
<td>Non-breaking hyphen</td>
<td>`"~`</td>
</tr>
</table>
<p data-category="Caution!">Some of the codes only work when you use the `babel` package.</p>
@preview
![](svg/chapter-05/hyphenation-crop.svg)
@slide(layout=extra-content-only)
@title
Manual quotation
@content
<table>
<tr>
<th>Language</th>
<th style="text-align: center;">Command</th>
<th style="text-align: center;">Result</th>
</tr>
<tr>
<td>English (B.&thinsp;E.)</td>
<td style="text-align: center;"><code> \`…\' </code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>&emsp;2nd Level</td>
<td style="text-align: center;"><code>\`\`…\'\'</code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>English (A.&thinsp;E.)</td>
<td style="text-align: center;"><code>\`\`…\'\'</code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>&emsp;2nd Level</td>
<td style="text-align: center;"><code> \`…\' </code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>German</td>
<td style="text-align: center;">`\glqq … \grqq`</td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>&emsp;2nd Level</td>
<td style="text-align: center;">` \glq … \grq `</td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>German altern.</td>
<td style="text-align: center;">`\frqq … \flqq`</td>
<td style="text-align: center;">»&hairsp;&hairsp;«</td>
</tr>
<tr>
<td>&emsp;2nd Level</td>
<td style="text-align: center;">` \frq … \flq `</td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
</table>
Other rules my apply for other languages, but most of the time its 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:
<table>
<tr>
<td><code>\\\`{o}</code></td><td>ò&emsp;&emsp;</td>
<td>`\c{c}`</td> <td>ç&emsp;&emsp;</td>
<td>`\d{u}`</td> <td></td>
</tr>
<tr>
<td>`\'{o}`</td> <td>ó</td>
<td>`\k{a}`</td> <td>ą</td>
<td>`\r{a}`</td> <td>å</td>
</tr>
<tr>
<td>`\^{o}`</td> <td>ô</td>
<td>`\l{}`</td> <td>ł</td>
<td>`\u{o}`</td> <td>ŏ</td>
</tr>
<tr>
<td>`\"{o}`</td> <td>ö</td>
<td>`\={o}`</td> <td>ō</td>
<td>`\v{s}`</td> <td>š</td>
</tr>
<tr>
<td>`\H{o}`</td> <td>ő</td>
<td>`\b{o}`</td> <td>o</td>
<td>`\t{oo}`</td><td>o͡o</td>
</tr>
<tr>
<td>`\~{o}`</td> <td>õ</td>
<td>`\.{o}`</td> <td>ȯ</td>
<td>`\o`</td> <td>ø</td>
</tr>
</table>
@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:
<table>
<tr>
<td style="text-align: center;">¿</td> <td><code>?\`</code></td>
<td style="text-align: center;">¡</td> <td><code>!\`</code></td>
</tr>
<tr>
<td style="text-align: center;">^</td> <td>`\textasciicircum`</td>
<td style="text-align: center;">~</td> <td>`\textasciitilde`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textasteriskcentered`</td>
<td style="text-align: center;">\\</td> <td>`\textbackslash`</td>
</tr>
<tr>
<td style="text-align: center;">|</td> <td>`\textbar`</td>
<td style="text-align: center;"></td> <td>`\textbullet`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textcopyright`</td>
<td style="text-align: center;"></td> <td>`\textdagger`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textdaggerdbl`</td>
<td style="text-align: center;"></td> <td>`\textellipsis`</td>
</tr>
<tr>
<td style="text-align: center;">&lt;</td> <td>`\textless`</td>
<td style="text-align: center;">&gt;</td> <td>`\textgreater`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textperthousand`</td>
<td style="text-align: center;">§</td> <td>`\textsection`</td>
</tr>
</table>
… and pretty much anything else.

View File

@ -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 &raquo;Comprehensive TeX Archive Network&laquo; 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 <a href="https://www.overleaf.com/templates">&raquo;Templates&laquo;</a> 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!
<p><span style="display: inline-block; width: 2em;" class="emoji">📍</span>WE5/02.104 <br/>
<span style="display: inline-block; width: 2em;" class="emoji">☎️</span>0951 863 1219 <br/>
<span style="display: inline-block; width: 2em;" class="emoji">📧</span><a href="mailto:fachschaft-wiai.stuve@uni-bamberg.de">fachschaft-wiai.stuve@uni-bamberg.de</a>
</p>
<img src="images/logo-fachschaft.jpg" style="width:40%; margin: 0 auto; margin-top: 2em;
display:block;"/>
@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
<img src="svg/chapter-16/fooboar-latex-tut.jpg" style="width:100%; margin:0 auto; display: block;"/>

View File

@ -0,0 +1,104 @@
@slide(layout=chapter-slide)
@number
15
@title
Getting help and&nbsp;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, …): <a href="https://www.overleaf.com/templates">»Templates«</a>.
![](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&nbsp;come over or write us an e-mail!
<p><span style="display: inline-block; width: 2em;" class="emoji">📍</span>WE5/02.104 <br/>
<span style="display: inline-block; width: 2em;" class="emoji">☎️</span>0951 863 1219 <br/>
<span style="display: inline-block; width: 2em;" class="emoji">📧</span><a href="mailto:fachschaft-wiai.stuve@uni-bamberg.de">fachschaft-wiai.stuve@uni-bamberg.de</a>
</p>
<img src="images/logo-fachschaft.jpg" style="width:40%; margin: 0 auto; margin-top: 2em;
display:block;"/>
@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
<img src="svg/chapter-16/fooboar-latex-tut.jpg" style="width:100%; margin:0 auto; display: block;" />

View File

@ -0,0 +1,233 @@
@slide(layout=chapter-slide)
@number
10
@title
Tabellen
@slide(layout=content-only)
@title
Grundstruktur <span class="emoji">🗒️</span>
@content
Für typografisch schöne Tabellen nutzen wir das Paket `booktabs`.
``` {.hljs .lang-tex}
\usepackage{booktabs}
```
``` {.hljs .lang-tex}
\begin{table}[<position>]
\begin{tabular}{<spaltendefinition>}
% Tabelleninhalt
\end{tabular}
\caption{<tabellenunterschrift>}
\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}
```
<table>
<tr>
<th>Kürzel</th>
<th>Bedeutung</th>
</tr>
<tr class="fragment">
<td>l</td>
<td>linksbündige Spalte</td>
</tr>
<tr class="fragment">
<td>c</td>
<td>zentrierte Spalte</td>
</tr>
<tr class="fragment">
<td>r</td>
<td>rechtsbündige Spalte</td>
</tr>
</table>
++ 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}
```
<p data-category="Hinweis">Mit `@{}` vor und nach einer Spaltendefinition wird der umgebende Weißraum unterdrückt.</p>
<p data-category="Beispiel">`\begin{tabular}{@{}lrcl@{}}` beschränkt die Linien auf die Breite des Tabelleninhalts.</p>
@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}{<spaltendefinition>}
% Tabelleninhalt
\caption{<tabellenunterschrift>}
\label{<label>}
\end{longtable}
```
@slide(layout=extra-content-only)
@title
Hinweise zu `longtable`
@content
``` {.hljs .lang-tex}
\begin{longtable}{<spaltendefinition>}
% Tabelleninhalt
\caption{<tabellenunterschrift>}
\label{<label>}
\end{longtable}
```
* Die `longtable`-Umgebung vereint die `tabular`-Umgebung und die `table`-Umgebung.
* Titel und Label können deshalb direkt unter dem Tabelleninhalt stehen.
* Sofern das Paket `booktabs` eingebunden ist, stehen seine Features auch in `longtable` zur Verfügung.
@slide(layout=extra-content-only)
@title
Besonders breite Tabellen
@content
Sollte die Tabelle einmal zu breit für eine Seite werden, kann sie auch im Querformat dargestellt werden:
``` {.hljs .lang-tex}
\usepackage{rotating}
```
``` {.hljs .lang-tex}
\begin{sidewaystable}[<position>]
\begin{tabular}{<spaltendef.>}
% Tabelleninhalt
\end{tabular}
\end{sidewaystable}
```
@slide(layout=extra-content-and-preview)
@title
Weiterführendes Beispiel
@content
``` {.hljs .lang-tex}
\begin{table}[h]
\begin{tabular}{llr}
\toprule
Struktur & \multicolumn{2}{l}{Zeitkomplexität für Zugriff} \\ \cmidrule(r){2-3}
& Average & Worst \\
\midrule
Stack & $\mathcal{O}(n)$ & $\mathcal{O}(n)$ \\
Binärbaum & $\mathcal{O}(log(n))$ & $\mathcal{O}(log(n))$ \\
AVL-Baum & $\mathcal{O}(log(n))$ & $\mathcal{O}(log(n))$ \\
\bottomrule
\end{tabular}
\end{table}
```
[<span class="emoji">🔗</span> Dokumentation zu Booktabs](http://packages.oth-regensburg.de/ctan/macros/latex/contrib/booktabs/booktabs.pdf)
@preview
![](svg/chapter-12/tabelle-fortgeschritten-beispiel-crop.svg){.thin-padding}

View File

@ -0,0 +1,236 @@
@slide(layout=chapter-slide)
@number
10
@title
Tables
@slide(layout=content-only)
@title
Basic structure <span class="emoji">🗒️</span>
@content
For typographically pleasing tables, we use the `booktabs` package.
``` {.hljs .lang-tex}
\usepackage{booktabs}
```
``` {.hljs .lang-tex}
\begin{table}[<position>]
\begin{tabular}{<column definition>}
% table content
\end{tabular}
\caption{<caption>}
\end{table}
```
Positioning works just like with graphics.
@slide(layout=content-and-preview)
@title
Column definitions
@content
``` {.hljs .lang-tex}
\begin{tabular}{lrcl}
% table content
\end{tabular}
```
<table>
<tr>
<th>letter</th>
<th>meaning</th>
</tr>
<tr class="fragment">
<td>l</td>
<td>left-justified column</td>
</tr>
<tr class="fragment">
<td>c</td>
<td>centred column</td>
</tr>
<tr class="fragment">
<td>r</td>
<td>right-justified column</td>
</tr>
</table>
++ Vertical separator lines and double horizontal lines are frowned upon by typographers and should be avoided.
@preview
![](svg/chapter-12/table-example-crop.svg){.thin-padding}
@slide(layout=content-and-preview)
@title
Table content
@content
``` {.hljs .lang-tex}
\begin{tabular}{lll}
\toprule
Column 1 & Column 2 & Column 3 \\
\midrule
Content a & Content b & Content c \\
Content e & Content f & Content g \\
Content i & Content j & Content k \\
\bottomrule
\end{tabular}
```
* ++ Columns are separated by `&`.
* ++ Rows are ended by `\\`.
* ++ `\toprule`, `\midrule` and `\bottomrule` structure the table.
@preview
![](svg/chapter-12/table-content-example-crop.svg){.thin-padding}
@slide(layout=wide-content)
@title
The entire table
@content
``` {.hljs .lang-tex}
\begin{table}[h]
\begin{tabular}{lrcl}
\toprule
Language & Author & Year & Filename extension \\
\midrule
C++ & Bjarne Stroustrup & 1985 & .cpp \\
Java & James Gosling & 1998 & .java \\
Python & Guido van Rossum & 1991 & .py \\
\bottomrule
\end{tabular}
\caption{Well-known programming languages}
\end{table}
```
<p data-category="Note">`@{}` to the left and right of a column definition removes the padding of the corresponding column.</p>
<p data-category="Example">`\begin{tabular}{@{}lrcl@{}}` limits the row separators to the width of the table content</p>
@slide(layout=content-only)
@title
More comfort
@content
The [Tables Generator](https://tablesgenerator.com/) is a wonderful tool to quickly create tables of different formats.
[![](svg/chapter-12/tables-generator.png)](https://tablesgenerator.com/)
@slide(layout=task)
@task-number
10
@title
Typesetting tables
@content
* The list in file `exercises/tables/tables.tex` stores information on a few modules of the WIAI faculty.
* Transform the list into a **table**.
* The table shall have colums for the *name*, the *abbreviation* (Kürzel) and the *semester* of the lectures.
* Add a **column** with **center-aligned text** on the left side of the table in order to **number** the lectures.
* Add a **caption** for the table.
@slide(layout=extra-content-only)
@title
Particularly long tables
@content
Tables that exceed one page are simply cut off by `tabular`. A solution is offered by the `longtable` package:
``` {.hljs .lang-tex}
\usepackage{longtable}
```
``` {.hljs .lang-tex}
\begin{longtable}{<column definition>}
% table content
\caption{<caption>}
\label{<label>}
\end{longtable}
```
@slide(layout=extra-content-only)
@title
Notes on `longtable`
@content
``` {.hljs .lang-tex}
\begin{longtable}{<column definition>}
% table content
\caption{<caption>}
\label{<label>}
\end{longtable}
```
* The `longtable` environment merges the `tabular` and `table` environments.
* Caption and label can therefore be inserted directly under the table content.
* As long as the `booktabs` package is used, its features are also provided in `longtable`.
@slide(layout=extra-content-only)
@title
Particularly wide tables
@content
If you need a table to be wider than a page, you can display it in landscape orientation:
``` {.hljs .lang-tex}
\usepackage{rotating}
```
``` {.hljs .lang-tex}
\begin{sidewaystable}[<position>]
\begin{tabular}{<column def.>}
% table content
\end{tabular}
\end{sidewaystable}
```
@slide(layout=extra-content-and-preview)
@title
An advanced example
@content
``` {.hljs .lang-tex}
\begin{table}[h]
\begin{tabular}{llr}
\toprule
Structure & \multicolumn{2}{l}{Access time complexity} \\ \cmidrule(r){2-3}
& Average & Worst \\
\midrule
Stack & $\mathcal{O}(n)$ & $\mathcal{O}(n)$ \\
Binary tree & $\mathcal{O}(log(n))$ & $\mathcal{O}(n)$ \\
AVL tree & $\mathcal{O}(log(n))$ & $\mathcal{O}(log(n))$ \\
\bottomrule
\end{tabular}
\end{table}
```
[<span class="emoji">🔗</span> Booktabs documentation](http://packages.oth-regensburg.de/ctan/macros/latex/contrib/booktabs/booktabs.pdf)
@preview
![](svg/chapter-12/table-advanced-example-crop.svg){.thin-padding}

View File

@ -0,0 +1,172 @@
@slide(layout=chapter-slide)
@number
6
@title
Text&shy;auszeichnung
@slide(layout=content-and-preview)
@title
Semantische und optische Hervorhebungen
@content
Semantische Hervorhebungen durch `\emph{}`:
``` {.lang-tex .hljs}
\emph{Super wichtiger Text \emph{mit noch
wichtigerem Text} im Text.}
```
Optische Auszeichnungsmöglichkeiten:
<table>
<tr><th>Bezeichnung</th><th>Befehl</th></tr>
<tr><td>fett (bold face)</td><td>`\textbf{wichtig}`</td></tr>
<tr><td>kursiv (italics)</td><td>`\textit{wichtig}`</td></tr>
<tr><td>Kapitälchen (small&nbsp;caps)</td><td>`\textsc{wichtig}`</td></tr>
<tr><td>dicktengleich (teletype)</td><td>`\texttt{wichtig}`</td></tr>
<tr><td>unterstrichen</td><td>`\underline{wichtig}`</td></tr>
</table>
@preview
<img class="thin-padding" src="svg/chapter-06/hervorhebungen-crop.svg" style="margin-bottom: 0; margin-top: 100px"/>
<img class="thin-padding" src="svg/chapter-06/optische-auszeichnungen-crop.svg" />
@slide(layout=content-only)
@title
Better Call LaTeX!
@content
<div class="box warning">
**Ein gutgemeinter Rat**
Konsistentes Aussehen über das gesamte Dokument hinweg gewünscht?
Voreinstellungen von LaTeX zur Schriftgröße verschiedener Textelemente (Titel, Fließtext, Fußnoten) vertrauen!
Das heißt im Umkehrschluss: Möglichst wenig manuell an Schriftgrößen herumschrauben.
</div>
@slide(layout=content-and-preview)
@title
URLs
@content
Das Paket `hyperref` stellt den Befehl `\url{}` bereit, der URLs
* zeichentreu
* mit bindestrichlosen Umbrüchen
* mit gut unterscheidbaren Zeichen
* im PDF anklickbar
wiedergibt.
``` {.lang-tex .hljs}
\url{https://www.latex-project.org/}
```
@preview
![](svg/chapter-06/url-crop.svg)
@slide(layout=task)
@task-number
6
@title
Text hervorheben
@content
* **Betont** in der Datei `exercises/text-markup/markup.tex` die Wörter *Recursion* und *recursive* mit `\emph{…}`.
* Macht die **URL** im Text anklickbar.
@slide(layout=extra-content-and-preview)
@title
Schriftgröße
@content
### Voreingestellte Schriftgrößen
``` {.hljs .lang-tex}
{\<fontsize> ein Textabschnitt}
```
Schriftgrößen relativ zu `normalsize`:
``` {.hljs .lang-tex}
{\tiny Wenn}
{\footnotesize du}
{\small das}
{\normalsize lesen}
{\large kannst,}
{\Large brauchst}
{\LARGE du}
{\huge keine}
{\Huge Brille.}
```
@preview
![](svg/chapter-06/schriftgroesse-optiker-crop.svg){.thin-padding}
@slide(layout=extra-content-and-preview)
@title
Flattersatz
@content
Standardmäßig setzt LaTeX Fließtext im Blocksatz, aber auch Flattersatz ist möglich.
``` {.lang-tex .hljs}
\raggedright … \raggedleft …
\centering …
```
Alternativ einsetzbare Umgebungen:
``` {.lang-tex .hljs}
\begin{flushleft} Text \end{flushleft}
\begin{flushright} Text \end{flushright}
\begin{center} Text \end{center}
```
<p data-category="Achtung!">Guter Flattersatz ist noch schwieriger als guter Blocksatz, daher lieber vermeiden!</p>
@preview
![](svg/chapter-07/ausrichtung-crop.svg)
@slide(layout=extra-content-and-preview)
@title
Einzüge und Abstände
@content
* Absätze werden standardmäßig durch Erstzeileneinzüge (`\parindent`) verdeutlicht
* Stattdessen (!) können auch Abstände (`\parskip`) verwendet werden
* Die beiden Parameter sind beliebig einstellbar:
``` {.lang-tex .hljs}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1em
plus .5em % erlaubte Dehnung
minus .5em % erlaubte Stauchung
}
```
* Mit `\noindent` kann für nur einen Absatz der Einzug abgeschaltet werden
@preview
![](./svg/chapter-07/einzüge-abstände-orig.svg)

View File

@ -0,0 +1,172 @@
@slide(layout=chapter-slide)
@number
6
@title
Text Markup
@slide(layout=content-and-preview)
@title
Emphases
@content
Continuous text can be emphasized with `\emph{}`:
``` {.lang-tex .hljs}
\emph{Emphasize important
\emph{and even more important} text}
```
Furthermore, optical highlighting can be used.
<table>
<tr><th>Name</th><th>Befehl</th></tr>
<tr><td>Bold (bold face)</td><td>`\textbf{important}`</td></tr>
<tr><td>Italics (italics)</td><td>`\textit{important}`</td></tr>
<tr><td>Small caps</td><td>`\textsc{important}`</td></tr>
<tr><td>non-proportional (teletype)</td><td>`\texttt{important}`</td></tr>
<tr><td>underlined</td><td>`\underline{important}`</td></tr>
</table>
@preview
<img class="thin-padding" src="svg/chapter-06/emphases-crop.svg" style="margin-bottom: 0;"/>
<img class="thin-padding fragment" src="svg/chapter-06/optical-highlighting-crop.svg"/>
@slide(layout=content-only)
@title
Better Call LaTeX!
@content
<div class="box warning">
**Some well-meaning advice**
You want the entire document to look consistent?
Trust LaTeXs defaults (font sizes of title, paragraphs, footnotes, etc.)!
This conversely means: Avoid fiddling around with font sizes manually.
</div>
@slide(layout=content-and-preview)
@title
URLs
@content
The `hyperref` package provides an `\url{}` command that reproduces URLs
* letter by letter
* using line breaks without hyphens
* using a font with well-distinguishable characters
* as a clickable link in the PDF
``` {.lang-tex .hljs}
\url{https://www.latex-project.org/}
```
@preview
![](svg/chapter-06/url-crop.svg)
@slide(layout=task)
@task-number
6
@title
Emphasising text
@content
* **Emphasise** the words *Recursion* and *recursive* in `exercises/text-markup/markup.tex` using `\emph{…}`.
* Make the **URL** in the text clickable.
* Of course, you can also experiment with the other **text markup** possibilities. However, remove them afterwards, if you want to have a clean document.
@slide(layout=extra-content-and-preview)
@title
Font size
@content
### Preset font sizes
``` {.hljs .lang-tex}
{\<fontsize> some text}
```
Font sizes relative to `normalsize`:
``` {.hljs .lang-tex}
{\tiny If}
{\footnotesize you}
{\small can}
{\normalsize read}
{\large this,}
{\Large you}
{\LARGE dont}
{\huge need}
{\Huge glasses.}
```
@preview
![](svg/chapter-06/font-size-optician-crop.svg){.thin-padding}
@slide(layout=extra-content-and-preview)
@title
Ragged alignment
@content
By default, LaTeX sets text in full justification, but it is possible to activate ragged alignment.
``` {.lang-tex .hljs}
\raggedright … \raggedleft …
\centering …
```
Alternatively, we can use dedicated environments:
``` {.lang-tex .hljs}
\begin{flushleft} Text \end{flushleft}
\begin{flushright} Text \end{flushright}
\begin{center} Text \end{center}
```
<p data-category="Caution!">Proper ragged alignment is even more difficult than good justification, so better avoid it.</p>
@preview
![](svg/chapter-07/ausrichtung-crop.svg)
@slide(layout=extra-content-and-preview)
@title
Indentation and spacing
@content
* paragraphs are usually indicated by first-line indentation (`\parindent`)
* we can decide to use paragraph spacing (`\parskip`) instead (!)
* both parameters are customisable:
``` {.lang-tex .hljs}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1em
plus .5em % permitted stretch
minus .5em % permitted compression
}
```
* `\noindent` allows us to disable first-line indentation for a given paragraph
@preview
![](./svg/chapter-07/indentation-spacing-orig.svg)

View File

@ -0,0 +1,8 @@
@slide(layout=titlepage)
@presentation-title
L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X-Wochenende
@subscript
Ein Workshop der Fachschaft WIAI. Präsentiert von Evelyn&nbsp;Fradtschuk, Jessica&nbsp;Klarmann, Florian&nbsp;Knoch, Theresa&nbsp;Knoll, Christian&nbsp;Kremitzl, Bernhard&nbsp;Luedtke und Jochen&nbsp;Mehlich.

View File

@ -0,0 +1,8 @@
@slide(layout=titlepage)
@presentation-title
L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X Weekend
@subscript
A Fachschaft WIAI workshop. Presented by Evelyn&nbsp;Fradtschuk, Jessica&nbsp;Klarmann, Florian&nbsp;Knoch, Theresa&nbsp;Knoll, Christian&nbsp;Kremitzl, Fabian&nbsp;Lamprecht, Bernhard&nbsp;Luedtke and Jochen&nbsp;Mehlich.

View File

@ -0,0 +1,128 @@
@slide(layout=chapter-slide)
@number
1
@title
Was ist L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X?
@slide(layout=content-and-preview)
@title
Entstehung
@content
* Donald **Knuth**, 19771986: Textsatzsystem **TeX**<span class="bubble fragment">τεχ → /tɛç/</span> für The Art of Computer Programming
* Leslie **Lamport**, ab 1980er: Softwarepaket **LaTeX** zur einfacheren Benutzung von TeX
<div style="display: flex; justify-content: space-between; align-items: stretch;">
<figure><img src="svg/chapter-01/knuth.jpg" style="height: 13em"/><figcaption>Donald Knuth</figcaption></figure>
<figure><img src="svg/chapter-01/lamport.jpg" style="height: 13em"/><figcaption>Leslie Lamport</figcaption></figure>
</div>
@preview
![](svg/chapter-01/taocp.jpg)
@slide(layout=macro-typography-grid)
@title
Gründe für LaTeX: Makrotypografie
@example-text
Dieser Absatz soll zeigen, wie sich unter&shy;schied&shy;liche Zeilen&shy;abstände bei unter&shy;schied&shy;lichen Satz&shy;breiten aus&shy;wirken. Dazu ist hier noch ein bisschen mehr Text nötig, damit das auch wirklich nach einem Absatz aussieht. Dazu ist hier noch ein bisschen mehr Text nötig, damit das auch wirklich nach einem Absatz aussieht. Dazu ist hier noch ein bisschen mehr Text nötig, damit das auch wirklich nach einem Absatz aussieht. Dazu ist hier noch ein bisschen mehr Text nötig, damit das auch wirklich nach einem Absatz aussieht. Dazu ist hier noch ein bisschen mehr Text nötig, damit das auch wirklich nach einem Absatz aussieht. Dazu ist hier noch ein bisschen mehr Text nötig, damit das auch wirklich nach einem Absatz aussieht. Dazu ist hier noch ein bisschen mehr Text nötig, damit das auch wirklich nach einem Absatz aussieht.
@narrow-tight
Kurz und eng
@normal-tight
Normale Länge und enger Zeilenabstand
@wide-tight
Lange Zeilen und enger Zeilenabstand
@narrow-medium
Kurz und normal
@normal-medium
Normale Länge und Zeilenabstand
@wide-medium
Lange Zeilen und normaler Zeilenabstand
@narrow-loose
Kurz und weit
@normal-loose
Normale Länge und weiter Zeilenabstand
@wide-loose
Lange Zeilen und weiter Zeilenabstand
@slide(layout=micro-typography-grid)
@title
Gründe für LaTeX: Mikrotypografie
@example1a
schräg (verzerrt)
@example1b
gerade
@example1c
kursiv (eigener Schnitt)
@example2a
kleine Schrift vergrößert
@example2b
jeweils passender Schriftgrad
@example2c
große Schrift verkleinert
@slide(layout=content-only)
@title
Gründe für LaTeX: Plaintext
@content
* zuverlässiges Undo
* einfache Versionierung
* unabhängig von proprietären Programmen
* Quelltext langfristig lesbar
* einfache Zusammenarbeit mit anderen Programmen
* keine Ablenkung durch Formatierung oder eingebettete Medien
@slide(layout=content-and-preview)
@title
Ablauf des Workshops
@content
**Ziel:** Wir arbeiten zusammen unser [LaTeX-Skript](https://github.com/fs-wiai/latex-script/) durch, das ihr nach dem Workshop als kompakte Referenz verwenden könnt.
* Learning by Doing
* Verstehen, wie LaTeX funktioniert
* Einzelheiten später nachschlagen
<div class="fragment">
**Gliederung:**
1. ~~Was ist LaTeX?~~
2. Wie funktioniert LaTeX?
3. Grundstruktur eines LaTeX-Dokuments
4. Projektstruktur
5. Viele Features
6. Literaturverwaltung
7. Ausblick
</div>
@preview
![](svg/chapter-01/cover-script.jpeg)

View File

@ -0,0 +1,127 @@
@slide(layout=chapter-slide)
@number
1
@title
What is L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X?
@slide(layout=content-and-preview)
@title
Origin
@content
* Donald **Knuth**, 19771986: typesetting system **TeX**<span class="bubble fragment" style="margin-top: -3em;">τεχ → /tɛç, tɛx, tɛk/</span> for The Art of Computer Programming
* Leslie **Lamport**, from 1980s: software package **LaTeX** made TeX easier to use
<div style="display: flex; justify-content: space-between; align-items: stretch;">
<figure><img src="svg/chapter-01/knuth.jpg" style="height: 13em"/><figcaption>Donald Knuth</figcaption></figure>
<figure><img src="svg/chapter-01/lamport.jpg" style="height: 13em"/><figcaption>Leslie Lamport</figcaption></figure>
</div>
@preview
![](svg/chapter-01/taocp.jpg)
@slide(layout=macro-typography-grid)
@title
Reasons for using LaTeX: macrotypography
@example-text
This paragraph shows the effect of varied line heights in combination with varied line lengths. For this purpose, a little more text is needed to make it look like an actual paragraph. For this purpose, a little more text is needed to make it look like an actual paragraph. For this purpose, a little more text is needed to make it look like an actual paragraph. For this purpose, a little more text is needed to make it look like an actual paragraph. For this purpose, a little more text is needed to make it look like an actual paragraph. For this purpose, a little more text is needed to make it look like an actual paragraph. For this purpose, a little more text is needed to make it look like an actual paragraph. For this purpose, a little more text is needed to make it look like an actual paragraph.
@narrow-tight
short & tight
@normal-tight
normal length and tight leading
@wide-tight
long lines and tight leading
@narrow-medium
short & medium
@normal-medium
normal length and leading
@wide-medium
long lines and medium leading
@narrow-loose
short & loose
@normal-loose
normal length and loose leading
@wide-loose
long lines and loose leading
@slide(layout=micro-typography-grid)
@title
Reasons for using LaTeX: microtypography
@example1a
slanted (distorted)
@example1b
straight
@example1c
italic (separate font)
@example2a
small font scaled up
@example2b
separate appropriate fonts
@example2c
big font scaled down
@slide(layout=content-only)
@title
Reasons for using LaTeX: plaintext
@content
* reliable undo
* easy versioning
* independence of proprietary software
* source code readable in the long term
* easy cooperation with other software
* no distraction by formatting or embedded media
@slide(layout=content-and-preview)
@title
Procedure of this workshop
@content
**Goal:** you are going to build your own little <br />LaTeX manual based on our [LaTeX script](https://github.com/fs-wiai/latex-script/).
* learning by doing
* understanding how LaTeX works
* details can be looked up later
<div class="fragment">
**Outline:**
1. ~~What is LaTeX?~~
2. How does LaTeX work?
3. Basic structure of a LaTeX document
4. Project structure
5. Lots of features
6. Reference management
7. Outlook
</div>
@preview
![](svg/chapter-01/cover-script.jpeg)

View File

@ -182,13 +182,13 @@ Computer Programming</li>
</ul>
<div style="display: flex; justify-content: space-between; align-items: stretch;">
<figure>
<img src="svg/chapter-01/knuth.jpg" style="height: 13em">
<img data-src="svg/chapter-01/knuth.jpg" style="height: 13em">
<figcaption>
Donald Knuth
</figcaption>
</figure>
<figure>
<img src="svg/chapter-01/lamport.jpg" style="height: 13em">
<img data-src="svg/chapter-01/lamport.jpg" style="height: 13em">
<figcaption>
Leslie Lamport
</figcaption>
@ -197,7 +197,7 @@ Leslie Lamport
</div>
<div class="layout-preview">
<img src="svg/chapter-01/taocp.jpg">
<img data-src="svg/chapter-01/taocp.jpg">
</div>
</div>
@ -498,27 +498,27 @@ it look like an actual paragraph.
}
</style>
<div class="micro-typography">
<p class="example example1"><img src="svg/chapter-01/schriftschnitte-slanted.svg" style="height: 10vh"></p>
<p class="example example1"><img data-src="svg/chapter-01/schriftschnitte-slanted.svg" style="height: 10vh"></p>
<p class="caption ugly">☹ slanted (distorted)
</p>
<p class="example example1"><img src="svg/chapter-01/schriftschnitte-roman.svg" style="height: 10vh"></p>
<p class="example example1"><img data-src="svg/chapter-01/schriftschnitte-roman.svg" style="height: 10vh"></p>
<p class="caption good">☺ straight
</p>
<p class="example example1"><img src="svg/chapter-01/schriftschnitte-italic.svg" style="height: 10vh"></p>
<p class="example example1"><img data-src="svg/chapter-01/schriftschnitte-italic.svg" style="height: 10vh"></p>
<p class="caption good">☺ italic (separate font)
</p>
<p class="example example2"><img src="svg/chapter-01/schriftgrade-vergroessert.svg" style="height: 12vh"></p>
<p class="example example2"><img data-src="svg/chapter-01/schriftgrade-vergroessert.svg" style="height: 12vh"></p>
<p class="caption ugly">☹ small font scaled up
</p>
<p class="example example2"><img src="svg/chapter-01/schriftgrade-korrekt.svg" style="height: 12vh"></p>
<p class="example example2"><img data-src="svg/chapter-01/schriftgrade-korrekt.svg" style="height: 12vh"></p>
<p class="caption good">☺ separate appropriate fonts
</p>
<p class="example example2"><img src="svg/chapter-01/schriftgrade-verkleinert.svg" style="height: 12vh"></p>
<p class="example example2"><img data-src="svg/chapter-01/schriftgrade-verkleinert.svg" style="height: 12vh"></p>
<p class="caption ugly">☹ big font scaled down
</p>
</div>
@ -571,7 +571,7 @@ it look like an actual paragraph.
</div>
<div class="layout-preview">
<img src="svg/chapter-01/cover-script.jpeg">
<img data-src="svg/chapter-01/cover-script.jpeg">
</div>
</div>
@ -617,7 +617,7 @@ Image source: <a href="https://xkcd.com/1341/">xkcd</a>
</div>
<div class="layout-preview">
<img src="svg/chapter-02/xkcd-types-of-editors.png">
<img data-src="svg/chapter-02/xkcd-types-of-editors.png">
</div>
</div>
@ -627,7 +627,7 @@ Image source: <a href="https://xkcd.com/1341/">xkcd</a>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-02/wysiwyg.svg" alt="How to get the final document">
<img data-src="svg/chapter-02/wysiwyg.svg" alt="How to get the final document">
<figcaption aria-hidden="true">How to get the final
document</figcaption>
</figure>
@ -729,7 +729,7 @@ Hello world!
</div>
<div class="layout-preview">
<img src="svg/chapter-03/hello-crop.svg">
<img data-src="svg/chapter-03/hello-crop.svg">
</div>
</div>
@ -809,7 +809,7 @@ within continuous text.</code></pre>
</div>
<div class="layout-preview">
<img src="svg/chapter-03/paragraphs-crop.svg">
<img data-src="svg/chapter-03/paragraphs-crop.svg">
</div>
</div>
@ -833,7 +833,7 @@ Place of birth: Milwaukee, Wisconsin
</div>
<div class="layout-preview">
<img src="svg/chapter-02/comments-crop.svg">
<img data-src="svg/chapter-02/comments-crop.svg">
</div>
</div>
@ -854,7 +854,7 @@ instead.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-03/reserved-characters-crop.svg">
<img data-src="svg/chapter-03/reserved-characters-crop.svg">
</div>
</div>
@ -878,7 +878,7 @@ Always available:</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-03/sections-crop.svg">
<img data-src="svg/chapter-03/sections-crop.svg">
</div>
</div>
@ -933,7 +933,7 @@ My favorite recipe
</div>
<div class="layout-preview">
<img src="svg/chapter-03/title-orig.svg">
<img data-src="svg/chapter-03/title-orig.svg">
</div>
</div>
@ -982,7 +982,7 @@ My favorite recipe
</div>
<div class="layout-preview">
<img src="svg/chapter-03/contents-crop.svg">
<img data-src="svg/chapter-03/contents-crop.svg">
</div>
</div>
@ -1089,7 +1089,7 @@ books</li>
</div>
<div class="layout-preview">
<img src="svg/chapter-03/languages-crop.svg">
<img data-src="svg/chapter-03/languages-crop.svg">
</div>
</div>
@ -1110,7 +1110,7 @@ contents:</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-03/sections-differently-crop.svg">
<img data-src="svg/chapter-03/sections-differently-crop.svg">
</div>
</div>
@ -1163,7 +1163,7 @@ environment, and the table of contents.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-04/langes-dokument.jpg" style="padding: .2em; height: 100vh">
<img data-src="svg/chapter-04/langes-dokument.jpg" style="padding: .2em; height: 100vh">
</div>
</div>
@ -1194,7 +1194,7 @@ environment, and the table of contents.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-04/main-orig.svg">
<img data-src="svg/chapter-04/main-orig.svg">
</div>
</div>
@ -1225,7 +1225,7 @@ of section 2.
</div>
<div class="layout-preview">
<img src="svg/chapter-04/main-parts-crop.svg" class="thin-padding">
<img data-src="svg/chapter-04/main-parts-crop.svg" class="thin-padding">
</div>
</div>
@ -1252,7 +1252,7 @@ those from here on.
</div>
<div class="layout-preview">
<img src="svg/chapter-04/tree-english-crop.svg">
<img data-src="svg/chapter-04/tree-english-crop.svg">
</div>
</div>
@ -1275,7 +1275,7 @@ could also write <code>praeamble.tex</code> here.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-04/relative-path-english-crop.svg">
<img data-src="svg/chapter-04/relative-path-english-crop.svg">
</div>
</div>
@ -1294,7 +1294,7 @@ could also write <code>praeamble.tex</code> here.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-04/relative-path-subdir-english-crop.svg">
<img data-src="svg/chapter-04/relative-path-subdir-english-crop.svg">
</div>
</div>
@ -1306,8 +1306,11 @@ could also write <code>praeamble.tex</code> here.</p>
<h2 data-category="Excursion ">Specifying file paths <span class="emoji">👣</span>
</h2>
<p data-category="Example">
<code>task.tex</code><code>graphics.raw.tex</code> (while
<code>task.tex</code> is imported into <code>main-exercises.tex</code>)
<code>basic-functionality.tex</code><code>graphics.raw.tex</code>
</p>
<p>
(<code>basic-functionality.tex</code> is imported into
<code>main-exercises.tex</code>)
</p>
<div class="fragment">
<pre>./exercises/graphics/graphics.raw.tex</pre>
@ -1319,7 +1322,7 @@ as fragments.
</div>
<div class="layout-preview">
<img src="svg/chapter-04/relative-path-transitive-english-crop.svg">
<img data-src="svg/chapter-04/relative-path-transitive-english-crop.svg">
</div>
</div>
@ -1408,7 +1411,7 @@ gaps after full stops.</li>
</div>
<div class="layout-preview">
<img src="svg/chapter-05/spaces-crop.svg">
<img data-src="svg/chapter-05/spaces-crop.svg">
</div>
</div>
@ -1479,7 +1482,7 @@ a dashmostly in American English
</div>
<div class="layout-preview">
<img src="svg/chapter-05/hyphens-and-dashes-crop.svg">
<img data-src="svg/chapter-05/hyphens-and-dashes-crop.svg">
</div>
</div>
@ -1501,7 +1504,7 @@ Zitat.}</code></pre>
</div>
<div class="layout-preview">
<img src="svg/chapter-05/quotes-crop.svg">
<img data-src="svg/chapter-05/quotes-crop.svg">
</div>
</div>
@ -1576,7 +1579,7 @@ check the results and intervene where needed by</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-05/french-spacing-crop.svg">
<img data-src="svg/chapter-05/french-spacing-crop.svg">
</div>
</div>
@ -1646,7 +1649,7 @@ Some of the codes only work when you use the <code>babel</code> package.
</div>
<div class="layout-preview">
<img src="svg/chapter-05/hyphenation-crop.svg">
<img data-src="svg/chapter-05/hyphenation-crop.svg">
</div>
</div>
@ -2103,8 +2106,8 @@ underlined
</div>
<div class="layout-preview">
<img class="thin-padding" src="svg/chapter-06/emphases-crop.svg" style="margin-bottom: 0;">
<img class="thin-padding fragment" src="svg/chapter-06/optical-highlighting-crop.svg">
<img class="thin-padding" data-src="svg/chapter-06/emphases-crop.svg" style="margin-bottom: 0;">
<img class="thin-padding fragment" data-src="svg/chapter-06/optical-highlighting-crop.svg">
</div>
</div>
@ -2145,7 +2148,7 @@ command that reproduces URLs</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-06/url-crop.svg">
<img data-src="svg/chapter-06/url-crop.svg">
</div>
</div>
@ -2191,7 +2194,7 @@ want to have a clean document.</li>
</div>
<div class="layout-preview">
<img src="svg/chapter-06/font-size-optician-crop.svg" class="thin-padding">
<img data-src="svg/chapter-06/font-size-optician-crop.svg" class="thin-padding">
</div>
</div>
@ -2217,7 +2220,7 @@ so better avoid it.
</div>
<div class="layout-preview">
<img src="svg/chapter-07/ausrichtung-crop.svg">
<img data-src="svg/chapter-07/ausrichtung-crop.svg">
</div>
</div>
@ -2248,7 +2251,7 @@ for a given paragraph</li>
</div>
<div class="layout-preview">
<img src="./svg/chapter-07/indentation-spacing-orig.svg">
<img data-src="./svg/chapter-07/indentation-spacing-orig.svg">
</div>
</div>
@ -2287,7 +2290,7 @@ the same for all kinds of enumerations.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-08/itemize-english-crop.svg">
<img data-src="svg/chapter-08/itemize-english-crop.svg">
</div>
</div>
@ -2311,8 +2314,8 @@ the same for all kinds of enumerations.</p>
</div>
<div class="layout-preview">
<img class="thin-padding" src="svg/chapter-08/enumerate-english-crop.svg" style="margin-bottom: 0;">
<img class="thin-padding fragment" src="svg/chapter-08/definition-english-crop.svg">
<img class="thin-padding" data-src="svg/chapter-08/enumerate-english-crop.svg" style="margin-bottom: 0;">
<img class="thin-padding fragment" data-src="svg/chapter-08/definition-english-crop.svg">
</div>
</div>
@ -2338,7 +2341,7 @@ the same for all kinds of enumerations.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-08/nested-lists-english-crop.svg">
<img data-src="svg/chapter-08/nested-lists-english-crop.svg">
</div>
</div>
@ -2385,7 +2388,7 @@ spacing.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-08/compact-english-crop.svg">
<img data-src="svg/chapter-08/compact-english-crop.svg">
</div>
</div>
@ -2409,7 +2412,7 @@ integrate enumerations into paragraphs.</p>
</div>
<div class="layout-preview">
<img class="thin-padding" src="svg/chapter-08/paralist-extended-english-crop.svg">
<img class="thin-padding" data-src="svg/chapter-08/paralist-extended-english-crop.svg">
</div>
</div>
@ -2435,7 +2438,7 @@ integrate enumerations into paragraphs.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-08/list-style-types-english-crop.svg">
<img data-src="svg/chapter-08/list-style-types-english-crop.svg">
</div>
</div>
@ -2473,7 +2476,7 @@ signs. We can also use the <code>equation</code> block environment:</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-09/simple-maths-crop.svg">
<img data-src="svg/chapter-09/simple-maths-crop.svg">
</div>
</div>
@ -2545,7 +2548,7 @@ if we add an asterisk after their names (e.g.
</div>
<div class="layout-preview">
<img src="svg/chapter-09/alignment-crop.svg">
<img data-src="svg/chapter-09/alignment-crop.svg">
</div>
</div>
@ -2794,7 +2797,7 @@ Dont use <code>\limits</code> inline.
</div>
<div class="layout-preview">
<img src="svg/chapter-09/limits-crop.svg">
<img data-src="svg/chapter-09/limits-crop.svg">
</div>
</div>
@ -3043,7 +3046,7 @@ upon by typographers and should be avoided.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-12/table-example-crop.svg" class="thin-padding">
<img data-src="svg/chapter-12/table-example-crop.svg" class="thin-padding">
</div>
</div>
@ -3072,7 +3075,7 @@ upon by typographers and should be avoided.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-12/table-content-example-crop.svg" class="thin-padding">
<img data-src="svg/chapter-12/table-content-example-crop.svg" class="thin-padding">
</div>
</div>
@ -3115,7 +3118,7 @@ the width of the table content
</h2>
<p>The <a href="https://tablesgenerator.com/">Tables Generator</a> is a
wonderful tool to quickly create tables of different formats.</p>
<p><a href="https://tablesgenerator.com/"><img src="svg/chapter-12/tables-generator.png"></a></p>
<p><a href="https://tablesgenerator.com/"><img data-src="svg/chapter-12/tables-generator.png"></a></p>
</div>
</div>
@ -3224,7 +3227,7 @@ landscape orientation:</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-12/table-advanced-example-crop.svg" class="thin-padding">
<img data-src="svg/chapter-12/table-advanced-example-crop.svg" class="thin-padding">
</div>
</div>
@ -3265,7 +3268,7 @@ wiki/Wild_boar}}</code></pre>
</div>
<div class="layout-preview">
<img src="svg/chapter-13/footnote-example-crop.svg">
<img data-src="svg/chapter-13/footnote-example-crop.svg">
</div>
</div>
@ -3290,7 +3293,7 @@ As you can see in figure
</div>
<div class="layout-preview">
<img src="svg/chapter-13/ref-example-crop.svg">
<img data-src="svg/chapter-13/ref-example-crop.svg">
</div>
</div>
@ -3365,7 +3368,7 @@ prefixes.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-13/cref-example-crop.svg">
<img data-src="svg/chapter-13/cref-example-crop.svg">
</div>
</div>
@ -3456,7 +3459,7 @@ the <code>\usepackage</code> command.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-13/footmisc-en-crop.svg" class="thin-padding">
<img data-src="svg/chapter-13/footmisc-en-crop.svg" class="thin-padding">
</div>
</div>
@ -3483,7 +3486,7 @@ sec:section3,sec:section5}.</code></pre>
</div>
<div class="layout-preview">
<img src="svg/chapter-13/cref-multiple-example-crop.svg">
<img data-src="svg/chapter-13/cref-multiple-example-crop.svg">
</div>
</div>
@ -3581,7 +3584,7 @@ styles.<cite>Unknown</cite></p>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-14/bibtex-alpha-example-crop.svg" class="large thin-padding" alt="Citing in Alpha style">
<img data-src="svg/chapter-14/bibtex-alpha-example-crop.svg" class="large thin-padding" alt="Citing in Alpha style">
<figcaption aria-hidden="true">Citing in Alpha style</figcaption>
</figure>
@ -3593,7 +3596,7 @@ styles.<cite>Unknown</cite></p>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-14/bibtex-natdin-example-crop.svg" class="large thin-padding" alt="Citing in Natdin style">
<img data-src="svg/chapter-14/bibtex-natdin-example-crop.svg" class="large thin-padding" alt="Citing in Natdin style">
<figcaption aria-hidden="true">Citing in Natdin style</figcaption>
</figure>
@ -3605,7 +3608,7 @@ styles.<cite>Unknown</cite></p>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-14/bamberg_catalogue_bibtex.jpg" class="large" alt="Finding ready-made BibTeX entries University of Bamberg Library">
<img data-src="svg/chapter-14/bamberg_catalogue_bibtex.jpg" class="large" alt="Finding ready-made BibTeX entries University of Bamberg Library">
<figcaption aria-hidden="true">Finding ready-made BibTeX entries
University of Bamberg Library</figcaption>
</figure>
@ -3618,7 +3621,7 @@ University of Bamberg Library</figcaption>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-14/google_bibtex1.jpg" class="large" alt="Finding ready-made BibTeX entries Google Scholar">
<img data-src="svg/chapter-14/google_bibtex1.jpg" class="large" alt="Finding ready-made BibTeX entries Google Scholar">
<figcaption aria-hidden="true">Finding ready-made BibTeX entries
Google Scholar</figcaption>
</figure>
@ -3631,7 +3634,7 @@ Google Scholar</figcaption>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-14/google_bibtex2.jpg" class="large" alt="Finding ready-made BibTeX entries Google Scholar">
<img data-src="svg/chapter-14/google_bibtex2.jpg" class="large" alt="Finding ready-made BibTeX entries Google Scholar">
<figcaption aria-hidden="true">Finding ready-made BibTeX entries
Google Scholar</figcaption>
</figure>
@ -3644,7 +3647,7 @@ Google Scholar</figcaption>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-14/dblp.jpg" class="large" alt="Finding ready-made BibTeX entries dblp.org">
<img data-src="svg/chapter-14/dblp.jpg" class="large" alt="Finding ready-made BibTeX entries dblp.org">
<figcaption aria-hidden="true">Finding ready-made BibTeX entries
dblp.org</figcaption>
</figure>
@ -3712,7 +3715,7 @@ Squares of all even % …
</div>
<div class="layout-preview">
<img src="svg/chapter-10/listings-haskell-english-crop.svg">
<img data-src="svg/chapter-10/listings-haskell-english-crop.svg">
</div>
</div>
@ -3734,7 +3737,7 @@ Squares of all even % …
</div>
<div class="layout-preview">
<img src="svg/chapter-10/listings-java-english-crop.svg">
<img data-src="svg/chapter-10/listings-java-english-crop.svg">
</div>
</div>
@ -3861,7 +3864,7 @@ popular.
</div>
<div class="layout-preview">
<img src="svg/chapter-15/index_en-crop.svg">
<img data-src="svg/chapter-15/index_en-crop.svg">
</div>
</div>
@ -3894,7 +3897,7 @@ themes</a>.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-15/beamer-orig.svg" style="width: 100%; margin: 0;">
<img data-src="svg/chapter-15/beamer-orig.svg" style="width: 100%; margin: 0;">
</div>
</div>
@ -3937,7 +3940,7 @@ child { node {home}
</div>
<div class="layout-preview">
<img src="svg/chapter-04/relative-path-crop.svg">
<img data-src="svg/chapter-04/relative-path-crop.svg">
</div>
</div>
@ -3955,7 +3958,7 @@ trees:</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-15/constituency-tree-crop.svg">
<img data-src="svg/chapter-15/constituency-tree-crop.svg">
</div>
</div>
@ -4015,7 +4018,7 @@ package.</p>
</div>
<div class="layout-preview">
<img class="thin-padding" src="svg/chapter-15/prftree-crop.svg">
<img class="thin-padding" data-src="svg/chapter-15/prftree-crop.svg">
</div>
</div>
@ -4107,7 +4110,7 @@ Table tuning
</h2>
<p>The LaTeX Wikibook offers numerous interesting articles and is
available in English and German (among others).</p>
<p><img src="svg/chapter-16/wikibooks-latex_en.jpg"></p>
<p><img data-src="svg/chapter-16/wikibooks-latex_en.jpg"></p>
</div>
</div>
@ -4121,7 +4124,7 @@ available in English and German (among others).</p>
</h2>
<p>The “Comprehensive TeX Archive Network” is the central source for
LaTeX packages and their documentation.</p>
<p><img src="svg/chapter-16/ctan.jpg"></p>
<p><img data-src="svg/chapter-16/ctan.jpg"></p>
</div>
</div>
@ -4137,7 +4140,7 @@ LaTeX packages and their documentation.</p>
<p>It also offers a multiple tutorials and templates for different
occasions (CV, theses, …):
<a href="https://www.overleaf.com/templates">»Templates«</a>.</p>
<p><img src="svg/chapter-16/overleaf.jpg"></p>
<p><img data-src="svg/chapter-16/overleaf.jpg"></p>
</div>
</div>
@ -4150,7 +4153,7 @@ occasions (CV, theses, …):
<a href="https://tex.stackexchange.com">StackExchange</a>
</h2>
<p>Question-and-answer website for LaTeX.</p>
<p><img src="svg/chapter-16/stackexchange.jpg"></p>
<p><img data-src="svg/chapter-16/stackexchange.jpg"></p>
</div>
</div>
@ -4163,7 +4166,7 @@ occasions (CV, theses, …):
<a href="https://www.texample.net">TeXample</a>
</h2>
<p>A collection of LaTeX examples, especially with TikZ.</p>
<p><img src="svg/chapter-16/texample.jpg"></p>
<p><img data-src="svg/chapter-16/texample.jpg"></p>
</div>
</div>
@ -4173,7 +4176,7 @@ occasions (CV, theses, …):
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-16/klassisches-beispiel-2.jpeg" class="large" alt="Classic (source)">
<img data-src="svg/chapter-16/klassisches-beispiel-2.jpeg" class="large" alt="Classic (source)">
<figcaption aria-hidden="true">Classic (<a href="https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends">source</a>)</figcaption>
</figure>
@ -4185,7 +4188,7 @@ occasions (CV, theses, …):
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-16/klassischeres-beispiel.jpg" alt="More classic (source)">
<img data-src="svg/chapter-16/klassischeres-beispiel.jpg" alt="More classic (source)">
<figcaption aria-hidden="true">More classic (<a href="https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends">source</a>)</figcaption>
</figure>
@ -4197,7 +4200,7 @@ occasions (CV, theses, …):
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-16/anderes-beispiel.png" class="large" alt="Different (source)">
<img data-src="svg/chapter-16/anderes-beispiel.png" class="large" alt="Different (source)">
<figcaption aria-hidden="true">Different (<a href="https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends">source</a>)</figcaption>
</figure>
@ -4218,7 +4221,7 @@ an e-mail!
<span class="emoji" style="display: inline-block; width: 2em;">☎️</span>0951 863 1219 <br>
<span class="emoji" style="display: inline-block; width: 2em;">📧</span><a href="mailto:fachschaft-wiai.stuve@uni-bamberg.de">fachschaft-wiai.stuve@uni-bamberg.de</a>
</p>
<p><img src="images/logo-fachschaft.jpg" style="width:40%; margin: 0 auto; margin-top: 2em; display:block;"></p>
<p><img data-src="images/logo-fachschaft.jpg" style="width:40%; margin: 0 auto; margin-top: 2em; display:block;"></p>
</div>
</div>
@ -4242,7 +4245,7 @@ an e-mail!
<article>
<div class="layout-preview-only">
<div class="layout-preview">
<p><img src="svg/chapter-16/fooboar-latex-tut.jpg" style="width:100%; margin:0 auto; display: block;"></p>
<p><img data-src="svg/chapter-16/fooboar-latex-tut.jpg" style="width:100%; margin:0 auto; display: block;"></p>
</div>
</div>

View File

@ -0,0 +1,412 @@
@slide(layout=chapter-slide)
@number
3
@title
Grundstruktur eines L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X-Dokuments
@slide(layout=content-and-preview)
@title
Präambel & Dokumentumgebung
@content
<p style="text-indent: -1.3em"><span class="emoji">👁</span> Ein mit LaTeX gesetztes Dokument besteht aus:</p>
* **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[<parameter>]{<dokumentklasse>}
```
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.&thinsp;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: <kbd>Strg</kbd> + <kbd>T</kbd> und <kbd>Strg</kbd> + <kbd>U</kbd>
@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.&thinsp;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.&thinsp;ä.).
* 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{<sprache a>}
\selectlanguage{<sprache b>}
```
Eingebetteter Text in anderer Sprache:
``` {.lang-tex .hljs}
\selectlanguage{<sprache a>}
\foreignlanguage{<sprache b>}{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
<div class="box warning">
**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 <kbd>Strg</kbd> + <kbd>T</kbd> erreicht werden).
</div>
Im nächsten Kapitel erklären wir, warum das notwendig ist.

View File

@ -0,0 +1,411 @@
@slide(layout=chapter-slide)
@number
3
@title
Basic structure of a L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X document
@slide(layout=content-and-preview)
@title
Preamble & document environment
@content
<p style="text-indent: -1.3em"><span class="emoji">👁</span> Every LaTeX document is composed of</p>
* 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[<parameter>]{<document_class>}
```
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.&thinsp;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: <kbd>Ctrl</kbd> + <kbd>T</kbd> and <kbd>Ctrl</kbd> + <kbd>U</kbd>
@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.&thinsp;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{<language a>}
\selectlanguage{<language b>}
```
Embedded Text in another language:
``` {.lang-tex .hljs}
\selectlanguage{<language a>}
\foreignlanguage{<language b>}{Text of language B in a Text of language A}
```
@slide(layout=extra-content-and-preview)
@title
Languages&hairsp;&hairsp;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
<div class="box warning">
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 <kbd>Strg</kbd> + <kbd>T</kbd>.)
</div>
We will learn in the following chapter why this is the case.

View File

@ -0,0 +1,91 @@
@slide(layout=chapter-slide)
@number
2
@title
Wie funktioniert L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X?
@slide(layout=content-and-preview)
@title
WYSIWaaas?
@content
### What You See Is What You Get {data-category=Word}
* Formatierung mit unmittelbarem optischen Feedback
<div class="fragment">
### What You See Is What You Mean {data-category=LaTeX}
* Trennung von Inhalt und Struktur
* Formatierung erst am Ende ersichtlich
</div>
<p style="margin-top:calc(.25 * var(--square));">
Bildquelle: <a href="https://xkcd.com/1341/">xkcd</a>
</p>
@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}
\<befehl>[<optionale_parameter>]{<obligatorische_parameter>}
```
++ 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:
<kbd>AltGr</kbd>&nbsp;+&nbsp;<kbd>ß</kbd>&nbsp;(Windows/Linux)
<kbd>Alt</kbd>&nbsp;+&nbsp;<kbd>Shift</kbd>&nbsp;+&nbsp;<kbd>7</kbd>&nbsp;(MacOS)

View File

@ -0,0 +1,93 @@
@slide(layout=chapter-slide)
@number
2
@title
How does <br/>L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X work?
@slide(layout=content-and-preview)
@title
WYSIWhat?
@content
### What You See Is What You Get {data-category=Word}
* Formatting with immediate visual feedback
<div class="fragment">
### What You See Is What You Mean {data-category=LaTeX}
* Separation of content and structure
* Formatting only visible afterwards
</div>
<p style="margin-top:calc(.25 * var(--square));">
Image source: <a href="https://xkcd.com/1341/">xkcd</a>
</p>
@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}
\<command>[<optional_parameters>]{<obligatory_parameters>}
```
++ 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
<kbd>AltGr</kbd>&nbsp;+&nbsp;<kbd>ß</kbd>&nbsp;(Windows/Linux)
<kbd>Alt</kbd>&nbsp;+&nbsp;<kbd>Shift</kbd>&nbsp;+&nbsp;<kbd>7</kbd>&nbsp;(MacOS)

View File

@ -0,0 +1,113 @@
@slide(layout=chapter-slide)
@number
9
@title
Grafiken
@slide(layout=content-only)
@title
Grafiken abbilden <span class="emoji">🖼️</span>
@content
Um Grafiken darzustellen, muss das Paket `graphicx` eingebunden werden.
``` {.lang-tex .hljs}
\begin{figure}
\includegraphics{<dateipfad>}
\caption[<kurztitel (abbildungsver-
zeichnis)>]{<bildunterschrift>}
\end{figure}
```
Bildgröße angeben:
``` {.lang-tex .hljs}
\includegraphics[width=0.5\textwidth,
height=5cm]{<dateipfad>}
```
@slide(layout=content-only)
@title
Positionierung auf der Seite
@content
``` {.lang-tex .hljs}
\begin{figure}[<positionskürzel>]
```
LaTeX positioniert Grafiken automatisch. Durch Kürzel können wir unsere Präferenzen (auch in Kombination) angeben.
<table>
<tr>
<th style="min-width:4em">Kürzel</th>
<th>Position</th>
</tr>
<tr class="fragment">
<td>h</td>
<td>hier, wenn es dir recht ist</td>
</tr>
<tr class="fragment">
<td>t</td>
<td>oberer Seitenrand (top)</td>
</tr>
<tr class="fragment">
<td>b</td>
<td>unterer Seitenrand (bottom)</td>
</tr>
<tr class="fragment">
<td>p</td>
<td>auf einer eigenen Seite (page)</td>
</tr>
<tr class="fragment">
<td>H</td>
<td>Hier, verdammt noch mal! <br />(benötigt Paket `float`)</td>
</tr>
</table>
@slide(layout=content-only)
@title
Zentrierte Anordnung
@content
``` {.lang-tex .hljs}
\begin{figure}[<position>]
\begin{center}
\includegraphics{<dateipfad>}
\end{center}
\end{figure}
```
Alternativ:
``` {.lang-tex .hljs}
\begin{figure}[<position>]
\centering
\includegraphics{<dateipfad>}
\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.

View File

@ -0,0 +1,113 @@
@slide(layout=chapter-slide)
@number
9
@title
Graphics
@slide(layout=content-only)
@title
Including graphics <span class="emoji">🖼️</span>
@content
To display graphics, we need the `graphicx` package.
``` {.lang-tex .hljs}
\begin{figure}
\includegraphics{<file path>}
\caption[<short caption (table of
figures)>]{<full caption>}
\end{figure}
```
Specifying the size:
``` {.lang-tex .hljs}
\includegraphics[width=0.5\textwidth,
height=5cm]{<file path>}
```
@slide(layout=content-only)
@title
Layout on the page
@content
``` {.lang-tex .hljs}
\begin{figure}[<position code>]
```
LaTeX places graphics automatically. With position codes, we can express our preferences (they can be combined as well).
<table>
<tr>
<th style="min-width:4em">code</th>
<th>position</th>
</tr>
<tr class="fragment">
<td>h</td>
<td>here, if you dont mind</td>
</tr>
<tr class="fragment">
<td>t</td>
<td>top of the page</td>
</tr>
<tr class="fragment">
<td>b</td>
<td>bottom of the page</td>
</tr>
<tr class="fragment">
<td>p</td>
<td>on its own page</td>
</tr>
<tr class="fragment">
<td>H</td>
<td>Here, for Gods sake! <br />(`float` package required)</td>
</tr>
</table>
@slide(layout=content-only)
@title
Centred alignment
@content
``` {.lang-tex .hljs}
\begin{figure}[<position>]
\begin{center}
\includegraphics{<path-to-file>}
\end{center}
\end{figure}
```
Alternatively:
``` {.lang-tex .hljs}
\begin{figure}[<position>]
\centering
\includegraphics{<path-to-file>}
\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`).

View File

@ -0,0 +1,67 @@
@slide(layout=chapter-slide)
@number
0
@title
Erste Schritte mit&nbsp;L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X
@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: <a href="https://miktex.org/download">MikT<sub style="font-size: 100%; margin-left: -.1em">E</sub>X</a>
* Linux-Distributionen: <a href="https://tug.org/texlive/doc/texlive-en/texlive-en.html#installation">T<sub style="font-size: 100%; margin-left: -.1em">E</sub>XLive</a>
* Debian-basierte Distros: Führt `sudo apt install texlive-full` aus
* Andere Distributionen: Folgt den anweisungen auf der T<sub style="font-size: 100%; margin-left: -.1em">E</sub>XLive-Website
<div class="box warning">
Bitte achtet darauf, die full version mit allen Paketen zu installieren, wenn ihr die Auswahl habt!
</div>
@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 <a href="https://notepad-plus-plus.org/downloads/">Notepad++</a> oder <a href="https://code.visualstudio.com/download">VSCode</a>
* Für Anfänger:innen empfehlen wir jedoch <a href="https://www.texstudio.org/">T<sub style="font-size: 100%; margin-left: -.1em">E</sub>Xstudio</a>, da es LaTeX-spezifische Features bietet
* Ladet T<sub style="font-size: 100%; margin-left: -.1em">E</sub>Xstudio 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 <span class="emoji"></span> klickt
* Einige neue Dateien sollten nun durch das Kompilieren generiert werden
<div class="box warning">
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.
</div>

View File

@ -0,0 +1,67 @@
@slide(layout=chapter-slide)
@number
0
@title
First steps with&nbsp;L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X
@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&nbsp;a&nbsp;command&nbsp;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 L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X code into a PDF
* Depending on your operating system, different compilers are available
* Windows: <a href="https://miktex.org/download">MikT<sub style="font-size: 100%; margin-left: -.1em">E</sub>X</a>
* macOS: <a href="https://tug.org/mactex/">MacT<sub style="font-size: 100%; margin-left: -.1em">E</sub>X</a>
* Linux distributions: <a href="https://tug.org/texlive/doc/texlive-en/texlive-en.html#installation">T<sub style="font-size: 100%; margin-left: -.1em">E</sub>XLive</a>
* Debian-based distributions: run `sudo apt install texlive-full`
* other distributions: see the T<sub style="font-size: 100%; margin-left: -.1em">E</sub>XLive website
<div class="box warning">
Make sure to install the full version with all packages, if you can!
</div>
@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., <a href="https://notepad-plus-plus.org/downloads/">Notepad++</a>, <a href="https://code.visualstudio.com/download">VSCode</a>
* For beginners, <a href="https://www.texstudio.org/">T<sub style="font-size: 100%; margin-left: -.1em">E</sub>Xstudio</a> is recommended due to its LaTeX-specific features
* Download and install T<sub style="font-size: 100%; margin-left: -.1em">E</sub>Xstudio
@slide(layout=content-only)
@title
Compile the script for&nbsp;the&nbsp;first&nbsp;time
@content
* Download the project archive from the VC.
* Unzip the archive.
* Open the file `main-exercises.tex` in T<sub style="font-size: 100%; margin-left: -.1em">E</sub>Xstudio. It is located in the root directory of the archive.
* Compile `main-exercises.tex` by pressing <span class="emoji"></span>
* A few new files will be generated by the compilation.
<div class="box warning">
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.
</div>

View File

@ -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
<img class="thin-padding" src="svg/chapter-08/enumerate-crop.svg" style="margin-bottom: 0;"/>
<img class="thin-padding fragment" src="svg/chapter-08/definition-crop.svg"/>
@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
<img class="thin-padding" src="svg/chapter-08/paralist-extended-crop.svg"/>
@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)

View File

@ -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
<img class="thin-padding" src="svg/chapter-08/enumerate-english-crop.svg" style="margin-bottom: 0;"/>
<img class="thin-padding fragment" src="svg/chapter-08/definition-english-crop.svg"/>
@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
<img class="thin-padding" src="svg/chapter-08/paralist-extended-english-crop.svg"/>
@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)

View File

@ -0,0 +1,114 @@
@slide(layout=chapter-slide)
@number
12
@title
Literatur&shy;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{<quelle>}`
* ++ Zitieren einer Quelle: `\cite{<quelle>}`
* ++ Zitieren einer Seite: `\cite[S. 15]{<quelle>}`
* ++ Zitieren mit weiteren Zusätzen:<br/>`\cite[<präfix>][<suffix>]{<quelle>}`
* ++ Verweis auf die genutzte `.bib`-Datei: `\bibliography{<.bib-datei>}`
* ++ Angabe des genutzten Zitierstils: <br/>`\bibliographystyle{<zitierstil>}`
> Zwei Dinge sind unendlich. Das Universum und&nbsp;die&nbsp;Auswahl an Zitierstilen.<cite>Unbekannt</cite>
@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`.

View File

@ -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{<source>}`
* ++ Citing a source: `\cite{<source>}`
* ++ Citing a page: `\cite[p. 15]{<source>}`
* ++ Citing with additional text:<br/>`\cite[<prefix>][<suffix>]{<source>}`
* ++ Referencing the `.bib` file: `\bibliography{<.bib file>}`
* ++ Choosing a citation style: <br/>`\bibliographystyle{<citation style>}`
> Two things are infinite: the universe and&nbsp;the&nbsp;assortment of citation styles.<cite>Unknown</cite>
@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.

View File

@ -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
<table>
<tr>
<th>Quelltext</th>
<th>Ergebnis</th>
</tr>
<tr class="fragment">
<td>`\sum_{i=1}^{n}x^2`</td>
<td>$\sum_{i=1}^{n} x^2$</td>
</tr>
<tr class="fragment">
<td>`12 \leq 4 x^2 + 13`</td>
<td>$12 \leq 4 x^2 + 13$</td>
</tr>
<tr class="fragment">
<td>`{n \choose k}`</td>
<td>${n \choose k}$</td>
</tr>
</table>
@slide(layout=content-and-preview)
@title
Ausrichtung von mehreren Gleichungen
@content
Die Umgebung `align` erlaubt es, Gleichungen zum Beispiel am &hairsp;=&hairsp; 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.&thinsp;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
<table>
<tr>
<th>Quelltext</th>
<th>Ergebnis</th>
</tr>
<tr>
<td>`(x)`, `[x]`, `\lbrace x \rbrace`, `\lvert x \rvert`</td>
<td>$(x), [x], \lbrace x\rbrace, \lvert x\rvert$</td>
</tr>
<tr>
<td>`\exists`, `\forall`, `\in`, <br />`\notin`, `\infty`</td>
<td>$\exists,\forall,\in,\notin,\infty$</td>
</tr>
<tr>
<td>`\alpha`, `\beta`, `\Gamma`, <br />`\Delta`, `\varepsilon`, `\pi`</td>
<td>$\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi$</td>
</tr>
<tr>
<td>`\rightarrow`, `\leftarrow`, `\Rightarrow`, `\Leftarrow`, `\Leftrightarrow`</td>
<td>$\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow$</td>
</tr>
<tr>
<td>`(A \cup B) \cap C`</td>
<td>$(A \cup B) \cap C$</td>
</tr>
<tr>
<td>`(A \lor B) \land C`</td>
<td>$(A \lor B) \land C$</td>
</tr>
<tr>
<td>`(A \cdot B) \times C`</td>
<td>$(A \cdot B) \times C$</td>
</tr>
</table>
@slide(layout=extra-content-only)
@title
Mitwachsende Klammern
@content
<table>
<tr>
<th>Quelltext</th>
<th>Ergebnis</th>
</tr>
<tr>
<td>`\left( \frac{1}{2} \right)`</td>
<td>$\left( \frac{1}{2} \right)$</td>
</tr>
<tr>
<td>`\left[ \frac{1}{2} \right]`</td>
<td>$\left[ \frac{1}{2} \right]$</td>
</tr>
<tr>
<td>`\left\lbrace \frac{1}{2} \right\rbrace`</td>
<td>$\left\lbrace \frac{1}{2} \right\rbrace$</td>
</tr>
</table>
``` {.lang-tex .hljs}
$4 \cdot \left( \frac{1}{2} % …
```
<p style="text-align: center;">$4 \cdot \left(\frac{1}{2} +\frac{3}{ 12 \cdot \left( 2 + \frac{1}{86 \cdot \left(\frac{1}{2} + 24 \right)} \right)} \right)$</p>
@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)
```
<p data-category="Achtung!">Der Einsatz von `\limits` sollte im Fließtext vermieden werden.</p>
@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{}`.
<p style="text-align: center;">$\left\lbrace x \mid tiefe(x) \geq 20\right\rbrace$</p>
<p style="text-align: center;">$\left\lbrace x \mid \text{tiefe}(x) \geq 20\right\rbrace$</p>
``` {.lang-tex .hljs}
$\left\lbrace x \mid \text{tiefe}(x) …
```

View File

@ -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
<table>
<tr>
<th>source code</th>
<th>result</th>
</tr>
<tr class="fragment">
<td>`\sum_{i=1}^{n}x^2`</td>
<td>$\sum_{i=1}^{n} x^2$</td>
</tr>
<tr class="fragment">
<td>`12 \leq 4 x^2 + 13`</td>
<td>$12 \leq 4 x^2 + 13$</td>
</tr>
<tr class="fragment">
<td>`{n \choose k}`</td>
<td>${n \choose k}$</td>
</tr>
</table>
@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 &hairsp;=&hairsp; 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.&thinsp;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
<table>
<tr>
<th>source code</th>
<th>result</th>
</tr>
<tr>
<td>`(x)`, `[x]`, `\lbrace x \rbrace`, `\lvert x \rvert`</td>
<td>$(x), [x], \lbrace x\rbrace, \lvert x\rvert$</td>
</tr>
<tr>
<td>`\exists`, `\forall`, `\in`, <br />`\notin`, `\infty`</td>
<td>$\exists,\forall,\in,\notin,\infty$</td>
</tr>
<tr>
<td>`\alpha`, `\beta`, `\Gamma`, <br />`\Delta`, `\varepsilon`, `\pi`</td>
<td>$\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi$</td>
</tr>
<tr>
<td>`\rightarrow`, `\leftarrow`, `\Rightarrow`, `\Leftarrow`, `\Leftrightarrow`</td>
<td>$\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow$</td>
</tr>
<tr>
<td>`(A \cup B) \cap C`</td>
<td>$(A \cup B) \cap C$</td>
</tr>
<tr>
<td>`(A \lor B) \land C`</td>
<td>$(A \lor B) \land C$</td>
</tr>
<tr>
<td>`(A \cdot B) \times C`</td>
<td>$(A \cdot B) \times C$</td>
</tr>
</table>
@slide(layout=extra-content-only)
@title
Height-adapting braces
@content
<table>
<tr>
<th>source code</th>
<th>result</th>
</tr>
<tr>
<td>`\left( \frac{1}{2} \right)`</td>
<td>$\left( \frac{1}{2} \right)$</td>
</tr>
<tr>
<td>`\left[ \frac{1}{2} \right]`</td>
<td>$\left[ \frac{1}{2} \right]$</td>
</tr>
<tr>
<td>`\left\lbrace \frac{1}{2} \right\rbrace`</td>
<td>$\left\lbrace \frac{1}{2} \right\rbrace$</td>
</tr>
</table>
``` {.lang-tex .hljs}
$4 \cdot \left( \frac{1}{2} % …
```
<p style="text-align: center;">$4 \cdot \left(\frac{1}{2} +\frac{3}{ 12 \cdot \left( 2 + \frac{1}{86 \cdot \left(\frac{1}{2} + 24 \right)} \right)} \right)$</p>
@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)
```
<p data-category="Caution!">Don't use `\limits` inline.</p>
@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.
<p style="text-align: center;">$\left\lbrace x \mid frequency(x) \geq 20\right\rbrace$</p>
<p style="text-align: center;">$\left\lbrace x \mid \text{frequency}(x) \geq 20\right\rbrace$</p>
``` {.lang-tex .hljs .fragment}
$\left\lbrace x \mid \text{frequency} …
```

View File

@ -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
<img src="svg/chapter-15/beamer-orig.svg" style="width: 100%; margin: 0;"/>
@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
<img class="thin-padding" src="svg/chapter-15/prftree-crop.svg"/>
@slide(layout=content-only)
@title
Weitere nützliche Pakete
@content
<table>
<tr>
<th>Paket</th>
<th>Anwendung</th>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/xcolor"><code>xcolor</code></a></td>
<td>Machs mit Farbe</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/todonotes"><code>todonotes</code></a></td>
<td>ToDo-Markierungen und Liste der ToDos</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/pdfpages"><code>pdfpages</code></a></td>
<td>Einbinden von PDF-Dateien</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/subcaption"><code>subcaption</code></a></td>
<td>Verschachtelte Abbildungen und ausgefeilte Bildunterschriften</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/colortbl"><code>colortbl</code></a>, <a href="https://www.ctan.org/pkg/tabularx"><code>tabularx</code></a>, <a href="https://www.ctan.org/pkg/multirow"><code>multirow</code></a>, <a href="https://www.ctan.org/pkg/makecell"><code>makecell</code></a></td>
<td>Gestalten von Tabellen</td>
</tr>
</table>

View File

@ -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
<img src="svg/chapter-15/beamer-orig.svg" style="width: 100%; margin: 0;"/>
@slide(layout=content-and-preview)
@title
Drawing images
@content
`TikZ` (“TikZ ist kein Zeichenprogramm”&thinsp;&thinsp;“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
<img class="thin-padding" src="svg/chapter-15/prftree-crop.svg"/>
@slide(layout=content-only)
@title
Other useful packages
@content
<table>
<tr>
<th>Package</th>
<th>Use case</th>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/xcolor"><code>xcolor</code></a></td>
<td>colours</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/todonotes"><code>todonotes</code></a></td>
<td>todo&nbsp;annotations&nbsp;and&nbsp;index</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/pdfpages"><code>pdfpages</code></a></td>
<td>embedding PDF files</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/subcaption"><code>subcaption</code></a></td>
<td>Nested figures and fine-tuned captions</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/colortbl"><code>colortbl</code></a>, <a href="https://www.ctan.org/pkg/tabularx"><code>tabularx</code></a>, <a href="https://www.ctan.org/pkg/multirow"><code>multirow</code></a>, <a href="https://www.ctan.org/pkg/makecell"><code>makecell</code></a></td>
<td>Table tuning</td>
</tr>
</table>

View File

@ -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 <span class="emoji">👹</span>
* 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 <span class="emoji">👑</span>
@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 <span class="emoji">👣</span>
@content
* wichtig für `\input{}` sowie später für das Einbinden von Bildern und anderen Medien
* Datei- und Ordnerstruktur = Baumstruktur <span class="emoji">🌳</span>
* bei `\input{}` kann der Pfad zu einer Unterdatei relativ zur Hauptdatei angeben werden
<p data-category="Achtung!" class="fragment">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.</p>
@preview
![](svg/chapter-04/tree-crop.svg)
@slide(layout=content-and-preview-with-category)
@category
Exkurs
@title
Dateipfade angeben <span class="emoji">👣</span>
@content
<p data-category="Beispiel">`main-exercises.tex``praeamble.tex`</p>
<div class="fragment">
`./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.
</div>
@preview
![](svg/chapter-04/relative-path-crop.svg)
@slide(layout=content-and-preview-with-category)
@category
Exkurs
@title
Dateipfade angeben <span class="emoji">👣</span>
@content
<p data-category="Beispiel">`main-exercises.tex``basic-document-structure.tex` (in einem Unterordner)</p>
<div class="fragment">
`./content/basic-document-structure.tex`
</div>
@preview
![](svg/chapter-04/relative-path-subdir-crop.svg)
@slide(layout=content-and-preview-with-category)
@category
Exkurs
@title
Dateipfade angeben <span class="emoji">👣</span>
@content
<p data-category="Beispiel">`basic-functionality.tex``graphics.raw.tex`</p>
<p>(wenn `basic-functionality.tex` von `main-exercises.tex` importiert wird)</p>
<div class="fragment">
<pre>./exercises/graphics/graphics.raw.tex</pre>
<p data-category="Achtung!">Pfade sind immer relativ zum Wurzelelement, auch wenn dieses noch andere Dateien einbindet, die wiederum andere Dateien referenzieren.</p>
</div>
@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.
<div class="box warning fragment">
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.
</div>
@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.&thinsp;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?

View File

@ -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 <span class="emoji">👹</span>
* 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 <span class="emoji">👑</span>
@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 <span class="emoji">👣</span>
@content
* important for `\input{}`, but later also for other media types
* file and folder structure = tree structure <span class="emoji">🌳</span>
* with `\input{}`, you can specify the path relative to the main file
<p data-category="Caution!" class="fragment">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.</p>
@preview
![](svg/chapter-04/tree-english-crop.svg)
@slide(layout=content-and-preview-with-category)
@category
Excursion
@title
Specifying file paths <span class="emoji">👣</span>
@content
<p data-category="Example">`main-exercises.tex``praeamble.tex`</p>
<div class="fragment">
`./praeamble.tex`
A **single dot `.`** represents the current folder (in this case: `latex-skript`). It is optional, you could also write `praeamble.tex` here.
</div>
@preview
![](svg/chapter-04/relative-path-english-crop.svg)
@slide(layout=content-and-preview-with-category)
@category
Excursion
@title
Specifying file paths <span class="emoji">👣</span>
@content
<p data-category="Example">`main-exercises.tex``basic-document-structure.tex` (in a subfolder)</p>
<pre class="fragment">./content/basic-document-structure.tex</pre>
@preview
![](svg/chapter-04/relative-path-subdir-english-crop.svg)
@slide(layout=content-and-preview-with-category)
@category
Excursion
@title
Specifying file paths <span class="emoji">👣</span>
@content
<p data-category="Example">`basic-functionality.tex``graphics.raw.tex`</p>
<p>(`basic-functionality.tex` is imported into `main-exercises.tex`)</p>
<div class="fragment">
<pre>./exercises/graphics/graphics.raw.tex</pre>
<p data-category="Caution!">Paths are always relative to the root document that imports other files as fragments.</p>
</div>
@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 dont have a preamble.
<div class="box warning fragment">
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.
</div>
@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?

View File

@ -0,0 +1,211 @@
@slide(layout=chapter-slide)
@number
11
@title
Referenzen und&nbsp;Fußnoten
@slide(layout=content-and-preview)
@title
Fußnoten <span class="emoji">📎</span>
@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 dont!)
``` {.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.
<table>
<tr>
<td>`fig:` Abbildungen</td>
<td>`tbl:` Tabellen</td>
</tr>
<tr>
<td>`sec:` Abschnitte</td>
<td>`subsec:` Unter&shy;abschnitte</td>
</tr>
<tr>
<td>`ch:` Kapitel</td>
<td>`itm:` Aufzählungs&shy;elemente</td>
</tr>
<tr>
<td>`eq:` Gleichungen</td>
<td>`lst:` Quelltext&shy;listings</td>
</tr>
</table>
@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)

View File

@ -0,0 +1,213 @@
@slide(layout=chapter-slide)
@number
11
@title
References and&nbsp;footnotes
@slide(layout=content-and-preview)
@title
Footnotes <span class="emoji">📎</span>
@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 dont!)
``` {.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.
<table>
<tr>
<td>`fig:` Figures</td>
<td>`tbl:` Tables</td>
</tr>
<tr>
<td>`sec:` Sections</td>
<td>`subsec:` Subsections</td>
</tr>
<tr>
<td>`ch:` Chapters</td>
<td>`itm:` Enumeration items</td>
</tr>
<tr>
<td>`eq:` Equations</td>
<td>`lst:` Source code listings</td>
</tr>
</table>
@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)

View File

@ -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.

View File

@ -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.&thinsp;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.

View File

@ -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
<table>
<tr>
<th></th>
<th>Name</th>
<th>Verwendung</th>
<th>Code</th>
</tr>
<tr>
<td>-</td>
<td>Bindestrich *(hypen)*</td>
<td>LaTeX-Wochenende</td>
<td>`-`</td>
</tr>
<tr>
<td></td>
<td>Halbgeviert&shy;strich<br />*(en dash)*</td>
<td>als Gedankenstrich oder als Bis-Strich: 10&hairsp;&hairsp;12 Uhr.</td>
<td>`--`</td>
</tr>
<tr>
<td></td>
<td>Geviertstrich<br />*(em dash)*</td>
<td>a dash&hairsp;&hairsp;mostly in American English</td>
<td>`---`</td>
</tr>
</table>
@preview
![](svg/chapter-05/striche-crop.svg)
@slide(layout=content-and-preview)
@title
Zitate
@content
Das Paket `csquotes` stellt u.&thinsp;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! <span class="emoji">⛑️</span>
* 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
<div class="box warning">
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).
</div>
* 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&nbsp;spacing,* also&nbsp;doppelte Leerzeichen nach dem Satzende.
Das kann mit `\frenchspacing` vor dem ersten Absatz verhindert werden. `\nonfrenchspacing` schaltet wieder zurück.
Bei *English&nbsp;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.
<table>
<tr>
<td>Ausschließliche Trennung</td>
<td>`\-`</td>
</tr>
<tr>
<td>Zusätzliche Trennstelle</td>
<td>`"-`</td>
</tr>
<tr>
<td>Bindestrich (verbietet andere Trennstellen)</td>
<td>`-`</td>
</tr>
<tr>
<td>Bindestrich (erlaubt andere Trennstellen)</td>
<td>`"=`</td>
</tr>
<tr>
<td>Trennstelle ohne Strich</td>
<td>`""`</td>
</tr>
<tr>
<td>Strich ohne Trennstelle</td>
<td>`"~`</td>
</tr>
</table>
<p data-category="Achtung!">Einige der Codes funktionieren nur mit eingebundenem `babel`-Paket.</p>
@preview
![](svg/chapter-05/silbentrennung-crop.svg)
@slide(layout=extra-content-only)
@title
Anführungszeichen
@content
<table>
<tr>
<th>Sprache</th>
<th style="text-align: center;">Befehl</th>
<th style="text-align: center;">Ergebnis</th>
</tr>
<tr>
<td>Deutsch</td>
<td style="text-align: center;">`\glqq … \grqq`</td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>&emsp;2. Ebene</td>
<td style="text-align: center;">` \glq … \grq `</td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>Deutsch altern.</td>
<td style="text-align: center;">`\frqq … \flqq`</td>
<td style="text-align: center;">»&hairsp;&hairsp;«</td>
</tr>
<tr>
<td>&emsp;2. Ebene</td>
<td style="text-align: center;">` \frq … \flq `</td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>Englisch (A.&thinsp;E.)</td>
<td style="text-align: center;"><code>\`\`…\'\'</code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>&emsp;2. Ebene</td>
<td style="text-align: center;"><code> \`…\' </code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>Englisch (B.&thinsp;E.)</td>
<td style="text-align: center;"><code> \`…\' </code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>&emsp;2. Ebene</td>
<td style="text-align: center;"><code>\`\`…\'\'</code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
</table>
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:
<table>
<tr>
<td><code>\\\`{o}</code></td><td>ò&emsp;&emsp;</td>
<td>`\c{c}`</td> <td>ç&emsp;&emsp;</td>
<td>`\d{u}`</td> <td></td>
</tr>
<tr>
<td>`\'{o}`</td> <td>ó</td>
<td>`\k{a}`</td> <td>ą</td>
<td>`\r{a}`</td> <td>å</td>
</tr>
<tr>
<td>`\^{o}`</td> <td>ô</td>
<td>`\l{}`</td> <td>ł</td>
<td>`\u{o}`</td> <td>ŏ</td>
</tr>
<tr>
<td>`\"{o}`</td> <td>ö</td>
<td>`\={o}`</td> <td>ō</td>
<td>`\v{s}`</td> <td>š</td>
</tr>
<tr>
<td>`\H{o}`</td> <td>ő</td>
<td>`\b{o}`</td> <td>o</td>
<td>`\t{oo}`</td><td>o͡o</td>
</tr>
<tr>
<td>`\~{o}`</td> <td>õ</td>
<td>`\.{o}`</td> <td>ȯ</td>
<td>`\o`</td> <td>ø</td>
</tr>
</table>
@slide(layout=extra-content-only)
@title
Sonderzeichen & Symbole
@content
Auch andere Sonderzeichen können entweder direkt eingegeben werden oder per Befehl:
<table>
<tr>
<td style="text-align: center;">¿</td> <td><code>?\`</code></td>
<td style="text-align: center;">¡</td> <td><code>!\`</code></td>
</tr>
<tr>
<td style="text-align: center;">^</td> <td>`\textasciicircum`</td>
<td style="text-align: center;">~</td> <td>`\textasciitilde`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textasteriskcentered`</td>
<td style="text-align: center;">\\</td> <td>`\textbackslash`</td>
</tr>
<tr>
<td style="text-align: center;">|</td> <td>`\textbar`</td>
<td style="text-align: center;"></td> <td>`\textbullet`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textcopyright`</td>
<td style="text-align: center;"></td> <td>`\textdagger`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textdaggerdbl`</td>
<td style="text-align: center;"></td> <td>`\textellipsis`</td>
</tr>
<tr>
<td style="text-align: center;">&lt;</td> <td>`\textless`</td>
<td style="text-align: center;">&gt;</td> <td>`\textgreater`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textperthousand`</td>
<td style="text-align: center;">§</td> <td>`\textsection`</td>
</tr>
</table>
… und so ziemlich alles andere.

View File

@ -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
<table>
<tr>
<th></th>
<th>Name</th>
<th>Use</th>
<th>Code</th>
</tr>
<tr>
<td>-</td>
<td>Hyphen</td>
<td>compound-forming hyphen</td>
<td>`-`</td>
</tr>
<tr>
<td></td>
<td>En dash *(Halbgeviert&shy;strich)*</td>
<td>a dash or a range: 12&hairsp;&hairsp;2 p.m.</td>
<td>`--`</td>
</tr>
<tr>
<td></td>
<td>Em dash *(Geviertstrich)*</td>
<td>a dash&hairsp;&hairsp;mostly in American English</td>
<td>`---`</td>
</tr>
</table>
@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! <span class="emoji">⛑️</span>
* 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
<div class="box warning">
From now on, compile the file `main-exercises.tex` to see your changes appear in the exercise script (in this task, see exercise 5).
</div>
* Replace the spaces in `exercises/special-characters.tex` within the abbreviations (“e.&thinsp;g.”, “i.&thinsp;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&nbsp;spacing,* i.&thinsp;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&nbsp;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.
<table>
<tr>
<td>Exclusive hyphenation</td>
<td>`\-`</td>
</tr>
<tr>
<td>Additional hyphenation</td>
<td>`"-`</td>
</tr>
<tr>
<td>Hyphen (suppressing other hyphenation)</td>
<td>`-`</td>
</tr>
<tr>
<td>Hyphen (allowing other hyphenation)</td>
<td>`"=`</td>
</tr>
<tr>
<td>Possible separation without hyphen</td>
<td>`""`</td>
</tr>
<tr>
<td>Non-breaking hyphen</td>
<td>`"~`</td>
</tr>
</table>
<p data-category="Caution!">Some of the codes only work when you use the `babel` package.</p>
@preview
![](svg/chapter-05/hyphenation-crop.svg)
@slide(layout=extra-content-only)
@title
Manual quotation
@content
<table>
<tr>
<th>Language</th>
<th style="text-align: center;">Command</th>
<th style="text-align: center;">Result</th>
</tr>
<tr>
<td>English (B.&thinsp;E.)</td>
<td style="text-align: center;"><code> \`…\' </code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>&emsp;2nd Level</td>
<td style="text-align: center;"><code>\`\`…\'\'</code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>English (A.&thinsp;E.)</td>
<td style="text-align: center;"><code>\`\`…\'\'</code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>&emsp;2nd Level</td>
<td style="text-align: center;"><code> \`…\' </code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>German</td>
<td style="text-align: center;">`\glqq … \grqq`</td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>&emsp;2nd Level</td>
<td style="text-align: center;">` \glq … \grq `</td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>German altern.</td>
<td style="text-align: center;">`\frqq … \flqq`</td>
<td style="text-align: center;">»&hairsp;&hairsp;«</td>
</tr>
<tr>
<td>&emsp;2nd Level</td>
<td style="text-align: center;">` \frq … \flq `</td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
</table>
Other rules my apply for other languages, but most of the time its 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:
<table>
<tr>
<td><code>\\\`{o}</code></td><td>ò&emsp;&emsp;</td>
<td>`\c{c}`</td> <td>ç&emsp;&emsp;</td>
<td>`\d{u}`</td> <td></td>
</tr>
<tr>
<td>`\'{o}`</td> <td>ó</td>
<td>`\k{a}`</td> <td>ą</td>
<td>`\r{a}`</td> <td>å</td>
</tr>
<tr>
<td>`\^{o}`</td> <td>ô</td>
<td>`\l{}`</td> <td>ł</td>
<td>`\u{o}`</td> <td>ŏ</td>
</tr>
<tr>
<td>`\"{o}`</td> <td>ö</td>
<td>`\={o}`</td> <td>ō</td>
<td>`\v{s}`</td> <td>š</td>
</tr>
<tr>
<td>`\H{o}`</td> <td>ő</td>
<td>`\b{o}`</td> <td>o</td>
<td>`\t{oo}`</td><td>o͡o</td>
</tr>
<tr>
<td>`\~{o}`</td> <td>õ</td>
<td>`\.{o}`</td> <td>ȯ</td>
<td>`\o`</td> <td>ø</td>
</tr>
</table>
@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:
<table>
<tr>
<td style="text-align: center;">¿</td> <td><code>?\`</code></td>
<td style="text-align: center;">¡</td> <td><code>!\`</code></td>
</tr>
<tr>
<td style="text-align: center;">^</td> <td>`\textasciicircum`</td>
<td style="text-align: center;">~</td> <td>`\textasciitilde`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textasteriskcentered`</td>
<td style="text-align: center;">\\</td> <td>`\textbackslash`</td>
</tr>
<tr>
<td style="text-align: center;">|</td> <td>`\textbar`</td>
<td style="text-align: center;"></td> <td>`\textbullet`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textcopyright`</td>
<td style="text-align: center;"></td> <td>`\textdagger`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textdaggerdbl`</td>
<td style="text-align: center;"></td> <td>`\textellipsis`</td>
</tr>
<tr>
<td style="text-align: center;">&lt;</td> <td>`\textless`</td>
<td style="text-align: center;">&gt;</td> <td>`\textgreater`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textperthousand`</td>
<td style="text-align: center;">§</td> <td>`\textsection`</td>
</tr>
</table>
… and pretty much anything else.

View File

@ -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 &raquo;Comprehensive TeX Archive Network&laquo; 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 <a href="https://www.overleaf.com/templates">&raquo;Templates&laquo;</a> 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!
<p><span style="display: inline-block; width: 2em;" class="emoji">📍</span>WE5/02.104 <br/>
<span style="display: inline-block; width: 2em;" class="emoji">☎️</span>0951 863 1219 <br/>
<span style="display: inline-block; width: 2em;" class="emoji">📧</span><a href="mailto:fachschaft-wiai.stuve@uni-bamberg.de">fachschaft-wiai.stuve@uni-bamberg.de</a>
</p>
<img src="images/logo-fachschaft.jpg" style="width:40%; margin: 0 auto; margin-top: 2em;
display:block;"/>
@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
<img src="svg/chapter-16/fooboar-latex-tut.jpg" style="width:100%; margin:0 auto; display: block;"/>

View File

@ -0,0 +1,104 @@
@slide(layout=chapter-slide)
@number
15
@title
Getting help and&nbsp;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, …): <a href="https://www.overleaf.com/templates">»Templates«</a>.
![](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&nbsp;come over or write us an e-mail!
<p><span style="display: inline-block; width: 2em;" class="emoji">📍</span>WE5/02.104 <br/>
<span style="display: inline-block; width: 2em;" class="emoji">☎️</span>0951 863 1219 <br/>
<span style="display: inline-block; width: 2em;" class="emoji">📧</span><a href="mailto:fachschaft-wiai.stuve@uni-bamberg.de">fachschaft-wiai.stuve@uni-bamberg.de</a>
</p>
<img src="images/logo-fachschaft.jpg" style="width:40%; margin: 0 auto; margin-top: 2em;
display:block;"/>
@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
<img src="svg/chapter-16/fooboar-latex-tut.jpg" style="width:100%; margin:0 auto; display: block;" />

View File

@ -0,0 +1,233 @@
@slide(layout=chapter-slide)
@number
10
@title
Tabellen
@slide(layout=content-only)
@title
Grundstruktur <span class="emoji">🗒️</span>
@content
Für typografisch schöne Tabellen nutzen wir das Paket `booktabs`.
``` {.hljs .lang-tex}
\usepackage{booktabs}
```
``` {.hljs .lang-tex}
\begin{table}[<position>]
\begin{tabular}{<spaltendefinition>}
% Tabelleninhalt
\end{tabular}
\caption{<tabellenunterschrift>}
\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}
```
<table>
<tr>
<th>Kürzel</th>
<th>Bedeutung</th>
</tr>
<tr class="fragment">
<td>l</td>
<td>linksbündige Spalte</td>
</tr>
<tr class="fragment">
<td>c</td>
<td>zentrierte Spalte</td>
</tr>
<tr class="fragment">
<td>r</td>
<td>rechtsbündige Spalte</td>
</tr>
</table>
++ 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}
```
<p data-category="Hinweis">Mit `@{}` vor und nach einer Spaltendefinition wird der umgebende Weißraum unterdrückt.</p>
<p data-category="Beispiel">`\begin{tabular}{@{}lrcl@{}}` beschränkt die Linien auf die Breite des Tabelleninhalts.</p>
@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}{<spaltendefinition>}
% Tabelleninhalt
\caption{<tabellenunterschrift>}
\label{<label>}
\end{longtable}
```
@slide(layout=extra-content-only)
@title
Hinweise zu `longtable`
@content
``` {.hljs .lang-tex}
\begin{longtable}{<spaltendefinition>}
% Tabelleninhalt
\caption{<tabellenunterschrift>}
\label{<label>}
\end{longtable}
```
* Die `longtable`-Umgebung vereint die `tabular`-Umgebung und die `table`-Umgebung.
* Titel und Label können deshalb direkt unter dem Tabelleninhalt stehen.
* Sofern das Paket `booktabs` eingebunden ist, stehen seine Features auch in `longtable` zur Verfügung.
@slide(layout=extra-content-only)
@title
Besonders breite Tabellen
@content
Sollte die Tabelle einmal zu breit für eine Seite werden, kann sie auch im Querformat dargestellt werden:
``` {.hljs .lang-tex}
\usepackage{rotating}
```
``` {.hljs .lang-tex}
\begin{sidewaystable}[<position>]
\begin{tabular}{<spaltendef.>}
% Tabelleninhalt
\end{tabular}
\end{sidewaystable}
```
@slide(layout=extra-content-and-preview)
@title
Weiterführendes Beispiel
@content
``` {.hljs .lang-tex}
\begin{table}[h]
\begin{tabular}{llr}
\toprule
Struktur & \multicolumn{2}{l}{Zeitkomplexität für Zugriff} \\ \cmidrule(r){2-3}
& Average & Worst \\
\midrule
Stack & $\mathcal{O}(n)$ & $\mathcal{O}(n)$ \\
Binärbaum & $\mathcal{O}(log(n))$ & $\mathcal{O}(log(n))$ \\
AVL-Baum & $\mathcal{O}(log(n))$ & $\mathcal{O}(log(n))$ \\
\bottomrule
\end{tabular}
\end{table}
```
[<span class="emoji">🔗</span> Dokumentation zu Booktabs](http://packages.oth-regensburg.de/ctan/macros/latex/contrib/booktabs/booktabs.pdf)
@preview
![](svg/chapter-12/tabelle-fortgeschritten-beispiel-crop.svg){.thin-padding}

View File

@ -0,0 +1,236 @@
@slide(layout=chapter-slide)
@number
10
@title
Tables
@slide(layout=content-only)
@title
Basic structure <span class="emoji">🗒️</span>
@content
For typographically pleasing tables, we use the `booktabs` package.
``` {.hljs .lang-tex}
\usepackage{booktabs}
```
``` {.hljs .lang-tex}
\begin{table}[<position>]
\begin{tabular}{<column definition>}
% table content
\end{tabular}
\caption{<caption>}
\end{table}
```
Positioning works just like with graphics.
@slide(layout=content-and-preview)
@title
Column definitions
@content
``` {.hljs .lang-tex}
\begin{tabular}{lrcl}
% table content
\end{tabular}
```
<table>
<tr>
<th>letter</th>
<th>meaning</th>
</tr>
<tr class="fragment">
<td>l</td>
<td>left-justified column</td>
</tr>
<tr class="fragment">
<td>c</td>
<td>centred column</td>
</tr>
<tr class="fragment">
<td>r</td>
<td>right-justified column</td>
</tr>
</table>
++ Vertical separator lines and double horizontal lines are frowned upon by typographers and should be avoided.
@preview
![](svg/chapter-12/table-example-crop.svg){.thin-padding}
@slide(layout=content-and-preview)
@title
Table content
@content
``` {.hljs .lang-tex}
\begin{tabular}{lll}
\toprule
Column 1 & Column 2 & Column 3 \\
\midrule
Content a & Content b & Content c \\
Content e & Content f & Content g \\
Content i & Content j & Content k \\
\bottomrule
\end{tabular}
```
* ++ Columns are separated by `&`.
* ++ Rows are ended by `\\`.
* ++ `\toprule`, `\midrule` and `\bottomrule` structure the table.
@preview
![](svg/chapter-12/table-content-example-crop.svg){.thin-padding}
@slide(layout=wide-content)
@title
The entire table
@content
``` {.hljs .lang-tex}
\begin{table}[h]
\begin{tabular}{lrcl}
\toprule
Language & Author & Year & Filename extension \\
\midrule
C++ & Bjarne Stroustrup & 1985 & .cpp \\
Java & James Gosling & 1998 & .java \\
Python & Guido van Rossum & 1991 & .py \\
\bottomrule
\end{tabular}
\caption{Well-known programming languages}
\end{table}
```
<p data-category="Note">`@{}` to the left and right of a column definition removes the padding of the corresponding column.</p>
<p data-category="Example">`\begin{tabular}{@{}lrcl@{}}` limits the row separators to the width of the table content</p>
@slide(layout=content-only)
@title
More comfort
@content
The [Tables Generator](https://tablesgenerator.com/) is a wonderful tool to quickly create tables of different formats.
[![](svg/chapter-12/tables-generator.png)](https://tablesgenerator.com/)
@slide(layout=task)
@task-number
10
@title
Typesetting tables
@content
* The list in file `exercises/tables/tables.tex` stores information on a few modules of the WIAI faculty.
* Transform the list into a **table**.
* The table shall have colums for the *name*, the *abbreviation* (Kürzel) and the *semester* of the lectures.
* Add a **column** with **center-aligned text** on the left side of the table in order to **number** the lectures.
* Add a **caption** for the table.
@slide(layout=extra-content-only)
@title
Particularly long tables
@content
Tables that exceed one page are simply cut off by `tabular`. A solution is offered by the `longtable` package:
``` {.hljs .lang-tex}
\usepackage{longtable}
```
``` {.hljs .lang-tex}
\begin{longtable}{<column definition>}
% table content
\caption{<caption>}
\label{<label>}
\end{longtable}
```
@slide(layout=extra-content-only)
@title
Notes on `longtable`
@content
``` {.hljs .lang-tex}
\begin{longtable}{<column definition>}
% table content
\caption{<caption>}
\label{<label>}
\end{longtable}
```
* The `longtable` environment merges the `tabular` and `table` environments.
* Caption and label can therefore be inserted directly under the table content.
* As long as the `booktabs` package is used, its features are also provided in `longtable`.
@slide(layout=extra-content-only)
@title
Particularly wide tables
@content
If you need a table to be wider than a page, you can display it in landscape orientation:
``` {.hljs .lang-tex}
\usepackage{rotating}
```
``` {.hljs .lang-tex}
\begin{sidewaystable}[<position>]
\begin{tabular}{<column def.>}
% table content
\end{tabular}
\end{sidewaystable}
```
@slide(layout=extra-content-and-preview)
@title
An advanced example
@content
``` {.hljs .lang-tex}
\begin{table}[h]
\begin{tabular}{llr}
\toprule
Structure & \multicolumn{2}{l}{Access time complexity} \\ \cmidrule(r){2-3}
& Average & Worst \\
\midrule
Stack & $\mathcal{O}(n)$ & $\mathcal{O}(n)$ \\
Binary tree & $\mathcal{O}(log(n))$ & $\mathcal{O}(n)$ \\
AVL tree & $\mathcal{O}(log(n))$ & $\mathcal{O}(log(n))$ \\
\bottomrule
\end{tabular}
\end{table}
```
[<span class="emoji">🔗</span> Booktabs documentation](http://packages.oth-regensburg.de/ctan/macros/latex/contrib/booktabs/booktabs.pdf)
@preview
![](svg/chapter-12/table-advanced-example-crop.svg){.thin-padding}

View File

@ -0,0 +1,172 @@
@slide(layout=chapter-slide)
@number
6
@title
Text&shy;auszeichnung
@slide(layout=content-and-preview)
@title
Semantische und optische Hervorhebungen
@content
Semantische Hervorhebungen durch `\emph{}`:
``` {.lang-tex .hljs}
\emph{Super wichtiger Text \emph{mit noch
wichtigerem Text} im Text.}
```
Optische Auszeichnungsmöglichkeiten:
<table>
<tr><th>Bezeichnung</th><th>Befehl</th></tr>
<tr><td>fett (bold face)</td><td>`\textbf{wichtig}`</td></tr>
<tr><td>kursiv (italics)</td><td>`\textit{wichtig}`</td></tr>
<tr><td>Kapitälchen (small&nbsp;caps)</td><td>`\textsc{wichtig}`</td></tr>
<tr><td>dicktengleich (teletype)</td><td>`\texttt{wichtig}`</td></tr>
<tr><td>unterstrichen</td><td>`\underline{wichtig}`</td></tr>
</table>
@preview
<img class="thin-padding" src="svg/chapter-06/hervorhebungen-crop.svg" style="margin-bottom: 0; margin-top: 100px"/>
<img class="thin-padding" src="svg/chapter-06/optische-auszeichnungen-crop.svg" />
@slide(layout=content-only)
@title
Better Call LaTeX!
@content
<div class="box warning">
**Ein gutgemeinter Rat**
Konsistentes Aussehen über das gesamte Dokument hinweg gewünscht?
Voreinstellungen von LaTeX zur Schriftgröße verschiedener Textelemente (Titel, Fließtext, Fußnoten) vertrauen!
Das heißt im Umkehrschluss: Möglichst wenig manuell an Schriftgrößen herumschrauben.
</div>
@slide(layout=content-and-preview)
@title
URLs
@content
Das Paket `hyperref` stellt den Befehl `\url{}` bereit, der URLs
* zeichentreu
* mit bindestrichlosen Umbrüchen
* mit gut unterscheidbaren Zeichen
* im PDF anklickbar
wiedergibt.
``` {.lang-tex .hljs}
\url{https://www.latex-project.org/}
```
@preview
![](svg/chapter-06/url-crop.svg)
@slide(layout=task)
@task-number
6
@title
Text hervorheben
@content
* **Betont** in der Datei `exercises/text-markup/markup.tex` die Wörter *Recursion* und *recursive* mit `\emph{…}`.
* Macht die **URL** im Text anklickbar.
@slide(layout=extra-content-and-preview)
@title
Schriftgröße
@content
### Voreingestellte Schriftgrößen
``` {.hljs .lang-tex}
{\<fontsize> ein Textabschnitt}
```
Schriftgrößen relativ zu `normalsize`:
``` {.hljs .lang-tex}
{\tiny Wenn}
{\footnotesize du}
{\small das}
{\normalsize lesen}
{\large kannst,}
{\Large brauchst}
{\LARGE du}
{\huge keine}
{\Huge Brille.}
```
@preview
![](svg/chapter-06/schriftgroesse-optiker-crop.svg){.thin-padding}
@slide(layout=extra-content-and-preview)
@title
Flattersatz
@content
Standardmäßig setzt LaTeX Fließtext im Blocksatz, aber auch Flattersatz ist möglich.
``` {.lang-tex .hljs}
\raggedright … \raggedleft …
\centering …
```
Alternativ einsetzbare Umgebungen:
``` {.lang-tex .hljs}
\begin{flushleft} Text \end{flushleft}
\begin{flushright} Text \end{flushright}
\begin{center} Text \end{center}
```
<p data-category="Achtung!">Guter Flattersatz ist noch schwieriger als guter Blocksatz, daher lieber vermeiden!</p>
@preview
![](svg/chapter-07/ausrichtung-crop.svg)
@slide(layout=extra-content-and-preview)
@title
Einzüge und Abstände
@content
* Absätze werden standardmäßig durch Erstzeileneinzüge (`\parindent`) verdeutlicht
* Stattdessen (!) können auch Abstände (`\parskip`) verwendet werden
* Die beiden Parameter sind beliebig einstellbar:
``` {.lang-tex .hljs}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1em
plus .5em % erlaubte Dehnung
minus .5em % erlaubte Stauchung
}
```
* Mit `\noindent` kann für nur einen Absatz der Einzug abgeschaltet werden
@preview
![](./svg/chapter-07/einzüge-abstände-orig.svg)

View File

@ -0,0 +1,172 @@
@slide(layout=chapter-slide)
@number
6
@title
Text Markup
@slide(layout=content-and-preview)
@title
Emphases
@content
Continuous text can be emphasized with `\emph{}`:
``` {.lang-tex .hljs}
\emph{Emphasize important
\emph{and even more important} text}
```
Furthermore, optical highlighting can be used.
<table>
<tr><th>Name</th><th>Befehl</th></tr>
<tr><td>Bold (bold face)</td><td>`\textbf{important}`</td></tr>
<tr><td>Italics (italics)</td><td>`\textit{important}`</td></tr>
<tr><td>Small caps</td><td>`\textsc{important}`</td></tr>
<tr><td>non-proportional (teletype)</td><td>`\texttt{important}`</td></tr>
<tr><td>underlined</td><td>`\underline{important}`</td></tr>
</table>
@preview
<img class="thin-padding" src="svg/chapter-06/emphases-crop.svg" style="margin-bottom: 0;"/>
<img class="thin-padding fragment" src="svg/chapter-06/optical-highlighting-crop.svg"/>
@slide(layout=content-only)
@title
Better Call LaTeX!
@content
<div class="box warning">
**Some well-meaning advice**
You want the entire document to look consistent?
Trust LaTeXs defaults (font sizes of title, paragraphs, footnotes, etc.)!
This conversely means: Avoid fiddling around with font sizes manually.
</div>
@slide(layout=content-and-preview)
@title
URLs
@content
The `hyperref` package provides an `\url{}` command that reproduces URLs
* letter by letter
* using line breaks without hyphens
* using a font with well-distinguishable characters
* as a clickable link in the PDF
``` {.lang-tex .hljs}
\url{https://www.latex-project.org/}
```
@preview
![](svg/chapter-06/url-crop.svg)
@slide(layout=task)
@task-number
6
@title
Emphasising text
@content
* **Emphasise** the words *Recursion* and *recursive* in `exercises/text-markup/markup.tex` using `\emph{…}`.
* Make the **URL** in the text clickable.
* Of course, you can also experiment with the other **text markup** possibilities. However, remove them afterwards, if you want to have a clean document.
@slide(layout=extra-content-and-preview)
@title
Font size
@content
### Preset font sizes
``` {.hljs .lang-tex}
{\<fontsize> some text}
```
Font sizes relative to `normalsize`:
``` {.hljs .lang-tex}
{\tiny If}
{\footnotesize you}
{\small can}
{\normalsize read}
{\large this,}
{\Large you}
{\LARGE dont}
{\huge need}
{\Huge glasses.}
```
@preview
![](svg/chapter-06/font-size-optician-crop.svg){.thin-padding}
@slide(layout=extra-content-and-preview)
@title
Ragged alignment
@content
By default, LaTeX sets text in full justification, but it is possible to activate ragged alignment.
``` {.lang-tex .hljs}
\raggedright … \raggedleft …
\centering …
```
Alternatively, we can use dedicated environments:
``` {.lang-tex .hljs}
\begin{flushleft} Text \end{flushleft}
\begin{flushright} Text \end{flushright}
\begin{center} Text \end{center}
```
<p data-category="Caution!">Proper ragged alignment is even more difficult than good justification, so better avoid it.</p>
@preview
![](svg/chapter-07/ausrichtung-crop.svg)
@slide(layout=extra-content-and-preview)
@title
Indentation and spacing
@content
* paragraphs are usually indicated by first-line indentation (`\parindent`)
* we can decide to use paragraph spacing (`\parskip`) instead (!)
* both parameters are customisable:
``` {.lang-tex .hljs}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1em
plus .5em % permitted stretch
minus .5em % permitted compression
}
```
* `\noindent` allows us to disable first-line indentation for a given paragraph
@preview
![](./svg/chapter-07/indentation-spacing-orig.svg)

View File

@ -0,0 +1,8 @@
@slide(layout=titlepage)
@presentation-title
L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X-Wochenende
@subscript
Ein Workshop der Fachschaft WIAI. Präsentiert von Evelyn&nbsp;Fradtschuk, Jessica&nbsp;Klarmann, Florian&nbsp;Knoch, Theresa&nbsp;Knoll, Christian&nbsp;Kremitzl, Bernhard&nbsp;Luedtke und Jochen&nbsp;Mehlich.

View File

@ -0,0 +1,8 @@
@slide(layout=titlepage)
@presentation-title
L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X Weekend
@subscript
A Fachschaft WIAI workshop. Presented by Evelyn&nbsp;Fradtschuk, Jessica&nbsp;Klarmann, Florian&nbsp;Knoch, Theresa&nbsp;Knoll, Christian&nbsp;Kremitzl, Fabian&nbsp;Lamprecht, Bernhard&nbsp;Luedtke and Jochen&nbsp;Mehlich.

View File

@ -0,0 +1,128 @@
@slide(layout=chapter-slide)
@number
1
@title
Was ist L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X?
@slide(layout=content-and-preview)
@title
Entstehung
@content
* Donald **Knuth**, 19771986: Textsatzsystem **TeX**<span class="bubble fragment">τεχ → /tɛç/</span> für The Art of Computer Programming
* Leslie **Lamport**, ab 1980er: Softwarepaket **LaTeX** zur einfacheren Benutzung von TeX
<div style="display: flex; justify-content: space-between; align-items: stretch;">
<figure><img src="svg/chapter-01/knuth.jpg" style="height: 13em"/><figcaption>Donald Knuth</figcaption></figure>
<figure><img src="svg/chapter-01/lamport.jpg" style="height: 13em"/><figcaption>Leslie Lamport</figcaption></figure>
</div>
@preview
![](svg/chapter-01/taocp.jpg)
@slide(layout=macro-typography-grid)
@title
Gründe für LaTeX: Makrotypografie
@example-text
Dieser Absatz soll zeigen, wie sich unter&shy;schied&shy;liche Zeilen&shy;abstände bei unter&shy;schied&shy;lichen Satz&shy;breiten aus&shy;wirken. Dazu ist hier noch ein bisschen mehr Text nötig, damit das auch wirklich nach einem Absatz aussieht. Dazu ist hier noch ein bisschen mehr Text nötig, damit das auch wirklich nach einem Absatz aussieht. Dazu ist hier noch ein bisschen mehr Text nötig, damit das auch wirklich nach einem Absatz aussieht. Dazu ist hier noch ein bisschen mehr Text nötig, damit das auch wirklich nach einem Absatz aussieht. Dazu ist hier noch ein bisschen mehr Text nötig, damit das auch wirklich nach einem Absatz aussieht. Dazu ist hier noch ein bisschen mehr Text nötig, damit das auch wirklich nach einem Absatz aussieht. Dazu ist hier noch ein bisschen mehr Text nötig, damit das auch wirklich nach einem Absatz aussieht.
@narrow-tight
Kurz und eng
@normal-tight
Normale Länge und enger Zeilenabstand
@wide-tight
Lange Zeilen und enger Zeilenabstand
@narrow-medium
Kurz und normal
@normal-medium
Normale Länge und Zeilenabstand
@wide-medium
Lange Zeilen und normaler Zeilenabstand
@narrow-loose
Kurz und weit
@normal-loose
Normale Länge und weiter Zeilenabstand
@wide-loose
Lange Zeilen und weiter Zeilenabstand
@slide(layout=micro-typography-grid)
@title
Gründe für LaTeX: Mikrotypografie
@example1a
schräg (verzerrt)
@example1b
gerade
@example1c
kursiv (eigener Schnitt)
@example2a
kleine Schrift vergrößert
@example2b
jeweils passender Schriftgrad
@example2c
große Schrift verkleinert
@slide(layout=content-only)
@title
Gründe für LaTeX: Plaintext
@content
* zuverlässiges Undo
* einfache Versionierung
* unabhängig von proprietären Programmen
* Quelltext langfristig lesbar
* einfache Zusammenarbeit mit anderen Programmen
* keine Ablenkung durch Formatierung oder eingebettete Medien
@slide(layout=content-and-preview)
@title
Ablauf des Workshops
@content
**Ziel:** Wir arbeiten zusammen unser [LaTeX-Skript](https://github.com/fs-wiai/latex-script/) durch, das ihr nach dem Workshop als kompakte Referenz verwenden könnt.
* Learning by Doing
* Verstehen, wie LaTeX funktioniert
* Einzelheiten später nachschlagen
<div class="fragment">
**Gliederung:**
1. ~~Was ist LaTeX?~~
2. Wie funktioniert LaTeX?
3. Grundstruktur eines LaTeX-Dokuments
4. Projektstruktur
5. Viele Features
6. Literaturverwaltung
7. Ausblick
</div>
@preview
![](svg/chapter-01/cover-script.jpeg)

View File

@ -0,0 +1,127 @@
@slide(layout=chapter-slide)
@number
1
@title
What is L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X?
@slide(layout=content-and-preview)
@title
Origin
@content
* Donald **Knuth**, 19771986: typesetting system **TeX**<span class="bubble fragment" style="margin-top: -3em;">τεχ → /tɛç, tɛx, tɛk/</span> for The Art of Computer Programming
* Leslie **Lamport**, from 1980s: software package **LaTeX** made TeX easier to use
<div style="display: flex; justify-content: space-between; align-items: stretch;">
<figure><img src="svg/chapter-01/knuth.jpg" style="height: 13em"/><figcaption>Donald Knuth</figcaption></figure>
<figure><img src="svg/chapter-01/lamport.jpg" style="height: 13em"/><figcaption>Leslie Lamport</figcaption></figure>
</div>
@preview
![](svg/chapter-01/taocp.jpg)
@slide(layout=macro-typography-grid)
@title
Reasons for using LaTeX: macrotypography
@example-text
This paragraph shows the effect of varied line heights in combination with varied line lengths. For this purpose, a little more text is needed to make it look like an actual paragraph. For this purpose, a little more text is needed to make it look like an actual paragraph. For this purpose, a little more text is needed to make it look like an actual paragraph. For this purpose, a little more text is needed to make it look like an actual paragraph. For this purpose, a little more text is needed to make it look like an actual paragraph. For this purpose, a little more text is needed to make it look like an actual paragraph. For this purpose, a little more text is needed to make it look like an actual paragraph. For this purpose, a little more text is needed to make it look like an actual paragraph.
@narrow-tight
short & tight
@normal-tight
normal length and tight leading
@wide-tight
long lines and tight leading
@narrow-medium
short & medium
@normal-medium
normal length and leading
@wide-medium
long lines and medium leading
@narrow-loose
short & loose
@normal-loose
normal length and loose leading
@wide-loose
long lines and loose leading
@slide(layout=micro-typography-grid)
@title
Reasons for using LaTeX: microtypography
@example1a
slanted (distorted)
@example1b
straight
@example1c
italic (separate font)
@example2a
small font scaled up
@example2b
separate appropriate fonts
@example2c
big font scaled down
@slide(layout=content-only)
@title
Reasons for using LaTeX: plaintext
@content
* reliable undo
* easy versioning
* independence of proprietary software
* source code readable in the long term
* easy cooperation with other software
* no distraction by formatting or embedded media
@slide(layout=content-and-preview)
@title
Procedure of this workshop
@content
**Goal:** you are going to build your own little <br />LaTeX manual based on our [LaTeX script](https://github.com/fs-wiai/latex-script/).
* learning by doing
* understanding how LaTeX works
* details can be looked up later
<div class="fragment">
**Outline:**
1. ~~What is LaTeX?~~
2. How does LaTeX work?
3. Basic structure of a LaTeX document
4. Project structure
5. Lots of features
6. Reference management
7. Outlook
</div>
@preview
![](svg/chapter-01/cover-script.jpeg)

View File

@ -179,13 +179,13 @@ The Art of Computer Programming</li>
</ul>
<div style="display: flex; justify-content: space-between; align-items: stretch;">
<figure>
<img src="svg/chapter-01/knuth.jpg" style="height: 13em">
<img data-src="svg/chapter-01/knuth.jpg" style="height: 13em">
<figcaption>
Donald Knuth
</figcaption>
</figure>
<figure>
<img src="svg/chapter-01/lamport.jpg" style="height: 13em">
<img data-src="svg/chapter-01/lamport.jpg" style="height: 13em">
<figcaption>
Leslie Lamport
</figcaption>
@ -194,7 +194,7 @@ Leslie Lamport
</div>
<div class="layout-preview">
<img src="svg/chapter-01/taocp.jpg">
<img data-src="svg/chapter-01/taocp.jpg">
</div>
</div>
@ -504,27 +504,27 @@ aussieht.
}
</style>
<div class="micro-typography">
<p class="example example1"><img src="svg/chapter-01/schriftschnitte-slanted.svg" style="height: 10vh"></p>
<p class="example example1"><img data-src="svg/chapter-01/schriftschnitte-slanted.svg" style="height: 10vh"></p>
<p class="caption ugly">☹ schräg (verzerrt)
</p>
<p class="example example1"><img src="svg/chapter-01/schriftschnitte-roman.svg" style="height: 10vh"></p>
<p class="example example1"><img data-src="svg/chapter-01/schriftschnitte-roman.svg" style="height: 10vh"></p>
<p class="caption good">☺ gerade
</p>
<p class="example example1"><img src="svg/chapter-01/schriftschnitte-italic.svg" style="height: 10vh"></p>
<p class="example example1"><img data-src="svg/chapter-01/schriftschnitte-italic.svg" style="height: 10vh"></p>
<p class="caption good">☺ kursiv (eigener Schnitt)
</p>
<p class="example example2"><img src="svg/chapter-01/schriftgrade-vergroessert.svg" style="height: 12vh"></p>
<p class="example example2"><img data-src="svg/chapter-01/schriftgrade-vergroessert.svg" style="height: 12vh"></p>
<p class="caption ugly">☹ kleine Schrift vergrößert
</p>
<p class="example example2"><img src="svg/chapter-01/schriftgrade-korrekt.svg" style="height: 12vh"></p>
<p class="example example2"><img data-src="svg/chapter-01/schriftgrade-korrekt.svg" style="height: 12vh"></p>
<p class="caption good">☺ jeweils passender Schriftgrad
</p>
<p class="example example2"><img src="svg/chapter-01/schriftgrade-verkleinert.svg" style="height: 12vh"></p>
<p class="example example2"><img data-src="svg/chapter-01/schriftgrade-verkleinert.svg" style="height: 12vh"></p>
<p class="caption ugly">☹ große Schrift verkleinert
</p>
</div>
@ -577,7 +577,7 @@ das ihr nach dem Workshop als kompakte Referenz verwenden könnt.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-01/cover-script.jpeg">
<img data-src="svg/chapter-01/cover-script.jpeg">
</div>
</div>
@ -622,7 +622,7 @@ Bildquelle: <a href="https://xkcd.com/1341/">xkcd</a>
</div>
<div class="layout-preview">
<img src="svg/chapter-02/xkcd-types-of-editors.png">
<img data-src="svg/chapter-02/xkcd-types-of-editors.png">
</div>
</div>
@ -632,7 +632,7 @@ Bildquelle: <a href="https://xkcd.com/1341/">xkcd</a>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-02/wysiwyg.svg" alt="Der Weg zum fertigen Dokument">
<img data-src="svg/chapter-02/wysiwyg.svg" alt="Der Weg zum fertigen Dokument">
<figcaption aria-hidden="true">Der Weg zum fertigen
Dokument</figcaption>
</figure>
@ -734,7 +734,7 @@ Hallo, Welt!
</div>
<div class="layout-preview">
<img src="svg/chapter-03/hallo-crop.svg">
<img data-src="svg/chapter-03/hallo-crop.svg">
</div>
</div>
@ -813,7 +813,7 @@ nichts verloren.</code></pre>
</div>
<div class="layout-preview">
<img src="svg/chapter-03/abs%C3%A4tze-crop.svg">
<img data-src="svg/chapter-03/abs%C3%A4tze-crop.svg">
</div>
</div>
@ -837,7 +837,7 @@ Geburtsort: Milwaukee, Wisconsin
</div>
<div class="layout-preview">
<img src="svg/chapter-02/kommentare-crop.svg">
<img data-src="svg/chapter-02/kommentare-crop.svg">
</div>
</div>
@ -858,7 +858,7 @@ Geburtsort: Milwaukee, Wisconsin
</div>
<div class="layout-preview">
<img src="svg/chapter-03/reservierte-zeichen-crop.svg">
<img data-src="svg/chapter-03/reservierte-zeichen-crop.svg">
</div>
</div>
@ -882,7 +882,7 @@ unterteilt. Immer verfügbar:</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-03/abschnitte-crop.svg">
<img data-src="svg/chapter-03/abschnitte-crop.svg">
</div>
</div>
@ -938,7 +938,7 @@ Mein Lieblingsrezept
</div>
<div class="layout-preview">
<img src="svg/chapter-03/titel-orig.svg">
<img data-src="svg/chapter-03/titel-orig.svg">
</div>
</div>
@ -988,7 +988,7 @@ Mein Lieblingsrezept
</div>
<div class="layout-preview">
<img src="svg/chapter-03/inhalt-crop.svg">
<img data-src="svg/chapter-03/inhalt-crop.svg">
</div>
</div>
@ -1097,7 +1097,7 @@ Bücher</li>
</div>
<div class="layout-preview">
<img src="svg/chapter-03/languages-crop.svg">
<img data-src="svg/chapter-03/languages-crop.svg">
</div>
</div>
@ -1118,7 +1118,7 @@ angegeben werden:</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-03/abschnitte-anders-crop.svg">
<img data-src="svg/chapter-03/abschnitte-anders-crop.svg">
</div>
</div>
@ -1172,7 +1172,7 @@ Auskommentieren kann in TeXstudio mit dem Shortcut <kbd>Strg</kbd> +
</div>
<div class="layout-preview">
<img src="svg/chapter-04/langes-dokument.jpg" style="padding: .2em; height: 100vh">
<img data-src="svg/chapter-04/langes-dokument.jpg" style="padding: .2em; height: 100vh">
</div>
</div>
@ -1203,7 +1203,7 @@ Auskommentieren kann in TeXstudio mit dem Shortcut <kbd>Strg</kbd> +
</div>
<div class="layout-preview">
<img src="svg/chapter-04/hauptdatei-orig.svg">
<img data-src="svg/chapter-04/hauptdatei-orig.svg">
</div>
</div>
@ -1234,7 +1234,7 @@ Inhalt von Abschnitt 2.
</div>
<div class="layout-preview">
<img src="svg/chapter-04/hauptdatei-teile-crop.svg" class="thin-padding">
<img data-src="svg/chapter-04/hauptdatei-teile-crop.svg" class="thin-padding">
</div>
</div>
@ -1262,7 +1262,7 @@ Schreibweise verwenden.
</div>
<div class="layout-preview">
<img src="svg/chapter-04/tree-crop.svg">
<img data-src="svg/chapter-04/tree-crop.svg">
</div>
</div>
@ -1286,7 +1286,7 @@ relativen Pfaden auf den aktuellen Ordner (hier:
</div>
<div class="layout-preview">
<img src="svg/chapter-04/relative-path-crop.svg">
<img data-src="svg/chapter-04/relative-path-crop.svg">
</div>
</div>
@ -1307,7 +1307,7 @@ relativen Pfaden auf den aktuellen Ordner (hier:
</div>
<div class="layout-preview">
<img src="svg/chapter-04/relative-path-subdir-crop.svg">
<img data-src="svg/chapter-04/relative-path-subdir-crop.svg">
</div>
</div>
@ -1319,9 +1319,11 @@ relativen Pfaden auf den aktuellen Ordner (hier:
<h2 data-category="Exkurs ">Dateipfade angeben <span class="emoji">👣</span>
</h2>
<p data-category="Beispiel">
<code>task.tex</code><code>graphics.raw.tex</code> (wenn
<code>task.tex</code> von <code>main-exercises.tex</code> importiert
wird)
<code>basic-functionality.tex</code><code>graphics.raw.tex</code>
</p>
<p>
(wenn <code>basic-functionality.tex</code> von
<code>main-exercises.tex</code> importiert wird)
</p>
<div class="fragment">
<pre>./exercises/graphics/graphics.raw.tex</pre>
@ -1333,7 +1335,7 @@ Dateien einbindet, die wiederum andere Dateien referenzieren.
</div>
<div class="layout-preview">
<img src="svg/chapter-04/relative-path-transitive-crop.svg">
<img data-src="svg/chapter-04/relative-path-transitive-crop.svg">
</div>
</div>
@ -1426,7 +1428,7 @@ Freiräume nach Satzzeichen zu verhindern.</li>
</div>
<div class="layout-preview">
<img src="svg/chapter-05/leerzeichen-crop.svg">
<img data-src="svg/chapter-05/leerzeichen-crop.svg">
</div>
</div>
@ -1497,7 +1499,7 @@ a dashmostly in American English
</div>
<div class="layout-preview">
<img src="svg/chapter-05/striche-crop.svg">
<img data-src="svg/chapter-05/striche-crop.svg">
</div>
</div>
@ -1520,7 +1522,7 @@ quote.}</code></pre>
</div>
<div class="layout-preview">
<img src="svg/chapter-05/zitate-crop.svg">
<img data-src="svg/chapter-05/zitate-crop.svg">
</div>
</div>
@ -1596,7 +1598,7 @@ kontrolliert werden. Eingreifen können wir mit</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-05/french-spacing-crop.svg">
<img data-src="svg/chapter-05/french-spacing-crop.svg">
</div>
</div>
@ -1667,7 +1669,7 @@ Einige der Codes funktionieren nur mit eingebundenem
</div>
<div class="layout-preview">
<img src="svg/chapter-05/silbentrennung-crop.svg">
<img data-src="svg/chapter-05/silbentrennung-crop.svg">
</div>
</div>
@ -2124,8 +2126,8 @@ unterstrichen
</div>
<div class="layout-preview">
<img class="thin-padding" src="svg/chapter-06/hervorhebungen-crop.svg" style="margin-bottom: 0; margin-top: 100px">
<img class="thin-padding" src="svg/chapter-06/optische-auszeichnungen-crop.svg">
<img class="thin-padding" data-src="svg/chapter-06/hervorhebungen-crop.svg" style="margin-bottom: 0; margin-top: 100px">
<img class="thin-padding" data-src="svg/chapter-06/optische-auszeichnungen-crop.svg">
</div>
</div>
@ -2167,7 +2169,7 @@ bereit, der URLs</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-06/url-crop.svg">
<img data-src="svg/chapter-06/url-crop.svg">
</div>
</div>
@ -2212,7 +2214,7 @@ Schriftgrößen</h3>
</div>
<div class="layout-preview">
<img src="svg/chapter-06/schriftgroesse-optiker-crop.svg" class="thin-padding">
<img data-src="svg/chapter-06/schriftgroesse-optiker-crop.svg" class="thin-padding">
</div>
</div>
@ -2238,7 +2240,7 @@ vermeiden!
</div>
<div class="layout-preview">
<img src="svg/chapter-07/ausrichtung-crop.svg">
<img data-src="svg/chapter-07/ausrichtung-crop.svg">
</div>
</div>
@ -2268,7 +2270,7 @@ abgeschaltet werden</li>
</div>
<div class="layout-preview">
<img src="./svg/chapter-07/einz%C3%BCge-abst%C3%A4nde-orig.svg">
<img data-src="./svg/chapter-07/einz%C3%BCge-abst%C3%A4nde-orig.svg">
</div>
</div>
@ -2307,7 +2309,7 @@ den Befehl <code>\item</code> gekennzeichnet.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-08/itemize-crop.svg">
<img data-src="svg/chapter-08/itemize-crop.svg">
</div>
</div>
@ -2331,8 +2333,8 @@ den Befehl <code>\item</code> gekennzeichnet.</p>
</div>
<div class="layout-preview">
<img class="thin-padding" src="svg/chapter-08/enumerate-crop.svg" style="margin-bottom: 0;">
<img class="thin-padding fragment" src="svg/chapter-08/definition-crop.svg">
<img class="thin-padding" data-src="svg/chapter-08/enumerate-crop.svg" style="margin-bottom: 0;">
<img class="thin-padding fragment" data-src="svg/chapter-08/definition-crop.svg">
</div>
</div>
@ -2358,7 +2360,7 @@ den Befehl <code>\item</code> gekennzeichnet.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-08/nested-lists-crop.svg">
<img data-src="svg/chapter-08/nested-lists-crop.svg">
</div>
</div>
@ -2405,7 +2407,7 @@ Zwischenräume zur Verfügung.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-08/compact-crop.svg">
<img data-src="svg/chapter-08/compact-crop.svg">
</div>
</div>
@ -2429,7 +2431,7 @@ zur Verfügung, die in einem Absatz stehen.</p>
</div>
<div class="layout-preview">
<img class="thin-padding" src="svg/chapter-08/paralist-extended-crop.svg">
<img class="thin-padding" data-src="svg/chapter-08/paralist-extended-crop.svg">
</div>
</div>
@ -2455,7 +2457,7 @@ notwendig.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-08/list-style-types-crop.svg">
<img data-src="svg/chapter-08/list-style-types-crop.svg">
</div>
</div>
@ -2493,7 +2495,7 @@ aktiviert wird. Außerdem gibt es eine Blockumgebung:</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-09/simple-maths-crop.svg">
<img data-src="svg/chapter-09/simple-maths-crop.svg">
</div>
</div>
@ -2565,7 +2567,7 @@ unterdrückt werden.</li>
</div>
<div class="layout-preview">
<img src="svg/chapter-09/alignment-crop.svg">
<img data-src="svg/chapter-09/alignment-crop.svg">
</div>
</div>
@ -2815,7 +2817,7 @@ werden.
</div>
<div class="layout-preview">
<img src="svg/chapter-09/limits-crop.svg">
<img data-src="svg/chapter-09/limits-crop.svg">
</div>
</div>
@ -3065,7 +3067,7 @@ Typograph*innen nicht gern gesehen und sollten vermieden werden.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-12/tabelle-beispiel-crop.svg" class="thin-padding">
<img data-src="svg/chapter-12/tabelle-beispiel-crop.svg" class="thin-padding">
</div>
</div>
@ -3094,7 +3096,7 @@ Typograph*innen nicht gern gesehen und sollten vermieden werden.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-12/tabelle-inhalt-beispiel-crop.svg" class="thin-padding">
<img data-src="svg/chapter-12/tabelle-inhalt-beispiel-crop.svg" class="thin-padding">
</div>
</div>
@ -3138,7 +3140,7 @@ Breite des Tabelleninhalts.
<p>Der <a href="https://tablesgenerator.com/">Tables Generator</a> ist
ein wunderbares Werkzeug, um schnell Tabellen verschiedener Formate zu
erstellen.</p>
<p><a href="https://tablesgenerator.com/"><img src="svg/chapter-12/tables-generator.png"></a></p>
<p><a href="https://tablesgenerator.com/"><img data-src="svg/chapter-12/tables-generator.png"></a></p>
</div>
</div>
@ -3245,7 +3247,7 @@ auch im Querformat dargestellt werden:</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-12/tabelle-fortgeschritten-beispiel-crop.svg" class="thin-padding">
<img data-src="svg/chapter-12/tabelle-fortgeschritten-beispiel-crop.svg" class="thin-padding">
</div>
</div>
@ -3283,7 +3285,7 @@ wiki/Eber}}</code></pre>
</div>
<div class="layout-preview">
<img src="svg/chapter-13/fu%C3%9Fnotenbeispiel-crop.svg">
<img data-src="svg/chapter-13/fu%C3%9Fnotenbeispiel-crop.svg">
</div>
</div>
@ -3307,7 +3309,7 @@ Wie man in Abbildung \ref{img:fooboar} …</code></pre>
</div>
<div class="layout-preview">
<img src="svg/chapter-13/ref-beispiel-crop.svg">
<img data-src="svg/chapter-13/ref-beispiel-crop.svg">
</div>
</div>
@ -3332,7 +3334,7 @@ Abkürzung ein.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-13/cref-beispiel-crop.svg">
<img data-src="svg/chapter-13/cref-beispiel-crop.svg">
</div>
</div>
@ -3477,7 +3479,7 @@ können.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-13/footmisc-de-crop.svg" class="thin-padding">
<img data-src="svg/chapter-13/footmisc-de-crop.svg" class="thin-padding">
</div>
</div>
@ -3504,7 +3506,7 @@ sec:section3,sec:section5}.</code></pre>
</div>
<div class="layout-preview">
<img src="svg/chapter-13/cref-multiple-beispiel-crop.svg">
<img data-src="svg/chapter-13/cref-multiple-beispiel-crop.svg">
</div>
</div>
@ -3604,7 +3606,7 @@ Zitierstilen.<cite>Unbekannt</cite></p>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-14/bibtex-alpha-crop.svg" class="large thin-padding" alt="Zitieren im Alpha-Zitierstil">
<img data-src="svg/chapter-14/bibtex-alpha-crop.svg" class="large thin-padding" alt="Zitieren im Alpha-Zitierstil">
<figcaption aria-hidden="true">Zitieren im Alpha-Zitierstil</figcaption>
</figure>
@ -3616,7 +3618,7 @@ Zitierstilen.<cite>Unbekannt</cite></p>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-14/bibtex-natdin-crop.svg" class="large thin-padding" alt="Zitieren im Natdin-Zitierstil">
<img data-src="svg/chapter-14/bibtex-natdin-crop.svg" class="large thin-padding" alt="Zitieren im Natdin-Zitierstil">
<figcaption aria-hidden="true">Zitieren im
Natdin-Zitierstil</figcaption>
</figure>
@ -3629,7 +3631,7 @@ Natdin-Zitierstil</figcaption>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-14/bamberger_katalog_bibtex.jpg" class="large" alt="Finden von fertigen BibTeX-Einträgen Bamberger Katalog">
<img data-src="svg/chapter-14/bamberger_katalog_bibtex.jpg" class="large" alt="Finden von fertigen BibTeX-Einträgen Bamberger Katalog">
<figcaption aria-hidden="true">Finden von fertigen BibTeX-Einträgen
Bamberger Katalog</figcaption>
</figure>
@ -3642,7 +3644,7 @@ Bamberger Katalog</figcaption>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-14/google_bibtex1.jpg" class="large" alt="Finden von fertigen BibTeX-Einträgen Google Scholar">
<img data-src="svg/chapter-14/google_bibtex1.jpg" class="large" alt="Finden von fertigen BibTeX-Einträgen Google Scholar">
<figcaption aria-hidden="true">Finden von fertigen BibTeX-Einträgen
Google Scholar</figcaption>
</figure>
@ -3655,7 +3657,7 @@ Google Scholar</figcaption>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-14/google_bibtex2.jpg" class="large" alt="Finden von fertigen BibTeX-Einträgen Google Scholar">
<img data-src="svg/chapter-14/google_bibtex2.jpg" class="large" alt="Finden von fertigen BibTeX-Einträgen Google Scholar">
<figcaption aria-hidden="true">Finden von fertigen BibTeX-Einträgen
Google Scholar</figcaption>
</figure>
@ -3668,7 +3670,7 @@ Google Scholar</figcaption>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-14/dblp.jpg" class="large" alt="Finden von fertigen BibTeX-Einträgen dblp.org">
<img data-src="svg/chapter-14/dblp.jpg" class="large" alt="Finden von fertigen BibTeX-Einträgen dblp.org">
<figcaption aria-hidden="true">Finden von fertigen BibTeX-Einträgen
dblp.org</figcaption>
</figure>
@ -3736,7 +3738,7 @@ Quadrate aller geraden % …
</div>
<div class="layout-preview">
<img src="svg/chapter-10/listings-haskell-crop.svg">
<img data-src="svg/chapter-10/listings-haskell-crop.svg">
</div>
</div>
@ -3759,7 +3761,7 @@ Einfügen externen Codes:</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-10/listings-java-crop.svg">
<img data-src="svg/chapter-10/listings-java-crop.svg">
</div>
</div>
@ -3885,7 +3887,7 @@ weiter verbreitet.
</div>
<div class="layout-preview">
<img src="svg/chapter-15/index.png">
<img data-src="svg/chapter-15/index.png">
</div>
</div>
@ -3918,7 +3920,7 @@ Themes</a>.</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-15/beamer-orig.svg" style="width: 100%; margin: 0;">
<img data-src="svg/chapter-15/beamer-orig.svg" style="width: 100%; margin: 0;">
</div>
</div>
@ -3960,7 +3962,7 @@ child { node {home}
</div>
<div class="layout-preview">
<img src="svg/chapter-04/relative-path-crop.svg">
<img data-src="svg/chapter-04/relative-path-crop.svg">
</div>
</div>
@ -3978,7 +3980,7 @@ erstellen:</p>
</div>
<div class="layout-preview">
<img src="svg/chapter-15/constituency-tree-crop.svg">
<img data-src="svg/chapter-15/constituency-tree-crop.svg">
</div>
</div>
@ -4038,7 +4040,7 @@ einwandfrei darstellen.</p>
</div>
<div class="layout-preview">
<img class="thin-padding" src="svg/chapter-15/prftree-crop.svg">
<img class="thin-padding" data-src="svg/chapter-15/prftree-crop.svg">
</div>
</div>
@ -4130,7 +4132,7 @@ Gestalten von Tabellen
</h2>
<p>Das Wikibook zu LaTeX enthält eine große Anzahl interessanter Artikel
und ist auch in deutscher Sprache verfügbar.</p>
<p><img src="svg/chapter-16/wikibooks-latex.jpg"></p>
<p><img data-src="svg/chapter-16/wikibooks-latex.jpg"></p>
</div>
</div>
@ -4144,7 +4146,7 @@ und ist auch in deutscher Sprache verfügbar.</p>
</h2>
<p>Das »Comprehensive TeX Archive Network« ist die zentrale Quelle für
LaTeX-Pakete und ihre Dokumentation.</p>
<p><img src="svg/chapter-16/ctan.jpg"></p>
<p><img data-src="svg/chapter-16/ctan.jpg"></p>
</div>
</div>
@ -4162,7 +4164,7 @@ Dokumenten ermöglicht.</p>
<a href="https://www.overleaf.com/templates">»Templates«</a>
LaTeX-Vorlagen für viele Gelegenheiten (Lebenslauf, Abschlussarbeiten,
…).</p>
<p><img src="svg/chapter-16/overleaf.jpg"></p>
<p><img data-src="svg/chapter-16/overleaf.jpg"></p>
</div>
</div>
@ -4175,7 +4177,7 @@ LaTeX-Vorlagen für viele Gelegenheiten (Lebenslauf, Abschlussarbeiten,
<a href="https://tex.stackexchange.com">StackExchange</a>
</h2>
<p>Frage-Forum zu LaTeX.</p>
<p><img src="svg/chapter-16/stackexchange.jpg"></p>
<p><img data-src="svg/chapter-16/stackexchange.jpg"></p>
</div>
</div>
@ -4189,7 +4191,7 @@ LaTeX-Vorlagen für viele Gelegenheiten (Lebenslauf, Abschlussarbeiten,
</h2>
<p>Webseite mit zahlreichen LaTeX-Beispielvorlagen, vor allem zu
TikZ.</p>
<p><img src="svg/chapter-16/texample.jpg"></p>
<p><img data-src="svg/chapter-16/texample.jpg"></p>
</div>
</div>
@ -4199,7 +4201,7 @@ TikZ.</p>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-16/klassisches-beispiel-2.jpeg" class="large" alt="Klassisch (Quelle)">
<img data-src="svg/chapter-16/klassisches-beispiel-2.jpeg" class="large" alt="Klassisch (Quelle)">
<figcaption aria-hidden="true">Klassisch (<a href="https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends">Quelle</a>)</figcaption>
</figure>
@ -4211,7 +4213,7 @@ TikZ.</p>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-16/klassischeres-beispiel.jpg" alt="Noch klassischer (Quelle)">
<img data-src="svg/chapter-16/klassischeres-beispiel.jpg" alt="Noch klassischer (Quelle)">
<figcaption aria-hidden="true">Noch klassischer (<a href="https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends">Quelle</a>)</figcaption>
</figure>
@ -4223,7 +4225,7 @@ TikZ.</p>
<div class="layout-preview-only">
<div class="layout-preview">
<figure>
<img src="svg/chapter-16/anderes-beispiel.png" class="large" alt="Anders (Quelle)">
<img data-src="svg/chapter-16/anderes-beispiel.png" class="large" alt="Anders (Quelle)">
<figcaption aria-hidden="true">Anders (<a href="https://tex.stackexchange.com/questions/1319/showcase-of-beautiful-typography-done-in-tex-friends">Quelle</a>)</figcaption>
</figure>
@ -4244,7 +4246,7 @@ vorbei oder schreibt uns eine Mail!
<span class="emoji" style="display: inline-block; width: 2em;">☎️</span>0951 863 1219 <br>
<span class="emoji" style="display: inline-block; width: 2em;">📧</span><a href="mailto:fachschaft-wiai.stuve@uni-bamberg.de">fachschaft-wiai.stuve@uni-bamberg.de</a>
</p>
<p><img src="images/logo-fachschaft.jpg" style="width:40%; margin: 0 auto; margin-top: 2em; display:block;"></p>
<p><img data-src="images/logo-fachschaft.jpg" style="width:40%; margin: 0 auto; margin-top: 2em; display:block;"></p>
</div>
</div>
@ -4268,7 +4270,7 @@ vorbei oder schreibt uns eine Mail!
<article>
<div class="layout-preview-only">
<div class="layout-preview">
<p><img src="svg/chapter-16/fooboar-latex-tut.jpg" style="width:100%; margin:0 auto; display: block;"></p>
<p><img data-src="svg/chapter-16/fooboar-latex-tut.jpg" style="width:100%; margin:0 auto; display: block;"></p>
</div>
</div>

View File

@ -0,0 +1,412 @@
@slide(layout=chapter-slide)
@number
3
@title
Grundstruktur eines L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X-Dokuments
@slide(layout=content-and-preview)
@title
Präambel & Dokumentumgebung
@content
<p style="text-indent: -1.3em"><span class="emoji">👁</span> Ein mit LaTeX gesetztes Dokument besteht aus:</p>
* **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[<parameter>]{<dokumentklasse>}
```
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.&thinsp;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: <kbd>Strg</kbd> + <kbd>T</kbd> und <kbd>Strg</kbd> + <kbd>U</kbd>
@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.&thinsp;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.&thinsp;ä.).
* 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{<sprache a>}
\selectlanguage{<sprache b>}
```
Eingebetteter Text in anderer Sprache:
``` {.lang-tex .hljs}
\selectlanguage{<sprache a>}
\foreignlanguage{<sprache b>}{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
<div class="box warning">
**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 <kbd>Strg</kbd> + <kbd>T</kbd> erreicht werden).
</div>
Im nächsten Kapitel erklären wir, warum das notwendig ist.

View File

@ -0,0 +1,411 @@
@slide(layout=chapter-slide)
@number
3
@title
Basic structure of a L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X document
@slide(layout=content-and-preview)
@title
Preamble & document environment
@content
<p style="text-indent: -1.3em"><span class="emoji">👁</span> Every LaTeX document is composed of</p>
* 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[<parameter>]{<document_class>}
```
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.&thinsp;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: <kbd>Ctrl</kbd> + <kbd>T</kbd> and <kbd>Ctrl</kbd> + <kbd>U</kbd>
@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.&thinsp;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{<language a>}
\selectlanguage{<language b>}
```
Embedded Text in another language:
``` {.lang-tex .hljs}
\selectlanguage{<language a>}
\foreignlanguage{<language b>}{Text of language B in a Text of language A}
```
@slide(layout=extra-content-and-preview)
@title
Languages&hairsp;&hairsp;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
<div class="box warning">
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 <kbd>Strg</kbd> + <kbd>T</kbd>.)
</div>
We will learn in the following chapter why this is the case.

View File

@ -0,0 +1,91 @@
@slide(layout=chapter-slide)
@number
2
@title
Wie funktioniert L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X?
@slide(layout=content-and-preview)
@title
WYSIWaaas?
@content
### What You See Is What You Get {data-category=Word}
* Formatierung mit unmittelbarem optischen Feedback
<div class="fragment">
### What You See Is What You Mean {data-category=LaTeX}
* Trennung von Inhalt und Struktur
* Formatierung erst am Ende ersichtlich
</div>
<p style="margin-top:calc(.25 * var(--square));">
Bildquelle: <a href="https://xkcd.com/1341/">xkcd</a>
</p>
@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}
\<befehl>[<optionale_parameter>]{<obligatorische_parameter>}
```
++ 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:
<kbd>AltGr</kbd>&nbsp;+&nbsp;<kbd>ß</kbd>&nbsp;(Windows/Linux)
<kbd>Alt</kbd>&nbsp;+&nbsp;<kbd>Shift</kbd>&nbsp;+&nbsp;<kbd>7</kbd>&nbsp;(MacOS)

View File

@ -0,0 +1,93 @@
@slide(layout=chapter-slide)
@number
2
@title
How does <br/>L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X work?
@slide(layout=content-and-preview)
@title
WYSIWhat?
@content
### What You See Is What You Get {data-category=Word}
* Formatting with immediate visual feedback
<div class="fragment">
### What You See Is What You Mean {data-category=LaTeX}
* Separation of content and structure
* Formatting only visible afterwards
</div>
<p style="margin-top:calc(.25 * var(--square));">
Image source: <a href="https://xkcd.com/1341/">xkcd</a>
</p>
@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}
\<command>[<optional_parameters>]{<obligatory_parameters>}
```
++ 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
<kbd>AltGr</kbd>&nbsp;+&nbsp;<kbd>ß</kbd>&nbsp;(Windows/Linux)
<kbd>Alt</kbd>&nbsp;+&nbsp;<kbd>Shift</kbd>&nbsp;+&nbsp;<kbd>7</kbd>&nbsp;(MacOS)

View File

@ -0,0 +1,113 @@
@slide(layout=chapter-slide)
@number
9
@title
Grafiken
@slide(layout=content-only)
@title
Grafiken abbilden <span class="emoji">🖼️</span>
@content
Um Grafiken darzustellen, muss das Paket `graphicx` eingebunden werden.
``` {.lang-tex .hljs}
\begin{figure}
\includegraphics{<dateipfad>}
\caption[<kurztitel (abbildungsver-
zeichnis)>]{<bildunterschrift>}
\end{figure}
```
Bildgröße angeben:
``` {.lang-tex .hljs}
\includegraphics[width=0.5\textwidth,
height=5cm]{<dateipfad>}
```
@slide(layout=content-only)
@title
Positionierung auf der Seite
@content
``` {.lang-tex .hljs}
\begin{figure}[<positionskürzel>]
```
LaTeX positioniert Grafiken automatisch. Durch Kürzel können wir unsere Präferenzen (auch in Kombination) angeben.
<table>
<tr>
<th style="min-width:4em">Kürzel</th>
<th>Position</th>
</tr>
<tr class="fragment">
<td>h</td>
<td>hier, wenn es dir recht ist</td>
</tr>
<tr class="fragment">
<td>t</td>
<td>oberer Seitenrand (top)</td>
</tr>
<tr class="fragment">
<td>b</td>
<td>unterer Seitenrand (bottom)</td>
</tr>
<tr class="fragment">
<td>p</td>
<td>auf einer eigenen Seite (page)</td>
</tr>
<tr class="fragment">
<td>H</td>
<td>Hier, verdammt noch mal! <br />(benötigt Paket `float`)</td>
</tr>
</table>
@slide(layout=content-only)
@title
Zentrierte Anordnung
@content
``` {.lang-tex .hljs}
\begin{figure}[<position>]
\begin{center}
\includegraphics{<dateipfad>}
\end{center}
\end{figure}
```
Alternativ:
``` {.lang-tex .hljs}
\begin{figure}[<position>]
\centering
\includegraphics{<dateipfad>}
\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.

View File

@ -0,0 +1,113 @@
@slide(layout=chapter-slide)
@number
9
@title
Graphics
@slide(layout=content-only)
@title
Including graphics <span class="emoji">🖼️</span>
@content
To display graphics, we need the `graphicx` package.
``` {.lang-tex .hljs}
\begin{figure}
\includegraphics{<file path>}
\caption[<short caption (table of
figures)>]{<full caption>}
\end{figure}
```
Specifying the size:
``` {.lang-tex .hljs}
\includegraphics[width=0.5\textwidth,
height=5cm]{<file path>}
```
@slide(layout=content-only)
@title
Layout on the page
@content
``` {.lang-tex .hljs}
\begin{figure}[<position code>]
```
LaTeX places graphics automatically. With position codes, we can express our preferences (they can be combined as well).
<table>
<tr>
<th style="min-width:4em">code</th>
<th>position</th>
</tr>
<tr class="fragment">
<td>h</td>
<td>here, if you dont mind</td>
</tr>
<tr class="fragment">
<td>t</td>
<td>top of the page</td>
</tr>
<tr class="fragment">
<td>b</td>
<td>bottom of the page</td>
</tr>
<tr class="fragment">
<td>p</td>
<td>on its own page</td>
</tr>
<tr class="fragment">
<td>H</td>
<td>Here, for Gods sake! <br />(`float` package required)</td>
</tr>
</table>
@slide(layout=content-only)
@title
Centred alignment
@content
``` {.lang-tex .hljs}
\begin{figure}[<position>]
\begin{center}
\includegraphics{<path-to-file>}
\end{center}
\end{figure}
```
Alternatively:
``` {.lang-tex .hljs}
\begin{figure}[<position>]
\centering
\includegraphics{<path-to-file>}
\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`).

View File

@ -0,0 +1,67 @@
@slide(layout=chapter-slide)
@number
0
@title
Erste Schritte mit&nbsp;L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X
@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: <a href="https://miktex.org/download">MikT<sub style="font-size: 100%; margin-left: -.1em">E</sub>X</a>
* Linux-Distributionen: <a href="https://tug.org/texlive/doc/texlive-en/texlive-en.html#installation">T<sub style="font-size: 100%; margin-left: -.1em">E</sub>XLive</a>
* Debian-basierte Distros: Führt `sudo apt install texlive-full` aus
* Andere Distributionen: Folgt den anweisungen auf der T<sub style="font-size: 100%; margin-left: -.1em">E</sub>XLive-Website
<div class="box warning">
Bitte achtet darauf, die full version mit allen Paketen zu installieren, wenn ihr die Auswahl habt!
</div>
@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 <a href="https://notepad-plus-plus.org/downloads/">Notepad++</a> oder <a href="https://code.visualstudio.com/download">VSCode</a>
* Für Anfänger:innen empfehlen wir jedoch <a href="https://www.texstudio.org/">T<sub style="font-size: 100%; margin-left: -.1em">E</sub>Xstudio</a>, da es LaTeX-spezifische Features bietet
* Ladet T<sub style="font-size: 100%; margin-left: -.1em">E</sub>Xstudio 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 <span class="emoji"></span> klickt
* Einige neue Dateien sollten nun durch das Kompilieren generiert werden
<div class="box warning">
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.
</div>

View File

@ -0,0 +1,67 @@
@slide(layout=chapter-slide)
@number
0
@title
First steps with&nbsp;L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X
@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&nbsp;a&nbsp;command&nbsp;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 L<sup style="font-weight: bold; font-size: 73%; margin-left: -.25em; margin-right: -.05em; position: relative; top: .2em">A</sup>T<sub style="font-size: 100%; margin-left: -.1em">E</sub>X code into a PDF
* Depending on your operating system, different compilers are available
* Windows: <a href="https://miktex.org/download">MikT<sub style="font-size: 100%; margin-left: -.1em">E</sub>X</a>
* macOS: <a href="https://tug.org/mactex/">MacT<sub style="font-size: 100%; margin-left: -.1em">E</sub>X</a>
* Linux distributions: <a href="https://tug.org/texlive/doc/texlive-en/texlive-en.html#installation">T<sub style="font-size: 100%; margin-left: -.1em">E</sub>XLive</a>
* Debian-based distributions: run `sudo apt install texlive-full`
* other distributions: see the T<sub style="font-size: 100%; margin-left: -.1em">E</sub>XLive website
<div class="box warning">
Make sure to install the full version with all packages, if you can!
</div>
@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., <a href="https://notepad-plus-plus.org/downloads/">Notepad++</a>, <a href="https://code.visualstudio.com/download">VSCode</a>
* For beginners, <a href="https://www.texstudio.org/">T<sub style="font-size: 100%; margin-left: -.1em">E</sub>Xstudio</a> is recommended due to its LaTeX-specific features
* Download and install T<sub style="font-size: 100%; margin-left: -.1em">E</sub>Xstudio
@slide(layout=content-only)
@title
Compile the script for&nbsp;the&nbsp;first&nbsp;time
@content
* Download the project archive from the VC.
* Unzip the archive.
* Open the file `main-exercises.tex` in T<sub style="font-size: 100%; margin-left: -.1em">E</sub>Xstudio. It is located in the root directory of the archive.
* Compile `main-exercises.tex` by pressing <span class="emoji"></span>
* A few new files will be generated by the compilation.
<div class="box warning">
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.
</div>

View File

@ -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
<img class="thin-padding" src="svg/chapter-08/enumerate-crop.svg" style="margin-bottom: 0;"/>
<img class="thin-padding fragment" src="svg/chapter-08/definition-crop.svg"/>
@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
<img class="thin-padding" src="svg/chapter-08/paralist-extended-crop.svg"/>
@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)

View File

@ -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
<img class="thin-padding" src="svg/chapter-08/enumerate-english-crop.svg" style="margin-bottom: 0;"/>
<img class="thin-padding fragment" src="svg/chapter-08/definition-english-crop.svg"/>
@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
<img class="thin-padding" src="svg/chapter-08/paralist-extended-english-crop.svg"/>
@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)

View File

@ -0,0 +1,114 @@
@slide(layout=chapter-slide)
@number
12
@title
Literatur&shy;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{<quelle>}`
* ++ Zitieren einer Quelle: `\cite{<quelle>}`
* ++ Zitieren einer Seite: `\cite[S. 15]{<quelle>}`
* ++ Zitieren mit weiteren Zusätzen:<br/>`\cite[<präfix>][<suffix>]{<quelle>}`
* ++ Verweis auf die genutzte `.bib`-Datei: `\bibliography{<.bib-datei>}`
* ++ Angabe des genutzten Zitierstils: <br/>`\bibliographystyle{<zitierstil>}`
> Zwei Dinge sind unendlich. Das Universum und&nbsp;die&nbsp;Auswahl an Zitierstilen.<cite>Unbekannt</cite>
@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`.

View File

@ -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{<source>}`
* ++ Citing a source: `\cite{<source>}`
* ++ Citing a page: `\cite[p. 15]{<source>}`
* ++ Citing with additional text:<br/>`\cite[<prefix>][<suffix>]{<source>}`
* ++ Referencing the `.bib` file: `\bibliography{<.bib file>}`
* ++ Choosing a citation style: <br/>`\bibliographystyle{<citation style>}`
> Two things are infinite: the universe and&nbsp;the&nbsp;assortment of citation styles.<cite>Unknown</cite>
@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.

View File

@ -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
<table>
<tr>
<th>Quelltext</th>
<th>Ergebnis</th>
</tr>
<tr class="fragment">
<td>`\sum_{i=1}^{n}x^2`</td>
<td>$\sum_{i=1}^{n} x^2$</td>
</tr>
<tr class="fragment">
<td>`12 \leq 4 x^2 + 13`</td>
<td>$12 \leq 4 x^2 + 13$</td>
</tr>
<tr class="fragment">
<td>`{n \choose k}`</td>
<td>${n \choose k}$</td>
</tr>
</table>
@slide(layout=content-and-preview)
@title
Ausrichtung von mehreren Gleichungen
@content
Die Umgebung `align` erlaubt es, Gleichungen zum Beispiel am &hairsp;=&hairsp; 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.&thinsp;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
<table>
<tr>
<th>Quelltext</th>
<th>Ergebnis</th>
</tr>
<tr>
<td>`(x)`, `[x]`, `\lbrace x \rbrace`, `\lvert x \rvert`</td>
<td>$(x), [x], \lbrace x\rbrace, \lvert x\rvert$</td>
</tr>
<tr>
<td>`\exists`, `\forall`, `\in`, <br />`\notin`, `\infty`</td>
<td>$\exists,\forall,\in,\notin,\infty$</td>
</tr>
<tr>
<td>`\alpha`, `\beta`, `\Gamma`, <br />`\Delta`, `\varepsilon`, `\pi`</td>
<td>$\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi$</td>
</tr>
<tr>
<td>`\rightarrow`, `\leftarrow`, `\Rightarrow`, `\Leftarrow`, `\Leftrightarrow`</td>
<td>$\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow$</td>
</tr>
<tr>
<td>`(A \cup B) \cap C`</td>
<td>$(A \cup B) \cap C$</td>
</tr>
<tr>
<td>`(A \lor B) \land C`</td>
<td>$(A \lor B) \land C$</td>
</tr>
<tr>
<td>`(A \cdot B) \times C`</td>
<td>$(A \cdot B) \times C$</td>
</tr>
</table>
@slide(layout=extra-content-only)
@title
Mitwachsende Klammern
@content
<table>
<tr>
<th>Quelltext</th>
<th>Ergebnis</th>
</tr>
<tr>
<td>`\left( \frac{1}{2} \right)`</td>
<td>$\left( \frac{1}{2} \right)$</td>
</tr>
<tr>
<td>`\left[ \frac{1}{2} \right]`</td>
<td>$\left[ \frac{1}{2} \right]$</td>
</tr>
<tr>
<td>`\left\lbrace \frac{1}{2} \right\rbrace`</td>
<td>$\left\lbrace \frac{1}{2} \right\rbrace$</td>
</tr>
</table>
``` {.lang-tex .hljs}
$4 \cdot \left( \frac{1}{2} % …
```
<p style="text-align: center;">$4 \cdot \left(\frac{1}{2} +\frac{3}{ 12 \cdot \left( 2 + \frac{1}{86 \cdot \left(\frac{1}{2} + 24 \right)} \right)} \right)$</p>
@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)
```
<p data-category="Achtung!">Der Einsatz von `\limits` sollte im Fließtext vermieden werden.</p>
@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{}`.
<p style="text-align: center;">$\left\lbrace x \mid tiefe(x) \geq 20\right\rbrace$</p>
<p style="text-align: center;">$\left\lbrace x \mid \text{tiefe}(x) \geq 20\right\rbrace$</p>
``` {.lang-tex .hljs}
$\left\lbrace x \mid \text{tiefe}(x) …
```

View File

@ -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
<table>
<tr>
<th>source code</th>
<th>result</th>
</tr>
<tr class="fragment">
<td>`\sum_{i=1}^{n}x^2`</td>
<td>$\sum_{i=1}^{n} x^2$</td>
</tr>
<tr class="fragment">
<td>`12 \leq 4 x^2 + 13`</td>
<td>$12 \leq 4 x^2 + 13$</td>
</tr>
<tr class="fragment">
<td>`{n \choose k}`</td>
<td>${n \choose k}$</td>
</tr>
</table>
@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 &hairsp;=&hairsp; 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.&thinsp;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
<table>
<tr>
<th>source code</th>
<th>result</th>
</tr>
<tr>
<td>`(x)`, `[x]`, `\lbrace x \rbrace`, `\lvert x \rvert`</td>
<td>$(x), [x], \lbrace x\rbrace, \lvert x\rvert$</td>
</tr>
<tr>
<td>`\exists`, `\forall`, `\in`, <br />`\notin`, `\infty`</td>
<td>$\exists,\forall,\in,\notin,\infty$</td>
</tr>
<tr>
<td>`\alpha`, `\beta`, `\Gamma`, <br />`\Delta`, `\varepsilon`, `\pi`</td>
<td>$\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi$</td>
</tr>
<tr>
<td>`\rightarrow`, `\leftarrow`, `\Rightarrow`, `\Leftarrow`, `\Leftrightarrow`</td>
<td>$\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow$</td>
</tr>
<tr>
<td>`(A \cup B) \cap C`</td>
<td>$(A \cup B) \cap C$</td>
</tr>
<tr>
<td>`(A \lor B) \land C`</td>
<td>$(A \lor B) \land C$</td>
</tr>
<tr>
<td>`(A \cdot B) \times C`</td>
<td>$(A \cdot B) \times C$</td>
</tr>
</table>
@slide(layout=extra-content-only)
@title
Height-adapting braces
@content
<table>
<tr>
<th>source code</th>
<th>result</th>
</tr>
<tr>
<td>`\left( \frac{1}{2} \right)`</td>
<td>$\left( \frac{1}{2} \right)$</td>
</tr>
<tr>
<td>`\left[ \frac{1}{2} \right]`</td>
<td>$\left[ \frac{1}{2} \right]$</td>
</tr>
<tr>
<td>`\left\lbrace \frac{1}{2} \right\rbrace`</td>
<td>$\left\lbrace \frac{1}{2} \right\rbrace$</td>
</tr>
</table>
``` {.lang-tex .hljs}
$4 \cdot \left( \frac{1}{2} % …
```
<p style="text-align: center;">$4 \cdot \left(\frac{1}{2} +\frac{3}{ 12 \cdot \left( 2 + \frac{1}{86 \cdot \left(\frac{1}{2} + 24 \right)} \right)} \right)$</p>
@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)
```
<p data-category="Caution!">Don't use `\limits` inline.</p>
@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.
<p style="text-align: center;">$\left\lbrace x \mid frequency(x) \geq 20\right\rbrace$</p>
<p style="text-align: center;">$\left\lbrace x \mid \text{frequency}(x) \geq 20\right\rbrace$</p>
``` {.lang-tex .hljs .fragment}
$\left\lbrace x \mid \text{frequency} …
```

View File

@ -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
<img src="svg/chapter-15/beamer-orig.svg" style="width: 100%; margin: 0;"/>
@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
<img class="thin-padding" src="svg/chapter-15/prftree-crop.svg"/>
@slide(layout=content-only)
@title
Weitere nützliche Pakete
@content
<table>
<tr>
<th>Paket</th>
<th>Anwendung</th>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/xcolor"><code>xcolor</code></a></td>
<td>Machs mit Farbe</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/todonotes"><code>todonotes</code></a></td>
<td>ToDo-Markierungen und Liste der ToDos</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/pdfpages"><code>pdfpages</code></a></td>
<td>Einbinden von PDF-Dateien</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/subcaption"><code>subcaption</code></a></td>
<td>Verschachtelte Abbildungen und ausgefeilte Bildunterschriften</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/colortbl"><code>colortbl</code></a>, <a href="https://www.ctan.org/pkg/tabularx"><code>tabularx</code></a>, <a href="https://www.ctan.org/pkg/multirow"><code>multirow</code></a>, <a href="https://www.ctan.org/pkg/makecell"><code>makecell</code></a></td>
<td>Gestalten von Tabellen</td>
</tr>
</table>

View File

@ -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
<img src="svg/chapter-15/beamer-orig.svg" style="width: 100%; margin: 0;"/>
@slide(layout=content-and-preview)
@title
Drawing images
@content
`TikZ` (“TikZ ist kein Zeichenprogramm”&thinsp;&thinsp;“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
<img class="thin-padding" src="svg/chapter-15/prftree-crop.svg"/>
@slide(layout=content-only)
@title
Other useful packages
@content
<table>
<tr>
<th>Package</th>
<th>Use case</th>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/xcolor"><code>xcolor</code></a></td>
<td>colours</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/todonotes"><code>todonotes</code></a></td>
<td>todo&nbsp;annotations&nbsp;and&nbsp;index</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/pdfpages"><code>pdfpages</code></a></td>
<td>embedding PDF files</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/subcaption"><code>subcaption</code></a></td>
<td>Nested figures and fine-tuned captions</td>
</tr>
<tr class="fragment">
<td><a href="https://www.ctan.org/pkg/colortbl"><code>colortbl</code></a>, <a href="https://www.ctan.org/pkg/tabularx"><code>tabularx</code></a>, <a href="https://www.ctan.org/pkg/multirow"><code>multirow</code></a>, <a href="https://www.ctan.org/pkg/makecell"><code>makecell</code></a></td>
<td>Table tuning</td>
</tr>
</table>

View File

@ -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 <span class="emoji">👹</span>
* 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 <span class="emoji">👑</span>
@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 <span class="emoji">👣</span>
@content
* wichtig für `\input{}` sowie später für das Einbinden von Bildern und anderen Medien
* Datei- und Ordnerstruktur = Baumstruktur <span class="emoji">🌳</span>
* bei `\input{}` kann der Pfad zu einer Unterdatei relativ zur Hauptdatei angeben werden
<p data-category="Achtung!" class="fragment">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.</p>
@preview
![](svg/chapter-04/tree-crop.svg)
@slide(layout=content-and-preview-with-category)
@category
Exkurs
@title
Dateipfade angeben <span class="emoji">👣</span>
@content
<p data-category="Beispiel">`main-exercises.tex``praeamble.tex`</p>
<div class="fragment">
`./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.
</div>
@preview
![](svg/chapter-04/relative-path-crop.svg)
@slide(layout=content-and-preview-with-category)
@category
Exkurs
@title
Dateipfade angeben <span class="emoji">👣</span>
@content
<p data-category="Beispiel">`main-exercises.tex``basic-document-structure.tex` (in einem Unterordner)</p>
<div class="fragment">
`./content/basic-document-structure.tex`
</div>
@preview
![](svg/chapter-04/relative-path-subdir-crop.svg)
@slide(layout=content-and-preview-with-category)
@category
Exkurs
@title
Dateipfade angeben <span class="emoji">👣</span>
@content
<p data-category="Beispiel">`basic-functionality.tex``graphics.raw.tex`</p>
<p>(wenn `basic-functionality.tex` von `main-exercises.tex` importiert wird)</p>
<div class="fragment">
<pre>./exercises/graphics/graphics.raw.tex</pre>
<p data-category="Achtung!">Pfade sind immer relativ zum Wurzelelement, auch wenn dieses noch andere Dateien einbindet, die wiederum andere Dateien referenzieren.</p>
</div>
@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.
<div class="box warning fragment">
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.
</div>
@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.&thinsp;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?

View File

@ -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 <span class="emoji">👹</span>
* 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 <span class="emoji">👑</span>
@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 <span class="emoji">👣</span>
@content
* important for `\input{}`, but later also for other media types
* file and folder structure = tree structure <span class="emoji">🌳</span>
* with `\input{}`, you can specify the path relative to the main file
<p data-category="Caution!" class="fragment">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.</p>
@preview
![](svg/chapter-04/tree-english-crop.svg)
@slide(layout=content-and-preview-with-category)
@category
Excursion
@title
Specifying file paths <span class="emoji">👣</span>
@content
<p data-category="Example">`main-exercises.tex``praeamble.tex`</p>
<div class="fragment">
`./praeamble.tex`
A **single dot `.`** represents the current folder (in this case: `latex-skript`). It is optional, you could also write `praeamble.tex` here.
</div>
@preview
![](svg/chapter-04/relative-path-english-crop.svg)
@slide(layout=content-and-preview-with-category)
@category
Excursion
@title
Specifying file paths <span class="emoji">👣</span>
@content
<p data-category="Example">`main-exercises.tex``basic-document-structure.tex` (in a subfolder)</p>
<pre class="fragment">./content/basic-document-structure.tex</pre>
@preview
![](svg/chapter-04/relative-path-subdir-english-crop.svg)
@slide(layout=content-and-preview-with-category)
@category
Excursion
@title
Specifying file paths <span class="emoji">👣</span>
@content
<p data-category="Example">`basic-functionality.tex``graphics.raw.tex`</p>
<p>(`basic-functionality.tex` is imported into `main-exercises.tex`)</p>
<div class="fragment">
<pre>./exercises/graphics/graphics.raw.tex</pre>
<p data-category="Caution!">Paths are always relative to the root document that imports other files as fragments.</p>
</div>
@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 dont have a preamble.
<div class="box warning fragment">
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.
</div>
@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?

View File

@ -0,0 +1,211 @@
@slide(layout=chapter-slide)
@number
11
@title
Referenzen und&nbsp;Fußnoten
@slide(layout=content-and-preview)
@title
Fußnoten <span class="emoji">📎</span>
@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 dont!)
``` {.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.
<table>
<tr>
<td>`fig:` Abbildungen</td>
<td>`tbl:` Tabellen</td>
</tr>
<tr>
<td>`sec:` Abschnitte</td>
<td>`subsec:` Unter&shy;abschnitte</td>
</tr>
<tr>
<td>`ch:` Kapitel</td>
<td>`itm:` Aufzählungs&shy;elemente</td>
</tr>
<tr>
<td>`eq:` Gleichungen</td>
<td>`lst:` Quelltext&shy;listings</td>
</tr>
</table>
@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)

View File

@ -0,0 +1,213 @@
@slide(layout=chapter-slide)
@number
11
@title
References and&nbsp;footnotes
@slide(layout=content-and-preview)
@title
Footnotes <span class="emoji">📎</span>
@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 dont!)
``` {.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.
<table>
<tr>
<td>`fig:` Figures</td>
<td>`tbl:` Tables</td>
</tr>
<tr>
<td>`sec:` Sections</td>
<td>`subsec:` Subsections</td>
</tr>
<tr>
<td>`ch:` Chapters</td>
<td>`itm:` Enumeration items</td>
</tr>
<tr>
<td>`eq:` Equations</td>
<td>`lst:` Source code listings</td>
</tr>
</table>
@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)

View File

@ -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.

View File

@ -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.&thinsp;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.

View File

@ -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
<table>
<tr>
<th></th>
<th>Name</th>
<th>Verwendung</th>
<th>Code</th>
</tr>
<tr>
<td>-</td>
<td>Bindestrich *(hypen)*</td>
<td>LaTeX-Wochenende</td>
<td>`-`</td>
</tr>
<tr>
<td></td>
<td>Halbgeviert&shy;strich<br />*(en dash)*</td>
<td>als Gedankenstrich oder als Bis-Strich: 10&hairsp;&hairsp;12 Uhr.</td>
<td>`--`</td>
</tr>
<tr>
<td></td>
<td>Geviertstrich<br />*(em dash)*</td>
<td>a dash&hairsp;&hairsp;mostly in American English</td>
<td>`---`</td>
</tr>
</table>
@preview
![](svg/chapter-05/striche-crop.svg)
@slide(layout=content-and-preview)
@title
Zitate
@content
Das Paket `csquotes` stellt u.&thinsp;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! <span class="emoji">⛑️</span>
* 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
<div class="box warning">
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).
</div>
* 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&nbsp;spacing,* also&nbsp;doppelte Leerzeichen nach dem Satzende.
Das kann mit `\frenchspacing` vor dem ersten Absatz verhindert werden. `\nonfrenchspacing` schaltet wieder zurück.
Bei *English&nbsp;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.
<table>
<tr>
<td>Ausschließliche Trennung</td>
<td>`\-`</td>
</tr>
<tr>
<td>Zusätzliche Trennstelle</td>
<td>`"-`</td>
</tr>
<tr>
<td>Bindestrich (verbietet andere Trennstellen)</td>
<td>`-`</td>
</tr>
<tr>
<td>Bindestrich (erlaubt andere Trennstellen)</td>
<td>`"=`</td>
</tr>
<tr>
<td>Trennstelle ohne Strich</td>
<td>`""`</td>
</tr>
<tr>
<td>Strich ohne Trennstelle</td>
<td>`"~`</td>
</tr>
</table>
<p data-category="Achtung!">Einige der Codes funktionieren nur mit eingebundenem `babel`-Paket.</p>
@preview
![](svg/chapter-05/silbentrennung-crop.svg)
@slide(layout=extra-content-only)
@title
Anführungszeichen
@content
<table>
<tr>
<th>Sprache</th>
<th style="text-align: center;">Befehl</th>
<th style="text-align: center;">Ergebnis</th>
</tr>
<tr>
<td>Deutsch</td>
<td style="text-align: center;">`\glqq … \grqq`</td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>&emsp;2. Ebene</td>
<td style="text-align: center;">` \glq … \grq `</td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>Deutsch altern.</td>
<td style="text-align: center;">`\frqq … \flqq`</td>
<td style="text-align: center;">»&hairsp;&hairsp;«</td>
</tr>
<tr>
<td>&emsp;2. Ebene</td>
<td style="text-align: center;">` \frq … \flq `</td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>Englisch (A.&thinsp;E.)</td>
<td style="text-align: center;"><code>\`\`…\'\'</code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>&emsp;2. Ebene</td>
<td style="text-align: center;"><code> \`…\' </code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>Englisch (B.&thinsp;E.)</td>
<td style="text-align: center;"><code> \`…\' </code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>&emsp;2. Ebene</td>
<td style="text-align: center;"><code>\`\`…\'\'</code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
</table>
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:
<table>
<tr>
<td><code>\\\`{o}</code></td><td>ò&emsp;&emsp;</td>
<td>`\c{c}`</td> <td>ç&emsp;&emsp;</td>
<td>`\d{u}`</td> <td></td>
</tr>
<tr>
<td>`\'{o}`</td> <td>ó</td>
<td>`\k{a}`</td> <td>ą</td>
<td>`\r{a}`</td> <td>å</td>
</tr>
<tr>
<td>`\^{o}`</td> <td>ô</td>
<td>`\l{}`</td> <td>ł</td>
<td>`\u{o}`</td> <td>ŏ</td>
</tr>
<tr>
<td>`\"{o}`</td> <td>ö</td>
<td>`\={o}`</td> <td>ō</td>
<td>`\v{s}`</td> <td>š</td>
</tr>
<tr>
<td>`\H{o}`</td> <td>ő</td>
<td>`\b{o}`</td> <td>o</td>
<td>`\t{oo}`</td><td>o͡o</td>
</tr>
<tr>
<td>`\~{o}`</td> <td>õ</td>
<td>`\.{o}`</td> <td>ȯ</td>
<td>`\o`</td> <td>ø</td>
</tr>
</table>
@slide(layout=extra-content-only)
@title
Sonderzeichen & Symbole
@content
Auch andere Sonderzeichen können entweder direkt eingegeben werden oder per Befehl:
<table>
<tr>
<td style="text-align: center;">¿</td> <td><code>?\`</code></td>
<td style="text-align: center;">¡</td> <td><code>!\`</code></td>
</tr>
<tr>
<td style="text-align: center;">^</td> <td>`\textasciicircum`</td>
<td style="text-align: center;">~</td> <td>`\textasciitilde`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textasteriskcentered`</td>
<td style="text-align: center;">\\</td> <td>`\textbackslash`</td>
</tr>
<tr>
<td style="text-align: center;">|</td> <td>`\textbar`</td>
<td style="text-align: center;"></td> <td>`\textbullet`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textcopyright`</td>
<td style="text-align: center;"></td> <td>`\textdagger`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textdaggerdbl`</td>
<td style="text-align: center;"></td> <td>`\textellipsis`</td>
</tr>
<tr>
<td style="text-align: center;">&lt;</td> <td>`\textless`</td>
<td style="text-align: center;">&gt;</td> <td>`\textgreater`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textperthousand`</td>
<td style="text-align: center;">§</td> <td>`\textsection`</td>
</tr>
</table>
… und so ziemlich alles andere.

View File

@ -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
<table>
<tr>
<th></th>
<th>Name</th>
<th>Use</th>
<th>Code</th>
</tr>
<tr>
<td>-</td>
<td>Hyphen</td>
<td>compound-forming hyphen</td>
<td>`-`</td>
</tr>
<tr>
<td></td>
<td>En dash *(Halbgeviert&shy;strich)*</td>
<td>a dash or a range: 12&hairsp;&hairsp;2 p.m.</td>
<td>`--`</td>
</tr>
<tr>
<td></td>
<td>Em dash *(Geviertstrich)*</td>
<td>a dash&hairsp;&hairsp;mostly in American English</td>
<td>`---`</td>
</tr>
</table>
@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! <span class="emoji">⛑️</span>
* 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
<div class="box warning">
From now on, compile the file `main-exercises.tex` to see your changes appear in the exercise script (in this task, see exercise 5).
</div>
* Replace the spaces in `exercises/special-characters.tex` within the abbreviations (“e.&thinsp;g.”, “i.&thinsp;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&nbsp;spacing,* i.&thinsp;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&nbsp;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.
<table>
<tr>
<td>Exclusive hyphenation</td>
<td>`\-`</td>
</tr>
<tr>
<td>Additional hyphenation</td>
<td>`"-`</td>
</tr>
<tr>
<td>Hyphen (suppressing other hyphenation)</td>
<td>`-`</td>
</tr>
<tr>
<td>Hyphen (allowing other hyphenation)</td>
<td>`"=`</td>
</tr>
<tr>
<td>Possible separation without hyphen</td>
<td>`""`</td>
</tr>
<tr>
<td>Non-breaking hyphen</td>
<td>`"~`</td>
</tr>
</table>
<p data-category="Caution!">Some of the codes only work when you use the `babel` package.</p>
@preview
![](svg/chapter-05/hyphenation-crop.svg)
@slide(layout=extra-content-only)
@title
Manual quotation
@content
<table>
<tr>
<th>Language</th>
<th style="text-align: center;">Command</th>
<th style="text-align: center;">Result</th>
</tr>
<tr>
<td>English (B.&thinsp;E.)</td>
<td style="text-align: center;"><code> \`…\' </code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>&emsp;2nd Level</td>
<td style="text-align: center;"><code>\`\`…\'\'</code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>English (A.&thinsp;E.)</td>
<td style="text-align: center;"><code>\`\`…\'\'</code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>&emsp;2nd Level</td>
<td style="text-align: center;"><code> \`…\' </code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>German</td>
<td style="text-align: center;">`\glqq … \grqq`</td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>&emsp;2nd Level</td>
<td style="text-align: center;">` \glq … \grq `</td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>German altern.</td>
<td style="text-align: center;">`\frqq … \flqq`</td>
<td style="text-align: center;">»&hairsp;&hairsp;«</td>
</tr>
<tr>
<td>&emsp;2nd Level</td>
<td style="text-align: center;">` \frq … \flq `</td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
</table>
Other rules my apply for other languages, but most of the time its 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:
<table>
<tr>
<td><code>\\\`{o}</code></td><td>ò&emsp;&emsp;</td>
<td>`\c{c}`</td> <td>ç&emsp;&emsp;</td>
<td>`\d{u}`</td> <td></td>
</tr>
<tr>
<td>`\'{o}`</td> <td>ó</td>
<td>`\k{a}`</td> <td>ą</td>
<td>`\r{a}`</td> <td>å</td>
</tr>
<tr>
<td>`\^{o}`</td> <td>ô</td>
<td>`\l{}`</td> <td>ł</td>
<td>`\u{o}`</td> <td>ŏ</td>
</tr>
<tr>
<td>`\"{o}`</td> <td>ö</td>
<td>`\={o}`</td> <td>ō</td>
<td>`\v{s}`</td> <td>š</td>
</tr>
<tr>
<td>`\H{o}`</td> <td>ő</td>
<td>`\b{o}`</td> <td>o</td>
<td>`\t{oo}`</td><td>o͡o</td>
</tr>
<tr>
<td>`\~{o}`</td> <td>õ</td>
<td>`\.{o}`</td> <td>ȯ</td>
<td>`\o`</td> <td>ø</td>
</tr>
</table>
@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:
<table>
<tr>
<td style="text-align: center;">¿</td> <td><code>?\`</code></td>
<td style="text-align: center;">¡</td> <td><code>!\`</code></td>
</tr>
<tr>
<td style="text-align: center;">^</td> <td>`\textasciicircum`</td>
<td style="text-align: center;">~</td> <td>`\textasciitilde`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textasteriskcentered`</td>
<td style="text-align: center;">\\</td> <td>`\textbackslash`</td>
</tr>
<tr>
<td style="text-align: center;">|</td> <td>`\textbar`</td>
<td style="text-align: center;"></td> <td>`\textbullet`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textcopyright`</td>
<td style="text-align: center;"></td> <td>`\textdagger`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textdaggerdbl`</td>
<td style="text-align: center;"></td> <td>`\textellipsis`</td>
</tr>
<tr>
<td style="text-align: center;">&lt;</td> <td>`\textless`</td>
<td style="text-align: center;">&gt;</td> <td>`\textgreater`</td>
</tr>
<tr>
<td style="text-align: center;"></td> <td>`\textperthousand`</td>
<td style="text-align: center;">§</td> <td>`\textsection`</td>
</tr>
</table>
… and pretty much anything else.

View File

@ -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 &raquo;Comprehensive TeX Archive Network&laquo; 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 <a href="https://www.overleaf.com/templates">&raquo;Templates&laquo;</a> 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!
<p><span style="display: inline-block; width: 2em;" class="emoji">📍</span>WE5/02.104 <br/>
<span style="display: inline-block; width: 2em;" class="emoji">☎️</span>0951 863 1219 <br/>
<span style="display: inline-block; width: 2em;" class="emoji">📧</span><a href="mailto:fachschaft-wiai.stuve@uni-bamberg.de">fachschaft-wiai.stuve@uni-bamberg.de</a>
</p>
<img src="images/logo-fachschaft.jpg" style="width:40%; margin: 0 auto; margin-top: 2em;
display:block;"/>
@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
<img src="svg/chapter-16/fooboar-latex-tut.jpg" style="width:100%; margin:0 auto; display: block;"/>

View File

@ -0,0 +1,104 @@
@slide(layout=chapter-slide)
@number
15
@title
Getting help and&nbsp;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, …): <a href="https://www.overleaf.com/templates">»Templates«</a>.
![](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&nbsp;come over or write us an e-mail!
<p><span style="display: inline-block; width: 2em;" class="emoji">📍</span>WE5/02.104 <br/>
<span style="display: inline-block; width: 2em;" class="emoji">☎️</span>0951 863 1219 <br/>
<span style="display: inline-block; width: 2em;" class="emoji">📧</span><a href="mailto:fachschaft-wiai.stuve@uni-bamberg.de">fachschaft-wiai.stuve@uni-bamberg.de</a>
</p>
<img src="images/logo-fachschaft.jpg" style="width:40%; margin: 0 auto; margin-top: 2em;
display:block;"/>
@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
<img src="svg/chapter-16/fooboar-latex-tut.jpg" style="width:100%; margin:0 auto; display: block;" />

View File

@ -0,0 +1,233 @@
@slide(layout=chapter-slide)
@number
10
@title
Tabellen
@slide(layout=content-only)
@title
Grundstruktur <span class="emoji">🗒️</span>
@content
Für typografisch schöne Tabellen nutzen wir das Paket `booktabs`.
``` {.hljs .lang-tex}
\usepackage{booktabs}
```
``` {.hljs .lang-tex}
\begin{table}[<position>]
\begin{tabular}{<spaltendefinition>}
% Tabelleninhalt
\end{tabular}
\caption{<tabellenunterschrift>}
\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}
```
<table>
<tr>
<th>Kürzel</th>
<th>Bedeutung</th>
</tr>
<tr class="fragment">
<td>l</td>
<td>linksbündige Spalte</td>
</tr>
<tr class="fragment">
<td>c</td>
<td>zentrierte Spalte</td>
</tr>
<tr class="fragment">
<td>r</td>
<td>rechtsbündige Spalte</td>
</tr>
</table>
++ 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}
```
<p data-category="Hinweis">Mit `@{}` vor und nach einer Spaltendefinition wird der umgebende Weißraum unterdrückt.</p>
<p data-category="Beispiel">`\begin{tabular}{@{}lrcl@{}}` beschränkt die Linien auf die Breite des Tabelleninhalts.</p>
@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}{<spaltendefinition>}
% Tabelleninhalt
\caption{<tabellenunterschrift>}
\label{<label>}
\end{longtable}
```
@slide(layout=extra-content-only)
@title
Hinweise zu `longtable`
@content
``` {.hljs .lang-tex}
\begin{longtable}{<spaltendefinition>}
% Tabelleninhalt
\caption{<tabellenunterschrift>}
\label{<label>}
\end{longtable}
```
* Die `longtable`-Umgebung vereint die `tabular`-Umgebung und die `table`-Umgebung.
* Titel und Label können deshalb direkt unter dem Tabelleninhalt stehen.
* Sofern das Paket `booktabs` eingebunden ist, stehen seine Features auch in `longtable` zur Verfügung.
@slide(layout=extra-content-only)
@title
Besonders breite Tabellen
@content
Sollte die Tabelle einmal zu breit für eine Seite werden, kann sie auch im Querformat dargestellt werden:
``` {.hljs .lang-tex}
\usepackage{rotating}
```
``` {.hljs .lang-tex}
\begin{sidewaystable}[<position>]
\begin{tabular}{<spaltendef.>}
% Tabelleninhalt
\end{tabular}
\end{sidewaystable}
```
@slide(layout=extra-content-and-preview)
@title
Weiterführendes Beispiel
@content
``` {.hljs .lang-tex}
\begin{table}[h]
\begin{tabular}{llr}
\toprule
Struktur & \multicolumn{2}{l}{Zeitkomplexität für Zugriff} \\ \cmidrule(r){2-3}
& Average & Worst \\
\midrule
Stack & $\mathcal{O}(n)$ & $\mathcal{O}(n)$ \\
Binärbaum & $\mathcal{O}(log(n))$ & $\mathcal{O}(log(n))$ \\
AVL-Baum & $\mathcal{O}(log(n))$ & $\mathcal{O}(log(n))$ \\
\bottomrule
\end{tabular}
\end{table}
```
[<span class="emoji">🔗</span> Dokumentation zu Booktabs](http://packages.oth-regensburg.de/ctan/macros/latex/contrib/booktabs/booktabs.pdf)
@preview
![](svg/chapter-12/tabelle-fortgeschritten-beispiel-crop.svg){.thin-padding}

View File

@ -0,0 +1,236 @@
@slide(layout=chapter-slide)
@number
10
@title
Tables
@slide(layout=content-only)
@title
Basic structure <span class="emoji">🗒️</span>
@content
For typographically pleasing tables, we use the `booktabs` package.
``` {.hljs .lang-tex}
\usepackage{booktabs}
```
``` {.hljs .lang-tex}
\begin{table}[<position>]
\begin{tabular}{<column definition>}
% table content
\end{tabular}
\caption{<caption>}
\end{table}
```
Positioning works just like with graphics.
@slide(layout=content-and-preview)
@title
Column definitions
@content
``` {.hljs .lang-tex}
\begin{tabular}{lrcl}
% table content
\end{tabular}
```
<table>
<tr>
<th>letter</th>
<th>meaning</th>
</tr>
<tr class="fragment">
<td>l</td>
<td>left-justified column</td>
</tr>
<tr class="fragment">
<td>c</td>
<td>centred column</td>
</tr>
<tr class="fragment">
<td>r</td>
<td>right-justified column</td>
</tr>
</table>
++ Vertical separator lines and double horizontal lines are frowned upon by typographers and should be avoided.
@preview
![](svg/chapter-12/table-example-crop.svg){.thin-padding}
@slide(layout=content-and-preview)
@title
Table content
@content
``` {.hljs .lang-tex}
\begin{tabular}{lll}
\toprule
Column 1 & Column 2 & Column 3 \\
\midrule
Content a & Content b & Content c \\
Content e & Content f & Content g \\
Content i & Content j & Content k \\
\bottomrule
\end{tabular}
```
* ++ Columns are separated by `&`.
* ++ Rows are ended by `\\`.
* ++ `\toprule`, `\midrule` and `\bottomrule` structure the table.
@preview
![](svg/chapter-12/table-content-example-crop.svg){.thin-padding}
@slide(layout=wide-content)
@title
The entire table
@content
``` {.hljs .lang-tex}
\begin{table}[h]
\begin{tabular}{lrcl}
\toprule
Language & Author & Year & Filename extension \\
\midrule
C++ & Bjarne Stroustrup & 1985 & .cpp \\
Java & James Gosling & 1998 & .java \\
Python & Guido van Rossum & 1991 & .py \\
\bottomrule
\end{tabular}
\caption{Well-known programming languages}
\end{table}
```
<p data-category="Note">`@{}` to the left and right of a column definition removes the padding of the corresponding column.</p>
<p data-category="Example">`\begin{tabular}{@{}lrcl@{}}` limits the row separators to the width of the table content</p>
@slide(layout=content-only)
@title
More comfort
@content
The [Tables Generator](https://tablesgenerator.com/) is a wonderful tool to quickly create tables of different formats.
[![](svg/chapter-12/tables-generator.png)](https://tablesgenerator.com/)
@slide(layout=task)
@task-number
10
@title
Typesetting tables
@content
* The list in file `exercises/tables/tables.tex` stores information on a few modules of the WIAI faculty.
* Transform the list into a **table**.
* The table shall have colums for the *name*, the *abbreviation* (Kürzel) and the *semester* of the lectures.
* Add a **column** with **center-aligned text** on the left side of the table in order to **number** the lectures.
* Add a **caption** for the table.
@slide(layout=extra-content-only)
@title
Particularly long tables
@content
Tables that exceed one page are simply cut off by `tabular`. A solution is offered by the `longtable` package:
``` {.hljs .lang-tex}
\usepackage{longtable}
```
``` {.hljs .lang-tex}
\begin{longtable}{<column definition>}
% table content
\caption{<caption>}
\label{<label>}
\end{longtable}
```
@slide(layout=extra-content-only)
@title
Notes on `longtable`
@content
``` {.hljs .lang-tex}
\begin{longtable}{<column definition>}
% table content
\caption{<caption>}
\label{<label>}
\end{longtable}
```
* The `longtable` environment merges the `tabular` and `table` environments.
* Caption and label can therefore be inserted directly under the table content.
* As long as the `booktabs` package is used, its features are also provided in `longtable`.
@slide(layout=extra-content-only)
@title
Particularly wide tables
@content
If you need a table to be wider than a page, you can display it in landscape orientation:
``` {.hljs .lang-tex}
\usepackage{rotating}
```
``` {.hljs .lang-tex}
\begin{sidewaystable}[<position>]
\begin{tabular}{<column def.>}
% table content
\end{tabular}
\end{sidewaystable}
```
@slide(layout=extra-content-and-preview)
@title
An advanced example
@content
``` {.hljs .lang-tex}
\begin{table}[h]
\begin{tabular}{llr}
\toprule
Structure & \multicolumn{2}{l}{Access time complexity} \\ \cmidrule(r){2-3}
& Average & Worst \\
\midrule
Stack & $\mathcal{O}(n)$ & $\mathcal{O}(n)$ \\
Binary tree & $\mathcal{O}(log(n))$ & $\mathcal{O}(n)$ \\
AVL tree & $\mathcal{O}(log(n))$ & $\mathcal{O}(log(n))$ \\
\bottomrule
\end{tabular}
\end{table}
```
[<span class="emoji">🔗</span> Booktabs documentation](http://packages.oth-regensburg.de/ctan/macros/latex/contrib/booktabs/booktabs.pdf)
@preview
![](svg/chapter-12/table-advanced-example-crop.svg){.thin-padding}

View File

@ -0,0 +1,172 @@
@slide(layout=chapter-slide)
@number
6
@title
Text&shy;auszeichnung
@slide(layout=content-and-preview)
@title
Semantische und optische Hervorhebungen
@content
Semantische Hervorhebungen durch `\emph{}`:
``` {.lang-tex .hljs}
\emph{Super wichtiger Text \emph{mit noch
wichtigerem Text} im Text.}
```
Optische Auszeichnungsmöglichkeiten:
<table>
<tr><th>Bezeichnung</th><th>Befehl</th></tr>
<tr><td>fett (bold face)</td><td>`\textbf{wichtig}`</td></tr>
<tr><td>kursiv (italics)</td><td>`\textit{wichtig}`</td></tr>
<tr><td>Kapitälchen (small&nbsp;caps)</td><td>`\textsc{wichtig}`</td></tr>
<tr><td>dicktengleich (teletype)</td><td>`\texttt{wichtig}`</td></tr>
<tr><td>unterstrichen</td><td>`\underline{wichtig}`</td></tr>
</table>
@preview
<img class="thin-padding" src="svg/chapter-06/hervorhebungen-crop.svg" style="margin-bottom: 0; margin-top: 100px"/>
<img class="thin-padding" src="svg/chapter-06/optische-auszeichnungen-crop.svg" />
@slide(layout=content-only)
@title
Better Call LaTeX!
@content
<div class="box warning">
**Ein gutgemeinter Rat**
Konsistentes Aussehen über das gesamte Dokument hinweg gewünscht?
Voreinstellungen von LaTeX zur Schriftgröße verschiedener Textelemente (Titel, Fließtext, Fußnoten) vertrauen!
Das heißt im Umkehrschluss: Möglichst wenig manuell an Schriftgrößen herumschrauben.
</div>
@slide(layout=content-and-preview)
@title
URLs
@content
Das Paket `hyperref` stellt den Befehl `\url{}` bereit, der URLs
* zeichentreu
* mit bindestrichlosen Umbrüchen
* mit gut unterscheidbaren Zeichen
* im PDF anklickbar
wiedergibt.
``` {.lang-tex .hljs}
\url{https://www.latex-project.org/}
```
@preview
![](svg/chapter-06/url-crop.svg)
@slide(layout=task)
@task-number
6
@title
Text hervorheben
@content
* **Betont** in der Datei `exercises/text-markup/markup.tex` die Wörter *Recursion* und *recursive* mit `\emph{…}`.
* Macht die **URL** im Text anklickbar.
@slide(layout=extra-content-and-preview)
@title
Schriftgröße
@content
### Voreingestellte Schriftgrößen
``` {.hljs .lang-tex}
{\<fontsize> ein Textabschnitt}
```
Schriftgrößen relativ zu `normalsize`:
``` {.hljs .lang-tex}
{\tiny Wenn}
{\footnotesize du}
{\small das}
{\normalsize lesen}
{\large kannst,}
{\Large brauchst}
{\LARGE du}
{\huge keine}
{\Huge Brille.}
```
@preview
![](svg/chapter-06/schriftgroesse-optiker-crop.svg){.thin-padding}
@slide(layout=extra-content-and-preview)
@title
Flattersatz
@content
Standardmäßig setzt LaTeX Fließtext im Blocksatz, aber auch Flattersatz ist möglich.
``` {.lang-tex .hljs}
\raggedright … \raggedleft …
\centering …
```
Alternativ einsetzbare Umgebungen:
``` {.lang-tex .hljs}
\begin{flushleft} Text \end{flushleft}
\begin{flushright} Text \end{flushright}
\begin{center} Text \end{center}
```
<p data-category="Achtung!">Guter Flattersatz ist noch schwieriger als guter Blocksatz, daher lieber vermeiden!</p>
@preview
![](svg/chapter-07/ausrichtung-crop.svg)
@slide(layout=extra-content-and-preview)
@title
Einzüge und Abstände
@content
* Absätze werden standardmäßig durch Erstzeileneinzüge (`\parindent`) verdeutlicht
* Stattdessen (!) können auch Abstände (`\parskip`) verwendet werden
* Die beiden Parameter sind beliebig einstellbar:
``` {.lang-tex .hljs}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1em
plus .5em % erlaubte Dehnung
minus .5em % erlaubte Stauchung
}
```
* Mit `\noindent` kann für nur einen Absatz der Einzug abgeschaltet werden
@preview
![](./svg/chapter-07/einzüge-abstände-orig.svg)

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