2019-05-06 14:50:23 +02:00

32 lines
851 B
Markdown

TODO: Listings
---
<div class="layout-content-and-preview">
<div class="layout-content">
<h2>Codeblöcke mit Syntaxhighlighting</h2>
<p>Paket <code>minted</code></p>
<p>Voraussetzungen: das Python-Paket <code>Pygments</code></p>
<p>--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)</p>
<pre class="lang-tex hljs">
<code>
\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}
</code>
</pre>
</div>
<div class="preview-layout">
<img src="sections/german/10/minted.png">
</div>