hetcasl.sty revision 374a17994c7c43df4fe2fc6e266bee5601b8dd5f
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\ProvidesPackage{hetcasl}[2002/10/04 v0.1 LaTeX Package for CASL v1.0.1]
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\NeedsTeXFormat{LaTeX2e}
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher% Required packages
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\RequirePackage{ifthen}
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\RequirePackage{tabularx}
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\RequirePackage{calc}
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\RequirePackage[latin1]{inputenc}
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\RequirePackage{xspace}
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\RequirePackage{latexsym}
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\newcounter{@opentabulars}
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\setcounter{@opentabulars}{0}
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\newlength{\@oldparindent}
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\newlength{\@hetcaslmaxwidth}
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\newlength{\@remhetcaslwidth}
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\newlength{\@KWwidth}%
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher% The next two length variables will be used in \KW
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\newlength{\@realWidth}\newlength{\@neededWidth}
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\newlength{\@EqSpace}
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\newlength{\@ABSpace}
aa8a8318aaa3270e9d9957d0c22dec6342360a37Pavel Reichl\newlength{\@LeftABSpace}
5cd4414fce1e0eb4133dfc6fc828bf25c8a959f9Lukas Slebodnik\newlength{\@RightABSpace}
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\newif\ifhetcasl \hetcaslfalse
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\newenvironment{hetcasl}[1][\textwidth]%
1b171c456ff901ab622e44bcfd213f7de86fd787Ariel Barria\PackageError{hetcasl evironments cannot nested}%
1b171c456ff901ab622e44bcfd213f7de86fd787Ariel Barria\else\hetcasltrue\fi%
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\setlength{\@oldparindent}{\the\parindent}%
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\setlength{\parindent}{0cm}%
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\setlength{\@hetcaslmaxwidth}{#1}%
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\setlength{\@remhetcaslwidth}{\the\@hetcaslmaxwidth}%
83bf46f4066e3d5e838a32357c201de9bd6ecdfdNikolai Kondrashov%\begin{alltt}\begingroup\rmfamily
83bf46f4066e3d5e838a32357c201de9bd6ecdfdNikolai Kondrashov\begin{tabbing}%
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher% a little line to set up three useful tabstops for rendering parts
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher% of a library and or specification
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\KW{view} \=\KW{preds} \=~~~~~~~\=\kill
1b171c456ff901ab622e44bcfd213f7de86fd787Ariel Barria\end{tabbing}%
1b171c456ff901ab622e44bcfd213f7de86fd787Ariel Barria%\endgroup\end{alltt}
1b171c456ff901ab622e44bcfd213f7de86fd787Ariel Barria%\@CloseAllTabulars%
1b171c456ff901ab622e44bcfd213f7de86fd787Ariel Barria\setlength{\parindent}{\the\@oldparindent}%
1b171c456ff901ab622e44bcfd213f7de86fd787Ariel Barria\hetcaslfalse%
1b171c456ff901ab622e44bcfd213f7de86fd787Ariel Barria\newcommand{\@HetCASLPrelude}{% HetCASL-Prelude
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\settowidth{\@KWwidth}{\textbf{view}}
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher%%%% define all the makros needed for typesetting hetCASL
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher% \KW prints a KeyWord within a box that is at least \@KWwidth wide.
83bf46f4066e3d5e838a32357c201de9bd6ecdfdNikolai Kondrashov% If the keyword needs more space the box is as wide as the kyeword
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher% is. The optional argument overrides \@KWwidth with the width of the
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher% mandatory argument in bold face. The mandatory argument is always
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher% printed in bold face.
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\newcommand{\KW}[2][no--format--keyword]%
7e394400eefd0e7c5ba0c64ab3fa28bee21ef2d7Sumit Bose{\ifthenelse{\equal{##1}{no--format--keyword}}%
7e394400eefd0e7c5ba0c64ab3fa28bee21ef2d7Sumit Bose{% no optional argument
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\settowidth{\@neededWidth}{\textbf{##2}}}%
7e394400eefd0e7c5ba0c64ab3fa28bee21ef2d7Sumit Bose{% optional argument given
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\settowidth{\@realWidth}{\textbf{##2}}%
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\settowidth{\@KWwidth}{\textbf{##1}}%
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\ifthenelse{\@KWwidth > \@realWidth}%
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher{\setlength{\@neededWidth}{\@KWwidth}}%
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher{\setlength{\@neededWidth}{\@realWidth}}}%
83bf46f4066e3d5e838a32357c201de9bd6ecdfdNikolai Kondrashov\makebox[% set the width of the box not smaller
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher% than the width of the KeyWord
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\@neededWidth]%
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher[l]{\textbf{##2}}%
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher% print the first argument as is and use the second argument as label
83bf46f4066e3d5e838a32357c201de9bd6ecdfdNikolai Kondrashov\newcommand{\HetsLabel}[2]{##1}
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher% print label for ids
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\newcommand{\IdDeclLabel}[2]{##1} %% {##1\label{##2}}
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\newcommand{\IdApplLabel}[2]{##1} %% {##1\ref{##2}}
77b13371c87702aee3f858f6b2b73826cf5a01bdJakub Hrozek% \SId prints its argument in small caps as a Structured Id for names
77b13371c87702aee3f858f6b2b73826cf5a01bdJakub Hrozek% of specifications, views and libraries
77b13371c87702aee3f858f6b2b73826cf5a01bdJakub Hrozek\newcommand{\SId}[1]{\textsc{##1}}%
77b13371c87702aee3f858f6b2b73826cf5a01bdJakub Hrozek% \SIdIndex prints its argument like \SId but sets an Index Entry if
77b13371c87702aee3f858f6b2b73826cf5a01bdJakub Hrozek\newcommand{\SIdIndex}[1]{\SId{##1}}%
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher% \Id prints its argument in italic face as one word, for all other
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher% identifiers not covered by \SId and only containing letters, numbers
aa8a8318aaa3270e9d9957d0c22dec6342360a37Pavel Reichl\newcommand{\Id}[1]{\textit{##1}}%
aa8a8318aaa3270e9d9957d0c22dec6342360a37Pavel Reichl% \AX prints its argument in math modus
b34ffbf33729c557c3d1aebf4707ad0ffe4f1904Petr Čech\newcommand{\Ax}[1]{\ensuremath{##1}}%
aa8a8318aaa3270e9d9957d0c22dec6342360a37Pavel Reichl% \AltBar prints a | with the space of an = sign
aa8a8318aaa3270e9d9957d0c22dec6342360a37Pavel Reichl\settowidth{\@EqSpace}{\Ax{=}}
aa8a8318aaa3270e9d9957d0c22dec6342360a37Pavel Reichl\settowidth{\@ABSpace}{\Ax{|}}
aa8a8318aaa3270e9d9957d0c22dec6342360a37Pavel Reichl\setlength{\@LeftABSpace}{(\@EqSpace - \@ABSpace) *1/2}
aa8a8318aaa3270e9d9957d0c22dec6342360a37Pavel Reichl\setlength{\@RightABSpace}{\@EqSpace - \@ABSpace - \@LeftABSpace}
aa8a8318aaa3270e9d9957d0c22dec6342360a37Pavel Reichl\newcommand{\AltBar}{\hspace*{\@LeftABSpace}\Ax{|}\hspace*{\@RightABSpace}}
77b13371c87702aee3f858f6b2b73826cf5a01bdJakub Hrozek\newcommand{\ANNOTEWORD}[1]{{\small{}\KW{\%##1}}}
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher%%%%% Heng todo:
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher%% Makros aus casl.sty definieren
3441d0c2d11aea0c39b009751a1898333c009674Stephen Gallagher\newcommand{\LBRACE} {\{}