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