lib/texinputs/isabelle.sty
author wenzelm
Sun Oct 21 19:42:53 2001 +0200 (2001-10-21)
changeset 11863 87643169ae7d
parent 11573 4f85af77038f
child 13933 b224c2fd4288
permissions -rw-r--r--
\newif\ifisamarkup controls spacing of isabeginpar;
wenzelm@7709
     1
%%
wenzelm@9818
     2
%% Author: Markus Wenzel, TU Muenchen
wenzelm@9818
     3
%% License: GPL (GNU GENERAL PUBLIC LICENSE)
wenzelm@7709
     4
%%
wenzelm@7709
     5
%% macros for Isabelle generated LaTeX output
wenzelm@7709
     6
%%
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}}}
wenzelm@10260
    25
\newcommand{\isactrlsub}[1]{\emph{\isascriptstyle${}\sb{#1}$}}
wenzelm@10260
    26
\newcommand{\isactrlsup}[1]{\emph{\isascriptstyle${}\sp{#1}$}}
wenzelm@11573
    27
\newcommand{\isactrlbold}[1]{{\bfseries\upshape\boldmath#1}}
wenzelm@10220
    28
wenzelm@8713
    29
\newdimen\isa@parindent\newdimen\isa@parskip
wenzelm@9657
    30
wenzelm@9702
    31
\newenvironment{isabellebody}{%
wenzelm@11863
    32
\isamarkuptrue\par%
wenzelm@9702
    33
\isa@parindent\parindent\parindent0pt%
wenzelm@8713
    34
\isa@parskip\parskip\parskip0pt%
wenzelm@10470
    35
\isastyle}{\par}
wenzelm@9702
    36
wenzelm@9702
    37
\newenvironment{isabelle}
wenzelm@10422
    38
{\begin{trivlist}\begin{isabellebody}\item\relax}
wenzelm@10422
    39
{\end{isabellebody}\end{trivlist}}
wenzelm@8713
    40
wenzelm@9669
    41
\newcommand{\isa}[1]{\emph{\isastyleminor #1}}
wenzelm@8714
    42
wenzelm@10949
    43
\newcommand{\isaindent}[1]{\hphantom{#1}}
wenzelm@7709
    44
\newcommand{\isanewline}{\mbox{}\\\mbox{}}
wenzelm@9669
    45
\newcommand{\isadigit}[1]{#1}
wenzelm@7752
    46
wenzelm@9669
    47
\chardef\isacharbang=`\!
wenzelm@9669
    48
\chardef\isachardoublequote=`\"
wenzelm@9657
    49
\chardef\isacharhash=`\#
wenzelm@9657
    50
\chardef\isachardollar=`\$
wenzelm@9657
    51
\chardef\isacharpercent=`\%
wenzelm@9657
    52
\chardef\isacharampersand=`\&
wenzelm@9657
    53
\chardef\isacharprime=`\'
wenzelm@9657
    54
\chardef\isacharparenleft=`\(
wenzelm@9657
    55
\chardef\isacharparenright=`\)
wenzelm@9657
    56
\chardef\isacharasterisk=`\*
wenzelm@9669
    57
\chardef\isacharplus=`\+
wenzelm@9669
    58
\chardef\isacharcomma=`\,
wenzelm@9657
    59
\chardef\isacharminus=`\-
wenzelm@9669
    60
\chardef\isachardot=`\.
wenzelm@9669
    61
\chardef\isacharslash=`\/
wenzelm@9669
    62
\chardef\isacharcolon=`\:
wenzelm@9669
    63
\chardef\isacharsemicolon=`\;
wenzelm@9657
    64
\chardef\isacharless=`\<
wenzelm@9669
    65
\chardef\isacharequal=`\=
wenzelm@9657
    66
\chardef\isachargreater=`\>
wenzelm@9669
    67
\chardef\isacharquery=`\?
wenzelm@9669
    68
\chardef\isacharat=`\@
wenzelm@9657
    69
\chardef\isacharbrackleft=`\[
wenzelm@9657
    70
\chardef\isacharbackslash=`\\
wenzelm@9657
    71
\chardef\isacharbrackright=`\]
wenzelm@9657
    72
\chardef\isacharcircum=`\^
wenzelm@9657
    73
\chardef\isacharunderscore=`\_
wenzelm@9669
    74
\chardef\isacharbackquote=`\`
wenzelm@9657
    75
\chardef\isacharbraceleft=`\{
wenzelm@9657
    76
\chardef\isacharbar=`\|
wenzelm@9657
    77
\chardef\isacharbraceright=`\}
wenzelm@9657
    78
\chardef\isachartilde=`\~
wenzelm@7788
    79
wenzelm@7797
    80
wenzelm@7797
    81
% keyword and section markup
wenzelm@7788
    82
wenzelm@9710
    83
\newcommand{\isakeywordcharunderscore}{\_}
wenzelm@9669
    84
\newcommand{\isakeyword}[1]
wenzelm@9710
    85
{\emph{\bf\def\isachardot{.}\def\isacharunderscore{\isakeywordcharunderscore}%
wenzelm@9669
    86
\def\isacharbraceleft{\{}\def\isacharbraceright{\}}#1}}
wenzelm@9669
    87
\newcommand{\isacommand}[1]{\isakeyword{#1}}
wenzelm@7758
    88
wenzelm@8501
    89
\newcommand{\isamarkupheader}[1]{\section{#1}}
wenzelm@7752
    90
\newcommand{\isamarkupchapter}[1]{\chapter{#1}}
wenzelm@7752
    91
\newcommand{\isamarkupsection}[1]{\section{#1}}
wenzelm@7752
    92
\newcommand{\isamarkupsubsection}[1]{\subsection{#1}}
wenzelm@7752
    93
\newcommand{\isamarkupsubsubsection}[1]{\subsubsection{#1}}
wenzelm@7752
    94
\newcommand{\isamarkupsect}[1]{\section{#1}}
wenzelm@7752
    95
\newcommand{\isamarkupsubsect}[1]{\subsection{#1}}
wenzelm@7752
    96
\newcommand{\isamarkupsubsubsect}[1]{\subsubsection{#1}}
wenzelm@8662
    97
wenzelm@11863
    98
\newif\ifisamarkup
wenzelm@11863
    99
\newcommand{\isabeginpar}{\par\ifisamarkup\relax\else\medskip\fi}
wenzelm@10586
   100
\newcommand{\isaendpar}{\par\medskip}
wenzelm@10586
   101
\newenvironment{isapar}{\parindent\isa@parindent\parskip\isa@parskip\isabeginpar}{\isaendpar}
wenzelm@9657
   102
\newenvironment{isamarkuptext}{\isastyletext\begin{isapar}}{\end{isapar}}
wenzelm@9657
   103
\newenvironment{isamarkuptxt}{\isastyletxt\begin{isapar}}{\end{isapar}}
wenzelm@9657
   104
\newcommand{\isamarkupcmt}[1]{{\isastylecmt--- #1}}
wenzelm@9657
   105
wenzelm@9657
   106
wenzelm@10024
   107
% alternative styles
wenzelm@9657
   108
wenzelm@9657
   109
\newcommand{\isabellestyle}{}
wenzelm@9669
   110
\def\isabellestyle#1{\csname isabellestyle#1\endcsname}
wenzelm@9657
   111
wenzelm@10024
   112
\newcommand{\isabellestylett}{%
wenzelm@10024
   113
\renewcommand{\isastyle}{\small\tt}%
wenzelm@10188
   114
\renewcommand{\isastyleminor}{\small\tt}%
wenzelm@10220
   115
\renewcommand{\isastylescript}{\footnotesize\tt}%
wenzelm@10024
   116
}
wenzelm@9669
   117
\newcommand{\isabellestyleit}{%
wenzelm@9669
   118
\renewcommand{\isastyle}{\small\it}%
wenzelm@9669
   119
\renewcommand{\isastyleminor}{\it}%
wenzelm@10220
   120
\renewcommand{\isastylescript}{\footnotesize\it}%
wenzelm@9725
   121
\renewcommand{\isakeywordcharunderscore}{\mbox{-}}%
wenzelm@10220
   122
\renewcommand{\isacharbang}{\isamath{!}}%
wenzelm@9669
   123
\renewcommand{\isachardoublequote}{}%
wenzelm@10220
   124
\renewcommand{\isacharhash}{\isamath{\#}}%
wenzelm@10220
   125
\renewcommand{\isachardollar}{\isamath{\$}}%
wenzelm@10220
   126
\renewcommand{\isacharpercent}{\isamath{\%}}%
wenzelm@10220
   127
\renewcommand{\isacharampersand}{\isamath{\&}}%
wenzelm@10220
   128
\renewcommand{\isacharprime}{\isamath{\mskip2mu{'}\mskip-2mu}}%
wenzelm@10220
   129
\renewcommand{\isacharparenleft}{\isamath{(}}%
wenzelm@10220
   130
\renewcommand{\isacharparenright}{\isamath{)}}%
wenzelm@10220
   131
\renewcommand{\isacharasterisk}{\isamath{*}}%
wenzelm@10220
   132
\renewcommand{\isacharplus}{\isamath{+}}%
wenzelm@10220
   133
\renewcommand{\isacharcomma}{\isamath{\mathord,}}%
wenzelm@10220
   134
\renewcommand{\isacharminus}{\isamath{-}}%
wenzelm@10220
   135
\renewcommand{\isachardot}{\isamath{\mathord.}}%
wenzelm@10220
   136
\renewcommand{\isacharslash}{\isamath{/}}%
wenzelm@10220
   137
\renewcommand{\isacharcolon}{\isamath{\mathord:}}%
wenzelm@10220
   138
\renewcommand{\isacharsemicolon}{\isamath{\mathord;}}%
wenzelm@10220
   139
\renewcommand{\isacharless}{\isamath{<}}%
wenzelm@10220
   140
\renewcommand{\isacharequal}{\isamath{=}}%
wenzelm@10220
   141
\renewcommand{\isachargreater}{\isamath{>}}%
wenzelm@10220
   142
\renewcommand{\isacharat}{\isamath{@}}%
wenzelm@10220
   143
\renewcommand{\isacharbrackleft}{\isamath{[}}%
wenzelm@10220
   144
\renewcommand{\isacharbrackright}{\isamath{]}}%
wenzelm@9725
   145
\renewcommand{\isacharunderscore}{\mbox{-}}%
wenzelm@10220
   146
\renewcommand{\isacharbraceleft}{\isamath{\{}}%
wenzelm@10220
   147
\renewcommand{\isacharbar}{\isamath{\mid}}%
wenzelm@10220
   148
\renewcommand{\isacharbraceright}{\isamath{\}}}%
wenzelm@10260
   149
\renewcommand{\isachartilde}{\isamath{{}\sp{\sim}}}%
wenzelm@9657
   150
}
wenzelm@9657
   151
wenzelm@9975
   152
\newcommand{\isabellestylesl}{%
wenzelm@9975
   153
\isabellestyleit%
wenzelm@9975
   154
\renewcommand{\isastyle}{\small\sl}%
wenzelm@9975
   155
\renewcommand{\isastyleminor}{\sl}%
wenzelm@10220
   156
\renewcommand{\isastylescript}{\footnotesize\sl}%
wenzelm@9975
   157
}