texlive[47483] Master/texmf-dist: exercisebank (29apr18)

commits+karl at tug.org commits+karl at tug.org
Sun Apr 29 23:46:58 CEST 2018


Revision: 47483
          http://tug.org/svn/texlive?view=revision&revision=47483
Author:   karl
Date:     2018-04-29 23:46:58 +0200 (Sun, 29 Apr 2018)
Log Message:
-----------
exercisebank (29apr18)

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	2018-04-29 21:46:45 UTC (rev 47482)
+++ trunk/Master/texmf-dist/doc/latex/exercisebank/README.txt	2018-04-29 21:46:58 UTC (rev 47483)
@@ -2,25 +2,27 @@
 A tool for creating and managing exercise sets in maths, physics, statistics and the like.
 
 Files:
-- exercisebank.sty : The exercise bank
-- exercisebank-doc.pdf : Description of how the package works
-- exercisebank-doc.tex : Description of how the package works - documentation
-- example.zip : containing example
-  |-- example.tex : example of use texfile
-  |-- exampe.pdf  : example of use output
-  |-- exercises/ : Directory containing exercises that could be use
-  |---|--- firstexercise.tex: example exercise
-  |---|--- secondexercise.tex: example exercise
-  |---|--- thirdexercise.tex: example exercise
 
+├── README.txt
+├── example.zip
+│   ├── example.pdf
+│   ├── example.tex
+│   └── exercises
+│       ├── firstexercise.tex
+│       ├── secondexercise.tex
+│       └── thirdexercise.tex
+├── exercisebank-doc.pdf
+├── exercisebank-doc.tex
+└── exercisebank.sty
+
 Author: Storvik Strauman, Andreas
 
 For bug report, inquires, contributed or anything else:
-https://github.com/Strauman/exerciseBank
+https://github.com/Strauman/exercisebank/
 
 Licence:
 
-The LaTeX package exercisebank - version v0.1.0 (2018/04/08)
+The LaTeX package exercisebank - version v0.1.4 (2018/04/28) - build 74
 exercisebank.sty: Exercise bank
 -------------------------------------------------------------------------------------------
 Copyright (c) 2018 by Andreas Storvik Strauman
@@ -33,4 +35,4 @@
 and version 1.3c or later is part of all distributions of LaTeX
 version 2008/05/04 or later.
 This work has the LPPL maintenance status `author-maintained'.
-This work consists of all files listed in README
+This work consists of all files listed in README.txt

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	2018-04-29 21:46:45 UTC (rev 47482)
+++ trunk/Master/texmf-dist/doc/latex/exercisebank/exercisebank-doc.tex	2018-04-29 21:46:58 UTC (rev 47483)
@@ -1,6 +1,6 @@
-%% exercisebank v0.1.0b55 - 2018/04/08
-%% The LaTeX package exercisebank - version v0.1.0 (2018/04/08) build 55
-%% #PACKAGE.sty
+%% exercisebank v0.1.4b74 - 2018/04/28
+%% The LaTeX package exercisebank - version v0.1.4 (2018/04/28) build 74
+%% Manual/Documentation for exercisebank.sty
 %% -------------------------------------------------------------------------------------------
 %% Copyright (c) 2018 by Andreas Storvik Strauman
 %% -------------------------------------------------------------------------------------------
@@ -13,11 +13,13 @@
 %% version 2008/05/04 or later.
 %% This work has the LPPL maintenance status `author-maintained'.
 %% This work consists of all files listed in README.txt
-\documentclass{article}
+\documentclass[a4paper]{article}
 \usepackage[all]{tcolorbox}
 \usepackage{needspace}
 \usepackage{tabularx}
+\usepackage{geometry}
 \makeatletter
+\def\input at path{{../../docs/}}
 \lstdefinestyle{mydocumentation}{style=tcbdocumentation,
   classoffset=0,
   texcsstyle=*\color{blue},
@@ -41,14 +43,54 @@
       \path[fill=yellow!50!black,draw=none] (interior.south west) rectangle node[white]{\Huge\bfseries !} ([xshift=4mm]interior.north west);
       },
     drop fuzzy shadow,#1}
- \title{Exercise bank - Manual\\{\normalsize v0.1.0}}
- \makeatother
+  \def\l at macro#1#2{#1\hfill\newline}
+\newcommand\macrotable{\hypersetup{linkcolor=black}\@starttoc{mac}\hypersetup{linkcolor=Definition}}
+\newcommand\gh[1]{\href{#1}{https://github.com/#1}}
+% --- CHANGELOG TABLE --- %
+\newcommand*\l at version[2]{%
+  \ifnum \c at tocdepth >\z@
+    \addpenalty\@secpenalty
+    \addvspace{1.0em \@plus\p@}%
+    \setlength\@tempdima{1.5em}%
+    \begingroup
+      \parindent \z@ \rightskip \@pnumwidth
+      \parfillskip -\@pnumwidth
+      \leavevmode \bfseries
+      \advance\leftskip\@tempdima
+      \hskip -\leftskip
+      #1\nobreak\hfil \nobreak\hb at xt@\@pnumwidth{}\par
+    \endgroup
+  \fi}
+  \newcommand*\l at change[2]{%
+    \addvspace{0.5em \@plus\p@}%
+    \leftskip1em--\hspace{0.5em}\begin{minipage}{0.5\textwidth}#1\end{minipage}\hfill%
+    \begin{minipage}{0.3\textwidth}#2\end{minipage}\par%
+  }
+
+\newcommand\chlogtable{\begin{NoHyper}\@starttoc{chlog}\hypersetup{final}\end{NoHyper}}
+\def\newversion#1{\addcontentsline{chlog}{version}{#1}}
+\newcommand\change[2][]{\addtocontents{chlog}{\protect\contentsline{change}{#2}{#1}{section.\thepage}}}
+% --- /CHANGELOG TABLE --- %
+
+\let\oldTOC\tableofcontents
+\renewcommand\tableofcontents{\hypersetup{linkcolor=black}\oldTOC\hypersetup{linkcolor=Definition}}
+\reversemarginpar
+\def\updated#1{\tcbdocmarginnote{\bfseries{\color{blue}U}#1}}
+\def\defnew#1{\tcbdocmarginnote{\bfseries{\color{green}N}#1}}
+
 \let\dac\docAuxCommand
+\def\mdac#1{\docAuxCommand{\expandafter\@gobble\string#1}}
+
+\makeatother
+
 \long\def\keyDef#1#2#3#4{\begin{docKey}{#1}{=\meta{#2}}{\meta{default}=#3}#4\end{docKey}}
+\long\def\optDef#1#2{\begin{docKey*}{#1}{}{}#2\end{docKey*}}
 \tcbset{documentation listing style=mydocumentation}
 % Magenta HREF style
 \let\oldhref\href
 \gdef\href#1#2{{\color{magenta}\oldhref{#1}{#2}}}
+\tcbset{documentation listing style=mydocumentation,/tcb/color hyperlink=Definition}
+\hypersetup{colorlinks=true}
 % Give section some space
 \let\oldsection\section
 \gdef\section{\needspace{0.3\paperheight}\oldsection}
@@ -57,12 +99,12 @@
 
 
 \setlength{\parindent}{0pt}
-\title{{exercisebank - manual\\ v0.1.0{\\[-0.5em]\footnotesize(build 55)}}}
+\title{{exercisebank - manual\\ v0.1.4{\\[-0.5em]\footnotesize(build 74)}}}
 \author{Andreas Strauman}
 \begin{document}
 \maketitle
  
-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 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.
 
 \tableofcontents
 \clearpage
@@ -133,6 +175,10 @@
 \makeset[intro]{myExerciseSet}{\exclude{myexercise}{1}}
 \end{dispListing}
 So we're excluding the partproblem 1. But that's the intro when we send the [intro] optional argument
+
+\subsection{Displaying numbers}
+If you have many part problems, counting the problem numbers can be a real hassle. Just use \dac{ShowNumbers}, and a big number will appear in front of every part problem!
+
 \subsection{Multiple}
 In \dac{makeset} you can just separate exercises with commas! Here is an example:
 
@@ -183,6 +229,20 @@
 
 Note that the \dac{At}{BeginProblem} is executed \emph{before} the headers.
 
+\subsection{Dynamic figure path}
+Exercisebank automatically allows you to \dac{input} and \dac{includegraphics} from
+the same as exercise is in. E.g. if you have a declared the option
+\begin{dispListing}
+\exercisebanksetup{exercise directory=exercises}
+\end{dispListing}
+ and you have a file \texttt{exercises/somedir/myexercise.tex}, you can put a figure in \texttt{exercises/somedir/} or make a directory with the same name as the file \texttt{exercises/somedir/myexercise/}. Then if you put a figure  \texttt{exercises/somedir/myfig.png} or \texttt{exercises/somedir/myexercise/myfig.png} you can just do
+\begin{dispListing}
+  \includegraphics{myfig}
+\end{dispListing}
+
+You can change the root dir by doing \\
+\dac{exercisebanksetup}\brackets{\refKey{figure root directory}=figures}. See the \refKey{figure root directory} key for more info.
+
 That covers the basics. Enjoy
 \begin{marker}
 \dac{begin}\{problem\},\dac{end}\{problem\},\\
@@ -190,7 +250,16 @@
 \dac{begin}\{intro\} and \dac{end}\{intro\} has to be on their own line without any spaces!
 \end{marker}
  \section{Reference}
-\subsection{Environments}
+\filbreak\subsection{Environments}
+ \addcontentsline{toc}{subsubsection}{\refEnv{intro}}
+\addcontentsline{toc}{subsubsection}{\refEnv{problem}}
+\addcontentsline{toc}{subsubsection}{\refEnv{solution}}
+
+
+\begin{docCommand}{DisplaySolutions}{}\addcontentsline{toc}{subsubsection}{\refCom{DisplaySolutions}}
+
+Turns on the solutions, so they are shown.
+\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}
@@ -198,16 +267,103 @@
  Things inside here is only visible if \refCom{DisplaySolutions} are given before \dac{begin}\{document\}
  \begin{marker}\dac{end}\{solution\} has to be on it's own line without any leading spaces!\end{marker}
 \end{docEnvironment}
-\begin{docCommand}{DisplaySolutions}{}
-Turns on the solutions, so they are shown.
-\end{docCommand}
 \begin{docEnvironment}{intro}{}
 Sometimes you'd want to introcude your exercises and tell a little bit about it. Maybe have a figure there also. Those things should go inside this environment. This can be treated as a problem in terms of counting. See \refCom{makeset} for more info.
 \end{docEnvironment}
-\subsection{Configuration and options}
+\filbreak\subsection{Making sets}
+\begin{docCommand}{spritesets}{\marg{setlist}}\addcontentsline{toc}{subsubsection}{\refCom{spritesets}}
+
+ This is a command that is used by sprite to determine what sets are shown in sprite. If this is not given, sprite uses all sets given in \dac{makset}
+\end{docCommand}
+\begin{docCommand}{makeset}{\oarg{intro,nohead}\marg{filable}}\addcontentsline{toc}{subsubsection}{\refCom{makeset}}
+\updated{v0.1.4\\2018/04/28 }
+ This command is the one you use to make a set! Later you use \dac{buildset} to build the sets you make. The \meta{filable} argument is either the name of the file relative to the \dac{setExercisesDir}-path (default is nothing, so it's in the root path), or you could use the \dac{select} or \dac{exclude} to  respectively cherry pick or exclude exercises. (See their docs).\\
+ \oarg{intro} this counts the intro environment as a part problem, so that you can \dac{select} or \dac{exclude} the intro\\
+ \oarg{nohead} prevents the builder from adding a problem header. This is handy if you want to create an exercise that is composed of multiple parts. You can use the \dac{phead} to insert the problem header where you want it
+\begin{dispListing}
+ \makeset[nohead]\{\phead, \select{myexercise}{1,2,3}}
+\end{dispListing}
+\end{docCommand}
+\begin{docCommand}{about}{\marg{text}}\addcontentsline{toc}{subsubsection}{\refCom{about}}
+
+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}{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
+ inside one page. Defaults to 4
+ \begin{marker}If \dac{sprite} is used, it should be the only command in \dac{begin}\{document\}\dac{end}\{document\}\end{marker}
+\end{docCommand}
+\begin{docCommand}{exclude}{\marg{exerciseFileName}\marg{Comma separated numbers}}\addcontentsline{toc}{subsubsection}{\refCom{exclude}}
+\updated{v0.1.4\\2018/04/28 }
+As you can see in the intro section of the documentation, this is for excluding partproblems
+To be used in \refCom{makeset}
+\end{docCommand}
+\begin{docCommand}{select}{\marg{exerciseFileName}\marg{Comma separated numbers}}\addcontentsline{toc}{subsubsection}{\refCom{select}}
+\updated{v0.1.4\\2018/04/28 }
+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}{DeclareExerciseCommand}{\marg{\dac{command}}\marg{actions}}\addcontentsline{toc}{subsubsection}{\refCom{DeclareExerciseCommand}}
+\defnew{v0.1.4\\2018/04/28 }
+This can be used later in makesets. E.g.
+\dac{DelcareExerciseCommand}\{\dac{pbreak}\}\brackets{\dac{clearpage}} will make
+\dac{pbreak} behave like \dac{clearpage} in the set:
+\begin{dispListing}
+\makeset[nohead]{%
+ \phead,
+ myExercise,
+ \pbreak,
+ myExerciseOnNewPage%
+}
+\end{dispListing}
+\end{docCommand}
+\begin{docCommand}{exec}{\marg{macros}}\addcontentsline{toc}{subsubsection}{\refCom{exec}}
+\updated{v0.1.4\\2018/04/28 }
+You can use this in \dac{makeset} to execute commands between problems.
+E.g. to insert a new page in between two problems when using nohead:
+\begin{dispListing}
+\makeset[nohead]{2}{\phead,my/exercise,\exec{\clearpage},next/exercise}
+\end{dispListing}
+\end{docCommand}
+\begin{docCommand}{setName}{}\addcontentsline{toc}{subsubsection}{\refCom{setName}}
+
+This variable prints out the name of your set that you sent to \dac{buildset}.
+The following example prints "Exercise set number 1" and "Exercise set number 2" on the top of each set
+\begin{dispListing}
+\At\StartBuildset{
+ Exercise set number \setName
+}
+ %... \makesets here ...%
+\begin{document}
+ \buildset{1}{myexercise}
+ \buildset{2}{myexercise}
+\end{document}
+\end{dispListing}
+\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\}}
+\end{docCommand}
+\begin{docCommand}{ppref}{\marg{label}}\addcontentsline{toc}{subsubsection}{\refCom{ppref}}
+\updated{v0.1.4\\2018/04/28 }
+Reference a partproblem created by \dac{pplabel}\{\meta{label\}}. This prints e.g. 1c)
+\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}
+\filbreak\subsection{Configuration and options}
 You can do a lot of configurations on this package, and probably
  even more to come in later versions!
-\begin{docCommand}{exercisebanksetup}{\marg{[key/values]}}
+\begin{docCommand}{ShowNumbers}{}\addcontentsline{toc}{subsubsection}{\refCom{ShowNumbers}}
+\updated{v0.1.4\\2018/04/28 }
+ Shows the numbers in fron of the part problems and intros that should be used with
+ \dac{exclude} and \dac{select}
+\end{docCommand}
+\begin{docCommand}{exercisebanksetup}{\marg{[key/values]}}\addcontentsline{toc}{subsubsection}{\refCom{exercisebanksetup}}
+\defnew{v0.1.0\\2018/04/08 }
  Here is a list of the different keys and their meaning
 \keyDef{part problems}{On/Off}{On}{
  This is whether or not to do part problems. E.g. 1a), 1b) etc.
@@ -232,15 +388,30 @@
 \keyDef{solution header}{string}{see below}{
 \dac{large}\{\dac{textbf}{\dac{@tr}{Solution\}:}}
 }
-\keyDef{exercise directory}{string}{./}{
+\keyDef{exercise directory}{dir}{./}{
 This key is used for setting the default exercise directory.
 }
+\keyDef{figure root directory}{dir}{\meta{exercise directory}}{
+Exercisebank automatically allows you to \dac{input}{} and \dac{includegraphics}{} from
+the same folder folder that your exercise is in, as well as a folder with the
+same name as the exercise file. This is elaborated in the intro section.
+However, you might want to put the figures inside a different directory.
+For example if you have one directory containing your problems called \texttt{exercises/},
+set with \refKey{exercise directory}, and a file containing the exercise:
+ \texttt{exercises/faradaysLaw/ACGenerate.tex}.
+Then by default figures in the directories \texttt{exercises/faradaysLaw/} and
+\texttt{exercises/faradaysLaw/ACGenerate/} can be included by just doing \dac{includegraphics}.
+And if you want to change the root of this directory to be \texttt{figures}, such that
+exercisebank looks for figures in \texttt{figures/faradaysLaw/} and \texttt{figures/faradaysLaw/ACGenerate/}
+You would use this option in the setup: \dac{exercisebanksetup}\{figure root directory=figures\}
+}
 \begin{dispListing}
  \exercisebanksetup{exercise directory=exercises,part problems=Off,solution header={\textbf{SOL:}}}
 \end{dispListing}
 \end{docCommand}
-\subsection{Internationalization}
-\begin{docCommand}{translateExBank}{\marg{Translation key/vals}}
+\filbreak\subsection{Internationalization}
+\begin{docCommand}{translateExBank}{\marg{Translation key/vals}}\addcontentsline{toc}{subsubsection}{\refCom{translateExBank}}
+
 This is to translate the text inside the package. As of now the available key/values are
 \begin{itemize}
 \item Problem
@@ -251,33 +422,43 @@
 \translateExBank{Problem=Oppgave, Solution=Løsning}
 \end{dispListing}
 \end{docCommand}
-\subsection{Triggers}
-\begin{docCommand}{Trigger}{\marg{Any Macro}}
+\filbreak\subsection{Triggers}
+\begin{docCommand}{Trigger}{\marg{Any Macro}}\addcontentsline{toc}{subsubsection}{\refCom{Trigger}}
+\updated{v0.1.3\\2018/04/20 }
  See \refCom{At}\\
  Available triggers:\\
 \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{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\\\
 \dac{Trigger}\dac{BeginProblem}:\\ Triggers before a file is included, but only if problem headers are to be written (no [nohead] given)\\
-\dac{Trigger}\dac{EndProblem}:\\ Triggers right after problem is included if [nohead] \dac{emph}\{not\} given\\
+\dac{Trigger}\dac{EndProblem}:\\ Triggers right after problem is included if [nohead] \emph{not} given\\
 \dac{Trigger}\dac{BeginBuildset}:\\ Triggers right before a set has begun building (not if \dac{sprite} is used). You might want to put your set-header here\\
 \dac{Trigger}\dac{EndBuildset}:\\ Triggers when a set has stopped building (not if \dac{sprite} is used)\\
 
 
 \end{docCommand}
-\subsection{General reference}
-\begin{docCommand}{ownLineNoSpacesGotIt}{}
+\filbreak\subsection{General reference}
+\begin{docCommand}{ownLineNoSpacesGotIt}{}\addcontentsline{toc}{subsubsection}{\refCom{ownLineNoSpacesGotIt}}
+
 This is to annoy the user enough to get his attention about the requirements of the \refEnv{problem}, \refEnv{solution} and \refEnv{intro} environments.\\
 \end{docCommand}
 \begin{marker}DEPRECATED! use \refCom{exercisebanksetup} with \refKey{exercise directory} instead!\end{marker}
-\begin{docCommand}{setExercisesDir}{\marg{directory}}
+\begin{docCommand}{setExercisesDir}{\marg{directory}}\addcontentsline{toc}{subsubsection}{\refCom{setExercisesDir}}
+
 \begin{marker}\dac{setExercisesDir} is deprecated! use \refCom{exercisebanksetup} with \refKey{exercise directory} instead!\end{marker}
 This is the directory, relative to the file you included the package,
 where the package should be looking for exercises. Default is the same directory as your main file (the one you build).
 \end{docCommand}
+\begin{docCommand}{isin}{\marg{haystack}\marg{needle}\marg{True}\marg{False}}\addcontentsline{toc}{subsubsection}{\refCom{isin}}
+
+ \meta{haystack} is a comma separated list of integers\\
+ \meta{needle} is an integer\\
+ Executes \meta{True} if \meta{needle} is found in \meta{haystack}
+ else executes \meta{False}
+\end{docCommand}
 This package also includes some extra stuff. For example the \dac{At} and \dac{Trigger}
 \begin{docCommand}{At}{\marg{AnyMacro}}
-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}.
+\updated{v0.1.3\\2018/04/20 }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}.
 \begin{dispListing}
  \At\BeginSomething{DoSomething}
  Which is triggered with
@@ -284,92 +465,86 @@
  \Trigger\BeginSomething, this evaluates to DoSomething
 \end{dispListing}
 \end{docCommand}
-\begin{docCommand}{isin}{\marg{haystack}\marg{needle}\marg{True}\marg{False}}
- \meta{haystack} is a comma separated list of integers\\
- \meta{needle} is an integer\\
- Executes \meta{True} if \meta{needle} is found in \meta{haystack}
- else executes \meta{False}
-\end{docCommand}
-\begin{docCommand}{exerciseFile}{}
+\begin{docCommand}{exerciseFile}{}\addcontentsline{toc}{subsubsection}{\refCom{exerciseFile}}
+
 This is a `read-only' macro that contains the name of the current exerciseFile
 \end{docCommand}
-\subsection{Making sets}
-\begin{docCommand}{makeset}{\oarg{intro,nohead}\marg{filable}}
- This command is the one you use to make a set! Later you use \dac{buildset} to build the sets you make. The \meta{filable} argument is either the name of the file relative to the \dac{setExercisesDir}-path (default is nothing, so it's in the root path), or you could use the \dac{select} or \dac{exclude} to  respectively cherry pick or exclude exercises. (See their docs).\\
- \oarg{intro} this counts the intro environment as a part problem, so that you can \dac{select} or \dac{exclude} the intro\\
- \oarg{nohead} prevents the builder from adding a problem header. This is handy if you want to create an exercise that is composed of multiple parts. You can use the \dac{phead} to insert the problem header where you want it
-\begin{dispListing}
- \makeset[nohead]\{\phead, \select{myexercise}{1,2,3}}
-\end{dispListing}
-\end{docCommand}
-\begin{docCommand}{about}{\marg{text}}
-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}{sprite}{\oarg{PiP}}
- This is a way to visualize all exercises. It takes one optional argument which is how many pages
- inside one page. Defaults to 4
- \begin{marker}If \dac{sprite} is used, it should be the only command in \dac{begin}\{document\}\dac{end}\{document\}\end{marker}
-\end{docCommand}
-\begin{docCommand}{exclude}{\marg{exerciseFileName}\marg{Comma separated numbers}}
-As you can see in the intro section of the documentation, this is for excluding partproblems
-To be used in \refCom{makeset}
-\end{docCommand}
-\begin{docCommand}{select}{\marg{exerciseFileName}\marg{Comma separated numbers}}
-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}{setName}{}
-This variable prints out the name of your set that you sent to \dac{buildset}.
-The following example prints "Exercise set number 1" and "Exercise set number 2" on the top of each set
-\begin{dispListing}
-\At\StartBuildset{
- Exercise set number \setName
-}
- %... \makesets here ...%
-\begin{document}
- \buildset{1}{myexercise}
- \buildset{2}{myexercise}
-\end{document}
-\end{dispListing}
-\end{docCommand}
-\begin{docCommand}{pplabel}{\marg{label}}
-Labels a partproblem. You can reference to it later using \dac{ppref}\{\meta{label\}}
-\end{docCommand}
-\begin{docCommand}{ppref}{\marg{label}}
-Reference a partproblem created by \dac{pplabel}\{\meta{label\}}. This prints e.g. 1c)
-\end{docCommand}
-\begin{docCommand}{ppref}{\marg{label}}
- Reference a partproblem created by \dac{pplabel}\{\meta{label\}}. This prints e.g. 1
-\end{docCommand}
-\subsection{Counters}
+\filbreak\subsection{Counters}
 \docCounter{problemcounter}-counter holds the current problem number and
 \docCounter{partproblemcounter}-counter holds the current partproblem \emph{number}.
+\filbreak\subsection{Macro definitions}
 
+ \addcontentsline{mac}{macro}{\refCom{At}}{}
+\addcontentsline{mac}{macro}{\refCom{DeclareExerciseCommand}}{}
+\addcontentsline{mac}{macro}{\refCom{DisplaySolutions}}{}
+\addcontentsline{mac}{macro}{\refCom{ShowNumbers}}{}
+\addcontentsline{mac}{macro}{\refCom{Trigger}}{}
+\addcontentsline{mac}{macro}{\refCom{about}}{}
+\addcontentsline{mac}{macro}{\refCom{exclude}}{}
+\addcontentsline{mac}{macro}{\refCom{exec}}{}
+\addcontentsline{mac}{macro}{\refCom{exerciseFile}}{}
+\addcontentsline{mac}{macro}{\refCom{exercisebanksetup}}{}
+\addcontentsline{mac}{macro}{\refCom{isin}}{}
+\addcontentsline{mac}{macro}{\refCom{makeset}}{}
+\addcontentsline{mac}{macro}{\refCom{ownLineNoSpacesGotIt}}{}
+\addcontentsline{mac}{macro}{\refCom{pplabel}}{}
+\addcontentsline{mac}{macro}{\refCom{ppref}}{}
+\addcontentsline{mac}{macro}{\refCom{pref}}{}
+\addcontentsline{mac}{macro}{\refCom{select}}{}
+\addcontentsline{mac}{macro}{\refCom{setExercisesDir}}{}
+\addcontentsline{mac}{macro}{\refCom{setName}}{}
+\addcontentsline{mac}{macro}{\refCom{sprite}}{}
+\addcontentsline{mac}{macro}{\refCom{spritesets}}{}
+\addcontentsline{mac}{macro}{\refCom{translateExBank}}{}
+
+ \macrotable
+
+
+% \newgeometry{lmargin=0.7cm}
 \section{Changelog}
 %!TEX root = exercisebank-doc.tex
-\begin{tabularx}{\textwidth}{llX}
-  Version&Date&Change\\
-  v0.0.2b11&2018/04/02&Updated documentation syntax.\\
-  v0.0.3b38&2018/04/03&\nobreak\begin{itemize}
-    \item Updated triggers doc
-    \item added trigger \dac{VeryBeginPartproblem}
-  \end{itemize}\\
-  v0.0.3b40&2018/04/03&\begin{itemize}
-    \item Added examples that uses the \dac{At} command.
-      Making front page and other snacks
-  \end{itemize}\\
-  v0.0.4b44&2018/04/03&\begin{itemize}
-    \item Changed design of part problems. (Looks much better now!)
-  \end{itemize}\\
-  v0.0.5b46&2018/04/03&\begin{itemize}
-    \item Fixed partproblems and solutions to fit on pages using \dac{filbreak}.
-  \end{itemize}\\
-  v0.1.0&2018/04/08&\begin{itemize}
-    \item \begin{marker}Backward incompability from v0.0.5:Removed default exercise directory! \end{marker} Use \dac{exercisebanksetup}\brackets{exercise directory=exercises} if you used the package before 2018/04/08!
-    \item Fixed title of documentation to match actual package.
-    \item Fixed weird paragraph styling when displaying solutions
-    \item Added a few package options. More to come!
-  \end{itemize}\\
-\end{tabularx}
+\newversion{v0.0.2b11 2018/04/02}
+  \change{Updated documentation syntax.}
+\newversion{v0.0.3b38 2018/04/03}\nobreak
+    \change{Updated triggers doc}
+    \change{added trigger \dac{VeryBeginPartproblem}}
+
+\newversion{v0.0.3b40 2018/04/03}
+    \change{Added examples that uses the \refCom{At} command.}
+    \change{Making front page and other snacks}
+
+\newversion{v0.0.4b44 2018/04/03}
+    \change{Changed design of part problems. (Looks much better now!)}
+
+\newversion{v0.0.5b46 2018/04/03}
+    \change{Fixed partproblems and solutions to fit on pages using \dac{filbreak}.}
+
+\newversion{v0.1.0 2018/04/08}
+    \change{Fixed title of documentation to match actual package.}
+    \change{Fixed weird paragraph styling when displaying solutions}
+    \change{Added a few package options. More to come!}
+
+\newversion{v0.1.1 2018/04/13}
+  \change{Added \refCom{exec}, which allows the user to execute macros between problems}
+  \change{Bug fix: \refCom{At} would cause crash due to latexmk multiple builds}
+  \change{Bug fix: \refCom{sprite} wouldn't build correctly}
+  \change{Bug fix: misc bugs involving \refCom{makeset}, \refCom{buildset}, nohead and \refCom{phead}}
+
+\newversion{v0.1.2 2018/04/17}
+    \change{Fixed bug that \refCom{select} and \refCom{exclude} not working as expected.}
+    \change{Added \refCom{ShowNumbers} for displaying numbers related to use in \refCom{select} and \refCom{exclude}}
+
+\newversion{v0.1.3 2018/04/20}
+    \change{Added custom dynamic figure path \refKey{figure root directory}.}
+    \change{Fixed bugs related to \refCom{phead} and the commands used in \refCom{makeset}-lists.}
+\newversion{ 2018/04/28}
+    % \change{Introduced solutions only: \refCom{SolutionsOnly}}
+    \change{Fixed paragraph tightening when displaying solutions}
+    \change{Introduced \refCom{DeclareExerciseCommand}}
+    \change{Fixed bug with \refCom{exec}}
+    \change{Iteration over items now uses a more lighweight approach.}
+    \change{For commands that takes `lists' as arguments (\refCom{makeset}, \refCom{select} and \refCom{exclude}), the last item of the list can be terminated with new line or spaces without problems.}
+    \change{For commands that takes `lists' as arguments, the entries in the list are now trimmed whitespaces on both sides.}
+    \change{Fixed bug where \refCom{ppref} did not reference letter in part problem.}
+\chlogtable
  \end{document}

Modified: trunk/Master/texmf-dist/tex/latex/exercisebank/exercisebank.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/exercisebank/exercisebank.sty	2018-04-29 21:46:45 UTC (rev 47482)
+++ trunk/Master/texmf-dist/tex/latex/exercisebank/exercisebank.sty	2018-04-29 21:46:58 UTC (rev 47483)
@@ -1,5 +1,5 @@
-% Source (with comments) can be found at https://github.com/Strauman/exerciseBank
-%% The LaTeX package exercisebank - version v0.1.0 (2018/04/08) - build 55
+% Source (with comments) can be found at https://github.com/Strauman/exercisebank/
+%% The LaTeX package exercisebank - version v0.1.4 (2018/04/28) - build 74
 %% exercisebank.sty: Exercise bank
 %% -------------------------------------------------------------------------------------------
 %% Copyright (c) 2018 by Andreas Storvik Strauman <andreas dot s dot strauman at uit dot no>
@@ -13,9 +13,10 @@
 %% 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/08 v0.1.0 Creates a setup that gives freedom in making sets and exercises.]
-\PackageWarningNoLine{exercisebank-v0.1.0}{This package is in the alpha 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{exbank}}
+\ProvidesPackage{exercisebank}[2018/04/28 v0.1.4 Creates a setup that gives freedom in making sets and exercises.]
+\xdef\exbank at quiet{1}
+\PackageWarningNoLine{exercisebank-v0.1.4}{This package is in the alpha 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}}
 }{}
 \gdef\setExercisesDir#1{\@latex at error{\string\setExercisesDir is deprecated. Use \string\exercisebanksetup{exercise directory=#1} instead}{}\stop\bye
 }
@@ -29,8 +30,59 @@
 \usepackage{calc}
 \usepackage{pgfpages}
 \usepackage{geometry}
+\usepackage{listofitems}
+\usepackage{trimspaces}
 \edef\@isTrue{1}
 \edef\@isFalse{0}
+\gdef\isin#1#2#3#4{ \def\needle{#2}
+ \def\haystack{#1}
+ \def\isFalse{0}
+ \let\isInList = \isFalse
+ \IfInteger{\needle}{}{\@latex at error{ISIN: Can't look for part problem that is not numeric!}{}\bye\stop}
+ \IfInteger{\haystack}{  \ifnum\haystack=\needle\relax
+   #3
+  \else
+   #4
+  \fi
+}{  \foreach\pp in #1{    \ifnum\pp=\needle\relax%
+     \gdef\isInList{1}
+     #3
+    \fi
+}
+  \if\isInList\isFalse
+   #4
+  \fi
+}
+}
+\gdef\strif#1#2{%
+ \ifnum\pdfstrcmp{#1}{#2}=\z@\relax%
+}
+\let\ea = \expandafter
+\begingroup\lccode`\|=`\\
+\lowercase{\endgroup\def\removebs#1{\if#1|\else#1\fi}}
+\gdef\exbank at macroname#1{\expandafter\removebs\string#1}
+\gdef\@noneofone#1{}
+\gdef\@noneoftwo#1#2{}
+\@ifundefined{exbank at quiet}{ \global\let\@dlog\@latex at warning
+}{ \global\let\@dlog\@noneofone
+}
+\newcommand\ex at before[2]{\edef #1{\unexpanded{#2}\unexpanded\expandafter{#1}}
+}
+\newcommand{\exb at lmargin}[2]{\strut\vadjust{\exb at domark{#1}{#2}}}
+\newcommand{\exb at domark}[2]{%
+  \hbox to #2{    \vbox to 0pt{      \kern-\dp\strutbox
+      \smash{\llap{#1}}
+      \vss
+}%
+}
+}
+\edef\@isTrue{1}
+\edef\@isFalse{0}
+\gdef\ShowNumbers{\gdef\@displayMetaCounter{\isTrue}}
+\gdef\@DisplaySolutions{\@isFalse}
+\gdef\DisplaySolutions{\xdef\@DisplaySolutions{\isTrue}\@latex at warning{Showing solutions}}
+\gdef\@SolutionsOnly{\@isFalse}
+\gdef\SolutionsOnly{\xdef\@SolutionsOnly{\@isTrue}\DisplaySolutions}
 \pgfkeys{/exbanksetup/.is family, /exbanksetup,
 default/.style = {  part problems = On,
   tighten paragraphs = True,
@@ -38,8 +90,10 @@
   part problem header={\large\textbf{(\theproblemcounter\alph{partproblemcounter})}},
   solution header={\large{\textbf{\@tr{Solution}:}}},
   exercise directory=.,
+  figure root directory=\@exercisesDir,
 },
 exercise directory/.estore in = \@exercisesDir, %
+figure root directory/.estore in = \@figrootDir, %
 problem header/.store in = \exbank at opt@problemHeader,
 part problem header/.store in = \exbank at opt@partProblemHeader,
 solution header/.store in = \exbank at opt@solutionHeader,
@@ -56,6 +110,30 @@
 \newcommand\exercisebanksetup[1]{  \pgfkeys{/exbanksetup, #1}%
 }
 \exercisebanksetup{default}
+\AtBeginDocument{\xdef\tpd{\the\prevdepth}}
+\gdef\tighten at paragraph{%
+\if\exbank at opt@tightenparagraphs\@isTrue\relax%
+  \if\@SolutionsOnly\@isFalse
+    \if\@DisplaySolutions\@isFalse
+      \filbreak%
+    \fi
+  \fi
+\fi%
+}
+\gdef\tighten at paragraph@solutions{%
+\if\exbank at opt@tightenparagraphs\@isTrue\relax%
+  \if\@SolutionsOnly\@isFalse
+    \if\@DisplaySolutions\@isTrue
+      \filbreak%
+    \fi
+  \fi
+\fi%
+}
+\gdef\tighten at paragraph@always{%
+\if\exbank at opt@tightenparagraphs\@isTrue\relax%
+\filbreak%
+\fi%
+}
 \pgfkeys{ /exbanki18n/.is family, /exbanki18n,
   default/.style = {Problem = Problem, Solution = Solution},
   Problem/.estore in = \@tr at Problem,
@@ -68,19 +146,36 @@
 }
 }
 \let\ea = \expandafter
-\def\removebs#1{\if#1\@backslashchar\else#1\fi}
-\newcommand{\At}[2]{  \def\macname{\expandafter\removebs\detokenize{#1}}
-  \let\mname = \macname
+\begingroup\lccode`\|=`\\
+\lowercase{\endgroup\def\removebs#1{\if#1|\else#1\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
+}
   \fi
 }
-\newcommand{\Trigger}[1]{  \def\macname{\expandafter\removebs\detokenize{#1}}
-  \let\mname = \macname
-  \@ifundefined{At@\mname}{}{\csname At@\mname\endcsname}
+\newcommand{\Trigger}[1]{  \edef\mname{\exbank at macroname{#1}}
+  \ea\@ifundefined{At@\mname}{}{%
+  \csname At@\mname\endcsname%
+}%
 }
+\xdef\figuresPath{\@figrootDir/}
+\gdef\fileInputPath{}
+\gdef\fileInputBase{}
+\providecommand*{\input at path}{}
+\g at addto@macro\input at path{{\fileInputBase}{\fileInputPath}}
+\At\PathControl{  \xdef\figuresPath{\@figrootDir/}
+  \edef\exfile{\exerciseFile}
+  \expandafter\filename at parse{\exfile}
+  \xdef\fileInputPath{\figuresPath\filename at area}
+  \xdef\fileInputBase{\figuresPath\filename at area\filename at base/}
+  \graphicspath{{\fileInputBase}{\fileInputPath}}
+  \@dlog{\fileInputBase}
+  \@ifundefined{input at path}{\gdef\input at path{{\fileInputBase}{\fileInputPath}}}{}
+}
 \newlength{\ppLeading}
 \newlength{\pMarginBelow}
 \newlength{\pMarginAbove}
@@ -111,17 +206,21 @@
 	\end{addmargin}
 	\vspace*{\pMarginBelow}
 }
-\At\EndProblem{	\if\exbank at opt@tightenparagraphs\isTrue\filbreak\fi
+\At\EndProblem{\tighten at paragraph
 }
 \At\VeryBeginPartproblem{%
 	\stepcounter{partproblemcounter}%
+	\bgroup
+	\if\@displayMetaCounter\isTrue\relax%
+		\ex at before\exbank at opt@partProblemHeader{{\Large\themetacounter}:}
+	\fi
 	\begin{addmargin}{\ppMargin}
-		\if\exbank at opt@tightenparagraphs\isTrue\filbreak\fi
 		\begin{itemize}
 			\item[\exbank at opt@partProblemHeader]
 }
 \At\EndPartproblem{		\end{itemize}
 	\end{addmargin}
+	\egroup\tighten at paragraph
 	\vspace*{\pMarginBelow}%
 }
 \At\BeginSolution{	\vspace*{1em}
@@ -132,13 +231,23 @@
 \At\EndSolution{		\end{itemize}
 	\end{addmargin}
 }
+\At\EndProblem{%
+\if\exbank at opt@tightenparagraphs\@isTrue\relax%
+  \if\@SolutionsOnly\@isFalse%
+    \if\@DisplaySolutions\@isTrue%
+      \penalty-300%
+    \fi%
+  \fi%
+\fi%
+}
+\@ifundefined{figure}{}{\edef\figure{\unexpanded{\tighten at paragraph@always}\unexpanded\expandafter{\figure}}
+}
+\@ifundefined{endfigure}{}{\g at addto@macro\endfigure{\tighten at paragraph@always}
+}
 \gdef\isFalse{0}
 \gdef\isTrue{1}
 \gdef\DisplayProblem{\isTrue}
 \gdef\@displayMetaCounter{\isFalse}
-\gdef\ShowNumbers{\gdef\@displayMetaCounter{\isTrue}}
-\gdef\@DisplaySolutions{\isFalse}
-\gdef\DisplaySolutions{\xdef\@DisplaySolutions{\isTrue}\@latex at warning{Showing solutions}}
 \AtBeginDocument{  \if\@DisplaySolutions\isFalse
     \@latex at warning{Hiding solutions. Show them with \string\DisplaySolutions}
   \fi
@@ -145,23 +254,20 @@
 }
 \global\let\do at ProcessCutFile = \ProcessCutFile
 \gdef\showhideproblem#1{%
-  \if\@displayMetaCounter\isTrue%
-    {P:\Large\themetacounter}
-    \Trigger\BeginPartproblem
-    \Trigger\VeryBeginPartproblem
-    \gdef\DisplayProblem{\isTrue}
+  \if\DisplayProblem\isFalse
+    \def\ProcessCutFile{}
   \else
-    \if\DisplayProblem\isFalse
-      \def\ProcessCutFile{}
-    \else
-      #1
-    \fi
+    \if\@SolutionsOnly\@isTrue\relax%
+    \def\ProcessCutFile{}\fi%
+    #1
   \fi
 }
 \generalcomment{problem}{  \edef\DisplaySolution{\@DisplaySolutions}
+  \stepcounter{metacounter}
   \Trigger\DecideProblemDisplay
   \begingroup
-     \showhideproblem{        \if\exbank at opt@partProblems\isTrue
+     \showhideproblem{%
+        \if\exbank at opt@partProblems\isTrue
             \Trigger\BeginPartproblem
             \Trigger\VeryBeginPartproblem
         \else
@@ -169,9 +275,10 @@
             \Trigger\VeryBeginProblem
         \fi
 }
-}{    \if\DisplayProblem\isFalse\else
+}{    \if\DisplayProblem\@isFalse\relax\else
       \if\exbank at opt@partProblems\isTrue
         \Trigger\EndPartproblem
+        \tighten at paragraph
       \else
         \Trigger\EndProblem
       \fi
@@ -193,14 +300,28 @@
   \fi
 }{\if\DisplaySolution\isTrue
 \Trigger\EndSolution
+\tighten at paragraph@solutions
+\vspace*{0.5em}
 \fi
-\Trigger\EndSolutionHard
 \endgroup
+\Trigger\EndSolutionHard%
 }
 \generalcomment{intro}{  \if\@countIntros\isTrue
+    \stepcounter{metacounter}
     \Trigger\DecideProblemDisplay
     \begingroup
-    \showhideproblem{\Trigger\BeginIntro}
+    \if\@displayMetaCounter\isTrue\relax%
+    {\exb at lmargin{{\Large\themetacounter}}{\pMarginLeft}}
+    \fi
+    \if\@spriteMode\isTrue
+      \if\introarg\isTrue
+        \stepcounter{partproblemcounter}
+      \fi
+    \fi
+    \showhideproblem{%
+      \tighten at paragraph%
+      \Trigger\BeginIntro%
+}
   \fi
 }{  \if\@countIntros\isTrue
     \Trigger\EndIntro
@@ -208,25 +329,6 @@
   \fi
   \vspace*{1em}
 }
-\gdef\isin#1#2#3#4{  \def\needle{#2}
-  \def\haystack{#1}
-  \def\isFalse{0}
-  \let\isInList = \isFalse
-  \IfInteger{\haystack}{    \if\haystack\needle
-    #3
-    \else
-    #4
-    \fi
-}{  \foreach\pp in #1{    \if\pp\needle
-      \gdef\isInList{1}
-      #3
-    \fi
-}
-  \if\isInList\isFalse
-    #4
-  \fi
-}
-}
 \def\squeeze{  \newlength{\marginw}
   \setlength{\marginw}{1.5cm}
   \newgeometry{margin=\marginw}
@@ -259,20 +361,16 @@
 }
 \let\ea = \expandafter
 \newcounter{metacounter}
-\def\emptyList{-1}
-\begingroup\lccode`\|=`\\
-\lowercase{\endgroup\def\removebs#1{\if#1|\else#1\fi}}
-\newcommand{\macroname}[1]{\expandafter\removebs\string#1}
-\gdef\ifppMode#1{  \def\mname{\macroname{#1}}
-  \if\mname\ppMode
+\setcounter{metacounter}{0}
+\gdef\emptyList{0}
+\gdef\ifppMode#1{  \def\mname{\exbank at macroname{#1}}
+  \strif\mname\ppMode
 }
-\gdef\isppMode#1#2{  \edef\mname{\macroname{#1}}
-  \if{\macroname{#1}}\ppMode#2\fi
+\gdef\isppMode#1#2{  \edef\mname{\exbank at macroname{#1}}
+  \strif{\exbank at macroname{#1}}{\ppMode}\relax#2\fi
 }
-\gdef\@noneofone#1{}
-\gdef\@noneOfTwo#1#2{}
 \gdef\@ifppMode#1{%
-\ifnum\pdfstrcmp{\macroname{#1}}{\ppMode}=\z@%
+\ifnum\pdfstrcmp{\exbank at macroname{#1}}{\ppMode}=\z@%
 \expandafter\@firstofone%
 \else%
 \expandafter\@noneofone%
@@ -280,17 +378,18 @@
 }%
 \def\pm at Exclude{exclude}
 \def\pm at Select{select}
+\def\pm at Normal{normal}
 \let\ipm\@ifppMode
 \let\T@\isTrue
 \let\F@\isFalse
-\At\DecideProblemDisplay{  \if\ppList\emptyList
-    \xdef\DisplayProblem{\ipm\exclude\T@\ipm\select\F@}
-  \else
-    \isin{\ppList}{\themetacounter}{      \xdef\DisplayProblem{\ipm\exclude\F@\ipm\select\T@\ipm\normal\T@}
-}{      \xdef\DisplayProblem{\ipm\exclude\T@\ipm\select\F@\ipm\normal\T@}
+\At\DecideProblemDisplay{%
+    \ifnum\pdfstrcmp{\ppList}{\emptyList}=\z@\relax%
+      \xdef\DisplayProblem{\ipm\exclude\T@\ipm\select\F@}
+    \else
+      \isin{\ppList}{\themetacounter}{        \xdef\DisplayProblem{\ipm\exclude\F@\ipm\select\T@\ipm\normal\T@}
+}{        \xdef\DisplayProblem{\ipm\exclude\T@\ipm\select\F@\ipm\normal\T@}
 }
-  \fi
-  \stepcounter{metacounter}
+    \fi
 }
 \pgfkeys{ /makeset/.is family, /makeset,
  default/.style = {noheadarg=\isFalse, introarg=\isFalse},
@@ -301,16 +400,21 @@
 }
 \gdef\@listOfSets{}
 \gdef\@spriteMode{\isFalse}
+\gdef\exbank at spriteSets{\emptyList}
+\long\gdef\spritesets#1{  \gdef\exbank at spriteSets{#1}
+}
+\global\let\exlist at protect\noexpand
 \newcommand\makeset[3][]{  \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{#3}
+  \ea\gdef\csname setlist@#2\endcsname{\exlist at protect{#3}}
   \def\setmacro{\unexpanded\expandafter{\csname setlist@#2\endcsname}}
-  \g at addto@macro\@listOfSets{#2}
+  \g at addto@macro\@listOfSets{,#2}
 }
 \long\gdef\about#1{}
 \newcommand\sprite[1][4]{\squeeze
@@ -317,18 +421,35 @@
 \gdef\@spriteMode{\isTrue}
 \long\def\about##1{{\Large\textbf{About}:\\[1.1em]##1\\[1.5em]}}
 \pgfpagesuselayout{#1 on 1}[a4paper,border shrink=5mm]
-  \foreach\set in \@listOfSets{    \buildset{\set}
+\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%
 }
+\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%
 }
-\newcommand{\redef}[3][{-1}]{  \if\@spriteMode\isFalse%
+\fi
+}
+\gdef\exbank at setEnv@normal#1{\exbank at setEnv{#1}{normal}
+}
+\newcommand{\exbank at setEnv}[3][{-1}]{  \if\@spriteMode\isFalse%
     \gdef\ppList{#1}
     \gdef\exerciseFile{#2}
     \gdef\ppMode{#3}
   \else
-    \gdef\ppList{}
+    \gdef\ppList{\emptyList}
     \gdef\exerciseFile{#2}
-    \gdef\ppMode{exclude}
-\fi
+    \gdef\ppMode{\pm at Normal}
+  \fi
 }
 \newcommand{\exclude}[2]{[{#2}]{#1}{exclude}}
 \newcommand{\select}[2]{[{#2}]{#1}{select}}
@@ -335,35 +456,69 @@
 \gdef\buildex#1{  \makeset{#1}{#1}
   \buildset{#1}
 }
+\gdef\exbank at def@makeset at command#1#2{%
+  \edef\macroname{\exbank at macroname{#1}}%
+  \xdef#1{?{@\macroname}}%
+  \ea\gdef\csname @\macroname\endcsname{#2}%
+}
+\let\exbank at isFirstProblem\isTrue
+\exbank at def@makeset at command{\phead}{  \if\exbank at isFirstProblem\isTrue%
+    \let\exbank at isFirstProblem\isFalse%
+  \else%
+    \Trigger\EndProblem%
+  \fi%
+  \Trigger\BeginProblem%
+  \Trigger\VeryBeginProblem%
+}
+\exbank at def@makeset at command{\pbreak}{\clearpage}
+\let\DeclareExerciseCommand\exbank at def@makeset at command
+\global\let\ex at protect\noexpand
+\gdef\exec#1{:\ex at protect{#1}}
 \gdef\@countIntros{\isFalse}
-\gdef\phead{?\noexpand\Trigger\noexpand\VeryBeginProblem}
 \newcommand\buildset[2][]{  \def\oarg{#1}
-  \@ifundefined{setlist@#2 at intro}{\gdef\@countIntros{\isFalse}}{\gdef\@countIntros{\isTrue}\@latex at warning{Counting intros}}
+  \@ifundefined{setlist@#2 at intro}{\gdef\@countIntros{\isFalse}}{\gdef\@countIntros{\isTrue}\@dlog{Counting intros}}
   \@ifundefined{setlist@#2 at nohead}{\gdef\nohead{\isFalse}}{\gdef\nohead{\isTrue}}
   \xdef\setName{#2}
   \@ifundefined{setlist@#2}{    \@latex at error{Couldn't find set #2. Did you remember to do \string\makeset{#2}{}?}
     \stop\bye
 }{}
-  \edef\setlist{\csname setlist@#2\endcsname}
+  \let\exlist at protect\unexpanded
+  \edef\exbank at setlist{\csname setlist@#2\endcsname}
+  \let\exlist at protect\noexpand
   \if\@spriteMode\isFalse
     \Trigger\StartBuildset
   \fi
-  \foreach\exerciseFileInfo in \setlist{    \def\continueLoop{\isTrue}
-    \gdef\ppList{-1}
-    \setcounter{metacounter}{1}
-    \StrLeft{\exerciseFileInfo}{1}[\firstchar]%
-    \if[\firstchar
-      \ea\redef\exerciseFileInfo\relax
-      \def\continueLoop{\isTrue}
-    \else\if?\firstchar
-        \expandafter\@secondoftwo\exerciseFileInfo
-      \def\continueLoop{\isFalse}
-    \else
-        \redef{\exerciseFileInfo}{normal}
-        \def\continueLoop{\isTrue}
-    \fi\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}%
+    \@dlog{Processing normal file "\exerciseFileInfo.tex"}%
+    \exbank at setEnv@normal{\exerciseFileInfo}\bgroup\nullfont%
+}
+  \gdef\exb at setEnv@withOptargs{%
+    \def\continueLoop{\isTrue}\ea\exbank at setEnv\exerciseFileInfo\bgroup\nullfont%
+}
+  \gdef\@execute at makeset@command ?##1{%
+    \edef\inner{\@firstofone##1}
+    \@dlog{Executing macro \@backslashchar\@gobble##1}
+    \csname\inner\endcsname
+    #1\def\continueLoop{\isFalse}\ea\bgroup
+}
+  \def\@execute at exec:{%
+    \def\continueLoop{\isFalse}\@dlog{Executing custom command}\bgroup
+}
+  \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
-    \Trigger\InputExercise
+    \let\ex at protect\noexpand
+  \Trigger\PathControl
     \if\nohead\isFalse
       \if\@spriteMode\isFalse
         \Trigger\BeginProblem
@@ -372,11 +527,14 @@
     \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
 }
     \if\nohead\isFalse\Trigger\EndProblem\fi
-    \fi
+    \fi%
 }
   \if\@spriteMode\isFalse
     \Trigger\EndBuildset
@@ -385,14 +543,14 @@
 \newcommand\refcounter[1]{\edef\@currentlabel{#1}%
 }
 \DeclareRobustCommand{\pplabel}[1]{	\refcounter{\theproblemcounter}\label{pr:\exerciseFile:#1}
-	\refcounter{\thepartproblemcounter}\label{pp:\exerciseFile:#1}
+	\refcounter{\alph{partproblemcounter}}\label{pp:\exerciseFile:#1}
 }
 \let\pptag = \pplabel
 \newcommand\pppref[1]{%
-(\ref{pp:\exerciseFile:#1})\relax%
+(\ea\@alph\ref{pp:\exerciseFile:#1})\relax%
 }
 \newcommand\ppref[1]{%
-\ref{pr:\exerciseFile:#1}\ref{pp:\exerciseFile:#1}\relax%
+(\ref{pr:\exerciseFile:#1}\ref{pp:\exerciseFile:#1})\relax%
 }
 \newcommand\pref[1]{%
 \ref{pr:\exerciseFile:#1}\relax%



More information about the tex-live-commits mailing list