doc-src/IsarOverview/Isar/document/isabelle.sty
author kleing
Mon Jun 21 10:25:57 2004 +0200 (2004-06-21)
changeset 14981 e73f8140af78
parent 14617 a2bcb11ce445
child 15909 5f0c8a3f0226
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{\isactrlbold}[1]{{\bfseries\upshape\boldmath#1}}
    29 
    30 % somewhat hackish: spanning sub/super scripts (\<^bsub>..\<^esub>)
    31 \newcommand{\isactrlbsub}{%
    32 \def\isatext##1{\isastylescript##1}\begin{math}_\bgroup}
    33 \newcommand{\isactrlesub}{\egroup\end{math}}
    34 \newcommand{\isactrlbsup}{%
    35 \def\isatext##1{\isastylescript##1}\begin{math}^\bgroup}
    36 \newcommand{\isactrlesup}{\egroup\end{math}}
    37 
    38 \newdimen\isa@parindent\newdimen\isa@parskip
    39 
    40 \newenvironment{isabellebody}{%
    41 \isamarkuptrue\par%
    42 \isa@parindent\parindent\parindent0pt%
    43 \isa@parskip\parskip\parskip0pt%
    44 \isastyle}{\par}
    45 
    46 \newenvironment{isabelle}
    47 {\begin{trivlist}\begin{isabellebody}\item\relax}
    48 {\end{isabellebody}\end{trivlist}}
    49 
    50 \newcommand{\isa}[1]{\emph{\isastyleminor #1}}
    51 
    52 \newcommand{\isaindent}[1]{\hphantom{#1}}
    53 \newcommand{\isanewline}{\mbox{}\par\mbox{}}
    54 \newcommand{\isasep}{} % override with e.g. \renewcommand{\isasep}{\vspace{1ex}}
    55 \newcommand{\isadigit}[1]{#1}
    56 
    57 \chardef\isacharbang=`\!
    58 \chardef\isachardoublequote=`\"
    59 \chardef\isacharhash=`\#
    60 \chardef\isachardollar=`\$
    61 \chardef\isacharpercent=`\%
    62 \chardef\isacharampersand=`\&
    63 \chardef\isacharprime=`\'
    64 \chardef\isacharparenleft=`\(
    65 \chardef\isacharparenright=`\)
    66 \chardef\isacharasterisk=`\*
    67 \chardef\isacharplus=`\+
    68 \chardef\isacharcomma=`\,
    69 \chardef\isacharminus=`\-
    70 \chardef\isachardot=`\.
    71 \chardef\isacharslash=`\/
    72 \chardef\isacharcolon=`\:
    73 \chardef\isacharsemicolon=`\;
    74 \chardef\isacharless=`\<
    75 \chardef\isacharequal=`\=
    76 \chardef\isachargreater=`\>
    77 \chardef\isacharquery=`\?
    78 \chardef\isacharat=`\@
    79 \chardef\isacharbrackleft=`\[
    80 \chardef\isacharbackslash=`\\
    81 \chardef\isacharbrackright=`\]
    82 \chardef\isacharcircum=`\^
    83 \chardef\isacharunderscore=`\_
    84 \chardef\isacharbackquote=`\`
    85 \chardef\isacharbraceleft=`\{
    86 \chardef\isacharbar=`\|
    87 \chardef\isacharbraceright=`\}
    88 \chardef\isachartilde=`\~
    89 
    90 
    91 % keyword and section markup
    92 
    93 \newcommand{\isakeywordcharunderscore}{\_}
    94 \newcommand{\isakeyword}[1]
    95 {\emph{\bf\def\isachardot{.}\def\isacharunderscore{\isakeywordcharunderscore}%
    96 \def\isacharbraceleft{\{}\def\isacharbraceright{\}}#1}}
    97 \newcommand{\isacommand}[1]{\isakeyword{#1}}
    98 
    99 \newcommand{\isamarkupheader}[1]{\section{#1}}
   100 \newcommand{\isamarkupchapter}[1]{\chapter{#1}}
   101 \newcommand{\isamarkupsection}[1]{\section{#1}}
   102 \newcommand{\isamarkupsubsection}[1]{\subsection{#1}}
   103 \newcommand{\isamarkupsubsubsection}[1]{\subsubsection{#1}}
   104 \newcommand{\isamarkupsect}[1]{\section{#1}}
   105 \newcommand{\isamarkupsubsect}[1]{\subsection{#1}}
   106 \newcommand{\isamarkupsubsubsect}[1]{\subsubsection{#1}}
   107 
   108 \newif\ifisamarkup
   109 \newcommand{\isabeginpar}{\par\ifisamarkup\relax\else\medskip\fi}
   110 \newcommand{\isaendpar}{\par\medskip}
   111 \newenvironment{isapar}{\parindent\isa@parindent\parskip\isa@parskip\isabeginpar}{\isaendpar}
   112 \newenvironment{isamarkuptext}{\isastyletext\begin{isapar}}{\end{isapar}}
   113 \newenvironment{isamarkuptxt}{\isastyletxt\begin{isapar}}{\end{isapar}}
   114 \newcommand{\isamarkupcmt}[1]{{\isastylecmt--- #1}}
   115 
   116 
   117 % alternative styles
   118 
   119 \newcommand{\isabellestyle}{}
   120 \def\isabellestyle#1{\csname isabellestyle#1\endcsname}
   121 
   122 \newcommand{\isabellestylett}{%
   123 \renewcommand{\isastyle}{\small\tt}%
   124 \renewcommand{\isastyleminor}{\small\tt}%
   125 \renewcommand{\isastylescript}{\footnotesize\tt}%
   126 }
   127 \newcommand{\isabellestyleit}{%
   128 \renewcommand{\isastyle}{\small\it}%
   129 \renewcommand{\isastyleminor}{\it}%
   130 \renewcommand{\isastylescript}{\footnotesize\it}%
   131 \renewcommand{\isakeywordcharunderscore}{\mbox{-}}%
   132 \renewcommand{\isacharbang}{\isamath{!}}%
   133 \renewcommand{\isachardoublequote}{}%
   134 \renewcommand{\isacharhash}{\isamath{\#}}%
   135 \renewcommand{\isachardollar}{\isamath{\$}}%
   136 \renewcommand{\isacharpercent}{\isamath{\%}}%
   137 \renewcommand{\isacharampersand}{\isamath{\&}}%
   138 \renewcommand{\isacharprime}{\isamath{\mskip2mu{'}\mskip-2mu}}%
   139 \renewcommand{\isacharparenleft}{\isamath{(}}%
   140 \renewcommand{\isacharparenright}{\isamath{)}}%
   141 \renewcommand{\isacharasterisk}{\isamath{*}}%
   142 \renewcommand{\isacharplus}{\isamath{+}}%
   143 \renewcommand{\isacharcomma}{\isamath{\mathord,}}%
   144 \renewcommand{\isacharminus}{\isamath{-}}%
   145 \renewcommand{\isachardot}{\isamath{\mathord.}}%
   146 \renewcommand{\isacharslash}{\isamath{/}}%
   147 \renewcommand{\isacharcolon}{\isamath{\mathord:}}%
   148 \renewcommand{\isacharsemicolon}{\isamath{\mathord;}}%
   149 \renewcommand{\isacharless}{\isamath{<}}%
   150 \renewcommand{\isacharequal}{\isamath{=}}%
   151 \renewcommand{\isachargreater}{\isamath{>}}%
   152 \renewcommand{\isacharat}{\isamath{@}}%
   153 \renewcommand{\isacharbrackleft}{\isamath{[}}%
   154 \renewcommand{\isacharbrackright}{\isamath{]}}%
   155 \renewcommand{\isacharunderscore}{\mbox{-}}%
   156 \renewcommand{\isacharbraceleft}{\isamath{\{}}%
   157 \renewcommand{\isacharbar}{\isamath{\mid}}%
   158 \renewcommand{\isacharbraceright}{\isamath{\}}}%
   159 \renewcommand{\isachartilde}{\isamath{{}\sp{\sim}}}%
   160 }
   161 
   162 \newcommand{\isabellestylesl}{%
   163 \isabellestyleit%
   164 \renewcommand{\isastyle}{\small\sl}%
   165 \renewcommand{\isastyleminor}{\sl}%
   166 \renewcommand{\isastylescript}{\footnotesize\sl}%
   167 }