%% %% This is file `ansexam2.tex', %% generated with the docstrip utility. %% %% The original source files were: %% %% answers.dtx (with options: `ex2') %% \documentclass[12pt,a4paper]{article} \usepackage{answers} %\usepackage[nosolutionfiles]{answers} % def d'un environnement Exercise numerote \newtheorem{Exc}{Exercise} \newenvironment{Ex}{\begin{Exc}\normalfont}% {\end{Exc}} % Trois types de solutions sont proposes \Newassociation{solution}{Soln}{test} \Newassociation{hint}{Hint}{test} \Newassociation{Solution}{sSol}{testtwo} \newcommand{\prehint}{~[Hint]} \newcommand{\presolution}{~[Solution]} \newcommand{\preSolution}{~[Homework]} % test \newcommand{\Opentesthook}[2]% {\Writetofile{#1}% {\protect\section{#1: #2}}} % introduction de la solution \renewcommand{\Solnlabel}[1]{\emph{Solution #1}} \renewcommand{\Hintlabel}[1]{\emph{Hint #1}} \renewcommand{\sSollabel}[1]{\emph{Solution to #1}} \begin{document} % gestion des fichiers contenant les solutions \Opensolutionfile{test}[ans2]{Solutions} \Writetofile{test}% {\protect\subsection {Some Solutions}} \Opensolutionfile{testtwo}[ans2x] \Writetofile{testtwo}{% \protect\subsection{Extra Solutions}} % Exercices \section{Exercises} \begin{Ex} An exercise with a solution. \begin{solution} This is a solution. \relax{} \end{solution} \end{Ex} \begin{Ex} An exercise with a hint and a secret solution. \begin{hint} This is a hint. \end{hint} \begin{Solution} This is a secret solution. \end{Solution} \end{Ex} \begin{Ex} An exercise with a hint. \begin{hint} This is a hint. \end{hint} \end{Ex} % gestion des fichiers contenant les solutions \Closesolutionfile{test} \Readsolutionfile{test} % \clearpage \hrule \Closesolutionfile{testtwo} \Readsolutionfile{testtwo} \end{document} %% %% End of file `ansexam2.tex'.