Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent behavior of task and subtask #189

Closed
cvoelcker opened this issue May 21, 2020 · 2 comments
Closed

Inconsistent behavior of task and subtask #189

cvoelcker opened this issue May 21, 2020 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@cvoelcker
Copy link

\begin{task}[credit=5 + 6 + 3 + 6]{Linear Algebra Refresher}
\begin{subtask}[credit=5,title=Matrix Properties]

The code above is derived from the current documentation and works. This is slightly difficult to work with, since you have to remember two formats for specifying titles and exercises. Is it possible to have:

\begin{task}[credit=5 + 6 + 3 + 6]{Linear Algebra Refresher}
\begin{subtask}[credit=5]{Matrix Properties}

work in an identical fashion to keep the format consistent? Currently, the title of subtaks is not rendered when the environment is set up this way.

This is probably related to recent fixes due to #176 .

@TeXhackse
Copy link
Collaborator

This is not directly related to the other issue. It as been the case since the first Version.

If you don't use an the Syntax of = inside the optional argument for the subtask it was always be different.

An option would be to add a second optional argument, like

\begin{subtask}[credit=x][title]

but this would lead to an issue if there is only one argument.
That's why I chose to create it that way.
To have the complete identical Syntax for both, would also be annoying for some, because in most cases (as far as I saw it) subtasks won't get a title.

What I can offer, is the possibility of making the task to use both variants

\begin{task}[credit=5 + 6 + 3 + 6,title={Linear Algebra Refresher}]{}

would be identical to


\begin{task}[credit=5 + 6 + 3 + 6]{Linear Algebra Refresher}

With a bit more effort, even with the removal of the empty group. But this might also confuse users.

The only possibility to get everything working would be to require the title but make a variant without a title as well. I will think about this, though I would not really like to change the default, but add a
subtask* which required the title...

@TeXhackse TeXhackse added the enhancement New feature or request label May 29, 2020
@TeXhackse
Copy link
Collaborator

I thought about this, and I still think in general it is not a good idea to enforce titles for subtasks. But you can workaround this for personal use:

\ExplSyntaxOn
\makeatletter
\NewDocumentEnvironment{mysubtask}{om}{
	\IfNoValueF{#1}{
		\keys_set:nn {TUDa/subtask} {#1}
	}
	\@subtask{#2}
}{}
\makeatother
\ExplSyntaxOff

This would define an extra environmet. Alternatively you could redefine subtask, replacing the first line of the Definition by \RenewDocumentEnvironment{subtask}{om}{.

@TeXhackse TeXhackse added this to the v3.0 milestone Sep 8, 2020
TeXhackse added a commit that referenced this issue Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants