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