doc-src/TutorialI/isabelle.sty
author nipkow
Wed Dec 06 13:22:58 2000 +0100 (2000-12-06)
changeset 10608 620647438780
parent 10589 b2d1b393b750
child 10823 88cb1547d952
permissions -rw-r--r--
*** empty log message ***
nipkow@8751
     1
%%
nipkow@8751
     2
%% $Id$
wenzelm@9845
     3
%% Author: Markus Wenzel, TU Muenchen
wenzelm@9845
     4
%% License: GPL (GNU GENERAL PUBLIC LICENSE)
nipkow@8751
     5
%%
nipkow@8751
     6
%% macros for Isabelle generated LaTeX output
nipkow@8751
     7
%%
nipkow@8751
     8
wenzelm@9924
     9
%%% Simple document preparation (based on theory token language and symbols)
nipkow@8751
    10
nipkow@8751
    11
% isabelle environments
nipkow@8751
    12
wenzelm@9924
    13
\newcommand{\isabellecontext}{UNKNOWN}
wenzelm@9924
    14
wenzelm@9673
    15
\newcommand{\isastyle}{\small\tt\slshape}
wenzelm@9673
    16
\newcommand{\isastyleminor}{\small\tt\slshape}
wenzelm@10226
    17
\newcommand{\isastylescript}{\footnotesize\tt\slshape}
wenzelm@9673
    18
\newcommand{\isastyletext}{\normalsize\rm}
wenzelm@9673
    19
\newcommand{\isastyletxt}{\rm}
wenzelm@9673
    20
\newcommand{\isastylecmt}{\rm}
nipkow@8751
    21
wenzelm@10226
    22
%symbol markup -- \emph achieves decent spacing via italic corrections
wenzelm@10226
    23
\newcommand{\isamath}[1]{\emph{$#1$}}
wenzelm@10226
    24
\newcommand{\isatext}[1]{\emph{#1}}
wenzelm@10226
    25
\newcommand{\isascriptstyle}{\def\isamath##1{##1}\def\isatext##1{\mbox{\isastylescript##1}}}
wenzelm@10267
    26
\newcommand{\isactrlsub}[1]{\emph{\isascriptstyle${}\sb{#1}$}}
wenzelm@10267
    27
\newcommand{\isactrlsup}[1]{\emph{\isascriptstyle${}\sp{#1}$}}
wenzelm@10226
    28
nipkow@8751
    29
\newdimen\isa@parindent\newdimen\isa@parskip
wenzelm@9673
    30
wenzelm@9717
    31
\newenvironment{isabellebody}{%
wenzelm@10471
    32
\par%
wenzelm@9717
    33
\isa@parindent\parindent\parindent0pt%
nipkow@8751
    34
\isa@parskip\parskip\parskip0pt%
wenzelm@10471
    35
\isastyle}{\par}
wenzelm@9717
    36
wenzelm@9717
    37
\newenvironment{isabelle}
wenzelm@10424
    38
{\begin{trivlist}\begin{isabellebody}\item\relax}
wenzelm@10424
    39
{\end{isabellebody}\end{trivlist}}
nipkow@8751
    40
wenzelm@9673
    41
\newcommand{\isa}[1]{\emph{\isastyleminor #1}}
nipkow@8771
    42
nipkow@8751
    43
\newcommand{\isanewline}{\mbox{}\\\mbox{}}
wenzelm@9673
    44
\newcommand{\isadigit}[1]{#1}
nipkow@8751
    45
wenzelm@9673
    46
\chardef\isacharbang=`\!
wenzelm@9673
    47
\chardef\isachardoublequote=`\"
wenzelm@9673
    48
\chardef\isacharhash=`\#
wenzelm@9673
    49
\chardef\isachardollar=`\$
wenzelm@9673
    50
\chardef\isacharpercent=`\%
wenzelm@9673
    51
\chardef\isacharampersand=`\&
wenzelm@9673
    52
\chardef\isacharprime=`\'
wenzelm@9673
    53
\chardef\isacharparenleft=`\(
wenzelm@9673
    54
\chardef\isacharparenright=`\)
wenzelm@9673
    55
\chardef\isacharasterisk=`\*
wenzelm@9673
    56
\chardef\isacharplus=`\+
wenzelm@9673
    57
\chardef\isacharcomma=`\,
wenzelm@9673
    58
\chardef\isacharminus=`\-
wenzelm@9673
    59
\chardef\isachardot=`\.
wenzelm@9673
    60
\chardef\isacharslash=`\/
wenzelm@9673
    61
\chardef\isacharcolon=`\:
wenzelm@9673
    62
\chardef\isacharsemicolon=`\;
wenzelm@9673
    63
\chardef\isacharless=`\<
wenzelm@9673
    64
\chardef\isacharequal=`\=
wenzelm@9673
    65
\chardef\isachargreater=`\>
wenzelm@9673
    66
\chardef\isacharquery=`\?
wenzelm@9673
    67
\chardef\isacharat=`\@
wenzelm@9673
    68
\chardef\isacharbrackleft=`\[
wenzelm@9673
    69
\chardef\isacharbackslash=`\\
wenzelm@9673
    70
\chardef\isacharbrackright=`\]
wenzelm@9673
    71
\chardef\isacharcircum=`\^
wenzelm@9673
    72
\chardef\isacharunderscore=`\_
wenzelm@9673
    73
\chardef\isacharbackquote=`\`
wenzelm@9673
    74
\chardef\isacharbraceleft=`\{
wenzelm@9673
    75
\chardef\isacharbar=`\|
wenzelm@9673
    76
\chardef\isacharbraceright=`\}
wenzelm@9673
    77
\chardef\isachartilde=`\~
nipkow@8751
    78
nipkow@8751
    79
nipkow@8751
    80
% keyword and section markup
nipkow@8751
    81
wenzelm@9717
    82
\newcommand{\isakeywordcharunderscore}{\_}
wenzelm@9673
    83
\newcommand{\isakeyword}[1]
wenzelm@9717
    84
{\emph{\bf\def\isachardot{.}\def\isacharunderscore{\isakeywordcharunderscore}%
wenzelm@9673
    85
\def\isacharbraceleft{\{}\def\isacharbraceright{\}}#1}}
wenzelm@9673
    86
\newcommand{\isacommand}[1]{\isakeyword{#1}}
nipkow@8751
    87
nipkow@8751
    88
\newcommand{\isamarkupheader}[1]{\section{#1}}
nipkow@8751
    89
\newcommand{\isamarkupchapter}[1]{\chapter{#1}}
nipkow@8751
    90
\newcommand{\isamarkupsection}[1]{\section{#1}}
nipkow@8751
    91
\newcommand{\isamarkupsubsection}[1]{\subsection{#1}}
nipkow@8751
    92
\newcommand{\isamarkupsubsubsection}[1]{\subsubsection{#1}}
nipkow@8751
    93
\newcommand{\isamarkupsect}[1]{\section{#1}}
nipkow@8751
    94
\newcommand{\isamarkupsubsect}[1]{\subsection{#1}}
nipkow@8751
    95
\newcommand{\isamarkupsubsubsect}[1]{\subsubsection{#1}}
nipkow@8751
    96
wenzelm@10589
    97
\newcommand{\isabeginpar}{\par\medskip}
wenzelm@10589
    98
\newcommand{\isaendpar}{\par\medskip}
wenzelm@10589
    99
\newenvironment{isapar}{\parindent\isa@parindent\parskip\isa@parskip\isabeginpar}{\isaendpar}
wenzelm@9673
   100
\newenvironment{isamarkuptext}{\isastyletext\begin{isapar}}{\end{isapar}}
wenzelm@9673
   101
\newenvironment{isamarkuptxt}{\isastyletxt\begin{isapar}}{\end{isapar}}
wenzelm@9673
   102
\newcommand{\isamarkupcmt}[1]{{\isastylecmt--- #1}}
wenzelm@9673
   103
wenzelm@9673
   104
wenzelm@10037
   105
% alternative styles
wenzelm@9673
   106
wenzelm@9673
   107
\newcommand{\isabellestyle}{}
wenzelm@9673
   108
\def\isabellestyle#1{\csname isabellestyle#1\endcsname}
wenzelm@9673
   109
wenzelm@10037
   110
\newcommand{\isabellestylett}{%
wenzelm@10037
   111
\renewcommand{\isastyle}{\small\tt}%
wenzelm@10211
   112
\renewcommand{\isastyleminor}{\small\tt}%
wenzelm@10226
   113
\renewcommand{\isastylescript}{\footnotesize\tt}%
wenzelm@10037
   114
}
wenzelm@9673
   115
\newcommand{\isabellestyleit}{%
wenzelm@9673
   116
\renewcommand{\isastyle}{\small\it}%
wenzelm@9673
   117
\renewcommand{\isastyleminor}{\it}%
wenzelm@10226
   118
\renewcommand{\isastylescript}{\footnotesize\it}%
wenzelm@9812
   119
\renewcommand{\isakeywordcharunderscore}{\mbox{-}}%
wenzelm@10226
   120
\renewcommand{\isacharbang}{\isamath{!}}%
wenzelm@9673
   121
\renewcommand{\isachardoublequote}{}%
wenzelm@10226
   122
\renewcommand{\isacharhash}{\isamath{\#}}%
wenzelm@10226
   123
\renewcommand{\isachardollar}{\isamath{\$}}%
wenzelm@10226
   124
\renewcommand{\isacharpercent}{\isamath{\%}}%
wenzelm@10226
   125
\renewcommand{\isacharampersand}{\isamath{\&}}%
wenzelm@10226
   126
\renewcommand{\isacharprime}{\isamath{\mskip2mu{'}\mskip-2mu}}%
wenzelm@10226
   127
\renewcommand{\isacharparenleft}{\isamath{(}}%
wenzelm@10226
   128
\renewcommand{\isacharparenright}{\isamath{)}}%
wenzelm@10226
   129
\renewcommand{\isacharasterisk}{\isamath{*}}%
wenzelm@10226
   130
\renewcommand{\isacharplus}{\isamath{+}}%
wenzelm@10226
   131
\renewcommand{\isacharcomma}{\isamath{\mathord,}}%
wenzelm@10226
   132
\renewcommand{\isacharminus}{\isamath{-}}%
wenzelm@10226
   133
\renewcommand{\isachardot}{\isamath{\mathord.}}%
wenzelm@10226
   134
\renewcommand{\isacharslash}{\isamath{/}}%
wenzelm@10226
   135
\renewcommand{\isacharcolon}{\isamath{\mathord:}}%
wenzelm@10226
   136
\renewcommand{\isacharsemicolon}{\isamath{\mathord;}}%
wenzelm@10226
   137
\renewcommand{\isacharless}{\isamath{<}}%
wenzelm@10226
   138
\renewcommand{\isacharequal}{\isamath{=}}%
wenzelm@10226
   139
\renewcommand{\isachargreater}{\isamath{>}}%
wenzelm@10226
   140
\renewcommand{\isacharat}{\isamath{@}}%
wenzelm@10226
   141
\renewcommand{\isacharbrackleft}{\isamath{[}}%
wenzelm@10226
   142
\renewcommand{\isacharbrackright}{\isamath{]}}%
wenzelm@9812
   143
\renewcommand{\isacharunderscore}{\mbox{-}}%
wenzelm@10226
   144
\renewcommand{\isacharbraceleft}{\isamath{\{}}%
wenzelm@10226
   145
\renewcommand{\isacharbar}{\isamath{\mid}}%
wenzelm@10226
   146
\renewcommand{\isacharbraceright}{\isamath{\}}}%
wenzelm@10267
   147
\renewcommand{\isachartilde}{\isamath{{}\sp{\sim}}}%
wenzelm@9673
   148
}
wenzelm@9673
   149
nipkow@9992
   150
\newcommand{\isabellestylesl}{%
nipkow@9992
   151
\isabellestyleit%
nipkow@9992
   152
\renewcommand{\isastyle}{\small\sl}%
nipkow@9992
   153
\renewcommand{\isastyleminor}{\sl}%
wenzelm@10226
   154
\renewcommand{\isastylescript}{\footnotesize\sl}%
nipkow@9992
   155
}