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 @@
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}
-
-
-
+
+ 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}
+
+ 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
+
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
|.
+ \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}
+
+
+ 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}
+