diff options
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/exsheets/README | 6 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/exsheets/exsheets_en.pdf | bin | 686568 -> 691187 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex | 123 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/exsheets/exsheets.sty | 94 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/exsheets/exsheets_headings.cfg | 10 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/exsheets/tasks.cfg | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/exsheets/tasks.sty | 166 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/exsheets/translations.sty | 10 |
8 files changed, 287 insertions, 126 deletions
diff --git a/Master/texmf-dist/doc/latex/exsheets/README b/Master/texmf-dist/doc/latex/exsheets/README index 8bf29bafce0..02c40c8c448 100644 --- a/Master/texmf-dist/doc/latex/exsheets/README +++ b/Master/texmf-dist/doc/latex/exsheets/README @@ -1,14 +1,14 @@ -------------------------------------------------------------------------- -EXSHEETS v0.8a - 2013/04/04 +EXSHEETS v0.9a - 2013/04/08 bundled packages: the EXSHEETS package Yet another package for the creation of exercise sheets -the TRANSLATIONS package v0.8a +the TRANSLATIONS package v0.9a a simple translator the CNTFORMATS package v0.4 A different way to read counters. -the TASKS package v0.8a +the TASKS package v0.9 Horizontal columned lists. All mentioned packages are described in exsheets_en.pdf 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 fe8fc148d19..f459bbf0559 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 dc93fd78468..6d2ff8a691d 100644 --- a/Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex +++ b/Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex @@ -105,9 +105,9 @@ lastvariant, midrule, NewQuSolPair, numberofquestions, points, PrintIfIncludeActiveF, PrintIfIncludeActiveT, PrintIfIncludeActiveTF, printsolutions, PrintSolutionsF, PrintSolutionsTF, PrintSolutionsT, - questionsincludedlast, QuestionNumber, RenewQuSolPair, rightarrow, + questionsincludedlast, QuestionNumber, RenewQuSolPair, rightarrow, rlap, s, sample, setlength, SetQuestionProperties, SetupExSheets, SetVariations, - spacing, square, sumpoints, + spacing, square, startnewitemline, sumpoints, tabcolsep, textcite, textcolor, toprule, totalpoints, variant, vary } @@ -1398,14 +1398,16 @@ following macro: \secidx*{Include from External Files} \section{Own Question/Solution Pairs} -\noindent\sinceversion{0.3}\ExSheets provides he possibility to create new +\noindent\changedversion{0.9}\ExSheets provides he possibility to create new environments that behave like the \code{question} and \code{solution} environments. This would allow, for example, to define a \code{question*}/\code{solution*} environment pair for bonus questions. The following commands may be used in the document preamble: \begin{beschreibung} - \Befehl{NewQuSolPair}{<question>}\oa{<question options>}\ma{<solution>}\oa{<solution options>} - \Befehl{RenewQuSolPair}{<question>}\oa{<question options>}\ma{<solution>}\oa{<solution options>} + \Befehl{NewQuSolPair}{<question>}\oa{<question options>}\oa{<general options>}% + \ma{<solution>}\oa{<solution options>}\oa{<general options>} + \Befehl{RenewQuSolPair}{<question>}\oa{<question options>}\oa{<general options>}% + \ma{<solution>}\oa{<solution options>}\oa{<general options>} \end{beschreibung} The standard environments are defined as follows: \begin{beispiel}[code only] @@ -1447,7 +1449,8 @@ be some more lines: \blank[width=5\linewidth]{} The options are these: \begin{beschreibung} \Option[blank]{style}{line|wave|dline|dotted|dashed}\Default{line} - The style of the line. + The style of the line. This uses the corresponding command from the \paket{ulem} + package and is the whole reason why \ExSheets loads it in the first place. \Option[blank]{scale}{<num>}\Default{1} Scales the width of the blank by factor \code{<num>} unless the width is explicitly set. @@ -1664,6 +1667,23 @@ The following examples use a sample text defined as follows: A `simple' heading. \sample \end{question} +\subsubsection{The `empty' Instance} +\sinceversion{0.9a} +\begin{beispiel}[code only] + \DeclareInstance{exsheets-heading}{empty}{default} + { + runin = true , + above = \parskip , + below = \parskip , + attach = + { main[l,vc] points[l,vc] (\linewidth + \marginparsep,0pt) } + } +\end{beispiel} +\SetupExSheets{headings=empty} +\begin{question}{1} + An `empty' heading. \sample +\end{question} + \subsubsection{The `block-rev' Instance} \begin{beispiel}[code only] \DeclareInstance{exsheets-heading}{block-rev}{default} @@ -1737,7 +1757,6 @@ The following examples use a sample text defined as follows: A `block-nr' heading. \sample \end{question} -\newpage% FIXME \subsubsection{The `block-nr-wp' Instance} \begin{beispiel}[code only] \DeclareInstance{exsheets-heading}{block-nr-wp}{default} @@ -1868,7 +1887,6 @@ The following examples use a sample text defined as follows: A `runin-nr-wp' heading. \sample \end{question} -\newpage% FIXME \subsubsection{The `inline' Instance} \sinceversion{0.5} \begin{beispiel}[code only] @@ -1916,7 +1934,6 @@ Text before \end{question} Text after -\newpage% FIXME \subsubsection{The `inline-nr' Instance} \sinceversion{0.5} \begin{beispiel}[code only] @@ -2107,6 +2124,7 @@ primarily is for. If you don't need this feature you're better off using traditi part~\ref{part:cntformats}}, \paket{xtemplate} and \paket{environ}. \section{How it works} +\subsection{The Basics} The \code{tasks} environment is similar to a list like \code{enumerate} but not the same: \begin{itemize} @@ -2162,7 +2180,41 @@ number of columns used by the environment is specified. \task \sample \task \s\par\s \end{tasks} - + +\subsection{Introducing a New Row} +\noindent\sinceversion{0.9}Sometimes it may come in handy if the current +row of items could be terminated and a new one is started. This is possible +with the following command: +\begin{beschreibung} + \Befehl{startnewitemline} +\end{beschreibung} +\begin{beispiel}[code only] + \begin{tasks}(4) + \task the first + \task the second + \task the third + \task the fourth + \task \rlap{the fifth item is way too long for this so we start a new row} \startnewitemline + \task the sixth + \task the seventh + \task \rlap{the eighth item also is too long} \startnewitemline + \task the nineth + \task the tenth + \end{tasks} +\end{beispiel} +\begin{tasks}(4) + \task the first + \task the second + \task the third + \task the fourth + \task \rlap{the fifth item is way too long for this so we start a new row} \startnewitemline + \task the sixth + \task the seventh + \task \rlap{the eighth item also is too long} \startnewitemline + \task the nineth + \task the tenth +\end{tasks} + \section{Available Options}\secidx[Options]{\Tasks}[tasks]\label{sec:tasks:options} The \Tasks package has one package option which also is called when you load \ExSheets with the \key{load-tasks} option. @@ -2176,15 +2228,20 @@ The environment itself has some more options, namely these: \begin{beschreibung} \Option{style}{<instance>}\Default{} Choose the instance to be used. Read more on this in section~\ref{sec:tasks}. - \Option{label}{<label specs>}\Default{} - Sets a custom label. The letters \code{tsk} are replaced with the task-counter. - An optional argument directly following these letters specifies the counter format: - \code{1}: \cmd{arabic}, \code{a}: \cmd{alph}, \code{A}: \cmd{Alph}, \code{r}: - \cmd{roman} and \code{R}: \cmd{Roman}. - \Option{label-width}{<dim>}\Default{3ex} + \Option{counter-format}{<counter specs>}\Default{} + \sinceversion{0.9}Sets a custom label. The letters \code{tsk} are replaced + with the task-counter. An optional argument directly following these letters + specifies the counter format: \code{1}: \cmd{arabic}, \code{a}: \cmd{alph}, + \code{A}: \cmd{Alph}, \code{r}: \cmd{roman} and \code{R}: \cmd{Roman}. + \Option{label-format}{<code>}\Default{} + \changedversion{0.9}Can be used to apply a formatting like, \emph{e.g.}, + \cmd*{bfseries} to the labels. + \Option{label}{<code>}\Default{} + \changedversion{0.9}Overwrite the automatic label to a custom one. + \Option{label-width}{<dim>}\Default{1em} Sets the width of the item labels. - \Option{label-offset}{<dim>}\Default{1ex} - \sinceversion{0.7}Sets the offset, i.e., the distance between label and item. + \Option{label-offset}{<dim>}\Default{.3333em} + \sinceversion{0.7}Sets the offset, \emph{i.e.}, the distance between label and item. \Option{label-align}{left|right|center}\Default{left} \sinceversion{0.7}Determines how the labels are aligned within the label-box whose width is set with \key{label-width} @@ -2192,6 +2249,8 @@ The environment itself has some more options, namely these: Sets the skip before the list. \Option{after-skip}{<skip>}\Default{0pt} Sets the skip after the list. + \Option{after-item-skip}{<skip>}\Default{1ex plus 1ex minus 1ex} + \sinceversion{0.9}This vertical skip is inserted between rows of items. \Option{resume}{\default{true}|false}\Default{false} The enumeration will resume from a previous \code{tasks} environment. In order to use this option properly you shouldn't mix different \code{tasks} environments @@ -2204,7 +2263,7 @@ These options can also be set using a setup command: Now the same list as above but with three columns and a different label: \begin{beispiel}[code only] - \begin{tasks}[label=(tsk[r]),label-width=4ex](3) + \begin{tasks}[counter-format=(tsk[r]),label-width=4ex](3) \task \sample \task \s\ \s \task \s @@ -2212,7 +2271,7 @@ Now the same list as above but with three columns and a different label: \task \s\par\s \end{tasks} \end{beispiel} -\begin{tasks}[label=(tsk[r]),label-width=4ex](3) +\begin{tasks}[counter-format=(tsk[r]),label-width=4ex](3) \task \sample \task \s\ \s \task \s @@ -2225,7 +2284,7 @@ Let's use it inside a question: % since settings are local the following ones will be lost % outside this example; see the appendix how the solution % appears there - \settasks{label=qu.tsk,label-width=5ex} + \settasks{counter-format=qu.tsk,label-width=5ex} \begin{question}[type=exam]{4} I have these two tasks for you. Shall we begin? \begin{tasks}(2) @@ -2286,6 +2345,8 @@ It is possible to add custom environments that work like the \code{tasks} enviro new item. Default for \code{<separator>} is \cmd{task}, default for \code{<cols>} is \code{1}. The \code{<options>} are the ones described in section~\ref{sec:tasks:options}. + \Befehl{RenewTasks}[<options>]{<name>}\oa{<separator}\da{<cols>}\newline + Renew environment previously defined with \cmd{NewTasks}. \end{beschreibung} The \code{tasks} environment is defined as follows: \begin{beispiel}[code only] @@ -2296,7 +2357,7 @@ The separator does not have to be a control sequence: \begin{beispiel} % preamble: % \usepackage{dingbat} - \NewTasks[label=\footnotesize\leftthumbsup]{done}[*] + \NewTasks[label=\footnotesize\leftthumbsup,label-width=1.3em]{done}[*] \begin{done} * First task * Second Task @@ -2358,9 +2419,10 @@ of their usage. 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 } \end{beispiel} @@ -2373,15 +2435,18 @@ This is rather brief this time: % available when `load-tasks=true': % ITEMIZE: \DeclareInstance{tasks}{itemize}{default} - { enumerate = false } + { + enumerate = false , + label-width = 1.125em + } % ENUMERATE: \DeclareInstance{tasks}{enumerate}{default} - { label-format = tsk. } + { counter-format = tsk. } % MULTIPLECHOICE: \DeclareInstance{tasks}{multiplechoice}{default} { - enumerate = false , - label = \choicebox , + enumerate = false , + label = \choicebox , } \end{beispiel} \secidx*{The `tasks' Object} 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}}% |