This repository was archived by the owner on Dec 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcodeformatting.tex
More file actions
45 lines (42 loc) · 3.04 KB
/
codeformatting.tex
File metadata and controls
45 lines (42 loc) · 3.04 KB
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
\definecolor{bgcolor}{rgb}{1, 1, 1}
\definecolor{codecolor}{rgb}{0, 0, 0}
\definecolor{stringcolor}{rgb}{0.62, 0, 0.36}
\definecolor{keywordcolor}{rgb}{0, 0, 0}
\definecolor{commentcolor}{rgb}{0.66, 0.66, 0.61}
\definecolor{linenumbercolor}{rgb}{0.4, 0.4, 0.4}
\definecolor{directivecolor}{rgb}{0, 0, 0}
\newfontfamily\listingsfont[Scale=.8]{Menlo}
\lstdefinelanguage{CustomSwift}[]{C++} {
morekeywords = {*, func, var, let, nil, guard, protocol, extension, import, in, inout, typealias, associatedtype, precedencegroup},
directivestyle = \listingsfont\bfseries\color{directivecolor},
morecomment=[n]{/*}{*/}, % allows for nested multi-line comments
}
\lstdefinestyle{Basic}{
xleftmargin=15pt,
backgroundcolor = \color{bgcolor},
fillcolor = \color{bgcolor},
basicstyle = \linespread{1.0}\color{codecolor}\scriptsize\listingsfont,
commentstyle = \color{commentcolor},
keywordstyle = \listingsfont\bfseries\color{keywordcolor},
identifierstyle = ,
numberstyle = \color{linenumbercolor}, % the style that is used for the line-numbers
stringstyle = \color{stringcolor}, % string literal style
breakatwhitespace = false, % sets if automatic breaks should only happen at whitespace
breaklines = true, % sets automatic line breaking
escapeinside = {\%*}{*)}, % if you want to add LaTeX within your code
extendedchars = true, % lets you use non-ASCII characters; for 8-bits encodings only
rulesep = 5pt,
framexleftmargin = 2pt,
framerule = 0.5pt,
framesep = 1pt,
keepspaces = true, % keeps spaces in text, useful for keeping indentation of code
morekeywords = {*,interface}, % if you want to add more keywords to the set
numbers = left, % where to put the line-numbers; possible values are (none, left, right)
numbersep = 6pt, % how far the line-numbers are from the code
showspaces = false, % show spaces everywhere adding particular underscores
showstringspaces = false, % underline spaces within strings only
showtabs = false, % show tabs within strings adding particular underscores
stepnumber = 1, % the step between two line-numbers. If it's 1, each line will be numbered
tabsize = 2, % sets default tabsize to 2 spaces
title = \lstname, % show the filename of files included with \lstinputlisting
}