-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathstyle.tex
127 lines (112 loc) · 3.67 KB
/
style.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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
\usepackage{geometry}
\usepackage{fancyhdr}
\usepackage{makecell}
\usepackage{multirow}
\usepackage{listings}
\usepackage{tikz}
\usepackage{fontspec, xunicode, xltxtra}
\usepackage{titlesec}
\usepackage{float}
\usepackage{caption}
\usepackage{amsmath, amssymb, amsfonts}
\usepackage[colorlinks, linkcolor=black, anchorcolor=black, citecolor=black]{hyperref}
\usepackage[justification=centering]{caption}
\usepackage{subcaption}
\usepackage{color}
\usepackage[super,square]{natbib}
\usepackage{blindtext}
\usepackage{bm}
\usepackage{enumitem}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{algorithm2e}
\usepackage[simplified]{pgf-umlcd}
\usepackage[lining]{ebgaramond}
\usepackage{lmodern}
\usepackage{longtable, booktabs}
% use print-styles when defining "PrintStyle"
\if @twoside % test onesize or twoside
\def \PrintStyle {}
\fi
% set the margin
\geometry{left=3.18cm, right=3.18cm, top=2.54cm, bottom=2.54cm}
% title and context interval
\titlespacing*{\chapter} {0pt}{0pt}{20pt}
\titlespacing*{\section}{0pt}{3ex}{1ex}
\titlespacing*{\subsection}{0pt}{2ex}{1ex}
\titlespacing*{\subsubsection}{0pt}{1ex}{0.5ex}
\titlespacing{\paragraph}{0pt}{1.5ex minus .1ex}{1pc}
\titleformat{\section}{\Large\bfseries}{\thesection}{0.75em}{}
\titleformat{\subsection}{\large\bfseries}{\thesubsection}{0.75em}{}
\titleformat{\paragraph}[runin]{\normalsize\sffamily}{\theparagraph}{}{}
% list line-spacing
\setenumerate[1]{itemsep=1.5pt,partopsep=0pt,parsep=\parskip,topsep=5pt}
\setitemize[1]{itemsep=1.5pt,partopsep=0pt,parsep=\parskip,topsep=5pt}
\setdescription{itemsep=1.5pt,partopsep=0pt,parsep=\parskip,topsep=5pt}
% set page number font
\fancyfoot[C]{\mdseries\small\thepage}
\fancypagestyle{plain}{%
\fancyhf{} % clear all header and footer fields
\fancyfoot[C]{\mdseries\small{\thepage}} % except the center
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
\newcommand{\chapterformat}{\centering\huge\bf\thispagestyle{plain}}
% set the tikz
\usetikzlibrary{chains,fit,shapes}
% set the code style
\ifx \PrintStyle \undefined
\def \highlightcolor {\color[rgb]{0.5,0,0.5}}
\lstset{
commentstyle=\small\color{green!50!black}\itshape,
keywordstyle=\small\color{cyan!50!black}\bfseries,
stringstyle=\small\color{purple},
numberstyle=\small\ttfamily\color{gray},
}
\else % print style
\def \highlightcolor {}
\lstset{
commentstyle=\small\itshape,
keywordstyle=\small\bfseries,
numberstyle=\small\ttfamily,
}
\fi
% generic code style
\lstset{
basicstyle=\small\ttfamily,
columns=fullflexible,
numbersep=1em,
xleftmargin=\parindent,
breakatwhitespace=false,
numbers=left,
captionpos=b, % sets the caption-position to bottom
breaklines=true, % automatic line breaking only at whitespace
keepspaces=true,
showstringspaces=false,
tabsize=4
}
% define the language berry
\lstdefinelanguage{berry} {%
keywords={def,var,if,elif,else,while,for,end,
break,return,continue,true,false,nil,
do,import,class,as,try,except,raise},%
morekeywords={print,type,self,super},
morecomment=[l]\#,%
morecomment=[s]{\#-}{-\#},%
morestring=[b]",%
morestring=[b]',%
}
% define the language ebnf
\lstdefinelanguage{ebnf} {%
keywords={ID,INTEGER,REAL,STRING},%
morecomment=[s]{(*}{*)},%
morestring=[b]",%
morestring=[b]',%
}
\lstdefinestyle{berry} {%
morekeywords={bint,breal,bvm,size_t}%
}
% define the library function title style
\newcommand{\libtitle}[1]{\subsubsection{\highlightcolor\textsl{#1}}}
% define the FFI title style
\newcommand{\ffititle}[1]{\subsubsection{\texttt{\highlightcolor\textsl{#1}}}}