# Overleaf can't find upright font files in folders

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.

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

returns an error.

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

– 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
• [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} Jan 13, 2020 at 2:10
• @LianTzeLim that fixed it--thanks!
– tomw
Jan 13, 2020 at 2:29

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/,