# How can I use the fontawesome package with XeLaTeX? [duplicate]

I am trying to compile a document using fontawesome with XeLaTeX (see this template https://github.com/ReScience/ReScience-submission/tree/master/article). I have Texlive 2016 installed in Ubuntu (installed directly from Texlive's homepage - not Ubuntu repositories). Texlive's tlmgr claims fontawesome is installed. I seem to find evidence of it here:

\$ kpsewhich fontawesome.map
/usr/local/texlive/2016/texmf-dist/fonts/map/dvips/fontawesome/fontawesome.map


To debug the problem, I am trying to compile the following MWE (test.tex):

\documentclass{article}
\usepackage{fontawesome}
\begin{document}
Test
\end{document}


using the command xelatex test.tex. Where it seems to reach the critical point, the log says:

kpathsea: Running mktextfm FontAwesome
/usr/local/texlive/2016/texmf-dist/web2c/mktexnam: Could not map source abbreviation F for FontAwesome.
/usr/local/texlive/2016/texmf-dist/web2c/mktexnam: Need to update /usr/local/texlive/2016/texmf-dist/fonts/map/fontname/special.map?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input FontAwesome
This is METAFONT, Version 2.7182818 (TeX Live 2016) (preloaded base=mf)

kpathsea: Running mktexmf FontAwesome
! I can't find file FontAwesome'.
<*> ...our; mag:=1; nonstopmode; input FontAwesome

Please type another input file name
! Emergency stop.
<*> ...our; mag:=1; nonstopmode; input FontAwesome

Transcript written on mfput.log.
grep: FontAwesome.log: Ingen sådan fil eller filkatalog
mktextfm: mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input FontAwesome' failed to make FontAwesome.tfm.
kpathsea: Appending font creation commands to missfont.log.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "FontAwesome" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................


I have run updmap-sys and mktexlsr, but that did not seem to help. updmap-sys said (among other things):

Files generated:
/usr/local/texlive/2016/texmf-var/fonts/map/dvips/updmap:
15796 2017-05-10 16:22:38 builtin35.map
1688569 2017-05-10 16:22:39 psfonts_pk.map
1903381 2017-05-10 16:22:38 psfonts_t1.map
1903376 2017-05-10 16:22:38 ps2pk.map
14 2017-05-10 16:22:39 psfonts.map -> psfonts_t1.map
/usr/local/texlive/2016/texmf-var/fonts/map/pdftex/updmap:
1903383 2017-05-10 16:22:39 pdftex_dl14.map
1901718 2017-05-10 16:22:39 pdftex_ndl14.map
15 2017-05-10 16:22:39 pdftex.map -> pdftex_dl14.map
/usr/local/texlive/2016/texmf-var/fonts/map/dvipdfmx/updmap:
319 2017-05-10 16:22:38 kanjix.map


Should there have been a xelatex folder as well? What can I do to fix this?

• Did you add that map to the updmap.cfg file before running updmap-sys? May 10, 2017 at 14:06
• No, I kind of assumed Texlive had taken care of all necessary set-up when I installed it. I see Map fontawesome.map in '/usr/local/texlive/2016/texmf-dist/web2c/updmap.cfg'. Is that correct? May 10, 2017 at 14:09
• That looks correct. If root owns you TeX distribution you need to use sudo updmap-sys. May 10, 2017 at 14:12
• According to Texlive recommendations, I have installed Texlive under a dedicated system user, 'tlusr'. I ran it as sudo -u tlusr updmap-sys and it seemed to work. I am going to amend my question above with some output from it... May 10, 2017 at 14:24
• xelatex doesn't need or use a map, it should use the real font. May 10, 2017 at 14:28

fontawesome loads the font by name: \newfontfamily{\FA}{FontAwesome}. The font (fontawesome.otf) is in the texmf-tree in fonts/opentype/public/fontawesome.

On windows this is fine. Linux-Systems the texmf-tree isn't searched by fontconfig and so the font is not found.

## Possible solutions

### 1. Use a file name:

\documentclass{article}
\usepackage{fontawesome}
\newfontfamily{\FA}{fontawesome.otf}
\begin{document}
\faHourglass
\end{document}


### 2. Copy the font to your system font folder.

https://www.tug.org/texlive/doc/texlive-en/texlive-en.html#x1-340003.4.4

• Trying your solution 1 still fails like before. On closer inspection, the is no 'fontawesome.otf' anywhere in my '/usr/local/texlive' tree. Where should that file have come from? May 10, 2017 at 15:27
• Oh, there is in /usr/local/texlive/2016/texmf-dist/fonts/opentype/public/fontawesome/FontAwesome.otf. However, changing your example to \newfontfamily{\FA}{FontAwesome.otf} does not help. May 10, 2017 at 15:32
• Sorry about the path. Normally it should work if you load it by file name. But I'm on windows so I can't test. Can you load it with \setmainfont{FontAwesome.otf}? May 10, 2017 at 15:49
• Unfortunately not. Everything I try seems to go wrong from where it says kpathsea: Running mktextfm FontAwesome in the log. May 10, 2017 at 16:09
• Ignore map-files. This is not your problem. The problem is why xelatex can't find and load the fontawesome.otf. Perhaps it is due to capitalization. It could matter on linux. Does \newfontfamily{\FA}{FontAwesome.otf} work? May 10, 2017 at 16:15

The FontAwesome documentation says you must use the fontspec package to use with xelatex\documentclass{article} \usepackage{fontspec} \usepackage{fontawesome} \begin{document} \faicon{500px} \end{document}  should do it. Note: see the documentation for a full list of all the macros it defines.

PS: The fully updated full TeX Live 2016 already contains fontawesome so I don't understand why you had to install it.

• I do not recall actually installing the package myself. I just mentioned that tlmgr says it is installed. May 10, 2017 at 15:52
• Unfortunately, your example still gives the same error as quoted in my question... May 10, 2017 at 16:06
• Did you try making a copy of the .otf in your system fonts folder, as suggested? May 10, 2017 at 16:17
• I had not got to that point yet, but it actually works! May 10, 2017 at 16:27
• It also works without fontspec. May 10, 2017 at 16:28