TransWikia.com

Using otf-libertinus with ConTeXt for typesetting math

TeX - LaTeX Asked by The_Keeper on June 11, 2021

I’m trying to use Libertinus Serif font for typesetting both text and math.

starttypescript [libertinusserif]
setups[font:fallback:serif]          % security: if not found==> back to defaults
% definefontsynonym[ConTeXt basics name] [Human readable]       [features=default]
  definefontsynonym[Serif]                 [LibertinusSerif-Regular]       [features=default]
  definefontsynonym[SerifItalic]           [LibertinusSerif-Italic]        [features=default]
  definefontsynonym[SerifBold]             [LibertinusSerif-Semiold]           [features=default]
  definefontsynonym[SerifBoldItalic]       [LibertinusSerif-SemiboldItalic]    [features=default]
stoptypescript

starttypescript [libertinusserif]
  definetypeface [libertinusserif]    [rm] [serif] [libertinusserif]    [default]
stoptypescript

setupbodyfont[libertinusserif, 14pt]

starttext
Just some text.

Some text with m{m+a_{th}} in it.

stoptext

and it drops out with the following error:

Math error: parameter Umathsub_shift_downtextstyle is not set


m_syst_action_nop ...artimath #1normalstopimath 
                                                  fi 
l.21 Some text with m{m+a_{th}}
                               in it.

(Note: when I comment out the line with math or do not set the body font, the output is produced.)

One Answer

I think one problem (the error you get) is that you do not define a math font.

If you use the standalone version, you just have to be sure to have the fonts on your system where it can be found (my $OSFONTDIR is set to $HOME/.fonts). It seems that this is not your problem, since you get the fonts when you comment out the math.

Thus, you will have these nice fonts working by adding

setupbodyfont[libertinus]

to your setup. The definitions seems to be taken from

tex/texmf-context/tex/context/fonts/mkiv/type-imp-libertinus.mkiv

Correct answer by mickep on June 11, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP