summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/exsol
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-10-23 20:44:24 +0000
committerKarl Berry <karl@freefriends.org>2018-10-23 20:44:24 +0000
commit1b17e1beab6ee5d5c29e2dd09313037a1a0e9d80 (patch)
treed366a94d4aed631aeb89f60d6815cff498781212 /Master/texmf-dist/source/latex/exsol
parentb2d85c17c9d9577a0395372219abcf13949d50a7 (diff)
exsol (23oct18)
git-svn-id: svn://tug.org/texlive/trunk@48977 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/exsol')
-rw-r--r--Master/texmf-dist/source/latex/exsol/exsol.dtx166
-rw-r--r--Master/texmf-dist/source/latex/exsol/exsol.ins4
2 files changed, 109 insertions, 61 deletions
diff --git a/Master/texmf-dist/source/latex/exsol/exsol.dtx b/Master/texmf-dist/source/latex/exsol/exsol.dtx
index f964f7d55a7..abe450d0c7d 100644
--- a/Master/texmf-dist/source/latex/exsol/exsol.dtx
+++ b/Master/texmf-dist/source/latex/exsol/exsol.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2016 by Walter Daems <walter.daems@uantwerpen.be>
+% Copyright (C) 2018 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,7 +30,7 @@
%<package|driver>\NeedsTeXFormat{LaTeX2e}
%<driver>\ProvidesFile{exsol.dtx}
%<package>\ProvidesPackage{exsol}
-%<package|driver> [2016/05/13 v1.2 ExSol - Exercises and Solutions package (DMW)]
+%<package|driver> [2018/10/23 v1.4 ExSol - Exercises and Solutions package (DMW)]
%<*driver>
\documentclass[10pt,a4paper]{ltxdoc}
\usepackage[english]{babel}
@@ -48,8 +48,8 @@
\RecordChanges
\newcommand{\exsol}{\textsc{ExSol}}
\StopEventually{\PrintChanges\PrintIndex}
-\def\fileversion{1.2}
-\def\filedate{2016/05/05}
+\def\fileversion{1.4}
+\def\filedate{2018/10/23}
\begin{document}
\DocInput{exsol.dtx}
\end{document}
@@ -97,6 +97,9 @@
% exercises, introduced new options (local, nolabels), separate
% counter for exerciseseries (only for use local mode), introduced
% local mode}
+% \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'}
%
% \DoNotIndex{\newcommand,\newenvironment}
% \setlength{\parindent}{0em}
@@ -116,7 +119,7 @@
% 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 keeping the
-% exercises and the solutions apart in the typeset result.
+% exercises and the solutions seperately in the typeset result.
%
% In \emph{global mode} (the default), this corresponds to generating
% the following separate documents:
@@ -132,20 +135,19 @@
% 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
+% this corresponds to inserting the saved solutions in the current
% document at a later stage in the text.
%
% \subsection{Why use \exsol{}?}
% \begin{itemize}
% \item It allows to keep the \LaTeX{} source of your exercises and their
% solutions together in a single file, next to each other. Away with
-% the nightmare to keep your solutions in sync with the exercises.
+% 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 (using global mode);
-% \item to encourage students that you provide with the solutions
-% separated from the exercises to first try solving the exercises
+% \item to encourage students to first try solving the exercises
% without peeking into the list of solutions (or the solution book).
% \end{itemize}
% \end{itemize}
@@ -276,14 +278,14 @@
%
% \begin{exercise}
% Calculate $y = 5 + 7$
-% \end{exercises}
+% \end{exercise}
% \begin{solution}
% $y = 12$
% \end{solution}
%
% \begin{exercise}
% Calculate $y = 7 - 12$
-% \end{exercises}
+% \end{exercise}
% \begin{solution}
% $y = -5$
% \end{solution}
@@ -294,14 +296,14 @@
%
% \begin{exercise}
% Calculate $y = 5 \cdot 7$
-% \end{exercises}
+% \end{exercise}
% \begin{solution}
% $y = 35$
% \end{solution}
%
% \begin{exercise}
% Calculate $y = 8 / 4$
-% \end{exercises}
+% \end{exercise}
% \begin{solution}
% $y = 2$
% \end{solution}
@@ -335,7 +337,7 @@
\section{Introduction}
-In this text we explain how to wolve second-order polynomial
+In this text we explain how to solve second-order polynomial
equations.
\section{Solving second-order polynomial equations}
@@ -414,9 +416,10 @@ equations.
\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>
%\end{Verbatim}
@@ -509,7 +512,7 @@ equations.
\usepackage{a4wide}
\usepackage[german]{babel}
-\usepackage[local,nolabels,exerciseaslist]{exsol}
+\usepackage[local,nolabels,exerciseaslist,usesolutionserieslabels]{exsol}
\usepackage{enumitem}
\setlength{\exsolexercisetopbottomsep}{0pt plus 0pt minus 1pt}
@@ -695,6 +698,7 @@ equations.
\RequirePackage{ifthen}
\RequirePackage{kvoptions}
\RequirePackage{multicol}
+\RequirePackage{varwidth}
% \end{macrocode}
%
% \subsection{Package options}
@@ -770,6 +774,15 @@ equations.
% \end{macrocode}
% \end{macro}
%
+% \changes{v1.4}{2018/10/23}{. added 'usesolutionserieslabels' option}
+% \begin{macro}{usesolutionserieslabels}
+% This boolean options (true,false) causes the exerciseseries label
+% to be reused when inserting the corresponding solutionseries.
+% \begin{macrocode}
+\DeclareBoolOption[false]{usesolutionserieslabels}
+% \end{macrocode}
+% \end{macro}
+%
% The options are processed using:
% \begin{macrocode}
\ProcessKeyvalOptions*
@@ -791,8 +804,10 @@ equations.
% \begin{macrocode}
\newlength{\exsolexercisesaboveskip}
\setlength{\exsolexercisesaboveskip}{0ex plus 1pt minus 1pt}
+\addtolength{\exsolexercisesaboveskip}{-2\baselineskip}
\newlength{\exsolexercisesbelowskip}
\setlength{\exsolexercisesbelowskip}{0ex plus 1pt minus 1pt}
+\addtolength{\exsolexercisesbelowskip}{\baselineskip}
% \end{macrocode}
%
% Then some lengths to control the spacing for a single
@@ -992,33 +1007,34 @@ equations.
% default results in non list formatting of exercise}
% \changes{v0.5}{2012/01/09}{Changed implementation to allow for
% copying the exercises to the solutions file.}
+% \changes{v1.3}{2017/01/08}{Corrected formatting error in case of
+% options exerciseaslist}
% \begin{macrocode}
\newenvironment{exsol@exercise}[1]
{%
\ifthenelse{\boolean{exsol@minipage}}{\begin{minipage}[t]{\textwidth}}{}%
\ifthenelse{\boolean{exsol@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@nolabels~#1:\else%
- \subparagraph{\exercisename{}~#1:}\fi]
- }%
- {\ifexsol@nolabels #1:\else%
- \subparagraph{\exercisename{}~#1:}\fi}
-}
-{%
- \ifthenelse{\boolean{exsol@exerciseaslist}}%
- {\end{list}}{}%
- \ifthenelse{\boolean{exsol@minipage}}{\end{minipage}}{\par}%
+ {
+ \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@nolabels~#1:\else\exercisename{}~#1:\fi]%
+ }
+ {\ifexsol@nolabels #1:\else%
+ \subparagraph{\exercisename{}~#1:}\fi}
+ }
+ {%
+ \ifthenelse{\boolean{exsol@exerciseaslist}}%
+ {\end{list}}{}%
+ \ifthenelse{\boolean{exsol@minipage}}{\end{minipage}}{\par}%
}
% \end{macrocode}
% \end{macro}
@@ -1084,7 +1100,7 @@ equations.
\setlength{\labelsep}{\exsolexerciselabelsep}
\setlength{\labelwidth}{\exsolexerciselabelwidth}}
\item[\ifexsol@nolabels #1:\else%
- \subparagraph{\solutionname{}\@ifmtarg{#1}{}{~}#1:}\fi]
+ \solutionname{}\@ifmtarg{#1}{}{~}#1:\fi]
}%
{\ifexsol@nolabels #1:\else%
\subparagraph{\solutionname{}\@ifmtarg{#1}{}{~}#1:}\fi}
@@ -1112,20 +1128,19 @@ equations.
\define@key{exercises}{solsubrule}{\renewcommand\solsubrule{#1}}
\define@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}}{}
- }
+{%
+ \newcommand\columncount{1}% default
+ \newcommand\exsubrule{}% default
+ \newcommand\solsubrule{}% default
+ \setkeys{exercises}{#1}%
+ \exercisesfontsize\rule{.25\linewidth}{0.15mm}%
+ \vspace*{-1.5\baselineskip}%
+ \paragraph{\exercisesname}~\\*
+ \ifthenelse{\columncount > 1}{\begin{multicols}{\columncount}}{}%
+ }%
{
- \ifthenelse{\columncount > 1}{\end{multicols}}{}\relax
+ \ifthenelse{\columncount > 1}{\end{multicols}}{}\relax%
\vspace*{-\baselineskip}\vspace*{\exsolexercisesbelowskip}%
- %\rule{.25\linewidth}{0.15mm}
\exsubrule\par}
% \end{macrocode}
% \end{macro}
@@ -1145,7 +1160,7 @@ equations.
\newcommand\columncount{1} % default
\newcommand\exsubrule{} % default
\newcommand\solsubrule{} % default
- \setkeys{exerciseseries}{#1}
+ \setkeys{exerciseseries}{#1}%
\paragraph{\seriesname~\theexerciseseries:~#2}~\par
\ifthenelse{\columncount > 1}{\begin{multicols}{\columncount}}{}
\immediate\write\solutionstream{\string\begin\string{solutionseries\string}%
@@ -1156,13 +1171,23 @@ equations.
\exsubrule\par
\immediate\write\solutionstream{\string\end\string{solutionseries\string}}
}
+% \end{macrocode}
+% \end{macro}
+% \changes{v1.2}{2016/05/05}{Added solutionseries environment}
+% \changes{v1.4}{2018/10/23}{. Implemented option to display
+% solutionserieslabels when option 'usersolutionserieslabels' is true}
+% \begin{macro}{solutionseries}
+% The |solutionseries| environment helps typesetting your
+% solutions in series. You don't need to use this function
+% explicitly. The package does this for you.
+% \begin{macrocode}
\newenvironment{solutionseries}[3][]
{
\newcommand\columncount{1} % default
\newcommand\exsubrule{} % default
\newcommand\solsubrule{} % default
- \setkeys{exercises}{#1}
- \paragraph{\seriesname~#3}~\par
+ \setkeys{exercises}{#1}%
+ \paragraph{\seriesname~#3\ifexsol@usesolutionserieslabels: #2\fi}~\par
\ifthenelse{\columncount > 1}{\begin{multicols}{\columncount}}{}
}
{
@@ -1307,14 +1332,25 @@ equations.
% \changes{v1.1}{2015/09/16}{Corrected congruence of chaptercounter of
% main document and chapter counter of exercises document (taking
% intou account alphanumbered chapters}
+% \changes{v1.3}{2016/08/09}{Corrected counter in solutionstream}
+% \changes{v1.3}{2016/08/09}{Added macro to suppress chapter in
+% solution stream}
% \begin{macrocode}
+\newif\ifnoexinchapter
+\noexinchapterfalse
\ifexsol@local
\else
\let\exsol@@makechapterhead\@makechapterhead
\def\@makechapterhead#1{%
\exsol@@makechapterhead{#1}
+ \ifnoexinchapter
+ \noexinchapterfalse
+ \else
+ \addtocounter{chapter}{-1}
\immediate\write\solutionstream{\string\setcounter{chapter}{\arabic{chapter}}%
\string\chapter{#1}}%
+ \addtocounter{chapter}{1}
+ \fi
}
\ifdefined\frontmatter
\let\exsol@@frontmatter\frontmatter
@@ -1347,10 +1383,22 @@ equations.
\fi
% \end{macrocode}
%
-% \begin{macro}{\noexercisesinchapter}
-% If you have chapters without exercises, you may want to indicate
-% this clearly into your source. Otherwise empty chapters may appear
-% in your solution book.
+% \begin{macro}{\noexercisesinnextchapter}
+% If you have chapters without exercises, you may want to leave them
+% out of your solution book. You can do this by putting the
+% |\noexercisesinnextchapter| macro before your chapter mark.
+% \begin{macrocode}
+\newcommand{\noexercisesinnextchapter}
+{
+ \noexinchaptertrue
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\noexercisesinnextchapter}
+% As an alternative you may just want to put this marker in your
+% text to cause the printing of the sentence ``No exercises in this
+% chapter'' in your solution book.
% \begin{macrocode}
\newcommand{\noexercisesinchapter}
{
diff --git a/Master/texmf-dist/source/latex/exsol/exsol.ins b/Master/texmf-dist/source/latex/exsol/exsol.ins
index f65a0e0aaa3..4a96cb05e04 100644
--- a/Master/texmf-dist/source/latex/exsol/exsol.ins
+++ b/Master/texmf-dist/source/latex/exsol/exsol.ins
@@ -1,4 +1,4 @@
-%% Copyright (C) 2015 by Walter Daems <walter.daems@uantwerpen.be>
+%% Copyright (C) 2018 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
@@ -27,7 +27,7 @@
This is a generated file.
-Copyright (C) 2015 by Walter Daems <walter.daems@uantwerpen.org>
+Copyright (C) 2018 by Walter Daems <walter.daems@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