texlive[41377] Master/texmf-dist: exsol (5jun16)
commits+karl at tug.org
commits+karl at tug.org
Sun Jun 12 01:15:38 CEST 2016
Revision: 41377
http://tug.org/svn/texlive?view=revision&revision=41377
Author: karl
Date: 2016-06-12 01:15:38 +0200 (Sun, 12 Jun 2016)
Log Message:
-----------
exsol (5jun16)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/exsol/exsol.pdf
trunk/Master/texmf-dist/source/latex/exsol/exsol.dtx
trunk/Master/texmf-dist/source/latex/exsol/exsol.ins
trunk/Master/texmf-dist/tex/latex/exsol/exsol.sty
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/exsol/README
trunk/Master/texmf-dist/doc/latex/exsol/example-formulacollection.pdf
trunk/Master/texmf-dist/doc/latex/exsol/example-local.pdf
trunk/Master/texmf-dist/doc/latex/exsol/example-solutionbook.pdf
trunk/Master/texmf-dist/doc/latex/exsol/example.pdf
Added: trunk/Master/texmf-dist/doc/latex/exsol/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/exsol/README (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/exsol/README 2016-06-11 23:15:38 UTC (rev 41377)
@@ -0,0 +1,44 @@
+************************************************************
+* *
+* The exsol package *
+* *
+************************************************************
+ Walter Daems
+ walter.daems(at)uantwerpen.be
+
+The package \exsol{} provides macros to allow
+embedding exercises and solutions in the LaTeX source of an
+instructional text (e.g., a book or a course text) while generating
+the following separate documents:
+ - your original text that only contains the exercises, and
+ - a solution book that only contains the solutions to the
+ exercises (a package option exists to also copy the exercises
+ themselves to the solution book).
+
+The former is generated when running LaTeX on your document. This
+run writes the solutions to a secondary file that can be included
+into a simple document harness, such that when running LaTeX on
+the latter, you can generate a nice solution book.
+
+The code of the exsol package was taken almost literally from
+fancyvrb [http://www.ctan.org/pkg/fancyvrb].
+Therefore, all credits go to the authors/maintainers of fancyvrb.
+
+If you think
+ - there's an error in this package,
+ - there's a feature missing in this package,
+please, don't hesitate to contact the author through e-mail
+(walter.daems at uantwerpen.be).
+
+Do you like this class file? You're welcome to send beer, wine, or
+just kind words.
+
+License
+=======
+
+ see file LICENSE
+
+History
+=======
+
+ see documentation (exsol.pdf)
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/doc/latex/exsol/README
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/exsol/example-formulacollection.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/exsol/example-formulacollection.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/exsol/example-formulacollection.pdf 2016-06-11 23:15:05 UTC (rev 41376)
+++ trunk/Master/texmf-dist/doc/latex/exsol/example-formulacollection.pdf 2016-06-11 23:15:38 UTC (rev 41377)
Property changes on: trunk/Master/texmf-dist/doc/latex/exsol/example-formulacollection.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/exsol/example-local.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/exsol/example-local.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/exsol/example-local.pdf 2016-06-11 23:15:05 UTC (rev 41376)
+++ trunk/Master/texmf-dist/doc/latex/exsol/example-local.pdf 2016-06-11 23:15:38 UTC (rev 41377)
Property changes on: trunk/Master/texmf-dist/doc/latex/exsol/example-local.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/exsol/example-solutionbook.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/exsol/example-solutionbook.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/exsol/example-solutionbook.pdf 2016-06-11 23:15:05 UTC (rev 41376)
+++ trunk/Master/texmf-dist/doc/latex/exsol/example-solutionbook.pdf 2016-06-11 23:15:38 UTC (rev 41377)
Property changes on: trunk/Master/texmf-dist/doc/latex/exsol/example-solutionbook.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/exsol/example.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/exsol/example.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/exsol/example.pdf 2016-06-11 23:15:05 UTC (rev 41376)
+++ trunk/Master/texmf-dist/doc/latex/exsol/example.pdf 2016-06-11 23:15:38 UTC (rev 41377)
Property changes on: trunk/Master/texmf-dist/doc/latex/exsol/example.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/exsol/exsol.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/exsol/exsol.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/exsol/exsol.dtx 2016-06-11 23:15:05 UTC (rev 41376)
+++ trunk/Master/texmf-dist/source/latex/exsol/exsol.dtx 2016-06-11 23:15:38 UTC (rev 41377)
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2014 by Walter Daems <walter.daems at uantwerpen.be>
+% Copyright (C) 2016 by Walter Daems <walter.daems at 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
@@ -21,7 +21,8 @@
% - exsol.sty
% - example.tex
% - example-solutionbook.tex
-%
+% - example-formulacollection.tex
+% - example-local.tex
% \fi
%
% \iffalse
@@ -29,9 +30,9 @@
%<package|driver>\NeedsTeXFormat{LaTeX2e}
%<driver>\ProvidesFile{exsol.dtx}
%<package>\ProvidesPackage{exsol}
-%<package|driver> [2014/08/31 v0.91 ExSol - Exercises and Solutions package (DMW)]
+%<package|driver> [2016/05/13 v1.2 ExSol - Exercises and Solutions package (DMW)]
%<*driver>
-\documentclass[11pt]{ltxdoc}
+\documentclass[10pt,a4paper]{ltxdoc}
\usepackage[english]{babel}
\usepackage[exercisesfontsize=small]{exsol}
\usepackage{metalogo}
@@ -45,10 +46,10 @@
\EnableCrossrefs
\CodelineIndex
\RecordChanges
-\newcommand{\exsol}{\textsf{ExSol}}
+\newcommand{\exsol}{\textsc{ExSol}}
\StopEventually{\PrintChanges\PrintIndex}
-\def\fileversion{0.91}
-\def\filedate{2014/08/31}
+\def\fileversion{1.2}
+\def\filedate{2016/05/05}
\begin{document}
\DocInput{exsol.dtx}
\end{document}
@@ -74,22 +75,28 @@
% Right brace \} Tilde \~}
%
%
-% \changes{v0.1}{2012/01/05}{. Initial version}
-% \changes{v0.2}{2012/01/06}{. Minor bug fixes based on first use by
+% \changes{v0.1}{2012/01/05}{\@ Initial version}
+% \changes{v0.2}{2012/01/06}{\@ Minor bug fixes based on first use by
% Paul Levrie}
-% \changes{v0.3}{2012/01/07}{. Minor bug fixes based on second use by
+% \changes{v0.3}{2012/01/07}{\@ Minor bug fixes based on second use by
% Paul}
-% \changes{v0.4}{2012/01/09}{. Allowed for non-list formatting of
+% \changes{v0.4}{2012/01/09}{\@ Allowed for non-list formatting of
% exercises (as default)}
-% \changes{v0.5}{2012/01/15}{. Added option to also send exercises to
+% \changes{v0.5}{2012/01/15}{\@ Added option to also send exercises to
% solutions file}
-% \changes{v0.6}{2013/05/12}{. Prepared for CTAN publication}
-% \changes{v0.7}{2014/07/14}{. Fixed UTF8 compatibility issues}
-% \changes{v0.8}{2014/07/15}{. Fixed missing babel tag and running out
-% of write hanles}
-% \changes{v0.9}{2014/07/28}{. Changed default behavior
-% w.r.t. minipage-wraping of exercises}
-% \changes{v0.91}{2014/08/31}{. Corrected minipage dependence, made }
+% \changes{v0.6}{2013/05/12}{\@ Prepared for CTAN publication}
+% \changes{v0.7}{2014/07/14}{\@ Fixed UTF8 compatibility issues}
+% \changes{v0.8}{2014/07/15}{\@ Fixed missing babel tag and running out
+% of write handles}
+% \changes{v0.9}{2014/07/28}{\@ Changed default behavior
+% w.r.t. minipage-wrapping of exercises}
+% \changes{v0.91}{2014/08/31}{\@ Corrected minipage dependence, made }
+% \changes{v1.0}{2015/09/16}{\@ First stable release}
+% \changes{v1.1}{2015/12/30}{\@ Bugfix release}
+% \changes{v1.2}{2016/05/05}{\@ Implemented multicolumn option for
+% exercises, introduced new options (local, nolabels), separate
+% counter for exerciseseries (only for use local mode), introduced
+% local mode}
%
% \DoNotIndex{\newcommand,\newenvironment}
% \setlength{\parindent}{0em}
@@ -104,46 +111,69 @@
%
% \section{Introduction}
% %%%%%%%%%%%%%%%%%%%%%%
+%
+% \subsection{Package goal}
% The package \exsol{} provides macros to allow
% embedding exercises and solutions in the \LaTeX{} source of an
-% instructional text (e.g., a book or a course text) while generating
+% instructional text (e.g., a book or a course text) while keeping the
+% exercises and the solutions apart in the typeset result.
+%
+% In \emph{global mode} (the default), this corresponds to generating
% the following separate documents:
% \begin{itemize}
% \item your original text that only contains the exercises, and
% \item a solution book that only contains the solutions to the
-% exercises (a package option exists to also copy the exercises themselves to the solution book).
+% exercises (a package option exists to also copy the exercises
+% themselves to the solution book).
% \end{itemize}
-%
% The former is generated when running \LaTeX{} on your document. This
% run writes the solutions to a secondary file that can be included
% into a simple document harness, such that when running \LaTeX{} on
% the latter, you can generate a nice solution book.
+%
+% In \emph{local mode} (invoked by specifying the package option 'local'),
+% this corresponds to reading in the saved solutions in the current
+% document at a later stage in the text.
%
-% Why use \exsol{}?
+% \subsection{Why use \exsol{}?}
% \begin{itemize}
% \item It allows to keep the \LaTeX{} source of your exercises and their
-% solutions in a single file. Away with the nightmare to keep your
-% solutions in sync with the original text.
+% solutions together in a single file, next to each other. Away with
+% the nightmare to keep your solutions in sync with the exercises.
% \item It separates exercises and solutions, allowing you
% \begin{itemize}
% \item to only release the solution book to the instructors of the
-% course;
-% \item to encourage students that you provide with the solution
-% book to first try solving the exercises without opening the book;
-% this seems to be easier than not peeking into the solution of an
-% exercise that is typeset just below the exercise itself.
+% course (using global mode);
+% \item to encourage students that you provide with the solutions
+% separated from the exercises to first try solving the exercises
+% without peeking into the list of solutions (or the solution book).
% \end{itemize}
% \end{itemize}
-%
+%
+% \subsection{Credits}
% The code of the \exsol{} package was taken almost literally
-% from \textsf{fancyvrb} \cite{fancyvrb}. Therefore, all credits go to the
-% authors/maintainers of \textsf{fancyvrb}.
+% from \textsf{fancyvrb} \cite{fancyvrb}. Therefore, all credits go to
+% the authors/maintainers of \textsf{fancyvrb}.
%
-% Thanks to Pieter Pareit and Pekka Pere for signaling problems and
-% making suggestions for the documentation.
+% Thanks to Paul Levrie, Pieter Pareit, Pekka Pere, Benjamin
+% Grinstein and Philippe Marti for signaling problems and making
+% suggestions for the improvement of the package and the
+% documentation.
%
+% \subsection{Note}
+% As of version 1.2, the package also contains facilities for
+% generating a formula collection. The only limitation is that
+% exercises and solutions cannot be part of the formula collection.
+% Though this is a restriction, it is not a severe one in my
+% opinion. Formula collections should be as concise as they can be.
+%
+% Though generating formula collections goes beyond exercises and
+% solutions, I chose not to change the package's name
+% \exsol{}. Einstein's name was also not changed into Relativistic
+% Einstein when he got to understand the theory of relativity.
+%
% \section{Installation}
-% %%%%%%%%%%%%%%%%%%%%%%
+% %%%%%%%%%%%%%%%%%%%%%%%%
% Either you are a package manager and then you'll know how to
% prepare an installation package for \exsol{}.
%
@@ -150,196 +180,431 @@
% Either you are a normal user and then you have two options. First,
% check if there is a package that your favorite \LaTeX{}
% distributor has prepared for you. Second, grab the TDS package
-% from CTAN \cite{CTAN} (\texttt{exsol.tds.zip}) and unzip it somewhere in your
-% own TDS tree, regenerate your filename database and off you go.
-% In any case, make sure that \LaTeX{} finds the \texttt{exsol.sty} file.
+% from CTAN \cite{CTAN} (|exsol.tds.zip|) and unzip it
+% somewhere in your own TDS tree, regenerate your filename database
+% and off you go.
+% In any case, make sure that \LaTeX{} finds the |exsol.sty|
+% file.
%
-% The \exsol{} package uses some auxiliary packages: \textsf{fancyvrb},
+% The \exsol{} package uses some auxiliary packages:
+% \textsf{fancyvrb},
% \textsf{ifthen}, \textsf{kvoptions} and, optionally,
% \textsf{babel}. Fetch them from CTAN \cite{CTAN} if your \TeX{}
% distributor does not provide them.
%
% \section{Usage}
-% %%%%%%%%%%%%%%%
+% %%%%%%%%%%%%%%%%%
%
% \subsection{Preparing your document source}
-% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \subsubsection{Loading the package}
% The macro package exsol can be loaded with:
% \begin{verbatim}
% \usepackage{exsol}
% \end{verbatim}
%
-% Then, you are ready to add some exercises including their solution
-% to your document source. To this end, embed them in a
-% \texttt{exercise} and a corresponding \texttt{solution} environment.
-% Optionally, you may embed several of them in a \texttt{exercises}
-% environment, to make them stand out in your text.
-% E.g.,
+% 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,
+% gathering the solutions in a separate book.
+% To this end, don't specify the package option '|[local]|', or
+% specify '|[local=false]|'.
%
-% \begin{VerbatimOut}{exsol.tmp}
-%
-% \begin{exercises}
+% A second mode of operation is 'local mode'. This allows grouping
+% your exercises in series and including them later in your text.
+% 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.).
%
+% \subsubsection{Global mode - flat grouping exercises}
+% Adding exercises together with their solutions in your document is
+% easy. Just embed them in a
+% |exercise| and a corresponding |solution| environment.
+% Optionally, you may embed several of them in a |exercises|
+% environment to make them stand out in your text.
+%
+% \begin{verbatim}
+% \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}
+% Calculate $y = 5 + 7$
+% \end{exercises}
% \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.
+% $y = 12$
% \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}
+% Calculate $y = 7 - 12$
+% \end{exercises}
% \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$.
+% $y = -5$
% \end{solution}
%
% \end{exercises}
-% \end{VerbatimOut}
-% \VerbatimInput[frame=lines,gobble=2,fontsize=\footnotesize]{exsol.tmp}
+% \end{verbatim}
+%
+% The optional argument of the exercises environment allows specifying
+% the typesetting in multiple columns.
%
-% The result in the original document, can be seen below. As you can
-% see, there's no trace of the solution.
+% On how to generate a solution book, take a look at the examples in
+% section~\ref{examplesglobal}.
%
-% \input{exsol.tmp}
+% \subsubsection{Local mode - grouping of exercises in series}
+% One might also consider to keep the solutions in the same text, in
+% local mode. In this case, we advise to gather the exercises in
+% 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.
+% In addition it takes two optional arguments:
+% \begin{itemize}
+% \item |columns| to specify the amount of clumns
+% \item |exsubrule| to specify the creation of a horizontal rule below
+% the exercise series.
+% \item |solsubrule| to specify the creation of a horizontal rule below
+% the solution series.
+% \item |subrule| to specify the creation of a horizontal rule below
+% the exercise and the solution series.
+% \end{itemize}
+%
+%
+% \begin{verbatim}
+% \begin{exerciseseries}[columns=2,subrule=\hrule]{Easy exercises}
%
-% When running \LaTeX{} on your document (in our case on the
-% \texttt{exsol.dtx} file, as a side effect a file with extension
-% \texttt{.sol.tex} has been written to disk (in our case, the file
-% \texttt{exsol.sol.tex}), containing all solutions in sequence.
+% \begin{exercise}
+% Calculate $y = 5 + 7$
+% \end{exercises}
+% \begin{solution}
+% $y = 12$
+% \end{solution}
%
-% Generating a solution book is a simple as including the file into a
-% simple \LaTeX{} harness, that allows you giving it a proper title page and to
-% add other bells and whistles.
+% \begin{exercise}
+% Calculate $y = 7 - 12$
+% \end{exercises}
+% \begin{solution}
+% $y = -5$
+% \end{solution}
%
-% E.g.,
-% \begin{VerbatimOut}{exsol-solutionbook.tex}
-% \documentclass{article}
-% \usepackage[english]{babel}
-% \title{Solutions to the exercises, specified in the \textsf{ExSol} package}
-% \author{Walter Daems}
-% \date{2013/05/12}
+% \end{exerciseseries}
%
-% \begin{document}
+% \begin{exerciseseries}{Difficult exercises}
%
-% \maketitle
+% \begin{exercise}
+% Calculate $y = 5 \cdot 7$
+% \end{exercises}
+% \begin{solution}
+% $y = 35$
+% \end{solution}
%
-% \input{exsol.sol}
+% \begin{exercise}
+% Calculate $y = 8 / 4$
+% \end{exercises}
+% \begin{solution}
+% $y = 2$
+% \end{solution}
%
-% \end{document}
-% \end{VerbatimOut}
-% \VerbatimInput[frame=lines,gobble=2,fontsize=\footnotesize]{exsol-solutionbook.tex}
+% \end{exerciseseries}
+% \end{verbatim}
+%
+%
+%
+% \subsection{Examples}
+%
+% \subsubsection{Global mode}
+% \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.
+%
+% \begin{Verbatim}[fontsize=\footnotesize]
+%<*example>
+\documentclass[a4paper,10pt]{article}
+
+\usepackage{a4wide}
+\usepackage[english]{babel}
+\usepackage[copyexercisesinsolutions]{exsol}
+
+\title{Gobal example, from the \textsf{ExSol} package}
+\author{Walter Daems}
+\setlength{\parindent}{0em}
+\begin{document}
+\maketitle
+
+\section{Introduction}
+
+In this text we explain how to wolve 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}
+
+\end{document}
+%</example>
+%\end{Verbatim}
+%
+% The result in the original document, can be seen in the file
+% |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:
%
-% You may generate this solution book, by running \LaTeX{} on the
-% file named \texttt{exsol-solutionbook.tex} that is generated when running
-% \LaTeX{} on the \texttt{exsol.dtx} file.
+% \begin{Verbatim}[fontsize=\footnotesize]
+%<*examplesol>
+\documentclass[a4paper,10pt]{article}
+
+\usepackage{a4wide}
+\usepackage[english]{babel}
+\usepackage{exsol}
+
+\setlength{\parindent}{0em}
+
+\title{Solutions to the exercises, specified in the example of the
+ \textsf{ExSol} package}
+\author{Walter Daems}
+
+\begin{document}
+
+\maketitle
+
+\input{example.sol.tex}
+
+\end{document}
+%</examplesol>
+% \end{Verbatim}
%
-% The result approximately looks like this:
+% 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:
+%
+% \begin{Verbatim}[fontsize=\footnotesize]
+%<*examplefor>
+\documentclass[a4paper,10pt]{article}
+
+\usepackage{a4wide}
+\usepackage[english]{babel}
+\usepackage{exsol}
+
+\setlength{\parindent}{0em}
+
+\title{Formula collection, specified in the example of the
+ \textsf{ExSol} package}
+\author{Walter Daems}
+
+\begin{document}
+
+\maketitle
+
+\input{example.fc.tex}
+
+\end{document}
+%</examplefor>
+% \end{Verbatim}
%
-% \setcounter{equation}{0}
-% \rule{\linewidth}{.7pt}
-% \begin{center}
-% {\Large Solutions to the exercises, specified in the \textsf{ExSol} package}\\
-% {\large Walter Daems}\\
-% {\large 2013/05/12}
-% \end{center}
-% \par---\newline\textbf{Solution 3.1-1}
-% 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.
-% \par---\newline\textbf{Solution 3.1-2}
-% 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$.
+% \subsubsection{Local mode}
%
-% \rule{\linewidth}{.7pt}
+% Below, you can find an example of a file that contains a number of
+% exercises and solutions, with the goal to include them later in the
+% same document.
+% This is done by issuing the |loadSolutions| macro at the very end of
+% the file. This macro can be called multiple times and will gobble up
+% and include all solutions so far. As a consequence the solutions
+% file is emptied and can be filled again by specifying new
+% exercise/solution pairs.
%
+%
+% \begin{Verbatim}[fontsize=\footnotesize]
+%<*example-local>
+\documentclass[a4paper,10pt]{article}
+
+\usepackage{a4wide}
+\usepackage[german]{babel}
+\usepackage[local,nolabels,exerciseaslist]{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 example, from the \textsf{ExSol} package}
+\author{Philippe Marti}
+\setlength{\parindent}{0em}
+\begin{document}
+\maketitle
+
+\section{\exercisesname}
+
+\begin{exerciseseries}[columns=2,solsubrule=\hrule]{Gleichungen $|$ 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}
+
+\begin{exerciseseries}[columns=2]{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}
+
+\section{\solutionsname}
+\loadSolutions
+
+\end{document}
+%</example-local>
+% \end{Verbatim}
+%
% \subsection{Fiddling with the spacing}
%
% The default spacing provided by the \textsf{ExSol} package should be
% fine for most users. However, if you like to tweak, below you can
% find the controls.
+%
+% As the formula collection generation is intended to interfere as
+% little as possible with the flow of the main document, you will
+% notice that it is impossible to control the extra spacing, as no
+% extra spacing should originate from using the
+% |informulacollection| environment.
+%
% \subsubsection{Spacing before and after the \texttt{exercises} environment}
%
% The lengths below control the spacing of the |exercises| environment:
@@ -403,8 +668,8 @@
% \subsection{Tips and tricks}
%
% If you want to include the solutions all at the
-% end of the current document, you need to explicitly close the
-% solution stream before including it:
+% end of the current document in global mode, you need to explicitly
+% close the solution stream before including it:
% \begin{verbatim}
% \closeout\solutionstream\input{\jobname.sol.tex}
% \end{verbatim}
@@ -425,9 +690,11 @@
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The package uses some auxiliary packages:
% \begin{macrocode}
+\RequirePackage{ifmtarg}
\RequirePackage{fancyvrb}
\RequirePackage{ifthen}
\RequirePackage{kvoptions}
+\RequirePackage{multicol}
% \end{macrocode}
%
% \subsection{Package options}
@@ -434,14 +701,36 @@
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The package offers some options:
%
+% \changes{v1.2}{2016/05/05}{Added option local}
+% \begin{macro}{local}
+% This boolean option (true, false) allows setting the mode of the
+% package into local, i.e. that the numbering of the exercises is not
+% related to the position in the document, but uses it's own local
+% counter in combination with a exerciseseries counter.
+% \begin{macrocode}
+\DeclareBoolOption[false]{local}
+% \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'
+% and 'Solution' label that normally appear before the exercise and
+% solution number.
+% \begin{macrocode}
+\DeclareBoolOption[false]{nolabels}
+% \end{macrocode}
+% \end{macro}
+%
% \changes{v0.2}{2012/01/06}{Added option exercisesfont}
-% \changes{v0.4}{2012/01/09}{Changed name of option to exercisesfontsize}
+% \changes{v0.4}{2012/01/09}{Changed name of option to
+% exercisesfontsize}
%
% \begin{macro}{exercisesfontsize}
-% This option allows setting the font of the \texttt{exercises}
+% This option allows setting the font of the |exercises|
% environment. You may chopse one of tiny, scriptsize, footnotesize,
% small, normalsize, large, etc.\\
-% E.g., \texttt{[exercisesfontsize=small]}.
+% E.g., |[exercisesfontsize=small]|.
% \begin{macrocode}
\DeclareStringOption[normalsize]{exercisesfontsize}
% \end{macrocode}
@@ -452,7 +741,7 @@
%
% \begin{macro}{exerciseaslist}
% This boolean option (true, false) allows setting the typesetting of
-% the \texttt{exercises} in a list environment. This causes the
+% the |exercises| in a list environment. This causes the
% exercises to be typeset in a more compact fashion, with indented
% left and right margin.
% \begin{macrocode}
@@ -501,9 +790,9 @@
% First some lengths to control the spacing before and after |exercises|.
% \begin{macrocode}
\newlength{\exsolexercisesaboveskip}
-\setlength{\exsolexercisesaboveskip}{1ex plus 1pt minus 1pt}
+\setlength{\exsolexercisesaboveskip}{0ex plus 1pt minus 1pt}
\newlength{\exsolexercisesbelowskip}
-\setlength{\exsolexercisesbelowskip}{1ex plus 1pt minus 1pt}
+\setlength{\exsolexercisesbelowskip}{0ex plus 1pt minus 1pt}
% \end{macrocode}
%
% Then some lengths to control the spacing for a single
@@ -538,17 +827,51 @@
% spot to avoid consuming all handles}
% \begin{macrocode}
\AtBeginDocument{
+ \typeout{Writing solutions to solution file \jobname.sol.tex}
\newwrite\solutionstream
\immediate\openout\solutionstream=\jobname.sol.tex
+ \typeout{Using intermediate exercise file \jobname.exc.tex}
\newwrite\exercisestream
+ \typeout{Writing formulae to formula collection file \jobname.fc.tex}
+ \newwrite\formulacollectionstream
+ \immediate\openout\formulacollectionstream=\jobname.fc.tex
+ \typeout{Using intermediate formula file \jobname.for.tex}
+ \newwrite\formulastream
}
\AtEndDocument{
+ \immediate\closeout\formulacollectionstream
\immediate\closeout\solutionstream
}
% \end{macrocode}
%
-% \subsection{Exercises counter}
+%
+% In local mode we also want to close the solutionstream, read it and
+% open it again:
+% \begin{macrocode}
+\newcommand\loadSolutions{
+ \immediate\closeout\solutionstream
+ \input{\jobname.sol.tex}
+% \immediate\openout\solutionstream=\jobname.sol.tex
+}
+% \end{macrocode}
+%
+% \subsection{Series counter}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% By providing an exerciseseries counter, proper numbering of the
+% exercise series is provided. Note that separate series, render the
+% numbering of the exercises from document-global, to series-local,
+% therefore hindering the concordance of solutions to exercises.
+%
+% \changes{v1.2}{2016/05/05}{Added series counter}
+% \begin{macrocode}
+\newcounter{exerciseseries}[subsubsection]
+\setcounter{exerciseseries}{0}
+\renewcommand{\theexerciseseries}{\arabic{exerciseseries}}
+% \end{macrocode}
+%
+%
+% \subsection{Exercise counter}
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% By providing an exercise counter, proper numbering of the exercises
% is provided to allow for good cross referencing of the solutions to
% the exercises.
@@ -555,24 +878,27 @@
% \changes{v0.2}{2012/01/06}{Removed dash in counter when in document
% without sectioning commands}
% \begin{macrocode}
-\newcounter{exercise}[subsection]
+\newcounter{exercise}[exerciseseries]
\setcounter{exercise}{0}
\renewcommand{\theexercise}{%
+ \ifexsol at local
+ \arabic{exerciseseries}.\arabic{exercise}%
+ \else
\@ifundefined{c at chapter}{}{\if0\arabic{chapter}\else\arabic{chapter}.\fi}%
\if0\arabic{section}\else\arabic{section}\fi%
\if0\arabic{subsection}\else.\arabic{subsection}\fi%
\if0\arabic{subsubsection}\else.\arabic{subsubsection}\fi%
\if0\arabic{exercise}\else%
- \@ifundefined{c at chapter}%
- {\if0\arabic{section}\else-\fi}%
- {-}%
- \arabic{exercise}%
+ \@ifundefined{c at chapter}%
+ {\if0\arabic{section}\else-\fi}%
+ {-}%
+ \arabic{exercise}%
\fi
+ \fi
}
% \end{macrocode}
%
%
-%
% \subsection{Detokenization in order to cope with utf8}
%
% Combining old-school \LaTeX{} (before \XeTeX{} and \LuaTeX{}) and
@@ -580,6 +906,8 @@
% Detokenization has been suggested by Geoffrey Poore to solve issues
% with UTF-8 characters messing up the |fancyvrb| internals.
% \changes{v0.7}{2014/07/14}{Added detokenized writing}
+% \changes{v1.0}{2014/09/13}{Added detokenized writing of formula and
+% formula collection stream}
% \begin{macrocode}
\newcommand{\GPES at write@detok}[1]{%
\immediate\write\exercisestream{\detokenize{#1}}}%
@@ -588,6 +916,11 @@
\newcommand{\GPESS at write@detok}[1]{%
\GPES at write@detok{#1}%
\GPSS at write@detok{#1}}%
+\newcommand{\GPFORCOL at write@detok}[1]{%
+ \immediate\write\formulacollectionstream{\detokenize{#1}}%
+ \immediate\write\formulastream{\detokenize{#1}}}%
+\newcommand{\GPFORCOLONLY at write@detok}[1]{%
+ \immediate\write\formulacollectionstream{\detokenize{#1}}}%
% \end{macrocode}
%
%
@@ -594,10 +927,10 @@
% \section{The user environments}
%
% \begin{macro}{exercise}
-% The \texttt{exercise} environment is used to typeset your
+% The |exercise| environment is used to typeset your
% exercises, provide them with a nice label and allow for copying
% the exercise to the solutions file (if the package option
-% \texttt{copyexercisesinsolution}) is set. The label can be
+% |copyexercisesinsolution|) is set. The label can be
% set by redefining the \cs{exercisename} macro, or by relying on
% the \textsf{Babel} provisions. The code is almost litteraly
% taken from the \textsf{fancyvrb} package.
@@ -606,14 +939,18 @@
\def\FVB at exercise{%
\refstepcounter{exercise}%
\immediate\openout\exercisestream=\jobname.exc.tex
- \ifexsol at copyexercisesinsolutions
- \typeout{Writing exercise to \jobname.sol.tex}
- \immediate\write\solutionstream{\string\par---\string\newline
- \string\textbf\string{\exercisename{} \theexercise \string}}
+ \ifexsol at local
+% \immediate\write\solutionstream{}
\else
- \immediate\write\solutionstream{\string\par---\string\newline}
+% \immediate\write\solutionstream{\string\vspace*\string{2ex\string}%
+% \string\quad\string\newline}
\fi
- \immediate\write\exercisestream{\string\begin{exsol at exercise}}
+ \ifexsol at copyexercisesinsolutions
+ % WDSC tofix
+ % \typeout{Writing exercise to \jobname.sol.tex}
+ \immediate\write\solutionstream{\string\begin{exsol at exercise}{\theexercise}}
+ \fi
+ \immediate\write\exercisestream{\string\begin{exsol at exercise}{\theexercise}}
\@bsphack
\begingroup
\FV at UseKeyValues
@@ -634,7 +971,7 @@
\endgroup\@esphack
\immediate\write\exercisestream{\string\end{exsol at exercise}}
\ifexsol at copyexercisesinsolutions
- \immediate\write\solutionstream{\string~\string\newline}
+ \immediate\write\solutionstream{\string\end{exsol at exercise}}
\fi
\immediate\closeout\exercisestream
\input{\jobname.exc.tex}
@@ -644,10 +981,10 @@
% \end{macro}
%
% \begin{macro}{exsol at exercise}
-% The \texttt{exsol at exercise} environment is an internal macro used
+% The |exsol at exercise| environment is an internal macro used
% to typeset your exercises and provide them with a nice label and
% number. Do not use it directly. Use the proper environment
-% \texttt{exercise} instead.
+% |exercise| instead.
% \changes{v0.2}{2012/01/06}{Attempted to fix MiKTeX formatting problems}
% \changes{v0.3}{2012/01/08}{Fixed labelsep to avoid cluttered
% itemize environments}
@@ -656,7 +993,7 @@
% \changes{v0.5}{2012/01/09}{Changed implementation to allow for
% copying the exercises to the solutions file.}
% \begin{macrocode}
-\newenvironment{exsol at exercise}[0]
+\newenvironment{exsol at exercise}[1]
{%
\ifthenelse{\boolean{exsol at minipage}}{\begin{minipage}[t]{\textwidth}}{}%
\ifthenelse{\boolean{exsol at exerciseaslist}}
@@ -672,9 +1009,11 @@
\setlength{\parsep}{\exsolexerciseparsep}
\setlength{\labelsep}{\exsolexerciselabelsep}
\setlength{\labelwidth}{\exsolexerciselabelwidth}}
- \item[\textit{~\exercisename{} \theexercise:~}]
+ \item[\ifexsol at nolabels~#1:\else%
+ \subparagraph{\exercisename{}~#1:}\fi]
}%
- {\textit{\exercisename{} \theexercise:}}
+ {\ifexsol at nolabels #1:\else%
+ \subparagraph{\exercisename{}~#1:}\fi}
}
{%
\ifthenelse{\boolean{exsol at exerciseaslist}}%
@@ -686,7 +1025,7 @@
%
%
% \begin{macro}{solution}
-% The \texttt{solution} environment is used to typeset your solutions
+% The |solution| environment is used to typeset your solutions
% and provide them with a nice label and number that corresponds to
% the exercise that preceeded this solution. Theno label can be
% set by redefining the \cs{solutionname} macro, or by relying on
@@ -695,13 +1034,11 @@
% \begin{macrocode}
\def\solution{\FV at Environment{}{solution}}
\def\FVB at solution{%
- \typeout{Writing solution to \jobname.sol.tex}
- \immediate\write\solutionstream{\string\textbf\string{\solutionname{}\string}}
+ %\typeout{Writing solution to \jobname.sol.tex}
\ifexsol at copyexercisesinsolutions
- \immediate\write\solutionstream{\string\newline}
+ \immediate\write\solutionstream{\string\begin{exsol at solution}{}}
\else
- \immediate\write\solutionstream{\string\textbf\string{\theexercise\string}%
- \string\newline}
+ \immediate\write\solutionstream{\string\begin{exsol at solution}{\theexercise}}
\fi
\@bsphack
\begingroup
@@ -715,60 +1052,195 @@
\let\@noligs\relax
\FV at Scan
}
-\def\FVE at solution{\endgroup\@esphack}
+\def\FVE at solution{
+ \endgroup\@esphack
+ \immediate\write\solutionstream{\string\end{exsol at solution}}
+}
\DefineVerbatimEnvironment{solution}{solution}{}
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{exsol at solution}
+% The |exsol at solution| environment is an internal macro used
+% to typeset your solutions. Do not use it directly. Use the proper
+% environment |solution| instead.
+% \changes{v1.2}{2016/05/05}{Added |exsol at solution| environment for
+% improved control on solution typesetting}
+% \begin{macrocode}
+\newenvironment{exsol at solution}[1]
+{%
+ \ifthenelse{\boolean{exsol at minipage}}{\begin{minipage}[t]{\textwidth}}{}%
+ \ifthenelse{\boolean{exsol at exerciseaslist}}
+ {\begin{list}%
+ {%
+ }%
+ {%
+ \setlength{\topsep}{\exsolexercisetopbottomsep}%
+ \setlength{\leftmargin}{\exsolexerciseleftmargin}%
+ \setlength{\rightmargin}{\exsolexerciserightmargin}%
+ \setlength{\listparindent}{\exsolexerciseparindent}%
+ \setlength{\itemindent}{\exsolexerciseitemindent}%
+ \setlength{\parsep}{\exsolexerciseparsep}
+ \setlength{\labelsep}{\exsolexerciselabelsep}
+ \setlength{\labelwidth}{\exsolexerciselabelwidth}}
+ \item[\ifexsol at nolabels #1:\else%
+ \subparagraph{\solutionname{}\@ifmtarg{#1}{}{~}#1:}\fi]
+ }%
+ {\ifexsol at nolabels #1:\else%
+ \subparagraph{\solutionname{}\@ifmtarg{#1}{}{~}#1:}\fi}
+ }
+ {%
+ \ifthenelse{\boolean{exsol at exerciseaslist}}%
+ {\end{list}}{}%
+ \ifthenelse{\boolean{exsol at minipage}}{\end{minipage}}{\par}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
% \begin{macro}{exercises}
-% The \texttt{exercises} environment helps typesetting your exercises to
+% The |exercises| environment helps typesetting your exercises to
% stand out from the rest of the text. You may use it at the end of
% a chapter, or just to group some exercises in the text.
% \changes{v0.2}{2012/01/06}{Attempted to fix MiKTeX formatting problems}
-% \changes{v0.3}{2012/01/07}{Added some extra whitespace below exercisesname}
+% \changes{v0.3}{2012/01/07}{Added some extra whitespace below
+% exercisesname}
+% \changes{v1.2}{2016/05/05}{Added multicolumn feature}
% \begin{macrocode}
-\newenvironment{exercises}
-{\par\exercisesfontsize\rule{.25\linewidth}{0.15mm}\vspace*{\exsolexercisesaboveskip}\\*%
- \textbf{\normalsize \exercisesname}}
-{\vspace*{-\baselineskip}\vspace*{\exsolexercisesbelowskip}\rule{.25\linewidth}{0.15mm}\par}
+\define at key{exercises}{columns}{\renewcommand\columncount{#1}}
+\define at key{exercises}{exsubrule}{\renewcommand\exsubrule{#1}}
+\define at key{exercises}{solsubrule}{\renewcommand\solsubrule{#1}}
+\define at key{exercises}{subrule}{\renewcommand\exsubrule{#1}\renewcommand\solsubrule{#1}}
+\newenvironment{exercises}[1][]
+{
+ \newcommand\columncount{1} % default
+ \newcommand\exsubrule{} % default
+ \newcommand\solsubrule{} % default
+ \setkeys{exercises}{#1}
+ \par\exercisesfontsize\rule{.25\linewidth}{0.15mm}%
+ \vspace*{\exsolexercisesaboveskip}%
+ \paragraph{\exercisesname}~\par
+ \ifthenelse{\columncount > 1}{\begin{multicols}{\columncount}}{}
+ }
+ {
+ \ifthenelse{\columncount > 1}{\end{multicols}}{}\relax
+ \vspace*{-\baselineskip}\vspace*{\exsolexercisesbelowskip}%
+ %\rule{.25\linewidth}{0.15mm}
+ \exsubrule\par}
% \end{macrocode}
% \end{macro}
-%
-% \subsection{Some Babel provisions}
-% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% \changes{v0.2}{2012/01/06}{Fixed babel errors}
-% \begin{macro}{\exercisename}
-% The exercise environment makes use of a label \texttt{\exercisename{}}
-% macro.
+%
+% \changes{v1.2}{2016/05/05}{Added exerciseseries environment}
+% \begin{macro}{exerciseseries}
+% The |exerciseseries| environment helps typesetting your
+% exercises in series.
% \begin{macrocode}
-\newcommand{\exercisename}{Exercise}
+\define at key{exerciseseries}{columns}{\renewcommand\columncount{#1}}
+\define at key{exerciseseries}{exsubrule}{\renewcommand\exsubrule{#1}}
+\define at key{exerciseseries}{solsubrule}{\renewcommand\solsubrule{#1}}
+\define at key{exerciseseries}{subrule}{\renewcommand\exsubrule{#1}\renewcommand\solsubrule{#1}}
+\newenvironment{exerciseseries}[2][]
+{
+ \refstepcounter{exerciseseries}%
+ \newcommand\columncount{1} % default
+ \newcommand\exsubrule{} % default
+ \newcommand\solsubrule{} % default
+ \setkeys{exerciseseries}{#1}
+ \paragraph{\seriesname~\theexerciseseries:~#2}~\par
+ \ifthenelse{\columncount > 1}{\begin{multicols}{\columncount}}{}
+ \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
+ \immediate\write\solutionstream{\string\end\string{solutionseries\string}}
+}
+\newenvironment{solutionseries}[3][]
+{
+ \newcommand\columncount{1} % default
+ \newcommand\exsubrule{} % default
+ \newcommand\solsubrule{} % default
+ \setkeys{exercises}{#1}
+ \paragraph{\seriesname~#3}~\par
+ \ifthenelse{\columncount > 1}{\begin{multicols}{\columncount}}{}
+ }
+ {
+ \ifthenelse{\columncount > 1}{\end{multicols}}{}
+ \solsubrule\par
+}
% \end{macrocode}
% \end{macro}
-%
-% \begin{macro}{\exercisesname}
-% The exercises environment makes use of a label \texttt{\exercisesname{}}
-% macro.
+%
+% \begin{macro}{informulacollection}
+% The |informulacollection| environment is used to write its
+% contents to the formula collection stream and load back into the
+% main text for typesetting. The code is almost litteraly
+% taken from the \textsf{fancyvrb} package.
% \begin{macrocode}
-\newcommand{\exercisesname}{Exercises}
+\def\informulacollection{\FV at Environment{}{informulacollection}}
+\def\FVB at informulacollection{%
+ \immediate\openout\formulastream=\jobname.for.tex
+ %\typeout{Writing formula to \jobname.for.tex and \jobname.fc.tex}
+ \@bsphack
+ \begingroup
+ \FV at UseKeyValues
+ \FV at DefineWhiteSpace
+ \def\FV at Space{\space}%
+ \FV at DefineTabOut
+ \let\FV at ProcessLine\GPFORCOL at write@detok %
+ \relax
+ \let\FV at FontScanPrep\relax
+ \let\@noligs\relax
+ \FV at Scan
+ }
+\def\FVE at informulacollection{
+ \endgroup\@esphack
+ \immediate\closeout\formulastream
+ \input{\jobname.for.tex}
+}
+\DefineVerbatimEnvironment{informulacollection}{informulacollection}{}
% \end{macrocode}
% \end{macro}
-%
-% \begin{macro}{\solutionname}
-% The solution environment makes use of a label \texttt{\solutionname{}}
-% macro.
+%
+% \begin{macro}{informulacollectiononly}
+% The |informulacollectiononly| environment is used to write its
+% contents to the formula collection stream \emph{without} loading
+% it back into the main text for typesetting. The code is almost litteraly
+% taken from the \textsf{fancyvrb} package.
% \begin{macrocode}
-\newcommand{\solutionname}{Solution}
+\def\informulacollectiononly{\FV at Environment{}{informulacollectiononly}}
+\def\FVB at informulacollectiononly{%
+ %\typeout{Writing special to \jobname.fc.tex}
+ \@bsphack
+ \begingroup
+ \FV at UseKeyValues
+ \FV at DefineWhiteSpace
+ \def\FV at Space{\space}%
+ \FV at DefineTabOut
+ \let\FV at ProcessLine\GPFORCOLONLY at write@detok %
+ \relax
+ \let\FV at FontScanPrep\relax
+ \let\@noligs\relax
+ \FV at Scan
+ }
+\def\FVE at informulacollectiononly{
+ \endgroup\@esphack
+}
+\DefineVerbatimEnvironment{informulacollectiononly}{informulacollectiononly}{}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\solutionname}
-% The solution environment makes use of a label \texttt{\solutionname{}}
-% macro.
-% \changes{v0.8}{2014/07/15}{Added missing babel tag}
+% \subsection{Some Babel provisions}
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \changes{v0.2}{2012/01/06}{Fixed babel errors}
% \begin{macrocode}
+\newcommand{\exercisename}{Exercise}
+\newcommand{\exercisesname}{Exercises}
+\newcommand{\solutionname}{Solution}
\newcommand{\solutionsname}{Solutions}
+\newcommand{\seriesname}{Series}
% \end{macrocode}
-% \end{macro}
%
%
% You may redefine these macros, but to help you out a little bit, we
@@ -777,6 +1249,9 @@
% languages, I'm very willing to incorporate them into the code.
%
% \changes{v0.7}{2014/07/14}{Added Finnish language support}
+% \changes{v1.2}{2016/05/05}{Added Spanish language support}
+% \changes{v1.2}{2016/05/05}{Completed German language support
+% (i.e. new spelling ngerman) support}
% \begin{macrocode}
\addto\captionsdutch{%
\renewcommand{\exercisename}{Oefening}%
@@ -783,6 +1258,7 @@
\renewcommand{\exercisesname}{Oefeningen}%
\renewcommand{\solutionname}{Oplossing}%
\renewcommand{\solutionsname}{Oplossingen}%
+ \renewcommand{\seriesname}{Reeks}%
}
\addto\captionsgerman{%
\renewcommand{\exercisename}{Aufgabe}%
@@ -789,12 +1265,21 @@
\renewcommand{\exercisesname}{Aufgaben}%
\renewcommand{\solutionname}{L\"osung}%
\renewcommand{\solutionsname}{L\"osungen}%
+ \renewcommand{\seriesname}{Serie}%
}
+\addto\captionsngerman{%
+ \renewcommand{\exercisename}{Aufgabe}%
+ \renewcommand{\exercisesname}{Aufgaben}%
+ \renewcommand{\solutionname}{L\"osung}%
+ \renewcommand{\solutionsname}{L\"osungen}%
+ \renewcommand{\seriesname}{Serie}%
+}
\addto\captionsfrench{%
\renewcommand{\exercisename}{Exercice}%
\renewcommand{\exercisesname}{Exercices}%
\renewcommand{\solutionname}{Solution}%
\renewcommand{\solutionsname}{Solutions}%
+ \renewcommand{\seriesname}{Serie}%
}
\addto\captionsfinnish{
\renewcommand{\exercisename}{Teht\"av\"a}%
@@ -801,7 +1286,15 @@
\renewcommand{\exercisesname}{Teht\"avi\"a}%
\renewcommand{\solutionname}{Ratkaisu}%
\renewcommand{\solutionsname}{Ratkaisut}%
+ \renewcommand{\seriesname}{Sarja}
}
+\addto\captionsspanish{%
+ \renewcommand{\exercisename}{Ejercicio}%
+ \renewcommand{\exercisesname}{Ejercicios}%
+ \renewcommand{\solutionname}{Soluci\'on}%
+ \renewcommand{\solutionsname}{Soluciones}%
+ \renewcommand{\seriesname}{Serie}%
+}
% \end{macrocode}
%
%
@@ -809,11 +1302,19 @@
% Now the final hack overloads the basic sectioning commands to make
% sure that they are copied into your solution book.
%
+% \changes{v1.0}{2015/09/16}{Added congruence of chaptercounter of
+% main document and chapter counter of exercises document}
+% \changes{v1.1}{2015/09/16}{Corrected congruence of chaptercounter of
+% main document and chapter counter of exercises document (taking
+% intou account alphanumbered chapters}
% \begin{macrocode}
+\ifexsol at local
+\else
\let\exsol@@makechapterhead\@makechapterhead
\def\@makechapterhead#1{%
- \immediate\write\solutionstream{\string\chapter{#1}}%
\exsol@@makechapterhead{#1}
+ \immediate\write\solutionstream{\string\setcounter{chapter}{\arabic{chapter}}%
+ \string\chapter{#1}}%
}
\ifdefined\frontmatter
\let\exsol@@frontmatter\frontmatter
@@ -836,6 +1337,14 @@
\exsol@@backmatter
}
\fi
+\ifdefined\appendix
+ \let\exsol@@appendix\appendix
+ \def\appendix{%
+ \immediate\write\solutionstream{\string\appendix}%
+ \exsol@@appendix
+ }
+\fi
+\fi
% \end{macrocode}
%
% \begin{macro}{\noexercisesinchapter}
Modified: trunk/Master/texmf-dist/source/latex/exsol/exsol.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/exsol/exsol.ins 2016-06-11 23:15:05 UTC (rev 41376)
+++ trunk/Master/texmf-dist/source/latex/exsol/exsol.ins 2016-06-11 23:15:38 UTC (rev 41377)
@@ -1,4 +1,4 @@
-%% Copyright (C) 2014 by Walter Daems <walter.daems at ieee.org>
+%% Copyright (C) 2015 by Walter Daems <walter.daems at 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
@@ -27,7 +27,7 @@
This is a generated file.
-Copyright (C) 2014 by Walter Daems <walter.daems at ieee.org>
+Copyright (C) 2015 by Walter Daems <walter.daems at uantwerpen.org>
This file may be distributed and/or modified under the conditions of
the LaTeX Project Public License, either version 1.3 of this license
@@ -43,7 +43,12 @@
\usedir{tex/latex/exsol}
\generate{\file{exsol.sty}{\from{exsol.dtx}{package}}}
+\generate{\file{example.tex}{\from{exsol.dtx}{example}}}
+\generate{\file{example-solutionbook.tex}{\from{exsol.dtx}{examplesol}}}
+\generate{\file{example-formulacollection.tex}{\from{exsol.dtx}{examplefor}}}
+\generate{\file{example-local.tex}{\from{exsol.dtx}{example-local}}}
+
\obeyspaces
\Msg{***************************************************************}
\Msg{* *}
Modified: trunk/Master/texmf-dist/tex/latex/exsol/exsol.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/exsol/exsol.sty 2016-06-11 23:15:05 UTC (rev 41376)
+++ trunk/Master/texmf-dist/tex/latex/exsol/exsol.sty 2016-06-11 23:15:38 UTC (rev 41377)
@@ -8,7 +8,7 @@
%%
%% This is a generated file.
%%
-%% Copyright (C) 2014 by Walter Daems <walter.daems at ieee.org>
+%% Copyright (C) 2015 by Walter Daems <walter.daems at uantwerpen.org>
%%
%% This file may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.3 of this license
@@ -22,10 +22,14 @@
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{exsol}
- [2014/08/31 v0.91 ExSol - Exercises and Solutions package (DMW)]
+ [2016/05/13 v1.2 ExSol - Exercises and Solutions package (DMW)]
+\RequirePackage{ifmtarg}
\RequirePackage{fancyvrb}
\RequirePackage{ifthen}
\RequirePackage{kvoptions}
+\RequirePackage{multicol}
+\DeclareBoolOption[false]{local}
+\DeclareBoolOption[false]{nolabels}
\DeclareStringOption[normalsize]{exercisesfontsize}
\DeclareBoolOption[false]{exerciseaslist}
\DeclareBoolOption[false]{copyexercisesinsolutions}
@@ -33,9 +37,9 @@
\ProcessKeyvalOptions*
\newcommand{\exercisesfontsize}{\csname \exsol at exercisesfontsize\endcsname}
\newlength{\exsolexercisesaboveskip}
-\setlength{\exsolexercisesaboveskip}{1ex plus 1pt minus 1pt}
+\setlength{\exsolexercisesaboveskip}{0ex plus 1pt minus 1pt}
\newlength{\exsolexercisesbelowskip}
-\setlength{\exsolexercisesbelowskip}{1ex plus 1pt minus 1pt}
+\setlength{\exsolexercisesbelowskip}{0ex plus 1pt minus 1pt}
\newlength{\exsolexercisetopbottomsep}
\setlength{\exsolexercisetopbottomsep}{0pt plus 0pt minus 1pt}
\newlength{\exsolexerciseleftmargin}
@@ -53,26 +57,45 @@
\newlength{\exsolexerciseparsep}
\setlength{\exsolexerciseparsep}{\parskip}
\AtBeginDocument{
+ \typeout{Writing solutions to solution file \jobname.sol.tex}
\newwrite\solutionstream
\immediate\openout\solutionstream=\jobname.sol.tex
+ \typeout{Using intermediate exercise file \jobname.exc.tex}
\newwrite\exercisestream
+ \typeout{Writing formulae to formula collection file \jobname.fc.tex}
+ \newwrite\formulacollectionstream
+ \immediate\openout\formulacollectionstream=\jobname.fc.tex
+ \typeout{Using intermediate formula file \jobname.for.tex}
+ \newwrite\formulastream
}
\AtEndDocument{
+ \immediate\closeout\formulacollectionstream
\immediate\closeout\solutionstream
}
-\newcounter{exercise}[subsection]
+\newcommand\loadSolutions{
+ \immediate\closeout\solutionstream
+ \input{\jobname.sol.tex}
+}
+\newcounter{exerciseseries}[subsubsection]
+\setcounter{exerciseseries}{0}
+\renewcommand{\theexerciseseries}{\arabic{exerciseseries}}
+\newcounter{exercise}[exerciseseries]
\setcounter{exercise}{0}
\renewcommand{\theexercise}{%
+ \ifexsol at local
+ \arabic{exerciseseries}.\arabic{exercise}%
+ \else
\@ifundefined{c at chapter}{}{\if0\arabic{chapter}\else\arabic{chapter}.\fi}%
\if0\arabic{section}\else\arabic{section}\fi%
\if0\arabic{subsection}\else.\arabic{subsection}\fi%
\if0\arabic{subsubsection}\else.\arabic{subsubsection}\fi%
\if0\arabic{exercise}\else%
- \@ifundefined{c at chapter}%
- {\if0\arabic{section}\else-\fi}%
- {-}%
- \arabic{exercise}%
+ \@ifundefined{c at chapter}%
+ {\if0\arabic{section}\else-\fi}%
+ {-}%
+ \arabic{exercise}%
\fi
+ \fi
}
\newcommand{\GPES at write@detok}[1]{%
\immediate\write\exercisestream{\detokenize{#1}}}%
@@ -81,18 +104,24 @@
\newcommand{\GPESS at write@detok}[1]{%
\GPES at write@detok{#1}%
\GPSS at write@detok{#1}}%
+\newcommand{\GPFORCOL at write@detok}[1]{%
+ \immediate\write\formulacollectionstream{\detokenize{#1}}%
+ \immediate\write\formulastream{\detokenize{#1}}}%
+\newcommand{\GPFORCOLONLY at write@detok}[1]{%
+ \immediate\write\formulacollectionstream{\detokenize{#1}}}%
\def\exercise{\FV at Environment{}{exercise}}
\def\FVB at exercise{%
\refstepcounter{exercise}%
\immediate\openout\exercisestream=\jobname.exc.tex
- \ifexsol at copyexercisesinsolutions
- \typeout{Writing exercise to \jobname.sol.tex}
- \immediate\write\solutionstream{\string\par---\string\newline
- \string\textbf\string{\exercisename{} \theexercise \string}}
+ \ifexsol at local
\else
- \immediate\write\solutionstream{\string\par---\string\newline}
\fi
- \immediate\write\exercisestream{\string\begin{exsol at exercise}}
+ \ifexsol at copyexercisesinsolutions
+ % WDSC tofix
+ % \typeout{Writing exercise to \jobname.sol.tex}
+ \immediate\write\solutionstream{\string\begin{exsol at exercise}{\theexercise}}
+ \fi
+ \immediate\write\exercisestream{\string\begin{exsol at exercise}{\theexercise}}
\@bsphack
\begingroup
\FV at UseKeyValues
@@ -113,13 +142,13 @@
\endgroup\@esphack
\immediate\write\exercisestream{\string\end{exsol at exercise}}
\ifexsol at copyexercisesinsolutions
- \immediate\write\solutionstream{\string~\string\newline}
+ \immediate\write\solutionstream{\string\end{exsol at exercise}}
\fi
\immediate\closeout\exercisestream
\input{\jobname.exc.tex}
}
\DefineVerbatimEnvironment{exercise}{exercise}{}
-\newenvironment{exsol at exercise}[0]
+\newenvironment{exsol at exercise}[1]
{%
\ifthenelse{\boolean{exsol at minipage}}{\begin{minipage}[t]{\textwidth}}{}%
\ifthenelse{\boolean{exsol at exerciseaslist}}
@@ -135,9 +164,11 @@
\setlength{\parsep}{\exsolexerciseparsep}
\setlength{\labelsep}{\exsolexerciselabelsep}
\setlength{\labelwidth}{\exsolexerciselabelwidth}}
- \item[\textit{~\exercisename{} \theexercise:~}]
+ \item[\ifexsol at nolabels~#1:\else%
+ \subparagraph{\exercisename{}~#1:}\fi]
}%
- {\textit{\exercisename{} \theexercise:}}
+ {\ifexsol at nolabels #1:\else%
+ \subparagraph{\exercisename{}~#1:}\fi}
}
{%
\ifthenelse{\boolean{exsol at exerciseaslist}}%
@@ -146,13 +177,11 @@
}
\def\solution{\FV at Environment{}{solution}}
\def\FVB at solution{%
- \typeout{Writing solution to \jobname.sol.tex}
- \immediate\write\solutionstream{\string\textbf\string{\solutionname{}\string}}
+ %\typeout{Writing solution to \jobname.sol.tex}
\ifexsol at copyexercisesinsolutions
- \immediate\write\solutionstream{\string\newline}
+ \immediate\write\solutionstream{\string\begin{exsol at solution}{}}
\else
- \immediate\write\solutionstream{\string\textbf\string{\theexercise\string}%
- \string\newline}
+ \immediate\write\solutionstream{\string\begin{exsol at solution}{\theexercise}}
\fi
\@bsphack
\begingroup
@@ -166,21 +195,144 @@
\let\@noligs\relax
\FV at Scan
}
-\def\FVE at solution{\endgroup\@esphack}
+\def\FVE at solution{
+ \endgroup\@esphack
+ \immediate\write\solutionstream{\string\end{exsol at solution}}
+}
\DefineVerbatimEnvironment{solution}{solution}{}
-\newenvironment{exercises}
-{\par\exercisesfontsize\rule{.25\linewidth}{0.15mm}\vspace*{\exsolexercisesaboveskip}\\*%
- \textbf{\normalsize \exercisesname}}
-{\vspace*{-\baselineskip}\vspace*{\exsolexercisesbelowskip}\rule{.25\linewidth}{0.15mm}\par}
+\newenvironment{exsol at solution}[1]
+{%
+ \ifthenelse{\boolean{exsol at minipage}}{\begin{minipage}[t]{\textwidth}}{}%
+ \ifthenelse{\boolean{exsol at exerciseaslist}}
+ {\begin{list}%
+ {%
+ }%
+ {%
+ \setlength{\topsep}{\exsolexercisetopbottomsep}%
+ \setlength{\leftmargin}{\exsolexerciseleftmargin}%
+ \setlength{\rightmargin}{\exsolexerciserightmargin}%
+ \setlength{\listparindent}{\exsolexerciseparindent}%
+ \setlength{\itemindent}{\exsolexerciseitemindent}%
+ \setlength{\parsep}{\exsolexerciseparsep}
+ \setlength{\labelsep}{\exsolexerciselabelsep}
+ \setlength{\labelwidth}{\exsolexerciselabelwidth}}
+ \item[\ifexsol at nolabels #1:\else%
+ \subparagraph{\solutionname{}\@ifmtarg{#1}{}{~}#1:}\fi]
+ }%
+ {\ifexsol at nolabels #1:\else%
+ \subparagraph{\solutionname{}\@ifmtarg{#1}{}{~}#1:}\fi}
+ }
+ {%
+ \ifthenelse{\boolean{exsol at exerciseaslist}}%
+ {\end{list}}{}%
+ \ifthenelse{\boolean{exsol at minipage}}{\end{minipage}}{\par}%
+}
+\define at key{exercises}{columns}{\renewcommand\columncount{#1}}
+\define at key{exercises}{exsubrule}{\renewcommand\exsubrule{#1}}
+\define at key{exercises}{solsubrule}{\renewcommand\solsubrule{#1}}
+\define at key{exercises}{subrule}{\renewcommand\exsubrule{#1}\renewcommand\solsubrule{#1}}
+\newenvironment{exercises}[1][]
+{
+ \newcommand\columncount{1} % default
+ \newcommand\exsubrule{} % default
+ \newcommand\solsubrule{} % default
+ \setkeys{exercises}{#1}
+ \par\exercisesfontsize\rule{.25\linewidth}{0.15mm}%
+ \vspace*{\exsolexercisesaboveskip}%
+ \paragraph{\exercisesname}~\par
+ \ifthenelse{\columncount > 1}{\begin{multicols}{\columncount}}{}
+ }
+ {
+ \ifthenelse{\columncount > 1}{\end{multicols}}{}\relax
+ \vspace*{-\baselineskip}\vspace*{\exsolexercisesbelowskip}%
+ %\rule{.25\linewidth}{0.15mm}
+ \exsubrule\par}
+\define at key{exerciseseries}{columns}{\renewcommand\columncount{#1}}
+\define at key{exerciseseries}{exsubrule}{\renewcommand\exsubrule{#1}}
+\define at key{exerciseseries}{solsubrule}{\renewcommand\solsubrule{#1}}
+\define at key{exerciseseries}{subrule}{\renewcommand\exsubrule{#1}\renewcommand\solsubrule{#1}}
+\newenvironment{exerciseseries}[2][]
+{
+ \refstepcounter{exerciseseries}%
+ \newcommand\columncount{1} % default
+ \newcommand\exsubrule{} % default
+ \newcommand\solsubrule{} % default
+ \setkeys{exerciseseries}{#1}
+ \paragraph{\seriesname~\theexerciseseries:~#2}~\par
+ \ifthenelse{\columncount > 1}{\begin{multicols}{\columncount}}{}
+ \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
+ \immediate\write\solutionstream{\string\end\string{solutionseries\string}}
+}
+\newenvironment{solutionseries}[3][]
+{
+ \newcommand\columncount{1} % default
+ \newcommand\exsubrule{} % default
+ \newcommand\solsubrule{} % default
+ \setkeys{exercises}{#1}
+ \paragraph{\seriesname~#3}~\par
+ \ifthenelse{\columncount > 1}{\begin{multicols}{\columncount}}{}
+ }
+ {
+ \ifthenelse{\columncount > 1}{\end{multicols}}{}
+ \solsubrule\par
+}
+\def\informulacollection{\FV at Environment{}{informulacollection}}
+\def\FVB at informulacollection{%
+ \immediate\openout\formulastream=\jobname.for.tex
+ %\typeout{Writing formula to \jobname.for.tex and \jobname.fc.tex}
+ \@bsphack
+ \begingroup
+ \FV at UseKeyValues
+ \FV at DefineWhiteSpace
+ \def\FV at Space{\space}%
+ \FV at DefineTabOut
+ \let\FV at ProcessLine\GPFORCOL at write@detok %
+ \relax
+ \let\FV at FontScanPrep\relax
+ \let\@noligs\relax
+ \FV at Scan
+ }
+\def\FVE at informulacollection{
+ \endgroup\@esphack
+ \immediate\closeout\formulastream
+ \input{\jobname.for.tex}
+}
+\DefineVerbatimEnvironment{informulacollection}{informulacollection}{}
+\def\informulacollectiononly{\FV at Environment{}{informulacollectiononly}}
+\def\FVB at informulacollectiononly{%
+ %\typeout{Writing special to \jobname.fc.tex}
+ \@bsphack
+ \begingroup
+ \FV at UseKeyValues
+ \FV at DefineWhiteSpace
+ \def\FV at Space{\space}%
+ \FV at DefineTabOut
+ \let\FV at ProcessLine\GPFORCOLONLY at write@detok %
+ \relax
+ \let\FV at FontScanPrep\relax
+ \let\@noligs\relax
+ \FV at Scan
+ }
+\def\FVE at informulacollectiononly{
+ \endgroup\@esphack
+}
+\DefineVerbatimEnvironment{informulacollectiononly}{informulacollectiononly}{}
\newcommand{\exercisename}{Exercise}
\newcommand{\exercisesname}{Exercises}
\newcommand{\solutionname}{Solution}
\newcommand{\solutionsname}{Solutions}
+\newcommand{\seriesname}{Series}
\addto\captionsdutch{%
\renewcommand{\exercisename}{Oefening}%
\renewcommand{\exercisesname}{Oefeningen}%
\renewcommand{\solutionname}{Oplossing}%
\renewcommand{\solutionsname}{Oplossingen}%
+ \renewcommand{\seriesname}{Reeks}%
}
\addto\captionsgerman{%
\renewcommand{\exercisename}{Aufgabe}%
@@ -187,12 +339,21 @@
\renewcommand{\exercisesname}{Aufgaben}%
\renewcommand{\solutionname}{L\"osung}%
\renewcommand{\solutionsname}{L\"osungen}%
+ \renewcommand{\seriesname}{Serie}%
}
+\addto\captionsngerman{%
+ \renewcommand{\exercisename}{Aufgabe}%
+ \renewcommand{\exercisesname}{Aufgaben}%
+ \renewcommand{\solutionname}{L\"osung}%
+ \renewcommand{\solutionsname}{L\"osungen}%
+ \renewcommand{\seriesname}{Serie}%
+}
\addto\captionsfrench{%
\renewcommand{\exercisename}{Exercice}%
\renewcommand{\exercisesname}{Exercices}%
\renewcommand{\solutionname}{Solution}%
\renewcommand{\solutionsname}{Solutions}%
+ \renewcommand{\seriesname}{Serie}%
}
\addto\captionsfinnish{
\renewcommand{\exercisename}{Teht\"av\"a}%
@@ -199,11 +360,22 @@
\renewcommand{\exercisesname}{Teht\"avi\"a}%
\renewcommand{\solutionname}{Ratkaisu}%
\renewcommand{\solutionsname}{Ratkaisut}%
+ \renewcommand{\seriesname}{Sarja}
}
+\addto\captionsspanish{%
+ \renewcommand{\exercisename}{Ejercicio}%
+ \renewcommand{\exercisesname}{Ejercicios}%
+ \renewcommand{\solutionname}{Soluci\'on}%
+ \renewcommand{\solutionsname}{Soluciones}%
+ \renewcommand{\seriesname}{Serie}%
+}
+\ifexsol at local
+\else
\let\exsol@@makechapterhead\@makechapterhead
\def\@makechapterhead#1{%
- \immediate\write\solutionstream{\string\chapter{#1}}%
\exsol@@makechapterhead{#1}
+ \immediate\write\solutionstream{\string\setcounter{chapter}{\arabic{chapter}}%
+ \string\chapter{#1}}%
}
\ifdefined\frontmatter
\let\exsol@@frontmatter\frontmatter
@@ -226,6 +398,14 @@
\exsol@@backmatter
}
\fi
+\ifdefined\appendix
+ \let\exsol@@appendix\appendix
+ \def\appendix{%
+ \immediate\write\solutionstream{\string\appendix}%
+ \exsol@@appendix
+ }
+\fi
+\fi
\newcommand{\noexercisesinchapter}
{
\immediate\write\solutionstream{No exercises in this chapter}
More information about the tex-live-commits
mailing list