pretext-tools extension

37 views
Skip to first unread message

David Austin

unread,
Jul 20, 2026, 7:22:30 AM (9 days ago) Jul 20
to pretext...@googlegroups.com
I eagerly reopened an old codespace to try out the new pretext-tools extension and the live preview feature.  I got this error message:

The instant preview needs a Node.js runtime with WebAssembly JSPI, and "node" does not provide one. Install Node.js 22 or later, or point the "pretext-tools.instantPreview.nodePath" setting at one.

I started a new codespace and found the same error.  Running "node -v" in both codespaces gives v22.23.1.  Claude suggested editing the setting pretext-tools.instantPreview.nodePath based on the results of "which node", which I did without success.  It then suggested 
node -e "console.log(typeof WebAssembly.Suspending)"
which returned "undefined".  It next suggested updating node to version 24, but nvm is not installed so I decided to post here.

Unrelated, but the "Format PreTeXt" button in PreTeXt.Plus has been a really useful feature for new authors I've been working with, but I couldn't find that option inside the codespace.  Perhaps that could be added to the pretext-tools menu (or someone could point me to where it already exists!).

Thanks for your work on this, Oscar!

David

Mitch Keller

unread,
Jul 20, 2026, 9:53:27 AM (9 days ago) Jul 20
to pretext...@googlegroups.com
I can confirm that I can replicate this issue both in a Codespace and locally on my MacBook Pro using the Docker container. Locally, I have pretext-full:latest, and I updated an existing Codespace to use pretext:latest and rebuilt.

I like the idea of a “Format PreTeXt” feature, but please make sure that it adjusts the indentation of elements that contain Python-like code uniformly. I’ve been burned a few times by the reindent in VS Code (not sure which add-on supplies it) as it undoes indentation inside loops, etc. inside my sageplot elements.

--
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 pretext-suppo...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-support/CANXmVMC0-%3DOjf0t2ymB7ECMd3jWyGpo%3DJTYaGH56PZcg4MYK%3Dg%40mail.gmail.com.


Oscar Levin

unread,
Jul 20, 2026, 10:18:58 AM (9 days ago) Jul 20
to PreTeXt support
Thanks both of you for the reports.  I've fixed the issue in v1.0.1.

The format feature should do a much better (maybe perfect) job with code blocks including sageplot.  I like the idea of adding a more visible command.  Currently formatting is available using the command pallet and the stock (not pretext-tools) "Format document" (or Ctrl+Shift+I, at least on windows).

Mitch Keller

unread,
Jul 20, 2026, 11:46:06 AM (9 days ago) Jul 20
to pretext...@googlegroups.com
Thanks for the speedy fix. Confirmed working locally (and very cool!). Testing turns up a few things:

  • External images show up as broken. I’m editing a section that has a PreFigure image in it as well as some images that were produced externally and are in the assets directory. The PreFigure image shows up fine, but the external ones don’t. When I do a preview in the browser, everything is there. Is this expected behavior? More generally, I’m seeing a sageplot not rendering (even though it’s generated), so now I’m wondering if PreFigure is getting some special treatment that’s making it show up (without relying on a generated SVG) while other assets aren’t being found.
  • A section with a lot of interactive sage elements seems to give up before MathJax can render the math content, and none of the sage interacts ever load. (Testing a section with just one sage interact seems to not load the interact either, but MathJax does get to run over the page.)
  • Versions are creating some issues with jumping to the right spot on the preview page. I have an #introduction with @component=“instructor” in the section I’m looking at. The live preview doesn’t include it (that doesn’t bother me), but double clicking on something like a #p in the live preview doesn’t take me to the right #p in the code editor and clicking somewhere in the code editor doesn’t always take me to the right spot in the preview. Things like #activity and #assemblage get me to the right spot (including #p inside those), but a #p that is a child of a #subsection doesn’t behave correctly.

David Austin

unread,
Jul 20, 2026, 1:34:00 PM (9 days ago) Jul 20
to pretext...@googlegroups.com
Looks good to me.  I didn't drive it as hard as Mitch did, but the live preview works, and the option to have the pretext menu appear on the left is great.  All very nice.

I'm wondering about validation in a codespace.  Inside the log file, I see stuff like
/tmpm2x_gz0f.xml:259:15: error: element "chapter" incomplete;
but I can't find that tmp file.  Is there any way I can look in that file?

Thanks,
David

Charles M

unread,
Jul 21, 2026, 12:39:41 AM (9 days ago) Jul 21
to PreTeXt support
Please forgive my ignorance. (I'm 56, and I still write all my research notes with fountain pens...seriously.) Is this question related to the following issue I'm seeing?

I just started learning Visual Source about ten minutes ago.  (Until now, I've been editing in TeXShop and building in the CLI.)  I'm editing an active copy of my manuscript.  The VS editor populates the @xref when I start typing, but Live Preview shows the usual message for a reference with no target;  everything else looks absolutely brilliant in Live Preview in the VS window.

When I ask VS to open the web output in Safari, all works well.  Am I missing an extension?

Thank you in advance.

Oscar Levin

unread,
Jul 21, 2026, 1:55:28 PM (8 days ago) Jul 21
to pretext...@googlegroups.com
The live preview only builds the current fragment of the document currently open in your editor, so if the xref points to something elsewhere, you will see that warning.  But it should work on full builds, as you noticed.  I'm adding a toggle to switch to the full preview, which hopefully will make it clearer what you see in the live preview.

I think I got images working better now. 

Just about to push a new version that has much better support for both live and full previews.

Charles M

unread,
Jul 22, 2026, 12:17:21 AM (8 days ago) Jul 22
to PreTeXt support
Thank you for the answer!

Just five minutes ago, I tried out the "full build" tab in the preview pane, and it worked perfectly for me on a manuscript currently at 355 pages with all the bibliographic references in the backmatter.  All knowls worked as they should, and it saves me valuable real estate on my monitor since I no longer have to keep Safari open.

Reply all
Reply to author
Forward
0 new messages