4

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. – user36296 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. – LianTze Lim Sep 16 '18 at 1:46
4

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

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.