doc-src/TutorialI/isabelle.sty
author wenzelm
Sun, 15 Oct 2000 19:50:35 +0200
changeset 10220 2a726de6e124
parent 10211 1bece7f35762
child 10226 2c0ad01ddaf7
permissions -rw-r--r--
proper symbol markup with \isamath, \isatext; support sub/super scripts:

%%
%% $Id$
%% Author: Markus Wenzel, TU Muenchen
%% License: GPL (GNU GENERAL PUBLIC LICENSE)
%%
%% macros for Isabelle generated LaTeX output
%%

%%% Simple document preparation (based on theory token language and symbols)

% isabelle environments

\newcommand{\isabellecontext}{UNKNOWN}

\newcommand{\isastyle}{\small\tt\slshape}
\newcommand{\isastyleminor}{\small\tt\slshape}
\newcommand{\isastyletext}{\normalsize\rm}
\newcommand{\isastyletxt}{\rm}
\newcommand{\isastylecmt}{\rm}

\newdimen\isa@parindent\newdimen\isa@parskip

\newenvironment{isabellebody}{%
\isa@parindent\parindent\parindent0pt%
\isa@parskip\parskip\parskip0pt%
\isastyle}{}

\newenvironment{isabelle}
{\begin{isabellebody}\begin{trivlist}\item\relax}
{\end{trivlist}\end{isabellebody}}

\newcommand{\isa}[1]{\emph{\isastyleminor #1}}

\newcommand{\isanewline}{\mbox{}\\\mbox{}}
\newcommand{\isadigit}[1]{#1}

\chardef\isacharbang=`\!
\chardef\isachardoublequote=`\"
\chardef\isacharhash=`\#
\chardef\isachardollar=`\$
\chardef\isacharpercent=`\%
\chardef\isacharampersand=`\&
\chardef\isacharprime=`\'
\chardef\isacharparenleft=`\(
\chardef\isacharparenright=`\)
\chardef\isacharasterisk=`\*
\chardef\isacharplus=`\+
\chardef\isacharcomma=`\,
\chardef\isacharminus=`\-
\chardef\isachardot=`\.
\chardef\isacharslash=`\/
\chardef\isacharcolon=`\:
\chardef\isacharsemicolon=`\;
\chardef\isacharless=`\<
\chardef\isacharequal=`\=
\chardef\isachargreater=`\>
\chardef\isacharquery=`\?
\chardef\isacharat=`\@
\chardef\isacharbrackleft=`\[
\chardef\isacharbackslash=`\\
\chardef\isacharbrackright=`\]
\chardef\isacharcircum=`\^
\chardef\isacharunderscore=`\_
\chardef\isacharbackquote=`\`
\chardef\isacharbraceleft=`\{
\chardef\isacharbar=`\|
\chardef\isacharbraceright=`\}
\chardef\isachartilde=`\~


% keyword and section markup

\newcommand{\isakeywordcharunderscore}{\_}
\newcommand{\isakeyword}[1]
{\emph{\bf\def\isachardot{.}\def\isacharunderscore{\isakeywordcharunderscore}%
\def\isacharbraceleft{\{}\def\isacharbraceright{\}}#1}}
\newcommand{\isacommand}[1]{\isakeyword{#1}}

\newcommand{\isamarkupheader}[1]{\section{#1}}
\newcommand{\isamarkupchapter}[1]{\chapter{#1}}
\newcommand{\isamarkupsection}[1]{\section{#1}}
\newcommand{\isamarkupsubsection}[1]{\subsection{#1}}
\newcommand{\isamarkupsubsubsection}[1]{\subsubsection{#1}}
\newcommand{\isamarkupsect}[1]{\section{#1}}
\newcommand{\isamarkupsubsect}[1]{\subsection{#1}}
\newcommand{\isamarkupsubsubsect}[1]{\subsubsection{#1}}

\newenvironment{isapar}{\parindent\isa@parindent\parskip\isa@parskip\par\medskip}{\par\medskip}
\newenvironment{isamarkuptext}{\isastyletext\begin{isapar}}{\end{isapar}}
\newenvironment{isamarkuptxt}{\isastyletxt\begin{isapar}}{\end{isapar}}
\newcommand{\isamarkupcmt}[1]{{\isastylecmt--- #1}}


% alternative styles

\newcommand{\isabellestyle}{}
\def\isabellestyle#1{\csname isabellestyle#1\endcsname}

\newcommand{\isabellestylett}{%
\renewcommand{\isastyle}{\small\tt}%
\renewcommand{\isastyleminor}{\small\tt}%
}
\newcommand{\isabellestyleit}{%
\renewcommand{\isastyle}{\small\it}%
\renewcommand{\isastyleminor}{\it}%
\renewcommand{\isakeywordcharunderscore}{\mbox{-}}%
\renewcommand{\isacharbang}{\emph{$!$}}%
\renewcommand{\isachardoublequote}{}%
\renewcommand{\isacharhash}{\emph{$\#$}}%
\renewcommand{\isachardollar}{\emph{$\$$}}%
\renewcommand{\isacharpercent}{\emph{$\%$}}%
\renewcommand{\isacharampersand}{\emph{$\&$}}%
\renewcommand{\isacharprime}{$\mskip2mu{'}\mskip-2mu$}%
\renewcommand{\isacharparenleft}{\emph{$($}}%
\renewcommand{\isacharparenright}{\emph{$)$}}%
\renewcommand{\isacharasterisk}{\emph{$*$}}%
\renewcommand{\isacharplus}{\emph{$+$}}%
\renewcommand{\isacharcomma}{\emph{$\mathord,$}}%
\renewcommand{\isacharminus}{\emph{$-$}}%
\renewcommand{\isachardot}{\emph{$\mathord.$}}%
\renewcommand{\isacharslash}{\emph{$/$}}%
\renewcommand{\isacharcolon}{\emph{$\mathord:$}}%
\renewcommand{\isacharsemicolon}{\emph{$\mathord;$}}%
\renewcommand{\isacharless}{\emph{$<$}}%
\renewcommand{\isacharequal}{\emph{$=$}}%
\renewcommand{\isachargreater}{\emph{$>$}}%
\renewcommand{\isacharat}{\emph{$@$}}%
\renewcommand{\isacharbrackleft}{\emph{$[$}}%
\renewcommand{\isacharbrackright}{\emph{$]$}}%
\renewcommand{\isacharunderscore}{\mbox{-}}%
\renewcommand{\isacharbraceleft}{\emph{$\{$}}%
\renewcommand{\isacharbar}{\emph{$\mid$}}%
\renewcommand{\isacharbraceright}{\emph{$\}$}}%
\renewcommand{\isachartilde}{\emph{${}^\sim$}}%
}

\newcommand{\isabellestylesl}{%
\isabellestyleit%
\renewcommand{\isastyle}{\small\sl}%
\renewcommand{\isastyleminor}{\sl}%
}