From 38db18a4925079829ab3131f4a06bdf9040778ac Mon Sep 17 00:00:00 2001 From: Marcel Schwarz Date: Wed, 10 Jun 2020 23:46:41 +0200 Subject: [PATCH] Add JSON formatting for listings --- documentation/documentation.tex | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/documentation/documentation.tex b/documentation/documentation.tex index b52abfb..03b9952 100644 --- a/documentation/documentation.tex +++ b/documentation/documentation.tex @@ -26,7 +26,7 @@ % Code \usepackage{listings} -\usepackage{color} +\usepackage{xcolor} \definecolor{dkgreen}{rgb}{0,0.6,0} \definecolor{gray}{rgb}{0.5,0.5,0.5} \definecolor{mauve}{rgb}{0.58,0,0.82} @@ -97,6 +97,33 @@ sensitive=true, stringstyle={\color{dkgreen}\ttfamily}, } +\colorlet{punct}{red!60!black} +\definecolor{delim}{RGB}{20,105,176} +\colorlet{numb}{magenta!60!black} +\lstdefinelanguage{json}{ + basicstyle=\normalfont\ttfamily, + stepnumber=1, + numbersep=8pt, + showstringspaces=false, + breaklines=true, + literate= + *{0}{{{\color{numb}0}}}{1} + {1}{{{\color{numb}1}}}{1} + {2}{{{\color{numb}2}}}{1} + {3}{{{\color{numb}3}}}{1} + {4}{{{\color{numb}4}}}{1} + {5}{{{\color{numb}5}}}{1} + {6}{{{\color{numb}6}}}{1} + {7}{{{\color{numb}7}}}{1} + {8}{{{\color{numb}8}}}{1} + {9}{{{\color{numb}9}}}{1} + {:}{{{\color{punct}{:}}}}{1} + {,}{{{\color{punct}{,}}}}{1} + {\{}{{{\color{delim}{\{}}}}{1} + {\}}{{{\color{delim}{\}}}}}{1} + {[}{{{\color{delim}{[}}}}{1} + {]}{{{\color{delim}{]}}}}{1}, +} \usepackage{setspace} \setstretch{1.2} %Zeilenabstand