lib/texinputs/isabelle.sty
author wenzelm
Wed Dec 06 21:30:26 2017 +0100 (10 months ago)
changeset 67151 d1ace598c026
parent 67146 909dcdec2122
child 67374 5a049cf98438
permissions -rw-r--r--
more default tags;
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@58870
    10
\newcommand{\setisabellecontext}[1]{\def\isabellecontext{#1}}
wenzelm@9913
    11
wenzelm@18860
    12
\newcommand{\isastyle}{\UNDEF}
wenzelm@58716
    13
\newcommand{\isastylett}{\UNDEF}
wenzelm@18860
    14
\newcommand{\isastyleminor}{\UNDEF}
wenzelm@58716
    15
\newcommand{\isastyleminortt}{\UNDEF}
wenzelm@18860
    16
\newcommand{\isastylescript}{\UNDEF}
wenzelm@9657
    17
\newcommand{\isastyletext}{\normalsize\rm}
wenzelm@9657
    18
\newcommand{\isastyletxt}{\rm}
wenzelm@9657
    19
\newcommand{\isastylecmt}{\rm}
wenzelm@8713
    20
wenzelm@43327
    21
\newcommand{\isaspacing}{%
wenzelm@43327
    22
  \sfcode 42 1000 % .
wenzelm@43327
    23
  \sfcode 63 1000 % ?
wenzelm@43327
    24
  \sfcode 33 1000 % !
wenzelm@43327
    25
  \sfcode 58 1000 % :
wenzelm@43327
    26
  \sfcode 59 1000 % ;
wenzelm@43327
    27
  \sfcode 44 1000 % ,
wenzelm@43327
    28
}
wenzelm@43325
    29
wenzelm@10220
    30
%symbol markup -- \emph achieves decent spacing via italic corrections
wenzelm@10220
    31
\newcommand{\isamath}[1]{\emph{$#1$}}
wenzelm@10220
    32
\newcommand{\isatext}[1]{\emph{#1}}
wenzelm@43325
    33
\DeclareRobustCommand{\isascriptstyle}{\def\isamath##1{##1}\def\isatext##1{\mbox{\isaspacing\isastylescript##1}}}
wenzelm@17180
    34
\newcommand{\isactrlsub}[1]{\emph{\isascriptstyle${}\sb{#1}$}}
wenzelm@17180
    35
\newcommand{\isactrlsup}[1]{\emph{\isascriptstyle${}\sp{#1}$}}
wenzelm@43325
    36
\DeclareRobustCommand{\isactrlbsub}{\emph\bgroup\math{}\sb\bgroup\mbox\bgroup\isaspacing\isastylescript}
wenzelm@25081
    37
\DeclareRobustCommand{\isactrlesub}{\egroup\egroup\endmath\egroup}
wenzelm@43325
    38
\DeclareRobustCommand{\isactrlbsup}{\emph\bgroup\math{}\sp\bgroup\mbox\bgroup\isaspacing\isastylescript}
wenzelm@25081
    39
\DeclareRobustCommand{\isactrlesup}{\egroup\egroup\endmath\egroup}
wenzelm@11573
    40
\newcommand{\isactrlbold}[1]{{\bfseries\upshape\boldmath#1}}
wenzelm@27337
    41
wenzelm@61473
    42
\newcommand{\isaantiqcontrol}[1]{\isatt{{\char`\\}{\char`\<}{\char`\^}#1{\char`\>}}}
wenzelm@22647
    43
\newenvironment{isaantiq}{{\isacharat\isacharbraceleft}}{{\isacharbraceright}}
kleing@14332
    44
wenzelm@8713
    45
\newdimen\isa@parindent\newdimen\isa@parskip
wenzelm@9657
    46
wenzelm@9702
    47
\newenvironment{isabellebody}{%
wenzelm@11863
    48
\isamarkuptrue\par%
wenzelm@9702
    49
\isa@parindent\parindent\parindent0pt%
wenzelm@8713
    50
\isa@parskip\parskip\parskip0pt%
wenzelm@43325
    51
\isaspacing\isastyle}{\par}
wenzelm@9702
    52
wenzelm@58716
    53
\newenvironment{isabellebodytt}{%
wenzelm@58716
    54
\isamarkuptrue\par%
wenzelm@58716
    55
\isa@parindent\parindent\parindent0pt%
wenzelm@58716
    56
\isa@parskip\parskip\parskip0pt%
wenzelm@58716
    57
\isaspacing\isastylett}{\par}
wenzelm@58716
    58
wenzelm@9702
    59
\newenvironment{isabelle}
wenzelm@10422
    60
{\begin{trivlist}\begin{isabellebody}\item\relax}
wenzelm@10422
    61
{\end{isabellebody}\end{trivlist}}
wenzelm@8713
    62
wenzelm@58716
    63
\newenvironment{isabellett}
wenzelm@58716
    64
{\begin{trivlist}\begin{isabellebodytt}\item\relax}
wenzelm@58716
    65
{\end{isabellebodytt}\end{trivlist}}
wenzelm@58716
    66
wenzelm@43325
    67
\newcommand{\isa}[1]{\emph{\isaspacing\isastyleminor #1}}
wenzelm@58716
    68
\newcommand{\isatt}[1]{\emph{\isaspacing\isastyleminortt #1}}
wenzelm@8714
    69
wenzelm@10949
    70
\newcommand{\isaindent}[1]{\hphantom{#1}}
kleing@13933
    71
\newcommand{\isanewline}{\mbox{}\par\mbox{}}
wenzelm@17158
    72
\newcommand{\isasep}{}
wenzelm@9669
    73
\newcommand{\isadigit}[1]{#1}
wenzelm@7752
    74
wenzelm@18860
    75
\newcommand{\isachardefaults}{%
wenzelm@64525
    76
\def\isacharbell{\isamath{\bigbox}}%requires stmaryrd
wenzelm@18860
    77
\chardef\isacharbang=`\!%
wenzelm@18860
    78
\chardef\isachardoublequote=`\"%
wenzelm@18860
    79
\chardef\isachardoublequoteopen=`\"%
wenzelm@18860
    80
\chardef\isachardoublequoteclose=`\"%
wenzelm@18860
    81
\chardef\isacharhash=`\#%
wenzelm@18860
    82
\chardef\isachardollar=`\$%
wenzelm@18860
    83
\chardef\isacharpercent=`\%%
wenzelm@18860
    84
\chardef\isacharampersand=`\&%
wenzelm@18860
    85
\chardef\isacharprime=`\'%
wenzelm@18860
    86
\chardef\isacharparenleft=`\(%
wenzelm@18860
    87
\chardef\isacharparenright=`\)%
wenzelm@18860
    88
\chardef\isacharasterisk=`\*%
wenzelm@18860
    89
\chardef\isacharplus=`\+%
wenzelm@18860
    90
\chardef\isacharcomma=`\,%
wenzelm@18860
    91
\chardef\isacharminus=`\-%
wenzelm@18860
    92
\chardef\isachardot=`\.%
wenzelm@18860
    93
\chardef\isacharslash=`\/%
wenzelm@18860
    94
\chardef\isacharcolon=`\:%
wenzelm@18860
    95
\chardef\isacharsemicolon=`\;%
wenzelm@18860
    96
\chardef\isacharless=`\<%
wenzelm@18860
    97
\chardef\isacharequal=`\=%
wenzelm@18860
    98
\chardef\isachargreater=`\>%
wenzelm@18860
    99
\chardef\isacharquery=`\?%
wenzelm@18860
   100
\chardef\isacharat=`\@%
wenzelm@18860
   101
\chardef\isacharbrackleft=`\[%
wenzelm@18860
   102
\chardef\isacharbackslash=`\\%
wenzelm@18860
   103
\chardef\isacharbrackright=`\]%
wenzelm@18860
   104
\chardef\isacharcircum=`\^%
wenzelm@18860
   105
\chardef\isacharunderscore=`\_%
wenzelm@18860
   106
\def\isacharunderscorekeyword{\_}%
wenzelm@18860
   107
\chardef\isacharbackquote=`\`%
wenzelm@18860
   108
\chardef\isacharbackquoteopen=`\`%
wenzelm@18860
   109
\chardef\isacharbackquoteclose=`\`%
wenzelm@18860
   110
\chardef\isacharbraceleft=`\{%
wenzelm@18860
   111
\chardef\isacharbar=`\|%
wenzelm@18860
   112
\chardef\isacharbraceright=`\}%
wenzelm@18860
   113
\chardef\isachartilde=`\~%
wenzelm@18860
   114
\def\isacharverbatimopen{\isacharbraceleft\isacharasterisk}%
wenzelm@18860
   115
\def\isacharverbatimclose{\isacharasterisk\isacharbraceright}%
wenzelm@55033
   116
\def\isacartoucheopen{\isatext{\raise.3ex\hbox{$\scriptscriptstyle\langle$}}}%
wenzelm@55033
   117
\def\isacartoucheclose{\isatext{\raise.3ex\hbox{$\scriptscriptstyle\rangle$}}}%
wenzelm@18860
   118
}
wenzelm@7788
   119
wenzelm@7797
   120
wenzelm@7797
   121
% keyword and section markup
wenzelm@7788
   122
wenzelm@9669
   123
\newcommand{\isakeyword}[1]
wenzelm@18860
   124
{\emph{\bf\def\isachardot{.}\def\isacharunderscore{\isacharunderscorekeyword}%
wenzelm@9669
   125
\def\isacharbraceleft{\{}\def\isacharbraceright{\}}#1}}
wenzelm@9669
   126
\newcommand{\isacommand}[1]{\isakeyword{#1}}
wenzelm@7758
   127
wenzelm@67146
   128
\newcommand{\isakeywordcontrol}[1]
wenzelm@67146
   129
{\emph{\bf\itshape\def\isacharunderscore{\isacharunderscorekeyword}#1\,}}
wenzelm@67146
   130
wenzelm@8501
   131
\newcommand{\isamarkupheader}[1]{\section{#1}}
wenzelm@7752
   132
\newcommand{\isamarkupchapter}[1]{\chapter{#1}}
wenzelm@7752
   133
\newcommand{\isamarkupsection}[1]{\section{#1}}
wenzelm@7752
   134
\newcommand{\isamarkupsubsection}[1]{\subsection{#1}}
wenzelm@7752
   135
\newcommand{\isamarkupsubsubsection}[1]{\subsubsection{#1}}
wenzelm@61463
   136
\newcommand{\isamarkupparagraph}[1]{\paragraph{#1}}
wenzelm@61463
   137
\newcommand{\isamarkupsubparagraph}[1]{\subparagraph{#1}}
wenzelm@8662
   138
wenzelm@11863
   139
\newif\ifisamarkup
wenzelm@11863
   140
\newcommand{\isabeginpar}{\par\ifisamarkup\relax\else\medskip\fi}
wenzelm@10586
   141
\newcommand{\isaendpar}{\par\medskip}
wenzelm@10586
   142
\newenvironment{isapar}{\parindent\isa@parindent\parskip\isa@parskip\isabeginpar}{\isaendpar}
wenzelm@17215
   143
\newenvironment{isamarkuptext}{\par\isastyletext\begin{isapar}}{\end{isapar}}
wenzelm@17215
   144
\newenvironment{isamarkuptxt}{\par\isastyletxt\begin{isapar}}{\end{isapar}}
wenzelm@9657
   145
\newcommand{\isamarkupcmt}[1]{{\isastylecmt--- #1}}
wenzelm@9657
   146
wenzelm@9657
   147
wenzelm@18860
   148
% styles
wenzelm@9657
   149
wenzelm@9669
   150
\def\isabellestyle#1{\csname isabellestyle#1\endcsname}
wenzelm@9657
   151
wenzelm@18860
   152
\newcommand{\isabellestyledefault}{%
wenzelm@42514
   153
\def\isastyle{\small\tt\slshape}%
wenzelm@58716
   154
\def\isastylett{\small\tt}%
wenzelm@42514
   155
\def\isastyleminor{\small\tt\slshape}%
wenzelm@58716
   156
\def\isastyleminortt{\small\tt}%
wenzelm@42514
   157
\def\isastylescript{\footnotesize\tt\slshape}%
wenzelm@18860
   158
\isachardefaults%
wenzelm@18860
   159
}
wenzelm@18860
   160
\isabellestyledefault
wenzelm@18860
   161
wenzelm@10024
   162
\newcommand{\isabellestylett}{%
wenzelm@42514
   163
\def\isastyle{\small\tt}%
wenzelm@58716
   164
\def\isastylett{\small\tt}%
wenzelm@42514
   165
\def\isastyleminor{\small\tt}%
wenzelm@58716
   166
\def\isastyleminortt{\small\tt}%
wenzelm@42514
   167
\def\isastylescript{\footnotesize\tt}%
wenzelm@18860
   168
\isachardefaults%
wenzelm@10024
   169
}
wenzelm@18860
   170
wenzelm@9669
   171
\newcommand{\isabellestyleit}{%
wenzelm@42514
   172
\def\isastyle{\small\it}%
wenzelm@58716
   173
\def\isastylett{\small\tt}%
wenzelm@42514
   174
\def\isastyleminor{\it}%
wenzelm@58716
   175
\def\isastyleminortt{\tt}%
wenzelm@42514
   176
\def\isastylescript{\footnotesize\it}%
wenzelm@42514
   177
\isachardefaults%
wenzelm@42514
   178
\def\isacharunderscorekeyword{\mbox{-}}%
wenzelm@42514
   179
\def\isacharbang{\isamath{!}}%
wenzelm@49320
   180
\def\isachardoublequote{}%
wenzelm@49320
   181
\def\isachardoublequoteopen{}%
wenzelm@49320
   182
\def\isachardoublequoteclose{}%
wenzelm@42514
   183
\def\isacharhash{\isamath{\#}}%
wenzelm@42514
   184
\def\isachardollar{\isamath{\$}}%
wenzelm@42514
   185
\def\isacharpercent{\isamath{\%}}%
wenzelm@42514
   186
\def\isacharampersand{\isamath{\&}}%
wenzelm@42514
   187
\def\isacharprime{\isamath{\mskip2mu{'}\mskip-2mu}}%
wenzelm@42514
   188
\def\isacharparenleft{\isamath{(}}%
wenzelm@42514
   189
\def\isacharparenright{\isamath{)}}%
wenzelm@42514
   190
\def\isacharasterisk{\isamath{*}}%
wenzelm@42514
   191
\def\isacharplus{\isamath{+}}%
wenzelm@42514
   192
\def\isacharcomma{\isamath{\mathord,}}%
wenzelm@42514
   193
\def\isacharminus{\isamath{-}}%
wenzelm@42514
   194
\def\isachardot{\isamath{\mathord.}}%
wenzelm@42514
   195
\def\isacharslash{\isamath{/}}%
wenzelm@42514
   196
\def\isacharcolon{\isamath{\mathord:}}%
wenzelm@42514
   197
\def\isacharsemicolon{\isamath{\mathord;}}%
wenzelm@42514
   198
\def\isacharless{\isamath{<}}%
wenzelm@42514
   199
\def\isacharequal{\isamath{=}}%
wenzelm@42514
   200
\def\isachargreater{\isamath{>}}%
wenzelm@42514
   201
\def\isacharat{\isamath{@}}%
wenzelm@42514
   202
\def\isacharbrackleft{\isamath{[}}%
wenzelm@42514
   203
\def\isacharbackslash{\isamath{\backslash}}%
wenzelm@42514
   204
\def\isacharbrackright{\isamath{]}}%
wenzelm@42514
   205
\def\isacharunderscore{\mbox{-}}%
wenzelm@42514
   206
\def\isacharbraceleft{\isamath{\{}}%
wenzelm@42514
   207
\def\isacharbar{\isamath{\mid}}%
wenzelm@42514
   208
\def\isacharbraceright{\isamath{\}}}%
wenzelm@42514
   209
\def\isachartilde{\isamath{{}\sp{\sim}}}%
wenzelm@42514
   210
\def\isacharbackquoteopen{\isatext{\raise.3ex\hbox{$\scriptscriptstyle\langle$}}}%
wenzelm@42514
   211
\def\isacharbackquoteclose{\isatext{\raise.3ex\hbox{$\scriptscriptstyle\rangle$}}}%
wenzelm@42514
   212
\def\isacharverbatimopen{\isamath{\langle\!\langle}}%
wenzelm@42514
   213
\def\isacharverbatimclose{\isamath{\rangle\!\rangle}}%
wenzelm@9657
   214
}
wenzelm@9657
   215
wenzelm@45646
   216
\newcommand{\isabellestyleliteral}{%
wenzelm@42663
   217
\isabellestyleit%
wenzelm@42663
   218
\def\isacharunderscore{\_}%
wenzelm@42663
   219
\def\isacharunderscorekeyword{\_}%
wenzelm@45646
   220
\chardef\isacharbackquoteopen=`\`%
wenzelm@45646
   221
\chardef\isacharbackquoteclose=`\`%
wenzelm@42663
   222
}
wenzelm@42663
   223
wenzelm@55365
   224
\newcommand{\isabellestyleliteralunderscore}{%
wenzelm@55365
   225
\isabellestyleliteral%
wenzelm@55365
   226
\def\isacharunderscore{\textunderscore}%
wenzelm@55365
   227
\def\isacharunderscorekeyword{\textunderscore}%
wenzelm@55365
   228
}
wenzelm@55365
   229
wenzelm@9975
   230
\newcommand{\isabellestylesl}{%
wenzelm@9975
   231
\isabellestyleit%
wenzelm@42514
   232
\def\isastyle{\small\sl}%
wenzelm@58716
   233
\def\isastylett{\small\tt}%
wenzelm@42514
   234
\def\isastyleminor{\sl}%
wenzelm@58716
   235
\def\isastyleminortt{\tt}%
wenzelm@42514
   236
\def\isastylescript{\footnotesize\sl}%
wenzelm@9975
   237
}
wenzelm@17052
   238
wenzelm@17052
   239
wenzelm@17052
   240
% tagged regions
wenzelm@17052
   241
wenzelm@17052
   242
%plain TeX version of comment package -- much faster!
wenzelm@17052
   243
\let\isafmtname\fmtname\def\fmtname{plain}
wenzelm@17052
   244
\usepackage{comment}
wenzelm@17052
   245
\let\fmtname\isafmtname
wenzelm@17052
   246
wenzelm@17052
   247
\newcommand{\isafold}[1]{\emph{$\langle\mathord{\mathit{#1}}\rangle$}}
wenzelm@17052
   248
wenzelm@17052
   249
\newcommand{\isakeeptag}[1]%
wenzelm@17052
   250
{\includecomment{isadelim#1}\includecomment{isatag#1}\csarg\def{isafold#1}{}}
wenzelm@17052
   251
\newcommand{\isadroptag}[1]%
wenzelm@17052
   252
{\excludecomment{isadelim#1}\excludecomment{isatag#1}\csarg\def{isafold#1}{}}
wenzelm@17052
   253
\newcommand{\isafoldtag}[1]%
wenzelm@17052
   254
{\includecomment{isadelim#1}\excludecomment{isatag#1}\csarg\def{isafold#1}{\isafold{#1}}}
wenzelm@17052
   255
wenzelm@67139
   256
\isakeeptag{document}
wenzelm@17052
   257
\isakeeptag{theory}
wenzelm@17052
   258
\isakeeptag{proof}
wenzelm@17052
   259
\isakeeptag{ML}
wenzelm@17052
   260
\isakeeptag{visible}
wenzelm@17052
   261
\isadroptag{invisible}
wenzelm@67151
   262
\isakeeptag{important}
wenzelm@67151
   263
\isakeeptag{unimportant}
wenzelm@17052
   264
wenzelm@17052
   265
\IfFileExists{isabelletags.sty}{\usepackage{isabelletags}}{}