diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/exsheets/exsheets.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/exsheets/exsheets.sty | 67 |
1 files changed, 38 insertions, 29 deletions
diff --git a/Master/texmf-dist/tex/latex/exsheets/exsheets.sty b/Master/texmf-dist/tex/latex/exsheets/exsheets.sty index 32234196478..9d899f2d815 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/05/26} -\def\exsheets@version{0.9f} +\def\exsheets@date{2013/06/28} +\def\exsheets@version{0.9h} \RequirePackage { expl3 , xparse } \ProvidesExplPackage @@ -1015,7 +1015,7 @@ \bool_if:NT \l__exsheets_auto_label_bool { \exp_args:Nx \label { qu : \g__exsheets_questions_current_id_tl } - \exp_args:Nx \SetQuestionProperties + \exsheets_set_question_properties:x { ref = \exp_not:N \ref { qu : \g__exsheets_questions_current_id_tl } , pageref = \exp_not:N \pageref { qu : \g__exsheets_questions_current_id_tl } @@ -1024,7 +1024,7 @@ } { \exp_args:Nx \label { \l__exsheets_questions_label_tl } - \exp_args:Nx \SetQuestionProperties + \exsheets_set_question_properties:x { ref = \exp_not:N \ref { \l__exsheets_questions_label_tl } , pageref = \exp_not:N \pageref { \l__exsheets_questions_label_tl } @@ -1067,7 +1067,7 @@ \fp_set_eq:NN \l__exsheets_question_points_fp \l__exsheets_points_default_fp - \exp_args:Nx \SetQuestionProperties + \exsheets_set_question_properties:x { points = \fp_to_tl:N \l__exsheets_points_default_fp } } } @@ -1076,7 +1076,7 @@ \g__exsheets_this_question_points_fp \l__exsheets_question_points_fp \__exsheets_read_points:n { #2 } - \SetQuestionProperties{points=#2} + \exsheets_set_question_properties:n { points = #2 } } \tl_if_blank:VT \l__exsheets_question_heading_instance_tl { @@ -1164,7 +1164,7 @@ { \fp_compare:nT { \g__exsheets_this_question_points_fp > 0 } { - \exp_args:Nx \SetQuestionProperties + \exsheets_set_question_properties:x { points = \fp_to_tl:N \g__exsheets_this_question_points_fp } } } @@ -1179,7 +1179,9 @@ \cs_new_protected:Npn \__exsheets_save_number_in_aux_x:Nnn #1#2#3 { \prop_gput:Nfx #1 { #2 } { #3 } - \iow_now:Nx \@auxout { \exsheets@save@number { #2 } { #3 } } + \if@filesw + \iow_now:Nx \@auxout { \exsheets@save@number { #2 } { #3 } } + \fi } \cs_new_protected:Npn \__exsheets_save_number_in:N #1 @@ -1335,6 +1337,7 @@ } \@esphack } +\cs_generate_variant:Nn \exsheets_set_question_properties:n { x } \NewDocumentCommand \SetQuestionProperties { m } { \exsheets_set_question_properties:n { #1 } } @@ -1882,20 +1885,22 @@ \cs_new_protected:Npn \__exsheets_exlabel:n #1 { \@bsphack - \iow_now:Nx \@auxout - { - \token_to_str:N \newlabel { exse:#1 } - { { \arabic { section } } { \thepage } } - } - \cs_if_exist:NT \thechapter - { - \iow_now:Nx \@auxout - { - \token_to_str:N \newlabel { exch:#1 } - { { \arabic { chapter } } { \thepage } } - } - } - \@esphack + \if@filesw + \iow_now:Nx \@auxout + { + \token_to_str:N \newlabel { exse:#1 } + { { \arabic { section } } { \thepage } } + } + \cs_if_exist:NT \thechapter + { + \iow_now:Nx \@auxout + { + \token_to_str:N \newlabel { exch:#1 } + { { \arabic { chapter } } { \thepage } } + } + } + \@esphack + \fi } % user command: @@ -2547,13 +2552,15 @@ % save total points in .aux file to make it available for \allpoints anywhere \AtEndDocument { - \iow_now:Nx \@auxout - { - \exp_not:N \exsheets@sum@of@points - { \fp_eval:n { \g__exsheets_points_sum_fp } }^^J - \exp_not:N \exsheets@sum@of@bonus - { \fp_eval:n { \g__exsheets_bonus_sum_fp } } - } + \if@filesw + \iow_now:Nx \@auxout + { + \exp_not:N \exsheets@sum@of@points + { \fp_eval:n { \g__exsheets_points_sum_fp } }^^J + \exp_not:N \exsheets@sum@of@bonus + { \fp_eval:n { \g__exsheets_bonus_sum_fp } } + } + \fi } % ---------------------------------------------------------------------------- @@ -2690,6 +2697,8 @@ HISTORY: option is enabled and questions/solutions are at the top of a new page because there wasn't enough place left at the page before +2013/05/30 v0.9g - obey \if@filesw +2013/06/28 v0.9h - cleaner internal use of \exsheets_set_question_properties:n %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % TODO: |