title: Latex Commands with URL
body: <p>I am having trouble adding a URL to the Linkedin command. I want it to essentially print the Linkedin logo, text that I want to be explicitly seen, and a URL that the user will be redirected to upon clicking it. Below is the current .cls file.</p>
  
  <p>.cls file:</p>
  
  <pre><code>\newcommand{\linkedinsymbol}{\faLinkedin}
  \newcommand{\printinfo}[2]{\mbox{\textcolor{accent}{\normalfont #1}\hspace{0.5em}#2\hspace{2em}}}
  \usepackage{hyperref}
  \newcommand{\linkedin}[1]{\printinfo{\linkedinsymbol}{#1}}
  </code></pre>
  
  <p>I tried turning the last line into the following:</p>
  
  <pre><code>\newcommand{\linkedin}[2]{\printinfo{\linkedinsymbol}{#1}}{\url{#2}}
  </code></pre>
  
  <p>However, upon doing so, I get the following errors:</p>
  
  <pre><code>
  ! LaTeX Error: Missing \begin{document}.
  
  See the LaTeX manual or LaTeX Companion for explanation.
  Type  H &lt;return&gt;  for immediate help.
   ...
  
  l.91 ...{\printinfo{\linkedinsymbol}{#1}}{\url{#2}
                                                    }
  ?
  ! Undefined control sequence.
  \hyper@linkurl ...tionraw &gt;&gt;}\relax \Hy@colorlink
                                                    \@urlcolor #1\Hy@xspace@en...
  l.91 ...{\printinfo{\linkedinsymbol}{#1}}{\url{#2}
                                                    }
  ?
  ! Undefined control sequence.
  \close@pdflink -&gt;\Hy@endcolorlink
                                    \Hy@VerboseLinkStop \pdfendlink
  l.91 ...{\printinfo{\linkedinsymbol}{#1}}{\url{#2}
                                                    }
  ?
  </code></pre>
  
  <p><strong>Minimum Reproducible Example:</strong></p>
  
  <p>main.tex:</p>
  
  <pre><code>\PassOptionsToPackage{dvipsnames}{xcolor}
  \documentclass[10pt,letterpaper]{altacv}
  \geometry{left=1cm,right=9cm,marginparwidth=6.8cm,marginparsep=1.2cm,top=1.25cm,bottom=1.25cm,footskip=2\baselineskip}
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
  \usepackage[default]{lato}
  
  \usepackage[hidelinks]{hyperref}
  
  \begin{document}
  \linkedin{linkedin.com/in/varunjain-me}{www.linkedin.com/in/varunjain-me}
  \end{document}
  </code></pre>
  
  <p>.cls file:</p>
  
  <pre><code>\NeedsTeXFormat{LaTeX2e}[1995/12/01]
  \@ifl@t@r\fmtversion{2018/04/01}{\UseRawInputEncoding}{}
  \ProvidesClass{altacv}[2018/07/27 AltaCV v1.1.4, yet another alternative class for a résumé/curriculum vitae.]
  
  \newif\if@academicons
  \DeclareOption{academicons}{\@academiconstrue}
  \newif\if@normalphoto
  \DeclareOption{normalphoto}{\@normalphototrue}
  \DeclareOption*{\PassOptionsToClass{\CurrentOption}{extarticle}}
  \ProcessOptions\relax
  
  \LoadClass{extarticle}
  
  \RequirePackage[margin=2cm]{geometry}
  \RequirePackage{fontawesome}
  
  \if@academicons
    \ExplSyntaxOn
    \msg_redirect_name:nnn { fontspec } { font-not-found } { none }
    \ExplSyntaxOff
    \RequirePackage{academicons}
    \newfontfamily{\AI}{academicons.ttf}
  \fi
  
  \RequirePackage{xcolor}
  
  \colorlet{accent}{blue!70!black}
  \colorlet{heading}{black}
  \colorlet{emphasis}{black}
  \colorlet{body}{black!80!white}
  \newcommand{\itemmarker}{{\small\textbullet}}
  \newcommand{\ratingmarker}{\faCircle}
  
  \RequirePackage{tikz}
  \usetikzlibrary{arrows}
  \RequirePackage[skins]{tcolorbox}
  \RequirePackage{enumitem}
  \setlist{leftmargin=*,labelsep=0.5em,nosep,itemsep=0.25\baselineskip,after=\vskip0.25\baselineskip}
  \setlist[itemize]{label=\itemmarker}
  \RequirePackage{graphicx}
  \RequirePackage{etoolbox}
  \RequirePackage{dashrule}
  \RequirePackage{multirow,tabularx}
  \RequirePackage{changepage}
  
  \setlength{\parindent}{0pt}
  \newcommand{\divider}{\textcolor{body!30}{\hdashrule{\linewidth}{0.6pt}{0.5ex}}\medskip}
  
  \newenvironment{fullwidth}{%
    \begin{adjustwidth}{}{\dimexpr-\marginparwidth-\marginparsep\relax}}
    {\end{adjustwidth}}
  \newcommand{\linkedinsymbol}{\faLinkedin}
  \newcommand{\printinfo}[2]{\mbox{\textcolor{accent}{\normalfont #1}\hspace{0.5em}#2\hspace{2em}}}
  \newcommand{\linkedin}[2]{\printinfo{\linkedinsymbol}{#1}}{\url{#2}}
  </code></pre>