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