The fontawesome5 package
Provides the icons of Font Awesome 5 as text characters: \faIcon{name}, or one command per icon such as \faGithub and \faEnvelope.
Loading the package
\usepackage{fontawesome5}The icons are characters of a font. They scale with the font size, take the text colour and need no image files. That suits contact lines in a CV, lists with check marks and links to profiles.
The package contains the free icons in three sets: solid (the default), regular (outlined) and brands (logos such as GitHub or LinkedIn). It works with pdfLaTeX, LuaLaTeX and XeLaTeX.
The name in \faIcon{...} is the icon name from the Font Awesome 5 catalogue, for example envelope or file-pdf. Each icon also has its own command: the name in camel case after \fa, so file-pdf becomes \faFilePdf.
Main commands
\faIcon{envelope} | Icon by name, in the solid style. |
\faIcon[regular]{envelope} | The outlined version of the icon. |
\faGithub, \faLinkedin | Brand icons through their own commands. |
\faCheck, \faTimes | Check mark and cross. |
{\Large\faIcon{home}} | The size follows the font size commands. |
\textcolor{red}{\faHeart} | Colour with xcolor. |
\usepackage[fixed]{fontawesome5} | Gives all icons the same width, so they line up in a list. |
Complete example
\documentclass{article}
\usepackage{xcolor}
\usepackage{fontawesome5}
\begin{document}
\faIcon{envelope} mail@example.org \quad
\faIcon{phone} +49 30 1234567 \quad
\faGithub\ example-user
\begin{itemize}
\item[\faCheck] Sample prepared
\item[\textcolor{red}{\faTimes}] Measurement failed
\end{itemize}
{\Large\faIcon[regular]{file-pdf}} Report as PDF
\end{document}Compiled with pdfLaTeX from TeX Live 2023.
Pitfalls
- A name that is not in the free set stops with
Package fontawesome5 Error: The requested icon ... was not found. - Do not load the older package
fontawesome(version 4) in the same document. The second one stops withIncompatible version of Font Awesome already loaded. - Several icon names changed between version 4 and version 5, so
\fa...commands copied from an older template can be undefined.
Related pages
- How-to Write a CV in LaTeX
- Package
pifont - Package
xcolor - Error Undefined control sequence