![Overleaf 无法在文件夹中找到直立字体文件](https://linux22.com/image/406405/Overleaf%20%E6%97%A0%E6%B3%95%E5%9C%A8%E6%96%87%E4%BB%B6%E5%A4%B9%E4%B8%AD%E6%89%BE%E5%88%B0%E7%9B%B4%E7%AB%8B%E5%AD%97%E4%BD%93%E6%96%87%E4%BB%B6.png)
当直立字体文件位于根文件夹中时,Overleaf 可以正确呈现 pdf,但当该文件位于文件夹中时会返回错误。
来源如下
\documentclass{article}
\usepackage{fontspec}
\setmainfont[
ItalicFont={fonts/LinLibertine_RIah.ttf},
]{LinLibertine_Rah.ttf}
\begin{document}
Hello \emph{world}
\end{document}
这是文件结构。
但如果我把直立的文件移到同一个文件夹中,从而改变源
\documentclass{article}
\usepackage{fontspec}
\setmainfont[
ItalicFont={fonts/LinLibertine_RIah.ttf},
]{fonts/LinLibertine_Rah.ttf}
\begin{document}
Hello \emph{world}
\end{document}
并更新文件结构
返回错误。
当直立字体文件位于文件夹中时,我该如何正确移动并引用它?
答案1
[免责声明:我是 Overleaf 的支持人员]
实际上,当我尝试在本地 TeX Live 安装上编译它时,您的代码片段也不起作用。但使用该Path
选项可以:
\setmainfont[Path=fonts/,
ItalicFont=LinLibertine_RIah.ttf]
{LinLibertine_Rah.ttf}