texlive[54449] Master/texmf-dist: tasks (21mar20)
commits+karl at tug.org
commits+karl at tug.org
Sat Mar 21 22:17:24 CET 2020
Revision: 54449
http://tug.org/svn/texlive?view=revision&revision=54449
Author: karl
Date: 2020-03-21 22:17:24 +0100 (Sat, 21 Mar 2020)
Log Message:
-----------
tasks (21mar20)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/tasks/README
trunk/Master/texmf-dist/tex/latex/tasks/tasks.cfg
trunk/Master/texmf-dist/tex/latex/tasks/tasks.sty
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/tasks/tasks-manual.pdf
trunk/Master/texmf-dist/doc/latex/tasks/tasks-manual.tex
Removed Paths:
-------------
trunk/Master/texmf-dist/doc/latex/tasks/tasks_en.pdf
trunk/Master/texmf-dist/doc/latex/tasks/tasks_en.tex
Modified: trunk/Master/texmf-dist/doc/latex/tasks/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tasks/README 2020-03-21 21:17:10 UTC (rev 54448)
+++ trunk/Master/texmf-dist/doc/latex/tasks/README 2020-03-21 21:17:24 UTC (rev 54449)
@@ -1,7 +1,7 @@
--------------------------------------------------------------------------
-the TASKS package v1.1a 2020/01/11
+the TASKS package v1.2 2020/03/21
- horizontally columned lists
+ lists with columns filled horizontally
--------------------------------------------------------------------------
Clemens Niederberger
Added: trunk/Master/texmf-dist/doc/latex/tasks/tasks-manual.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/tasks/tasks-manual.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tasks/tasks-manual.pdf 2020-03-21 21:17:10 UTC (rev 54448)
+++ trunk/Master/texmf-dist/doc/latex/tasks/tasks-manual.pdf 2020-03-21 21:17:24 UTC (rev 54449)
Property changes on: trunk/Master/texmf-dist/doc/latex/tasks/tasks-manual.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/tasks/tasks-manual.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tasks/tasks-manual.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/tasks/tasks-manual.tex 2020-03-21 21:17:24 UTC (rev 54449)
@@ -0,0 +1,498 @@
+% --------------------------------------------------------------------------
+% the TASKS package
+%
+% lists with columns filled horizontally
+%
+% --------------------------------------------------------------------------
+% Clemens Niederberger
+% Web: https://github.com/cgnieder/tasks/
+% E-Mail: contact at mychemistry.eu
+% --------------------------------------------------------------------------
+% Copyright 2013--2020 Clemens Niederberger
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Clemens Niederberger.
+% --------------------------------------------------------------------------
+% If you have any ideas, questions, suggestions or bugs to report, please
+% feel free to contact me.
+% --------------------------------------------------------------------------
+\documentclass{tasks-manual}
+
+\begin{document}
+
+\section{Preface}
+\subsection{Motivation \& History}
+Originally \Tasks\ has been an integral part of the
+\ExSheets\changedversion{0.7} package~\cite{pkg:exsheets}. However, users
+told me that it indeed could be useful to have it as a stand-alone package not
+having to load the whole \ExSheets\ beast just for having the \env{tasks}
+environment available. Since I agree with this the environment has been
+extracted into a package if its own, \Tasks. Since then \Tasks\ has been
+distributed as a package of its own but as part of the \ExSheets\
+bundle\changedversion{0.10}. With v0.10 I decided to make it a completely
+independent package. So the relation to \ExSheets\ only is a historical one.
+
+The reason for the \env{tasks} environment is an unwritten agreement in German
+maths textbooks (exspecially in (junior) high school textbooks) to organize
+exercises in columns counting horizontally rather than vertically. That is
+what \code{tasks} primarily is for. If you don't need this feature you're
+better off using traditional \LaTeX\ lists and the \pkg{enumitem} package for
+customization.
+
+\subsection{Changes}
+The \sinceversion{1.0} step to version~1.0 brought some significant changes:
+\begin{itemize}
+ \item the option \option{counter-format} is deprecated. Labels can now be
+ set quite similar to the way they are set in \pkg{enumitem}. This also
+ made the \code{enumerate} option of the list template superfluous which has
+ been removed accordingly.
+ \item The commands \cs{NewTasks} and \cs{RenewTasks} have been renamed.
+ \item The multiple choice lists have been removed.
+ \item Custom definitions can be put in a \code{tasks.cfg} file which is
+ automatically loaded if available.
+\end{itemize}
+
+\section{License and Requirements}\label{sec:license}
+\license
+
+\Tasks\ requires the \bnd{l3kernel}~\cite{bnd:l3kernel} bundle,
+\needpackage{xparse} and \pkg{xtemplate}.
+
+\section{How it works}
+\subsection{Background}
+The \env{tasks} environment is similar to a list like \env{enumerate} but not
+the same. Here are some of the differences:
+\begin{tasks}[style=enumerate]
+ \task there is no pagebreak possible inside an item but only between items.
+ \task the enumeration default is a), b), c) \ldots
+ \task the body of the \env{tasks} environment is split at \emph{every}
+ occurrence of the item separator. For this reason the default separator
+ is not \cs*{item} but \cs{task} so it is unique to this environment only.
+ This directly leads to\ldots
+ \task \ldots\ the fact that the \env{tasks} environment cannot be nested.
+ You can, however, use an \env*{itemize} environment or another
+ \enquote{real} list in it.
+ \task A fifth difference: verbatim material cannot be used in it. You'll
+ have to use \cs*{string}, \cs*{texttt} or \cs*{detokenize}. If this
+ won't suffice then don't use \env{tasks}.
+\end{tasks}
+
+\begin{bewareofthedog}
+ The environments of \Tasks\ are what I like to call
+ \enquote{pseudo-environments}. This means like environments defined by the
+ package \pkg{environ}~\cite{pkg:environ} the body of the environment is read
+ as argument before it is processed. This is why verbatim material cannot be
+ used in \Tasks' lists.
+\end{bewareofthedog}
+
+\subsection{The Basics}
+\begin{environments}
+ \environment{tasks}[\oarg{options}\darg{num of columns}]
+ List like environment where the single items are introduced with
+ \cs{task}.
+\end{environments}
+Let's see an example:
+\begin{example}
+ % \Sample is defined to contain some sample text:
+ % \def\sample{This is some sample text we will use to create a somewhat
+ % longer text spanning a few lines.}
+ % \def\Sample{\sample\ \sample\par\sample}
+ Some text before the list.
+ \begin{tasks}
+ \task \Sample
+ \task \Sample
+ \task \Sample
+ \end{tasks}
+ And also some text after it.
+\end{example}
+
+The environment takes the optional argument \darg{num of columns} with which
+the number of columns used by the environment is specified.
+\begin{example}
+ \begin{tasks}(2)
+ \task \Sample
+ \task \sample\ \sample
+ \task \sample
+ \task \Sample
+ \task \sample\par\sample
+ \end{tasks}
+\end{example}
+
+\subsection{Items Spanning More Than One Column}
+Sometimes it may come in handy if an item is allowed to span more than one
+column. \Tasks\sinceversion{0.10} supports items using the remaining space by
+adding an optional\label{optional-star} star to \cs{task}:
+\begin{example}
+ \begin{tasks}(3)
+ \task \sample
+ \task* \sample
+ \task* \sample
+ \task \sample
+ \task \sample
+ \end{tasks}
+\end{example}
+
+\Tasks\sinceversion{0.10} also supports items that span \emph{all} columns in
+any case by adding an optional bang\label{optional-bang} to \cs{task}.
+\begin{example}
+ \begin{tasks}(3)
+ \task \sample
+ \task! \sample
+ \task! \sample
+ \task \sample
+ \task \sample
+ \end{tasks}
+\end{example}
+
+The optional star has itself an optional argument with parentheses where you
+can specify the number of columns the item is supposed to span:\label{debug}
+\begin{example}
+ \settasks{debug}
+ \begin{tasks}(4)
+ \task the first
+ \task the second
+ \task the third
+ \task the fourth
+ \task*(3) the fifth item is way too long for this and needs three columns
+ \task the sixth
+ \task the seventh
+ \task*(2) the eighth item is way too long for this and needs two columns
+ \task the nineth
+ \task the tenth
+ \end{tasks}
+\end{example}
+If there are not enough columns left (say two columns but you said
+\cs{task}\sarg\Darg{3}) the argument is ignored and the maximum number of
+remaining columns is used (two in case of our example).
+
+Both optional star and optional bang can be combined with the optional
+argument for a custom label:
+\begin{example}
+ \begin{tasks}(3)
+ \task \sample
+ \task* \sample
+ \task*[(x)] \sample
+ \task \sample
+ \task \sample
+ \end{tasks}
+\end{example}
+
+Forcing a new item line manually is also possible\sinceversion{0.9} using the
+following command:
+\begin{commands}
+ \command{startnewitemline}
+ Introduce a new line in a \env{tasks} environment.
+\end{commands}
+While this works it also needs a bit of care since the width of the items
+doesn't change which means in order to use the full width you'd have to use
+trickery like \cs*{rlap} which then means the danger of the item text sticking
+into the margin.
+
+\begin{example}
+ \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{example}
+
+\section{Available Options}\label{sec:tasks:options}
+
+The \Tasks\ package does not have any package options\changedversion{0.10}.
+
+The environment \env{tasks} has a number of options, though, namely the
+following ones that can be set using a setup command:
+\begin{commands}
+ \command{settasks}[\marg{options}]
+ Setup command for \Tasks.
+\end{commands}
+\begin{options}
+ \keyval{style}{instance}\Default
+ Choose the instance to be used. Read more on this in
+ section~\ref{sec:tasks}.
+ \keyval{label-format}{code}\Default
+ \changedversion{1.1a}Can be used to apply a formatting like, \eg,
+ \cs*{bfseries} to the labels. This may be code accepting the item as
+ mandatory argument.
+ \keyval{label}{code}\Default{\cs*{alph}\code{*)}}
+ \changedversion{1.0}Sets a custom label. The \code{*} is replaced by
+ \Marg{task}. This is heavily inspired by
+ \pkg{enumitem}'s~\cite{pkg:enumitem} \code{label} option.
+ \keyval{label-width}{dim}\Default{1em}
+ Sets the width of the item labels.
+ \keyval{label-offset}{dim}\Default{.3333em}
+ \sinceversion{0.7}Sets the offset, \ie, the distance between label and
+ item.
+ \keyval{item-format}{code}\Default
+ \sinceversion{0.11}Can be used to apply a formatting like, \eg,
+ \cs*{bfseries} to the items. This may be code accepting the item as
+ mandatory argument.
+ \keyval{item-indent}{dim}\Default{2.5em}
+ \sinceversion{0.9a}The indent of an item, \ie, the horizontal space
+ available for both label and label-offset. If
+ \[
+ \text{\code{indent}} =
+ \text{\code{label-width}} + \text{\code{label-offset}}
+ \]
+ the label will align with the textblock above (if
+ \keyis{label-align}{left} is set). Please see figure~\ref{fig:lengths}
+ for a sketch of the available lengths and how they are set.
+ \keyval{column-sep}{dim}\Default{0pt}
+ \sinceversion{0.10}A horizontal length that is inserted between columns ot
+ items.
+ \keychoice{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 \option{label-width}.
+ \keyval{before-skip}{skip}\Default{0pt}
+ Sets the skip before the list.
+ \keyval{after-skip}{skip}\Default{0pt}
+ Sets the skip after the list.
+ \keyval{after-item-skip}{skip}\Default{1ex plus 1ex minus 1ex}
+ \sinceversion{0.9}This vertical skip is inserted between rows of items.
+ \keybool{resume}\Default{false}
+ The enumeration will resume from a previous \env{tasks} environment. In
+ order to use this option properly you shouldn't mix different \env{tasks}
+ environments that both count their items.
+ \keyval{start}{integer}\Default{1}
+ \sinceversion{1.1}Set the starting value with which the list starts
+ counting.
+ \keyval{counter}{counter}\Default{task}
+ \sinceversion{1.2}The counter to be used to count the items.
+ \keybool{debug}\Default{false}
+ \sinceversion{0.10}If set to true \cs*{fboxsep} is set to \code{0pt}
+ inside the \env{tasks} environment and \cs*{fbox} is used to draw a frame
+ around the label boxes and the item boxes.
+\end{options}
+
+\begin{figure}
+ \centering
+ \begin{tikzpicture}[every node/.style={font=\footnotesize},scale=.5]
+ \coordinate (itemedge1) at (2,2) ;
+ \coordinate (itemedge2) at (13,2) ;
+ \draw
+ (itemedge1) -- ++(8,0) -- ++(0,-2) -- ++(-8,0) -- cycle ;
+ \draw
+ (itemedge1) ++(-.5,0) coordinate(labeledge1)
+ -- ++(-1,0) --++ (0,-1) --++(1,0) --++(0,1) ;
+ \draw (itemedge1) ++(-2,0) -- ++(0,-2) ;
+ \draw
+ (itemedge2) -- ++(8,0) -- ++(0,-2) -- ++(-8,0) -- cycle ;
+ \draw
+ (itemedge2) ++(-.3,0) coordinate(labeledge2)
+ -- ++(-1,0) --++ (0,-1) --++(1,0) --++(0,1) ;
+ \draw (itemedge2) ++(-2,0) -- ++(0,-2) ;
+ \draw[<->] (itemedge2) ++(-2,0) --node[above]{column sep} ++(-1,0) ;
+ \draw[<->] (0,-.5) --node[below]{item indent} (2,-.5) ;
+ \draw[<->] (2,-.5) --node[below]{item width} (10,-.5) ;
+ \draw[<->] (labeledge1) ++(0,1) --node[above]{label width} ++(-1,0) ;
+ \draw[<->] (labeledge1) --node[above]{label offset} ++(.5,0) ;
+ \end{tikzpicture}
+ \caption{A visual representation of the used lengths.}
+ \label{fig:lengths}
+\end{figure}
+
+Now the same list as above but with three columns and a different label:
+\begin{example}
+ \begin{tasks}[label=(\roman*),label-width=4ex](2)
+ \task \Sample
+ \task \sample\ \sample
+ \task \sample
+ \task \Sample
+ \task \sample\par\sample
+ \end{tasks}
+\end{example}
+
+Let's use it inside a question, \ie, inside \pkg{xsim}'s \env{exercise}
+environment~\cite{pkg:xsim}:
+\begin{example}
+ % since settings are local the following ones will be lost
+ % outside this example;
+ \settasks{
+ label = \theexercise.\arabic* ,
+ item-indent = 2em ,
+ label-width = 2em ,
+ label-offset = 0pt
+ }
+ \begin{exercise}
+ I have these two tasks for you. Shall we begin?
+ \begin{tasks}(2)
+ \task The first task: easy!
+ \task The second task: even more so!
+ \end{tasks}
+ \end{exercise}
+ \begin{solution}[print]
+ Now, let's see\ldots\ ah, yes:
+ \begin{tasks}
+ \task This is the first solution. Told you it was easy.
+ \task This is the second solution. And of course you knew that!
+ \end{tasks}
+ \end{solution}
+\end{example}
+
+Finally let's see what the \option{debug} option does (you could see it
+already on page~\pageref{debug}):
+\begin{example}
+ \settasks{debug}
+ \begin{tasks}(2)
+ \task \Sample
+ \task \Sample
+ \end{tasks}
+\end{example}
+
+\section{Available Instances}\label{sec:tasks:instances}
+There are currently three additional instances for the \code{tasks} object
+available:
+\begin{description}
+ \item[itemize] uses \cs*{labelitemi} as labels.
+ \item[enumerate] enumerates the items with 1., 2., \ldots
+ % \item[multiplechoice] a --~well~-- `multiple choice' list.
+\end{description}
+\begin{example}
+ \begin{tasks}[style=itemize](2)
+ \task that's just how\ldots
+ \task \ldots we expected
+ \end{tasks}
+ \begin{tasks}[style=enumerate](2)
+ \task that's just how\ldots
+ \task \ldots we expected
+ \end{tasks}
+\end{example}
+ % \begin{tasks}[style=multiplechoice](2)
+ % \task that's just how\ldots
+ % \task \ldots we expected
+ % \end{tasks}
+
+\section{Custom Labels}
+If you want to change a single label inside a list, you can use the optional
+argument of \cs{task}. This will temporarily overwrite the default label.
+\begin{example}[side-by-side]
+ \begin{tasks}[style=itemize]
+ \task a standard item
+ \task another one
+ \task[+] a different one
+ \task and another one
+ \end{tasks}
+\end{example}
+
+\begin{commands}
+ \command{tasksifmeasuringTF}[\marg{true}\marg{false}]
+ \sinceversion{1.2}This command used inside a label checks if the label is
+ typeset for measuring its width or if it is typeset \enquote{for
+ real}. Might be useful sometimes. There are also the variants
+ \cs{tasksifmeasuringT} and \cs{tasksifmeasuringF}.
+\end{commands}
+
+\section{New \code{tasks}-like Environments}
+It is possible to add custom environments that work like the \code{tasks}
+environment.
+\begin{commands}
+ \command{NewTasksEnvironment}[\oarg{options}\marg{name}\oarg{separator}\darg{cols}]
+ Define environment \meta{name} that uses \meta{separator} to introduce a
+ new item. Default for \meta{separator} is \cs{task}, default for
+ \meta{cols} is \code{1}. The \meta{options} are the ones described in
+ section~\ref{sec:tasks:options}.
+ \command{RenewTasksEnvironment}[\oarg{options}\marg{name}\oarg{separator}\darg{cols}]
+ Renew environment previously defined with \cs{NewTasksEnvironment}.
+\end{commands}
+The \env{tasks} environment is defined as follows:
+\begin{sourcecode}
+ \NewTasksEnvironment{tasks}
+\end{sourcecode}
+
+The separator does not have to be a control sequence:
+\begin{example}
+ % preamble:
+ % \usepackage{fontawesome}
+ \NewTasksEnvironment[label=\faThumbsOUp,label-width=15pt]{done}[*]
+ \begin{done}
+ * First task
+ * Second task
+ \end{done}
+\end{example}
+Although this might seem handy or even nice I strongly advice against using
+something different than a command sequence. Remember that the items will be
+split at \emph{every} occurrence of the separator. So in order to use the
+separator (here for example for a starred variant of a command) within an item
+it has to be hidden in braces. This is avoided of you use a command sequence
+which even doesn't have to be defined.
+
+Please also keep in mind that the separator still has an optional star
+argument (see~\pageref{optional-star}), an optional bang argument and the
+standard optional argument. Using \code{*} will prevent the optional star
+argument.
+
+\begin{example}
+ % preamble:
+ % \usepackage{fontawesome}
+ \NewTasksEnvironment[label=\faThumbsOUp,label-width=15pt]{done}[*]
+ \begin{done}(3)
+ * First task
+ * Second task
+ *! Third task spanning the full width available
+ * Fourth task
+ \end{done}
+\end{example}
+
+\section{Styling \Tasks}
+\Tasks\ uses \pkg{xtemplate} to declare additional instances for the lists.
+
+\subsection{The \code{tasks} Object}\label{sec:tasks}
+The object that's defined by \Tasks\ is the `tasks' object. This time there
+are four instances available for the one template (again `default') that was
+defined.
+
+\subsubsection{Available Options}
+This section only lists the options that can be used when defining an instance
+of the `default' template. The following subsections will give some examples
+of their usage.
+
+\begin{sourcecode}
+ \DeclareTemplateInterface{tasks}{default}{3}
+ {
+ % option : type = default
+ label : tokenlist = \alph*) ,
+ indent : length = 2.5em ,
+ label-format : tokenlist ,
+ label-width : length = 1em ,
+ label-offset : length = .3333em ,
+ after-item-skip : skip = 1ex plus 1ex minus 1ex
+ }
+\end{sourcecode}
+
+\subsubsection{Predefined Instances}
+This is rather brief this time:
+\begin{sourcecode}
+ % alphabetize: a) b) c)
+ \DeclareInstance{tasks}{alphabetize}{default}{}
+ % itemize
+ \DeclareInstance {tasks} {itemize} {default}
+ {
+ label-width = 1.125em ,
+ label = \labelitemi
+ }
+ % enumerate:
+ \DeclareInstance {tasks} {enumerate} {default}
+ { label = \arabic*. }
+\end{sourcecode}
+
+\clearpage
+\printbibliography
+
+\end{document}
Property changes on: trunk/Master/texmf-dist/doc/latex/tasks/tasks-manual.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/latex/tasks/tasks_en.pdf
===================================================================
(Binary files differ)
Deleted: trunk/Master/texmf-dist/doc/latex/tasks/tasks_en.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tasks/tasks_en.tex 2020-03-21 21:17:10 UTC (rev 54448)
+++ trunk/Master/texmf-dist/doc/latex/tasks/tasks_en.tex 2020-03-21 21:17:24 UTC (rev 54449)
@@ -1,527 +0,0 @@
-% --------------------------------------------------------------------------
-% the TASKS package
-%
-% horizontally columned lists
-%
-% --------------------------------------------------------------------------
-% Clemens Niederberger
-% Web: https://github.com/cgnieder/tasks/
-% E-Mail: contact at mychemistry.eu
-% --------------------------------------------------------------------------
-% Copyright 2013--2020 Clemens Niederberger
-%
-% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
-% of this license or (at your option) any later version.
-% The latest version of this license is in
-% http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
-% version 2005/12/01 or later.
-%
-% This work has the LPPL maintenance status `maintained'.
-%
-% The Current Maintainer of this work is Clemens Niederberger.
-% --------------------------------------------------------------------------
-% If you have any ideas, questions, suggestions or bugs to report, please
-% feel free to contact me.
-% --------------------------------------------------------------------------
-\documentclass[load-preamble+]{cnltx-doc}
-\usepackage{tasks}
-
-\setcnltx{
- package = {tasks} ,
- authors = Clemens Niederberger ,
- email = {contact at mychemistry.eu} ,
- url = {https://github.com/cgnieder/tasks/} ,
- info = {horizontally columned lists} ,
- add-cmds = {
- NewTasksEnvironment,
- RenewTasksEnvironment,
- settasks,
- startnewitemline ,
- task
- } ,
- add-silent-cmds = {
- DeclareInstance, DeclareTemplateInterface,
- leftthumbsup,
- sample, Sample , theexercise
- }
-}
-
-\newpackagename\ExSheets{ExSheets}
-\newpackagename\xsim{xsim}
-\newpackagename\Tasks{tasks}
-
-% ----------------------------------------------------------------------------
-% other packages, bibliography, index
-\usepackage{xcoffins,tikz,wasysym,enumitem,booktabs,siunitx}
-\usepackage[accsupp]{acro}
-\DeclareAcronym{id}{
- short = id ,
- long = Identifier ,
- format = \scshape ,
- pdfstring = ID ,
- accsupp = ID
-}
-
-\usepackage{filecontents}
-\usepackage{csquotes}
-
-% ----------------------------------------------------------------------------
-% example definitions that have to be done in the preamble:
-\usepackage{xsim}
-\usepackage{dingbat}
-
-\newcommand*\sample{This is some sample text we will use to create a somewhat
- longer text spanning a few lines.}
-\newcommand*\Sample{\sample\ \sample\par\sample}
-
-\begin{document}
-
-\section{Preface}
-\subsection{Motivation}
-Originally \Tasks\ has been an integral part of the
-\ExSheets\changedversion{0.7} package. However, users told me that it indeed
-could be useful to have it as a stand-alone package not having to load the
-whole \ExSheets\ beast just for having the \env{tasks} environment available.
-Since I agree with this the environment has been extracted into a package if
-its own, \Tasks. Since then \Tasks{} has been distributed as a package of its
-own but as part of the \ExSheets{} bundle\changedversion{0.10}. With v0.10 I
-decided to make it a completely independent package. So the relation to
-\ExSheets{} only is a historical one.
-
-The reason for the \env{tasks} environment is an unwritten agreement in German
-maths textbooks (exspecially in (junior) high school textbooks) to organize
-exercises in columns counting horizontally rather than vertically. That is
-what \code{tasks} primarily is for. If you don't need this feature you're
-better off using traditional \LaTeX{} lists and the \pkg{enumitem} package for
-customization.
-
-\subsection{Changes}
-The \sinceversion{1.0} step to version~1.0 brought some significant changes:
-\begin{itemize}
- \item the option \option{counter-format} is deprecated. Labels can now be
- set quite similar to the way they are set in \pkg{enumitem}. This also
- made the \code{enumerate} option of the list template superfluous which has
- been removed accordingly.
- \item The commands \cs{NewTasks} and \cs{RenewTasks} have been renamed.
- \item The multiple choice lists have been removed.
- \item Custom definitions can be put in a \code{tasks.cfg} file which is
- automatically loaded if available.
-\end{itemize}
-
-\section{License and Requirements}\label{sec:license}
-\license
-
-\Tasks\ requires the \bnd{l3kernel}~\cite{bnd:l3kernel} bundle,
-\needpackage{xparse} and \pkg{xtemplate}.
-
-\section{How it works}
-\subsection{The Basics}
-The \env{tasks} environment is similar to a list like \env{enumerate} but not
-the same. Here are some of the differences:
-\begin{itemize}
- \item A first difference: there is no pagebreak possible inside an item but
- only between items.
- \item A second difference: the enumeration default is a), b), c) \ldots
- \item A third difference: the body of the \env{tasks} environment is split
- at \emph{every} occurrence of the item separator. For this reason the
- default separator is not \cs*{item} but \cs{task} so it is unique to this
- environment only. This directly leads to\ldots
- \item \ldots{} a fourth difference: the \env{tasks} environment cannot be
- nested. You can, however, use an \env*{itemize} environment or another
- \enquote{real} list in it.
- \item A fifth difference: verbatim material cannot be used in it. You'll
- have to use \cs*{string}, \cs*{texttt} or \cs*{detokenize}. If this
- won't suffice then don't use \env{tasks}.
-% \item A sixth difference: %footnotes
-\end{itemize}
-
-\begin{environments}
- \environment{tasks}[\oarg{options}\darg{num of columns}]
- List like environment where the single items are introduced with
- \cs{task}.
-\end{environments}
-Let's see an example:
-\begin{example}
- % \Sample is defined to contain some sample text:
- % \def\sample{This is some sample text we will use to create a somewhat
- % longer text spanning a few lines.}
- % \def\Sample{\sample\ \sample\par\sample}
- Some text before the list.
- \begin{tasks}
- \task \Sample
- \task \Sample
- \task \Sample
- \end{tasks}
- And also some text after it.
-\end{example}
-
-The environment takes the optional argument \darg{num of columns} with which
-the number of columns used by the environment is specified.
-\begin{example}
- \begin{tasks}(2)
- \task \Sample
- \task \sample\ \sample
- \task \sample
- \task \Sample
- \task \sample\par\sample
- \end{tasks}
-\end{example}
-
-\subsection{Items Spanning More Than One Column}
-Sometimes it may come in handy if an item is allowed to span more than one
-column. \Tasks\sinceversion{0.10} supports items using the remaining space by
-adding an optional\label{optional-star} star to \cs{task}:
-\begin{example}
- \begin{tasks}(3)
- \task \sample
- \task* \sample
- \task* \sample
- \task \sample
- \task \sample
- \end{tasks}
-\end{example}
-
-\Tasks\sinceversion{0.10} also supports items that span \emph{all} columns in
-any case by adding an optional bang\label{optional-bang} to \cs{task}.
-\begin{example}
- \begin{tasks}(3)
- \task \sample
- \task! \sample
- \task! \sample
- \task \sample
- \task \sample
- \end{tasks}
-\end{example}
-
-The optional star has itself an optional argument with parentheses where you
-can specify the number of columns the item is supposed to span:\label{debug}
-\begin{example}
- \settasks{debug}
- \begin{tasks}(4)
- \task the first
- \task the second
- \task the third
- \task the fourth
- \task*(3) the fifth item is way too long for this and needs three columns
- \task the sixth
- \task the seventh
- \task*(2) the eighth item is way too long for this and needs two columns
- \task the nineth
- \task the tenth
- \end{tasks}
-\end{example}
-If there are not enough columns left (say two columns but you said
-\cs{task}\sarg\Darg{3}) the argument is ignored and the maximum number of
-remaining columns is used (two in case of our example).
-
-Both optional star and optional bang can be combined with the optional
-argument for a custom label:
-\begin{example}
- \begin{tasks}(3)
- \task \sample
- \task* \sample
- \task*[(x)] \sample
- \task \sample
- \task \sample
- \end{tasks}
-\end{example}
-
-Forcing a new item line manually is also possible\sinceversion{0.9} using the
-following command:
-\begin{commands}
- \command{startnewitemline}
- Introduce a new line in a \env{tasks} environment.
-\end{commands}
-\begin{example}
- \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{example}
-
-While this works it also needs a bit of care since the width of the items
-doesn't change which means in order to use the full width you'd have to use
-trickery like \cs*{rlap} which then means the danger of the item text sticking
-into the margin\ldots
-
-\section{Available Options}\label{sec:tasks:options}
-
-The \Tasks{} package does not have any package options\changedversion{0.10}.
-
-The environment \env{tasks} has a number of options, though, namely the
-following ones that can be set using a setup command:
-\begin{commands}
- \command{settasks}[\marg{options}]
- Setup command for \Tasks.
-\end{commands}
-\begin{options}
- \keyval{style}{instance}\Default
- Choose the instance to be used. Read more on this in
- section~\ref{sec:tasks}.
- \keyval{label-format}{code}\Default
- \changedversion{1.1a}Can be used to apply a formatting like, \eg,
- \cs*{bfseries} to the labels. This may be code accepting the item as
- mandatory argument.
- \keyval{label}{code}\Default{\cs*{alph}\code{*)}}
- \changedversion{1.0}Sets a custom label. The \code{*} is replaced by
- \Marg{task}. This is heavily inspired by
- \pkg{enumitem}'s~\cite{pkg:enumitem} \code{label} option.
- \keyval{label-width}{dim}\Default{1em}
- Sets the width of the item labels.
- \keyval{label-offset}{dim}\Default{.3333em}
- \sinceversion{0.7}Sets the offset, \ie, the distance between label and
- item.
- \keyval{item-format}{code}\Default
- \sinceversion{0.11}Can be used to apply a formatting like, \eg,
- \cs*{bfseries} to the items. This may be code accepting the item as
- mandatory argument.
- \keyval{item-indent}{dim}\Default{2.5em}
- \sinceversion{0.9a}The indent of an item, \ie, the horizontal space
- available for both label and label-offset. If
- \[
- \text{\code{indent}} =
- \text{\code{label-width}} + \text{\code{label-offset}}
- \]
- the label will align with the textblock above (if
- \keyis{label-align}{left} is set). Please see figure~\ref{fig:lengths}
- for a sketch of the available lengths and how they are set.
- \keyval{column-sep}{dim}\Default{0pt}
- \sinceversion{0.10}A horizontal length that is inserted between columns ot
- items.
- \keychoice{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 \option{label-width}.
- \keyval{before-skip}{skip}\Default{0pt}
- Sets the skip before the list.
- \keyval{after-skip}{skip}\Default{0pt}
- Sets the skip after the list.
- \keyval{after-item-skip}{skip}\Default{1ex plus 1ex minus 1ex}
- \sinceversion{0.9}This vertical skip is inserted between rows of items.
- \keybool{resume}\Default{false}
- The enumeration will resume from a previous \env{tasks} environment. In
- order to use this option properly you shouldn't mix different \env{tasks}
- environments that both count their items.
- \keyval{start}{integer}\Default{1}
- \sinceversion{1.1}Set the starting value with which the list starts
- counting.
- \keybool{debug}\Default{false}
- \sinceversion{0.10}If set to true \cs*{fboxsep} is set to \code{0pt}
- inside the \env{tasks} environment and \cs*{fbox} is used to draw a frame
- around the label boxes and the item boxes.
-\end{options}
-
-\begin{figure}
- \centering
- \begin{tikzpicture}[every node/.style={font=\footnotesize},scale=.5]
- \coordinate (itemedge1) at (2,2) ;
- \coordinate (itemedge2) at (13,2) ;
- \draw
- (itemedge1) -- ++(8,0) -- ++(0,-2) -- ++(-8,0) -- cycle ;
- \draw
- (itemedge1) ++(-.5,0) coordinate(labeledge1)
- -- ++(-1,0) --++ (0,-1) --++(1,0) --++(0,1) ;
- \draw (itemedge1) ++(-2,0) -- ++(0,-2) ;
- \draw
- (itemedge2) -- ++(8,0) -- ++(0,-2) -- ++(-8,0) -- cycle ;
- \draw
- (itemedge2) ++(-.3,0) coordinate(labeledge2)
- -- ++(-1,0) --++ (0,-1) --++(1,0) --++(0,1) ;
- \draw (itemedge2) ++(-2,0) -- ++(0,-2) ;
- \draw[<->] (itemedge2) ++(-2,0) --node[above]{column sep} ++(-1,0) ;
- \draw[<->] (0,-.5) --node[below]{item indent} (2,-.5) ;
- \draw[<->] (2,-.5) --node[below]{item width} (10,-.5) ;
- \draw[<->] (labeledge1) ++(0,1) --node[above]{label width} ++(-1,0) ;
- \draw[<->] (labeledge1) --node[above]{label offset} ++(.5,0) ;
- \end{tikzpicture}
- \caption{A visual representation of the used lengths.}
- \label{fig:lengths}
-\end{figure}
-
-Now the same list as above but with three columns and a different label:
-\begin{example}
- \begin{tasks}[label=(\roman*),label-width=4ex](2)
- \task \Sample
- \task \sample\ \sample
- \task \sample
- \task \Sample
- \task \sample\par\sample
- \end{tasks}
-\end{example}
-
-Let's use it inside a question, \ie, inside \xsim's \env{exercise}
-environment:
-\begin{example}
- % since settings are local the following ones will be lost
- % outside this example;
- \settasks{
- label = \theexercise.\arabic* ,
- item-indent = 2em ,
- label-width = 2em ,
- label-offset = 0pt
- }
- \begin{exercise}
- I have these two tasks for you. Shall we begin?
- \begin{tasks}(2)
- \task The first task: easy!
- \task The second task: even more so!
- \end{tasks}
- \end{exercise}
- \begin{solution}[print]
- Now, let's see\ldots\ ah, yes:
- \begin{tasks}
- \task This is the first solution. Told you it was easy.
- \task This is the second solution. And of course you knew that!
- \end{tasks}
- \end{solution}
-\end{example}
-
-Finally let's see what the \option{debug} option does (you could see it
-already on page~\pageref{debug}):
-\begin{example}
- \settasks{debug}
- \begin{tasks}(2)
- \task \Sample
- \task \Sample
- \end{tasks}
-\end{example}
-
-\section{Available Instances}\label{sec:tasks:instances}
-There are currently three additional instances for the \code{tasks} object
-available:
-\begin{description}
- \item[itemize] uses \cs*{labelitemi} as labels.
- \item[enumerate] enumerates the items with 1., 2., \ldots
- % \item[multiplechoice] a --~well~-- `multiple choice' list.
-\end{description}
-\begin{example}
- \begin{tasks}[style=itemize](2)
- \task that's just how\ldots
- \task \ldots we expected
- \end{tasks}
- \begin{tasks}[style=enumerate](2)
- \task that's just how\ldots
- \task \ldots we expected
- \end{tasks}
-\end{example}
- % \begin{tasks}[style=multiplechoice](2)
- % \task that's just how\ldots
- % \task \ldots we expected
- % \end{tasks}
-
-\section{Custom Labels}
-If you want to change a single label inside a list, you can use the optional
-argument of \cs{task}. This will temporarily overwrite the default label.
-\begin{example}[side-by-side]
- \begin{tasks}[style=itemize]
- \task a standard item
- \task another one
- \task[+] a different one
- \task and another one
- \end{tasks}
-\end{example}
-
-\section{New \code{tasks}-like Environments}
-It is possible to add custom environments that work like the \code{tasks}
-environment.
-\begin{commands}
- \command{NewTasksEnvironment}[\oarg{options}\marg{name}\oarg{separator}\darg{cols}]
- Define environment \meta{name} that uses \meta{separator} to introduce a
- new item. Default for \meta{separator} is \cs{task}, default for
- \meta{cols} is \code{1}. The \meta{options} are the ones described in
- section~\ref{sec:tasks:options}.
- \command{RenewTasksEnvironment}[\oarg{options}\marg{name}\oarg{separator}\darg{cols}]
- Renew environment previously defined with \cs{NewTasksEnvironment}.
-\end{commands}
-The \env{tasks} environment is defined as follows:
-\begin{sourcecode}
- \NewTasksEnvironment{tasks}
-\end{sourcecode}
-
-The separator does not have to be a control sequence:
-\begin{example}
- % preamble:
- % \usepackage{dingbat}
- \NewTasksEnvironment[label=\footnotesize\leftthumbsup,label-width=15pt]{done}[*]
- \begin{done}
- * First task
- * Second task
- \end{done}
-\end{example}
-Although this might seem handy or even nice I strongly advice against using
-something different than a command sequence. Remember that the items will be
-split at \emph{every} occurrence of the separator. So in order to use the
-separator (here for example for a starred variant of a command) within an item
-it has to be hidden in braces. This is avoided of you use a command sequence
-which even doesn't have to be defined.
-
-Please also keep in mind that the separator still has an optional star
-argument (see~\pageref{optional-star}), an optional bang argument and the
-standard optional argument. Using \code{*} will prevent the optional star
-argument.
-
-\begin{example}
- % preamble:
- % \usepackage{dingbat}
- \NewTasksEnvironment[label=\footnotesize\leftthumbsup,label-width=15pt]{done}[*]
- \begin{done}(3)
- * First task
- * Second task
- *! Third task spanning the full width available
- * Fourth task
- \end{done}
-\end{example}
-
-\section{Styling \Tasks}
-\Tasks\ uses \pkg{xtemplate} to declare additional instances for the lists.
-
-\subsection{The \code{tasks} Object}\label{sec:tasks}
-The object that's defined by \Tasks\ is the `tasks' object. This time there
-are four instances available for the one template (again `default') that was
-defined.
-
-\subsubsection{Available Options}
-This section only lists the options that can be used when defining an instance
-of the `default' template. The following subsections will give some examples
-of their usage.
-
-\begin{sourcecode}
- \DeclareTemplateInterface{tasks}{default}{3}
- {
- % option : type = default
- label : tokenlist = \alph*) ,
- indent : length = 2.5em ,
- label-format : tokenlist ,
- label-width : length = 1em ,
- label-offset : length = .3333em ,
- after-item-skip : skip = 1ex plus 1ex minus 1ex
- }
-\end{sourcecode}
-
-\subsubsection{Predefined Instances}
-This is rather brief this time:
-\begin{sourcecode}
- % alphabetize: a) b) c)
- \DeclareInstance{tasks}{alphabetize}{default}{}
- % itemize
- \DeclareInstance {tasks} {itemize} {default}
- {
- label-width = 1.125em ,
- label = \labelitemi
- }
- % enumerate:
- \DeclareInstance {tasks} {enumerate} {default}
- { label = \arabic*. }
-\end{sourcecode}
-
-\end{document}
Modified: trunk/Master/texmf-dist/tex/latex/tasks/tasks.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tasks/tasks.cfg 2020-03-21 21:17:10 UTC (rev 54448)
+++ trunk/Master/texmf-dist/tex/latex/tasks/tasks.cfg 2020-03-21 21:17:24 UTC (rev 54449)
@@ -1,7 +1,7 @@
% --------------------------------------------------------------------------
% the TASKS package
%
-% horizontally columned lists
+% lists with columns filled horizontally
%
% --------------------------------------------------------------------------
% Clemens Niederberger
Modified: trunk/Master/texmf-dist/tex/latex/tasks/tasks.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tasks/tasks.sty 2020-03-21 21:17:10 UTC (rev 54448)
+++ trunk/Master/texmf-dist/tex/latex/tasks/tasks.sty 2020-03-21 21:17:24 UTC (rev 54449)
@@ -1,7 +1,7 @@
% --------------------------------------------------------------------------
% the TASKS package
%
-% horizontally columned lists
+% lists with columns filled horizontally
%
% --------------------------------------------------------------------------
% Clemens Niederberger
@@ -28,10 +28,10 @@
\RequirePackage {expl3,xparse,xtemplate}
\ExplSyntaxOn
-\tl_const:Nn \c_tasks_date_tl {2020/01/11}
+\tl_const:Nn \c_tasks_date_tl {2020/03/21}
\tl_const:Nn \c_tasks_version_major_number_tl {1}
-\tl_const:Nn \c_tasks_version_minor_number_tl {1}
-\tl_const:Nn \c_tasks_version_subrelease_tl {a}
+\tl_const:Nn \c_tasks_version_minor_number_tl {2}
+\tl_const:Nn \c_tasks_version_subrelease_tl {}
\tl_const:Nx \c_tasks_version_number_tl
{
\c_tasks_version_major_number_tl .
@@ -42,7 +42,7 @@
\c_tasks_version_number_tl
\c_tasks_version_subrelease_tl
}
-\tl_const:Nn \c_tasks_info_tl {horizontally ~ columned ~ lists}
+\tl_const:Nn \c_tasks_info_tl {lists~ with~ columns~ filled~ horizontally}
\ProvidesExplPackage
{tasks}
@@ -56,8 +56,10 @@
\cs_generate_variant:Nn \tl_if_eq:nnT {V}
\cs_generate_variant:Nn \coffin_attach:NnnNnnnn {NnnNx}
\cs_generate_variant:Nn \tl_set_rescan:Nnn {NnV}
+\cs_generate_variant:Nn \tl_set:Nn {cV}
\cs_generate_variant:Nn \hbox_set:Nn {NV}
\cs_generate_variant:Nn \msg_warning:nnnn {nnV,nnnx}
+\cs_generate_variant:Nn \tl_replace_once:Nnn {Nne}
% --------------------------------------------------------------------------
\msg_new:nnn {tasks} {width-too-small}
@@ -68,9 +70,10 @@
\msg_new:nnn {tasks} {no-item}
{
- You've~ placed~ `#1'~ before~ the~ first~ #2~ \msg_line_context: .~
- I~ will~ throw~ it~ away~ and~ ignore~ it~ for~ the~ rest~ of~ the~
- list.
+ You've~ placed \\ \\
+ #1 \\ \\
+ before~ the~ first~ #2~ \msg_line_context: .~ I~ will~ throw~ it~ away~
+ and~ ignore~ it~ for~ the~ rest~ of~ the~ list.
}
\msg_new:nnn {tasks} {deprecated}
@@ -113,6 +116,7 @@
\bool_new:N \l__tasks_debug_bool
\bool_new:N \l__tasks_item_full_line_bool
\bool_new:N \l__tasks_item_rest_of_line_bool
+\bool_new:N \l__tasks_measuring_bool
\tl_new:N \l__tasks_instance_tl
\tl_new:N \l__tasks_label_tl
@@ -119,6 +123,7 @@
\tl_new:N \l__tasks_custom_label_tl
\tl_new:N \l__tasks_label_format_tl
\tl_new:N \l__tasks_custom_label_format_tl
+\tl_new:N \l__tasks_counter_tl
\tl_new:N \l__tasks_item_format_tl
\tl_new:N \l__tasks_custom_item_format_tl
\tl_new:N \l__tasks_item_fill_left_tl
@@ -164,6 +169,22 @@
{ \use:n {#1} }
}
+\prg_new_conditional:Npnn \tasks_if_measuring: {p,T,F,TF}
+ {
+ \bool_if:NTF \l__tasks_measuring_bool
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+
+\DeclareExpandableDocumentCommand \tasksifmeasuringTF {+m+m}
+ { \tasks_if_measuring:TF {#1} {#2} }
+
+\DeclareExpandableDocumentCommand \tasksifmeasuringT {+m}
+ { \tasks_if_measuring:T {#1} }
+
+\DeclareExpandableDocumentCommand \tasksifmeasuringF {+m}
+ { \tasks_if_measuring:F {#1} }
+
% --------------------------------------------------------------------------
% #1: instance
% #2: number of columns
@@ -256,12 +277,10 @@
{ \l__tasks_tmpa_int } > { \l__tasks_item_columns_int }
{ \int_set_eq:NN \l__tasks_tmpa_int \l__tasks_item_columns_int }
{ \int_zero:N \l__tasks_item_columns_int }
- \bool_if:nT
+ \bool_lazy_and:nnT
+ { \l__tasks_item_rest_of_line_bool }
+ { !\int_compare_p:nNn { \l__tasks_item_columns_int } = {0} }
{
- \l__tasks_item_rest_of_line_bool &&
- !\int_compare_p:nNn { \l__tasks_item_columns_int } = {0}
- }
- {
\int_gadd:Nn \g__tasks_current_col_num_int
{ \l__tasks_item_columns_int -1 }
\int_gadd:Nn \g__tasks_total_items_int
@@ -283,7 +302,10 @@
{
\vcoffin_set:Nnn \l__tasks_tmpa_coffin
{ \l__tasks_item_width_dim }
- { \__tasks_setup: #2 {#3} \mode_if_horizontal:T { \strut } }
+ {
+ \__tasks_setup:
+ #2 { #3 \mode_if_horizontal:T { \strut } }
+ }
\__tasks_debug:n
{
\coffin_typeset:Nnnnn \l__tasks_tmpa_coffin
@@ -338,18 +360,13 @@
\noindent
\skip_horizontal:N \l__tasks_item_indent_dim
% typeset the item (with the attached label protruding to the left):
- \coffin_typeset:Nnnnn \l__tasks_item_coffin
- {l}
- {T}
- {0pt}
- {0pt}
- \bool_if:nT
+ \coffin_typeset:Nnnnn \l__tasks_item_coffin {l} {T} {0pt} {0pt}
+ \bool_lazy_or:nnT
+ { \l__tasks_item_full_line_bool }
{
- \l__tasks_item_full_line_bool ||
- (
- \l__tasks_item_rest_of_line_bool &&
- \int_compare_p:nNn { \l__tasks_item_columns_int } = {0}
- )
+ \bool_lazy_and_p:nn
+ { \l__tasks_item_rest_of_line_bool }
+ { \int_compare_p:nNn { \l__tasks_item_columns_int } = {0} }
}
{ \tasks_new_row: }
% are we between items in a row? Then skip by \l__tasks_column_sep_dim :
@@ -358,12 +375,9 @@
{ \skip_horizontal:N \l__tasks_column_sep_dim }
% if we ended a row and a new row is still to come skip vertically by
% \l__tasks_after_item_skip :
- \bool_if:nT
- {
- ( \int_compare_p:nNn { \g__tasks_current_col_num_int } = { \l__tasks_columns_int } )
- &&
- ( \int_compare_p:n { \g__tasks_current_row_num_int != \g__tasks_rows_int } )
- }
+ \bool_lazy_and:nnT
+ { \int_compare_p:nNn { \g__tasks_current_col_num_int } = { \l__tasks_columns_int } }
+ { \int_compare_p:n { \g__tasks_current_row_num_int != \g__tasks_rows_int } }
{ \skip_vertical:N \l__tasks_after_item_skip }
% clean up:
\coffin_clear:N \l__tasks_item_coffin
@@ -429,10 +443,10 @@
{
label : tokenlist = \alph*) ,
indent : length = 2.5em ,
- label-format : tokenlist ,
+ label-format : tokenlist ,
label-width : length = 11pt ,
label-offset : length = .3333em ,
- item-format : tokenlist ,
+ item-format : tokenlist ,
after-item-skip : skip = 1ex plus 1ex minus 1ex
}
@@ -482,7 +496,11 @@
\__tasks_label_align:V \l__tasks_label_align_tl
% need this for enumerate list:
\bool_if:NF \l__tasks_resume_bool
- { \setcounter {task} { \int_eval:n { \l__tasks_start_int -1 } } }
+ {
+ \setcounter
+ { \l__tasks_counter_tl }
+ { \int_eval:n { \l__tasks_start_int -1 } }
+ }
\int_set:Nn \l__tasks_columns_int {#2}
% set all the items in their own coffins and join with the ground:
\int_gzero:N \g__tasks_current_col_num_int
@@ -509,12 +527,12 @@
\bool_set_false:N \l__tasks_tmpa_bool
\tl_if_in:NnT \l__tasks_tmpa_tl {*}
{
- \tl_replace_once:Nnn \l__tasks_tmpa_tl {*} {{task}}
+ \tl_replace_once:Nne \l__tasks_tmpa_tl {*} {{ \l__tasks_counter_tl }}
\bool_set_true:N \l__tasks_tmpa_bool
}
\tl_set_rescan:NnV \l__tasks_tmpa_tl {} \l__tasks_tmpa_tl
\bool_if:NT \l__tasks_tmpa_bool
- { \tl_set:NV \thetask \l__tasks_tmpa_tl }
+ { \tl_set:cV { the \l__tasks_counter_tl } \l__tasks_tmpa_tl }
\dim_compare:nNnT
{ \l__tasks_item_indent_dim }
<
@@ -529,12 +547,13 @@
\seq_map_inline:Nn \l__tasks_seq
{
\__tasks_read_item:www ##1 \q_stop
- \refstepcounter {task}
+ \refstepcounter { \l__tasks_counter_tl }
\tl_set:Nx \l__tasks_label_tl { { \exp_not:V \l__tasks_tmpa_tl } }
\bool_if:NTF \l__tasks_custom_label_format_bool
{ \tl_put_left:NV \l__tasks_label_tl \l__tasks_custom_label_format_tl }
{ \tl_put_left:NV \l__tasks_label_tl \l__tasks_label_format_tl }
% check if the label width is big enough:
+ \bool_set_true:N \l__tasks_measuring_bool
\hbox_set:NV \l__tasks_tmpa_box \l__tasks_label_tl
\dim_compare:nNnT
{ \box_wd:N \l__tasks_tmpa_box }
@@ -546,6 +565,7 @@
{label-width}
{ \dim_to_decimal:n { \box_wd:N \l__tasks_tmpa_box } }
}
+ \bool_set_false:N \l__tasks_measuring_bool
\tl_if_eq:VnTF \l__tasks_tmp_label_tl { $tasks$default$label$ }
{
\__tasks_task:VVV
@@ -624,6 +644,8 @@
counter-format .code:n =
\msg_warning:nnnnn {tasks} {deprecated} {option} {counter-format} {label}
\keys_set:nn {tasks/list} { label = #1 } ,
+ counter .tl_set:N = \l__tasks_counter_tl ,
+ counter .initial:n = task ,
label .code:n =
\bool_set_true:N \l__tasks_custom_label_bool
\tl_set:Nn \l__tasks_custom_label_tl {#1} ,
@@ -828,5 +850,9 @@
2019/11/03 v1.1 - fix typo
- make \settasks' argument long
- new option `start'
-2020/01/11 v1.2 - allow `label-format' to end with command that needs an
+2020/01/11 v1.1a - allow `label-format' to end with command that needs an
argument
+2020/03/21 v1.2 - prefer lazy boolean evaluation
+ - \tasksifmeasuringTF
+ - new option `counter'
+ - rename manual files
More information about the tex-live-commits
mailing list.