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