diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/exsheets/exsheets.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/exsheets/exsheets.sty | 94 |
1 files changed, 59 insertions, 35 deletions
diff --git a/Master/texmf-dist/tex/latex/exsheets/exsheets.sty b/Master/texmf-dist/tex/latex/exsheets/exsheets.sty index cc2b91f14d2..f24065715ef 100644 --- a/Master/texmf-dist/tex/latex/exsheets/exsheets.sty +++ b/Master/texmf-dist/tex/latex/exsheets/exsheets.sty @@ -31,8 +31,8 @@ % If you have any ideas, questions, suggestions or bugs to report, please % feel free to contact me. % ---------------------------------------------------------------------------- -\def\exsheets@date{2013/04/04} -\def\exsheets@version{0.8a} +\def\exsheets@date{2013/04/08} +\def\exsheets@version{0.9a} \RequirePackage { expl3 , xparse } \ProvidesExplPackage @@ -120,7 +120,7 @@ I'm~doing~nothing. } -\cs_new:Npn \exsheets_depr_cmd:nn #1#2 +\cs_new_protected:Npn \exsheets_depr_cmd:nn #1#2 { \cs_new:Npn #1 { \msg_warning:nnnn { exsheets } { deprecated-command } { #1 } { #2 } #2 } @@ -258,45 +258,45 @@ \tl_new:N \l__exsheets_points_post_bonus_marker_tl \tl_set:Nn \l__exsheets_points_post_bonus_marker_tl { ) } -\cs_new_nopar:Npn \exsheets_set_points_name:n #1 +\cs_new_protected_nopar:Npn \exsheets_set_points_name:n #1 { \tl_if_in:nnTF { #1 } { / } { \__exsheets_set_points_name_aux:nn #1 \q_stop } { \__exsheets_set_points_name_aux:nn #1 / \q_stop } } -\cs_new_nopar:Npn \__exsheets_set_points_name_aux:nn #1/#2 \q_stop +\cs_new_protected_nopar:Npn \__exsheets_set_points_name_aux:nn #1/#2 \q_stop { \tl_set:Nn \l__exsheets_points_name_tl { #1 } \tl_set:Nn \l__exsheets_points_name_plural_tl { #1#2 } } -\cs_new_nopar:Npn \exsheets_set_bonus_name:n #1 +\cs_new_protected_nopar:Npn \exsheets_set_bonus_name:n #1 { \tl_if_in:nnTF { #1 } { / } { \__exsheets_set_bonus_name_aux:nn #1 \q_stop } { \__exsheets_set_bonus_name_aux:nn #1 / \q_stop } } -\cs_new_nopar:Npn \__exsheets_set_bonus_name_aux:nn #1/#2 \q_stop +\cs_new_protected_nopar:Npn \__exsheets_set_bonus_name_aux:nn #1/#2 \q_stop { \tl_set:Nn \l__exsheets_bonus_name_tl { #1 } \tl_set:Nn \l__exsheets_bonus_name_plural_tl { #1#2 } } % FIXME: \fp_add will deprecate! -\cs_new_nopar:Npn \exsheets_add_points:n #1 +\cs_new_protected_nopar:Npn \exsheets_add_points:n #1 { \fp_gadd:Nn \g__exsheets_points_sum_fp { #1 } } \cs_generate_variant:Nn \exsheets_add_points:n { V } -\cs_new_nopar:Npn \exsheets_add_bonus:n #1 +\cs_new_protected_nopar:Npn \exsheets_add_bonus:n #1 { \fp_gadd:Nn \g__exsheets_bonus_sum_fp { #1 } } \cs_generate_variant:Nn \exsheets_add_bonus:n { V } -\cs_new_nopar:Npn \exsheets@sum@of@points #1 +\cs_new_protected_nopar:Npn \exsheets@sum@of@points #1 { \fp_gset:Nn \g__exsheets_total_points_fp { #1 } } -\cs_new_nopar:Npn \exsheets@sum@of@bonus #1 +\cs_new_protected_nopar:Npn \exsheets@sum@of@bonus #1 { \fp_gset:Nn \g__exsheets_total_bonus_fp { #1 } } \cs_new_nopar:Npn \exsheets_parse_points:n #1 @@ -325,7 +325,7 @@ } \cs_generate_variant:Nn \exsheets_parse_bonus:n { V } -\cs_new_nopar:Npn \exsheets_num:n #1 +\cs_new_protected_nopar:Npn \exsheets_num:n #1 { \group_begin: \fp_set:Nn \l__exsheets_tmpa_tl { #1 } @@ -414,14 +414,14 @@ { \exsheets_print_bonus:n { #2 } } } -\cs_new_nopar:Npn \exsheets_print_points:n #1 +\cs_new_protected_nopar:Npn \exsheets_print_points:n #1 { \exsheets_parse_points:n { #1 } \exsheets_points_name:n { #1 } } \cs_generate_variant:Nn \exsheets_print_points:n { V } -\cs_new_nopar:Npn \exsheets_print_bonus:n #1 +\cs_new_protected_nopar:Npn \exsheets_print_bonus:n #1 { \exsheets_parse_bonus:n { #1 } \exsheets_bonus_name:n { #1 } @@ -674,7 +674,7 @@ { \__exsheets_declare_relgrades:n { #1 } } \@onlypreamble \DeclareRelGrades -\cs_new:Npn \__exsheets_grade:nn #1#2 +\cs_new_protected:Npn \__exsheets_grade:nn #1#2 { \prop_get:NnNTF \l__exsheets_relgrades_prop { #2 } \l__exsheets_tmpa_fp { @@ -917,7 +917,7 @@ { \fp_set:Nn \l__exsheets_question_bonus_fp { #2 } } } } -\cs_new:Npn \__exsheets_read_points:n #1 +\cs_new_protected:Npn \__exsheets_read_points:n #1 { \__exsheets_read_points:w #1++ \q_stop } \NewDocumentEnvironment { __exsheets_question: } { gg } @@ -1127,7 +1127,7 @@ } } -\cs_new:Npn \__exsheets_restore_number_from_and_do:Nnn #1#2#3 +\cs_new_protected:Npn \__exsheets_restore_number_from_and_do:Nnn #1#2#3 { \prop_get:NnN #1 { #2 } \l__exsheets_tmpc_tl \tl_if_eq:NNF \l__exsheets_tmpc_tl \q_no_value @@ -1292,7 +1292,7 @@ \colorlet { exsheetsdebugcolor } { yellow } -\cs_new:Npn \exsheets_debug_box:nn #1#2 +\cs_new_protected:Npn \exsheets_debug_box:nn #1#2 { \exsheets_par: \noindent @@ -1306,7 +1306,7 @@ \cs_new:Npn \__exsheets_list_comma: {} -\cs_new_nopar:Npn \exsheets_questions_debug: +\cs_new_protected:Npn \exsheets_questions_debug: { \bool_if:nT { \l__exsheets_questions_debug_bool && \l__exsheets_inside_question_bool } @@ -1744,7 +1744,7 @@ \bool_new:N \l__exsheets_solutions_runin_bool \bool_set_false:N \l__exsheets_solutions_runin_bool -\cs_new_nopar:Npn \__exsheets_solutions_name:nn #1#2 +\cs_new_protected_nopar:Npn \__exsheets_solutions_name:nn #1#2 { \tl_if_blank:VT \l__exsheets_solution_heading_instance_tl { @@ -1855,7 +1855,7 @@ \int_set:Nn \l__exsheets_counter_qu_int { \arabic{question} } } -\cs_new:Npn \__exsheets_print_solution_if:nn #1#2 +\cs_new_protected:Npn \__exsheets_print_solution_if:nn #1#2 { \exp_args:No \int_compare:nT { #2 } { @@ -2088,7 +2088,7 @@ } } -\cs_new_nopar:Npn \__exsheets_read_number:w #1-#2-#3 \q_stop +\cs_new_protected_nopar:Npn \__exsheets_read_number:w #1-#2-#3 \q_stop { \int_zero:N \l__exsheets_counter_ch_int \int_zero:N \l__exsheets_counter_sec_int @@ -2102,7 +2102,7 @@ \int_set:Nn \l__exsheets_counter_qu_int { #3 } } -\cs_new_nopar:Npn \exsheets_solutions_print_name:nn #1#2 +\cs_new_protected_nopar:Npn \exsheets_solutions_print_name:nn #1#2 { \tl_set_rescan:Nnn \l__exsheets_tmpa_tl { \char_set_catcode_letter:N \@ } { #1 } @@ -2147,32 +2147,32 @@ % ---------------------------------------------------------------------------- % create question/solution pairs -\cs_new:Npn \__exsheets_new_qu_sol_pair:nnnn #1#2#3#4 +\cs_new_protected:Npn \__exsheets_new_qu_sol_pair:nnnnnn #1#2#3#4#5#6 { \NewDocumentEnvironment { #1 } { O{}G{} } - { \__exsheets_question: {#2,##1} {##2} } + { \keys_set:nn { exsheets } { #3 } \__exsheets_question: {#2,##1} {##2} } { \end__exsheets_question: } - \NewDocumentEnvironment { #3 } { O{} } - { \__exsheets_solution: {#4,##1} } + \NewDocumentEnvironment { #4 } { O{} } + { \keys_set:nn { exsheets } { #6 } \__exsheets_solution: {#5,##1} } { \end__exsheets_solution: } } -\cs_new:Npn \__exsheets_renew_qu_sol_pair:nnnn #1#2#3#4 +\cs_new_protected:Npn \__exsheets_renew_qu_sol_pair:nnnnnn #1#2#3#4#5#6 { \RenewDocumentEnvironment { #1 } { O{}G{} } - { \__exsheets_question: {#2,##1} {##2} } + { \keys_set:nn { exsheets } { #3 } \__exsheets_question: {#2,##1} {##2} } { \end__exsheets_question: } - \RenewDocumentEnvironment { #3 } { O{} } - { \__exsheets_solution: {#4,##1} } + \RenewDocumentEnvironment { #4 } { O{} } + { \keys_set:nn { exsheets } { #6 } \__exsheets_solution: {#5,##1} } { \end__exsheets_solution: } } -\NewDocumentCommand \NewQuSolPair { mO{}mO{} } - { \__exsheets_new_qu_sol_pair:nnnn { #1 } { #2 } { #3 } { #4 } } +\NewDocumentCommand \NewQuSolPair { mO{}O{}mO{}O{} } + { \__exsheets_new_qu_sol_pair:nnnnnn { #1 } { #2 } { #3 } { #4 } { #5 } { #6 } } \@onlypreamble \NewQuSolPair -\NewDocumentCommand \RenewQuSolPair { mO{}mO{} } - { \__exsheets_renew_qu_sol_pair:nnnn { #1 } { #2 } { #3 } { #4 } } +\NewDocumentCommand \RenewQuSolPair { mO{}O{}mO{}O{} } + { \__exsheets_renew_qu_sol_pair:nnnnnn { #1 } { #2 } { #3 } { #4 } { #5 } { #6 } } \@onlypreamble \RenewQuSolPair % ---------------------------------------------------------------------------- @@ -2550,6 +2550,30 @@ HISTORY: 2013/04/04 v0.8a - translations: bug fix in \DeclareDictTranslation - exsheets: added Portuguese translations - tasks: corrected \seq_length:N => \seq_count:N +2013/04/07 v0.9 - translations: slightly improved messages + - tasks: protected internal commands where appropriate + - tasks: made enumerated item referenceable with \label{} + and \ref{}; this introduced new options: + * the former `label-format' is now `counter-format' + * new: `label-format' + - tasks: changed defaults for `label-width' and + `label-offset' + - tasks: ensure that the `after-item-skip' is only + inserted in between rows + - tasks: new option `after-item-skip' + - tasks: improvements when label are set with optional + argument: + * a provided but empty argument is now correctly + recognized + * the counter is _not_ stepped anymore for enumerated + lists when the optional argument is provided + - tasks: new command \nextonnewrow that forces the next + item to be put at the beginning of a row + - exsheets: protected internal commands where appropriate + - exsheets: added possibility to set general options + with \NewQuSolPair and \RenewQuSolPair +2013/04/08 v0.9a - exsheets: added headings instance `empty' + - translations: changed fallback warning into info %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % TODO: |