embed Prefigure graph

8 views
Skip to first unread message

Taran Funk

unread,
May 20, 2026, 3:09:11 PM (9 days ago) May 20
to PreTeXt support
I'm trying to get this prefigure to appear in my book (it's not perfect yet, but can edit it more once I can get it to display properly). I'm using the code below to insert the graph with annotations. I created it in the prefigure playground, so at least the diagram portion worked in the playground. Let me know if anyone can see a problem, or if more information would be helpful. Thanks! I am finally getting around to making this book after that workshop almost a year ago...

<figure xml:id="slope-figure">
<image width="60%">
<prefigure xmlns="https://prefigure.org" label="RWT-Domain-Range-prefigure1">
<description> Slope of a line segment between two points on a graph </description>
<diagram dimensions="(300,300)" margins="5">
<definition>x1=1</definition>
<definition>x2=4</definition>
<definition>y1=1</definition>
<definition>y2=5</definition>
<definition>p=(x1,y1)</definition>
<definition>q=(x2,y2)</definition>
<definition>r=(x2,y1)</definition>
<coordinates bbox="(-1,-1,6,6)">
<axes decorations="no" xlabel="x" ylabel="y"/>
<group outline="none">
<polygon points="(p,r,q)" stroke="red"/>
<line endpoints="(p, q)" stroke="blue" infinite="yes"/>
</group>
<label anchor="((x1+x2)/2,y1)" alignment="south">
<m>\Delta x</m>
</label>
<label anchor="(x2,(y1+y2)/2)" alignment="east">
<m>\Delta y</m>
</label>
</coordinates>

<annotations>
<annotation ref="figure"
text="Graph showing the how the change in y and change in x is found on a graph">
<annotation ref="graph-group" text="The graph and its tangent line">
<annotation ref="graph" text="The graph of the function f" sonify="yes"/>
<annotation ref="point" text="The point a comma f of a"/>
<annotation ref="tangent" text="The tangent line to the graph of f at the point"/>
</annotation>
</annotation>
</annotations>
</diagram>
</prefigure>
</image>
</figure>

Oscar Levin

unread,
May 20, 2026, 3:44:02 PM (9 days ago) May 20
to PreTeXt support
I copy/pasted your code into a pretext article and it built fine.  What are you using for building pretext?  Note that pretext.plus does not yet support annotated prefigure diagrams (it will coming soon).

Taran Funk

unread,
May 20, 2026, 7:19:13 PM (9 days ago) May 20
to PreTeXt support
I have been using the command 
pretext view web -b
I have deployed it on github as well, but it still just shows an empty figure heading. Not sure if this link will work, but this hopefully will take you to the part of the book showing an empty figure heading under the definition of slope:
https://thfunk.github.io/UNO-MATH-1300/Slope.html

David W. Farmer

unread,
May 20, 2026, 7:31:41 PM (9 days ago) May 20
to PreTeXt support

I don't see a `caption` in that figure.

https://pretextbook.org/doc/guide/html/topic-figure.html
> --
> 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/ee8b5bee-01a8-4252-8d9a-767f132fd3dfn%40googlegroups.com.
>
>

David Austin

unread,
May 20, 2026, 8:44:07 PM (9 days ago) May 20
to pretext...@googlegroups.com
I cloned your repository and built your source.  The results looks fine to me (see below).  What environment are you building in?

image.png


Oscar Levin

unread,
May 20, 2026, 8:46:21 PM (9 days ago) May 20
to pretext...@googlegroups.com
Can you run pretext --version and report the output?

Taran Funk

unread,
May 20, 2026, 9:33:39 PM (9 days ago) May 20
to PreTeXt support
2.36.0 is what that command returns

Taran Funk

unread,
May 20, 2026, 9:35:52 PM (9 days ago) May 20
to PreTeXt support
I've been working through VSCode, don't know if that changes anything.

Oscar Levin

unread,
May 20, 2026, 11:59:53 PM (9 days ago) May 20
to pretext...@googlegroups.com
You are fairly up to date, but upgrading to 2.39 might be worth a shot.  If that doesn't help, perhaps you can come to our dropin tomorrow?

Sent from my T-Mobile 5G Device
Get Outlook for Android

From: pretext...@googlegroups.com <pretext...@googlegroups.com> on behalf of Taran Funk <tara...@gmail.com>
Sent: Wednesday, May 20, 2026 7:35:52 PM
To: PreTeXt support <pretext...@googlegroups.com>
Subject: Re: [pretext-support] Re: embed Prefigure graph
 
Reply all
Reply to author
Forward
0 new messages