# Extending moderncv social command

I wrote the following code:

\documentclass[11pt,a4paper,sans]{moderncv}

\moderncvstyle{casual}
\moderncvcolor{blue}
\usepackage[scale=0.75]{geometry}

\makeatletter
\makeatother

\name{John}{Doe}

\begin{document}

\makecvtitle

\end{document}


which add a clickable Skype profile on the CV.

Is there a way to extend the existing social command in order to accept Skype as optional parameter, in order to write a more readable thing like this?

\social[skype]{jdoe}


Now it is possible to do it this way:

\newcommand*\skypesocialsymbol{{\FA\symbol{"F17E}}}
\social[skype][skype.com/user/jdoe]{jdoe}


You just have to change the url accordingly.

• Not-a-LaTeX-expert here. I love your one-liner solution. I had to adapt it though: \newcommand*\skypesocialsymbol{{\faSkype~}} worked. – Morgan Courbet Apr 12 '18 at 10:07
• @MorganCourbet's solution works well. It simply requires the fontawesome package. – myrdd May 23 '18 at 9:53

The following code in the preamble does the trick!

% hlink
\makeatletter
\ifthenelse{\equal{#1}{}}%
{\href{#2}{#2}}%
{\href{#2}{#1}}}
\makeatother

% social
\makeatletter
\RenewDocumentCommand{\social}{O{}O{}m}{%
\ifthenelse{\equal{#2}{}}%
{%
}
\makeatother


## Step by step explanation:

Create a "hlink" command: This is needed because the skype link is not a link to a web page

\makeatletter
\ifthenelse{\equal{#1}{}}%
{\href{#2}{#2}}%
{\href{#2}{#1}}}
\makeatother


Create commands for the symbols that will be used. Note that the skype symbol is not in the default Font Awesome command sets and thus needs a different solution than the facebook symbol

\newcommand*{\facebooksocialsymbol}{\faFacebook~}


Lastly, edit the original social command to include these symbols:

\RenewDocumentCommand{\social}{O{}O{}m}{%
\ifthenelse{\equal{#2}{}}%
{%