-
Notifications
You must be signed in to change notification settings - Fork 7
/
settings_listings.tex
71 lines (71 loc) · 1.71 KB
/
settings_listings.tex
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
% settings for listings.sty
\renewcommand{\lstlistingname}{代码清单}
\lstdefinestyle{lfonts}{
basicstyle = \footnotesize\ttfamily,
stringstyle = \color{purple},
keywordstyle = \color{blue!60!black}\bfseries,
commentstyle = \color{olive}\scshape,
}
\lstdefinestyle{lnumbers}{
numbers = left,
numberstyle = \tiny,
numbersep = 1em,
firstnumber = 1,
stepnumber = 1,
}
\lstdefinestyle{llayout}{
breaklines = true,
tabsize = 2,
columns = flexible,
}
\lstdefinestyle{lgeometry}{
xleftmargin = 20pt,
xrightmargin = 0pt,
frame = tb,
framesep = \fboxsep,
framexleftmargin = 20pt,
}
\lstdefinestyle{lgeneral}{
style = lfonts,
style = lnumbers,
style = llayout,
style = lgeometry,
}
\def\beginlstdelim#1#2#3{%
\def\endlstdelim{#2\egroup}%
\ttfamily#1\bgroup\color{#3}\aftergroup\endlstdelim}
\lstdefinestyle{ldelims}{
moredelim = **[is][\beginlstdelim{\$}{\$}{orange}]{\$}{\$},
moredelim = **[is][\beginlstdelim{\{}{\}}{ForestGreen}]{\{}{\}},
moredelim = **[is][\beginlstdelim{[}{]}{cyan}]{[}{]},
}
% LaTeX lst style
\lstdefinestyle{lltx}{
language = {[LaTeX]TeX},
style = lgeneral,
style = ldelims,
morekeywords = {% LaTeX original commands
maketitle,
rmfamily, sffamily, ttfamily,
itshape, slshape, scshape,
mdseries, bfseries, emph,
textrm, textsf, texttt,
textit, textsl, textsc,
textmd, textbf,
newcommand, renewcommand, providecommand,
cs, meta, marg, oarg, parg
}
}
\lstdefinestyle{iltx}{
style = lltx,
basicstyle = \ttfamily
}
\lstdefinestyle{lbash}{
language = {bash},
style = lgeneral,
}
\lstdefinestyle{ibash}{
style = lbash,
basicstyle = \ttfamily
}
\endinput