1 % tutorial.sty : Isabelle Tutorial Page Layout
3 \typeout{Document Style tutorial. Released 9 July 2001}
5 \hyphenation{Isa-belle man-u-script man-u-scripts ap-pen-dix mut-u-al-ly}
6 \hyphenation{data-type data-types co-data-type co-data-types }
8 %usage: \iflabelundefined{LABEL}{if not defined}{if defined}
9 \newcommand{\iflabelundefined}[1]{\@ifundefined{r@#1}}
12 %%%INDEXING use isa-index to process the index
14 \newcommand\seealso[2]{\emph{see also} #1}
17 %index, putting page numbers of definitions in boldface
18 \def\bold#1{\textbf{#1}}
19 \newcommand\fnote[1]{#1n}
20 \newcommand\indexbold[1]{\index{#1|bold}}
22 % The alternative to \protect\isa in the indexing macros is
23 % \noexpand\noexpand \noexpand\isa
24 % need TWO levels of \noexpand to delay the expansion of \isa:
25 % the \noexpand\noexpand will leave one \noexpand, to be given to the
26 % (still unexpanded) \isa token. See TeX by Topic, page 122.
28 %%%% for indexing constants, symbols, theorems, ...
29 \newcommand\cdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (constant)}}
30 \newcommand\sdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (symbol)}}
32 \newcommand\tdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (theorem)}}
33 \newcommand\tdxbold[1]{\isa{#1}\index{#1@\protect\isa{#1} (theorem)|bold}}
35 \newcommand\cldx[1]{\isa{#1}\index{#1@\protect\isa{#1} (class)}}
36 \newcommand\tydx[1]{\textit{#1}\index{#1@{\textit{#1}} (type)}}
37 \newcommand\thydx[1]{\isa{#1}\index{#1@\protect\isa{#1} (theory)}}
39 \newcommand\attrdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (attribute)}}
40 \newcommand\commdx[1]{\isacommand{#1}\index{#1@\protect\isacommand{#1}
42 \newcommand\methdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (method)}}
43 \newcommand\tooldx[1]{\isa{#1}\index{#1@\protect\isa{#1} (tool)}}
44 \newcommand\settdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (setting)}}
46 %set argument in \bf font and index in ROMAN font (for definitions in text!)
47 \newcommand\bfindex[1]{{\bf#1}\index{#1|bold}\@}
49 \newcommand\rmindex[1]{{#1}\index{#1}\@}
50 \newcommand\ttindex[1]{\texttt{#1}\index{#1@\texttt{#1}}\@}
51 \newcommand\ttindexbold[1]{\texttt{#1}\index{#1@\texttt{#1}|bold}\@}
53 \newcommand{\indexboldpos}[2]{#1\index{#2@#1|bold}\@}
54 \newcommand{\ttindexboldpos}[2]{\texttt{#1}\index{#2@\texttt{#1}|bold}\@}
55 \newcommand{\isaindexbold}[1]{\isa{#1}\index{*#1|bold}\@}
56 \newcommand{\isaindex}[1]{\isa{#1}\index{*#1}\@}
58 %\newtheorem{theorem}{Theorem}[section]
59 \newtheorem{Exercise}{Exercise}[section]
60 \newenvironment{exercise}{\begin{Exercise}\rm}{\end{Exercise}}
61 \newcommand{\ttlbr}{\texttt{[|}}
62 \newcommand{\ttrbr}{\texttt{|]}}
63 \newcommand{\ttor}{\texttt{|}}
64 \newcommand{\ttall}{\texttt{!}}
65 \newcommand{\ttuniquex}{\texttt{?!}}
66 \newcommand{\ttEXU}{\texttt{EX!}}
67 \newcommand{\ttAnd}{\texttt{!!}}
69 \newcommand{\isasymimp}{\isasymlongrightarrow}
70 \newcommand{\isasymImp}{\isasymLongrightarrow}
71 \newcommand{\isasymFun}{\isasymRightarrow}
72 \newcommand{\isasymuniqex}{\isamath{\exists!\,}}
73 \renewcommand{\S}{Sect.\ts}
75 \renewenvironment{isamarkuptxt}{\begin{isamarkuptext}}{\end{isamarkuptext}}
78 \newcommand{\REMARK}[1]{\ifremarks\marginpar{\raggedright\footnotesize#1}\fi}
80 %names of Isabelle rules
81 \newcommand{\rulename}[1]{\hfill(#1)}
82 \newcommand{\rulenamedx}[1]{\hfill(#1\index{#1@\protect\isa{#1} (theorem)|bold})}
84 %%%% meta-logical connectives
87 \let\Imp=\Longrightarrow
89 \newcommand{\Var}[1]{{?\!#1}}
91 %%% underscores as ordinary characters, not for subscripting
92 %% use @ or \sb for subscripting; use \at for @
93 %% only works in \tt font
94 %% must not make _ an active char; would make \ttindex fail!
95 \gdef\underscoreoff{\catcode`\@=8\catcode`\_=\other}
96 \gdef\underscoreon{\catcode`\_=8\makeatother}
100 % alternative underscore
101 \def\_{\leavevmode\kern.06em\vbox{\hrule height.2ex width.3em}\hskip0.1em}
104 %%%% ``WARNING'' environment
105 \def\dbend{\vtop to 0pt{\vss\hbox{\Huge\bf!}\vss}}
106 \newenvironment{warn}{\medskip\medbreak\begingroup \clubpenalty=10000
107 \small %%WAS\baselineskip=0.9\baselineskip
108 \noindent \hangindent\parindent \hangafter=-2
109 \hbox to0pt{\hskip-\hangindent\dbend\hfill}\ignorespaces}%
110 {\par\endgroup\medbreak}
113 %%%% Standard logical symbols
118 \let\bimp=\leftrightarrow
119 \newcommand\all[1]{\forall#1.} %quantification
120 \newcommand\ex[1]{\exists#1.}
121 \newcommand{\pair}[1]{\langle#1\rangle}
123 \newcommand{\lparr}{\mathopen{(\!|}}
124 \newcommand{\rparr}{\mathclose{|\!)}}
125 \newcommand{\fs}{\mathpunct{,\,}}
126 \newcommand{\ty}{\mathrel{::}}
127 \newcommand{\asn}{\mathrel{:=}}
128 \newcommand{\more}{\ldots}
129 \newcommand{\record}[1]{\lparr #1 \rparr}
130 \newcommand{\dtt}{\mathord.}
132 \newcommand\lbrakk{\mathopen{[\![}}
133 \newcommand\rbrakk{\mathclose{]\!]}}
134 \newcommand\List[1]{\lbrakk#1\rbrakk} %was \obj
135 \newcommand\vpile[1]{\begin{array}{c}#1\end{array}}
136 \newenvironment{matharray}[1]{\[\begin{array}{#1}}{\end{array}\]}
137 \newcommand{\Text}[1]{\mbox{#1}}
139 \DeclareMathSymbol{\dshsym}{\mathalpha}{letters}{"2D}
140 \newcommand{\dsh}{\mathit{\dshsym}}
150 %macros to change the treatment of symbols
151 \def\relsemicolon{\mathcode`\;="303B} %treat ; like a relation
152 \def\binperiod{\mathcode`\.="213A} %treat . like a binary operator
153 \def\binvert{\mathcode`\|="226A} %treat | like a binary operator
155 %redefinition of \sloppy and \fussy to use \emergencystretch
156 \def\sloppy{\tolerance2000 \hfuzz.5pt \vfuzz.5pt \emergencystretch=15pt}
157 \def\fussy{\tolerance200 \hfuzz.1pt \vfuzz.1pt \emergencystretch=0pt}
159 %non-bf version of description
160 \def\descrlabel#1{\hspace\labelsep #1}
161 \def\descr{\list{}{\labelwidth\z@ \itemindent-\leftmargin\let\makelabel\descrlabel}}
162 \let\enddescr\endlist
164 % The mathcodes for the letters A, ..., Z, a, ..., z are changed to
165 % generate text italic rather than math italic by default. This makes
166 % multi-letter identifiers look better. The mathcode for character c
167 % is set to |"7000| (variable family) + |"400| (text italic) + |c|.
169 \DeclareSymbolFont{italics}{\encodingdefault}{\rmdefault}{m}{it}%
170 \def\@setmcodes#1#2#3{{\count0=#1 \count1=#3
171 \loop \global\mathcode\count0=\count1 \ifnum \count0<#2
172 \advance\count0 by1 \advance\count1 by1 \repeat}}
173 \@setmcodes{`A}{`Z}{"7\hexnumber@\symitalics41}
174 \@setmcodes{`a}{`z}{"7\hexnumber@\symitalics61}