4

I'm currently working in sharelatex online Latex editor, using XeLaTeX. I had all the fonts working using the fontspec package, however once moved to the Fonts folder there is no way to make them work:

\setmainfont{./Fonts/Merriweather-Regular.ttf}%
  [Ligatures=TeX,
  BoldFont=./Fonts/Merriweather-Bold.ttf,
  ItalicFont=./Fonts/Merriweather-Italic.ttf,
  BoldItalicFont=./Fonts/Merriweather-BoldItalic.ttf]

Even replacing the ./Fonts/, /Fonts/, Fonts/, etc.

Does anyone know how to make it work?

9

Don't load the fonts with the relative path. Load them by their font names and specify the ExternalLocation key to point to your folder:

\documentclass{article}       

\usepackage{fontspec}
\setmainfont[ExternalLocation=Fonts/]{AGaramondPro-Regular.otf}%
  [Ligatures=TeX,
  BoldFont=AGaramondPro-Bold.otf,
  ItalicFont=AGaramondPro-Italic.otf,
  BoldItalicFont=AGaramondPro-BoldItalic.otf]

\begin{document}
This is some regular text.
\end{document}

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.