Re: pytex: a tex engine written in python
Junling Ma <[email protected]> Mon, 13 Jul 2026 11:07:16 -0700
| Newsgroups | gmane.comp.tex.texhax |
|---|---|
| Message-ID | <[email protected]> |
Hi Joseph, Thanks for the prompt feedback. Yes accessible PDF is currently not = supported, as neither xetex nor pdftex supports them. We may implement = the support by implementing necessary latex primitives, as we use = reportLab under the hood for generating PDF files, and that package = supports accessible PDFs. But that might take a long time to be = implemented, as I am a one-person team currently. For \XeTeXinterchartoks, It is not actually difficult to implement it. = Yet, it seems to me that the purpose is to expose complex opentype = kern/ligature programs beyond TFM capabilities. I would prefer implement = what latex does, feed chunks of glyphs to the font=E2=80=99s = kern/ligature programs until the program ends. Then we consider the = resulting nodes as a single glyph and append it to the list. Unless you = need specific controls, e.g., for fonts that do not support these = Ker/ligature programs, maybe? The latter can be done in this engine = fairly easily. Maybe I misunderstood the purpose of the interchar class = mechanisms in XeTeX? Best, Junling > On Jul 13, 2026, at 3:30=E2=80=AFAM, Joseph Wright <[email protected]> = wrote: >=20 > On 13/07/2026 08:15, Junling Ma wrote: >> Hi all, >> I've been working (with plenty of help from Codex) on a very = preliminary TeX engine in Python called pytex, currently available on = GitHub at roverrobot/pytex. It is built around a modular architecture to = make it easier to extend in areas such as safe \write18 support, = \special handling, font handling, and additional output backends such as = HTML and DOCX. It supports Unicode out of the box. The parser itself = supports incremental parsing and introspection, so it can be = incorporated into other tools. In addition, the architecture is intended = to support concurrent parser instances (more work is needed though). >> The current focus is compatibility with existing TeX/LaTeX documents = rather than performance. At the moment, it implements enough of pdfTeX = and XeTeX to run the LaTeX2=CE=B5 engine, and it can produce DVI, XDV, = PDF, SVG, HTML, and DOCX output. Since this is still at a very early = stage, it is quite slow, does not yet support the TeX format dump files = (it uses a compressed JSON format instead), does not support = bidirectional text, and currently requires an existing TeX Live = installation. I'm also sure there are many bugs and missing features. My = hope, however, is that the overall architecture is flexible enough to = make future extensions straightforward. >> If you're interested, I'd be very grateful for feedback. You are also = very welcome to contribute. >> Best, >> Junling Ma >=20 > Hello Junling, >=20 > Looks interesting. With XeTeX essentially unmaintained, this could be = a path for users to migrate to something with updates possible (though = accessible PDFs likely remain more realistic with LuaTeX). Have you = considered adding \XeTeXinterchartoks support? >=20 > Regards, >=20 > Joseph