texlive[48242] Master/texmf-dist: exercisebank (21jul18)

commits+karl at tug.org commits+karl at tug.org
Sat Jul 21 22:18:30 CEST 2018


Revision: 48242
          http://tug.org/svn/texlive?view=revision&revision=48242
Author:   karl
Date:     2018-07-21 22:18:30 +0200 (Sat, 21 Jul 2018)
Log Message:
-----------
exercisebank (21jul18)

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-07-21 20:18:18 UTC (rev 48241)
+++ trunk/Master/texmf-dist/doc/latex/exercisebank/README.txt	2018-07-21 20:18:30 UTC (rev 48242)
@@ -22,7 +22,7 @@
 
 Licence:
 
-The LaTeX package exercisebank - version v0.1.4 (2018/04/28) - build 74
+The LaTeX package exercisebank - version v0.2.0 (2018/07/21) - build 75
 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	2018-07-21 20:18:18 UTC (rev 48241)
+++ trunk/Master/texmf-dist/doc/latex/exercisebank/exercisebank-doc.tex	2018-07-21 20:18:30 UTC (rev 48242)
@@ -1,5 +1,5 @@
-%% exercisebank v0.1.4b74 - 2018/04/28
-%% The LaTeX package exercisebank - version v0.1.4 (2018/04/28) build 74
+%% exercisebank v0.2.0b75 - 2018/07/21
+%% The LaTeX package exercisebank - version v0.2.0 (2018/07/21) build 75
 %% Manual/Documentation for exercisebank.sty
 %% -------------------------------------------------------------------------------------------
 %% Copyright (c) 2018 by Andreas Storvik Strauman
@@ -99,12 +99,12 @@
 
 
 \setlength{\parindent}{0pt}
-\title{{exercisebank - manual\\ v0.1.4{\\[-0.5em]\footnotesize(build 74)}}}
+\title{{exercisebank - manual\\ v0.2.0{\\[-0.5em]\footnotesize(build 75)}}}
 \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
@@ -201,8 +201,11 @@
 \end{dispListing}
 
 \subsection{Solutions}
-The last thing to cover then is solutions. In your exercise files you just use the solution environment
+The last thing to cover then is solutions. In your exercise files you just use the solution environment \emph{below} the \refEnv{problem} environment:
 \begin{dispListing}
+\begin{problem}
+Some problem
+\end{problem}
 \begin{solution}
 Solution goes here
 \end{solution}
@@ -212,8 +215,14 @@
 
 \subsection{Using \dac{At}}
 \subsubsection{Making your own front page for a set}
-To create your own front page for each set, you'd use\\ \dac{At}\dac{StartBuildset}\brackets{\meta{FrontPageContents}}. Anyhing you send in to \dac{At}\dac{StartBuildset} will be executed before the first problem starts:
+
+To create your own front page for each set, you could use the \refKey{front page} key:
 \begin{dispListing}
+  \exercisebanksetu{front page={path/to/file.tex}}
+\end{dispListing}\\
+
+To illustrate how the \dac{At} command works, you could use the following command to execute macros \dac{At}\dac{StartBuildset}\brackets{\meta{FrontPageContents}}. Anything you send in to \dac{At}\dac{StartBuildset} will be executed before the first problem starts:
+\begin{dispListing}
   \At\StartBuildset{
     \input{myFrontpage}
   }
@@ -227,7 +236,7 @@
   }
 \end{dispListing}
 
-Note that the \dac{At}{BeginProblem} is executed \emph{before} the headers.
+Note that the \dac{At}\dac{BeginProblem} is executed \emph{before} the headers.
 
 \subsection{Dynamic figure path}
 Exercisebank automatically allows you to \dac{input} and \dac{includegraphics} from
@@ -276,7 +285,7 @@
  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 }
+\updated{v0.2.0\\2018/07/21 }
  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
@@ -296,17 +305,17 @@
  \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 }
+\updated{v0.2.0\\2018/07/21 }
 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 }
+\updated{v0.2.0\\2018/07/21 }
 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 }
+\defnew{v0.2.0\\2018/07/21 }
 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:
@@ -320,7 +329,7 @@
 \end{dispListing}
 \end{docCommand}
 \begin{docCommand}{exec}{\marg{macros}}\addcontentsline{toc}{subsubsection}{\refCom{exec}}
-\updated{v0.1.4\\2018/04/28 }
+\updated{v0.2.0\\2018/07/21 }
 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}
@@ -342,12 +351,19 @@
 \end{document}
 \end{dispListing}
 \end{docCommand}
+\begin{docCommand}{buildsets}{\marg{list}}\addcontentsline{toc}{subsubsection}{\refCom{buildsets}}
+\defnew{v0.2.0\\2018/07/21 }
+This command will generate multiple sets:
+\begin{dispListing}
+\buildsets{set,set2,set3}
+\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 }
+\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}{pref}{\marg{label}}\addcontentsline{toc}{subsubsection}{\refCom{pref}}
@@ -358,12 +374,12 @@
 You can do a lot of configurations on this package, and probably
  even more to come in later versions!
 \begin{docCommand}{ShowNumbers}{}\addcontentsline{toc}{subsubsection}{\refCom{ShowNumbers}}
-\updated{v0.1.4\\2018/04/28 }
+\updated{v0.2.0\\2018/07/21 }
  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 }
+\updated{v0.2.0\\2018/07/21 }
  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.
@@ -386,7 +402,8 @@
  \dac{large}\dac{textbf}\{(\dac{theproblemcounter}\dac{alph}{partproblemcounter\})}
 }
 \keyDef{solution header}{string}{see below}{
-\dac{large}\{\dac{textbf}{\dac{@tr}{Solution\}:}}
+\dac{large}\{\dac{textbf}{\dac{@tr}\brackets{Solution:\}}}
+\dac{@tr} is the translation macro
 }
 \keyDef{exercise directory}{dir}{./}{
 This key is used for setting the default exercise directory.
@@ -403,11 +420,27 @@
 \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\}
+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:}}}
+\exercisebanksetup{
+ exercise directory=exercises,
+ part problems=Off,
+ solution header={\textbf{SOL:}}
+}
 \end{dispListing}
+\keyDef{use margins}{True/False}{True}{
+ Whether or not to put the part problem labels and the problem headers outside the
+ normal margins.
+}
+\keyDef{front page}{file}{}{
+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}{
+Whether or not to put problem headers and part problem headers out in the margins.
+}
 \end{docCommand}
 \filbreak\subsection{Internationalization}
 \begin{docCommand}{translateExBank}{\marg{Translation key/vals}}\addcontentsline{toc}{subsubsection}{\refCom{translateExBank}}
@@ -472,6 +505,40 @@
 \filbreak\subsection{Counters}
 \docCounter{problemcounter}-counter holds the current problem number and
 \docCounter{partproblemcounter}-counter holds the current partproblem \emph{number}.
+\filbreak\subsection{Lengths and margins}
+Note that these are all \emph{\!\dac{textbf}\{lengths\}}
+and should be used as e.g.
+\begin{dispListing}
+\setlength{\pMarginBelow}
+\end{dispListing}
+\begin{docCommand}{pMarginBelow}{}\addcontentsline{toc}{subsubsection}{\refCom{pMarginBelow}}
+
+Distance below Problem \# header
+\end{docCommand}
+\begin{docCommand}{pMarginAbove}{}\addcontentsline{toc}{subsubsection}{\refCom{pMarginAbove}}
+
+Distance above Problem \# header
+\end{docCommand}
+\begin{docCommand}{pMarginLeft}{}\addcontentsline{toc}{subsubsection}{\refCom{pMarginLeft}}
+
+ Problem header: distance from the default left margin
+\end{docCommand}
+\begin{docCommand}{ppMarginBelow}{}\addcontentsline{toc}{subsubsection}{\refCom{ppMarginBelow}}
+
+ Part problem: distance from the end of the part problem to the next item
+\end{docCommand}
+\begin{docCommand}{ppMarginAbove}{}\addcontentsline{toc}{subsubsection}{\refCom{ppMarginAbove}}
+
+ Part problem: distance above the start of the part problem to the previous item
+\end{docCommand}
+\begin{docCommand}{ppMargin}{}\addcontentsline{toc}{subsubsection}{\refCom{ppMargin}}
+
+ Part problem: how far away from the text the part problem labels are.
+\end{docCommand}
+\begin{docCommand}{introMargin}{}\addcontentsline{toc}{subsubsection}{\refCom{introMargin}}
+
+ The offset of margins for intros
+\end{docCommand}
 \filbreak\subsection{Macro definitions}
 
  \addcontentsline{mac}{macro}{\refCom{At}}{}
@@ -480,13 +547,21 @@
 \addcontentsline{mac}{macro}{\refCom{ShowNumbers}}{}
 \addcontentsline{mac}{macro}{\refCom{Trigger}}{}
 \addcontentsline{mac}{macro}{\refCom{about}}{}
+\addcontentsline{mac}{macro}{\refCom{buildsets}}{}
 \addcontentsline{mac}{macro}{\refCom{exclude}}{}
 \addcontentsline{mac}{macro}{\refCom{exec}}{}
 \addcontentsline{mac}{macro}{\refCom{exerciseFile}}{}
 \addcontentsline{mac}{macro}{\refCom{exercisebanksetup}}{}
+\addcontentsline{mac}{macro}{\refCom{introMargin}}{}
 \addcontentsline{mac}{macro}{\refCom{isin}}{}
 \addcontentsline{mac}{macro}{\refCom{makeset}}{}
 \addcontentsline{mac}{macro}{\refCom{ownLineNoSpacesGotIt}}{}
+\addcontentsline{mac}{macro}{\refCom{pMarginAbove}}{}
+\addcontentsline{mac}{macro}{\refCom{pMarginBelow}}{}
+\addcontentsline{mac}{macro}{\refCom{pMarginLeft}}{}
+\addcontentsline{mac}{macro}{\refCom{ppMargin}}{}
+\addcontentsline{mac}{macro}{\refCom{ppMarginAbove}}{}
+\addcontentsline{mac}{macro}{\refCom{ppMarginBelow}}{}
 \addcontentsline{mac}{macro}{\refCom{pplabel}}{}
 \addcontentsline{mac}{macro}{\refCom{ppref}}{}
 \addcontentsline{mac}{macro}{\refCom{pref}}{}
@@ -536,9 +611,11 @@
 
 \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{Fixed bugs related to \refCom*{phead} and the commands used in \refCom{makeset}-lists.}
+\newversion{V0.1.4 2018/04/28}
     % \change{Introduced solutions only: \refCom{SolutionsOnly}}
+    \change{Updated margins a lot!}
+    \change{Fixed sneaky space in translation}
     \change{Fixed paragraph tightening when displaying solutions}
     \change{Introduced \refCom{DeclareExerciseCommand}}
     \change{Fixed bug with \refCom{exec}}
@@ -545,6 +622,10 @@
     \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.}
+\newversion{v0.2.0 2018/07/21}
     \change{Fixed bug where \refCom{ppref} did not reference letter in part problem.}
+    \change{Introducing \refCom{buildsets}-command for building more than one set at a time.}
+    \change{Ability to add front page with the \refKey{front page} setup-key.}
+    \change{You can now remove the forced margin setup with \refKey{style margins}.}
 \chlogtable
  \end{document}

Modified: trunk/Master/texmf-dist/tex/latex/exercisebank/exercisebank.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/exercisebank/exercisebank.sty	2018-07-21 20:18:18 UTC (rev 48241)
+++ trunk/Master/texmf-dist/tex/latex/exercisebank/exercisebank.sty	2018-07-21 20:18:30 UTC (rev 48242)
@@ -1,5 +1,5 @@
 % 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
+%% The LaTeX package exercisebank - version v0.2.0 (2018/07/21) - build 75
 %% exercisebank.sty: Exercise bank
 %% -------------------------------------------------------------------------------------------
 %% Copyright (c) 2018 by Andreas Storvik Strauman <andreas dot s dot strauman at uit dot no>
@@ -13,9 +13,9 @@
 %% 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/28 v0.1.4 Creates a setup that gives freedom in making sets and exercises.]
+\ProvidesPackage{exercisebank}[2018/07/21 v0.2.0 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!}
+\PackageWarningNoLine{exercisebank-v0.2.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}}
 }{}
 \gdef\setExercisesDir#1{\@latex at error{\string\setExercisesDir is deprecated. Use \string\exercisebanksetup{exercise directory=#1} instead}{}\stop\bye
@@ -32,6 +32,7 @@
 \usepackage{geometry}
 \usepackage{listofitems}
 \usepackage{trimspaces}
+\usepackage{needspace}
 \edef\@isTrue{1}
 \edef\@isFalse{0}
 \gdef\isin#1#2#3#4{ \def\needle{#2}
@@ -86,26 +87,34 @@
 \pgfkeys{/exbanksetup/.is family, /exbanksetup,
 default/.style = {  part problems = On,
   tighten paragraphs = True,
-  problem header={\normalfont\Large\bfseries\@tr{Problem}~\theproblemcounter},
+  problem header={\normalsize\Large\bfseries\@tr{Problem}~\theproblemcounter},
   part problem header={\large\textbf{(\theproblemcounter\alph{partproblemcounter})}},
   solution header={\large{\textbf{\@tr{Solution}:}}},
   exercise directory=.,
   figure root directory=\@exercisesDir,
+  style margins=On,
+  problem needs space=0.2\paperheight
 },
 exercise directory/.estore in = \@exercisesDir, %
 figure root directory/.estore in = \@figrootDir, %
+front page/.estore in = \exb at frontpage,
+front page=\@isFalse,
 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,
+problem needs space/.store in = \exbank at opt@problemneedspace,
 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},
 switches/.cd,
   On/.initial = \@isTrue,
   on/.initial = \@isTrue,
-  T/.initial =  \@isTrue
+  T/.initial =  \@isTrue,
+  True/.initial =  \@isTrue,
   Off/.initial = \@isFalse,
   off/.initial = \@isFalse,
   F/.initial = \@isFalse,
+  False/.initial = \@isFalse,
 }
 \newcommand\exercisebanksetup[1]{  \pgfkeys{/exbanksetup, #1}%
 }
@@ -113,11 +122,7 @@
 \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{%
@@ -142,9 +147,11 @@
 \newcommand{\translateExBank}[1]{  \pgfkeys{/exbanki18n, default, #1}%
 }
 \translateExBank{}
-\gdef\@tr#1{\@ifundefined{@tr@#1}{#1}{  \csname @tr@#1\endcsname
+\gdef\@tr#1{%
+\@ifundefined{@tr@#1}{#1}{%
+  \csname @tr@#1\endcsname%
+}%
 }
-}
 \let\ea = \expandafter
 \begingroup\lccode`\|=`\\
 \lowercase{\endgroup\def\removebs#1{\if#1|\else#1\fi}}
@@ -176,7 +183,6 @@
   \@dlog{\fileInputBase}
   \@ifundefined{input at path}{\gdef\input at path{{\fileInputBase}{\fileInputPath}}}{}
 }
-\newlength{\ppLeading}
 \newlength{\pMarginBelow}
 \newlength{\pMarginAbove}
 \newlength{\pMarginLeft}
@@ -183,15 +189,23 @@
 \newlength{\ppMarginBelow}
 \newlength{\ppMarginAbove}
 \newlength{\ppMargin}
-\newlength{\ppPullback}
-\setlength{\ppLeading}{4em}
-\setlength{\pMarginBelow}{1em}
-\setlength{\pMarginAbove}{1em}
-\setlength{\pMarginLeft}{-1.5em}
-\setlength{\ppMarginBelow}{2em}
-\setlength{\ppMarginAbove}{2em}
-\setlength{\ppMargin}{2em}
-\setlength{\ppPullback}{3.5em}
+\newlength{\introMargin}
+\newlength{\solutionMarginLeft}
+\newlength{\solutionMarginAbove}
+\edef\defaultLeftMargin{\the\dimexpr1in+\hoffset}
+\setlength{\ppMargin}{0.5em}
+\setlength{\pMarginLeft}{-\ppMargin-2.5em}
+\setlength{\solutionMarginLeft}{\ppMargin}
+\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}}
@@ -198,39 +212,37 @@
 \newcounter{problemcounter}
 \setcounter{problemcounter}{0}
 \newcounter{partproblemcounter}
-\At\VeryBeginProblem{	\stepcounter{problemcounter}
-	\setcounter{partproblemcounter}{0}
-	\vspace*{\pMarginAbove}
-	\begin{addmargin}{\pMarginLeft}
-		{\exbank at opt@problemHeader}
-	\end{addmargin}
-	\vspace*{\pMarginBelow}
+\At\VeryBeginProblem{%
+	\if\exbank at opt@tightenparagraphs\@isTrue\relax%
+	\needspace{\exbank at opt@problemneedspace}%
+	\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}%
 }
-\At\EndProblem{\tighten at paragraph
+\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}
-		\begin{itemize}
-			\item[\exbank at opt@partProblemHeader]
-}
-\At\EndPartproblem{		\end{itemize}
-	\end{addmargin}
-	\egroup\tighten at paragraph
+	\bgroup%
+	\if\@displayMetaCounter\@isTrue\relax%
+		\ex at before\exbank at opt@partProblemHeader{{\Large\themetacounter}:}%
+	\fi%
+\if\exbank at opt@doMargins\@isTrue\relax%
+\leavevmode\smash{\llap{{\exbank at opt@partProblemHeader}\hskip\ppMargin}}%
+\else{\exbank at opt@partProblemHeader}\fi%
+\ignorespaces}%
+\At\EndPartproblem{%
+	\egroup%
 	\vspace*{\pMarginBelow}%
+	\tighten at paragraph\par%
 }
-\At\BeginSolution{	\vspace*{1em}
-	\begin{addmargin}{\solMargin}
-		\begin{itemize}
-			\item[\exbank at opt@solutionHeader]
-}
-\At\EndSolution{		\end{itemize}
-	\end{addmargin}
-}
+\At\BeginSolution{\hfill\break\vspace*{\solutionMarginAbove}{\exbank at opt@solutionHeader}}
+\At\EndSolution{}
 \At\EndProblem{%
 \if\exbank at opt@tightenparagraphs\@isTrue\relax%
   \if\@SolutionsOnly\@isFalse%
@@ -306,6 +318,13 @@
 \endgroup
 \Trigger\EndSolutionHard%
 }
+\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%
+}
 \generalcomment{intro}{  \if\@countIntros\isTrue
     \stepcounter{metacounter}
     \Trigger\DecideProblemDisplay
@@ -313,8 +332,8 @@
     \if\@displayMetaCounter\isTrue\relax%
     {\exb at lmargin{{\Large\themetacounter}}{\pMarginLeft}}
     \fi
-    \if\@spriteMode\isTrue
-      \if\introarg\isTrue
+    \if\@spriteMode\@isTrue
+      \if\introarg\@isTrue
         \stepcounter{partproblemcounter}
       \fi
     \fi
@@ -322,12 +341,12 @@
       \tighten at paragraph%
       \Trigger\BeginIntro%
 }
-  \fi
+  \fi%
+  \intromargin{-1em}
 }{  \if\@countIntros\isTrue
     \Trigger\EndIntro
     \endgroup
-  \fi
-  \vspace*{1em}
+  \fi\par\endintromargin
 }
 \def\squeeze{  \newlength{\marginw}
   \setlength{\marginw}{1.5cm}
@@ -404,7 +423,9 @@
 \long\gdef\spritesets#1{  \gdef\exbank at spriteSets{#1}
 }
 \global\let\exlist at protect\noexpand
-\newcommand\makeset[3][]{  \pgfkeys{/makeset, default, #1}%
+\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}
@@ -475,22 +496,32 @@
 \global\let\ex at protect\noexpand
 \gdef\exec#1{:\ex at protect{#1}}
 \gdef\@countIntros{\isFalse}
-\newcommand\buildset[2][]{  \def\oarg{#1}
-  \@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}{}?}
+\gdef\exb at setpgf#1{%
+\edef\keystring{{/makeset,default,#1}}%
+\ea\pgfkeys\keystring}
+\newcommand\buildset[2][]{%
+  \def\oarg{#1}%
+  \@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}%
+  \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
-    \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}
+  \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}%
     \@dlog{Processing normal file "\exerciseFileInfo.tex"}%
@@ -500,46 +531,58 @@
     \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
+    \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
+    \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
-    \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
+  \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
 }
-    \if\nohead\isFalse\Trigger\EndProblem\fi
+    \if\nohead\isFalse\Trigger\EndProblem\fi%
     \fi%
 }
-  \if\@spriteMode\isFalse
-    \Trigger\EndBuildset
+  \if\@spriteMode\isFalse%
+    \Trigger\EndBuildset%
   \fi
+  \setcounter{problemcounter}{0}%
+  \setcounter{partproblemcounter}{0}%
+  \clearpage%
 }
+\newcommand\buildsets[1]{%
+	\xdef\csvlist{#1}%
+	\readlist*\items\csvlist%
+	\foreachitem\set\in\items{%
+		\buildset{\set}%
+}
+}
 \newcommand\refcounter[1]{\edef\@currentlabel{#1}%
 }
 \DeclareRobustCommand{\pplabel}[1]{	\refcounter{\theproblemcounter}\label{pr:\exerciseFile:#1}



More information about the tex-live-commits mailing list