1 | \input{common} |
---|
2 | \CFAStyle % CFA code-style |
---|
3 | \lstset{language=CFA} % default language |
---|
4 | |
---|
5 | \lstdefinestyle{defaultStyle}{ |
---|
6 | escapeinside={@@}, |
---|
7 | % basicstyle=\linespread{0.9}\tt\footnotesize, % reduce line spacing and use typewriter font |
---|
8 | basicstyle=\linespread{0.9}\sf, % reduce line spacing and use typewriter font |
---|
9 | % keywordstyle=\bfseries\color{blue}, |
---|
10 | % keywordstyle=[2]\bfseries\color{Plum}, |
---|
11 | % commentstyle=\sf\itshape\color{OliveGreen}, % green and italic comments |
---|
12 | % identifierstyle=\color{identifierCol}, |
---|
13 | % stringstyle=\sf\color{Mahogany}, % use sanserif font |
---|
14 | stringstyle=\tt, % use sanserif font |
---|
15 | mathescape=true, |
---|
16 | % columns=fixed, |
---|
17 | columns=fullflexible, |
---|
18 | % aboveskip=4pt, % spacing above/below code block |
---|
19 | % belowskip=3pt, |
---|
20 | keepspaces=true, |
---|
21 | tabsize=4, |
---|
22 | % frame=lines, |
---|
23 | literate=, |
---|
24 | showlines=true, % show blank lines at end of code |
---|
25 | showspaces=false, |
---|
26 | showstringspaces=false, |
---|
27 | showlines=true, % show blank lines at end of code |
---|
28 | escapechar=\$, |
---|
29 | xleftmargin=\parindentlnth, % indent code to paragraph indentation |
---|
30 | moredelim=[is][\color{red}\bfseries]{**R**}{**R**}, % red highlighting |
---|
31 | morekeywords=[2]{accept, signal, signal_block, wait, waitfor, waituntil}, |
---|
32 | abovecaptionskip=5pt, |
---|
33 | } |
---|
34 | |
---|
35 | \lstdefinestyle{cfaStyle}{ |
---|
36 | escapeinside={@@}, |
---|
37 | basicstyle=\linespread{0.9}\sf, % reduce line spacing and use typewriter font |
---|
38 | stringstyle=\tt, % use sanserif font |
---|
39 | mathescape=true, |
---|
40 | columns=fullflexible, |
---|
41 | keepspaces=true, |
---|
42 | tabsize=4, |
---|
43 | literate=, |
---|
44 | showlines=true, % show blank lines at end of code |
---|
45 | showspaces=false, |
---|
46 | showstringspaces=false, |
---|
47 | showlines=true, % show blank lines at end of code |
---|
48 | escapechar=\$, |
---|
49 | xleftmargin=\parindentlnth, % indent code to paragraph indentation |
---|
50 | moredelim=[is][\color{red}\bfseries]{**R**}{**R**}, % red highlighting |
---|
51 | morekeywords=[2]{accept, signal, signal_block, wait, waitfor, waituntil}, |
---|
52 | abovecaptionskip=5pt, |
---|
53 | } |
---|
54 | |
---|
55 | \lstnewenvironment{cfacode}[1][]{ |
---|
56 | \lstset{ |
---|
57 | language = CFA, |
---|
58 | style=cfaStyle, |
---|
59 | captionpos=b, |
---|
60 | #1 |
---|
61 | } |
---|
62 | }{} |
---|
63 | |
---|
64 | \lstnewenvironment{cppcode}[1][]{ |
---|
65 | \lstset{ |
---|
66 | language = c++, |
---|
67 | style=defaultStyle, |
---|
68 | captionpos=b, |
---|
69 | #1 |
---|
70 | } |
---|
71 | }{} |
---|
72 | |
---|
73 | \newcommand{\code}[1]{\lstinline[language=CFA,style=cfaStyle]{#1}} |
---|
74 | \newcommand{\uC}{$\mu$\CC} |
---|
75 | |
---|