diff options
author | Karl Berry <karl@freefriends.org> | 2014-09-14 21:59:39 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-09-14 21:59:39 +0000 |
commit | cb121761c0eab3885766e8a10e3f6068d746d4a3 (patch) | |
tree | a43bcf3eeaeb8787614a2aabecb20c857ee928a2 | |
parent | 7426807c769da65414ae7586a8d3a52175f18ac4 (diff) |
exsheets (14sep14)
git-svn-id: svn://tug.org/texlive/trunk@35168 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/exsheets/README | 6 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/exsheets/exsheets_en.pdf | bin | 672736 -> 679273 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex | 48 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/exsheets/exsheets-listings.sty | 6 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/exsheets/exsheets.sty | 225 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def | 6 |
6 files changed, 187 insertions, 104 deletions
diff --git a/Master/texmf-dist/doc/latex/exsheets/README b/Master/texmf-dist/doc/latex/exsheets/README index 3bbc7723442..f2d1cb1b91c 100644 --- a/Master/texmf-dist/doc/latex/exsheets/README +++ b/Master/texmf-dist/doc/latex/exsheets/README @@ -1,9 +1,9 @@ -------------------------------------------------------------------------- -EXSHEETS 2014/07/20 +EXSHEETS 2014/09/14 bundled packages: -the EXSHEETS package v0.15 +the EXSHEETS package v0.16 Yet another package for the creation of exercise sheets -the EXSHEETS-LISTINGS package v0.2 +the EXSHEETS-LISTINGS package v0.16 Using listings in exsheets -------------------------------------------------------------------------- diff --git a/Master/texmf-dist/doc/latex/exsheets/exsheets_en.pdf b/Master/texmf-dist/doc/latex/exsheets/exsheets_en.pdf Binary files differindex e0d18574c53..f82b8eccbcc 100644 --- a/Master/texmf-dist/doc/latex/exsheets/exsheets_en.pdf +++ b/Master/texmf-dist/doc/latex/exsheets/exsheets_en.pdf diff --git a/Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex b/Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex index 728d373118f..ee83c00a510 100644 --- a/Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex +++ b/Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex @@ -132,8 +132,6 @@ } \usepackage{exsheets-listings} -\edef\exsheetslistingsverion{v\csname exsheets@listings@version\endcsname} - \microtypesetup{tracking=scshape} \defbibheading{bibliography}[\bibname]{\section{#1}} @@ -437,6 +435,30 @@ New options: section~\ref{sec:additional_info}. \end{itemize} +\subsection{Version 0.16} +New options/changes: +\begin{itemize} + \item The option \option{pre-hook} to the \env{question} environment now + places its contents before the question heading, see + section~\ref{sec:opti-ques-envir}. + \item New option \option{pre-body-hook} to the \env{question} environment + which adds its contents before the question body, see + section~\ref{sec:opti-ques-envir}. + \item New option \option{post-body-hook} to the \env{question} environment + which adds its contents after the question body, see + section~\ref{sec:opti-ques-envir}. + \item New option \option{pre-hook} to the \env{solution} environment which + adds code before a solution, see section~\ref{sec:opti-soli-envir}. + \item New option \option{post-hook} to the \env{solution} environment which + adds code after a solution, see section~\ref{sec:opti-soli-envir}. + \item New option \option{pre-body-hook} to the \env{solution} environment + which adds its contents before the solution body, see + section~\ref{sec:opti-soli-envir}. + \item New option \option{post-body-hook} to the \env{solution} environment + which adds its contents after the solution body, see + section~\ref{sec:opti-soli-envir}. +\end{itemize} + \section{Thanks} I need to thank the many users who gave me feedback so far! For one thing this shows me that \ExSheets\ is useful to people. It also led to many @@ -653,9 +675,13 @@ The \env{question} environment takes one or more of the following options: \keybool{use}\Module{question}\Default{true} Discards the question. Or not. \keyval{pre-hook}{code}\Module{question}\Default - \sinceversion{0.14}Adds \meta{code} directly before the question body. - \keyval{pre-hook}{code}\Module{question}\Default - \sinceversion{0.14}Adds \meta{code} directly after the question body. + \changedversion{0.16}Adds \meta{code} directly before the question title. + \keyval{post-hook}{code}\Module{question}\Default + \changedversion{0.16}Adds \meta{code} directly after the question. + \keyval{pre-body-hook}{code}\Module{question}\Default + \sinceversion{0.16}Adds \meta{code} directly before the question body. + \keyval{post-body-hook}{code}\Module{question}\Default + \sinceversion{0.16}Adds \meta{code} directly after the question body. \end{options} \begin{example} @@ -745,13 +771,21 @@ You can see that in the default settings the solution is \emph{not} written to the document. It has been saved, though, for possible later usage. We will see the solution later! -\subsection{Options to the \env*{solution} Environment} +\subsection{Options to the \env*{solution} Environment}\label{sec:opti-soli-envir} The \env{solutions} environment also has options, namely these: \begin{options} \keyval{name}{name}\Module{solution}\Default Sets a custom name. \keybool{print}\Module{solution}\Default{false} Prints or hides the solution. + \keyval{pre-hook}{code}\Module{solution}\Default + \sinceversion{0.16}Adds \meta{code} directly before the solution title. + \keyval{post-hook}{code}\Module{solution}\Default + \sinceversion{0.16}Adds \meta{code} directly after the solution. + \keyval{pre-body-hook}{code}\Module{solution}\Default + \sinceversion{0.16}Adds \meta{code} directly before the solution body. + \keyval{post-body-hook}{code}\Module{solution}\Default + \sinceversion{0.16}Adds \meta{code} directly after the solution body. \end{options} Their meaning is the same as those for the \code{question} environment. \begin{example} @@ -2387,7 +2421,7 @@ will be loaded \cs*{AtBeginDocument}. \SetupExSheets{headings=block} -\part{The \ExSheetslistings\ Package \exsheetslistingsverion}\label{part:listings} +\part{The \ExSheetslistings\ Package}\label{part:listings} \section{The Problem} I knew the day would come when people would ask how to include verbatim material in the \env{question} and \env{solution} environments. Since they're diff --git a/Master/texmf-dist/tex/latex/exsheets/exsheets-listings.sty b/Master/texmf-dist/tex/latex/exsheets/exsheets-listings.sty index 544ad1ce34d..8ae6f4ffdc5 100644 --- a/Master/texmf-dist/tex/latex/exsheets/exsheets-listings.sty +++ b/Master/texmf-dist/tex/latex/exsheets/exsheets-listings.sty @@ -26,13 +26,11 @@ % feel free to contact me. % ---------------------------------------------------------------------------- \RequirePackage{exsheets,listings} -\def\exsheets@listings@date{2013/10/11} -\def\exsheets@listings@version{0.2} % we need this loaded before expl3 syntax is activated: \lst@RequireAspects{writefile} \ProvidesExplPackage{exsheets-listings} - {\exsheets@listings@date} - {\exsheets@listings@version} + {\exsheets@date} + {\exsheets@version} {listings in exsheets} % ---------------------------------------------------------------------------- diff --git a/Master/texmf-dist/tex/latex/exsheets/exsheets.sty b/Master/texmf-dist/tex/latex/exsheets/exsheets.sty index 4e628c964af..5f358be1e6c 100644 --- a/Master/texmf-dist/tex/latex/exsheets/exsheets.sty +++ b/Master/texmf-dist/tex/latex/exsheets/exsheets.sty @@ -25,8 +25,8 @@ % If you have any ideas, questions, suggestions or bugs to report, please % feel free to contact me. % ---------------------------------------------------------------------------- -\def\exsheets@date{2014/07/20} -\def\exsheets@version{0.15} +\def\exsheets@date{2014/09/14} +\def\exsheets@version{0.16} \RequirePackage { expl3 , xparse } \ProvidesExplPackage @@ -80,73 +80,73 @@ % messages \msg_new:nnn {exsheets} {totalpoints} { - You~need~to~activate~`points/parse'~if~you~want~to~use~ - \token_to_str:N \totalpoints .~I~will~do~nothing~instead. + You~ need~ to~ activate~ `points/parse'~ if~ you~ want~ to~ use~ + \token_to_str:N \totalpoints .~ I~ will~ do~ nothing~ instead. } \msg_new:nnn {exsheets} {parse-points} { - You~need~to~activate~`points/parse'~if~you~want~to~use~ - \token_to_str:N #1 .~I~will~do~nothing~instead. + You~ need~ to~ activate~ `points/parse'~ if~ you~ want~ to~ use~ + \token_to_str:N #1 .~ I~ will~ do~ nothing~ instead. } \msg_new:nnn {exsheets} {headings} { - You~requested~the~headings~instance~`#1'~\msg_line_context: \c_space_tl - which~is~not~defined.~Did~you~forget~to~use~the~package~option~ - `load-headings'?~Anyway,~I~will~use~the~instance~`block'~instead~and~ - pretend~nothing~happened. + You~ requested~ the~ headings~ instance~ `#1'~ \msg_line_context: \c_space_tl + which~ is~ not~ defined.~ Is~ this~ a~ typo?~ Anyway,~ I~ will~ use~ the~ + instance~ `block'~ instead~ and~pretend~ nothing~ happened. } \msg_new:nnn {exsheets} {random-file} { - You~asked~me~to~select~#1~questions~from~file~#2~which~contains~#3~questions.~ - I'll~select~all~of~them. + You~ asked~ me~ to~ select~ #1~ questions~ from~ file~ #2~ which~ + contains~ #3~ questions.~ I'll~ select~ all~ of~ them. } \msg_new:nnn {exsheets} {random-selectable} { - You~asked~me~to~select~#1~questions~from~file~#2~which~contains~#3~questions.~ - #4~of~these~are~selectable,~so~I'll~select~all~of~them. + You~ asked~ me~ to~ select~ #1~ questions~ from~ file~ #2~ which~ + contains~ #3~ questions.~ #4~ of~ these~ are~ selectable,~ so~ I'll~ + select~ all~ of~ them. } \msg_new:nnn {exsheets} {only-inside-question} { - The~command~`~\token_to_str:N #1 \c_space_tl'~can~only~be~used~inside~ - the~question~environment. + The~ command~ `~ \token_to_str:N #1 \c_space_tl'~ can~ only~ be~ used~ + inside~ the~ question~ environment. } \msg_new:nnn {exsheets} {loading-configurations} - { Loading~custom~configurations~file~`exsheets_configurations.cgf'. } + { Loading~ custom~ configurations~ file~ `exsheets_configurations.cgf'. } \msg_new:nnn {exsheets} {deprecated-command} { - The~command~`~\token_to_str:N #1 \c_space_tl'~is~deprecated.~ - Use~`~\token_to_str:N #2 \c_space_tl'~instead. + The~ command~ `~ \token_to_str:N #1 \c_space_tl'~ is~ deprecated.~ + Use~ `~ \token_to_str:N #2 \c_space_tl'~ instead. } \msg_new:nnn {exsheets} {dropped-option} - { The~option~`#1'~has~been~dropped. } + { The~ option~ `#1'~ has~ been~ dropped. } \msg_new:nnn {exsheets} {grade-missing} - { The~grade~`#1'~has~never~been~declared. } + { The~ grade~ `#1'~ has~ never~ been~ declared. } \msg_new:nnn {exsheets} {grade-parse} { - I~cannot~calculate~the~points~for~grade~`#1'~since~you're~using~the~option~ - `points/parse=false'. + I~ cannot~ calculate~ the~ points~ for~ grade~ `#1'~ since~ you're~ using~ + the~ option~ `points/parse=false'. } \msg_new:nnn {exsheets} {variations} { - The~number~of~variations~must~at~least~be~`2'.~You~chose~`#1'~hence~I'm~ - doing~nothing. + The~ number~ of~ variations~ must~ at~ least~ be~ `2'.~ You~ chose~ `#1'~ + hence~ I'm~ doing~ nothing. } \msg_new:nnn {exsheets} {variant} { - You~must~choose~an~integer~between~`1'~and~`#1'.~You~chose~`#2'~hence~ - I'm~doing~nothing. + You~ must~ choose~ an~ integer~ between~ `1'~ and~ `#1'.~ You~ chose~ + `#2'~ hence~ I'm~ doing~ nothing. } \cs_new_protected:Npn \exsheets_depr_cmd:nn #1#2 @@ -156,7 +156,7 @@ } \cs_new_protected:Npn \exsheets_option_dropped:n #1 - { \msg_warning:nnn {exsheets} { dropped-option } {#1} } + { \msg_warning:nnn {exsheets} {dropped-option} {#1} } % ---------------------------------------------------------------------------- \RequirePackage @@ -232,9 +232,6 @@ \tl_set:Nn \l__exsheets_questions_toclevel_tl { subsection } \tl_new:N \l__exsheets_solutions_toclevel_tl \tl_set:Nn \l__exsheets_solutions_toclevel_tl { subsection } -\tl_new:N \l__exsheets_solutions_pre_hook_tl -\tl_new:N \l__exsheets_solutions_post_hook_tl - \keys_define:nn {exsheets} { @@ -253,7 +250,7 @@ headings-format .tl_set:N = \l_exsheets_heading_title_user_format_tl , subtitle-format .tl_set:N = - \l_heading_exsheets_subtitle_user_format_tl , + \l_exsheets_heading_subtitle_user_format_tl , load-tasks .code:n = \exsheets_option_dropped:n {load-tasks} , use-ref .bool_set:N = \l__exsheets_solutions_by_ref_bool , @@ -827,7 +824,7 @@ % Einteilung in Klassen, Themen und andere Gruppierungen: \prop_new:N \l__exsheets_class_prop -\tl_new:N \l__exsheets_step_counter_tl +\tl_new:N \g__exsheets_use_current_question_tl \bool_new:N \l__exsheets_use_this_question_bool \cs_new_protected:Npn \exsheets_new_question_class:nn #1#2 @@ -971,6 +968,8 @@ \tl_new:N \l__exsheets_questions_pre_hook_tl \tl_new:N \l__exsheets_questions_post_hook_tl +\tl_new:N \l__exsheets_questions_pre_body_hook_tl +\tl_new:N \l__exsheets_questions_post_body_hook_tl \tl_new:N \CurrentQuestionID @@ -1024,10 +1023,7 @@ \exsheets_set_ref_properties:V \l__exsheets_questions_label_tl } \__exsheets_save_number_in:N \g__exsheets_question_number_prop - \tl_use:N \l__exsheets_questions_pre_hook_tl \__exsheets_save_and_print_question_body:V \BODY - \tl_use:N \l__exsheets_questions_post_hook_tl - \exsheets_h_or_vspace:N \l__exsheets_questions_skip_below_dim \exsheets_set_question_properties:x { \tl_if_blank:VF \l__exsheets_questions_subtitle_tl @@ -1042,17 +1038,21 @@ { bonus-points = \fp_to_tl:N \g__exsheets_this_question_bonus_fp } } } + \tl_use:N \l__exsheets_questions_post_hook_tl } } \cs_new:Npn \__exsheets_save_and_print_question_body:n #1 { + \tl_use:N \l__exsheets_questions_pre_body_hook_tl \group_begin: \bool_if:NF \l__exsheets_save_question_body_to_aux_bool { \@fileswfalse } \exsheets_set_question_properties:n { question-body = {#1} } \group_end: #1 + \tl_use:N \l__exsheets_questions_post_body_hook_tl + \exsheets_h_or_vspace:N \l__exsheets_questions_skip_below_dim } \cs_generate_variant:Nn \__exsheets_save_and_print_question_body:n { V } @@ -1167,6 +1167,35 @@ \exsheets_update_referencing_commands: +\cs_new_protected:Npn \__exsheets_determine_question_usage: + { + \tl_gclear:N \g__exsheets_use_current_question_tl + \prop_map_inline:Nn \l__exsheets_class_prop + { + \use:c { __exsheets_questions_use_##1: } + \bool_if:nTF + { + ( + \l__exsheets_use_this_question_bool + && + \bool_if_p:c { l__exsheets_##2_active_bool } + ) + || + ! \bool_if_p:c { g__exsheets_use_##1_bool } + } + { \tl_gput_right:Nn \g__exsheets_use_current_question_tl { y } } + { \tl_gput_right:Nn \g__exsheets_use_current_question_tl { n } } + } + } + +\prg_new_protected_conditional:Npnn \exsheets_if_current_question_is_used: { T,F,TF } + { + \tl_if_in:NnTF \g__exsheets_use_current_question_tl { n } + { \prg_return_false: } + { \prg_return_true: } + } + + \newenvironment { __exsheets_question: } [2] { \bool_set_true:N \l__exsheets_inside_question_bool @@ -1258,27 +1287,8 @@ !\l__exsheets_questions_deactivate_bool } { - \tl_clear:N \l__exsheets_step_counter_tl - % das ist etwas mühsam: abhängig von der Nutzung der verschiedenen - % Gruppierungsmöglichkeiten muss der Counter erhöht werden: - \prop_map_inline:Nn \l__exsheets_class_prop - { - \use:c { __exsheets_questions_use_##1: } - \bool_if:nTF - { - ( - \l__exsheets_use_this_question_bool - && - \bool_if_p:c { l__exsheets_##2_active_bool } - ) - || - ! \bool_if_p:c { g__exsheets_use_##1_bool } - } - { \tl_put_right:Nn \l__exsheets_step_counter_tl { y } } - { \tl_put_right:Nn \l__exsheets_step_counter_tl { n } } - } - % erhöhe jetzt, wenn kein Nein dabei war: - \tl_if_in:NnF \l__exsheets_step_counter_tl { n } + \__exsheets_determine_question_usage: + \exsheets_if_current_question_is_used:T { \refstepcounter{question} } \__exsheets_get_sectioning_numbers: \bool_if:nT @@ -1323,6 +1333,7 @@ \bool_if:nTF { \l__exsheets_parse_points_bool && !\l__exsheets_only_print_points_bool } { + \tl_use:N \l__exsheets_questions_pre_hook_tl \exsheets_use_heading:VVVVnV \l__exsheets_question_heading_instance_tl \l__exsheets_questions_title_tl @@ -1337,6 +1348,7 @@ % might be dangerous to expand here... \tl_if_blank:xTF { \l__exsheets_questions_points_tl } { + \tl_use:N \l__exsheets_questions_pre_hook_tl \exsheets_use_heading:VVVnnV \l__exsheets_question_heading_instance_tl \l__exsheets_questions_title_tl @@ -1346,6 +1358,7 @@ \l__exsheets_tmpa_tl } { + \tl_use:N \l__exsheets_questions_pre_hook_tl \exsheets_use_heading:VVVVnV \l__exsheets_question_heading_instance_tl \l__exsheets_questions_title_tl @@ -1522,6 +1535,8 @@ skip-below .dim_set:N = \l__exsheets_questions_skip_below_dim , pre-hook .tl_set:N = \l__exsheets_questions_pre_hook_tl , post-hook .tl_set:N = \l__exsheets_questions_post_hook_tl , + pre-body-hook .tl_set:N = \l__exsheets_questions_pre_body_hook_tl , + post-body-hook .tl_set:N = \l__exsheets_questions_post_body_hook_tl , save-to-aux .bool_set:N = \l__exsheets_save_question_body_to_aux_bool } @@ -2048,24 +2063,24 @@ { \int_use:N \g__exsheets_questions_id_int } \l__exsheets_qu_counter_pattern_tl % print here - \bool_if:NT \l__exsheets_solutions_print_here_bool + \exsheets_if_current_question_is_used:T { - \int_set:Nn \l__exsheets_counter_qu_int { \arabic{question} } - \__exsheets_get_sectioning_numbers: - \__exsheets_solutions_name:VVV - \l__exsheets_qu_counter_interpretation_tl - \l__exsheets_solutions_name_tl - \g__exsheets_questions_current_id_tl - \use:n {#1} - \exsheets_h_or_vspace:N \l__exsheets_solutions_skip_below_dim + \bool_if:NT \l__exsheets_solutions_print_here_bool + { + \int_set:Nn \l__exsheets_counter_qu_int { \arabic{question} } + \__exsheets_get_sectioning_numbers: + \__exsheets_print_solution:VVVn + \l__exsheets_qu_counter_interpretation_tl + \l__exsheets_solutions_name_tl + \g__exsheets_questions_current_id_tl + {#1} + } } } \cs_generate_variant:Nn \__exsheets_save_solution:n { V } \NewEnviron { __exsheets_solution_internal: } { - % \exp_args:NNV \cspreto \BODY \l__exsheets_solutions_pre_hook_tl - % \exp_args:NNV \csappto \BODY \l__exsheets_solutions_post_hook_tl \bool_if:nT { \g__exsheets_questions_use_bool && \l__exsheets_solutions_use_bool } { \__exsheets_save_solution:V \BODY } @@ -2104,7 +2119,6 @@ { \bool_set_true:N \l__exsheets_inside_solution_bool \IfNoValueF {#1} { \keys_set:nn { exsheets / solution } {#1} } - % \tl_use:N \l__exsheets_solutions_pre_hook_tl } \tl_if_blank:VT \l__exsheets_solution_heading_instance_tl { @@ -2114,11 +2128,7 @@ } \__exsheets_solution_internal: } - { - \end__exsheets_solution_internal: - % \bool_if:NT \l__exsheets_solutions_use_bool - % { \tl_use:N \l__exsheets_solutions_post_hook_tl } - } + { \end__exsheets_solution_internal: } \bool_new:N \l__exsheets_solutions_runin_bool \bool_set_false:N \l__exsheets_solutions_runin_bool @@ -2250,16 +2260,22 @@ {#1} \l__exsheets_tmpc_tl \prop_get:NnN \g__exsheets_solutions_counter_prop {#1} \l__exsheets_tmpd_tl + \group_begin: + \tl_set_eq:NN \CurrentQuestionID \l__exsheets_tmpc_tl + \__exsheets_sectioning_hook:nV { ch } + \l__exsheets_new_chapter_hook_tl + \__exsheets_sectioning_hook:nV { sec } + \l__exsheets_new_section_hook_tl + \group_end: \eSaveCounterPatternFrom [ exsheets ] \l__exsheets_current_pattern_interpretation_tl \l__exsheets_current_pattern_tl \l__exsheets_tmpd_tl - \exsheets_solutions_print_name:VVV + \__exsheets_print_solution:VVVV \l__exsheets_current_pattern_tl \l__exsheets_tmpa_tl \l__exsheets_tmpc_tl - \tl_use:N \l__exsheets_tmpb_tl - \exsheets_h_or_vspace:N \l__exsheets_solutions_skip_below_dim + \l__exsheets_tmpb_tl } } @@ -2433,12 +2449,11 @@ \l__exsheets_current_pattern_interpretation_tl \l__exsheets_current_pattern_tl \l__exsheets_tmpd_tl - \exsheets_solutions_print_name:VVV + \__exsheets_print_solution:VVVV \l__exsheets_current_pattern_tl \l__exsheets_tmpa_tl \l__exsheets_tmpc_tl - \tl_use:N \l__exsheets_tmpb_tl - \exsheets_h_or_vspace:N \l__exsheets_solutions_skip_below_dim + \l__exsheets_tmpb_tl } } @@ -2483,12 +2498,11 @@ \l__exsheets_current_pattern_interpretation_tl \l__exsheets_current_pattern_tl \l__exsheets_qu_counter_pattern_tl - \exsheets_solutions_print_name:VVV + \__exsheets_print_solution:VVVV \l__exsheets_current_pattern_tl \l__exsheets_tmpa_tl \l__exsheets_tmpc_tl - \tl_use:N \l__exsheets_tmpb_tl - \exsheets_h_or_vspace:N \l__exsheets_solutions_skip_below_dim + \l__exsheets_tmpb_tl } } } @@ -2521,6 +2535,22 @@ } \cs_generate_variant:Nn \exsheets_solutions_print_name:nnn { VVV } +% #1: number +% #2: name +% #3: ID +% #4: body +\cs_new_protected:Npn \__exsheets_print_solution:nnnn #1#2#3#4 + { + \tl_use:N \l__exsheets_solutions_pre_hook_tl + \exsheets_solutions_print_name:nnn {#1} {#2} {#3} + \tl_use:N \l__exsheets_solutions_pre_body_hook_tl + \use:n {#4} + \tl_use:N \l__exsheets_solutions_post_body_hook_tl + \tl_use:N \l__exsheets_solutions_post_hook_tl + \exsheets_h_or_vspace:N \l__exsheets_solutions_skip_below_dim + } +\cs_generate_variant:Nn \__exsheets_print_solution:nnnn { VVV, VVVV } + \cs_new:Npn \PrintSolutionsTF { \bool_if:NTF \l__exsheets_solutions_print_bool } \cs_new:Npn \PrintSolutionsT @@ -2531,6 +2561,11 @@ \bool_new:N \l__exsheets_print_byID_sorted_bool \bool_set_true:N \l__exsheets_print_byID_sorted_bool +\tl_new:N \l__exsheets_solutions_pre_body_hook_tl +\tl_new:N \l__exsheets_solutions_post_body_hook_tl +\tl_new:N \l__exsheets_solutions_pre_hook_tl +\tl_new:N \l__exsheets_solutions_post_hook_tl + \keys_define:nn { exsheets / solution } { headings .tl_set:N = \l__exsheets_solution_heading_instance_tl , @@ -2551,8 +2586,10 @@ name .tl_set:N = \l__exsheets_solutions_name_tl , sorted .bool_set:N = \l__exsheets_print_byID_sorted_bool , skip-below .dim_set:N = \l__exsheets_solutions_skip_below_dim , - % pre-hook .tl_set:N = \l__exsheets_solutions_pre_hook_tl , - % post-hook .tl_set:N = \l__exsheets_solutions_post_hook_tl + pre-body-hook .tl_set:N = \l__exsheets_solutions_pre_body_hook_tl , + post-body-hook .tl_set:N = \l__exsheets_solutions_post_body_hook_tl , + pre-hook .tl_set:N = \l__exsheets_solutions_pre_hook_tl , + post-hook .tl_set:N = \l__exsheets_solutions_post_hook_tl } % ---------------------------------------------------------------------------- @@ -2701,6 +2738,7 @@ % the following code from Heiko Oberdieck in d.c.t.t served as inspiration % and basis for the \blank command: +% https://groups.google.com/d/msg/de.comp.text.tex/fZLwraH04jE/o1RSdFXjGuIJ % % \makeatletter % \newcommand*{\luecke}{% @@ -3055,8 +3093,6 @@ HISTORY: \exsheets_use_heading:nnnnnn - new options `question/pre-hook' and `question/post-hook' - % `solution/pre-hook' and - % `solution/post-hook' - new pre-defined property `question-body' - new pre-defined property `bonus-points' - new pre-defined property `counter' @@ -3070,6 +3106,21 @@ HISTORY: its own - drop options `load-headings' and `load-tasks' - new command \IfQuestionPropertyTF +2014/09/14 v0.16 - fix `subtitle-format' option + - allow that the format given in `headings-format' and + `subtitle-format' can end with a command needing an + argument + - add options `solution/pre-hook', + `solution/post-hook', `solution/pre-body-hook' and + `solution/post-body-hook' (this adds a possibility + for issue #21) + - add options `question/pre-body-hook' and + `question/post-body-hook' + - add internal interface for the printing of solutions + ( \__exsheets_print_solution:nnnn ) + - fix issue #22 + - fix issue #23 + - use only one version number for the whole bundle %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % TODO: diff --git a/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def b/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def index 83fe81bf4d1..0604adb28dd 100644 --- a/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def +++ b/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def @@ -249,7 +249,7 @@ \tl_use:N \l__exsheets_heading_title_format_tl \strut \tl_use:N \l__exsheets_heading_title_pre_code_tl - { \tl_use:N \l_exsheets_heading_title_user_format_tl #1 } + { \tl_use:N \l_exsheets_heading_title_user_format_tl {#1} } \tl_use:N \l__exsheets_heading_title_post_code_tl } \hcoffin_set:Nn \l__exsheets_heading_number_coffin @@ -259,7 +259,7 @@ { \tl_use:N \l__exsheets_heading_number_format_tl } \strut \tl_use:N \l__exsheets_heading_number_pre_code_tl - { \tl_use:N \l_exsheets_heading_title_user_format_tl #2 } + { \tl_use:N \l_exsheets_heading_title_user_format_tl {#2} } \tl_use:N \l__exsheets_heading_number_post_code_tl } \hcoffin_set:Nn \l__exsheets_heading_subtitle_coffin @@ -274,7 +274,7 @@ { \group_begin: \tl_use:N \l_exsheets_heading_subtitle_user_format_tl - \exsheets_get_question_property:nn { subtitle } { #5 } + { \exsheets_get_question_property:nn { subtitle } { #5 } } \group_end: } \tl_use:N \l__exsheets_heading_subtitle_post_code_tl |