diff options
author | Karl Berry <karl@freefriends.org> | 2013-12-08 22:01:25 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-12-08 22:01:25 +0000 |
commit | 8a0e29b0e58b2bc46dd9227f4d3e6c009414306c (patch) | |
tree | 40ffbbd012bc89a8ddfa2080910cdcf0bd84db2a /Master/texmf-dist/tex/latex/exsheets | |
parent | d43ee48953990b7021d39c2b086fa43d079fdd3b (diff) |
exsheets (8dec13)
git-svn-id: svn://tug.org/texlive/trunk@32363 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/exsheets')
-rw-r--r-- | Master/texmf-dist/tex/latex/exsheets/exsheets.sty | 62 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def | 70 |
2 files changed, 76 insertions, 56 deletions
diff --git a/Master/texmf-dist/tex/latex/exsheets/exsheets.sty b/Master/texmf-dist/tex/latex/exsheets/exsheets.sty index 7a67093fe33..033507e03a0 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{2013/12/02} -\def\exsheets@version{0.12} +\def\exsheets@date{2013/12/08} +\def\exsheets@version{0.12a} \RequirePackage { expl3 , xparse } \ProvidesExplPackage @@ -226,8 +226,8 @@ \tl_new:N \l__exsheets_solution_heading_instance_tl \tl_new:N \l_exsheets_heading_title_user_format_tl \tl_set:Nn \l_exsheets_heading_title_user_format_tl { \normalsize\bfseries } -\tl_new:N \l_exsheets_subtitle_format_tl -\tl_set:Nn \l_exsheets_subtitle_format_tl { \normalsize\bfseries\itshape } +\tl_new:N \l_exsheets_heading_subtitle_user_format_tl +\tl_set:Nn \l_exsheets_heading_subtitle_user_format_tl { \normalsize\itshape } \tl_new:N \l__exsheets_questions_toclevel_tl \tl_set:Nn \l__exsheets_questions_toclevel_tl { subsection } \tl_new:N \l__exsheets_solutions_toclevel_tl @@ -252,7 +252,8 @@ load-headings .bool_set:N = \l__exsheets_load_headings_bool , headings-format .tl_set:N = \l_exsheets_heading_title_user_format_tl , - subtitle-format .tl_set:N = \l_exsheets_subtitle_format_tl , + subtitle-format .tl_set:N = + \l_heading_exsheets_subtitle_user_format_tl , load-tasks .bool_set:N = \l__exsheets_load_tasks_bool , use-ref .bool_set:N = \l__exsheets_solutions_by_ref_bool , totoc .choice: , @@ -309,7 +310,7 @@ \tl_new:N \l__exsheets_points_number_format_tl \tl_new:N \l__exsheets_bonus_number_format_tl \tl_new:N \l__exsheets_points_pre_bonus_marker_tl -\tl_set:Nn \l__exsheets_points_pre_bonus_marker_tl { (+ } +\tl_set:Nn \l__exsheets_points_pre_bonus_marker_tl { \space(+ } \tl_new:N \l__exsheets_points_post_bonus_marker_tl \tl_set:Nn \l__exsheets_points_post_bonus_marker_tl { ) } \tl_new:N \l__exsheets_points_format_tl @@ -542,29 +543,34 @@ \NewDocumentCommand \totalpoints { s } { - \exsheets_totalpoints: - \IfBooleanF { #1 } + \group_begin: + \tl_use:N \l__exsheets_points_format_tl { - \bool_if:nT + \exsheets_totalpoints: + \IfBooleanF { #1 } { - \l__exsheets_points_separate_bonus_bool || - \fp_compare_p:n { \g_exsheets_total_bonus_fp = 0 } + \bool_if:nT + { + \l__exsheets_points_separate_bonus_bool || + \fp_compare_p:n { \g_exsheets_total_bonus_fp = 0 } + } + { \exsheets_points_name:n { \g_exsheets_total_points_fp } } } - { \exsheets_points_name:n { \g_exsheets_total_points_fp } } - } - \exsheets_totalbonus: - \IfBooleanF { #1 } - { - \fp_compare:nF { \g_exsheets_total_bonus_fp = 0 } + \exsheets_totalbonus: + \IfBooleanF { #1 } { - \bool_if:NTF \l__exsheets_points_separate_bonus_bool - { \exsheets_bonus_name:n { \g_exsheets_total_bonus_fp } } + \fp_compare:nF { \g_exsheets_total_bonus_fp = 0 } { - \exsheets_points_name:n - { \g_exsheets_total_points_fp + \g_exsheets_total_bonus_fp } + \bool_if:NTF \l__exsheets_points_separate_bonus_bool + { \exsheets_bonus_name:n { \g_exsheets_total_bonus_fp } } + { + \exsheets_points_name:n + { \g_exsheets_total_points_fp + \g_exsheets_total_bonus_fp } + } } } } + \group_end: } \exsheets_depr_cmd:nn { \sumpoints } { \totalpoints* } @@ -589,7 +595,6 @@ { \fp_compare:nF { \g_exsheets_total_bonus_fp = 0 } { - \tl_use:N \c_space_tl \tl_use:N \l__exsheets_points_pre_bonus_marker_tl \exsheets_parse_bonus:n { \g_exsheets_total_bonus_fp } @@ -611,7 +616,7 @@ pre-bonus .tl_set:N = \l__exsheets_points_pre_bonus_marker_tl , post-bonus .tl_set:N = \l__exsheets_points_post_bonus_marker_tl , use-name .bool_set:N = \l__exsheets_points_name_bool , - format .tl_set:N = \l__exsheets_points_format_tl , + format .tl_set:N = \l__exsheets_points_format_tl , number-format .tl_set:N = \l__exsheets_points_number_format_tl , bonus-format .tl_set:N = \l__exsheets_bonus_number_format_tl , parse .bool_set:N = \l__exsheets_parse_points_bool , @@ -1143,8 +1148,8 @@ { \exsheets_set_question_properties:x { subtitle = { \exp_not:V \l__exsheets_questions_subtitle_tl } } - % FIXME: rather useless since it isn't used at all, see also - % exsheets_headings.def + % this is used in the headings instance; could maybe be replaced + % by retrieving the property... % \prop_gput:NVV \g__exsheets_questions_subtitle_prop % \g__exsheets_questions_current_id_tl % \l__exsheets_questions_subtitle_tl @@ -2898,6 +2903,7 @@ HISTORY: - changed horizontal spaces declared as `1ex' into `.3333em' in the declarations of the headings instances + - added subtitles 2013/11/07 v0.10a - fix bug in loading headings of questions; when included from an external file sometimes the wrong ID has been passed to the headings @@ -2912,7 +2918,7 @@ HISTORY: retrieved before the corresponding question is printed - make \GetQuestionProperty expandable - - new syntax featture in points argument: a leading + - new syntax feature in points argument: a leading bang prevents the points from being added to the sum of points - added possibility for @@ -2920,6 +2926,10 @@ HISTORY: - added \IfQuestionSubtitle(TF) - added `subtitle' property - dropped `color' option +2013/12/08 v0.12a - changed details in the printing mechanism of the + points which seems to be more consistent + - fix bug introduced in the last update: subtitles work + again %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % TODO: diff --git a/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def b/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def index 4d29d095776..7c79be05be9 100644 --- a/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def +++ b/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def @@ -62,6 +62,7 @@ \tl_set:Nn \l__exsheets_heading_number_pre_code_tl { \use:n } \tl_new:N \l__exsheets_heading_number_post_code_tl +\tl_new:N \l__exsheets_heading_subtitle_format_tl \tl_new:N \l__exsheets_heading_subtitle_pre_code_tl \tl_set:Nn \l__exsheets_heading_subtitle_pre_code_tl { \use:n } \tl_new:N \l__exsheets_heading_subtitle_post_code_tl @@ -166,6 +167,7 @@ number-format : tokenlist = , number-pre-code : tokenlist = , number-post-code : tokenlist = , + subtitle-format : tokenlist = , subtitle-pre-code : tokenlist = , subtitle-post-code : tokenlist = , points-format : tokenlist = , @@ -194,6 +196,7 @@ number-format = \l__exsheets_heading_number_format_tl , number-pre-code = \l__exsheets_heading_number_pre_code_tl , number-post-code = \l__exsheets_heading_number_post_code_tl , + subtitle-format = \l__exsheets_heading_title_format_tl , subtitle-pre-code = \l__exsheets_heading_subtitle_pre_code_tl , subtitle-post-code = \l__exsheets_heading_subtitle_post_code_tl , points-format = \l__exsheets_heading_points_format_tl , @@ -261,14 +264,18 @@ } \hcoffin_set:Nn \l__exsheets_heading_subtitle_coffin { - \prop_get:NnNT \g__exsheets_questions_subtitle_prop - { #5 } - \l__exsheets_questions_subtitle_tl + \exsheets_if_question_subtitle:T { + \tl_if_blank:VTF \l__exsheets_heading_subtitle_format_tl + { \tl_use:N \l__exsheets_heading_title_format_tl } + { \tl_use:N \l__exsheets_heading_subtitle_format_tl } + \strut \tl_use:N \l__exsheets_heading_subtitle_pre_code_tl { - \tl_use:N \l_exsheets_subtitle_format_tl - \tl_use:N \l__exsheets_questions_subtitle_tl + \group_begin: + \tl_use:N \l_exsheets_heading_subtitle_user_format_tl + \exsheets_get_question_property:nn { subtitle } { #5 } + \group_end: } \tl_use:N \l__exsheets_heading_subtitle_post_code_tl } @@ -286,35 +293,38 @@ \group_end: \tl_use:N \l__exsheets_heading_points_pre_code_tl { - \fp_compare:nF { #3 = 0 } + \tl_use:N \tl_use:N \l__exsheets_points_format_tl { - \bool_if:nTF + \fp_compare:nF { #3 = 0 } { - \l__exsheets_points_separate_bonus_bool || - \fp_compare_p:n { #4 = 0 } - } - { \exsheets_print_points:n { #3 } } - { \exsheets_parse_points:n { #3 } } - } - \bool_if:nT - { !\fp_compare_p:n { #3 = 0 } && !\fp_compare_p:n { #4 = 0 } } - { ~ } - \fp_compare:nF { #4 = 0 } - { - \tl_use:N \l__exsheets_points_pre_bonus_marker_tl - \bool_if:nTF - { - \l__exsheets_points_separate_bonus_bool || - \fp_compare_p:n { #3 = 0 } - } - { - \exsheets_print_bonus:n { #4 } - \tl_use:N \l__exsheets_points_post_bonus_marker_tl + \bool_if:nTF + { + \l__exsheets_points_separate_bonus_bool || + \fp_compare_p:n { #4 = 0 } + } + { + \exsheets_parse_points:n { #3 } + \exsheets_points_name:n { #3 } + } + { \exsheets_parse_points:n { #3 } } } + \fp_compare:nF { #4 = 0 } { - \exsheets_parse_bonus:n { #4 } - \tl_use:N \l__exsheets_points_post_bonus_marker_tl - \exsheets_points_name:n { #3 + #4 } + \tl_use:N \l__exsheets_points_pre_bonus_marker_tl + \bool_if:nTF + { + \l__exsheets_points_separate_bonus_bool || + \fp_compare_p:n { #3 = 0 } + } + { + \exsheets_print_bonus:n { #4 } + \tl_use:N \l__exsheets_points_post_bonus_marker_tl + } + { + \exsheets_parse_bonus:n { #4 } + \tl_use:N \l__exsheets_points_post_bonus_marker_tl + \exsheets_points_name:n { #3 + #4 } + } } } } |