]> matita.cs.unibo.it Git - helm.git/blob - matita/components/binaries/matex/test/matex.sty
9b2e412c7ff13975116135b25ceb7cebe70e805e
[helm.git] / matita / components / binaries / matex / test / matex.sty
1 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
2 \ProvidesPackage{matex}[2016/06/12 MaTeX Package]
3 \RequirePackage{xcolor}
4 \RequirePackage{stix}
5 \ExecuteOptions{}
6 \ProcessOptions*
7
8 \makeatletter
9
10 \newcommand*\ma@cast{\mathbin:}
11 \newcommand*\ma@abbr{\mathrel\eqdef}
12 \newcommand*\ma@prod{\mathord\Pi}
13 \newcommand*\ma@arrw{\mathrel\Rightarrow}
14 \newcommand*\ma@fall{\mathord\forall}
15 \newcommand*\ma@impl{\mathrel\supset}
16 \newcommand*\ma@case{\mathrel\questeq}
17 \newcommand*\ma@caze{\mathrel\mapsto}
18 \newcommand*\ma@pair{\mathbin\mapsto}
19
20 \definecolor{ma@black}{HTML}{000000}
21 \definecolor{ma@blue}{HTML}{00005F}
22 \definecolor{ma@purple}{HTML}{3F005F}
23
24 \newcommand*\ma@fwd{ma@black}
25 \newcommand*\ma@open{ma@blue}
26 \newcommand*\ma@exit{ma@blue}
27 \newcommand*\ma@prim{ma@purple}
28 \newcommand*\ma@qed{ma@blue}
29
30 \newcommand*\neverindent{\setlength\parindent{0pt}}
31
32 %\newcommand*\setlabel[1]{\protected@edef\@currentlabel{#1}}
33 %\newcommand*\ObjLabel[1]{\label{obj:#1}\hypertarget{obj:#1}{}}
34 %\newcommand*\ObjRef[1]{\hyperlink{obj:#1}{\ref*{obj:#1}}}
35 %\newcommand*\ma@setlabel[2]{\setlabel{#1}\ObjLabel{#2}}
36
37 \newcommand*\ma@settarget[2]{\hypertarget{obj:#2}{#1}}
38 \newcommand*\ma@setlink[2]{\hyperlink{obj:#2}{#1}}
39 \newcommand*\ma@setopttarget[2]{\def\ma@tmp{#2}%
40    \mathord{\ifx\ma@tmp\empty #1\else\ma@settarget{#1}{#2}\fi}%
41 }
42 \newcommand*\ma@setoptlink[2]{\def\ma@tmp{#2}%
43    \mathord{\ifx\ma@tmp\empty #1\else\ma@setlink{#1}{#2}\fi}%
44 }
45
46 \newcommand*\setordlink[2]{\mathord{\ma@setlink{#1}{#2}}}
47 \newcommand*\setoplink[2]{\mathop{\ma@setlink{#1}{#2}}}
48 \newcommand*\setbinlink[2]{\mathbin{\ma@setlink{#1}{#2}}}
49 \newcommand*\setrellink[2]{\mathrel{\ma@setlink{#1}{#2}}}
50
51 \newcommand*\ObjIncNode{}
52 \newcommand*\ObjNode{}
53
54 \newcommand*\ma@thehead[3]{\ObjIncNode\textbf{#1 \ObjNode(\ma@settarget{#2}{#3})}\neverindent\par}
55 \newcommand*\ma@theneck[1]{\textsl{#1}\neverindent\par}
56
57 \newenvironment{axiom}[2]{\ma@thehead{Axiom}{#1}{#2}$}{$\par}
58 \newenvironment{declaration}[2]{\ma@thehead{Declaration}{#1}{#2}$}{$\par}
59 \newenvironment{definition}[2]{$}{$\par}
60 \newenvironment{proposition}[2]{\ma@thehead{Proposition}{#1}{#2}$}{$\par}
61 \newenvironment{proof}[2]{\ma@theneck{Proof}}{\par}
62 \newenvironment{ma@step}[1]{\color{#1}}{\par}
63
64 \newcommand*\ma@tmp{}
65 \newcommand*\ma@skip[4]{}
66 \newcommand*\ma@next[5]{\def\ma@tmp{#5}%
67    \ifx\ma@tmp\empty #4\let\ma@tmp=\ma@skip\else #1#2{#5}\let\ma@tmp=\ma@next\fi
68    \ma@tmp #3#2#3#4%
69 }
70 \newcommand*\ma@thop[1]{\mathop{#1}\allowbreak}
71 \newcommand*\ma@cm{\ma@thop{,}}
72 \newcommand*\ma@or{\mathbin\vert}
73 \newcommand*\ma@cp{)\allowbreak}
74 \newcommand*\ma@qm{\mathord{?}}
75 \newcommand*\ma@arg[1]{#1}
76 \newcommand*\ma@args{(\ma@next\relax\ma@arg\ma@cm\ma@cp}
77 \newcommand*\ma@cases{\ma@next\relax\ma@arg\ma@or\relax}
78 \newcommand*\ma@bind{\ma@thop{}}
79
80 \newcommand*\PROP{\mathord\mathrm{PROP}}
81 \newcommand*\CROP[1]{\mathord\mathrm{CROP}}
82 \newcommand*\TYPE[1]{\mathord\mathrm{TYPE}}
83 \newcommand*\LREF[2]{\ma@setoptlink{#1}{#2}}
84 \newcommand*\GREF[2]{\ma@setoptlink{\mathrm{#1}}{#2}}
85 \newcommand*\ABBR[4]{(\ma@setopttarget{#1}{#2}\ma@abbr #4\ma@cast #3)\ma@bind}
86 \newcommand*\ABST[3]{(\ma@setopttarget{#1}{#2}\ma@cast #3)\ma@bind}
87 \newcommand*\PROD[3]{\def\ma@tmp{#2}%
88    \ifx\ma@tmp\empty #3\ma@arrw\else
89    (\ma@prod\ma@setopttarget{#1}{#2}\ma@cast #3)\ma@bind\fi
90 }
91 \newcommand*\FALL[3]{\def\ma@tmp{#2}%
92    \ifx\ma@tmp\empty #3\ma@impl\else
93    (\ma@fall\ma@setopttarget{#1}{#2}\ma@cast #3)\ma@bind\fi
94 }
95 \newcommand*\APPL[1]{#1\ma@args}
96 \newcommand*\CASE[3]{#3\ma@case\ma@cases}
97 \newcommand*\CAZE[3]{#3\ma@caze(\ma@qm\ma@cast #2)\ma@cases}
98 \newcommand*\PAIR[2]{#1\ma@pair #2}
99
100 \newcommand*\ma@term[1]{$#1$}
101 \newcommand*\ma@with{ with }
102 \newcommand*\ma@comma{, }
103 \newcommand*\ma@stop{.\end{ma@step}}
104 \newcommand*\ma@head[6]{\def\ma@tmp{#5}%
105    \ifx\ma@tmp\empty\begin{ma@step}{#1}$\mathbf{\ma@setopttarget{#2}{#3}}$%
106    \else\begin{ma@step}{#4}$\mathbf{\ma@setopttarget{#5}{#6}}$%
107    \fi
108 }
109 \newcommand*\ma@tail{\ma@next\ma@with\ma@term\ma@comma\ma@stop}
110 \newcommand*\ma@type[1]{\def\ma@tmp{#1}%
111    \ifx\ma@tmp\empty\mathrm{(omitted)}\else #1\fi
112 }
113
114 \newcommand*\EXIT[1]{\ma@head{\ma@exit}{end}{}{}{}{} of block #1\ma@stop}
115 \newcommand*\OPEN[3]{\ma@head{}{}{}{\ma@open}{#1}{#2} is this block #3\ma@stop}
116 \newcommand*\PRIM[3]{\ma@head{}{}{}{\ma@prim}{#1}{#2} will have type $\ma@type{#3}$\ma@stop}
117 \newcommand*\DECL[3]{\ma@head{\ma@qed}{\_QED}{}{\ma@fwd}{#1}{#2} has type $\ma@type{#3}$\par}
118 \newcommand*\BODY[1]{being $#1$\ma@stop}
119 \newcommand*\STEP[1]{by $#1$\ma@tail}
120 \newcommand*\DEST[1]{by cases on $#1$\ma@tail}
121
122 \makeatother
123
124 \endinput