cgnieder / tasks Goto Github PK
View Code? Open in Web Editor NEWLaTeX package for columned lists filled horizontally.
LaTeX package for columned lists filled horizontally.
By default, the decimal separator of the tasks package is the period. In French, it is the comma. How to make the following code display a comma while keeping the period in the source code?
In other words, the following code
\documentclass{article}
\usepackage{tasks}
\usepackage[french]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
\begin{tasks}[item-format=\ensuremath](1)
\task 0.6\times0.7=0.42
\task 0.05\times0.1=0.005
\task 0.07\times0.08=0.0056
\end{tasks}
\end{document}
looks like this:
and not as this:
Same question on https://tex.stackexchange.com here:
[How to modify the decimal separator of the tasks package?](https://tex.stackexchange.com/q/686861/138900)
On of the motivations of creating the tasks packages seems to be (from the manual):
The reason for the 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 tasks primarily is for. If you don’t need this feature
you’re better off using traditional LATEX lists and the enumitem package for customization.
Now such exercises often consist of only math formulas (for example calculating some integrals or derivatives) without text. Then you have to enter mathmode for every task. With regard to the quoted aim of the package, I think it would be a good idea to have an option such that the whole task environment operates in mathmode (similar as you can have matrices of math nodes in tikz).
Here is an example of a similar environment called brqalign, which was created by David Carlisle in response of one of my questions:
In #5 a \strut
was added to ensure even spacing, but this strut is wrong if for some reason the task ends in a \par
. In such a case a strut will generate a full extra line!
One should probably check for hmode and insert the strut only then, or if in vmode only add a vertical space of the difference between a s strut decender and \prevdepth
.
The second list has an unexpected linebreak (\large
seems to be necessary for reproducing the issue...)
\documentclass{article}
\usepackage[textwidth=18cm]{geometry}
\usepackage{tasks}
\begin{document}
\large
\fbox{%
\begin{minipage}{15cm}
\begin{tasks}(3)
\task sadf
\task asdf
\task adsf
\end{tasks}
\end{minipage}}
\fbox{%
\begin{minipage}{16cm}
\begin{tasks}(3)
\task sadf
\task asdf
\task adsf
\end{tasks}
\end{minipage}}
\fbox{%
\begin{minipage}{17cm}
\begin{tasks}(3)
\task sadf
\task asdf
\task adsf
\end{tasks}
\end{minipage}}
\end{document}
´´´
Do I misunderstand something or is center not working?
\documentclass{article}
\pagestyle{empty}
\setlength\textwidth{250.0pt}
\usepackage{tasks}
\settasks{debug,label-width=3pc,item-indent=4pc}
\begin{document}
\begin{tasks}[label-align=left](3)
\task One \task Two \task Go
\task \dotfill \task* \dotfill \end{tasks}
\begin{tasks}[label-align=center](3)
\task One \task Two \task Go
\task \dotfill \task* \dotfill \end{tasks}
\begin{tasks}[label-align=right](3)
\task One \task Two \task Go
\task \dotfill \task* \dotfill \end{tasks}
\end{document}
Gives me
I am referring to issue #23 which fixed the behavior of counting custom labels. I use custom labels to replace empty checkboxes with checked checkboxes in xsim solutions. Here's the code snippet I use for my multiple choice questions:
% Multiple choice
\NewTasksEnvironment[label=\faSquareO~\Alph*), label-width=27pt]{choices}[\choice]
\newcommand*\correct{\IfInsideSolutionTF{\StrSubstitute{\thetask}{\faSquareO}{\faCheckSquareO}}{\thetask}}
So, for example I have tasks A) B) C) D) from which B and C are correct (\choice[\correct]
). With the current version 1.3a this results in the labeling: A) A) A) B) because B and C would get a custom label.
To allow such a use case I suggest adding the option "count-custom-labels". I forked the project and added this option. Is this something you would like to see in the package / do you accept pull requests? Link to the commit: Commit 0a5265d. Note that I just started getting into the expl3 syntax, the code would be cleaner if there's a possibility to combine the two if statements using logical operators?!
A possibly common use case is to start a new row of tasks. Right now this can be achieved with
... \task*[] % ensure that the row ends
\task bla bla \task more bla bla
but this doesn't seem to be really nice. Instead
\task!(1) bla bla
\task more bla bla
start a new row and do a one column task.
I'm using the setting \settasks{counter-format=(tsk[a])}
to use the task labels (a), (b), (c), ...
But if I have more that 26 tasks, so it would have to go past (z), I get an error
./main.tex:251: Undefined control sequence.
\GenericError ...
#4 \errhelp \@err@ ...
l.251 \end{tasks}
I'm not sure what should come after (z), but I can't imagine it should result in a compile error.
As the title says can't break a page inside tasks
:
\documentclass{article}
\usepackage{tasks}
\begin{document}
\begin{tasks}
\task Foo
\newpage
\task Bar
\end{tasks}
\end{document}
Expected result: two pages.
I use the tasks package to write a book where I have a lot of enums. The experience with the package has been very good so far.
The case is that I changed my OS from Mint to Ubuntu, 20.04.3 LTS, 64 bits, GNOME 3.36.8 and now the new compilations produce from the task environment an output in which the rows of the lists overlap each other, I want say: they are mounted on top of each other.
I have searched for a solution in Google and I have not found it.
While trying to answer this question using the tasks
package, I encountered a possible incompatibility between the tasks
package and the babel
package with the greek
option. The following MWE compiles perfectly fine if the second line is commented out, but yields a bunch or error messages if commented in:
\documentclass{article}
\usepackage[greek]{babel}
\usepackage{tasks}
\begin{document}
\begin{tasks}(2)
\task
\task
\end{tasks}
\end{document}
Excerpt of the log file:
! Use of \\SaveCounterPatternFrom doesn't match its definition.
\@ifnextchar ... \reserved@d =#1\def \reserved@a {
#2}\def \reserved@b {#3}\f...
l.8 \end{tasks}
If you say, e.g., `\def\a1{...}', then you must always
put `1' after `\a', since control sequence names are
made up of letters only. The macro here has not been
followed by the required stuff, so I'm ignoring it.
! Argument of \@firstoftwo has an extra }.
<inserted text>
\par
l.8 \end{tasks}
I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.
Runaway argument?
! Paragraph ended before \@firstoftwo was complete.
<to be read again>
\par
l.8 \end{tasks}
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.
LaTeX Info: Redefining \anw@print on input line 8.
! Extra }, or forgotten \endgroup.
<argument> ...\@currentlabel {\l__tasks_label_tl }
l.8 \end{tasks}
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.
LaTeX Info: Redefining \anw@print on input line 8.
Overfull \hbox (0.83313pt too wide) in paragraph at lines 8--8
|\LGR/cmr/m/n/10 aþ)
[]
! Use of \\SaveCounterPatternFrom doesn't match its definition.
\@ifnextchar ... \reserved@d =#1\def \reserved@a {
#2}\def \reserved@b {#3}\f...
l.8 \end{tasks}
If you say, e.g., `\def\a1{...}', then you must always
put `1' after `\a', since control sequence names are
made up of letters only. The macro here has not been
followed by the required stuff, so I'm ignoring it.
! Argument of \@firstoftwo has an extra }.
<inserted text>
\par
l.8 \end{tasks}
I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.
Runaway argument?
! Paragraph ended before \@firstoftwo was complete.
<to be read again>
\par
l.8 \end{tasks}
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.
LaTeX Info: Redefining \anw@print on input line 8.
! Extra }, or forgotten \endgroup.
<argument> ...\@currentlabel {\l__tasks_label_tl }
l.8 \end{tasks}
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.
LaTeX Info: Redefining \anw@print on input line 8.
Overfull \hbox (0.83313pt too wide) in paragraph at lines 8--8
|\LGR/cmr/m/n/10 bþ)
[]
Overfull \hbox (5.83191pt too wide) in paragraph at lines 8--8
[] \LGR/cmr/m/n/10 þ) []
[]
It seems that tasks cannot compute the right width for the tasks with beamer when aspectratio=169 is in effect. - egreg Oct 19 '16 at 14:05
\documentclass[aspectratio=169]{beamer}
\usetheme{Berkeley}
\usepackage{tasks}
\begin{document}
\begin{frame}
\transwipe
1.Which one you want to choose?
\begin{tasks}[counter-format=tsk[A].,debug=true](4)
\task A
\task B
\task C
\task D
\end{tasks}
\end{frame}
\end{document}
In the new version v1.0 the multiple choice style are removed. So my template are broken (it's no problem, i can fix that). Although xsim has the support for multiple choice questions, but not completely like tasks.
So..my questions ist: can you add the multiple choice style to tasks again (or add it to xsim)?
I think that the multiple choice style is useful, especially when you don't use xsim.
Thank you for your work. We use your packages (xsim&tasks) for our exercises in our school (hhgym.de) and love it!
P.S. Why you have removed the multiple choice lists in tasks?
\documentclass[12pt,a4paper]{article}
\usepackage{tasks}
\NewTasksEnvironment[%
style=itemize,%
label-offset=1.45ex,%
label-align=right,%
label-width=1ex,%
item-indent=2.45ex,%
column-sep=2ex,%
before-skip=4ex,% No effect!
after-skip=4ex,%
after-item-skip=0ex]{Itemize}[\item](2)
\parindent=0pt
\begin{document}
Before tasks environment.
\begin{Itemize}
\item Hello
\item World
\item Hello
\item World
\end{Itemize}
After tasks environment. ``before-skip=4ex'' has no effect!
\end{document}
Answering a help request on SX and some subsequent email discussion I came across this set of issues:
\documentclass{article}
\usepackage{tasks}
% case
% 0 strange warning message
% 1 results in error
% 2 only this seems to work
\ifcase 0
\settasks{
counter-format =(tsk[A]),
label-format=\bfseries,
label-offset=1em,
label-align=right,
}
\or
\settasks{
label =(\Alph*),
label-format=\bfseries,
label-offset=1em,
label-align=right,
}
\or
\settasks{
label =\textbf{(\Alph*)},
%label-format=\bfseries,
label-offset=1em,
label-align=right,
}
\fi
\begin{document}
%First question below
$v \cdot 3uv^{-2}$
\begin{tasks}(2)
\task $8u^3v$
\task $3u^5v^3$
\task $\displaystyle\frac{3u}{v}$
\task $3u^3v^3$
\end{tasks}
\end{document}
In case 0 you get this error:
Package tasks Warning: You've tried setting option `counter-format' on line
(tasks) 17. However, option `counter-format' is deprecated.
(tasks) Please use option `' instead. Refer to the manual for
(tasks) details.
Not really helpful :-) as it is missing the new option name
Case 1 is more problematic, here we get
./counter-format deprecated error.tex:26: LaTeX Error: Missing \begin{document}
.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.26 }
?
Seems that label-format
is broken as without it (case 2) it works
See this comment by jashandeep-sohi on issue #2:
There was also an issue with inconsistent spacing between items if you mix single line items and multi-line items:
\begin{tasks}[style=itemize, debug, after-item-skip=0] \task T \task T \task T\\T \task T \task T \end{tasks}
As detailed in https://tex.stackexchange.com/questions/584249/issue-with-recent-version-of-tasks-and-numbering
The behaviour of \task[]
has changed, it now produces an unlabeled task, however it increases a step in the enumeration.
\documentclass{article}
\usepackage{tasks}
\settasks{
%debug,
style=enumerate,
label-format=\bfseries,
label-align=right,
label-width=21pt,
label-offset=6pt,
item-indent=27pt,
column-sep=0.5em,}
\begin{document}
\begin{tasks}(2)
\task[] Not numbered
\task[] Not numbered
\task This used to be numbered 1
\task[] Not numbered
\task This used to be numbered 2
\task[] Not numbered
\task This used to be numbered 3
\task[] Not numbered
\end{tasks}
\end{document}
Please check on page 9 the text before the last tcolorbox:
current: Now the same list as above but with three columns and a different label:
correct: ...with two columns ...
When set vertical skips before-skip
, after-skip
and after-item-skip
to be 0pt
, these skips seem not precisely 0pt
.
Compared with this, when load the package enumitem
with option nosep
, the vertical skips between items of enumerate
are the same with normal main text.
The following is my code.
\documentclass{article}
\usepackage{enumitem,tasks}
\setlist{nosep,leftmargin=*}
\settasks{before-skip=0pt,after-skip=0pt,after-item-skip=0pt}
\begin{document}
\parindent0pt
\fbox{some text}\\
\fbox{some text}
\begin{enumerate}
\item \fbox{item~1}
\item \fbox{item~2}
\end{enumerate}
\fbox{some text}
\begin{tasks}
\task \fbox{item~1}
\task \fbox{item~2}
\end{tasks}
\fbox{some text}
\end{document}
I've discovered the nice tasks package recently and began playing with it. However the
column-sep key appears to be undefined, albeit it is documented. Will it be added soon?
Best regards,
B. Alfonsi
Use of \thetask in the tasks environment is messed up in the latest version 1.3a, as illustrated in the attached minimal example. With previous version 1.3 the example works just fine.
brokentasks.pdf
\documentclass{article}
\usepackage{tasks}
\newif\ifshowanswers
\showanswersfalse
\showanswerstrue% comment this out if you do not want to show correct answers
\newcommand{\correct}{%
\ifshowanswers
{\bfseries\thetask}
\else
\thetask
\fi
}
\begin {document}
A tricky question follows:
\begin{tasks}(1)%
%
\task[\correct] Correct answer 1.
\task Wrong answer 1.
\task Wrong answer 2.
\task Wrong answer 3.
\task[\correct] Correct answer 2.
%
\end{tasks}
\end{document}
Using \NewTasksEnvironment[label={\alph*) (T/F):},indent=3cm]{tftasks}
results in an error:
LaTeX3 Error: The key 'tasks/list/indent' is unknown and is being ignored.
Having an environment like align*
or even your own blank in a separate line of the task, the next task moves away an additional line.
\documentclass{article}
\usepackage{amsmath}
\usepackage{xsim}
\usepackage{tasks}
\begin{document}
\begin{tasks}
\task normal Space after that
\task HUGE gap after \begin{align*}
3
\end{align*}
\task works fine with blank in line \blank{a}
\task filler
\task messes with blank in separate line
\blank{line}
\task filler
\end{tasks}
\end{document}
See: https://tex.stackexchange.com/q/455050/8323
The problem comes from the exclamation mark. Babel package (which is a "should use" package for french writing people) modify how the exclamation mark interacts...
This simple input file:
\documentclass[11pt, a4paper]{article}
\usepackage{exsheets}
\usepackage[detect-all=true]{siunitx}
\usepackage[version=3]{mhchem}
\begin{document}
\begin{question}{2}
$c_\ce{Cu} = \SI{386}{J/(kg.K)}$
\end{question}
\end{document}
gives me this weird error, that I honestly can't figure out.
It turns out that the following modification $c_{\ce{Cu}} = \SI{386}{J/(kg.K)}$
instead compiles fine, probably pointing out to some quarrel between tasks.sty
and mhchem
?
Another clue: this line $c_\text{Cu} = \SI{386}{J/(kg.K)}$
also compiles fine.
It is not so crucial, but I'm reporting as a reference in case someone gets crazy on it like me before isolating the culprit...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.