FontAwesome font not found?
On my MacBook (running MacTeX 2013 under MacOSX 10.7.5), your example compiles correctly under LuaLaTeX
if I add the instruction \usepackage{fontspec}
:
% !TEX TS-program = lualatex
\documentclass[border=2pt]{standalone}
\usepackage{fontspec}
\usepackage{fontawesome}
\begin{document}
\faTwitter
\end{document}
Addendum: After I downloaded the OpenType version of this font -- BTW, the version at http://fortawesome.github.io/Font-Awesome/ seems to be slightly newer than the one on the CTAN -- and "activated" it by opening it in the FontBook
application and clicking on the "Install" button, the MWE above also compiles correctly under XeLaTeX. This is not exactly surprising, I suppose, as Xe(La)TeX
depends heavily on the underlying operating system for activities such as loading fonts.
Addendum, mid-February 2020: The demo document shown above continues to work correctly under LuaLaTeX when run under TeXLive2019 or MacTeX2019. To get it to compile under XeLaTeX, you will probably need to insert the instruction
\defaultfontfeatures{Path = /usr/local/texlive/2019/texmf-dist/fonts/opentype/public/fontawesome/}
between the instructions \usepackage{fontspec}
and \usepackage{fontawesome}
.
The file FontAwesome.otf
that's distributed with MacTeX2019 has version number 4.6.3. There is a slightly newer version of the OpenType font file -- version 4.7.0, to be precise -- on github. Both 4.6.3 and 4.7.0 date back to 2016. A minor caveat: I haven't actually tested out the slightly newer version of FontAwesome.otf
. However, I believe it should be compatible with the fontawesome
package.
If anyone wants to get this working with xelatex
without installing the font into your system, see section 4.2 By file name of the fontspec.pdf manual:
[Loading the font by file name] is also necessary in XeTeX when loading OpenType fonts that are present within your TEX distribution, such as
/usr/local/texlive/2013/texmf-dist/fonts/opentype/public
. Fonts in such locations are visible to XeTeX but cannot be loaded by font name, only file name; LuaTEX does not have this restriction.
Since fontawesome.sty
simply references the font by name:
% definition of \FA as a shortcut to load the Font Awesome font
\newfontfamily{\FA}{FontAwesome}
We have to set the default Path
to locate the font, before loading fontawesome
:
\documentclass{article}
\usepackage{fontspec}
\defaultfontfeatures{
Path = /usr/local/texlive/2013/texmf-dist/fonts/opentype/public/fontawesome/ }
\usepackage{fontawesome}
\begin{document}
\faTwitter
\end{document}
You may have to change Path
depending on where fontawesome
is installed. Assuming you're using TeX Live, you can find the relative path to the font file by running:
tlmgr info --list fontawesome
Output:
package: fontawesome
category: Package
shortdesc: Font containing web-related icons.
longdesc: The package offers access to the large number of web-related icons provided by the included font. The package requires the package, fontspec, running under XeTeX or LuaTeX.
installed: Yes
revision: 31020
sizes: doc: 173k, run: 101k
relocatable: Yes
cat-version: 3.1.1
cat-date: 2014-04-26 20:05:48 +0200
cat-license: other-free
collection: collection-fontsextra
Included files, by type:
run files:
texmf-dist/fonts/opentype/public/fontawesome/FontAwesome.otf
texmf-dist/tex/latex/fontawesome/fontawesome.sty
doc files:
texmf-dist/doc/latex/fontawesome/README details="Readme"
texmf-dist/doc/latex/fontawesome/fontawesome.pdf
texmf-dist/doc/latex/fontawesome/fontawesome.tex
On Ubuntu, you can install fontawesome using the following command:
sudo apt-get install texlive-fonts-extra