doc-src/IsarOverview/Isar/document/isabelle.sty
author kleing
Mon Jun 21 10:25:57 2004 +0200 (2004-06-21)
changeset 14981 e73f8140af78
parent 14617 a2bcb11ce445
child 15909 5f0c8a3f0226
permissions -rw-r--r--
Merged in license change from Isabelle2004
kleing@13999
     1
%%
kleing@13999
     2
%% Author: Markus Wenzel, TU Muenchen
kleing@13999
     3
%%
kleing@13999
     4
%% macros for Isabelle generated LaTeX output
kleing@13999
     5
%%
kleing@13999
     6
kleing@13999
     7
%%% Simple document preparation (based on theory token language and symbols)
kleing@13999
     8
kleing@13999
     9
% isabelle environments
kleing@13999
    10
kleing@13999
    11
\newcommand{\isabellecontext}{UNKNOWN}
kleing@13999
    12
kleing@13999
    13
\newcommand{\isastyle}{\small\tt\slshape}
kleing@13999
    14
\newcommand{\isastyleminor}{\small\tt\slshape}
kleing@13999
    15
\newcommand{\isastylescript}{\footnotesize\tt\slshape}
kleing@13999
    16
\newcommand{\isastyletext}{\normalsize\rm}
kleing@13999
    17
\newcommand{\isastyletxt}{\rm}
kleing@13999
    18
\newcommand{\isastylecmt}{\rm}
kleing@13999
    19
kleing@13999
    20
%symbol markup -- \emph achieves decent spacing via italic corrections
kleing@13999
    21
\newcommand{\isamath}[1]{\emph{$#1$}}
kleing@13999
    22
\newcommand{\isatext}[1]{\emph{#1}}
kleing@13999
    23
\newcommand{\isascriptstyle}{\def\isamath##1{##1}\def\isatext##1{\mbox{\isastylescript##1}}}
kleing@13999
    24
\newcommand{\isactrlsub}[1]{\emph{\isascriptstyle${}\sb{#1}$}}
kleing@13999
    25
\newcommand{\isactrlsup}[1]{\emph{\isascriptstyle${}\sp{#1}$}}
nipkow@14617
    26
\newcommand{\isactrlisub}[1]{\emph{\isascriptstyle${}\sb{#1}$}}
nipkow@14617
    27
\newcommand{\isactrlisup}[1]{\emph{\isascriptstyle${}\sp{#1}$}}
kleing@13999
    28
\newcommand{\isactrlbold}[1]{{\bfseries\upshape\boldmath#1}}
kleing@13999
    29
nipkow@14617
    30
% somewhat hackish: spanning sub/super scripts (\<^bsub>..\<^esub>)
nipkow@14617
    31
\newcommand{\isactrlbsub}{%
nipkow@14617
    32
\def\isatext##1{\isastylescript##1}\begin{math}_\bgroup}
nipkow@14617
    33
\newcommand{\isactrlesub}{\egroup\end{math}}
nipkow@14617
    34
\newcommand{\isactrlbsup}{%
nipkow@14617
    35
\def\isatext##1{\isastylescript##1}\begin{math}^\bgroup}
nipkow@14617
    36
\newcommand{\isactrlesup}{\egroup\end{math}}
nipkow@14617
    37
kleing@13999
    38
\newdimen\isa@parindent\newdimen\isa@parskip
kleing@13999
    39
kleing@13999
    40
\newenvironment{isabellebody}{%
kleing@13999
    41
\isamarkuptrue\par%
kleing@13999
    42
\isa@parindent\parindent\parindent0pt%
kleing@13999
    43
\isa@parskip\parskip\parskip0pt%
kleing@13999
    44
\isastyle}{\par}
kleing@13999
    45
kleing@13999
    46
\newenvironment{isabelle}
kleing@13999
    47
{\begin{trivlist}\begin{isabellebody}\item\relax}
kleing@13999
    48
{\end{isabellebody}\end{trivlist}}
kleing@13999
    49
kleing@13999
    50
\newcommand{\isa}[1]{\emph{\isastyleminor #1}}
kleing@13999
    51
kleing@13999
    52
\newcommand{\isaindent}[1]{\hphantom{#1}}
kleing@13999
    53
\newcommand{\isanewline}{\mbox{}\par\mbox{}}
nipkow@14617
    54
\newcommand{\isasep}{} % override with e.g. \renewcommand{\isasep}{\vspace{1ex}}
kleing@13999
    55
\newcommand{\isadigit}[1]{#1}
kleing@13999
    56
kleing@13999
    57
\chardef\isacharbang=`\!
kleing@13999
    58
\chardef\isachardoublequote=`\"
kleing@13999
    59
\chardef\isacharhash=`\#
kleing@13999
    60
\chardef\isachardollar=`\$
kleing@13999
    61
\chardef\isacharpercent=`\%
kleing@13999
    62
\chardef\isacharampersand=`\&
kleing@13999
    63
\chardef\isacharprime=`\'
kleing@13999
    64
\chardef\isacharparenleft=`\(
kleing@13999
    65
\chardef\isacharparenright=`\)
kleing@13999
    66
\chardef\isacharasterisk=`\*
kleing@13999
    67
\chardef\isacharplus=`\+
kleing@13999
    68
\chardef\isacharcomma=`\,
kleing@13999
    69
\chardef\isacharminus=`\-
kleing@13999
    70
\chardef\isachardot=`\.
kleing@13999
    71
\chardef\isacharslash=`\/
kleing@13999
    72
\chardef\isacharcolon=`\:
kleing@13999
    73
\chardef\isacharsemicolon=`\;
kleing@13999
    74
\chardef\isacharless=`\<
kleing@13999
    75
\chardef\isacharequal=`\=
kleing@13999
    76
\chardef\isachargreater=`\>
kleing@13999
    77
\chardef\isacharquery=`\?
kleing@13999
    78
\chardef\isacharat=`\@
kleing@13999
    79
\chardef\isacharbrackleft=`\[
kleing@13999
    80
\chardef\isacharbackslash=`\\
kleing@13999
    81
\chardef\isacharbrackright=`\]
kleing@13999
    82
\chardef\isacharcircum=`\^
kleing@13999
    83
\chardef\isacharunderscore=`\_
kleing@13999
    84
\chardef\isacharbackquote=`\`
kleing@13999
    85
\chardef\isacharbraceleft=`\{
kleing@13999
    86
\chardef\isacharbar=`\|
kleing@13999
    87
\chardef\isacharbraceright=`\}
kleing@13999
    88
\chardef\isachartilde=`\~
kleing@13999
    89
kleing@13999
    90
kleing@13999
    91
% keyword and section markup
kleing@13999
    92
kleing@13999
    93
\newcommand{\isakeywordcharunderscore}{\_}
kleing@13999
    94
\newcommand{\isakeyword}[1]
kleing@13999
    95
{\emph{\bf\def\isachardot{.}\def\isacharunderscore{\isakeywordcharunderscore}%
kleing@13999
    96
\def\isacharbraceleft{\{}\def\isacharbraceright{\}}#1}}
kleing@13999
    97
\newcommand{\isacommand}[1]{\isakeyword{#1}}
kleing@13999
    98
kleing@13999
    99
\newcommand{\isamarkupheader}[1]{\section{#1}}
kleing@13999
   100
\newcommand{\isamarkupchapter}[1]{\chapter{#1}}
kleing@13999
   101
\newcommand{\isamarkupsection}[1]{\section{#1}}
kleing@13999
   102
\newcommand{\isamarkupsubsection}[1]{\subsection{#1}}
kleing@13999
   103
\newcommand{\isamarkupsubsubsection}[1]{\subsubsection{#1}}
kleing@13999
   104
\newcommand{\isamarkupsect}[1]{\section{#1}}
kleing@13999
   105
\newcommand{\isamarkupsubsect}[1]{\subsection{#1}}
kleing@13999
   106
\newcommand{\isamarkupsubsubsect}[1]{\subsubsection{#1}}
kleing@13999
   107
kleing@13999
   108
\newif\ifisamarkup
kleing@13999
   109
\newcommand{\isabeginpar}{\par\ifisamarkup\relax\else\medskip\fi}
kleing@13999
   110
\newcommand{\isaendpar}{\par\medskip}
kleing@13999
   111
\newenvironment{isapar}{\parindent\isa@parindent\parskip\isa@parskip\isabeginpar}{\isaendpar}
kleing@13999
   112
\newenvironment{isamarkuptext}{\isastyletext\begin{isapar}}{\end{isapar}}
kleing@13999
   113
\newenvironment{isamarkuptxt}{\isastyletxt\begin{isapar}}{\end{isapar}}
kleing@13999
   114
\newcommand{\isamarkupcmt}[1]{{\isastylecmt--- #1}}
kleing@13999
   115
kleing@13999
   116
kleing@13999
   117
% alternative styles
kleing@13999
   118
kleing@13999
   119
\newcommand{\isabellestyle}{}
kleing@13999
   120
\def\isabellestyle#1{\csname isabellestyle#1\endcsname}
kleing@13999
   121
kleing@13999
   122
\newcommand{\isabellestylett}{%
kleing@13999
   123
\renewcommand{\isastyle}{\small\tt}%
kleing@13999
   124
\renewcommand{\isastyleminor}{\small\tt}%
kleing@13999
   125
\renewcommand{\isastylescript}{\footnotesize\tt}%
kleing@13999
   126
}
kleing@13999
   127
\newcommand{\isabellestyleit}{%
kleing@13999
   128
\renewcommand{\isastyle}{\small\it}%
kleing@13999
   129
\renewcommand{\isastyleminor}{\it}%
kleing@13999
   130
\renewcommand{\isastylescript}{\footnotesize\it}%
kleing@13999
   131
\renewcommand{\isakeywordcharunderscore}{\mbox{-}}%
kleing@13999
   132
\renewcommand{\isacharbang}{\isamath{!}}%
kleing@13999
   133
\renewcommand{\isachardoublequote}{}%
kleing@13999
   134
\renewcommand{\isacharhash}{\isamath{\#}}%
kleing@13999
   135
\renewcommand{\isachardollar}{\isamath{\$}}%
kleing@13999
   136
\renewcommand{\isacharpercent}{\isamath{\%}}%
kleing@13999
   137
\renewcommand{\isacharampersand}{\isamath{\&}}%
kleing@13999
   138
\renewcommand{\isacharprime}{\isamath{\mskip2mu{'}\mskip-2mu}}%
kleing@13999
   139
\renewcommand{\isacharparenleft}{\isamath{(}}%
kleing@13999
   140
\renewcommand{\isacharparenright}{\isamath{)}}%
kleing@13999
   141
\renewcommand{\isacharasterisk}{\isamath{*}}%
kleing@13999
   142
\renewcommand{\isacharplus}{\isamath{+}}%
kleing@13999
   143
\renewcommand{\isacharcomma}{\isamath{\mathord,}}%
kleing@13999
   144
\renewcommand{\isacharminus}{\isamath{-}}%
kleing@13999
   145
\renewcommand{\isachardot}{\isamath{\mathord.}}%
kleing@13999
   146
\renewcommand{\isacharslash}{\isamath{/}}%
kleing@13999
   147
\renewcommand{\isacharcolon}{\isamath{\mathord:}}%
kleing@13999
   148
\renewcommand{\isacharsemicolon}{\isamath{\mathord;}}%
kleing@13999
   149
\renewcommand{\isacharless}{\isamath{<}}%
kleing@13999
   150
\renewcommand{\isacharequal}{\isamath{=}}%
kleing@13999
   151
\renewcommand{\isachargreater}{\isamath{>}}%
kleing@13999
   152
\renewcommand{\isacharat}{\isamath{@}}%
kleing@13999
   153
\renewcommand{\isacharbrackleft}{\isamath{[}}%
kleing@13999
   154
\renewcommand{\isacharbrackright}{\isamath{]}}%
kleing@13999
   155
\renewcommand{\isacharunderscore}{\mbox{-}}%
kleing@13999
   156
\renewcommand{\isacharbraceleft}{\isamath{\{}}%
kleing@13999
   157
\renewcommand{\isacharbar}{\isamath{\mid}}%
kleing@13999
   158
\renewcommand{\isacharbraceright}{\isamath{\}}}%
kleing@13999
   159
\renewcommand{\isachartilde}{\isamath{{}\sp{\sim}}}%
kleing@13999
   160
}
kleing@13999
   161
kleing@13999
   162
\newcommand{\isabellestylesl}{%
kleing@13999
   163
\isabellestyleit%
kleing@13999
   164
\renewcommand{\isastyle}{\small\sl}%
kleing@13999
   165
\renewcommand{\isastyleminor}{\sl}%
kleing@13999
   166
\renewcommand{\isastylescript}{\footnotesize\sl}%
kleing@13999
   167
}