2

In order to specify the sans serif font in report I am successfully using the following and all of the font shapes are being reproduced in the pdf without warning.

\setsansfont[Path = fonts/Lato2OFL/, 
UprightFont = Lato-Regular.ttf,
BoldFont = Lato-Bold.ttf,
ItalicFont = Lato-Italic.ttf,
BoldItalicFont = Lato-BoldItalic.ttf]{Lato}

However, in the table of contents I would like to use the 'Light' variant of this font. I was hoping that doing the following would do the trick:

\fontspec[Path = fonts/Lato2OFL/,
             UprightFont = Lato-Light.ttf,
             ItalicFont = Lato-LightItalic.ttf,
             BoldFont = Lato-Regular.ttf,
             BoldItalicFont = Lato-Italic.ttf
             ]{Lato-Light}\tableofcontents

Assuming that Latex would use the font files that I specify for each of the fonts that it may need. Note that I thought it would be nice to use the 'Lato-Regular' for a 'boldish' font in the text that is otherwise 'Light' But I get the warning:

LaTeX Font Warning: Font shape `EU2/Lato-Light.ttf(0)/bx/n' undefined
(Font)              using `EU2/Lato-Light.ttf(0)/m/n' instead on input
line 12.

and the bold font is replaced by the thin upright font ie. 'no bold'. I think I am missing something fundamentally about specifying fonts in LaTeX because it seems that it is looking for a bold font in the Lato-Light family, but I just want it to use the file I asked it to use.

2
  • 2
    tex.stackexchange.com/a/264275/7883 will help you.
    – Thérèse
    Jun 3, 2016 at 15:14
  • Thank you for the reply, The information on the page that you link to is very useful, however the strategy did not fix my problem. I ended up ignoring the warning and allowing the replacement of the bx/n font with the upright font of that family.
    – trosendal
    Jun 30, 2016 at 6:02

0

Browse other questions tagged .