Compare commits

...

210 Commits

Author SHA1 Message Date
89c2d46463 Update version 2025-05-13 13:34:54 +02:00
9594555c6b Re-order sections 2025-05-13 13:33:17 +02:00
8984674b28 Merge branches 'master' and 'master' of git.stuve-bamberg.de:latex/latex-skript 2025-05-10 13:13:15 +02:00
a49f819d2e Add installation verification file 2025-05-10 13:10:30 +02:00
Florian
a50c4bf8fb Update VS Code instructions 2025-05-09 00:18:39 +02:00
Florian
3e3d168b79 Adapt literature task for biber 2025-05-09 00:10:32 +02:00
Florian
9e827a19d6 Add extra document customization task 2025-05-08 23:24:48 +02:00
Florian
4aa827cd20 Add extra list task instructions 2025-05-08 22:28:38 +02:00
Florian
1a39161dd4 Remove the commenting-out task 2025-05-08 22:13:09 +02:00
Florian
d1458eca95 Add extra tasks for lists 2025-05-08 22:08:42 +02:00
Florian
ce6d806495 Adjust exercise numbers 2025-05-01 22:15:42 +02:00
Florian
e39f7eca69 Replace fake ellipses 2025-05-01 22:15:31 +02:00
c0fb9341d9 Fix curly braces 2025-04-30 16:45:04 +02:00
08bd6674bc Adjust imprint for v1.4.1 release 2024-11-23 21:22:57 +01:00
ba3de5fc2d Add clean to make publication 2024-11-23 21:12:30 +01:00
ae59df6855 Remove more aux files on make clean 2024-11-23 21:11:04 +01:00
315a83fda9 Add note on compiler 2024-11-23 20:49:31 +01:00
479823d6e6 Add a tutorial on how to integrate LaTeX and VS Code 2024-11-23 20:47:55 +01:00
7fdac83f02 Fix task description 2024-11-23 18:53:08 +01:00
62fbaf1bf3 Fix LaTeX companion date 2024-11-23 18:26:56 +01:00
7ecc90b22d Move caption below image 2024-11-23 18:23:57 +01:00
b87f06f4d3 Replace scrartcl 2024-11-23 17:27:37 +01:00
25273d056c Fix outdated Java version in task 11a 2024-11-23 16:15:43 +01:00
1ca170d111 Add magic TeX comments 2024-11-23 16:08:50 +01:00
58df0cc4dc Remove the euro sign from the special character task 2024-04-01 11:31:18 +02:00
Uni Seme4ki Arbeit
9a439157ae remove typo 2023-11-26 17:53:18 +01:00
0b60aee8a8 Fix \sh commands 2023-11-08 22:06:59 +01:00
e0e694f900 Fix listings task 2023-04-28 17:26:58 +02:00
8f9ef296fd Adjust reference exercise 2023-04-28 16:57:04 +02:00
8ea59e8656 Fix date 2023-04-28 16:14:02 +02:00
4a9f04a652 Increase release number 2023-04-28 13:27:30 +02:00
4abe1f3ccb Remove ToDo 2023-04-28 13:21:10 +02:00
fe7d63f9f3 Add solution cover 2023-04-28 13:07:06 +02:00
1cc6d96ed3 Minor refactoring 2023-04-28 12:42:36 +02:00
bb2db7a0dc Update first chapters section 2023-04-28 12:28:33 +02:00
a029095b65 Reorder sections 2023-04-26 10:02:21 +02:00
b52d346a39 Fix Makefile: both project zips should work again 2023-04-23 14:54:42 +02:00
381d1845d0 add caption information 2023-04-21 11:22:05 +02:00
63e7f42658 Remove references to Citavi 2023-04-09 17:48:42 +02:00
4187e79408 Fix author names in author tag 2023-03-01 13:29:29 +01:00
5c9b705960 Add contributors 2023-03-01 13:25:35 +01:00
a78fe6e336 Replace occurrences of main.tex 2023-01-28 16:46:15 +01:00
f206d75505 Add new cover pages 2023-01-28 15:53:38 +01:00
d9238159dd Update README 2023-01-28 15:53:22 +01:00
9a99c0aee9 Start fixing the Makefile 2023-01-13 18:21:53 +01:00
5731eb3c45 Add exercise versions 2023-01-13 17:18:30 +01:00
3c699d5dd0 Remove exercise command 2023-01-13 16:35:09 +01:00
e4e731f044 Split script 2023-01-13 16:03:41 +01:00
6dfd17dc46 Add details on the literate option for listings 2023-01-03 11:08:25 +01:00
a074052ab7 Fix literate ß in listings 2023-01-03 10:58:00 +01:00
f3e18adcb4 Replace \mathrm by \text 2023-01-03 10:55:24 +01:00
9b9940af27 Add new image crops 2022-11-14 10:48:55 +01:00
5a93acbeaa adjust exercise numbers to presentation 2022-11-12 00:36:53 +01:00
7338bb65e5 Merge paragraph formatting chapter into text markup chapter 2022-11-04 15:14:40 +01:00
cc0eef7ef6 Replace fontawesome icons 2022-10-29 18:25:22 +02:00
8ff9cd19d2 Remove compact lists from exercise 2022-10-11 21:06:04 +02:00
e9263d7efd Add citeauthor command 2022-10-11 20:18:46 +02:00
cf7a34585b Remove dblp part 2022-10-11 20:06:30 +02:00
5846df3590 Adjust project structure exercise 2022-10-11 20:06:23 +02:00
d08bb59517 Drop hyphens from the exercise 2022-09-26 10:28:14 +02:00
50914a0953 Remove minipages breaking exercises (by more more or less undoing 68b43dcc5a, and thereby rendering the special characters exercise partly useless) 2022-09-23 16:40:26 +02:00
b5ad8b380b Merge branch 'master' of git.stuve-bamberg.de:latex/latex-skript 2022-06-18 22:32:24 +02:00
49ef46c24d Move cover to parent folder 2022-06-18 22:32:00 +02:00
402cc5275a Move cover to titlepage 2022-06-18 22:29:15 +02:00
3dd100ee3e Merge branch '2022-refactor-script' 2022-06-18 22:01:05 +02:00
68ea193e66 Add cover 2022-06-18 21:59:14 +02:00
68b43dcc5a revise special characters exercise. 2022-06-16 15:48:05 +02:00
d433b1611e escaping latex code 2022-06-07 20:27:53 +02:00
3da04c663b include examples for different hyphens 2022-06-07 20:21:56 +02:00
47fd4ac4da Merge branch '2022-refactor-script' of git.stuve-bamberg.de:latex/latex-skript into 2022-refactor-script 2022-05-22 10:38:05 +02:00
cae9575704 Move source code listings chapter after graphics and tables. 2022-05-22 10:37:44 +02:00
0581584181 Update project structure exercises 2022-05-09 16:01:22 +02:00
eb580eca60 Remove one book 2022-04-11 14:32:14 +02:00
0a9086eb92 Replace the codeblock command 2022-04-11 14:09:12 +02:00
a26138023c Fix strange line breaks 2022-04-11 13:58:43 +02:00
4350ac3f0c Remove code listings that are part of solutions 2022-04-11 13:56:17 +02:00
5d4ae70397 use same font size for listings 2022-04-11 10:18:03 +02:00
7b4a4d1ef1 remove euro sign in task solution (special characters) 2022-04-11 10:11:36 +02:00
e3a8c976f5 remove eurosym from script 2022-04-10 20:22:10 +02:00
e2663134a1 delete todo note in task 13 2022-03-27 18:43:45 +02:00
11981baa80 Use autogobble in minted exercise 2022-03-13 19:22:33 +01:00
f71ca7f887 Check with Barilla 2022-03-13 19:17:54 +01:00
f3a4141776 Fix typo 2022-03-13 19:01:07 +01:00
918ea4d7e1 Change desired citation style 2022-03-13 18:55:38 +01:00
4aabd15076 remove typo 2022-01-21 14:19:18 +01:00
4251abb989 adapt basic-document-structure exercise to presentation 2022-01-20 20:40:39 +01:00
0037368ab3 Improving a few line breaks, possibly destroying everything language-related in doing so. 2022-01-20 19:50:00 +01:00
68ff85c26d Fix left-over in task 2022-01-18 13:51:05 +01:00
41f7ba74dd Fix indentation 2022-01-18 13:50:52 +01:00
7d37c51f94 Refactor first page 2022-01-18 12:27:58 +01:00
44e094811b Minor changes to the listingsmode introduction 2022-01-12 12:27:42 +01:00
bf2194d534 add section on switching listings mode 2022-01-12 11:49:49 +01:00
56db9b28d7 Fix minted style 2022-01-12 08:41:06 +01:00
ffc0bb9cea Revising source code chapter, improving lstlistings. 2022-01-11 22:26:13 +01:00
44b6e36815 Update release date 2022-01-10 17:31:12 +01:00
ad8139d623 Update README 2022-01-10 17:14:52 +01:00
6ecf6267bd Include txt files in the publication script 2022-01-10 10:34:00 +01:00
1ee3d6c36e Add setup.tex to the publication script 2022-01-10 10:22:29 +01:00
f8cacd2e10 Fix line-wrap 2022-01-10 10:14:44 +01:00
cc88aff49b Merge branch '2021-translate-script' of git.stuve-bamberg.de:latex/latex-skript into 2021-translate-script 2022-01-10 10:12:40 +01:00
9df4071888 Create minted-free alternative to the minted chapter 2022-01-10 10:07:35 +01:00
5a9cc630bb include minted in preamble only when minted is defined as listingsmode 2022-01-10 09:27:09 +01:00
c9f0bee905 include minted in preamble only when minted is defined as listingsmode 2022-01-10 09:26:45 +01:00
b9d6c531a9 Make minted import optional 2022-01-10 09:21:01 +01:00
8c6a782cfc Update python tutorial 2022-01-10 09:05:15 +01:00
d4df68bc99 Merge branch '2021-translate-script' of git.stuve-bamberg.de:latex/latex-skript into 2021-translate-script 2022-01-10 08:13:30 +01:00
6ebf564ee2 replace minted with shell command 2022-01-10 01:40:04 +01:00
fccedb63b0 exclude change-compiler section from chapter 0 2022-01-10 01:27:52 +01:00
4eae1b1f67 add float package to preamble 2022-01-09 21:11:01 +01:00
2b23cf4290 Merge branch '2021-translate-script' of git.stuve-bamberg.de:latex/latex-skript into 2021-translate-script 2022-01-08 17:42:14 +01:00
56f2f42cc9 replaced minted in continuous text with codeblock commands 2022-01-08 17:40:16 +01:00
16480cd7f9 replaced minted in continuous text with codeblock commands 2022-01-08 17:35:48 +01:00
1626e79ea9 Remove TODO 2022-01-08 16:32:49 +01:00
211f1af408 Rework the source code chapter 2022-01-08 16:28:10 +01:00
658ca6a689 Merge branch '2021-translate-script' of git.stuve-bamberg.de:latex/latex-skript into 2021-translate-script 2022-01-08 15:17:07 +01:00
efdae30d72 Add text description of the listings package 2022-01-08 15:17:03 +01:00
03e95d1e99 Merge branch '2021-translate-script' of git.stuve-bamberg.de:latex/latex-skript into 2021-translate-script 2022-01-08 15:05:17 +01:00
fcc38b3f6d set latex as language for listings 2022-01-08 15:05:10 +01:00
6d6e7e6ab9 Fix title case 2022-01-08 14:15:50 +01:00
fa4f63aedb Remove remaining \mintinline calls 2022-01-08 14:15:29 +01:00
ff281eea38 Merge branch '2021-translate-script' of git.stuve-bamberg.de:latex/latex-skript into 2021-translate-script 2022-01-08 14:03:15 +01:00
1897770361 Fix semantics of the \sh command by adding a \mono command 2022-01-08 14:01:10 +01:00
fae350c6df delete commented out line in codeblock command 2022-01-08 13:51:25 +01:00
c5dac27ce9 Use lstlistings in codeblocks 2022-01-08 13:50:03 +01:00
d0ff1e467e update project structure exercise 2022-01-08 13:49:12 +01:00
eec4b468c2 update listings command and code examples 2022-01-08 12:32:48 +01:00
70e4227534 add codeblock command and include it into some exercises 2022-01-03 15:06:40 +01:00
f18ed4ab9c Adding compiling option for listings. 2021-11-17 21:54:36 +01:00
be170abc01 Add the file command 2021-11-17 14:40:00 +01:00
e378b99733 add code and sh commands in exercises 2021-11-05 16:35:29 +01:00
b67fedc413 Unify commands 2021-11-01 12:14:40 +01:00
633e55906a Add english lectures 2021-10-04 13:43:15 +02:00
27e862eaca Remove TODO 2021-10-04 13:36:45 +02:00
fc15b0a296 Integrated corrections as discussed, chapters 5–16. 2021-09-30 20:01:19 +02:00
bfb3fee06c Integrated corrections as discussed, chapters 0–4 2021-09-29 00:05:31 +02:00
984b492dfb Merge branch '2021-translate-script' of git.stuve-bamberg.de:latex/latex-skript into 2021-translate-script 2021-09-24 16:04:19 +02:00
d66cd35472 Reviewed sections 10–16. 2021-09-23 23:24:19 +02:00
6f7554f748 Reviewed sections 10–11. 2021-09-10 13:58:09 +02:00
0e22caed01 Reviewed sections 3–9. 2021-09-10 13:43:08 +02:00
8984cb90da Minor fixes 2021-09-10 10:39:12 +02:00
a89148f53a Add some missing translations 2021-09-09 22:02:16 +02:00
43c4487702 Add missing translations 2021-09-09 21:36:58 +02:00
b497cacd1a Minor fixes 2021-09-09 21:25:51 +02:00
574838b080 Minor corrections 2021-09-09 21:16:51 +02:00
e9c410f139 minor changes regarding punctuation, upper and lower case, etc. 2021-09-05 18:33:28 +02:00
a017c5b8b4 translate exercise on project structure 2021-09-05 17:46:15 +02:00
a7e734a5e2 translate document-structure example and make other minor changes 2021-09-05 11:07:52 +02:00
36c5dd0ac8 Minor corrections to chapter 0. 2021-08-13 13:18:22 +02:00
c90332c0e5 Minor improvements on chapter 1–2. 2021-08-13 13:12:53 +02:00
156d0efecd Minor improvements on "Basic document structure" 2021-08-10 22:41:48 +02:00
b59b1d7831 Minor improvements on "Basic document structure" 2021-08-10 22:10:11 +02:00
a90ca6f9a4 Minor improvements on "What is LaTeX" 2021-08-10 21:39:17 +02:00
d4b618bb67 Minor improvements on "First steps …" 2021-08-10 21:10:23 +02:00
f16307ce8f Fix casing 2021-08-10 20:54:31 +02:00
78bed6ebe9 Fix minor mistakes in license statement 2021-08-10 20:50:53 +02:00
69c341325a fix cmp to cf 2021-07-23 14:18:43 +02:00
0ead420670 Merge branch '2021-translate-script' of git.stuve-bamberg.de:latex/latex-skript into 2021-translate-script 2021-07-23 14:12:06 +02:00
ac18657d88 Revised Details in project structure 2021-07-23 14:12:00 +02:00
9c2ba96e03 Merge branch '2021-translate-script' of git.stuve-bamberg.de:latex/latex-skript into 2021-translate-script 2021-07-23 14:08:17 +02:00
fd09dc9b5f Translate exercise toc line. 2021-07-23 14:08:07 +02:00
46421f3f8c Translated Project-Structure 2021-07-23 13:49:21 +02:00
b4ba69d9b4 translate references 2021-07-23 12:37:40 +02:00
dd87033b2b translate footnotes exercises 2021-07-23 11:52:47 +02:00
429a8e167d translate footnotes 2021-07-23 11:34:30 +02:00
5d6ef668f6 translate prospect chapter 2021-07-23 11:20:02 +02:00
7fc4292c48 Translate exercise 10. 2021-07-20 21:06:25 +02:00
329e639f9f Merge branch '2021-translate-script' of git.stuve-bamberg.de:latex/latex-skript into 2021-translate-script 2021-07-20 20:53:37 +02:00
7c13411361 Translite chapter 9. 2021-07-20 20:53:23 +02:00
308a0da7db Merge branch '2021-translate-script' of git.stuve-bamberg.de:latex/latex-skript into 2021-translate-script 2021-07-19 22:13:04 +02:00
8b5bfa6144 Translate the literature section 2021-07-19 22:12:46 +02:00
f20b039b80 Translate chapter 0. 2021-07-18 23:02:49 +02:00
5de5d729c1 Translate exercise 12. 2021-07-18 22:32:01 +02:00
29acc52b92 Translate chapter 12. 2021-07-18 22:20:47 +02:00
77a5f4236e Translate exercise 6. 2021-07-18 21:31:58 +02:00
0d7239443c Translate chapter 6. 2021-07-18 00:08:42 +02:00
ce626899fd Translate excercise 5. 2021-07-17 23:19:18 +02:00
8fe25a8633 Bluedtke: Wie Funktioniert LaTeX übersetzt 2021-07-08 17:32:29 +02:00
300aa2fdb6 translate graphics exercise solution 2021-07-08 11:55:47 +02:00
4ec34c575b translate graphics chapter and exercise material 2021-07-08 11:54:32 +02:00
f5a754fb0d translate graphics chapter (without exercise) 2021-07-08 11:33:17 +02:00
29bc4678f0 translate task for basic document structure 2021-07-08 10:19:18 +02:00
e0e3bb6366 translate basic document structure 2021-07-08 10:07:06 +02:00
166e01dcf9 Translate chapter 5. 2021-07-07 21:54:58 +02:00
8586f36b04 Translate figure caption 2021-07-07 18:08:57 +02:00
180a35c8ac Translate lists chapter 2021-07-07 18:08:43 +02:00
6e0942fb21 first translation of formatting paragraphs.tex 2021-06-26 00:29:45 +02:00
10e543c239 Fixing typos. 2021-06-25 16:05:05 +02:00
3edbaf43c1 Translate chapter 1. 2021-06-25 00:11:17 +02:00
974bc647e2 improvements on translatin of basic document structure 2021-06-24 18:48:00 +02:00
2c2f6090fc modify first version of translated basic-document-structure 2021-06-24 18:15:57 +02:00
fd9336f7f5 translate basic document structure 2021-06-24 18:09:01 +02:00
2942af9253 Translate meta info 2021-06-23 10:16:08 +02:00
ee9d97c138 Translate the source code listings part and add note on shell escape 2021-06-23 10:02:12 +02:00
Florian
6c7d21b70a
Create LICENSE 2021-05-28 22:48:18 +02:00
c5ac52d2c0 Fix URL 2021-05-28 22:30:35 +02:00
10430f3296 Merge branch 'master' of git.stuve-bamberg.de:latex/latex-skript 2021-05-28 20:59:10 +02:00
de6f76d0ca Resetting minted style after minted exercise 2021-05-28 20:58:59 +02:00
09a27eed79 delete csquotes from basic document structure task and change hyperref command 2021-05-28 20:03:51 +02:00
f15f6c54d8 Fix typos 2021-05-28 13:32:24 +02:00
f68ef73bcf Fix date 2021-05-28 13:12:01 +02:00
1121724641 Rename task files 2021-05-28 12:56:29 +02:00
e214041228 Fix typo 2021-05-28 12:18:36 +02:00
a324b8dca3 Add subtasks 2021-05-28 12:18:19 +02:00
17422be5c2 Fix typos 2021-05-28 11:46:27 +02:00
bd86860d9a Add instruction to comment out input blockers 2021-05-28 11:24:27 +02:00
0648ac9718 Add compilation note 2021-05-28 11:19:10 +02:00
034d0f80c5 Modifications according to last meeting. 2021-05-27 15:20:17 +02:00
d73fdf9350 Minor corrections. 2021-05-24 16:49:23 +02:00
6961b55448 Minor corrections. 2021-05-24 16:33:13 +02:00
Bernhard Luedtke
0ec7b758e8 BLuedtke: Zweites Kapitel Überarbeitet 2021-05-24 15:51:40 +02:00
177 changed files with 2762 additions and 1439 deletions

3
.gitignore vendored
View File

@ -79,7 +79,8 @@ _minted*
*.swp
*.swo
main.pdf
main-*.pdf
listings-mode.tex
exercise-mode.tex
public
exercises/*/*.pdf

428
LICENSE Normal file
View File

@ -0,0 +1,428 @@
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.

View File

@ -10,7 +10,8 @@ clean:
@echo Cleaning up temporary files.
@rm -rf public/*
@rm -rf temp/*
@rm -f {main,script-only}.{aux,loc,log,out,pdf,soc,toc}
@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}
# Compile listings (only needed when listings have changed)
listings: listings/**/*
@ -21,26 +22,15 @@ tasks: exercises/**/*
./compile_tasks
# Compile a preview PDF containing all contents
preview: main.tex
echo "\newcommand\exercisemode{any}" > exercise-mode.tex
pdflatex -shell-escape main.tex
@echo
@echo
@echo Run \'make publication\' to generate PDF and ZIP file for publication.
# Compile a preview PDF containing all contents and the literature
preview-with-literature: main.tex
echo "\newcommand\exercisemode{any}" > exercise-mode.tex
pdflatex -shell-escape main.tex
bibtex main.aux
pdflatex -shell-escape main.tex
pdflatex -shell-escape main.tex
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: publication-pdf-without-exercises publication-pdf-with-exercises publication-pdf-with-solutions publication-zip-with-exercises publication-zip-with-solutions
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:
@ -52,48 +42,60 @@ publication-dir:
mkdir -p temp/
# Compile a printable PDF without exercises
publication-pdf-without-exercises: clean publication-dir main.tex
echo "\newcommand\exercisemode{none}" > exercise-mode.tex
pdflatex -shell-escape -jobname=script-only main.tex
pdflatex -shell-escape -jobname=script-only main.tex
pdflatex -shell-escape -jobname=script-only main.tex
mv script-only.pdf public/
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.tex
echo "\newcommand\exercisemode{exercises}" > exercise-mode.tex
pdflatex -shell-escape -jobname=script-with-exercises main.tex
pdflatex -shell-escape -jobname=script-with-exercises main.tex
pdflatex -shell-escape -jobname=script-with-exercises main.tex
mv script-with-exercises.pdf public/
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/* graphics/* listings/**/*.{tex,pdf,bib,java,txt} titlepage.tex imprint.tex temp/
cd temp && zip ../public/project-without-exercises * **/* **/**/*
# Compile a printable PDF with exercises and solutions
publication-pdf-with-solutions: clean publication-dir main.tex
echo "\newcommand\exercisemode{solutions}" > exercise-mode.tex
pdflatex -shell-escape -jobname=script-with-solutions main.tex
pdflatex -shell-escape -jobname=script-with-solutions main.tex
pdflatex -shell-escape -jobname=script-with-solutions main.tex
mv script-with-solutions.pdf public/
# Build a ZIP file with tasks and without solutions
publication-zip-with-exercises: clean publication-dir main.tex
rm -rf temp/*
cp --parents main.tex praeamble.tex commands.tex content/* graphics/* listings/**/*.{tex,pdf,bib,java} temp/
publication-zip-with-exercises: clean publication-dir
rm -rf temp/* exercises/**/_*
cp --parents main-exercises.tex praeamble.tex commands.tex setup.tex graphics/* 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}
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 main.tex
rm -rf temp/*
cp --parents main.tex praeamble.tex commands.tex content/* graphics/* listings/**/*.{tex,pdf,bib,java} temp/
publication-zip-with-solutions: clean publication-dir
rm -rf temp/* exercises/**/_*
cp --parents main-solutions.tex praeamble.tex commands.tex setup.tex graphics/* 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}
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 * **/* **/**/*

111
README.md
View File

@ -1,6 +1,6 @@
# LaTeX Script by Fachschaft WIAI
This script introduces the most fundamental LaTeX mechanisms to get learners started. It is used both as a reference and as exercise material for our [LaTeX workshop](https://wiai.de/latex-weekend), a **two-day tutorial aimed at students from various backgrounds**. At the moment, it is only available in German. The following topics are covered:
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
@ -10,26 +10,58 @@ This script introduces the most fundamental LaTeX mechanisms to get learners sta
* formatting paragraphs
* lists
* maths and formulas
* sourcecode listings
* graphics
* tables
* footnotes
* references
* literature management
* source code listings (`listings` with an optional `minted` part)
Most chapters contain exercises to be performed within the script itself, practically teaching the aspects that are introduced by the text.
Most chapters contain exercises to practically apply the aspects that are introduced by the text.
## Requirements
## Getting started
Compiling the script requires a working [LaTeX installation](https://tug.org/texlive/).
For sourcecode listings, we are using [Pygments](https://pygments.org/) and [Python3](https://www.python.org/).
The Makefile comes in handy for compiling the different versions of the script (see usage section).
For learners, we recommend using [TeXstudio](https://www.texstudio.org/) to compile the script.
### 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://github.com/fs-wiai/latex-script/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-skript/
latex-script/
├── commands.tex
├── compile_listings
├── compile_tasks
@ -41,45 +73,61 @@ latex-skript/
│   ├── 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.tex
├── main-exercises.tex
├── main-script.tex
├── main-solutions.tex
├── Makefile
├── praeamble.tex
├── public
└── README.md
├── setup.tex
├── README.md
├── titlepage-exercises.tex
├── titlepage-solutions.tex
└── titlepage.tex
```
* **`main.tex`** is the entrypoint. It includes the preamble (`preamble.tex`), our custom commands (`commands.tex`) as well as all sections.
* **`content`** comprises the individual chapters of this script.
* Most chapters include a task that can be found in the **`exercises`** folder.
* **`public`** is the folder where all packed-up versions of the script are moved to, once they have been created using the `Makefile` and the command `make publication`. There are two zip archives of this repository (one containing only the exercises and one with solutions included) as well as three PDF versions (one with the content only, one with exercises, and one with exercises and solutions).
* `compile_listings` and `compile_commands` are two **utility bash scripts**. They produce a rendered and cropped PDF version of all `.tex` files within the `listings`/`exercises` folders and their subfolders. Rendered listings remain in `listings` whereas tasks are moved to the **`graphics`** folder afterwards. The compiled tasks are necessary for students who receive the project archive, but should not be given the sourcecode of tasks, e.g., if an exercise demands them to code up a table based on a pre-coded example.
## Relevant files for learners
## Usage
In this repository, we provide an exercise script in which you can practically apply what you have learned. These files will be needed:
**For beginners**: A PDF version of the script can be found in the “releases” section. It will give you an overview of how to use any LaTeX project. For this, have a look at the “Erste Schritte mit LaTeX” section.
* **`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.
**Commandline usage**: The project can be compiled by running a LaTeX compiler on `main.tex`. Note that we make (heavy) use of the Pygments package, which requires additional installation (see section above) and a flag (`--shell-escape`) that has to be passed to the compiler. To configure TeXstudio with Pygments, see the chapter “Quelltext-Listings” (especially “10.2 Compilerbefehl ändern”) in the script. A simple command would be:
## Additional material
```sh
$ pdflatex --shell-escape main.tex
```
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:
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:
* 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.
```sh
$ pdflatex --shell-escape main.tex
$ bibtex main.aux
$ pdflatex --shell-escape main.tex
$ pdflatex --shell-escape main.tex
```
Please don't feel overwhelmed by the amount of files in this repository. You will get to know the most important parts of the project step by step by [following the script](https://github.com/fs-wiai/latex-script/releases) or our workshop. What's more, by using this larger 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.&thinsp;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
@ -87,10 +135,13 @@ You are welcome to contribute to this project by creating issues, opening pull r
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 was created by Fachschaft WIAI, the Student Council of the faculty of Information Systems and Applied Computer Sciences at University of Bamberg. It is licensed under the creative commons licence “Attribution-ShareAlike 4.0 International” (CC BY-SA 4.0): http://creativecommons.org/licenses/by-sa/4.0/. Usage permissions beyond the scope of this license might be granted upon request.
The LaTeX Script has been assembled by the Student Council of the Faculty of Information Systems and Applied Computer Sciences (Fachschaft WIAI) at University of Bamberg. It is licensed under Creative Commons “Attribution-ShareAlike 4.0 International” (CC BY-SA 4.0): http://creativecommons.org/licenses/by-sa/4.0/. Upon request, allowances exceeding the limitations of this license may be granted.

View File

@ -34,6 +34,150 @@
\rule{\widefigurewidth}{0.4pt}
}
% 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.
@ -64,7 +208,7 @@
\colrules
% Left content: code listing:
\begin{subfigure}{\widefigurewidth}
\inputminted[breaklines]{tex}{listings/#2.tex}
\codeblock{latex}{listings/#2.tex}
\end{subfigure}
\hspace{\widefiguregap}
% Right content: image or rendered example:
@ -87,7 +231,7 @@
\hspace{\widefiguregap}
% Right caption:
\begin{subfigure}[t]{\widefigurewidth}
\caption{Ergebnis}
\caption{Result}
\label{#1-result}
\end{subfigure}
}
@ -97,69 +241,3 @@
\end{figure}
}
% Exercise mode
% =============
% The exercise mode can be chosen by writing one of the following to the exercise-mode.tex file before compilation:
% \newcommand\exercisemode{none} % for a blank script without exercises
% \newcommand\exercisemode{exercises} % for a script with exercises only
% \newcommand\exercisemode{solutions} % for a script with solutions only
% \newcommand\exercisemode{any} % for a script containing all available material
% The following lines include that file or make \exercisemode default to 'any' so that any derivatives of this project will work even without the file.
\IfFileExists{exercise-mode.tex}{
\input{exercise-mode.tex}
}{
\newcommand\exercisemode{any}
}
% Exercises
% =========
% Includes the task.tex file within the given subfolder of exercises and adds a heading.
\newcommand\exercise[1]{
\ifthenelse{\equal{\exercisemode}{none}}{
% Exercises disabled.
}{
\newpage
\definecolor{latexblue}{rgb}{0.9,0.925,0.95}
\pagecolor{latexblue}
%\definecolor{latexblue}{rgb}{0.73,0.84,0.92}
\section*{Übung \thechapter}
\addcontentsline{toc}{section}{Übung}%
\input{exercises/#1/task.tex}
\newpage
\nopagecolor
}
}
% Exercise Material
% =================
% Takes a project-relative path, and inserts matching exercise material and/or solutions, depending on the exercise mode.
\newcommand\exercisematerial[1]{
% Mode 'exercises': raw material only
\ifthenelse{\equal{\exercisemode}{exercises}}{
\IfFileExists{#1.raw.tex}{
\input{#1.raw.tex}
}{}
}{}
% Mode 'solutions': completed material only
\ifthenelse{\equal{\exercisemode}{solutions}}{
\IfFileExists{#1.done.tex}{
\input{#1.done.tex}
}{}
}{}
% Mode 'any': all existing material. If both raw and completed material exist, headings are added for each.
\ifthenelse{\equal{\exercisemode}{any}}{
\IfFileExists{#1.raw.tex}{
\IfFileExists{#1.done.tex}{
\subsubsection*{Vorschau des ungelösten Materials}
}{}
\input{#1.raw.tex}
}{}
\IfFileExists{#1.done.tex}{
\IfFileExists{#1.raw.tex}{
\subsubsection*{Vorschau des gelösten Materials}
}{}
\input{#1.done.tex}
}{}
}{}
}

View File

@ -2,22 +2,30 @@
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 --output-directory "${D}" "${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} ######"
pdflatex --output-directory "${D}" "${F}"
pdfcrop "${D}/$(basename -s .tex ${F}).pdf" \
"${D}/$(basename -s .tex ${F}).pdf"
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} ######"

View File

@ -1,133 +1,131 @@
\chapter{Grundstruktur}
\chapter{Basic document structure}
\label{sec:basic-document-structure}
Wie sieht so ein \LaTeX-Dokument jetzt eigentlich aus?
Im Kern besteht es immer aus zwei Teilen: einer Präambel zu Beginn sowie der unmittelbar folgenden Dokumentumgebung.
Als \emph{Präambel} bezeichnen wir die ersten Befehle eines \LaTeX-Dokumentes, mit denen globale Einstellungen wie die Dokumentklasse, die Zeichenkodierung, die Sprache und das Seitenformat festgelegt werden.
Die \emph{Dokumentumgebung} hingegen enthält den Inhalt, der später in der fertigen \acro{PDF}-Datei erscheinen soll.
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}{Beispielhafter Aufbau eines einfachen \LaTeX-Dokuments mit Präambel und Dokumentumgebung}
\Example{lst:latex-document-basic-structure}{basic-document-structure/hello-world}{basic-document-structure/hello-world_crop}{Exemplary structure of a simple \LaTeX{} document with preamble and document environment}
\section{Präambel}
Beginnen wir mit der Präambel.
Eine minimale Präambel sollte die folgenden Festlegungen treffen:
\section{Preamble}
Let's take a closer look at the preamble.
A minimal preamble should contain the following specifications:
\subsection{Dokumentklasse}\label{sec:document-class}
\mintinline{latex}|\documentclass[<parameter>]{<dokumentklasse>}|
definiert die Dokumentklasse.
Die verbreitetsten von \LaTeX\ standardmäßig unterstützten Dokumentklassen sind \mintinline{latex}{article} für kurze und \mintinline{latex}{report} für längere Dokumente, \mintinline{latex}{book} für Bücher, \mintinline{latex}{beamer}\footnote{Präsentationen in \LaTeX\ sind ein Thema für sich, auf das wir nicht näher eingehen. Bei Interesse sei diese Einführung von Overleaf empfohlen: \url{https://www.overleaf.com/learn/latex/Beamer}} für Präsentationen sowie \mintinline{latex}{letter}\footnote{Auch auf Briefe wird in diesem Skript nicht weiter eingegangen. WikiBooks gibt eine Einführung: \url{https://en.wikibooks.org/wiki/LaTeX/Letters}} für Briefe.
\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.
Parallel zu den Standard-Dokumentklassen entwickelten sich die \acro{KOMA}-Script-Klassen.\footnote{Einen umfassenden Überblick über die Möglichkeiten von \acro{KOMA}-Script gibt folgendes Handbuch: \url{https://komascript.de/~mkohm/scrguide.pdf}}
Als Alternative zum \mintinline{latex}{article} steht \mintinline{latex}{scrartcl} bereit, \mintinline{latex}{report} wird durch \mintinline{latex}{scrreport} ersetzt, \mintinline{latex}{scrbook} kann anstelle von \mintinline{latex}{book} verwendet werden und \mintinline{latex}{scrlttr2} ist als Ersatz für \mintinline{latex}{letter} entstanden.
Eine vollständige Liste aller möglichen \acro{KOMA}-Script-Dokumentklassen ist online\footnote{Erreichbar unter \url{https://komascript.de/komascriptbestandteile}} verfügbar.
Die \acro{KOMA}-Klassen ändern das Layout des fertigen \acro {PDF}-Dokuments und bringen zusätzliche Funktionalitäten mit.
Während die Standard-Klassen für den Gebrauch in Amerika gedacht sind, folgen \acro{KOMA}-Klassen europäischen Normen, etwa bei Brief"|formaten.
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.
Dem \mintinline{latex}{\documentclass}-Befehl können verschiedene optionale Parameter übergeben werden.
\mintinline{latex}{\documentclass[10pt,a5paper,landscape]{scrartcl}} etwa konfiguriert einen \acro{KOMA}-Script-Artikel mit Schriftgröße 10\,pt\footnote{Die Standardschriftgröße wäre hier 12\,pt.} auf A5-Papier\footnote{In der Voreinstellung handelte es sich um A4-Papier.} im Querformat.
Auch die Sprache kann mit übergeben werden (vgl. dazu \cref{sec:language}).
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{Exkurs: Pakete}
\subsection{Digression: packages}
\label{sec:packages}
\begin{minted}{latex}
\usepackage[<optionen>]{<paketname>}
\end{minted}
Pakete sind \LaTeX-Erweiterungen, die zusätzliche Befehle und Funktionalitäten zur Verfügung stellen.
Es existieren verschiedene Pakete für verschiedene Anwendungsfälle (z.\,B. Formelsatz, Listen, \textellipsis).
Bevor sie verwendet werden können, müssen sie in der Präambel eingebunden werden.
Hierfür wird der obige Befehl verwendet.
Die wichtigsten \LaTeX-Pakete sind im Comprehensive \TeX\ Archive Network,\footnote{Erreichbar unter \url{https://www.ctan.org/}} kurz \acro{CTAN}, abgelegt.
Hier finden sich auch Dokumentationen zu den einzelnen Funktionalitäten.
\subsection{Kodierung}
\begin{minted}{latex}
\usepackage[utf8]{inputenc}
\usepackage[t1]{fontenc}
\end{minted}
Pakete werden zum Beispiel zur Auswahl der Zeichenkodierung benötigt.
Die Zeichenkodierung\footnote{Vgl. \url{https://de.wikipedia.org/wiki/Zeichenkodierung}} entscheidet darüber, welcher Zeichensatz zur Verfügung steht.
Der Standardzeichensatz in \LaTeX\ ist \acro{ASCII}.\footnote{Vgl. \url{https://de.wikipedia.org/wiki/American_Standard_Code_for_Information_Interchange}}
Dieser amerikanische Standard enthält beispielsweise keine Umlaute und ist daher für die meisten Einsätze wenig geeignet.
Als universelle Zeichenkodierung kann \acro{UTF-8}\footnote{Vgl. \url{https://de.wikipedia.org/wiki/UTF-8}} verwendet werden.
\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.
In \LaTeX-Dokumenten sind zwei verschiedene Zeichenkodierungen von Belang.
Das Input Encoding (kurz: \mintinline{latex}{inputenc}) bezieht sich auf den Quelltext, den wir eingeben, während das Font Encoding (kurz: \mintinline{latex}{fontenc}) das fertige \acro{PDF}-Dokument beeinflusst.
Konkret beeinflusst \mintinline{latex}{fontenc} die Wahl der Schriftartdatei, die verwendet wird, um den Inhalt des Dokuments darzustellen, denn auch diese muss natürlich Sonderzeichen beinhalten.\footnote{Details zur Arbeitsweise von \mintinline{latex}{fontenc} gibt dieser Beitrag: \url{https://www.texwelt.de/fragen/5537/was-macht-eigentlich-usepackaget1fontenc}}
\mintinline{latex}{T1} ist eine Kodierung, die mit einer begrenzten Anzahl an Zeichen europäische Sprachen abzubilden versucht.
\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.
\subsection{Sprache}\label{sec:language}
\begin{minted}{latex}
\usepackage[ngerman]{babel}
\end{minted}
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.
Das Paket \mintinline{latex}{babel} stellt sprachspezifische Informationen (z.\,B. Silbentrennung, Sonderzeichen, Wechsel zwischen Fonts, Übersetzung von Labels\footnote{Vgl. \cref{sec:references}} wie \enquote{Kapitel}, \enquote{Inhaltsverzeichnis} oder \enquote{Abbildung}) bereit.
Als optionaler Parameter kann die Sprache übergeben werden.
\mintinline{latex}{ngerman} steht hierbei für die Neue Deutsche Rechtschreibung.
Manche Pakete erfordern es, dass die Sprachangabe schon als optionaler Parameter dem \mintinline{latex}{\documentclass}-Befehl\footnote{Vgl. \cref{sec:document-class}} übergeben wird.
In diesem Fall wird der optionale Parameter beim Einbinden von \mintinline{latex}{babel} einfach weggelassen.
\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.
In einem Dokument können auch mehrere Sprachen verwendet werden.
Sie können einfach kommagetrennt als optionale Parameter aufgelistet werden.
Im Dokument kann mit dem Befehl \mintinline{latex}{\selectlanguage{<sprache>}} zwischen den Sprachen umgeschaltet werden.
Fremdsprachiger Text lässt sich alternativ auch über folgenden Befehl einbinden:
\begin{minted}{latex}
\foreignlanguage{<sprache>}{<text>}
\end{minted}
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:
\section{Dokumentumgebung}
\codeblock{latex}{listings/basic-document-structure/foreign-language.tex}
Zwischen \mintinline{latex}{\begin{document}} und \mintinline{latex}{\end{document}} gehören die Inhalte, die tatsächlich im Dokument erscheinen sollen.
\section{Document environment}
The actual content of the \acro{PDF} document needs to be put inside of an environment starting with \code{latex}{\textbackslash begin\{document\}} and ending with \code{latex}{\textbackslash end\{document\}}.
\subsection{Fließtext}
Der einfachste Inhalt der Dokumentumgebung ist Fließtext.
Er kann direkt in den Quelltext geschrieben werden.
Zeilenumbrüche und zu mehreren auftretende Leerzeichen werden dabei ignoriert.
Leerzeilen erzeugen einen neuen Absatz, der standardmäßig mit einem Einzug beginnt.\footnote{Der Befehl \mintinline{latex}{\noindent} verhindert dies.}
Manuelle Umbrüche können mit zwei Backslashes (\enquote{\textbackslash\textbackslash}) erzwungen werden.
Dies sollte jedoch vermieden werden.
\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{Kommentare}
Einige Zeichen sind für besondere Funktionen reserviert.
So bewirkt ein Prozent-Zeichen beispielsweise, dass der Rest einer Zeile vom Compiler ignoriert wird.
Der Text erscheint also nicht im fertigen \acro{PDF}-Dokument.
Dies kann nützlich sein, um während der Bearbeitung Notizen festzuhalten, ohne Einfluss auf das fertige Dokument zu nehmen.
Wir sprechen hier von einem Kommentar.
\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.
Falls tatsächlich ein Prozentzeichen erscheinen soll, könnt ihr dies durch einen Backslash erreichen: \mintinline{latex}{\%}.
Diese Lösung, die auch als Escaping bezeichnet wird, funktioniert auch für die Zeichen \#, \$, \&, \_, \{ und \}.
Für den Backslash muss der Befehl \mintinline{latex}{\textbackslash} verwendet werden.\footnote{Eine Übersicht weiterer Sonderzeichen ist im zugehörigen \cref{sec:special-characters} zu finden.}
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{Abschnitte und Kapitel}
Texte werden durch Überschriften in Abschnitte und Kapitel unterteilt.
Immer nutzbar sind die in \cref{lst:headlines} dargestellten Befehle.
\Example{lst:headlines}{basic-document-structure/headlines}{basic-document-structure/headlines_crop}{Überschriftenebenen}
Je nach Dokumentklasse sind außerdem \mintinline{latex}{\chapter{Kapitel}} und \mintinline{latex}{\part{Teil}} verfügbar -- beispielsweise in Büchern.
Mit Sternchen fallen bei allen diesen Befehlen die Nummerierung und der Eintrag im Inhaltsverzeichnis\footnote{Vgl. \cref{sec:table-of-contents}} weg:
\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.
\begin{minted}{latex}
\section*{Kommt nicht im Inhaltsverzeichnis vor}
\end{minted}
\Example{lst:headlines}{basic-document-structure/headlines}{basic-document-structure/headlines_crop}{Heading Levels}
Ein alternativer Titel im Inhaltsverzeichnis kann als optionaler Parameter in eckigen Klammern zwischen dem Befehl und dem eigentlichen Titel angegeben werden.
Some document classes provide additional commands. In a \pkg{report}, you get \code{late}{\textbackslash chapter\{Chapter\}}, and in a \pkg{book}, additionally \code{latex}{\textbackslash part\{Part\}}.
You can mark the command with an asterisk if you want to omit the numbering of a section and exclude it from the table of contents:\footnote{cf. \cref{sec:table-of-contents}}
\begin{minted}{latex}
\section[Titel im Verzeichnis]{Kapitelüberschrift}
\end{minted}
\codeblock{latex}{listings/basic-document-structure/section.tex}
\subsection{Titelei}
Ein einfacher Titel lässt sich im Dokument mit dem Befehl \mintinline{latex}{\maketitle} erzeugen.
Die Werte für die Einträge müssen in der Präambel festgelegt werden.
Mehrere Autoren werden dabei mit \mintinline{latex}{\and} verbunden.
Fehlt der Befehl \mintinline{latex}{\date}, wird per default das aktuelle Datum gesetzt.
Die genaue Gestaltung hängt von der verwendeten Dokumentklasse ab.
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:
\Example{lst:titles}{basic-document-structure/titles}{basic-document-structure/titles_crop}{Die Titelei}
\codeblock{latex}{listings/basic-document-structure/title-in-toc.tex}
\subsection{Verzeichnisse}\label{sec:table-of-contents}
\subsection{Front matter}
A simple front matter can be created by using the command \code{latex}{\textbackslash maketitle}.
The values to be inserted into the front matter must be specified within the preamble.
Multiple authors are joined by \code{latex}{\textbackslash and}.
If the date is not specified by the \code{latex}{\textbackslash date} command, the current date will be inserted by default.
The design of the front matter depends on the specified document class.
Aus allen mit den oben genannten Befehlen eingefügten Abschnitten fügt der Befehl \mintinline{latex}{\tableofcontents} ein automatisch nummeriertes Inhaltsverzeichnis zusammen (wie zum Beispiel in \cref{lst:main-file} auf \cpageref{lst:main-file} zu sehen).
Die Aufzählungszeichen, die Tiefe der Aufzählung und viele weitere Gestaltungselemente sind frei anpassbar.\footnote{Ein empfehlenswerter Blogpost hierzu ist unter \url{https://texblog.org/2011/09/09/10-ways-to-customize-tocloflot/} verfügbar.}
Damit \LaTeX\ das Inhaltsverzeichnis vollständig baut, muss das Projekt zweimal kompiliert werden.
\Example{lst:titles}{basic-document-structure/titles}{basic-document-structure/titles_crop}{The front matter}
Neben dem Inhaltsverzeichnis stehen auch eine \mintinline{latex}{\listoffigures} (Abbildungsverzeichnis) und eine \mintinline{latex}{\listoftables} (Tabellenverzeichnis) zur Verfügung.
Aufgeführt werden jeweils die Bild- oder Tabellenunterschriften.\footnote{Siehe hierzu \cref{sec:graphics} (Grafiken) und \cref{sec:tables} (Tabellen).}
\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}

View File

@ -1,72 +1,102 @@
\chapter{Wie funktioniert \LaTeX?}
\chapter{How does \LaTeX{} work?}
\label{sec:basic-functionality}
Programme zur Textverarbeitung und Dokumentenerstellung nutzen unterschiedliche Vorgehensweisen, um basierend auf einer bearbeiteten Datei ein Dokument zu erstellen.
Wer mit Microsoft Word vertraut ist, dem ist bekannt, dass das von der Export-Funktion erstellte Dokument (häufig einfach als \acro{PDF}-Dokument bezeichnet) genau so aussieht, wie Word das bearbeitete Dokument darstellt.
Wird ein Bild in der Ausgangsdatei verschoben, erscheint es in dem exportierten Dokument an der neuen Position.
Diese Art der Formatierung wird \emph{What you see is what you get} genannt (kurz: \acro{WYSIWYG}).
Eine Formatierung in Word (und zahlreichen alternativen Office-Programmen wie Libre Office) führt zu unmittelbarer optischer Rückmeldung, wie das finale Dokument aussehen wird.
Inhalt und Struktur sind eng miteinander verbunden.
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{} arbeitet hingegen nach dem Prinzip \emph{What you get is what you mean} (kurz: \acro{WYGIWYM}).
Inhalt und Struktur sind stärker getrennt.
Der Inhalt wird in einem Dokument in einfacher Textform platziert, zusammen mit bestimmten Befehlen (kombiniert: der Quelltext).
Bei Erstellung des Ausgabedokuments (ebenfalls ein \acro{PDF}-Dokument) werden die Befehle von einem Programm namens Compiler verarbeitet.
\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.
Der Compiler nimmt den Quelltext entgegen und liest ihn Zeile für Zeile.
Trifft er auf einen Befehl (eine bestimmte Zeichenkette, vgl. \cref{subsec:command-structure}), interpretiert er diesen und sorgt etwa für die richtige Darstellung des mit dem Befehl markierten Textes im Ausgabedokument.\footnote{Es sei an dieser Stelle bereits angemerkt, dass Befehle nicht nur genutzt werden, um einzelne Textpassagen, überschriften und so weiter auszuzeichnen. Im Laufe dieses Skriptes werden wir verschiedene Befehle kennenlernen, die ganz unterschiedliche Funktionen erfüllen.}
Hervorgehebene Zeichenketten (z.\,B. \mintinline{latex}{\emph{hervorgehobener Text}}) erscheinen dann beispielsweise kursiv im Dokument (\emph{hervorgehobener Text}), während die Zeichenkette, die den Befehl bildet (\mintinline{latex}{\emph{}}), nicht in der \acro{PDF}-Datei auftaucht.
To customize the presentation of the content, we do not set the text appearance itself but add appropriate commands instead.
These are processed by a \emph{compiler}, which adjusts the resulting appearance depending on the command.
Line by line, the compiler processes text and commands from our source code.
When all the source code has been processed by the compiler, we get the final document.
There are different export options, but most of the time we output the document as a \acro{PDF}\,---\,just like in Word.
Dieses einfache Beispiel verdeutlicht eine Stärke des \acro{WYGIWYM}-Prinzips.
Wir markieren Textelemente auf der semantischen Ebene (\enquote{Dieser Text soll hervorgehoben werden.}) und können die zugehörigen typographischen Anpassungen (\enquote{Hervorgehobener Text wird kursiv gedruckt.}) an zentraler Stelle festlegen -- oder gleich \LaTeX{} überlassen.
Das Prinzip ist ähnlich zu Formatvorlagen in Office-Programmen, wenn auch konsequenter und mächtiger.
Basierend auf dem Text, den Befehlen und den Standard-Einstellungen des Compilers entsteht so das finale Dokument.
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.
\section{Was brauchen wir dazu?}
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}
Um den Quelltext zu erstellen, auf dessen Basis der Compiler ein Dokument erstellen soll, wird ein Bearbeitungsprogramm benötigt.
Grundsätzlich ist ein einfaches Textbearbeitungsprogramm wie der Editor unter Windows oder auch Notepad++\footnote{Verfügbar unter \url{https://notepad-plus-plus.org/}.} ausreichend.
Fortgeschrittene Programme wie TeXstudio\footnote{Verfügbar unter \url{https://www.texstudio.org/}.} oder Texmaker\footnote{Verfügbar unter \url{https://www.xm1math.net/texmaker/}.} integrieren zusätzliche Funktionen, welche die Verwendung von Befehlen erleichtern.
Falls ihr aus einem anderen Kontext bereits Visual Studio Code oder Atom kennt, findet ihr auch für diese Editoren Erweiterungen, die auf die Arbeit mit \LaTeX{} zugeschnitten sind.
Zum Kompilieren des Quelltexts wird ein Compiler benötigt.
Der Compiler ist meist Teil einer Sammlung von Programmen und Paketen, die zusammen eine \LaTeX-Distribution bilden.
Die Distributionen enthalten verschiedene andere Hilfsprogramme, auf die wir für den Moment nicht näher eingehen.\footnote{Eines dieser Hilfsprogramme kommt später im Kapitel \ref{sec:literature} zum Einsatz, wenn wir Literatur referenzieren.}
Die ebenfalls enthaltenen Pakete\footnote{Die ganz Eiligen finden in \cref{subsubsec:packages} mehr Informationen.} stellen verschiedene Befehle zur Verfügung.
Manche Distributionen gibt es als normale und als vollständige Variante zum Download.
Die vollständige Variante enthält alle Pakete (und ist entsprechend wesentlich größer), während in der normalen Version Pakete erst dann heruntergeladen werden, wenn sie benötigt werden.
Die Entscheidung, ob ihr lieber zu Beginn oder später während des Arbeitens auf den Download wartet, können wir euch leider nicht abnehmen.
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.
Bekannte Distributionen sind MiK\TeX,\footnote{Für Windows, macOS und Linux. Verfügbar unter \url{https://miktex.org/}.} Mac\TeX\footnote{Für macOS und Linux. Verfügbar unter \url{https://www.tug.org/mactex/}.}, und \TeX{} Live.\footnote{Für Windows, macOS und Linux. Verfügbar unter \url{https://www.tug.org/texlive/}.}
Installiert euch am besten gleich eine davon.
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.
\section{Die Befehle}
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}
Die in Quelltext verwendeten Befehle folgen einem allgemeinen Aufbau:
\begin{minted}{xml}
\<befehl>[<optionale_parameter>]{<obligatorische_parameter>}
\end{minted}
Ein Befehl kann mehrere optionale und/oder obligatorische Parameter verwenden. Manche Befehle besitzen keine obligatorischen Parameter. Einige werden in \cref{tbl:latex-commands} dargestellt.
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
Befehl & Effekt \\
Command & Effect \\
\midrule
\mintinline{latex}{\newpage} & fügt eine neue Seite ein \\
\mintinline{latex}{\textbf{Text}} & schreibt den übergebenen Text fett \\
\mintinline{latex}{\usepackage[utf8]{inputenc}} & setzt die Textkodierung auf \acro{UTF-8} \\
\mintinline{latex}{\documentclass[a4paper,12pt]{article}} & setzt die Dokumentenklasse \\
\mintinline{latex}{\frac{3}{4}} & fügt den mathematischen Bruch ein \\
\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{Beispiele für \LaTeX-Befehle}
\caption{Examples for \LaTeX-commands}
\label{tbl:latex-commands}
\end{table}
Sollte ein Befehl mehrere optionale Parameter erlauben, welche gleiche Eingaben akzeptieren, muss angegeben werden, welcher Parameter gemeint ist. Beispielsweise akzeptiert der Befehl für das Einbinden von Grafiken optionale Parameter für Breite und Höhe. Bei einer Eingabe von \mintinline{tex}|[12cm, 4cm]| wäre unklar, welcher Wert für welchen Parameter bestimmt ist. Um die Zuweisung zu konkretisieren, können die Parameter explizit angegeben werden:
\begin{minted}{tex}
\includegraphics[width=12cm, height=4cm]{bild.png}
\end{minted}
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 dont have to learn every single command by heart: As soon as you remember the most important commands, you can easily create simple documents and look up everything else.

View File

@ -1,44 +0,0 @@
\chapter*{Erste Schritte mit \LaTeX}
\addcontentsline{toc}{section}{Erste Schritte mit \LaTeX}
Dieses Skript dient als kurze Referenz zum Umgang mit LateX und als Übungsbeispiel für das LaTeX-Tutorium der Fachschaft WIAI.
Viele Aufgaben erfordern es, das Skript selbst anzupassen.
Das dafür benötigte Projektarchiv mit allen Quelltextdateien sowie die aktuellste Version dieses Skriptes sind auf Github\footnote{\url{https://github.com/fs-wiai/latex-script/releases}} zu finden.
Bevor wir ins Arbeiten mit \LaTeX{} einsteigen können, müssen wir es natürlich zunächst installieren.
Außerdem müssen wir einige Anpassungen vornehmen, um mit diesem Projekt arbeiten zu können.
Alle Schritte erläutern wir in den folgenden Kapiteln näher.
Nach und nach werdet ihr so ein Verständnis der Arbeitsweise mit \LaTeX{} aufbauen.
Für den Anfang folgt einfach der Anleitung.
Achtet bitte darauf, dass ihr \emph{zuerst} den Compiler und \emph{danach} einen Editor installiert.
\section*{Compiler}
Zunächst zum Compiler. Ihn brauchen wir, um den Quelltext, den wir schreiben, in ein \acro{PDF} umzuwandeln. Hier gibt es für verschiedene Betriebssysteme unterschiedliche Compiler, wie etwa MikTeX für Windows,\footnote{\url{https://miktex.org/download}} MacTex für MacOS\footnote{\url{http://tug.org/mactex/}} und TeXLive für Linux-Distributionen.\footnote{Sofern ihr eine debianbasierte Linux-Distribution verwendet, kann der Compiler mittels \mintinline{bash}{sudo apt install texlive-full} installiert werden. Für andere Distributionen findet ihr eine Anleitung unter \url{https://tug.org/texlive/doc/texlive-en/texlive-en.html\#installation}.} Bestenfalls installiert ihr die volle Version mit allen Paketen.
\section*{Editor}
Sobald ihr das gemacht habt, könnt ihr euch auch schon einen Editor
herunterladen, in dem ihr eure \LaTeX-Dokumente gerne schreiben möchtet. Dafür
ist eigentlich jeder Editor geeignet (notepad++, Atom, VS Code, usw.). Wir
empfehlen für Anfänger jedoch ein Programm, das \LaTeX-spezfische Funktionen
besitzt, wie etwa TeXstudio.\footnote{Eine aktuelle Version findet ihr unter
\url{https://www.texstudio.org/}.}
\section*{Compilerbefehl ändern}
Damit es beim Kompilieren dieses Dokuments nicht zu Fehlern kommt, müsst ihr
nun den Compilerbefehl ändern. Klickt dazu in TeXstudio zunächst auf die
Schaltfläche \emph{Optionen} und anschließend auf \emph{TeXstudio
konfigurieren \textellipsis}. Danach wird sich ein neues Fenster öffnen. Dort navigiert
ihr zum Bereich \emph{Befehle} und setzt bei \emph{PdfLaTeX} das Flag
\mintinline{bash}{--shell-escape}. In anderen Worten: Der Text bei
\emph{PdfLaTeX} sollte folgendermaßen lauten:
\mint{bash}{pdflatex -synctex=1 -interaction=nonstopmode --shell-escape
%.tex}.
\section*{Das erste Mal kompilieren}
Öffnet nun die Datei \mintinline{bash}{main.tex} im Wurzelverzeichnis des
Projektes und kompiliert sie durch Druck auf \faForward.
In dem Ordner, in dem die Datei liegt, sollten verschiedene neue Dateien erschienen sein.
Die Datei \mintinline{bash}{main.pdf} enthält das kompilierte Dokument.
Außerdem sind einige Hilfsdateien aufgetaucht, die der Compiler zum Beispiel nutzt, um das Inhaltsverzeichnis zu generieren.
Damit seid ihr startklar!

View File

@ -1,15 +1,78 @@
\chapter{Fußnoten}
\label{sec:footnotes}
\chapter{References and footnotes}
\section{Footnotes}\label{sec:footnotes}
Für Fußnoten gibt es den Befehl \mintinline{latex}{\footnote{text}}, der an der Stelle des Aufrufs automatisch die richtige Ziffer einfügt und den übergebenen Text in der Fußzeile erscheinen lässt.
In Kombination mit dem Paket \mintinline{latex}{hyperref} sind die Fußnoten sowie URLs\footnote{Sofern sie über den Befehl \mintinline{latex}{\url{}} gesetzt wurden.} zudem anklickbar.
Beispiele findet ihr im gesamten Dokument.
Das Paket \mintinline{latex}{footmisc} stellt verschiedene weitere Optionen für die Darstellung von Fußnoten zur Verfügung, die als optionale Parameter an den Befehl \mintinline{latex}{\usepackage} übergeben werden können:
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 \mintinline{latex}{\usepackage[perpage]{footmisc}} sorgt dafür, dass die Zählung der Fußnoten auf jeder Seite neu beginnt.
\item \mintinline{latex}{\usepackage[para]{footmisc}} lässt die Fußnoten in der Fußzeile als Fließtext (gegebenenfalls auch nebeneinander) erscheinen.
\item \mintinline{latex}{\usepackage[symbol]{footmisc}} bewirkt eine Nummerierung mit Symbolen (z.\,B. \textdagger, \textdaggerdbl) statt Ziffern.
\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{cleverref}.\footnote{with only one
\enquote{r}!}
It provides us with the command \code{latex}{\textbackslash cref\{<label>\}},
which can also handle multiple labels separated by commas.
This automatically generates elegant references like \enquote{sections 1 to 3,
and 5.}\footnote{for the source code \code{latex}{\textbackslash
cref\{sec:section1,sec:section2,
sec:section3,sec:section5\}}}
Furthermore, \code{latex}{\textbackslash ref\{<label>\}} automatically inserts
a suited abbreviation, e.\,g., \enquote{fig.} for figures.
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}

View File

@ -1,29 +0,0 @@
\chapter{Absatzformatierung} % (fold)
\label{sec:formatting-paragraphs}
\section*{Flattersatz}
\label{sec:ragged-alignment}
Standardmäßig setzt \LaTeX{} Fließtext im Blocksatz.
Flattersatz\footnote{Bekannt als links, rechts oder zentriert ausgerichteter Text in Programmen wie Word.} ist aber auch möglich.
Die Befehle \mintinline{tex}|\raggedright|, \mintinline{tex}|\raggedleft| und \mintinline{tex}|\centering| können dazu verwendet werden.
Diese Befehle beeinflussen die Umgebung, in der sie verwendet werden.
Dies kann zum Beispiel die \texttt{document}-Umgebung sein, dementsprechend würde sämtlicher Text des Dokuments beeinflusst werden.
Alternativ existieren Umgebungen, welche die Absatzformatierung beeinflussen (\cref{lst:ragged-alignment}).
\example{lst:ragged-alignment}{formatting-paragraphs/ragged-alignment}{Flattersatz}
\section*{Einzüge und Abstände}
\label{sec:indents-and-parskips}
Absätze werden standardmäßig durch Einzüge in der ersten Zeile des Absatzes verdeutlicht (\mintinline{tex}{\parindent}).
Stattdessen können auch vertikale Abstände zwischen den Absätzen verwendet werden (\mintinline{tex}{\parskip}).
Für beide Varianten gibt es einstellbare Parameter:
\begin{minted}{tex}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1em
plus .5em % erlaubte Dehnung
minus .5em % erlaubte Stauchung
}
\end{minted}
Mit dem Befehl \mintinline{tex}{\noindent} kann für nur einen Absatz der Einzug abgeschaltet werden.
Für den ersten Absatz nach einer Überschrift wird standardmäßig automatisch kein Einzug eingefügt.

View File

@ -1,63 +1,52 @@
\chapter{Grafiken}
\chapter{Graphics}
\label{sec:graphics}
Aufgrund der Natur von \LaTeX{} (What you get is what you mean, vgl. \cref{sec:basic-functionality}) stellt die Einbindung von Grafiken in ein Dokument eine interessante Aufgabe dar. Mit textuellen Befehlen zum dargestellten Bild \todo{Irgendwas fehlt da} -- wie üblich kommen bestimmte Befehle und Pakete zum Einsatz. In diesem Abschnitt werden diese Bestandteile näher erläutert.
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{Grafiken abbilden}
\section{Inserting graphics}
\label{sec:display-graphics}
Um Grafiken darzustellen, muss das Paket \texttt{graphicx} eingebunden werden. Zum Einfügen können dann folgende Befehle verwendet werden:
In order to be able to reference graphics, the package \texttt{graphicx} has to be included. For inserting a figure, we can use the following commands:
\begin{minted}[tabsize=4]{latex}
\begin{figure}
\includegraphics{<dateipfad>}
\caption[<kurztitel>]{<bildunterschrift>}
\end{figure}
\end{minted}
\codeblock{latex}{listings/graphics/insert-graphics.tex}
\noindent Soll die Bildgröße angepasst werden, kann der \texttt{includegraphics}-Befehl abgeändert werden.
Die erwünschte Höhe und Breite können hier separat angegeben werden, etwa wie folgt:
\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:
\begin{minted}{latex}
\includegraphics[width=0.5\textwidth,height=5cm]{<dateipfad>}
\end{minted}
\codeblock{latex}{listings/graphics/image-size.tex}
\section{Platzierung}
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}
Ein interessanter Aspekt des What-you-get-is-what-you-mean-Paradigmas ist die Art und Weise, wie Grafiken positioniert werden können.
Standardmäßig erfolgt eine automatische Platzierung an einer vom Compiler berechneten, potenziell optimalen Stelle.
Dabei werden verschiedene Layouts erstellt und danach bewertet, wie ansprechend das Ergebnis ist.
Durch das Verschieben von Grafiken können typografische Schönheitsfehler wie Schusterjungen und Hurenkinder\footnote{Die erste (letzte) Zeile eines Absatzes steht allein als letzte (erste) Zeile auf der vorherigen (nächsten) Seite, vgl. \url{https://de.wikipedia.org/wiki/Hurenkind_und_Schusterjunge}.} weitestgehend vermieden werden.
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.
Dies bedeutet aber auch, dass eine Grafik nicht notwendigerweise zwischen den zwei Textblöcken wie im Quelltext erscheint, sondern an anderer Stelle.
Um im Text einen klaren Bezug zu einer gegebenenfalls anderswo platzierten Grafik herzustellen, können wir Labels verwenden, die wir in \cref{sec:references} erklären.
Wir können diese Verschiebungen außerdem durch Hinzufügen eines optionalen Parameters zur \mintinline{latex}{figure}-Umgebung mehr oder minder rigoros begrenzen.
Die verfügbaren Positionskürzel werden in \cref{tbl:placement-abbreviations} aufgelistet.
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!]
\center
\centering
\begin{tabular}{cl}
\toprule
Kürzel & Position \\
Shortcut & Position \\
\midrule
h & möglichst hier, wenn es gefällt \\
t & oberer Seitenrand \emph{(top)} \\
b & unterer Seitenrand \emph{(bottom)} \\
p & auf einer eigenen Seite \emph{(page)} \\
H & Definitiv an dieser Stelle! (benötigt Paket \texttt{float}) \\
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{Kürzel zur Platzierung von Abbildungen}
\caption{Shortcuts for positioning graphics}
\label{tbl:placement-abbreviations}
\end{table}
\begin{minted}[tabsize=4]{latex}
\begin{figure}[<positionskürzel>]
\centering
\includegraphics{<dateipfad>}
\end{figure}
\end{minted}
\codeblock{latex}{listings/graphics/positioning.tex}
Neben der vertikalen Positionierung spielt gegebenenfalls auch die horizontale Ausrichtung eine Rolle.
Standardmäßig sind Grafiken linksbündig orientiert.
Der Befehl \mintinline{latex}{\centering} zentriert alle folgenden Objekte bis zum Ende der aktuellen Umgebung.
Soll sich die Zentrierung nur auf ein Objekt beziehen, kann dieses stattdessen mit \mintinline{latex}{\begin{center}} und \mintinline{latex}{\end{center}} umschlossen werden.
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\}}.

View File

@ -1,22 +1,23 @@
\chapter{Aufzählungen}
\chapter{Lists}
\label{sec:lists}
Von Haus aus unterstützt \LaTeX\ drei Aufzählungstypen: ungeordnete und geordnete Listen sowie Definitionslisten.
Zu jedem dieser Typen existieren eigene Umgebungen, die aber grundsätzlich gleich aufgebaut sind.
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}{Beispielhafte ungeordnete Aufzählung}
\example{lst:unordered-list}{lists/nested-list}{Examplary unordered list}
In \cref{lst:unordered-list-code} werden verschiedene Listenelemente (\mintinline{latex}{\item}) von einer \mintinline{latex}{itemize}-Umgebung eingerahmt.
Innerhalb eines Listenelements kann eine neue Listen\-umgebung eröffnet werden, um eine verschachtelte Liste zu erhalten.
Ersetzt man \mintinline{latex}{itemize} durch \mintinline{latex}{enumerate}, erhält man bei sonst gleichem Quelltext eine geordnete Liste.
Für etwas weniger gebräuchliche Definitionslisten muss die Umgebung \mintinline{latex}{description} verwendet werden.
Außerdem erhalten die Elemente in eckigen Klammern den zu definierenden Begriff (\cref{lst:definition-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:definition-list}{lists/definition-list}{lists/definition-list_crop}{Beispielhafte Definitionsliste}
\Example{lst:description-list}{lists/description-list}{lists/description-list_crop}{Exemplary description list}
Die sehr großen Abstände zwischen einzelnen Listenelementen können durch das Paket \mintinline{latex}{paralist}\footnote{\url{https://www.ctan.org/pkg/paralist}} verringert werden.
Hierzu wird nur der Umgebungsname ersetzt: \mintinline{latex}{compactitem} statt \mintinline{latex}{itemize}, \mintinline{latex}{compactenum} statt \mintinline{latex}{enumerate} und \mintinline{latex}{compactdesc} statt \mintinline{latex}{description}.
Soll die Aufzählung im Fließtext erscheinen, bringt \mintinline{latex}{paralist} dafür die Umgebungen \mintinline{latex}{inparaenum} und \mintinline{latex}{inparaitem} mit.
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}.
Um das Aufzählungszeichen oder die Nummerierung anzupassen, kann das Paket \mintinline{latex}{enumitem}\footnote{\url{https://www.ctan.org/pkg/enumitem}} verwendet werden.
\mintinline{latex}{\begin{enumerate}[label=\roman*]} erzeugt eine Liste mit römischen Zahlen. Für alphabetische Nummerierung sorgt der Parameter \mintinline{latex}{[label=\alph*]}.
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.

View File

@ -1,74 +1,69 @@
\chapter{Literaturverwaltung}
\chapter{Reference management}
\label{sec:literature}
Um die ersten Studien- oder Abschlussarbeiten in \LaTeX\ zu setzen, fehlt uns jetzt nur noch eine Möglichkeit, Literatur zu referenzieren.
Unsere Literatursammlung liegt in der sogenannten .bib-Datei.
Wenn wir aus unserem \LaTeX-Dokument darauf verweisen, kann uns das Programm Bib\TeX{} (ähnlich zum Compiler \acro{PDF}\LaTeX) an der richtigen Stelle die richtigen Zitationen in einem vorher festgelegten Bibliografiestil einfügen.
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{Die Bibliografie-Datei}
In der .bib-Datei sammeln wir unsere Literatureinträge in einem Format, das durch Bib\TeX{} verarbeitbar ist.
Einen beispielhaften Eintrag aus einer .bib-Datei zeigt \cref{lst:bibfile-sample-entry}.
\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]
\begin{minted}[autogobble]{latex}
@article{turing1990, % Dokumentenart und Bezeichner für den \cite-Befehl
title={The chemical basis of morphogenesis}, % Titel
author={Turing, Alan Mathison}, % Autor
journal={Bulletin of mathematical biology}, % Titel des Journals
volume={52}, % Band des Journals
pages={153--197}, % Seitenzahl im Journal
year={1990}, % Erscheinungsjahr
publisher={Springer} % Verleger des Journals
}
\end{minted}
\caption{Beispielhafter Eintrag einer .bib-Datei}
\codeblock{bibtex}{listings/literature/bibliography-entry.bib}
\caption{Exemplary bibliography entry}
\label{lst:bibfile-sample-entry}
\end{figure}
Nach einem \texttt{@}-Zeichen wird die Art des Literaturverzeichniseintrags angegeben (z.\,B. article, book, proceedings).
Es folgt eine Auflistung wichtiger Attribute wie Titel, Autor:in und abhängig vom Eintragstyp weiterer Felder.
Der erste Eintrag nach der öffnenden geschwungenen Klammer ist der wichtigste:
Unter diesem Kürzel wird der Eintrag später in \LaTeX{} angesprochen.
Diese sogenannten Bib\TeX-Keys müssen eindeutig sein und können frei vergeben werden.
Üblich sind Kombinationen aus Autor:innen, Publikationsjahren und Themen.
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
Die .bib-Datei kann manuell zusammengetragen werden.
Viel häufiger allerdings werden dafür Programme wie JabRef,\footnote{Vgl. \url{https://www.jabref.org/}.} Zotero\footnote{Vgl. \url{https://www.zotero.org/}.} oder das weit verbreitete Citavi\footnote{Vgl. \url{https://www.citavi.com/de}.} verwendet.
Während JabRef direkt eine .bib-Datei als Datenbank verwendet, lassen sich Zotero- und Citavi-Projekte\footnote{Vgl. \url{https://www1.citavi.com/sub/manual5/de/exporting_to_bibtex.html}.} in .bib-Dateien exportieren.
\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.
.bib-Datei-Einträge werden unter anderem auch von Google Scholar zur Verfügung gestellt (vgl. \cref{fig:google-scholar-bibtex}).
Hierbei ist es wichtig, darauf zu achten, dass die Einträge einheitlich und möglichst vollständig sind.
Als hochwertige (wenn auch leider nicht vollständige) Quelle für Bib\TeX-Einträge kann die dblp Computer Science Library\footnote{Verfügbar unter \url{https://dblp.org/search}.} dienen.
\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{Bib\TeX-Einträge in Google Scholar abrufen}
\caption{Loading Bib\TeX{} entries from Google Scholar}
\label{fig:google-scholar-bibtex}
\end{figure}
\section{Zitieren}
Durch Bib\TeX{} wird \LaTeX{} um einige Befehle zum Zitieren erweitert (vgl. \cref{tbl:bibtex-commands}).
Zusätzlich benötigt wird das Paket \mintinline{sh}{natbib}.
\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
Funktion & Befehl \\ \midrule
Quelle zitieren & \mintinline{latex}{\cite{<quelle>}} \\
Seite zitieren & \mintinline{latex}{\cite[S. 15]{<quelle>}} \\
Weitere Zusätze zitieren & \mintinline{latex}{\cite[<präfix>][<suffix>]{<quelle>}} \\
.bib-Datei einbinden & \mintinline{latex}{\bibliography{<.bib-datei>}} \\
Zitierstil ändern & \mintinline{latex}{\bibliographystyle{<zitierstil>}} \\ \bottomrule
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{Befehle zum Zitieren von Literatur}
\caption{Commands for citations}
\label{tbl:bibtex-commands}
\end{table}
Als \mintinline{latex}{<quelle>} einer Zitation wird immer der Bib\TeX-Key angegeben.
Verfügbare Zitierstile\footnote{Eine vollständigere Liste ist bei Overleaf zu finden: \url{https://www.overleaf.com/learn/latex/Biblatex_citation_styles}} sind zum Beispiel alpha, natdin und apa.
Das Literaturverzeichnis erscheint immer an der Stelle, an der der Befehl \mintinline{latex}{\bibliography{}} aufgerufen wurde.
Zum Befehl \mintinline{latex}{\cite} existieren zahlreiche weitere Varianten.\footnote{Vgl. \url{https://www.economics.utoronto.ca/osborne/latex/BIBTEX.HTM.}}
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}{Beispiel für Zitationen im Stil \mintinline{latex}{natdin}.}
\Example{lst:natdin-example}{literature/natdin-example}{literature/natdin-example_bib}{Exemplary citations in the \mono{natdin} style.}

View File

@ -1,30 +1,33 @@
\chapter{Mathematische Formeln}
\chapter{Mathematical formulas}
\label{sec:maths}
Mathematische Formeln können nur im sogenannten Mathmode gesetzt werden, der innerhalb einer Zeile (auch als inline bekannt) durch zwei Dollarzeichen aktiviert wird.
Außerdem gibt es eine Blockumgebung (vgl. \cref{lst:sample-math-environment}).
Wichtige Pakete für mathematische Zeichen sind \mintinline{latex}{amsmath}, \mintinline{latex}{amsthm} und \mintinline{latex}{amssymb} der American Mathematical Society sowie \mintinline{latex}{mathtools}.
Wie bei allen Umgebungen kann durch Angabe eines Asterisks (\textasteriskcentered) die Nummerierung der Gleichungen ausgeschaltet werden.
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}{Beispielhafte Matheumgebungen}
\example{lst:sample-math-environment}{maths/sample-math-environment}{Exemplary math environments}
\section{Einige Beispiele}
\section{A few examples}
%Die \cref{tbl:maths-common-commands,tbl:maths-logic-sets-braces} listen einige häufig in Formeln verwendeten Befehle auf.
\begin{table}[H]
\centering
\begin{tabular}{ll}
\toprule
Quelltext & Ergebnis \\ \midrule
\mintinline{latex}{\sqrt{16}} & $\sqrt{16}$ \\
\mintinline{latex}{\frac{3}{4}} & $\frac{3}{4}$ \\
\mintinline{latex}{e^{\pi}} & $e^{\pi}$ \\
\mintinline{latex}{\sum_{i=1}\^{n}x^2} & $\sum_{i=1}^{n}x^2$ \\
\mintinline{latex}{12 \leq 4 x^2 + 13} & $12 \leq 4 x^2 + 13$ \\
\mintinline{latex}{{n \choose k}} & ${n \choose k}$ \\
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{Häufig verwendete Befehle (Wurzel, Bruch, Exponent, Summe, Vergleichszeichen, Binomialkoeffizient). Durch \mintinline{latex}{^{}} und \mintinline{latex}{_{}} werden die Inhalte in den Klammern hoch- oder tiefgestellt.}
\caption{Frequently used commands (square root, fraction, power, sum, inequation, binomial coefficient).
By \code{latex}{\textasciicircum\{\}} and \code{latex}{\_\{\}}, the content is set in super- or subscript.}
\label{tbl:maths-common-commands}
\end{table}
@ -33,47 +36,48 @@ Wie bei allen Umgebungen kann durch Angabe eines Asterisks (\textasteriskcentere
\centering
\begin{tabular}{ll}
\toprule
Quelltext & Ergebnis \\ \midrule
\mintinline{latex}{(x), [x], \lbrace x \rbrace, \lvert x \rvert} & $(x), [x], \lbrace x\rbrace, \lvert x\rvert$\\
\mintinline{latex}{\exists,\forall,\in,\notin,\infty} & $\exists,\forall,\in,\notin,\infty$ \\
\mintinline{latex}{\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi} & $\alpha, \beta, \Gamma, \Delta, \varepsilon, \pi$ \\
\mintinline{latex}{\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow} & $\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \Leftrightarrow$ \\
\mintinline{latex}{(A \cup B) \cap C} & $(A \cup B) \cap C$ \\
\mintinline{latex}{(A \lor B) \land C} & $(A \lor B) \land C$ \\
\mintinline{latex}{(A \cdot B) \times C} & $(A \cdot B) \times C$ \\ \bottomrule
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{Klammerungen, Quantoren, griechische Buchstaben, Pfeile, Operatoren}
\caption{Brackets, quantifiers, greek letters, arrows, operators}
\label{tbl:maths-logic-sets-braces}
}
\end{table}
\section{Mitwachsende Klammern}
\section{Growing brackets}
Im Zusammenspiel mit Brüchen kommt es vor, dass Klammern mit ihrem Inhalt wachsen sollen.
Hierfür muss dem Befehl zum Erzeugen der Klammern (\mintinline{latex}{(}, \mintinline{latex}{)}, \mintinline{latex}{[}, \mintinline{latex}{]}, \mintinline{latex}{\lbrace} und \mintinline{latex}{\rbrace}) jeweils ein Positionsmarker (\mintinline{latex}{\left} oder \mintinline{latex}{\right}) vorangestellt werden.
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}{Beispiel für mitwachsende Klammern}
\example{lst:growing-brackets}{maths/growing-brackets}{Example for growing brackets}
\section{Darstellung von Grenzen}
\section{Lower and upper bounds}
Mit dem Befehl \mintinline{latex}{\limits} lassen sich die Grenzen von Integralen unter und über dem Integralzeichen darstellen.
Bei Summen, Produkten und Grenzwerten geschieht das automatisch (vgl. \cref{lst:limits}).
Im Fließtext eignet sich \mintinline{latex}{\limits} nur bedingt.
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}{Grenzen von Summen, Produkten, Grenzwerten und Integralen}
\example{lst:limits}{maths/limits}{Lower and upper bounds of sums, products, limits and integrals}
\section{Ausrichtung mehrerer Gleichungen}
\section{Aligning equations}
Die Umgebung \mintinline{latex}{align} erlaubt es, Gleichungen zum Beispiel am \texttt{=}-Zeichen auszurichten (vgl. \cref{lst:math-alignment-example}).
Ausgerichtet wird dabei analog zu Tabellen am \texttt{\&}-Zeichen.
Zeilenumbrüche werden durch zwei Backslashes markiert.
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}{Am Gleichheitszeichen ausgerichtete Gleichungen}
\Example{lst:math-alignment-example}{maths/align-example}{maths/align-example_crop}{Equations aligned at equals signs}
\section{Mengenschreibweise}
\section{Text in math mode}
Manchmal ist es notwendig, im Zusammenhang mit der Mengenschreibweise Prädikate unter Verwendung von textuellen Beschreibungen oder längeren Funktionsnamen zu definieren.
Im Mathmode wird die Zeichensetzung von \LaTeX{} nicht auf Fließtext, sondern auf Formeln ausgerichtet, was zu ungünstigen Anordnungen zusammenhängender Buchstabenketten führt.
Für diesen Fall gibt es den Befehl \mintinline{latex}{\mathrm{}} (\enquote{math roman}, vgl. \cref{lst:set-builder-notation}).
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}{Probleme in der Mengenschreibweise und ihre Lösung}
\example{lst:set-builder-notation}{maths/set-builder-notation}{Problems arising from intensional set notation and their solution}

View File

@ -1,21 +1,25 @@
\chapter{Projektstruktur}
\chapter{Project structure}
\label{sec:project-structure}
In den bisherigen Kapiteln haben wir nur sehr kurze \LaTeX{}-Beispiele gesehen. Natürlich kann \LaTeX{} aber auch verwendet werden, um größere Dokumente und Projekte zu erstellen, wie etwa eine Abschlussarbeit.
Um nicht den Überblick im Quellcode zu verlieren und zu vermeiden, dass Quelldateien zu lang werden, ist eine sinnvolle Strukturierung eines größeren \LaTeX{}-Projektes ratsam. Hierfür wird der Quellcode in verschiedene Dateien aufgeteilt, welche in den folgenden Abschnitten näher beleuchtet werden.
In 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{Hauptdatei} Typischerweise wird bei größeren Projekten mit einer Hauptdatei gearbeitet, die gerne \texttt{main.tex} genannt wird. Sie ist sozusagen das Skelett des Projektes und enthält damit dessen Grundgerüst inklusive der Präambel. In dieser Hauptdatei werden Titel, Inhaltsverzeichnis sowie die einzelnen Kapitel einer Arbeit eingebunden (vgl. \cref{lst:main-file}). Die Einbindung der einzelnen Abschnitte kann entweder mittels \mintinline{latex}{\input{...}} oder \mintinline{latex}{\include{...}} erfolgen. Beide verlangen als Argument den Pfad zur Datei, die eingebunden werden soll. Auf die Unterschiede zwischen den beiden Befehlen gehen wir später noch ein (vgl. \cref{sec:input-vs-include}).
\example{lst:main-file}{project-structure/main-file}{Typische Struktur einer Hauptdatei in \LaTeX{}}
\section{Abschnittsdateien}
Abschnittsdateien sind Dateien, die innerhalb der Hauptdatei eingebunden werden. Diese können in einer Abschlussarbeit beispielsweise einzelne Kapitel sein. Grundsätzlich ist man aber ganz frei in der Entscheidung, wie granular die Aufteilung des Inhaltes in einzelne Dateien gestaltet werden soll.
Die Dateien, die durch die Hauptdatei eingebunden werden, enthalten keine Präambel, da diese ja schon in der Hauptdatei vorhanden ist. Auch die Befehle \mintinline{latex}{\begin{document}} und \mintinline{latex}{\end{document}} tauchen nicht noch mal auf.
\section{Input oder Include?}
\label{sec:input-vs-include}
Kommen wir nun zu den Unterschieden zwischen den beiden möglichen Befehlen zum Einbinden von \LaTeX-Dateien. Kurz zusammengefasst weisen \mintinline{latex}{\include} und \mintinline{latex}{\input} Unterschiede in den folgenden drei Aspekten auf: Die Art und Weise, wie der Pfad zur einzubindenden Datei angegeben wird, die Möglichkeit der Schachtelung von Einbindungen und ob für jeden Abschnitt eine neue Seite angefangen wird.
Benutzt man den Befehl \mintinline{latex}{\input}, kann die Dateiendung \texttt{.tex} angegeben werden, sie ist aber nicht zwingend notwendig. Außerdem kann man die Einbindung von Dateien schachteln: Eine Datei, die mit \mintinline{latex}{\input} eingebunden wurde, kann wiederum mit dem gleichen Befehl eine andere Datei einbinden. Die Dateien, die eingebunden wurden, werden im fertigen Dokument eingefügt, ohne dass dabei eine neue Seite für den eingebundenen Abschnitt angefangen wird (vgl. \cref{lst:main-file}).
Anders verhält sich der Befehl \mintinline{latex}{\include}: Hier wird die Dateiendung \texttt{.tex} für die eingebundenen Kapitel \emph{nicht} mit angegeben. Die Schachtelung von Einbindungen ist nicht möglich. Für jede eingebundene Datei wird außerdem eine neue Seite erzeugt.
\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.

View File

@ -1,13 +1,12 @@
\chapter{Ausblick}
\chapter{Prospects}
\label{sec:prospects}
Natürlich konnten wir euch in diesem knappen Rahmen nicht ansatzweise zeigen, was \LaTeX{} alles zu bieten hat.
In diesem letzten Abschnitt haben wir daher ein paar Informationen gesammelt, die euch dabei helfen sollen, selbständig tiefer einzusteigen.
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{Pakete}
\section{Packages}
Eine Auswahl an Paketen haben wir euch bereits vorgestellt, es gibt aber noch ein paar tausend weitere.
Für einige häufig benötigte Features haben wir euch hier eine kurze Liste passender Pakete zusammengestellt:
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{
@ -26,14 +25,14 @@ Für einige häufig benötigte Features haben wir euch hier eine kurze Liste pas
\colrules
% Left caption:
\begin{subfigure}[t]{\widefigurewidth}
\caption{Vektorgrafiken mit TikZ}
\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{Konstituentenbäume mit qtree}
\caption{Parse trees with \pkg{qtree}}
\centering\tiny{\url{https://www.ling.upenn.edu/advice/latex/qtree/}}
\label{fig:qtree-example}
\end{subfigure}
@ -54,87 +53,90 @@ Für einige häufig benötigte Features haben wir euch hier eine kurze Liste pas
\colrules
% Left caption:
\begin{subfigure}[t]{\widefigurewidth}
\caption{Beweisbäume mit prftree}
\caption{Proof trees with \pkg{prftree}}
\centering\tiny{\url{https://ftp.gwdg.de/pub/ctan/macros/latex/contrib/prftree/}}
\label{fig:prftree-example}
\end{subfigure}
\hspace{\widefiguregap}
% Right caption:
\begin{subfigure}[t]{\widefigurewidth}
\caption{Chemische Strukturformeln mit chemfig}
\caption{Chemical structural formulas with \pkg{chemfig}}
\centering\tiny{\url{http://latex-cookbook.net/cookbook/examples/benzene-ring/}}
\label{fig:chemfig-example}
\end{subfigure}
\medskip
}
% General caption:
\caption{Beispiele zu verschiedenen Paketen}
\caption{Examples for some packages}
\label{fig:package-examples}
\end{figure}
\begin{description}
\item[Stichwortverzeichnisse]
können mit \texttt{makeidx} automatisiert erstellt werden.\footnote{\url{https://www.ctan.org/pkg/makeidx}}
Mit \mintinline{tex}{\index{}} werden im Text einzelne Stichwörter ausgezeichnet, der Befehl \mintinline{tex}{\printindex} sammelt sie in einem Verzeichnis mit Referenzen.
\item[Vektorgrafiken]
\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})
lassen sich mit \texttt{TikZ} (rekursives Akronym für \emph{TikZ ist kein Zeichenprogramm}) direkt im \LaTeX{}-Code erstellen.\footnote{\url{https://www.ctan.org/pkg/pgf}}
Achtung: Dieses Paket ist sehr mächtig, aber nicht unbedingt einsteigerfreundlich.
Bevor ihr damit etwas von Grund auf selbst gestaltet, empfehlen wir euch, mit einigen der Beispiele bei \TeX{}ample\footnote{\url{https://texample.net/tikz/examples/}} zu experimentieren.
Für bestimmte Anwendungsfälle gibt es aber auch spezielle Pakete, die dann meist einfacher zu handhaben sind:
\item[Konstituentenbäume,]
die Sätze in ihre grammatikalischen Bestandteile zerlegen (\cref{fig:qtree-example}), erzeugt \texttt{qtree}.\footnote{\url{https://ctan.org/pkg/qtree}}
\item[Beweisbäume,]
wie sie in der Logik benötigt werden (\cref{fig:prftree-example}), erzeugt \texttt{prftree}.\footnote{\url{https://www.ctan.org/pkg/prftree}}
\item[Chemische Strukturformeln]
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})
können unter anderem mit dem Paket \texttt{chemfig} erzeugt werden.\footnote{\url{https://www.ctan.org/pkg/chemfig}}
\item[Farbe]
bringt \texttt{xcolor} in eure Dokumente.\footnote{\url{https://www.ctan.org/pkg/xcolor}}
\item[Notizen,]
die ihr bei der Abgabe garantiert nicht überseht, fügt \texttt{todonotes} ein.\footnote{\url{https://www.ctan.org/pkg/todonotes}}
Damit könnt ihr markieren, was ihr noch \todo{Nicht ändern, das ist ein Beispiel.}ändern oder einfügen wollt.
\item[Seiten aus anderen \acro{PDF}-Dateien]
integriert ihr mit \texttt{pdfpages}.\footnote{\url{https://www.ctan.org/pkg/pdfpages}}
Das eignet sich sehr gut, um Ausgaben anderer Programme in eure Arbeit zu integrieren, beispielsweise in einem Anhang.
Einmal kompilieren, und schon ist auch der Anhang wieder auf dem neuesten Stand, wenn das externe Programm etwas geändert hat.
\item[Verschachtelte Abbildungen]
und die nahezu beliebige Positionierung von Bildunterschriften ermöglicht \texttt{subcaption}.\footnote{\url{https://www.ctan.org/pkg/subcaption}}
Davon haben wir auch in diesem Dokument ausgiebig Gebrauch gemacht.
\item[Tabellen]
können noch sehr viel flexibler gestaltet werden, als wir es hier gezeigt haben.
Dabei helfen unter anderem die Pakete
\texttt{colortbl},\footnote{\url{https://www.ctan.org/pkg/colortbl}}
\texttt{tabularx},\footnote{\url{https://www.ctan.org/pkg/tabularx}}
\texttt{multirow},\footnote{\url{https://www.ctan.org/pkg/multirow}}
\texttt{makecell}.\footnote{\url{https://www.ctan.org/pkg/makecell}}
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 Eigentlich kein Paket, sondern eine weitere Dokumentenklasse ist \textbf{beamer:} Damit könnt ihr \textbf{Bildschirmpräsentationen} mit \LaTeX{} erstellen.
Informationen und Beispiele dazu gibt es bei Overleaf\footnote{\url{https://www.overleaf.com/learn/latex/Beamer}}
womit wir schon beim nächsten Abschnitt sind:
\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{Hilfe und Informationen}
\section{Help and information}
Eine deutlich ausführlichere Einführung in \LaTeX{} bieten die \textbf{Wikibooks.}
Das deutschsprachige Wikibook\footnote{\url{https://de.wikibooks.org/wiki/LaTeX-Kompendium}} ist dabei noch etwas unvollständiger als das englischsprachige.\footnote{\url{https://en.wikibooks.org/wiki/LaTeX}}
Beide verweisen bei Bedarf auf zusätzliche Pakete.
\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.
Falls ihr mehr Informationen zu einem bestimmten Paket sucht, ist \acro{\textbf{CTAN}}\footnote{\url{https://ctan.org/}} die zentrale Anlaufstelle.
Dort findet ihr zu jedem Paket die offizielle Dokumentation als \acro{PDF}-Dokument.
Darin sind vor allem die ersten Abschnitte interessant, weiter hinten folgen Implementierungsdetails, die ihr normalerweise nicht braucht.
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.
Wenn die Dokumentation zu theoretisch ist und ihr auf der Suche nach praktischen Beispielen seid, kann \textbf{Overleaf}\footnote{\url{https://www.overleaf.com/}} weiterhelfen.
Das Portal ist primär ein kollaborativer Online-\LaTeX-Editor, ihr findet dort aber auch einige Vorlagen\footnote{\url{https://www.overleaf.com/latex/templates}} für verschiedene Arten von Dokumenten (Lebensläufe, Abschlussarbeiten u.\,v.\,m.).
Speziell zu TikZ bietet \textbf{\TeX{}ample}\footnote{\url{https://texample.net/}} eine Vielzahl an Beispielen.
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.
Bei konkreten Fragen oder Problemen hilft wie üblich die Frage-Antwort-Plattform \textbf{Stackexchange} weiter:
Es gibt dort auch eine \TeX-Community.\footnote{\url{https://tex.stackexchange.com/}}
Und selbstverständlich könnt ihr euch auch immer gerne uns wenden:
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 per Mail an \href{mailto:fachschaft-wiai.stuve@uni-bamberg.de}{fachschaft-wiai.stuve@uni-bamberg.de},
\item telefonisch unter +49951\,863\,1219
\item oder in unserem Büro in WE5/02.104.
\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}

View File

@ -1,45 +0,0 @@
\chapter{Referenzen}
\label{sec:references}
Für Querverweise der Form \enquote{Wie man in Abbildung 23 sieht, \textellipsis} bringt \LaTeX\ von Haus aus den Befehl \mintinline{latex}{\ref{label}} mit, der lästige Anpassungen an der Nummerierung der Grafiken, Tabellen etc. erspart.
Er erhält als Argument ein eindeutiges Label, das auch dem referenzierten Element zugeordnet werden muss.
Anschließend erscheint an der Stelle des Befehlsaufrufs die fortlaufende Nummer des referenzierten Elements.
\Example{lst:fooboar-learning-latex}{references/ref}{references/ref_crop}{Beispiel für eine Referenzierung}
Noch smarter ist das Paket \mintinline{latex}{cleveref}.\footnote{mit nur einem \enquote{r}!}
Es bringt den Befehl \mintinline{latex}{\cref{label}} mit, dem auch -- durch Kommata getrennt -- mehrere Labels übergeben werden können.
Daraus entstehen dann automatisiert Angaben wie \enquote{Abschnitte 1 bis 3 und 5}.\footnote{für den Quelltext \mintinline{latex}{\cref{sec:section1,sec:section2,
sec:section3,sec:section5}}}
Zudem fügt \mintinline{latex}{\cref{label}} eigenständig die richtige Abkürzung ein, beispielsweise \enquote{Abb.} für Grafiken.
Referenziert werden können neben Grafiken und Tabellen unter anderem auch Abschnitte, Bilder, Quelltext-Listings und Gleichungen.
Viele Pakete nutzen das Label, um herauszufinden, zu welchem Objekttyp es gehört.
Aus diesem Grund ist es üblich, jedem Label ein Präfix voranzustellen (\cref{lst:reference-prefixes}).
\begin{table}[H]
\centering
\begin{tabular}{@{}llll@{}}
\toprule
Präfix & Objekttyp & Präfix & Objekttyp \\ \midrule
fig: & Abbildungen & tbl: & Tabellen \\
sec: & Abschnitte & subsec: & Unterabschnitte \\
ch: & Kapitel & itm: & Aufzählungselemente \\
eq: & Gleichungen & lst: & Quelltext-Listings \\ \bottomrule
\end{tabular}
\caption{Präfixe für Labels}
\label{lst:reference-prefixes}
\end{table}
Bei der Verwendung von \mintinline{latex}{\cref{label}} ist zu beachten, dass die generierten Passagen in einigen Dokumentklassen erst dann auf Deutsch erscheinen, wenn bereits in der Dokumentklasse die Sprache festgelegt wurde:
\begin{minted}{latex}
\documentclass[ngerman]{article}
\end{minted}
\noindent Von Abschnitten abgesehen, müssen Beschriftungen\footnote{\mintinline{latex}{\caption{}}} außerdem \emph{immer vergeben und vor dem Label platziert} werden, damit sie anschließend referenziert werden können.
Bei Abschnitten wird das Label direkt hinter dem Befehl angefügt:
\begin{minted}{latex}
\section{Hinweise}\label{sec:hints}
\end{minted}

View File

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

View File

@ -0,0 +1,95 @@
\section{Using minted}
\subsection{Installation}
Using \pkg{minted} requires a working installation of the programming language Python 3 (henceforth referred to as Python).
On some operating systems, Python comes pre-installed, in which case entering the command \sh{python -{}-version} or \sh{python3 -{}-version} in a terminal of your choice\footnote{Opening a terminal on Windows: \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}
}

View File

@ -1,69 +1,25 @@
\chapter{Quelltext-Listings}
\chapter{Source code listings}
\label{sec:source-code-listings}
Um Quelltext in eigenen Arbeiten darzustellen, gibt es in \LaTeX verschiedene Wege.
Wir verwenden hierfür gern das Paket \mintinline{latex}{minted}, das zwar etwas zusätzlichen Installationsaufwand verursacht, dafür aber ansprechende Ergebnisse generiert und gut zu handhaben ist.
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.
\section{Installation}
Zur Verwendung von \mintinline{latex}{minted} ist eine Installation der Programmiersprache Python 3 notwendig. Je nachdem, welches Betriebsystem ihr nutzt, kann es sein, dass Python 3 bei euch schon installiert ist. Das könnt ihr durch die Engabe des Befehls \mintinline{bash}{python --version} oder \mintinline{bash}{python3 --version} in einem Terminal\footnote{Navigation unter Windows: \faWindows\ + R → \enquote{cmd} eingeben → Enter} herausfinden
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}.
Sollte Python bei euch noch nicht installiert sein, sind die Installationsdateien auf der Projekt-Website\footnote{Verfügbar unter \url{https://www.python.org/downloads/}.} zu finden.
Ein ausführlicherer Beitrag zur Installation unter Windows,\footnote{Jason Fitzpatrick, How to Install Python on Windows. How-To Geek. July 11, 2017. Verfügbar unter \url{https://www.howtogeek.com/197947/how-to-install-python-on-windows/}.} Linux\footnote{ \url{https://docs.python-guide.org/starting/install3/linux/}} oder MacOS\footnote{\url{https://docs.python-guide.org/starting/install3/osx/}} führt euch durch die verschiedenen Schritte, die speziell für euer Betriebssystem notwendig sind.\footnote{Insbesondere das Anpassen des Systempfads sollte unter Windows nicht vergessen werden.}
\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.
Nach der erfolgreichen Installation solltet ihr, je nach Betriebssystem, in der Eingabeaufforderung den oben genannten Befehl noch mal eingeben und mit Enter bestätigen können und in etwa folgendes Ergebnis erhalten:
\section*{Source code listings within this script}
\begin{minted}[]{bash}
$ python --version
Python 3.8.5
\end{minted}
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}.
\noindent Sollte die Versionsnummer höher sein, ist alles bestens.
Im gleichen Fenster gebt ihr jetzt den Befehl \mintinline{bash}{pip install Pygments}\footnote{Achtung: In einigen Betriebssystem lautet der Befehl \mintinline{bash}{pip3 install Pygments}} ein, womit das Pygments-Paket für Python installiert wird.
Nach Abschluss dieses Vorgangs könnt ihr das \LaTeX-Paket \mintinline{latex}{minted} über \mintinline{latex}{\usepackage{minted}} einbinden.
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}
\section{Compiler-Befehl ändern}
Bevor es allerdings richtig losgehen kann, müssen wir noch eine Kleinigkeit im Compile-Prozess anpassen.
Normalerweise ruft euer Editor beim Klick auf den grünen Pfeil etwa den folgenden Befehl auf:
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.
\begin{minted}[]{bash}
$ pdflatex main.tex
\end{minted}
\noindent Welcher Befehl das bei euch genau ist, könnt ihr in \TeX{}studio unter \enquote{Optionen → \TeX{}studio konfigurieren → Befehle} einsehen.
Neben Pdf\LaTeX{} seht ihr den Befehl.
Die Datei, die kompiliert werden soll, wird hier durch \mintinline{bash}{%.tex} angegeben.
Außerdem sind üblicherweise noch zwei zusätzliche Angaben enthalten, jeweils mit einem Bindestrich davor (\mintinline{bash}{-synctex=1 -interaction=nonstopmode}).
Diese Angaben heißen Flags und konfigurieren das Programm \mintinline{bash}{pdflatex}.
Eine solche Flag müssen wir ergänzen.
Platziert die Angabe \mintinline{bash}{-shell-escape} vor der Datei-Angabe (\mintinline{bash}{%.tex}):
\begin{minted}[]{bash}
pdflatex -synctex=1 -interaction=nonstopmode -shell-escape %.tex
\end{minted}
\noindent Nach Klick auf \enquote{Okay} ist der Einrichtungsschritt abgeschlossen.
Auch andere Editoren bieten die Möglichkeit, den Kompilierbefehl anzupassen.
Schaut am besten mal in die Einstellungen oder bemüht eine Suchmaschine.
\section{Quelltext setzen}
Jetzt kann der eigentliche Spaß losgehen.
Quelltext könnt ihr von nun an unter Angabe der Sprache in einer eigenen Umgebung setzen:
\example{lst:minted-environment}{source-code-listings/minted-environment}{Beispielhaftes Quelltext-Listing}
\example{lst:minted-variants}{source-code-listings/minted-variants}{Kurzschreibweise und Inline-Listing}
\noindent Außerdem gibt es eine Kurzschreibweise und eine Inline-Variante des Befehls (vgl. \cref{lst:minted-variants}).
Um Redundanz zu vermeiden, ist es manchmal praktisch, den Quelltext direkt aus der Quelldatei einzulesen.
Hierzu müssen nur die verwendete Programmiersprache und der Dateipfad an den Befehl \mintinline{latex}{\inputminted} übergeben werden (vgl. \cref{lst:minted-external}).
\example{lst:minted-external}{source-code-listings/minted-import}{Einbinden aus einer externen Datei}
\section{Minted konfigurieren}
Durch optionale Parameter können Zeilennummerierung, Umbrüche und Farben ausgewählt werden.
Außerdem sind zahlreiche Themes verfügbar (\cref{lst:minted-external-styled}).
Einen umfänglichen Überblick geben die Einführung von Overleaf und die Dokumentation.\footnote{Verfügbar unter \url{https://www.overleaf.com/learn/latex/Code_Highlighting_with_minted} bzw. \url{https://ctan.kako-dev.de/macros/latex/contrib/minted/minted.pdf}.}
\example{lst:minted-external-styled}{source-code-listings/minted-import-styled}{Themes und weitere Optionen}
\input{./content/source-code-listings-minted}
\input{./content/source-code-listings-listings}

View File

@ -1,142 +1,147 @@
\chapter{Sonderzeichen}
\chapter{Special characters}
\label{sec:special-characters}
\section{Leerzeichen}
\section{Spaces}
Das am häufigsten benötigte Sonderzeichen ist ein einfaches Leerzeichen als Wortzwischenraum.
Dieses Zeichen entsteht in \LaTeX, wenn im Quellcode zwischen anderen Zeichen Leerzeichen oder einzelne Zeilenumbrüche stehen.
Es gibt aber auch einige andere Arten von Leerzeichen.
Wie sie verwendet werden können, wird in \cref{lst:spaces} veranschaulicht.
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}{Unterschiedliche Leerzeichen in \LaTeX}
\example{lst:spaces}{special-characters/spaces}{Different spaces in \LaTeX}
\paragraph{English Spacing}
In englischsprachigen Dokumenten verwendet LaTeX das traditionelle English Spacing, also doppelte Leerzeichen nach dem Satzende.
Der Befehl \mintinline{tex}|\frenchspacing| vor dem ersten Absatz verhindert das.
Der Befehl \mintinline{tex}|\nonfrenchspacing| schaltet wieder zurück.
Bei English Spacing versucht \LaTeX, Abkürzungen zu erkennen und danach trotzdem normale Wortzwischenräume zu setzen.
Das solltet ihr aber kontrollieren und, wo nötig,
Wortzwischenräume (\mintinline[showspaces]{tex}{.\ }) oder Satzenden (\mintinline[showspaces]{tex}{\@. }) erzwingen.
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{Striche}
Es gibt verschiedene horizontale Striche.
Am häufigsten werden der Bindestrich (-), der Halbgeviertstrich () und der Geviertstrich\footnote{Ein Geviert ist die Zeilenhöhe, die eine Bleiletter aus dem Buchdruck einnimmt.} (—) verwendet.
Diese drei Striche werden in \LaTeX{} durch unterschiedlich viele Bindestriche im Quelltext erzeugt, wie \cref{tbl:bars} zeigt.
\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 & Strich & Verwendung \\
Code & Character & Usage \\
\midrule
\mintinline{tex}|-| & Bindestrich & \LaTeX-Wochenende \\
\mintinline{tex}|--| & Halbgeviertstrich & als Gedankenstrich mit Leerzeichen außenrum oder als Bis-Strich: 10\,\,12 Uhr \\
\mintinline{tex}|---| & Geviertstrich & a dash\,\,mostly used in American English \\
\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{Striche in \LaTeX}
\caption{Hyphens and dashes in \LaTeX}
\label{tbl:bars}
\end{longtable}
Der Bindestrich wird zwar auch zur Silbentrennung verwendet, ihr solltet ihn dafür aber nicht explizit im Quellcode eingeben.
An den meisten Stellen trennt \LaTeX{} automatisch richtig, wenn ihr das passende \texttt{babel}-Paket eingebunden habt.\footnote{Vgl. \cref{sec:language}.}
Wenn dabei etwas schiefgeht, könnt ihr mit den Codes in \cref{tbl:separators} eingreifen:\footnote{Auch dafür muss \texttt{babel} eingebunden sein.}
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.}
\begin{longtable}{@{}lp{11cm}@{}}
\setlength\LTleft{-2cm}
\begin{longtable}{@{}lp{8cm}p{3cm}p{3cm}@{}}
\toprule
Code & Erläuterung \\
Code & Explanation & English example & German example \\
\midrule
\endhead
\mintinline{tex}|\-| & Ausschließliche Trennstelle: Das Wort darf nur an dieser Stelle getrennt werden (kann auch mehrfach in einem Wort vorkommen, dann sind alle Stellen erlaubt). \\
\mintinline{tex}|"-| & Zusätzliche Trennstelle: Das Wort darf neben den von \LaTeX{} erkannten Trennstellen auch hier getrennt werden. \\
\mintinline{tex}|-| & Exklusiver Bindestrich: Wird für Komposita verwendet und unterbindet die automatische Silbentrennung im Wort (das ist typografisch erwünscht). \\
\mintinline{tex}|"=| & Nichtexklusiver Bindestrich: Wird für lange Komposita verwendet, bei denen die Silbentrennung aktiv bleiben soll, weil der Umbruch sonst nicht klappt. \\
\mintinline{tex}|""| & Trennstelle ohne Strich: Kann beispielsweise verwendet werden, um \textsc{url}s ohne Bindestrich zu trennen. \\
\mintinline{tex}|"~| & Bindestrich ohne Trennstelle: Wird verwendet, um den Bindestrich zusammen mit dem folgenden Wort umbrechen zu lassen: \emph{Vorlesungszeit und "~raum} \\
\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{Ausnahmen für die Silbentrennung}
\caption{Exceptions for hyphenation}
\label{tbl:separators}
\end{longtable}
\section{Anführungszeichen}
Anführungszeichen können grundsätzlich mit den Codes in \cref{tbl:quotation-marks} erzeugt werden.
Entscheidend ist dabei jeweils das Aussehen und nicht die Semantik, weshalb zum Beispiel im Deutschen die französichen Guillemets verkehrt herum verwendet werden (»french left quoation mark« rechts und umgekehrt).
\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
Sprache & \multicolumn{2}{c}{Erste Ebene} & \multicolumn{2}{c}{Zweite Ebene} \\
Language & \multicolumn{2}{c}{First level} & \multicolumn{2}{c}{Second level} \\
\cmidrule(lr){2-3} \cmidrule(lr){4-5}
& Code & Ergebnis & Code & Ergebnis \\
& Code & Result & Code & Result \\
\midrule
Deutsch & \mintinline{tex}|\glqq...\grqq| & \glqq\grqq & \mintinline{tex}|\glq\grq| & \glq\grq \\
Deutsch alternativ & \mintinline{tex}|\frqq...\flqq| & \frqq\flqq & \mintinline{tex}|\frq\flq| & \frq\flq \\
Englisch (\acro{A.\,E.}) & \mintinline{tex}|``...''| & ``…'' & \mintinline{tex}|`...'| & `…' \\
Englisch (\acro{B.\,E.}) & \mintinline{tex}|`...'| & `…' & \mintinline{tex}|``...''| & ``…'' \\
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{Anführungszeichen}
\caption{Quotation marks}
\label{tbl:quotation-marks}
\end{table}
Deutlich flexibler seid ihr aber mit dem Paket \mintinline{tex}{csquotes}, das den Befehl \mintinline{tex}|\enquote{<zitat>}| zur Verfügung stellt.
Abhängig von der Sprache werden die passenden Anführungszeichen verwendet; bei verschachtelten \texttt{enquote}s wird zwischen erster und zweiter Ebene gewechselt.
Mit der Option \mintinline{tex}|autostyle=true| beim Paketimport setzt der Befehl \mintinline{tex}|\foreignquote{<sprache>}{<zitat>}| je nach Sprache abweichende Anführungszeichen.
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{Diakritika}
Wenn ihr Buchstaben mit diakritischen Zeichen direkt über die Tastatur eingeben könnt beispielsweise die deutschen Umlaute oder gängige Akzente auf einer deutschen Tastatur , könnt ihr das auch direkt im Quelltext tun.
Die Zeichen bleiben dann im Output erhalten.
Ansonsten können die Diakritika auch per Escape-Codes erzeugt werden.
\cref{tbl:diacritics} gibt nur einige Beispiele an die Buchstaben lassen sich natürlich austauschen, es gibt aber auch noch viele andere Diakritika.
\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
\verb|\`{o}| & -- & \`{o} & $\quad$ & \verb|\c{c}| & -- & \c{c} & $\quad$ & \verb|\d{u}| & -- & \d{u} \\
\verb|\'{o}| & -- & \'{o} & & \verb|\k{a}| & -- & \k{a} & & \verb|\r{a}| & -- & \r{a} \\
\verb|\^{o}| & -- & \^{o} & & \verb|\l{}| & -- & \l{} & & \verb|\u{o}| & -- & \u{o} \\
\verb|\"{o}| & -- & \"{o} & & \verb|\={o}| & -- & \={o} & & \verb|\v{s}| & -- & \v{s} \\
\verb|\H{o}| & -- & \H{o} & & \verb|\b{o}| & -- & \b{o} & & \verb|\t{oo}| & -- & \t{oo} \\
\verb|\~{o}| & -- & \~{o} & & \verb|\.{o}| & -- & \.{o} & & \verb|\o| & -- & \o \\
\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{Diakritika}
\caption{Diacritics}
\label{tbl:diacritics}
\end{table}
\section{Andere Sonderzeichen}
Einige Sonderzeichen, beispielsweise das Prozentzeichen, sind für die \LaTeX{}-Syntax reserviert und können nicht als normale Zeichen verwendet werden.
Diese und viele, viele weitere Sonderzeichen können über eigene Befehle erzeugt werden.
Dabei ist zu beachten, dass manche Sonderzeichen nur in Mathe-Umgebungen (siehe \cref{sec:maths}) funktionieren, andere brauchen zusätzliche Pakete.
\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
Zeichen & Code & Bemerkung \\
Sign & Code & Remarks \\
\midrule
?`/!` & \verb|?`/!`| & \\
\textasciicircum & \verb|\textasciicircum| & \\
\textasciitilde & \verb|\textasciitilde| & \\
\textasteriskcentered & \verb|\textasteriskcentered| & \\
\textbackslash & \verb|\textbackslash| & \\
%\textbar & \verb|\textbar| & \\
%\textbullet & \verb|\textbullet| & \\
\textcopyright & \verb|\textcopyright| & \\
\textdagger & \verb|\textdagger| & \\
%\textdaggerdbl & \verb|\textdaggerdbl| & \\
\textellipsis & \verb|\textellipsis| & \\
\textless/\textgreater & \verb|\textless/\textgreater| & \\
\textperthousand & \verb|\textperthousand| & \\
\textsection & \verb|\textsection| & \\
$\delta, \pi, \Sigma$ & \verb|\delta, \pi, \Sigma|, … & nur in Mathe-Umgebung \\
\euro & \verb|\euro| & nur mit Paket \texttt{eurosym} \\
\textteshlig & \verb|\textteshlig| & nur mit Paket \texttt{tipa} \\
\textmusicalnote & \verb|\textmusicalnote| & nur mit Paket \texttt{textcomp} \\
\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{Einige Sonderzeichen}
\caption{Some special characters}
\label{tbl:special-characters}
\end{table}
Falls ihr mal ein Sonderzeichen braucht, von dem ihr nicht genau wisst, wie es heißt, hilft euch \emph{Detexify}\footnote{\url{http://detexify.kirelabs.org/classify.html}} ihr könnt das Symbol zeichnen und bekommt alle nötigen Infos.
Dass es von Keilschrift bis zu technischen Symbolen wirklich \emph{alles} gibt, stellt ihr fest, wenn ihr durch die \emph{Comprehensive \LaTeX{} Symbol List}\footnote{\url{http://tug.ctan.org/info/symbols/comprehensive/symbols-a4.pdf}} blättert.
Whenever you need a certain symbol and dont know its name, \emph{Detexify}\footnote{\url{http://detexify.kirelabs.org/classify.html}} comes to the rescue: You can draw the symbol and get all necessery information.
From cuneiforms to technical symbols, there is absolutely \emph{everything}\textit{,} as you can see scrolling through the \emph{Comprehensive \LaTeX{} Symbol List}\textit{.}\footnote{\url{http://tug.ctan.org/info/symbols/comprehensive/symbols-a4.pdf}}

View File

@ -1,50 +1,50 @@
\chapter{Tabellen}
\chapter{Tables}
\label{sec:tables}
Für Tabellen gibt es zwei grundlegende Umgebungen.
Die erste, \texttt{table}, ist dafür zuständig, die Tabelle insgesamt in das übrige Dokument einzubauen.
Die Positionierung erfolgt dabei analog zur Positionierung von Grafiken.
Auch bei Tabellen kann der Befehl \mintinline{tex}{\caption} verwendet werden, um der Tabelle eine Beschriftung zuzuordnen.
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.
Anders als bei Grafiken funktioniert dann der eigentliche Tabelleninhalt.
Während Grafiken aus externen Dateien stammen und nicht durch \LaTeX{} interpretiert werden, muss die innere Struktur von Tabellen im Code aufgeschlüsselt werden.
Dazu dient die Umgebung \texttt{tabular}, die als verpflichtenden Parameter eine Spaltendefinition erwartet.
Die Spaltendefinition besteht aus je einem Buchstaben pro Tabellenspalte, der die Textausrichtung der Spalte angibt:
\texttt{l} für linksbündig, \texttt{r} für rechtsbündig, \texttt{c} für zentriert.
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.
Innerhalb der \texttt{tabular}-Umgebung folgt dann der eigentliche Tabelleninhalt.
Dabei werden Tabellenzeilen genau wie Zeilenumbrüche durch \mintinline{tex}{\\} markiert, Zellengrenzen durch \mintinline{tex}{&}.
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}{\&}.
Für typografisch ansprechende Tabellen empfehlen wir das Paket \texttt{booktabs}.\footnote{Alle bisher genannten Befehle funktionieren auch ohne dieses Paket, das Ergebnis sieht dann aber deutlich unprofessioneller aus.}
Dieses Paket bringt die Befehle \mintinline{tex}{\toprule}, \mintinline{tex}{\midrule} und \mintinline{tex}{\bottomrule} mit, die jeweils passende horizontale Linien für den Tabellenbegin, für Gruppierungen innerhalb der Tabelle sowie für das Tabellenende zeichnen.
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.
Vertikale Linien können als senkrechter Strich (\texttt{|}) in die Spaltendefinition eingefügt werden, davon ist aber abzuraten.
Wenn ihr den zusätzlichen Weißraum entfernen möchtet, der standardmäßig die Spalten umgibt, könnt ihr ebenfalls zwischen den Buchstaben der Spaltendefinition die Zeichenkette \mintinline{tex}{@{}} einfügen.
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.
Die komplette Tabelle kann dann beispielsweise so aussehen wie in \cref{lst:sample-table} abgebildet.
A complete table can then look like the one shown in \cref{lst:sample-table}.
\Example{lst:sample-table}{tables/table-example}{tables/table-example-renderable}{Eine komplette Tabelle}
\Example{lst:sample-table}{tables/table-example}{tables/table-example-renderable}{A complete table}
\paragraph{Überlänge}
Für Tabellen, die über eine Seite hinausgehen, oder die Zeilenumbrüche innerhalb einzelner Tabellenzellen erfordern, kann zusätzlich das Paket \texttt{longtable} eingebunden werden, mit dem \texttt{booktabs} ebenfalls kompatibel ist.
Die \texttt{longtable}-Umgebung vereint die \texttt{table}- und die \texttt{tabular}-Umgebung.
Damit ergibt sich folgende Grundstruktur:
\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{minted}{latex}
\begin{longtable}
% Inhalte
\caption{<Beschriftung>}
\end{longtable}
\end{minted}
\begin{samepage}
\codeblock{latex}{listings/tables/excess-length.tex}
\end{samepage}
\paragraph{Überbreite}
Soll stattdessen eine sehr breite Tabelle dargestellt werden, empfiehlt es sich auf hochkant ausgerichteten Seiten, die Tabelle um 90\textdegree{} zu drehen.
Das geht mithilfe des Pakets \texttt{rotating}.
Der einzige Unterschied zu einer normalen Tabelle ist, dass die \texttt{table}- Umgebung durch eine \texttt{sidewaystable}-Umgebung ersetzt wird.
Die Positionierung und die enthaltene \texttt{tabular}"=Umgebung funktionieren unverändert.
\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{Weitere Möglichkeiten}
Natürlich bietet \LaTeX{} noch viele weitere Features für ausgefeiltere Tabellen, beispielsweise zeilen- oder spaltenübergreifende Zellen.
Dafür, oder wenn ihr euch einfach Tipparbeit sparen wollt, empfehlen wir euch den \emph{Tables Generator,}\footnote{\url{https://tablesgenerator.com/}} in dem ihr Tabellen in \textsc{wysiwyg}-Manier zusammenklicken könnt und kopierfertigen \LaTeX-Code erhaltet.
\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.

View File

@ -1,67 +1,102 @@
\chapter{Textauszeichnung}
\chapter{Text markup}
Bei der Textauszeichnung wird zwischen semantischer und optischer Hervorhebung unterschieden.
Wir empfehlen, so oft wie möglich semantische Auszeichnung zu verwenden, die nur angibt, \emph{warum} etwas ausgezeichnet wird, und \LaTeX{} überlässt, \emph{wie} es aussehen soll.
Die einfachste semantische Auszeichnung, die auch im vorherigen Satz verwendet wurde, ist eine Betonung mit \mintinline{latex}{\emph{}}.
Der Befehl lässt sich auch schachteln und setzt Text normalerweise kursiv bzw. in zweiter Ebene wieder gerade.
Diese Art der Hervorhebung wird erst beim Lesen wahrgenommen und zieht nicht schon vorher Aufmerksamkeit an, wie es der farbige Befehl in diesem Absatz tut, oder Fettsatz, der eher zur Gliederung geeignet ist.
\section*{Text highlighting}
Einige optische Auszeichnungen werden in \cref{tbl:visual-markup} aufgelistet, sollten aber sehr vorsichtig verwendet werden.
Grundsätzlich lassen sie sich auch untereinander schachteln, bei einigen Kombinationen werden aber die passenden Schriftschnitte fehlen.
Viele andere Programme fangen in solchen Fällen an, vorhandene Schnitte zu verzerren, um den fehlenden Schnitt zu imitieren.
Gut sieht so etwas aber nicht aus, deshalb verzichtet \LaTeX{} darauf.
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
Auszeichnung & Befehl & Darstellung \\
Markup & Command & Rendering \\
\midrule
fett & \mintinline{latex}{\textbf{bold face}} & \textbf{bold face} \\
kursiv & \mintinline{latex}{\textit{italics}} & \textit{italics} \\
Kapitälchen & \mintinline{latex}{\textsc{small caps}} & \textsc{small caps} \\
dicktengleich & \mintinline{latex}{\texttt{typewriter text}} & \texttt{typewriter text} \\
schräg & \mintinline{latex}{\texttt{slanted}} & \textsl{slanted} (bitte nicht!) \\
unterstrichen & \mintinline{latex}{\underline{underlined}} & \underline{underlined} \\
tiefgestellt & \mintinline{latex}{\textsubscript{subscript}} & x\textsubscript{subscript} \\
hochgestellt & \mintinline{latex}{\textsubscript{superscript}} & x\textsuperscript{superscript} \\
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, dont!) \\
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{Befehle zur optischen Textauszeichnung}
\caption{Visual markup commands}
\label{tbl:visual-markup}
\end{table}
Normalerweise solltet ihr diese Befehle kaum brauchen, denn da, wo diese Auszeichnungen angebracht sind, tauchen sie meistens von selbst auf, wenn ihr semantische Befehle verwendet.
Beispielsweise stellt das Paket \texttt{hyperref} den Befehl \mintinline{latex}{\url{}} bereit, mit dem \textsc{url}s nicht nur dicktengleich dargestellt werden, sondern auch anklickbar und bei Bedarf automatisch mit bindestrichlosen Zeilenumbrüchen versehen.
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.
Das gleiche gilt für unterschiedliche Schriftgrößen:
Die Größe der Schrift im Fließtext könnt ihr mit einer Option der Dokumentenklasse festlegen:
\begin{minted}{latex}
\documentclass[9pt]{article}
\end{minted}
Darauf aufbauend erzeugt \LaTeX{} verschiedene Schriftgrade, die durch die Befehle in \cref{tbl:type-sizes} gesetzt werden können.
Beschränkt so etwas aber besser auf Titelseiten und ähnliches.
Für den Rest könnt ihr auf die Standardeinstellungen vertrauen und euch das visuelle Durcheinander sparen.
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
Befehl & Darstellung \\
Command & Rendering \\
\midrule
\mintinline{latex}{{\tiny winzig}} & {\tiny winzig} \\
\mintinline{latex}{{\footnotesize Fußnotengröße}} & {\footnotesize Fußnotengröße} \\
\mintinline{latex}{{\small klein}} & {\small klein} \\
\mintinline{latex}{{\normalsize normal}} & {\normalsize normal} \\
\mintinline{latex}{{\large groß}} & {\large groß} \\
\mintinline{latex}{{\Large größer}} & {\Large größer} \\
\mintinline{latex}{{\LARGE am größten}} & {\LARGE am größten} \\
\mintinline{latex}{{\huge am allergrößten}} & {\huge am allergrößten} \\
\mintinline{latex}{{\Huge Größenwahn}} & {\Huge Größenwahn} \\
\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{Befehle zur optischen Textauszeichnung}
\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.

View File

@ -1,29 +0,0 @@
\begin{center}
\fslogo \\
\vspace{3em}
\rule{\textwidth}{1pt}\par
\vspace{0.8\baselineskip}
\Huge\bfseries Skript zum \LaTeX-Tutorium der Fachschaft \acro{WIAI}
\vspace{0.8\baselineskip}
\rule{\textwidth}{1pt}\par
%\vspace{2em}
{\large \today}
\vfill
{\Large{ Evelyn Fradtschuk, Florian Knoch,\\
Christian Kremitzl, Bernhard Luedtke}}\\
\vfill
\end{center}
\newpage
\thispagestyle{empty}
\mbox{}
\vfill
\begin{tabular}{@{}lp{9cm}}
& \subsubsection*{Impressum} \\
& Das \LaTeX-Skript (Version 1.0 vom 22.~Februar 2021) wurde von der Fachschaft \acro{WIAI} der Otto-Friedrich-Universität Bamberg zusammengestellt. \\
& Es ist unterliegt der Creative-Commons-Lizenz \enquote{Namens"-nennung Weitergabe unter gleichen Bedingungen 4.0 International} (CC BY-SA 4.0): \\
\href{http://creativecommons.org/licenses/by-sa/4.0/}{\includegraphics[height=.5cm]{graphics/cc-by-sa}} & \url{http://creativecommons.org/licenses/by-sa/4.0/} \\ \\
& Auf Nachfrage können auch über diese Lizenz hinausgehende Erlaubnisse gewährt werden.
\end{tabular}

View File

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

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

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

View File

@ -0,0 +1,69 @@
% 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}

View File

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

View File

@ -1,25 +1,25 @@
1. Getränke
1. Beverages
1.1 Pink Lemonade
Wir alle kennen und lieben sie im Sommer: eine kühle Limonade. Die pinke Variante wurde traditionell zubereitet, indem man der Limonade Lebensmittelfarbe hinzugefügt hat. Wir haben das Ganze etwas abgewandelt und uns für eine Variante mit Beeren entschieden, um den sauren Geschmack der Zitronen auszugleichen. Dadurch wird die Limonade ein perfekter und erfrischender Sommer-Drink!
We all know and love it in summer: a cold lemonade. The pink variant of our favorite summer drink is traditionally achieved by adding food coloring to the lemonade. However, we changed things up a little and decided to go for a variant with berries instead of food coloring, which also makes the drink less sour.
1.1.1 Zutaten
Für die Zubereitung der Limonade braucht ihr 400 g Beeren. Sie können entweder gefroren oder frisch sein. Bei der Wahl der Beeren könnt ihr euch austoben: Himbeeren, Heidelbeeren, Brombeeren oder auch eine Mischung aus verschiedenen Beeren eignen sich hervorragend. \\
Für ein wenig Süße nutzen wir 50 ml Ahornsirup, natürlich könnt ihr auch mehr oder weniger nehmen, je nachdem, wie sauer ihr eure Limonade haben wollt. Übrigens eignen sich auch andere Süßungsmittel wie etwa Agavendicksaft oder Kokosblütensirup wunderbar. \\
Außerdem benötigen wir noch 4 gepresste Zitronen, ungefähr einen Liter kaltes Wasser und 400 g Eiswürfel, damit das Getränk auch schön kühl bleibt.
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 Zubereitung
Die Beeren zusammen mit dem Ahornsirup in einen Kochtopf geben und bei mittlerer Hitze für drei bis vier Minuten kochen. Sobald die Beeren anfangen, weich zu werden, könnt ihr die Hitze etwas reduzieren. Mit dem Ende eines Holzlöffels zerdrückt ihr nun die Beeren, bis so gut wie keine großen Stücke mehr vorhanden sind. Je weniger Stücke, desto besser! \\
Nun platziert ihr ein Sieb über dem Gefäß, in dem ihr eure Limonade aufbewahren wollt, und gebt die Himbeeren in das Sieb. Mit der Rückseite eines Löffels versucht ihr, so viel Saft wie möglich aus der Beeren-Mixtur zu pressen. Den Saft danach abkühlen lassen. \\
Sobald eure Beeren-Flüssigkeit abgekühlt ist, gebt den Zitronensaft, das kalte Wasser und die Eiswürfel hinzu und rührt alles ordentlich um. \\
Eure Limonade ist nun fertig zum genießen und bereit, in Gläser gefüllt zu werden!
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 Heiße Schokolade
1.2 Hot Chocolate
Coming soon!
2. Frühstücksgerichte
2. Breakfast
2.1 Overnight Oats aus Couscous
2.1 Buckwheat Porridge
Coming soon!

View File

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

View File

@ -1,6 +1,28 @@
\section{Structure your document and text}
\begin{enumerate}
\item Im Ordner \mintinline{latex}{exercises/basic-document-structure} findet ihr eine Datei namens \mintinline{latex}{document-structure.tex}. Öffnet die Datei, kopiert den Text und fügt ihn in eine neue Datei ein, die ihr beispielsweise \mintinline[breaklines, breakbytokenanywhere]{latex}{document- structure-solution.tex} nennt. Packt den Text in der neuen Datei in eine \mintinline{latex}{document}-Umgebung und fügt eine Präambel ein, um euer erstes \LaTeX -Dokument anschließend kompilieren zu können. Kompiliert nun das neue Dokument.
\item Herzlichen Glückwunsch, ihr habt euer erstes eigenes \LaTeX -Dokument erstellt und kompiliert. Wie euch vielleicht aufgefallen ist, sind die Absätze im Dokument mit \mintinline{latex}{\\} erstellt worden. Ersetzt diese durch richtige Absätze.
\item Nun ist es an der Zeit, das Dokument etwas zu strukturieren. Verwendet für die Überschriften die passenden \LaTeX -Befehle (\mintinline{latex}{\section}, \mintinline{latex}{\subsection}, usw.) und fügt anschließend ein Inhaltsverzeichnis in euer Dokument ein.
\item 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}
\exercisematerial{exercises/basic-document-structure/document-structure}
\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}

View File

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

View File

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

View File

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

View File

@ -1,4 +1,6 @@
Integriert im Text der Datei \mintinline{bash}{exercises/footnotes/footnotes.tex} das Statement \glqq{}Stand: März 2021\grqq{} in eine Fußnote. Fügt außerdem eine klickbare URL als Fußnote zum Download des Java Development Kits ein:\\
\texttt{https://www.oracle.com/java/technologies/javase-downloads.html}
\section{Footnotes and references}
\exercisematerial{exercises/footnotes/footnotes}
\subsection{Inserting footnotes}
Make the text \enquote{released in September 2023} of the file \file{exercises/footnotes/footnotes.tex} appear as a footnote instead of in parentheses.
Additionally, insert a clickable URL to the Java Development Kit as footnote: \\ \texttt{https://www.oracle.com/java/technologies/javase-downloads.html}

View File

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

View File

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

View File

@ -1 +1,3 @@
Bitte hier das Bild einfügen.
% !TeX root = ../../main-exercises.tex
Please insert the image here.

View File

@ -1,3 +1,8 @@
Bei den Übungsaufgaben findet ihr im Ordner \mintinline{latex}{graphics} eine Bilddatei namens \mintinline{latex}{latex-logo.png}. Fügt das Bild in die Datei \mintinline{bash}{exercises/graphics/graphics.tex} ein. Sorgt dafür, dass das Bild genau unter diesem Text erscheint. Das Bild soll außerdem zentriert eingebunden werden und über eine Bildunterschrift verfügen. Passt die Größe außerdem an die Breite der Seite (\mintinline{latex}{\textwidth}) an.
\section{Inserting graphics}
\exercisematerial{exercises/graphics/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.

View File

@ -0,0 +1,47 @@
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}

View File

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

View File

@ -1,4 +1,6 @@
Zutaten:
400 g Beeren, 50 ml Ahornsirup, 4 gepresste Zitronen, 1 Liter kaltes Wasser, 400 g Eiswürfel
% !TeX root = ../../main-exercises.tex
\noindent Arbeitsschritte: Beeren kochen und zu Saft verarbeiten, Ahornsirup hinzufügen, Zitronensaft auspressen, restliche Zutaten zusammenfügen und verühren
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

View File

@ -1,3 +1,15 @@
Formatiert das Rezept in der Datei \mintinline{bash}{exercises/lists/lists.tex} als ungeordnete Liste (\mintinline{latex}{itemize}) mit den Elementen \emph{Zutaten} und \emph{Arbeitsschritte}. Innerhalb dieser soll eine kompakte, ungeordnete Liste (\mintinline{latex}{compactitem}) der Zutaten erstellt werden. Die Arbeitsschritte hingegen sollen als kompakte, geordnete Liste dargestellt werden.
\section{Adding enumerations}
\exercisematerial{exercises/lists/lists}
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}

View File

@ -0,0 +1,12 @@
% Preamble adjustments
% Literature
\usepackage[style=numeric, citestyle=alpha, 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

View File

@ -1,34 +1,26 @@
@book{lamport1994,
author = {Leslie Lamport},
title = {LaTeX - {A} Document Preparation System: User's Guide and Reference
Manual, Second Edition},
publisher = {Pearson / Prentice Hall},
year = {1994},
isbn = {978-0-201-52983-8},
timestamp = {Fri, 08 Apr 2011 18:21:00 +0200},
biburl = {https://dblp.org/rec/books/daglib/0023602.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
@book{datta2017,
author = {Dilip Datta},
title = {LaTeX in 24 Hours - {A} Practical Guide for Scientific Writing},
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}
bibsource = {dblp computer science bibliography,
https://dblp.org}
}
@book{goossensmittelbach2002,
@book{goossensmittelbach2010,
author = {Michel Goossens and
Frank Mittelbach and
Alexander Samarin},
title = {Der LaTeX Begleiter},
publisher = {Addison-Wesley},
year = {2002},
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}
}
bibsource = {dblp computer science bibliography,
https://dblp.org}
}

View File

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

View File

@ -1,6 +1,7 @@
Das erstgenannte Buch (Lamport, 1994) wurde vom Schöpfer von LaTeX, Leslie Lamport, selbst verfasst.
Da es bereits etwas betagter ist, geben wir euch mit \glqq{}\LaTeX\ in 24 Hours\grqq{} (Datta, 2017) noch ein aktuelleres Buch in die Hand.
Es gibt eine Unmenge weiterer Handbücher (u.\thinspace a. Goossens, Mittelbach u. Samarin, 2002).
% !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).
~\\
@ -8,6 +9,4 @@ Es gibt eine Unmenge weiterer Handbücher (u.\thinspace a. Goossens, Mittelbach
\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 9783319478302
\noindent [Goossens u. a. 2002] Goossens, Michel ; Mittelbach, Frank ; Samarin, Alexander: Der LaTeX Begleiter. Addison-Wesley, 2002. ISBN 9783827370440
\noindent [Lamport 1994] Lamport, Leslie: LaTeX - A Document Preparation System: Users Guide and Reference Manual, Second Edition. Pearson / Prentice Hall, 1994. ISBN 9780201529838
\noindent [Goossens u. a. 2010] Goossens, Michel ; Mittelbach, Frank ; Samarin, Alexander: Der LaTeX Begleiter. Addison-Wesley, 2010. ISBN 9783827370440

View File

@ -1,18 +1,19 @@
\section{Creating and inserting references}
\begin{enumerate}
\item Sucht bei Google Scholar die Bib\TeX-Einträge für folgende \LaTeX"=Handbücher:
\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 Leslie Lamport (1994): \LaTeX. A Document Preparation System.
\item Dilip Datta (2017): \LaTeX\ in 24 Hours. A Practical Guide for Scientific Writing.
\item Frank Mittelbach / Michel Goossens (2002): Der \LaTeX-Begleiter.
\item Frank Mittelbach / Michel Goossens (2010): Der \LaTeX-Begleiter.
\end{itemize}
\item Vergleicht die Einträge mit den Ergebnissen, die euch \url{dblp.org} für dieselben Bücher liefert.
\item Erstellt im Ordner \mintinline{latex}{exercises/literature} eine neue Bib\TeX-Datei mit dem Namen \mintinline{sh}{literature.bib}.
\item Fügt die Bib\TeX-Einträge in die Bib\TeX-Datei ein. Wählt hierfür aus Google Scholar und dblp die aus eurer Sicht geeigneteren Einträge.
\item Vergebt aussagekräftige Bib\TeX-Keys.
\item Bindet die Bib\TeX-Datei an einer geeigneten Stelle ein, an der später auch das Literaturverzeichnis zu sehen sein soll.
\item Zitiert die drei Handbücher in der Datei\\\mintinline{sh}{exercises/literature/literature.tex}.
\item Wählt den Bibliographiestil \mintinline{sh}{natdin}.
\item \textbf{Hinweis}: Sollte das Kompilieren fehlschlagen, kann es hilfreich sein, einmal alle Hilfsdateien (\mintinline{sh}{main.aux/bbl/blg/loc/out/pdf/soc/toc}) zu löschen und neu zu kompilieren.
\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}
\exercisematerial{exercises/literature/literature}
\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.

View File

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

View File

@ -1,25 +1 @@
\begin{minted}{latex}
% Fallbeschleunigung in Deutschland
$$9,81\,\frac{m}{s^2}$$
% pq-Formel
$$x_{1,2} = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}$$
% Mitternachtsformel
$$x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$
% Catalansche Zahlen
\begin{equation*}
C_n = \frac{1}{n+1} {2n \choose n} = \frac{(2n)!}{(n+1)!n!}
\end{equation*}
% Definition der Fakultät
$$n! = \prod_{i=1}^{n} i$$
% Menge aller ungeraden natürlichen Zahlen
$$\{ x \mid x \in \mathds{N}, \mathrm{ungerade}(x) \}$$
% Elimination $\neg\exists x$
$$\neg\exists x . p(x) \Leftrightarrow \forall x . \neg p(x)$$
\end{minted}
\codeblock{latex}{./exercises/maths/math-formulas.code.done.tex}

View File

@ -1,2 +1,6 @@
% Ersetzt diese Grafik durch die entsprechenden Formeln:
% !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}

View File

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

View File

@ -1,3 +1,4 @@
Setzt die folgenden Formeln und beachtet dabei die Größe der Klammern.
\section{Typesetting mathematics}
\exercisematerial{exercises/maths/math-formulas}
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.

View File

@ -3,14 +3,15 @@
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\title{Übung zur Projektstruktur}
\title{Exercise on Project Structure}
\begin{document}
\maketitle
\tableofcontents
\include{section1}
\include{section2}
\include{section3}
\newpage
\input{section1}
\newpage
\input{section2}
\end{document}

View File

@ -4,8 +4,9 @@
\maketitle
\tableofcontents
\include{section1.done}
\include{section2.done}
\include{section3.done}
\newpage
\input{section1.done}
\newpage
\input{section2.done}
\end{document}

View File

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

View File

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

View File

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

View File

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

View File

@ -1,9 +0,0 @@
\section{Dritter Abschnitt}
Tart dragée bear claw icing fruitcake. Caramels marzipan jujubes bonbon. Fruitcake danish cookie halvah cake. Cheesecake sesame snaps jelly beans. Macaroon powder pie biscuit biscuit croissant cotton candy. Chocolate bar chupa chups tart cheesecake gingerbread tart. Ice cream muffin chupa chups sugar plum dragée topping marshmallow dragée.
Brownie chocolate cake oat cake soufflé ice cream brownie soufflé pudding. Wafer toffee topping bonbon. Croissant cheesecake halvah ice cream pudding. Jelly pastry carrot cake dragée. Jelly-o cotton candy croissant.
Halvah pie donut sweet pudding sweet roll soufflé tart tiramisu. Fruitcake soufflé lemon drops croissant croissant sweet lemon drops icing. Jelly cheesecake cotton candy jujubes candy canes. Gummi bears gummies pie pudding sweet roll cake wafer. Icing powder ice cream carrot cake pudding sesame snaps. Caramels brownie lemon drops macaroon. Oat cake sesame snaps chocolate cake bear claw muffin chocolate fruitcake pie.
Bear claw wafer jelly-o jujubes donut powder jelly-o soufflé gummi bears. Carrot cake gummies gummi bears chocolate cake. Soufflé dessert jelly beans wafer. Sugar plum liquorice icing. Gummies marzipan lemon drops apple pie. Jelly-o icing lemon drops cake. Chupa chups chocolate sesame snaps gingerbread pastry bear claw carrot cake apple pie.

View File

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

View File

@ -1,23 +1,24 @@
\begin{enumerate}
\item
\textbf{Lagert die einzelnen Abschnitte in eigene Dateien \mintinline{latex}{section1.tex}, \mintinline{latex}{section2.tex} und \mintinline{latex}{section3.tex} aus und bindet sie mittels \mintinline{latex}{\include} ein.}
\begin{figure}[H]
\inputminted[linenos=true]{latex}{exercises/project-structure/main-with-preamble.done.tex}
\caption{\mintinline{latex}{main.tex}}
\end{figure}
\begin{figure}[H]
\inputminted[linenos=true,breaklines=true]{latex}{exercises/project-structure/section1.done.tex}
\caption{\mintinline{latex}{section1.tex} (analog für die anderen Abschnitte)}
\end{figure}
\item
\textbf{Welcher Befehl wird durch \mintinline{latex}{\include} überflüssig?} \\
\mintinline{latex}{\include} sorgt eigenständig dafür, dass der Inhalt jeder eingebundener Datei auf einer eigenen Seite erscheint. Der Befehl \mintinline{latex}{\newpage} ist somit überflüssig.
\item
\textbf{Kann auch die Präambel ausgelagert werden? Wenn nicht, warum? Wenn doch, wofür ist diese Vorgehensweise eventuell nützlich?} \\
Auch die Präambel kann ausgelagert werden. Das Vorgehen entspricht dem aus Aufgabe 1 bekannten. In realen \LaTeX-Projekten sind häufig sehr viele Pakete eingebunden, die oftmals mit zusätzlichen Befehlen in der Präambel konfiguriert werden müssen. Es ist daher gute Praxis, die Präambel auszulagern. Das hat zudem den Vorteil, dass wir eine Datei mit den am häufigsten verwendeten Paketen einfach von einem Projekt ins andere mitnehmen können, ohne unsere Präambel immer wieder neu zu schreiben.
\item
\textbf{Ergänzt in der Präambel den Befehl \mintinline{latex}{\includeonly{section2}}. Kompiliert das Dokument und prüft, was sich geändert hat. Welche Funktion hat dieser Befehl und wofür könnte er bei einem größeren Projekt hilfreich sein? } \\
Der Befehl \mintinline{latex}{\includeonly{section2}} tut genau, was er sagt. Beim Kompilieren werden unter allen \mintinline{latex}{\include}-Statements nur noch diejenigen beachtet, deren Dateinamen auch in \mintinline{latex}{\includeonly{datei1,datei2,…}} vorkommen.
Wenn in größeren Projekten die Kompilierzeit mit jeder Seite länger wird, ist \mintinline{latex}{\includeonly} sehr nützlich. Mit der richtigen Einstellung wird nur kompiliert, woran wir gerade arbeiten. Vor dem finalen Kompiliervorgang können wir dann das \mintinline{latex}{\includeonly}-Statement entfernen und erhalten unser vollständiges PDF.
\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}

View File

@ -1,6 +1,5 @@
\begin{enumerate}
\item Lagert die einzelnen Abschnitte in eigene Dateien \mintinline{latex}{section1.tex}, \mintinline{latex}{section2.tex} und \mintinline{latex}{section3.tex} aus und bindet sie mittels \mintinline{latex}{\include} ein.
\item Welcher Befehl wird durch \mintinline{latex}{\include} überflüssig?
\item Kann auch die Präambel ausgelagert werden? Wenn nicht, warum? Wenn doch, wofür ist diese Vorgehensweise eventuell nützlich?
\item Ergänzt in der Präambel den Befehl \mintinline{latex}{\includeonly{section2}}. Kompiliert das Dokument und prüft, was sich geändert hat. Welche Funktion hat dieser Befehl und wofür könnte er bei einem größeren Projekt hilfreich sein?
\end{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}

View File

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

View File

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

View File

@ -1,15 +1,14 @@
C\# ist eine objektorientierte Programmiersprache, die im Auftrag von Microsoft entwickelt wurde und die es mittlerweile seit 2001 gibt. In der Abbildung seht ihr das Logo der Programmiersprache.
% !TeX root = ../../main-exercises.tex
C\# is an object-oriented programming language that was developed by Microsoft in 2011. In the figure we can see the logo of the programming language.
\begin{figure}[H]
\caption{Das Logo der Programmiersprache C\#}
\centering
\includegraphics[width=2cm]{exercises/references/csharp.png}
\caption{The logo of C\#}
\end{figure}
Das nachstehende Quelltext-Listing zeigt ein Programm, dass den Text \enquote{Hello LaTeX friends!} auf der Konsole ausgibt. Ähnlich wie bei Java, werden auch in C\# Klassen und eine Main-Methode verwendet, um eine ausführbare Anwendung zu bauen.
\inputminted[breaklines, linenos=true]{csharp}{exercises/references/HelloLateXFriends.cs}
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}

View File

@ -1,3 +1,11 @@
Ersetzt im Text in der Datei \mintinline{bash}{exercises/references/references.tex} die Phrasen \enquote{in der Abbildung} und \enquote{Das nachstehende Quelltext-Listing} jeweils durch eine Referenz auf das Bild und auf das Quelltext-Listing. Nutzt dafür den Befehl \mintinline{latex}{\cref}. Achtet darauf, dass ihr zunächst Labels für die Elemente, die ihr referenzieren wollt, vergeben müsst. Hüllt das Quelltext-Listing dafür zunächst in eine Umgebung namens \mintinline{latex}{listing} und fügt noch eine Beschriftung hinzu. Achtet auch auf geeignete Präfixe vor den Labels.
% same chapter as footnotes
\subsection{Inserting references}
\exercisematerial{exercises/references/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 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.

View File

@ -0,0 +1,8 @@
\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}

View File

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

View File

@ -0,0 +1,15 @@
% 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}

View File

@ -0,0 +1,3 @@
% !TeX root = ../../main-exercises.tex
Your listings go here.

View File

@ -1,26 +0,0 @@
\usemintedstyle{native}
\definecolor{ourBackgroundColor}{rgb}{0.1,0.1,0.2}
\inputminted[
breaklines,
linenos=true,
bgcolor=ourBackgroundColor,
firstline=5,
lastline=7,
gobble=4
]{java}{exercises/source-code-listings/Source.java}
\usemintedstyle{default}
\begin{minted}{latex}
\usemintedstyle{native}
\definecolor{ourBackgroundColor}{rgb}{0.1,0.1,0.2}
\inputminted[
breaklines, % Zeilenumbrüche
linenos=true, % Zeilennummerierung
bgcolor=ourBackgroundColor, % Hintergrundfarbe
firstline=5, % erste Zeile
lastline=7, % letzte Zeile
gobble=4 % Leerzeichen entfernen
]{java}{exercises/source-code-listings/Source.java}
\end{minted}

View File

@ -1,17 +1,36 @@
Im Ordner \mintinline{text}{exercises/source-code-listings} findet ihr eine Datei namens \mintinline{text}{Source.java}.
Wir werden diese im Folgenden in unser Dokument einbinden und das Aussehen unseren Wünschen anpassen.
\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 Bindet die Datei an dieser Stelle ein.
\item Aktiviert Syntax-Highlighting durch Angabe der Sprache Java.
\item Lasst LaTeX zu lange Zeilen automatisch umbrechen.
\item Die Zeilen sollen nummeriert sein.
\item Nutzt das Theme \mintinline{latex}|native|.
\item Dieses Theme ist für einen dunklen Hintergrund optimiert. Ändert die Hintergrundfarbe des Themes zu dunkelblau.
\item Bindet jetzt ausschließlich die Zeilen 5 bis 7 ein.
\item Entfernt die Leerzeichen am Anfang der Zeilen durch Angabe der richtigen Option. (Hinweis: Die Dokumentation spricht hier von \mintinline{latex}|gobble|.)
\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}
Konsultiert bei Fragen die Dokumentation des Paketes Minted.
\section*{Listings tasks}
\exercisematerial{exercises/source-code-listings/task-1}
\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}
}{}

View File

@ -0,0 +1,7 @@
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.

View File

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

View File

@ -1 +1,9 @@
Was ist eigentlich ein Semesterticket? Es ist auch als Studi-Ticket oder Studi-Karte bekannt und ermöglicht es euch, kostenlos die öffentlichen Verkehrsmittel in und um Bamberg zu nutzen. In Bamberg wird euer Studierendenausweis u. a. als Semesterticket genutzt. Um es nutzen zu können, solltet ihr den Studierendenausweis in einem der Universitätsgebäude validieren. Dies ist möglich, sobald ihr die Semestergebühr von 101,50 Euro bezahlt habt. Ein Validierungsdrucker befindet sich z. B. im ERBA-Gebäude im Foyer vor der Bibliothek. Die Öffnungszeiten des Uni-Gebäudes an der Weberei sind Mo. - Fr., 7.00 - 22.00 Uhr.
% !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.

View File

@ -1,10 +1,13 @@
\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 Im Text in \mintinline{bash}{exercises/special-characters/special-characters.tex} findet ihr eine Reihe an Abkürzungen. Ersetzt die Leerzeichen innerhalb der Abkürzungen durch schmale Leerzeichen. Setzt außerdem ein schmales Leerzeichen vor das Wort \emph{Euro}.
\item Ersetzt die Bindestriche bei den Öffnungszeiten der ERBA durch Halbgeviertstriche.
\item Setzt beim Wort \emph{Studierendenausweis} eine ausschließliche Trennstelle nach \enquote{Studierenden-}.
\item Setzt die Wörter \emph{Studi-Ticket} und \emph{Studi-Karte} in Anführungszeichen. Nutzt dafür den Befehl \mintinline{latex}{\enquote}.
\item Ersetzt das Wort \emph{Euro} durch ein Euro-Zeichen.
\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}
\exercisematerial{exercises/special-characters/special-characters}

View File

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

View File

@ -1,29 +1,15 @@
\begin{minted}[breaklines]{latex}
\begin{table}[h]
\centering
\begin{tabular}{clll}
\toprule
Nr. & Name & Kürzel & Semester \\
\midrule
1 & Mathematik für Informatik 1 & GdI-MfI1-B & Winter \\
2 & Datenbanksysteme & MOBI-DBS-B & Sommer \\
3 & Einführung in die Medieninformatik & MI-EMI-B & Winter \\
\bottomrule
\end{tabular}
\caption{Übersicht über einige Veranstaltungen}
\end{table}
\end{minted}
\codeblock{latex}{./exercises/tables/tables.code.done.tex}
\begin{table}[h]
\centering
\begin{tabular}{clll}
\toprule
Nr. & Name & Kürzel & Semester \\
\midrule
1 & Mathematik für Informatik 1 & GdI-MfI1-B & Winter \\
2 & Datenbanksysteme & MOBI-DBS-B & Sommer \\
3 & Einführung in die Medieninformatik & MI-EMI-B & Winter \\
\bottomrule
\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{Übersicht über einige Veranstaltungen}
\end{table}
\caption{Overview over some courses}
\end{table}

View File

@ -1,11 +1,13 @@
% !TeX root = ../../main-exercises.tex
\begin{itemize}
\item Mathematik für Informatik
\subitem Kürzel: GdI-MfI1-B
\subitem Semester: Winter
\item Datenbanksysteme
\subitem Kürzel: MOBI-DBS-B
\subitem Semester: Sommer
\item Einführung in die Medieninformatik
\subitem Kürzel: MI-EMI-B
\subitem Semester: Winter
\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}

View File

@ -1,5 +1,8 @@
Die folgende Liste zeigt ein paar Eckdaten über einige Lehrveranstaltungen an der Fakultät WIAI. Die Übersicht ist allerdings etwas unschön geraten. Wandelt deshalb die Liste in eine Tabelle mit den Spalten \emph{Name}, \emph{Kürzel} und \emph{Semester} um. Fügt zusätzlich eine \emph{zentrierte Spalte} ein, in denen ihr die Veranstaltungen nummeriert. Fügt außerdem eine Tabellenunterschrift hinzu. Arbeitet hierfür bitte in der Datei \mintinline{bash}{exercises/tables/tables.tex}.
\exercisematerial{exercises/tables/tables}
\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}.

View File

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

View File

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

View File

@ -1,3 +1,9 @@
Die Rekursion ist eine bekannte Problemlösestrategie in der Informatik. Dabei wird ein großes Problem zerlegt und zunächst nur ein Teil der Aufgabe gelöst. Oft wird Rekursion innerhalb von Programmcode umgesetzt, indem eine Methode sich immer wieder selbst aufruft, bis eine bestimmte Abbruchbedingung erfüllt ist. Das heißt, dass das Programm theoretisch bis ins Unendliche weiterlaufen kann, wenn es rekursiv ist.
% !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
Weite Informationen findet ihr im Wikipedia-Artikel zur Rekursion unter https://de.wikipedia.org/wiki/Rekursion.

View File

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

View File

@ -0,0 +1,36 @@
\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 Github: \url{https://github.com/fs-wiai/latex-script/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}
Lets start with the compiler.
(Seriously!)
We will need it to convert our \LaTeX{} documents into \acro{PDF}s.
There are different compilers for different operating systems;
for example, MikTeX for Windows,\footnote{\url{https://miktex.org/download}} Mac\TeX{} for macOS,\footnote{\url{http://tug.org/mactex/}} and \TeX{}Live for Linux distributions.\footnote{On Debian-based Linux distributions, install the compiler by executing \sh{sudo apt install texlive-full.}
For other distributions, see \url{https://tug.org/texlive/doc/texlive-en/texlive-en.html\#installation}.}
In case you get to choose, it is best to install the full version with all packages.
\section*{Editor}
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

Binary file not shown.

BIN
graphics/cover-script.pdf Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
graphics/faForward.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 809 B

1
graphics/faForward.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416V96C0 83.6 7.2 72.3 18.4 67s24.5-3.6 34.1 4.4L224 214.3V256v41.7L52.5 440.6zM256 352V256 128 96c0-12.4 7.2-23.7 18.4-29s24.5-3.6 34.1 4.4l192 160c7.3 6.1 11.5 15.1 11.5 24.6s-4.2 18.5-11.5 24.6l-192 160c-9.5 7.9-22.8 9.7-34.1 4.4s-18.4-16.6-18.4-29V352z"/></svg>

After

Width:  |  Height:  |  Size: 553 B

BIN
graphics/faWindows.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 863 B

1
graphics/faWindows.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M0 93.7l183.6-25.3v177.4H0V93.7zm0 324.6l183.6 25.3V268.4H0v149.9zm203.8 28L448 480V268.4H203.8v177.9zm0-380.6v180.1H448V32L203.8 65.7z"/></svg>

After

Width:  |  Height:  |  Size: 383 B

Binary file not shown.

Binary file not shown.

13
imprint.tex Normal file
View File

@ -0,0 +1,13 @@
\newpage
\thispagestyle{empty}
\mbox{}
\vfill
\begin{tabular}{@{}lp{9cm}}
& \subsubsection*{Imprint} \\
& The \LaTeX{} Script (version 1.4.2 from May 15th, 2025) has been assembled by the Student Council of the Information Systems and Applied Computer Sciences Faculty (Fachschaft \acro{WIAI}) at the University of Bamberg. \\
& It is licensed under Creative Commons \enquote{Attribution-ShareAlike 4.0 International} (CC BY-SA 4.0): \\
\href{http://creativecommons.org/licenses/by-sa/4.0/}{\includegraphics[height=.5cm]{graphics/cc-by-sa}} & \url{http://creativecommons.org/licenses/by-sa/4.0/} \\ \\
& Upon request, allowances exceeding the limitations of this license may be granted.
\end{tabular}

1
install-verification/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.pdf

View File

@ -0,0 +1,67 @@
\documentclass[a4paper,english]{report}
\IfFileExists{listings-mode.tex}{
\input{listings-mode.tex}
}{
\newcommand\listingsmode{default}
}
% Language and font encoding
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english,ngerman]{babel}
% Special characters
\usepackage{eurosym, tipa, textcomp, textgreek, upgreek}
% Mathematical symbols
\usepackage{amssymb, amsfonts, amsmath, dsfont}
% References and URLs
\usepackage[hidelinks]{hyperref}
\usepackage{cleveref}
% Images
\usepackage{graphicx}
\usepackage{float}
% Text color
\usepackage[usenames,dvipsnames]{xcolor}
% Multiple captions in one figure
\usepackage{subcaption}
% Compact lists
\usepackage{paralist}
% Tables
\usepackage{longtable, array, tabularx, booktabs, colortbl}
% PDF imports
\usepackage{pdfpages}
% ToDos
\usepackage{todonotes}
\usepackage{changes}
% Source code listings
\usepackage{listings}
\ifthenelse{\equal{\listingsmode}{minted}}{\usepackage{minted}}{}
% Quotes (\enquote)
\usepackage[autostyle,autopunct=false]{csquotes}
% Literature
\usepackage{natbib}
% Line wraps in monospace font
\usepackage[htt]{hyphenat}
% Tracking changes
\usepackage{changes}
\begin{document}
It works.
\end{document}

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