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