Another prefigure error

26 views
Skip to first unread message

Mark Fitch

unread,
Aug 28, 2026, 2:35:05 PM (14 days ago) Aug 28
to pretext...@googlegroups.com

The prefigure code below works fine in the playground. When I try to use it in a PreTeXt document I get the error below. This is the error from running the prefig -vv  command recommended.

Because the labels show up in the correct place and all the annotations work in the playground, I don't know what else to check.

error: There was a problem placing the labels in the diagram
error: Debugging information is available with 'prefig -vv build filename'

        <diagram dimensions="(400,200)" margins="5">
          <coordinates bbox="(0,0,10,5)">
            <label at="start" anchor="(5,2.3)" alignment="n" justify="center"
                  clear-background="yes">
              <m>\displaystyle \lim_{x \to a} f(x) = L</m> if and only if
              <newline/>
              for all <m>\epsilon \gt 0</m>
              <newline/>
              there exists a <m>\delta \gt 0</m>
              <newline/>
              such that
            </label>
            <group at="condition">
              <label at="inputs" anchor="(2.5,1.6)" alignment="n">
                <m>|x-a| \lt \delta</m>
              </label>
              <label anchor="(2.5,1.6)" alignment="s" scale="0.6">
                the distance between x and a
                <newline/>
                is less than a tiny number
              </label>
              <label at="implies" anchor="(3.75,1.9)" alignment="e">
                implies
              </label>
              <label at="outputs" anchor="(7,1.6)" alignment="n">
                <m>|f(x)-L| \lt \epsilon</m>
              </label>
              <label anchor="(7,1.6)" alignment="s" scale="0.6">
                the distance between <m>f(x)</m> and L
                <newline/>
                is less than a tiny number
              </label>
              <label anchor="(1.7,0.6)" alignment="e" scale="0.6">
                x really close to a implies <m>f(x)</m> is really close to L
              </label>
            </group>
          </coordinates>
          <annotations>
            <annotation ref="start" text="The limit as x approaches a of the function f of x equals L if an only if for all epsilon greater than 0 there exists a delta greater than 0 such that" >
              <annotation ref="condition" text="x really close to a implies f of x is really close to L" >
                <annotation ref="inputs" text="the distance between x and a is less than a little number" />
                <annotation ref="implies" text="implies" />
                <annotation ref="outputs" text="the distance between f of x and L is less than a little number" />
              </annotation>
            </annotation>
          </annotations>
        </diagram>


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

Mark Fitch

unread,
Aug 28, 2026, 7:03:25 PM (13 days ago) Aug 28
to PreTeXt support
After further debugging the issue is the Prefigure chokes on \lt in the labels. If I remove that (or change to \gt for testing) it compiles correctly. &lt; does not change anything.

Rob Beezer

unread,
Aug 28, 2026, 7:26:54 PM (13 days ago) Aug 28
to pretext...@googlegroups.com
\lt is not a standard LaTeX macro. But MathJax defines it, so we define it
elsewhere (like for LaTeX conversions). You really don't want a bare "<"
floating around in your XML.

David A can probably do better - but try a "&lt;" where you have a "\lt" and see
what happens.

Rob

On 8/28/26 16:03, 'Mark Fitch' via PreTeXt support wrote:
> After further debugging the issue is the Prefigure chokes on \lt in the labels.
> If I remove that (or change to \gt for testing) it compiles correctly. &lt; does
> not change anything.
>
> On Friday, August 28, 2026 at 10:35:05 AM UTC-8 Mark Fitch wrote:
>
> __
>
> The prefigure code below works fine in the playground. When I try to use it
> in a PreTeXt document I get the error below. This is the error from running
> the prefig -vv  command recommended.
>
> Because the labels show up in the correct place and all the annotations work
> in the playground, I don't know what else to check.
>
> error: There was a problem placing the labels in the diagram
> error: Debugging information is available with 'prefig -vv build filename'
>
> <diagramdimensions="(400,200)"margins="5">
> <coordinatesbbox="(0,0,10,5)">
> <labelat="start"anchor="(5,2.3)"alignment="n"justify="center"
> clear-background="yes">
> <m>\displaystyle \lim_{x \to a} f(x) = L</m>if and only if
> <newline/>
>               for all <m>\epsilon \gt 0</m>
> <newline/>
>               there exists a <m>\delta \gt 0</m>
> <newline/>
>               such that
> </label>
> <groupat="condition">
> <labelat="inputs"anchor="(2.5,1.6)"alignment="n">
> <m>|x-a| \lt \delta</m>
> </label>
> <labelanchor="(2.5,1.6)"alignment="s"scale="0.6">
>                 the distance between x and a
> <newline/>
>                 is less than a tiny number
> </label>
> <labelat="implies"anchor="(3.75,1.9)"alignment="e">
>                 implies
> </label>
> <labelat="outputs"anchor="(7,1.6)"alignment="n">
> <m>|f(x)-L| \lt \epsilon</m>
> </label>
> <labelanchor="(7,1.6)"alignment="s"scale="0.6">
>                 the distance between <m>f(x)</m>and L
> <newline/>
>                 is less than a tiny number
> </label>
> <labelanchor="(1.7,0.6)"alignment="e"scale="0.6">
>                 x really close to a implies <m>f(x)</m>is really close to L
> </label>
> </group>
> </coordinates>
> <annotations>
> <annotationref="start"text="The limit as x approaches a of the function f of
> x equals L if an only if for all epsilon greater than 0 there exists a delta
> greater than 0 such that">
> <annotationref="condition"text="x really close to a implies f of x is really
> close to L">
> <annotationref="inputs"text="the distance between x and a is less than a
> little number"/>
> <annotationref="implies"text="implies"/>
> <annotationref="outputs"text="the distance between f of x and L is less than
> a little number"/>
> </annotation>
> </annotation>
> </annotations>
> </diagram>
>
>
> 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
>
> --
> 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 <mailto:pretext-
> support+u...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-
> support/9ab2ad54-81af-4520-b938-08de4271b9dfn%40googlegroups.com <https://
> groups.google.com/d/msgid/pretext-support/9ab2ad54-81af-4520-
> b938-08de4271b9dfn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Mark Fitch

unread,
Aug 28, 2026, 7:37:14 PM (13 days ago) Aug 28
to pretext...@googlegroups.com
&lt; fails the same way.

Mark Fitch

unread,
Aug 28, 2026, 7:41:03 PM (13 days ago) Aug 28
to pretext...@googlegroups.com
At this point it may be pertinent that I am running on Windows with the
latest pretext and prefigure.

On 8/28/2026 3:26 PM, 'Rob Beezer' via PreTeXt support wrote:

Rob Beezer

unread,
Aug 28, 2026, 10:17:38 PM (13 days ago) Aug 28
to pretext...@googlegroups.com
On 8/28/26 16:37, 'Mark Fitch' via PreTeXt support wrote:
> &lt; fails the same way.

Dang. David A and I will need to decide where and how this gets sorted out.
Perhaps he and I can work on it Tuesday morning.

Rob

David Austin

unread,
Aug 30, 2026, 6:18:06 PM (11 days ago) Aug 30
to pretext...@googlegroups.com
This is really an issue with the MathJax script that we are using to process the labels.  The script converts the math expressions into SVGs and writes them out into an HTML file, which is then read back in by PreFigure.  However, the script also writes the latex macros out along with the SVGs and that introduces a problematic "<" character into the HTML file.  That file cannot then be read so the placement of labels fails.

I identified this back in May and contacted the author of the mj-sre-page script.  The short story is that the issue never got resolved as both parties were traveling at different times over the summer.  I think I can get Claude to fix it on my own so I'll make a PR on the PreFigure repository seeking a review and tagging Rob.  There are reasons that it has not shown up in PreTeXt, but it's worth paying attention to.

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/MTAwMDAxakJ6ZUw1ZmE.1787969855%40pnsh.

David Austin

unread,
Aug 30, 2026, 6:41:34 PM (11 days ago) Aug 30
to pretext...@googlegroups.com

David Austin

unread,
Sep 4, 2026, 11:37:02 AM (7 days ago) Sep 4
to pretext...@googlegroups.com
The problem with non XML-compliant characters in macros has been fixed in prefig 0.7.6.  So including \lt inside a math label in a PreFigure diagram produces the expected result.   Read all about it here.

David

Mark Fitch

unread,
Sep 4, 2026, 2:44:34 PM (7 days ago) Sep 4
to pretext...@googlegroups.com

Now any math in a label causes the "problem placing the labels" error on my machine. The label below, as the only content of a prefigure image, causes an error. The error disappears with the math tags gone.

I just updated prefigure and pretext this morning. I ran the test using just prefig to get maximum error reporting.

            <label anchor="(7,1.6)" alignment="s" scale="0.6">
              the distance between <m>5</m>
            </label>

David Austin

unread,
Sep 4, 2026, 3:45:25 PM (7 days ago) Sep 4
to pretext...@googlegroups.com

Mark Fitch

unread,
Sep 4, 2026, 4:25:10 PM (7 days ago) Sep 4
to pretext...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages