\documentclass{book}
\usepackage{theorem}
\theorembodyfont{\rmfamily}
\usepackage[dvips]{epsfig}	% specify `dvips' driver
%\usepackage[pdftex]{epsfig}	% specify `pdftex' driver
\usepackage{makeidx}
\setlength{\textheight}{8.1in}
\setlength{\textwidth}{5in}
\setlength{\topmargin}{.25in}
\setlength{\oddsidemargin}{.75in} % 1.25 for book Change to .75 for web version
\setlength{\evensidemargin}{.75in} % .25 for book Change to .75 for web version
%
% Low-level figure positioning.  Change as appropriate to your system.
%
\newcommand{\barefig}[2]{\makebox{\includegraphics*[width=#2] {figures/#1.ps}}} 
%
% Higher-level figure commands.
%
\newcommand{\NA}{{\rm NA}}
\usepackage{latexsym}
\newif\ifdiscrete
%\discretetrue
\discretefalse
\newcommand{\choice}[2]{\ifdiscrete{#1}\else{#2}\fi}

%\putfig{3.5truein}{PSfig1.3}{Peter's winnings in 40 plays of heads or tails.}{fig 1.3}
\newcommand{\putfig}[4]
{\begin{figure}
\centerline{\barefig{#2}{#1}}
\caption{#3}
\label{#4}
\end{figure}}

\newcommand{\putfigdouble}[6]
{\begin{figure}
\centerline{\barefig{#2}{#1}}
\centerline{\barefig{#4}{#3}}
\caption{#5}
\label{#6}
\end{figure}}

\newcommand{\nocaption}[4]
{\begin{figure}
\centerline{\barefig{#2}{#1}}
%\caption{#3}
\label{#4}
\end{figure}}
%
\newenvironment{example}
{\noindent\begin{examp}}
{\hfill $\Box$ \end{examp}}

\newenvironment{definition}
{\noindent\begin{defn}}
{\hfill $\Box$ \end{defn}}

\newenvironment{theorem}
{\noindent\begin{thm}}
{\hfill $\Box$ \end{thm}}

\newenvironment{corollary}
{\noindent\begin{cor}}
{\hfill $\Box$ \end{cor}}

\newenvironment{lemma}
{\noindent\begin{lem}}
{\hfill $\Box$ \end{lem}}

\newenvironment{proposition}
{\noindent\begin{prop}}
{\hfill $\Box$ \end{prop}}
%
\newtheorem{examp}{Example}[chapter]
\newtheorem{defn}{Definition}[chapter]
\newtheorem{thm}{Theorem}[chapter]
\newtheorem{cor}{Corollary}[chapter]
\newtheorem{prop}{Proposition}[chapter]
\newtheorem{lem}{Lemma}[chapter]
\newcommand{\exercises}{\subsection*{Exercises}}
\newcommand{\proof}{\vskip .2in\noindent{\bf Proof.\ }}
%\newcommand{\emx}[1]{{\emx{#1}\/}}
%\newcommand{\mat}[1]{{\mbox{\bf#1}\/}}
\newcommand{\emx}[1]{{\em{#1}\/}}
\newcommand{\mat}[1]{{\mbox{\bf#1}\/}}


\newenvironment{scope}{}{}
\newenvironment{shrink}{\begin{scope} \small}{\end{scope}}
\newenvironment{progout}{\begin{shrink}}{\end{shrink}}


\newcount\exerciseno
%\def\chapterno{4}
\def\i{\advance\exerciseno by 1\bigskip
\item[\bf{\the\exerciseno}]}
\def\istar{\advance\exerciseno by 1\bigskip
\item[\bf{*\the\exerciseno}]}

%\newenvironment{LJSItem}[1]
%   {\exerciseno=0
%     \renewcommand{\theenumi}{\alph{enumi}}
%	    \renewcommand{\labelenumi}{\bf{\theenumi.}}
%      \begin{list}{}%
%          {\renewcommand{\makelabel}[1]{\hfil\bf{##1}\hspace{.5em}}%
%            \settowidth{\labelwidth}{\bf{#1}}%
%            \addtolength{\labelwidth}{.5em}%
%            \setlength{\leftmargin}{\labelwidth}
%             \addtolength{\leftmargin}{\labelsep}%
%             }%
%    }%
%{\end{list}}

\newenvironment{LJSItem}{%

%\def\chapterno{4}
\newcommand{\exref}[1]{\ref{##1}}
\def\i{\renewcommand{\labelenumi}{\bf\theenumi}\item}

\def\istar{\renewcommand{\labelenumi}{\bf*\theenumi}\item}

\begin{enumerate}}
{\end{enumerate}}
\def\partone{ch1,ch2,ch3,ch4,ch5,ch6}
\def\parttwo{ch7,ch8,ch9,ch10,ch11,ch12}
\def\all{frontmatter,\partone,\parttwo,backmatter}
\typein[\secstoprocess]{enter the sections to process: }
\includeonly{\secstoprocess}

\title{Introduction to Probability}
\author{Charles M. Grinstead \\ Swarthmore College
\and
J. Laurie Snell \\ Dartmouth College}
\date{10 September 1996}

\makeindex
\begin{document}
\addtolength{\normalbaselineskip}{1pt}
\normalbaselines
\include{frontmatter}
\include{ch1}
\choice{}{\include{ch2}}
\include{ch3}
\include{ch4}
\include{ch5}
\include{ch6}
\include{ch7}
\include{ch8}
\include{ch9}
\choice{}{\include{ch10}}
\include{ch11} 
\choice{}{\include{ch12}}
\include{backmatter}

\end{document}
