%% %% This is file `ansexam1.tex', %% generated with the docstrip utility. %% %% The original source files were: %% %% answers.dtx (with options: `ex1') \documentclass[12pt,a4paper]{article} \usepackage{answers} \Newassociation{sol}{Solution}{ans} \newtheorem{ex}{Exercise} \begin{document} \Opensolutionfile{ans}[ans1] \section{Problems} \begin{ex} First exercise \begin{sol} First solution. \end{sol} \end{ex} \begin{ex} Second exercise \begin{sol} Second solution. \end{sol} \end{ex} \Closesolutionfile{ans} \section{Solutions} \input{ans1} \end{document} \endinput %% %% End of file `ansexam1.tex'.