diff options
author | Karl Berry <karl@freefriends.org> | 2024-01-07 21:26:22 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-01-07 21:26:22 +0000 |
commit | de3f4265bc7c8c0a53616804c4d9e03dc39a0b47 (patch) | |
tree | 643d152e42f9917c75df7c8c5a51c4342b3e642a | |
parent | c2206aa26a2dbe9073c92709c5351e6a1ed6270a (diff) |
exsol (6jan24)
git-svn-id: svn://tug.org/texlive/trunk@69333 c570f23f-e606-0410-a88d-b1316a301751
19 files changed, 1077 insertions, 49 deletions
diff --git a/Master/texmf-dist/doc/latex/exsol/example-exercisebook.pdf b/Master/texmf-dist/doc/latex/exsol/example-exercisebook.pdf Binary files differnew file mode 100644 index 00000000000..e332ad06a3a --- /dev/null +++ b/Master/texmf-dist/doc/latex/exsol/example-exercisebook.pdf diff --git a/Master/texmf-dist/doc/latex/exsol/example-exercisebook.tex b/Master/texmf-dist/doc/latex/exsol/example-exercisebook.tex new file mode 100644 index 00000000000..8f32d4a42a4 --- /dev/null +++ b/Master/texmf-dist/doc/latex/exsol/example-exercisebook.tex @@ -0,0 +1,44 @@ +%% +%% This is file `example-exercisebook.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% exsol.dtx (with options: `exampleexc') +%% +%% This is a generated file. +%% +%% Copyright (C) 2019 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 +%% or (at your option) any later version. The latest version of this +%% license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of LaTeX version +%% 2005/12/01 or later. +%% +\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} +\endinput +%% +%% End of file `example-exercisebook.tex'. diff --git a/Master/texmf-dist/doc/latex/exsol/example-external.pdf b/Master/texmf-dist/doc/latex/exsol/example-external.pdf Binary files differnew file mode 100644 index 00000000000..767df3f446d --- /dev/null +++ b/Master/texmf-dist/doc/latex/exsol/example-external.pdf diff --git a/Master/texmf-dist/doc/latex/exsol/example-external.tex b/Master/texmf-dist/doc/latex/exsol/example-external.tex new file mode 100644 index 00000000000..9c02c7a79aa --- /dev/null +++ b/Master/texmf-dist/doc/latex/exsol/example-external.tex @@ -0,0 +1,124 @@ +%% +%% This is file `example-external.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% exsol.dtx (with options: `example-external') +%% +%% This is a generated file. +%% +%% Copyright (C) 2019 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 +%% or (at your option) any later version. The latest version of this +%% license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of LaTeX version +%% 2005/12/01 or later. +%% +\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} +\endinput +%% +%% End of file `example-external.tex'. diff --git a/Master/texmf-dist/doc/latex/exsol/example-formulacollection.pdf b/Master/texmf-dist/doc/latex/exsol/example-formulacollection.pdf Binary files differindex 75730d35d56..965a4e2b3f2 100644 --- a/Master/texmf-dist/doc/latex/exsol/example-formulacollection.pdf +++ b/Master/texmf-dist/doc/latex/exsol/example-formulacollection.pdf diff --git a/Master/texmf-dist/doc/latex/exsol/example-formulacollection.tex b/Master/texmf-dist/doc/latex/exsol/example-formulacollection.tex new file mode 100644 index 00000000000..107c6f6b40a --- /dev/null +++ b/Master/texmf-dist/doc/latex/exsol/example-formulacollection.tex @@ -0,0 +1,44 @@ +%% +%% This is file `example-formulacollection.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% exsol.dtx (with options: `examplefor') +%% +%% This is a generated file. +%% +%% Copyright (C) 2019 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 +%% or (at your option) any later version. The latest version of this +%% license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of LaTeX version +%% 2005/12/01 or later. +%% +\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} +\endinput +%% +%% End of file `example-formulacollection.tex'. diff --git a/Master/texmf-dist/doc/latex/exsol/example-inline.pdf b/Master/texmf-dist/doc/latex/exsol/example-inline.pdf Binary files differnew file mode 100644 index 00000000000..1ea5fda2cb8 --- /dev/null +++ b/Master/texmf-dist/doc/latex/exsol/example-inline.pdf diff --git a/Master/texmf-dist/doc/latex/exsol/example-inline.tex b/Master/texmf-dist/doc/latex/exsol/example-inline.tex new file mode 100644 index 00000000000..d6f4951ce26 --- /dev/null +++ b/Master/texmf-dist/doc/latex/exsol/example-inline.tex @@ -0,0 +1,108 @@ +%% +%% This is file `example-inline.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% exsol.dtx (with options: `example-inline') +%% +%% This is a generated file. +%% +%% Copyright (C) 2019 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 +%% or (at your option) any later version. The latest version of this +%% license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of LaTeX version +%% 2005/12/01 or later. +%% +\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} +\endinput +%% +%% End of file `example-inline.tex'. diff --git a/Master/texmf-dist/doc/latex/exsol/example-local.pdf b/Master/texmf-dist/doc/latex/exsol/example-local.pdf Binary files differindex ddb51bed263..009b07f672b 100644 --- a/Master/texmf-dist/doc/latex/exsol/example-local.pdf +++ b/Master/texmf-dist/doc/latex/exsol/example-local.pdf diff --git a/Master/texmf-dist/doc/latex/exsol/example-local.tex b/Master/texmf-dist/doc/latex/exsol/example-local.tex new file mode 100644 index 00000000000..408e8a5b455 --- /dev/null +++ b/Master/texmf-dist/doc/latex/exsol/example-local.tex @@ -0,0 +1,110 @@ +%% +%% This is file `example-local.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% exsol.dtx (with options: `example-local') +%% +%% This is a generated file. +%% +%% Copyright (C) 2019 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 +%% or (at your option) any later version. The latest version of this +%% license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of LaTeX version +%% 2005/12/01 or later. +%% +\documentclass[a4paper,10pt]{article} + +\usepackage{a4wide} +\usepackage[german]{babel} +\usepackage[local,nolabels,exerciseaslist,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 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} +\endinput +%% +%% End of file `example-local.tex'. diff --git a/Master/texmf-dist/doc/latex/exsol/example-solutionbook.pdf b/Master/texmf-dist/doc/latex/exsol/example-solutionbook.pdf Binary files differindex 58e8f1172de..6b4758989a4 100644 --- a/Master/texmf-dist/doc/latex/exsol/example-solutionbook.pdf +++ b/Master/texmf-dist/doc/latex/exsol/example-solutionbook.pdf diff --git a/Master/texmf-dist/doc/latex/exsol/example-solutionbook.tex b/Master/texmf-dist/doc/latex/exsol/example-solutionbook.tex new file mode 100644 index 00000000000..20be3a433f6 --- /dev/null +++ b/Master/texmf-dist/doc/latex/exsol/example-solutionbook.tex @@ -0,0 +1,44 @@ +%% +%% This is file `example-solutionbook.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% exsol.dtx (with options: `examplesol') +%% +%% This is a generated file. +%% +%% Copyright (C) 2019 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 +%% or (at your option) any later version. The latest version of this +%% license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of LaTeX version +%% 2005/12/01 or later. +%% +\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} +\endinput +%% +%% End of file `example-solutionbook.tex'. diff --git a/Master/texmf-dist/doc/latex/exsol/example.pdf b/Master/texmf-dist/doc/latex/exsol/example.pdf Binary files differindex c19b69c8484..47225cc0b25 100644 --- a/Master/texmf-dist/doc/latex/exsol/example.pdf +++ b/Master/texmf-dist/doc/latex/exsol/example.pdf diff --git a/Master/texmf-dist/doc/latex/exsol/example.tex b/Master/texmf-dist/doc/latex/exsol/example.tex new file mode 100644 index 00000000000..6766f2fe65f --- /dev/null +++ b/Master/texmf-dist/doc/latex/exsol/example.tex @@ -0,0 +1,129 @@ +%% +%% This is file `example.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% exsol.dtx (with options: `example') +%% +%% This is a generated file. +%% +%% Copyright (C) 2019 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 +%% or (at your option) any later version. The latest version of this +%% license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of LaTeX version +%% 2005/12/01 or later. +%% +\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 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} + +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} + 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} + \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 + $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 the conclusion. +\section{Conclusion} +Solving second-order polynomial equations is very easy. +\end{document} +\endinput +%% +%% End of file `example.tex'. diff --git a/Master/texmf-dist/doc/latex/exsol/exsol.pdf b/Master/texmf-dist/doc/latex/exsol/exsol.pdf Binary files differindex 0fd252d1177..db7e94c5465 100644 --- a/Master/texmf-dist/doc/latex/exsol/exsol.pdf +++ b/Master/texmf-dist/doc/latex/exsol/exsol.pdf diff --git a/Master/texmf-dist/doc/latex/exsol/manifest.txt b/Master/texmf-dist/doc/latex/exsol/manifest.txt new file mode 100644 index 00000000000..dd199abe582 --- /dev/null +++ b/Master/texmf-dist/doc/latex/exsol/manifest.txt @@ -0,0 +1,16 @@ +[ 4096] . +[ 1644] README +[ 443] manifest.txt +[ 403] LICENSE +[ 227438] exsol.pdf +[ 2547] exsol.ins +[ 59594] exsol.dtx +[ 69744] example-solutionbook.pdf +[ 61820] example.pdf +[ 55624] example-local.pdf +[ 56960] example-inline.pdf +[ 55413] example-formulacollection.pdf +[ 58600] example-external.pdf +[ 48449] example-exercisebook.pdf + +1 directory, 13 files diff --git a/Master/texmf-dist/source/latex/exsol/exsol.dtx b/Master/texmf-dist/source/latex/exsol/exsol.dtx index abe450d0c7d..7c2692e2fe6 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) 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} diff --git a/Master/texmf-dist/source/latex/exsol/exsol.ins b/Master/texmf-dist/source/latex/exsol/exsol.ins index 4a96cb05e04..f5967d7191d 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) 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 @@ -27,7 +27,7 @@ This is a generated file. -Copyright (C) 2018 by Walter Daems <walter.daems@uantwerpen.org> +Copyright (C) 2019 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 @@ -46,7 +46,10 @@ and version 1.3 or later is part of all distributions of LaTeX version \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-exercisebook.tex}{\from{exsol.dtx}{exampleexc}}} \generate{\file{example-local.tex}{\from{exsol.dtx}{example-local}}} +\generate{\file{example-inline.tex}{\from{exsol.dtx}{example-inline}}} +\generate{\file{example-external.tex}{\from{exsol.dtx}{example-external}}} \obeyspaces diff --git a/Master/texmf-dist/tex/latex/exsol/exsol.sty b/Master/texmf-dist/tex/latex/exsol/exsol.sty index 9b7f6a9a8fe..f3796233455 100644 --- a/Master/texmf-dist/tex/latex/exsol/exsol.sty +++ b/Master/texmf-dist/tex/latex/exsol/exsol.sty @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% Copyright (C) 2018 by Walter Daems <walter.daems@uantwerpen.org> +%% Copyright (C) 2019 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 @@ -22,14 +22,18 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{exsol} - [2018/10/23 v1.4 ExSol - Exercises and Solutions package (DMW)] + [2024/01/07 v1.6 ExSol - Exercises and Solutions package (DMW)] \RequirePackage{ifmtarg} \RequirePackage{fancyvrb} \RequirePackage{ifthen} \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}{}} \DeclareBoolOption[false]{local} +\DeclareBoolOption[false]{external} +\DeclareBoolOption[false]{inline} \DeclareBoolOption[false]{nolabels} \DeclareStringOption[normalsize]{exercisesfontsize} \DeclareBoolOption[false]{exerciseaslist} @@ -64,8 +68,14 @@ \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 @@ -116,13 +126,13 @@ \def\exercise{\FV@Environment{}{exercise}} \def\FVB@exercise{% \refstepcounter{exercise}% + \ifexsol@external\else \immediate\openout\exercisestream=\jobname.exc.tex + \fi \ifexsol@local \else \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}} @@ -148,8 +158,10 @@ \ifexsol@copyexercisesinsolutions \immediate\write\solutionstream{\string\end{exsol@exercise}} \fi + \ifexsol@external\else \immediate\closeout\exercisestream \input{\jobname.exc.tex} + \fi } \DefineVerbatimEnvironment{exercise}{exercise}{} \newenvironment{exsol@exercise}[1] @@ -180,12 +192,22 @@ } \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 @@ -201,6 +223,11 @@ \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}{} \newenvironment{exsol@solution}[1] @@ -262,13 +289,17 @@ \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 } \newenvironment{solutionseries}[3][] { @@ -384,6 +415,10 @@ \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 } @@ -391,6 +426,9 @@ \let\exsol@@frontmatter\frontmatter \def\frontmatter{% \immediate\write\solutionstream{\string\frontmatter}% + \ifexsol@external% + \immediate\write\exercisestream{\string\frontmatter}% + \fi% \exsol@@frontmatter } \fi @@ -398,6 +436,9 @@ \let\exsol@@mainmatter\mainmatter \def\mainmatter{% \immediate\write\solutionstream{\string\mainmatter}% + \ifexsol@external% + \immediate\write\exercisestream{\string\mainmatter}% + \fi% \exsol@@mainmatter } \fi @@ -405,6 +446,9 @@ \let\exsol@@backmatter\backmatter \def\backmatter{% \immediate\write\solutionstream{\string\backmatter}% + \ifexsol@external% + \immediate\write\exercisestream{\string\backmatter}% + \fi% \exsol@@backmatter } \fi @@ -412,6 +456,9 @@ \let\exsol@@appendix\appendix \def\appendix{% \immediate\write\solutionstream{\string\appendix}% + \ifexsol@external% + \immediate\write\exercisestream{\string\appendix}% + \fi% \exsol@@appendix } \fi @@ -423,6 +470,9 @@ \newcommand{\noexercisesinchapter} { \immediate\write\solutionstream{No exercises in this chapter} + \ifexsol@external% + \immediate\write\exercisestream{No exercises in this chapter}% + \fi% } \endinput %% |