summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/exercisebank/exercisebank-doc.tex
blob: 8897fb1d927bd01f8b0739686320849f619c4550 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
%% 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
%% -------------------------------------------------------------------------------------------
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% 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.txt
\documentclass[a4paper]{article}
\usepackage[all]{tcolorbox}
\usepackage{needspace}
\usepackage{tabularx}
\usepackage{geometry}
\makeatletter
\def\input@path{{../../docs/}}
\lstdefinestyle{mydocumentation}{style=tcbdocumentation,
  classoffset=0,
  texcsstyle=*\color{blue},
  moretexcs={arrayrulecolor,draw,includegraphics,ifthenelse,isodd,lipsum,path,pgfkeysalso},
  classoffset=1,
  moretexcs={% core
    makeset,phead,buildset,select,exclude,Trigger,At,translateExBank,exercisebanksetup,exerciseFile
  },
  texcsstyle=*\color{Definition}\bfseries,
  classoffset=0,% restore default
  }
\newtcolorbox{marker}[1][]{enhanced,
    before skip=2mm,after skip=3mm,
    boxrule=0.4pt,left=5mm,right=2mm,top=1mm,bottom=1mm,
    colback=yellow!50,
    colframe=yellow!20!black,
    sharp corners,rounded corners=southeast,arc is angular,arc=3mm,
    underlay={%
      \path[fill=tcbcol@back!80!black] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
      \path[draw=tcbcol@frame,shorten <=-0.05mm,shorten >=-0.05mm] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
      \path[fill=yellow!50!black,draw=none] (interior.south west) rectangle node[white]{\Huge\bfseries !} ([xshift=4mm]interior.north west);
      },
    drop fuzzy shadow,#1}
  \def\l@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@version[2]{%
  \ifnum \c@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@xt@\@pnumwidth{}\par
    \endgroup
  \fi}
  \newcommand*\l@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}
\let\oldsubsection\subsection
\gdef\subsection{\needspace{0.2\paperheight}\oldsubsection}


\setlength{\parindent}{0pt}
\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.

\tableofcontents
\clearpage
\section{Motivation}
Exercises are saved as separate files containing part problems. These files can be used to make sets, and you can cherry-pick or exclude certain part problems as you see fit. This makes it easier to maintain and keep your exercises flexible as the syllabus changes.

\section{Flow/Moderate start}
I suspect that working with this package will break you current flow. So let's go throught it.

Most likely you would want to put all your exercises in a folder. To set the default folder, use \refCom{exercisebanksetup}.
In these examples we use \texttt{exercises/}.
\begin{dispListing*}{title=exercises/myexercise.tex}
\begin{intro}
  This introduces our problem
\end{intro}
\begin{problem}
  This is a partproblem 1,
  and will be hidden (just wait, you'll see)
\end{problem}
\begin{problem}
  This is a partproblem 2.
  This will not be hidden, but become part problem a!
\end{problem}
\end{dispListing*}
Let's build all of them first. In the main file, (the one where you include this package):
\begin{dispListing*}{title=main.tex}
  \documentclass{article}
  \usepackage{exercisebank}
  \exercisebanksetup{exercise directory=exercises}
  \makeset{myExerciseSet}{myexercise}
  \begin{document}
    \buildset{myExerciseSet}
  \end{document}
\end{dispListing*}
This builds the entire set, and adds Problem header and partproblem counters ( (1a) and (1b) ) by default.
\subsection{Select}
Now, let's build only the second problem.
\begin{dispListing*}{title=main.tex}
  \documentclass{article}
  \usepackage{exercisebank}
  \exercisebanksetup{exercise directory=exercises}
  \makeset{myExerciseSet}{\select{myexercise}{2}}
  \begin{document}
    \buildset{myExerciseSet}
  \end{document}
\end{dispListing*}
This should only build the intro and the one exercise you \refCom*{select}ed!

Now, say you want to hide the intro. Well all you have to do in this case is
make the package treat the intro as a problem in regards to what is \refCom*{select}ed.
Just add the optional argument \oarg{intro} to \dac{make}. That is switch
\begin{dispListing}
\makeset{myExerciseSet}{\select{myexercise}{2}}
\end{dispListing}
with
\begin{dispListing}
\makeset[intro]{myExerciseSet}{\select{myexercise}{3}}
\end{dispListing}
Notice that there are 3 `partproblems' now since we have to count the intro!

\subsection{Exclude}
But what if you have an exercise with 12 partproblems, and you only want to exclude the 7th partproblem? Well, then \dac{Exclude} is here to rescue the day for you.
\begin{dispListing}
  \makeset{myExerciseSet}{\exclude{soManyExercises}{7}}
\end{dispListing}
Here it's important to note that the [intro] argument would not make the intros disappear. If we wanted to only exclude the intro from our previous example file \texttt{exercises/myexercise.tex} we would do
\begin{dispListing}
\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:

Let's say you have two files with exercises. One located in \texttt{exercises/circuits/RLC.tex} and one in \texttt{exercises/ohm/ohmsGeneralLaw.tex}, and you want to include partproblem 1 through 5 from \texttt{RLC.tex} and all of the exercises from \texttt{ohmsGeneralLaw.tex}.

\begin{dispListing}
\makeset{\select{circuits/RLC}{1,...,5}, ohmsGeneralLaw}
\end{dispListing}
This will divide it up with problem headers. So that what is in the \texttt{RLC.tex}-file will be Problem 1, and \texttt{ohmsGeneralLaw.tex} Problem 2.
\subsection{Mixnmatch}
What if you want to make both of them the same exercise? Well, then you pass the [nohead] argument to \dac{makeset}:
\begin{dispListing}
\makeset[nohead]{\phead, \select{circuits/RLC}{1,...,5}, ohmsGeneralLaw}
\end{dispListing}
The \dac{phead} command makes a problem header. You can pass them as much as you want:

\begin{dispListing}
\makeset[nohead]{\phead, \select{circuits/RLC}{1,...,5},
              ohmsGeneralLaw, \phead, someOtherExercise, moreExercises}
\end{dispListing}

\subsection{Solutions}
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}
\end{dispListing}
They are hidden by default, so you would have to use \dac{DisplaySolutions} in
your main file to display them.

\subsection{Using \dac{At}}
\subsubsection{Making your own front page for a set}

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}
  }
\end{dispListing}
\subsubsection{Printing the file name beneath the problem header}
Maybe you want to see what files are what problems. One way to do that is hook into the \dac{At}\dac{VeryBeginProblem} and use \refCom{exerciseFile}.This is the command that the headers call, so anything you put in there will be executed right after the headers.

\begin{dispListing}
  \At\VeryBeginProblem{
    \exerciseFile\\
  }
\end{dispListing}

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
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\},\\
\dac{begin}\{solution\},\dac{end}\{solution\},\\
\dac{begin}\{intro\} and \dac{end}\{intro\} has to be on their own line without any spaces!
\end{marker}
 \section{Reference}
\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}
\begin{docEnvironment}{solution}{}
 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{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}
\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.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
\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.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.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.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:
\begin{dispListing}
\makeset[nohead]{%
 \phead,
 myExercise,
 \pbreak,
 myExerciseOnNewPage%
}
\end{dispListing}
\end{docCommand}
\begin{docCommand}{exec}{\marg{macros}}\addcontentsline{toc}{subsubsection}{\refCom{exec}}
\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}
\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}{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.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}}

 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}{ShowNumbers}{}\addcontentsline{toc}{subsubsection}{\refCom{ShowNumbers}}
\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}}
\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.
 If this is turned Off, then the part problems will be treated as problems
}
\keyDef{tighten paragraphs}{True/False}{True}{
 Disabling this will prevent
 the package from attempting to prevent part problems to scatter across pages
}
\keyDef{problem header}{macro}{see below}{
 This sets the problem header. To access the translation of the problem text, use \dac{@tr}\{Problem\}, and
 the problem counter is accessed with \dac{theproblemcounter}.\\
 Defaults to\\
 \brackets{\dac{normalfont}\dac{Large}\dac{bfseries}\dac{@tr}\{Problem\}~\dac{theproblemcounter}}.
}
\keyDef{part problem header}{macro}{see below}{
 This sets the problem header. To access the current problem, use \dac{theproblemcounter}, and then the current
 part problem \dac{thepartproblemcounter}. To make it a letter, as per default use \dac{alph}\{partproblemcounter\}\\
 Default is:\\
 \dac{large}\dac{textbf}\{(\dac{theproblemcounter}\dac{alph}{partproblemcounter\})}
}
\keyDef{solution header}{string}{see below}{
\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.
}
\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}
\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}}

This is to translate the text inside the package. As of now the available key/values are
\begin{itemize}
\item Problem
\item Solution
\end{itemize}
The Norwegian translation would then be done with
\begin{dispListing}
\translateExBank{Problem=Oppgave, Solution=Løsning}
\end{dispListing}
\end{docCommand}
\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{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] \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}
\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}}\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}}
\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
 \Trigger\BeginSomething, this evaluates to DoSomething
\end{dispListing}
\end{docCommand}
\begin{docCommand}{exerciseFile}{}\addcontentsline{toc}{subsubsection}{\refCom{exerciseFile}}

This is a `read-only' macro that contains the name of the current exerciseFile
\end{docCommand}
\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}}{}
\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{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}}{}
\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
\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{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}}
    \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}