summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/exsol/exsol.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/exsol/exsol.sty')
-rw-r--r--Master/texmf-dist/tex/latex/exsol/exsol.sty72
1 files changed, 61 insertions, 11 deletions
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
%%