diff options
author | Karl Berry <karl@freefriends.org> | 2015-05-08 22:17:59 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-05-08 22:17:59 +0000 |
commit | b01c284cd5b49463dc30f117b5b24020a1f8cc7d (patch) | |
tree | e9fd61ce2c739e167dba6aaee8779cfc026da279 /Master | |
parent | 0c2bb1a3f4ead43fc8928b06efe420c099c46a67 (diff) |
exsheets (8may15)
git-svn-id: svn://tug.org/texlive/trunk@37278 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/exsheets/README | 6 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/exsheets/exsheets_en.pdf | bin | 683256 -> 682183 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/exsheets/exsheets.sty | 170 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def | 2 |
5 files changed, 80 insertions, 100 deletions
diff --git a/Master/texmf-dist/doc/latex/exsheets/README b/Master/texmf-dist/doc/latex/exsheets/README index 00ebce19e10..42d20323809 100644 --- a/Master/texmf-dist/doc/latex/exsheets/README +++ b/Master/texmf-dist/doc/latex/exsheets/README @@ -1,9 +1,9 @@ -------------------------------------------------------------------------- -EXSHEETS 2015/02/09 +EXSHEETS 2015/05/06 bundled packages: -the EXSHEETS package v0.18 +the EXSHEETS package v0.18a Yet another package for the creation of exercise sheets -the EXSHEETS-LISTINGS package v0.18 +the EXSHEETS-LISTINGS package v0.18a 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 8dcb6b2f494..608d06a2fb1 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 2a9be5269cb..2cc970945b7 100644 --- a/Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex +++ b/Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex @@ -31,7 +31,9 @@ % feel free to contact me. % -------------------------------------------------------------------------- \documentclass[load-preamble+,scrartcl={DIV10}]{cnltx-doc} + \usepackage{exsheets} + \setcnltx{ package = {exsheets} , authors = Clemens Niederberger , diff --git a/Master/texmf-dist/tex/latex/exsheets/exsheets.sty b/Master/texmf-dist/tex/latex/exsheets/exsheets.sty index 758f981d217..b6de309bd11 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{2015/02/09} -\def\exsheets@version{0.18} +\def\exsheets@date{2015/05/06} +\def\exsheets@version{0.18a} \RequirePackage { expl3 , xparse } \ProvidesExplPackage @@ -35,20 +35,6 @@ {\exsheets@version} {Yet another package for the creation of exercise sheets and exams.} -% -------------------------------------------------------------------------- -% check expl3 version: -\@ifpackagelater {expl3} {2014/01/01} - { } - { - \PackageError {exsheets} {Support~package~expl3~too~old} - { - You~need~to~update~your~installation~of~the~bundles~'l3kernel'~and~ - 'l3packages'.\MessageBreak - Loading~exsheets~will~abort! - } - \tex_endinput:D - } - % ---------------------------------------------------------------------------- % variants of kernel functions: \cs_generate_variant:Nn \prop_get:NnN { Nx , cf } @@ -151,7 +137,7 @@ \cs_new_protected:Npn \exsheets_depr_cmd:nn #1#2 { - \cs_new:Npn #1 + \cs_new_protected:Npn #1 { \msg_warning:nnnn {exsheets} { deprecated-command } {#1} {#2} #2 } } @@ -341,57 +327,58 @@ \tl_new:N \l__exsheets_points_format_tl \tl_set:Nn \l__exsheets_points_format_tl { \use:n } -\cs_new_protected_nopar:Npn \exsheets_set_points_name:n #1 +\cs_new_protected:Npn \__exsheets_set_points_name:nNN #1#2#3 { \tl_if_in:nnTF {#1} { / } - { \__exsheets_set_points_name_aux:nn #1 \q_stop } - { \__exsheets_set_points_name_aux:nn #1 / \q_stop } + { \__exsheets_set_points_name_aux:wNN #1 \q_mark #2#3 } + { \__exsheets_set_points_name_aux:wNN #1 / \q_mark #2#3 } } -\cs_new_protected_nopar:Npn \__exsheets_set_points_name_aux:nn #1/#2 \q_stop +\cs_new_protected:Npn \__exsheets_set_points_name_aux:wNN #1/#2 \q_mark #3#4 { - \tl_set:Nn \l__exsheets_points_name_tl {#1} - \tl_set:Nn \l__exsheets_points_name_plural_tl { #1#2 } + \tl_set:Nn #3 {#1} + \tl_set:Nn #4 { #1#2 } } -\cs_new_protected_nopar:Npn \exsheets_set_bonus_name:n #1 +\cs_new_protected:Npn \exsheets_set_points_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 } + \__exsheets_set_points_name:nNN {#1} + \l__exsheets_points_name_tl + \l__exsheets_points_name_plural_tl } -\cs_new_protected_nopar:Npn \__exsheets_set_bonus_name_aux:nn #1/#2 \q_stop +\cs_new_protected:Npn \exsheets_set_bonus_name:n #1 { - \tl_set:Nn \l__exsheets_bonus_name_tl {#1} - \tl_set:Nn \l__exsheets_bonus_name_plural_tl { #1#2 } + \__exsheets_set_points_name:nNN {#1} + \l__exsheets_bonus_name_tl + \l__exsheets_bonus_name_plural_tl } % FIXME: \fp_add will deprecate! -\cs_new_protected_nopar:Npn \exsheets_add_points:n #1 +\cs_new_protected:Npn \exsheets_add_points:n #1 { \fp_gadd:Nn \g__exsheets_points_sum_fp {#1} \fp_gadd:Nn \g__exsheets_this_question_points_fp {#1} } \cs_generate_variant:Nn \exsheets_add_points:n { V } -\cs_new_protected_nopar:Npn \exsheets_add_bonus:n #1 +\cs_new_protected:Npn \exsheets_add_bonus:n #1 { \fp_gadd:Nn \g__exsheets_bonus_sum_fp {#1} \fp_gadd:Nn \g__exsheets_this_question_bonus_fp {#1} } \cs_generate_variant:Nn \exsheets_add_bonus:n { V } -\cs_new_protected_nopar:Npn \exsheets@sum@of@points #1 +\cs_new_protected:Npn \exsheets@sum@of@points #1 { \fp_gset:Nn \g_exsheets_total_points_fp {#1} } -\cs_new_protected_nopar:Npn \exsheets@sum@of@bonus #1 +\cs_new_protected:Npn \exsheets@sum@of@bonus #1 { \fp_gset:Nn \g_exsheets_total_bonus_fp {#1} } -\cs_new_nopar:Npn \exsheets_parse_points:n #1 +\cs_new:Npn \__exsheets_parse_points:nN #1#2 { \group_begin: - \tl_use:N \l__exsheets_points_number_format_tl + \tl_use:N #2 { \bool_if:NTF \l__exsheets_parse_points_bool { \exsheets_num:n { \fp_to_decimal:n {#1} } } @@ -399,31 +386,25 @@ } \group_end: } +\cs_new:Npn \exsheets_parse_points:n #1 + { + \__exsheets_parse_points:nN {#1} + \l__exsheets_points_number_format_tl + } \cs_generate_variant:Nn \exsheets_parse_points:n { V } -\cs_new_nopar:Npn \exsheets_parse_bonus:n #1 +\cs_new:Npn \exsheets_parse_bonus:n #1 { - \group_begin: - \tl_use:N \l__exsheets_bonus_number_format_tl - { - \bool_if:NTF \l__exsheets_parse_points_bool - { \exsheets_num:n { \fp_to_decimal:n {#1} } } - { \use:n {#1} } - } - \group_end: + \__exsheets_parse_points:nN {#1} + \l__exsheets_bonus_number_format_tl } \cs_generate_variant:Nn \exsheets_parse_bonus:n { V } -\cs_new_protected_nopar:Npn \exsheets_num:n #1 - { - \group_begin: - \fp_set:Nn \l__exsheets_tmpa_tl {#1} - \fp_to_tl:N \l__exsheets_tmpa_tl - \group_end: - } +\cs_new:Npn \exsheets_num:n #1 + { \fp_to_tl:n {#1} } \cs_generate_variant:Nn \exsheets_num:n { V,x } -\cs_new_nopar:Npn \exsheets_points_name:n #1 +\cs_new:Npn \__exsheets_print_points_name:nNN #1#2#3 { \bool_if:NT \l__exsheets_points_name_bool { @@ -433,39 +414,31 @@ \bool_if:NTF \l__exsheets_parse_points_bool { \tl_if_eq:nnTF {#1} { ?? } - { \tl_use:N \l__exsheets_points_name_plural_tl } + { \tl_use:N #3 } { - \fp_compare:nTF { #1 <= 1 } - { \tl_use:N \l__exsheets_points_name_tl } - { \tl_use:N \l__exsheets_points_name_plural_tl } + \fp_compare:nTF { #1 = 1 } + { \tl_use:N #2 } + { \tl_use:N #3 } } } - { \tl_use:N \l__exsheets_points_name_plural_tl } + { \tl_use:N #3 } } } } + +\cs_new:Npn \exsheets_points_name:n #1 + { + \__exsheets_print_points_name:nNN {#1} + \l__exsheets_points_name_tl + \l__exsheets_points_name_plural_tl + } \cs_generate_variant:Nn \exsheets_points_name:n { V } -\cs_new_nopar:Npn \exsheets_bonus_name:n #1 +\cs_new:Npn \exsheets_bonus_name:n #1 { - \bool_if:NT \l__exsheets_points_name_bool - { - \, - \hbox:n - { - \bool_if:NTF \l__exsheets_parse_points_bool - { - \tl_if_eq:nnTF {#1} { ?? } - { \tl_use:N \l__exsheets_bonus_name_plural_tl } - { - \fp_compare:nTF { #1 <= 1 } - { \tl_use:N \l__exsheets_bonus_name_tl } - { \tl_use:N \l__exsheets_bonus_name_plural_tl } - } - } - { \tl_use:N \l__exsheets_bonus_name_plural_tl } - } - } + \__exsheets_print_points_name:nNN {#1} + \l__exsheets_bonus_name_tl + \l__exsheets_bonus_name_plural_tl } \cs_generate_variant:Nn \exsheets_bonus_name:n { V } @@ -503,7 +476,7 @@ { \exsheets_print_bonus:n {#2} } } -\cs_new_protected_nopar:Npn \exsheets_print_points:n #1 +\cs_new_protected:Npn \exsheets_print_points:n #1 { \group_begin: \tl_use:N \l__exsheets_points_format_tl @@ -515,7 +488,7 @@ } \cs_generate_variant:Nn \exsheets_print_points:n { V } -\cs_new_protected_nopar:Npn \exsheets_print_bonus:n #1 +\cs_new_protected:Npn \exsheets_print_bonus:n #1 { \exsheets_parse_bonus:n {#1} \exsheets_bonus_name:n {#1} @@ -600,7 +573,7 @@ \exsheets_depr_cmd:nn { \sumpoints } { \totalpoints* } -\cs_new_nopar:Npn \exsheets_totalpoints: +\cs_new_protected:Npn \exsheets_totalpoints: { \bool_if:NTF \l__exsheets_parse_points_bool { @@ -614,7 +587,7 @@ { \msg_warning:nn {exsheets} {totalpoints} } } -\cs_new_nopar:Npn \exsheets_totalbonus: +\cs_new:Npn \exsheets_totalbonus: { \bool_if:NT \l__exsheets_parse_points_bool { @@ -834,7 +807,7 @@ \bool_new:N \l__exsheets_solutions_use_bool \bool_set_true:N \l__exsheets_solutions_use_bool -\cs_new_nopar:Npn \exsheets_glue:N #1 +\cs_new:Npn \exsheets_glue:N #1 { \cleaders \vbox:n {} \skip_vertical:N #1 } % Einteilung in Klassen, Themen und andere Gruppierungen: @@ -1205,7 +1178,7 @@ \bool_if:NT \l__exsheets_questions_use_bool { \bool_gset_true:N \g__exsheets_questions_use_bool } % Optionen: - \IfNoValueF {#1} { \keys_set:nn { exsheets / question } {#1} } + \tl_if_blank:nF {#1} { \keys_set:nn { exsheets / question } {#1} } % ID: \bool_if:nT { @@ -1250,7 +1223,7 @@ % Punktevergabe: \fp_gzero:N \g__exsheets_this_question_points_fp \fp_gzero:N \g__exsheets_this_question_bonus_fp - \IfNoValueTF {#2} + \tl_if_blank:nTF {#2} { \__exsheets_read_points:n { 0 } \bool_if:NT \l__exsheets_points_questions_default_bool @@ -1490,7 +1463,7 @@ % #4: points % #5: bonus % #6: id -\cs_new:Npn \exsheets_use_heading:nnnnnn #1#2#3#4#5#6 +\cs_new_protected:Npn \exsheets_use_heading:nnnnnn #1#2#3#4#5#6 { \IfInstanceExistTF {exsheets-heading} {#1} { \UseInstance {exsheets-heading} {#1} } @@ -1586,7 +1559,7 @@ % #1: ID % #2: property % #3: value -\cs_new:Npn \exsheets@question@property #1#2#3 +\cs_new_protected:Npn \exsheets@question@property #1#2#3 { \prop_gput:cnn { g__exsheets_question_property_#2_prop } {#1} {#3} @@ -1718,7 +1691,7 @@ \int_new:N \l__exsheets_include_random_int \int_zero:N \l__exsheets_include_random_int -\cs_new:Npn \exsheets_file_input_if_exist:n #1 +\cs_new_protected:Npn \exsheets_file_input_if_exist:n #1 { \file_if_exist:nT {#1} { \file_input:n {#1} } } \cs_new_protected:Npn \exsheets_prop_count:N #1 @@ -2137,7 +2110,7 @@ \bool_new:N \l__exsheets_solutions_runin_bool \bool_set_false:N \l__exsheets_solutions_runin_bool -\cs_new_protected_nopar:Npn \__exsheets_solutions_name:nnn #1#2#3 +\cs_new_protected:Npn \__exsheets_solutions_name:nnn #1#2#3 { \tl_if_blank:VT \l__exsheets_solution_heading_instance_tl { @@ -2291,7 +2264,7 @@ } % print by section: -\cs_new:Npn \exsheets_print_solutions_section:n #1 +\cs_new_protected:Npn \exsheets_print_solutions_section:n #1 { \tl_if_blank:nTF {#1} { @@ -2341,7 +2314,7 @@ } } -\cs_new:Npn \__exsheets_print_solutions_section:nnn #1#2#3 +\cs_new_protected:Npn \__exsheets_print_solutions_section:nnn #1#2#3 { \__exsheets_read_number:w #2 \q_stop \__exsheets_print_solution_if:nn {#1} @@ -2349,7 +2322,7 @@ } % print by chapter: -\cs_new:Npn \exsheets_print_solutions_chapter:n #1 +\cs_new_protected:Npn \exsheets_print_solutions_chapter:n #1 { \tl_if_blank:nTF {#1} { @@ -2399,7 +2372,7 @@ } } -\cs_new:Npn \__exsheets_print_solutions_chapter:nnn #1#2#3 +\cs_new_protected:Npn \__exsheets_print_solutions_chapter:nnn #1#2#3 { \__exsheets_read_number:w #2 \q_stop \__exsheets_print_solution_if:nn {#1} @@ -2407,7 +2380,7 @@ } % print all: -\cs_new:Npn \exsheets_print_solutions_all: +\cs_new_protected:Npn \exsheets_print_solutions_all: { \prop_map_function:NN \g__exsheets_question_number_prop \__exsheets_print_solutions_all:nn @@ -2541,7 +2514,7 @@ } } -\cs_new_protected_nopar:Npn \__exsheets_read_number:w #1-#2-#3 \q_stop +\cs_new_protected: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 @@ -2555,7 +2528,7 @@ \int_set:Nn \l__exsheets_counter_qu_int {#3} } -\cs_new_protected_nopar:Npn \exsheets_solutions_print_name:nnn #1#2#3 +\cs_new_protected:Npn \exsheets_solutions_print_name:nnn #1#2#3 { \tl_set_rescan:Nnn \l__exsheets_tmpa_tl { \char_set_catcode_letter:N \@ } {#1} @@ -2870,7 +2843,7 @@ \DeclareTranslation { English } { exsheets-exercise-name } { Exercise } \DeclareTranslation { British } { exsheets-exercise-name } { Exercise } \DeclareTranslation { American } { exsheets-exercise-name } { Exercise } -\DeclareTranslation { French } { exsheets-exercise-name } { Exercise } +\DeclareTranslation { French } { exsheets-exercise-name } { Exercice } \DeclareTranslation { German } { exsheets-exercise-name } { \"Ubung } \DeclareTranslation { Italian } { exsheets-exercise-name } { Esercizio } \DeclareTranslation { Spanish } { exsheets-exercise-name } { Ejercicio } @@ -3171,6 +3144,11 @@ HISTORY: - change test in \exsheets_h_or_vspace:N to something more reliable and meaningful - new option `no-skip-below' +2015/05/06 v0.18a - fix bug in points mechanism + - singular points name is now only used for exactly 1 + point + - a few cosmetic changes to the points function + definitions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % TODO: diff --git a/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def b/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def index b78f0b70daa..89e09c51574 100644 --- a/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def +++ b/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def @@ -406,7 +406,7 @@ \dim_compare:nF { \parskip = 0pt } { \skip_vertical:n { -\parskip } } \bool_if:NTF \l__exsheets_heading_indent_first_bool - { \@afterheading } + { \@afterindenttrue\@afterheading } { \@afterindentfalse\@afterheading } } } |