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