1

Overleaf renders a pdf properly when the upright font file is in the root folder, but returns an error when the file is in a folder.

Here's the source

\documentclass{article}
\usepackage{fontspec}
\setmainfont[
  ItalicFont={fonts/LinLibertine_RIah.ttf},
  ]{LinLibertine_Rah.ttf}

\begin{document}

Hello \emph{world}

\end{document}

and here's the file structure.

enter image description here

but if I move the upright file into the same folder, changing the source thus

\documentclass{article}
\usepackage{fontspec}
\setmainfont[
  ItalicFont={fonts/LinLibertine_RIah.ttf},
  ]{fonts/LinLibertine_Rah.ttf}

\begin{document}

Hello \emph{world}

\end{document}

and updating the file structure

enter image description here

returns an error.

How do I move properly refer to the upright font file when its in a folder?

4
  • Have you contacted the Overleaf help desk about this issue?
    – Mico
    Jan 13, 2020 at 1:32
  • i have not--i thought I was making some rudimentary TeX error
    – tomw
    Jan 13, 2020 at 2:00
  • 3
    [Disclaimer: I'm a support personnel at Overleaf] Actually your code snippet doesn't work either when I tried compiling it on a local TeX Live installation, but using the Path option does: \setmainfont[Path=fonts/,ItalicFont=LinLibertine_RIah.ttf]{LinLibertine_Rah.ttf}
    – imnothere
    Jan 13, 2020 at 2:10
  • @LianTzeLim that fixed it--thanks!
    – tomw
    Jan 13, 2020 at 2:29

1 Answer 1

4

[Disclaimer: I'm a support personnel at Overleaf]

Actually your code snippet doesn't work either when I tried compiling it on a local TeX Live installation. But using the Path option does:

\setmainfont[Path=fonts/,
             ItalicFont=LinLibertine_RIah.ttf]
  {LinLibertine_Rah.ttf}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.