mathematical expressions as tasks

11 views
Skip to first unread message

Michael Shulman

unread,
Jan 12, 2026, 12:46:32 PM (14 days ago) Jan 12
to pretext...@googlegroups.com

"It is common to make lists of expressions, equations, or identities. ... In these situations, author a list item, <li>, within an <ol> or <ul>, by using only the necessary <m> element. Do not use an intervening <p>, and do not include any adjacent text. Whitespace is OK. Then PreTeXt will add LaTeX’s \displaystyle command to improve the visual appearance of the mathematics"

I think this is a great behavior, and I was wondering if it could be extended somehow to <task>s in exercises, which are rendered to the user like a list, and may also sometimes be lists of expressions, equations, or identities, such as with an introduction like "find the derivatives of the following functions"?

--
Michael Shulman
University of San Diego

"The role of the intellectual cannot be to excuse the violence of one
side and condemn that of the other."
        -- Albert Camus

Alex Jordan

unread,
Jan 12, 2026, 1:08:10 PM (14 days ago) Jan 12
to pretext...@googlegroups.com
Is the "find the derivatives of the following functions" (or similar thing) happening inside an #exercises? If it is, the more common way to do that would be to use an #exercisegroup, with an #intorduction and perhaps a @cols, and then #exercise children. Rather than one #exercise with #task children.

This is just to check whether #exercisegroup could meet your need before thinking harder. OK, I'll think a little harder. A #task could have an #answer. If it does, the #task needs to be structured with a #statement. And then your #m is a child of the #statement. So there'd be a messiness in the code to checking (a) a #task that only has #m and (b) a #task/statement that only has #m. Just a first observation.

 

--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-support/CADYavpznAU%3D7SBvxxLKeNaR-%2BPLx%3DGP9BUHoOec4tV%3DC5KWHWg%40mail.gmail.com.

Rob Beezer

unread,
Jan 12, 2026, 5:09:54 PM (14 days ago) Jan 12
to pretext...@googlegroups.com
> Why do you say nested cases environments would be too much?

What David said, and yes to "mean that it would be too much work to detect
nested cases and they're likely to be rare".

Too rare to add in the necessarily complicated code. Trade-off is not worth the
maintenance costs. Just because we *can* do sometnhing does not always mean we
*should*.

I've never used {multiline}. MathJax 4 (pending) will have some line-breaking
features. Not sure if we will use them. Is the solution identical to that for
{cases}? It'd be a way to test moving to a list of environments, rather than one.

> (Side note: the link to "Supported LaTeX commands" at
https://pretextbook.org/doc/guide/html/overview-math.html is broken.)

Thanks - that's on MathJax. I'll fix it.

Rob


Rob Beezer

unread,
Jan 12, 2026, 5:16:49 PM (14 days ago) Jan 12
to pretext...@googlegroups.com
(This one *does* belong on this thread. :-( )

> I was wondering if it could be extended somehow

That one was quite complicated already, and recently I regretted doing it (I
forget just why, it was in the way of something).

Exercises are complicated, and tasks a bit more so.

So I think this is another place where we may already being a bit too clever.

Alex Jordan

unread,
Jan 12, 2026, 5:41:50 PM (14 days ago) Jan 12
to pretext...@googlegroups.com
Note that if you have nested cases, you can still put \text{.} directly into the LaTeX source somewhere and leave a period off the end. It is not elegant. But if it's important in a special place, it can be done.

While I'm here... there is currently no way to do these:
without using #m and \begin{aligned} or \begin{alignedat}. Desired features are overall left alignment and a big left brace. Internal alignment of equations optional (not used in that example). In the off chance people are thinking about XML markup for multiline math expressions, these are things to think about. Maybe they could be realized as #md, with appropriate attributes. But I digress...






--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.

Rob Beezer

unread,
Jan 12, 2026, 5:50:42 PM (14 days ago) Jan 12
to pretext...@googlegroups.com
On 1/12/26 14:41, Alex Jordan wrote:
> Note that if you have nested cases, you can still put \text{.} directly into the
> LaTeX source somewhere and leave a period off the end. It is not elegant. But if
> it's important in a special place, it can be done.

And the the end-of-sentence is hidden from us when we try to do things like
braille formatting. :-(
Reply all
Reply to author
Forward
0 new messages