source: doc/theses/colby_parsons_MMAth/style/cfa-format.tex@ 1e6cecb

ADT ast-experimental stuck-waitfor-destruct
Last change on this file since 1e6cecb was 3c17a10, checked in by caparsons <caparson@…>, 3 years ago

updated style to remove some 800-lb gorilla macros

  • Property mode set to 100644
File size: 3.3 KB
Line 
1\usepackage[usenames,dvipsnames]{xcolor}
2\usepackage{listings}
3\usepackage{inconsolata}
4
5\definecolor{basicCol}{HTML}{000000}
6\definecolor{commentCol}{HTML}{000000}
7\definecolor{stringCol}{HTML}{000000}
8\definecolor{keywordCol}{HTML}{000000}
9\definecolor{identifierCol}{HTML}{000000}
10
11\lstdefinestyle{defaultStyle}{
12 escapeinside={@@},
13 basicstyle=\linespread{0.9}\tt\footnotesize, % reduce line spacing and use typewriter font
14 keywordstyle=\bfseries\color{blue},
15 keywordstyle=[2]\bfseries\color{Plum},
16 commentstyle=\itshape\color{OliveGreen}, % green and italic comments
17 identifierstyle=\color{identifierCol},
18 stringstyle=\sf\color{Mahogany}, % use sanserif font
19 mathescape=true,
20 columns=fixed,
21 aboveskip=4pt, % spacing above/below code block
22 belowskip=3pt,
23 keepspaces=true,
24 tabsize=4,
25 % frame=lines,
26 literate=,
27 showlines=true, % show blank lines at end of code
28 showspaces=false,
29 showstringspaces=false,
30 escapechar=\$,
31 xleftmargin=\parindentlnth, % indent code to paragraph indentation
32 moredelim=[is][\color{red}\bfseries]{**R**}{**R**}, % red highlighting
33 % moredelim=* detects keywords, comments, strings, and other delimiters and applies their formatting
34 % moredelim=** allows cumulative application
35}
36
37\lstdefinestyle{cfaStyle}{
38 escapeinside={@@},
39 basicstyle=\linespread{0.9}\tt\footnotesize, % reduce line spacing and use typewriter font
40 keywordstyle=\bfseries\color{blue},
41 keywordstyle=[2]\bfseries\color{Plum},
42 commentstyle=\sf\itshape\color{OliveGreen}, % green and italic comments
43 identifierstyle=\color{identifierCol},
44 stringstyle=\sf\color{Mahogany}, % use sanserif font
45 mathescape=true,
46 columns=fixed,
47 aboveskip=4pt, % spacing above/below code block
48 belowskip=3pt,
49 keepspaces=true,
50 tabsize=4,
51 % frame=lines,
52 literate=,
53 showlines=true, % show blank lines at end of code
54 showspaces=false,
55 showstringspaces=false,
56 escapechar=\$,
57 xleftmargin=\parindentlnth, % indent code to paragraph indentation
58 moredelim=[is][\color{red}\bfseries]{**R**}{**R**}, % red highlighting
59 morekeywords=[2]{accept, signal, signal_block, wait, waitfor},
60}
61
62\lstnewenvironment{ccode}[1][]{
63 \lstset{
64 language = C,
65 style=defaultStyle,
66 captionpos=b,
67 #1
68 }
69}{}
70
71\lstnewenvironment{cfacode}[1][]{
72 \lstset{
73 language = CFA,
74 style=cfaStyle,
75 captionpos=b,
76 #1
77 }
78}{}
79
80\lstnewenvironment{cppcode}[1][]{
81 \lstset{
82 language = c++,
83 style=defaultStyle,
84 captionpos=b,
85 #1
86 }
87}{}
88
89\lstnewenvironment{ucppcode}[1][]{
90 \lstset{
91 language = c++,
92 style=defaultStyle,
93 captionpos=b,
94 #1
95 }
96}{}
97
98\lstnewenvironment{javacode}[1][]{
99 \lstset{
100 language = java,
101 style=defaultStyle,
102 captionpos=b,
103 #1
104 }
105}{}
106
107\lstnewenvironment{gocode}[1][]{
108 \lstset{
109 language = Golang,
110 style=defaultStyle,
111 captionpos=b,
112 #1
113 }
114}{}
115
116\newcommand{\zero}{\lstinline{zero_t}\xspace}
117\newcommand{\one}{\lstinline{one_t}\xspace}
118\newcommand{\ateq}{\lstinline{\@=}\xspace}
119\newcommand{\code}[1]{\lstinline[language=CFA,style=cfaStyle]{#1}}
120\newcommand{\pscode}[1]{\lstinline[language=pseudo,style=pseudoStyle]{#1}}
Note: See TracBrowser for help on using the repository browser.