Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e0f61faefe | |||
| b4a864b6c9 |
83
.gitignore
vendored
83
.gitignore
vendored
@ -1,87 +1,6 @@
|
||||
### LaTeX ###
|
||||
## Core latex/pdflatex auxiliary files:
|
||||
*.aux
|
||||
*.loc
|
||||
*.lof
|
||||
*.log
|
||||
*.lot
|
||||
*.fls
|
||||
*.out
|
||||
*.soc
|
||||
*.tmp
|
||||
*.toc
|
||||
*.fmt
|
||||
*.fot
|
||||
*.cb
|
||||
*.cb2
|
||||
.*.lb
|
||||
|
||||
## Intermediate documents:
|
||||
*.dvi
|
||||
*.xdv
|
||||
*-converted-to.*
|
||||
# these rules might exclude image files for figures etc.
|
||||
# *.ps
|
||||
# *.eps
|
||||
# *.pdf
|
||||
|
||||
## Generated if empty string is given at "Please type another file name for output:"
|
||||
.pdf
|
||||
|
||||
## Bibliography auxiliary files (bibtex/biblatex/biber):
|
||||
*.bbl
|
||||
*.bcf
|
||||
*.blg
|
||||
*-blx.aux
|
||||
*-blx.bib
|
||||
*.run.xml
|
||||
|
||||
## Build tool auxiliary files:
|
||||
*.fdb_latexmk
|
||||
*.synctex
|
||||
*.synctex(busy)
|
||||
*.synctex.gz
|
||||
*.synctex.gz(busy)
|
||||
*.pdfsync
|
||||
|
||||
## Build tool directories for auxiliary files
|
||||
# latexrun
|
||||
latex.out/
|
||||
|
||||
# hyperref
|
||||
*.brf
|
||||
|
||||
# minted
|
||||
_minted*
|
||||
*.pyg
|
||||
|
||||
# todonotes
|
||||
*.tdo
|
||||
|
||||
## Editors:
|
||||
# LyX
|
||||
*.lyx~
|
||||
|
||||
# Kile
|
||||
*.backup
|
||||
|
||||
# TeXnicCenter
|
||||
*.tps
|
||||
|
||||
### vscode ###
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
*.code-workspace
|
||||
|
||||
### vim
|
||||
*.swp
|
||||
*.swo
|
||||
|
||||
main-*.pdf
|
||||
listings-mode.tex
|
||||
exercise-mode.tex
|
||||
public
|
||||
exercises/*/*.pdf
|
||||
temp
|
||||
|
||||
366
CHANGES
Normal file
366
CHANGES
Normal file
@ -0,0 +1,366 @@
|
||||
============================================================
|
||||
Aenderungen von Version 2.3 zu 3.0 2012-07 (MD, PGU)
|
||||
|
||||
Auf aktuelle Gegebenheiten angepasst. Änderungen siehe
|
||||
https://github.com/texdoc/l2kurz
|
||||
============================================================
|
||||
Aenderungen von Version 2.2 zu 2.3 2003-04-10 (WaS)
|
||||
|
||||
* Die Kurzbeschreibung wird unter die "GNU Free
|
||||
Documentation License" gestellt.
|
||||
|
||||
* 7.3 (Andere Schriftfamilien): Erwaehnung von mathpazo
|
||||
statt mathpple
|
||||
|
||||
* 8.1.1 (Zeilenabstand): sinnvolleres Anwendungsbeispiel
|
||||
fuer \linespread
|
||||
|
||||
* diverse Schreibfehler beseitigt; Abkuerzungen und Akronyme
|
||||
mit Kapitaelchen gesetzt
|
||||
|
||||
* E-Mail-Adresse aktualisiert
|
||||
|
||||
|
||||
============================================================
|
||||
Aenderungen von Version 2.1 zu 2.2 2001-06-10 (WaS)
|
||||
|
||||
* Die Kurzbeschreibung wird nur noch als Quelltext und PDF
|
||||
verteilt. DVI ist nicht sinnvoll, da wegen eingebundenem
|
||||
EPS-Bild abhaengig vom Treiber; PostScript ist
|
||||
unwirtschaftlich (zu gross) und bietet keine Vorteile
|
||||
gegenueber PDF. Die PDF-Version wurde mit VTeX 7.32
|
||||
erzeugt und macht keine Probleme mit Acrobat Reader 5.
|
||||
|
||||
* Quelltext: hyperref.sty und die TC-Fonts (!) werden
|
||||
jetzt zwingend vorausgesetzt.
|
||||
|
||||
* zahlreiche kleine Verbesserungen der Formulierung;
|
||||
Schreibfehler ausgebessert; Querverweise ergaenzt;
|
||||
|
||||
* 1.1.3: LaTeX wird nur noch jaehrlich aktualisiert
|
||||
|
||||
* 1.2.4 (Arbeitsablauf): Neben DVI werden nun auch
|
||||
PDF und PostScript als Ausgabeformate erwaehnt.
|
||||
|
||||
* Tab.1 (Klassen): statt slides wird foils erwaehnt;
|
||||
proc wird weggelasen, weil auch im LaTeX-Handbuch
|
||||
nicht beschrieben.
|
||||
|
||||
* Tab.3 (Pakete): geometry und fancyhdr ergaenzt, weil
|
||||
populaer; array u.a. weggelassen, weil fuer Anfaenger
|
||||
irrelevant.
|
||||
|
||||
* Kap.4 (Formeln): Differentiale werden jetzt aufrecht
|
||||
gescbrieben: \mathrm{d}x
|
||||
|
||||
* Kap.5 (Bilder): Neue Formulierung ohne Bezug auf
|
||||
DVI-Treiber; auf vielfache Anregung hin wird generell
|
||||
auf graphicx.sty statt auf graphics.sty verwiesen.
|
||||
|
||||
* Kap.7 (Schriften): Aenderungen in Hinblick auf die
|
||||
inzwischen uebliche Unterstuetzung von
|
||||
PostScript-Schriften.
|
||||
|
||||
* Literatur: Hinweise auf neue PSNFSS-Doku (ab v8.1) und auf
|
||||
die FAQ ergaenzt.
|
||||
|
||||
* Neue E-Mail-Adresse was@VR-Web.de
|
||||
|
||||
|
||||
============================================================
|
||||
Korrekturen in v2.1 [1999-05-24 (WaS)]
|
||||
|
||||
* 3.1: Querverweis korrigiert (2.5 stattt 2.4)
|
||||
|
||||
|
||||
============================================================
|
||||
Aenderungen von v2.0 zu v2.1 [1999-04-18 (WaS)]
|
||||
|
||||
Fehlerkorrekturen:
|
||||
|
||||
* Praeambel: \NeedsTeXFormat{LaTeX2e}[1998/06/01]
|
||||
|
||||
* 2.5: `In Tab. 1 ... sind Klassen aufgefuehrt, ...'
|
||||
(statt: `alle Klassen');
|
||||
|
||||
* 4.1, Aufzaehlungspunkt 3: \textnormal statt \textrm
|
||||
|
||||
* 4.5: \backslash aus Tab.9 entfernt (siehe Tab.15)
|
||||
|
||||
* 4.5: \lhd, \unlhd, \rhd, \unrhd von Tab.12 nach Tab.11
|
||||
(Operatoren) versetzt.
|
||||
|
||||
* 4.5: In Tab.12 (Relationen) den Doppelpunkt (:) ergaenzt.
|
||||
|
||||
* Schreib-, Satz- und stilistische Fehler korrigiert
|
||||
|
||||
Sonstige Aenderungen:
|
||||
|
||||
* Wenn die tc-Fonts fehlen, wird die Liste der TS1-Symbole
|
||||
durch einen Hinweistext ersetzt; es sollte aber _kein_
|
||||
TeX-Fehler auftreten. Es wird dazu die Existenz von
|
||||
tcrm1095.tfm abgeprueft.
|
||||
|
||||
* Neue Email-Adresse <walter.schmidt@arcormail.de>
|
||||
|
||||
* Die Bedingungen fuer eine Verteilung der Kurzbeschreibung
|
||||
erscheinen nun auch in der gedruckten Fassung.
|
||||
|
||||
* geaendertes CTAN-Verzeichnis
|
||||
|
||||
* Kopfzeilen entfernt; durch die Untergliederung in viele
|
||||
kurze Abschnitte mit eigenen Ueberschriften sind lebende
|
||||
Kolumnentitel IMHO ueberfluesig; ausserdem vertragen sie
|
||||
sich schlecht mit den vielen Abschnittsueberschriften am
|
||||
Seitenanfang.
|
||||
|
||||
* Aus den meisten Quellcode-Beispielen wurde die fuer
|
||||
Anfaenger abschreckende german-Notation entfernt. (z.T.
|
||||
durch Umformulieren ;-) In Kap.2.4.5 wird aber explizit
|
||||
darauf hingewiesen, dass sie in _einigen_ Beispiel benutzt
|
||||
wird.
|
||||
|
||||
* In den Quellcode-Beispielen werden die expliziten
|
||||
Zeilenenden \\ weggelassen, wenn die einzelnen Zeilen
|
||||
getrennte Beispiele darstellen. (Uebersichtlichkeit!)
|
||||
|
||||
* 2.7 (inputenc.sty): Hinweis auf VMS ergaenzt; Fussnote
|
||||
entfernt (die Fehlermeldung wurde inzwischen vernessert!)
|
||||
|
||||
* Tab.1 (Klassen) + Tab.3 (Pakete): Hinweis auf a4.sty
|
||||
entfernt; stattdessen wird nun auf die KOMA-Script-Klassen
|
||||
hingewiesen.
|
||||
|
||||
* Tab.3 (Pakete): alltt.sty aufgefuehrt, weil es zur
|
||||
Basisverteilung gehoert und ausserdem in der
|
||||
Kurzbeschreibung selbst benutzt wird. (was wiederum in
|
||||
Abschnitt 2.6 erwaehnt wird.)
|
||||
|
||||
* 3.2.1: Hinweis auf Klasse slides ergaenzt; Formulierung
|
||||
geaendert.
|
||||
|
||||
* 3.6: Den Hinweis ergaenzt, dass \footnote nicht in
|
||||
Gleitobjekten, Tabellen und der tabular-Umg. erlaubt ist.
|
||||
|
||||
* 4.5: Tab.13 heisst jetzt `Negierte Relationen' (anstelle
|
||||
von `Negationen')
|
||||
|
||||
* 6.2.1: Ergaenzung: Was geschieht bei \begin{figure}[h] ?
|
||||
|
||||
* 7.3: In Tab.18 courier.sty und mathpple.sty ergaenzt.
|
||||
|
||||
* 8.1.2: Text und Beispiele uebersichtlicher angeordnet.
|
||||
|
||||
* Anhang A (Textsymbole): Es sind nun diejenigen Symbole
|
||||
gekennzeichnet, die auch mit PostScript-Fonts verfuegbar
|
||||
verfuegbar sind, wenn diese fuer TS1 aufbereitet wurden.
|
||||
|
||||
* ebd.: Fuer die auch ohne textcomp.sty vorhandenen Symbole
|
||||
werden die ueblichen Makros entspr. Abschnitt 3.4.5
|
||||
angegeben, also z.B. \S statt \textsection.
|
||||
|
||||
* Literatur: `Notes on the setup of PostScript fonts ...'
|
||||
entfernt, weil es leider teilweise veraltet und
|
||||
irrefuehrend ist.
|
||||
K. Reckdahls "epslatex" auf vielfachen Wunsch ergaenzt.
|
||||
A. Reicherts Typografie-Workshop ergaenzt.
|
||||
|
||||
|
||||
============================================================
|
||||
Aenderungen von Version 1.2 zu 2.0 (WaS)
|
||||
|
||||
Die `Kurzbeschreibung' wurde im Wesentlichen aktualisiert
|
||||
und an einigen Stellen (hoffentlich) verbessert. Es war
|
||||
aber _nicht_ meine Absicht, sie `vollstaendiger' zu machen;
|
||||
das wuerde schlussendlich zu einem zweiten `LaTeX-Handbuch'
|
||||
fuehren. LaTeX 2.09 wird nicht mehr beruecksichtigt.
|
||||
|
||||
Die wichtigsten Aenderungen im Detail:
|
||||
|
||||
* E. Schlegl aus der Autorenliste gestrichen, weil die von
|
||||
ihr verfasste Einleitung neu formuliert wurde.
|
||||
|
||||
* Kein twoside-Layout (stoert beim normalen Ausdrucken)
|
||||
|
||||
* a4.sty wird nicht mehr benutzt, weil sein Satzspiegel bei
|
||||
einseitiger Formatierung nicht horizontal zentriert ist.
|
||||
|
||||
* Eigenes Titelblatt; dieses umd die folgende Seite neu
|
||||
formuliert und gestaltet.
|
||||
|
||||
* 1.2.1: Die manuelle Arbeitsweise wird nur noch in der
|
||||
Vergangenheitsform erlaeutert.
|
||||
|
||||
* In Kap. 1 ergaenzt, wofuer LaTeX geeignet ist, und wofuer
|
||||
nicht; Liste der Vor- und Nachteile von LaTeX nur in
|
||||
diesem Rahmen.
|
||||
|
||||
* 1.1.3: `LaTeX 2e': Das Dokument bezieht sich nun auf
|
||||
LaTeX2e von Juni 1998, wegen mathptmx.sty und \mathring.
|
||||
|
||||
* neues Kap. 1.2.4: typische Arbeitsweise von LaTeX
|
||||
(Editieren, Setzen, Preview, Druck)
|
||||
|
||||
* Die Reihenfolge in Kapitel 2 umgestellt: `Spezielle
|
||||
Zeichen' umbenannt in `Zeichensatz' und nach hinten
|
||||
verschoben, weil inputenc erst verstaendlich ist, nachdem
|
||||
`Pakete' erklaert wurden.
|
||||
|
||||
* Den Begriff `Vorspann' eingefuehrt, weil nachfolgend
|
||||
darauf verwiesen wird: Pakete werden nur im `Vorspann'
|
||||
geladen.
|
||||
|
||||
* Im Abschnitt `Zeichensatz' wird nun auch die direkte
|
||||
Eingabe von Sonderzeichen beschrieben. Das wird
|
||||
heutzutage als Selbstverstaendlichkeit erwartet und darf
|
||||
keinesfalls erst als `Sonderfall' in einem spaeteren
|
||||
Kapitel auftauchen! Leider gibt es keine fuer den
|
||||
normalen Benutzer brauchbaren Tabellen der (im Text oder
|
||||
in Formeln) erlaubten Eingabezeichen, auf die hier
|
||||
verwiesen werden koennte! Auf's Listing von inputenc.dtx
|
||||
sollte jedenfalls nicht verwiesen werden.
|
||||
|
||||
* Die Tabelle `Pakete' wurde ueberarbeitet.
|
||||
|
||||
* Den Abschnitt `Layout' entfernt, denn `Klassen' und
|
||||
`Pakete' haben nicht nur mit Layout zu tun. Nachdem fuer
|
||||
diesen Abschnitt nur noch `Seitenstil' uebrig bleibt, habe
|
||||
ich das zusammen mit den Gleitobjekten in einen neuen
|
||||
Abschnitt `Seitenaufbau' versetzt.
|
||||
|
||||
* Den Abschnitt `Deutschsprachige Texte' an den Anfang des
|
||||
Kapitels `Setzen von Text' verschoben, weil man das als
|
||||
Allererstes braucht! In den folgenden Abschnitten wird
|
||||
dann jeweils erwaehnt, was sich durch Laden von german.sty
|
||||
aendert. Die Liste der internen Bezeichner wie
|
||||
\chaptername wurde weggelassen.
|
||||
|
||||
* Im Kapitel `Blocksatz' die Hinweise auf Absaetze mit
|
||||
vertikalem Abstand anstelle des Einzugs entfernt. Die
|
||||
angegebenen Befehle hatten zu viele unschoene
|
||||
Nebenwirkungen! Leider gibt es AFAIK keine allgemein
|
||||
verfuegbares Paket, das nur die Absaetze entsprechend
|
||||
umstellt.
|
||||
|
||||
* Im Abschnitt `Silbentrennung' wird nicht mehr auf den
|
||||
german-Befehl "= hingewiesen, weil der in der Hand eines
|
||||
Laien gefaehrlich ist: Bei zusammengesetzten Woertern
|
||||
sollte man lieber _nur_ explizite Trennstellen mit \-
|
||||
angeben, siehe gerdoc.tex! Der Befehl \discretionary wird
|
||||
nicht mehr beschrieben; in deutschen Texten wird
|
||||
normalerweise nur "ck, "ff usw. gebraucht, und mit der
|
||||
neuen Rechtschreibung nicht einmal mehr das!
|
||||
|
||||
* Anfuehrungszeichen: `` und '' sind nicht _englische_
|
||||
Quotes, sondern _amerikanische_. Die Beschreibung der
|
||||
deutschen Anfuehrungszeichen als Ligaturen ,, und '' wurde
|
||||
entfernt, denn mit der allgemeinen Verfuegbarkeit vom
|
||||
german.sty ist sie nicht noetig und verwirrt nur.
|
||||
|
||||
* Den Abschnitt `Akzente und spezielle Zeichen' weitgehend
|
||||
umgeschrieben und nochmal auf die direkte Eingabe von
|
||||
Sonderzeichen hingewiesen.
|
||||
|
||||
* Den Abschnitt `Abstaende' umbenannt in `Wortabstand' und
|
||||
weiter nach vorne versetzt.
|
||||
|
||||
* Im Abschnitt `Hervorgehobene Woerter' nur noch \emph
|
||||
erklaert, nicht mehr \em. Auch die Beschreibung von
|
||||
\nocorr gehoert IMO nicht in eine Kurzanleitung (siehe
|
||||
T.Oetikers engl. Fassung!). Den Abschnitt umbenannt in
|
||||
`Hervorgehobener Text'.
|
||||
|
||||
* Neu: `Hochgestellter Text'
|
||||
|
||||
* `Setzen von ... Formeln / Allgemeines': Hochstellen von
|
||||
Text gehoert nicht mehr zu `mathematischen Texten', und
|
||||
Tiefstellen wird hier ganz einfach nicht mehr erwaehnt.
|
||||
|
||||
* In den Tabellen der math. Symbole ist nun klar erkennbar,
|
||||
ob ein Zeichen Operator, Relation oder Delimiter ist. Das
|
||||
\| (aus der Tabelle `sonstige Symbole') wurde zu den
|
||||
Klammerungssymbolen versetzt. Dort wurden auch | und
|
||||
\backslash neu aufgenommen.
|
||||
|
||||
* In Tabelle `Relationen' \notin ergaenzt.
|
||||
|
||||
* In der Tabelle `Klammern' die Synonyme fuer \{ \} \[ \]
|
||||
entfernt. Ist in einer Kurzanleitung IMO unnoetig und
|
||||
verwirrt nur.
|
||||
|
||||
* Tabelle `Synonyme' entfernt - Begruendung dito!
|
||||
|
||||
* Kapitel `Gleitobjekte': Die Erklaerung der Umgebungen
|
||||
figure und table schien mir besser unter den Oberbegriff
|
||||
`Gleitobjekte' zu passen. Ich erinnere mich, dass ich
|
||||
selbst seinerzeit LaTeX durch die `Kurzanleitung'
|
||||
kennenlernte; der eigentliche Sinn von Gleitobjekten blieb
|
||||
mir dabei lange unklar, da ich die Umgebungen `figure' und
|
||||
`table' primaer mit Ihrem Inhalt (Bilder und Tabellen) in
|
||||
Zusammenhang brachte, weniger mit dem `Gleiten'.
|
||||
Ausserdem wurden ser Begriff `Tafel' durch `Tabelle'
|
||||
ersetzt und die Erklaerung der Plazierungsparameter
|
||||
korrigiert.
|
||||
|
||||
* Neues Kapitel `Setzen von Bildern'
|
||||
|
||||
* Neues Kapitel `Schriften' (Groessen, Stil,
|
||||
Schriftfamilien, europaeische Schriften). Eine Uebersicht
|
||||
ueber die TS1-Textsymbole ist bewusst nur als Anhang
|
||||
aufgenommen; sie sollte entfallen, sobald eine derartige
|
||||
Liste in der offiziellen LaTeX-Doku enthalten ist.
|
||||
(Hoffentlich bald !!!)
|
||||
|
||||
* Horizontale Abstaende: Beispiele geaendert
|
||||
|
||||
* Tab `Laengenmasse': Big Point zusaetzlich aufgefuehrt,
|
||||
weil diese Masseinheit im Zusammenhang mit PostScript
|
||||
haeufig vorkommt. Es werden soweit wie moeglich _exakte_
|
||||
Definitionen angegeben!
|
||||
|
||||
* Briefe: Den Hinweis auf Adressetiketten entfernt, weil
|
||||
das auch im offiziellen LaTeX-Handbuch nicht beschrieben
|
||||
wird (und weil es sowieso ein Schmarrn ist ;-). Hinweis
|
||||
auf dinbrief.cls.
|
||||
|
||||
* Robuste und zerbrechliche Befehle: Das Kapitel enthaelt
|
||||
nun eine Kurzfassung dessen, was im LaTeX(2e)-Handbuch
|
||||
steht. Befehle, die in der Kurzanleitung sonst nicht
|
||||
erwaenht werden, werden auch hier nicht in Bezug auf
|
||||
`Robustheit' oder `bewegte Argumente' beschrieben. Der
|
||||
Titel des Kapitels wurde in `Zerbrechliche Befehle'
|
||||
geaendert, weil das Wort `robust' gar nicht erst
|
||||
eingefuehrt wird.
|
||||
|
||||
* Kompatibilitaet mit LaTeX 2.09: Abschnitt entfernt! Wer
|
||||
schon mit LaTeX 2.09 zu tun hatte, wird heute keine
|
||||
Lektuere fuer Einsteiger lesen!
|
||||
|
||||
* Literaturverzeichnis: Total ueberarbeitet und aktualisiert.
|
||||
|
||||
* L2K4.TEX auf drei Dateien (L2K4, L2K5, L2K6) aufgeteilt.
|
||||
|
||||
============================================================
|
||||
Changes from version 1.1 to 1.2
|
||||
* Added german editions of Lamport and Goosens et. al.
|
||||
* Updated to LaTeX2e 95/06/01 (mentioning cfgguide.tex,
|
||||
modguide.tex, fontenc.sty, inputenc.sty)
|
||||
* Changed list of packages, added `fontenc'/`inputenc'
|
||||
* Rewrote paragraph about float placement parameters, additional
|
||||
explanation of \nocorr
|
||||
* Added more hyphenation suggestions, `sloppypar' environment,
|
||||
and `\hbadness' hacks to avoid `underfull hbox' warnings (and
|
||||
to simplify a change of the paper size)
|
||||
* Replaced almost all old style font command \rm,...\tt by
|
||||
their \text... equivalents, replaced $...$ by \(...\)
|
||||
|
||||
|
||||
============================================================
|
||||
Changes from version 1 to 1.1
|
||||
* Applied orthographical and stilistic corrections, many of
|
||||
which were suggested by Luzia Dietsche
|
||||
* Rewrote one sentence to avoid `overfull hbox'
|
||||
* Added `newlfont' to the list of packages
|
||||
|
||||
== finis
|
||||
|
||||
428
LICENSE
428
LICENSE
@ -1,428 +0,0 @@
|
||||
Attribution-ShareAlike 4.0 International
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons Corporation ("Creative Commons") is not a law firm and
|
||||
does not provide legal services or legal advice. Distribution of
|
||||
Creative Commons public licenses does not create a lawyer-client or
|
||||
other relationship. Creative Commons makes its licenses and related
|
||||
information available on an "as-is" basis. Creative Commons gives no
|
||||
warranties regarding its licenses, any material licensed under their
|
||||
terms and conditions, or any related information. Creative Commons
|
||||
disclaims all liability for damages resulting from their use to the
|
||||
fullest extent possible.
|
||||
|
||||
Using Creative Commons Public Licenses
|
||||
|
||||
Creative Commons public licenses provide a standard set of terms and
|
||||
conditions that creators and other rights holders may use to share
|
||||
original works of authorship and other material subject to copyright
|
||||
and certain other rights specified in the public license below. The
|
||||
following considerations are for informational purposes only, are not
|
||||
exhaustive, and do not form part of our licenses.
|
||||
|
||||
Considerations for licensors: Our public licenses are
|
||||
intended for use by those authorized to give the public
|
||||
permission to use material in ways otherwise restricted by
|
||||
copyright and certain other rights. Our licenses are
|
||||
irrevocable. Licensors should read and understand the terms
|
||||
and conditions of the license they choose before applying it.
|
||||
Licensors should also secure all rights necessary before
|
||||
applying our licenses so that the public can reuse the
|
||||
material as expected. Licensors should clearly mark any
|
||||
material not subject to the license. This includes other CC-
|
||||
licensed material, or material used under an exception or
|
||||
limitation to copyright. More considerations for licensors:
|
||||
wiki.creativecommons.org/Considerations_for_licensors
|
||||
|
||||
Considerations for the public: By using one of our public
|
||||
licenses, a licensor grants the public permission to use the
|
||||
licensed material under specified terms and conditions. If
|
||||
the licensor's permission is not necessary for any reason--for
|
||||
example, because of any applicable exception or limitation to
|
||||
copyright--then that use is not regulated by the license. Our
|
||||
licenses grant only permissions under copyright and certain
|
||||
other rights that a licensor has authority to grant. Use of
|
||||
the licensed material may still be restricted for other
|
||||
reasons, including because others have copyright or other
|
||||
rights in the material. A licensor may make special requests,
|
||||
such as asking that all changes be marked or described.
|
||||
Although not required by our licenses, you are encouraged to
|
||||
respect those requests where reasonable. More considerations
|
||||
for the public:
|
||||
wiki.creativecommons.org/Considerations_for_licensees
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 International Public
|
||||
License
|
||||
|
||||
By exercising the Licensed Rights (defined below), You accept and agree
|
||||
to be bound by the terms and conditions of this Creative Commons
|
||||
Attribution-ShareAlike 4.0 International Public License ("Public
|
||||
License"). To the extent this Public License may be interpreted as a
|
||||
contract, You are granted the Licensed Rights in consideration of Your
|
||||
acceptance of these terms and conditions, and the Licensor grants You
|
||||
such rights in consideration of benefits the Licensor receives from
|
||||
making the Licensed Material available under these terms and
|
||||
conditions.
|
||||
|
||||
|
||||
Section 1 -- Definitions.
|
||||
|
||||
a. Adapted Material means material subject to Copyright and Similar
|
||||
Rights that is derived from or based upon the Licensed Material
|
||||
and in which the Licensed Material is translated, altered,
|
||||
arranged, transformed, or otherwise modified in a manner requiring
|
||||
permission under the Copyright and Similar Rights held by the
|
||||
Licensor. For purposes of this Public License, where the Licensed
|
||||
Material is a musical work, performance, or sound recording,
|
||||
Adapted Material is always produced where the Licensed Material is
|
||||
synched in timed relation with a moving image.
|
||||
|
||||
b. Adapter's License means the license You apply to Your Copyright
|
||||
and Similar Rights in Your contributions to Adapted Material in
|
||||
accordance with the terms and conditions of this Public License.
|
||||
|
||||
c. BY-SA Compatible License means a license listed at
|
||||
creativecommons.org/compatiblelicenses, approved by Creative
|
||||
Commons as essentially the equivalent of this Public License.
|
||||
|
||||
d. Copyright and Similar Rights means copyright and/or similar rights
|
||||
closely related to copyright including, without limitation,
|
||||
performance, broadcast, sound recording, and Sui Generis Database
|
||||
Rights, without regard to how the rights are labeled or
|
||||
categorized. For purposes of this Public License, the rights
|
||||
specified in Section 2(b)(1)-(2) are not Copyright and Similar
|
||||
Rights.
|
||||
|
||||
e. Effective Technological Measures means those measures that, in the
|
||||
absence of proper authority, may not be circumvented under laws
|
||||
fulfilling obligations under Article 11 of the WIPO Copyright
|
||||
Treaty adopted on December 20, 1996, and/or similar international
|
||||
agreements.
|
||||
|
||||
f. Exceptions and Limitations means fair use, fair dealing, and/or
|
||||
any other exception or limitation to Copyright and Similar Rights
|
||||
that applies to Your use of the Licensed Material.
|
||||
|
||||
g. License Elements means the license attributes listed in the name
|
||||
of a Creative Commons Public License. The License Elements of this
|
||||
Public License are Attribution and ShareAlike.
|
||||
|
||||
h. Licensed Material means the artistic or literary work, database,
|
||||
or other material to which the Licensor applied this Public
|
||||
License.
|
||||
|
||||
i. Licensed Rights means the rights granted to You subject to the
|
||||
terms and conditions of this Public License, which are limited to
|
||||
all Copyright and Similar Rights that apply to Your use of the
|
||||
Licensed Material and that the Licensor has authority to license.
|
||||
|
||||
j. Licensor means the individual(s) or entity(ies) granting rights
|
||||
under this Public License.
|
||||
|
||||
k. Share means to provide material to the public by any means or
|
||||
process that requires permission under the Licensed Rights, such
|
||||
as reproduction, public display, public performance, distribution,
|
||||
dissemination, communication, or importation, and to make material
|
||||
available to the public including in ways that members of the
|
||||
public may access the material from a place and at a time
|
||||
individually chosen by them.
|
||||
|
||||
l. Sui Generis Database Rights means rights other than copyright
|
||||
resulting from Directive 96/9/EC of the European Parliament and of
|
||||
the Council of 11 March 1996 on the legal protection of databases,
|
||||
as amended and/or succeeded, as well as other essentially
|
||||
equivalent rights anywhere in the world.
|
||||
|
||||
m. You means the individual or entity exercising the Licensed Rights
|
||||
under this Public License. Your has a corresponding meaning.
|
||||
|
||||
|
||||
Section 2 -- Scope.
|
||||
|
||||
a. License grant.
|
||||
|
||||
1. Subject to the terms and conditions of this Public License,
|
||||
the Licensor hereby grants You a worldwide, royalty-free,
|
||||
non-sublicensable, non-exclusive, irrevocable license to
|
||||
exercise the Licensed Rights in the Licensed Material to:
|
||||
|
||||
a. reproduce and Share the Licensed Material, in whole or
|
||||
in part; and
|
||||
|
||||
b. produce, reproduce, and Share Adapted Material.
|
||||
|
||||
2. Exceptions and Limitations. For the avoidance of doubt, where
|
||||
Exceptions and Limitations apply to Your use, this Public
|
||||
License does not apply, and You do not need to comply with
|
||||
its terms and conditions.
|
||||
|
||||
3. Term. The term of this Public License is specified in Section
|
||||
6(a).
|
||||
|
||||
4. Media and formats; technical modifications allowed. The
|
||||
Licensor authorizes You to exercise the Licensed Rights in
|
||||
all media and formats whether now known or hereafter created,
|
||||
and to make technical modifications necessary to do so. The
|
||||
Licensor waives and/or agrees not to assert any right or
|
||||
authority to forbid You from making technical modifications
|
||||
necessary to exercise the Licensed Rights, including
|
||||
technical modifications necessary to circumvent Effective
|
||||
Technological Measures. For purposes of this Public License,
|
||||
simply making modifications authorized by this Section 2(a)
|
||||
(4) never produces Adapted Material.
|
||||
|
||||
5. Downstream recipients.
|
||||
|
||||
a. Offer from the Licensor -- Licensed Material. Every
|
||||
recipient of the Licensed Material automatically
|
||||
receives an offer from the Licensor to exercise the
|
||||
Licensed Rights under the terms and conditions of this
|
||||
Public License.
|
||||
|
||||
b. Additional offer from the Licensor -- Adapted Material.
|
||||
Every recipient of Adapted Material from You
|
||||
automatically receives an offer from the Licensor to
|
||||
exercise the Licensed Rights in the Adapted Material
|
||||
under the conditions of the Adapter's License You apply.
|
||||
|
||||
c. No downstream restrictions. You may not offer or impose
|
||||
any additional or different terms or conditions on, or
|
||||
apply any Effective Technological Measures to, the
|
||||
Licensed Material if doing so restricts exercise of the
|
||||
Licensed Rights by any recipient of the Licensed
|
||||
Material.
|
||||
|
||||
6. No endorsement. Nothing in this Public License constitutes or
|
||||
may be construed as permission to assert or imply that You
|
||||
are, or that Your use of the Licensed Material is, connected
|
||||
with, or sponsored, endorsed, or granted official status by,
|
||||
the Licensor or others designated to receive attribution as
|
||||
provided in Section 3(a)(1)(A)(i).
|
||||
|
||||
b. Other rights.
|
||||
|
||||
1. Moral rights, such as the right of integrity, are not
|
||||
licensed under this Public License, nor are publicity,
|
||||
privacy, and/or other similar personality rights; however, to
|
||||
the extent possible, the Licensor waives and/or agrees not to
|
||||
assert any such rights held by the Licensor to the limited
|
||||
extent necessary to allow You to exercise the Licensed
|
||||
Rights, but not otherwise.
|
||||
|
||||
2. Patent and trademark rights are not licensed under this
|
||||
Public License.
|
||||
|
||||
3. To the extent possible, the Licensor waives any right to
|
||||
collect royalties from You for the exercise of the Licensed
|
||||
Rights, whether directly or through a collecting society
|
||||
under any voluntary or waivable statutory or compulsory
|
||||
licensing scheme. In all other cases the Licensor expressly
|
||||
reserves any right to collect such royalties.
|
||||
|
||||
|
||||
Section 3 -- License Conditions.
|
||||
|
||||
Your exercise of the Licensed Rights is expressly made subject to the
|
||||
following conditions.
|
||||
|
||||
a. Attribution.
|
||||
|
||||
1. If You Share the Licensed Material (including in modified
|
||||
form), You must:
|
||||
|
||||
a. retain the following if it is supplied by the Licensor
|
||||
with the Licensed Material:
|
||||
|
||||
i. identification of the creator(s) of the Licensed
|
||||
Material and any others designated to receive
|
||||
attribution, in any reasonable manner requested by
|
||||
the Licensor (including by pseudonym if
|
||||
designated);
|
||||
|
||||
ii. a copyright notice;
|
||||
|
||||
iii. a notice that refers to this Public License;
|
||||
|
||||
iv. a notice that refers to the disclaimer of
|
||||
warranties;
|
||||
|
||||
v. a URI or hyperlink to the Licensed Material to the
|
||||
extent reasonably practicable;
|
||||
|
||||
b. indicate if You modified the Licensed Material and
|
||||
retain an indication of any previous modifications; and
|
||||
|
||||
c. indicate the Licensed Material is licensed under this
|
||||
Public License, and include the text of, or the URI or
|
||||
hyperlink to, this Public License.
|
||||
|
||||
2. You may satisfy the conditions in Section 3(a)(1) in any
|
||||
reasonable manner based on the medium, means, and context in
|
||||
which You Share the Licensed Material. For example, it may be
|
||||
reasonable to satisfy the conditions by providing a URI or
|
||||
hyperlink to a resource that includes the required
|
||||
information.
|
||||
|
||||
3. If requested by the Licensor, You must remove any of the
|
||||
information required by Section 3(a)(1)(A) to the extent
|
||||
reasonably practicable.
|
||||
|
||||
b. ShareAlike.
|
||||
|
||||
In addition to the conditions in Section 3(a), if You Share
|
||||
Adapted Material You produce, the following conditions also apply.
|
||||
|
||||
1. The Adapter's License You apply must be a Creative Commons
|
||||
license with the same License Elements, this version or
|
||||
later, or a BY-SA Compatible License.
|
||||
|
||||
2. You must include the text of, or the URI or hyperlink to, the
|
||||
Adapter's License You apply. You may satisfy this condition
|
||||
in any reasonable manner based on the medium, means, and
|
||||
context in which You Share Adapted Material.
|
||||
|
||||
3. You may not offer or impose any additional or different terms
|
||||
or conditions on, or apply any Effective Technological
|
||||
Measures to, Adapted Material that restrict exercise of the
|
||||
rights granted under the Adapter's License You apply.
|
||||
|
||||
|
||||
Section 4 -- Sui Generis Database Rights.
|
||||
|
||||
Where the Licensed Rights include Sui Generis Database Rights that
|
||||
apply to Your use of the Licensed Material:
|
||||
|
||||
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
|
||||
to extract, reuse, reproduce, and Share all or a substantial
|
||||
portion of the contents of the database;
|
||||
|
||||
b. if You include all or a substantial portion of the database
|
||||
contents in a database in which You have Sui Generis Database
|
||||
Rights, then the database in which You have Sui Generis Database
|
||||
Rights (but not its individual contents) is Adapted Material,
|
||||
|
||||
including for purposes of Section 3(b); and
|
||||
c. You must comply with the conditions in Section 3(a) if You Share
|
||||
all or a substantial portion of the contents of the database.
|
||||
|
||||
For the avoidance of doubt, this Section 4 supplements and does not
|
||||
replace Your obligations under this Public License where the Licensed
|
||||
Rights include other Copyright and Similar Rights.
|
||||
|
||||
|
||||
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
|
||||
|
||||
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
|
||||
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
|
||||
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
|
||||
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
|
||||
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
|
||||
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
|
||||
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
|
||||
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
|
||||
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
|
||||
|
||||
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
|
||||
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
|
||||
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
|
||||
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
|
||||
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
|
||||
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
|
||||
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
|
||||
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
|
||||
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
|
||||
|
||||
c. The disclaimer of warranties and limitation of liability provided
|
||||
above shall be interpreted in a manner that, to the extent
|
||||
possible, most closely approximates an absolute disclaimer and
|
||||
waiver of all liability.
|
||||
|
||||
|
||||
Section 6 -- Term and Termination.
|
||||
|
||||
a. This Public License applies for the term of the Copyright and
|
||||
Similar Rights licensed here. However, if You fail to comply with
|
||||
this Public License, then Your rights under this Public License
|
||||
terminate automatically.
|
||||
|
||||
b. Where Your right to use the Licensed Material has terminated under
|
||||
Section 6(a), it reinstates:
|
||||
|
||||
1. automatically as of the date the violation is cured, provided
|
||||
it is cured within 30 days of Your discovery of the
|
||||
violation; or
|
||||
|
||||
2. upon express reinstatement by the Licensor.
|
||||
|
||||
For the avoidance of doubt, this Section 6(b) does not affect any
|
||||
right the Licensor may have to seek remedies for Your violations
|
||||
of this Public License.
|
||||
|
||||
c. For the avoidance of doubt, the Licensor may also offer the
|
||||
Licensed Material under separate terms or conditions or stop
|
||||
distributing the Licensed Material at any time; however, doing so
|
||||
will not terminate this Public License.
|
||||
|
||||
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
|
||||
License.
|
||||
|
||||
|
||||
Section 7 -- Other Terms and Conditions.
|
||||
|
||||
a. The Licensor shall not be bound by any additional or different
|
||||
terms or conditions communicated by You unless expressly agreed.
|
||||
|
||||
b. Any arrangements, understandings, or agreements regarding the
|
||||
Licensed Material not stated herein are separate from and
|
||||
independent of the terms and conditions of this Public License.
|
||||
|
||||
|
||||
Section 8 -- Interpretation.
|
||||
|
||||
a. For the avoidance of doubt, this Public License does not, and
|
||||
shall not be interpreted to, reduce, limit, restrict, or impose
|
||||
conditions on any use of the Licensed Material that could lawfully
|
||||
be made without permission under this Public License.
|
||||
|
||||
b. To the extent possible, if any provision of this Public License is
|
||||
deemed unenforceable, it shall be automatically reformed to the
|
||||
minimum extent necessary to make it enforceable. If the provision
|
||||
cannot be reformed, it shall be severed from this Public License
|
||||
without affecting the enforceability of the remaining terms and
|
||||
conditions.
|
||||
|
||||
c. No term or condition of this Public License will be waived and no
|
||||
failure to comply consented to unless expressly agreed to by the
|
||||
Licensor.
|
||||
|
||||
d. Nothing in this Public License constitutes or may be interpreted
|
||||
as a limitation upon, or waiver of, any privileges and immunities
|
||||
that apply to the Licensor or You, including from the legal
|
||||
processes of any jurisdiction or authority.
|
||||
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons is not a party to its public
|
||||
licenses. Notwithstanding, Creative Commons may elect to apply one of
|
||||
its public licenses to material it publishes and in those instances
|
||||
will be considered the “Licensor.” The text of the Creative Commons
|
||||
public licenses is dedicated to the public domain under the CC0 Public
|
||||
Domain Dedication. Except for the limited purpose of indicating that
|
||||
material is shared under a Creative Commons public license or as
|
||||
otherwise permitted by the Creative Commons policies published at
|
||||
creativecommons.org/policies, Creative Commons does not authorize the
|
||||
use of the trademark "Creative Commons" or any other trademark or logo
|
||||
of Creative Commons without its prior written consent including,
|
||||
without limitation, in connection with any unauthorized modifications
|
||||
to any of its public licenses or any other arrangements,
|
||||
understandings, or agreements concerning use of licensed material. For
|
||||
the avoidance of doubt, this paragraph does not form part of the
|
||||
public licenses.
|
||||
|
||||
Creative Commons may be contacted at creativecommons.org.
|
||||
|
||||
102
Makefile
102
Makefile
@ -1,102 +0,0 @@
|
||||
SHELL=/bin/bash
|
||||
|
||||
default: preview
|
||||
|
||||
# Build everything there is.
|
||||
all: listings tasks preview publication
|
||||
|
||||
# Remove builds and LaTeX output.
|
||||
clean:
|
||||
@echo Cleaning up temporary files.
|
||||
@rm -rf public/*
|
||||
@rm -rf temp/*
|
||||
@rm -f main-{script,exercises,solutions}.{aux,loc,log,out,pdf,soc,toc,synctex.gz}
|
||||
@rm -f exercises/*/*.{aux,loc,log,out,pdf,soc,toc,synctex.gz}
|
||||
@rm -f install-verification/*.{aux,loc,log,out,pdf,soc,toc,synctex.gz}
|
||||
|
||||
# Compile listings (only needed when listings have changed)
|
||||
listings: listings/**/*
|
||||
./compile_listings
|
||||
|
||||
# Compile pre-rendered tasks
|
||||
tasks: exercises/**/*
|
||||
./compile_tasks
|
||||
|
||||
# Compile a preview PDF containing all contents
|
||||
preview: main-script.tex
|
||||
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
|
||||
pdflatex -shell-escape main-script.tex
|
||||
@echo
|
||||
@echo
|
||||
@echo Run \'make publication\' to generate PDF and ZIP file for publication.
|
||||
|
||||
# Build all PDF and ZIP variants
|
||||
publication: clean publication-pdf-without-exercises publication-pdf-with-exercises publication-pdf-with-solutions publication-zip-with-exercises publication-zip-with-solutions
|
||||
|
||||
#
|
||||
# Building blocks from here on:
|
||||
#
|
||||
|
||||
# Directory for files to be published
|
||||
publication-dir:
|
||||
mkdir -p public/
|
||||
mkdir -p temp/
|
||||
|
||||
# Compile a printable PDF without exercises
|
||||
publication-pdf-without-exercises: clean publication-dir main-script.tex
|
||||
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
|
||||
pdflatex -shell-escape main-script.tex
|
||||
pdflatex -shell-escape main-script.tex
|
||||
pdflatex -shell-escape main-script.tex
|
||||
mv main-script.pdf public/
|
||||
|
||||
# Compile a printable PDF with exercises and without solutions
|
||||
publication-pdf-with-exercises: clean publication-dir main-exercises.tex
|
||||
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
|
||||
pdflatex -shell-escape main-exercises.tex
|
||||
pdflatex -shell-escape main-exercises.tex
|
||||
pdflatex -shell-escape main-exercises.tex
|
||||
mv main-exercises.pdf public/
|
||||
|
||||
# Compile a printable PDF with solutions
|
||||
publication-pdf-with-solutions: clean publication-dir main-solutions.tex
|
||||
echo "\newcommand\listingsmode{minted}" > listings-mode.tex
|
||||
pdflatex -shell-escape main-solutions.tex
|
||||
pdflatex -shell-escape main-solutions.tex
|
||||
pdflatex -shell-escape main-solutions.tex
|
||||
mv main-solutions.pdf public/
|
||||
|
||||
# Build a ZIP file without tasks
|
||||
publication-zip-without-exercises: clean publication-dir
|
||||
rm -rf temp/*
|
||||
cp --parents main-script.tex praeamble.tex commands.tex setup.tex content/* docs/* graphics/* install-verification/* listings/**/*.{tex,pdf,bib,java,txt} titlepage.tex imprint.tex temp/
|
||||
cd temp && zip ../public/project-without-exercises * **/* **/**/*
|
||||
|
||||
|
||||
# Build a ZIP file with tasks and without solutions
|
||||
publication-zip-with-exercises: clean publication-dir
|
||||
rm -rf temp/* exercises/**/_*
|
||||
cp --parents main-exercises.tex praeamble.tex commands.tex setup.tex docs/* graphics/* install-verification/* listings/**/*.{tex,pdf,bib,java,txt} titlepage-exercises.tex imprint.tex first-steps-with-latex.tex temp/
|
||||
cp --parents exercises/**/* temp/
|
||||
rm -f temp/exercises/**/*.done.{tex,bib,synctex.gz}
|
||||
rm -f temp/exercises/**/*.rend.tex
|
||||
rm -f temp/exercises/**/*.aux
|
||||
find temp/ -name '*.raw.*' -exec bash -c 'sed "s/\.raw\./\./g" <<<{} | xargs mv {}' \;
|
||||
find temp/ -name '*.tex' -exec sed -i -e 's/\.raw\./\./g' {} \;
|
||||
sed -i 's/\.raw//g' temp/main-exercises.tex
|
||||
cd temp && zip ../public/project-with-exercises * **/* **/**/*
|
||||
|
||||
# Build a ZIP file with tasks and solutions
|
||||
publication-zip-with-solutions: clean publication-dir
|
||||
rm -rf temp/* exercises/**/_*
|
||||
cp --parents main-solutions.tex praeamble.tex commands.tex setup.tex docs/* graphics/* install-verification/* listings/**/*.{tex,pdf,bib,java,txt} titlepage-exercises.tex imprint.tex first-steps-with-latex.tex temp/
|
||||
cp --parents exercises/**/* temp/
|
||||
rm -f temp/exercises/**/*.raw.{tex,bib,synctex.gz}
|
||||
rm -f temp/exercises/**/*.aux
|
||||
find temp/ -name '*.done.*' -exec bash -c 'sed "s/\.done\./\./g" <<<{} | xargs mv {}' \;
|
||||
find temp/ -name '*.tex' -exec sed -i -e 's/(raw|done)//g' {} \;
|
||||
sed -i 's/\.done//g' temp/main-solutions.tex
|
||||
sed -i 's/\.done//g' temp/exercises/*/*.tex
|
||||
cd temp && zip ../public/project-with-solutions * **/* **/**/*
|
||||
|
||||
|
||||
35
README
Normal file
35
README
Normal file
@ -0,0 +1,35 @@
|
||||
Dieses Verzeichnis enthält die deutschsprachige
|
||||
LaTeX2e-Kurzbeschreibung als PDF und als LaTeX-Quelltext.
|
||||
|
||||
l2kurz.pdf
|
||||
PDF, formatiert für 1-seitigen Ausdruck
|
||||
|
||||
l2kurz2.pdf
|
||||
PDF, formatiert für doppelseitigen Ausdruck
|
||||
|
||||
l2kurz.tex (Stammdatei)
|
||||
|
||||
einleitung.tex
|
||||
allgemeines.tex
|
||||
eingabefile.tex
|
||||
textsatz.tex
|
||||
mathematik.tex
|
||||
bilder.tex
|
||||
seitenaufbau.tex
|
||||
schriften.tex
|
||||
spezialitaeten.tex
|
||||
anhang.tex
|
||||
l2ksym.tex
|
||||
|
||||
ozean.pdf
|
||||
ozean.svg (Quelle)
|
||||
|
||||
fontspecbeispiel.tex (Ausgabe wird in l2kurz einbebunden)
|
||||
|
||||
Bitte, senden Sie Kommentare, Aenderungswuensche oder
|
||||
Hinweise auf Fehler an Patrick Gundlach <patrick@gundla.ch>
|
||||
oder im Bugtracker auf https://github.com/texdoc/l2kurz
|
||||
|
||||
Die Lizenz (Open Publication License, v1.0 oder später) ist unter
|
||||
http://www.opencontent.org/openpub/ zu finden. Sie gilt
|
||||
für alle TeX-Dateien in diesem Verzeichnis.
|
||||
2
README.fswiai
Normal file
2
README.fswiai
Normal file
@ -0,0 +1,2 @@
|
||||
Dieses Projekt wurde von Mitgliedern der Fachschaft WIAI der Universität Bamberg verändert, um als Arbeitsgrundlage für einen LaTeX-Workshop zu dienen. Daher wurden auch bewusst Fehler gegenüber dem Original eingefügt, die in den Aufgaben behoben werden sollen. Dieses Dokument ist nicht dafür bestimmt, ohne die entsprechenden Aufgabenstellungen weitergegeben zu werden. Die README zum Originaldokument ist in den beiden anderen README-Dateien enthalten.
|
||||
|
||||
35
README.l2kurz
Normal file
35
README.l2kurz
Normal file
@ -0,0 +1,35 @@
|
||||
Dieses Verzeichnis enthält die deutschsprachige
|
||||
LaTeX2e-Kurzbeschreibung als PDF und als LaTeX-Quelltext.
|
||||
|
||||
l2kurz.pdf
|
||||
PDF, formatiert für 1-seitigen Ausdruck
|
||||
|
||||
l2kurz2.pdf
|
||||
PDF, formatiert für doppelseitigen Ausdruck
|
||||
|
||||
l2kurz.tex (Stammdatei)
|
||||
|
||||
einleitung.tex
|
||||
allgemeines.tex
|
||||
eingabefile.tex
|
||||
textsatz.tex
|
||||
mathematik.tex
|
||||
bilder.tex
|
||||
seitenaufbau.tex
|
||||
schriften.tex
|
||||
spezialitaeten.tex
|
||||
anhang.tex
|
||||
l2ksym.tex
|
||||
|
||||
ozean.pdf
|
||||
ozean.svg (Quelle)
|
||||
|
||||
fontspecbeispiel.tex (Ausgabe wird in l2kurz einbebunden)
|
||||
|
||||
Bitte, senden Sie Kommentare, Aenderungswuensche oder
|
||||
Hinweise auf Fehler an Patrick Gundlach <patrick@gundla.ch>
|
||||
oder im Bugtracker auf https://github.com/texdoc/l2kurz
|
||||
|
||||
Die Lizenz (Open Publication License, v1.0 oder später) ist unter
|
||||
http://www.opencontent.org/openpub/ zu finden. Sie gilt
|
||||
für alle TeX-Dateien in diesem Verzeichnis.
|
||||
151
README.md
151
README.md
@ -1,151 +0,0 @@
|
||||
# LaTeX Script by Fachschaft WIAI
|
||||
|
||||
The material contained in this repository introduces the most fundamental LaTeX mechanisms to get learners started. It comprises both a script and hands-on exercises for our [LaTeX workshop](https://wiai.stuve-bamberg.de/latex-weekend), a **LaTeX introduction aimed at students from various backgrounds**. The following topics are covered:
|
||||
|
||||
* general introduction to the LaTeX system
|
||||
* basic document structure
|
||||
* structuring a more complex project
|
||||
* special characters
|
||||
* text markup
|
||||
* formatting paragraphs
|
||||
* lists
|
||||
* maths and formulas
|
||||
* graphics
|
||||
* tables
|
||||
* footnotes
|
||||
* references
|
||||
* literature management
|
||||
* source code listings (`listings` with an optional `minted` part)
|
||||
|
||||
Most chapters contain exercises to practically apply the aspects that are introduced by the text.
|
||||
|
||||
## Getting started
|
||||
|
||||
### For beginners
|
||||
|
||||
This project contains three different documents:
|
||||
|
||||
1. a **script** containing all of the chapters we cover in the workshop (`main-script`),
|
||||
2. an **exercise script** with practical tasks to apply what you have learned (`main-exercises`), and
|
||||
3. a **solution script** that you can refer to for your self-study (`main-solutions`).
|
||||
|
||||
A PDF version of all of these documents can be found [in the “releases” section](https://git.stuve-bamberg.de/latex/latex-skript/releases). You may use the script to delve into the realms of LaTeX on your own. It will give you an overview of how to approach any, but especially this LaTeX project. To get your hands dirty, have a look at the exercise script, especially the “First steps with LaTeX” section.
|
||||
|
||||
**Optionally**, the `minted` package can be used for source code listings. This requires some additional configuration (including the installation of [Python3](https://www.python.org/)). Please refer to the chapter on “Source code listings” in the aforementioned PDF file.
|
||||
|
||||
### Command line usage
|
||||
|
||||
Each document in this project can be compiled by running a LaTeX compiler on `main-script.tex` (or any of the other two main files, respectively). A simple command would be:
|
||||
|
||||
```sh
|
||||
$ pdflatex main-script.tex
|
||||
```
|
||||
|
||||
Run the command twice to generate the table of contents and other registers. Once the literature tasks are being worked on, compilation requires an additional call to BibTeX:
|
||||
|
||||
```sh
|
||||
$ pdflatex main-script.tex
|
||||
$ bibtex main-script.aux
|
||||
$ pdflatex main-script.tex
|
||||
$ pdflatex main-script.tex
|
||||
```
|
||||
|
||||
If you decide to use the optional `minted` package (see section above), don't forget to add the `--shell-escape` flag:
|
||||
|
||||
```sh
|
||||
$ pdflatex --shell-escape main.tex
|
||||
```
|
||||
|
||||
Read more about the potentially dangerous implications of this flag in the script.
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
latex-script/
|
||||
├── commands.tex
|
||||
├── compile_listings
|
||||
├── compile_tasks
|
||||
├── content
|
||||
│ ├── basic-document-structure.tex
|
||||
│ ├── basic-functionality.tex
|
||||
│ └── …
|
||||
├── docs
|
||||
│ ├── vs-code-instructions.md
|
||||
│ ├── faq.md
|
||||
│ └── …
|
||||
├── exercises
|
||||
│ ├── basic-document-structure
|
||||
│ ├── footnotes
|
||||
│ └── …
|
||||
├── first-steps-with-latex.tex
|
||||
├── graphics
|
||||
│ ├── benzene-ring.pdf
|
||||
│ ├── cc-by-sa.png
|
||||
│ └── …
|
||||
├── imprint.tex
|
||||
├── LICENSE
|
||||
├── listings
|
||||
│ ├── basic-document-structure
|
||||
│ ├── formatting-paragraphs
|
||||
│ └── …
|
||||
├── main-exercises.tex
|
||||
├── main-script.tex
|
||||
├── main-solutions.tex
|
||||
├── Makefile
|
||||
├── praeamble.tex
|
||||
├── public
|
||||
├── setup.tex
|
||||
├── README.md
|
||||
├── titlepage-exercises.tex
|
||||
├── titlepage-solutions.tex
|
||||
└── titlepage.tex
|
||||
```
|
||||
|
||||
## Relevant files for learners
|
||||
|
||||
In this repository, we provide an exercise script in which you can practically apply what you have learned. These files will be needed:
|
||||
|
||||
* **`main-exercises.tex`** is the entry point for the exercise part. It includes the preamble (`preamble.tex`), our custom commands (`commands.tex`) as well as all sections.
|
||||
* **`exercises`** contains one sub-folder for each chapter. Within these folders, there are the LaTeX files you will have to modify to complete an exercise.
|
||||
|
||||
## Additional material
|
||||
|
||||
Besides the exercise part, we also provide the script detailing all of the information we give you during our workshop. This script can be used as a reference, a refresher, and a source of inspiration. Moreover, it is a practical example of how LaTeX can be brought to good use. This is why we offer you the full source code, structured like this:
|
||||
|
||||
* The **`content`** folder comprises the individual chapters of the script.
|
||||
* They are bound together by **`main-script.tex`**, which also includes our preamble (`preamble.tex`) and our custom commands (`commands.tex`).
|
||||
* Further folders (e.g., `listings` and `graphics`) contain additional resources like images and source code listings used in the script.
|
||||
|
||||
Please don't feel overwhelmed by the amount of files in this repository. You will get to know the most important parts of the project step by step by [following the script](https://git.stuve-bamberg.de/latex/latex-skript/releases) or our workshop. What's more, by using this larger project you get accustomed to the complexity of real LaTeX projects – bachelor's/master's theses and the like.
|
||||
|
||||
## Further information for maintainers
|
||||
|
||||
### Listings mode
|
||||
**`setup.tex`** is used to configure which package to use for source code listings. All listings in the script are set using custom commands that can internally switch between the `listings` and the `minted` package.
|
||||
|
||||
**`listings-mode.tex`** is the file that determines the listings mode. If this file is non-existent or contains the line `\newcommand\listingsmode{default}`, `listings` is used. `\newcommand\listingsmode{minted}` switches it to `minted`. We decided to add this abstraction to deal with learners having trouble to install Pygments on their machine.
|
||||
|
||||
### Including rendered images of source code
|
||||
**`compile_listings`** and **`compile_commands`** are two utility bash scripts. They produce a rendered and cropped PDF version of all `.tex` files within the `listings`/`exercises` folders and their sub folders. Rendered listings remain in `listings` whereas exercise renderings are moved to the **`graphics`** folder afterwards.
|
||||
|
||||
The compiled tasks are necessary for students who receive the project archive, but should not be given the source code of tasks, e. g., if an exercise demands them to code up a table based on a pre-coded example.
|
||||
|
||||
### Publishing the script
|
||||
**`public`** is the folder where all packed-up versions of the script are moved to, once they have been created using the `Makefile` and the command `make publication`. There are two zip archives of this repository (one containing only the exercises and one with solutions included) as well as three PDF versions (one with the content only, one with exercises, and one with exercises and solutions).
|
||||
|
||||
## Contributing
|
||||
|
||||
You are welcome to contribute to this project by creating issues, opening pull requests, or reporting bugs. Note that our goal is to keep the content rather condensed, so we might not choose to incorporate further sections.
|
||||
|
||||
These are the main contributors so far:
|
||||
* Evelyn Fradtschuk
|
||||
* Jessica Klarmann
|
||||
* Florian Knoch
|
||||
* Theresa Knoll
|
||||
* Christian Kremitzl
|
||||
* Bernhard Luedtke
|
||||
* Jochen Mehlich
|
||||
|
||||
## License
|
||||
|
||||
The LaTeX Script has been assembled by the Student Council of the Faculty of Information Systems and Applied Computer Sciences (Fachschaft WIAI) at University of Bamberg. It is licensed under Creative Commons “Attribution-ShareAlike 4.0 International” (CC BY-SA 4.0): http://creativecommons.org/licenses/by-sa/4.0/. Upon request, allowances exceeding the limitations of this license may be granted.
|
||||
BIN
allgemeines.pdf
Normal file
BIN
allgemeines.pdf
Normal file
Binary file not shown.
177
allgemeines.tex
Normal file
177
allgemeines.tex
Normal file
@ -0,0 +1,177 @@
|
||||
\documentclass{scrartcl}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage[ngerman]{babel}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{csquotes}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\tableofcontents
|
||||
|
||||
\section{Allgemeines} \label{sec:allgemeines}
|
||||
|
||||
|
||||
\subsection{The Name of the Game}
|
||||
|
||||
\subsubsection{\TeX}
|
||||
|
||||
\TeX\ (sprich Tech, kann auch TeX geschrieben werden) ist
|
||||
ein Computerprogamm von Donald E. Knuth \cite{texbook,schwarz}.
|
||||
Es dient zum Setzen von Texten und mathematischen Formeln.
|
||||
|
||||
\subsubsection{\LaTeX}
|
||||
|
||||
\LaTeX\ (sprich \enquote{Lah-tech} oder \enquote{Lej-tech}, kann auch
|
||||
\enquote{LaTeX} geschrieben werden) ist ein auf \TeX\ auf\/bauendes
|
||||
Computerprogramm und wurde von Leslie Lamport~\cite{manual,wonne}
|
||||
geschrieben. Es vereinfacht den Umgang mit \TeX, indem es
|
||||
entsprechend der logischen Struktur des Dokuments auf vorgefertigte
|
||||
Layout-Elemente zurückgreift.
|
||||
|
||||
\LaTeXe{} ist die aktuelle Version und mit dem Fokus auf Stabilität werden derzeit nur noch Fehler behoben. Eine Weiterentwicklung findet im \LaTeX{}3"=Projekt statt, einige Zusatzmodule (Pakete) für \LaTeX{} benutzen schon die neue Version, für den Benutzer ist dies jedoch in der Regel unsichtbar.
|
||||
|
||||
|
||||
\subsection{Grundkonzept}
|
||||
|
||||
\subsubsection{Autor, Designer und Setzer}
|
||||
|
||||
Für eine Publikation übergab der Autor dem Verleger
|
||||
traditionell ein maschinengeschriebenes Manuskript. Der
|
||||
Buch-Designer des Verlages entschied dann über das Layout des
|
||||
Schriftstücks (Länge einer Zeile, Schriftart, Abstände vor
|
||||
und nach Kapiteln usw.\@) und schrieb dem Setzer die
|
||||
dafür notwendigen Anweisungen dazu.
|
||||
\LaTeX{} ist in diesem Sinne der Buch-Designer,
|
||||
das Programm \TeX{} ist sein Setzer.
|
||||
|
||||
Ein menschlicher Buchdesigner erkennt die Absichten des Autors
|
||||
(z.B.\ Kapitel"=Überschriften, Zitate, Beispiele, Formeln, ...) meistens aufgrund seines Fachwissens aus dem Inhalt des
|
||||
Manuskripts. \LaTeX{} dagegen ist \enquote{nur} ein Programm und
|
||||
benötigt daher zusätzliche Informationen vom Autor, die die
|
||||
logische Struktur des Textes beschreiben.
|
||||
Diese Informationen werden in Form von sogenannten \enquote{Befehlen}
|
||||
innerhalb des Textes angegeben.
|
||||
Der Autor braucht sich also
|
||||
(weitgehend) nur um die logische Struktur seines Werkes zu kümmern,
|
||||
nicht um die Details von Gestaltung und Satz.
|
||||
|
||||
Im Gegensatz dazu steht der visuell orientierte Entwurf eines
|
||||
Schriftstückes mit Textverarbeitungs- oder \textsc{dtp}-Programmen wie z.\,B.\
|
||||
\textsc{Word}.
|
||||
In diesem Fall legt der Autor das Layout des Textes gleich bei der
|
||||
interaktiven Eingabe fest. Dabei sieht er am Bildschirm das, was
|
||||
auch auf der gedruckten Seite stehen wird. Solche Systeme, die das
|
||||
visuelle Entwerfen unterstützen, werden auch \textsc{wysiwyg}-Systeme
|
||||
(\enquote{what you see is what you get}) genannt.
|
||||
|
||||
Bei \LaTeX{} sieht der Autor beim Schreiben des Eingabefiles in
|
||||
der Regel noch nicht sofort, wie der Text nach dem Formatieren
|
||||
aussehen wird. Er kann aber %durch Aufruf des entsprechenden Programms
|
||||
jederzeit einen \enquote{Probe-Ausdruck} seines Schriftstücks auf dem
|
||||
Bildschirm machen und danach sein Eingabefile entsprechend
|
||||
korrigieren und die Arbeit fortsetzen.
|
||||
|
||||
\subsubsection{Layout-Design}
|
||||
|
||||
Typographisches Design ist ein Handwerk, das erlernt werden muss.
|
||||
Ungeübte Autoren machen dabei oft gravierende Fehler.
|
||||
Fälschlicherweise glauben viele Laien, dass Textdesign
|
||||
vor allem eine Frage der Ästhetik ist - wenn das
|
||||
Schriftstück vom künstlerischen Standpunkt aus schön
|
||||
aussieht, dann ist es schon gut designt.
|
||||
Da Schriftstücke jedoch gelesen und nicht in einem Museum
|
||||
aufgehängt werden, sind die leichtere Lesbarkeit und bessere
|
||||
Verständlichkeit wichtiger als das schöne Aussehen.
|
||||
|
||||
Beispiele:
|
||||
Die Schriftgröße und Nummerierung von Überschriften soll so
|
||||
gewählt werden, dass die Struktur der Kapitel und Unterkapitel
|
||||
klar erkennbar ist.
|
||||
Die Zeilenlänge soll so gewählt werden, dass anstrengende
|
||||
Augenbewegungen des Lesers vermieden werden, nicht so, dass der
|
||||
Text das Papier möglichst schön ausfüllt.
|
||||
|
||||
Mit interaktiven visuellen Entwurfssystemen ist es leicht,
|
||||
Schriftstücke zu erzeugen, die zwar gut aussehen,
|
||||
aber ihren Inhalt und dessen Aufbau nur mangelhaft wiedergeben.
|
||||
\LaTeX{} verhindert solche
|
||||
Fehler, indem es den Autor dazu zwingt, die logische
|
||||
Struktur des Textes anzugeben, und dann automatisch ein dafür
|
||||
geeignetes Layout verwendet.
|
||||
|
||||
Daraus ergibt sich, dass \LaTeX{} insbesondere für Dokumente geeignet
|
||||
ist, wo vorgegebene Gestaltungsprinzipien auf sich wiederholende
|
||||
logische Textstrukturen angewandt werden sollen.
|
||||
Für das - notwendigerweise - visuell orientierte Gestalten
|
||||
etwa eines Plakates ist \LaTeX{} hingegen
|
||||
aufgrund seiner Arbeitsweise weniger geeignet.
|
||||
|
||||
\subsubsection{Vor- und Nachteile}
|
||||
|
||||
Gegenüber anderen Textverarbeitungs- oder \textsc{dtp}-Programmen
|
||||
zeichnet sich \LaTeX{}
|
||||
vor allem durch die folgenden Vorteile aus:
|
||||
|
||||
Der Anwender muss nur wenige, leicht verständliche Befehle
|
||||
angeben, die die logische Struktur des Schriftstücks
|
||||
betreffen, und braucht sich um die gestalterischen Details
|
||||
(fast) nicht zu kümmern.
|
||||
|
||||
Das Setzen von mathematischen Formeln ist besonders gut
|
||||
unterstützt.
|
||||
|
||||
Auch anspruchsvolle Strukturen wie Fußnoten, Literaturverzeichnisse,
|
||||
Tabellen u.\,v.\,a.\ können mit wenig Aufwand erzeugt werden.
|
||||
% ---- schwammige Formulierung ;-)
|
||||
|
||||
Routineaufgaben wie das Aktualisieren von Querverweisen
|
||||
oder das Erstellen des Inhaltsverzeichnisses
|
||||
werden automatisch erledigt.
|
||||
|
||||
Es stehen zahlreiche vordefinierte Layouts zur Verfügung.
|
||||
|
||||
\LaTeX-Dokumente sind zwischen verschiedenen Installationen und
|
||||
Rechnerplattformen austauschbar.
|
||||
|
||||
Im Gegensatz zu vielen \textsc{wysiwyg}-Programmen bearbeitet \LaTeX{} auch
|
||||
lange oder komplizierte Dokumente zuverlässig,
|
||||
und sein Ressourcenverbrauch (Speicher, Rechenleistung) ist vergleichsweise
|
||||
mäßig.
|
||||
|
||||
Ein Nachteil soll freilich auch nicht verschwiegen werden:
|
||||
|
||||
Dadurch, dass der Text erst von \LaTeX\ nach PDF gewandelt wird, unterscheidet sich der Arbeitsablauf von \LaTeX\ stark von den üblichen Textverarbeitungen bzw. DTP-Programmen. Das erfordert ein Umdenken und eine gewisse Einarbeitung.
|
||||
|
||||
\subsubsection{Der Arbeitsablauf}
|
||||
|
||||
Der typische Ablauf beim Arbeiten mit \LaTeX{} ist:
|
||||
|
||||
|
||||
1. Ein Eingabefile schreiben, das den Text und die \LaTeX-Befehle
|
||||
enthält.
|
||||
|
||||
2. Dieses File mit \LaTeX{} bearbeiten; dabei wird eine Datei
|
||||
erzeugt, die den gesetzten Text in einem geräteunabhängigen Format
|
||||
(\textsc{dvi}, \textsc{pdf} oder auch PostScript) enthält.
|
||||
|
||||
3. Einen \enquote{Probeausdruck} davon auf dem Bildschirm anzeigen (Preview).
|
||||
|
||||
4. Wenn nötig, die Eingabe korrigieren und zurück zu Schritt~2.
|
||||
|
||||
5. Die Ausgabedatei drucken.
|
||||
|
||||
Zeitgemäße Betriebssysteme machen es möglich, dass der Texteditor
|
||||
und das Preview-Programm gleichzeitig in verschiedenen Fenstern
|
||||
\enquote{geöffnet} sind; beim Durchlaufen des obigen Zyklus brauchen sie
|
||||
also nicht immer wieder von neuem gestartet werden. Nur die
|
||||
wiederholte \LaTeX-Bearbeitung des Textes muss noch von Hand
|
||||
angestoßen werden und läuft ebenfalls in einem eigenen Fenster ab.
|
||||
|
||||
Wenn der Texteditor keine Schnittstelle anbietet, um \LaTeX{} direkt aus einem Menüpunkt heraus aufzurufen, dann ist der übliche Weg über die Kommandozeile bzw. Eingabeaufforderung. Dort wird dann das Kommando \texttt{pdflatex} aufgerufen und als Parameter wird der Name der Datei angegeben, unter der das Dokument auf der Festplatte gespeichert ist:
|
||||
\texttt{pdflatex masterarbeit.tex}
|
||||
|
||||
Das Ergebnis des Aufrufs ist eine PDF-Datei, die wie die Eingabedatei heißt, nur mit der Endung \texttt{.pdf}. \LaTeX\ gibt einige Meldungen auf der Konsole aus, die beispielsweise Auskunft über die Anzahl der Seiten des Dokuments geben.
|
||||
|
||||
|
||||
\end{document}
|
||||
76
anhang.tex
Normal file
76
anhang.tex
Normal file
@ -0,0 +1,76 @@
|
||||
%!TEX root = l2kurz.tex
|
||||
|
||||
% master: l2kurz.tex
|
||||
% L2KA.TEX - Anhang der LaTeX-Kurzbeschreibung v2.2
|
||||
% 2001-06-08 (WaS)
|
||||
|
||||
\appendix
|
||||
%\settocdepth{1}
|
||||
|
||||
\enlargethispage*{2.5\baselineskip}
|
||||
|
||||
\section[Mit dem Paket \texttt{textcomp} verfügbare Symbole]{Mit dem Paket \texttt{textcomp} verfügbare Symbole\footnote{Schriften, die nicht speziell für die Verwendung mit
|
||||
\TeX{} entworfen wurden, enthalten normalerweise nur die mit * markierten Zeichen.}}
|
||||
\label{textsymbols}
|
||||
{\small
|
||||
\begin{tabbing}
|
||||
\quad\quad\=\texttt{Mtextquotestraightdblbase}\hspace{1cm}\=\quad\quad\=\kill
|
||||
\textquotestraightbase \> \lstinline+\textquotestraightbase+\textsuperscript{*} \> \textquotestraightdblbase \> \lstinline+\textquotestraightdblbase+\textsuperscript{*} \\
|
||||
\texttwelveudash \> \lstinline+\texttwelveudash+\textsuperscript{*} \> \textthreequartersemdash \> \lstinline+\textthreequartersemdash+\textsuperscript{*} \\
|
||||
\textleftarrow \> \lstinline+\textleftarrow+ \> \textrightarrow \> \lstinline+\textrightarrow+\\
|
||||
\textblank \> \lstinline+\textblank+ \> \textdollar \> \lstinline+\$+\textsuperscript{*} \\
|
||||
\textquotesingle \> \lstinline+\textquotesingle+\textsuperscript{*} \> \textasteriskcentered \> \lstinline+\textasteriskcentered+\textsuperscript{*} \\
|
||||
\textdblhyphen \> \lstinline+\textdblhyphen+ \> \textfractionsolidus \> \lstinline+\textfractionsolidus+\textsuperscript{*} \\
|
||||
\textlangle \> \lstinline+\textlangle+ \> \textminus \> \lstinline+\textminus+\textsuperscript{*} \\
|
||||
\textrangle \> \lstinline+\textrangle+ \> \textmho \> \lstinline+\textmho+\\
|
||||
\textbigcircle \> \lstinline+\textbigcircle+ \> \textohm \> \lstinline+\textohm+\\
|
||||
\textlbrackdbl \> \lstinline+\textlbrackdbl+ \> \textrbrackdbl \> \lstinline+\textrbrackdbl+\\
|
||||
\textuparrow \> \lstinline+\textuparrow+ \> \textdownarrow \> \lstinline+\textdownarrow+\\
|
||||
\textasciigrave \> \lstinline+\textasciigrave+\textsuperscript{*} \> \textborn \> \lstinline+\textborn+\\
|
||||
\textdivorced \> \lstinline+\textdivorced+ \> \textdied \> \lstinline+\textdied+\\
|
||||
\textleaf \> \lstinline+\textleaf+ \> \textmarried \> \lstinline+\textmarried+\\
|
||||
\textmusicalnote \> \lstinline+\textmusicalnote+ \> \texttildelow \> \lstinline+\texttildelow+\textsuperscript{*} \\
|
||||
\textdblhyphenchar \> \lstinline+\textdblhyphenchar+ \> \textasciibreve \> \lstinline+\textasciibreve+\textsuperscript{*} \\
|
||||
\textasciicaron \> \lstinline+\textasciicaron+\textsuperscript{*} \> \textacutedbl \> \lstinline+\textacutedbl+\textsuperscript{*} \\
|
||||
\textgravedbl \> \lstinline+\textgravedbl+\textsuperscript{*} \> \textdagger \> \lstinline+\dag+\textsuperscript{*} \\
|
||||
\textdaggerdbl \> \lstinline+\ddag+\textsuperscript{*} \> \textbardbl \> \lstinline+\textbardbl+\textsuperscript{*} \\
|
||||
\textperthousand \> \lstinline+\textperthousand+\textsuperscript{*} \> \textbullet \> \lstinline+\textbullet+\textsuperscript{*} \\
|
||||
\textcelsius \> \lstinline+\textcelsius+\textsuperscript{*} \> \textdollaroldstyle \> \lstinline+\textdollaroldstyle+\\
|
||||
\textcentoldstyle \> \lstinline+\textcentoldstyle+ \> \textflorin \> \lstinline+\textflorin+\textsuperscript{*} \\
|
||||
\textcolonmonetary \> \lstinline+\textcolonmonetary+ \> \textwon \> \lstinline+\textwon+\\
|
||||
\textnaira \> \lstinline+\textnaira+ \> \textguarani \> \lstinline+\textguarani+\\
|
||||
\textpeso \> \lstinline+\textpeso+ \> \textlira \> \lstinline+\textlira+\\
|
||||
\textrecipe \> \lstinline+\textrecipe+ \> \textinterrobang \> \lstinline+\textinterrobang+\\
|
||||
\textinterrobangdown \> \lstinline+\textinterrobangdown+ \> \textdong \> \lstinline+\textdong+\\
|
||||
\texttrademark \> \lstinline+\texttrademark+\textsuperscript{*} \> \textpertenthousand \> \lstinline+\textpertenthousand+\\
|
||||
\textpilcrow \> \lstinline+\textpilcrow+ \> \textbaht \> \lstinline+\textbaht+\\
|
||||
\textnumero \> \lstinline+\textnumero+ \> \textdiscount \> \lstinline+\textdiscount+\\
|
||||
\textestimated \> \lstinline+\textestimated+ \> \textopenbullet \> \lstinline+\textopenbullet+\\
|
||||
\textservicemark \> \lstinline+\textservicemark+ \> \textlquill \> \lstinline+\textlquill+\\
|
||||
\textrquill \> \lstinline+\textrquill+ \> \textcent \> \lstinline+\textcent+\textsuperscript{*} \\
|
||||
\textsterling \> \lstinline+\pounds+\textsuperscript{*} \> \textcurrency \> \lstinline+\textcurrency+\textsuperscript{*} \\
|
||||
\textyen \> \lstinline+\textyen+\textsuperscript{*} \> \textbrokenbar \> \lstinline+\textbrokenbar+\textsuperscript{*} \\
|
||||
\textsection \> \lstinline+\S+\textsuperscript{*} \> \textasciidieresis \> \lstinline+\textasciidieresis+\textsuperscript{*} \\
|
||||
\textcopyright \> \lstinline+\copyright+\textsuperscript{*} \> \textordfeminine \> \lstinline+\textordfeminine+\textsuperscript{*} \\
|
||||
\textcopyleft \> \lstinline+\textcopyleft+ \> \textlnot \> \lstinline+\textlnot+\textsuperscript{*} \\
|
||||
\textcircledP \> \lstinline+\textcircledP+ \> \textregistered \> \lstinline+\textregistered+\textsuperscript{*} \\
|
||||
\textasciimacron \> \lstinline+\textasciimacron+\textsuperscript{*} \> \textdegree \> \lstinline+\textdegree+\textsuperscript{*} \\
|
||||
\textpm \> \lstinline+\textpm+\textsuperscript{*} \> \texttwosuperior \> \lstinline+\texttwosuperior+\\
|
||||
\textthreesuperior \> \lstinline+\textthreesuperior+ \> \textasciiacute \> \lstinline+\textasciiacute+\textsuperscript{*} \\
|
||||
\textmu \> \lstinline+\textmu+\textsuperscript{*} \> \textparagraph \> \lstinline+\P+\textsuperscript{*} \\
|
||||
\textperiodcentered \> \lstinline+\textperiodcentered+\textsuperscript{*} \> \textreferencemark \> \lstinline+\textreferencemark+\\
|
||||
\textonesuperior \> \lstinline+\textonesuperior+ \> \textordmasculine \> \lstinline+\textordmasculine+\textsuperscript{*} \\
|
||||
\textsurd \> \lstinline+\textsurd+ \> \textonequarter \> \lstinline+\textonequarter+\\
|
||||
\textonehalf \> \lstinline+\textonehalf+ \> \textthreequarters \> \lstinline+\textthreequarters+\\
|
||||
\textsf{\texteuro} \> \lstinline+\textsf{\texteuro}+ \> \texttimes \> \lstinline+\texttimes+\textsuperscript{*} \\
|
||||
\textdiv \> \lstinline+\textdiv+\textsuperscript{*} \\
|
||||
\end{tabbing}
|
||||
}
|
||||
|
||||
%{\footnotesize\noindent
|
||||
%Schriften, die nicht speziell für die Verwendung mit
|
||||
%\TeX{} entworfen wurden, enthalten normalerweise nur die mit * markierten Zeichen.
|
||||
%\par}
|
||||
|
||||
\input{l2ksym}
|
||||
\endinput
|
||||
34
bilder.tex
Normal file
34
bilder.tex
Normal file
@ -0,0 +1,34 @@
|
||||
%!TEX root = l2kurz.tex
|
||||
% bilder.tex - Teil der LaTeX2e-Kurzbeschreibung
|
||||
% Siehe https://github.com/texdoc/l2kurz
|
||||
|
||||
\section{Setzen von Bildern} \label{graphics}
|
||||
|
||||
Lädt man im Vorspann des Dokuments das Paket \texttt{graphicx}, dann kann man
|
||||
Bilder, die mit einem anderen Programm erzeugt wurden, mit dem Befehl
|
||||
\lstinline|\includegraphics| in das Dokument einfügen. Der Dateiname ist als
|
||||
Argument des Befehls anzugeben. Welche Dateiformate verarbeitet werden können,
|
||||
hängt vom jeweiligen \TeX-System ab. Das häufig benutzte PDF\TeX{} kann
|
||||
Grafiken in den Formaten PDF, PNG JPEG und JBIG2 verarbeiten.
|
||||
|
||||
% http://openclipart.org/detail/104863/ocean-theme-papercut-by-last-dino
|
||||
% Public Domain (CC0)
|
||||
% http://creativecommons.org/publicdomain/zero/1.0/
|
||||
|
||||
\begin{LTXexample}
|
||||
Hier \includegraphics
|
||||
[width=3cm]{ozean}
|
||||
ist ein Bild.
|
||||
\end{LTXexample}
|
||||
|
||||
\noindent Wird das Paket \texttt{graphicx} mit der Option \texttt{[draft]} geladen,
|
||||
dann erscheint anstelle des Bildes nur ein Rahmen entsprechend
|
||||
der tatsächlichen Bildgröße mit dem Namen des Grafikfiles,
|
||||
was die Bearbeitung beschleunigt und für Probeausdrucke nützlich ist.
|
||||
|
||||
Weitere Informationen zum Einbinden von Bildern finden Sie in der
|
||||
Online"=Dokumentation \cite{grfguide}, im \textit{Graphics Companion}
|
||||
\cite{grfcomp} und in K.~Reckdahls empfehlenswertem Tutorium \cite{epslatex}.
|
||||
|
||||
|
||||
|
||||
243
commands.tex
243
commands.tex
@ -1,243 +0,0 @@
|
||||
|
||||
% Acronyms
|
||||
% ========
|
||||
% The argument appears in small caps.
|
||||
\newcommand\acro[1]{\textsc{\lowercase{#1}}}
|
||||
|
||||
% Variables
|
||||
% =========
|
||||
\newcommand\widefiguremargin{-.22\textwidth}
|
||||
\newcommand\widefigurewidth{.49\textwidth}
|
||||
\newcommand\widefiguregap{.02\textwidth}
|
||||
\newcommand\widefiguresum{1.4\textwidth}
|
||||
|
||||
% Fachschaft logo
|
||||
% ===============
|
||||
\newcommand*{\fslogo}{\raisebox{+1.25ex}{\includegraphics[height=6cm]{graphics/logo-fachschaft}}}
|
||||
|
||||
% Wide box
|
||||
% ========
|
||||
% Box that runs into both margins. To be used inside a floating environment like figure or table.
|
||||
\newcommand\widebox[1]{
|
||||
\hspace{\widefiguremargin}
|
||||
\begin{minipage}{\widefiguresum}
|
||||
#1
|
||||
\end{minipage}
|
||||
}
|
||||
|
||||
% Column rules
|
||||
% ============
|
||||
% Adds two rules each spanning approximately half of the available textwidth (as defined by \widefigurewidth).
|
||||
\newcommand\colrules{
|
||||
\rule{\widefigurewidth}{0.4pt}
|
||||
\hspace{\widefiguregap}
|
||||
\rule{\widefigurewidth}{0.4pt}
|
||||
}
|
||||
|
||||
% Shell command
|
||||
% ==============
|
||||
% Mono-spaced text without syntax highlighting.
|
||||
% Intended for full commands. Wrapped by empty lines.
|
||||
\newcommand\shell[1]{%
|
||||
\vspace{.5cm}
|
||||
\noindent \hspace*{-1em}{\color{lightgray}\texttt{\$ }}\texttt{#1}
|
||||
\vspace{.5cm}
|
||||
}
|
||||
|
||||
% Command parts
|
||||
% ===================
|
||||
% Mono-spaced text without syntax highlighting.
|
||||
% Intended for parts of shell commands.
|
||||
% Displayed inline.
|
||||
\newcommand\sh[1]{%
|
||||
\texttt{#1}%
|
||||
}
|
||||
|
||||
% Package names
|
||||
% =============
|
||||
% Mono-spaced text without syntax highlighting.
|
||||
% Intended for LaTeX package names.
|
||||
\newcommand\pkg[1]{%
|
||||
\ifthenelse{\equal{\listingsmode}{minted}}{%
|
||||
\texttt{#1}%
|
||||
}{%
|
||||
\texttt{#1}%
|
||||
}%
|
||||
}
|
||||
|
||||
% File paths
|
||||
% ==========
|
||||
% Mono-spaced text without syntax highlighting.
|
||||
% Intended for file names and paths.
|
||||
\newcommand\file[1]{%
|
||||
\texttt{#1}%
|
||||
}
|
||||
|
||||
% Mono-spaced words
|
||||
% =================
|
||||
% Mono-spaced text without syntax highlighting.
|
||||
% Intended for single words or small passages without special meaning.
|
||||
% These can be environments, file extensions, and many more.
|
||||
\newcommand\mono[1]{%
|
||||
\texttt{#1}%
|
||||
}
|
||||
|
||||
% Inline code
|
||||
% ===========
|
||||
% Code snippets with syntax highlighting.
|
||||
% TODO: Fix special character mess.
|
||||
% Caution: Must not be used inside `\textbf{}'
|
||||
%
|
||||
% Arguments:
|
||||
% 1. Language.
|
||||
% 2. Source code.
|
||||
\newcommand\code[2]{%
|
||||
\texttt{#2}%
|
||||
}
|
||||
|
||||
% Code block
|
||||
% ==========
|
||||
% Pastes in a non-inline code block using minted or lstlistings
|
||||
% first parameter: programming language
|
||||
% path to code file
|
||||
|
||||
\lstdefinelanguage{latex}{%
|
||||
language=[LaTeX]TeX
|
||||
}
|
||||
|
||||
\lstdefinelanguage{csharp}{%
|
||||
language=[Sharp]C
|
||||
}
|
||||
|
||||
\lstdefinelanguage{bibtex}
|
||||
{keywords={%
|
||||
@article,@book,@collectedbook,@conference,@electronic,@ieeetranbstctl,%
|
||||
@inbook,@incollectedbook,@incollection,@injournal,@inproceedings,%
|
||||
@manual,@mastersthesis,@misc,@patent,@periodical,@phdthesis,@preamble,%
|
||||
@proceedings,@standard,@string,@techreport,@unpublished%
|
||||
},
|
||||
comment=[l][\itshape]{@comment},
|
||||
sensitive=false,
|
||||
}
|
||||
|
||||
|
||||
\newcommand\codeblock[2]{%
|
||||
\ifthenelse{\equal{\listingsmode}{minted}}{%
|
||||
\inputminted[breaklines]{#1}{#2}
|
||||
}{%
|
||||
\ifthenelse{\equal{#1}{latex}}{%
|
||||
|
||||
\lstset{language=#1,
|
||||
basicstyle=\small\ttfamily,
|
||||
breaklines=true,
|
||||
keywordstyle=\color{ForestGreen}\bfseries,
|
||||
emph={%
|
||||
subsection, subsubsection, url, includegraphics, toprule,
|
||||
midrule, bottomrule, cref, setlength, maketitle,
|
||||
tableofcontents, foreignlanguage, paragraph, subparagraph,
|
||||
mint, mintinline, inputminted, usemintedstyle, definecolor,
|
||||
citep, enquote, lstinputlisting%
|
||||
},
|
||||
postbreak=\mbox{{$\hookrightarrow$}\space},
|
||||
emphstyle={\color{ForestGreen}\bfseries},
|
||||
commentstyle=\color{darkgray},
|
||||
% Allow special characters in lstlistings.
|
||||
literate=
|
||||
{Ö}{{\"O}}1
|
||||
{Ä}{{\"A}}1
|
||||
{Ü}{{\"U}}1
|
||||
{ß}{{\ss}}1
|
||||
{ü}{{\"u}}1
|
||||
{ä}{{\"a}}1
|
||||
{ö}{{\"o}}1
|
||||
{é}{{\'e}}1
|
||||
{…}{\textellipsis}1
|
||||
}
|
||||
\lstinputlisting{#2}%
|
||||
%
|
||||
}{%
|
||||
\lstset{
|
||||
language=#1,
|
||||
% Allow special characters in lstlistings.
|
||||
literate=
|
||||
{Ö}{{\"O}}1
|
||||
{Ä}{{\"A}}1
|
||||
{Ü}{{\"U}}1
|
||||
{ß}{{\ss}}1
|
||||
{ü}{{\"u}}1
|
||||
{ä}{{\"a}}1
|
||||
{ö}{{\"o}}1
|
||||
{é}{{\'e}}1
|
||||
{…}{\textellipsis}1
|
||||
}
|
||||
\lstinputlisting{#2}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
% Simple code examples
|
||||
% ====================
|
||||
% Box for example code next to the rendered example.
|
||||
%
|
||||
% Arguments:
|
||||
% 1. Label.
|
||||
% 2. Content path without extension. If a corresponding PDF file exists, it gets included as an image. Otherwise, the LaTeX code gets rendered directly.
|
||||
% 3. Caption.
|
||||
\newcommand\example[3]{
|
||||
\Example{#1}{#2}{#2}{#3}
|
||||
}
|
||||
|
||||
% Extended code examples
|
||||
% ======================
|
||||
% Box for example code next to the rendered example.
|
||||
% Depending on the third argument, the source path for the right-side rendering can differ from the source path of the left-side listing.
|
||||
% Useful if only an excerpt of the document to be rendered affects the entire output.
|
||||
%
|
||||
% Arguments:
|
||||
% 1. Label.
|
||||
% 2. Content path without extension. If a corresponding PDF file exists, it gets included as an image. Otherwise, the LaTeX code gets rendered directly.
|
||||
% 3. Alternative path for Rendering (c.f. 2.)
|
||||
% 4. Caption.
|
||||
\newcommand\Example[4]{
|
||||
\begin{figure}[htp]
|
||||
\widebox{
|
||||
% Top rules:
|
||||
\colrules
|
||||
% Left content: code listing:
|
||||
\begin{subfigure}{\widefigurewidth}
|
||||
\codeblock{latex}{listings/#2.tex}
|
||||
\end{subfigure}
|
||||
\hspace{\widefiguregap}
|
||||
% Right content: image or rendered example:
|
||||
\begin{subfigure}{\widefigurewidth}
|
||||
\IfFileExists{listings/#3.pdf}{
|
||||
\includegraphics[width=\linewidth]{listings/#3.pdf}
|
||||
}{
|
||||
\medskip
|
||||
\input{listings/#3}
|
||||
\medskip
|
||||
}
|
||||
\end{subfigure}
|
||||
% Bottom rules:
|
||||
\colrules
|
||||
% Left caption:
|
||||
\begin{subfigure}[t]{\widefigurewidth}
|
||||
\caption{\LaTeX-Code}
|
||||
\label{#1-code}
|
||||
\end{subfigure}
|
||||
\hspace{\widefiguregap}
|
||||
% Right caption:
|
||||
\begin{subfigure}[t]{\widefigurewidth}
|
||||
\caption{Result}
|
||||
\label{#1-result}
|
||||
\end{subfigure}
|
||||
}
|
||||
% General caption:
|
||||
\caption{#4}
|
||||
\label{#1}
|
||||
\end{figure}
|
||||
}
|
||||
|
||||
@ -1,41 +0,0 @@
|
||||
#!/bin/bash
|
||||
for D in listings/*; do
|
||||
if [ -d "${D}" ]; then
|
||||
# Compile without cropping.
|
||||
# References to other files are interpreted relative to the
|
||||
# root directory.
|
||||
for F in ${D}/*_page.tex; do
|
||||
if [ -f "${F}" ]; then
|
||||
echo "###### Compiling ${F} ######"
|
||||
pdflatex --shell-escape --output-directory "${D}" "${F}"
|
||||
fi
|
||||
done
|
||||
# Compile with cropping.
|
||||
# Careful: References to other files are interpreted relative
|
||||
# to the file, not to the root directory.
|
||||
for F in ${D}/*_crop.tex; do
|
||||
if [ -f "${F}" ]; then
|
||||
echo "###### Compiling and cropping ${F} ######"
|
||||
pushd "${D}"
|
||||
pdflatex --shell-escape "$(basename $F)"
|
||||
pdfcrop "$(basename -s .tex ${F}).pdf" \
|
||||
"$(basename -s .tex ${F}).pdf"
|
||||
popd
|
||||
fi
|
||||
done
|
||||
# Compile with BibTeX and cropping.
|
||||
# References to other files are interpreted relative to the
|
||||
# root directory.
|
||||
for F in ${D}/*_bib.tex; do
|
||||
if [ -f "${F}" ]; then
|
||||
echo "###### Compiling and cropping ${F} ######"
|
||||
pdflatex --output-directory "${D}" "${F}"
|
||||
bibtex "${F%.tex}.aux"
|
||||
pdflatex --output-directory "${D}" "${F}"
|
||||
pdflatex --output-directory "${D}" "${F}"
|
||||
pdfcrop "${D}/$(basename -s .tex ${F}).pdf" \
|
||||
"${D}/$(basename -s .tex ${F}).pdf"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
||||
@ -1,31 +0,0 @@
|
||||
#!/bin/bash
|
||||
for D in exercises/*; do
|
||||
echo "${D}"
|
||||
if [ -d "${D}" ]; then
|
||||
# convert tex to pdf
|
||||
for F in ${D}/*.rend.tex; do
|
||||
if [ -f "${F}" ]; then
|
||||
echo "###### Rendering ${F} ######"
|
||||
pdflatex --output-directory "${D}" --shell-escape "${F}"
|
||||
fi
|
||||
done
|
||||
# crop pdf
|
||||
for F in ${D}/*.rend.pdf; do
|
||||
if [ -f "${F}" ]; then
|
||||
pdfcrop "${F}"
|
||||
fi
|
||||
done
|
||||
# remove temporary files
|
||||
for F in ${D}/*.{aux,log,out}; do
|
||||
if [ -f "${F}" ]; then
|
||||
rm ${F}
|
||||
fi
|
||||
done
|
||||
# move pdf to graphics folder
|
||||
for F in ${D}/*.pdf; do
|
||||
if [ -f "${F}" ]; then
|
||||
mv ${F} graphics/
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
||||
@ -1,131 +0,0 @@
|
||||
\chapter{Basic document structure}
|
||||
\label{sec:basic-document-structure}
|
||||
|
||||
In essence, every \LaTeX{} document is composed of two parts:
|
||||
We call the first commands within our \LaTeX{} document the \emph{preamble}.
|
||||
It specifies global properties of our document, such as the document class, the encoding, the language, the page format, and additional packages that we want to use.
|
||||
The \emph{document environment}, on the other hand, contains the actual content of our document, i.\,e., the things that we will later see in our generated \acro{PDF} file.
|
||||
|
||||
\Example{lst:latex-document-basic-structure}{basic-document-structure/hello-world}{basic-document-structure/hello-world_crop}{Exemplary structure of a simple \LaTeX{} document with preamble and document environment}
|
||||
|
||||
\section{Preamble}
|
||||
Let's take a closer look at the preamble.
|
||||
A minimal preamble should contain the following specifications:
|
||||
|
||||
\subsection{Document class}\label{sec:document-class}
|
||||
We can define a document class by using the command \code{latex}{\textbackslash documentclass[<para- meter>]\{<document class>\}}.
|
||||
The most commonly used document classes that are supported by default are \pkg{article} for short documents, and \pkg{report} for longer ones.
|
||||
Furthermore, you can use \pkg{book} for books, \pkg{beamer}\footnote{We do not cover making presentations in \LaTeX{} in this tutorial. However, if you are interested in the topic, we recommend this introduction on Overleaf: \url{https://www.overleaf.com/learn/latex/Beamer}} for presentations, and \pkg{letter}\footnote{We also do not cover letters in this script. An introduction can be found on WikiBooks: \url{https://en.wikibooks.org/wiki/LaTeX/Letters}} for letters.
|
||||
|
||||
In addition to the standard document classes, the \acro{KOMA} script classes have been developed.
|
||||
They provide alternatives to the document classes mentioned above:
|
||||
In lieu of \pkg{article} you can use \pkg{scrartcl}, \pkg{report} is replaced by \pkg{scrreprt},\footnote{Those vowels are indeed missing, do not try to insert them.} and \pkg{scrbook} can be used instead of \pkg{book}.
|
||||
As a replacement for \pkg{letter}, one can use \pkg{scrlttr2}.
|
||||
A complete list of all \acro{KOMA} script classes is available online.\footnote{Available at: \url{https://komascript.de/komascriptbestandteile}}
|
||||
By using \acro{KOMA} document classes, the layout of the generated \acro{PDF} document is changed.
|
||||
On top of that, they provide additional functionalities.
|
||||
The standard document classes are designed according to US-American conventions
|
||||
whereas \acro{KOMA} classes adhere to European norms, e.\,g., for
|
||||
writing letters.
|
||||
|
||||
Each \code{latex}{\textbackslash documentclass} command can hold optional parameters in
|
||||
square brackets.
|
||||
\code{latex}{\textbackslash documentclass[10pt,a5paper,landscape]scrartcl\}},
|
||||
for instance, configures a \acro{KOMA} script article and sets its font size to
|
||||
10\,pt,\footnote{The standard font size is 12\,pt.} the page size to
|
||||
A5,\footnote{The default case would be A4.} and the orientation of the page to
|
||||
landscape.
|
||||
The language can be passed as an optional parameter, too (cf. \cref{sec:language}).
|
||||
|
||||
\subsection{Digression: packages}
|
||||
\label{sec:packages}
|
||||
|
||||
\codeblock{latex}{listings/basic-document-structure/packages.tex}
|
||||
Packages provide additional commands and functionalities that we can use within our \LaTeX{} source code.
|
||||
There are numerous packages for different use cases (e.\,g., typesetting formulas, lists, \textellipsis).
|
||||
In order to use a package, it must be included within the preamble.
|
||||
To do so, the above-mentioned command is used.
|
||||
The most important \LaTeX{} packages can be found in the Comprehensive \TeX\ Archive Network, short: \acro{CTAN}.\footnote{Available at: \url{https://www.ctan.org/}}
|
||||
You can also find documentation for the packages there.
|
||||
|
||||
\subsection{Encoding}
|
||||
\codeblock{latex}{listings/basic-document-structure/encoding.tex}
|
||||
One use case for packages is specifying the encoding of our \LaTeX{} document.
|
||||
The character encoding\footnote{cf. \url{https://en.wikipedia.org/wiki/Character_encoding}} determines the available character set.
|
||||
The standard encoding in \LaTeX{} is \acro{ASCII}.\footnote{cf. \url{https://en.wikipedia.org/wiki/ASCII}}
|
||||
It is an American character encoding and therefore does not contain German umlauts or most other special characters, which makes it unsuitable at least for non-english use cases.
|
||||
Instead, \acro{UTF-8}\footnote{cf. \url{https://en.wikipedia.org/wiki/UTF-8}} can be used as a universal character encoding.
|
||||
|
||||
In \LaTeX{}, we need to specify two character encodings:
|
||||
The input encoding (\mono{inputenc}), which refers to our source code, and the font encoding (\mono{fontenc}), which determines what the content of our \acro{PDF} document looks like.\footnote{Details on \mono{fontenc} can be found at: \url{https://tex.stackexchange.com/questions/108417/font-encoding-in-latex}}
|
||||
\pkg{T1} is an encoding that tries to cover most European languages with a limited number of characters.
|
||||
|
||||
\subsection{Language}\label{sec:language}
|
||||
\codeblock{latex}{listings/basic-document-structure/language.tex}
|
||||
The package \pkg{babel} provides language-specific information (e.\,g., on hyphenation, special characters, changing fonts, translation of labels\footnote{cf. \cref{sec:references}} like \enquote{Chapter,} \enquote{Table of Contents,} or \enquote{Figure.}
|
||||
The desired language can be passed as an optional parameter.
|
||||
\pkg{ngerman}, for instance, is used for the new German spelling.
|
||||
Some packages require that the language is already passed as an optional parameter in the \code{latex}{\textbackslash documentclass} command.
|
||||
In this case, just leave out the optional parameter for the language within the \pkg{babel} inclusion command.
|
||||
|
||||
We can also use multiple languages in our document.
|
||||
To do so, we pass the languages, separated by commas, as an optional parameter to the babel inclusion command.
|
||||
Within our document, we can switch between languages with the \code{latex}{\textbackslash selectlanguage\{<language>\}} command.
|
||||
Alternatively, foreign-language text can be declared by using the following command:
|
||||
|
||||
\codeblock{latex}{listings/basic-document-structure/foreign-language.tex}
|
||||
|
||||
\section{Document environment}
|
||||
The actual content of the \acro{PDF} document needs to be put inside of an environment starting with \code{latex}{\textbackslash begin\{document\}} and ending with \code{latex}{\textbackslash end\{document\}}.
|
||||
|
||||
\subsection{Continuous text}
|
||||
The easiest content that we can integrate into the document environment is continuous text.
|
||||
We can write it directly into our source code.
|
||||
Line breaks and multiple consecutive spaces are ignored by \LaTeX{}.
|
||||
Blank lines create a new paragraph, that is indented by default.\footnote{The automatic indentation of new paragraphs can be prevented by using the command \code{latex}{\textbackslash noindent}.}
|
||||
Manual line breaks can be enforced with two backslashes (\textbackslash\textbackslash).
|
||||
This should be avoided, though.
|
||||
|
||||
\subsection{Comments}
|
||||
Some characters are reserved for \LaTeX-specific commands, for instance, the percent sign.
|
||||
Using a percent sign tells the \LaTeX{} compiler to ignore the rest of the line, so the text after the percent character will not appear in the generated \acro{PDF} document.
|
||||
This is called a \emph{comment}\textit{,}
|
||||
and it can be useful to take notes while working on a document without affecting the document itself.
|
||||
|
||||
There are a few more of these reserved characters, as we will see and learn to deal with in \cref{sec:more-special-characters}.
|
||||
|
||||
\subsection{Sections and chapters}
|
||||
Continuous text can be structured by headings that divide the document into sections and chapters.
|
||||
Needless to say, \LaTeX{} provides us with commands for that.
|
||||
The commands that are depicted in \cref{lst:headlines} can be used with any document class.
|
||||
|
||||
\Example{lst:headlines}{basic-document-structure/headlines}{basic-document-structure/headlines_crop}{Heading Levels}
|
||||
|
||||
Some document classes provide additional commands. In a \pkg{report}, you get \code{late}{\textbackslash chapter\{Chapter\}}, and in a \pkg{book}, additionally \code{latex}{\textbackslash part\{Part\}}.
|
||||
You can mark the command with an asterisk if you want to omit the numbering of a section and exclude it from the table of contents:\footnote{cf. \cref{sec:table-of-contents}}
|
||||
|
||||
\codeblock{latex}{listings/basic-document-structure/section.tex}
|
||||
|
||||
An alternative title for the table of contents can be declared as an optional
|
||||
parameter in square brackets between the command and the actual title:
|
||||
|
||||
\codeblock{latex}{listings/basic-document-structure/title-in-toc.tex}
|
||||
|
||||
\subsection{Front matter}
|
||||
A simple front matter can be created by using the command \code{latex}{\textbackslash maketitle}.
|
||||
The values to be inserted into the front matter must be specified within the preamble.
|
||||
Multiple authors are joined by \code{latex}{\textbackslash and}.
|
||||
If the date is not specified by the \code{latex}{\textbackslash date} command, the current date will be inserted by default.
|
||||
The design of the front matter depends on the specified document class.
|
||||
|
||||
\Example{lst:titles}{basic-document-structure/titles}{basic-document-structure/titles_crop}{The front matter}
|
||||
|
||||
\subsection{Indices}\label{sec:table-of-contents}
|
||||
|
||||
The command \code{latex}{\textbackslash tableofcontents} generates an automatically numbered table of contents by making use of the above-mentioned commands for dividing our text into sections and chapters (this can bee seen in \cref{lst:main-file} on \cpageref{lst:main-file}).
|
||||
|
||||
The numbering style and depth, and many other options can, of course, be specified manually.\footnote{We recommend the following blogpost: \url{https://texblog.org/2011/09/09/10-ways-to-customize-tocloflot/}}
|
||||
For \LaTeX{} to create our table of contents properly, the project has to be compiled twice.
|
||||
|
||||
Besides the table of contents, you can also generate a \code{latex}{\textbackslash listoffigures} (list of figures) and a \code{latex}{\textbackslash listoftables} (list of tables).
|
||||
The captions of your figures and tables will appear within those indices.\footnote{cf. \cref{sec:graphics} (Graphics) and \cref{sec:tables} (Tables) for more information on captions}
|
||||
@ -1,102 +0,0 @@
|
||||
\chapter{How does \LaTeX{} work?}
|
||||
\label{sec:basic-functionality}
|
||||
|
||||
Word processing and document creation programs have to decide how to translate user input into a document layout.
|
||||
There are different concepts to approach this topic.
|
||||
When working with Microsoft Word, the rule is: a document exported as \acro{PDF} looks exactly like the source document in Word.
|
||||
Where a graphic is placed in Word, it is also found in the \acro{PDF}.
|
||||
Adjustments to the appearance in Word and other popular programs thus result in a direct visual change.
|
||||
This type of formatting is called \emph{What you see is what you get} (\acro{WYSIWYG} for short).
|
||||
Content and formatting are closely linked.
|
||||
|
||||
\LaTeX{}, on the other hand, works according to the principle \emph{What you get is what you mean} (\acro{WYGIWYM} for short).
|
||||
Content and formatting are separated more clearly.
|
||||
The content is placed in a document in plain text form, together with so-called \emph{commands}.
|
||||
The combination of text content and commands is also called \emph{source} code.
|
||||
|
||||
To customize the presentation of the content, we do not set the text appearance itself but add appropriate commands instead.
|
||||
These are processed by a \emph{compiler}, which adjusts the resulting appearance depending on the command.
|
||||
Line by line, the compiler processes text and commands from our source code.
|
||||
When all the source code has been processed by the compiler, we get the final document.
|
||||
There are different export options, but most of the time we output the document as a \acro{PDF}\,---\,just like in Word.
|
||||
|
||||
As a brief example for a command, we shall use the emphasis of words or sentences.
|
||||
The command is \code{latex}{\textbackslash emph\{\}}.
|
||||
We write the text we want to emphasize inside the curly braces in the source code, like this:
|
||||
\code{latex}{\textbackslash emph\{Good morning!\}}.
|
||||
In the resulting \acro{PDF}, this text will appear in italics: \emph{Good morning!}
|
||||
There is no trace of the command identifier and the special characters.
|
||||
You can see, we are not writing italic text inside the source code, we just tell the compiler that certain words should be emphasized by the use of a command.
|
||||
|
||||
This simple example illustrates a strength of the \acro{WYGIWYM} principle.
|
||||
We mark text elements on a semantic level and can make the associated typographic adjustments centrally\,---\,or let \LaTeX{} do the configuration itself.
|
||||
For instance, if we want to change the way highlighting is done, we can configure this once.
|
||||
At all places where \code{latex}{\textbackslash emph\{\}} is used, the final result will be adjusted accordingly.
|
||||
There is no need to make adjustments at each occurrence of an emphasized word.
|
||||
The principle is similar to style sheets in office programs, although more consistent and powerful.
|
||||
|
||||
\section{What do we need to use \LaTeX{}?}
|
||||
\label{subsec:what-we-need}
|
||||
|
||||
If we want to generate a \acro{PDF} document with \LaTeX{}, we need at least two programs.
|
||||
One to create the source code, and a second one to process the source code.
|
||||
The latter is the already mentioned compiler.
|
||||
|
||||
In principle, a simple text editing program is sufficient for creating the source code.
|
||||
Most operating systems provide such programs out of the box.
|
||||
Maybe you are already used to applications like Notepad++,\footnote{Available at \url{https://notepad-plus-plus.org/}.} these are usable as well.
|
||||
Then there are advanced programs like \TeX{}studio\footnote{Available at \url{https://www.texstudio.org/}.} or Texmaker\footnote{Available at \url{https://www.xm1math.net/texmaker/}.} which integrate additional functions that facilitate the use of commands.
|
||||
You are free to choose, but we recommend to use \TeX{}studio.
|
||||
|
||||
As mentioned before, we need a compiler to be able to compile our source code.
|
||||
The compiler is usually part of a collection of \emph{programs} and \emph{packages} which are together called a \LaTeX{} \emph{distribution}\textit{.}
|
||||
The included packages provide various additional commands.
|
||||
For now, we will skip over the many programs.\footnote{We will get to know one of these helper programs later on, in \ref{sec:literature}, when we are citing literature.}
|
||||
|
||||
Multiple different \LaTeX{} distributions exist.
|
||||
Some of the well-known ones are MiK\TeX,\footnote{For Windows, macOS and Linux. Available at \url{https://miktex.org/}.} Mac\TeX,\footnote{For macOS and Linux. Available at \url{https://www.tug.org/mactex/}.} and \TeX{} Live.\footnote{For Windows, macOS, and Linux. Available at \url{https://www.tug.org/texlive/}.}
|
||||
It is best to install one of them right away.
|
||||
The installation may take several hours.
|
||||
For this reason, some distributions are available for download in a small and a full version.
|
||||
The full version contains all packages, while the small version downloads packages only when they are needed.
|
||||
Unfortunately, we cannot take away the decision if you would rather wait for the download at the beginning or later while you are working.
|
||||
|
||||
\section{The commands}
|
||||
\label{subsec:command-structure}
|
||||
The commands used in source code follow a general structure:
|
||||
\codeblock{xml}{listings/basic-functionality/command-structure.txt}
|
||||
|
||||
A command can use several optional and/or mandatory parameters.
|
||||
Some commands have no mandatory parameters at all.
|
||||
Some examples are shown in \cref{tbl:latex-commands}.
|
||||
|
||||
\begin{table}[h!]
|
||||
\widebox{
|
||||
\begin{tabular}{@{}p{\widefigurewidth}p{\widefigurewidth}@{}}
|
||||
\toprule
|
||||
Command & Effect \\
|
||||
\midrule
|
||||
\code{latex}{\textbackslash newpage} & inserts a new page \\
|
||||
\code{latex}{\textbackslash textbf\{Text\}} & prints the text in bold font \\
|
||||
\code{latex}{\textbackslash usepackage[utf8]\{inputenc\}} & sets the text encoding to \acro{UTF-8} \\
|
||||
\code{latex}{\textbackslash documentclass[a4paper,12pt]\{article\}} & specifies the document class \\
|
||||
\code{latex}{\textbackslash frac\{3\}\{4\}} & inserts a mathematical fraction \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
}
|
||||
\caption{Examples for \LaTeX-commands}
|
||||
\label{tbl:latex-commands}
|
||||
\end{table}
|
||||
|
||||
If a command allows multiple optional parameters that accept similar inputs, it is sometimes necessary to specify which parameter is meant.
|
||||
For example, the command for embedding graphics accepts optional parameters for width and height.
|
||||
If \mono{[12cm, 4cm]} were entered, it would be unclear which value is intended for which parameter.
|
||||
To make the assignment more concrete, it is possible to specify the parameters
|
||||
explicitly:
|
||||
\codeblock{latex}{listings/basic-functionality/parameters.tex}
|
||||
|
||||
As the examples already show, many different commands can be used.
|
||||
Some are intended for use in mathematical formulas, others allow the inclusion of graphics.
|
||||
In the beginning, it will take some getting used to.
|
||||
However, you don’t have to learn every single command by heart: As soon as you remember the most important commands, you can easily create simple documents and look up everything else.
|
||||
|
||||
@ -1,78 +0,0 @@
|
||||
\chapter{References and footnotes}
|
||||
\section{Footnotes}\label{sec:footnotes}
|
||||
|
||||
|
||||
Whenever we want to include footnotes into our \LaTeX{} document, we can use
|
||||
the command \code{latex}{\textbackslash footnote{<text>}}. At the position where we use
|
||||
the command, the correct number will be inserted automatically, and the text
|
||||
within the curly braces will appear in the footer. In combination with the
|
||||
package \pkg{hyperref}, \acro{URL}s within footnotes become
|
||||
clickable.\footnote{if we use the command \code{latex}{\textbackslash url{…}}}
|
||||
We can see examples for that in the whole document.
|
||||
|
||||
The package \pkg{footmisc} provides us with additional options for how to display footnotes. They can be passed as optional parameters to the command \code{latex}{\textbackslash usepackage}:
|
||||
\begin{itemize}
|
||||
\item \code{latex}{\textbackslash usepackage[perpage]\{footmisc\}} ensures that the count of footnotes begins at 1 for each new page.
|
||||
\item \code{latex}{\textbackslash usepackage[para]\{footmisc\}} lets the footnotes within the footer appear as continuous text (i.\,e., the footnotes can also appear next to each other).
|
||||
\item \code{latex}{\textbackslash usepackage[symbol]\{footmisc\}} causes a numbering with symbols (e.\,g., \textdagger, \textdaggerdbl) instead of numbers.
|
||||
\end{itemize}
|
||||
|
||||
|
||||
\section{References}\label{sec:references}
|
||||
|
||||
If we want to make references, like \enquote{\textellipsis , which you can see
|
||||
in figure 21, \textellipsis}, \LaTeX{} by default provides us with the command
|
||||
\code{latex}{\textbackslash ref\{<label>\}}. No more adapting of the numbering
|
||||
for graphics, tables, etc. needed!
|
||||
The command expects a unique label as argument, that needs to be assigned to
|
||||
the referenced element. After that, wherever we call the command, the number of
|
||||
our referenced object appears in the text.
|
||||
\Example{lst:fooboar-learning-latex}{references/ref}{references/ref_crop}{Example
|
||||
for a reference}
|
||||
|
||||
A smarter package for references is \pkg{cleveref}.\footnote{with only one
|
||||
\enquote{r}!}
|
||||
It provides us with the command \code{latex}{\textbackslash cref\{<label>\}},
|
||||
which can also handle multiple labels separated by commas.
|
||||
This automatically generates elegant references like \enquote{sections 1 to 3,
|
||||
and 5.}\footnote{for the source code \code{latex}{\textbackslash
|
||||
cref\{sec:section1,sec:section2,
|
||||
sec:section3,sec:section5\}}}
|
||||
Furthermore, \code{latex}{\textbackslash ref\{<label>\}} automatically inserts
|
||||
a suited abbreviation, e.\,g., \enquote{fig.} for figures.
|
||||
|
||||
We can reference graphics, tables, sections, chapters, source code listings,
|
||||
and equations.
|
||||
Many packages use the label in order to find out the object type of the
|
||||
referenced element.
|
||||
For this reason, it is common to insert a prefix before each label
|
||||
(\cref{lst:reference-prefixes}).
|
||||
|
||||
\begin{table}[H]
|
||||
\centering
|
||||
\begin{tabular}{@{}llll@{}}
|
||||
\toprule
|
||||
Prefix & Object type & Prefix & Object type \\ \midrule
|
||||
fig: & figures & tbl: & tables \\
|
||||
sec: & sections & subsec: & subsections \\
|
||||
ch: & chapters & itm: & items \\
|
||||
eq: & equations & lst: & source code listings \\ \bottomrule
|
||||
\end{tabular}
|
||||
\caption{Prefixes for labels}
|
||||
\label{lst:reference-prefixes}
|
||||
\end{table}
|
||||
|
||||
Note that if we use \code{latex}{\textbackslash cref\{<label>\}}\,---\,for some
|
||||
document classes\,---\,the generated passages only appear in the desired
|
||||
language (e.\,g., German) when the language is specified already within the
|
||||
document class command:
|
||||
|
||||
\codeblock{latex}{listings/references/set-language.tex}
|
||||
|
||||
\noindent Except for sections, captions\footnote{\code{latex}{\textbackslash
|
||||
caption\{…\}}} \emph{always need to be specified and positioned before the
|
||||
label}\textit{.} Otherwise, they cannot be referenced later on in the text.
|
||||
Labels for sections are inserted directly after the command:
|
||||
|
||||
\codeblock{latex}{listings/references/sections.tex}
|
||||
|
||||
@ -1,52 +0,0 @@
|
||||
\chapter{Graphics}
|
||||
\label{sec:graphics}
|
||||
|
||||
Since in \LaTeX{} we work with plain text, we cannot simply embed graphics into our text as we may be used to from other word processing programs.
|
||||
Instead, we reference external image files by a command. The figure is then embedded and positioned at compile time.
|
||||
|
||||
\section{Inserting graphics}
|
||||
\label{sec:display-graphics}
|
||||
In order to be able to reference graphics, the package \texttt{graphicx} has to be included. For inserting a figure, we can use the following commands:
|
||||
|
||||
\codeblock{latex}{listings/graphics/insert-graphics.tex}
|
||||
|
||||
\noindent The command \mono{includegraphics} can be used to change the image size. The desired height and width of the figure can be indicated separately, as illustrated by the following example:
|
||||
|
||||
\codeblock{latex}{listings/graphics/image-size.tex}
|
||||
|
||||
With the \mono{caption} command you can also add a caption to the image. Note that you can provide an alternative caption in square brackets, if you want.
|
||||
|
||||
\section{Positioning}
|
||||
\label{sec:graphics-placement}
|
||||
One interesting aspect of the what-you-get-is-what-you-mean paradigm is the way how graphics can be positioned.
|
||||
The compiler creates multiple layouts and evaluates them.
|
||||
By default, graphics are placed at the potentially optimal position that is calculated by the compiler.
|
||||
By moving them around, typographic blemishes like widows and orphans\footnote{The first (last) line of a paragraph appears alone as last (first) line on the previous (next) page, cf. \url{https://en.wikipedia.org/wiki/Widows_and_orphans}.} can be avoided.
|
||||
|
||||
As a consequence, graphics are not necessarily placed between the two text blocks that we specify, but at another position.
|
||||
In order to reference a picture, that possibly is placed on another page, we can use labels, which are covered in \cref{sec:references}.
|
||||
On top of that, we can limit the positioning of our image more or less rigorously by adding optional parameters to the \texttt{figure} environment. The available positioning shortcuts can be found in \cref{tbl:placement-abbreviations}.
|
||||
|
||||
\begin{table}[h!]
|
||||
\centering
|
||||
\begin{tabular}{cl}
|
||||
\toprule
|
||||
Shortcut & Position \\
|
||||
\midrule
|
||||
h & here, if possible \\
|
||||
t & on top of the page \emph{(top)} \\
|
||||
b & at the bottom of the page \emph{(bottom)} \\
|
||||
p & on its own page \emph{(page)} \\
|
||||
H & definitely here (requires package \texttt{float}) \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Shortcuts for positioning graphics}
|
||||
\label{tbl:placement-abbreviations}
|
||||
\end{table}
|
||||
|
||||
\codeblock{latex}{listings/graphics/positioning.tex}
|
||||
|
||||
Besides the vertical positioning, also the horizontal orientation may be of importance.
|
||||
By default, graphics are left-justified.
|
||||
The command \code{latex}{\textbackslash centering} centers all following objects in the current environment.
|
||||
If we want the centering to affect only one object, we can alternatively wrap it with \code{latex}{\textbackslash begin\{center\}} and \code{latex}{\textbackslash end\{center\}}.
|
||||
@ -1,23 +0,0 @@
|
||||
\chapter{Lists}
|
||||
\label{sec:lists}
|
||||
|
||||
Inherently, \LaTeX{} supports three types of lists: unordered, ordered, and description lists.
|
||||
For each of these types, there are dedicated environments whose structure is very similar.
|
||||
|
||||
\example{lst:unordered-list}{lists/nested-list}{Examplary unordered list}
|
||||
|
||||
In \cref{lst:unordered-list-code}, different list items (\code{latex}{\textbackslash item}) are framed by an \mono{itemize} environment.
|
||||
Within a list item, we can open a new list environment to create a nested list.
|
||||
If we replace \mono{itemize} by \mono{enumerate}, the list becomes ordered without changing the source code any further.
|
||||
To make use of the less common description lists, we have to specify the environment \mono{description}.
|
||||
Moreover, the items need to be extended by the term to be defined, put in brackets (\cref{lst:description-list}).
|
||||
|
||||
\Example{lst:description-list}{lists/description-list}{lists/description-list_crop}{Exemplary description list}
|
||||
|
||||
The exuberant spacing between list items can be reduced by utilizing the \mono{paralist}\footnote{\url{https://www.ctan.org/pkg/paralist}} package.
|
||||
To do so, we simply adjust the environment name: \sh{compactitem} replaces \sh{itemize}, \sh{compactenum} replaces \sh{enumerate}, and \sh{compactdesc} replaces \sh{description}.
|
||||
If the list ought to appear within a text body, \pkg{paralist} provides the extra environments \mono{inparaenum} and \mono{inparaitem}.
|
||||
|
||||
We can customize bullet and list numbering styles via the \pkg{enumitem}\footnote{\url{https://www.ctan.org/pkg/enumitem}} package.
|
||||
\code{latex}{\textbackslash begin\{enumerate\}[label=\textbackslash roman*]} produces a list with Roman numerals.
|
||||
The parameter \code{latex}{[label=\textbackslash alph*]} inserts alphabetical numbering.
|
||||
@ -1,69 +0,0 @@
|
||||
\chapter{Reference management}
|
||||
\label{sec:literature}
|
||||
|
||||
For typesetting our first thesis in \LaTeX{}, the last core functionality to learn is citing literature.
|
||||
Our references are gathered in a bibliography file.
|
||||
Once we reference one of its entries from our \LaTeX{} document, Bib\TeX{} (a
|
||||
program similar to the standard \sh{pdflatex} compiler)
|
||||
can insert automatically generated citations.
|
||||
It will format them in a bibliography style of our choice.
|
||||
|
||||
\section{The bibliography file}
|
||||
Our \textbf{bibliography collection} consists of multiple literature entries in a pre-defined format, such that they can be processed by Bib\TeX{}.
|
||||
An exemplary item can be seen in \cref{lst:bibfile-sample-entry}.
|
||||
|
||||
\begin{figure}[H]
|
||||
\codeblock{bibtex}{listings/literature/bibliography-entry.bib}
|
||||
|
||||
\caption{Exemplary bibliography entry}
|
||||
\label{lst:bibfile-sample-entry}
|
||||
\end{figure}
|
||||
|
||||
The type of the bibliography entry is specified after the opening \mono{@} sign (article, book, proceedings, …).
|
||||
What follows is a list of important attributes like title and author.
|
||||
Whether they are required or not depends on the type of the entry.
|
||||
In any case, we will need the first entry after the opening braces: the Bib\TeX{} key.
|
||||
This is the identifier that we will use to reference the entry in our \LaTeX{} document.
|
||||
Bib\TeX{} keys can be chosen freely, but have to be unique.
|
||||
Typically, they will consist of a combination of authors, publication dates, and topics.\newpage
|
||||
|
||||
\textbf{Bibliography files} can be compiled manually, yet it is more common to use programs like JabRef\footnote{Cf. \url{https://www.jabref.org/}.} or Zotero\footnote{Cf. \url{https://www.zotero.org/}.}.
|
||||
While JabRef operates directly on your bibliography file, Zotero projects\footnote{Vgl. \url{https://guides.library.iit.edu/c.php?g=720120&p=6296986}.} can be exported to bibliography files to use them in \LaTeX{} documents.
|
||||
|
||||
\textbf{Bibliography entries} are provided by many academic search engines, including Google Scholar (cf. \cref{fig:google-scholar-bibtex}).
|
||||
When using them, make sure that the entries are cohesive across your reference collection and complete with regard to their attributes.
|
||||
A high-quality (although, unfortunately, incomplete) source for Bib\TeX{} entries is the dblp computer science bibliography.\footnote{Available at \url{https://dblp.org/search}.}
|
||||
|
||||
\begin{figure}[H]
|
||||
\includegraphics[width=\textwidth]{graphics/google_bibtex1.jpg}
|
||||
\includegraphics[width=\textwidth]{graphics/google_bibtex2.jpg}
|
||||
\caption{Loading Bib\TeX{} entries from Google Scholar}
|
||||
\label{fig:google-scholar-bibtex}
|
||||
\end{figure}
|
||||
|
||||
\section{Citing}
|
||||
Bib\TeX{} extends \LaTeX{} by several commands (cf. \cref{tbl:bibtex-commands}).
|
||||
Make sure to include the \pkg{natbib} package for this purpose.
|
||||
|
||||
\begin{table}[H]
|
||||
\centering
|
||||
\begin{tabular}{ll}
|
||||
\toprule
|
||||
Function & Command \\ \midrule
|
||||
Citing authors & \code{latex}{\textbackslash citeauthor\{<source>\}} \\
|
||||
Citing sources & \code{latex}{\textbackslash cite\{<source>\}} \\
|
||||
Citing pages & \code{latex}{\textbackslash cite[p. 15]\{<source>\}} \\
|
||||
Custom citations & \code{latex}{\textbackslash cite[<prefix>][<suffix>]\{<source>\}} \\
|
||||
Including the bibliography & \code{latex}{\textbackslash bibliography\{<bibliographyfile>\}} \\
|
||||
Setting the bibliography style & \code{latex}{\textbackslash bibliographystyle\{<style>\}} \\ \bottomrule
|
||||
\end{tabular}
|
||||
\caption{Commands for citations}
|
||||
\label{tbl:bibtex-commands}
|
||||
\end{table}
|
||||
|
||||
The \code{latex}{<source>} of a citation is always a Bib\TeX key.
|
||||
The list of available citation styles\footnote{Head to Overleaf for a rather complete list: \url{https://www.overleaf.com/learn/latex/Biblatex_citation_styles}} includes \mono{alpha}, \mono{natdin}, and \mono{apa}.
|
||||
The table of references will always appear where the \code{latex}{\textbackslash bibliography\{…\}} command was put.
|
||||
The \code{latex}{\textbackslash cite} command comes with many variants.\footnote{cf. \url{https://www.economics.utoronto.ca/osborne/latex/BIBTEX.HTM}}
|
||||
|
||||
\Example{lst:natdin-example}{literature/natdin-example}{literature/natdin-example_bib}{Exemplary citations in the \mono{natdin} style.}
|
||||
@ -1,83 +0,0 @@
|
||||
\chapter{Mathematical formulas}
|
||||
\label{sec:maths}
|
||||
|
||||
Mathematical formulas are always set in \emph{math mode}, which, within a paragraph (referred to as \emph{inline}), can be turned on or off with a dollar sign.
|
||||
There is also a \emph{block} environment (cf. \cref{lst:sample-math-environment}).
|
||||
Important packages for mathematical features are the \texttt{amsmath},
|
||||
\pkg{amsthm}, and \pkg{amssymb} packages of the American Mathematical
|
||||
Society, as well as \pkg{mathtools}.
|
||||
As with many other environments, adding an asterisk turns off the numbering.
|
||||
|
||||
\example{lst:sample-math-environment}{maths/sample-math-environment}{Exemplary math environments}
|
||||
|
||||
\section{A few examples}
|
||||
%Die \cref{tbl:maths-common-commands,tbl:maths-logic-sets-braces} listen einige häufig in Formeln verwendeten Befehle auf.
|
||||
|
||||
\begin{table}[H]
|
||||
\centering
|
||||
\begin{tabular}{ll}
|
||||
\toprule
|
||||
Source code & Result \\ \midrule
|
||||
\code{latex}{\textbackslash sqrt\{16\}} & $\sqrt{16}$ \\
|
||||
\code{latex}{\textbackslash frac\{3\}\{4\}} & $\frac{3}{4}$ \\
|
||||
\code{latex}{e\textasciicircum\{\textbackslash pi\}} & $e^{\pi}$ \\
|
||||
\code{latex}{\textbackslash sum\_\{i=1\}\textasciicircum\{n\}x\textasciicircum 2} & $\sum_{i=1}^{n}x^2$ \\
|
||||
\code{latex}{12 \textbackslash leq 4 x\textasciicircum 2 + 13} & $12 \leq 4 x^2 + 13$ \\
|
||||
\code{latex}{{n \textbackslash choose k}} & ${n \choose k}$ \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Frequently used commands (square root, fraction, power, sum, inequation, binomial coefficient).
|
||||
By \code{latex}{\textasciicircum\{…\}} and \code{latex}{\_\{…\}}, the content is set in super- or subscript.}
|
||||
\label{tbl:maths-common-commands}
|
||||
\end{table}
|
||||
|
||||
\begin{table}[H]
|
||||
\widebox{
|
||||
\centering
|
||||
\begin{tabular}{ll}
|
||||
\toprule
|
||||
Source code & Result \\ \midrule
|
||||
\code{latex}{(x), [x], \textbackslash lbrace x \textbackslash rbrace, \textbackslash lvert x \textbackslash rvert} & $(x), [x], \lbrace x\rbrace, \lvert x\rvert$\\
|
||||
\code{latex}{\textbackslash exists,\textbackslash forall,\textbackslash in,\textbackslash notin,\textbackslash infty} & $\exists,\forall,\in,\notin,\infty$ \\
|
||||
\code{latex}{\textbackslash alpha, \textbackslash beta, \textbackslash Gamma, \textbackslash Delta, \textbackslash varepsilon, \textbackslash pi} & $\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi$ \\
|
||||
\code{latex}{\textbackslash rightarrow, \textbackslash leftarrow, \textbackslash Rightarrow, \textbackslash Leftarrow, \textbackslash Leftrightarrow} & $\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow$ \\
|
||||
\code{latex}{(A \textbackslash cup B) \textbackslash cap C} & $(A \cup B) \cap C$ \\
|
||||
\code{latex}{(A \textbackslash lor B) \textbackslash land C} & $(A \lor B) \land C$ \\
|
||||
\code{latex}{(A \textbackslash cdot B) \textbackslash times C} & $(A \cdot B) \times C$ \\ \bottomrule
|
||||
\end{tabular}
|
||||
\caption{Brackets, quantifiers, greek letters, arrows, operators}
|
||||
\label{tbl:maths-logic-sets-braces}
|
||||
}
|
||||
\end{table}
|
||||
|
||||
\section{Growing brackets}
|
||||
|
||||
Especially in combination with fractions, brackets should grow according to their content.
|
||||
This can be achieved by pre-pending each bracket (\code{latex}{(}, \code{latex}{)}, \code{latex}{[}, \code{latex}{]}, \code{latex}{\textbackslash lbrace} and \code{latex}{\textbackslash rbrace}) with a position marker (\code{latex}{\textbackslash left} or \code{latex}{\textbackslash right}).
|
||||
|
||||
\example{lst:growing-brackets}{maths/growing-brackets}{Example for growing brackets}
|
||||
|
||||
\section{Lower and upper bounds}
|
||||
|
||||
The \code{latex}{\textbackslash limits} command renders lower and upper bounds of integrals above and below the integral sign.
|
||||
Sums, products, and limits do this
|
||||
automatically (cf. \cref{lst:limits}).
|
||||
For inline formulas, \code{latex}{\textbackslash limits} are of bounded suitability.
|
||||
|
||||
\example{lst:limits}{maths/limits}{Lower and upper bounds of sums, products, limits and integrals}
|
||||
|
||||
\section{Aligning equations}
|
||||
|
||||
The \mono{align} environment allows to align multiple equations horizontally, e.\,g., at the \mono{=} sign (\cref{lst:math-alignment-example}).
|
||||
As in tables, the \mono{\&} sign is used to specify anchorage points.
|
||||
Line breaks are denoted by two backslashes.
|
||||
|
||||
\Example{lst:math-alignment-example}{maths/align-example}{maths/align-example_crop}{Equations aligned at equals signs}
|
||||
|
||||
\section{Text in math mode}
|
||||
|
||||
Sometimes sets have to be defined in terms of textual descriptions or longer function names.
|
||||
The \LaTeX{} math mode assumes that letters are variables rather than text, which creates problems when they are indeed supposed to be entire words.
|
||||
For this case, there is the \code{latex}{\textbackslash text\{\}} command (c.\,f. \cref{lst:set-builder-notation}).
|
||||
|
||||
\example{lst:set-builder-notation}{maths/set-builder-notation}{Problems arising from intensional set notation and their solution}
|
||||
@ -1,25 +0,0 @@
|
||||
\chapter{Project structure}
|
||||
\label{sec:project-structure}
|
||||
|
||||
In the previous chapters, we have only seen very short \LaTeX{} examples.
|
||||
\LaTeX{} can of course also be used to create larger documents and projects, such as a thesis.
|
||||
In order not to lose the overview in the source code and to avoid that source files become too long, a reasonable structuring of a larger \LaTeX{} project is advisable.
|
||||
For this purpose, the source code is divided into different files, which will be discussed in more detail in the following sections.
|
||||
|
||||
\section{Main file}
|
||||
|
||||
In large projects, we typically use one main file, which is often called \file{main.tex}.
|
||||
It is, in a sense, the structural skeleton of the project, as it contains the basic structure including the preamble.
|
||||
The title, table of contents, as well as the individual chapters of a work are integrated in this main file (cf.\ \cref{lst:main-file}).
|
||||
The inclusion of the individual sections is typically done by the \code{latex}{\textbackslash input\{...\}} command
|
||||
\footnote{There exists another command called \code{latex}{\textbackslash include\{\textellipsis\}} that works slightly differently. It requires you to specify the file to be included without a file extension. Besides this, a line break is added before the content of the partial file. Lastly, you cannot nest \code{latex}{\textbackslash include\{\textellipsis\}} statements. When you try to include a file that also includes a file, a compiler error will be thrown. \code{latex}{\textbackslash input\{\textellipsis\}} on the other hand is capable of such nested imports. In this script, we will present the \code{latex}{\textbackslash input\{\textellipsis\}} command only.}
|
||||
with the file to be included as an argument.
|
||||
|
||||
\example{lst:main-file}{project-structure/main-file}{Typical structure in a main file \LaTeX{}}
|
||||
|
||||
\section{Partial files}
|
||||
Partial files are files that are included within another file, most often the main file.
|
||||
In a thesis, for example, these can represent individual chapters.
|
||||
You are free to decide how granular the division of the content into individual files should be.
|
||||
The files that are included by the main file do not contain a preamble, since this is already present in the main file.
|
||||
Neither do the commands \code{latex}{\textbackslash begin\{document\}} and \code{latex}{\textbackslash end\{document\}} appear again.
|
||||
@ -1,142 +0,0 @@
|
||||
\chapter{Prospects}
|
||||
\label{sec:prospects}
|
||||
|
||||
Obviously, in this script, we were not able to show you the least of what \LaTeX{} has to offer.
|
||||
Therefore, in this last section, we gathered some information to help you to go further into depth by yourself.
|
||||
|
||||
\section{Packages}
|
||||
|
||||
We already have presented a selection of packages. However, there are thousands more of them. In the following sections we have put together some packages for frequently needed features:
|
||||
|
||||
\begin{figure}[p]
|
||||
\widebox{
|
||||
% Top rules:
|
||||
\colrules
|
||||
% Left content: code listing:
|
||||
\begin{subfigure}{\widefigurewidth}
|
||||
\includegraphics[width=\linewidth]{graphics/coffee-cup.pdf}
|
||||
\end{subfigure}
|
||||
\hspace{\widefiguregap}
|
||||
% Right content: image or rendered example:
|
||||
\begin{subfigure}{\widefigurewidth}
|
||||
\includegraphics[width=\linewidth]{graphics/qtree.png}
|
||||
\end{subfigure}
|
||||
% Bottom rules:
|
||||
\colrules
|
||||
% Left caption:
|
||||
\begin{subfigure}[t]{\widefigurewidth}
|
||||
\caption{Vector graphics with \pkg{TikZ}}
|
||||
\centering\tiny{\url{https://texample.net/tikz/examples/coffee-cup/}}
|
||||
\label{fig:tikz-example}
|
||||
\end{subfigure}
|
||||
\hspace{\widefiguregap}
|
||||
% Right caption:
|
||||
\begin{subfigure}[t]{\widefigurewidth}
|
||||
\caption{Parse trees with \pkg{qtree}}
|
||||
\centering\tiny{\url{https://www.ling.upenn.edu/advice/latex/qtree/}}
|
||||
\label{fig:qtree-example}
|
||||
\end{subfigure}
|
||||
\medskip
|
||||
|
||||
% Top rules:
|
||||
\colrules
|
||||
% Left content: code listing:
|
||||
\begin{subfigure}{\widefigurewidth}
|
||||
\includegraphics[width=\linewidth]{graphics/prftree.png}
|
||||
\end{subfigure}
|
||||
\hspace{\widefiguregap}
|
||||
% Right content: image or rendered example:
|
||||
\begin{subfigure}{\widefigurewidth}
|
||||
\includegraphics[width=\linewidth]{graphics/benzene-ring.pdf}
|
||||
\end{subfigure}
|
||||
% Bottom rules:
|
||||
\colrules
|
||||
% Left caption:
|
||||
\begin{subfigure}[t]{\widefigurewidth}
|
||||
\caption{Proof trees with \pkg{prftree}}
|
||||
\centering\tiny{\url{https://ftp.gwdg.de/pub/ctan/macros/latex/contrib/prftree/}}
|
||||
\label{fig:prftree-example}
|
||||
\end{subfigure}
|
||||
\hspace{\widefiguregap}
|
||||
% Right caption:
|
||||
\begin{subfigure}[t]{\widefigurewidth}
|
||||
\caption{Chemical structural formulas with \pkg{chemfig}}
|
||||
\centering\tiny{\url{http://latex-cookbook.net/cookbook/examples/benzene-ring/}}
|
||||
\label{fig:chemfig-example}
|
||||
\end{subfigure}
|
||||
\medskip
|
||||
}
|
||||
% General caption:
|
||||
\caption{Examples for some packages}
|
||||
\label{fig:package-examples}
|
||||
\end{figure}
|
||||
|
||||
|
||||
\begin{description}
|
||||
\item[Indices]
|
||||
can be created automatically with \pkg{makeidx}.\footnote{\url{https://www.ctan.org/pkg/makeidx}}
|
||||
By using \code{latex}{\textbackslash index\{…\}}, one can mark entries for the index. With \code{latex}{\textbackslash printindex}, an index with references is compiled out of them.
|
||||
\item[Vector graphics]
|
||||
(\cref{fig:tikz-example})
|
||||
can be \enquote{drawn} directly in the \LaTeX{} source code with \pkg{TikZ} (recursive acronym for \emph{TikZ ist kein Zeichenprogramm}, in English: \emph{TikZ is not a drawing program}).\footnote{\url{https://www.ctan.org/pkg/pgf}}
|
||||
Caution: This package is very powerful, but not necessarily beginner-friendly.
|
||||
Before creating vector graphics from scratch, we recommend you to experiment with some of the examples at \TeX{}ample\footnote{\url{https://texample.net/tikz/examples/}}.
|
||||
Also, for certain use cases, there are special packages that are easier to handle than \enquote{raw} TikZ:
|
||||
\item[Parse trees]
|
||||
that divide sentences into their grammatical components (\cref{fig:qtree-example}) can be created with \pkg{qtree}.\footnote{\url{https://ctan.org/pkg/qtree}}
|
||||
\item[Proof trees,]
|
||||
that are often used in logics (\cref{fig:prftree-example}), can be drawn with the package \pkg{prftree}.\footnote{\url{https://www.ctan.org/pkg/prftree}}
|
||||
\item[Chemical structural formulas]
|
||||
(\cref{fig:chemfig-example})
|
||||
can, amongst others, be created with \pkg{chemfig}.\footnote{\url{https://www.ctan.org/pkg/chemfig}}
|
||||
\item[Colors]
|
||||
for your documents are provided by \pkg{xcolor}.\footnote{\url{https://www.ctan.org/pkg/xcolor}}
|
||||
\item[Notes]
|
||||
that you cannot overlook can be created with \pkg{todonotes}.\footnote{\url{https://www.ctan.org/pkg/todonotes}}
|
||||
With this package, you can mark what you still \todo{Please do not change. This is an example.} have to change within your document.
|
||||
\item[Pages of other \acro{PDF} files]
|
||||
can be integrated into the source code with the \texttt{pdfpages}\footnote{\url{https://www.ctan.org/pkg/pdfpages}} package.
|
||||
It comes in very handy whenever one needs the output of external programs in the document, for example, in the appendix.
|
||||
Just compile the document one more time and the appendix is up to date again, if the external program has changed something.
|
||||
\item[Nested graphics]
|
||||
and the positioning of captions at almost any place are provided by
|
||||
\pkg{subcaption}.\footnote{\url{https://www.ctan.org/pkg/subcaption}}
|
||||
We also made extensive use of this package.
|
||||
\item[Tables]
|
||||
can be designed much more flexibly than what we have shown here.
|
||||
The following packages can help you with that:
|
||||
\pkg{colortbl},\footnote{\url{https://www.ctan.org/pkg/colortbl}}
|
||||
\pkg{tabularx},\footnote{\url{https://www.ctan.org/pkg/tabularx}}
|
||||
\pkg{multirow},\footnote{\url{https://www.ctan.org/pkg/multirow}}
|
||||
\pkg{makecell}.\footnote{\url{https://www.ctan.org/pkg/makecell}}
|
||||
\end{description}
|
||||
|
||||
\noindent \mono{beamer}, which is not a package, but another document class, can be used to create \textbf{slide shows}
|
||||
with \LaTeX{}. Information on the document class and examples are available at Overleaf,\footnote{\url{https://www.overleaf.com/learn/latex/Beamer}} which brings us to the next section:
|
||||
|
||||
\section{Help and information}
|
||||
|
||||
\textbf{Wikibooks} provides you with a much more detailed introduction into \LaTeX{}. Note that the German version\footnote{\url{https://de.wikibooks.org/wiki/LaTeX-Kompendium}} is less complete than the English one.\footnote{\url{https://en.wikibooks.org/wiki/LaTeX}}
|
||||
If required, both refer to additional packages.
|
||||
|
||||
Whenever you need information on certain packages, \acro{\textbf{CTAN}}\footnote{\url{https://ctan.org/}} is your place to go.
|
||||
For each package, you can find the official documentation as a \acro{PDF} file there.
|
||||
Within this file, the first paragraphs are usually the most interesting. They are
|
||||
followed by implementation details, that you normally do not need.
|
||||
|
||||
If the official documentation is too theoretical, and you prefer a more hands-on approach, \textbf{Overleaf}\footnote{\url{https://www.overleaf.com/}} can help you out.
|
||||
Primarily, it is a collaborative online \LaTeX{} editor. However, you can find
|
||||
multiple templates\footnote{\url{https://www.overleaf.com/latex/templates}} for
|
||||
different types of documents (CVs, theses, \textellipsis) there.
|
||||
|
||||
If you are looking for examples dedicated to TikZ, \textbf{\TeX{}ample}\footnote{\url{https://texample.net/}} provides you with multiple of them.
|
||||
|
||||
For concrete questions, the question-answering platform \textbf{Stackexchange} is a good place to go: There even is a \TeX{} community there.\footnote{\url{https://tex.stackexchange.com/}}
|
||||
|
||||
~\newline\noindent Of course, you can always contact us with your questions:
|
||||
\begin{compactitem}
|
||||
\item via mail to \href{mailto:fachschaft-wiai.stuve@uni-bamberg.de}{fachschaft-wiai.stuve@uni-bamberg.de},
|
||||
\item via phone at +49951\,863\,1219,
|
||||
\item or just come to our bureau at WE5/02.104.
|
||||
\end{compactitem}
|
||||
|
||||
@ -1,32 +0,0 @@
|
||||
\newpage
|
||||
\section{Using listings}
|
||||
|
||||
\subsection{Installation}
|
||||
\pkg{listings} is a \LaTeX{} package of itself and does not require any additional installation as long as the \pkg{xcolor} package is installed as well.
|
||||
We can therefore jump straight into typesetting source code.
|
||||
|
||||
\subsection{Defining listings}
|
||||
Similar to \pkg{minted}, you can define listings using a dedicated environment (cf.\ \cref{lst:listings-environment}) and you can use another command to import source code directly from external files (cf.\ \cref{lst:listings-external}).
|
||||
|
||||
\example{lst:listings-environment}{source-code-listings/listings-environment}{Exemplary source code listing}
|
||||
\example{lst:listings-external}{source-code-listings/listings-import}{Including from a separate file}
|
||||
|
||||
\noindent Both commands need a language specification\footnote{See this guide on Overleaf for a list of all languages: \url{https://www.overleaf.com/learn/latex/Code_listing\#Reference_guide}} as an optional parameter to apply syntax highlighting.
|
||||
|
||||
\subsection{Configuring listings}
|
||||
The \pkg{listings} package can also be tweaked in an almost infinite number of ways.
|
||||
Numerous optional parameters give you a lot of freedom.
|
||||
|
||||
Once again, Overleaf and the package documentation\footnote{Available at \url{https://www.overleaf.com/learn/latex/Code_listing\#Code_styles_and_colours} and \url{https://ctan.org/pkg/listings}, respectively.} come in handy.
|
||||
|
||||
\example{lst:listings-external-styled}{source-code-listings/listings-import-styled}{Themes and further options}
|
||||
|
||||
\subsection{Drawbacks and caveats}
|
||||
As mentioned earlier, \pkg{listings} is not our first choice for source code listings.
|
||||
Its renderings are of rather peculiar appearance.
|
||||
|
||||
With some amount of configuration, we can overcome the most disturbing default settings.
|
||||
Although \pkg{listings} is not shipped with any pre-defined themes, you can define your own and use them throughout your project with the \mono{lstdefinestyle} command.\footnote{Have a look at it in the package documentation. For the very impatient, here is a solarized theme for \pkg{listings}: \url{https://github.com/jez/latex-solarized}}
|
||||
|
||||
The package is also a bit older than its alternative, causing \acro{UTF-8} special characters to break.
|
||||
If this happens to you, have a look at the \mono{literate} option of the \pkg{listings}\footnote{The \LaTeX{} WikiBook offers a good starter for the \mono{literate} option covering the most frequent special characters: \url{https://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings\#Encoding_issue}} commands.
|
||||
@ -1,95 +0,0 @@
|
||||
\section{Using minted}
|
||||
|
||||
\subsection{Installation}
|
||||
Using \pkg{minted} requires a working installation of the programming language Python 3 (henceforth referred to as Python).
|
||||
On some operating systems, Python comes pre-installed, in which case entering the command \sh{python -{}-version} or \sh{python3 -{}-version} in a terminal of your choice\footnote{Opening a terminal on Windows: \includegraphics[width=.7em]{graphics/faWindows.png} + R → Type \enquote{cmd} → Enter} should print out the installed Python version.
|
||||
|
||||
If Python is yet to be installed, then you can find the installation files on the project website\footnote{Available at \url{https://www.python.org/downloads/}.}.
|
||||
There are extensive articles that cover all relevant steps to install Python on
|
||||
Windows,\footnote{Pawandeep, How to install Python in Windows?. Tutorialspoint. March 10, 2021. Available at
|
||||
\url{https://www.tutorialspoint.com/how-to-install-python-in-windows}.
|
||||
Windows users will have to adjust the system path during the installation process. Forgetting this step has
|
||||
been the number one installation problem in past workshops.}
|
||||
Linux,\footnote{\url{https://docs.python-guide.org/starting/install3/linux/}}
|
||||
or macOS.\footnote{\url{https://docs.python-guide.org/starting/install3/osx/}}
|
||||
|
||||
After a successful installation, you should be able to execute the aforementioned command in a terminal, confirm by pressing Enter, and see approximately the following result:
|
||||
|
||||
\shell{python -{}-version \\ Python 3.8.5}
|
||||
|
||||
\noindent If the version number is equal to the one stated here, or higher, then everything should be set up correctly.
|
||||
Next, enter the command \sh{pip install Pygments}\footnote{On some operating systems, you might have to use the command \sh{pip3 install Pygments}} in the same terminal window to install the Pygments package for Python.
|
||||
Once the installation is complete, you are ready to include the \LaTeX{} package \pkg{minted} into your documents by adding \code{latex}{\textbackslash usepackage\{minted\}} to your preamble.
|
||||
|
||||
|
||||
\subsection{Changing the compiler command}
|
||||
There is one last adjustment needed before you can actually compile your documents---we will have to adjust the compile command.
|
||||
Out of the box, your editor will probably execute the following command after you clicked the green compile arrow:
|
||||
|
||||
\shell{pdflatex main-exercises.tex}
|
||||
|
||||
\noindent The exact command can be found and configured in \TeX{}studio under Options\,→\,Configure \TeX{}studio\,→\,Commands.
|
||||
It is stated next to the Pdf\LaTeX{} label.
|
||||
The file that is to be compiled will replace the placeholder \sh{\%.tex} upon compilation.
|
||||
Typically, there are two additional options configured.
|
||||
You can recognize them by the hyphen before their names (\sh{-synctex=1} and \sh{-interaction=\allowbreak{}nonstopmode}).
|
||||
These options are called flags and they configure the program \sh{pdflatex}.
|
||||
We will have to add another flag.
|
||||
Place the string \sh{-shell-escape} before the file placeholder (\sh{\%.tex}):
|
||||
|
||||
\shell{pdflatex -synctex=1 -interaction=nonstopmode -shell-escape \%.tex}
|
||||
|
||||
\noindent After a click on \enquote{Okay} the configuration is finished.
|
||||
Other editors usually provide similar options to configure the compilation command.
|
||||
We recommend you to have a look at the settings or to use of a search engine to figure it out.
|
||||
|
||||
\paragraph{An important note on the shell-escape flag.} \pkg{minted}'s syntax highlighting is done by a Python package, which adds the necessity to communicate between the compiler and the Python runtime.
|
||||
The shell-escape flag adds this communication path.
|
||||
When enabled, \LaTeX{} can execute any command in a terminal, which can be very useful.
|
||||
Nonetheless, it would also be possible to execute malign code on your computer via \LaTeX{}, especially when you are compiling unknown documents from the Internet.
|
||||
Therefore, do not compile downloaded documents with the shell-escape flag if you do not trust the authors and did not check the packages and commands they include.
|
||||
|
||||
\subsection{Defining listings}
|
||||
We are finally ready to marvel at the aesthetic quality of the listings \pkg{minted} produces.
|
||||
You can define listings using a dedicated environment:
|
||||
|
||||
% Render listing directly, if minted is available.
|
||||
% Otherwise, include pre-rendered images.
|
||||
\ifthenelse{\equal{\listingsmode}{minted}}{%
|
||||
\example{lst:minted-environment}{source-code-listings/minted-environment}{Exemplary source code listing}
|
||||
}{%
|
||||
\Example{lst:minted-environment}{source-code-listings/minted-environment}{source-code-listings/minted-environment_crop}{Exemplary source code listing}
|
||||
}
|
||||
|
||||
% Render listing directly, if minted is available.
|
||||
% Otherwise, include pre-rendered images.
|
||||
\ifthenelse{\equal{\listingsmode}{minted}}{%
|
||||
\example{lst:minted-variants}{source-code-listings/minted-variants}{Shorthand and inline listing}
|
||||
}{%
|
||||
\Example{lst:minted-variants}{source-code-listings/minted-variants}{source-code-listings/minted-variants_crop}{Shorthand and inline listing}
|
||||
}
|
||||
|
||||
\noindent There is also a shorthand and an inline variant of the command (cf.\ \cref{lst:minted-variants}).
|
||||
To avoid redundancy, it may be practical to import source code directly from the source file.
|
||||
To accomplish this, we only have to pass the programming language and the file path to the \code{latex}{\textbackslash inputminted} command (cf.\ \cref{lst:minted-external}).
|
||||
|
||||
% Render listing directly, if minted is available.
|
||||
% Otherwise, include pre-rendered images.
|
||||
\ifthenelse{\equal{\listingsmode}{minted}}{%
|
||||
\example{lst:minted-external}{source-code-listings/minted-import}{Including from a separate file}
|
||||
}{%
|
||||
\Example{lst:minted-external}{source-code-listings/minted-import}{source-code-listings/minted-import_crop}{Including from a separate file}
|
||||
}
|
||||
|
||||
\subsection{Configuring minted}
|
||||
Optional parameters allow us to add line numbers, line breaks, and colors.
|
||||
Moreover, there are numerous themes available (\cref{lst:minted-external-styled}).
|
||||
The introduction on Overleaf and the package documentation\footnote{Available at \url{https://www.overleaf.com/learn/latex/Code_Highlighting_with_minted} and \url{https://ctan.kako-dev.de/macros/latex/contrib/minted/minted.pdf}, respectively.} give an extensive overview.
|
||||
|
||||
% Render listing directly, if minted is available.
|
||||
% Otherwise, include pre-rendered images.
|
||||
\ifthenelse{\equal{\listingsmode}{minted}}{%
|
||||
\example{lst:minted-external-styled}{source-code-listings/minted-import-styled}{Themes and further options}
|
||||
}{%
|
||||
\Example{lst:minted-external-styled}{source-code-listings/minted-import-styled}{source-code-listings/minted-import-styled_crop}{Themes and further options}
|
||||
}
|
||||
@ -1,25 +0,0 @@
|
||||
\chapter{Source code listings}
|
||||
\label{sec:source-code-listings}
|
||||
|
||||
There are many ways in \LaTeX{} to display source code.
|
||||
We have come to appreciate the package \pkg{minted}, which causes some additional installation overhead, but generates very appealing source code renderings.
|
||||
|
||||
However, especially on macOS, the installation of \pkg{minted} has caused a lot of headache in the early days of this workshop.
|
||||
That's why we will also have a look at an alternative called \pkg{listings}.
|
||||
|
||||
\paragraph{A note on colors.} Both of these packages require you to define colors.
|
||||
We can recommend using the \pkg{xcolor} package.
|
||||
There are very helpful resources\footnote{If you would like to specify your own colors , these pages might help you: \url{https://www.overleaf.com/learn/latex/Using_colours_in_LaTeX} for a list of pre-defined colors in the \pkg{xcolor} package, \url{https://mmoredo.github.io/latex-color-converter/} for defining your own colors} available online such that we will not go into details here.
|
||||
|
||||
\section*{Source code listings within this script}
|
||||
|
||||
This script uses the package \pkg{listings} as default way for displaying source code listings, since, as mentioned above, it causes less headache, especially on macOS. As we introduce \pkg{minted} as an alternative package, naturally, this script can also display source code listings rendered by \pkg{minted}.
|
||||
|
||||
To switch between the packages, you can change the listings mode to \pkg{minted} like so: First of all, follow the respective installation instructions. Afterwards, create a new file called \file{listings-mode.tex} in the root directory of this project, and insert the following line into the newly created file:
|
||||
|
||||
\codeblock{latex}{./listings/source-code-listings/change-listings-mode.tex}
|
||||
|
||||
After compiling the script, you should see differently rendered source code listings. If you want to return to \pkg{listings} as package for rendering your source code listings, just replace \sh{minted} with \sh{default} in the \file{listings-mode.tex} file. Source code listings within this script are then displayed using the \pkg{listings} package again.
|
||||
|
||||
\input{./content/source-code-listings-minted}
|
||||
\input{./content/source-code-listings-listings}
|
||||
@ -1,147 +0,0 @@
|
||||
\chapter{Special characters}
|
||||
|
||||
\label{sec:special-characters}
|
||||
|
||||
\section{Spaces}
|
||||
|
||||
The special character used most frequently is a simple space between words.
|
||||
\LaTeX{} creates it whenever the source code contains spaces or single newlines (by hitting the enter key once) between other characters.
|
||||
The word space is not the only one, though\,---\,there are a few more types of spaces.
|
||||
\Cref{lst:spaces} illustrates how they are used.
|
||||
|
||||
\example{lst:spaces}{special-characters/spaces}{Different spaces in \LaTeX}
|
||||
|
||||
\paragraph{English Spacing}
|
||||
In documents written in English, \LaTeX{} uses traditional English Spacing by default. That is, double spaces after each sentence.
|
||||
We can prevent this by using the command \code{tex}{\textbackslash frenchspacing} above the first paragraph.
|
||||
With \code{latex}{\textbackslash nonfrenchspacing}, we can reset the behavior.
|
||||
When using English Spacing, \LaTeX{} tries to recognize abbreviations and to use normal spaces after those.
|
||||
We should still check this and\,---\,where necessary\,---\,enforce word spaces (\mono{.\textbackslash␣}) or sentence spaces (\mono{\textbackslash @.␣}).
|
||||
|
||||
\section{Hyphens and dashes}
|
||||
There are different kinds of horizontal lines being used as punctuation,
|
||||
most frequently the hyphen (-), the en dash (–) and the em dash (—).\footnote{They are named after the letters N and M,
|
||||
that occupy roughly the same space.
|
||||
The letter M is also about as wide as it is tall, and the amount is called a \emph{Geviert} in German, hence the German terms \emph{Halbgeviertstrich} and \emph{Geviertstrich} for the two dashes.}
|
||||
These three characters are created in \LaTeX{} by different numbers of consecutive hyphens in the source code,
|
||||
as shown in \cref{tbl:bars}.
|
||||
|
||||
\begin{longtable}{@{}llp{7.8cm}@{}}
|
||||
\toprule
|
||||
Code & Character & Usage \\
|
||||
\midrule
|
||||
\code{latex}{-} & Hyphen & a small-sized stroke \\
|
||||
\code{latex}{-{}-} & En dash & a range mark (8\,--\,10\,am) or an interruptor at sentence level – the latter surrounded by spaces and used in most European languages (including British English) \\
|
||||
\code{latex}{-{}-{}-} & Em dash & an interrupter at sentence level\,---\,mostly used in American English and without or with thin spaces \\
|
||||
\bottomrule
|
||||
\caption{Hyphens and dashes in \LaTeX}
|
||||
\label{tbl:bars}
|
||||
\end{longtable}
|
||||
|
||||
The hyphen is obviously also used for hyphenation, but for this purpose, we should not insert it explicitly in our source code.
|
||||
In most places, \LaTeX{} does the hyphenation automatically if we are using the correct \texttt{babel} configuration.\footnote{c.\,f. \cref{sec:language}.}
|
||||
In case something goes wrong, we can intervene using the codes from \cref{tbl:separators}:\footnote{Those also require the \texttt{babel} package.}
|
||||
|
||||
\setlength\LTleft{-2cm}
|
||||
\begin{longtable}{@{}lp{8cm}p{3cm}p{3cm}@{}}
|
||||
\toprule
|
||||
Code & Explanation & English example & German example \\
|
||||
\midrule
|
||||
\endhead
|
||||
\code{latex}{\textbackslash -} & Exclusive hyphenation: The word may only be hyphenated at this position (can also be used multiple times within one word\,---\,all of those positions are then allowed). & & $\qquad\qquad\qquad$~Vers\-endung, Ver\-sendung \\
|
||||
\code{latex}{"-} & Additional hyphenation: The word may be hyphenated here, as well as at the default positions. & & $\qquad\quad$~Mecklen- burg-Vorpommern \\
|
||||
\code{latex}{-} & Exclusive hyphen: Is only used for compound words and prevents the automatic hyphenation for the rest of the word (which is typographically desirable). & $\qquad\qquad\quad$~stand-by & Hals-Nasen-Ohren-Arzt \\
|
||||
\code{latex}{"=} & Non-exclusive hyphen: Is used for long compound words when the text wrapping would not work without additional automatic hyphenation. & & $\qquad\qquad$~Sonnen-auf- und -untergang \\
|
||||
\code{latex}{""} & Cut-off point without a hyphen: Allows something like a \acro{url} to wrap without inserting a potentially misleading hyphen. Also useful in combination with parentheses. & $\qquad\qquad$~(sub-) module & $\qquad\qquad$~(Teil-) Prüfung \\
|
||||
\code{latex}{"\textasciitilde} & Non-wrapping hyphen: Keeps the hyphen together with the following word, very useful for suspended hyphens when parts of compound words are omitted. & high-quality and \mbox{-priced products} & von Satzanfang bis \mbox{-ende} \\ % cannot be reproduced without german babel
|
||||
\bottomrule
|
||||
\caption{Exceptions for hyphenation}
|
||||
\label{tbl:separators}
|
||||
\end{longtable}
|
||||
|
||||
\section{Quotation marks}
|
||||
Quotation marks can generally be created using the codes from \cref{tbl:quotation-marks}.
|
||||
The decisive factor is the appearance, not the semantics, which is why the French Guillemets are used the wrong way around in German
|
||||
(the \emph{french left quotation mark} on the right and vice versa).
|
||||
|
||||
\begin{table}[H]
|
||||
\center
|
||||
\begin{tabular}{lcccc}
|
||||
\toprule
|
||||
Language & \multicolumn{2}{c}{First level} & \multicolumn{2}{c}{Second level} \\
|
||||
\cmidrule(lr){2-3} \cmidrule(lr){4-5}
|
||||
& Code & Result & Code & Result \\
|
||||
\midrule
|
||||
English (\acro{A.\,E.}) & \code{latex}{``…''} & ``…'' & \code{latex}{`…'} & `…' \\
|
||||
English (\acro{B.\,E.}) & \code{latex}{`…'} & `…' & \code{latex}{``…''} & ``…'' \\
|
||||
German & \code{latex}{\glqq…\grqq} & \glqq…\grqq & \code{latex}{\glq…\grq} & \glq…\grq \\
|
||||
German (alternatively) & \code{latex}{\frqq…\flqq} & \frqq…\flqq & \code{latex}{\frq…\flq} & \frq…\flq \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Quotation marks}
|
||||
\label{tbl:quotation-marks}
|
||||
\end{table}
|
||||
|
||||
We can get more flexibility using the \pkg{csquote} package, which provides the \code{latex}{\enquote{<quote>}} command.
|
||||
It chooses the correct quotation marks depending on the language being used; also, nested \texttt{enquote}s automatically switch back and forth between first and second level.
|
||||
When enabling the \code{latex}{autostyle=true} option on package import, \code{latex}{\textbackslash foreignquote\{<language>\}\{<quote>\}} selects varying quotation marks for each quotation.
|
||||
|
||||
\section{Diacritics}
|
||||
If we are able to insert letters with diacritics via our keyboard\,---\,e.\,g., the German Umlauts or common accents\,---\,we can do this within our source code, as well:
|
||||
The characters will remain intact in the output.
|
||||
If not, we can also create the diacritics via escape codes.
|
||||
\Cref{tbl:diacritics} shows just a few examples\,---\,the letters can of course be swapped out, but there is still a huge amount of different diacritics.
|
||||
|
||||
\begin{table}[H]
|
||||
\center
|
||||
\begin{tabular}{lccclccclcc}
|
||||
\toprule
|
||||
\code{latex}{\textbackslash `{o}} & -- & \`{o} & $\quad$ & \code{latex}{\textbackslash c{c}} & -- & \c{c} & $\quad$ & \code{latex}{\textbackslash d{u}} & -- & \d{u} \\
|
||||
\code{latex}{\textbackslash '\{o\}} & -- & \'{o} & & \code{latex}{\textbackslash k\{a\}} & -- & \k{a} & & \code{latex}{\textbackslash r\{a\}} & -- & \r{a} \\
|
||||
\code{latex}{\textbackslash \^\{o\}} & -- & \^{o} & & \code{latex}{\textbackslash l\{\}} & -- & \l{} & & \code{latex}{\textbackslash u\{o\}} & -- & \u{o} \\
|
||||
\code{latex}{\textbackslash "\{o\}} & -- & \"{o} & & \code{latex}{\textbackslash =\{o\}} & -- & \={o} & & \code{latex}{\textbackslash v\{s\}} & -- & \v{s} \\
|
||||
\code{latex}{\textbackslash H\{o\}} & -- & \H{o} & & \code{latex}{\textbackslash b\{o\}} & -- & \b{o} & & \code{latex}{\textbackslash t\{oo\}} & -- & \t{oo} \\
|
||||
\code{latex}{\textbackslash ~\{o\}} & -- & \~{o} & & \code{latex}{\textbackslash .\{o\}} & -- & \.{o} & & \code{latex}{\textbackslash o} & -- & \o \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Diacritics}
|
||||
\label{tbl:diacritics}
|
||||
\end{table}
|
||||
|
||||
\section{More special characters}\label{sec:more-special-characters}
|
||||
Some special characters, like the percent sign, are reserved as part of the \LaTeX{} syntax and cannot be used as normal characters.
|
||||
These and many, many more can be created by their own commands.
|
||||
Please note that some of them only work in maths environments (c.\,f. \cref{sec:maths}), others might require additional packages.
|
||||
|
||||
\begin{table}[H]
|
||||
\center
|
||||
\begin{tabular}{cll}
|
||||
\toprule
|
||||
Sign & Code & Remarks \\
|
||||
\midrule
|
||||
?`/!` & \verb|?`/!`| & \\
|
||||
\textasciicircum & \code{latex}{\textbackslash textasciicircum} & \\
|
||||
\textasciitilde & \code{latex}{\textbackslash textasciitilde} & \\
|
||||
\textasteriskcentered & \code{latex}{\textbackslash textasteriskcentered} & \\
|
||||
\textbackslash & \code{latex}{\textbackslash textbackslash} & \\
|
||||
%\textbar & \code{latex}{\textbackslash textbar} & \\
|
||||
%\textbullet & \code{latex}{\textbackslash textbullet} & \\
|
||||
\textcopyright & \code{latex}{\textbackslash textcopyright} & \\
|
||||
\textdagger & \code{latex}{\textbackslash textdagger} & \\
|
||||
%\textdaggerdbl & \code{latex}{\textbackslash textdaggerdbl} & \\
|
||||
\textellipsis & \code{latex}{\textbackslash textellipsis} & \\
|
||||
\textless/\textgreater & \code{latex}{\textbackslash textless/\textbackslash textgreater} & \\
|
||||
\textperthousand & \code{latex}{\textbackslash textperthousand} & \\
|
||||
\textsection & \code{latex}{\textbackslash textsection} & \\
|
||||
$\delta, \pi, \Sigma$ & \verb|\delta, \pi, \Sigma|, … & only in maths
|
||||
environments \\
|
||||
\textteshlig & \code{latex}{\textbackslash textteshlig} & requires the \pkg{tipa} package \\
|
||||
\textmusicalnote & \code{latex}{\textbackslash textmusicalnote} & requires the \pkg{textcomp} package \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Some special characters}
|
||||
\label{tbl:special-characters}
|
||||
\end{table}
|
||||
Whenever you need a certain symbol and don’t know its name, \emph{Detexify}\footnote{\url{http://detexify.kirelabs.org/classify.html}} comes to the rescue: You can draw the symbol and get all necessery information.
|
||||
From cuneiforms to technical symbols, there is absolutely \emph{everything}\textit{,} as you can see scrolling through the \emph{Comprehensive \LaTeX{} Symbol List}\textit{.}\footnote{\url{http://tug.ctan.org/info/symbols/comprehensive/symbols-a4.pdf}}
|
||||
|
||||
@ -1,50 +0,0 @@
|
||||
\chapter{Tables}
|
||||
\label{sec:tables}
|
||||
|
||||
There are two fundamental environments for tables.
|
||||
The first one, called \mono{table}, is responsible for integrating the table as a whole into the document.
|
||||
Positioning is done the same way as it is with graphics.
|
||||
The \code{latex}{\textbackslash caption} command is the same, as well.
|
||||
|
||||
At the table \emph{content}, the similarities end:
|
||||
While graphics are embedded from external files and not interpreted by \LaTeX{},
|
||||
the inner structure of tables has to be encoded explicitly.
|
||||
This is done with the \mono{tabular} environment that expects a column definition as an obligatory parameter.
|
||||
The column definition consists of one letter per column specifying its text alignment:
|
||||
\mono{l} for left-justified, \mono{r} for right-justified, \mono{c} for centered.
|
||||
|
||||
Within the \mono{tabular} environment, the actual table content follows.
|
||||
Table rows are separated by \code{latex}{\textbackslash \textbackslash}, just like line breaks, and cells by an \code{latex}{\&}.
|
||||
|
||||
For typographically pleasing tables, we recommend the \pkg{booktabs} package.\footnote{All commands previously mentioned also work without this package, but the result will look far less professional.}
|
||||
This package brings along the commands \code{latex}{\textbackslash toprule}, \code{tex}{\textbackslash midrule} and \code{tex}{\textbackslash bottomrule} that draw appropriate horizontal lines above, within and below the table, respectively.
|
||||
|
||||
Vertical lines can be inserted as a vertical bar character (\mono{|}) in the column definition, but this is \emph{not} recommended.\footnote{The
|
||||
whitespace within the table separates the columns clearly enough, additional lines just make for visual clutter.}
|
||||
If you want to remove the additional whitespace that surrounds the columns by default (e.\,g., to the left of the first column and to the right of the last), you can add the string \mono{@\{\}} at the corresponding places within the column definition.
|
||||
|
||||
A complete table can then look like the one shown in \cref{lst:sample-table}.
|
||||
|
||||
\Example{lst:sample-table}{tables/table-example}{tables/table-example-renderable}{A complete table}
|
||||
|
||||
\paragraph{Excess length}
|
||||
For tables exceeding one page or requiring line breaks within individual cells,
|
||||
the \pkg{longtable} package can be used additionally (also supported by \pkg{booktabs}).
|
||||
The \pkg{longtable} environment combines the \mono{table} and \mono{tabular} environments.
|
||||
With it, you get the following basic structure:
|
||||
|
||||
\begin{samepage}
|
||||
\codeblock{latex}{listings/tables/excess-length.tex}
|
||||
\end{samepage}
|
||||
|
||||
\paragraph{Excess width}
|
||||
If you want to present a very wide table instead, it is preferable on pages in portrait orientation to turn the table by 90\textdegree{}.
|
||||
This can be done with the help of the \pkg{rotating} package.
|
||||
The only difference between this and a normal table is that the \mono{table} environment gets replaced by a \mono{sidewaystable} environment.
|
||||
Positioning and the \mono{tabular} stay unaffected.
|
||||
|
||||
\paragraph{More possibilities}
|
||||
Of course, \LaTeX{} offers lots of additional features for sophisticated tables, e.\,g., row- or column-spanning cells.
|
||||
For something like this\,---\,or just to save some typing\,---\,we recommend the \emph{Tables Generator}\textit{,}\footnote{\url{https://tablesgenerator.com/}} that allows you to click your tables together in \textsc{wysiwyg} style and provides you with \LaTeX{} code ready for copying into your document.
|
||||
|
||||
|
||||
@ -1,102 +0,0 @@
|
||||
\chapter{Text markup}
|
||||
|
||||
\section*{Text highlighting}
|
||||
|
||||
Text markup can be done in two ways: semantically or visually.
|
||||
We recommend that you use semantic markup whenever possible.
|
||||
In contrast to visual markup, it only states \emph{why} something is special and entrusts to \LaTeX{} \emph{how} it is going to look.
|
||||
The simplest semantic markup, that was also used in the previous sentence, is an emphasis: \code{latex}{\textbackslash emph\{…\}}.
|
||||
By default, this command sets text in italics.
|
||||
When it is nested, the second level of emphasis is set straight again.
|
||||
This kind of formatting is only perceived when reading the text and does not attract attention beforehand, as colored or bold text does (which is more appropriate for higher-level structuring purposes).
|
||||
|
||||
Some types of visual markup are listed in \cref{tbl:visual-markup}, but you should use them very carefully.
|
||||
In principle, they can also be nested, however, for some combinations, the corresponding fonts will be missing.
|
||||
Many other programs try to distort existing fonts to imitate the missing one.
|
||||
As this does not look particularly good, \LaTeX{} will not do it.
|
||||
So do not be surprised when your carefully nested selection of four different markups is just ignored and does not do anything at all.
|
||||
|
||||
\begin{table}[H]
|
||||
\center
|
||||
\begin{tabular}{lll}
|
||||
\toprule
|
||||
Markup & Command & Rendering \\
|
||||
\midrule
|
||||
bold & \code{latex}{\textbackslash textbf\{bold face\}} & \textbf{bold face} \\
|
||||
italics & \code{latex}{\textbackslash textit\{italics\}} & \textit{italics} \\
|
||||
small caps & \code{latex}{\textbackslash textsc\{small caps\}} & \textsc{small caps} \\
|
||||
monospaced & \code{latex}{\textbackslash texttt\{typewriter text\}} & \texttt{typewriter text} \\
|
||||
slanted & \code{latex}{\textbackslash textsl\{slanted\}} & \textsl{slanted} (please, don’t!) \\
|
||||
underlined & \code{latex}{\textbackslash underline\{underlined\}} & \underline{underlined} \\
|
||||
subscript & \code{latex}{\textbackslash textsubscript\{subscript\}} & x\textsubscript{subscript} \\
|
||||
superscript & \code{latex}{\textbackslash textsubscript\{superscript\}} & x\textsuperscript{superscript} \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Visual markup commands}
|
||||
\label{tbl:visual-markup}
|
||||
\end{table}
|
||||
|
||||
Usually, you should not need these commands too often, as they appear by themselves when you are using semantic markup.
|
||||
For instance, the \pkg{hyperref} package provides the \code{latex}{\textbackslash url\{…\}} command.
|
||||
This command does not only use a mono-spaced font for \acro{URL}s, it also makes them clickable and, if necessary, wraps them without adding hyphens.
|
||||
|
||||
The same applies for different font sizes.
|
||||
You can specify the body text font size with an option at the document class:
|
||||
\codeblock{latex}{listings/text-markup/font-size.tex}
|
||||
Building upon this, \LaTeX{} generates different font sizes that can be called via the commands in \cref{tbl:type-sizes}.
|
||||
It is, however, best to restrict those to title pages and similar things.
|
||||
For the rest, you can trust the default settings and avoid the visual clutter.
|
||||
|
||||
\begin{table}[H]
|
||||
\center
|
||||
\begin{tabular}{ll}
|
||||
\toprule
|
||||
Command & Rendering \\
|
||||
\midrule
|
||||
\code{latex}{\{\textbackslash tiny tiny\}} & {\tiny tiny} \\
|
||||
\code{latex}{\{\textbackslash footnotesize footnote size\}} & {\footnotesize footnote size} \\
|
||||
\code{latex}{\{\textbackslash small small\}} & {\small small} \\
|
||||
\code{latex}{\{\textbackslash normalsize normal\}} & {\normalsize normal} \\
|
||||
\code{latex}{\{\textbackslash large large\}} & {\large large} \\
|
||||
\code{latex}{\{\textbackslash Large larger\}} & {\Large larger} \\
|
||||
\code{latex}{\{\textbackslash LARGE largest\}} & {\LARGE largest} \\
|
||||
\code{latex}{\{\textbackslash huge largest of all\}} & {\huge largest of all} \\
|
||||
\code{latex}{\{\textbackslash Huge megalomania\}} & {\Huge megalomania} \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Font size commands}
|
||||
\label{tbl:type-sizes}
|
||||
\end{table}
|
||||
|
||||
\newpage
|
||||
|
||||
\section*{Paragraph alignment}
|
||||
\label{sec:ragged-alignment}
|
||||
By default, \LaTeX{} sets continuous text in full justification.
|
||||
However, we can also switch to ragged alignment by using the commands
|
||||
\code{latex}{\textbackslash raggedright}, \code{latex}{\textbackslash raggedleft}, and
|
||||
\code{latex}{\textbackslash centering}.
|
||||
These commands influence the environment that they are used in, e.\,g., the
|
||||
\mono{document} environment. Correspondingly, the text within the whole
|
||||
document is affected.
|
||||
Alternatively, we can use dedicated environments in order to influence the
|
||||
formatting
|
||||
of certain paragraphs (\cref{lst:ragged-alignment}).
|
||||
|
||||
\example{lst:ragged-alignment}{formatting-paragraphs/ragged-alignment}{Ragged
|
||||
alignment}
|
||||
|
||||
\section*{Indentation and spacing}
|
||||
\label{sec:indents-and-parskips}
|
||||
Usually, we illustrate a new paragraph by indenting the first line of it
|
||||
(\code{latex}{\textbackslash parindent}).
|
||||
Alternatively, paragraph spacing, i.\,e., vertical space between paragraphs,
|
||||
can be used (\code{latex}{\textbackslash parskip}).
|
||||
For both variants, there are adjustable parameters:
|
||||
\codeblock{latex}{listings/formatting-paragraphs/indentation.tex}
|
||||
|
||||
\noindent We can use \code{latex}{\textbackslash noindent} to turn off the indentation for only one
|
||||
paragraph.
|
||||
For the first paragraph after a heading, there is usually no indentation.
|
||||
|
||||
|
||||
@ -1,45 +0,0 @@
|
||||
\chapter{Why use \LaTeX?}
|
||||
\label{sec:why-uses-latex}
|
||||
|
||||
In the early 1960s, a rather talented American Ph.D. student was asked by a big publishing company whether he wanted to write a book on compilers.
|
||||
He did.
|
||||
Soon after he had begun with his research, he realized that he wanted to start with some foundations of computer science, so he asked the publishers if the book might be a little longer.
|
||||
They replied, \enquote{make it as long as you feel necessary.}
|
||||
In 1968, the first volume was published, at that time still printed using mechanical typesetting.
|
||||
|
||||
This method was just disappearing then, and being replaced by new methods.
|
||||
However, the author did not like the results of those new methods, so,
|
||||
at the end of the 70s, he began to develop his own typesetting system \TeX{}
|
||||
(pronounced as \textipa{[tEx]}, \textipa{[tE\c{c}]} or \textipa{[tEk]}, named after the ancient Greek word \texttau$\mathrm{\acute{\varepsilon}}$\textchi\textnu\texteta{} \textipa{['tExnE:]} meaning \emph{art, craft}).
|
||||
|
||||
Today, Donald Knuth (that is the former student’s name) is a retired professor of computer science and his compiler book has grown to become the multi-volume standard work \emph{The Art of Computer Programming}\,—\,three volumes of which are still to be written, among them the one on compilers.
|
||||
Unlike the book, however, \TeX{} is the rare occurrence of a software system that may actually be called \emph{complete} without meaning \emph{dead}.
|
||||
|
||||
Two more letters are needed for \LaTeX:
|
||||
They are the initial two letters of the last name of Leslie Lamport, who, in the 80s, extended \TeX{} by a collection of small programs that made the entire system usable for us end-users and are responsible for its widespread adoption.
|
||||
The current version dates from the mid~90s.
|
||||
|
||||
Why are we telling you all of that?
|
||||
It explains some of the advantages that still distinguish \LaTeX{} today:
|
||||
It is a mature, stable, and reliable system
|
||||
that does typesetting in a typographically sophisticated way and mostly automatically.
|
||||
|
||||
As the \TeX{} code is stored in plain text files (cf. \cref{sec:basic-functionality}),
|
||||
even more advantages arise:
|
||||
You can structure your projects clearly (cf. \cref{sec:project-structure}),
|
||||
and whenever you undo changes in the source code, you can always rely on getting exactly the same output as before
|
||||
rather than some more or less similar reconstruction.
|
||||
On a larger scale, this does also work in connection with Git or other source code versioning tools.
|
||||
Furthermore, you can trust your source code to be readable long-term, without any specific software.
|
||||
It can always be opened with any program that supports plain text.
|
||||
|
||||
% Quellen:
|
||||
% https://en.wikipedia.org/wiki/Donald_Knuth
|
||||
% https://de.wikipedia.org/wiki/Donald_E._Knuth
|
||||
% https://en.wikipedia.org/wiki/The_Art_of_Computer_Programming
|
||||
% https://de.wikipedia.org/wiki/The_Art_of_Computer_Programming
|
||||
% https://en.wikipedia.org/wiki/TeX
|
||||
% https://de.wikipedia.org/wiki/TeX
|
||||
% https://de.wikipedia.org/wiki/LaTeX
|
||||
% https://en.wikipedia.org/wiki/LaTeX
|
||||
|
||||
@ -1,24 +0,0 @@
|
||||
# Instructions for compiling this project in CoCalc
|
||||
|
||||
> [CoCalc](https://academiccloud.de/services/cocalc/) is a web service for data scientists. As part of the [AcademicCloud](https://academiccloud.de/), it is available to students at University of Bamberg. CoCalc is useful for collaboration on $\LaTeX$ documents, Jupyter Notebooks, and much more. CoCalc provides an [extensive documentation](https://doc.cocalc.com/latex.html).
|
||||
>
|
||||
> **Please note**: The Academic Cloud version is currently in preview, causing limited resources, no backups, and changes without prior notice. Use at your own risk.
|
||||
|
||||
This tutorial demonstrates how to set up CoCalc to compile the LaTeX script.
|
||||
|
||||
## Project setup
|
||||
|
||||
1. Open CoCalc. Students at University of Bamberg may use [this instance](https://academiccloud.de/services/cocalc/).
|
||||
2. Click the blue button to go to your projects.
|
||||
3. Click on “Create Project …”.
|
||||
+ Add a title (e.g., “latex-workshop”).
|
||||
+ Click on “Customize software environment” and choose “TeXLive” from the dropdown.
|
||||
+ Create the project and wait for the initialization to finish. It is done when you see a blue button allowing you to “Create or Upload Files …”
|
||||
4. Choose “Explorer” on the left side and click on “Upload.” Select your compressed project archive. Once uploaded, click on the name and proceed to “Extract Files …”
|
||||
5. Back in the Explorer, you can now navigate through our project directory. Go to the file `main-exercises.tex`. It should load a familiar $\LaTeX$ work environment and automatically build the document for you. Compilation will be triggered whenever you hit `Ctrl + S`.
|
||||
|
||||
## Some general advice
|
||||
|
||||
+ Use the dropdown next to the three colorful buttons to **switch between source code files** related to the same root document. Do not open them in separate tabs via the Explorer.
|
||||
+ CoCalc **projects stop on inactivity**. You will be prompted to restart the project.
|
||||
+ When you **add new .tex documents**, CoCalc automatically fills them with some content you may want to use. For our purposes, you may delete this so-called boilerplate code.
|
||||
66
docs/faq.md
66
docs/faq.md
@ -1,66 +0,0 @@
|
||||
# Frequently asked questions
|
||||
|
||||
- [Frequently asked questions](#frequently-asked-questions)
|
||||
- [Error: “File 'setup.tex' not found. \\input{setup.tex}”](#error-file-setuptex-not-found-inputsetuptex)
|
||||
- [Error: “File \`latex-logo.png' not found: using draft setting.”](#error-file-latex-logopng-not-found-using-draft-setting)
|
||||
- [Error: “Unable to find xyz.sty”](#error-unable-to-find-xyzsty)
|
||||
- [I accidentally dismissed the prompt asking me to install a missing package.](#i-accidentally-dismissed-the-prompt-asking-me-to-install-a-missing-package)
|
||||
- [MikTeX Console is already running](#miktex-console-is-already-running)
|
||||
- [I want to use my own tools.](#i-want-to-use-my-own-tools)
|
||||
- [I need more help.](#i-need-more-help)
|
||||
|
||||
## Error: “File 'setup.tex' not found. \input{setup.tex}”
|
||||
|
||||
**Windows-specific diagnosis**:
|
||||
If this error shows up when you compile the script for the first time, you may have opened the $\LaTeX$ file without unzipping the project archive first. To resolve the error, go back to the folder where you store your downloads. Locate the project archive (something like `latex-project-….zip`). Do not double-click it. Instead, right-click and select “Unzip”, “Extract”, or similar. This will extract the ZIP archive to a new folder. Open this folder and proceed with opening the file you were looking for.
|
||||
|
||||
**Generic hints**:
|
||||
The compiler complains that a file called `setup.tex` cannot be found in the same folder as the file you are compiling. Make sure the file exists and there are no typos in your file name.
|
||||
|
||||
## Error: “File `latex-logo.png' not found: using draft setting.”
|
||||
|
||||
This is a common error when including any images or other media. Remember to specify the path to the image relative to your root document (i. e., your `main.tex`).
|
||||
|
||||
## Error: “Unable to find xyz.sty”
|
||||
|
||||
**Windows-specific diagnosis**:
|
||||
This error typically relates to packages missing from your $\LaTeX$ installation. On Windows, it can typically be solved like this:
|
||||
|
||||
1. Open the Mik$\TeX$ Console, a program that comes with your $\LaTeX$ installation.
|
||||
2. In there, you will find the “Packages” tab.
|
||||
3. Click the button to search for package updates. This should resolve the error.
|
||||
|
||||
**Generic hints**:
|
||||
The compiler complains that a package, particularly the corresponding .sty document, is missing. Typically, there is a `\usepackage{xyz}` command that loads the package xyz. Make sure there are no typos in the package name. If you do not use $\TeX$live-full (Linux), try to install the package via the Mik$\TeX$ Console (Windows) or your $\LaTeX$ distribution's helper tools.
|
||||
|
||||
## I accidentally dismissed the prompt asking me to install a missing package.
|
||||
|
||||
Try re-opening $\TeX$studio. If this does not help, there is still the option to manually install the required packages from the Mik$\TeX$ Console or similar distribution-specific management software.
|
||||
|
||||
## MikTeX Console is already running
|
||||
|
||||
If this error occurs while opening the MikTeX Console, open the Task Manager, search for “MikTeX Console”, select the entry in the table, and terminate the task by a click on the respective button. Then, open MikTeX Console again.
|
||||
|
||||
## I want to use my own tools.
|
||||
|
||||
Sure, feel free. We provide instructions for [CoCalc](./cocalc-instructions.md) and [VS Code/Codium](./vs-code-instructions.md). Any other editor will do if you know your ways around the terminal. In essence, all we do here is this:
|
||||
|
||||
```bash
|
||||
lualatex main.tex
|
||||
biber main
|
||||
lualatex main.tex
|
||||
lualatex main.tex
|
||||
```
|
||||
|
||||
Just run `pdflatex main.tex` twice if you do not have any citations. Or have a look at XeTeX, … ([numerous other tools available](https://www.tug.org/interest.html#free)).
|
||||
|
||||
## I need more help.
|
||||
|
||||
Please refer to our various resources:
|
||||
|
||||
- the workshop's [presentation](https://wiai.de/latex-weekend)
|
||||
- the [Moodle course](https://wiai.de/latex)
|
||||
- the Git project containing the [script](https://git.stuve-bamberg.de/latex/latex-skript)
|
||||
- the WIAI Student Council's [website](https://www.uni-bamberg.de/wiai/fs)
|
||||
|
||||
|
||||
@ -1,94 +0,0 @@
|
||||
# Instructions for compiling LaTeX documents in Visual Studio Code
|
||||
|
||||
This tutorial demonstrates how to set up VS Code to compile the LaTeX script. Make sure to have a [LaTeX compiler installed](./README.md) before continuing.
|
||||
|
||||
## Software installation
|
||||
|
||||
1. Download and install [VS Code](https://code.visualstudio.com/) or its open-source version [VS Codium](https://vscodium.com/).
|
||||
2. Install the [LaTeX Workshop](https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop) plugin.
|
||||
|
||||
## Build recipes
|
||||
|
||||
LaTeX Workshop uses so-called recipes to compile documents. A recipe refers to a list of commands that are executed one after the other. For our exercises, we will need one basic recipe which simply runs the compiler twice. Later on, we will need a second recipe to deal with bibliographic data.
|
||||
|
||||
1. Launch the VS Code settings and search for “recipes.”
|
||||
2. In the “Latex-workshop > LaTeX: Recipes” section, click on “Edit in settings.json.”
|
||||
3. Go ahead and add the following two entries to the list. The first one just uses the `pdflatex` compiler twice to build our document, whereas the second one adds an intermediate round of `biber` compilation and changes the LaTeX compiler to `lualatex`.
|
||||
|
||||
```json
|
||||
"latex-workshop.latex.recipes": [
|
||||
{
|
||||
"name": "pdflatex × 2",
|
||||
"tools": [
|
||||
"pdflatex",
|
||||
"pdflatex"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "lualatex -> biber -> lualatex × 2",
|
||||
"tools": [
|
||||
"lualatex",
|
||||
"biber",
|
||||
"lualatex",
|
||||
"lualatex"
|
||||
]
|
||||
},
|
||||
// EXISTING ENTRIES GO HERE
|
||||
]
|
||||
```
|
||||
|
||||
4. Now search for “latex tools” in the settings search.
|
||||
5. In the “Latex-workshop > LaTeX: Tools section, click on “Edit in settings.json.”
|
||||
6. Make sure the following entry is part of the list.
|
||||
|
||||
```json
|
||||
"latex-workshop.latex.tools": [
|
||||
{
|
||||
"name": "biber",
|
||||
"command": "biber",
|
||||
"args": [
|
||||
"%DOC%"
|
||||
],
|
||||
"env": {}
|
||||
},
|
||||
{
|
||||
"name": "lualatex",
|
||||
"command": "lualatex",
|
||||
"args": [
|
||||
"-synctex=1",
|
||||
"-interaction=nonstopmode",
|
||||
"-file-line-error",
|
||||
"%DOC%"
|
||||
],
|
||||
"env": {}
|
||||
},
|
||||
// EXISTING ENTRIES GO HERE
|
||||
]
|
||||
```
|
||||
|
||||
7. Save and close the settings file.
|
||||
8. For later convenience, set the “Latex-workshop > Latex > Recipe: Default” option to `lastUsed`.
|
||||
|
||||
## Compiling
|
||||
|
||||
1. Open the unzipped project archive (available in the [Releases section](https://git.stuve-bamberg.de/latex/latex-skript/releases)).
|
||||
2. To test your installation, open `main-exercises.tex`.
|
||||
3. In the left side bar, click on the TeX symbol, open the “Build LaTeX project entry” (clicking on the little arrow on the left) and choose the “pdflatex × 2” recipe. For the duration of the compilation, you should see a spinning icon in the bottom row next to the Git icons. Any errors will appear in the problems tab.
|
||||
4. To open the resulting document, click on “View LaTeX PDF” in the TeX section below the recipes. If this succeeded, you are ready to work on the exercises. The document will compile again once you save it.
|
||||
|
||||
## Some useful notes
|
||||
|
||||
+ LaTeX Workshop has a [process of deciding which file to compile](https://github.com/James-Yu/LaTeX-Workshop/wiki/Compile#latex-workshoplatexbuildforceRecipeUsage). Unfortunately, our project archive tends to confuse the plugin, resulting in compiler errors. You can **specify the document root** by adding a magic TeX root comment. We provided these comments for you in all exercise files:
|
||||
|
||||
```
|
||||
% !TeX root = ../../main-exercises.tex
|
||||
```
|
||||
|
||||
+ However, by default, **LaTeX Workshop ignores them** because they may pose a security threat if you cannot trust the project you are compiling. See [this issue](https://github.com/James-Yu/LaTeX-Workshop/issues/3027) for more details. To enable them anyway, go to your settings and deactivate the “Force Recipe Usage” checkbox.
|
||||
|
||||
The **LaTeX Workshop** plugin offers a couple of other handy features:
|
||||
|
||||
+ Sometimes, it is helpful to kill all compiler processes and **clean up the auxiliary files** afterwards.
|
||||
+ If you need to **find a certain section** in the PDF or in the source document, you can use the “Navigate, select and edit” menu.
|
||||
+ In the left sidebar, you will also find the entire **document structure** and **snippets** that will make your life easier.
|
||||
|
||||
373
eingabefile.tex
Normal file
373
eingabefile.tex
Normal file
@ -0,0 +1,373 @@
|
||||
%!TEX root = l2kurz.tex
|
||||
% Siehe https://github.com/texdoc/l2kurz
|
||||
|
||||
|
||||
\section{Eingabefile}
|
||||
|
||||
Das Eingabefile für \LaTeX{} ist ein Textfile mit der Endung \lstinline+.tex+.
|
||||
Es wird mit einem Editor erstellt und enthält sowohl den Text, der gedruckt
|
||||
werden soll, als auch die Befehle, aus denen \LaTeX\ erfährt, wie der Text
|
||||
gesetzt werden soll. Als Editor bietet sich ein spezieller \LaTeX-Editor an
|
||||
wie beispielsweise Texmaker (\href{http://www.xm1math.net/texmaker}{\nolinkurl
|
||||
{www.xm1math.net/texmaker}}). Diese Editoren bieten neben Syntaxhervorhebung
|
||||
und "=überprüfung auch vordefinierte Arbeitsabläufe, so dass der Benutzer sich
|
||||
auf die Erstellung des Texts konzentrieren kann. Es ist aber auch möglich und
|
||||
gängige Praxis, \emph{normale} Texteditoren wie emacs, vim oder notepad++ zu
|
||||
benutzen.
|
||||
|
||||
|
||||
\subsection{Leerstellen}
|
||||
|
||||
"`Unsichtbare"' Zeichen wie das Leerzeichen, Tabulatoren und das Zeilenende
|
||||
werden von \LaTeX{} einheitlich als Leerzeichen behandelt. \emph{Mehrere}
|
||||
Leerzeichen werden wie \emph{ein} Leerzeichen behandelt. Wenn man andere als
|
||||
die normalen Wort- und Zeilenabstände will, kann man dies also nicht durch die
|
||||
Eingabe von zusätzlichen Leerzeichen oder Leerzeilen erreichen, sondern nur mit
|
||||
entsprechenden \LaTeX-Befehlen.
|
||||
|
||||
Eine Leerzeile zwischen Textzeilen bedeutet das Ende eines Absatzes.
|
||||
\emph{Mehrere} Leerzeilen werden wie \emph{eine} Leerzeile behandelt.
|
||||
|
||||
|
||||
\subsection{\LaTeX-Befehle und Gruppen}
|
||||
|
||||
Die meisten \LaTeX-Befehle haben eines der beiden folgenden Formate: Entweder
|
||||
sie beginnen mit einem Backslash~(\lstinline|\|) und haben dann einen nur aus
|
||||
Buchstaben bestehenden Namen, der durch ein oder mehrere Leerzeichen oder
|
||||
durch ein nachfolgendes Sonderzeichen beendet wird; oder sie bestehen aus
|
||||
einem Backslash und genau einem Sonderzeichen. Groß- und Kleinbuchstaben haben
|
||||
auch in Befehlsnamen \emph{verschiedene} Bedeutung. Wenn man nach einem
|
||||
Befehlsnamen eine Leerstelle erhalten will, muss man~\lstinline|{}| zur
|
||||
Beendigung des Befehlsnamens oder einen eigenen Befehl für die Leerstelle
|
||||
verwenden.
|
||||
|
||||
% PG: würde ich drin lassen
|
||||
%\renewcommand{\today}{31.~Mai 2012} % to make sure that the
|
||||
% line breaks look good, regardless of the date of printing.
|
||||
%MD: obeylines zu besseren Darstellung eingefuegt
|
||||
%MD: Redefinition von \today lokal halten
|
||||
\begin{LTXexample}[firstline=4]
|
||||
\renewcommand*\today{%
|
||||
\the\numexpr\year-1978\relax.~Mai \the\year}
|
||||
\obeylines
|
||||
Heute ist der \today.
|
||||
Oder: Heute ist der \today .
|
||||
Falsch ist:
|
||||
Am \today regnet es.
|
||||
Richtig ist:
|
||||
Am \today{} scheint die Sonne.
|
||||
Oder: Am \today\ schneit es.
|
||||
\end{LTXexample}
|
||||
|
||||
|
||||
|
||||
Manche Befehle haben Parameter, die zwischen geschwungenen Klammern angegeben
|
||||
werden müssen. Manche Befehle haben Parameter, die weggelassen oder zwischen
|
||||
eckigen Klammern angegeben werden können. Manche Befehle haben Varianten, die
|
||||
durch das Hinzufügen eines Sterns an den Befehlsnamen unterschieden werden.
|
||||
|
||||
Geschwungene Klammern können auch dazu verwendet werden, Gruppen (\emph{groups})
|
||||
zu bilden. Die Wirkung von Befehlen, die innerhalb von Gruppen oder Umgebungen
|
||||
(\emph{environments}) angegeben werden, endet immer mit dem Ende der Gruppe
|
||||
bzw.\ der Umgebung. Im obigen Beispiel ist~\lstinline|{}| eine leere Gruppe, die
|
||||
außer der Beendigung des Befehlsnamens \texttt{today} keine Wirkung hat.
|
||||
|
||||
\subsection{Kommentare}
|
||||
|
||||
Alles, was hinter einem Prozentzeichen (\lstinline|%|) steht (bis zum Ende der
|
||||
Eingabezeile), wird von \LaTeX{} ignoriert. Dies kann für Notizen des Autors
|
||||
verwendet werden, die nicht oder noch nicht ausgedruckt werden sollen.
|
||||
\begin{LTXexample}
|
||||
Das ist ein % dummes
|
||||
% Besser: ein lehrreiches <----
|
||||
Beispiel.
|
||||
\end{LTXexample}
|
||||
|
||||
\subsection{Aufbau}
|
||||
|
||||
Der erste Befehl in einem \LaTeX-Eingabefile muss der Befehl
|
||||
\begin{lstlisting}
|
||||
\documentclass
|
||||
\end{lstlisting}
|
||||
sein. Er legt fest, welche Art von Schriftstück überhaupt erzeugt werden soll
|
||||
(Bericht, Buch, Brief usw.). Danach können weitere Befehle folgen bzw.
|
||||
deklariert werden, die für das gesamte Dokument gelten sollen. Dieser Teil des
|
||||
Dokuments wird auch als \emph{Vorspann} oder \emph{Präambel} bezeichnet. Mit dem
|
||||
Befehl
|
||||
\begin{lstlisting}
|
||||
\begin{document}
|
||||
\end{lstlisting}
|
||||
endet der Vorspann, und es beginnt das Setzen des Schriftstücks. Nun folgen der
|
||||
Text und alle \LaTeX-Befehle, die das Ausdrucken des Schriftstücks bewirken.
|
||||
Die Eingabe muss mit dem Befehl
|
||||
\begin{lstlisting}
|
||||
\end{document}
|
||||
\end{lstlisting}
|
||||
beendet werden. Falls nach diesem Befehl noch Eingaben folgen, werden sie von
|
||||
\LaTeX{} ignoriert.
|
||||
|
||||
Listing~\ref{mini} zeigt ein \emph{minimales} \LaTeX-File. Ein etwas
|
||||
komplizierteres File ist in Listing~\ref{dokument} skizziert.
|
||||
|
||||
\begin{example}[caption={Ein minimales \LaTeX-File},label={mini}]
|
||||
\documentclass{article}
|
||||
\begin{document}
|
||||
Small is beautiful.
|
||||
\end{document}
|
||||
\end{example}
|
||||
|
||||
\begin{example}[caption={Aufbau eines Artikels},label={dokument}]
|
||||
\documentclass[11pt,a4paper,ngerman]{article}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage{babel}
|
||||
\date{29. Februar 1998}
|
||||
\author{H.~Partl}
|
||||
\title{Über kurz oder lang}
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
\tableofcontents
|
||||
|
||||
\section{Start}
|
||||
Hier beginnt mein schönes Werk ...
|
||||
|
||||
\section{Ende}
|
||||
... und hier endet es.
|
||||
|
||||
\end{document}
|
||||
\end{example}
|
||||
|
||||
|
||||
\subsection{Dokumentklassen}\label{docsty}
|
||||
|
||||
Die am Beginn des Eingabefiles mit
|
||||
\begin{lstlisting}
|
||||
\documentclass[<optionen>]{<klasse>}
|
||||
\end{lstlisting}
|
||||
definierte "`Klasse"' eines Dokumentes enthält Vereinbarungen über das Layout
|
||||
und die logischen Strukturen, z.\,B.\ die Gliederungseinheiten (Kapitel etc.\@),
|
||||
die für alle Dokumente dieses Typs gemeinsam sind.
|
||||
|
||||
Zwischen den geschwungenen Klammern \emph{muss} genau eine Dokumentklasse
|
||||
angegeben werden. Tabelle~\vref{docstyles} führt
|
||||
Klassen auf, die in jeder vollständigen \LaTeX-Installation existieren.
|
||||
|
||||
Zwischen den eckigen Klammern \emph{können}, durch Kommas getrennt, eine oder
|
||||
mehrere Optionen für das Klassenlayout angegeben werden. Die wichtigsten
|
||||
Optionen für die Standardklassen sind in der Tabelle~\vref{options} angeführt.
|
||||
Das Eingabefile für diese Beschreibung beginnt z.\,B.\ mit:
|
||||
\begin{lstlisting}
|
||||
\documentclass[11pt,a4paper]{article}
|
||||
\end{lstlisting}
|
||||
|
||||
|
||||
\begin{longtable}[c]{@{}>{\raggedright\arraybackslash\ttfamily}p{2.2cm}%
|
||||
p{\dimexpr 0.95\linewidth-2.2cm-2\tabcolsep\relax}@{}}
|
||||
\caption{Dokumentklassen}\label{docstyles} \\\toprule
|
||||
\endfirsthead
|
||||
\caption[]{Dokumentklassen}\\\toprule
|
||||
\endhead
|
||||
\multicolumn{2}{r}{\small Forsetzung nächste Seite}\\
|
||||
\endfoot
|
||||
\endlastfoot
|
||||
article &
|
||||
für Artikel in wissenschaftlichen Zeitschriften, kürzere Berichte u.\,v.\,a.
|
||||
\\
|
||||
report &
|
||||
für längere Berichte, die aus mehreren Kapiteln bestehen, Diplomarbeiten,
|
||||
Dissertationen u.\,ä.
|
||||
\\
|
||||
book &
|
||||
für Bücher
|
||||
\\
|
||||
scrartcl, scrreprt, scrbook &
|
||||
Die sog. KOMA-Klassen sind Varianten der o.\,g. Klassen mit besserer Anpassung
|
||||
an DIN-Papierformate und "`europäische"' Typographie. Zudem erlauben sie
|
||||
mittels Optionen die Anpassung des Layouts. Entgegen den Standardklassen
|
||||
existiert eine deutsche und englische Dokumenation (siehe \cite{scrguide})
|
||||
\\
|
||||
beamer &
|
||||
für Präsentationen
|
||||
\\
|
||||
\bottomrule
|
||||
\end{longtable}
|
||||
|
||||
|
||||
|
||||
\begin{longtable}[c]{@{}>{\raggedright\arraybackslash\ttfamily}p{2.2cm}%
|
||||
p{\dimexpr 0.95\linewidth-2.2cm-2\tabcolsep\relax}@{}}
|
||||
\caption[Klassenoptionen]{Klassenoptionen für die Standardklassen}\label{options} \\\toprule
|
||||
\endfirsthead
|
||||
\caption[]{Klassenoptionen für die Standardklassen}\\\toprule
|
||||
\endhead
|
||||
\multicolumn{2}{r}{\small Forsetzung nächste Seite}\\
|
||||
\endfoot
|
||||
\endlastfoot
|
||||
10pt 11pt 12pt &
|
||||
wählt die normale Schriftgröße des Dokuments aus. 10\,pt hohe Schrift ist die
|
||||
Voreinstellung; diese Beschreibung benutzt 11\,pt.
|
||||
\\
|
||||
a4paper &
|
||||
für Papier im DIN\,A4-Format. Ohne diese Option nehmen die Standardklassen das
|
||||
amerikanisches Papierformat.
|
||||
\\
|
||||
fleqn &
|
||||
für linksbündige statt zentrierte mathematische Gleichungen
|
||||
\\
|
||||
leqno &
|
||||
für Gleichungsnummern links statt rechts von jeder nummerierten Gleichung
|
||||
\\
|
||||
titlepage notitlepage &
|
||||
legt fest, ob Titel und Zusammenfassung auf einer eigenen Seite erscheinen
|
||||
sollen. \texttt{titlepage} ist die Voreinstellung für die Klassen
|
||||
\texttt{report} und \texttt{book}.
|
||||
\\
|
||||
onecolumn twocolumn &
|
||||
für ein- oder zweispaltigen Satz. Die Voreinstellung ist immer
|
||||
\texttt{onecolumn}.
|
||||
\\
|
||||
oneside twoside &
|
||||
legt fest, ob die Seiten für ein- oder zweiseitigen Druck gestaltet werden
|
||||
sollen. \texttt{oneside} ist die Voreinstellung für alle Klassen außer
|
||||
\texttt{book}.
|
||||
\\\bottomrule
|
||||
\end{longtable}
|
||||
|
||||
|
||||
|
||||
|
||||
\subsection{Pakete}\label{packages}
|
||||
|
||||
Mit dem Befehl
|
||||
\begin{lstlisting}
|
||||
\usepackage[<optionen>]{<paket>}
|
||||
\end{lstlisting}
|
||||
können im Vorspann ergänzende Makropakete (\emph{packages}) geladen werden, die das
|
||||
Layout der Dokumentklasse modifizieren oder zusätzliche Funktionalität
|
||||
bereitstellen. Eine Auswahl von Paketen findet sich in der Tabelle~\vref{pack}. Der Befehl \lstinline+\usepackage+ erlaubt das Laden
|
||||
mehrerer Pakete, wobei eine Optionenübergabe nicht möglich ist, bzw. die Optionen für alle Pakete gelten.
|
||||
|
||||
|
||||
|
||||
\begin{longtable}[c]{@{}>{\raggedright\arraybackslash\ttfamily}p{2.2cm}%
|
||||
p{\dimexpr 0.95\linewidth-2.2cm-2\tabcolsep\relax}@{}}
|
||||
\caption{Pakete (eine Auswahl)}\label{pack} \\\toprule
|
||||
\endfirsthead
|
||||
\caption[]{Pakete (eine Auswahl)}\\\toprule
|
||||
\endhead
|
||||
\multicolumn{2}{r}{\small Fortsetzung nächste Seite}\\
|
||||
\endfoot
|
||||
\endlastfoot
|
||||
amsmath, amssymb &
|
||||
Mathematischer Formelsatz mit erweiterten Fähigkeiten, zusätzliche
|
||||
mathematische Schriften und Symbole; Beschreibung siehe \cite{mathmode}.
|
||||
\\
|
||||
array &
|
||||
Verbesserte und erweiterte Versionen der Umgebungen \texttt{array},
|
||||
\texttt{tabular} und \texttt{tabular*}.
|
||||
\\
|
||||
babel &
|
||||
Anpassungen für viele verschiedene Sprachen. Die gewählten Sprachen werden
|
||||
als Optionen angegeben.
|
||||
\\
|
||||
csquotes & Mächtiges Paket zum korrekten Setzen (fremdsprachlicher) Anführungszeichen \\
|
||||
fontenc &
|
||||
Erlaubt die Verwendung von Schriften mit unterschiedlicher Kodierung
|
||||
(Zeichenvorrat, Anordnung).
|
||||
\\
|
||||
geometry &
|
||||
Manipulation des Seitenlayouts.\\
|
||||
graphicx &
|
||||
Einbindung von extern erzeugten Graphiken. Die umfangreichen Möglichkeiten
|
||||
dieses Pakets werden in~\cite{grfguide} und~\cite{grfcomp} beschrieben.
|
||||
\\
|
||||
hyperref &
|
||||
Ermöglicht Hyperlinks zwischen Textstellen und zu externen Dokumenten;
|
||||
besonders sinnvoll einsetzbar, wenn mit \TeX\ eine Ausgabedatei im
|
||||
\textsc{pdf}- oder \textsc{html}-Format erzeugt wird.
|
||||
\\
|
||||
imakeidx &
|
||||
Unterstützt das Erstellen eines Index.
|
||||
\\
|
||||
listings & Flexible Erweiterung der \texttt{verbatim}-Umgebung.
|
||||
\\
|
||||
longtable &
|
||||
für Tabellen über mehrere Seiten mit automatischem Seitenumbruch.
|
||||
\\
|
||||
microtype & Verändert den Absatzumbruch leicht, um bessere Zeilenumbrüche zu erzeugen; optischer Randausgleich. \\
|
||||
multicol &
|
||||
Mehrspaltiger Satz mit Kolumnenausgleich.
|
||||
\\
|
||||
selinput &
|
||||
Deklaration der Zeichenkodierung im Eingabefile.
|
||||
\\
|
||||
siunitx & Formatierung von Zahlen und physikalischen Einheiten \\
|
||||
tabularx &
|
||||
für Tabellen mit automatisch an den vorhandenen Platz angepasster Breite der
|
||||
Spalten.
|
||||
\\
|
||||
textcomp &
|
||||
Bindet Schriften mit zusätzlichen Textsymbolen ein.
|
||||
\\
|
||||
xcolor &
|
||||
Unterstützung für Farbausgabe; Beschreibung siehe~\cite{grfguide}
|
||||
und~\cite{grfcomp}.
|
||||
\\
|
||||
\bottomrule
|
||||
\end{longtable}
|
||||
|
||||
|
||||
\subsection{Eingabezeichensatz}\label{inputenc}
|
||||
|
||||
Bei jedem \LaTeX-System dürfen mindestens die folgenden Zeichen zur Eingabe von
|
||||
Text verwendet werden:
|
||||
\begin{quote}
|
||||
\ttfamily
|
||||
a\dots z A\dots Z 0\dots 9 \\
|
||||
. : ; , ? ! ` ' ( ) [ ] - / * @ + =
|
||||
\end{quote}
|
||||
Die folgenden Eingabezeichen haben für \LaTeX{} eine Spezialbedeutung oder sind
|
||||
nur innerhalb von mathematischen Formeln erlaubt:
|
||||
\begin{quote}
|
||||
\verb.$ & % # _ { } ~ ^ " \ | < >.
|
||||
\end{quote}
|
||||
Für Zeichen, die über obige Liste hinausgehen, beispielsweise die Umlaute, sind
|
||||
unterschiedliche Kodierungen in
|
||||
Gebrauch. Die Kodierung ist hierbei vom Betriebssystem sowie vom Editor
|
||||
abhängig. Um Umlaute direkt zu nutzen ohne auf spezielle Kodierung einzugehen,
|
||||
bietet sich das Paket \texttt{selinput} an. Es ermittelt während des
|
||||
Kompilierungsvorgangs die verwendete Kodierung. Um dies sicher zu stellen, muss
|
||||
das Paket wie folgt in der Präambel eingebunden werden:
|
||||
\begin{example}[caption={Bestimmung der Kodierung für die Nutzung von Umlauten},]
|
||||
\usepackage{selinput}
|
||||
\SelectInputMappings{
|
||||
adieresis={ä},
|
||||
germandbls={ß},
|
||||
}
|
||||
% Wörter mit Umlauten werden getrennt:
|
||||
\usepackage[T1]{fontenc}
|
||||
\end{example}
|
||||
|
||||
Neben dem Paket \texttt{selinput} existiert auch das Paket \texttt{inputenc}.
|
||||
Hier gibt man die zu verwendende Kodierung als Paketoption vor, diese muss man
|
||||
jedoch dafür in Erfahrung bringen, was nicht immer einfach ist. Im Falle von
|
||||
UTF-8 als Eingabekodierung ist das:
|
||||
|
||||
\begin{beispiel}
|
||||
\lstinline+\usepackage[utf8]{inputenc}+
|
||||
\end{beispiel}
|
||||
|
||||
Falls \LaTeX{} ein eingegebenes Zeichen nicht darstellen kann, was meist für die
|
||||
sogenannten "`Pseudografik-Zeichen"' gilt, bekommt man eine entsprechende
|
||||
Fehlermeldung. Auch sind manche Zeichen nur im Text, andere nur in
|
||||
mathematischen Formeln erlaubt.
|
||||
|
||||
Man beachte, dass der in der \emph{Ausgabe} darstellbare Zeichenvorrat von
|
||||
\LaTeX{} nicht davon abhängt, welche Zeichen als \emph{Eingabe} erlaubt sind:
|
||||
Für jedes überhaupt darstellbare Zeichen -- also auch diejenigen, die nicht im
|
||||
Zeichensatz des jeweiligen Betriebssystems enthalten sind -- gibt es einen
|
||||
\LaTeX-Befehl oder eine Ersatzdarstellung, die ausschließlich mit ASCII-Zeichen
|
||||
auskommt. Näheres darüber erfahren Sie in Abschnitt \ref{spezial}.
|
||||
|
||||
\endinput
|
||||
92
einleitung.tex
Normal file
92
einleitung.tex
Normal file
@ -0,0 +1,92 @@
|
||||
% Siehe https://github.com/texdoc/l2kurz
|
||||
|
||||
\begin{titlepage}
|
||||
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
|
||||
{\Huge%
|
||||
\fontfamily{lmss}\fontseries{sbc}\selectfont
|
||||
\raggedright
|
||||
\sbLaTeXe-Kurzbeschreibung
|
||||
\rule{\textwidth}{0.75pt}
|
||||
\par
|
||||
}
|
||||
\begin{flushleft}
|
||||
\normalsize
|
||||
\fontfamily{lmss}\fontseries{sbc}\selectfont
|
||||
Version \lkver\\
|
||||
\lkdate\\[2ex]
|
||||
Marco Daniel\\
|
||||
Patrick Gundlach\\
|
||||
Walter Schmidt\\
|
||||
Jörg Knappen\\
|
||||
Hubert Partl%\footnote{Zentraler Informatikdienst der Universität für Bodenkultur, Wien}
|
||||
\\
|
||||
Irene Hyna%\footnote{Bundesministerium für Wissenschaft und Verkehr, Wien}
|
||||
\\
|
||||
\end{flushleft}
|
||||
|
||||
\vfill
|
||||
|
||||
{\parindent=0cm
|
||||
\LaTeX{} ist ein Satzsystem, das für viele Arten von
|
||||
Schriftstücken verwendet werden kann, von einfachen Briefen bis zu
|
||||
kompletten Büchern. Besonders geeignet ist es für
|
||||
wissenschaftliche oder technische Dokumente. \LaTeX{} ist für
|
||||
praktisch alle verbreiteten Betriebssysteme verfügbar.
|
||||
\bigskip
|
||||
|
||||
Die vorliegende Kurzbeschreibung bezieht sich auf die Version
|
||||
\LaTeXe\ in der Fassung vom Juni~2001 und sollte für den
|
||||
Einstieg in \LaTeX{} ausreichen.
|
||||
Eine vollständige Beschreibung enthält das \manual{}
|
||||
in Verbindung mit der Online-Dokumentation.
|
||||
}
|
||||
\setcounter{footnote}{0}
|
||||
\end{titlepage}
|
||||
|
||||
|
||||
{\parindent=0cm\thispagestyle{empty}
|
||||
|
||||
Autoren: 1998--2016 M.~Daniel, P.~Gundlach, W.~Schmidt, J.~Knappen, H.~Partl, I.~Hyna
|
||||
|
||||
\bigskip
|
||||
|
||||
% Lizenzänderung in Absprache mit Walter Schmidt <-> Patrick Gundlach 19. Juni 2012
|
||||
{\selectlanguage{USenglish}
|
||||
This material may be distributed only subject to the terms and
|
||||
conditions set forth in the \emph{Open Publication License}, v1.0 or
|
||||
later (the latest version is presently available at
|
||||
\url{http://www.opencontent.org/openpub/}).}
|
||||
|
||||
|
||||
\bigskip
|
||||
|
||||
Die in dieser Publikation erwähnten Software- und Hardware"=Bezeichnungen sind
|
||||
in den meisten Fällen auch eingetragene Warenzeichen und unterliegen als
|
||||
solche den gesetzlichen Bestimmungen.
|
||||
|
||||
\bigskip
|
||||
|
||||
Dieses Dokument wurde von Mitgliedern der Fachschaft \textsc{wiai} der Universität Bamberg verändert, um als Arbeitsgrundlage für einen \LaTeX{}-Workshop zu dienen. Daher wurden auch bewusst Fehler gegenüber dem Original eingefügt, die in den Aufgaben behoben werden sollen. Dieses Dokument ist nicht dafür bestimmt, ohne die entsprechenden Aufgabenstellungen weitergegeben zu werden. Das Originaldokument ist unten verlinkt.
|
||||
|
||||
\vfill
|
||||
|
||||
Dieses Dokument wurde mit \LaTeX{} gesetzt.
|
||||
Es ist als Quelltext und im PDF-Format online erhältlich:
|
||||
\begin{quote}
|
||||
\url{http://mirror.ctan.org/info/lshort/german/}
|
||||
\end{quote}
|
||||
Die Änderungen seit Version 2.3 (10.\,April 2003) sind unter \url{https://github.com/texdoc/l2kurz} einzusehen.
|
||||
\bigskip
|
||||
|
||||
Die Autoren bedanken sich bei
|
||||
Luzia Dietsche,
|
||||
Michael Hofmann,
|
||||
Peter Karp,
|
||||
Rolf \mbox{Niepraschk},
|
||||
Heiko Oberdiek,
|
||||
Bernd Raichle,
|
||||
Rainer Schöpf und
|
||||
Stefan Steffens
|
||||
für Tipps, Anmerkungen und Korrekturen.
|
||||
|
||||
}
|
||||
@ -1,69 +0,0 @@
|
||||
% twocolumn parameter adds second column
|
||||
\documentclass[twocolumn]{article}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage[english,italian]{babel}
|
||||
\usepackage[hidelinks]{hyperref}
|
||||
|
||||
% for headers and footers
|
||||
\usepackage{fancyhdr}
|
||||
|
||||
% configure title components
|
||||
\title{Recipes}
|
||||
\date{\today}
|
||||
\author{It's you!}
|
||||
|
||||
\begin{document}
|
||||
|
||||
% set headers and footers
|
||||
\pagestyle{fancy} % activate headers and footers in general
|
||||
\thispagestyle{fancy} % apply to the first page as well
|
||||
|
||||
% clear and configure headers
|
||||
\fancyhead{}
|
||||
\fancyhead[R]{Recipes}
|
||||
|
||||
% clear and configure footers
|
||||
\fancyfoot{}
|
||||
\fancyfoot[R]{\thepage}
|
||||
|
||||
% switch language (needs optional parameter where the babel package is added), display title, then switch back
|
||||
\selectlanguage{italian}
|
||||
\maketitle
|
||||
\selectlanguage{english}
|
||||
|
||||
\tableofcontents
|
||||
|
||||
\section{Beverages}
|
||||
|
||||
\subsection{Pink Lemonade}
|
||||
We all know and love it in summer: a cold lemonade. The pink variant of our favorite summer drink is traditionally achieved by adding food coloring to the lemonade.
|
||||
However, we changed things up a little and decided to go for a variant with berries instead of food coloring, which also makes the drink less sour.
|
||||
|
||||
\subsubsection{Ingredients}
|
||||
For making the lemonade we need 400\,g of berries. You can use either frozen or fresh ones. You can, of course, adjust the choice of berries to your likings: raspberries, blueberries, blackberries, or a mixture work excellently for making the lemonade.
|
||||
|
||||
To make the drink sweeter we use 50\,ml of maple syrup. Needless to say, you can also use less, if you want your lemonade to be more sour. By the way, other sweeteners, such as agave syrup, or coconut sugar also work fine.
|
||||
|
||||
Additionally, we need the juice of four freshly-squeezed lemons, one litre worth of cold water and 400\,g of ice cubes to keep the drink cold.
|
||||
|
||||
\subsubsection{Instructions}
|
||||
Put the berries along with the maple syrup into a large bowl and cook them at medium-high heat for around three to four minutes. When the berries start to soften, reduce the heat a little. Now mash the berries with the end of a wooden spoon until there are almost no big chunks anymore. The less chunks the better!
|
||||
|
||||
Place a sieve over the container that you want to store the lemonade in. Put the berries into the sieve. With the end of the wooden spoon, try to press out as much liquid of the berry mixture as possible. Let the juice sit until it is completely cold.
|
||||
|
||||
When the liquid is cold, add the lemon juice, the cold water, and the ice cubes and stir everything.
|
||||
|
||||
Your lemonade is now ready to enjoy!
|
||||
|
||||
% short title for the table of contents via optional parameter
|
||||
\subsection[Chocoho!]{Hot Chocolate}
|
||||
Coming soon!
|
||||
|
||||
% asterisk (*) hides the section title in the table of contents
|
||||
\section*{Breakfast}
|
||||
|
||||
\subsubsection{Buckwheat Overnight Oats}
|
||||
Coming soon!
|
||||
|
||||
\end{document}
|
||||
@ -1 +0,0 @@
|
||||
\codeblock{latex}{./exercises/basic-document-structure/document-structure.code.done.tex}
|
||||
@ -1,25 +0,0 @@
|
||||
|
||||
1. Beverages
|
||||
|
||||
1.1 Pink Lemonade
|
||||
We all know and love it in summer: a cold lemonade. The pink variant of our favorite summer drink is traditionally achieved by adding food coloring to the lemonade. However, we changed things up a little and decided to go for a variant with berries instead of food coloring, which also makes the drink less sour.
|
||||
|
||||
1.1.1 Ingredients
|
||||
For making the lemonade we need 400\,g of berries. You can use either frozen or fresh ones. You can, of course, adjust the choice of berries to your likings: raspberries, blueberries, blackberries, or a mixture work excellently for making the lemonade. \\
|
||||
To make the drink sweeter we use 50\,ml of maple syrup. Needless to say, you can also use less, if you want your lemonade to be more sour. By the way, other sweeteners, such as agave syrup, or coconut sugar also work fine. \\
|
||||
Additionally, we need the juice of four freshly-squeezed lemons, one litre worth of cold water and 400\,g of ice cubes to keep the drink cold.
|
||||
|
||||
1.1.2 Instructions
|
||||
Put the berries along with the maple syrup into a large bowl and cook them at medium-high heat for around three to four minutes. When the berries start to soften, reduce the heat a little. Now mash the berries with the end of a wooden spoon until there are almost no big chunks anymore. The less chunks the better! \\
|
||||
Place a sieve over the container that you want to store the lemonade in. Put the berries into the sieve. With the end of the wooden spoon, try to press out as much liquid of the berry mixture as possible. Let the juice sit until it is completely cold. \\
|
||||
When the liquid is cold, add the lemon juice, the cold water, and the ice cubes and stir everything. \\
|
||||
Your lemonade is now ready to enjoy!
|
||||
|
||||
1.2 Hot Chocolate
|
||||
Coming soon!
|
||||
|
||||
2. Breakfast
|
||||
|
||||
2.1 Buckwheat Porridge
|
||||
Coming soon!
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage[english]{babel}
|
||||
@ -1,28 +0,0 @@
|
||||
\section{Structure your document and text}
|
||||
|
||||
\begin{enumerate}
|
||||
\item In the directory \file{exercises/basic-document-structure}, you can find a file named \file{document-structure.tex}. Wrap the text of the file in a \code{latex}{document} environment and add the following preamble.
|
||||
\codeblock{latex}{./exercises/basic-document-structure/preamble.code.tex}
|
||||
\item In TeXstudio, right click on the file and select \enquote{Set as explicit root document.} Next, compile the file.
|
||||
\item Congratulations! You have created and compiled your first \LaTeX{}
|
||||
document. Maybe you have noticed that paragraphs within the text were
|
||||
created by using \code{latex}{\textbackslash\textbackslash}. Replace the
|
||||
two backslashes by real paragraphs.
|
||||
\item It is time to structure your first document. Use the \LaTeX{}
|
||||
commands \code{latex}{\textbackslash section},
|
||||
\code{latex}{\textbackslash subsection}, etc. to structure the text.
|
||||
Also, include a table of contents for your document.
|
||||
\end{enumerate}
|
||||
|
||||
\subsection*{Extra tasks: Make it fit your needs}
|
||||
|
||||
\begin{itemize}
|
||||
\item Add a \textbf{title} to the document.
|
||||
\item Make today's date appear in a \textbf{language of your choice}.
|
||||
\item \textbf{Hide} one section title in the table of contents.
|
||||
\item Add a \textbf{short title} to a different section title.
|
||||
\item Split the text in \textbf{two columns} (keyword: \texttt{twocolumn}).
|
||||
\item Add a \textbf{header} with the title on the right and a \textbf{footer} with the page number on the left.
|
||||
\item Try out what changes when you change the \textbf{document class}.
|
||||
\item Research the possibilities of traditional\footnote{\url{https://hartwork.org/beamer-theme-matrix/}} and modern\footnote{\url{https://gitlab.cs.fau.de/i4/tex/i4neo}} \textbf{beamer presentation templates}.
|
||||
\end{itemize}
|
||||
@ -1,4 +0,0 @@
|
||||
Java is an object-oriented programming language that appeared in 1995.
|
||||
It still counts as one of the most dominant programming languages.\footnote{As of 2025, see \url{https://github.blog/news-insights/octoverse/octoverse-a-new-developer-joins-github-every-second-as-ai-leads-typescript-to-1/} (last accessed: 17/11/2025)}
|
||||
In order to write Java programs, one needs to install the so-called \emph{Java Development Kit (JDK)}.
|
||||
Java programs can be written independently from the operating system that one uses.
|
||||
@ -1 +0,0 @@
|
||||
\codeblock{latex}{./exercises/footnotes/footnotes.code.done.tex}
|
||||
@ -1,6 +0,0 @@
|
||||
% !TeX root = ../../main-exercises.tex
|
||||
|
||||
Java is an object-oriented programming language that appeared in 1995.
|
||||
It still counts as one of the most dominant programming languages (as of 2025).
|
||||
In order to write Java programs, one needs to install the so-called \emph{Java Development Kit (JDK)}.
|
||||
Java programs can be written independently from the operating system that one uses.
|
||||
@ -1,6 +0,0 @@
|
||||
\section{Footnotes and references}
|
||||
|
||||
\subsection{Inserting footnotes}
|
||||
|
||||
Make the text \enquote{as of 2025} of the file \file{exercises/footnotes/footnotes.tex} appear as a footnote instead of in parentheses.
|
||||
Additionally, reference the corresponding blog post in the footnote: \\ \texttt{https://github.blog/news-insights/octoverse/octoverse-a-new-developer-joins-github-every-second-as-ai-leads-typescript-to-1/}
|
||||
@ -1,5 +0,0 @@
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=\textwidth]{exercises/graphics/latex-logo.png}
|
||||
\caption{The \LaTeX{} Project Logo}
|
||||
\end{figure}
|
||||
@ -1 +0,0 @@
|
||||
\codeblock{latex}{./exercises/graphics/graphics.code.done.tex}
|
||||
@ -1,3 +0,0 @@
|
||||
% !TeX root = ../../main-exercises.tex
|
||||
|
||||
Please insert the image here.
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 51 KiB |
@ -1,8 +0,0 @@
|
||||
\section{Inserting graphics}
|
||||
|
||||
In the \file{exercises/graphics} directory you can find an image file
|
||||
\file{latex-logo.png}. Insert the image into the
|
||||
\file{exercises/graphics/graphics.tex} file. Make sure that the image is placed
|
||||
exactly where you have specified it. On top of that, the picture shall be
|
||||
centered, and a caption shall be added. Adapt the image width to the text width
|
||||
(\code{latex}{\textbackslash textwidth}). On top of that, add a caption to the image.
|
||||
@ -1,47 +0,0 @@
|
||||
Ingredients:
|
||||
400 g berries, 50 ml maple syrup, 4 lemons, 1 l cold water, 400 g ice cubes
|
||||
|
||||
\noindent Instructions: Boil and shred the berries, add maple syrup, squeeze the lemons and add their juice, add the remaining ingredients, scramble thoroughly
|
||||
|
||||
\begin{itemize}
|
||||
\item Ingredients:
|
||||
\begin{itemize}
|
||||
\item 400 g berries
|
||||
\item 50 ml maple syrup
|
||||
\item 4 lemons
|
||||
\item 1 l cold water
|
||||
\item 400 g ice cubes
|
||||
\end{itemize}
|
||||
|
||||
\item Instructions:
|
||||
\begin{enumerate}
|
||||
\item boil and shred the berries
|
||||
\item add maple syrup
|
||||
\item squeeze the lemons and add their juice
|
||||
\item add the remaining ingredients
|
||||
\item scramble thoroughly
|
||||
\end{enumerate}
|
||||
\end{itemize}
|
||||
|
||||
% With all extra tasks:
|
||||
|
||||
\begin{itemize}
|
||||
\item Ingredients:
|
||||
\begin{compactitem}
|
||||
\item 400 g berries
|
||||
\item 50 ml maple syrup
|
||||
\item 4 lemons
|
||||
\item 1 l cold water
|
||||
\item 400 g ice cubes
|
||||
\end{compactitem}
|
||||
|
||||
\item Instructions:
|
||||
\begin{enumerate}[label=\roman*]
|
||||
\setcounter{enumi}{6}
|
||||
\item boil and shred the berries
|
||||
\item add maple syrup
|
||||
\item squeeze the lemons and add their juice
|
||||
\item add the remaining ingredients
|
||||
\item scramble thoroughly
|
||||
\end{enumerate}
|
||||
\end{itemize}
|
||||
@ -1 +0,0 @@
|
||||
\codeblock{latex}{./exercises/lists/lists.code.done.tex}
|
||||
@ -1,6 +0,0 @@
|
||||
% !TeX root = ../../main-exercises.tex
|
||||
|
||||
Ingredients:
|
||||
400~g berries, 50~ml maple syrup, 4~lemons, 1~l cold water, 400~g ice cubes
|
||||
|
||||
\noindent Instructions: Boil and shred the berries, add maple syrup, squeeze the lemons and add their juice, add the remaining ingredients, scramble thoroughly
|
||||
@ -1,15 +0,0 @@
|
||||
\section{Adding enumerations}
|
||||
|
||||
Format the recipe you can find in \file{exercises/lists/lists.tex} as an
|
||||
unordered list (\code{latex}{itemize}) with sub-lists \emph{Ingredients}
|
||||
and \emph{Instructions}.
|
||||
Within these, there shall be an unordered list of ingredients and an ordered list of
|
||||
instructions, respectively.
|
||||
|
||||
\subsection*{Extra tasks: Special enumerations}
|
||||
|
||||
\begin{itemize}
|
||||
\item Try using \textbf{Roman numerals} in the ordered list.
|
||||
\item Make the ordered list \textbf{start at 7} (keyword: \texttt{\textbackslash setcounter}).
|
||||
\item Reduce the \textbf{white space} between the items in the unordered list.
|
||||
\end{itemize}
|
||||
@ -1,12 +0,0 @@
|
||||
% Preamble adjustments
|
||||
|
||||
% Literature
|
||||
\usepackage[style=numeric, citestyle=alphabetic, backend=biber]{biblatex}
|
||||
\addbibresource{exercises/literature/literature.bib}
|
||||
|
||||
% Actual content
|
||||
|
||||
An introductory \LaTeX{} course can be found in \enquote{\LaTeX{} in 24 Hours} \parencite{datta2017}.
|
||||
There is a plethora of further handbooks \cite*[e.\,g.,][]{goossensmittelbach2010}.
|
||||
|
||||
\printbibliography
|
||||
@ -1,26 +0,0 @@
|
||||
@book{datta2017,
|
||||
author = {Dilip Datta},
|
||||
title = {LaTeX in 24 Hours - {A} Practical Guide for
|
||||
Scientific Writing},
|
||||
publisher = {Springer},
|
||||
year = {2017},
|
||||
doi = {10.1007/978-3-319-47831-9},
|
||||
isbn = {978-3-319-47830-2},
|
||||
timestamp = {Wed, 28 Jun 2017 15:07:35 +0200},
|
||||
biburl = {https://dblp.org/rec/books/sp/Datta17.bib},
|
||||
bibsource = {dblp computer science bibliography,
|
||||
https://dblp.org}
|
||||
}
|
||||
@book{goossensmittelbach2010,
|
||||
author = {Michel Goossens and
|
||||
Frank Mittelbach and
|
||||
Alexander Samarin},
|
||||
title = {Der LaTeX Begleiter},
|
||||
publisher = {Addison-Wesley},
|
||||
year = {2010},
|
||||
isbn = {978-3-8273-7044-0},
|
||||
timestamp = {Fri, 15 Apr 2011 13:37:33 +0200},
|
||||
biburl = {https://dblp.org/rec/books/daglib/0011922.bib},
|
||||
bibsource = {dblp computer science bibliography,
|
||||
https://dblp.org}
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
\codeblock{bibtex}{./exercises/literature/literature.done.bib}
|
||||
|
||||
\codeblock{latex}{./exercises/literature/literature.code.done.tex}
|
||||
@ -1,12 +0,0 @@
|
||||
% !TeX root = ../../main-exercises.tex
|
||||
|
||||
An introductory \LaTeX{} course can be found in \enquote{\LaTeX{} in 24 Hours} (Datta, 2017).
|
||||
There is a plethora of further handbooks (e.\,g., Goossens, Mittelbach and Samarin, 2002).
|
||||
|
||||
~\\
|
||||
|
||||
\noindent Literatur
|
||||
|
||||
\noindent [Datta 2017] Datta, Dilip: LaTeX in 24 Hours - A Practical Guide for Scientific Writing. Springer, 2017. \url{http://dx.doi.org/10.1007/978-3-319-47831-9}. – ISBN 978–3–319–47830–2
|
||||
|
||||
\noindent [Goossens u. a. 2010] Goossens, Michel ; Mittelbach, Frank ; Samarin, Alexander: Der LaTeX Begleiter. Addison-Wesley, 2010. – ISBN 978–3–8273–7044–0
|
||||
@ -1,19 +0,0 @@
|
||||
\section{Creating and inserting references}
|
||||
|
||||
\begin{enumerate}
|
||||
\item Create a new Bib\TeX{} file called \file{literature.bib} in the \file{exercises/literature} folder.
|
||||
\item Use Google Scholar or \url{dblp.org} to retrieve Bib\TeX{} entries for the following \LaTeX{}
|
||||
handbooks:
|
||||
\begin{itemize}
|
||||
\item Dilip Datta (2017): \LaTeX\ in 24 Hours. A Practical Guide for Scientific Writing.
|
||||
\item Frank Mittelbach / Michel Goossens (2010): Der \LaTeX-Begleiter.
|
||||
\end{itemize}
|
||||
\item Add the Bib\TeX{} entries to the newly created Bib\TeX{} file.
|
||||
\item Assign unique and meaningful Bib\TeX{} keys.
|
||||
\item Add the bibliography file to the project's preamble.
|
||||
\item Make use of the \mono{alpha} bibliography style.
|
||||
\item Cite the two handbooks in the file\\\file{exercises/literature/literature.tex}.
|
||||
\item Ensure that the bibliography is listed.
|
||||
\end{enumerate}
|
||||
|
||||
\noindent \textbf{Note}: If compiling fails, it may help to remove all auxiliary files \\(\mono{main.aux/bbl/blg/loc/out/pdf/soc/toc}) before compiling again.
|
||||
@ -1,22 +0,0 @@
|
||||
% Gravitational acceleration in Germany
|
||||
$$9,81\,\frac{m}{s^2}$$
|
||||
|
||||
% pq formula
|
||||
$$x_{1,2} = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}$$
|
||||
|
||||
% Quadratic formula
|
||||
$$x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$
|
||||
|
||||
% Catalan numbers
|
||||
\begin{equation*}
|
||||
C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!}
|
||||
\end{equation*}
|
||||
|
||||
% Definition of a factorial
|
||||
$$n! = \prod_{i=1}^{n} i$$
|
||||
|
||||
% Set of all odd natural numbers
|
||||
$$\{ x \mid x \in \mathds{N}, \text{odd}(x) \}$$
|
||||
|
||||
% Elimination $\neg\exists x$
|
||||
$$\neg\exists x . p(x) \Leftrightarrow \forall x . \neg p(x)$$
|
||||
@ -1 +0,0 @@
|
||||
\codeblock{latex}{./exercises/maths/math-formulas.code.done.tex}
|
||||
@ -1,6 +0,0 @@
|
||||
% !TeX root = ../../main-exercises.tex
|
||||
|
||||
Replace this graphic by the corresponding formulas:
|
||||
|
||||
\vspace{1cm} % some additional spacing before the image
|
||||
\includegraphics{graphics/math-formulas.rend-crop.pdf}
|
||||
@ -1,47 +0,0 @@
|
||||
\documentclass[a4paper, ngerman]{report}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage{babel}
|
||||
\usepackage{eurosym, tipa, textcomp, textgreek, upgreek}
|
||||
\usepackage{amssymb, amsfonts, amsmath, dsfont}
|
||||
\usepackage[hidelinks]{hyperref}
|
||||
\usepackage{cleveref}
|
||||
\usepackage{graphicx}
|
||||
\usepackage{longtable, array, tabularx, booktabs, colortbl}
|
||||
\usepackage{minted}
|
||||
\begin{document}
|
||||
\thispagestyle{empty}
|
||||
|
||||
\hrule
|
||||
\begin{center}
|
||||
|
||||
\textbf{Gravitational acceleration in Germany}
|
||||
$$9,81\,\frac{m}{s^2}$$ \\
|
||||
~ \\
|
||||
|
||||
\textbf {\textit{pq} formula}
|
||||
$$x_{1,2} = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}$$ \\
|
||||
~ \\
|
||||
|
||||
\textbf{Quadratic formula}
|
||||
$$x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$ \\
|
||||
~ \\
|
||||
|
||||
\textbf{Catalan numbers}
|
||||
\begin{equation*} C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!} \end{equation*} \\
|
||||
~ \\
|
||||
|
||||
\textbf{Definition of a factorial}
|
||||
$$n! = \prod_{i=1}^{n} i$$ \\
|
||||
~ \\
|
||||
|
||||
\textbf{Set of all odd natural numbers}
|
||||
$$\{ x \mid x \in \mathds{N}, \text{odd}(x) \}$$
|
||||
~ \\
|
||||
|
||||
\textbf{Elimination $\neg\exists x$}
|
||||
$$\neg\exists x . p(x) \Leftrightarrow \forall x . \neg p(x)$$
|
||||
\end{center}
|
||||
|
||||
\hrule
|
||||
\end{document}
|
||||
@ -1,4 +0,0 @@
|
||||
\section{Typesetting mathematics}
|
||||
|
||||
Use \LaTeX{}'s math mode to typeset the following formulas.
|
||||
Pay attention to the size of brackets. Prioritize those formulas that appear to be most useful and/or interesting to you.
|
||||
@ -1,17 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[ngerman]{babel}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[T1]{fontenc}
|
||||
|
||||
\title{Exercise on Project Structure}
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
\tableofcontents
|
||||
|
||||
\newpage
|
||||
\input{section1}
|
||||
\newpage
|
||||
\input{section2}
|
||||
|
||||
\end{document}
|
||||
@ -1,12 +0,0 @@
|
||||
\input{preamble.done}
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
\tableofcontents
|
||||
|
||||
\newpage
|
||||
\input{section1.done}
|
||||
\newpage
|
||||
\input{section2.done}
|
||||
|
||||
\end{document}
|
||||
@ -1,29 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[english]{babel}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[T1]{fontenc}
|
||||
|
||||
\title{Exercise on Project Structure}
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
\tableofcontents
|
||||
|
||||
\newpage
|
||||
\section{First section}
|
||||
Jelly beans tiramisu chocolate bar chupa chups candy canes lollipop liquorice cheesecake tootsie roll. Marshmallow sugar plum cake tiramisu jelly cake bear claw. Croissant liquorice jelly lollipop carrot cake. Cheesecake danish chocolate halvah. Candy canes jujubes chupa chups jujubes candy canes tootsie roll toffee danish sesame snaps. Sugar plum gummi bears lollipop chocolate bar. Ice cream soufflé sweet lemon drops chocolate soufflé gingerbread cookie muffin.
|
||||
|
||||
Sugar plum danish halvah jujubes pastry donut carrot cake dessert donut. Sweet gingerbread gingerbread wafer gummi bears pastry. Tootsie roll donut powder cake. Brownie halvah lollipop gummi bears. Liquorice pie caramels jelly beans. Halvah danish brownie danish toffee cotton candy lemon drops.
|
||||
|
||||
Donut jelly beans candy canes muffin lemon drops carrot cake sugar plum. Sesame snaps pie bonbon cotton candy cookie caramels. Chupa chups dessert tootsie roll carrot cake candy cookie sweet roll jelly beans. Oat cake halvah gingerbread bonbon sweet sesame snaps dragée carrot cake. Bonbon pastry chupa chups. Chocolate cake macaroon jelly-o. Pastry pastry sugar plum jujubes lemon drops gummi bears sugar plum cheesecake fruitcake. Chocolate cake chocolate candy. Wafer carrot cake chocolate cake jujubes cupcake soufflé gingerbread chocolate cake donut.
|
||||
|
||||
\newpage
|
||||
\section{Second section}
|
||||
|
||||
Sweet roll tart chocolate bar cotton candy jelly beans cheesecake. Ice cream pastry halvah tart dragée jelly beans chocolate toffee wafer. Pie tootsie roll wafer halvah jelly cake donut cheesecake. Caramels tiramisu candy canes tootsie roll danish apple pie topping topping. Gingerbread carrot cake chocolate cake liquorice jujubes caramels cupcake apple pie macaroon.
|
||||
|
||||
Marzipan marzipan cupcake pastry tart sesame snaps sweet roll pie. Marshmallow pastry icing macaroon topping toffee powder gummi bears soufflé. Danish carrot cake sesame snaps cotton candy candy canes cotton candy. Cheesecake dragée sweet roll. Cheesecake muffin tiramisu marshmallow. Lollipop lollipop jujubes jelly-o cake sugar plum. Lemon drops donut topping wafer. Pastry gingerbread biscuit cheesecake muffin candy canes sweet pastry.
|
||||
|
||||
Carrot cake cotton candy toffee jelly-o chocolate toffee cookie sweet roll. Pastry tootsie roll marzipan apple pie lollipop gingerbread sweet. Fruitcake gummies bear claw croissant. Pie cotton candy cheesecake powder bonbon candy canes lemon drops sweet.
|
||||
|
||||
\end{document}
|
||||
@ -1,6 +0,0 @@
|
||||
\documentclass{article}
|
||||
\usepackage[english]{babel}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[T1]{fontenc}
|
||||
|
||||
\title{Exercise on Project Structure}
|
||||
@ -1,6 +0,0 @@
|
||||
\section{First section}
|
||||
Jelly beans tiramisu chocolate bar chupa chups candy canes lollipop liquorice cheesecake tootsie roll. Marshmallow sugar plum cake tiramisu jelly cake bear claw. Croissant liquorice jelly lollipop carrot cake. Cheesecake danish chocolate halvah. Candy canes jujubes chupa chups jujubes candy canes tootsie roll toffee danish sesame snaps. Sugar plum gummi bears lollipop chocolate bar. Ice cream soufflé sweet lemon drops chocolate soufflé gingerbread cookie muffin.
|
||||
|
||||
Sugar plum danish halvah jujubes pastry donut carrot cake dessert donut. Sweet gingerbread gingerbread wafer gummi bears pastry. Tootsie roll donut powder cake. Brownie halvah lollipop gummi bears. Liquorice pie caramels jelly beans. Halvah danish brownie danish toffee cotton candy lemon drops.
|
||||
|
||||
Donut jelly beans candy canes muffin lemon drops carrot cake sugar plum. Sesame snaps pie bonbon cotton candy cookie caramels. Chupa chups dessert tootsie roll carrot cake candy cookie sweet roll jelly beans. Oat cake halvah gingerbread bonbon sweet sesame snaps dragée carrot cake. Bonbon pastry chupa chups. Chocolate cake macaroon jelly-o. Pastry pastry sugar plum jujubes lemon drops gummi bears sugar plum cheesecake fruitcake. Chocolate cake chocolate candy. Wafer carrot cake chocolate cake jujubes cupcake soufflé gingerbread chocolate cake donut.
|
||||
@ -1,7 +0,0 @@
|
||||
\section{Second section}
|
||||
|
||||
Sweet roll tart chocolate bar cotton candy jelly beans cheesecake. Ice cream pastry halvah tart dragée jelly beans chocolate toffee wafer. Pie tootsie roll wafer halvah jelly cake donut cheesecake. Caramels tiramisu candy canes tootsie roll danish apple pie topping topping. Gingerbread carrot cake chocolate cake liquorice jujubes caramels cupcake apple pie macaroon.
|
||||
|
||||
Marzipan marzipan cupcake pastry tart sesame snaps sweet roll pie. Marshmallow pastry icing macaroon topping toffee powder gummi bears soufflé. Danish carrot cake sesame snaps cotton candy candy canes cotton candy. Cheesecake dragée sweet roll. Cheesecake muffin tiramisu marshmallow. Lollipop lollipop jujubes jelly-o cake sugar plum. Lemon drops donut topping wafer. Pastry gingerbread biscuit cheesecake muffin candy canes sweet pastry.
|
||||
|
||||
Carrot cake cotton candy toffee jelly-o chocolate toffee cookie sweet roll. Pastry tootsie roll marzipan apple pie lollipop gingerbread sweet. Fruitcake gummies bear claw croissant. Pie cotton candy cheesecake powder bonbon candy canes lemon drops sweet.
|
||||
@ -1,4 +0,0 @@
|
||||
\section{A structured project}
|
||||
|
||||
Within the directory \file{exercises/project-structure} you can find the file
|
||||
\file{main.tex}.
|
||||
@ -1,24 +0,0 @@
|
||||
\begin{enumerate}
|
||||
\item
|
||||
Put the sections of the file into separate files, named
|
||||
\file{section1.tex}, \file{section2.tex}, and \file{section3.tex} and insert them using the \code{latex}{\textbackslash input} command. (In TeXstudio, make sure that you select the main file as the file to be compiled by right-clicking on it and selecting \enquote{Select as explicit root document.})
|
||||
|
||||
\begin{figure}[H]
|
||||
\codeblock{latex}{exercises/project-structure/main.done.tex}
|
||||
\caption{\file{main.tex}}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[H]
|
||||
\codeblock{latex}{exercises/project-structure/section1.done.tex}
|
||||
\caption{\file{section1.tex} (analogous for the other
|
||||
sections)}
|
||||
\end{figure}
|
||||
|
||||
\item Can the preamble also live in its own file? Find out by moving it analogously to the sections. If no, why? If yes, why can outsourcing the preamble be useful?
|
||||
|
||||
The preamble can also be outsourced. In real-world \LaTeX{} projects, we often make use of numerous packages that need to be
|
||||
configured by additional commands within the preamble. Therefore, it is
|
||||
advisable to outsource the preamble. On top of that, this is useful
|
||||
because the file with the most-commonly used packages can be moved from
|
||||
one project to another without needing to rewrite the preamble every time.
|
||||
\end{enumerate}
|
||||
@ -1,5 +0,0 @@
|
||||
\begin{enumerate}
|
||||
\item Put the sections of the file into separate files, named \file{section1.tex} and \file{section2.tex}.
|
||||
Include them using the \code{latex}{\textbackslash input} command. (In TeXstudio, make sure that you select the main file as the file to be compiled by right-clicking on it and selecting \enquote{Select as explicit root document.})
|
||||
\item Can the preamble also live in its own file? Find out by moving it analogously to the sections. If no, why? If yes, why can outsourcing the preamble be useful?
|
||||
\end{enumerate}
|
||||
@ -1,5 +0,0 @@
|
||||
public class HelloLaTeXFriends {
|
||||
public static void Main() {
|
||||
System.Console.WriteLine("Hello LaTeX friends!");
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 9.4 KiB |
@ -1,14 +0,0 @@
|
||||
C\# is an object-oriented programming language that was developed by Microsoft in 2011.
|
||||
\Cref{fig:csharp} displays the logo of the programming language.
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=2cm]{exercises/references/csharp.png}
|
||||
\caption{The logo of C\#}
|
||||
\label{fig:csharp}
|
||||
\end{figure}
|
||||
|
||||
Listing \ref{lst:csharphelloworld} shows a program that prints the text \enquote{Hello LaTeX friends!} to the console. Like Java, C\# makes use of classes and main methods to build executable applications.
|
||||
|
||||
\lstset{language=csharp}
|
||||
\lstinputlisting[label=lst:csharphelloworld, caption=Hello World in C\#]{exercises/references/HelloLateXFriends.cs}
|
||||
@ -1 +0,0 @@
|
||||
\codeblock{latex}{./exercises/references/references.code.done.tex}
|
||||
@ -1,14 +0,0 @@
|
||||
% !TeX root = ../../main-exercises.tex
|
||||
|
||||
C\# is an object-oriented programming language that was developed by Microsoft in 2011. The figure displays the logo of the programming language.
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=2cm]{exercises/references/csharp.png}
|
||||
\caption{The logo of C\#}
|
||||
\end{figure}
|
||||
|
||||
The following source code listing shows a program that prints the text \enquote{Hello LaTeX friends!} to the console. Like Java, C\# makes use of classes and main methods to build executable applications.
|
||||
|
||||
\lstset{language=csharp}
|
||||
\lstinputlisting{exercises/references/HelloLateXFriends.cs}
|
||||
@ -1,11 +0,0 @@
|
||||
% same chapter as footnotes
|
||||
\subsection{Inserting references}
|
||||
|
||||
In file \file{exercises/references/references.tex}, replace \enquote{in the
|
||||
figure} and \enquote{the following source code listing} with suited references.
|
||||
Use the command \code{latex}{\textbackslash cref}. Do not forget to first
|
||||
introduce labels and captions for the elements that you want to reference.
|
||||
Make sure to use suitable prefixes before the labels.
|
||||
|
||||
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 \code{\lstinputlisting} command.
|
||||
@ -1,9 +0,0 @@
|
||||
public class Source {
|
||||
public static void main(String[] args) {
|
||||
String greeting = "Willkommen in dieser äußerst sinnvollen Java-Klasse, die wirklich bemerkenswert wenig Bedeutung trägt.";
|
||||
|
||||
for (int i = 0; i < greeting.length(); i++) {
|
||||
System.out.println(greeting.charAt(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,8 +0,0 @@
|
||||
\lstinputlisting[
|
||||
language=Java,
|
||||
numbers=left, % line numbers
|
||||
showstringspaces=false, % spaces in strings
|
||||
keywordstyle=\color{blue}, % keyword color
|
||||
basicstyle=\ttfamily\small, % overall font and size
|
||||
literate={ä}{{\"a}}1 {ß}{{\ss}}1 % special characters
|
||||
]{exercises/source-code-listings/Source.java}
|
||||
@ -1,13 +0,0 @@
|
||||
\usemintedstyle{native}
|
||||
\definecolor{ourBackgroundColor}{rgb}{0.1,0.1,0.2}
|
||||
|
||||
\inputminted[
|
||||
breaklines, % line breaks
|
||||
linenos=true, % line numbers
|
||||
bgcolor=ourBackgroundColor, % background color
|
||||
firstline=5, % first line to be included
|
||||
lastline=7, % last line to be included
|
||||
autogobble=true % remove leading spaces
|
||||
]{java}{exercises/source-code-listings/Source.java}
|
||||
|
||||
\usemintedstyle{default}
|
||||
@ -1,15 +0,0 @@
|
||||
% Show rendering with respect to the installed software
|
||||
\ifthenelse{\equal{\listingsmode}{minted}}{%
|
||||
\subsubsection{Minted rendering}
|
||||
\input{exercises/source-code-listings/minted.done.tex}
|
||||
}{%
|
||||
\subsubsection{Listings rendering}
|
||||
\input{exercises/source-code-listings/listings.done.tex}
|
||||
}
|
||||
|
||||
\subsubsection{Minted solution}
|
||||
\codeblock{latex}{./exercises/source-code-listings/minted.done.tex}
|
||||
|
||||
\subsubsection{Listings solution}
|
||||
\codeblock{latex}{./exercises/source-code-listings/listings.done.tex}
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
% !TeX root = ../../main-exercises.tex
|
||||
|
||||
Your listings go here.
|
||||
@ -1,36 +0,0 @@
|
||||
\section{Listings}
|
||||
|
||||
In the folder \file{exercises/source-code-listings}, you will find a file called \file{Source.java}.
|
||||
We will now include it into our document and adjust its display to fit our needs.
|
||||
If you have questions, consult the \pkg{minted} or \pkg{listings} package documentation.
|
||||
|
||||
\section*{Minted tasks}
|
||||
|
||||
\begin{enumerate}
|
||||
\item Include the file into \\
|
||||
\file{exercises/source-code-listings/source-code-listings.tex}.
|
||||
\item Enable special characters via the \code{latex}{literate} option.
|
||||
\item Activate syntax highlighting by stating the programming language Java.
|
||||
\item Add line breaks and line numbers.
|
||||
\item Use the theme \code{latex}{native}.
|
||||
\item This theme is optimized for a dark background. Change the background color to dark blue.
|
||||
\item Include only lines 5 to 7.
|
||||
\item Delete the spaces at the beginning of the lines. (Hint: The documentation speaks of \code{latex}{autogobble}.)
|
||||
\end{enumerate}
|
||||
|
||||
\section*{Listings tasks}
|
||||
|
||||
\begin{enumerate}
|
||||
\item Include the file into \\
|
||||
\file{exercises/source-code-listings/source-code-listings.tex}.
|
||||
\item Activate syntax highlighting by stating the programming language Java.
|
||||
\item Set the \mono{basicstyle} to a proper mono-spaced font (\mono{\textbackslash ttfamily \textbackslash small})
|
||||
\item Add line numbers.
|
||||
\item Change the keyword color to blue.
|
||||
\item Don't show special characters for spaces in strings.
|
||||
\end{enumerate}
|
||||
|
||||
% Reset experiments from exercise material if minted is used
|
||||
\ifthenelse{\equal{\listingsmode}{minted}}{%
|
||||
\usemintedstyle{default}
|
||||
}{}
|
||||
@ -1,7 +0,0 @@
|
||||
What is a semester ticket?
|
||||
It is also known as \enquote{Studi-Ticket} or \enquote{Studi-Karte} in German and allows you to use the local public transport around Bamberg for free.
|
||||
In Bamberg, the semester ticked is embodied in your student card (Studierendenausweis).
|
||||
To be able to use it, you have to validate the student card in one of the university buildings.
|
||||
This is possible after you have paid the semester fees.
|
||||
Validation printers are located in multiple university buildings, e.\,g., in the foyer of the Erba building, in front of the library.
|
||||
This building is opened Monday\,--\,Friday, 7am\,--\,10pm.
|
||||
@ -1 +0,0 @@
|
||||
\codeblock{latex}{./exercises/special-characters/special-characters.code.done.tex}
|
||||
@ -1,9 +0,0 @@
|
||||
% !TeX root = ../../main-exercises.tex
|
||||
|
||||
What is a semester ticket?
|
||||
It is also known as Studi-Ticket or Studi-Karte and allows you to use the local public transport around Bamberg for free.
|
||||
In Bamberg, your student card (Studierendenausweis) is used, i. a., as a semester ticket.
|
||||
To be able to use it, you should validate the student card in one of the university buildings.
|
||||
This is possible after you have paid the semester fees.
|
||||
Validation printers are located in multiple university buildings, e. g., in the foyer of the Erba building, in front of the library.
|
||||
This building is opened Monday - Friday, 7am - 10pm.
|
||||
@ -1,13 +0,0 @@
|
||||
\section{Insert special characters}
|
||||
|
||||
For this task, we are using the file \file{exercises/special-characters.tex}.
|
||||
To be able to see your results here within the exercise script,
|
||||
compile the \file{main-exercises.tex} file.
|
||||
This applies for the subsequent tasks, as well.
|
||||
|
||||
\begin{enumerate}
|
||||
\item Replace the spaces within abbreviations (e.\,g., i.\,a.) by thin spaces.
|
||||
\item Replace the hyphens within the Erba opening hours by en dashes.
|
||||
\item Add quotation marks around the words \emph{Studi-Ticket} and
|
||||
\emph{Studi-Karte} using the \code{latex}{\textbackslash enquote} command.
|
||||
\end{enumerate}
|
||||
@ -1,13 +0,0 @@
|
||||
\begin{table}[h]
|
||||
\centering
|
||||
\begin{tabular}{clll}
|
||||
\toprule
|
||||
No. & Name & Abbreviation & Term \\
|
||||
\midrule
|
||||
1 & Foundations of Software Engineering & SWT-FSE-B & summer \\
|
||||
2 & Information Retrieval & MI-IR-M & summer \\
|
||||
3 & International Outsourcing Management & ISM-IOM-M & winter \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Overview over some courses}
|
||||
\end{table}
|
||||
@ -1,15 +0,0 @@
|
||||
\codeblock{latex}{./exercises/tables/tables.code.done.tex}
|
||||
|
||||
\begin{table}[h]
|
||||
\centering
|
||||
\begin{tabular}{clll}
|
||||
\toprule
|
||||
No. & Name & Abbreviation & Term \\
|
||||
\midrule
|
||||
1 & Foundations of Software Engineering & SWT-FSE-B & summer \\
|
||||
2 & Information Retrieval & MI-IR-M & summer \\
|
||||
3 & International Outsourcing Management & ISM-IOM-M & winter \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\caption{Overview over some courses}
|
||||
\end{table}
|
||||
@ -1,13 +0,0 @@
|
||||
% !TeX root = ../../main-exercises.tex
|
||||
|
||||
\begin{itemize}
|
||||
\item Foundations of Software Engineering
|
||||
\subitem abbreviation: SWT-FSE-B
|
||||
\subitem term: summer
|
||||
\item Information Retrieval
|
||||
\subitem abbreviation: MI-IR-M
|
||||
\subitem term: summer
|
||||
\item International Outsourcing Management
|
||||
\subitem abbreviation: ISM-IOM-M
|
||||
\subitem term: winter
|
||||
\end{itemize}
|
||||
@ -1,8 +0,0 @@
|
||||
\section{Typesetting tables}
|
||||
|
||||
The following list shows some key data about a few courses of the \acro{WIAI} faculty.
|
||||
However, the overview is not as clear as it could be.
|
||||
To improve it, convert the list into a table with columns for \emph{name}, \emph{abbreviation} and \emph{term}.
|
||||
Insert an additional \emph{centered column} that numbers the courses.
|
||||
Add a caption to the table.
|
||||
You find the table in \file{exercises/tables/tables.tex}.
|
||||
@ -1,5 +0,0 @@
|
||||
\blockquote[Source and more information: \url{https://en.wikipedia.org/wiki/Recursion}]{
|
||||
\emph{Recursion} (adjective: \emph{recursive}) occurs when a thing is defined in terms of itself or of its type.
|
||||
\emph{Recursion} is used in a variety of disciplines ranging from linguistics to logic.
|
||||
The most common application of \emph{recursion} is in mathematics and computer science, where a function being defined is applied within its own definition.
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
\codeblock{latex}{./exercises/text-markup/markup.code.done.tex}
|
||||
@ -1,9 +0,0 @@
|
||||
% !TeX root = ../../main-exercises.tex
|
||||
|
||||
``Recursion (adjective: recursive) occurs when a thing is defined in terms of itself or of its type.
|
||||
Recursion is used in a variety of disciplines ranging from linguistics to logic.
|
||||
The most common application of recursion is in mathematics and computer science,
|
||||
where a function being defined is applied within its own definition.''
|
||||
|
||||
Source and more information: https://en.wikipedia.org/wiki/Recursion
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
\section{Emphasising text}
|
||||
|
||||
\begin{enumerate}
|
||||
\item In \file{exercies/text-markup/markup.tex}, emphasize the words
|
||||
``recursion'' and ``recursive.''
|
||||
\item Make the \textsc{url} clickable.
|
||||
\item Find a proper way to display the whole \textbf{paragraph as a quote}. Have a look at the \mono{csquotes} package.
|
||||
\item Of course, you can also experiment with the other commands that you learned for text markup. However, you might want to remove them afterwards to keep your document nice and tidy.
|
||||
\end{enumerate}
|
||||
|
||||
@ -1,36 +0,0 @@
|
||||
\newpage
|
||||
\definecolor{latexblue}{rgb}{0.9,0.925,0.95}
|
||||
\pagecolor{latexblue}
|
||||
|
||||
\chapter*{First steps with \LaTeX}
|
||||
\addcontentsline{toc}{section}{First steps with \LaTeX}
|
||||
|
||||
This document\footnote{Find the latest version of this document on Gitea: \url{https://git.stuve-bamberg.de/latex/latex-skript/releases}} contains exercises to practically apply learnings from the Fachschaft \acro{WIAI}'s \LaTeX{} workshop.
|
||||
The following instructions will equip you with the programs necessary to create documents with \LaTeX{}---they are explained in the workshop and the main script.
|
||||
Please, make sure to install the \emph{compiler first} and the \emph{editor afterwards}\textit{.}
|
||||
|
||||
\section*{Compiler}
|
||||
Let’s start with the compiler.
|
||||
(Seriously!)
|
||||
We will need it to convert our \LaTeX{} documents into \acro{PDF}s.
|
||||
There are different compilers for different operating systems;
|
||||
for example, MikTeX for Windows,\footnote{\url{https://miktex.org/download}} Mac\TeX{} for macOS,\footnote{\url{http://tug.org/mactex/}} and \TeX{}Live for Linux distributions.\footnote{On Debian-based Linux distributions, install the compiler by executing \sh{sudo apt install texlive-full.}
|
||||
For other distributions, see \url{https://tug.org/texlive/doc/texlive-en/texlive-en.html\#installation}.}
|
||||
In case you get to choose, it is best to install the full version with all packages.
|
||||
|
||||
\section*{Editor}
|
||||
As soon as you have installed the compiler, you can download an editor that you are going to use to write your \LaTeX{} documents.
|
||||
Any editor will do (notepad++, Atom, VS Code, etc.).
|
||||
However, for beginners, we recommend using \TeX{}studio,\footnote{You find the latest version on \url{https://www.texstudio.org/}.} a program that supports you with \LaTeX-specific features.
|
||||
|
||||
\section*{Compiling for the first time}
|
||||
Open up the file \file{main-exercises.tex} in \TeX{}studio.
|
||||
It can be found in our project directory.
|
||||
By pressing \includegraphics[width=.8em]{graphics/faForward.png}, it is converted into a a file called \file{main-exercises.pdf}.
|
||||
You should be able to find the latter by looking at the project directory in your file explorer.
|
||||
If your installation is not working yet, \TeX{}studio will show you an error message.
|
||||
Feel free to contact us in this case.\footnote{Find us at \url{https://www.uni-bamberg.de/wiai/fs}.}
|
||||
Otherwise, you are now ready to go!
|
||||
|
||||
\newpage
|
||||
\nopagecolor
|
||||
BIN
fontspec.pdf
Normal file
BIN
fontspec.pdf
Normal file
Binary file not shown.
13
fontspecbeispiel.tex
Normal file
13
fontspecbeispiel.tex
Normal file
@ -0,0 +1,13 @@
|
||||
% lualatex fontspecbeispiel
|
||||
% pdfcrop fontspecbeispiel.pdf fontspec.pdf
|
||||
|
||||
\documentclass{article}
|
||||
\usepackage[ngerman]{babel}
|
||||
\usepackage{nopageno}
|
||||
% Nur XeLaTeX und LuaLaTeX:
|
||||
\usepackage{fontspec}
|
||||
\setmainfont{Linux Libertine O}
|
||||
\begin{document}
|
||||
Das ist ein Text in der Schriftart Linux Libertine mit den Schnitten
|
||||
\textit{Kursiv}, \textbf{\textit{Fett Kursiv}} und \textsc{Kapitälchen}.
|
||||
\end{document}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user