Re: [PATCH v2] [eqn]: Use XML character references in MathML output.

Nguyễn Gia Phong via discussion of the GNU roff typesetting system and related software <[email protected]> Mon, 08 Jun 2026 10:20:46 +0900
Newsgroups gmane.comp.printing.groff.general
Message-ID <[email protected]>
On 2026-04-29 at 17:31+09:00, Nguyễn Gia Phong wrote:
> On 2026-04-28 at 22:28-05:00, G. Branden Robinson wrote:
> > On 2026-03-26 at 13:48+09:00, Nguyễn Gia Phong wrote:
> > > XML only defines four entities (< > & ") out of the box,
> > > others need to be declared in the document's DOCTYPE.
> > > For web feeds such as RSS and Atom, is is particularly cumbersome
> > > to define the math entities as these feeds are supposed
> > > to be stand-alone and thus the entity definitions have to be inlined.
> > >
> > > Therefore, character references are now used
> > > instead of entity references, making the MathML output
> > > directly embeddable into these feeds.  The entity table
> > > is no longer used and thus removed.
> > >
> > > * src/preproc/eqn/text.cpp: Remove struct map, entity_table,
> > >   and special_to_entity.  Include "unicode.h" header file.
> > >   (special_char_box::output): Instead of named entity reference,
> > >   print XML character reference with Unicode codepoint for MathML.
> > >   Add support for Unicode code sequence as an input character.
> > >
> > > References: https://www.w3.org/TR/REC-xml/#sec-references
> >
> > if I understand your analysis correctly, you're probably
> > on the right track: the special character rewriting table
> > that GNU eqn uses for MathML mode is flat wrong, [so] copying
> > or reusing the one for troff output.
>
> I'm not claiming it is flat wrong or buggy, but rather
> it has a rather limited usefulness, as the generated MathML
> *cannot* be embedded in web feeds.
>
> I assume that very few people make use of the MathML output,
> hence many problems remain undetected.

Gentle ping, I'm very much anticipating this patch to be applied
in the upcoming 1.25 release!
signature.asc (application/pgp-signature, 248 B)
-----BEGIN PGP SIGNATURE-----

iIQEABYKACwWIQSDiv4NVdwHTjYPlDqEtpzm8/a3ZwUCaiYY8A4cY254QGxvYW5n
Lm5ldAAKCRCEtpzm8/a3Z+LnAP91+q08fzVVAoh8MHZEuRy8Vd2eL0JOB0+9pZCw
8LpVbAD/UI3u/F/Q6Uw5c+IefthQERignX72/WjrjaoCA/8YmwA=
=K2Y7
-----END PGP SIGNATURE-----