summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/exsol/exsol.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/exsol/exsol.dtx')
-rw-r--r--macros/latex/contrib/exsol/exsol.dtx428
1 files changed, 392 insertions, 36 deletions
diff --git a/macros/latex/contrib/exsol/exsol.dtx b/macros/latex/contrib/exsol/exsol.dtx
index abe450d0c7..7c2692e2fe 100644
--- a/macros/latex/contrib/exsol/exsol.dtx
+++ b/macros/latex/contrib/exsol/exsol.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2018 by Walter Daems <walter.daems@uantwerpen.be>
+% Copyright (C) 2019 by Walter Daems <walter.daems@uantwerpen.be>
%
% This work may be distributed and/or modified under the conditions of
% the LaTeX Project Public License, either version 1.3 of this license
@@ -30,11 +30,12 @@
%<package|driver>\NeedsTeXFormat{LaTeX2e}
%<driver>\ProvidesFile{exsol.dtx}
%<package>\ProvidesPackage{exsol}
-%<package|driver> [2018/10/23 v1.4 ExSol - Exercises and Solutions package (DMW)]
+%<package|driver> [2024/01/07 v1.6 ExSol - Exercises and Solutions package (DMW)]
%<*driver>
\documentclass[10pt,a4paper]{ltxdoc}
\usepackage[english]{babel}
\usepackage[exercisesfontsize=small]{exsol}
+\usepackage{booktabs}
\usepackage{metalogo}
\EnableCrossrefs
\CodelineIndex
@@ -48,8 +49,8 @@
\RecordChanges
\newcommand{\exsol}{\textsc{ExSol}}
\StopEventually{\PrintChanges\PrintIndex}
-\def\fileversion{1.4}
-\def\filedate{2018/10/23}
+\def\fileversion{1.6}
+\def\filedate{2024/01/07}
\begin{document}
\DocInput{exsol.dtx}
\end{document}
@@ -100,6 +101,9 @@
% \changes{v1.3}{2016/08/09}{\@ Correction of spacings and counters}
% \changes{v1.4}{2018/10/23}{\@ Allowed for adding exerciseseries label in
% solutionseries using option 'usesolutionserieslabels'}
+% \changes{v1.5}{2019/01/02}{\@ Added inline and external mode}
+% \changes{v1.6}{2024/01/07}{\@ Added check to see if babel was
+% loaded, and issue appropriate error}
%
% \DoNotIndex{\newcommand,\newenvironment}
% \setlength{\parindent}{0em}
@@ -134,10 +138,31 @@
% into a simple document harness, such that when running \LaTeX{} on
% the latter, you can generate a nice solution book.
%
+% In \emph{external mode} both the exercises and the solutions are
+% written to secondary files that can be included in a simple document
+% harness, such that when running \LaTeX{} on these, you can generate
+% an exercise as well as a solution book.
+%
% In \emph{local mode} (invoked by specifying the package option 'local'),
% this corresponds to inserting the saved solutions in the current
% document at a later stage in the text.
-%
+%
+% In \emph{inline mode} (invoked by specifying the package option
+% 'inline'), the solutions are inserted 'on the spot'.
+%
+% This has been conveniently summarized in the table below:
+% \begin{center}
+% \begin{tabular}{ccc}
+% \toprule
+% \bf mode & \bf exercises & \bf solutions\\
+% \midrule
+% global & on the spot & in separate document\\
+% external & in separate document & in separate document\\
+% local & on the spot & later in the same document\\
+% inline & on the spot & on the spot \\
+% \bottomrule
+% \end{tabular}
+% \end{center}
% \subsection{Why use \exsol{}?}
% \begin{itemize}
% \item It allows to keep the \LaTeX{} source of your exercises and their
@@ -203,9 +228,16 @@
% \subsubsection{Loading the package}
% The macro package exsol can be loaded with:
% \begin{verbatim}
+% \usepackage{babel}
% \usepackage{exsol}
% \end{verbatim}
%
+% Note before we start that you need to load the babel package before
+% you load the exsol package! This is to allow you to load the
+% appropriate languages for your text.
+%
+% OK, now let's get started.
+%
% Your first choice to make is where you want your solutions to
% appear. The primary objective of the exsol package was 'global
% mode', i.e. separating your solutions from the exercises,
@@ -218,7 +250,11 @@
% Gathering exercises in (numbered) series and 'loading' them locally
% in your text, allows for simplifying the
% individual exercise numbers (omitting their prefix containing,
-% chapter number, section number, subsection number a.s.o.).
+% chapter number, section number, subsection number a.s.o.).
+%
+% A third mode of operation is 'inline mode', in which the
+% solution is inserted in the main text 'on the spot'. You can trigger
+% this, by specifying the package option 'inline'.
%
% \subsubsection{Global mode - flat grouping exercises}
% Adding exercises together with their solutions in your document is
@@ -259,8 +295,7 @@
% series (e.g. according to their degree of difficulty). This can be
% done by using the |exerciseseries| environment instead of the
% |exercises| environment.
-% This environment takes and also takes a
-% mandatory label argument.
+% This environment takes and also takes a mandatory label argument.
% In addition it takes two optional arguments:
% \begin{itemize}
% \item |columns| to specify the amount of clumns
@@ -311,7 +346,8 @@
% \end{exerciseseries}
% \end{verbatim}
%
-%
+% As an alternative, you can specify the 'inine' option to include
+% the solutions on the spot where you specified them.
%
% \subsection{Examples}
%
@@ -319,7 +355,8 @@
% \label{examplesglobal}
% Below, you can find an example of a file that contains a number of
% exercises and solutions, with the goal to generate a separate
-% solution book.
+% solution book. Note that referencing exercises works just as you
+% would expect it.
%
% \begin{Verbatim}[fontsize=\footnotesize]
%<*example>
@@ -356,9 +393,14 @@ equations.
\end{equation}
\end{informulacollection}
+To make sure you master calculating the roots of second-order
+equation, please solve exercise \ref{ex:1}.
+
+
\begin{exercises}[columns = 2]
\begin{exercise}
+ \label{ex:1}
Solve the following equation for $x \in C$, with $C$ the set of
complex numbers:
\begin{equation}
@@ -396,6 +438,7 @@ equations.
The proposed values $x = x_1, x_2$ are solutions to the given equation.
\end{solution}
\begin{exercise}
+ \label{ex:2}
Consider a 2-dimensional vector space equipped with a Euclidean
distance function. Given a right-angled triangle, with the sides
$A$ and $B$ adjacent to the right angle having lengths, $3$ and
@@ -417,7 +460,8 @@ equations.
Therefore, the length of the hypotenuse equals $5$.
\end{solution}
\end{exercises}
-And now, we can come to conclusion.
+
+And now, we can come to the conclusion.
\section{Conclusion}
Solving second-order polynomial equations is very easy.
\end{document}
@@ -428,17 +472,140 @@ Solving second-order polynomial equations is very easy.
% |example.pdf|. As you can see, the formulacollection entry and the
% exercise appear. There's no trace of the solution.
%
-% When running \LaTeX{} on your document (e.g., the file example.tex
-% as part of the exsol package, as a side effect files with the
-% extension |.sol.tex| and |.fc.tex| have been written
-% to disk (in our case, the files |example.sol.tex| and
-% |example.fc.tex|), containing all solutions and entries for
-% the formula collection in sequence.
-%
-% Generating a solution book is as simple as including the solution
-% file into a simple \LaTeX{} harness, that allows you giving it a
-% proper title page and to add other bells and whistles.
-% This can be seen below:
+% The solution can be recovered by including the |example.sol.tex|
+% file in an appropriate harness. This is explained in
+% section~\ref{harnesses}.
+%
+% \subsubsection{external mode}
+% \label{examplesexternal}
+% Below, you can find an example of a file that contains a number of
+% exercises and solutions, with the goal to generate a separate
+% exercise and solution book.
+%
+% \begin{Verbatim}[fontsize=\footnotesize]
+%<*example-external>
+\documentclass[a4paper,10pt]{article}
+
+\usepackage{a4wide}
+\usepackage[english]{babel}
+\usepackage[external]{exsol}
+
+\title{External example, from the \textsf{ExSol} package}
+\author{Walter Daems}
+\setlength{\parindent}{0em}
+\begin{document}
+\maketitle
+
+\section{Introduction}
+
+In this text we explain how to solve second-order polynomial
+equations.
+
+\section{Solving second-order polynomial equations}
+
+\begin{informulacollectiononly}
+\section*{Solving second-order polynomial equations}
+\end{informulacollectiononly}
+\begin{informulacollection}
+ The roots of the following equation
+ \begin{equation}
+ a x^2 + bx + c = 0
+ \end{equation}
+ can be determined as:
+ \begin{equation}
+ x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4 a c}}{2 a}
+ \end{equation}
+\end{informulacollection}
+
+\begin{exercises}[columns = 2]
+
+ \begin{exercise}
+ Solve the following equation for $x \in C$, with $C$ the set of
+ complex numbers:
+ \begin{equation}
+ 5 x^2 -3 x = 5
+ \end{equation}
+ \end{exercise}
+ \begin{solution}
+ Let's start by rearranging the equation, a bit:
+ \begin{eqnarray}
+ 5.7 x^2 - 3.1 x &=& 5.3\\
+ 5.7 x^2 - 3.1 x -5.3 &=& 0
+ \end{eqnarray}
+ The equation is now in the standard form:
+ \begin{equation}
+ a x^2 + b x + c = 0
+ \end{equation}
+ For quadratic equations in the standard form, we know that two
+ solutions exist:
+ \begin{equation}
+ x_{1,2} = \frac{ -b \pm \sqrt{d}}{2a}
+ \end{equation}
+ with
+ \begin{equation}
+ d = b^2 - 4 a c
+ \end{equation}
+ If we apply this to our case, we obtain:
+ \begin{equation}
+ d = (-3.1)^2 - 4 \cdot 5.7 \cdot (-5.3) = 130.45
+ \end{equation}
+ and
+ \begin{eqnarray}
+ x_1 &=& \frac{3.1 + \sqrt{130.45}}{11.4} = 1.27\\
+ x_2 &=& \frac{3.1 - \sqrt{130.45}}{11.4} = -0.73
+ \end{eqnarray}
+ The proposed values $x = x_1, x_2$ are solutions to the given equation.
+ \end{solution}
+ \begin{exercise}
+ Consider a 2-dimensional vector space equipped with a Euclidean
+ distance function. Given a right-angled triangle, with the sides
+ $A$ and $B$ adjacent to the right angle having lengths, $3$ and
+ $4$, calculate the length of the hypotenuse, labeled $C$.
+ \end{exercise}
+ \begin{solution}
+ This calls for application of Pythagoras' theorem, which
+ tells us:
+ \begin{equation}
+ \left\|A\right\|^2 + \left\|B\right\|^2 = \left\|C\right\|^2
+ \end{equation}
+ and therefore:
+ \begin{eqnarray}
+ \left\|C\right\|
+ &=& \sqrt{\left\|A\right\|^2 + \left\|B\right\|^2}\\
+ &=& \sqrt{3^2 + 4^2}\\
+ &=& \sqrt{25} = 5
+ \end{eqnarray}
+ Therefore, the length of the hypotenuse equals $5$.
+ \end{solution}
+\end{exercises}
+And now, we can come to conclusion.
+
+\section{Conclusion}
+Solving second-order polynomial equations is very easy.
+\end{document}
+%</example-external>
+%\end{Verbatim}
+%
+% The result in the original document, can be seen in the file
+% |example-external.pdf|. As you can see, only the formulacollection
+% entry appears. There's no trace of the exercises or the solutions.
+%
+% \subsubsection{Harnesses}
+% \label{harnesses}
+%
+% When running \LaTeX{} on your document in global or external mode
+% (e.g., the file example-external.tex as part of the exsol package,
+% as a side effect files with the
+% extension |.sol.tex|, |.exc.tex| and/or |.fc.tex| have been written
+% to disk (in our case, the files |example-external.sol.tex|,
+% |example-external.exc.tex| and |example-external.fc.tex|),
+% containing all exercises, solutions and entries for the formula
+% collection in sequence.
+%
+% Generating an exercises/solution book is as simple as including the
+% exercise/solution file into a simple \LaTeX{} harness, that allows
+% you giving it a proper title page and to add other bells and whistles.
+% As an example, you can find a harness for a solution book below.
%
% \begin{Verbatim}[fontsize=\footnotesize]
%<*examplesol>
@@ -464,11 +631,8 @@ Solving second-order polynomial equations is very easy.
%</examplesol>
% \end{Verbatim}
%
-% Generating a formula collection is as simple as including the
-% formula collectoin file into a simple \LaTeX{} harness, that allows
-% you giving it a proper title page and to add other bells and
-% whistles.
-% This can be seen below:
+% Similar harnesses can be used for the exercise book and the formula
+% collection.
%
% \begin{Verbatim}[fontsize=\footnotesize]
%<*examplefor>
@@ -494,6 +658,31 @@ Solving second-order polynomial equations is very easy.
%</examplefor>
% \end{Verbatim}
%
+% \begin{Verbatim}[fontsize=\footnotesize]
+%<*exampleexc>
+\documentclass[a4paper,10pt]{article}
+
+\usepackage{a4wide}
+\usepackage[english]{babel}
+\usepackage{exsol}
+
+\setlength{\parindent}{0em}
+
+\title{Exercise book, specified in the example-external of the
+ \textsf{ExSol} package}
+\author{Walter Daems}
+
+\begin{document}
+
+\maketitle
+
+\input{example-external.exc.tex}
+
+\end{document}
+%</exampleexc>
+% \end{Verbatim}
+%
+%
% \subsubsection{Local mode}
%
% Below, you can find an example of a file that contains a number of
@@ -596,6 +785,103 @@ Solving second-order polynomial equations is very easy.
%</example-local>
% \end{Verbatim}
%
+%
+% \subsubsection{Inline mode}
+%
+% Below, you can find an example of a file that contains a number of
+% exercises and solutions, with the goal to include the solutions on
+% the spot.
+%
+%
+% \begin{Verbatim}[fontsize=\footnotesize]
+%<*example-inline>
+\documentclass[11pt,a4paper]{article}
+
+\usepackage[german]{babel}
+\usepackage[inline,usesolutionserieslabels]{exsol}
+\usepackage{enumitem}
+
+\setlength{\exsolexercisetopbottomsep}{0pt plus 0pt minus 1pt}
+\setlength{\exsolexerciseleftmargin}{2em}
+\setlength{\exsolexerciserightmargin}{1em}
+\setlength{\exsolexerciseparindent}{0em}
+\setlength{\exsolexerciselabelsep}{1ex}
+\setlength{\exsolexerciselabelwidth}{30pt}
+\setlength{\exsolexerciseitemindent}{0pt}
+\setlength{\exsolexerciseparsep}{\parskip}
+
+\title{Local inline example, from the \textsf{ExSol} package}
+\author{Philippe Marti}
+\setlength{\parindent}{0em}
+\begin{document}
+\maketitle
+
+\section{Gleichungssysteme und Geraden}
+
+Ein bisschen Theorie\ldots
+
+\begin{exerciseseries}[solsubrule=\hrule]{Gleichungssysteme}
+ \begin{exercise}
+ Die Summe zweier Zahlen ist 17 und ihre Differenz 7. Bestimme die
+ beiden Zahlen!
+ \end{exercise}
+ \begin{solution}
+ 5 und 12
+ \end{solution}
+
+ \begin{exercise}
+ Die Differenz einer Zahl und dem Dreifachen einer zweiten Zahl ist
+ 14. Bestimme die beiden Zahlen, falls die zweite Zahl ein Zehntel
+ der ersten ist.
+ \end{exercise}
+ \begin{solution}
+ 20 und 2
+ \end{solution}
+\end{exerciseseries}
+~\\
+Etwas mehr Theorie\ldots
+
+\begin{exerciseseries}{Geraden}
+ \begin{exercise}
+ Berechne den Schnittpunkt von \mbox{$y=3x+1$} und \mbox{$y=3x-7$}.
+ \end{exercise}
+ \begin{solution}
+ Es gibt keinen Schnittpunkt
+ \end{solution}
+
+ \begin{exercise}
+ Die Familie Meier fordert Offerten f\"ur eine Heizungsreparatur
+ ein. Firma A berechnet f\"ur die Fahrtkosten Fr. 42.- und f\"ur
+ jede Arbeitsstunde 76.-. Bei der Firma B sind die Fahrtkosten
+ Fr. 35.- und jede Arbeitsstunde wird mit Fr. 80.- berechnet.
+ \begin{enumerate}[label=\alph*)]
+ \item Welche Kosten entstehen f\"ur beide Firmen, wenn ein Monteur
+ 3.5 Stunden
+ f\"ur die Arbeit benötigt? Welche Firma ist in diesem Fall
+ kostengünstiger?
+
+ \item Wie lauten die Gleichungen derjenigen zwei linearen
+ Funktionen, die jeder Arbeitszeit $x$ (in Stunden) die
+ entstehenden Kosten $y$ (in Franken) zuordnet?
+
+ \item Berechne, bei welcher Arbeitszeit die Kosten bei beiden
+ Firmen gleich sind.
+ \end{enumerate}
+ \end{exercise}
+ \begin{solution}
+ \begin{enumerate}[label=\alph*)]
+ \item Firma A: 308.- $|$ Firma B: 315.-
+ \item A: $y=76x+42$ $|$ B: $y=80x+35$
+ \item Bei $1\frac{3}{4}$ Stunden
+ \end{enumerate}
+ \end{solution}
+\end{exerciseseries}
+
+\end{document}
+%</example-inline>
+% \end{Verbatim}
+%
+%
% \subsection{Fiddling with the spacing}
%
% The default spacing provided by the \textsf{ExSol} package should be
@@ -699,6 +985,8 @@ Solving second-order polynomial equations is very easy.
\RequirePackage{kvoptions}
\RequirePackage{multicol}
\RequirePackage{varwidth}
+\@ifpackageloaded{babel}{\typeout{Good: you loaded babel first!}}{\PackageError{exsol}{You forgot to load the
+ babel package before exsol}{}}
% \end{macrocode}
%
% \subsection{Package options}
@@ -716,6 +1004,26 @@ Solving second-order polynomial equations is very easy.
% \end{macrocode}
% \end{macro}
%
+% \changes{v1.5}{2019/01/02}{Added option external}
+% \begin{macro}{external}
+% This boolean option (true, false) allows setting the mode of the
+% package into external, i.e. that the both exercises and solutions
+% will be written to separate files.
+% \begin{macrocode}
+\DeclareBoolOption[false]{external}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.5}{2019/01/02}{Added option inline}
+% \begin{macro}{inline}
+% This boolean option (true, false) allows setting the mode of the
+% package into inline, i.e. that the solutions will be included 'on
+% the spot'.
+% \begin{macrocode}
+\DeclareBoolOption[false]{inline}
+% \end{macrocode}
+% \end{macro}
+%
% \changes{v1.2}{2016/05/05}{Added option nolabels}
% \begin{macro}{nolabels}
% This boolean option (true, false) allows suppressing the 'Exercise'
@@ -845,8 +1153,14 @@ Solving second-order polynomial equations is very easy.
\typeout{Writing solutions to solution file \jobname.sol.tex}
\newwrite\solutionstream
\immediate\openout\solutionstream=\jobname.sol.tex
+ \ifexsol@external
+ \typeout{Writing exercises to exercise file \jobname.exc.tex}
+ \newwrite\exercisestream
+ \immediate\openout\exercisestream=\jobname.exc.tex
+ \else
\typeout{Using intermediate exercise file \jobname.exc.tex}
\newwrite\exercisestream
+ \fi
\typeout{Writing formulae to formula collection file \jobname.fc.tex}
\newwrite\formulacollectionstream
\immediate\openout\formulacollectionstream=\jobname.fc.tex
@@ -953,7 +1267,9 @@ Solving second-order polynomial equations is very easy.
\def\exercise{\FV@Environment{}{exercise}}
\def\FVB@exercise{%
\refstepcounter{exercise}%
+ \ifexsol@external\else
\immediate\openout\exercisestream=\jobname.exc.tex
+ \fi
\ifexsol@local
% \immediate\write\solutionstream{}
\else
@@ -961,8 +1277,6 @@ Solving second-order polynomial equations is very easy.
% \string\quad\string\newline}
\fi
\ifexsol@copyexercisesinsolutions
- % WDSC tofix
- % \typeout{Writing exercise to \jobname.sol.tex}
\immediate\write\solutionstream{\string\begin{exsol@exercise}{\theexercise}}
\fi
\immediate\write\exercisestream{\string\begin{exsol@exercise}{\theexercise}}
@@ -988,8 +1302,10 @@ Solving second-order polynomial equations is very easy.
\ifexsol@copyexercisesinsolutions
\immediate\write\solutionstream{\string\end{exsol@exercise}}
\fi
+ \ifexsol@external\else
\immediate\closeout\exercisestream
\input{\jobname.exc.tex}
+ \fi
}
\DefineVerbatimEnvironment{exercise}{exercise}{}
% \end{macrocode}
@@ -1050,12 +1366,22 @@ Solving second-order polynomial equations is very easy.
% \begin{macrocode}
\def\solution{\FV@Environment{}{solution}}
\def\FVB@solution{%
- %\typeout{Writing solution to \jobname.sol.tex}
+ % \typeout{Writing solution to \jobname.sol.tex}
+ % WDSC
\ifexsol@copyexercisesinsolutions
- \immediate\write\solutionstream{\string\begin{exsol@solution}{}}
+ \immediate\write\solutionstream{\string\begin{exsol@solution}{}}
\else
- \immediate\write\solutionstream{\string\begin{exsol@solution}{\theexercise}}
+ \ifexsol@inline
+ \immediate\write\solutionstream{\string\begin{exsol@solution}{}}
+ \else
+ \immediate\write\solutionstream{\string\begin{exsol@solution}{\theexercise}}
+ \fi
\fi
+ % \ifexsol@copyexercisesinsolutions
+ % \immediate\write\solutionstream{\string\begin{exsol@solution}{}}
+ % \else
+ % \immediate\write\solutionstream{\string\begin{exsol@solution}{\theexercise}}
+ % \fi
\@bsphack
\begingroup
\FV@UseKeyValues
@@ -1071,6 +1397,11 @@ Solving second-order polynomial equations is very easy.
\def\FVE@solution{
\endgroup\@esphack
\immediate\write\solutionstream{\string\end{exsol@solution}}
+ \ifexsol@inline
+ \immediate\closeout\solutionstream
+ \input{\jobname.sol.tex}
+ \immediate\openout\solutionstream=\jobname.sol.tex
+ \fi
}
\DefineVerbatimEnvironment{solution}{solution}{}
% \end{macrocode}
@@ -1163,13 +1494,17 @@ Solving second-order polynomial equations is very easy.
\setkeys{exerciseseries}{#1}%
\paragraph{\seriesname~\theexerciseseries:~#2}~\par
\ifthenelse{\columncount > 1}{\begin{multicols}{\columncount}}{}
+ \ifexsol@inline\else
\immediate\write\solutionstream{\string\begin\string{solutionseries\string}%
\string[#1\string]\string{#2\string}\string{\theexerciseseries\string}}
- }
- {
- \ifthenelse{\columncount > 1}{\end{multicols}}{}\relax
- \exsubrule\par
+ \fi
+}
+{
+ \ifthenelse{\columncount > 1}{\end{multicols}}{}\relax
+ \exsubrule\par
+ \ifexsol@inline\else
\immediate\write\solutionstream{\string\end\string{solutionseries\string}}
+ \fi
}
% \end{macrocode}
% \end{macro}
@@ -1335,6 +1670,8 @@ Solving second-order polynomial equations is very easy.
% \changes{v1.3}{2016/08/09}{Corrected counter in solutionstream}
% \changes{v1.3}{2016/08/09}{Added macro to suppress chapter in
% solution stream}
+% \changes{v1.5}{2019/01/02}{Added writing the sectioning code to the
+% exercise stream in external mode}
% \begin{macrocode}
\newif\ifnoexinchapter
\noexinchapterfalse
@@ -1349,6 +1686,10 @@ Solving second-order polynomial equations is very easy.
\addtocounter{chapter}{-1}
\immediate\write\solutionstream{\string\setcounter{chapter}{\arabic{chapter}}%
\string\chapter{#1}}%
+ \ifexsol@external
+ \immediate\write\exercisestream{\string\setcounter{chapter}{\arabic{chapter}}%
+ \string\chapter{#1}}%
+ \fi
\addtocounter{chapter}{1}
\fi
}
@@ -1356,6 +1697,9 @@ Solving second-order polynomial equations is very easy.
\let\exsol@@frontmatter\frontmatter
\def\frontmatter{%
\immediate\write\solutionstream{\string\frontmatter}%
+ \ifexsol@external%
+ \immediate\write\exercisestream{\string\frontmatter}%
+ \fi%
\exsol@@frontmatter
}
\fi
@@ -1363,6 +1707,9 @@ Solving second-order polynomial equations is very easy.
\let\exsol@@mainmatter\mainmatter
\def\mainmatter{%
\immediate\write\solutionstream{\string\mainmatter}%
+ \ifexsol@external%
+ \immediate\write\exercisestream{\string\mainmatter}%
+ \fi%
\exsol@@mainmatter
}
\fi
@@ -1370,6 +1717,9 @@ Solving second-order polynomial equations is very easy.
\let\exsol@@backmatter\backmatter
\def\backmatter{%
\immediate\write\solutionstream{\string\backmatter}%
+ \ifexsol@external%
+ \immediate\write\exercisestream{\string\backmatter}%
+ \fi%
\exsol@@backmatter
}
\fi
@@ -1377,6 +1727,9 @@ Solving second-order polynomial equations is very easy.
\let\exsol@@appendix\appendix
\def\appendix{%
\immediate\write\solutionstream{\string\appendix}%
+ \ifexsol@external%
+ \immediate\write\exercisestream{\string\appendix}%
+ \fi%
\exsol@@appendix
}
\fi
@@ -1403,6 +1756,9 @@ Solving second-order polynomial equations is very easy.
\newcommand{\noexercisesinchapter}
{
\immediate\write\solutionstream{No exercises in this chapter}
+ \ifexsol@external%
+ \immediate\write\exercisestream{No exercises in this chapter}%
+ \fi%
}
% \end{macrocode}
% \end{macro}