[Tex/LaTex] How to add links of websites with their logo/icon in LaTeX

cvtemplates

- \profilepic{alice.jpeg}
- \cvname{Alice}
- \cvjobtitle{Advanture}
- \cvdate{26 November, 1865}
- \cvaddress{United Kingdom}
- \cvnumberphone{+880567632189}
- \cvsite{http://en.wikipedia.org}
- \cvmail{alice@gmail.com}

This code has been taken from Overleaf that works based on online. I would like to add two more lines in this code. Below the line showing phone number, I want to delete cv site, and want to add my Facebook and LinkedIn profiles links. And I want to show these two links in such a way that only my name will be shown in blue color and when anyone will click on my name, they will automatically visit my profiles. I also want at the left hand side of these links, their logo/icon (Facebook logo and LinkedIn logo) will be shown.

Please instruct me how I can do that.
Thanks in advance.

Best Answer

Try adding the following to the preamble (between \documentclass{twentysecondcv} and \begin{document})

\usepackage{fontawesome}

\newcommand{\givenfacebook}{}
\newcommand{\givenlinkedin}{}

\newcommand{\cvfacebook}[1]{\renewcommand{\givenfacebook}{#1}}
\newcommand{\cvlinkedin}[1]{\renewcommand{\givenlinkedin}{#1}}

\renewcommand{\makeprofile}
{
\begin{tikzpicture}[remember picture,overlay]
     \node [rectangle, fill=asidecolor, anchor=north, minimum width=9.90cm, minimum height=\paperheight+1cm] (box) at (-5cm,0.5cm){};
\end{tikzpicture}


\begin{textblock}{6}(0.5, 0.2)
\begin{flushleft}
\hspace{13pt}
\begin{tikzpicture}[x=\imagescale,y=-\imagescale]
    \clip (600/2, 567/2) circle (567/2);

        \node[anchor=north west, inner sep=0pt, outer sep=0pt] at (0,0) {\includegraphics[width=\imagewidth]{\givenprofilepic}};
\end{tikzpicture}

{\Huge\color{mainblue}\givencvname}

\begin{flushright}
{\Large\color{black!80}\givencvjobtitle}
\end{flushright}
\renewcommand{\arraystretch}{1.6}
\begin{tabular}{p{0.5cm} @{\hskip 0.5cm}p{5cm}}
\ifthenelse{\equal{\givencvdate}{}}{}{\textsc{\Large\icon{\Info}} & \givencvdate\\}
\ifthenelse{\equal{\givencvaddress}{}}{}{\textsc{\Large\icon{\Letter}} & \givencvaddress\\}
\ifthenelse{\equal{\givennumberphone}{}}{}{\textsc{\Large\icon{\Telefon}} & \givennumberphone\\}
\ifthenelse{\equal{\givencvsite}{}}{}{\textsc{\Large\icon{\Mundus}} & \givencvsite}\\
\ifthenelse{\equal{\givenfacebook}{}}{}{\textsc{\large\icon{\faFacebook}} & \href{http://www.facebook.com/\givenfacebook }{\givencvname}\\}
\ifthenelse{\equal{\givenlinkedin}{}}{}{\textsc{\large\icon{\faLinkedin}} & \href{http://www.linkedin.com/in/\givenlinkedin }{\givencvname}\\}
\ifthenelse{\equal{\givencvmail}{}}{}{\textsc{\large\icon{@}} & \href{mailto:\givencvmail}{\givencvmail}}
\end{tabular}


\profilesection{About me}{3.2cm}
\givenaboutme


\profilesection{Skill}{5cm}
\givenskill
\giventextskill
\noindent
\scriptsize
\noindent
(*)[The skill scale is from 0 (Fundamental Awareness) to 6 (Expert).]

\end{flushleft}
\end{textblock}
\vspace{-10pt}
}

The fontawesome package is used for the facebook and linkedin logos. The original code for \makeprofile from twentysecondcv.cls is sourced from https://github.com/spagnuolocarmine/TwentySecondsCurriculumVitae-LaTex/

Two new commands \cvfacebook{foo} and \cvlinkedin{bar} are defined to make the facebook link point to www.facebook.com/foo and the linkedin link point to www.linkedin.com/in/bar.

The only changes within \renewcommand{\makeprofile} are that I added the two lines

\ifthenelse{\equal{\givenfacebook}{}}{}{\textsc{\large\icon{\faFacebook}} & \href{http://www.facebook.com/\givenfacebook }{\givencvname}\\}
\ifthenelse{\equal{\givenlinkedin}{}}{}{\textsc{\large\icon{\faLinkedin}} & \href{http://www.linkedin.com/in/\givenlinkedin }{\givencvname}\\}

The personal details on the left are then specified by

\profilepic{alice.jpeg} %path of profile pic
\cvname{Alice} %your name
\cvjobtitle{Adventurer}%your actual job position
\cvdate{26 November 1865}%date of birth
\cvaddress{United Kingdom}%address
\cvnumberphone{+39 0325658974}%telphone number
\cvmail{alice@wonderland.com}%e-mail
\cvsite{http://en.wikipedia.org}%personal site
\cvfacebook{foo}
\cvlinkedin{bar}

These commands should be included in the body of the document. To remove any of these, just remove (or comment out using % at the beginning of the line) the appropriate command.

Image of CV

Related Question