texlive[50448] Master/texmf-dist: exercisebank (18mar19)

commits+karl at tug.org commits+karl at tug.org
Mon Mar 18 22:16:17 CET 2019


Revision: 50448
          http://tug.org/svn/texlive?view=revision&revision=50448
Author:   karl
Date:     2019-03-18 22:16:17 +0100 (Mon, 18 Mar 2019)
Log Message:
-----------
exercisebank (18mar19)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/exercisebank/README.txt
    trunk/Master/texmf-dist/doc/latex/exercisebank/example.zip
    trunk/Master/texmf-dist/doc/latex/exercisebank/exercisebank-doc.pdf
    trunk/Master/texmf-dist/doc/latex/exercisebank/exercisebank-doc.tex
    trunk/Master/texmf-dist/tex/latex/exercisebank/exercisebank.sty

Modified: trunk/Master/texmf-dist/doc/latex/exercisebank/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/exercisebank/README.txt	2019-03-18 21:15:59 UTC (rev 50447)
+++ trunk/Master/texmf-dist/doc/latex/exercisebank/README.txt	2019-03-18 21:16:17 UTC (rev 50448)
@@ -7,10 +7,13 @@
 ├── example.zip
 │   ├── example.pdf
 │   ├── example.tex
-│   └── exercises
-│       ├── firstexercise.tex
-│       ├── secondexercise.tex
-│       └── thirdexercise.tex
+│   ├── exercises
+│   │   └── mechanics
+│   │       └── center-of-mass.tex
+│   ├── figures
+│   │   └── mechanics
+│   │       └── rod.tex
+│   └── mathcommands.tex
 ├── exercisebank-doc.pdf
 ├── exercisebank-doc.tex
 └── exercisebank.sty
@@ -22,7 +25,7 @@
 
 Licence:
 
-The LaTeX package exercisebank - version v0.2.2 (2018/10/04) - build 97
+The LaTeX package exercisebank - version v0.3.0 (2019/03/18) - build 137
 exercisebank.sty: Exercise bank
 -------------------------------------------------------------------------------------------
 Copyright (c) 2018 by Andreas Storvik Strauman

Modified: trunk/Master/texmf-dist/doc/latex/exercisebank/example.zip
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/exercisebank/exercisebank-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/exercisebank/exercisebank-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/exercisebank/exercisebank-doc.tex	2019-03-18 21:15:59 UTC (rev 50447)
+++ trunk/Master/texmf-dist/doc/latex/exercisebank/exercisebank-doc.tex	2019-03-18 21:16:17 UTC (rev 50448)
@@ -1,5 +1,5 @@
-%% exercisebank v0.2.2b97 - 2018/10/04
-%% The LaTeX package exercisebank - version v0.2.2 (2018/10/04) build 97
+%% exercisebank v0.3.0b137 - 2019/03/18
+%% The LaTeX package exercisebank - version v0.3.0 (2019/03/18) build 137
 %% Manual/Documentation for exercisebank.sty
 %% -------------------------------------------------------------------------------------------
 %% Copyright (c) 2018 by Andreas Storvik Strauman
@@ -49,6 +49,13 @@
 \newcommand\gh[1]{\href{https://github.com/#1}{@#1}}
 \newcommand\ghURL[1]{\href{https://github.com/#1}{https://github.com/#1}}
 
+\providecommand\onethankyou at tmp@content{\relax}
+\providecommand\onethankyou at content{\relax}
+\let\dlog\@latex at warning
+\dlog{OTYC\onethankyou at content:\the\catcode`\@}
+\gdef\onethankyou#1{\dlog{Reg @oty}\gdef\onethankyou at tmp@content{#1}}
+\AtEndDocument{\write\@auxout{\string\gdef\string\onethankyou at content{\onethankyou at tmp@content}}}
+
 \providecommand\thankyous{\relax}
 \def\print at thankyous{\readlist*\lst\thankyous\foreachitem\itm\in\lst{\if\itm\relax\else\item[-] \itm\fi}}
 \providecommand\@thankyous at content{\relax}
@@ -98,6 +105,7 @@
 \begingroup\lccode`\|=`\\
 \lowercase{\endgroup\def\removebs#1{\if#1|\else#1\fi}}
 \newcommand{\macroname}[1]{\expandafter\removebs\string#1}
+% \def\obeyifnextspace{\ltx at ifnextchar{ }\relax\relax}
 \def\dac#1{\docAuxCommand{\macroname{#1}}}
 \let\mdac\dac
 
@@ -119,7 +127,7 @@
 
 
 \setlength{\parindent}{0pt}
-\title{{exercisebank - manual\\ v0.2.2{\\[-0.5em]\footnotesize(build 97)}}}
+\title{{exercisebank - manual\\ v0.3.0{\\[-0.5em]\footnotesize(build 137)}}}
 \author{Andreas Strauman}
 \begin{document}
 \maketitle
@@ -126,7 +134,11 @@
  
 If you found any bugs or want new functionality, to contribute, view the commented source, get latest version of this package or get in touch with me, you can do all of that at \url{https://github.com/Strauman/exercisebank/}. If you have questions of functionality, kindly direct them to the community\\ \url{http://tex.stackexchange.com}. The author is active on this site regularly.
 If you feel up for it, you can always find the latest development version online, and I always need people to test -- it saves me a lot of time!
-\if\thankyous\relax\else Special thanks to these contributors: \makeatletter\begin{itemize}\print at thankyous\end{itemize}\makeatother\fi
+\makeatletter
+\if\onethankyou at content\relax\else\par%
+An extra special thanks to \onethankyou at content who really helps out with this package!
+\fi
+\if\thankyous\relax\else\par Special thanks to the people who helps me with this package: \makeatletter\begin{itemize}\print at thankyous\end{itemize}\makeatother\fi
 \if\testers\relax\else\footxt{People who helped test and make this package better (github users): \testers}\fi
 \tableofcontents
 \clearpage
@@ -307,6 +319,10 @@
 
 Turns on the solutions, so they are shown.
 \end{docCommand}
+\begin{docCommand}{SolutionsOnly}{}\addcontentsline{toc}{subsubsection}{\refCom{SolutionsOnly}}
+\defnew{v0.3.0\\2019/03/18 }
+Displays only solutions (if there are any) to the part problem
+\end{docCommand}
 \begin{docEnvironment}{problem}{}
 Inside the \dac{keyRef}\{exercise directory\}, you keep your exercises. Inside the exercise file you'd use a problem environment to write your partproblems. It might be a little confusing that you're using \dac{begin}\{problem\} instead of \dac{begin}\{partproblem\} when you're writing a partproblem, but it's less typing.
 \end{docEnvironment}
@@ -358,6 +374,10 @@
 This contains information about an exercise set. It is intended to be on the top of an
 exercise, explaining short what the exercise is about. It's only visible when using \dac{sprite}
 \end{docCommand}
+\begin{docCommand}{buildall}{}\addcontentsline{toc}{subsubsection}{\refCom{buildall}}
+\defnew{v0.3.0\\2019/03/18 }
+ Build all sets defined with \dac{makeset}
+\end{docCommand}
 \begin{docCommand}{sprite}{\oarg{PiP}}\addcontentsline{toc}{subsubsection}{\refCom{sprite}}
 \updated{v0.1.1\\2018/04/13 }
  This is a way to visualize all exercises. It takes one optional argument which is how many pages
@@ -405,11 +425,8 @@
 As you can see in the intro section of the documentation, this is for cherry picking partproblems
 To be used in \refCom{makeset}
 \end{docCommand}
-\begin{docCommand}{orderedselect}{}\addcontentsline{toc}{subsubsection}{\refCom{orderedselect}}
-\defnew{v0.2.1\\2018/09/24 }
-\end{docCommand}
 \begin{docCommand}{buildset}{\oarg{intro|nohead|nointro}\marg{setname}}\addcontentsline{toc}{subsubsection}{\refCom{buildset}}
-\updated{v0.2.1\\2018/09/24 }
+\updated{v0.3.0\\2019/03/18 }
 This command runs the set given. The set has do be defined by \dac{makeset}. E.eg
 \begin{dispListing}
 \makeset{myExerciseSet}{exercisefile1, \select{exercisefile2}{1,2}}
@@ -447,6 +464,10 @@
 \buildsets{tag,tag2,tag3}{set,set2,set3}
 \end{dispListing}
 \end{docCommand}
+\begin{docCommand}{buildsprite}{\marg{setslist}}\addcontentsline{toc}{subsubsection}{\refCom{buildsprite}}
+\defnew{v0.3.0\\2019/03/18 }
+ Builds a sprite from the given comma separated list of sets
+\end{docCommand}
 \begin{docCommand}{pplabel}{\marg{label}}\addcontentsline{toc}{subsubsection}{\refCom{pplabel}}
 
 Labels a partproblem. You can reference to it later using \dac{ppref}\{\meta{label\}}
@@ -455,14 +476,35 @@
 \updated{v0.2.0\\2018/07/21 }
 Reference a partproblem created by \dac{pplabel}\{\meta{label\}}. This prints e.g. 1c)
 \end{docCommand}
+\begin{docCommand}{ppgref}{\marg{label}}\addcontentsline{toc}{subsubsection}{\refCom{ppgref}}
+\defnew{v0.3.0\\2019/03/18 }
+Reference a partproblem created by \dac{pplabel}\{\meta{label\}}. This can be used for \emph{global} exercises.
+\end{docCommand}
 \begin{docCommand}{pref}{\marg{label}}\addcontentsline{toc}{subsubsection}{\refCom{pref}}
 
  Reference a partproblem created by \dac{pplabel}\{\meta{label\}}. This prints e.g. 1
 \end{docCommand}
+\begin{docCommand}{pgref}{\marg{label}}\addcontentsline{toc}{subsubsection}{\refCom{pgref}}
+\defnew{v0.3.0\\2019/03/18 }
+ Reference a partproblem created by \dac{pplabel}\{\meta{label\}}. This prints e.g. 1, but have global search.
+\end{docCommand}
 \begin{docCommand}{HideTags}{\marg{list}}\addcontentsline{toc}{subsubsection}{\refCom{HideTags}}
-\defnew{v0.2.1\\2018/09/24 }
+\updated{v0.3.0\\2019/03/18 }
 Hide all exercises containing the list of tags when building a set.
 \end{docCommand}
+\begin{docCommand}{ShowAllTags}{}\addcontentsline{toc}{subsubsection}{\refCom{ShowAllTags}}
+\defnew{v0.3.0\\2019/03/18 }
+Reset tags set by \dac{HideTags}
+\end{docCommand}
+\begin{docCommand}{exercisenote}{}\addcontentsline{toc}{subsubsection}{\refCom{exercisenote}}
+\defnew{v0.3.0\\2019/03/18 }
+ Adds a note below an exercise header. To be used in \dac{makeset}
+\begin{dispListing}
+ \makeset{\exercisenote{This is a pretty hard exercise}, my/hard/exercise}
+\end{dispListing}
+ Here the text inside \dac{exercisenote} (This is a pretty hard exercise) will show
+ right below the problem header of my/hard/exercise.tex
+\end{docCommand}
 \filbreak\subsection{Configuration and options}
 You can do a lot of configurations on this package, and probably
  even more to come in later versions!
@@ -472,11 +514,11 @@
  \dac{exclude} and \dac{select}
 \end{docCommand}
 \begin{docCommand}{ShowTags}{}\addcontentsline{toc}{subsubsection}{\refCom{ShowTags}}
-\defnew{v0.2.1\\2018/09/24 }
+\updated{v0.3.0\\2019/03/18 }
  Shows the tags in front of the part problems much like \dac{ShowNumbers}
 \end{docCommand}
 \begin{docCommand}{ShowFilenames}{}\addcontentsline{toc}{subsubsection}{\refCom{ShowFilenames}}
-\defnew{v0.2.1\\2018/09/24 }
+\updated{v0.3.0\\2019/03/18 }
  Shows the path+filename to the current exercise file
 \end{docCommand}
 \begin{docCommand}{exercisebanksetup}{\marg{\oarg{key/values}}}\addcontentsline{toc}{subsubsection}{\refCom{exercisebanksetup}}
@@ -550,15 +592,26 @@
 Path to a front page that will be loaded at every \dac{buildset}
 Where to load the front page. The commands \refCom{setName} is available.
 }
-\keyDef{style margins}{yes/no}{yes}{
+\keyDef{style margins}{true|false}{true}{
 Whether or not to put problem headers and part problem headers out in the margins.
 }
+\keyDef{show lonely part problems}{true|false}{false}{
+ Whether or not to show part problems if there is only one part problem within the problem.
+}
 \end{docCommand}
 \keyDef{current points style}{style}{see below}{
  This is how the points will be shown in the part problem headers.
- the default code is by \gh{thorstengrote}
- \texttt{~\dac{ifnum}\dac{exb at currentPoints}=\dac{z@}\dac{ifnum}\dac{totalpoints}=\dac{z@}\dac{else}\dac{phantom}\{0p\}\dac{fi}\dac{else}\dac{exb at currentPoints} p\dac{fi}~\dac{ignorespaces}}
+ the default code is by \gh{thorstengrote} (see example below)
 }
+\begin{dispListing}
+~\ifnum\exb at currentPoints=\z@%
+    \ifnum\totalpoints=\z@\else%
+      \phantom{0p}%
+    \fi%
+  \else%
+    \exb at currentPoints p%
+  \fi~\ignorespaces
+\end{dispListing}
 \keyDef{disable points}{bool}{false}{
  Whether or not to disable the point system.
 }
@@ -577,9 +630,9 @@
 \translateExBank{Problem=Oppgave, Solution=Løsning}
 \end{dispListing}
 \end{docCommand}
-\filbreak\subsection{Problem options and tagging}
+\filbreak\subsection{Problem options: points and tagging}
 \begin{docCommand}{nextproblem}{}\addcontentsline{toc}{subsubsection}{\refCom{nextproblem}}
-\updated{v0.2.2\\2018/10/04 }
+\updated{v0.3.0\\2019/03/18 }
 Prior to a problem environment in an exercise file you can pass options
 using the \dac{nextproblem} command. If you e.g. wanted to hide one regardless
 of what set it is you'd do
@@ -615,6 +668,12 @@
   This problem is easy
 \end{problem}
 \end{dispListing}
+\keyDef{head}{text}{}{
+  Set the part problem header for the next problem.
+}
+\keyDef{solution only}{true|false}{}{
+  hide next problem unless \dac{DisplaySolutions} are on
+}
 Here are the \dac{nextproblem} keys:
 \keyDef{points}{number}{0}{
  The number of points the next exercise is worth.
@@ -622,6 +681,14 @@
 }
 
 
+\begin{docCommand}{totalpoints}{}\addcontentsline{toc}{subsubsection}{\refCom{totalpoints}}
+
+Contains the total number of points for all exercises in the current set
+\end{docCommand}
+\begin{docCommand}{exercisepoints}{}\addcontentsline{toc}{subsubsection}{\refCom{exercisepoints}}
+\defnew{v0.3.0\\2019/03/18 }
+ Contains the total number of points in the current exercise (or "Problem")
+\end{docCommand}
 \filbreak\subsection{Triggers}
 \begin{docCommand}{Trigger}{\marg{Any Macro}}\addcontentsline{toc}{subsubsection}{\refCom{Trigger}}
 \updated{v0.2.1\\2018/09/24 }
@@ -629,6 +696,8 @@
  Available triggers:\\
 \dac{Trigger}\dac{PartProblemHeaderSuffix}:\\ Triggers after the part problem header.
  anything added to this trigger will happen within the header
+\dac{Trigger}\dac{PostPPHeader}:\\ Triggers right after the part problem header
+has been printed. It is also triggered after the PP header for SolutionsOnly.
 \dac{Trigger}\dac{BeginPartproblem}:\\ Triggers before a partproblem is inserted\\
 \dac{Trigger}\dac{VeryBeginPartproblem}:\\ Triggers right after \dac{BeginPartproblem}. This is so that the user can do stuff before the actual headers start. The partproblem headers are invoked by \dac{At}\dac{VeryBeginPartproblem}\\
 \dac{Trigger}\dac{InputExercise}:\\ Triggers before a file is included\\\
@@ -639,6 +708,14 @@
 
 
 \end{docCommand}
+\begin{docCommand}{exb at ClearHook}{}\addcontentsline{toc}{subsubsection}{\refCom{exb at ClearHook}}
+
+ Deletes all information from a hook.
+ Note that if preceded by \dac{rigid}, then the
+ ENTIRE hook will be cleared.
+ Note that the necessary hooks might not be
+ registered as rigid. Thus show caution when deleting hooks
+\end{docCommand}
 \filbreak\subsection{General reference}
 \begin{docCommand}{ownLineNoSpacesGotIt}{}\addcontentsline{toc}{subsubsection}{\refCom{ownLineNoSpacesGotIt}}
 
@@ -658,6 +735,14 @@
  Executes \meta{True} if \meta{needle} is found in \meta{haystack}
  else executes \meta{False}
 \end{docCommand}
+\begin{docCommand}{exercisebankversion}{}\addcontentsline{toc}{subsubsection}{\refCom{exercisebankversion}}
+\defnew{v0.3.0\\2019/03/18 }
+ Prints the current version and build to the error log
+\end{docCommand}
+\begin{docCommand}{exercisebankbuild}{}\addcontentsline{toc}{subsubsection}{\refCom{exercisebankbuild}}
+\defnew{v0.3.0\\2019/03/18 }
+ Prints the current build number to the error log
+\end{docCommand}
 This package also includes some extra stuff. For example the \dac{At} and \dac{Trigger}
 \begin{docCommand}{At}{\marg{AnyMacro}}
 \updated{v0.2.1\\2018/09/24 }Here you can send any macro because it isn't evaluated! For example \dac{At}\dac{BeginSomething} is fine and even if \dac{BeginSomething} is not defined. Also and when using \dac{Trigger} it just ignores it if it didn't exist. It's pretty similar in function as to \dac{AtBeginDocument}.
@@ -667,6 +752,17 @@
  \Trigger\BeginSomething, this evaluates to DoSomething
 \end{dispListing}
 \end{docCommand}
+\begin{docCommand}{@rigid}{}\addcontentsline{toc}{subsubsection}{\refCom{@rigid}}
+\defnew{v0.3.0\\2019/03/18 }
+Used to make \dac{At} so that the contents won't be deleted
+with \dac{ClearHook}. Note that the necessary hooks might not be
+ registered as rigid. Thus show caution when deleting hooks
+\end{docCommand}
+\begin{docCommand}{thisfilepath}{}\addcontentsline{toc}{subsubsection}{\refCom{thisfilepath}}
+
+ Contains the path to the exercisefile relative to the build file.
+ Useful for inputing files in the same directory as an exercisefile.
+\end{docCommand}
 \begin{docCommand}{exerciseFile}{}\addcontentsline{toc}{subsubsection}{\refCom{exerciseFile}}
 
 This is a `read-only' macro that contains the name of the current exerciseFile
@@ -702,43 +798,54 @@
 \end{docCommand}
 \begin{docCommand}{ppMargin}{}\addcontentsline{toc}{subsubsection}{\refCom{ppMargin}}
 
- Part problem: how far away from the text the part problem labels are.
+ Part problem: how far away from the text the part problem labels are (horisontally).
 \end{docCommand}
-\begin{docCommand}{introMargin}{}\addcontentsline{toc}{subsubsection}{\refCom{introMargin}}
+\begin{docCommand}{introOutdent}{}\addcontentsline{toc}{subsubsection}{\refCom{introOutdent}}
 
  The offset of margins for intros
 \end{docCommand}
 \filbreak\subsection{Macro definitions}
 
- \addcontentsline{mac}{macro}{\refCom{At}}{}
+ \addcontentsline{mac}{macro}{\refCom{@rigid}}{}
+\addcontentsline{mac}{macro}{\refCom{At}}{}
 \addcontentsline{mac}{macro}{\refCom{DeclareExerciseCommand}}{}
 \addcontentsline{mac}{macro}{\refCom{DisplaySolutions}}{}
 \addcontentsline{mac}{macro}{\refCom{HideTags}}{}
+\addcontentsline{mac}{macro}{\refCom{ShowAllTags}}{}
 \addcontentsline{mac}{macro}{\refCom{ShowFilenames}}{}
 \addcontentsline{mac}{macro}{\refCom{ShowNumbers}}{}
 \addcontentsline{mac}{macro}{\refCom{ShowTags}}{}
+\addcontentsline{mac}{macro}{\refCom{SolutionsOnly}}{}
 \addcontentsline{mac}{macro}{\refCom{Trigger}}{}
 \addcontentsline{mac}{macro}{\refCom{about}}{}
+\addcontentsline{mac}{macro}{\refCom{buildall}}{}
 \addcontentsline{mac}{macro}{\refCom{buildset}}{}
 \addcontentsline{mac}{macro}{\refCom{buildsets}}{}
+\addcontentsline{mac}{macro}{\refCom{buildsprite}}{}
 \addcontentsline{mac}{macro}{\refCom{buildtags}}{}
+\addcontentsline{mac}{macro}{\refCom{exb at ClearHook}}{}
 \addcontentsline{mac}{macro}{\refCom{exb at isin}}{}
 \addcontentsline{mac}{macro}{\refCom{exclude}}{}
 \addcontentsline{mac}{macro}{\refCom{exec}}{}
 \addcontentsline{mac}{macro}{\refCom{exerciseFile}}{}
+\addcontentsline{mac}{macro}{\refCom{exercisebankbuild}}{}
 \addcontentsline{mac}{macro}{\refCom{exercisebanksetup}}{}
-\addcontentsline{mac}{macro}{\refCom{introMargin}}{}
+\addcontentsline{mac}{macro}{\refCom{exercisebankversion}}{}
+\addcontentsline{mac}{macro}{\refCom{exercisenote}}{}
+\addcontentsline{mac}{macro}{\refCom{exercisepoints}}{}
+\addcontentsline{mac}{macro}{\refCom{introOutdent}}{}
 \addcontentsline{mac}{macro}{\refCom{makeset}}{}
 \addcontentsline{mac}{macro}{\refCom{makesetdefaults}}{}
 \addcontentsline{mac}{macro}{\refCom{nextproblem}}{}
-\addcontentsline{mac}{macro}{\refCom{orderedselect}}{}
 \addcontentsline{mac}{macro}{\refCom{ownLineNoSpacesGotIt}}{}
 \addcontentsline{mac}{macro}{\refCom{pMarginAbove}}{}
 \addcontentsline{mac}{macro}{\refCom{pMarginBelow}}{}
 \addcontentsline{mac}{macro}{\refCom{pMarginLeft}}{}
+\addcontentsline{mac}{macro}{\refCom{pgref}}{}
 \addcontentsline{mac}{macro}{\refCom{ppMargin}}{}
 \addcontentsline{mac}{macro}{\refCom{ppMarginAbove}}{}
 \addcontentsline{mac}{macro}{\refCom{ppMarginBelow}}{}
+\addcontentsline{mac}{macro}{\refCom{ppgref}}{}
 \addcontentsline{mac}{macro}{\refCom{pplabel}}{}
 \addcontentsline{mac}{macro}{\refCom{ppref}}{}
 \addcontentsline{mac}{macro}{\refCom{pref}}{}
@@ -747,6 +854,8 @@
 \addcontentsline{mac}{macro}{\refCom{setName}}{}
 \addcontentsline{mac}{macro}{\refCom{sprite}}{}
 \addcontentsline{mac}{macro}{\refCom{spritesets}}{}
+\addcontentsline{mac}{macro}{\refCom{thisfilepath}}{}
+\addcontentsline{mac}{macro}{\refCom{totalpoints}}{}
 \addcontentsline{mac}{macro}{\refCom{translateExBank}}{}
 
  \macrotable
@@ -817,10 +926,41 @@
 \newversion{v0.2.2 2018/10/04}
     \change{Made trailing commas ignored in all lists (\dac\makeset,\dac\buildset,\dac\select,\dac\exclude, etc.)}
     \change{Fixed bug where tags wouldn't hide.}
+\newversion{v0.3.0 2019/03/18}
+    \change{Added possibility of custom part problem header from \dac\nextproblem}
+    \change{Added possibility of showing problem only when \dac\DisplaySolutions active}
+    \change{Corrected use of the length \dac\ppMarginBelow}
+    \change{Fixed bug where \dac\phead and \dac\ShowFilenames crash}
+    \change{Introduced \dac\SolutionsOnly}
+    \change{Fixed bug where part problem header repeats if solution is itemize.}
+    \change{Introduced the \dac\@rigid command for the \dac\At functionality. Also the \dac\ClearHook for deleting a hook}
+    \change{\dac\buildset now gives error if set does not exist.}
+    \change{Made \dac\HideTags cummulative.}
+    \change{Created \dac\ShowAllTags for clearing tags list}
+    \change{Raises error when pdfTeX(or pdfLaTeX) is not used}
+    \change{Allow underscore for files in \dac\makeset}
+    \change{Added \dac\exercisepoints for getting total number of points in an exercise/problem.}
+    \change{added \dac\pgref and \dac\ppgref}
+    \change{Margins now more manageable}
+    \change{Prevent overwriting of \dac\graphicspath}
+    \change{Set (append) to \dac\input at path no matter what.}
+    % \change{Fixed bug where part problem headers showing weird if problem started with envs. like enumerate or a figure.}
+    \change{Added command \dac\buildall to build all sets}
+    \change{Moved tag placement for when \dac\ShowTags active}
+    \change{Adjusted margins.}
+    \change{Activated \dac\ppMarginAbove (it now does something)}
+    \change{Added \dac\exercisebankversion and \dac\exercisebankbuild}
+    \change{Part problem header now showing if only one part problem is displayed}
+    \change{Possibility to toggle whether part problem header showing if only one part problem is displayed \refKey{show lonely part problems}}
+    \change{Fixed TeX capacity exceeded error for long exercises.}
+    \change{Added \dac\thisfilepath for getting path of current exercisefile}
+    \change{Changed default spacing}
+    \change{Added \dac\buildsprite}
 \chlogtable
 
 
 % Testers and thanks
 \tester{\gh{thorstengrothe}}
-\tester{\gh{tristelune1}}
+\onethankyou{\gh{tristelune1}}
+% \thankyou{}
  \end{document}

Modified: trunk/Master/texmf-dist/tex/latex/exercisebank/exercisebank.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/exercisebank/exercisebank.sty	2019-03-18 21:15:59 UTC (rev 50447)
+++ trunk/Master/texmf-dist/tex/latex/exercisebank/exercisebank.sty	2019-03-18 21:16:17 UTC (rev 50448)
@@ -1,5 +1,5 @@
 % Source (with comments) can be found at https://github.com/Strauman/exercisebank/
-%% The LaTeX package exercisebank - version v0.2.2 (2018/10/04) - build 97
+%% The LaTeX package exercisebank - version v0.3.0 (2019/03/18) - build 137
 %% exercisebank.sty: Exercise bank
 %% -------------------------------------------------------------------------------------------
 %% Copyright (c) 2018 by Andreas Storvik Strauman <andreas dot s dot strauman at uit dot no>
@@ -13,17 +13,78 @@
 %% 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/10/04 v0.2.2 Creates a setup that gives freedom in making sets and exercises.]
+\ProvidesPackage{exercisebank}[2019/03/18 v0.3.0 Creates a setup that gives freedom in making sets and exercises.]
 \xdef\exbank at quiet{1}
-\def\exercisebankversion{v0.2.2 - Build 97}
-\PackageWarningNoLine{exercisebank-v0.2.2}{This package is in the beta stage, and if something unexpected happens please, oh pretty please, report it to https://github.com/Strauman/exercisebank. Thank you!}
+\def\exercisebankversion{v0.3.0 - Build 137}
+\PackageWarningNoLine{exercisebank-v0.3.0}{This package is in the beta stage, and if something unexpected happens please, oh pretty please, report it to https://github.com/Strauman/exercisebank. Thank you!}
 \@ifundefined{ownLineNoSpacesGotIt}{\@latex at 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{exercisebank}}
 }{}
+\ifcsname pdfstrcmp\endcsname\else
+\PackageError{exercisebank-v0.3.0}{Exercisebank currently only works with pdfLaTeX}{}\stop
+\fi
 \gdef\setExercisesDir#1{\@latex at error{\string\setExercisesDir is deprecated. Use \string\exercisebanksetup{exercise directory=#1} instead}{}\stop\bye
 }
 \@ifundefined{exercisesDir}{\gdef\@exercisesDir{.}
 }{}
 \global\let\incl = \input
+\def\exb at rememberCC#1{%
+	\edef\exbtmp at charcode{\the\numexpr#1}%
+	\expandafter\xdef\csname exb at remcc@\exbtmp at charcode\endcsname{\the\catcode#1}%
+}
+\def\exb at ignoreCC#1{%
+	\edef\exbtmp at charcode{\the\numexpr#1}
+	\exb at rememberCC{\exbtmp at charcode}%
+	\catcode\exbtmp at charcode=9%
+}
+\def\exb at resetCC#1{	\catcode#1=\csname exb at remcc@\the\numexpr#1\endcsname
+}
+\def\ignoreOutlineSpaces{%
+	\exb at ignoreCC{10}%
+	\exb at ignoreCC{11}%
+	\exb at ignoreCC{12}%
+	\exb at ignoreCC{13}%
+}
+\def\obeyOutlineSpaces{%
+	\exb at resetCC{10}%
+	\exb at resetCC{11}%
+	\exb at resetCC{12}%
+	\exb at resetCC{13}\ignorespaces%
+}
+\let\ignoreOutlineSpaces\relax
+\let\obeyOutlineSpaces\relax
+\def\g at newif#1{%
+  \count@\escapechar\escapechar\m at ne
+    \global\let#1\iffalse%
+    \g at if#1\iftrue%
+    \g at if#1\iffalse%
+\escapechar\count@}
+\def\g at if#1#2{%
+  \expandafter\def\csname\expandafter\@gobbletwo\string#1%
+  \expandafter\@gobbletwo\string#2\endcsname%
+  {\global\let#1#2}%
+}
+\global\newif\ifexbset at nextprob@header
+\global\exbset at nextprob@headertrue
+\newif\ifexb at opthides
+\g at newif\ifexb at b@nextprob at header
+\g at newif\ifexb at solutionsonly
+\g at newif\ifexb at isFirstProblem
+\g at newif\ifexb at opt@tightenparagraphs
+\g at newif\ifexb at DisplaySolutions
+\g at newif\ifexb at DisplayCurrentSolution
+\g at newif\ifexb at DisplayCurrentProblem
+\g at newif\ifexbank at if@needspace
+\g at newif\ifexb at opt@partProblems
+\g at newif\ifexb at opt@doMargins
+\g at newif\ifexb at CountIntros
+\g at newif\ifexb at noheadArg
+\g at newif\ifexb at showtags
+\g at newif\ifexb at showCurrent@PPHeader
+\g at newif\ifexb at showLonelyPartProblems
+\global\exb at showLonelyPartProblemsfalse
+\global\exb at showCurrent@PPHeadertrue
+\exb at b@nextprob at headerfalse
+\exbank at if@needspacetrue
 \usepackage{xstring}
 \usepackage{pgffor}
 \usepackage{scrextend}
@@ -60,7 +121,7 @@
 			\fi%
 }%
 	\fi}
-\gdef\exb at warn{\PackageWarningNoLine{exercisebank-v0.2.2}}
+\gdef\exb at warn{\PackageWarningNoLine{exercisebank-v0.3.0}}
 \gdef\exb at err#1{\PackageError{exercisebank}{#1}{}}
 \newif\ifexb at isInList
 \newcounter{exb at isin@dots}
@@ -138,38 +199,39 @@
 \global\catcode`\^^J=12\relax%
 \global\catcode`\ =10\relax%
 }
-\let\nextPar\everypar
+\def\@AtNextParHook{}
+\let\oldep\everypar
+\oldep{\the\everypar}
 \newtoks\everypar
-\nextPar{\the\everypar}
-\def\AtNextPar#1{\nextPar\expandafter{\the\nextPar\nextPar{\the\everypar}#1}}
+\oldep{\the\everypar\@AtNextParHook\relax\gdef\@AtNextParHook{}}
+\def\AtNextPar#1{\g at addto@macro\@AtNextParHook{#1}}
+\gdef\exercisebankversion{\PackageWarningNoLine{exercisebank}{Version v0.3.0b137}}
+\gdef\exercisebankbuild{\PackageWarningNoLine{exercisebank}{Build 137}}
 \edef\@isTrue{1}
 \edef\@isFalse{0}
 \gdef\ShowNumbers{\gdef\@displayMetaCounter{\isTrue}}
-\gdef\exb at showtags{\isFalse}
-\gdef\ShowTags{\gdef\exb at showtags{\isTrue}}
+\global\exb at showtagsfalse
+\gdef\ShowTags{\global\exb at showtagstrue}
 \gdef\exb at printCurrentTags{Tags: \exb at currentTags~}
-\gdef\ShowFilenames{\At\VeryBeginProblem{\exerciseFile\\}}
-\gdef\@DisplaySolutions{\@isFalse}
-\gdef\DisplaySolutions{\xdef\@DisplaySolutions{\isTrue}\@latex at warning{Showing solutions}}
-\gdef\ifDisplaySolutions{\if\@DisplaySolutions\@isTrue}
-\gdef\@SolutionsOnly{\@isFalse}
-\gdef\SolutionsOnly{\xdef\@SolutionsOnly{\@isTrue}\DisplaySolutions}
+\gdef\ShowFilenames{\At\InputExerciseFile{File: {\ttfamily \@exercisesDir/\exerciseFile}\par}}
+\global\exb at DisplaySolutionsfalse
+\gdef\DisplaySolutions{\global\exb at DisplaySolutionstrue\@latex at warning{Showing solutions}}
+\gdef\SolutionsOnly{\DisplaySolutions\global\exb at solutionsonlytrue}
 \gdef\exb at currentPoints{0}
-\newif\ifexbank at if@needspace
-\global\exbank at if@needspacetrue
 \pgfkeys{/exbanksetup/.is family, /exbanksetup,
-default/.style = {  part problems = On,
-  tighten paragraphs = True,
-  problem header={\normalsize\Large\bfseries\@tr{Problem}~\theproblemcounter},
+default/.style = {  part problems = true,
+  tighten paragraphs = true,
+  problem header={\Large\bfseries\@tr{Problem}~\theproblemcounter},
   part problem header={\large\textbf{(\theproblemcounter\alph{partproblemcounter})}},
   part problem header suffix={},
   solution header={\large{\textbf{\@tr{Solution}:}}},
   exercise directory=.,
   figure root directory=\@exercisesDir,
-  style margins=On,
+  style margins=true,
   problem needs space=0.2\paperheight,
-  no needspace/.is if={exbank at if@needspace},
-  no needspace/.default = false
+  needspace/.is if={exbank at if@needspace},
+  no needspace/.code = {\global\ifexbank at if@needspacefalse},
+  show lonely part problems/.is if={exb at showLonelyPartProblems}
 },
 exercise directory/.estore in = \@exercisesDir, %
 figure root directory/.estore in = \@figrootDir, %
@@ -180,9 +242,9 @@
 solution header/.store in = \exbank at opt@solutionHeader,
 problem needs space/.store in = \exbank at opt@problemneedspace,
 part problem header suffix/.store in=\exb at partproblem@header at suffix,
-part problems/.style = {switches/#1/.get = \exbank at opt@partProblems},
-tighten paragraphs/.style = {switches/#1/.get = \exbank at opt@tightenparagraphs},
-style margins/.style={switches/#1/.get = \exbank at opt@doMargins},
+part problems/.is if = {exb at opt@partProblems},
+tighten paragraphs/.is if = {exb at opt@tightenparagraphs},
+style margins/.is if ={exb at opt@doMargins},
 switches/.cd,
   On/.initial = \@isTrue,
   on/.initial = \@isTrue,
@@ -198,24 +260,59 @@
 \exercisebanksetup{default}
 \AtBeginDocument{\xdef\tpd{\the\prevdepth}}
 \gdef\tighten at paragraph{%
-\if\exbank at opt@tightenparagraphs\@isTrue\relax%
-      \filbreak%
+\ifexb at opt@tightenparagraphs\relax%
+  \filbreak%
 \fi%
 }
 \gdef\tighten at paragraph@solutions{%
-\if\exbank at opt@tightenparagraphs\@isTrue\relax%
-  \if\@SolutionsOnly\@isFalse
-    \if\@DisplaySolutions\@isTrue
-      \filbreak%
-    \fi
+\ifexb at opt@tightenparagraphs%
+  \ifexb at DisplaySolutions%
+    \filbreak%
   \fi
 \fi%
 }
 \gdef\tighten at paragraph@always{%
-\if\exbank at opt@tightenparagraphs\@isTrue\relax%
+\ifexb at opt@tightenparagraphs%
 \filbreak%
 \fi%
 }
+\@dlog{unfilbreak at exercisebank}
+\@ifdefinable\@My at filbreak@counter{\newcount\@My at filbreak@counter}
+\global \@My at filbreak@counter = 0
+\@ifdefinable\@My at filbreak@mark{\newmarks\@My at filbreak@mark}
+\renewcommand*\filbreak{%
+    \par
+    \global\advance \@My at filbreak@counter \@ne
+    \marks\@My at filbreak@mark{\number\@My at filbreak@counter}%
+    \vfil
+    \penalty -200
+    \vfilneg
+}
+\newcommand*\@My at finish@stopfilbreak{}
+\newcommand*\stopfilbreak{%
+    \par
+    \ifnum\prevdepth >\@m \else\prevdepth \z@ \fi
+    \nobreak\null
+    \nobreak\vskip -\baselineskip
+    \penalty\z@
+    \begingroup
+        \output{%
+            \typeout{t: \the\pagetotal, g: \the\pagegoal}%
+            \unvbox\@cclv
+            \ifnum 0\topmarks\@My at filbreak@mark <\@My at filbreak@counter
+                \gdef\@My at finish@stopfilbreak{%
+                    \penalty\z@%
+}%
+            \else
+                \gdef\@My at finish@stopfilbreak{%
+                    \penalty\z@ %
+}%
+            \fi
+}%
+        \break
+    \endgroup
+    \@My at finish@stopfilbreak
+}
 \pgfkeys{ /exbanki18n/.is family, /exbanki18n,
   default/.style = {Problem = Problem, Solution = Solution},
   Problem/.estore in = \@tr at Problem,
@@ -229,42 +326,63 @@
   \csname @tr@#1\endcsname%
 }%
 }
+\newif\ifat at isrigid
 \let\ea = \expandafter
 \begingroup\lccode`\|=`\\
 \lowercase{\endgroup\def\removebs#1{\if#1|\else#1\fi}}
 \ifcsname at at verbose\endcsname
-\global\def\@triggerLog#1{\@latex at warning{--\string\TRIGGER: #1}}%
+	\global\def\@triggerLog#1{\@latex at warning{--\string\TRIGGER: #1}}%
 \else
-\global\let\@triggerLog\@gobble%
+	\global\let\@triggerLog\@gobble%
 \fi
-\newcommand{\At}[2]{  \edef\mname{\exbank at macroname{#1}}%
-  \ifcsname At@\mname\endcsname%
-    \ea\g at addto@macro\csname At@\mname\endcsname{#2}%
-  \else%
-    \ea\gdef\csname At@\mname\endcsname{#2}%
-    \AtEndDocument{%
-        \expandafter\let\csname At@\mname\endcsname\relax%
+\newcommand{\At}[2]{%
+	\edef\mname{\exbank at macroname{#1}}%
+	\ifcsname At@\mname\endcsname%
+		\ea\g at addto@macro\csname At@\mname\endcsname{#2}%
+	\else%
+    \ifat at isrigid
+      \ea\gdef\csname Rigid at At@\mname\endcsname{#2}%
+    \else
+      \ea\gdef\csname At@\mname\endcsname{#2}%
+    \fi%
+	\fi%
+	\global\at at isrigidfalse%
 }
-  \fi%
-}
+\let\@rigid\at at isrigidtrue
 \newcommand{\Trigger}[1]{%
-  \edef\mname{\exbank at macroname{#1}}%
-  \ea\@ifundefined{At@\mname}{}{%
-  \@triggerLog{\mname}\csname At@\mname\endcsname%
+	\edef\mname{\exbank at macroname{#1}}%
+  \ea\@ifundefined{Rigid at At@\mname}{}{%
+		\@triggerLog{\mname}\csname Rigid at At@\mname\endcsname%
 }%
+	\ea\@ifundefined{At@\mname}{}{%
+		\@triggerLog{\mname}\csname At@\mname\endcsname%
+}%
 }
+\newcommand{\exb at ClearHook}[1]{%
+	\edef\mname{\exbank at macroname{#1}}%
+	\expandafter\let\csname At@\mname\endcsname\relax%
+  \ifat at isrigid
+    \expandafter\let\csname Rigid at At@\mname\endcsname\relax%
+  \fi
+	\global\at at isrigidfalse%
+}
 \xdef\figuresPath{\@figrootDir/}
 \gdef\fileInputPath{}
+\gdef\thisfilepath{} %
 \gdef\fileInputBase{}
+\@ifundefined{input at path}{\gdef\input at path{}}{}
+\AtBeginDocument{%
 \providecommand*{\input at path}{}
-\g at addto@macro\input at path{{\fileInputBase}{\fileInputPath}}
+\providecommand*{\Ginput at path}{}
+\g at addto@macro\input at path{{\fileInputBase}{\fileInputPath}}%
+\g at addto@macro\Ginput at path{{\fileInputBase}{\fileInputPath}}%
+}
 \At\PathControl{  \xdef\figuresPath{\@figrootDir/}
   \edef\exfile{\exerciseFile}
   \expandafter\filename at parse{\exfile}
+  \xdef\thisfilepath{\@exercisesDir/\filename at area}
   \xdef\fileInputPath{\figuresPath\filename at area}
   \xdef\fileInputBase{\figuresPath\filename at area\filename at base/}
-  \graphicspath{{\fileInputBase}{\fileInputPath}}
-  \@ifundefined{input at path}{\gdef\input at path{{\fileInputBase}{\fileInputPath}}}{}
 }
 \newlength{\pMarginBelow}
 \newlength{\pMarginAbove}
@@ -272,43 +390,36 @@
 \newlength{\ppMarginBelow}
 \newlength{\ppMarginAbove}
 \newlength{\ppMargin}
-\newlength{\introMargin}
-\newlength{\solutionMarginLeft}
+\newlength{\introOutdent}
 \newlength{\solutionMarginAbove}
-\edef\defaultLeftMargin{\the\dimexpr1in+\hoffset}
+\setlength\parindent{0pt}
+\setlength{\pMarginLeft}{-\ppMargin-2.5em}
+\setlength{\pMarginBelow}{1.5em \@plus .5em \@minus .5em}
+\setlength{\pMarginAbove}{0pt}
 \setlength{\ppMargin}{0.5em}
-\setlength{\pMarginLeft}{-\ppMargin-2.5em}
-\setlength{\solutionMarginLeft}{\ppMargin}
+\setlength{\ppMarginBelow}{0em}
+\setlength{\ppMarginAbove}{0.5\baselineskip}
+\setlength{\introOutdent}{1em}
 \setlength{\solutionMarginAbove}{1em}
-\setlength{\pMarginBelow}{0em}
-\setlength{\pMarginAbove}{\baselineskip}
-\setlength{\introMargin}{-1.5em}
-\setlength{\ppMarginBelow}{\baselineskip}
-\setlength{\ppMarginAbove}{0em}
-\setlength\parindent{0pt}
-\newbox\ppmarkbox
-\newlength\markskip
-\setlength\markskip{4\baselineskip}
-\def\solMargin{\dimexpr\ppMargin\relax}
-\def\vsSize{1em}
-\def\vs{\vspace{\vsSize}}
 \newcounter{problemcounter}
 \setcounter{problemcounter}{0}
 \newcounter{partproblemcounter}
 \At\VeryBeginProblem{%
-	\if\exbank at opt@tightenparagraphs\@isTrue\relax%
+	\ifexb at opt@tightenparagraphs%
 	\ifexbank at if@needspace\needspace{\exbank at opt@problemneedspace}\fi%
-	\vskip-2\baselineskip\relax%
 	\fi%
 	\stepcounter{problemcounter}%
 	\setcounter{partproblemcounter}{0}%
-	\vspace*{\pMarginAbove}%
-  \strut\vadjust{\vbox to 0pt{\if\exbank at opt@doMargins\@isTrue\hskip\pMarginLeft\fi{\exbank at opt@problemHeader}\vss}}\par%
-	\vspace*{\the\dimexpr\baselineskip+\pMarginBelow}%
+	\vspace\pMarginAbove%
+  \strut\vadjust{\vbox to 0pt{\ifexb at opt@doMargins\relax\hskip\pMarginLeft\fi{\exbank at opt@problemHeader}\vss}}\par%
+	\vspace\pMarginBelow\relax%
 }
 \At\EndProblem{%
 \tighten at paragraph%
 }%
+\At\BeginPartproblem{%
+\vspace\ppMarginAbove\relax%
+}
 \At\VeryBeginPartproblem{%
 \@dinfo{Triggered Beginning Part Problem (\string\VeryBeginPartproblem)}%
 	\stepcounter{partproblemcounter}%
@@ -318,152 +429,201 @@
 	\if\@displayMetaCounter\@isTrue\relax%
 		\gdef\exb at prePPHead{{\Large\themetacounter}:}%
 	\fi%
-	\if\exb at showtags\isTrue%
-		\gdef\exb at postPPHead{\exb at printCurrentTags}%
+	\ifexb at showtags%
+		\g at addto@macro\exb at postPPHead{\exb at printCurrentTags}%
 	\fi%
-\ifnum\pdfstrcmp{\exbank at opt@doMargins}{\@isTrue}=\z@\relax%
-\newbox\nobox%
-\gdef\exb at pp@lefttag{\leavevmode{\smash{\llap{{\exb at prePPHead\exbank at opt@partProblemHeader\Trigger\PartProblemHeaderSuffix}\hskip\ppMargin}\exb at postPPHead}}}%
+\ifexb at opt@doMargins%
+\let\exb at partProblemHeader\exbank at opt@partProblemHeader%
+\ifexb at b@nextprob at header\relax%
+	\global\exb at b@nextprob at headerfalse%
+	\addtocounter{partproblemcounter}{-1}%
+	\let\exb at partProblemHeader\exb at nextprob@header%
+\fi%
+\gdef\exb at pp@lefttag{\leavevmode{\smash{\llap{{\exb at prePPHead\exb at partProblemHeader\Trigger\PartProblemHeaderSuffix}\hskip\ppMargin}\exb at postPPHead}}}%
 \else%
-\gdef\exb at pp@lefttag{{\exbank at opt@partProblemHeader\Trigger\PartProblemHeaderSuffix}}%
+\gdef\exb at pp@lefttag{{\exb at partProblemHeader\Trigger\PartProblemHeaderSuffix}}%
 \fi%
-\AtNextPar{\exb at pp@lefttag}%
-\ignorespaces}%
+\ifexb at showCurrent@PPHeader%
+\AtNextPar{\exb at pp@lefttag\global\let\exb at pp@lefttag\relax\Trigger\AfterPPHeader}\par%
+\else%
+\par%
+\fi\ignorespaces}%
 \At\EndPartproblem{%
-	\vspace*{\pMarginBelow}%
-	\tighten at paragraph\par%
+	\vspace\ppMarginBelow\relax%
+	\tighten at paragraph%
+	\global\exb at showCurrent@PPHeadertrue
 }
-\At\BeginSolution{\hfill\break\vspace*{\solutionMarginAbove}{\exbank at opt@solutionHeader}}
+\At\BeginSolution{\ifexb at solutionsonly\else\hfill\break\vspace{\solutionMarginAbove}\fi{\exbank at opt@solutionHeader}}
 \At\EndSolution{}
-\newif\ifexb at opthides
+\newcounter{numppInFile}
+\At\BeginPartproblem{%
+	\ifcsname exb at numexercises@\the\numexpr\the\c at problemcounter\endcsname%
+	\edef\numppex{\csname exb at numexercises@\the\numexpr\the\c at problemcounter\endcsname}%
+	\ifnum\numppex=\@ne%
+		\ifexb at showLonelyPartProblems\else%
+		\global\exb at showCurrent@PPHeaderfalse%
+		\fi
+	\fi%
+	\fi%
+	\stepcounter{numppInFile}%
+}
+\At\EndProblem{%
+	\immediate\write\@auxout{\string\expandafter\string\gdef\string\csname\space exb at numexercises@\the\numexpr\the\c at problemcounter\endcsname{\the\c at numppInFile}}%
+	\setcounter{numppInFile}{0}%
+}
 \providecommand\exb at currentTags{}
+\providecommand\exb at nextprob@header{}
 \pgfkeys{/exbank/problems/.cd,%
-default/.style={hide=false,tag=\relax},%
+initial style/.style={hide=false,tag=\relax,reset pp head},%
+default/.style={initial style},
 hide/.is if={exb at opthides},%
 tags/.estore in=\exb at currentTags,%
-tag/.code={\pgfkeysalso{tags={#1}}}%
+tag/.code={\pgfkeysalso{tags={#1}}},
+head/.code={\global\exb at b@nextprob at headertrue\gdef\exb at nextprob@header{#1}},%
+reset pp head/.code={\global\exb at b@nextprob at headerfalse},
+solution only/.code={\ifexb at DisplaySolutions\else\pgfkeysalso{/exbank/problems/hide=true}\fi},
+reset to default/.code=\pgfkeysalso{/exbank/problems/default/.style={initial style}}
 }
 \def\nextproblem{\pgfqkeys{/exbank/problems}}
+\def\resetnextproblems{\nextproblem{reset to default}}
+\def\nextproblems#1{%
+\edef\nextprobargs{{default/.style={#1}}}%
+\expandafter\nextproblem\nextprobargs%
+}
+\newcounter{exb at cutfilecounter}
+\global\let\do at ProcessCutFile = \ProcessCutFile
 \At\EndProblem{%
-\if\exbank at opt@tightenparagraphs\@isTrue\relax%
-  \if\@SolutionsOnly\@isFalse%
-    \if\@DisplaySolutions\@isTrue%
-      \penalty-300%
-    \fi%
-  \fi%
-\fi%
+	\ifexb at opt@tightenparagraphs\relax%
+		\ifexb at DisplaySolutions%
+			\penalty-300%
+		\fi%
+	\fi%
 }
-\@ifundefined{figure}{}{\edef\figure{\unexpanded{\tighten at paragraph@always}\unexpanded\expandafter{\figure}}
+\@ifundefined{figure}{}{	\edef\figure{\unexpanded{\tighten at paragraph@always}\unexpanded\expandafter{\figure}}
 }
-\@ifundefined{endfigure}{}{\g at addto@macro\endfigure{\tighten at paragraph@always}
+\@ifundefined{endfigure}{}{	\g at addto@macro\endfigure{\tighten at paragraph@always}
 }
 \gdef\isFalse{0}
 \gdef\isTrue{1}
-\gdef\DisplayProblem{\isTrue}
+\global\exb at DisplayCurrentProblemtrue
 \gdef\@displayMetaCounter{\isFalse}
-\AtBeginDocument{  \if\@DisplaySolutions\isFalse
-    \@latex at warning{Hiding solutions. Show them with \string\DisplaySolutions}
-  \fi
+\AtBeginDocument{	\ifexb at DisplaySolutions\else
+		\@latex at warning{Hiding solutions. Show them with \string\DisplaySolutions}
+	\fi
 }
-\global\let\do at ProcessCutFile = \ProcessCutFile
 \newif\ifexb at isdisplaying
-\newif\ifexb at hidenextsol
-\global\exb at hidenextsolfalse
-\gdef\exb at ifshowproblem#1#2{\exb at isdisplayingfalse\ifnum\pdfstrcmp{\DisplayProblem}{\@isTrue}=\z@\ifexb at opthides\else\exb at isdisplayingtrue\fi\fi%
-\ifexb at isdisplaying#1\else#2\fi}
-\gdef\showhideproblem#1{%
-\exb at ifshowproblem{\let\ProcessCutFile\do at ProcessCutFile#1\global\exb at hidenextsolfalse}{\def\ProcessCutFile{}\global\exb at hidenextsoltrue}%
+\long\gdef\exb at ifshowproblem#1#2{%
+	\exb at isdisplayingfalse%
+	\ifexb at DisplayCurrentProblem%
+		\ifexb at opthides\else\exb at isdisplayingtrue\fi\fi%
+	\ifexb at isdisplaying#1\else#2\fi%
 }
+\long\gdef\showhideproblem#1{%
+	\exb at ifshowproblem{\let\ProcessCutFile\do at ProcessCutFile#1\global\exb at DisplayCurrentSolutiontrue}{\def\ProcessCutFile{}\global\exb at DisplayCurrentSolutionfalse}%
+}
 \generalcomment{problem}{%
-  \edef\DisplaySolution{\@DisplaySolutions}%
-  \stepcounter{metacounter}%
-  \@dinfo{problem: Triggering \string\DecideProblemDisplay}%
-  \Trigger\DecideProblemDisplay%
-  \@dinfo{problem:Executing - \string\showhideproblem}%
-     \showhideproblem{%
-        \if\exbank at opt@partProblems\isTrue
-            \Trigger\BeginPartproblem%
-            \Trigger\VeryBeginPartproblem%
-        \else%
-            \Trigger\BeginProblem%
-            \Trigger\VeryBeginProblem%
-        \fi%
+	\ifexb at DisplaySolutions
+		\global\exb at DisplayCurrentSolutiontrue\else\global\exb at DisplayCurrentSolutionfalse
+	\fi
+	\stepcounter{metacounter}%
+	\@dinfo{problem: Triggering \string\DecideProblemDisplay}%
+	\Trigger\DecideProblemDisplay%
+	\@dinfo{problem:Executing - \string\showhideproblem - \the\c at problemcounter}%
+	\showhideproblem{%
+		\ifexb at opt@partProblems%
+			\ifexb at solutionsonly\else
+				\Trigger\BeginPartproblem%
+				\Trigger\VeryBeginPartproblem%
+			\fi
+		\else%
+			\Trigger\BeginProblem%
+			\Trigger\VeryBeginProblem%
+		\fi%
 }%
-}{\@dinfo{Ending problem env}%
-    \if\DisplayProblem\@isTrue\relax%
-      \if\exbank at opt@partProblems\@isTrue\relax%
-        \Trigger\EndPartproblem%
-        \tighten at paragraph\fi%
-      \else
-        \Trigger\EndProblem%
-    \fi%
-\@dinfo{Ended problem env}%
+	\ifexb at solutionsonly\def\ProcessCutFile{}\ifexb at DisplayCurrentProblem\relax\stepcounter{partproblemcounter}\fi\fi
+}{%
+	\@dinfo{Ending problem env \the\c at problemcounter}%
+	\ifexb at DisplayCurrentProblem\relax%
+		\ifexb at opt@partProblems\relax%
+			\Trigger\EndPartproblem%
+			\tighten at paragraph
+		\else
+			\Trigger\EndProblem%
+		\fi%
+	\fi%
+	\@dinfo{Ended problem env}%
 }
 \g at addto@macro\AfterproblemComment{\nextproblem{default}\ignorespaces}%
-\generalcomment{solution}{\@dinfo{START solution ENV}%
-\Trigger\AtBeginSolutionHard
-\begingroup
-  \if\@DisplaySolutions\isTrue
-    \if\DisplayProblem\isFalse
-      \xdef\DisplaySolution{\isFalse}
-    \fi
-  \fi
-  \if\DisplaySolution\isTrue
-    \ifexb at hidenextsol\else\Trigger\BeginSolution\fi
-  \else
-    \def\ProcessCutFile{}
-  \fi
+\generalcomment{solution}{%
+	\@dinfo{START solution ENV}%
+	\Trigger\AtBeginSolutionHard
+	\begingroup
+	\ifexb at DisplaySolutions%
+		\ifexb at DisplayCurrentProblem\else%
+			\global\exb at DisplayCurrentSolutionfalse
+		\fi
+	\else
+		\global\exb at DisplayCurrentSolutionfalse
+	\fi
+	\ifexb at DisplayCurrentSolution%
+		\let\ProcessCutFile\do at ProcessCutFile%
+		\ifexb at solutionsonly\AtNextPar{\leavevmode\smash{\llap{\exbank at opt@partProblemHeader}}\Trigger\AfterPPHeader}\fi%
+		\ifexb at DisplayCurrentSolution\Trigger\BeginSolution\fi%
+	\else
+		\def\ProcessCutFile{}%
+	\fi
 }{%
-\if\DisplaySolution\isTrue
-\Trigger\EndSolution
-\tighten at paragraph@solutions
-\vspace*{0.5em}
-\fi
-\endgroup
-\Trigger\EndSolutionHard\@dinfo{END solution ENV}%
+	\ifexb at DisplayCurrentSolution%
+		\Trigger\EndSolution
+		\tighten at paragraph@solutions
+		\vspace{0.5em}
+	\fi
+	\endgroup
+	\Trigger\EndSolutionHard\@dinfo{END solution ENV}%
 }
 \g at addto@macro\AftersolutionComment{\ignorespaces}
-\def\intromargin#1{%
-\if\exbank at opt@doMargins\@isTrue%
-\gdef\endintromargin{\endlist\endgroup}%
-\begingroup\list{}{\leftmargin#1}\item[]%
-\else%
-\relax\global\let\endintromargin=\relax\fi%
+\def\exb at intromargin{%
+	\ifexb at opt@doMargins\relax%
+		\gdef\exb at endintromargin{\endlist\endgroup}%
+		\begingroup\list{}{\leftmargin-\introOutdent}\item[]%
+	\else%
+		\relax\global\let\exb at endintromargin=\relax\fi%
 }
 \generalcomment{intro}{\@dinfo{START intro ENV}%
-  \if\@countIntros\isTrue%
-    \stepcounter{metacounter}%
-    \Trigger\DecideProblemDisplay%
-    \gdef\exb at pre@intro{}%
-    \gdef\exb at post@intro{}%
-    \if\@displayMetaCounter\isTrue\relax%
-    \gdef\exb at pre@intro{{\leavevmode{\llap{{\Large\themetacounter}:\hspace*{-\pMarginLeft}}}}\ignorespaces}%
-    \fi%
-    \if\exb at showtags\isTrue%
-    \xdef\exb at post@intro{\exb at printCurrentTags}%
-    \fi%
-    \if\@spriteMode\@isTrue%
-      \if\introarg\@isTrue%
-        \stepcounter{partproblemcounter}%
-      \fi%
-    \fi%
-    \gdef\@displayIntro{\@isFalse}
-    \showhideproblem{%
-      \tighten at paragraph%
-      \Trigger\BeginIntro\exb at pre@intro\exb at post@intro%
-      \gdef\@displayIntro{\@isTrue}
+	\ifexb at CountIntros%
+		\stepcounter{metacounter}%
+		\Trigger\DecideProblemDisplay%
+		\gdef\exb at pre@intro{}%
+		\gdef\exb at post@intro{}%
+		\if\@displayMetaCounter\isTrue\relax%
+			\gdef\exb at pre@intro{{\leavevmode{\llap{{\Large\themetacounter}:\hspace*{-\pMarginLeft}}}}\ignorespaces}%
+		\fi%
+		\ifexb at showtags%
+			\xdef\exb at post@intro{\exb at printCurrentTags}%
+		\fi%
+		\if\@spriteMode\@isTrue%
+			\if\introarg\@isTrue%
+				\stepcounter{partproblemcounter}%
+			\fi%
+		\fi%
+		\gdef\@displayIntro{\@isFalse}%
+		\showhideproblem{%
+			\tighten at paragraph%
+			\Trigger\BeginIntro\exb at pre@intro\exb at post@intro%
+			\gdef\@displayIntro{\@isTrue}%
 }%
-  \exb at ifshowproblem{\intromargin{-1em}}{}
-  \else%
-  \intromargin{-1em}
-  \fi%
-}{  \if\@countIntros\isTrue%
-    \Trigger\EndIntro%
-    \exb at ifshowproblem{\endintromargin}{}
-  \else
-    \endintromargin
-  \fi%
-  \@dinfo{END intro ENV}\ignorespaces%
+		\exb at ifshowproblem{\exb at intromargin}{}%
+	\else%
+		\exb at intromargin%
+	\fi%
+	\ifexb at solutionsonly\def\ProcessCutFile{}\fi
+}{	\ifexb at CountIntros%
+		\Trigger\EndIntro%
+		\exb at ifshowproblem{\exb at endintromargin}{}
+	\else
+		\exb at endintromargin
+	\fi%
+	\@dinfo{END intro ENV}\ignorespaces%
 }
 \g at addto@macro\AfterintroComment{\nextproblem{default}\ignorespaces}
 \def\squeeze{  \newlength{\marginw}
@@ -504,18 +664,18 @@
 \global\exb at tagbuildmodefalse
 \global\let\emptyList\exb at emptyList
 \global\let\exb at tagList\exb at emptyList
-\gdef\ifppMode#1{  \def\mname{\exbank at macroname{#1}}
-  \strif\mname\ppMode
+\gdef\ifppMode#1{	\def\mname{\exbank at macroname{#1}}
+	\strif\mname\ppMode
 }
-\gdef\isppMode#1#2{  \edef\mname{\exbank at macroname{#1}}
-  \strif{\exbank at macroname{#1}}{\ppMode}\relax#2\fi
+	\gdef\isppMode#1#2{	\edef\mname{\exbank at macroname{#1}}
+	\strif{\exbank at macroname{#1}}{\ppMode}\relax#2\fi
 }
 \gdef\@ifppMode#1{%
-\ifnum\pdfstrcmp{\exbank at macroname{#1}}{\ppMode}=\z@%
-\expandafter\@firstofone%
-\else%
-\expandafter\@noneofone%
-\fi%
+	\ifnum\pdfstrcmp{\exbank at macroname{#1}}{\ppMode}=\z@%
+		\expandafter\@firstofone%
+	\else%
+		\expandafter\@noneofone%
+	\fi%
 }%
 \def\pm at Exclude{exclude}
 \def\pm at Select{select}
@@ -523,84 +683,93 @@
 \let\ipm\@ifppMode
 \let\T@\isTrue
 \let\F@\isFalse
+\def\exb at DPT{\global\exb at DisplayCurrentProblemtrue}
+\def\exb at DPF{\global\exb at DisplayCurrentProblemfalse}
 \At\DecideProblemDisplay{%
-    \ifnum\pdfstrcmp{\ppList}{\emptyList}=\z@\relax%
-      \xdef\DisplayProblem{\ipm\exclude\T@\ipm\select\F@}
-    \fi
-    \exb at int@isin{\themetacounter}{\ppList}{      \xdef\DisplayProblem{\ipm\exclude\F@\ipm\select\T@\ipm\normal\T@}
-}{      \xdef\DisplayProblem{\ipm\exclude\T@\ipm\select\F@\ipm\normal\T@}
+	\ifnum\pdfstrcmp{\ppList}{\emptyList}=\z@\relax%
+		\ipm\exclude\exb at DPT\ipm\select\exb at DPF
+	\fi
+	\exb at int@isin{\themetacounter}{\ppList}{		\ipm\exclude\exb at DPF\ipm\select\exb at DPT\ipm\normal\exb at DPT
+}{		\ipm\exclude\exb at DPT\ipm\select\exb at DPF\ipm\normal\exb at DPT
 }
-\ifexb at tagbuildmode
-\ifnum\pdfstrcmp{\DisplayProblem}{\T@}=\z@\relax%
-\exb at intersection@any{\exb at currentTags}{\exb at tagList}{\global\exb at opthidesfalse}{\global\exb at opthidestrue\xdef\DisplayProblem{0}}%
-\fi
-\fi
+	\ifexb at tagbuildmode
+		\ifexb at DisplayCurrentProblem\relax%
+			\exb at intersection@any{\exb at currentTags}{\exb at tagList}{\global\exb at opthidesfalse}{\global\exb at opthidestrue\global\exb at DisplayCurrentProblemfalse}%
+		\fi
+	\fi
 }
 \gdef\introarg{\@isFalse}
-\gdef\noheadarg{\@isFalse}
-\pgfkeys{ /makeset/.is family, /makeset,
- default/.style = {},
- intro/.style = {introarg=\@isTrue},
- nointro/.style = {introarg=\@isFalse},
- nohead/.style = {noheadarg=\@isTrue},
- head/.style = {noheadarg=\@isFalse},
- introarg/.estore in = \introarg,
- noheadarg/.estore in = \noheadarg
+\pgfkeys{	/makeset/.is family, /makeset,
+	default/.style = {noheadarg=false},
+	intro/.style = {introarg=\@isTrue},
+	nointro/.style = {introarg=\@isFalse},
+	nohead/.style = {noheadarg=true},
+	head/.style = {noheadarg=false},
+	introarg/.estore in = \introarg,
+	noheadarg/.is if = {exb at noheadArg},
 }
 \gdef\makesetdefaults#1{%
-\edef\exb at setpgfkeys{{\unexpanded\expandafter{/makeset/default/.style = {#1}}}}%
-\expandafter\pgfkeys\exb at setpgfkeys%
+	\edef\exb at setpgfkeys{{\unexpanded\expandafter{/makeset/default/.style = {#1}}}}%
+	\expandafter\pgfkeys\exb at setpgfkeys%
 }
 \pgfkeys{/makeset/override/.cd,
-intro/.code = {\gdef\introarg{\@isTrue}\ea\gdef\csname setlist@\exb at currentSetID @intro\endcsname{\@isTrue}},
-nointro/.code = {\gdef\introarg{\@isFalse}\ea\gdef\csname setlist@\exb at currentSetID @intro\endcsname{\@isFalse}},
-nohead/.code = {\gdef\noheadarg{\@isTrue}\ea\gdef\csname setlist@\exb at currentSetID @nohead\endcsname{\@isTrue}}
+	intro/.code = {\gdef\introarg{\@isTrue}\ea\gdef\csname setlist@\exb at currentSetID @intro\endcsname{\@isTrue}},
+	nointro/.code = {\gdef\introarg{\@isFalse}\ea\gdef\csname setlist@\exb at currentSetID @intro\endcsname{\@isFalse}},
+	nohead/.code = {\exb at noheadArgtrue\ea\gdef\csname setlist@\exb at currentSetID @nohead\endcsname{\@isTrue}}
 }
 \gdef\@listOfSets{}
 \gdef\@spriteMode{\isFalse}
 \gdef\exbank at spriteSets{\emptyList}
-\long\gdef\spritesets#1{  \gdef\exbank at spriteSets{#1}
+\long\gdef\spritesets#1{	\gdef\exbank at spriteSets{#1}
 }
-\global\let\exlist at protect\noexpand
-\newcommand\makeset[3][]{  \xdef\thissetid{#2}
-  \ea\xdef\csname setkeys@\thissetid\endcsname{#1}
-  \pgfkeys{/makeset, default, #1}%
-  \if\introarg\isTrue%
-    \gdef\introarg{\isTrue}
-    \ea\gdef\csname setlist@#2 at intro\endcsname{\isTrue}
-  \fi
-  \if\noheadarg\isTrue%
-    \ea\gdef\csname setlist@#2 at nohead\endcsname{\isTrue}
-  \fi
-  \ea\gdef\csname setlist@#2\endcsname{\exlist at protect{#3}}
-  \def\setmacro{\unexpanded\expandafter{\csname setlist@#2\endcsname}}
-  \g at addto@macro\@listOfSets{,#2}
+\gdef\exb at listofsetnames{}
+\global\let\exlist at protect\unexpanded
+\newcommand\makeset[3][]{	\xdef\thissetid{#2}
+	\xdef\exb at listofsetnames{\unexpanded\expandafter{\exb at listofsetnames}\thissetid,}
+	\ea\xdef\csname setkeys@\thissetid\endcsname{#1}
+	\pgfkeys{/makeset, default, #1}%
+	\if\introarg\isTrue%
+		\gdef\introarg{\isTrue}
+		\ea\gdef\csname setlist@#2 at intro\endcsname{\isTrue}
+	\fi
+	\ifexb at noheadArg%
+		\ea\gdef\csname setlist@#2 at nohead\endcsname{\isTrue}
+	\fi
+	\ea\gdef\csname setlist@#2\endcsname{\exlist at protect{#3}}
+	\def\setmacro{\unexpanded\expandafter{\csname setlist@#2\endcsname}}
+	\g at addto@macro\@listOfSets{,#2}
 }
 \long\gdef\about#1{}
+\newcommand\buildall{%
+\edef\tmpargs{{\exb at listofsetnames}}
+\dlog{\tmpargs}
+\expandafter\buildsets\tmpargs
+}
 \newcommand\sprite[1][4]{\squeeze
 \gdef\@spriteMode{\isTrue}
 \long\def\about##1{{\Large\textbf{About}:\\[1.1em]##1\\[1.5em]}}
 \pgfpagesuselayout{#1 on 1}[a4paper,border shrink=5mm]
 \ifnum\pdfstrcmp{\exbank at spriteSets}{\emptyList}=\z@\relax%
-  \edef\sprite at setlist{\ea\@secondoftwo\@listOfSets}
-  \readlist*\list at sprite@setlist\sprite at setlist
-  \foreachitem\set\in\list at sprite@setlist{    \edef\theset{{\set}}
-    \if\theset\empty\relax\else%
-    \buildset{\set}%
-    \fi%
+	\edef\sprite at setlist{\ea\@secondoftwo\@listOfSets}
+	\readlist*\list at sprite@setlist\sprite at setlist
+	\foreachitem\set\in\list at sprite@setlist{		\edef\theset{{\set}}
+		\if\theset\empty\relax\else%
+			\buildset{\set}%
+		\fi%
 }
 \else
-  \edef\sprite at setlist{\exbank at spriteSets}
-  \readlist*\list at sprite@setlist\sprite at setlist
-  \foreachitem\set\in\list at sprite@setlist{    \edef\theset{{\set}}
-    \if\theset\empty\relax\else%
-    \buildex{\set}%
-    \fi%
+	\edef\sprite at setlist{\exbank at spriteSets}
+	\readlist*\list at sprite@setlist\sprite at setlist
+	\foreachitem\set\in\list at sprite@setlist{		\edef\theset{{\set}}
+		\if\theset\empty\relax\else%
+			\buildex{\set}%
+		\fi%
 }
 \fi
 }
 \gdef\exbank at setEnv@normal#1{\exbank at setEnv{#1}{normal}
 }
+\gdef\exerciseFile{}%
 \newcommand{\exbank at setEnv}[3][{-1}]{  \if\@spriteMode\isFalse%
     \gdef\ppList{#1}
     \gdef\exerciseFile{#2}
@@ -611,31 +780,32 @@
     \gdef\ppMode{\pm at Normal}
   \fi
 }
+\global\let\exb at execChar\relax
 \global\let\ex at protect\noexpand
-\long\gdef\exec#1{:\ex at protect{#1}}
-\gdef\exb at def@makeset at cmd#1{\@ifnextchar[{\@exb at def@makeset at cmd{#1}}{\@exb at def@makeset at cmd{#1}[0]}}
-\gdef\@exb at def@makeset at cmd#1[#2]#3{\def\ncArgs{#1[#2]}%
+\long\gdef\exec#1{\exb at execChar\ex at protect{#1}}
+\long\gdef\exb at def@makeset at cmd#1{\@ifnextchar[{\@exb at def@makeset at cmd{#1}}{\@exb at def@makeset at cmd{#1}[0]}}
+\long\gdef\@exb at def@makeset at cmd#1[#2]#3{\def\ncArgs{#1[#2]}%
 \bgroup\globaldefs=1\ea\newcommand\ncArgs{\exec{#3}}\egroup%
 }
-\def\exbank at def@makeset at command{\exb at warn{\string\exbank at def@makeset at command\space is deprecated and will be removed in versions >= 0.3.0. Use \string\exb at def@makeset at cmd}\exb at def@makeset at cmd}
+\def\exbank at def@makeset at command{\exb at warn{\string\exbank at def@makeset at command\space is deprecated and will be removed in versions >= 0.3.0. Use \string\exb at def@makeset at cmd\space(or \string\DeclareExerciseCommand where applicable)}\exb at def@makeset at cmd}
 \let\DeclareExerciseCommand\exb at def@makeset at cmd
 \newcommand{\exclude}[2]{[{#2}]{#1}{exclude}}
 \newcommand{\select}[2]{[{#2}]{#1}{select}}
 \newcommand{\orderedselect}[2]{%
-\readlist*\thelist\csv at list%
-\foreachitem\items\in\thelist{[{\item}]{#1},}%
 }
-\let\exbank at isFirstProblem\isTrue
-\exb at def@makeset at cmd{\phead}{  \if\exbank at isFirstProblem\isTrue%
-    \let\exbank at isFirstProblem\isFalse%
+\exb at isFirstProblemtrue
+\exb at def@makeset at cmd{\phead}{%
+  \ifexb at isFirstProblem%
+    \global\exb at isFirstProblemfalse%
   \else%
     \Trigger\EndProblem%
   \fi%
+\par%
   \Trigger\BeginProblem%
   \Trigger\VeryBeginProblem%
 }
-\exb at def@makeset at cmd{\pheadarg}[1]{  \if\exbank at isFirstProblem\isTrue%
-    \let\exbank at isFirstProblem\isFalse%
+\exb at def@makeset at cmd{\pheadarg}[1]{  \ifexb at isFirstProblem%
+    \global\exb at isFirstProblemfalse%
   \else%
     \Trigger\EndProblem%
   \fi%
@@ -643,92 +813,110 @@
   \bgroup\def\theproblemcounter{#1}\Trigger\VeryBeginProblem\egroup%
 }
 \exb at def@makeset at cmd{\pbreak}{\clearpage}
-\gdef\buildex#1{  \makeset{#1}{#1}
-  \buildset{#1}
+\gdef\buildex#1{	\makeset{#1}{#1}
+	\buildset{#1}
 }
-\gdef\@countIntros{\isFalse}
+\exb at CountIntrosfalse
 \gdef\exb at setpgf#1{%
-\edef\keystring{{/makeset,default,#1}}%
-\ea\pgfkeys\keystring}
-\newcommand\buildset[2][]{%
-  \xdef\exb at currentSetID{#2}%
-  \pgfkeys{/makeset/override/.cd, #1}
-  \global\let\setName\exb at currentSetID%
-  \gdef\exb at buildset@oarg{#1}
-  \@ifundefined{setlist@#2 at intro}{\gdef\@countIntros{\isFalse}}{\gdef\@countIntros{\isTrue}}%
-  \@ifundefined{setlist@#2 at nohead}{\gdef\nohead{\isFalse}}{\gdef\nohead{\isTrue}}%
-  \ifcsname setkeys@\setName\endcsname%
-  \xdef\skeys{\csname setkeys@#2\endcsname}%
-  \exb at setpgf\skeys%
-  \fi%
-  \@ifundefined{setlist@#2}{%
-    \@latex at error{Couldn't find set #2. Did you remember to do \string\makeset{#2}{}?}
-    \stop\bye
-}{}
-  \let\exlist at protect\unexpanded%
-  \edef\exbank at setlist{\csname setlist@#2\endcsname}%
-  \let\exlist at protect\noexpand%
-  \if\@spriteMode\isFalse%
-    \if\exb at frontpage\@isFalse\else\input{\exb at frontpage}\fi
-    \Trigger\StartBuildset%
-  \fi%
-  \gdef\@delegateFileInfo{\@ifnextchar?\@execute at makeset@command\@is at exec}%
-  \def\@is at exec{\@ifnextchar:\@execute at exec\@is at file}%
-  \gdef\@is at file{\@ifnextchar[\exb at setEnv@withOptargs\X at exb@setEnv}%
-  \gdef\X at exb@setEnv##1{%
-    \def\continueLoop{\isTrue}%
-    \@dinfo{Processing normal file "\exerciseFileInfo.tex"}%
-    \exbank at setEnv@normal{\exerciseFileInfo}\bgroup\nullfont%
+	\edef\keystring{{/makeset,default,#1}}%
+	\ea\pgfkeys\keystring}
+\long\def\exb at getnextchar#1#2\endstr{\gdef\exb at nextchar{#1}\gdef\exb at restchars{#2}}
+\long\gdef\@execute at makeset@command#1{%
+	\@dinfo{Executing macro \@backslashchar\@gobble##1}%
+	\csname #1\endcsname%
+	\def\continueLoop{\isFalse}%
 }
-  \gdef\exb at setEnv@withOptargs{%
-    \def\continueLoop{\isTrue}\ea\exbank at setEnv\exerciseFileInfo\bgroup\nullfont%
+\long\def\@execute at exec#1{%
+	\def\continueLoop{\isFalse}\@dinfo{Executing custom (\string\exec) command}{#1}%
 }
-  \gdef\@execute at makeset@command ?##1{%
-    \edef\inner{\@firstofone##1}%
-    \@dinfo{Executing macro \@backslashchar\@gobble##1}%
-    \csname\inner\endcsname%
-    #1\def\continueLoop{\isFalse}\ea\bgroup%
+\long\gdef\X at exb@setEnv#1{%
+	\def\continueLoop{\isTrue}%
+	\@dinfo{Processing normal file "\exerciseFileInfo.tex"}%
+	\exbank at setEnv@normal{#1}%
 }
-  \def\@execute at exec:{%
-    \def\continueLoop{\isFalse}\@dinfo{Executing custom command}\bgroup%
+\long\gdef\exb at setEnv@withOptargs#1{%
+	\def\continueLoop{\isTrue}
+	\edef\firstarg{#1}
+	\expandafter\exbank at setEnv\firstarg%
 }
-  \readlist*\setlist\exbank at setlist%
-  \foreachitem\exerciseFileInfo\in\setlist{%
-    \def\continueLoop{\isTrue}%
-    \gdef\ppList{\emptyList}%
-    \setcounter{metacounter}{0}%
-    \let\ex at protect\unexpanded%
-    \edef\exerciseFileInfo{\exerciseFileInfo}%
-    \ea\@delegateFileInfo\exerciseFileInfo\egroup%
-    \Trigger\InputExercise%
-    \if\continueLoop\isTrue%
-    \let\ex at protect\noexpand%
-  \Trigger\PathControl%
-    \if\nohead\isFalse%
-      \if\@spriteMode\isFalse%
-        \Trigger\BeginProblem%
-      \fi%
-    \fi%
-    \if\nohead\isFalse\Trigger\VeryBeginProblem\fi%
-    \if\@spriteMode\isTrue\textbf{\exerciseFile.tex\\}\fi%
-    \IfFileExists{\@exercisesDir/\exerciseFile}{%
-      \incl{\@exercisesDir/\exerciseFile}%
-      \if\@spriteMode\isTrue%
-        \setcounter{partproblemcounter}{0}%
-      \fi%
-}{      \@latex at error{Could not find \@exercisesDir/\exerciseFile. Maybe it is because the default exercise directory is now changed to the same directory that your main file is in. To set default exercise directory to exercises, do \string\exercisebanksetup{exercise directory=exercises}}{}
-      \stop\bye
+\def\set at charcode#1{\edef\testcode{\unexpanded{\the\numexpr`}#1}}
+\long\def\@delegateFileInfo#1{%
+	\expandafter\exb at getnextchar#1\endstr%
+  \set at charcode\exb at nextchar\relax
+	\ifnum\testcode=\the\numexpr`?\relax
+		\relax\@execute at makeset@command\exb at restchars%
+	\else\ifnum\testcode = \the\numexpr`:\relax%
+			\@execute at exec\exb at restchars
+		\else\ifnum\testcode = \the\numexpr`[\relax%
+				\exb at setEnv@withOptargs{\exb at nextchar\exb at restchars}
+			\else%
+				\X at exb@setEnv{\exb at nextchar\exb at restchars}
+			\fi
+		\fi
+	\fi
 }
-    \if\nohead\isFalse\Trigger\EndProblem\fi%
-    \fi%
+\newcommand\buildset[2][]{%
+	\xdef\exb at currentSetID{#2}%
+	\pgfkeys{/makeset/override/.cd, #1}
+	\global\let\setName\exb at currentSetID%
+	\gdef\exb at buildset@oarg{#1}
+	\@ifundefined{setlist@#2 at intro}{\exb at CountIntrosfalse}{\exb at CountIntrostrue}%
+	\@ifundefined{setlist@#2 at nohead}{\gdef\nohead{\isFalse}}{\gdef\nohead{\isTrue}}%
+	\ifcsname setkeys@\setName\endcsname%
+		\xdef\skeys{\csname setkeys@#2\endcsname}%
+		\exb at setpgf\skeys%
+	\fi%
+	\@ifundefined{setlist@#2}{%
+		\exb at err{Couldn't find set #2. Did you remember to do \string\makeset{#2}{}?}
+		\stop\bye
+}{}
+	\let\exlist at protect\unexpanded%
+	\edef\exbank at setlist{\csname setlist@#2\endcsname}%
+	\let\exlist at protect\unexpanded%
+	\if\@spriteMode\isFalse%
+		\if\exb at frontpage\@isFalse\else\input{\exb at frontpage}\fi
+		\Trigger\StartBuildset%
+	\fi%
+	\readlist*\setlist\exbank at setlist%
+	\foreachitem\exerciseFileInfo\in\setlist{%
+		\def\continueLoop{\isTrue}%
+		\gdef\ppList{\emptyList}%
+		\setcounter{metacounter}{0}%
+		\let\ex at protect\unexpanded%
+		\edef\exb at execChar{:}%
+		\edef\exerciseFileInfo{\exerciseFileInfo}%
+		\@delegateFileInfo\exerciseFileInfo%
+		\Trigger\InputExercise%
+		\if\continueLoop\isTrue%
+			\let\ex at protect\noexpand%
+			\Trigger\PathControl%
+			\if\nohead\isFalse%
+				\if\@spriteMode\isFalse%
+					\Trigger\BeginProblem%
+				\fi%
+			\fi%
+			\if\nohead\isFalse\Trigger\VeryBeginProblem\fi%
+			\if\@spriteMode\isTrue\textbf{\exerciseFile.tex\\}\fi%
+			\IfFileExists{\@exercisesDir/\exerciseFile}{%
+				\Trigger\InputExerciseFile
+				\let\exb at execChar\relax
+				\incl{\@exercisesDir/\exerciseFile}%
+				\if\@spriteMode\isTrue%
+					\setcounter{partproblemcounter}{0}%
+				\fi%
+}{				\@latex at error{Could not find \@exercisesDir/\exerciseFile. Maybe it is because the default exercise directory is now changed to the same directory that your main file is in. To set default exercise directory to exercises, do \string\exercisebanksetup{exercise directory=exercises}}{}
+				\stop\bye
 }
-  \if\@spriteMode\isFalse%
-    \Trigger\EndBuildset%
-  \fi%
-  \setcounter{problemcounter}{0}%
-  \setcounter{partproblemcounter}{0}%
-  \clearpage%
+			\if\nohead\isFalse\Trigger\EndProblem\fi%
+		\fi%
 }
+	\if\@spriteMode\isFalse%
+		\Trigger\EndBuildset%
+	\fi%
+	\setcounter{problemcounter}{0}%
+	\setcounter{partproblemcounter}{0}%
+	\clearpage%
+}
 \newcommand\buildsets[2][]{%
 	\xdef\csvlist{#2}%
 	\readlist*\items\csvlist%
@@ -737,23 +925,28 @@
 }
 }
 \newcommand\buildtags[2]{%
-  \global\exb at tagbuildmodetrue
-  \xdef\csvtags{#1}%
-  \xdef\csvlist{#2}
+	\global\exb at tagbuildmodetrue
+	\xdef\csvtags{#1}%
+	\xdef\csvlist{#2}
 	\xdef\csvsets{#2}%
 	\readlist*\tagsItems\csvtags%
-  \readlist*\setsItems\csvsets%
+	\readlist*\setsItems\csvsets%
 	\foreachitem\set\in\setsItems{%
-    \xdef\exb at tagList{\csvtags}
+		\xdef\exb at tagList{\csvtags}
 		\buildset{\set}%
 }
-  \global\exb at tagbuildmodefalse
+	\global\exb at tagbuildmodefalse
 }
-\newcommand\refcounter[1]{\edef\@currentlabel{#1}%
+\def\buildsprite#1{\squeeze%
+\gdef\@spriteMode{\isTrue}
+\pgfpagesuselayout{4 on 1}[a4paper,border shrink=5mm]%
+\buildsets{#1}%
 }
-\DeclareRobustCommand{\pplabel}[1]{	\refcounter{\theproblemcounter}\label{pr:\exerciseFile:#1}
-	\refcounter{\alph{partproblemcounter}}\label{pp:\exerciseFile:#1}
+\providecommand\refcounter[1]{\edef\@currentlabel{#1}%
 }
+\DeclareRobustCommand{\pplabel}[1]{	\refcounter{\theproblemcounter}\label{pr:\exerciseFile:#1}\label{pr:global:#1}
+	\refcounter{\alph{partproblemcounter}}\label{pp:\exerciseFile:#1}\label{pp:global:#1}
+}
 \let\pptag = \pplabel
 \newcommand\pppref[1]{%
 (\ea\@alph\ref{pp:\exerciseFile:#1})\relax%
@@ -761,34 +954,77 @@
 \newcommand\ppref[1]{%
 (\ref{pr:\exerciseFile:#1}\ref{pp:\exerciseFile:#1})\relax%
 }
+\newcommand\ppgref[1]{%
+(\ref{pr:global:#1}\ref{pp:global:#1})\relax%
+}
 \newcommand\pref[1]{%
 \ref{pr:\exerciseFile:#1}\relax%
 }
+\newcommand\pgref[1]{%
+\ref{pr:global:#1}\relax%
+}
 \gdef\exb at currentPoints{0}
 \gdef\exb at currentPointsStyle{}
 \newif\ifexb at enablepoints\global\exb at enablepointstrue
 \exercisebanksetup{%
-current points style/.store in=\exb at currentPointsStyle,
-current points style={\ifnum\exb at currentPoints=\z@\ifnum\totalpoints=\z@\else\phantom{0p}\fi\else\exb at currentPoints p\fi\ignorespaces},
-disable points/.is if={exb at enablepoints}
+	current points style/.store in=\exb at currentPointsStyle,
+	current points style={\ifnum\exb at currentPoints=\z@\ifnum\totalpoints=\z@\else\phantom{0p}\fi\else\exb at currentPoints p\fi\ignorespaces},
+	disable points/.is if={exb at enablepoints}
 }
 \ifexb at enablepoints
-\AtEndDocument{%
-\immediate\write\@auxout{\string\gdef\string\totalpoints{\the\c at exb@points}}%
+	\AtEndDocument{%
+		\immediate\write\@auxout{\string\gdef\string\totalpoints{\the\c at exb@points}}%
 }
-\At\PartProblemHeaderSuffix{\exb at currentPointsStyle}
+	\At\PartProblemHeaderSuffix{\exb at currentPointsStyle}
 \fi
 \newcounter{exb at points}
 \setcounter{exb at points}{0}
 \providecommand\totalpoints{}
 \nextproblem{points/.store in=\exb at currentPoints}
-\At\BeginPartproblem{\addtocounter{exb at points}\exb at currentPoints}
+\At\BeginPartproblem{%
+\addtocounter{exb at points}{\exb at currentPoints}%
+}
 \At\EndPartproblem{\gdef\exb at currentPoints{0}}
+\providecommand\exercisepoints{}
+\newcounter{exb at tmp@exercisepoints}
+\setcounter{exb at tmp@exercisepoints}{0}
+\At\VeryBeginProblem{	\xdef\exb at expoints@macname{exb at exercisepoints@\the\c at problemcounter}
+	\ifcsname\exb at expoints@macname\endcsname%
+		\xdef\exercisepoints{\csname\exb at expoints@macname\endcsname}
+	\else%
+		\gdef\exercisepoints{}
+	\fi
+	\setcounter{exb at tmp@exercisepoints}{0}
+}
+\At\BeginPartproblem{%
+\addtocounter{exb at tmp@exercisepoints}{\exb at currentPoints}%
+}
+\At\EndProblem{%
+\immediate\write\@auxout{\string\expandafter\string\gdef\string\csname\space exb at exercisepoints@\the\numexpr\the\c at problemcounter\endcsname{\the\c at exb@tmp at exercisepoints}}%
+}
 \def\exb at hidetaglist{}
-\At\DecideProblemDisplay{\ifnum\pdfstrcmp{\DisplayProblem}{\T@}=\z@\relax%
-\ifx\exb at hidetaglist\relax\else
-\exb at intersection@any{\exb at currentTags}{\exb at hidetaglist}{\global\exb at opthidestrue}{\global\exb at opthidesfalse}%
+\At\DecideProblemDisplay{\ifexb at DisplayCurrentProblem\relax%
+\ifx\exb at hidetaglist\empty\relax\else
+\exb at intersection@any{\exb at currentTags}{\exb at hidetaglist}{\global\exb at opthidestrue}{}%
 \fi
 \fi
 }
-\gdef\HideTags#1{\xdef\exb at hidetaglist{#1}}
+\gdef\HideTags#1{\xdef\exb at hidetaglist{\unexpanded\expandafter{\exb at hidetaglist},#1}}
+\gdef\ShowAllTags{\gdef\exb at hidetaglist{}}
+\global\let\@exercisenote\@nil%
+\gdef\@addExercisenote#1{%
+	\ifx\@exercisenote\@@nil%
+	\gdef\@exercisenote{#1}%
+	\else
+	\g at addto@macro{\@exercisenote}{\par#1}
+\fi
+}
+\At\VeryBeginProblem{%
+\ifx\@exercisenote\@@nil\else%
+\begingroup\list{}{\leftmargin-\introOutdent}\item[]%
+\@exercisenote%
+\endlist\endgroup%
+\global\let\@exercisenote\nil%
+\fi%
+}
+\DeclareExerciseCommand\exercisenote[1]{\@addExercisenote{#1}}



More information about the tex-live-commits mailing list