-
Notifications
You must be signed in to change notification settings - Fork 0
/
my_little_nosql.sty
114 lines (105 loc) · 3.16 KB
/
my_little_nosql.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
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
\ProvidesPackage{my_little_nosql}
\RequirePackage{cmap}
\RequirePackage{graphicx}
\RequirePackage{tabularx}
\RequirePackage{indentfirst}
\RequirePackage{mathtext}
\RequirePackage[T1]{fontenc}
\RequirePackage[utf8]{inputenc}
\RequirePackage[english]{babel}
\RequirePackage{listings}
\RequirePackage[scaled]{beramono}
\RequirePackage{tgadventor}
\RequirePackage{times}
\RequirePackage[usenames,dvipsnames]{color}
\RequirePackage[colorlinks=true]{hyperref}
\RequirePackage{amssymb,amsmath,amsfonts}
\RequirePackage{perpage} %the perpage package
\RequirePackage{wrapfig}
\RequirePackage{pdfpages} % cover image
\RequirePackage{lmodern}
\RequirePackage{multicol}
\graphicspath{{images/}{logos/}}
\sloppy
\definecolor{lineno}{rgb}{0.5,0.5,0.5}
\definecolor{code}{rgb}{0,0.1,0.6}
\definecolor{keyword}{rgb}{0.5,0.1,0.1}
\definecolor{titlebox}{rgb}{0.85,0.85,0.85}
\definecolor{download}{rgb}{0.8,0.1,0.5}
\definecolor{code_title}{rgb}{0.8,0.1,0.4}
\definecolor{title}{rgb}{0.2,0.2,0.2}
\lstset{
language=SQL,
basicstyle=\ttfamily\small\color{code},
showspaces=false,
showstringspaces=false,
breaklines=true, % Автоматический перенос строк
breakatwhitespace=true,
numbers=left,
firstnumber=1,
stepnumber=5,
numberfirstline=true,
numberstyle=\color{lineno}\sffamily\scriptsize,
keywordstyle=\color{keyword}\bfseries,
stringstyle=\itshape,
morekeywords={dosync,if},
deletekeywords={alter},
keepspaces=true
}
\lstdefinelanguage{JavaScript}{
keywords={typeof, new, true, false, catch, function, return, null, catch, switch, var, if, in, while, do, else, case, break},
keywordstyle=\color{blue}\bfseries,
ndkeywords={class, export, boolean, throw, implements, import, this},
ndkeywordstyle=\color{darkgray}\bfseries,
identifierstyle=\color{black},
sensitive=false,
comment=[l]{//},
morecomment=[s]{/*}{*/},
commentstyle=\color{purple}\ttfamily,
stringstyle=\color{red}\ttfamily,
morestring=[b]',
morestring=[b]"
}
\makeatletter
\gdef\lst@SkipOrPrintLabel{%
\ifnum\lst@skipnumbers=\z@
\global\advance\lst@skipnumbers-\lst@stepnumber\relax
\lst@PlaceNumber
\lst@numberfirstlinefalse
\else
\lst@ifnumberfirstline
{\def\thelstnumber{Line \@arabic\c@lstnumber}\lst@PlaceNumber}%
\lst@numberfirstlinefalse
\else
{\def\thelstnumber{-}\lst@PlaceNumber}%
\fi
\fi
\global\advance\lst@skipnumbers\@ne}%
\def\lst@maketitle#1{
\vskip\abovecaptionskip
\colorbox{titlebox}{
%\scriptsize
\small
\color{download}\ttfamily\href{http://nosql.leopard.in.ua/codes/#1}{Скачать}
\color{title}\sffamily\bfseries#1}
\vskip\belowcaptionskip}
\def\lst@makecaption#1#2{
\vskip\abovecaptionskip
\colorbox{titlebox}{
%\scriptsize
\small
\color{code_title}\ttfamily#1
\color{title}\sffamily\bfseries#2}
\vskip\belowcaptionskip}
\makeatother
\let\olditemize=\itemize
\def\itemize{
\olditemize
\setlength{\itemsep}{-1ex}
}
\let\oldenumerate=\enumerate
\def\enumerate{
\oldenumerate
\setlength{\itemsep}{-1ex}
}
\MakePerPage{footnote} %the perpage package command