5

I got the Plasmati Graduate CV template for my curriculum.

It says: This template needs to be compiled with XeLaTeX and requires the Fontin font (OpenType version preferred) which can be downloaded for free here.

I already changed the compiler to XeLaTeX in Overleaf, it isn't going well:

fontspec error: "font-not-found"

! The font "Fontin" cannot be found.

! See the fontspec documentation for further information.

! For immediate help type H .

l.36 ...[SmallCapsFont = Fontin SmallCaps]{Fontin}

% Main document font

I haven't changed the original code

I haven't changed the original code. What am I doing wrong?

Thanks for the attention!

  • 2
    Welcome to TeX.SX! It looks like that the template depends on a font Fontin that you do not have. – Heiko Oberdiek Jul 2 '17 at 4:02
  • 2
    Install the font however you usually install fonts on your system. Or comment out the lines loading Fontin. – cfr Jul 2 '17 at 4:13
  • 1
    Add the extension to the font name: \setmainfont[]{Fontin-Regular.ttf} – Ross Jul 2 '17 at 4:18
  • 1
    @cfr Installing fonts locally on one's computer probably won't help the document compile in Overleaf… the interesting thing here is that the screenshot shows the font files as existing in the same directory as the being-compiled main.tex, so presumably it's something about how the name is looked up. – ShreevatsaR Jul 2 '17 at 5:03
  • 1
    @cfr Ah good point, I hadn't noticed it wasn't in the actual text and was only in the tags and in the screenshot… somehow when I read the question it was obvious to me that it was about Overleaf; maybe I noticed the screenshot (and/or tags?) more? Anyway, I've edited it into the title and body of the post just now, to make it easier for future visitors to find this question. – ShreevatsaR Jul 2 '17 at 15:14
12

The original code \setmainfont[SmallCapsFont = Fontin SmallCaps]{Fontin} assumes Fontin has been installed in the operating system's font folder. However, this isn't the case on Overleaf, so you'll need to point fontspec at the OTF files by referring to their file names, rather than by their font names.

To get this to compile on Overleaf using the file structure you have in your screenshot (i.e. all font files on the top level, in the same folder as the .tex file), replace the \setmainfont[SmallCapsFont = Fontin SmallCaps]{Fontin} in the preamble with these instead:

\setmainfont[Path = ./,  %% Optional; but UPDATE this if 
                         %% your font files are in a folder
 Extension = .otf,
 UprightFont = *-Regular,
 BoldFont = *-Bold,
 ItalicFont = *-Italic,
 SmallCapsFont = *-SmallCaps]
{Fontin}

If you put the font files in a folder, remember to update the Path parameter (which actually isn't really necessary in your case if fonts are on the same path as the .tex). Note also that when using filenames like this with fontspec, you'll need to specify the fonts for the bold, italics etc explicitly: fontspec doesn't automatically "deduce" which files to use based on the filename pattern Fontin-Regular.otf, you need to tell it exactly what to use.

Here's a working example on Overleaf: https://www.overleaf.com/read/rnzwwvywcngf

Note that there are a couple other \setmainfont in the body, at the beginning of some tabulars. These are redundant, and I've commented them out in my example Overleaf project above.

For reference, here's the list of OTF/TTF fonts that are available on Overleaf.

  • 2
    With the fonts in the same folder as the .tex file, the path specification is actually not required here. This code works because of the specification of the extension Extension = .otf. The alternative syntax from section 4.2 of the fontspec manual also work here: \setmainfont{Fontin-Regular.otf}[ItalicFont=Fontin-Italic.otf,BoldFont=Fontin-Bold.otf,SmallCapsFont=Fontin-SmallCaps.otf]. – Ross Jul 2 '17 at 8:43
  • 2
    @Ross Thanks for pointing that out; I used a Path there to point out that the fonts can be placed in a folder if desired (perhaps to un-clutter the file hierarchy) but forgot to write that note in. I've updated it now. – LianTze Lim Jul 2 '17 at 11:32
  • Oh, got it! It works! Thank you very much, LianTze Lim! – BadWolf Jul 2 '17 at 15:12

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.