From 71c5385b16afce7e5659929bd66ed077e203a8e7 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 5 Oct 2019 20:50:33 +0000 Subject: tasks (5oct19) git-svn-id: svn://tug.org/texlive/trunk@52297 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/tasks/README | 6 +- Master/texmf-dist/doc/latex/tasks/tasks_en.pdf | Bin 459628 -> 448511 bytes Master/texmf-dist/doc/latex/tasks/tasks_en.tex | 176 +++++++++---------------- 3 files changed, 62 insertions(+), 120 deletions(-) (limited to 'Master/texmf-dist/doc/latex/tasks') diff --git a/Master/texmf-dist/doc/latex/tasks/README b/Master/texmf-dist/doc/latex/tasks/README index 48d949ffac7..190287819ca 100644 --- a/Master/texmf-dist/doc/latex/tasks/README +++ b/Master/texmf-dist/doc/latex/tasks/README @@ -1,14 +1,14 @@ -------------------------------------------------------------------------- -the TASKS package v0.12 2016/08/13 +the TASKS package v1.0 2019/10/04 - Horizontal columned lists. + horizontally columned lists -------------------------------------------------------------------------- Clemens Niederberger Web: https://github.com/cgnieder/tasks/ E-Mail: contact@mychemistry.eu -------------------------------------------------------------------------- -Copyright 2013-2016 Clemens Niederberger +Copyright 2013--2019 Clemens Niederberger This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 diff --git a/Master/texmf-dist/doc/latex/tasks/tasks_en.pdf b/Master/texmf-dist/doc/latex/tasks/tasks_en.pdf index 0e7f51af91f..fb9d209ea2e 100644 Binary files a/Master/texmf-dist/doc/latex/tasks/tasks_en.pdf and b/Master/texmf-dist/doc/latex/tasks/tasks_en.pdf differ diff --git a/Master/texmf-dist/doc/latex/tasks/tasks_en.tex b/Master/texmf-dist/doc/latex/tasks/tasks_en.tex index 35b56f74a26..25f5353eeed 100644 --- a/Master/texmf-dist/doc/latex/tasks/tasks_en.tex +++ b/Master/texmf-dist/doc/latex/tasks/tasks_en.tex @@ -1,14 +1,14 @@ % -------------------------------------------------------------------------- % the TASKS package % -% Horizontal columned lists. +% horizontally columned lists % % -------------------------------------------------------------------------- % Clemens Niederberger % Web: https://github.com/cgnieder/tasks/ % E-Mail: contact@mychemistry.eu % -------------------------------------------------------------------------- -% Copyright 2013-2014 Clemens Niederberger +% Copyright 2013--2019 Clemens Niederberger % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -33,31 +33,23 @@ authors = Clemens Niederberger , email = {contact@mychemistry.eu} , url = {https://github.com/cgnieder/tasks/} , - info = {create horizontal columned lists} , + info = {horizontally columned lists} , add-cmds = { - checkedchoicebox , - choicebox, - NewTasks, + NewTasksEnvironment, + RenewTasksEnvironment, settasks, startnewitemline , task } , add-silent-cmds = { - choice, correct, DeclareInstance, DeclareTemplateInterface, leftthumbsup, - sample, Sample + sample, Sample , theexercise } } -\BeforeBeginEnvironment{example}{\vspace{\baselineskip}} -\AfterEndEnvironment{example}{\vspace{\baselineskip}} -\BeforeBeginEnvironment{sourcecode}{\vspace{\baselineskip}} -\AfterEndEnvironment{sourcecode}{\vspace{\baselineskip}} - \newpackagename\ExSheets{ExSheets} -\newpackagename\ExSheetslistings{ExSheets-listings} -\newpackagename\cntformats{cntformats} +\newpackagename\xsim{xsim} \newpackagename\Tasks{tasks} % ---------------------------------------------------------------------------- @@ -75,15 +67,10 @@ \usepackage{filecontents} \usepackage{csquotes} - - % ---------------------------------------------------------------------------- % example definitions that have to be done in the preamble: -\usepackage{exsheets} +\usepackage{xsim} \usepackage{dingbat} -\NewTasks[style=multiplechoice]{multiplechoice}[\choice](3) -\newcommand*\correct{\PrintSolutionsTF{\checkedchoicebox}{\choicebox}} - \newcommand*\sample{This is some sample text we will use to create a somewhat longer text spanning a few lines.} @@ -91,7 +78,8 @@ \begin{document} -\section{Motivation} +\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 @@ -109,15 +97,24 @@ 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 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{emuerate} option of the list template superfluous which has + been removed accordingly. + \item The commands \cs{NewTasks} and \cs{RenewTasks} have ben 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}, \pkg{xtemplate} and \needpackage{l3keys2e} which are -part of the \bnd{l3packages}~\cite{bnd:l3packages} bundle, -\pkg{epic}~\cite{pkg:epic}, \pkg{cntformats}~\cite{pkg:cntformats}, and -\pkg{environ}~\cite{pkg:environ}. - +\needpackage{xparse} and \pkg{xtemplate}. \section{How it works} \subsection{The Basics} @@ -272,17 +269,13 @@ following ones that can be set using a setup command: \keyval{style}{instance}\Default Choose the instance to be used. Read more on this in section~\ref{sec:tasks}. - \keyval{counter-format}{counter specs}\Default{tsk[a])} - \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}: \cs*{arabic}, - \code{a}: \cs*{alph}, \code{A}: \cs*{Alph}, \code{r}: \cs*{roman} and - \code{R}: \cs*{Roman}. \keyval{label-format}{code}\Default \changedversion{0.9}Can be used to apply a formatting like, \eg, \cs*{bfseries} to the labels. - \keyval{label}{code}\Default - \changedversion{0.9}Overwrite the automatic label to a custom one. + \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} @@ -353,7 +346,7 @@ following ones that can be set using a setup command: Now the same list as above but with three columns and a different label: \begin{example} - \begin{tasks}[counter-format=(tsk[r]),label-width=4ex](2) + \begin{tasks}[label=(\roman*),label-width=4ex](2) \task \Sample \task \sample\ \sample \task \sample @@ -361,32 +354,25 @@ Now the same list as above but with three columns and a different label: \task \sample\par\sample \end{tasks} \end{example} -% \begin{tasks}[counter-format=(tsk[r]),label-width=4ex](3) -% \task \Sample -% \task \sample\ \sample -% \task \sample -% \task \Sample -% \task \sample\par\sample -% \end{tasks} - -Let's use it inside a question, \ie, inside \ExSheets' \env{question} + +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{ - counter-format = qu.tsk , - item-indent = 2em , - label-width = 2em , - label-offset = 0pt + label = \theexercise.\arabic* , + item-indent = 2em , + label-width = 2em , + label-offset = 0pt } - \begin{question}[type=exam]{4} + \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{question} + \end{exercise} \begin{solution}[print] Now, let's see\ldots\ ah, yes: \begin{tasks} @@ -412,7 +398,7 @@ 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. + % \item[multiplechoice] a --~well~-- `multiple choice' list. \end{description} \begin{example} \begin{tasks}[style=itemize](2) @@ -423,11 +409,11 @@ available: \task that's just how\ldots \task \ldots we expected \end{tasks} - \begin{tasks}[style=multiplechoice](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 @@ -441,28 +427,28 @@ argument of \cs{task}. This will temporarily overwrite the default label. \end{tasks} \end{example} -\section{New Tasks} +\section{New \code{tasks}-like Environments} It is possible to add custom environments that work like the \code{tasks} environment. \begin{commands} - \command{NewTasks}[\oarg{options}\marg{name}\oarg{separator}\darg{cols}] + \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{RenewTasks}[\oarg{options}\marg{name}\oarg{separator}\darg{cols}] - Renew environment previously defined with \cs{NewTasks}. + \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} - \NewTasks{tasks} + \NewTasksEnvironment{tasks} \end{sourcecode} The separator does not have to be a control sequence: \begin{example} % preamble: % \usepackage{dingbat} - \NewTasks[label=\footnotesize\leftthumbsup,label-width=1.3em]{done}[*] + \NewTasksEnvironment[label=\footnotesize\leftthumbsup,label-width=15pt]{done}[*] \begin{done} * First task * Second task @@ -483,7 +469,7 @@ argument. \begin{example} % preamble: % \usepackage{dingbat} - \NewTasks[label=\footnotesize\leftthumbsup,label-width=1.3em]{done}[*] + \NewTasksEnvironment[label=\footnotesize\leftthumbsup,label-width=15pt]{done}[*] \begin{done}(3) * First task * Second task @@ -492,43 +478,8 @@ argument. \end{done} \end{example} -Let's say you want a \env*{multiplechoice} environment that has three columns -in its default state. You could do something like this: -\begin{example} - % preamble: - % \NewTasks[style=multiplechoice]{multiplechoice}[\choice](3) - % \newcommand*\correct{\PrintSolutionsTF{\checkedchoicebox}{\choicebox}} - % - % \PrintSolutionsTF and the {question} environment are provided - % by the ExSheets package - \begin{question} - \begin{multiplechoice} - \choice First choice - \choice Second choice - \choice[\correct] Third choice - \end{multiplechoice} - \end{question} - \begin{solution}[print] - \begin{multiplechoice} - \choice First choice - \choice Second choice - \choice[\correct] Third choice - \end{multiplechoice} - \end{solution} -\end{example} - -The last example shows you two additional commands: -\begin{commands} - \command{choicebox}[\quad\choicebox] - Print an empty square. - \command{checkedchoicebox}[\quad\checkedchoicebox] - Print a crossed-out square. -\end{commands} - - \section{Styling \Tasks} -Equivalent to the styling of \ExSheets\ \Tasks\ uses \pkg{xtemplate} to -declare additional instances for the lists. +\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 @@ -544,10 +495,8 @@ of their usage. \DeclareTemplateInterface{tasks}{default}{3} { % option : type = default - enumerate : boolean = true , - label : tokenlist , + label : tokenlist = \alph*) , indent : length = 2.5em , - counter-format : tokenlist = tsk[a]) , label-format : tokenlist , label-width : length = 1em , label-offset : length = .3333em , @@ -558,24 +507,17 @@ of their usage. \subsubsection{Predefined Instances} This is rather brief this time: \begin{sourcecode} - % ALPHABETIZE: a) b) c) + % alphabetize: a) b) c) \DeclareInstance{tasks}{alphabetize}{default}{} - % available when `load-tasks=true': - % ITEMIZE: - \DeclareInstance{tasks}{itemize}{default} - { - enumerate = false , - label-width = 1.125em - } - % ENUMERATE: - \DeclareInstance{tasks}{enumerate}{default} - { counter-format = tsk. } - % MULTIPLECHOICE: - \DeclareInstance{tasks}{multiplechoice}{default} + % itemize + \DeclareInstance {tasks} {itemize} {default} { - enumerate = false , - label = \choicebox , + label-width = 1.125em , + label = \labelitemi } + % enumerate: + \DeclareInstance {tasks} {enumerate} {default} + { label = \arabic*. } \end{sourcecode} \end{document} -- cgit v1.2.3