% S book functions
%
% Example environment: for S examples -- like verbatim except that
% you can insert special things by using \ commands and braces (which
% then themselves have to be escaped)
%
% \s inserts a Postscript symbol that stands for the 1988 S book in references
%
% \Sfigure{filename} inserts a figure using psfig
\def\docspecials{\do\ \do\$\do\&%
  \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~}

\def\alltt{\trivlist \item[]\if@minipage\else\vskip\parskip\fi
\leftskip\@totalleftmargin\rightskip\z@
\parindent\z@\parfillskip\@flushglue\parskip\z@
\@tempswafalse \def\par{\if@tempswa\hbox{}\fi\@tempswatrue\@@par}
\obeylines \tt \catcode``=13 \@noligs \let\do\@makeother \docspecials
 \frenchspacing\@vobeyspaces}

\let\endalltt=\endtrivlist

\newenvironment{Example}{\begin{list}{}{\setlength{\leftmargin}{\parindent}}\item
\begin{alltt}}{\end{alltt}\end{list}}
% some commands from Doug Bates for nonlinear chapter
\newcommand{\Co}[1]{{\small\tt #1}}
\newcommand{\E}[1]{{\rm E}\left[ #1 \right]}
\newcommand{\boeta}{\mbox{\boldmath$\eta$}}
\newcommand{\bbeta}{\mbox{\boldmath$\beta$}}
\newcommand{\bG}{\bf G}
\newcommand{\bX}{\bf X}
\newcommand{\by}{\bf y}
\newcommand{\bz}{\bf z}
\newcommand{\trans}{^{\rm T}}
\newcommand{\btheta}{\mbox{\boldmath$\theta$}}
\newcommand{\logit}{\mathop{\rm logit}\nolimits}

%%\newcommand{\s}{\raisebox{-.2ex}{\psfig{figure=/usr/jmc/book2/bigS.ps,height=1em,silent=}}}
\newcommand{\s}{\fbox{\(\cal S\)}}
\newcommand{\Gets}{\(\leftarrow\)}

% commands for figures
\input{psfig}
\newlength{\figurewidth}
\setlength{\figurewidth}{\textwidth}
\addtolength{\figurewidth}{2\parindent}
\newcommand{\Sfigure}[1]{\psfig{figure=#1,width=\figurewidth,silent=}}
\newcommand{\littlefigure}[1]{\psfig{figure=#1,width=2.4in,silent=}}

\newcommand{\ModelChapter}{1}
\newcommand{\DataChapter}{2}
\newcommand{\LinearChapter}{3}
\newcommand{\DesignChapter}{4}
\newcommand{\GlmChapter}{5}
\newcommand{\GamChapter}{6}
\newcommand{\SmoothChapter}{7}
\newcommand{\TreeChapter}{8}
\newcommand{\NonlinChapter}{9}

\newcommand{\Author}[1]{

\sf \large
#1

}
\newcommand{\Twiddle}{\mbox{\boldmath\(\tt\sim\)}}
\newcommand{\Hat}{\mbox{\boldmath\({}^{\wedge}\)}}
