Closed jodros closed 2 weeks ago
Have you installed a math font? From the documentation, "By default, this package uses Libertinus Math, so it will fail if Libertinus Math can’t be found."
Have you installed a math font?
Yes, I have this and other math fonts installed.
Can you Try with sile -d math -d fonts
to get some debug info from the math and font subsystems. Also your sile --version
would be good to know at this point.
Here is the output:
$ sile -d math -d fonts index.sil
SILE v0.15.3 (LuaJIT 2.1.ROLLING) [Rust]
<index.sil> as sil
<test.sil> as sil
[math] Resulting mbox: VBox(HBox(UnderOver(Text(atom=1, kind=operator, script=1, largeop, text="∑"), Text(atom=0, kind=identifier, script=3, text="i"), nil), Text(atom=3, kind=operator, script=1, text="="), Superscript(Text(atom=0, kind=number, script=1, text="1"), nil), Fraction(HBox(HBox(Superscript(Text(atom=0, kind=identifier, script=3, text="x"), nil))), HBox(HBox(Text(atom=0, kind=identifier, script=3, text="n"))))))
[math] Loading math font Libertinus Math;10;400;Regular;normal;;;LTR
[fonts] Looking for Libertinus Math;10;400;Regular;normal;;;LTR
[fonts] Resolved font family Libertinus Math -> /usr/share/fonts/Libertinus/LibertinusMath-Regular.woff2Error: runtime error: /usr/local/share/sile/packages/math/base-elements.lua:119: attempt to index a nil value
stack traceback:
[C]: in function '__index'
/usr/local/share/sile/packages/math/base-elements.lua:119: in function 'getMathMetrics'
/usr/local/share/sile/packages/math/base-elements.lua:305: in function 'getScaleDown'
/usr/local/share/sile/packages/math/base-elements.lua:934: in function 'shape'
/usr/local/share/sile/packages/math/base-elements.lua:337: in function 'shapeTree'
/usr/local/share/sile/packages/math/base-elements.lua:334: in function 'shapeTree'
/usr/local/share/sile/packages/math/base-elements.lua:334: in function 'shapeTree'
/usr/local/share/sile/packages/math/base-elements.lua:334: in function 'shapeTree'
/usr/local/share/sile/packages/math/typesetter.lua:157: in function 'handleMath'
/usr/local/share/sile/packages/math/init.lua:81: in function </usr/local/share/sile/packages/math/init.lua:73>
/usr/local/share/sile/core/sile.lua:605: in function 'call'
/usr/local/share/sile/core/sile.lua:396: in function 'process'
/usr/local/share/sile/core/sile.lua:475: in function 'processString'
/usr/local/share/sile/core/sile.lua:525: in function </usr/local/share/sile/core/sile.lua:488>
/usr/local/share/sile/core/sile.lua:605: in function 'call'
/usr/local/share/sile/core/sile.lua:396: in function 'process'
/usr/local/share/sile/core/sile.lua:475: in function 'processString'
/usr/local/share/sile/core/sile.lua:525: in function </usr/local/share/sile/core/sile.lua:488>
I just realized that despite I had all of the .otf fonts in /usr/share/fonts/otf
, I had another folder /usr/share/fonts/Libertinus
with only .woff fonts
and SILE was looking firstly in the later...
I don't think we can fault SILE for finding that font (especially since it's just following fontconfig
's cues) but we can probably do a better job of erroring out at this point if we're asked to do something with a font that it doesn't support.
I simply can't render anything with math, always get:
Both in my own files and those in
tests
.