\newcommand {\exo@SquareBox}[2][0.033em]{} %{\color{blue}\huge$\diamondsuit$}} \def \ExerciseName {Exercise} \def \AnswerName {Answer} \newtheorem{Exercise}{\aname{Exo-\theExercise}{\ExerciseName}} \newcounter{Question} \newenvironment {exercise}[1][] {\def \@test {#1}\ifx \@test \empty \begin{Exercise}\else \begin{Exercise}[#1]\fi \setcounter{Question}{0}} {\exo@SquareBox {0.5em}\end{Exercise}} \newenvironment {answer}{\em \stepcounter{Question} %\begin{tabular*}{\linewidth}{r} \begin{flushright} \bf \ahrefloc{Rep-\theExercise.\theQuestion}{\AnswerName} \end{flushright} %\end {tabular*} \begin{cutflow}{Answer} \aname {Rep-\theExercise.\theQuestion}{}} {\end{cutflow} } \newcommand{\inputanswers}[1][\jobname]{\bgroup \input {#1.ans}\egroup} \def \AnswerContinued #1#2#3{\subsubsection* {(Exercise #1, continued)}} \def \AnswerNew #1#2#3{\subsection* {\ahrefloc {Exo-#1}{Exercise #1}, page #3}} \newcommand {\ExerciseNew}[4]{} \let \exo@chap \@empty \newcommand {\ExerciseItem}[4] {\def \@test {#2}\ifx \@test \exo@chap \let \do \relax \else \def \do {\gdef \exo@chap {#2} \\\multicolumn {2}{l}{\bf Chapter \exo@chap}\\[0.5em]}\fi \do \hspace {2em}\ahrefloc{Exo-#1}{#1}:\quad & #4\\} \def \listofexercises {\bgroup \let \ExerciseNew \ExerciseItem \begin{tabular}{rp{}}\input {ocaml.exo}\end{tabular} \egroup}