-
Notifications
You must be signed in to change notification settings - Fork 1
/
template
77 lines (74 loc) · 3.4 KB
/
template
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
\documentclass[border=0.2cm]{standalone}
\usepackage[<<textencoding>>]{inputenc}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{snakes,arrows,shapes}
\newcommand{\redtext}[1]{\textcolor{Maroon}{#1}}
\newcommand{\bluetext}[1]{\textcolor{NavyBlue}{#1}}
\newcommand{\orangetext}[1]{\textcolor{BurntOrange}{#1}}
\newcommand{\graytext}[1]{\textcolor{gray}{#1}}
\newcommand{\key}[1]{\ensuremath{\mathtt{#1}}}
\newcommand{\high}{\textcolor{OrangeRed}{\key{high}}}
\newcommand{\low}{\textcolor{PineGreen}{\key{low}}}
\newcommand{\unk}{\textcolor{Maroon}{\key{\star}}}
\newcommand{\Bool}{\key{Bool}}
\newcommand{\Unit}{\key{Unit}}
\newcommand{\Fun}[3]{\ensuremath{{#1}\xrightarrow{{#2}}{#3}}}
\newcommand{\Refer}[1]{\ensuremath{\key{Ref}\;{#1}}}
\newcommand{\true}{\key{true}}
\newcommand{\false}{\key{false}}
\newcommand{\unit}{\key{unit}}
\newcommand{\syntax}[1]{\text{\texttt{\textcolor{Purple}{#1}}}}
\newcommand{\ccsyntax}[1]{\text{\texttt{\textcolor{Plum}{#1}}}}
\newcommand{\const}[2]{\ensuremath{\syntax{(\$}\;{#1}\syntax{)}_{#2}}}
\newcommand{\lam}[5]{\ensuremath{\syntax{(λ}^{#1}{#2}\syntax{:}{#3}\syntax{.}\,{#4}\syntax{)}_{#5}}}
\newcommand{\app}[3]{\ensuremath{\syntax{(}{#1}\;{#2}\syntax{)}^{\orangetext{#3}}}}
\newcommand{\ifexp}[4]{\ensuremath{\syntax{(if}\;{#1}\;\syntax{then}\;{#2}\;\syntax{else}\;{#3}\syntax{)}^{\orangetext{#4}}}}
\newcommand{\refexp}[3]{\ensuremath{\syntax{(ref}\;{#1}\;{#2}\syntax{)}^{\orangetext{#3}}}}
\newcommand{\deref}[1]{\ensuremath{\syntax{!}\;{#1}}}
\newcommand{\assign}[3]{\ensuremath{\syntax{(}{#1}\;\syntax{:=}\;{#2}\syntax{)}^{\orangetext{#3}}}}
\newcommand{\ann}[3]{\ensuremath{\syntax{(}{#1}\;\syntax{:}\;{#2}\syntax{)}^{\orangetext{#3}}}}
\newcommand{\letexp}[3]{\ensuremath{\syntax{let}\;{#1}={#2}\;\syntax{in}\;{#3}}}
\newcommand{\ccvar}[1]{\ensuremath{\ccsyntax{`}\,{#1}}}
\newcommand{\ccconst}[2]{\ensuremath{\ccsyntax{(\$}\;{#1}\ccsyntax{)}_{#2}}}
\newcommand{\ccaddr}[2]{\ensuremath{\ccsyntax{(addr}\;{#1}\ccsyntax{)}_{#2}}}
\newcommand{\cclam}[4]{\ensuremath{\ccsyntax{(}\redtext{\lambda}^{#1}{#2}\ccsyntax{.}\,{#3}\ccsyntax{)}_{#4}}}
\newcommand{\ccif}[4]{\ensuremath{\ccsyntax{if}\;{#1}\;{#2}\;{#3}\;{#4}}}
\newcommand{\ccref}[3]{\ensuremath{\ccsyntax{ref}^{\ccsyntax{#1}}\;{#2}\;{#3}}}
\newcommand{\ccderef}[1]{\ensuremath{\ccsyntax{!}\;{#1}}}
\newcommand{\ccassign}[3]{\ensuremath{{#1}\;\ccsyntax{:=}^{\ccsyntax{#2}}\;{#3}}}
\newcommand{\cccast}[2]{\ensuremath{{#1}\,\ccsyntax{\{}\,{#2}\,\ccsyntax{\}}}}
\newcommand{\ccprot}[2]{\ensuremath{\ccsyntax{prot}\;{#1}\;{#2}}}
\newcommand{\cccastpc}[2]{\ensuremath{\ccsyntax{cast}_{\ccsyntax{pc}}\;{#1}\;{#2}}}
\newcommand{\cclet}[2]{\ensuremath{\ccsyntax{let}\;{#1}\;\ccsyntax{in}\;{#2}}}
\newcommand{\ccerr}[1]{\ensuremath{\ccsyntax{error}\;{#1}}}
\newcommand{\Cast}[3]{\ensuremath{{#1}\Rightarrow^{\orangetext{#3}}{#2}}}
\newcommand{\blame}[1]{\ensuremath{\key{blame}^{\orangetext{#1}}}}
<<startpreprocsection>>%
\usepackage[active,auctex]{preview}
<<endpreprocsection>>%
<<gvcols>>%
<<cropcode>>%
<<docpreamble>>%
\begin{document}
%
<<startpreprocsection>>%
<<preproccode>>
<<endpreprocsection>>%
%
<<startoutputsection>>
% Start of code
% \begin{tikzpicture}[anchor=mid,>=latex',join=bevel,<<graphstyle>>]
\begin{tikzpicture}[>=latex',join=bevel,<<graphstyle>>]
\pgfsetlinewidth{1bp}
<<figpreamble>>%
<<drawcommands>>
<<figpostamble>>%
\end{tikzpicture}
% End of code
<<endoutputsection>>
%
\end{document}
%