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