| 13999 |      1 | %%
 | 
|  |      2 | %% Author: Markus Wenzel, TU Muenchen
 | 
|  |      3 | %% License: GPL (GNU GENERAL PUBLIC LICENSE)
 | 
|  |      4 | %%
 | 
|  |      5 | %% macros for Isabelle generated LaTeX output
 | 
|  |      6 | %%
 | 
|  |      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}}}
 | 
|  |     25 | \newcommand{\isactrlsub}[1]{\emph{\isascriptstyle${}\sb{#1}$}}
 | 
|  |     26 | \newcommand{\isactrlsup}[1]{\emph{\isascriptstyle${}\sp{#1}$}}
 | 
| 14617 |     27 | \newcommand{\isactrlisub}[1]{\emph{\isascriptstyle${}\sb{#1}$}}
 | 
|  |     28 | \newcommand{\isactrlisup}[1]{\emph{\isascriptstyle${}\sp{#1}$}}
 | 
| 13999 |     29 | \newcommand{\isactrlbold}[1]{{\bfseries\upshape\boldmath#1}}
 | 
|  |     30 | 
 | 
| 14617 |     31 | % somewhat hackish: spanning sub/super scripts (\<^bsub>..\<^esub>)
 | 
|  |     32 | \newcommand{\isactrlbsub}{%
 | 
|  |     33 | \def\isatext##1{\isastylescript##1}\begin{math}_\bgroup}
 | 
|  |     34 | \newcommand{\isactrlesub}{\egroup\end{math}}
 | 
|  |     35 | \newcommand{\isactrlbsup}{%
 | 
|  |     36 | \def\isatext##1{\isastylescript##1}\begin{math}^\bgroup}
 | 
|  |     37 | \newcommand{\isactrlesup}{\egroup\end{math}}
 | 
|  |     38 | 
 | 
| 13999 |     39 | \newdimen\isa@parindent\newdimen\isa@parskip
 | 
|  |     40 | 
 | 
|  |     41 | \newenvironment{isabellebody}{%
 | 
|  |     42 | \isamarkuptrue\par%
 | 
|  |     43 | \isa@parindent\parindent\parindent0pt%
 | 
|  |     44 | \isa@parskip\parskip\parskip0pt%
 | 
|  |     45 | \isastyle}{\par}
 | 
|  |     46 | 
 | 
|  |     47 | \newenvironment{isabelle}
 | 
|  |     48 | {\begin{trivlist}\begin{isabellebody}\item\relax}
 | 
|  |     49 | {\end{isabellebody}\end{trivlist}}
 | 
|  |     50 | 
 | 
|  |     51 | \newcommand{\isa}[1]{\emph{\isastyleminor #1}}
 | 
|  |     52 | 
 | 
|  |     53 | \newcommand{\isaindent}[1]{\hphantom{#1}}
 | 
|  |     54 | \newcommand{\isanewline}{\mbox{}\par\mbox{}}
 | 
| 14617 |     55 | \newcommand{\isasep}{} % override with e.g. \renewcommand{\isasep}{\vspace{1ex}}
 | 
| 13999 |     56 | \newcommand{\isadigit}[1]{#1}
 | 
|  |     57 | 
 | 
|  |     58 | \chardef\isacharbang=`\!
 | 
|  |     59 | \chardef\isachardoublequote=`\"
 | 
|  |     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=`\`
 | 
|  |     86 | \chardef\isacharbraceleft=`\{
 | 
|  |     87 | \chardef\isacharbar=`\|
 | 
|  |     88 | \chardef\isacharbraceright=`\}
 | 
|  |     89 | \chardef\isachartilde=`\~
 | 
|  |     90 | 
 | 
|  |     91 | 
 | 
|  |     92 | % keyword and section markup
 | 
|  |     93 | 
 | 
|  |     94 | \newcommand{\isakeywordcharunderscore}{\_}
 | 
|  |     95 | \newcommand{\isakeyword}[1]
 | 
|  |     96 | {\emph{\bf\def\isachardot{.}\def\isacharunderscore{\isakeywordcharunderscore}%
 | 
|  |     97 | \def\isacharbraceleft{\{}\def\isacharbraceright{\}}#1}}
 | 
|  |     98 | \newcommand{\isacommand}[1]{\isakeyword{#1}}
 | 
|  |     99 | 
 | 
|  |    100 | \newcommand{\isamarkupheader}[1]{\section{#1}}
 | 
|  |    101 | \newcommand{\isamarkupchapter}[1]{\chapter{#1}}
 | 
|  |    102 | \newcommand{\isamarkupsection}[1]{\section{#1}}
 | 
|  |    103 | \newcommand{\isamarkupsubsection}[1]{\subsection{#1}}
 | 
|  |    104 | \newcommand{\isamarkupsubsubsection}[1]{\subsubsection{#1}}
 | 
|  |    105 | \newcommand{\isamarkupsect}[1]{\section{#1}}
 | 
|  |    106 | \newcommand{\isamarkupsubsect}[1]{\subsection{#1}}
 | 
|  |    107 | \newcommand{\isamarkupsubsubsect}[1]{\subsubsection{#1}}
 | 
|  |    108 | 
 | 
|  |    109 | \newif\ifisamarkup
 | 
|  |    110 | \newcommand{\isabeginpar}{\par\ifisamarkup\relax\else\medskip\fi}
 | 
|  |    111 | \newcommand{\isaendpar}{\par\medskip}
 | 
|  |    112 | \newenvironment{isapar}{\parindent\isa@parindent\parskip\isa@parskip\isabeginpar}{\isaendpar}
 | 
|  |    113 | \newenvironment{isamarkuptext}{\isastyletext\begin{isapar}}{\end{isapar}}
 | 
|  |    114 | \newenvironment{isamarkuptxt}{\isastyletxt\begin{isapar}}{\end{isapar}}
 | 
|  |    115 | \newcommand{\isamarkupcmt}[1]{{\isastylecmt--- #1}}
 | 
|  |    116 | 
 | 
|  |    117 | 
 | 
|  |    118 | % alternative styles
 | 
|  |    119 | 
 | 
|  |    120 | \newcommand{\isabellestyle}{}
 | 
|  |    121 | \def\isabellestyle#1{\csname isabellestyle#1\endcsname}
 | 
|  |    122 | 
 | 
|  |    123 | \newcommand{\isabellestylett}{%
 | 
|  |    124 | \renewcommand{\isastyle}{\small\tt}%
 | 
|  |    125 | \renewcommand{\isastyleminor}{\small\tt}%
 | 
|  |    126 | \renewcommand{\isastylescript}{\footnotesize\tt}%
 | 
|  |    127 | }
 | 
|  |    128 | \newcommand{\isabellestyleit}{%
 | 
|  |    129 | \renewcommand{\isastyle}{\small\it}%
 | 
|  |    130 | \renewcommand{\isastyleminor}{\it}%
 | 
|  |    131 | \renewcommand{\isastylescript}{\footnotesize\it}%
 | 
|  |    132 | \renewcommand{\isakeywordcharunderscore}{\mbox{-}}%
 | 
|  |    133 | \renewcommand{\isacharbang}{\isamath{!}}%
 | 
|  |    134 | \renewcommand{\isachardoublequote}{}%
 | 
|  |    135 | \renewcommand{\isacharhash}{\isamath{\#}}%
 | 
|  |    136 | \renewcommand{\isachardollar}{\isamath{\$}}%
 | 
|  |    137 | \renewcommand{\isacharpercent}{\isamath{\%}}%
 | 
|  |    138 | \renewcommand{\isacharampersand}{\isamath{\&}}%
 | 
|  |    139 | \renewcommand{\isacharprime}{\isamath{\mskip2mu{'}\mskip-2mu}}%
 | 
|  |    140 | \renewcommand{\isacharparenleft}{\isamath{(}}%
 | 
|  |    141 | \renewcommand{\isacharparenright}{\isamath{)}}%
 | 
|  |    142 | \renewcommand{\isacharasterisk}{\isamath{*}}%
 | 
|  |    143 | \renewcommand{\isacharplus}{\isamath{+}}%
 | 
|  |    144 | \renewcommand{\isacharcomma}{\isamath{\mathord,}}%
 | 
|  |    145 | \renewcommand{\isacharminus}{\isamath{-}}%
 | 
|  |    146 | \renewcommand{\isachardot}{\isamath{\mathord.}}%
 | 
|  |    147 | \renewcommand{\isacharslash}{\isamath{/}}%
 | 
|  |    148 | \renewcommand{\isacharcolon}{\isamath{\mathord:}}%
 | 
|  |    149 | \renewcommand{\isacharsemicolon}{\isamath{\mathord;}}%
 | 
|  |    150 | \renewcommand{\isacharless}{\isamath{<}}%
 | 
|  |    151 | \renewcommand{\isacharequal}{\isamath{=}}%
 | 
|  |    152 | \renewcommand{\isachargreater}{\isamath{>}}%
 | 
|  |    153 | \renewcommand{\isacharat}{\isamath{@}}%
 | 
|  |    154 | \renewcommand{\isacharbrackleft}{\isamath{[}}%
 | 
|  |    155 | \renewcommand{\isacharbrackright}{\isamath{]}}%
 | 
|  |    156 | \renewcommand{\isacharunderscore}{\mbox{-}}%
 | 
|  |    157 | \renewcommand{\isacharbraceleft}{\isamath{\{}}%
 | 
|  |    158 | \renewcommand{\isacharbar}{\isamath{\mid}}%
 | 
|  |    159 | \renewcommand{\isacharbraceright}{\isamath{\}}}%
 | 
|  |    160 | \renewcommand{\isachartilde}{\isamath{{}\sp{\sim}}}%
 | 
|  |    161 | }
 | 
|  |    162 | 
 | 
|  |    163 | \newcommand{\isabellestylesl}{%
 | 
|  |    164 | \isabellestyleit%
 | 
|  |    165 | \renewcommand{\isastyle}{\small\sl}%
 | 
|  |    166 | \renewcommand{\isastyleminor}{\sl}%
 | 
|  |    167 | \renewcommand{\isastylescript}{\footnotesize\sl}%
 | 
|  |    168 | }
 |