5

I'm looking at this CTAN Package. I don't think it's a part of texlive 2016 which is what overleaf uses.

This means I have to upload files manually to my overleaf project so that I could include them. I downloaded the zip folder available on package, unzipped it and uploaded it to my project with exactly the same directory structure

Next I used the latexmkrc file to configure latex to search the .sty files in the uploaded folder as suggested on their documentation page

This is what my file looks like:

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

Now my latex file compiles, but the icons like \faGithub don't render.

My usecase is that I want to use some of the new icons which are present in fontawesome5 but not in fontawesome4.

Note that when I use the package fontawesome then thing are working.

  • I did not test on overleaf, but the package is included in a full texlive installation. Unless the texlive version on overleaf is too old, I guess it is worth a try to test if it just works without manually configuring anything. – samcarter_is_at_topanswers.xyz Sep 15 '18 at 15:23
  • Ah. In that case it's probably that overleaf's version is old. I did try to just \usepackage{fontaweseom5} but got errors – Peeyush Kushwaha Sep 15 '18 at 15:24
  • the link you give in the first line of your question documents that the package is in texlive and miktex. – David Carlisle Sep 15 '18 at 16:51
  • @DavidCarlisle clarified. Overleaf uses texlive 2016 apparently, which is probably why they don't have it. Seems like I still need to configure it manually though – Peeyush Kushwaha Sep 15 '18 at 17:21
  • Overleaf v1 projects, as well as v1 projects imported into Overleaf v2, uses TeX Live 2016. New projects created on Overleaf v2 uses TeX Live 2017 but fontawesome5 isn't available in that TL2017 version either. – imnothere Sep 16 '18 at 01:46
  • Updated: You can now change your Overleaf project's TeX Live version https://www.overleaf.com/blog/new-feature-select-your-tex-live-compiler-version/ so this should work without further configurations if you switch to TL2019. – imnothere May 19 '20 at 01:49

2 Answers2

7

[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.

imnothere
  • 14,215
  • This is great news, thank you! I was just trying out the fa5 package in a current project and it worked out of the box :) One Question though, i cant't get the Pro icons to work. I own a valid license for Font Awesome 5, is there any chance that you could install the Font Awesome 5 Pro desktop fonts to your system font path? Or is there a way to add those fonts as an Overleaf user? – GlabbichRulz Jun 08 '20 at 21:51
  • 2
    @GlabbichRulz Due to licensing issues, we don't have FontAwesome5 Pro on the server. If you've uploaded the files to your project, you can try using a latexmkrc file to update the OPENTYPEFONTS path. If you run into particular problems, you might want to email support@overleaf.com with your Overleaf project's URL, and we'll try to have a closer look at your project's current folder structure and latexmkrc. – imnothere Jun 09 '20 at 03:50
5

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.

  • I did this. It still compiles but the icons aren't rendering. – Peeyush Kushwaha Sep 27 '18 at 20:45
  • @PeeyushKushwaha That's odd, it works on https://www.overleaf.com/read/qrcvrjhmrrpd . If you created the project using the old Overleaf V1 (TeX Live 2016), you can try to copy your project in the projects list. This creates a new project with the same content, so you keep everything but the copy is created by Overleaf V2 such that it uses TeX Live 2017. – Marcel Krüger Sep 27 '18 at 23:09
  • Accepted since the link you provided is working. I'd suggest adding it to the answer itself, since people can then clone project. I'm still facing errors but it's probably more of a template issue, don't think it's a 2016/17 issue – Peeyush Kushwaha Oct 24 '18 at 12:17