New LaTeX (and more) to PreTeXt conversions: testing requests

14 views
Skip to first unread message

Oscar Levin

unread,
Jul 15, 2026, 3:52:49 PMJul 15
to PreTeXt development
With the help of Rob's assistant, I have refactored the pandoc custom writer that can be used to convert pretty much any document into pretext.  Preliminary testing seems very promising (for example, converting pandoc's own manual from markdown to pretext results in a document with zero schema violations; previously there were hundreds).

If you would like to try this out on your favorite latex or markdown or MS Word document, you can do so very easily with the pretext-tools extension for VSCode, or run pandoc directly following the directions here: https://github.com/oscarlevin/pandoc-pretext

There is another new way to convert latex (and markdown) to pretext as well: you paste in and select a number of lines of latex in a pretext document and then select the "PreTeXt: Convert to pretext" in VSCode, and it should do a pretty good job (thanks to the unified-latex-to-pretext project from Jason S.).  This is also built into the editor at pretext.plus if you want to try it out without downloading anything.

Any feedback you all have would be greatly appreciated. 

Rob Beezer

unread,
Jul 16, 2026, 1:20:53 PMJul 16
to prete...@googlegroups.com
I took this for a drive, once I got pandoc v3.0 installed properly.

I have a chapter from a commercially-published computer science textbook that
was given to me by the publisher to test. So unfortunately I cannot post
anything here, nor should I be feeding it to AI, I think. It is in RTF format,
so I *can* feed it to pandoc.

It is pretty technical material, grammars and parse trees. Lots of verbatim
text and program listings. And images of more complicated technical items. So
it was a challenge for the conversion, but perhaps understandably so.

* Result (120K of PreTeXt) passed validation with no errors.

* Overall chapter title was inside #intoduction as
p
ol
li
p
Title text here

* Seems every #p has its entire contents wrapped in a #term. Likely some font
signal from the RTF to pandoc? Same for some #caption.

* Many instances of #pre material were done accurately.

* Most #program ended up being a bunch of #c, one per source line, but with
linebreaks as comments, so all run together in PreTeXt.

* A list in the original was set 100% in italics, I think because it was really
a #definition. That became #li correctly but set as #term with #em immediately
inside (due to becoming #p).

* Little indication of an #image, other than sometimes an empty Figure apparent
as a (hard-coded) number and caption.

Verdict: this did a good job of catching most of the text nodes, and would
likely prove to be a very good head-start towards a conversion. Maybe an AI
pass could clean up some consistent misinterpretations (#term on #p, #program as
a sequence of #c, missing #image). I built a PDF. It was readable, except that
it was all bold (#term) which got old fast. Much of the technical material was
so poorly formatted it wasn't really readable (the run-on sequences of #c).

Obviously, something less technical, or something with better structure (LaTeX),
would go better.

Thanks, Oscar! Great progress.
> --
> 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/9453f512-5830-4912-8422-b731b017c2f2n%40googlegroups.com <https://
> groups.google.com/d/msgid/pretext-dev/9453f512-5830-4912-8422-
> b731b017c2f2n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Reply all
Reply to author
Forward
0 new messages