%%% csug8.hcls
%%% Based on tspl4.hcls
%%% Copyright (c) 1998 R, Kent Dybvig
%%%
%%% Permission is hereby granted, free of charge, to any person obtaining a
%%% copy of this software and associated documentation files (the "Software"),
%%% to deal in the Software without restriction, including without limitation
%%% the rights to use, copy, modify, merge, publish, distribute, sublicense,
%%% and/or sell copies of the Software, and to permit persons to whom the
%%% Software is furnished to do so, subject to the following conditions:
%%%
%%% The above copyright notice and this permission notice shall be included in
%%% all copies or substantial portions of the Software.
%%%
%%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
%%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
%%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
%%% THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
%%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
%%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
%%% DEALINGS IN THE SOFTWARE.
\newif\iflatex\latexfalse
\newif\ifhtml\htmltrue
\newif\ifdraft\draftfalse % define to prevent confusion in tspl.stex
%%% \frontmatter, \mainmatter, \backmatter
\newif\ifmainmatter \mainmattertrue
\newcommand{\frontmatter}{\mainmatterfalse}
\newcommand{\mainmatter}{\setcounter{chapter}{0}\mainmattertrue}
\newcommand{\backmatter}{\mainmatterfalse}
\newif\ifchapterpictures\chapterpicturestrue
% we \let\label=\nolable within toc entries to avoid inserting
% labels that belong with the labeled entity, not the toc
\def\nolabel#1{}
%%% \chapter
\newcounter{chapter}
\def\chpic#1#2{\raw{}\\\emph{#2}}
\newcommand{\chapter}[1]{
\endchapter
\begingroup\renewcommand{\label}[1]{}\openhtmlfile{#1}\endgroup
\ifmainmatter
\refstepcounter{chapter}
\edef\templabel{\genlab}\label{\templabel}
\ifchapterpictures
\input{hebert/new/ch\thechapter}
\fi
\raw{
}Chapter \thechapter. #1\raw{
}
\begin{divertoutput}[0]
\raw{}\textbf{\hpageref[toc]{\templabel}{Chapter \thechapter. {\let\label=\nolabel #1}}}
\raw{}
\end{divertoutput}
\renewcommand{\endchapter}{\begin{divertoutput}[0]
\raw{
}
\end{divertoutput}
\copyrightnotice
\closehtmlfile\renewcommand{\endchapter}{}}
\else
\edef\templabel{\genlab}\label{\templabel}
\raw{
}#1\raw{
}
\begin{divertoutput}[0]
\raw{}\textbf{\hpageref[toc]{\templabel}{{\let\label=\nolabel #1}}}\raw{}
\end{divertoutput}
\renewcommand{\endchapter}{\copyrightnotice
\closehtmlfile\renewcommand{\endchapter}{}}
\fi
}
\newcommand{\endchapter}{}
\newcommand{\copyrightnotice}{}
%%% \section
\newcounter{section}[chapter]
\renewcommand{\thesection}{\thechapter.\arabic{section}}
\newcommand{\section}[1]{
\raw{
}\refstepcounter{section}\edef\templabel{\genlab}%
\label{\templabel}Section \thesection. #1\raw{
}
\begin{divertoutput}[0]
\raw{}\textbf{\hpageref[toc]{\templabel}{Section \thesection. {\let\label=\nolabel #1}}}
\end{divertoutput}
}
%%% \subsection
\newcounter{subsection}[section]
\renewcommand{\thesubsection}{\thesection.\arabic{subsection}}
\newcommand{\subsection}[1]{
\raw{}Subsection \refstepcounter{subsection}\thesubsection. #1\raw{
}
}
%%% \exercise
\newcounter{exercise}[section]
\renewcommand{\theexercise}{\thesection.\arabic{exercise}}
\newcommand{\exercise}{
\raw{}Exercise \refstepcounter{exercise}\theexercise\raw{
}
}
%%% alphalist
\newcounter{alphalist}
\def\alphalist{\begingroup\setcounter{alphalist}{0}
\def\endalphalistitem{}%
\renewcommand{\item}{\endalphalistitem
\def\endalphalistiem{\raw{}}%
\stepcounter{alphalist}%
\raw{}\textit{~~\alph{alphalist}}.\raw{ | }}
\raw{}}
\def\endalphalist{\endalphalistitem\raw{ }\endgroup}
%%% define our own (compact) description environment
\def\description{\begingroup
\renewcommand{\item}[1][]{\raw{}##1\raw{}}\raw{}}
\def\enddescription{\raw{ }\endgroup}
%%% table of contents
% do \endchapter as a favor to \chapter
\newenvironment{contents}
{\raw{}Table of Contents\raw{}\raw{}}
%%% summary of forms
\def\sfentry#1#2#3{\raw{}#1\raw{ | }%
\raw{}#2\raw{ | }%
\raw{}#3\raw{ | }}%
\newenvironment{thesummary}
{\raw{}%
\raw{Form | Category | }%
\raw{Page |
---|
| }}
{\raw{ }}
%%% index
\newcommand{\see}[2]{\emph{see} #1}
\newenvironment{theindex}
{\begingroup\newcommand{\itemindent}{\raw{ }}
\def\indexbreak{\def\indexbreak{\raw{ }}}
\renewcommand{\item}{\indexbreak}
\newcommand{\subitem}{\raw{ }\itemindent}
\newcommand{\subsubitem}{\raw{ }\itemindent\itemindent}}
{\par\endgroup}
%%% answers
\def\answer#1#2{}
\def\ansentry#1#2{\par\bigskip\noindent\textbf{Exercise~\ref{#2}.~}(page~\pageref{#2})\\ #1}
\def\theanswers{\begingroup
\ifhtml\begingroup\def\hardspaces{}\fi
\input{\jobname.ans}
\ifhtml\endgroup\fi
\endgroup}
%%%% TSPL/CSSM specific
\def\longcode{}
\def\noskip{}
\def\copyright{©}
\def\itemvdots{\vdots}
\def\parheader#1 {\medskip\noindent{\bf #1.}~~}
%%% grammar support
\newenvironment{grammar}
{\begingroup
\def\orbar{\raw{ | | | }}
\def\longis{\raw{ | }$\longrightarrow$\raw{ | }}
\def\\{\raw{ |
}}
\raw{}\endgroup}
\def\bar{\raw{|}}
\def\kplus{\raw{+}}
\def\kstar{\raw{*}}
\def\ang#1{\raw{<}#1\raw{>}}
\def\entryheader{\noskipentryheader}
\def\noskipentryheader{\def\entrybreak{\def\entrybreak{\raw{ }}}}
\def\endentryheader{\endnoskipentryheader}
\def\endnoskipentryheader{\par}
\def\formdef#1#2{\entrybreak\raw{}{\bf #1}: #2\raw{}}
\def\formsummary#1#2#3#4{}
\def\returns{\\\textbf{returns: }}
\def\libraries{\\\textbf{libraries: }}
\def\categorysyntax{syntax}
\def\categoryprocedure{procedure}
\def\categorythreadparameter{thread parameter}
\def\categoryglobalparameter{global parameter}
\def\categorymodule{module}
\def\categoryftype{ftype}
%%% hyperlink support
\newcommand{\hyperlink}[3][]{\raw{}#3\raw{}}
|