diff --git a/css/theme/latex.css b/css/theme/latex.css index 45386af..c85e5e2 100644 --- a/css/theme/latex.css +++ b/css/theme/latex.css @@ -447,3 +447,30 @@ kbd { .emoji { font-family: "Twemoji"; } + +/* + * Links + * ============ + */ +p { + z-index: 1; } + +p a:link, p a:hover, p a:active, p a:visited { + text-decoration: none; + color: var(--secondary-dark); + font-weight: bold; + position: relative; + z-index: 1; } + p a:link::before, p a:hover::before, p a:active::before, p a:visited::before { + content: ''; + position: absolute; + width: 102%; + height: 0; + background-color: var(--secondary-light); + z-index: -1; + bottom: -5%; + left: -1%; + transition: .2s height ease; } + +p a:hover::before { + height: 110%; } diff --git a/css/theme/source/latex.scss b/css/theme/source/latex.scss index 365a6bf..c504059 100644 --- a/css/theme/source/latex.scss +++ b/css/theme/source/latex.scss @@ -558,4 +558,42 @@ kbd { .emoji { font-family: "Twemoji"; -} \ No newline at end of file +} + +/* + * Links + * ============ + */ +p { + z-index: 1; +} + +p a { + &:link, + &:hover, + &:active, + &:visited { + text-decoration: none; + color: var(--secondary-dark); + font-weight: bold; + position: relative; + z-index: 1; + + &::before { + content: ''; + position: absolute; + width: 102%; + height: 0; + background-color: var(--secondary-light); + z-index: -1; + bottom: -5%; + left: -1%; + transition: .2s height ease; + } + } + + &:hover::before { + height: 110%; + + } +} diff --git a/sections/german/10/10.md b/sections/german/10/10.md index 9f8e305..9e7f0ba 100644 --- a/sections/german/10/10.md +++ b/sections/german/10/10.md @@ -1,6 +1,6 @@
-

🖥️
Code-Listings

+

🖥️
Quelltext-Listings

@@ -8,28 +8,96 @@
-

Codeblöcke mit Syntaxhighlighting

-

Paket minted

-

Voraussetzungen: das Python-Paket Pygments

-

--shell-escape Flag hinzufügen (TeXstudio: Options > Configure TeXstudio > Commands "pdflatex -syntex=1 -interaction=nonstopmode %.tex" in "pdflatex -syntex=1 -interaction=nonstopmode --shell-escape %.tex" ändern)

-
-    
-\begin{minted}{java}
-public class Duck {
-    public static void main(String[] args) {
-        System.out.println("Hallo,Welt!");
-    }
-}
-\end{minted}
-
-\begin{minted}{python}
-def printHello:
-    print("Hallo, Welt!")
-\end{minted}
-
-
-
-
- +

Installation

+

+ Mit dem Paket minted lässt sich Quelltext gut darstellen. Dafür wird die Programmiersprache Python benötigt. +

+

+ Nach der Installation von Python kann das zugehörige Paket Pygments in der Eingabeaufforderung installiert werden durch: +

+
pip install Pygments
+

Anschließend muss das LaTeX-Paket nur noch eingebunden werden:

+
\usepackage{minted}
+
+
+ +
+--- + +
+
+

Anpassungen beim Kompilieren

+
+

+ Um Dokumente mit Quelltext-Listings kompilieren zu können, muss die Flag --shell-escape an den Compiler übergeben werden. +

+
+

+ In TeXstudio muss diese unter Optionen > TeXstudio konfigurieren > Befehle + bei PdfLaTeX vor %.tex ergänzt werden: +

+

+ pdflatex -syntex=1 -interaction=nonstopmode --shell-escape %.tex +

+
+
+ +--- + +
+
+

Code im LaTeX-Quelltext

+

In einer eigenen Umgebung:

+
\section{Haskell}
+Quadrate aller geraden Zahlen zwischen 1 und 200:
+\begin{minted}{haskell}
+[x^2 | x <- [1..200], even x]
+\end{minted}
+

Inline im Quelltext:

+
\section{HTML}
+Eine Überschrift wird so ausgezeichnet:
+\mint{html}|

LaTeX im Studium

|.
+
+
+ +
+
+ +--- + +
+
+

Code aus externen Dateien

+
\section{Java}
+\inputminted{java}{HelloWorld.java}
+
public class HelloWorld {
+  public static void main(String[] args) {
+    System.out.println("Hello, World!");
+  }
+}
+
+
+ +
+
+ +--- + +
+
+

Minted konfigurieren

+

+ Durch optionale Parameter können Zeilennummerierung, Umbrüche, Farben und Themes für das Syntax Highlighting ausgewählt werden: +

+
\begin{minted}[
+linenos=true,
+tabsize=4,
+breaklines=true,
+]{javascript}
+    % ...
+\end{minted}
+

🔗 Dokumentation von Overleaf

+
+
\ No newline at end of file diff --git a/sections/german/10/Test.java b/sections/german/10/Test.java new file mode 100644 index 0000000..aec5385 --- /dev/null +++ b/sections/german/10/Test.java @@ -0,0 +1,5 @@ +public class Test { + public static void main(String[] args) { + System.out.println("Hello, World!"); + } +} \ No newline at end of file diff --git a/sections/german/10/minted-haskell-crop.svg b/sections/german/10/minted-haskell-crop.svg new file mode 100644 index 0000000..bac9619 --- /dev/null +++ b/sections/german/10/minted-haskell-crop.svg @@ -0,0 +1,452 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sections/german/10/minted-haskell-orig.svg b/sections/german/10/minted-haskell-orig.svg new file mode 100644 index 0000000..a99446e --- /dev/null +++ b/sections/german/10/minted-haskell-orig.svg @@ -0,0 +1,452 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sections/german/10/minted-haskell.tex b/sections/german/10/minted-haskell.tex new file mode 100644 index 0000000..ef7ad3a --- /dev/null +++ b/sections/german/10/minted-haskell.tex @@ -0,0 +1,21 @@ +\documentclass[a4paper]{article} +\usepackage{lmodern} +\usepackage{amssymb,amsmath} +\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} +\usepackage{hyperref} +\usepackage{minted} +\begin{document} +\thispagestyle{empty} + +\section{Haskell} +Quadrate aller geraden Zahlen zwischen 1 und 200: +\begin{minted}{haskell} +[x^2 | x <- [1..200], even x] +\end{minted} + +\section{HTML} +Eine Überschrift wird so ausgezeichnet: +\mint{html}|

LaTeX im Studium

|. + +\end{document} diff --git a/sections/german/10/minted-java-crop.svg b/sections/german/10/minted-java-crop.svg new file mode 100644 index 0000000..2dd4f65 --- /dev/null +++ b/sections/german/10/minted-java-crop.svg @@ -0,0 +1,282 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sections/german/10/minted-java-orig.svg b/sections/german/10/minted-java-orig.svg new file mode 100644 index 0000000..ac025ff --- /dev/null +++ b/sections/german/10/minted-java-orig.svg @@ -0,0 +1,282 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sections/german/10/minted-java.tex b/sections/german/10/minted-java.tex new file mode 100644 index 0000000..98faa68 --- /dev/null +++ b/sections/german/10/minted-java.tex @@ -0,0 +1,13 @@ +\documentclass[a4paper]{article} +\usepackage{lmodern} +\usepackage{amssymb,amsmath} +\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} +\usepackage{hyperref} +\usepackage{minted} +\begin{document} +\thispagestyle{empty} + +\inputminted{java}{Test.java} + +\end{document} diff --git a/sections/german/10/minted-overview-crop.svg b/sections/german/10/minted-overview-crop.svg new file mode 100644 index 0000000..d973da0 --- /dev/null +++ b/sections/german/10/minted-overview-crop.svg @@ -0,0 +1,1364 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sections/german/10/minted-overview-orig.svg b/sections/german/10/minted-overview-orig.svg new file mode 100644 index 0000000..25bf43c --- /dev/null +++ b/sections/german/10/minted-overview-orig.svg @@ -0,0 +1,1364 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sections/german/10/minted-overview.tex b/sections/german/10/minted-overview.tex new file mode 100644 index 0000000..79197df --- /dev/null +++ b/sections/german/10/minted-overview.tex @@ -0,0 +1,45 @@ +\documentclass[a4paper]{article} +\usepackage{lmodern} +\usepackage{amssymb,amsmath} +\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} +\usepackage{hyperref} +\usepackage{minted} +\begin{document} +\thispagestyle{empty} + +\begin{minted}[ +fontfamily=tt, +linenos=true, +numberblanklines=true, +numbersep=12pt, +numbersep=5pt, +gobble=0, +frame=leftline, +framerule=0.4pt, +framesep=2mm, +funcnamehighlighting=true, +tabsize=4, +breaklines=true, +texcl=false, +]{html} +
+
+

Installation

+

+ Mit dem Paket minted lässt sich Quelltext gut darstellen. Dafür wird die Programmiersprache Python benötigt. +

+

+ Nach der Installation von Python kann das zugehörige Paket Pygments in der Eingabeaufforderung installiert werden durch: +

+
pip install Pygments
+

Anschließend muss das LaTeX-Paket nur noch eingebunden werden:

+
\usepackage{minted}
+
+
+ +
+
+\end{minted} + +\end{document} diff --git a/tex2svg b/tex2svg index 8fa6c9c..d66138d 100755 --- a/tex2svg +++ b/tex2svg @@ -2,7 +2,7 @@ 0.upto(15) do |i| Dir.chdir "sections/german/#{i.to_s.rjust(2, '0')}" `ls -1 *.tex`.split("\n").map { |file| file.sub(/\.tex$/, '')}.each do |file| - `pdflatex #{file}.tex` + `pdflatex --shell-escape #{file}.tex` `pdfcrop #{file}.pdf` `pdf2svg #{file}.pdf #{file}-orig.svg` `pdf2svg #{file}-crop.pdf #{file}-crop.svg`