[Tex/LaTex] Circle Font Awesome Icons

circlesfontawesome

I need to circle font awesome icons.
Currently, this is how it looks.
enter image description here

The code for this is:

\usepackage{fontawesome}
\begin{document}
\faDesktop shubhamrathi.in
\faEnvelope hello@shubhamrathi.in
\faPhone +91-9985556304
\faGithub srrathi
\faLinkedin /in/shubhamrrathi

\end{document}

I need icons to be enclosed in a circle like this:

enter image description here

How should this be done? I'm preferably looking for a solution without pstricks ( one which works with Sharelatex)

Best Answer

Here is a solution based on pstricks. I define a \pscircled{#1} command:

\documentclass{article}
\usepackage[utf8]{inputenc} %
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{fontawesome}
\usepackage{pst-node, auto-pst-pdf}
\usepackage{hyperref}

\newcommand\pscircled[1]{%
\raisebox{-0.315\height}{\begin{postscript}
\Cnodeput[radius=2.3ex](0,0){P}{#1}
\end{postscript}}}

\begin{document}

\noindent       
\pscircled{\faDesktop}~\href{www.shubhamrathi.in}{shubhamrathi.in}
\enspace 
\pscircled{\faEnvelope}~hello@shubhamrathi.in
\enspace 
\pscircled{\faPhone}~+91-9985556304\\
%
\pscircled{\faGithub}~srrathi
\enspace 
\pscircled{\faLinkedin}~/in/shubhamrrathi

\end{document} 

enter image description here