%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This is typebook.sty, a LaTeX2e style file to modify the book class
% for typesetting documentation transformed from DocBook XML by the
% docbook-latex XSLT stylesheet. It is used specifically for doing
% computing documentation about typographic systems like LaTeX.
%
% GNU Copyleft 1998-2005 Silmaril Consultants
%
% Peter Flynn <[email protected]>
%
% You modify use and distribute this file in any way you wish except
% by charging for it or claiming that you wrote it. This header and
% identity must be preserved on all copies and derivatives.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% FONTS
%
% Supply default names for the fonts because my own font definitions
% store their own names in these macros, and if you're processing
% this yourself (ie without my fonts) I still want the references to
% font names in the session on fonts to work. These are defaults.
%
\newcommand{\rmfontfamilyname}{Computer Modern Roman}
\newcommand{\sffontfamilyname}{Computer Modern Sans-Serif}
\newcommand{\ttfontfamilyname}{Computer Modern Typewriter}
%
% I invoke pslatex before my private fonts so I get the benefit of the
% narrowed Courier, which is useful. If anyone knows the location of a
% free Prestige Elite (Type 1) font, which was a freebie give-away on
% some DTP CD-ROM in the late 1990s, of which I have lost my copy, I
% would be very grateful to know.
%
% ald721 and hum521 are Bitstream's Aldine (Bembo) and Humanist (Gill)
%\usepackage{pslatex,ald721,hum521}
% carmina and inc901 are also Bitstream for Carmina and Antique Olive
%\usepackage{pslatex,carmina,inc901}
% The pslatex default is narrowed Courier, so say so:
\renewcommand{\ttfontfamilyname}{Courier Narrow}
% These redefinitions seem to be needed (is ly1enc.def faulty?)
% Comment them out if you're not using LY1 (my Bitstream fonts need them)
%\renewcommand{\ae}{\char'032}
%\renewcommand{\AE}{\char'035}
%\renewcommand{\o}{\char'034}
%\renewcommand{\O}{\char'037}
% As you won't have any of them, comment out those lines and UNcomment
% the following FOUR lines to get Times and Helvetica (\snore):
%\renewcommand{\rmfontfamilyname}{Times}
%\renewcommand{\sffontfamilyname}{Helvetica}
%\renewcommand{\ttfontfamilyname}{Courier}
%\usepackage{pslatex}
% Alternatively you could UNcomment these four lines instead:
\renewcommand{\rmfontfamilyname}{Palatino}
\renewcommand{\sffontfamilyname}{Avant Garde}
\renewcommand{\ttfontfamilyname}{Courier}
\usepackage{pslatex,palatino,avant}
%
% And yes, I do know that pslatex is obsolete and deprecated, and when
% someone gets around to updating it to do things the way they say
% they ought to be, I'll get around to updating this style file.
%
% Anyway, in this case (for TUGboat), I fiddled with the .fd file for
% Avant Garde and decreased the size to 90% because it's a font with
% a very large x-height and it needs to be smaller to sort with
% Palatino. Ditto with the special narrow Courier in pslatex.sty: I
% grew that to 110% because it was too short. Hence there are copies
% of ot1ppl.fd and pslatex.sty in the source directory which should
% override the ones in a normal LaTeX distribution.
%
% Sample line for the font sampler to make it easier to type
%
\newcommand{\alphabet}[2][OT1]{%
       \fontencoding{#1}\fontfamily{#2}\selectfont
       The quick brown fox jumps over the lazy dog}
\newcommand{\shortalphabet}[2][OT1]{%
       \fontencoding{#1}\fontfamily{#2}\selectfont
       The quick brown fox jumps over the}
\newcommand{\dalphabet}[2][OT1]{% German
       \fontencoding{#1}\fontfamily{#2}\selectfont
       Fuch\char'215, Du hast die Gan\char'215\ gestohlen, gib sie wieder her!}
%
% Allow access to ``Light'' variant of the font if available
%
\newcommand{\lite}{\fontseries{l}\selectfont}
%
% Shorthand macros for Metafont, fpTeX, and teTeX, which add
% themselves to the index
%
\newcommand{\mf}{%
       {\fontencoding{U}\fontfamily{zmf}\selectfont METAFONT}%
       \index{metafont@{\fontencoding{U}\fontfamily{zmf}%
               \selectfont METAFONT}}}
\newcommand{\fp}{fp\kern-1pt\TeX\index{fptex@fp\kern-1pt\TeX}}
\newcommand{\te}{te\kern-1pt\TeX\index{tetex@te\kern-1pt\TeX}}
\def\LyX{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\spacefactor1000}%
%
% We work in ISO 8859-1 here
%
\usepackage[latin1]{inputenc}
%
% Define the Euro more carefully than TS1 does
%
\newcommand{\euro}{{\fontencoding{TS1}\fontfamily{cmr}\selectfont\texteuro}}
%
% Smaller paragraph indentation
\setlength{\parindent}{1em}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% PACKAGES
%
% You MUST have these installed for this stuff to work. You can get
% all of them from CTAN like I did.
%
% The page geometry is designed for A4. If you need to print on
% Letter, you'll need to fiddle, because the font sampler page won't
% fit very easily.
%
\usepackage{pstricks,pst-char,pst-grad,mdwlist,soul,ragged2e}
\usepackage{graphicx,url,fancybox,fancyvrb,fancyhdr,array,paralist}
% was 396bp wide, 696bp high. This now makes the text area the same
% as the TUGboat version, for pageno compatibility
\usepackage[a4paper,left=1in,textwidth=32pc,headsep=30pt,twosideshift=0pt,
 textheight=56.5pc,headheight=15bp]{geometry}
%\usepackage[left=1in,textwidth=14cm,marginpar=3cm,marginparsep=6mm,
%            textheight=22.5cm,headheight=15pt]{geometry}%tugboat!
\widowpenalty=10000
\clubpenalty=10000
\parfillskip = .75\hsize plus .06\hsize minus .75\hsize
\renewcommand{\topfraction}{.9}
\renewcommand{\bottomfraction}{.5}
\renewcommand{\floatpagefraction}{.8}
\renewcommand{\textfraction}{.1}
\setcounter{bottomnumber}{2}
\setcounter{totalnumber}{4}
\spaceskip=3pt plus4.5pt minus1.5pt
\usepackage{multicol,color,bbding,marvosym,textcomp,type1cm,makeidx}
\usepackage[normalem]{ulem}
%
% Bibliography macros to customise jurabib
%
\usepackage[bibformat=numbered]{jurabib}
\newcommand{\titleof}[1]{\emph{\citefield{title}{#1}}}
\newcommand{\authorof}[1]{\citefield{juraauthor}{#1}}
\newcommand{\dateof}[1]{\citefield{year}{#1}}
\newcommand{\citeauthoryear}[1]{\authorof{#1} \dateof{#1}}
\newcommand{\citeauthortitleyear}[1]{\authorof{#1}, \titleof{#1} \dateof{#1}}
\newcommand{\titlecite}[1]{\titleof{#1}\footnote{\citeauthoryear{#1}}}
%
\DeclareRobustCommand{\LaTeX}{L\kern-.42em%
       {\sbox\z@ T%
        \vbox to1.05\ht\z@{\hbox{\check@mathfonts
                             \fontsize\sf@size\z@
                             \math@fontsfalse\selectfont
                             A}%
                       \vss}%
       }%
       \kern-.2em%
       \TeX}
\DeclareRobustCommand{\sfLaTeX}{L\kern-.24em%
       {\sbox\z@ T%
        \vbox to1.05\ht\z@{\hbox{\check@mathfonts
                             \fontsize\sf@size\z@
                             \math@fontsfalse\selectfont
                             A}%
                       \vss}%
       }%
       \kern-.15em%
       \TeX}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% COLOUR
%
% Pretty colours for the title page and examples.
% Can't use {named} model because pdflatex can't use it (yet?).
%
\definecolor{midblue}{rgb}{0.145,0.490,0.882}
\definecolor{myred}{cmyk}{0,1,0.13,0}
\definecolor{grey}{gray}{0.7}
\definecolor{litegrey}{gray}{0.75}
\definecolor{olivegreen}{cmyk}{0.95,0,0.95,0.75}%was {0.64,0,0.95,0.40}
\definecolor{greenyellow}{cmyk}{0.15,0,0.69,0}
\definecolor{pinegreen}{cmyk}{0.92,0,0.59,0.25}
\definecolor{bluegreen}{cmyk}{0.85,0,0.33,0}
\definecolor{lavender}{cmyk}{0,0.48,0,0}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% INDEXING
%
\makeindex
%
% Shorthands to allow auto-indexing of keywords
%
\newcommand{\Linux}{Linux\index{Linux}}
\newcommand{\CTAN}{CTAN\index{CTAN}}
\newcommand{\product}[2][\relax]{%
       \mbox{\textit{#2}}%
       \if#1\relax\index{#2@\string\textit{#2}}\else
               \index{#1@\string\textit{#2}}\fi
       \if#1\relax\index{Products@\string\textbf{Products}!#2@\string\textit{#2}}\else
               \index{Products@\string\textbf{Products}!#1@\string\textit{#2}}\fi}
\newcommand{\package}[1]{%
       \mbox{\textsf{#1}}%
       \index{#1@\string\textsf{#1}}%
       \index{Packages@\string\textbf{Packages}!#1@\string\textsf{#1}}}
\newcommand{\env}[1]{%
       \mbox{\textsf{\bfseries#1}}%
       \index{#1@\string\textsf{\lite #1}}%
       \index{Environments@\string\textbf{Environments}!#1@\string\textsf{\bfseries #1}}}
\def\getfirst#1#2\sentinel{\def\firsttok{#1}}
\newcommand{\opt}[1]{\def\firsttok{\relax}%
       \mbox{\textsf{\itshape\lite#1}}%
       \getfirst#1\sentinel
       \ifthenelse{\equal{\firsttok}{1}}
       {\index{1@\string\textsf{\string\itshape\lite #1}}%
       \index{Options@\string\textbf{Options}!1@\string\textsf{\string\itshape\lite #1}}}
       {\index{#1@\string\textsf{\string\itshape\lite #1}}%
       \index{Options@\string\textbf{Options}!#1@\string\textsf{\string\itshape\lite #1}}}}
\newcommand{\counter}[1]{%
       \mbox{\texttt{\itshape #1}}%
       \index{#1@\string\texttt{\itshape #1}}%
       \index{Counters@\string\textbf{Counters}!#1@\string\texttt{\itshape #1}}}
\newcommand{\length}[1]{%
       \mbox{\texttt{\char'134 #1}}%
       \index{#1@\string\texttt{\char'134 #1}}%
       \index{Lengths@\string\textbf{Lengths (Dimensions)}!#1@\string\texttt{\char'134 #1}}}
\newcommand{\command}[1]{%
       \mbox{\texttt{\bfseries\char'134 #1}}%
       \index{#1@\string\texttt{\bfseries\char'134 #1}}%
       \index{Commands@\string\textbf{Commands}!#1@\string\texttt{\bfseries\char'134 #1}}}
\newcommand{\indexcommand}[1]{% like \command but silent (no output)
       \index{#1@\string\texttt{\bfseries\char'134 #1}}%
       \index{Control@\string\textbf{Control sequences}!#1@\string\texttt{\bfseries\char'134 #1}}}
\newcommand{\keyword}[1]{%
       \mbox{\textbf{#1}}%
       \index{#1|textbf}}
% Person-indexing is documented in the text. Read it!
\def\reindex #1 #2\sentinel{\index{#2, #1}}
\newcommand{\person}[1]{#1\reindex #1\sentinel}
\newcommand{\nameindex}[1]{#1\splitname #1\sentinel}
\def\splitname #1 #2\sentinel{\index{#2, #1}}
%
% Some hyphenation oddities :-)  US hyphenation-by-syllable really sucks.
%
\hyphenation{mark-up pro-fes-sio-nal Micro-soft Win-dows Linux
docu-ment docu-ments tabu-lar cross-referencing helico-pter
Post-Script si-mi-lar ad-ministra-tive Ameri-can dri-ver tech-ni-cal
style-sheets chan-ges analy-sis ge-ne-ric found-ries}
%
% Protected BackSlash needed to allow raggedright etc in tables
%
\newcommand{\pbs}[1]{\let\tmp\\#1\let\\\tmp}
%
% Number sections down to subsubsection level,
% but show down only as far as subsections in the Table of Contents
%
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{2}
\newcounter{hold} % for tracking continued procedure steps
\def\gfdl{\renewcommand{\thesubsection}{\thechapter.\arabic{subsection}}\let\section\subsection\setcounter{subsection}{-1}\multicolsep=1.5pc}
%
% Adjust paragraph spacing, but only for use after the ToC
%
\newcommand{\textparsettings}{%
       \setlength{\parskip}{1em plus3pt minus3pt}%
       \setlength{\parindent}{0pt}%
}
%
% Reduce space above and below lists
%
\setlength{\partopsep}{0pt}
%
% Now the hairy stuff, redefining LaTeX internals
%
% Redefine the layout for new chapter pages
%
\@openrighttrue
%\renewcommand{\chaptername}{Session}%sessions no longer
% First, make sure we get genuinely empty pages when the chapter
% starts after a right-hand chapter-finish.
\def\cleardoublepage{\clearpage
                       \if@twoside
                               \ifodd
                                       \c@page
                               \else
                                       \hbox{}\thispagestyle{empty}\newpage
                                       \if@twocolumn
                                               \hbox{}\newpage
                                       \fi
                               \fi
                       \fi}
% Save blank pages in TUGboat
\renewcommand\chapter{\clearpage
       \thispagestyle{plain}%
       \global\@topnum\z@
       \@afterindentfalse
       \secdef\@chapter\@schapter}
% Make sure \chapter causes a plain page
%\renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
%       \thispagestyle{plain}%
%       \global\@topnum\z@
%       \@afterindentfalse
%       \secdef\@chapter\@schapter}
% Redesign the opening of a chapter
%\gdef\thechapter{\Roman{chapter}}
\def\@makechapterhead#1{%
       \vspace*{1cm}%
       {\parindent \z@ \RaggedRight \normalfont
               \ifnum \c@secnumdepth >\m@ne
                       \Large{\scshape \@chapapp
                               \ifthenelse{\equal{\@chapapp}{\chaptername}}%
                                       {\space \Roman{chapter}}%
                                       {\space \thechapter}}%
                       \par\nobreak
                       \vspace*{.5in}
               \fi
               \interlinepenalty\@M
               \sffamily\Huge #1\par\nobreak
               \vspace*{36pt}}}
%
% Fix appendix switch
%
\renewcommand\appendix{\par
 \setcounter{chapter}{0}%
 \setcounter{section}{0}%
 \gdef\@chapapp{\appendixname}%
 \gdef\thechapter{\@Alph\c@chapter}}
%
% Make a new format for the title page
%
\renewcommand{\maketitle}{\begingroup
       \thispagestyle{empty}%
       \setlength{\parindent}{0pt}%
       \begin{minipage}{32pc}
         \begin{flushright}
           {\fontsize{42}{42}\selectfont\bfseries\@newtitle}
           \par\vspace*{1cm}
           {\LARGE\bfseries
            \hbox{\textcolor{blue}{\@subtitle}}\par}
           \par\vspace*{1in}
           {\sffamily\LARGE\textbf{\@author}\par}
         \end{flushright}
       \end{minipage}
       \vfill
       \normalsize{\sffamily\textit{\@date}}
       \par\endgroup}
%
% Extra macros to make the title page work
%
\def\@subtitle{\relax}
\newcommand{\subtitle}[1]{\gdef\@subtitle{#1}}
\def\@newtitle{%
       \pscharpath[linestyle=none,fillstyle=gradient,gradbegin=yellow,
       gradend=green,gradmidpoint=1]{%
               \begin{tabular}{@{}r@{}l@{}l@{}}
                       &format\\&format\\&format&\thinspace\phantom{ting}
               \end{tabular}\par}\\
               \begin{tabular}{@{}r@{}l@{\hspace*{1.33pt}}l@{}}%
                 \color{litegrey}\fontsize{36}{36}\selectfont
                 \lite\texttt{\char'134 title\char'173}&%
                 \color{olivegreen}format&%
                 \color{olivegreen}ting
                 \\
                 \color{olivegreen}in&%
                 \color{olivegreen}format&%
                 \color{olivegreen}ion%
                 \color{litegrey}\fontsize{36}{36}\selectfont
                 \lite\texttt{\char'175}
               \end{tabular}\\
       \pscharpath[linestyle=none,fillstyle=gradient,gradbegin=magenta,
       gradend=cyan,gradmidpoint=0]{%
               \begin{tabular}{@{}r@{}l@{}l@{}}
                       &format\\&format\\&format&\thinspace\phantom{ting}
               \end{tabular}}}
\def\@oldtitle{%
       \pscharpath[linestyle=none,fillstyle=gradient,gradbegin=white,
       gradend=black,gradmidpoint=.5]{\begin{tabular}{@{}r@{}l@{}}
               &format\\&format\\&format\\
               &\color{blue}format\rlap{ting}\\
               \color{blue}in&\color{blue}format\rlap{ion}\\
               &format\\&format\\&format\end{tabular}}}
%
% Make section/subsection/subsubsection use sans-serif type
% and less space before and after the heading line
%
\renewcommand\section{\@startsection{section}{1}{\z@}%
                       {-3ex \@plus -1.5ex \@minus -1ex}%
                       {2ex \@plus.2ex}%
                       {\normalfont\Large\bfseries\sffamily\RaggedRight}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
                       {-2ex\@plus -1ex \@minus -.5ex}%
                       {1.5ex \@plus .2ex}%
                       {\normalfont\large\bfseries\sffamily\RaggedRight}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
                       {-1.5ex\@plus -1ex \@minus -.5ex}%
                       {1ex \@plus .2ex}%
                       {\normalfont\normalsize\bfseries\sffamily\RaggedRight}}
%
% Define some running heads
%
\pagestyle{fancy}
\fancyhead{}
\renewcommand{\headrulewidth}{.1pt}
\fancyhead[LO,RE]{\footnotesize\sffamily\lite\leftmark}
\fancyhead[LE,RO]{\footnotesize\sffamily\lite\itshape\rightmark}
\fancyfoot[C]{}
\fancyfoot[LE,RO]{\setlength{\fboxsep}{2pt}\ovalbox{\footnotesize\sffamily\thepage}}
\fancyfoot[LO,RE]{\footnotesize\sffamily\lite\@title}
\fancypagestyle{plain}{%
\fancyhf{}
\fancyfoot[R]{\setlength{\fboxsep}{2pt}\ovalbox{\footnotesize\sffamily\thepage}}
\fancyfoot[L]{\footnotesize\sffamily\lite\@title}
\renewcommand{\headrulewidth}{0pt}}
%
% Give access to marginal notes (geometry controls the margins)
%
\newcommand{\marginal}[1]{\marginpar{\tiny\raggedright#1}}
%
% Make a `keycap' icon
%
\newlength{\keywidth}
\newlength{\keyheight}
\newlength{\keydepth}
\newcommand{\key}[1]{\begingroup\small
       \setlength{\fboxsep}{1pt}%
       \settowidth{\keywidth}{\sffamily#1}%
       \ifdim\keywidth<1em\setlength{\keywidth}{1em}\fi
       \settoheight{\keyheight}{Xfl)}%
       \settodepth{\keydepth}{)yj}%
       \ovalbox{\hbox to\keywidth{\hss\sffamily#1\hss
               \vrule height\keyheight depth\keydepth width0pt}}%
       \endgroup}%
% Also make a typewriter-font version
\newcommand{\ttkey}[1]{\begingroup\small
       \setlength{\fboxsep}{1pt}%
       \settowidth{\keywidth}{\ttfamily#1}%
       \ifdim\keywidth<1em\setlength{\keywidth}{1em}\fi
       \settoheight{\keyheight}{Xfl)}%
       \settodepth{\keydepth}{)yj}%
       \ovalbox{\hbox to\keywidth{\hss\ttfamily#1\hss
               \vrule height\keyheight depth\keydepth width0pt}}%
       \endgroup}%
% And a button-bar icon version
\newcommand{\icon}[1]{\begingroup\small
       \setlength{\fboxsep}{1pt}%
       \settowidth{\keywidth}{\sffamily#1}%
       \ifdim\keywidth<1em\setlength{\keywidth}{1em}\fi
       \settoheight{\keyheight}{Xfl)}%
       \settodepth{\keydepth}{)yj}%
       \fbox{\hbox to\keywidth{\hss\sffamily#1\hss
               \vrule height\keyheight depth\keydepth width0pt}}%
       \endgroup}%
% And some utilities to allow description of menu options
\newcommand{\with}{--}
\newcommand{\fby}{~~}
%
% Make slanted fractions for use outside math mode
%
\newcommand{\Frac}[2]{%
       \raisebox{.5ex}{\scriptsize#1}\kern-.1em/%
       \kern-.1em\raisebox{-.333ex}{\scriptsize#2}\thinspace}
%
% Redefine some front matter appearances
%
\renewenvironment{abstract}{%
     \clearpage
     \section*{\abstractname}%
     \@mkboth{\MakeUppercase\@title}{\MakeUppercase\abstractname}}%
    {\par\vfil\null}
%
\renewcommand\tableofcontents{\clearpage
   \section*{\contentsname}%
   \@mkboth{\MakeUppercase\@title}{\MakeUppercase\contentsname}%
   \thispagestyle{plain}\begingroup
   \fontsize{9}{11.5}\selectfont\@starttoc{toc}\par\endgroup}
% appendix numbers were getting too close to the text
\renewcommand*\l@section{\@dottedtocline{1}{2em}{2.5em}}
\renewcommand*\l@subsection{\@dottedtocline{2}{4em}{3.5em}}
% New list of exercises
\newcommand\listofexercises{%
   \section*{Exercises}%
     \@mkboth{CONTENTS}%
             {CONTENTS}%
   \begingroup
   \fontsize{9}{11.5}\selectfont\@starttoc{loe}\par\endgroup}
%
\renewenvironment{thebibliography}[1]
    {\clearpage\section*{\bibname}%
       \@mkboth{\MakeUppercase\@title}{\MakeUppercase\bibname}%
     \list{\@biblabel{\@arabic\c@enumiv}}%
          {\settowidth\labelwidth{\@biblabel{#1}}%
           \leftmargin\labelwidth
           \advance\leftmargin\labelsep
           \@openbib@code
           \usecounter{enumiv}%
           \let\p@enumiv\@empty
           \renewcommand\theenumiv{\@arabic\c@enumiv}}%
     \sloppy\RaggedRight
     \clubpenalty4000
     \@clubpenalty \clubpenalty
     \widowpenalty4000%
     \sfcode`\.\@m}
    {\def\@noitemerr
      {\@latex@warning{Empty `thebibliography' environment}}%
     \endlist}
%
\renewenvironment{theindex}
              {\@mkboth{\MakeUppercase\@title}%
                       {\MakeUppercase\indexname}%
               \begin{multicols}{2}%
               \parindent\z@
               \parskip\z@ \@plus .3\p@\relax
               \let\item\@idxitem}
              {\end{multicols}\clearpage}
% Add a new description for named prelims
\newcommand{\prelim}[1]{\clearpage
   \section*{#1}\addcontentsline{toc}{section}{#1}%
   \@mkboth{\MakeUppercase\@title}{\MakeUppercase{#1}}}
%
% Fix floating footnotes (c.t.t. 22 Oct 2001 Donald Arseneau)
% Message-ID: <[email protected]>, thanks Don.
%
\def\footnoterule{\kern-3\p@
       \nobreak \vfill
       \hrule \@width 2in \kern 2.6\p@} % the \hrule is .4pt high
%
\newcommand{\tablefootnote}[1]{\raisebox{.667ex}{\kern.1em\scriptsize\ref{#1}}}
%
% Add a fake linebreak for illustration
%
\newcommand{\fakebreak}{\linebreak}
%
% Some artefacts of transformation from XML
%
\newcommand{\mdash}{~--- }
\newcommand{\ndash}{--}
\newcommand{\amp}{\&}
\newcommand{\dito}{\raisebox{-.5ex}{''}}
\newcommand{\guiicon}[1]{{\setlength{\fboxsep}{1pt}%
       \colorbox{grey}{\color{white}\footnotesize\textsf{#1}}}}
%
% Change the name of the Abstract
%
\renewcommand{\abstractname}{Summary}
%
% Sidebars, Exercises and Warnings
\newenvironment{sidebar}{%
       \begin{Sbox}\begin{minipage}{.85\textwidth}}%
       {\end{minipage}\end{Sbox}%
               \begin{center}\setlength{\fboxsep}{6pt}%
               \shadowbox{\TheSbox}\end{center}}
\newenvironment{warning}{%
       \begin{Sbox}\begin{minipage}{.85\textwidth}\sffamily\small\RaggedRight}%
       {\end{minipage}\end{Sbox}%
               \begin{center}\setlength{\fboxsep}{6pt}%
               \colorbox{litegrey}{\TheSbox}\end{center}}
% fancybox's thin double lines are too thin for Adobe Acrobat to
% render properly.
\def\@doublebox#1{%
 \begingroup
   \setbox\@fancybox\hbox{{#1}}%
   \fboxrule=.2pt% was .75\fboxrule
   \setbox\@fancybox\hbox{\fbox{\box\@fancybox}}%
   \fboxrule=2\fboxrule
   \fboxsep=\fboxrule
   \advance\fboxsep 2pt% instead of .5pt
   \fbox{\box\@fancybox}%
 \endgroup}
\newcounter{exercise}
\newenvironment{exercise}{\refstepcounter{exercise}%
       \begin{Sbox}\begin{minipage}{.85\textwidth}\sffamily\RaggedRight
               \setlength{\parindent}{1em}%
               \noindent{\scshape\small Exercise \theexercise}}%
       {\end{minipage}\end{Sbox}%
               \begin{center}\setlength{\fboxsep}{6pt}%
                 \doublebox{\TheSbox}%
               \end{center}}
\newenvironment{example}{%
       \begin{Sbox}\begin{minipage}{.85\textwidth}}%
       {\end{minipage}\end{Sbox}%
               \begin{center}\setlength{\fboxsep}{6pt}%
               \fbox{\TheSbox}\end{center}}
\newlength{\boxedwidth}
\newcommand{\resetboxedwidth}[1]{%
       \setlength{\boxedwidth}{\columnwidth}
       \addtolength{\boxedwidth}{-2.5\fboxsep}
       \addtolength{\boxedwidth}{-2\fboxrule}
       \addtolength{\boxedwidth}{-#1}
       \addtolength{\boxedwidth}{-\leftmargin}}
\newenvironment{sourcecode}[1][0pt]{%
       \setlength{\fboxsep}{1pc}\resetboxedwidth{#1}%
       \begin{Sbox}
       \begin{minipage}{\boxedwidth}}
       {\end{minipage}
       \end{Sbox}
       \begin{center}
       \cornersize*{1pc}\ovalbox{\TheSbox}
       \end{center}}
%
\index{options|see{Class Options}}
\newcommand{\emstrut}{\vrule height1em width0pt}
%
% Macro for menus
%
\newlength{\menuwidth}
\newlength{\menuitemwidth}
\newlength{\menusubitemwidth}
\newlength{\menumaxwidth}
\newlength{\menumaxheight}
\newlength{\menumaxdepth}
\newlength{\menuheight}
\newcommand{\menu}[1]{\setlength{\fboxsep}{1pt}\setlength{\fboxrule}{.1pt}%
       \settowidth{\menuwidth}{\bfseries #1}%
%       \addtolength{\menuwidth}{2ex}%
       \raisebox{\fboxsep}{\fbox{\hbox to\menuwidth{\scriptsize\sffamily\bfseries
                       \vphantom{()}#1\hss\tiny\HandLeftUp}}}}
\newcommand{\menuitem}[2]{\@ifnextchar[{\@menusubitem{#1}{#2}}{\@menuitem{#1}{#2}}}
\newcommand{\@menuitem}[2]{%
       \settoheight{\menumaxheight}{AhMI(l'}%
       \settodepth{\menumaxdepth}{jJ,)yp}%
       {\scriptsize\sffamily
       \setlength{\fboxsep}{1pt}\setlength{\fboxrule}{.1pt}%
       \settowidth{\menuwidth}{\bfseries #1}%
       \settoheight{\menuheight}{\bfseries\vphantom{()}#1}%
       \addtolength{\menumaxheight}{-\menuheight}%
       \settowidth{\menuitemwidth}{#2}%
       \settodepth{\menumaxdepth}{\vphantom{(yjp)}#2}%
       \ifdim\menuitemwidth>\menuwidth
               \menumaxwidth=\menuitemwidth
       \else
               \menumaxwidth=\menuwidth
       \fi
       \addtolength{\menumaxwidth}{2em}%
       \raisebox{\menumaxheight}{\colorbox{black}{\hbox
           to\menumaxwidth{\color{white}\bfseries\vphantom{(yjp)}#1\hss}}}%
       \kern-\menumaxwidth\kern\menuwidth
       \raisebox{-\menumaxdepth}{\fcolorbox{black}{white}{\hbox
               to\menumaxwidth{\color{black}\vphantom{(yjp)}#2\hss\tiny\HandLeftUp}}}} }
\def\@menusubitem#1#2[#3]{%
       \settoheight{\menumaxheight}{AhMI(l'}%
       \settodepth{\menumaxdepth}{jJ,)yp}%
       {\scriptsize\sffamily
       \setlength{\fboxsep}{1pt}\setlength{\fboxrule}{.1pt}%
       \settowidth{\menuwidth}{\bfseries#1}%
       \settoheight{\menuheight}{\bfseries\vphantom{()}#1}%
       \addtolength{\menumaxheight}{-\menuheight}%
       \settowidth{\menuitemwidth}{#2}%
       \settowidth{\menusubitemwidth}{\itshape #3}%
       \settodepth{\menumaxdepth}{\itshape\vphantom{(yjp)}#3}%
       \ifdim\menuitemwidth>\menuwidth
               \ifdim\menusubitemwidth>\menuwidth
                       \menumaxwidth=\menusubitemwidth
               \else
                       \menumaxwidth=\menuitemwidth
               \fi
       \else
               \ifdim\menusubitemwidth>\menuwidth
                       \menumaxwidth=\menusubitemwidth
               \else
                       \menumaxwidth=\menuwidth
               \fi
       \fi
       \addtolength{\menumaxwidth}{2em}%
       \raisebox{\menumaxheight}{\fbox{\hbox to\menumaxwidth{\bfseries
                       \vphantom{(yjp)}#1\hss}}}%
       \kern-\menumaxwidth\kern\menuwidth
       \raisebox{\fboxsep}{\fcolorbox{black}{white}{\hbox
               to\menumaxwidth{\color{black}\vphantom{(yjp)}#2\hss}}}%
       \kern-\menumaxwidth\kern\menuitemwidth
       \raisebox{-\menumaxdepth}{\colorbox{black}{\hbox
               to\menumaxwidth{\color{white}\itshape\vphantom{(yjp)}#3\hss
               \upshape\tiny\HandLeftUp}}}}}
\newcommand{\smiley}{%
       \smash{\raisebox{.75ex}{%
               \setlength{\tabcolsep}{0pt}\footnotesize
               \begin{tabular}c.\thinspace.\\[-1ex]%
                       \texttt{\char'015}\\[-1.1em]%
                       $\smile$\\[-1.5em]\large$\bigcirc$\end{tabular}}}}
%
% Set a date and version number for this stylesheet
%
\newcounter{version}
\newcounter{issue}
% History
% v0.1 developed 1999 but never released
% v1.* rewritten 2000 as training document but incomplete
% v2.1 completed December 2001, notified to c.t.t 2001-12-14
% v2.2 finished Yuletide 2001, only minor typos
% v2.3 converted from SGML to XML started
% v3.0 XML done, front redesigned, loads of changes suggested by readers
\setcounter{version}{3}
\setcounter{issue}{4}
%\newcommand{\releasedate}{November 2001}%2.1
%\newcommand{\releasedate}{December 2001}%2.2
%\newcommand{\releasedate}{March 2002}%2.3
%\newcommand{\releasedate}{January 2003}%3.0
\newcommand{\releasedate}{November 2003}%3.4
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%