Configuring fontawesome5 on overleaf

The line

$ENV{'TEXINPUTS'}='./fontawesome5///:' . $ENV{'TEXINPUTS'};

tells TeX where to look for the TeX files in the package, but not where to find the actual font.

To access the font with pdfTeX, TeX needs to know where to find some additional kinds of files:

  • Font metrics (.tfm files in dir tfm) The ENV variable is TFMFONTS
  • Encoding vectors (.enc files in dir enc) The ENV variable is ENCFONTS
  • The actual fonts (in Type 1 format) (.pfb files in dir type1) The ENV variable is T1FONTS
  • Font maps (.map files in dir map) The ENV variable is TEXFONTMAPS

Additionally TeX needs to know that it has to load the font map from fontawesome5.

So you need to add

\pdfmapfile{+fontawesome5.map}

in the preable of your document and write

$ENV{'TEXINPUTS'}='./fontawesome5/tex/:' . $ENV{'TEXINPUTS'};
$ENV{'TFMFONTS'}='./fontawesome5/tfm/:' . $ENV{'TFMFONTS'};
$ENV{'ENCFONTS'}='./fontawesome5/enc/:' . $ENV{'ENCFONTS'};
$ENV{'T1FONTS'}='./fontawesome5/type1/:' . $ENV{'T1FONTS'};
$ENV{'TEXFONTMAPS'}='./fontawesome5/map/:' . $ENV{'TEXFONTMAPS'};

in your latexmkrc.


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

As of May 2020, you can change your Overleaf project's TeX Live version via the Overleaf project menu. fontawesome5 should work without further configurations if you switch to TL2019.