Math in xref by title

Skip to first unread message

Jeremy Sylvestre

Aug 30, 2022, 12:50:08 PM8/30/22
to PreTeXt support
I've got a case of
<xref ... text="title" />
where the referenced title contains math but the math isn't being rendered in the xref text.

See here:

Document was built using commit be05756b.

(Probably my title shouldn't contain math at all in this specific case, but these are just in-class activities for a course that will likely never be taught again due to program changes, so my editor hat isn't going to get much use here.)

David Farmer

Aug 30, 2022, 12:52:30 PM8/30/22
to PreTeXt support

Looks like it is missing its span.process-math .
> --
> 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
> To view this discussion on the web visit
> .

Rob Beezer

Sep 19, 2022, 8:17:02 PM9/19/22
Dear Jeremy,

Thanks very much for the report. Timing was bad on my end, and a preliminary
inspection suggested this was going to take some digging. And it did.

Text for the clickable part of a cross-reference was being assumed to be all
text, no HTML elements (very old code, a rookie mistake). So as David suggested
the new "span" alerting MathJax was being built and then dropped. One such
example has always been in the sample article, which nobody had noticed. (Look
now, since it may be a few hours before I update it.)

Worse, *any* formatting in the clickable of a cross-reference was getting
dropped. So, a PreTeXt "em" in a title creates an HTML "span.emphasis" that was
not surving into an "xref" by the title. Sample article now has such an example.

Merged now. Website update soon. Confirmation for your project would be
welcome (perhaps on the next CLI update?). Thanks again.

Reply all
Reply to author
0 new messages