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