LaTeX macros in WeBWorK exercise group introduction

6 views
Skip to first unread message

Sean Fitzpatrick

unread,
Sep 24, 2025, 10:55:26 AM (3 days ago) Sep 24
to PreTeXt development
Probably for Alex: it appears that LaTeX macros are not being loaded when you activate a WeBWorK exercise from an exercise group that has math in the introduction.

Here is an example: Exercise 2.1.3.33

When we activate the exercise, we copy over the introduction to become part of the exercise. Macros within the statement of the exercise are rendering fine, but not those in the introduction.

Actually, it's a bit weird: it is processing some macros, but not others.

In source, I have <m>\gp(x)</m>, and \gp is defined as g\primeskip ', where \primeskip is defined as \hskip0.75pt.

So \gp is being translated to g\primeskip', but the \primeskip command is not being translated. It works fine in the main text.

Rob Beezer

unread,
Sep 24, 2025, 11:22:52 AM (3 days ago) Sep 24
to prete...@googlegroups.com
Chaining those macros may be confusing WW's selective loading of macros. Try a one-shot definition as a workaround?

We don't implement a complete LaTeX parser in XSL. ;-)

This is changing some, or maybe a PR, or may be under discussion.

Rob

On September 24, 2025 4:55:26 PM GMT+02:00, Sean Fitzpatrick <dsfitz...@gmail.com> wrote:
>Probably for Alex: it appears that LaTeX macros are not being loaded when
>you activate a WeBWorK exercise from an exercise group that has math in the
>introduction.
>
>Here is an example: Exercise 2.1.3.33
><https://opentext.uleth.ca/apex-calculus/sec_derivative.html#ex-deriv-intro-graph-interpret-1>

Alex Jordan

unread,
Sep 24, 2025, 11:28:59 AM (3 days ago) Sep 24
to prete...@googlegroups.com
I'm heading in to teach all day, but I can guess what this is. And I think Rob has it right. We can recognize that the exercise uses \gp and toss in its definition. But here it turns out that its definition then makes use of some other custom macro, and we're not recursively probing for that kind of thing.

And yes, there is an open PR that would get past this, among other things. As submitted, the PR works, but could be made nicer. I haven't been able to circle back and make it nicer.

--
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDAxMi5iZWV6ZXI.1758727369%40pnsh.

Sean Fitzpatrick

unread,
Sep 24, 2025, 2:06:57 PM (3 days ago) Sep 24
to PreTeXt development
Thanks, both. It shouldn't be hard to sanitize the macros in APEX so there are no macros depending on macros.
Reply all
Reply to author
Forward
0 new messages