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
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This is a generated file %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}
\usepackage[all]{tcolorbox}
\input{styling}
\input{preamble}
\let\dac\docAuxCommand
\tcbset{documentation listing style=mydocumentation}
\setlength{\parindent}{0pt}
\author{Andreas Strauman}
\begin{document}
\maketitle
\tableofcontents
\clearpage
\input{intro}
\section{Reference}
\subsection{Environments}
\begin{docEnvironment}[]{problem}{}
Inside the exercises folder, you keep your exercises. Inside there 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.
\begin{marker}\dac{end}\{problem\} has to be on it's own line without any leading spaces!\end{marker}
\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{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.
\begin{marker}\dac{end}\{intro\} has to be on it's own line without any leading spaces!\end{marker}
\end{docEnvironment}
\subsection{Internationalization}
\begin{docCommand}[]{translateExBank}{\marg{Translation key/vals}}
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}
\end{docCommand}
The Norwegian translation would then be done with
\begin{dispListing}
\translateExBank{Problem=Oppgave, Solution=Løsning}
\end{dispListing}
\subsection{Triggers}
\begin{docCommand}[]{Trigger}{\marg{Any Macro}}
See \refCom{At}\\
Available triggers:\\
\dac{At}\dac{InputExercise}\\ Triggers before a file is included\\
\dac{At}\dac{BeginProblem}\\ Triggers before a file is included, but only if problem headers are to be written (no [nohead] given)\\
\dac{At}\dac{EndProblem}\\ Triggers right after problem is included if [nohead] \emph{not} given\\
\dac{At}\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{At}\dac{EndBuildset}\\ Triggers when a set has stopped building (not if \dac{sprite} is used)\\
\end{docCommand}
\subsection{General reference}
\begin{docCommand}[]{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.\\
Compilation wont work unless \dac{end}\{problem\}, \dac{end}\{solution\} and \dac{end}\{intro\} are on their own lines and without any spaces. This warning can be removed by doing \dac{def}\dac{ownLineNoSpacesGotIt}{} before \dac{usepackage}\{exbank\}.
\end{docCommand}
\begin{docCommand}[]{setExercisesDir}{\marg{directory}}
This is the directory, relative to the file you included the package,
where the package should be looking for exercises. Default is \texttt{exercises}
\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}.
\end{docCommand}
\begin{dispListing}
\At\BeginSomething{DoSomething}
Which is triggered with
\Trigger\BeginSomething, this evaluates to DoSomething
\end{dispListing}
\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{exerciseDir}-path (default its in the root called exercises), 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
\end{docCommand}
\begin{dispListing}
\makeset[nohead]\{\phead, \select{myexercise}{1,2,3}}
\end{dispListing}
\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}[]{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}[]{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}
\docCounter{problemcounter}-counter holds the current problem number and
\docCounter{partproblemcounter}-counter holds the current partproblem \emph{number}.
\end{document}
|