author | Christian Urban <christian dot urban at kcl dot ac dot uk> |
Fri, 06 Sep 2013 14:55:53 +0100 | |
changeset 15 | baa2970a9687 |
parent 13 | dd1499f296ea |
child 21 | 17ea9ad46257 |
permissions | -rw-r--r-- |
2 | 1 |
%% |
2 |
%% macros for Isabelle generated LaTeX output |
|
3 |
%% |
|
4 |
||
5 |
%%% Simple document preparation (based on theory token language and symbols) |
|
6 |
||
7 |
% isabelle environments |
|
8 |
||
9 |
\newcommand{\isabellecontext}{UNKNOWN} |
|
10 |
||
11 |
\newcommand{\isastyle}{\UNDEF} |
|
12 |
\newcommand{\isastyleminor}{\UNDEF} |
|
13 |
\newcommand{\isastylescript}{\UNDEF} |
|
14 |
\newcommand{\isastyletext}{\normalsize\rm} |
|
15 |
\newcommand{\isastyletxt}{\rm} |
|
16 |
\newcommand{\isastylecmt}{\rm} |
|
17 |
||
18 |
\newcommand{\isaspacing}{% |
|
19 |
\sfcode 42 1000 % . |
|
20 |
\sfcode 63 1000 % ? |
|
21 |
\sfcode 33 1000 % ! |
|
22 |
\sfcode 58 1000 % : |
|
23 |
\sfcode 59 1000 % ; |
|
24 |
\sfcode 44 1000 % , |
|
25 |
} |
|
26 |
||
27 |
%symbol markup -- \emph achieves decent spacing via italic corrections |
|
28 |
\newcommand{\isamath}[1]{\emph{$#1$}} |
|
29 |
\newcommand{\isatext}[1]{\emph{#1}} |
|
30 |
\DeclareRobustCommand{\isascriptstyle}{\def\isamath##1{##1}\def\isatext##1{\mbox{\isaspacing\isastylescript##1}}} |
|
31 |
\newcommand{\isactrlsub}[1]{\emph{\isascriptstyle${}\sb{#1}$}} |
|
32 |
\newcommand{\isactrlsup}[1]{\emph{\isascriptstyle${}\sp{#1}$}} |
|
33 |
\DeclareRobustCommand{\isactrlbsub}{\emph\bgroup\math{}\sb\bgroup\mbox\bgroup\isaspacing\isastylescript} |
|
34 |
\DeclareRobustCommand{\isactrlesub}{\egroup\egroup\endmath\egroup} |
|
35 |
\DeclareRobustCommand{\isactrlbsup}{\emph\bgroup\math{}\sp\bgroup\mbox\bgroup\isaspacing\isastylescript} |
|
36 |
\DeclareRobustCommand{\isactrlesup}{\egroup\egroup\endmath\egroup} |
|
37 |
\newcommand{\isactrlbold}[1]{{\bfseries\upshape\boldmath#1}} |
|
38 |
||
39 |
\newenvironment{isaantiq}{{\isacharat\isacharbraceleft}}{{\isacharbraceright}} |
|
40 |
||
41 |
\newdimen\isa@parindent\newdimen\isa@parskip |
|
42 |
||
43 |
\newenvironment{isabellebody}{% |
|
44 |
\isamarkuptrue\par% |
|
45 |
\isa@parindent\parindent\parindent0pt% |
|
46 |
\isa@parskip\parskip\parskip0pt% |
|
47 |
\isaspacing\isastyle}{\par} |
|
48 |
||
49 |
\newenvironment{isabelle} |
|
50 |
{\begin{trivlist}\begin{isabellebody}\item\relax} |
|
51 |
{\end{isabellebody}\end{trivlist}} |
|
52 |
||
53 |
\newcommand{\isa}[1]{\emph{\isaspacing\isastyleminor #1}} |
|
54 |
||
55 |
\newcommand{\isaindent}[1]{\hphantom{#1}} |
|
56 |
\newcommand{\isanewline}{\mbox{}\par\mbox{}} |
|
57 |
\newcommand{\isasep}{} |
|
58 |
\newcommand{\isadigit}[1]{#1} |
|
59 |
||
60 |
\newcommand{\isachardefaults}{% |
|
61 |
\chardef\isacharbang=`\!% |
|
62 |
\chardef\isachardoublequote=`\"% |
|
63 |
\chardef\isachardoublequoteopen=`\"% |
|
64 |
\chardef\isachardoublequoteclose=`\"% |
|
65 |
\chardef\isacharhash=`\#% |
|
66 |
\chardef\isachardollar=`\$% |
|
67 |
\chardef\isacharpercent=`\%% |
|
68 |
\chardef\isacharampersand=`\&% |
|
69 |
\chardef\isacharprime=`\'% |
|
70 |
\chardef\isacharparenleft=`\(% |
|
71 |
\chardef\isacharparenright=`\)% |
|
72 |
\chardef\isacharasterisk=`\*% |
|
73 |
\chardef\isacharplus=`\+% |
|
74 |
\chardef\isacharcomma=`\,% |
|
75 |
\chardef\isacharminus=`\-% |
|
76 |
\chardef\isachardot=`\.% |
|
77 |
\chardef\isacharslash=`\/% |
|
78 |
\chardef\isacharcolon=`\:% |
|
79 |
\chardef\isacharsemicolon=`\;% |
|
80 |
\chardef\isacharless=`\<% |
|
81 |
\chardef\isacharequal=`\=% |
|
82 |
\chardef\isachargreater=`\>% |
|
83 |
\chardef\isacharquery=`\?% |
|
84 |
\chardef\isacharat=`\@% |
|
85 |
\chardef\isacharbrackleft=`\[% |
|
86 |
\chardef\isacharbackslash=`\\% |
|
87 |
\chardef\isacharbrackright=`\]% |
|
88 |
\chardef\isacharcircum=`\^% |
|
89 |
\chardef\isacharunderscore=`\_% |
|
90 |
\def\isacharunderscorekeyword{\_}% |
|
91 |
\chardef\isacharbackquote=`\`% |
|
92 |
\chardef\isacharbackquoteopen=`\`% |
|
93 |
\chardef\isacharbackquoteclose=`\`% |
|
94 |
\chardef\isacharbraceleft=`\{% |
|
95 |
\chardef\isacharbar=`\|% |
|
96 |
\chardef\isacharbraceright=`\}% |
|
97 |
\chardef\isachartilde=`\~% |
|
98 |
\def\isacharverbatimopen{\isacharbraceleft\isacharasterisk}% |
|
99 |
\def\isacharverbatimclose{\isacharasterisk\isacharbraceright}% |
|
100 |
} |
|
101 |
||
102 |
||
103 |
% keyword and section markup |
|
104 |
||
105 |
\newcommand{\isakeyword}[1] |
|
106 |
{\emph{\bf\def\isachardot{.}\def\isacharunderscore{\isacharunderscorekeyword}% |
|
107 |
\def\isacharbraceleft{\{}\def\isacharbraceright{\}}#1}} |
|
108 |
\newcommand{\isacommand}[1]{\isakeyword{#1}} |
|
109 |
||
110 |
\newcommand{\isamarkupheader}[1]{\section{#1}} |
|
111 |
\newcommand{\isamarkupchapter}[1]{\chapter{#1}} |
|
112 |
\newcommand{\isamarkupsection}[1]{\section{#1}} |
|
113 |
\newcommand{\isamarkupsubsection}[1]{\subsection{#1}} |
|
114 |
\newcommand{\isamarkupsubsubsection}[1]{\subsubsection{#1}} |
|
115 |
\newcommand{\isamarkupsect}[1]{\section{#1}} |
|
116 |
\newcommand{\isamarkupsubsect}[1]{\subsection{#1}} |
|
117 |
\newcommand{\isamarkupsubsubsect}[1]{\subsubsection{#1}} |
|
118 |
||
119 |
\newif\ifisamarkup |
|
120 |
\newcommand{\isabeginpar}{\par\ifisamarkup\relax\else\medskip\fi} |
|
121 |
\newcommand{\isaendpar}{\par\medskip} |
|
122 |
\newenvironment{isapar}{\parindent\isa@parindent\parskip\isa@parskip\isabeginpar}{\isaendpar} |
|
123 |
\newenvironment{isamarkuptext}{\par\isastyletext\begin{isapar}}{\end{isapar}} |
|
124 |
\newenvironment{isamarkuptxt}{\par\isastyletxt\begin{isapar}}{\end{isapar}} |
|
125 |
\newcommand{\isamarkupcmt}[1]{{\isastylecmt--- #1}} |
|
126 |
||
127 |
||
128 |
% styles |
|
129 |
||
130 |
\def\isabellestyle#1{\csname isabellestyle#1\endcsname} |
|
131 |
||
132 |
\newcommand{\isabellestyledefault}{% |
|
133 |
\def\isastyle{\small\tt\slshape}% |
|
134 |
\def\isastyleminor{\small\tt\slshape}% |
|
135 |
\def\isastylescript{\footnotesize\tt\slshape}% |
|
136 |
\isachardefaults% |
|
137 |
} |
|
138 |
\isabellestyledefault |
|
139 |
||
140 |
\newcommand{\isabellestylett}{% |
|
141 |
\def\isastyle{\small\tt}% |
|
142 |
\def\isastyleminor{\small\tt}% |
|
143 |
\def\isastylescript{\footnotesize\tt}% |
|
144 |
\isachardefaults% |
|
145 |
} |
|
146 |
||
147 |
\newcommand{\isabellestyleit}{% |
|
148 |
\def\isastyle{\small\it}% |
|
149 |
\def\isastyleminor{\it}% |
|
150 |
\def\isastylescript{\footnotesize\it}% |
|
151 |
\isachardefaults% |
|
152 |
\def\isacharunderscorekeyword{\mbox{-}}% |
|
153 |
\def\isacharbang{\isamath{!}}% |
|
10
569222a42cf5
updated the paper for submission
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
2
diff
changeset
|
154 |
\def\isachardoublequote{}% |
569222a42cf5
updated the paper for submission
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
2
diff
changeset
|
155 |
\def\isachardoublequoteopen{}% |
569222a42cf5
updated the paper for submission
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
2
diff
changeset
|
156 |
\def\isachardoublequoteclose{}% |
2 | 157 |
\def\isacharhash{\isamath{\#}}% |
158 |
\def\isachardollar{\isamath{\$}}% |
|
159 |
\def\isacharpercent{\isamath{\%}}% |
|
160 |
\def\isacharampersand{\isamath{\&}}% |
|
161 |
\def\isacharprime{\isamath{\mskip2mu{'}\mskip-2mu}}% |
|
162 |
\def\isacharparenleft{\isamath{(}}% |
|
163 |
\def\isacharparenright{\isamath{)}}% |
|
164 |
\def\isacharasterisk{\isamath{*}}% |
|
165 |
\def\isacharplus{\isamath{+}}% |
|
166 |
\def\isacharcomma{\isamath{\mathord,}}% |
|
167 |
\def\isacharminus{\isamath{-}}% |
|
168 |
\def\isachardot{\isamath{\mathord.}}% |
|
169 |
\def\isacharslash{\isamath{/}}% |
|
170 |
\def\isacharcolon{\isamath{\mathord:}}% |
|
171 |
\def\isacharsemicolon{\isamath{\mathord;}}% |
|
172 |
\def\isacharless{\isamath{<}}% |
|
173 |
\def\isacharequal{\isamath{=}}% |
|
174 |
\def\isachargreater{\isamath{>}}% |
|
175 |
\def\isacharat{\isamath{@}}% |
|
176 |
\def\isacharbrackleft{\isamath{[}}% |
|
177 |
\def\isacharbackslash{\isamath{\backslash}}% |
|
178 |
\def\isacharbrackright{\isamath{]}}% |
|
179 |
\def\isacharunderscore{\mbox{-}}% |
|
180 |
\def\isacharbraceleft{\isamath{\{}}% |
|
181 |
\def\isacharbar{\isamath{\mid}}% |
|
182 |
\def\isacharbraceright{\isamath{\}}}% |
|
183 |
\def\isachartilde{\isamath{{}\sp{\sim}}}% |
|
184 |
\def\isacharbackquoteopen{\isatext{\raise.3ex\hbox{$\scriptscriptstyle\langle$}}}% |
|
185 |
\def\isacharbackquoteclose{\isatext{\raise.3ex\hbox{$\scriptscriptstyle\rangle$}}}% |
|
186 |
\def\isacharverbatimopen{\isamath{\langle\!\langle}}% |
|
187 |
\def\isacharverbatimclose{\isamath{\rangle\!\rangle}}% |
|
188 |
} |
|
189 |
||
190 |
\newcommand{\isabellestyleliteral}{% |
|
191 |
\isabellestyleit% |
|
192 |
\def\isacharunderscore{\_}% |
|
193 |
\def\isacharunderscorekeyword{\_}% |
|
194 |
\chardef\isacharbackquoteopen=`\`% |
|
195 |
\chardef\isacharbackquoteclose=`\`% |
|
196 |
} |
|
197 |
||
198 |
\newcommand{\isabellestylesl}{% |
|
199 |
\isabellestyleit% |
|
200 |
\def\isastyle{\small\sl}% |
|
201 |
\def\isastyleminor{\sl}% |
|
202 |
\def\isastylescript{\footnotesize\sl}% |
|
203 |
} |
|
204 |
||
205 |
||
206 |
% tagged regions |
|
207 |
||
208 |
%plain TeX version of comment package -- much faster! |
|
209 |
\let\isafmtname\fmtname\def\fmtname{plain} |
|
210 |
\usepackage{comment} |
|
211 |
\let\fmtname\isafmtname |
|
212 |
||
213 |
\newcommand{\isafold}[1]{\emph{$\langle\mathord{\mathit{#1}}\rangle$}} |
|
214 |
||
215 |
\newcommand{\isakeeptag}[1]% |
|
216 |
{\includecomment{isadelim#1}\includecomment{isatag#1}\csarg\def{isafold#1}{}} |
|
217 |
\newcommand{\isadroptag}[1]% |
|
218 |
{\excludecomment{isadelim#1}\excludecomment{isatag#1}\csarg\def{isafold#1}{}} |
|
219 |
\newcommand{\isafoldtag}[1]% |
|
220 |
{\includecomment{isadelim#1}\excludecomment{isatag#1}\csarg\def{isafold#1}{\isafold{#1}}} |
|
221 |
||
222 |
\isakeeptag{theory} |
|
223 |
\isakeeptag{proof} |
|
224 |
\isakeeptag{ML} |
|
225 |
\isakeeptag{visible} |
|
226 |
\isadroptag{invisible} |
|
227 |
||
228 |
\IfFileExists{isabelletags.sty}{\usepackage{isabelletags}}{} |