update tasks on source code listings

This commit is contained in:
Fradtschuk 2021-04-26 23:16:14 +02:00
parent bd4d7ec6fc
commit 8c8920c432
2 changed files with 19 additions and 12 deletions

View File

@ -114,14 +114,18 @@ breaklines=true,
@slide(layout=task) @slide(layout=task)
@task-number @task-number
9 8
@title @title
Quelltext einbinden Quelltext einbinden
@content @content
* Abschnitt 2.4 enthält zwei auskommentierte **Listings**. * Im Ordner `exercises/source-code-listings` findet ihr eine Datei namens `Source.java`. Wir werden diese im Folgenden in unser Dokument einbinden und das Aussehen unseren Wünschen anpassen.
* ++ Bindet zunächst das **Paket `minted`** an der richtigen Stelle ein. * ++ **Bindet** den Java-Quelltext in der Datei `task-1.raw.tex` **ein**.
* ++ Nutzt die **`minted`-Umgebung**, um das erste Listing mit Syntax Highlighting zu versehen. * ++ Aktiviert das **Syntax-Highlighting** durch Angabe der Sprache Java.
* ++ Lagert das zweite Listing in eine **neue Datei** aus und bindet sie mit `\inputminted` ein. * ++ Verwendet eine Option, um die Zeilen zu **nummerieren**.
* ++ Ändert das **Farbschema** zu `borland`. * ++ Nutzt das **Theme** `native`.
* ++ Ändert die **Hintergrundfarbe** des Themes zu dunkelblau.
* ++ Bindet jetzt nur die **Zeilen 5 bis 7** ein.
* ++ Entfernt die **Leerzeichen** am Anfang der Zeilen durch die passende Option (Tipp: Die Dokumentation spricht hier von `gobble`).
* ++ Seht bei Fragen in der Dokumentation des Paketes *Minted* nach.

View File

@ -114,14 +114,17 @@ breaklines=true,
@slide(layout=task) @slide(layout=task)
@task-number @task-number
9 8
@title @title
Listing source code Listing source code
@content @content
* Section 2.4 contains two **listings** that are currently commented out. * In the directory `exercises/source-code-listings` you can find a file named `Source.java`, which we want to include in our document.
* ++ Include the **`minted` package** in the right place. * ++ **Include** the java code in the file `task-1.raw.tex1`.
* ++ Make use of the **`minted` environment** to activate syntax highlighting for the first listing. * ++ **Number** the code lines.
* ++ Move the second listing to a **new file** and include it using `\inputminted`. * ++ Use the **theme** `native`.
* ++ Change the **color scheme** to `borland`. * ++ Change the **background colour** to dark blue.
* ++ Now only include **lines 5 to 7**.
* ++ Delete the **spaces** at the beginning of the lines by using a suitable option (Hint: The documentation speaks of `gobble`).
* ++ If you have questions, try to consult the documentation of the Minted package.