% derived from chapternotes
\newcounter{exercise_number}
\setcounter{exercise_number}{1}
\newcommand{\exercise}{\noindent{\sf{Exercise}
 \arabic{exercise_number}}\addtocounter{exercise_number}{1}\typeout{setcounter{exercise_number}{\arabic{exercise_number}}}}

\newcounter{solution_number}
\setcounter{solution_number}{1}
\newcommand{\solution}{\noindent{\sf{Solution to exercise}
 \arabic{solution_number}}\addtocounter{solution_number}{1}}

\newcounter{example_number}
\setcounter{example_number}{1}
\newcommand{\example}{\noindent{\sf{Example} \arabic{example_number}}\addtocounter{example_number}{1}}
%
% The command \example simply causes the word example 3 to be printed
% and the counter to be incremented. Used by \exampla{} and \problema{}
%

\newtheorem{problemo}{Exerciso}[chapter]

\newenvironment{problemski}{\begin{description}\item[\exercise:]}
{\end{description}}

%
% problema and exampla are identical, except for the enum depth advance
%
\newcommand{\dorat}{\raisebox{-0.45in}[0in][0in]{\psfig{figure=figs/myrat1b.eps,width=1.4cm}}}% was ratbert4
% problema is just the same as an old exercisa -- no rat, no clever depth change
\newcommand{\problema}[1]{\begin{description}\item[\exercise:] #1 \end{description}}
% indented exercise with rat: 
\newcommand{\exercisr}[1]{\begin{description}\item[{\makebox[0in][r]{\dorat}}\exercise:]
\ifnum \@enumdepth >3 \@toodeep\else
\advance\@enumdepth \@ne 
\fi
 #1 \end{description}}
% indented exercise without rat
\newcommand{\exercisnr}[1]{\begin{description}\item[\exercise:]
\ifnum \@enumdepth >3 \@toodeep\else
% this advances the enum depth. I don't know what causes it to get unadvanced.
\advance\@enumdepth \@ne 
% \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
\fi
% {\marginpar[\raisebox{-15pt}{$\Rightarrow$}]{\raisebox{-15pt}{$\Leftarrow$}}}
% why does htis not work??????
 #1 \end{description}}
\newcommand{\exercisa}[1]{\exercisr{#1}}
\newcommand{\exampla}[1]{\begin{description}\item[\example:] 
\ifnum \@enumdepth >3 \@toodeep\else
% this advances the enum depth. I don't know what causes it to get unadvanced.
\advance\@enumdepth \@ne 
% \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
\fi
 #1 \end{description}}
% \reversemarginpar
\newcommand{\solutiona}[1]{\begin{description}\item[\solution:] \ifnum \@enumdepth >3 \@toodeep\else
% this from chapternotes.sty
\advance\@enumdepth \@ne 
\fi
{#1} \end{description}}

\endinput
