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