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