Use Fontawesome with pdfLatex

Using Fontawesome in Documents

Fontawesome offers more than 600 scalable vector icons which can be used via CSS. The same icon kit is also available for being used in Latex. Since recently, the package was only available for Xelatex and LuaTex, but it is now also available for pdfLatex. The installation is a bit tricky, which I would like to share with you how I managed to install the font for Latex.

Get Hold of the Package

You can download the package from CTAN and store it locally on your drive. Alternatively you can also use wget:

wget http://mirrors.ctan.org/fonts/fontawesome.zip

Obey the Structure!

The TexLive system utilises a special directory structure for finding the packages and their content. The package we obtained from CTAN does currently not comply with the given structure, which is why the installation procedure differs a little bit from the norm. You should know that TexLive utilises several repositories for storing packages. A global one in the directory /usr/local/share/texmf  and a local one in the home directory, usually ~/texmf . You can print the directory that TexLive is using withthe following command:

psewhich -var-value=TEXMFHOME

We will install fontawesome in the user’s directory as this does not require root privileges. Upon googling for a little while, I found this helpful post, which describes how to copy the needed tiles to their  appropriate location. First, we create the directory structure in the local TexLive repository of the user.

mkdir -p ~/texmf/
mkdir -p ~/texmf/doc/fonts/fontawesome/
mkdir -p ~/texmf/fonts/enc/dvips/fontawesome/
mkdir -p ~/texmf/fonts/map/dvips/fontawesome/
mkdir -p ~/texmf/fonts/opentype/public/fontawesome/
mkdir -p ~/texmf/fonts/tfm/public/fontawesome/
mkdir -p ~/texmf/fonts/type1/public/fontawesome/
mkdir -p ~/texmf/tex/latex/fontawesome/

In the second step, unzip the package file and copy the content into the directory structure:

unzip fontawesome.zip
cd fontawesome
mv README.md ~/texmf/doc/fonts/fontawesome/
mv doc/* ~/texmf/doc/fonts/fontawesome/
mv enc/* ~/texmf/fonts/enc/dvips/fontawesome/
mv map/* ~/texmf/fonts/map/dvips/fontawesome/
mv opentype/* ~/texmf/fonts/opentype/public/fontawesome/
mv tfm/* ~/texmf/fonts/tfm/public/fontawesome/
mv type1/* ~/texmf/fonts/type1/public/fontawesome/
mv tex/* ~/texmf/tex/latex/fontawesome/

Now everything is in the right place. Following the blog post I linked above unfortunately leads to an error, that the map file cannot be found. What was missing in the original post is that you need to provide the name of the map file, such that the update tool can actually find it. Reading the linked documentation actually helped and I found the trick. We need to create a directory called web2c in the ~/texmf directory and create a file called updmap.cfg. This file needs to point to the map file of Fontawesome and we are all set:

user:~/texmf$ cat web2c/updmap.cfg 
Map fontawesome.map

Install the new Font

Then we can proceed as described and update the package manager of TexLive and install the font like this:

texhash ~/texmf 
updmap
kpsewhich fontawesome.map

Try it!

This minimal example shows how to test and use the Fontawesome package.

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{fontawesome}

\title{Using Fontawesome in Latex  \faThumbsUp}
\author{Stefan}

\begin{document}

\maketitle
\section{Why Fontawesome?}
Using fontawesome allows creating iconic texts. Also there are a lot of social media icons available,
 such as \faFacebook, \faTwitter or \faLinkedin. And there is no need 
for Windings\footnote{https://en.wikipedia.org/wiki/Wingdings} anymore for creating awesome picture stories.
\section{Wordpress}
\begin{tiny} \faWordpress \end{tiny}
\begin{small} \faWordpress \end{small}
\begin{normalsize} \faWordpress \end{normalsize}
\begin{LARGE} \faWordpress \end{LARGE} 
\begin{Huge} \faWordpress \end{Huge}
\end{document}

The final result looks like this. Isn’t it beautiful?

Fontawesome Example

5 thoughts on “Use Fontawesome with pdfLatex

  1. Thank you very much for your time to put this guideline up for others. Helped me save time.

  2. Hello Stefan,
    I followed your instructions (on a fedora 20 installation + TeXlive 2014).
    Unfortunately I get an error message (see the end of the log file below )
    Is this easy to repair?
    Thanks in advance for helping me out.
    Best regards,
    Jan de Ruijter

    log-file after running your example in TeXmaker.

    ======================
    This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex 2014.9.29) 7 JAN 2017 14:48
    entering extended mode
    restricted \write18 enabled.
    %&-line parsing enabled.
    **fontawesome-test.tex
    (./fontawesome-test.tex
    LaTeX2e
    Babel and hyphenation patterns for 78 languages loaded.
    (/usr/local/texlive/2014/texmf-dist/tex/latex/base/article.cls
    Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
    (/usr/local/texlive/2014/texmf-dist/tex/latex/base/size10.clo
    File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
    )
    \c@part=\count79
    \c@section=\count80
    \c@subsection=\count81
    \c@subsubsection=\count82
    \c@paragraph=\count83
    \c@subparagraph=\count84
    \c@figure=\count85
    \c@table=\count86
    \abovecaptionskip=\skip41
    \belowcaptionskip=\skip42
    \bibindent=\dimen102
    )
    (/usr/local/texlive/2014/texmf-dist/tex/latex/base/inputenc.sty
    Package: inputenc 2014/04/30 v1.2b Input encoding file
    \inpenc@prehook=\toks14
    \inpenc@posthook=\toks15
    (/usr/local/texlive/2014/texmf-dist/tex/latex/base/utf8.def
    File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
    Now handling font encoding OML …
    … no UTF-8 mapping file for font encoding OML
    Now handling font encoding T1 …
    … processing UTF-8 mapping file for font encoding T1
    (/usr/local/texlive/2014/texmf-dist/tex/latex/base/t1enc.dfu
    File: t1enc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc
    defining Unicode char U+00A1 (decimal 161)
    defining Unicode char U+00A3 (decimal 163)
    defining Unicode char U+00AB (decimal 171)
    defining Unicode char U+00BB (decimal 187)
    defining Unicode char U+00BF (decimal 191)
    defining Unicode char U+00C0 (decimal 192)
    defining Unicode char U+00C1 (decimal 193)
    defining Unicode char U+00C2 (decimal 194)
    defining Unicode char U+00C3 (decimal 195)
    defining Unicode char U+00C4 (decimal 196)
    defining Unicode char U+00C5 (decimal 197)
    defining Unicode char U+00C6 (decimal 198)
    defining Unicode char U+00C7 (decimal 199)
    defining Unicode char U+00C8 (decimal 200)
    defining Unicode char U+00C9 (decimal 201)
    defining Unicode char U+00CA (decimal 202)
    defining Unicode char U+00CB (decimal 203)
    defining Unicode char U+00CC (decimal 204)
    defining Unicode char U+00CD (decimal 205)
    defining Unicode char U+00CE (decimal 206)
    defining Unicode char U+00CF (decimal 207)
    defining Unicode char U+00D0 (decimal 208)
    defining Unicode char U+00D1 (decimal 209)
    defining Unicode char U+00D2 (decimal 210)
    defining Unicode char U+00D3 (decimal 211)
    defining Unicode char U+00D4 (decimal 212)
    defining Unicode char U+00D5 (decimal 213)
    defining Unicode char U+00D6 (decimal 214)
    defining Unicode char U+00D8 (decimal 216)
    defining Unicode char U+00D9 (decimal 217)
    defining Unicode char U+00DA (decimal 218)
    defining Unicode char U+00DB (decimal 219)
    defining Unicode char U+00DC (decimal 220)
    defining Unicode char U+00DD (decimal 221)
    defining Unicode char U+00DE (decimal 222)
    defining Unicode char U+00DF (decimal 223)
    defining Unicode char U+00E0 (decimal 224)
    defining Unicode char U+00E1 (decimal 225)
    defining Unicode char U+00E2 (decimal 226)
    defining Unicode char U+00E3 (decimal 227)
    defining Unicode char U+00E4 (decimal 228)
    defining Unicode char U+00E5 (decimal 229)
    defining Unicode char U+00E6 (decimal 230)
    defining Unicode char U+00E7 (decimal 231)
    defining Unicode char U+00E8 (decimal 232)
    defining Unicode char U+00E9 (decimal 233)
    defining Unicode char U+00EA (decimal 234)
    defining Unicode char U+00EB (decimal 235)
    defining Unicode char U+00EC (decimal 236)
    defining Unicode char U+00ED (decimal 237)
    defining Unicode char U+00EE (decimal 238)
    defining Unicode char U+00EF (decimal 239)
    defining Unicode char U+00F0 (decimal 240)
    defining Unicode char U+00F1 (decimal 241)
    defining Unicode char U+00F2 (decimal 242)
    defining Unicode char U+00F3 (decimal 243)
    defining Unicode char U+00F4 (decimal 244)
    defining Unicode char U+00F5 (decimal 245)
    defining Unicode char U+00F6 (decimal 246)
    defining Unicode char U+00F8 (decimal 248)
    defining Unicode char U+00F9 (decimal 249)
    defining Unicode char U+00FA (decimal 250)
    defining Unicode char U+00FB (decimal 251)
    defining Unicode char U+00FC (decimal 252)
    defining Unicode char U+00FD (decimal 253)
    defining Unicode char U+00FE (decimal 254)
    defining Unicode char U+00FF (decimal 255)
    defining Unicode char U+0102 (decimal 258)
    defining Unicode char U+0103 (decimal 259)
    defining Unicode char U+0104 (decimal 260)
    defining Unicode char U+0105 (decimal 261)
    defining Unicode char U+0106 (decimal 262)
    defining Unicode char U+0107 (decimal 263)
    defining Unicode char U+010C (decimal 268)
    defining Unicode char U+010D (decimal 269)
    defining Unicode char U+010E (decimal 270)
    defining Unicode char U+010F (decimal 271)
    defining Unicode char U+0110 (decimal 272)
    defining Unicode char U+0111 (decimal 273)
    defining Unicode char U+0118 (decimal 280)
    defining Unicode char U+0119 (decimal 281)
    defining Unicode char U+011A (decimal 282)
    defining Unicode char U+011B (decimal 283)
    defining Unicode char U+011E (decimal 286)
    defining Unicode char U+011F (decimal 287)
    defining Unicode char U+0130 (decimal 304)
    defining Unicode char U+0131 (decimal 305)
    defining Unicode char U+0132 (decimal 306)
    defining Unicode char U+0133 (decimal 307)
    defining Unicode char U+0139 (decimal 313)
    defining Unicode char U+013A (decimal 314)
    defining Unicode char U+013D (decimal 317)
    defining Unicode char U+013E (decimal 318)
    defining Unicode char U+0141 (decimal 321)
    defining Unicode char U+0142 (decimal 322)
    defining Unicode char U+0143 (decimal 323)
    defining Unicode char U+0144 (decimal 324)
    defining Unicode char U+0147 (decimal 327)
    defining Unicode char U+0148 (decimal 328)
    defining Unicode char U+014A (decimal 330)
    defining Unicode char U+014B (decimal 331)
    defining Unicode char U+0150 (decimal 336)
    defining Unicode char U+0151 (decimal 337)
    defining Unicode char U+0152 (decimal 338)
    defining Unicode char U+0153 (decimal 339)
    defining Unicode char U+0154 (decimal 340)
    defining Unicode char U+0155 (decimal 341)
    defining Unicode char U+0158 (decimal 344)
    defining Unicode char U+0159 (decimal 345)
    defining Unicode char U+015A (decimal 346)
    defining Unicode char U+015B (decimal 347)
    defining Unicode char U+015E (decimal 350)
    defining Unicode char U+015F (decimal 351)
    defining Unicode char U+0160 (decimal 352)
    defining Unicode char U+0161 (decimal 353)
    defining Unicode char U+0162 (decimal 354)
    defining Unicode char U+0163 (decimal 355)
    defining Unicode char U+0164 (decimal 356)
    defining Unicode char U+0165 (decimal 357)
    defining Unicode char U+016E (decimal 366)
    defining Unicode char U+016F (decimal 367)
    defining Unicode char U+0170 (decimal 368)
    defining Unicode char U+0171 (decimal 369)
    defining Unicode char U+0178 (decimal 376)
    defining Unicode char U+0179 (decimal 377)
    defining Unicode char U+017A (decimal 378)
    defining Unicode char U+017B (decimal 379)
    defining Unicode char U+017C (decimal 380)
    defining Unicode char U+017D (decimal 381)
    defining Unicode char U+017E (decimal 382)
    defining Unicode char U+200C (decimal 8204)
    defining Unicode char U+2013 (decimal 8211)
    defining Unicode char U+2014 (decimal 8212)
    defining Unicode char U+2018 (decimal 8216)
    defining Unicode char U+2019 (decimal 8217)
    defining Unicode char U+201A (decimal 8218)
    defining Unicode char U+201C (decimal 8220)
    defining Unicode char U+201D (decimal 8221)
    defining Unicode char U+201E (decimal 8222)
    defining Unicode char U+2030 (decimal 8240)
    defining Unicode char U+2031 (decimal 8241)
    defining Unicode char U+2039 (decimal 8249)
    defining Unicode char U+203A (decimal 8250)
    defining Unicode char U+2423 (decimal 9251)
    )
    Now handling font encoding OT1 …
    … processing UTF-8 mapping file for font encoding OT1
    (/usr/local/texlive/2014/texmf-dist/tex/latex/base/ot1enc.dfu
    File: ot1enc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc
    defining Unicode char U+00A1 (decimal 161)
    defining Unicode char U+00A3 (decimal 163)
    defining Unicode char U+00B8 (decimal 184)
    defining Unicode char U+00BF (decimal 191)
    defining Unicode char U+00C5 (decimal 197)
    defining Unicode char U+00C6 (decimal 198)
    defining Unicode char U+00D8 (decimal 216)
    defining Unicode char U+00DF (decimal 223)
    defining Unicode char U+00E6 (decimal 230)
    defining Unicode char U+00EC (decimal 236)
    defining Unicode char U+00ED (decimal 237)
    defining Unicode char U+00EE (decimal 238)
    defining Unicode char U+00EF (decimal 239)
    defining Unicode char U+00F8 (decimal 248)
    defining Unicode char U+0131 (decimal 305)
    defining Unicode char U+0141 (decimal 321)
    defining Unicode char U+0142 (decimal 322)
    defining Unicode char U+0152 (decimal 338)
    defining Unicode char U+0153 (decimal 339)
    defining Unicode char U+2013 (decimal 8211)
    defining Unicode char U+2014 (decimal 8212)
    defining Unicode char U+2018 (decimal 8216)
    defining Unicode char U+2019 (decimal 8217)
    defining Unicode char U+201C (decimal 8220)
    defining Unicode char U+201D (decimal 8221)
    )
    Now handling font encoding OMS …
    … processing UTF-8 mapping file for font encoding OMS
    (/usr/local/texlive/2014/texmf-dist/tex/latex/base/omsenc.dfu
    File: omsenc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc
    defining Unicode char U+00A7 (decimal 167)
    defining Unicode char U+00B6 (decimal 182)
    defining Unicode char U+00B7 (decimal 183)
    defining Unicode char U+2020 (decimal 8224)
    defining Unicode char U+2021 (decimal 8225)
    defining Unicode char U+2022 (decimal 8226)
    )
    Now handling font encoding OMX …
    … no UTF-8 mapping file for font encoding OMX
    Now handling font encoding U …
    … no UTF-8 mapping file for font encoding U
    defining Unicode char U+00A9 (decimal 169)
    defining Unicode char U+00AA (decimal 170)
    defining Unicode char U+00AE (decimal 174)
    defining Unicode char U+00BA (decimal 186)
    defining Unicode char U+02C6 (decimal 710)
    defining Unicode char U+02DC (decimal 732)
    defining Unicode char U+200C (decimal 8204)
    defining Unicode char U+2026 (decimal 8230)
    defining Unicode char U+2122 (decimal 8482)
    defining Unicode char U+2423 (decimal 9251)
    ))
    (/usr/local/texlive/2014/texmf-dist/tex/latex/fontawesome/tex/fontawesome.sty
    Package: fontawesome 2016/05/15 v4.6.3.1 font awesome icons
    (/usr/local/texlive/2014/texmf-dist/tex/generic/ifxetex/ifxetex.sty
    Package: ifxetex 2010/09/12 v0.6 Provides ifxetex conditional
    )
    (/usr/local/texlive/2014/texmf-dist/tex/generic/oberdiek/ifluatex.sty
    Package: ifluatex 2010/03/01 v1.3 Provides the ifluatex switch (HO)
    Package ifluatex Info: LuaTeX not detected.
    )
    (/usr/local/texlive/2014/texmf-dist/tex/latex/fontawesome/tex/fontawesomesymbol
    s-generic.tex)
    (/usr/local/texlive/2014/texmf-dist/tex/latex/fontawesome/tex/fontawesomesymbol
    s-pdftex.tex)) (./fontawesome-test.aux)
    \openout1 = `fontawesome-test.aux’.
    LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 8.
    LaTeX Font Info: … okay on input line 8.
    LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 8.
    LaTeX Font Info: … okay on input line 8.
    LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 8.
    LaTeX Font Info: … okay on input line 8.
    LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 8.
    LaTeX Font Info: … okay on input line 8.
    LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 8.
    LaTeX Font Info: … okay on input line 8.
    LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 8.
    LaTeX Font Info: … okay on input line 8.
    LaTeX Font Info: Try loading font information for U+fontawesomeone on input
    line 10.
    (/usr/local/texlive/2014/texmf-dist/tex/latex/fontawesome/tex/ufontawesomeone.f
    d
    File: ufontawesomeone.fd 2016/05/22 Font definitions for U/fontawesomeone.
    )
    LaTeX Font Info: External font `cmex10′ loaded for size
    (Font) on input line 10.
    LaTeX Font Info: External font `cmex10′ loaded for size
    (Font) on input line 10.
    LaTeX Font Info: External font `cmex10′ loaded for size
    (Font) on input line 10.
    LaTeX Font Info: Try loading font information for U+fontawesometwo on input
    line 13.
    (/usr/local/texlive/2014/texmf-dist/tex/latex/fontawesome/tex/ufontawesometwo.f
    d
    File: ufontawesometwo.fd 2016/05/22 Font definitions for U/fontawesometwo.
    )
    LaTeX Font Info: Try loading font information for U+fontawesomethree on inpu
    t line 13.
    (/usr/local/texlive/2014/texmf-dist/tex/latex/fontawesome/tex/ufontawesomethree
    .fd
    File: ufontawesomethree.fd 2016/05/22 Font definitions for U/fontawesomethree.
    )
    LaTeX Font Info: External font `cmex10′ loaded for size
    (Font) on input line 14.
    LaTeX Font Info: External font `cmex10′ loaded for size
    (Font) on input line 14.
    [1
    {/usr/local/texlive/2014/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
    (./fontawesome-test.aux) )
    Here is how much of TeX’s memory you used:
    1979 strings out of 493117
    26268 string characters out of 6135439
    73891 words of memory out of 5000000
    5471 multiletter control sequences out of 15000+600000
    9952 words of font info for 35 fonts, out of 8000000 for 9000
    1141 hyphenation exceptions out of 8191
    24i,8n,19p,239b,187s stack positions out of 5000i,500n,10000p,200000b,80000s
    !pdfTeX error: pdflatex (file FontAwesome–fontawesomeone): Font FontAwesome–f
    ontawesomeone at 1493 not found
    ==> Fatal error occurred, no output PDF file produced!

  3. I tried to find out if this contains some clues how to solve the pdflatex problem,
    unfortunately I didn’t succeed.
    Anyway thanks for trying to help me.
    Best regards,
    Jan

  4. I also got a not found error, it’s because I put updmap.cfg in the wrong folder, after making sure I’d done everything right, it worked!!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.