matze / mtheme

A modern LaTeX Beamer theme
6.38k stars 843 forks source link

Not sure how to use Fira Fonts #373

Closed christineymshen closed 4 years ago

christineymshen commented 4 years ago

I'm using this theme in rmarkdown, compiled by xelatex. I've installed fira fonts (or at least I think I have). They are sitting in the TinyTex fonts foder. But somehow when I compile it, it can't find it.

In the log file it says "Package beamerthememetropolis Warning: Could not find Fira Sans fonts on input line 95."

And at the very end of the log file it has these:

! kpathsea:make_tex: Invalid filename `Fira Sans Light', contains ' '
! kpathsea:make_tex: Invalid filename `Fira Sans Light Italic', contains ' '
! kpathsea:make_tex: Invalid filename `Fira Sans', contains ' '
! kpathsea:make_tex: Invalid filename `Fira Sans Italic', contains ' '
! kpathsea:make_tex: Invalid filename `Fira Sans Light OT', contains ' '
! kpathsea:make_tex: Invalid filename `Fira Sans Light Italic OT', contains ' '
! kpathsea:make_tex: Invalid filename `Fira Sans OT', contains ' '
! kpathsea:make_tex: Invalid filename `Fira Sans Italic OT', contains ' '
! kpathsea:make_tex: Invalid filename `Fira Mono', contains ' '
! kpathsea:make_tex: Invalid filename `Fira Mono Bold', contains ' '
! kpathsea:make_tex: Invalid filename `Fira Mono OT', contains ' '
! kpathsea:make_tex: Invalid filename `Fira Mono Bold OT', contains ' '

I wonder what's the best way to solve this? I've been exploring for other solutions online for quite a bit. But because I'm not very familiar with the whole framework of latex/ beamer, I'm not sure what's the best way to approach this.

Thanks!

christineymshen commented 4 years ago

I'm still not sure what I tried that helped, but now my rmd file somehow is able to find the Fira Sans Font.

ArchangeGabriel commented 4 years ago

For anyone landing there, see #280.

CharlieLeee commented 4 years ago

@ArchangeGabriel I use texlive 2017 on Ubuntu 18.04 and met this issue, do you know how to solve it?

ArchangeGabriel commented 4 years ago

@CharlieLee Did you check #280?

CharlieLeee commented 4 years ago

@ArchangeGabriel yes, is it clean to use the solution offered in https://github.com/matze/mtheme/issues/280#issuecomment-454041741, or are there other solutions?

ArchangeGabriel commented 4 years ago

The other solution is:

\setsansfont[
    Extension      = .otf,
    UprightFont    = *-Light,
    ItalicFont     = *-LightItalic,
    BoldFont       = *-Regular,
    BoldItalicFont = *-RegularItalic
]{FiraSans}
\setmonofont[
    Extension   = .otf,
    UprightFont = *-Regular,
    BoldFont    = *-Medium
]{FiraMono}
CharlieLeee commented 4 years ago

@ArchangeGabriel Okay, thank you! I'll go with it