% from itchapter.sty
% stolen from ipolppt.sty july 99
%
% used by thebook
% defines use of figtype
\newcounter{tabtype}
\newcounter{figtype}
%
\newenvironment{figindent}{\begin{description}}{\end{description}}
\newenvironment{indented}{\begin{indented}}{\end{indented}}
\newenvironment{varindent}[1]{\begin{varindent}{#1}}{\end{varindent}}
%
\def\indented{\list{}{\itemsep=0\p@\labelsep=0\p@\itemindent=0\p@
   \labelwidth=0\p@\leftmargin=48\p@\topsep=0\p@\partopsep=0\p@
   \parsep=0\p@\itemindent=-48\p@\listparindent=15\p@}\rm}
% added Tue 31/12/02 for figtype 5, but not used :
\def\specialindented{\list{}{\itemsep=0\p@\labelsep=0\p@\itemindent=0\p@
   \labelwidth=0\p@\leftmargin=0\p@\rightmargin=-48\p@\topsep=0\p@\partopsep=0\p@
   \parsep=0\p@\itemindent=-48\p@\listparindent=15\p@}\rm}
\def\notindented{\list{}{\itemsep=0\p@\labelsep=0\p@\itemindent=0\p@
   \labelwidth=0\p@\leftmargin=0\p@\topsep=0\p@\partopsep=0\p@
   \parsep=0\p@\itemindent=0\p@\listparindent=1em\parindent=1em}\rm}
% the above changes made Sat 8/11/03 have had no effect on indentn of paragraphs
%  in margin figures.
%   \parsep=0\p@\itemindent=0\p@\listparindent=0\p@}\rm} was this until Sat 8/11/03

\let\endindented=\endlist 
\let\endnotindented=\endlist 

\def\varindent#1{\setlength{\varind}{#1}%
   \list{}{\itemsep=0\p@\labelsep=0\p@\itemindent=0\p@
   \labelwidth=0\p@\leftmargin=\varind\topsep=0\p@\partopsep=0\p@
   \parsep=0\p@\listparindent=15\p@}\rm}

\let\endvarindent=\endlist 

% DJCM added 14 3 94:
% was:
% \long\def\@makecaption#1#2{
%  \vskip 10pt 
%  \setbox\@tempboxa\hbox{#1: #2}
%  \ifdim \wd\@tempboxa >\hsize #1: #2\par \else \hbox
% to\hsize{\hfil\box\@tempboxa\hfil} 
%  \fi}
%
% this does all smoothly indented
%
% \long\def\@makecaption#1#2{
%  \vskip 11pt \begin{indented}
%  \item[]{\bf #1.} #2
%  \end{indented}
% }
%  this makes Figure look just like a description
% \long\def\@makecaption#1#2{
%  \vskip 10pt \begin{figindent}
%  \item[#1.] #2
%  \end{figindent} 
% }
% changed, Dec 97
% THIS WAS USED FOR A LONG TIME: (97-99)
%\long\def\@makecaption#1#2{
% \vskip 10pt \begin{indented}\small% added small Dec 97.
% \item[{\bf #1}]. #2
% \end{indented} 
%}
% figtype 4 - is to make marginal captions; 1,2,3 as in ioplppt.sty
% 5 (Tue 31/12/02) is for fullwidth figures with wider captions
\long\def\@makecaption#1#2{
 \vskip 10pt
 \ifnum\thefigtype=5\begin{specialindented}\small%
 \item[{\sf #1}]. #2
 \end{specialindented}\else
 \ifnum\thefigtype=4\begin{notindented}\raggedright\small%
 \item[{\sf #1}]. #2
 \end{notindented}\else
 \ifnum\thefigtype=2\begin{varindent}{\@figindent}
 \item[]{\sf #1.} #2
 \end{varindent}\else
 \ifnum\thefigtype=3
 \footnotesize\rm{\sf #1.} #2\else
 \begin{indented}\small% added small Dec 97.
 \item[{\sf #1}]. #2
 \end{indented}\fi\fi\fi\fi
}



