Prefigure not rendering live

43 views
Skip to first unread message

Mark Fitch

unread,
Aug 26, 2026, 3:32:11 PMAug 26
to pretext...@googlegroups.com

The prefigure diagram (code below) renders correctly in the Prefigure playground, but the function does not show up when I deploy it.

It is the sixth image (center row, right entry at http://www.math.uaa.alaska.edu/~afmaf/classes/math251/lessons/section-limits-discover.html#figure-limits-exists-2-1-1)


<diagram dimensions="(300,300)" margins="5">
<definition>f(t) = sqrt(abs(t-4))</definition>
<coordinates bbox="[-1,-0.2,8,2]">
<axes xlabel="t" ylabel="h(t)"
  hticks="(0,1,8)" hlabels="(0,1,8)"
  vticks="(0,0.2,2)" vlabels="(0,0.2,2)"
  arrows="0"/>
<line at="guide" endpoints="((4,0),(4,2))" stroke="blue" />
<graph at="graph_left" function="f" domain="(0,4)" stroke="lightgreen" thickness="2" />
<graph at="graph_right" function="f" domain="(4,8)" stroke="lightgreen" thickness="2" />
</coordinates>
<annotations>
<annotation ref="figure" text="The graph of a function">
<annotation ref="graph_left" text="The curve begins at the top left curves down to (4,0)." sonify="yes" />
<annotation ref="graph_right" text="To the right of this it is a mirror image. At (4,0) the curve makes a sharp turn." sonify="yes" />
<annotation ref="guide" text="Vertical line at t equals 4 guiding you toward the curve" />
</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

David Austin

unread,
Aug 26, 2026, 8:40:57 PMAug 26
to pretext...@googlegroups.com
Hi Mark,

I just dropped this into one of my projects, and everything turned out well.  Would you mind sharing your source code?

David

image.png


--
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/81e730e1-d031-4492-8921-4173e6eef61a%40alaska.edu.

Mark Fitch

unread,
Aug 27, 2026, 1:36:30 AMAug 27
to pretext...@googlegroups.com

David Austin

unread,
Aug 27, 2026, 7:40:28 AMAug 27
to pretext...@googlegroups.com
Thanks, Mark.  I sent you a PR that reorganizes your project a bit.  As a rule, we don't want to include assets in the repository that can be generated from source so I removed your directories "generated" and ".cache" and updated your publication file directing PreTeXt to store generated assets in a "generated-assets" directory.  Also, generated assets should not go inside "source" so that is now a sibling of "source" (PreTeXt will create that directory when you build again).  This builds cleanly for me and includes the proper version of that diagram.  

When I forked your repository, I noticed that the assets were not being generated as they should have been so I suspect something similar was happening with you and that diagram was not being updated as you would have expected.  Just let me know if you have questions.

David

Mark Fitch

unread,
Aug 27, 2026, 10:33:24 AMAug 27
to pretext...@googlegroups.com

David Austin

unread,
Aug 27, 2026, 10:37:18 AMAug 27
to pretext...@googlegroups.com

Mark Fitch

unread,
Aug 27, 2026, 1:05:23 PMAug 27
to pretext...@googlegroups.com

The PR is noted. 

I finally found an error reported for this Prefigure. It is below. Does this suggest my copy of Prefigure is missing some definitions?

error: Unknown function in evaluation: abs
error: Unsafe function definition: sqrt(abs(x-4))
error: Error in definition: Unsafe function definition: sqrt(abs(x-4))
error: Error retrieving function in graph: Unrecognized name: f
error: Error retrieving function in graph: Unrecognized name: f

David Austin

unread,
Aug 27, 2026, 1:08:42 PMAug 27
to pretext...@googlegroups.com
Yes, that suggests you have a pretty old version of prefig.  I'm not sure how you're working but "pip install --upgrade prefig" in a terminal window will probably do the trick.

Mark Fitch

unread,
Aug 27, 2026, 1:17:48 PMAug 27
to pretext...@googlegroups.com

After uninstall pretext and reinstalling both, everything works now.

David Austin

unread,
Aug 27, 2026, 1:19:46 PMAug 27
to pretext...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages