5

The following does not work:

\documentclass{standalone}
\usepackage{fontawesome}
\begin{document}
\faHourglass
\end{document}

I get:

Use of \faHourglass doesn't match its definition \end

This is the only symbol in the fontawesome package that does not work for me. Any ideas why?

kaba
  • 599
  • Try -- \def\faHourglass{\faicon{hourglass}} after \usepackage{fontawesome} -- this looks like a bug in the package –  May 15 '16 at 20:39
  • 1
    It is a bug. The package also define \faHourglass1 and this is simply wrong. A number of other symbols are faulty too e.g. \faBattery4. – Ulrike Fischer May 15 '16 at 20:44
  • Note that \faHourglass3 will work because the package has overwritten its initial definition of faHourglass in a way which requires it to be followed by 3. However, it may not give you the particular hourglass symbol you want. – cfr May 15 '16 at 20:53
  • https://github.com/xdanaux/fontawesome-latex/issues/3 – cfr May 15 '16 at 21:53

2 Answers2

3

The package does

\def\faHtml5{\faicon{html5}}

\def\faCss3{\faicon{css3}}

\def\faBattery3{\faicon{battery-3}}

\def\faBattery4{\faicon{battery-4}}

\def\faHourglass1{\faicon{hourglass-1}}

\def\faBattery0{\faicon{battery-0}}

\def\faBattery2{\faicon{battery-2}}

\def\faHourglass2{\faicon{hourglass-2}}

\def\faBattery1{\faicon{battery-1}}

\def\faHourglass3{\faicon{hourglass-3}}

While the first two give no real problem, provided you always use the literal input, the \faHourglass and \faBattery families will not work; only \faBattery1 and \faHourglass3 are legal.

I suggest fixing them like

\documentclass[border=2]{standalone}
\usepackage{fontawesome}

% fix the wrong symbols
\renewcommand{\faHourglass}[1][]{%
  \faicon{hourglass\if\relax\detokenize{#1}\relax\else-#1\fi}%
}
\renewcommand{\faBattery}[1][4]{%
  \faicon{battery-#1}%
}

\begin{document}

\faHourglass\ \faHourglass[1]\ \faHourglass[2]\ \faHourglass[3]

\faBattery\ \faBattery[0]\ \faBattery[1]\ \faBattery[2]\ \faBattery[3]\ \faBattery[4]

\end{document}

enter image description here

Or you can simply fix \faHourglass and use the already existing synonyms.

\documentclass[border=2]{standalone}
\usepackage{fontawesome}

% fix the wrong symbol 
\renewcommand{\faHourglass}{\faicon{hourglass}}

\begin{document}

\faHourglass\ \faHourglassStart\ \faHourglassHalf\ \faHourglassEnd\ \faHourglassO

\faBatteryEmpty\ \faBatteryQuarter\ \faBatteryHalf\ \faBatteryThreeQuarters\ \faBatteryFull

\end{document}

enter image description here

Both tested with pdflatex, xelatex and lualatex. Be sure to have the last version of FontAwesome.otf.

egreg
  • 1,121,712
0

Here is a workaround – redefine \faHourglass:

\documentclass{article}
\usepackage{fontawesome}
\usepackage{ifxetex}
\def\faHourglass{\ifxetex\FA\symbol{"F254}\else\FAone\symbol{169}\fi}%

\begin{document}

\begin{tabular}{ccccc}
  \faHourglassO & \faHourglass & %
  \faHourglassStart & \faHourglassEnd & \faHourglassHalf%\
\end{tabular}

\end{document} 

enter image description here

Bernard
  • 271,350