6

I am trying to use fontawesome package with BasicTex distribution with the following code:

\documentclass{article}
\usepackage{fontawesome}
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} 
\newfontfamily{\FA}{Font Awesome 5 Brands}

\begin{document}

\end{document}   

It compiles and doesn't give me any errors. However, it doesn't show any symbols when I try to use the logos such as:

\faTwitter
\faLinkedin
\faEnvelope

I am new to latex so I tried to solve this problem by trying other people's answers but none of them worked. But, if I set the main font :

 \setmainfont{Font Awesome 5 Brands Regular}

it shows ALL the logos except envelope and phone. However, it automatically changes some text into symbols such as Java, python. Any ideas on how to solve this?

note: I am using texmaker with BasicTex. I have all the packages in the current folder that I am compiling. I installed the fonts Font Awesome 5 Free Regular and Font Awesome 5 Brands Regular in Font Book. When I compile it doesn't give me any errors but these warnings:

Underfull \hbox (badness 4279) in paragraph at lines 78--80
You are not using babel.sty
  • Smaller installation of MacTex. I can see the font in my Font Book and sty file and font files also in the folder for this particular text file I am compiling. – ege Jun 6 '18 at 0:29
6

You try to use the fontawesome package, but this package is only compatible with Font Awesome 4. It will lead to problems with Font Awesome 5, especially since there is no longer a single font including all of Font Awesome.

Instead you can use the fontawesome5 package:

\documentclass{article}
\usepackage{fontawesome5}

\begin{document}
Twitter: \faTwitter
LinkedIn: \faLinkedin
Envelope: \faEnvelope
\end{document}   

enter image description here

Disclaimer: I am the maintainer of fontawesome5.

  • Thank you. But this time I am getting another error - Undefined sequences for each of those lines in document: \faTwitter, etc. Could it be because of my fontawesome5.sty file? – ege Jun 6 '18 at 0:26
  • @ege Try to update your TeX installation. Maybe you have to add the new package. – Dr. Manuel Kuehner Jun 9 '18 at 22:17
  • @ege Which engine are you using? Does this happen with LuaTeX and XeTeX? Does pdfTeX work? – Marcel Krüger Jun 9 '18 at 23:00
  • @MarcelKrüger I tried to use both LuaTeX and XeteX with BasicTeX package(small TeX package for mac). I installed the recommended package MacTeX and now everything works perfectly. Thank you. – ege Jul 1 '18 at 5:33
1

To be able to use Font Awesome 5 with [Xe/Lua]LaTeX, the easiest solution is probably to install the font on your system and access it through the package commands from fontawesome5 for the respective symbols (like you show in your MWE). There are other possibilities, if you don't want to install them system wide, but this is for another question.

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.