ordering of #answer and #solution

7 views
Skip to first unread message

David Austin

unread,
Jul 28, 2026, 8:32:02 AM (3 days ago) Jul 28
to prete...@googlegroups.com
In cleaning up the ULA source, I found that the schema enforces an ordering of #answer and #solution elements inside a #task.  So the following is valid:

<task>
  <answer> .. </answer>
  <solution> .. </solution>
</task>

but 

<task>
  <solution> .. </solution>
  <answer> .. </answer>
</task>

is not.  It felt more natural to me to write solutions and then append shorter answers so I'm wondering if this is intentional.  My assistant says the order doesn't affect processing. I can easily fix the 386 (!) violations, but I'm wondering about newer authors who may be confused since the validation report just says that 'element "answer" not allowed here.'

David

David Austin

unread,
Jul 28, 2026, 8:41:17 AM (3 days ago) Jul 28
to PreTeXt development
Similarly, a #caption must come before #image inside a #figure.  ULA has 260 violations from the ordering requirement!  

Oscar Levin

unread,
9:36 AM (1 hour ago) 9:36 AM
to prete...@googlegroups.com
This should be a relatively easy change in the schema, assuming there isn't a semantics or code reason to keep enforcing this.

Rob, would you like a PR?

--
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/f8f981b0-21a5-4177-949b-af5d437c1a4dn%40googlegroups.com.

Rob Beezer

unread,
10:36 AM (28 minutes ago) 10:36 AM
to prete...@googlegroups.com
Sorry, meant to reply to this sooner. hint -> answer -> solution is a
progression I want to enforce.

#hint: Bring a towel.

#answer: 42.

#solution: Read the classic nerd literature.

These should always render in this order (if not, there needs to be a code
change), so authors should be in the habit of authoring them in this order. And
they should be using the schema *early* and alerted to this then.

Now, out of the other side of my mouth, #caption is metadata(-ish), like #title.
Killed on sight and we decide where it needs to go. Maybe below #figure
contents, maybe not.

So everything here is as intended. And now, your assistant should make short
work of whipping your source into shape. ;-)

A lot of work is going into the holes in the schema, so expect more of this in
the days ahead.

Rob
> email to pretext-dev...@googlegroups.com <mailto:pretext-
> dev+uns...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/
> f8f981b0-21a5-4177-949b-af5d437c1a4dn%40googlegroups.com <https://
> groups.google.com/d/msgid/pretext-dev/f8f981b0-21a5-4177-949b-
> af5d437c1a4dn%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> 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 <mailto:pretext-
> dev+uns...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/
> CAOU9BaUh-6EyH-K7dkXtsb%2BGsBrM3c4rsbhnSRnSB%2B%2BtsVJQEA%40mail.gmail.com
> <https://groups.google.com/d/msgid/pretext-dev/CAOU9BaUh-6EyH-
> K7dkXtsb%2BGsBrM3c4rsbhnSRnSB%2B%2BtsVJQEA%40mail.gmail.com?
> utm_medium=email&utm_source=footer>.

Reply all
Reply to author
Forward
0 new messages