summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-04-10 22:44:54 +0000
committerKarl Berry <karl@freefriends.org>2013-04-10 22:44:54 +0000
commite533034626aa12a7d01144a888de7aacca481033 (patch)
tree85b4b4e204f0bf95593580aca20f1549ac8efe11 /Master/texmf-dist/tex
parent29908990b09fca3ffa1d0689e2220c8a5de22a2c (diff)
exsheets (10apr13)
git-svn-id: svn://tug.org/texlive/trunk@29840 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/exsheets/exsheets.sty94
-rw-r--r--Master/texmf-dist/tex/latex/exsheets/exsheets_headings.cfg10
-rw-r--r--Master/texmf-dist/tex/latex/exsheets/tasks.cfg4
-rw-r--r--Master/texmf-dist/tex/latex/exsheets/tasks.sty166
-rw-r--r--Master/texmf-dist/tex/latex/exsheets/translations.sty10
5 files changed, 190 insertions, 94 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:
diff --git a/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.cfg b/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.cfg
index bb60744ab98..0db292f4be1 100644
--- a/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.cfg
+++ b/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.cfg
@@ -35,6 +35,16 @@
\ProvidesFile{exsheets_headings.cfg}
[\exsheets@date\space v\exsheets@version\space ExSheets headings instances]
+% EMPTY:
+\DeclareInstance { exsheets-heading } { empty } { default }
+ {
+ runin = true ,
+ above = \parskip ,
+ below = \parskip ,
+ attach =
+ { main[l,vc] points[l,vc] (\linewidth + \marginparsep,0pt) }
+ }
+
% SIMPLE:
\DeclareInstance { exsheets-heading } { simple } { default }
{
diff --git a/Master/texmf-dist/tex/latex/exsheets/tasks.cfg b/Master/texmf-dist/tex/latex/exsheets/tasks.cfg
index fb8923ef0d6..5ac789f91d0 100644
--- a/Master/texmf-dist/tex/latex/exsheets/tasks.cfg
+++ b/Master/texmf-dist/tex/latex/exsheets/tasks.cfg
@@ -38,12 +38,12 @@
\DeclareInstance { tasks } { itemize } { default }
{
enumerate = false ,
- label-width = 2.25ex
+ label-width = 1.125em
}
% ENUMERATE:
\DeclareInstance { tasks } { enumerate } { default }
- { label-format = tsk. }
+ { counter-format = tsk. }
% MULTIPLECHOICE
\DeclareInstance { tasks } { multiplechoice } { default }
diff --git a/Master/texmf-dist/tex/latex/exsheets/tasks.sty b/Master/texmf-dist/tex/latex/exsheets/tasks.sty
index 14981e67db8..b6f2d01eef5 100644
--- a/Master/texmf-dist/tex/latex/exsheets/tasks.sty
+++ b/Master/texmf-dist/tex/latex/exsheets/tasks.sty
@@ -28,8 +28,8 @@
% If you have any ideas, questions, suggestions or bugs to report, please
% feel free to contact me.
% --------------------------------------------------------------------------
-\def\@tasks@date{2013/04/04}
-\def\@tasks@version{0.8a}
+\def\@tasks@date{2013/04/07}
+\def\@tasks@version{0.9}
\RequirePackage { expl3 , xparse , l3keys2e }
\ProvidesExplPackage
@@ -46,7 +46,7 @@
\int_new:N \l__tasks_depth_int
\int_new:N \g__tasks_int
-\int_new:N \l__tasks_total_items_int
+\int_new:N \g__tasks_total_items_int
\int_new:N \l__tasks_columns_int
\int_new:N \l__tasks_rows_int
@@ -55,10 +55,15 @@
\bool_new:N \l__tasks_load_tasks_bool
\bool_new:N \l__tasks_label_width_bool
\bool_new:N \l__tasks_label_offset_bool
+\bool_new:N \l__tasks_custom_label_bool
+\bool_new:N \l__tasks_custom_after_item_skip_bool
\tl_new:N \l__tasks_instance_tl
\tl_new:N \l__tasks_label_tl
+\tl_new:N \l__tasks_custom_label_tl
\tl_new:N \l__tasks_label_pattern_tl
+\tl_new:N \l__tasks_custom_label_pattern_tl
+\tl_new:N \l__tasks_label_format_tl
\tl_new:N \l__tasks_custom_label_format_tl
\tl_new:N \l__tasks_item_fill_left_tl
\tl_new:N \l__tasks_item_fill_right_tl
@@ -75,6 +80,7 @@
\dim_new:N \l__tasks_label_default_offset_dim
\skip_new:N \l__tasks_after_item_skip
+\skip_new:N \l__tasks_custom_after_item_skip
\skip_new:N \l__tasks_before_list_skip
\skip_new:N \l__tasks_after_list_skip
@@ -83,13 +89,14 @@
% scratch variables:
\tl_new:N \l__tasks_tmpa_tl
-\int_new:N \l__tasks_tmpa_int
+\int_new:N \g__tasks_tmpa_int
+\int_new:N \l__tasks_tmpb_int
\coffin_new:N \l__tasks_tmpa_coffin
\coffin_new:N \l__tasks_tmpb_coffin
\coffin_new:N \l__tasks_tmpc_coffin
% collect the tasks:
-\cs_new:Npn \__tasks_collect_tasks:nw #1#2 \end #3
+\cs_new_protected:Npn \__tasks_collect_tasks:nw #1#2 \end #3
{
\tl_put_right:Nn \l__tasks_body_tl { #1 }
\end { #3 }
@@ -101,37 +108,40 @@
% #2: number of columns
% #3: item separator
% #4: environment body
-\cs_new:Npn \__tasks:nnnn #1#2#3#4
+\cs_new_protected:Npn \__tasks:nnnn #1#2#3#4
{
\seq_set_split:Nnn \l__tasks_seq { #3 } { #4 }
% remove the first (empty) item:
\seq_pop_left:NN \l__tasks_seq \l__tasks_tmpa_tl
\tl_if_blank:VF \l__tasks_tmpa_tl
{ \tl_show:N \l__tasks_tmpa_tl \@noitemerr }
- \int_set:Nn \l__tasks_total_items_int
+ \int_gset:Nn \g__tasks_total_items_int
{ \seq_count:N \l__tasks_seq }
\UseInstance { tasks } { #1 }
- { \l__tasks_total_items_int }
+ { \g__tasks_total_items_int }
{ #2 }
- { \l__tasks_custom_label_format_tl }
+ { \l__tasks_custom_label_pattern_tl }
% just to be sure:
\seq_clear:N \l__tasks_seq
}
\cs_generate_variant:Nn \__tasks:nnnn { VnnV }
-\cs_new:Npn \__tasks_task:nnw #1#2[#3,#4][#5,#6](#7,#8)
+\cs_new_protected:Npn \__tasks_task:nnw #1#2[#3,#4][#5,#6](#7,#8)
{
\dim_set:Nn \l__tasks_item_width_dim
{
\linewidth / \l__tasks_columns_int -
\l__tasks_depth_int \l__tasks_item_indent_dim
}
- \int_incr:N \l__tasks_tmpa_int
- \__tasks_set_rows_num:NN
- \l__tasks_total_items_int
+ \int_gincr:N \g__tasks_tmpa_int
+ \__tasks_gset_rows_num:NN
+ \g__tasks_total_items_int
\l__tasks_columns_int
- \int_compare:nT { \l__tasks_tmpa_int > \l__tasks_columns_int }
- { \int_set:Nn \l__tasks_tmpa_int { 1 } }
+ \int_compare:nT { \g__tasks_tmpa_int > \l__tasks_columns_int }
+ {
+ \int_gset:Nn \g__tasks_tmpa_int { 1 }
+ \int_incr:N \l__tasks_tmpb_int
+ }
% the item:
\hcoffin_set:Nn \l__tasks_tmpa_coffin
{
@@ -155,13 +165,18 @@
{ -\l__tasks_label_width_dim - \l__tasks_label_offset_dim } { 0pt }
% typeset label & item:
% need this when a new row starts:
- \int_compare:nT { \l__tasks_tmpa_int = 1 }
+ \int_compare:nT { \g__tasks_tmpa_int = 1 }
{ \skip_vertical:N \c_zero_skip }
\skip_horizontal:N \l__tasks_item_indent_dim
\coffin_typeset:Nnnnn \l__tasks_tmpa_coffin
{ l } { T } { 0pt } { 0pt }
% need this before a new row starts:
- \int_compare:nT { \l__tasks_tmpa_int = \l__tasks_columns_int }
+ \bool_if:nT
+ {
+ ( \int_compare_p:n { \g__tasks_tmpa_int = \l__tasks_columns_int } )
+ &&
+ ( \int_compare_p:n { \l__tasks_tmpb_int != \l__tasks_rows_int } )
+ }
{ \skip_vertical:N \l__tasks_after_item_skip }
\coffin_clear:N \l__tasks_tmpa_coffin
\coffin_clear:N \l__tasks_tmpb_coffin
@@ -169,7 +184,7 @@
}
\cs_generate_variant:Nn \__tasks_task:nnw { VV }
-\cs_new:Npn \__tasks_setup:
+\cs_new_protected:Npn \__tasks_setup:
{
\dim_set:Nn \parskip { 0pt }
\skip_set:Nn \parfillskip { 0pt plus 1fil }
@@ -178,14 +193,14 @@
\strut
}
-\cs_new:Npn \__tasks_set_rows_num:NN #1#2
+\cs_new_protected:Npn \__tasks_gset_rows_num:NN #1#2
{
- \int_set:Nn \l__tasks_rows_int { \int_div_truncate:nn { #1 } { #2 } }
+ \int_gset:Nn \l__tasks_rows_int { \int_div_truncate:nn { #1 } { #2 } }
\int_compare:nNnT { \int_mod:nn { #1 } { #2 } } > { 0 }
- { \int_incr:N \l__tasks_rows_int }
+ { \int_gincr:N \l__tasks_rows_int }
}
-\cs_new:Npn \__tasks_label_align:n #1
+\cs_new_protected:Npn \__tasks_label_align:n #1
{
\clist_if_in:nnTF { left , center , right } { #1 }
{
@@ -224,9 +239,10 @@
enumerate : boolean = true ,
label : tokenlist ,
indent : length = 2.5em ,
- label-format : tokenlist = tsk[a]) ,
- label-width : length = 3ex ,
- label-offset : length = 1ex ,
+ counter-format : tokenlist = tsk[a]) ,
+ label-format : tokenlist ,
+ label-width : length = 1em ,
+ label-offset : length = .3333em ,
after-item-skip : skip = 1ex plus 1ex minus 1ex
}
% the `default' template code:
@@ -235,7 +251,8 @@
enumerate = \l__tasks_enumerate_bool ,
label = \l__tasks_label_tl ,
indent = \l__tasks_item_indent_dim ,
- label-format = \l__tasks_label_pattern_tl ,
+ counter-format = \l__tasks_label_pattern_tl ,
+ label-format = \l__tasks_label_format_tl ,
label-width = \l__tasks_label_default_width_dim ,
label-offset = \l__tasks_label_default_offset_dim ,
after-item-skip = \l__tasks_after_item_skip
@@ -254,17 +271,37 @@
\l__tasks_label_offset_dim
\l__tasks_label_default_offset_dim
}
+ \bool_if:NT \l__tasks_custom_after_item_skip_bool
+ {
+ \skip_set_eq:NN
+ \l__tasks_after_item_skip
+ \l__tasks_custom_after_item_skip
+ }
+ \bool_if:NT \l__tasks_custom_label_bool
+ {
+ \tl_set_eq:NN
+ \l__tasks_label_tl
+ \l__tasks_custom_label_tl
+ \bool_set_false:N \l__tasks_enumerate_bool
+ }
\__tasks_label_align:V \l__tasks_label_align_tl
% need this for enumerate list:
\bool_if:nT { !\l__tasks_resume_bool && \l__tasks_enumerate_bool }
{ \int_gzero:N \g__tasks_int }
\int_set:Nn \l__tasks_columns_int { #2 }
% set all the items in their own coffins and join with the ground:
- \int_zero:N \l__tasks_tmpa_int
- \tl_if_blank:VF \l__tasks_custom_label_format_tl
+ \int_gzero:N \g__tasks_tmpa_int
+ \int_set:Nn \l__tasks_tmpb_int { 1 }
+ \tl_if_blank:VF \l__tasks_custom_label_pattern_tl
{
\tl_set_eq:NN
\l__tasks_label_pattern_tl
+ \l__tasks_custom_label_pattern_tl
+ }
+ \tl_if_blank:VF \l__tasks_custom_label_format_tl
+ {
+ \tl_set_eq:NN
+ \l__tasks_label_format_tl
\l__tasks_custom_label_format_tl
}
\seq_map_inline:Nn \l__tasks_seq
@@ -272,21 +309,22 @@
\__tasks_read_item:w ##1 \q_stop
\bool_if:NTF \l__tasks_enumerate_bool
{
- \int_gincr:N \g__tasks_int
- \tl_if_blank:VT \l__tasks_label_tl
+ \tl_if_eq:VnT \l__tasks_tmp_label_tl { @tasks@default@label@ }
{
- \tl_set:Nn \l__tasks_label_tl
- {
- \ReadCounterPatternFrom [ tasks ]
- \l__tasks_label_pattern_tl
- }
+ \int_gincr:N \g__tasks_int
+ \SaveCounterPatternFrom [ tasks ]
+ \l__tasks_tmpa_tl
+ \l__tasks_label_tl
+ \l__tasks_label_pattern_tl
+ \cs_gset:Npx \@currentlabel { \l__tasks_label_tl }
}
}
{
\tl_if_blank:VT \l__tasks_label_tl
{ \tl_set_eq:NN \l__tasks_label_tl \labelitemi }
}
- \tl_if_blank:VTF \l__tasks_tmp_label_tl
+ \tl_put_left:NV \l__tasks_label_tl \l__tasks_label_format_tl
+ \tl_if_eq:VnTF \l__tasks_tmp_label_tl { @tasks@default@label@ }
{
\__tasks_task:VVw
\l__tasks_label_tl
@@ -302,18 +340,21 @@
}
}
}
+\cs_generate_variant:Nn \tl_if_eq:nnTF { V }
+\cs_generate_variant:Nn \tl_if_eq:nnT { V }
\cs_new:Npn \__tasks_read_item:w
{
\peek_meaning:NTF [
{ \__tasks_read_item_aux:w }
- { \__tasks_read_item_aux:w[] }
+ { \__tasks_read_item_aux:w[@tasks@default@label@] }
}
-\cs_new:Npn \__tasks_read_item_aux:w [#1]#2 \q_stop
+\cs_new_protected:Npn \__tasks_read_item_aux:w [#1]#2 \q_stop
{
- \tl_if_blank:nF { #1 }
- { \tl_set:Nn \l__tasks_tmp_label_tl { #1 } }
+ \tl_set:Nn \l__tasks_tmp_label_tl { #1 }
+ \tl_if_eq:nnF { #1 } { @tasks@default@label@ }
+ { \tl_put_left:NV \l__tasks_tmp_label_tl \l__tasks_label_format_tl }
\tl_set:Nn \l__tasks_item_tl { \ignorespaces #2 }
}
@@ -328,7 +369,7 @@
\dim_new:N \l__tasks_choice_raise_dim
\dim_set:Nn \l__tasks_choice_raise_dim { .1ex }
-\cs_new:Npn \tasks_choice:
+\cs_new_protected:Npn \tasks_choice:
{
\leavevmode
\bool_set_false:N \l__tasks_choice_checked_bool
@@ -337,7 +378,7 @@
{ \hbox:n { \__tasks_choice: } }
}
-\cs_new:Npn \tasks_choice_checked:
+\cs_new_protected:Npn \tasks_choice_checked:
{
\leavevmode
\bool_set_true:N \l__tasks_choice_checked_bool
@@ -346,7 +387,7 @@
{ \hbox:n { \__tasks_choice: } }
}
-\cs_new:Npn \__tasks_choice:
+\cs_new_protected:Npn \__tasks_choice:
{%
\dim_set:Nn \unitlength { .1\l__tasks_choice_width_dim }
\begin{picture}(10,0)
@@ -370,18 +411,25 @@
\keys_define:nn { tasks / list }
{
- style .tl_set:N = \l__tasks_instance_tl ,
- label .tl_set:N = \l__tasks_custom_label_format_tl ,
- label-width .code:n =
+ style .tl_set:N = \l__tasks_instance_tl ,
+ counter-format .tl_set:N = \l__tasks_custom_label_pattern_tl ,
+ label .code:n =
+ \bool_set_true:N \l__tasks_custom_label_bool
+ \tl_set:Nn \l__tasks_custom_label_tl { #1 } ,
+ label-format .tl_set:N = \l__tasks_custom_label_format_tl ,
+ label-width .code:n =
\dim_set:Nn \l__tasks_label_width_dim { #1 }
\bool_set_true:N \l__tasks_label_width_bool ,
- label-offset .code:n =
+ label-offset .code:n =
\dim_set:Nn \l__tasks_label_offset_dim { #1 }
\bool_set_true:N \l__tasks_label_offset_bool ,
- label-align .tl_set:N = \l__tasks_label_align_tl ,
- before-skip .skip_set:N = \l__tasks_before_list_skip ,
- after-skip .skip_set:N = \l__tasks_after_list_skip ,
- resume .bool_set:N = \l__tasks_resume_bool
+ label-align .tl_set:N = \l__tasks_label_align_tl ,
+ before-skip .skip_set:N = \l__tasks_before_list_skip ,
+ after-skip .skip_set:N = \l__tasks_after_list_skip ,
+ after-item-skip .code:n =
+ \bool_set_true:N \l__tasks_custom_after_item_skip_bool
+ \skip_set:Nn \l__tasks_custom_after_item_skip { #1 } ,
+ resume .bool_set:N = \l__tasks_resume_bool
}
% the generic environment:
@@ -404,6 +452,20 @@
\skip_vertical:N \l__tasks_after_list_skip
}
+% command to start a new row:
+\cs_new_protected:Npn \tasks_new_row:
+ {
+ \int_gset:Nn \g__tasks_total_items_int
+ { \g__tasks_total_items_int + \l__tasks_columns_int - \g__tasks_tmpa_int }
+ \__tasks_gset_rows_num:NN
+ \g__tasks_total_items_int
+ \l__tasks_columns_int
+ \int_gset_eq:NN \g__tasks_tmpa_int \l__tasks_columns_int
+ }
+
+\NewDocumentCommand \startnewitemline {}
+ { \tasks_new_row: }
+
% the user environment:
\NewDocumentCommand \NewTasks { O{}mO{\task}D(){1} }
{
@@ -436,7 +498,7 @@
{ \input { tasks.cfg } }
}
-\cs_new:Npn \tasks_setup:n #1
+\cs_new_protected:Npn \tasks_setup:n #1
{ \keys_set:nn { tasks / list } { #1 } }
\NewDocumentCommand \settasks { m }
diff --git a/Master/texmf-dist/tex/latex/exsheets/translations.sty b/Master/texmf-dist/tex/latex/exsheets/translations.sty
index 03cf81c8169..fbd5976d838 100644
--- a/Master/texmf-dist/tex/latex/exsheets/translations.sty
+++ b/Master/texmf-dist/tex/latex/exsheets/translations.sty
@@ -29,8 +29,8 @@
% If you have any ideas, questions, suggestions or bugs to report, please
% feel free to contact me.
% --------------------------------------------------------------------------
-\def\@trnslt@date{2013/04/04}
-\def\@trnslt@version{v0.8a}
+\def\@trnslt@date{2013/04/08}
+\def\@trnslt@version{v0.9a}
\ProvidesPackage{translations}[\@trnslt@date\space \@trnslt@version\space a simple translator]
\RequirePackage{etoolbox}
@@ -112,7 +112,6 @@
{}%
\csletcs{@trnslt@language@#1}{@trnslt@language@#2}}
-% TODO: nur eine Notlösung bis es eine echte gibt:
% #1: dialect
% #2: language
\newrobustcmd*\DeclareLanguageDialect[2]{%
@@ -213,10 +212,11 @@
{\csuse{@trnslt@word@#1@\@trnslt@language{#2}}}%
}
{%
- \@trnslt@warning{Translation for `#1' in #2 unknown.}%
+ \@trnslt@warning{Translation for `#1' in #2 unknown. You may try to use
+ \string\DeclareTranslation{#2}{#1}{ ... } in your preamble.}%
\@trnslt@if@translation{#1}{fallback}
{%
- \@trnslt@warningnoline{Using fallback translation for `#1'}%
+ \@trnslt@info{Using fallback translation for `#1'}%
\csuse{@trnslt@word@#1@fallback}
}%
{\csuse{@trnslt@word@#1@literal}}%