-
Notifications
You must be signed in to change notification settings - Fork 0
/
listings-json.sty
46 lines (42 loc) · 1.08 KB
/
listings-json.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{listings-rust}[2018/01/23 Custom Package]
\RequirePackage{color}
\RequirePackage{listings}
\lstdefinelanguage{JSON}{
basicstyle=\ttfamily,
comment=[l]{//}, % Though JSON doesn't allow comments, this is just for completeness
commentstyle=\color[gray]{0.4},
showstringspaces=false,
string=[s]{"}{"},
morestring=[b]',
% Highlight true, false, null as special keywords:
literate=
*{true}{{{\color{blue}true}}}4
{false}{{{\color{blue}false}}}5
{null}{{{\color{blue}null}}}4,
}
\lstdefinestyle{colouredJson}{%
language=Json,
basicstyle=\ttfamily,
commentstyle=\color[gray]{0.4},
stringstyle=\color[rgb]{0,0,0.5},
columns=flexible,
keepspaces=true,
showspaces=false,
showtabs=false,
showstringspaces=false,
}
\lstdefinestyle{boxedJson}{%
style=colouredJson,
numbers=left,
firstnumber=auto,
numberblanklines=true,
frame=single,
numberstyle=\tiny,
numbersep=7pt,
framesep=5pt,
framerule=1pt,
xleftmargin=15pt,
backgroundcolor=\color[gray]{0.97},
rulecolor=\color[gray]{0.90},
}