how to select the fonts when using mathJax to generate SVG from the command line

23 views
Skip to first unread message

caramelizedonions

unread,
Mar 31, 2018, 11:33:01 PM3/31/18
to MathJax Users
I am trying to make SVG formulas from the command line, like so:

>>> tex2svg '\sin^2(\theta) + \cos^2(\theta)' > test.svg

So far this works fine, but I would like to adjust the fonts. Specifically, I would like STIXGeneral for the numbers and math symbols, and Baskerville for the math operators and all "roman" font.

Update: by doing

>>> tex2svg --font 'STIX-Web' '\sin^2(\theta) + \cos^2(\theta)' > test.svg

I am able to get STIX fonts for the math symbols, but I still don't know how to change the "roman" font...

Davide Cervone

unread,
Apr 2, 2018, 8:58:17 AM4/2/18
to mathja...@googlegroups.com
This is not possible with mathjax-node at the moment.  See  this discussion


for some details on why this isn't possible.  The discussion is about in-browser use of MathJax, but the issue is the same, and in fact your situation is even harder to deal with, because mathjax-node can't even measure the widths of characters as you can in the browser.  So this is not something that you are going to be able to do.

Davide


-- 
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages