Prefigure error (speech)

12 views
Skip to first unread message

Mark Fitch

unread,
Mar 4, 2026, 2:43:03 PM (5 days ago) Mar 4
to pretext...@googlegroups.com
The errors below are generated for a diagram I have constructed. The
diagram works in the Prefigure playground and is produced correctly for
pretext (it shows up in html).

Unable to load locale: base
Unable to load locale: en
Something went wrong computing speech.

Dr. Mark A. Fitch
Professor of Mathematics
Overseer, Associate of Arts/Science

maf...@alaska.edu
SSB 154
University of Alaska Anchorage
3211 Providence Drive, Anchorage, AK 99508

David Austin

unread,
Mar 4, 2026, 3:12:55 PM (5 days ago) Mar 4
to pretext...@googlegroups.com
Hi Mark,

Can you send your PreFigure source?

Thanks,
David

--
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/4aee2665-3e74-4897-b645-2b849a16c8c9%40alaska.edu.

David Austin

unread,
Mar 4, 2026, 3:21:24 PM (5 days ago) Mar 4
to pretext...@googlegroups.com
Also, where are you seeing those errors?

Mark Fitch

unread,
Mar 4, 2026, 3:34:43 PM (5 days ago) Mar 4
to pretext...@googlegroups.com

Pretext/prefigure code snippet is below. All speech works when I deploy it on a test site. It is the second figure at the URL: http://www.math.uaa.alaska.edu/~afmaf/web_test/sec-section-name.html

The errors show up when I run pretext to produce html (or run Prefigure directly on just that diagram in a separate file). The speech error is repeated many times. The errors are repeated for both prefigure diagrams (one is the sample from the documentation).

compiling PreFigure source file prefigure-diffeq.xml to SVG


Unable to load locale: base
Unable to load locale: en
Something went wrong computing speech.

  <figure xml:id="figure-prefigure-curve">
    <caption>Limit example</caption>
    <image width="70%">
      <prefigure label="prefigure-limit1"
                      xmlns="https://prefigure.org">
        <diagram dimensions="(300,300)" margins="5">
          <definition>f(x) = 10 / (1 + exp(-0.8 * (x - 6)))</definition>
          <coordinates bbox="[-1,-1,13,11]">
            <axes xlabel="x" ylabel="f(x)"
                  hticks="(0,2,12)" hlabels="(0,2,12)" 
                  vticks="(0,1,10)" vlabels="(0,1,10)"
                  arrows="0"/>
            <line at="guide" endpoints="((6,0),(6,10))" stroke="blue" />
            <graph at="graph" function="f" stroke="lightgreen" thickness="2" />
          </coordinates>
  <annotations>
    <annotation ref="figure" text="The graph of a function">
      <annotation ref="graph" text="On the left the graph begins at the bottom rising slowly at first then faster then slowly again. It has no breaks." sonify="yes" />
      <annotation ref="guide" text="Vertical line at x equal 6 guiding you to the curve" />
    </annotation>
  </annotations>

        </diagram>
      </prefigure>
    </image>
  </figure>

David Austin

unread,
Mar 4, 2026, 3:46:35 PM (5 days ago) Mar 4
to pretext...@googlegroups.com
I was able to build the source that you sent directly using prefig and within a PreTeXt document, and everything looks fine here.  That error message refers to a file prefigure-diffeq.xml, which is not the diagram that you sent since that one has label prefigure-limit1.  Can you send the source from the diagram with label prefigure-diffeq?

Thanks,
David

Mark Fitch

unread,
Mar 4, 2026, 4:01:59 PM (5 days ago) Mar 4
to pretext...@googlegroups.com

The error message is the same for both figures. That source is on the Prefigure web site (https://prefigure.org/docs/sec-annotations.html)

This suggests something not installed/configured on my installation. Using -vv with prefig I get the following. I am uncertain how to make liblouis work. I have downloaded the files for windows, added them to the path, and install the python louis package, but the error message persists. That also appears unconnected with speech.

No PreFigure publication file applied.
Building from PreFigure source prefigure-image1.xml
cairo imported
Failed to import louis so we cannot make braille labels
See the installation instructions at https://prefigure.org
The rest of the diagram will still be built.
debug: Initializing PreFigure diagram
debug: Processing PreFigure elements
debug: Processing definition: f(x) = 10 / (1 + exp(-0.8 * (x - 6)))
debug: Processing element coordinates
debug: Processing element axes
debug: Processing element line with handle guide
debug: Processing element graph with handle graph
debug: Processing element annotations
debug: Processing annotation with ref=figure
debug: Processing annotation with ref=graph
debug: Processing annotation with ref=guide
debug: Positioning labels
debug: Using MathJax to produce mathematical labels

debug: Writing the diagram and any annotations

David Austin

unread,
Mar 4, 2026, 5:25:50 PM (5 days ago) Mar 4
to pretext...@googlegroups.com
That error message is coming from MathJax, when it tries to build labels (I assume that you're not building tactile diagrams so liblouis isn't needed).  So something about your MathJax and/or node installation is giving the error.  Is your node installation fairly recent?  Setting up a virtual environment and installing prefig there will also install MathJax anew.

Mark Fitch

unread,
Mar 4, 2026, 6:12:22 PM (5 days ago) Mar 4
to pretext...@googlegroups.com

My prefig is installed in the virtual environment where pretext is installed. MathJax was installed as part of that (prefig init). I just updated node (v24.14.0). The error persists. It happens on both my work computer and my personal computer.

This is not time critical, so I will keep playing with this. Probably it will eat up too much of my spring break next week.

David Austin

unread,
Mar 5, 2026, 8:02:48 AM (4 days ago) Mar 5
to pretext...@googlegroups.com
Let's see if we can isolate the problem a bit.  Perhaps you could put these three files in some out of the way  location in your filesystem.  Then try

npm install
node mj-sre-page.js --svg --svgenhanced --depth deep mj_in.html > mj_out.html



David Austin

unread,
Mar 5, 2026, 8:53:23 AM (4 days ago) Mar 5
to pretext...@googlegroups.com
Sorry, I didn't include the link in the previous message.

Mark Fitch

unread,
Mar 5, 2026, 1:20:50 PM (4 days ago) Mar 5
to pretext...@googlegroups.com

This makes no sense to me. The file is there at exactly that address.

node mj-sre-page.js --svg --svgenhanced --depth deep /c/bin/testing/mj_in.html
node:fs:440
    return binding.readFileUtf8(path, stringToFlags(options.flag));
                   ^

Error: ENOENT: no such file or directory, open 'C:\bin\testing\mj_in.html'
    at Object.readFileSync (node:fs:440:20)
    at Object.<anonymous> (C:\bin\testing\mj-sre-page.js:119:32)
    at Module._compile (node:internal/modules/cjs/loader:1812:14)
    at Object..js (node:internal/modules/cjs/loader:1943:10)
    at Module.load (node:internal/modules/cjs/loader:1533:32)
    at Module._load (node:internal/modules/cjs/loader:1335:12)
    at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
    at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main
:154:5)
    at node:internal/main/run_main_module:33:47 {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\bin\\testing\\mj_in.html'
}

Node.js v24.14.0

David Austin

unread,
Mar 5, 2026, 1:26:41 PM (4 days ago) Mar 5
to pretext...@googlegroups.com
As I recall, on a windows machine, there's something weird about paths and you need to issue the command in the same directory where everything lives.


Mark Fitch

unread,
Mar 5, 2026, 3:40:27 PM (4 days ago) Mar 5
to pretext...@googlegroups.com

That was silly. - and not _

Still gives the errors below. Output attached.

mj-out.html

David Austin

unread,
Mar 5, 2026, 3:50:04 PM (4 days ago) Mar 5
to pretext...@googlegroups.com
OK, your MathJax output looks good.  The labels in the diagrams on your web page also look correct.  I'm not sure why MathJax is sending you these errors, but it doesn't appear to be causing problems with the output.  I don't feel like this is really a PreFigure issue so perhaps you could keep going and write back if you have PreFigure output that looks unexpected.

Reply all
Reply to author
Forward
0 new messages