summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-04-04 20:17:27 +0000
committerKarl Berry <karl@freefriends.org>2018-04-04 20:17:27 +0000
commit96713a32275c0b6c81fc2b7c0f9116f659180f84 (patch)
tree47acce0381bc6a94b46ef10320b6bfe18795ffc5 /Master/texmf-dist/tex/latex
parentb8e3667229f98fc455cfd2b16302bd8f366af5ed (diff)
exercisebank (4apr18)
git-svn-id: svn://tug.org/texlive/trunk@47286 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/exercisebank/exercisebank.sty101
1 files changed, 63 insertions, 38 deletions
diff --git a/Master/texmf-dist/tex/latex/exercisebank/exercisebank.sty b/Master/texmf-dist/tex/latex/exercisebank/exercisebank.sty
index f4731b6893b..cdce8adaa24 100644
--- a/Master/texmf-dist/tex/latex/exercisebank/exercisebank.sty
+++ b/Master/texmf-dist/tex/latex/exercisebank/exercisebank.sty
@@ -1,5 +1,5 @@
% Source (with comments) can be found at https://github.com/Strauman/exerciseBank
-%% The LaTeX package exercisebank - version 0.0.2-1 (2018/04/01)
+%% The LaTeX package exercisebank - version v0.0.6 (2018/04/03) - build 47
%% exercisebank.sty: Exercise bank
%% -------------------------------------------------------------------------------------------
%% Copyright (c) 2018 by Andreas Storvik Strauman <andreas dot s dot strauman at uit dot no>
@@ -13,20 +13,20 @@
%% version 2008/05/04 or later.
%% This work has the LPPL maintenance status `author-maintained'.
%% This work consists of all files listed in README
-\ProvidesPackage{exercisebank}[2018/04/01 v0.0.2-1 Creates a setup that gives freedom in making sets and exercises.]
-\@ifundefined{ownLineNoSpacesGotIt}{\@latex@warning{Compilation wont work unless \string\end{problem} and \string\end{solution} are on their own lines and without any spaces. This warning can be removed by doing \string\def\string\ownLineNoSpacesGotIt{} before \string\usepackage{exbank}}
+\ProvidesPackage{exercisebank}[2018/04/03 v0.0.6 Creates a setup that gives freedom in making sets and exercises.]
+\@ifundefined{ownLineNoSpacesGotIt}{\@latex@warning{Compilation wont work unless \string\end{problem} and \string\end{solution} are on their own lines and without any spaces. This warning can be removed by doing \string\def\string\ownLineNoSpacesGotIt{} before \@backslashchar usepackage{exbank}}
}{}
\gdef\setExercisesDir#1{\gdef\exercisesDir{#1}}
\@ifundefined{exercisesDir}{\gdef\exercisesDir{exercises}
}{}
\global\let\incl = \input
-\usepackage{xstring}
-\usepackage{pgffor}
-\usepackage{scrextend}
-\usepackage{comment}
-\usepackage{calc}
-\usepackage{pgfpages}
-\usepackage{geometry}
+\RequirePackage{xstring}
+\RequirePackage{pgffor}
+\RequirePackage{scrextend}
+\RequirePackage{comment}
+\RequirePackage{calc}
+\RequirePackage{pgfpages}
+\RequirePackage{geometry}
\pgfkeys{ /exbanki18n/.is family, /exbanki18n,
default/.style = {Problem = Problem, Solution = Solution},
Problem/.estore in = \@tr@Problem,
@@ -52,38 +52,59 @@
\let\mname = \macname
\@ifundefined{At@\mname}{}{\csname At@\mname\endcsname}
}
-\def\ppLeading{4em}
-\def\pMarginBelow{1em}
-\def\pMarginAbove{1em}
-\def\pMarginLeft{-1.5em}
-\def\ppMargin{1em}
-\def\solMargin{\dimexpr\ppMargin+\ppMargin\relax}
+\newlength{\ppLeading}
+\newlength{\pMarginBelow}
+\newlength{\pMarginAbove}
+\newlength{\pMarginLeft}
+\newlength{\ppMarginBelow}
+\newlength{\ppMarginAbove}
+\newlength{\ppMargin}
+\newlength{\ppPullback}
+\setlength{\ppLeading}{4em}
+\setlength{\pMarginBelow}{1em}
+\setlength{\pMarginAbove}{1em}
+\setlength{\pMarginLeft}{-1.5em}
+\setlength{\ppMarginBelow}{2em}
+\setlength{\ppMarginAbove}{2em}
+\setlength{\ppMargin}{2em}
+\setlength{\ppPullback}{3.5em}
+\def\solMargin{\dimexpr\ppMargin\relax}
\def\vsSize{1em}
\def\vs{\vspace{\vsSize}}
\newcounter{problemcounter}
\setcounter{problemcounter}{0}
\newcounter{partproblemcounter}
-\At\VeryBeginProblem{ \stepcounter{problemcounter}
- \setcounter{partproblemcounter}{1}
- \vspace*{\pMarginAbove}
- \begin{addmargin}{\pMarginLeft}
- {\normalfont\Large\bfseries\@tr{Problem}~\theproblemcounter}
- \end{addmargin}
- \vspace*{\pMarginBelow}
-}
-\At\BeginPartproblem{ \vspace{\ppMargin}%
- \begin{addmargin}{\ppMargin}%
-\large\hspace*{-\ppMargin}\textbf{(\theproblemcounter\alph{partproblemcounter})}\normalsize
- \stepcounter{partproblemcounter}
-}
-\At\EndPartproblem{\hfill
-\end{addmargin}\vspace*{0.5em}
-}
-\At\BeginSolution{ \vspace*{1em}
- \begin{addmargin}{\solMargin}%
-\hspace*{-\solMargin}\large{\textbf{\@tr{Solution}:}}\normalsize
-}
-\At\EndSolution{ \end{addmargin}\vspace*{1em}
+\At\VeryBeginProblem{ \stepcounter{problemcounter}
+ \setcounter{partproblemcounter}{1}
+ \vspace*{\pMarginAbove}
+ \begin{addmargin}{\pMarginLeft}
+ {\normalfont\Large\bfseries\@tr{Problem}~\theproblemcounter}
+ \end{addmargin}
+ \vspace*{\pMarginBelow}
+}
+\At\EndProblem{ \filbreak
+}
+\At\VeryBeginPartproblem{%
+ \stepcounter{partproblemcounter}%
+ \def\@pproblemHead{\large\textbf{(\theproblemcounter\alph{partproblemcounter})}}
+ \begin{addmargin}{\ppMargin}
+ \filbreak
+ \begin{itemize}
+ \item[\@pproblemHead]
+}
+\At\EndPartproblem{ \end{itemize}
+ \end{addmargin}
+ \vspace*{\pMarginBelow}%
+}
+\At\BeginSolution{ \vspace*{1em}
+ \def\@solutionHead{\large{\textbf{\@tr{Solution}:}}}
+ \begin{addmargin}{\solMargin}
+ \filbreak
+ \begin{itemize}
+ \item[\@solutionHead]
+}
+\At\EndSolution{ \end{itemize}
+ \end{addmargin}
}
\gdef\isFalse{0}
\gdef\isTrue{1}
@@ -101,6 +122,7 @@
\if\@displayMetaCounter\isTrue%
{P:\Large\themetacounter}
\Trigger\BeginPartproblem
+ \Trigger\VeryBeginPartproblem
\gdef\DisplayProblem{\isTrue}
\else
\if\DisplayProblem\isFalse
@@ -113,7 +135,9 @@
\generalcomment{problem}{ \edef\DisplaySolution{\@DisplaySolutions}
\Trigger\DecideProblemDisplay
\begingroup
- \showhideproblem{\Trigger\BeginPartproblem}
+ \showhideproblem{ \Trigger\BeginPartproblem
+ \Trigger\VeryBeginPartproblem
+}
}{ \if\DisplayProblem\isFalse\else
\Trigger\EndPartproblem
\fi
@@ -147,6 +171,7 @@
\Trigger\EndIntro
\endgroup
\fi
+ \vspace*{1em}
}
\gdef\isin#1#2#3#4{ \def\needle{#2}
\def\haystack{#1}