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
% -*- TeX-master: "../main.tex" -*-

\LetLtxMacro{\cminted}{\minted}
\let\endcminted\endminted
\xpretocmd{\cminted}{\RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{}}{}{}

% \RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{}
\newmintinline[fcode]{./latex/fstar.py -x}{escapeinside=!!,mathescape=true}%
\newminted[fstarcode]{./latex/fstar.py -x}{autogobble,escapeinside=!!,mathescape=true}%
\newmintedfile[inputfstar]{./latex/fstar.py -x}{autogobble,escapeinside=!!,mathescape=true}%


\LetLtxMacro{\cfstarcode}{\fstarcode}
\let\endcfstarcode\endfstarcode
\xpretocmd{\cfstarcode}{\RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{}}{}{}

\newcommand{\shorteq}{\resizebox{4pt}{\height}{=}}
\newcommand{\shortgt}{\resizebox{4pt}{\height}{\textgreater}}
\newcommand{\bindSymbol}{%
   \textrm{\shortgt\kern-2pt\shortgt\kern-1pt\shorteq}%
}

\newtheorem{assumption}{Assumption}



% define environment fequation
\def\fEQlabel{}%
\newif\ifflagFEQLabel%
\makeatletter
\newcommand{\customlabel}[2]{%
   \protected@write \@auxout {}{\string \newlabel {#1}{{#2}{\thepage}{#2}{#1}{}} }%
   \hypertarget{#1}{}%
}
\makeatother
\LetLtxMacro{\fequation}{\cfstarcode}%
\let\endfequation\endcfstarcode%
\xpretocmd{\fequation}{%
\noindent%
  \list{}{\rightmargin=0pt\leftmargin=0pt}\item\relax%
  \LetLtxMacro{\savelabel}{\label}%
  \vspace{5.5pt}%
  \flagFEQLabelfalse%
  \ifdefempty{\fEQlabel}{}{\flagFEQLabeltrue}%
  \ifflagFEQLabel%
  \stepcounter{equation}%
  \customlabel{\fEQlabel}{\theequation}%
  \minipage{1\linewidth}%
  \fi%
  \centering%
}{}{}%
\xapptocmd{\endfequation}{%
  \ifflagFEQLabel%
  \endminipage%
  \kern-0.6cm\minipage{0.04\linewidth}%
  \flushright%
  \eqref{\fEQlabel}%
  \endminipage%
  \fi%
  \vspace{5.5pt}%
  \endlist%
  \def\fEQlabel{}%
  \global\def\fEQlabel{}%
}{}{}%

\newcommand{\fLabel}[1]{\global\def\fEQlabel{#1}}

\def\bang{!}