LaTeX fonts

30 views
Skip to first unread message

Sean Fitzpatrick

unread,
Feb 19, 2026, 10:12:06 AM (12 days ago) Feb 19
to PreTeXt development
Over on the PreTeXt discord, an author was asking about changing the font in PDF. 

It was observed that there is a note in the guide -- dated 2019 -- that work is planned to put font selection in the publisher file. 

Is this still to-do, or was it implemented but not documented? 
Can an author put a font choice in a latex-preamble-early/late without adding extra XSL?

Rob Beezer

unread,
Feb 19, 2026, 10:27:20 AM (12 days ago) Feb 19
to prete...@googlegroups.com
Thanks, Sean, for relaying this one.

You *can* change fonts, we do this for the Guide. (See the PDF version at the
website.)

The LaTeX conversion is designed so that many templates can be
extended/overridden. A publisher can implement their own style, or we make
available a few styles in the distribution. The relevant one here is specified
in the publication file as "guide" and the file is

xsl/latex/pretext-latex-guide.xsl

It is intentionally semi-complicated, but could be stripped down for a starting
point. Others nearby might be helpful.

The past few days, I'd been thinking fonts needed some attention. Mostly to
more readily support a variety of languages, but it might be nice to have a
simpler mechanism to simply change a font, full stop.

Rob
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-dev...@googlegroups.com <mailto:pretext-
> dev+uns...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/
> CAH%2BNcPZ0XqspgHVBKCKU6KBxPbir%3DheBCTv%3DkbP_Dfi%2BQHNQ5g%40mail.gmail.com
> <https://groups.google.com/d/msgid/pretext-dev/
> CAH%2BNcPZ0XqspgHVBKCKU6KBxPbir%3DheBCTv%3DkbP_Dfi%2BQHNQ5g%40mail.gmail.com?
> utm_medium=email&utm_source=footer>.

Sean Fitzpatrick

unread,
Feb 19, 2026, 10:33:31 AM (12 days ago) Feb 19
to PreTeXt development
Thanks Rob. 

The suggestion I gave was to copy the XSL from another project and adjust. 
The guide gives the impression that we want to support this without the need for extra XSL, but I suppose the 2019 date on that note should make it clear that this hasn't been a priority.

To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDAyNC5iZWV6ZXI.1771514836%40pnsh.

Rob Beezer

unread,
Feb 19, 2026, 11:38:03 AM (12 days ago) Feb 19
to prete...@googlegroups.com
On 2/19/26 07:33, Sean Fitzpatrick wrote:
> but I suppose the 2019 date on that note should make it clear that
> this hasn't been a priority.

Well, since that was written we have had a pandemic. ;-)

Lots of priorities. Just need manpower...

Sean Fitzpatrick

unread,
Feb 19, 2026, 12:45:59 PM (11 days ago) Feb 19
to PreTeXt development
Over on discord I suggested that there might be an inertia problem: those of us who can figure out how to get fonts into the publisher file have also figured out how to do it with XSL, and therefore may not be motivated to choose this over other projects.:-)

--
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.

Rob Beezer

unread,
Feb 20, 2026, 3:19:45 PM (10 days ago) Feb 20
to prete...@googlegroups.com
On 2/19/26 09:45, Sean Fitzpatrick wrote:
> Over on discord I suggested that there might be an inertia problem: those of us
> who can figure out how to get fonts into the publisher file have also figured
> out how to do it with XSL, and therefore may not be motivated to choose this
> over other projects.:-)

Might be a good problem for us to have? ;-)

Rob Beezer

unread,
Feb 20, 2026, 3:37:42 PM (10 days ago) Feb 20
to prete...@googlegroups.com
Sean started this thread, and I want to get serious about a response, so I hope
this has some visibility, especially for Oscar.

The #latex element of the publisher file has lots of possible attributes.
Which is fine.

Without looking real hard at implementation aspects, how about four more:

@font
@math-font
@font-options
@math-font-options

These would override default values (which might include language-specific
support if I can get a better handle on that), and would fill LaTeX macros like:

\setmainfont{ }[ ]

The value of @font would need to be:

* the name of an OTF (or TTF, too?) font

* installed on the user's system (generally *not* just in their LaTeX distribution)

And would require

* using xelatex and not pdflatex (our default situation anyway)

Obviously, some details to sort out. But does anybody see any red flags?

Oscar - irrelevant for "classic" LaTeX? How do we feel about putting fonts into
Docker containers, CodeSpaces, etc? We could just make this a "local" feature,
for bare CLI or pretext/pretext.

Rob

Oscar Levin

unread,
Feb 20, 2026, 5:14:08 PM (10 days ago) Feb 20
to prete...@googlegroups.com
I think this is a good idea.  

For the journal styles (classic) this is not advisable, so we should just not do it.

As for the codespace, I already add the fonts so that the sample article with its font customizations compile.  No reason not allow some other fonts too (within reason).

--
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.

Alex Jordan

unread,
Feb 20, 2026, 5:42:57 PM (10 days ago) Feb 20
to prete...@googlegroups.com
Sometimes you have the font you want for the main body text, but it does not come with a monospace variant, italic variant, etc. So I think there should be a way to declare these things too. This is all tied very closely to using xelatex and the fontspec package. Is it worth considering an embrace of that, and surveying fontspec for more features to use? Like (for example) all of the arguments that go to \setmainfont, \setsansfont, etc could be legal attributes in the publisher file, somewhere down in the latex element.

Somewhere, people should be educated about font licensing and whether or not the font ends up included inside the PDF. With some of the publishers who would actually do the printing, they might reject a job because of either of these concerns. IIRC, for inserting a font into the PDF, I had to run xelatex with some arcane argument and/or use Acrobat.

Rob Beezer

unread,
Feb 23, 2026, 11:17:00 AM (8 days ago) Feb 23
to prete...@googlegroups.com
Thanks for the comments, Alex. Replies interspersed.

On 2/20/26 14:42, Alex Jordan wrote:
> Sometimes you have the font you want for the main body text, but it does not
> come with a monospace variant, italic variant, etc. So I think there should be a
> way to declare these things too.

Templates are currently organized so that with extra XSL, and an understanding
of fontspec you can do this now.

Most "mainstream" OTF fonts are organized with italic, bold, and bolditalic
variants with standard names. Small caps can be faked. There are options to
specify nonstandard names (which is a different problem than ouright availability).

> This is all tied very closely to using xelatex
> and the fontspec package. Is it worth considering an embrace of that, and
> surveying fontspec for more features to use? Like (for example) all of the
> arguments that go to \setmainfont, \setsansfont, etc could be legal attributes
> in the publisher file, somewhere down in the latex element.

I do not plan to make this very complicated, and I certainly do not want to
document and maintain a bunch of features of the fontspec package. We do this
with the LaTeX geometry package, the value in the publisher file is just the
argument to "\geometry{}". I plan to see do similarly here - publisher file has
two strings that go directly into \setmainfont{}[], and similarly for the math
font and the monospace font. I consider this an embrace - read the fonspec docs
and do whatever you like.

> Somewhere, people should be educated about font licensing and whether or not the
> font ends up included inside the PDF. With some of the publishers who would
> actually do the printing, they might reject a job because of either of these
> concerns. IIRC, for inserting a font into the PDF, I had to run xelatex with
> some arcane argument and/or use Acrobat.

Yes! Are you volunteering? There might even be a good place righr now, since
there is a lot of discussion of fonts in The Guide already (which I will need to
review as part of this).

Rob
Reply all
Reply to author
Forward
0 new messages