# How to change moderncv \social[linkedin] from http to https?

Hello I am new to LaTeX and like it!

In moderncv I have a Link to my Linkedin profile. However, this link is http and I'd like to change to https.

Example

    \documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{casual}
\moderncvcolor{blue}
\usepackage[scale=0.75]{geometry}

\name{John}{Doe}

\begin{document}

\makecvtitle

\section{Education}

\end{document}


I tried to customize the link as described in Fixing the '\social' command of 'moderncv' for LinkedIN (intl profile) but it doesn't accept https.

If you need a minimal working example, just use the default template of moderncv at http://www.pirbot.com/mirrors/ctan/macros/latex/contrib/moderncv/examples/template.tex . Thanks in advance!

A fix by "renew-ing" the documentclass command to use \href{}{} for this page:

\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{casual}
\moderncvcolor{blue}
\usepackage[scale=0.75]{geometry}

% Added these lines (until \makeatother that belongs to documentclass moderncv.cls)
\makeatletter
\RenewDocumentCommand{\social}{O{}O{}m}{%
\ifthenelse{\equal{#2}{}}%
{%NEXT LINE CHANGED FROM ORIGINAL
}
\makeatother
\name{John}{Doe}

\begin{document}

\makecvtitle

\section{Education}

\end{document}


You need simply to define a new command \httpslink like

% makes a https hyperlink
\ifthenelse{\equal{#1}{}}%
{\href{https://#2}{#2}}%
{\href{https://#2}{#1}}}


Then you can simply change the call of \httplink to \httpslink to get your wished result.

Please see the following MWE (important code changings marked with <======):

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

\moderncvstyle{casual}
\moderncvcolor{blue}

\usepackage[scale=0.75]{geometry}

\ifthenelse{\equal{#1}{}}%
{\href{https://#2}{#2}}%
{\href{https://#2}{#1}}}

% usage: \social[<optional type>][<optional url>]{<account name>}
\RenewDocumentCommand{\social}{O{}O{}m}{% <=============================
\ifthenelse{\equal{#2}{}}%
{%
}

\name{John}{Doe}

which gives you the wished result: https://www.linkedin.com/in/reidhoffman. Please see that I changed the old protocolls httplink to httpslink also for all other possibilitys command \social gave you to add social links to your cv ...