lib/texinputs/isabelle.sty
author wenzelm
Tue Sep 20 21:39:00 2005 +0200 (2005-09-20)
changeset 17531 0bc8ae586a7c
parent 17215 8b969275a5d2
child 18860 9089cdb4c5fd
permissions -rw-r--r--
tuned headers;
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@9657
    13
\newcommand{\isastyle}{\small\tt\slshape}
wenzelm@9669
    14
\newcommand{\isastyleminor}{\small\tt\slshape}
wenzelm@10220
    15
\newcommand{\isastylescript}{\footnotesize\tt\slshape}
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@9669
    55
\chardef\isacharbang=`\!
wenzelm@9669
    56
\chardef\isachardoublequote=`\"
wenzelm@17158
    57
\chardef\isachardoublequoteopen=`\"
wenzelm@17158
    58
\chardef\isachardoublequoteclose=`\"
wenzelm@9657
    59
\chardef\isacharhash=`\#
wenzelm@9657
    60
\chardef\isachardollar=`\$
wenzelm@9657
    61
\chardef\isacharpercent=`\%
wenzelm@9657
    62
\chardef\isacharampersand=`\&
wenzelm@9657
    63
\chardef\isacharprime=`\'
wenzelm@9657
    64
\chardef\isacharparenleft=`\(
wenzelm@9657
    65
\chardef\isacharparenright=`\)
wenzelm@9657
    66
\chardef\isacharasterisk=`\*
wenzelm@9669
    67
\chardef\isacharplus=`\+
wenzelm@9669
    68
\chardef\isacharcomma=`\,
wenzelm@9657
    69
\chardef\isacharminus=`\-
wenzelm@9669
    70
\chardef\isachardot=`\.
wenzelm@9669
    71
\chardef\isacharslash=`\/
wenzelm@9669
    72
\chardef\isacharcolon=`\:
wenzelm@9669
    73
\chardef\isacharsemicolon=`\;
wenzelm@9657
    74
\chardef\isacharless=`\<
wenzelm@9669
    75
\chardef\isacharequal=`\=
wenzelm@9657
    76
\chardef\isachargreater=`\>
wenzelm@9669
    77
\chardef\isacharquery=`\?
wenzelm@9669
    78
\chardef\isacharat=`\@
wenzelm@9657
    79
\chardef\isacharbrackleft=`\[
wenzelm@9657
    80
\chardef\isacharbackslash=`\\
wenzelm@9657
    81
\chardef\isacharbrackright=`\]
wenzelm@9657
    82
\chardef\isacharcircum=`\^
wenzelm@9657
    83
\chardef\isacharunderscore=`\_
wenzelm@9669
    84
\chardef\isacharbackquote=`\`
wenzelm@17158
    85
\chardef\isacharbackquoteopen=`\`
wenzelm@17158
    86
\chardef\isacharbackquoteclose=`\`
wenzelm@9657
    87
\chardef\isacharbraceleft=`\{
wenzelm@9657
    88
\chardef\isacharbar=`\|
wenzelm@9657
    89
\chardef\isacharbraceright=`\}
wenzelm@9657
    90
\chardef\isachartilde=`\~
wenzelm@17180
    91
\def\isacharverbatimopen{\isacharbraceleft\isacharasterisk}
wenzelm@17180
    92
\def\isacharverbatimclose{\isacharasterisk\isacharbraceright}
wenzelm@7788
    93
wenzelm@7797
    94
wenzelm@7797
    95
% keyword and section markup
wenzelm@7788
    96
wenzelm@9710
    97
\newcommand{\isakeywordcharunderscore}{\_}
wenzelm@9669
    98
\newcommand{\isakeyword}[1]
wenzelm@9710
    99
{\emph{\bf\def\isachardot{.}\def\isacharunderscore{\isakeywordcharunderscore}%
wenzelm@9669
   100
\def\isacharbraceleft{\{}\def\isacharbraceright{\}}#1}}
wenzelm@9669
   101
\newcommand{\isacommand}[1]{\isakeyword{#1}}
wenzelm@7758
   102
wenzelm@8501
   103
\newcommand{\isamarkupheader}[1]{\section{#1}}
wenzelm@7752
   104
\newcommand{\isamarkupchapter}[1]{\chapter{#1}}
wenzelm@7752
   105
\newcommand{\isamarkupsection}[1]{\section{#1}}
wenzelm@7752
   106
\newcommand{\isamarkupsubsection}[1]{\subsection{#1}}
wenzelm@7752
   107
\newcommand{\isamarkupsubsubsection}[1]{\subsubsection{#1}}
wenzelm@7752
   108
\newcommand{\isamarkupsect}[1]{\section{#1}}
wenzelm@7752
   109
\newcommand{\isamarkupsubsect}[1]{\subsection{#1}}
wenzelm@7752
   110
\newcommand{\isamarkupsubsubsect}[1]{\subsubsection{#1}}
wenzelm@8662
   111
wenzelm@11863
   112
\newif\ifisamarkup
wenzelm@11863
   113
\newcommand{\isabeginpar}{\par\ifisamarkup\relax\else\medskip\fi}
wenzelm@10586
   114
\newcommand{\isaendpar}{\par\medskip}
wenzelm@10586
   115
\newenvironment{isapar}{\parindent\isa@parindent\parskip\isa@parskip\isabeginpar}{\isaendpar}
wenzelm@17215
   116
\newenvironment{isamarkuptext}{\par\isastyletext\begin{isapar}}{\end{isapar}}
wenzelm@17215
   117
\newenvironment{isamarkuptxt}{\par\isastyletxt\begin{isapar}}{\end{isapar}}
wenzelm@9657
   118
\newcommand{\isamarkupcmt}[1]{{\isastylecmt--- #1}}
wenzelm@9657
   119
wenzelm@9657
   120
wenzelm@10024
   121
% alternative styles
wenzelm@9657
   122
wenzelm@9657
   123
\newcommand{\isabellestyle}{}
wenzelm@9669
   124
\def\isabellestyle#1{\csname isabellestyle#1\endcsname}
wenzelm@9657
   125
wenzelm@10024
   126
\newcommand{\isabellestylett}{%
wenzelm@10024
   127
\renewcommand{\isastyle}{\small\tt}%
wenzelm@10188
   128
\renewcommand{\isastyleminor}{\small\tt}%
wenzelm@10220
   129
\renewcommand{\isastylescript}{\footnotesize\tt}%
wenzelm@10024
   130
}
wenzelm@9669
   131
\newcommand{\isabellestyleit}{%
wenzelm@9669
   132
\renewcommand{\isastyle}{\small\it}%
wenzelm@9669
   133
\renewcommand{\isastyleminor}{\it}%
wenzelm@10220
   134
\renewcommand{\isastylescript}{\footnotesize\it}%
wenzelm@9725
   135
\renewcommand{\isakeywordcharunderscore}{\mbox{-}}%
wenzelm@10220
   136
\renewcommand{\isacharbang}{\isamath{!}}%
wenzelm@9669
   137
\renewcommand{\isachardoublequote}{}%
wenzelm@17158
   138
\renewcommand{\isachardoublequoteopen}{}%
wenzelm@17158
   139
\renewcommand{\isachardoublequoteclose}{}%
wenzelm@10220
   140
\renewcommand{\isacharhash}{\isamath{\#}}%
wenzelm@10220
   141
\renewcommand{\isachardollar}{\isamath{\$}}%
wenzelm@10220
   142
\renewcommand{\isacharpercent}{\isamath{\%}}%
wenzelm@10220
   143
\renewcommand{\isacharampersand}{\isamath{\&}}%
wenzelm@10220
   144
\renewcommand{\isacharprime}{\isamath{\mskip2mu{'}\mskip-2mu}}%
wenzelm@10220
   145
\renewcommand{\isacharparenleft}{\isamath{(}}%
wenzelm@10220
   146
\renewcommand{\isacharparenright}{\isamath{)}}%
wenzelm@10220
   147
\renewcommand{\isacharasterisk}{\isamath{*}}%
wenzelm@10220
   148
\renewcommand{\isacharplus}{\isamath{+}}%
wenzelm@10220
   149
\renewcommand{\isacharcomma}{\isamath{\mathord,}}%
wenzelm@10220
   150
\renewcommand{\isacharminus}{\isamath{-}}%
wenzelm@10220
   151
\renewcommand{\isachardot}{\isamath{\mathord.}}%
wenzelm@10220
   152
\renewcommand{\isacharslash}{\isamath{/}}%
wenzelm@10220
   153
\renewcommand{\isacharcolon}{\isamath{\mathord:}}%
wenzelm@10220
   154
\renewcommand{\isacharsemicolon}{\isamath{\mathord;}}%
wenzelm@10220
   155
\renewcommand{\isacharless}{\isamath{<}}%
wenzelm@10220
   156
\renewcommand{\isacharequal}{\isamath{=}}%
wenzelm@10220
   157
\renewcommand{\isachargreater}{\isamath{>}}%
wenzelm@10220
   158
\renewcommand{\isacharat}{\isamath{@}}%
wenzelm@10220
   159
\renewcommand{\isacharbrackleft}{\isamath{[}}%
wenzelm@17052
   160
\renewcommand{\isacharbackslash}{\isamath{\backslash}}%
wenzelm@10220
   161
\renewcommand{\isacharbrackright}{\isamath{]}}%
wenzelm@9725
   162
\renewcommand{\isacharunderscore}{\mbox{-}}%
wenzelm@10220
   163
\renewcommand{\isacharbraceleft}{\isamath{\{}}%
wenzelm@10220
   164
\renewcommand{\isacharbar}{\isamath{\mid}}%
wenzelm@10220
   165
\renewcommand{\isacharbraceright}{\isamath{\}}}%
wenzelm@10260
   166
\renewcommand{\isachartilde}{\isamath{{}\sp{\sim}}}%
wenzelm@17158
   167
\renewcommand{\isacharbackquoteopen}{\isatext{\raise.3ex\hbox{$\scriptscriptstyle\langle$}}}%
wenzelm@17158
   168
\renewcommand{\isacharbackquoteclose}{\isatext{\raise.3ex\hbox{$\scriptscriptstyle\rangle$}}}%
wenzelm@17180
   169
\renewcommand{\isacharverbatimopen}{\isamath{\langle\!\langle}}%
wenzelm@17180
   170
\renewcommand{\isacharverbatimclose}{\isamath{\rangle\!\rangle}}%
wenzelm@9657
   171
}
wenzelm@9657
   172
wenzelm@9975
   173
\newcommand{\isabellestylesl}{%
wenzelm@9975
   174
\isabellestyleit%
wenzelm@9975
   175
\renewcommand{\isastyle}{\small\sl}%
wenzelm@9975
   176
\renewcommand{\isastyleminor}{\sl}%
wenzelm@10220
   177
\renewcommand{\isastylescript}{\footnotesize\sl}%
wenzelm@9975
   178
}
wenzelm@17052
   179
wenzelm@17052
   180
wenzelm@17052
   181
% tagged regions
wenzelm@17052
   182
wenzelm@17052
   183
%plain TeX version of comment package -- much faster!
wenzelm@17052
   184
\let\isafmtname\fmtname\def\fmtname{plain}
wenzelm@17052
   185
\usepackage{comment}
wenzelm@17052
   186
\let\fmtname\isafmtname
wenzelm@17052
   187
wenzelm@17052
   188
\newcommand{\isafold}[1]{\emph{$\langle\mathord{\mathit{#1}}\rangle$}}
wenzelm@17052
   189
wenzelm@17052
   190
\newcommand{\isakeeptag}[1]%
wenzelm@17052
   191
{\includecomment{isadelim#1}\includecomment{isatag#1}\csarg\def{isafold#1}{}}
wenzelm@17052
   192
\newcommand{\isadroptag}[1]%
wenzelm@17052
   193
{\excludecomment{isadelim#1}\excludecomment{isatag#1}\csarg\def{isafold#1}{}}
wenzelm@17052
   194
\newcommand{\isafoldtag}[1]%
wenzelm@17052
   195
{\includecomment{isadelim#1}\excludecomment{isatag#1}\csarg\def{isafold#1}{\isafold{#1}}}
wenzelm@17052
   196
wenzelm@17052
   197
\isakeeptag{theory}
wenzelm@17052
   198
\isakeeptag{proof}
wenzelm@17052
   199
\isakeeptag{ML}
wenzelm@17052
   200
\isakeeptag{visible}
wenzelm@17052
   201
\isadroptag{invisible}
wenzelm@17052
   202
wenzelm@17052
   203
\IfFileExists{isabelletags.sty}{\usepackage{isabelletags}}{}