PreFigure fonts

17 views
Skip to first unread message

Lon Mitchell

unread,
Dec 10, 2025, 3:21:14 PM (7 days ago) Dec 10
to PreTeXt support
Using the CLI (thanks, Oscar!), I have latex output, but the PreFigures go directly to PDF.  How can I produce tex files for the PreFigures as well?  The motivation is having control over the fonts so they match the text fonts when those are changed.  

David Austin

unread,
Dec 10, 2025, 3:28:06 PM (7 days ago) Dec 10
to pretext...@googlegroups.com
Maybe I'm not following, but are you asking to create TikZ source from the PreFigure source?  That's not possible and likely won't ever be.  Can you say more specifically what your use case is?

Thanks,
David

On Wed, Dec 10, 2025 at 3:21 PM Lon Mitchell <lonmi...@gmail.com> wrote:
Using the CLI (thanks, Oscar!), I have latex output, but the PreFigures go directly to PDF.  How can I produce tex files for the PreFigures as well?  The motivation is having control over the fonts so they match the text fonts when those are changed.  

--
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/9d1db948-1f5a-4d91-845a-02e63ebf8a2fn%40googlegroups.com.

Lon Mitchell

unread,
Dec 10, 2025, 3:45:31 PM (7 days ago) Dec 10
to pretext...@googlegroups.com
Thanks, David.  Essentially yes: Tikz or other tex-able source was my first thought.  I'm preparing a published version of a book and using Adobe Garamond as the main font.  Many of the figures include text and/or symbols, and I would like to have those in the same font as the surrounding text.  So if there is currently no tex file intermediary between PreFigure and PDF, is there any other way you can think of to get PreFigure to use other fonts in generating the PDFs?

You received this message because you are subscribed to a topic in the Google Groups "PreTeXt support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-support/5xXv7dvWA6E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-suppo...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-support/CANXmVMDeh46HOsTXotLzKBz5BcembQWrN37mZLY%3DfWM%3D1nKc1A%40mail.gmail.com.

Rob Beezer

unread,
Dec 10, 2025, 3:55:53 PM (7 days ago) Dec 10
to pretext...@googlegroups.com

Lon Mitchell

unread,
Dec 11, 2025, 9:56:39 AM (6 days ago) Dec 11
to pretext...@googlegroups.com
Thanks, Rob.  It looks like the PreFigure output has the glyphs converted to paths (looking in the xml for the svg and no font info in the PDF), so a path-to-path conversion won't change anything in terms of font.  Even if individual glyphs could be changed from one font to another, the result would still have the kerning of the original font.  So it seems that having the tex code for the labels is key.  And I'm guessing that PreFigure uses tex in some fashion (mathjax?) and at some point in its output.  So I think we're back to if there is a way to ask PreFigure to use a different font.  Which perhaps is a question for David.

Lon



You received this message because you are subscribed to a topic in the Google Groups "PreTeXt support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-support/5xXv7dvWA6E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-suppo...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-support/MTAwMDAwNy5iZWV6ZXI.1765400150%40pnsh.

David Austin

unread,
Dec 11, 2025, 11:53:35 AM (6 days ago) Dec 11
to pretext...@googlegroups.com
Thanks for your message, Lon.  There are two types of text in a PreFigure diagram.  The glyphs you are seeing in the PreFigure output come from MathJax, which processes everything inside an #m tag.  It may be possible that we can use a different font by passing a configuration parameter into our MathJax script.  I'll investigate with our current use of MathJax and also as we (slowly) convert to MathJax 4.

It is also possible to include plain text not processed by MathJax inside a PreFigure label, and it seems natural that you would want this kind of label to be rendered in the same font as the surrounding text (I thought that's what you meant originally).  This may rely on converting the output SVG, in which the text is included with a #text element, into TikZ.  I've been experimenting with the Python package Rob linked to but haven't had success yet, but I plan to keep trying.  Having PreFigure output TikZ raises a host of other questions.

I'll report more later.

Thanks again,
David

Rob Beezer

unread,
Dec 12, 2025, 7:21:48 PM (5 days ago) Dec 12
to pretext...@googlegroups.com

David Austin

unread,
Dec 12, 2025, 7:55:53 PM (5 days ago) Dec 12
to pretext...@googlegroups.com
Not naive at all.  That's what I've settled on as the "right" approach.  I've corresponded with Lon off list so this isn't a pressing concern right now.  

What you're proposing would be a bit of PreFigure work and also require some PreTeXt integration.  There are other higher priorities right now, but I'll keep it in the queue.  The request is reasonable but I wonder how common, to cite David F's criterion for prioritizing work.

Reply all
Reply to author
Forward
0 new messages