# fontawesome scaling, deedy-resume pgfplots axis, XeTeX, LuaTeX issues

I am currently working on a document using the deedy-resume template

http://www.latextemplates.com/template/deedy-resume-cv

in LaTeX and I have two issues which result in a dilemma and I can't resolve it.

I am using the package fontawesome to embed icons within text and pgfplots to create charts.

Issue #1:

When I complile the document with XeLaTeX, the scaling of the fontawesome icons differs between viewers (Adobe Reader, Evince, etc.)

Solution: Use LuaLaTeX - no scaling probelms

Issue #2:

When I compile the document with LuaLaTeX the paremeter

x axis line style={opacity=0},


to hide margin lines but keep axis labels is ineffective within the tikzpicture - axis enviroment. It works fine with XeLaTeX, though.

Relevant LaTeX snippets:

\documentclass[lettera4paper]{deedy-resume}

\usepackage{fontspec}
\usepackage{fontawesome}
\usepackage{pgfplots}

\begin{document}
\section{Icons}

\begin{tabular}{lll}

\faSmile{} Smile :) &  \faHospital{} Hospital & plain text

\end{tabular}

\section{Bar chart}

\definecolor{color1}{HTML}{666666}
\begin{tikzpicture}
\begin{axis}[
xbar,
x axis line style={opacity=0},
enlargelimits=0.1,
major tick style={draw=none},
legend style={draw=none},
xmin=0,
symbolic x coords={0,1,2,3,4,5,6},
symbolic y coords={A,B,C,D,E,F},
xtick={0,1,2,3,4,5,6},
ytick={A,B,C,D,E,F},
bar width=0.7em,
xmajorgrids,
major grid style=white,
axis on top,
cycle list={fill=color1, draw=none},
]
\addplot coordinates {(6,A) (5,B) (3,C) (4,D) (3,E) (1,F)};
\end{axis}
\end{tikzpicture}
\end{document}


## 2 Answers

The problem with oversized fonts in adobe reader comes from a bug with XeLaTex when using fonts in OTF format that have a particular resolution (see http://typophile.com/node/46451). What I do to circumvent this issue is to work locally with the .ttf version of FontAwesome. Added benefits to this is to make the new fonts available to you, it's easier to share your work afterwards, and it is platform independent. Here is what I do:

• I download the latest version of the font here http://fortawesome.github.io/Font-Awesome/
• I extract the files and copy the file named "fontawesome-webfont.ttf" locally where my latex document is in a subfolder (named fonts for example).
• I load the font with the fontspec package to redefine the \FA fontfamily.

Here is the modified example of the MWE your provided:

\documentclass[lettera4paper]{deedy-resume}

\usepackage{fontspec}
\usepackage{fontawesome}
\usepackage{pgfplots}

\newfontfamily{\FA}[Path = fonts/]{fontawesome-webfont}

\begin{document}
\section{Icons}

\begin{tabular}{lll}

\faSmile{} Smile :) &  \faHospital{} Hospital & plain text

\end{tabular}

\section{Bar chart}

\definecolor{color1}{HTML}{666666}
\begin{tikzpicture}
\begin{axis}[
xbar,
x axis line style={opacity=0},
enlargelimits=0.1,
major tick style={draw=none},
legend style={draw=none},
xmin=0,
symbolic x coords={0,1,2,3,4,5,6},
symbolic y coords={A,B,C,D,E,F},
xtick={0,1,2,3,4,5,6},
ytick={A,B,C,D,E,F},
bar width=0.7em,
xmajorgrids,
major grid style=white,
axis on top,
cycle list={fill=color1, draw=none},
]
\addplot coordinates {(6,A) (5,B) (3,C) (4,D) (3,E) (1,F)};
\end{axis}
\end{tikzpicture}
\end{document}


Which yields in adobe reader 9 in Ubuntu 14.04 when compiling with XeLaTex to :

How-to define new font manually:

You can also define the command for the fonts by yourself instead of using the fontawesome package. Let's see for the new font for github for example :

• Define and use it like this :

\documentclass{article}

\usepackage{fontspec}

\newfontfamily{\FA}[Path = fonts/]{fontawesome-webfont}

\def\githubAlt{{\FA\symbol{"F113}}}

\begin{document}
GitHub icon: \githubAlt
\end{document}


Which yields to:

This is a solution for the first issue (taken from here):

• Download the latest version of fontawesome from their site: http://fortawesome.github.io/Font-Awesome/
• Install the .ttf version of the font (by simply double clicking the file on the most operating systems)
• Replace the line \newfontfamily{\FA}{FontAwesome} in your fontawesome.sty file with \newfontfamily{\FA}{FontAwesome Regular}

This solved the scaling issue for me. Take a look at link above for technical details.

• Hey thank you for your suggestion. I also found that solution, but may I ask you do you mean fontawesome-webfont.ttf ? It is the only true type font delivered in the most recent package. Following your instructions it says that FontAwesome Regular couldn't be found. ! fontspec error: "font-not-found" ! ! The font "FontAwesome Regluar" cannot be found. – Patryk Apr 22 '15 at 12:25
• I'm sorry, seems like the name got changed or the font handling differs between operating systems. The other answer is better anyways ;-) – JBantje Apr 22 '15 at 15:09
• @Patryk It's not called FontAwesome Regluar, but FontAwesome Regular; anyway, in Plain XeTeX, I should use \font\FA="FontAwesome" at 10pt. Your mileage may vary. – Marcel Korpel Apr 22 '15 at 15:18
• @MarcelKorpel Thank you for this! I wouldn't have noticed myself probably. It didn't help though! – Patryk Apr 27 '15 at 14:07