Articles

Font Awesome in pdfTeX

In howto on Jan 15, 2016 by theoryl Tagged: , , , , , , ,

Font Awesome is a font that provides scalable icons that can easily be used in text. It can even be used in TeX!

This is for pdfTeX 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian), which I obtained directly from the Ubuntu 14.04 official repository. The fontawesome package (v3.1.1) in this distribution does not work with pdfLaTeX. (It can only be used with XeLaTeX or LuaLaTeX.) But the latest version of fontawesome (v4.4.0 2015-07-30) includes type1 conversion of the font and is usable with pdfLaTeX. See https://www.ctan.org/tex-archive/fonts/fontawesome for more detail.

The zip file available for download from CTAN does not have the correct “TDS” layout though, so it cannot be directly installed. See http://www.tex.ac.uk/FAQ-instt1font.html for detail.

Thus, to really install fontawesome, the following is what I did. First, download the zip file.

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

Unzip it.

unzip fontawesome.zip

Put the files according to the correct layout (see https://www.tug.org/svn/texlive?view=revision&revision=38013) in the local “texmf” area: ~/texmf/.

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/

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/

cd ..
rm -rf fontawesome

Finish the installation. See https://tug.org/fonts/fontinstall-personal.html.

updmap

Verify that the map file has been registered.

kpsewhich fontawesome.map

Now, try to pdfLaTeX this guy:

\documentclass{article}
\usepackage{fontawesome}

\begin{document}

{Normal \faAdjust}
{\Huge Huge \faAdjust}

\end{document}

If pdfLaTeX doesn’t complain, you’re good!

Advertisements

One Response to “Font Awesome in pdfTeX”

  1. […] 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 […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: