From ed3c2bdc2e38f74ce9d73421609725707dc4941d Mon Sep 17 00:00:00 2001 From: teridax Date: Tue, 5 Sep 2023 16:11:29 +0200 Subject: [PATCH] added custom minted configuration --- minted/main.tex | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/minted/main.tex b/minted/main.tex index 77323cd..7d0f724 100644 --- a/minted/main.tex +++ b/minted/main.tex @@ -1,13 +1,12 @@ \documentclass{article} % =================================================== -% _____ _ +% _____ _ % | ____|_ ____ _ _ __ ___ _ __ | | ___ % | _| \ \/ / _` | '_ ` _ \| '_ \| |/ _ \ % | |___ > < (_| | | | | | | |_) | | __/ % |_____/_/\_\__,_|_| |_| |_| .__/|_|\___| -% |_| -% =================================================== +% |_| % License: MIT % Author: Sven Vogel @@ -15,12 +14,30 @@ % Based on the tutorial at: % https://www.overleaf.com/learn/latex/Code_Highlighting_with_minted +% More infos can be found here: +% https://tug.ctan.org/macros/latex/contrib/minted/minted.pdf % =================================================== % include the required package % make sure this is installed: % > tlmgr install minted \usepackage{minted} + +% =================================================== +% set global style for minted +\usemintedstyle{borland} + +% set global options for all listings +% these can also be applied locally to individual listings +\setminted { + linenos=true, % enable line numbers + bgcolor=lightgray, % background color + resetmargins=true, + tabsize=4, % white spaces for tabs + xleftmargin=24pt, % margin to the left side. can be used to include line numbers + escapeinside=|| % symbols used to escape LaTeX +} + % =================================================== \title{Minted-Syntax-Hightlightning-Test} @@ -48,12 +65,16 @@ The following will show some syntax highlighted source code: def incmatrix(genl1,genl2): for i in range(m-1): for j in range(i+1, m): + // TODO: do sth. [r,c] = np.where(M2 == M1[i,j]) for k in range(len(r)): VT[(i)*n + r[k]] = 1; VT[(i)*n + c[k]] = 1; VT[(j)*n + r[k]] = 1; VT[(j)*n + c[k]] = 1; + + # the following text is escaped LaTeX + |\colorbox{yellow}{test}| if M is None: M = np.copy(VT) @@ -67,6 +88,9 @@ def incmatrix(genl1,genl2): \label{listing:1} % add a label for referencing \end{listing} +% inline code: +Here we have inline code: \mintinline{python}{print(x**2)}. See? + This code is imported from a file: % import code from a file: @@ -78,4 +102,4 @@ This code is imported from a file: % =================================================== -\end{document} +\end{document} \ No newline at end of file