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