[Tex/LaTex] Add a second website in moderncv banking

cvmoderncvtitles

I wanted to include 2 websites in my resume which I am making using moderncv but it seems it allows only one website. How to show 2 websites in the header (showing the website icon for both)? I am using moderncv's banking style.

Best Answer

The following solution provides a general approach to adding two homepages and requires the following addition to your moderncv preamble:

\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\makeatletter
\newcommand*{\homepageA}[1]{\def\@homepageA{#1}}
\newcommand*{\homepageB}[1]{\def\@homepageB{#1}}
\patchcmd{\maketitle}% <cmd>
  {\ifthenelse{\isundefined{\@homepage}}{}{\addtomaketitle{\homepagesymbol\httplink{\@homepage}}}}% <search>
  {\ifthenelse{\isundefined{\@homepageA}}{}{\addtomaketitle{\homepagesymbol\httplink{\@homepageA}}}%
   \ifthenelse{\isundefined{\@homepageB}}{}{\addtomaketitle{\homepagesymbol\httplink{\@homepageB}}}}% <replace>
  {}{}% <success><failure>
\makeatother

With the aid of etoolbox, the banking style \maketitle macro is patched to insert two homepages. These homepages are specified using \homepageA and \homepageB, which use a similar interface to the original \homepage (which now doesn't get used anymore).

enter image description here


This approach translates directly to the use of emails as well via the following set of instructions:

\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\makeatletter
\newcommand*{\emailA}[1]{\def\@emailA{#1}}
\newcommand*{\emailB}[1]{\def\@emailB{#1}}
\patchcmd{\maketitle}% <cmd>
  {\ifthenelse{\isundefined{\@email}}{}{\addtomaketitle{\emailsymbol\emaillink{\@email}}}}% <search>
  {\ifthenelse{\isundefined{\@emailA}}{}{\addtomaketitle{\emailsymbol\emaillink{\@emailA}}}%
   \ifthenelse{\isundefined{\@emailB}}{}{\addtomaketitle{\emailsymbol\emaillink{\@emailB}}}}% <replace>
  {}{}% <success><failure>
\makeatother

Now two email addresses are specifier via \emailA and \emailB, respectively:

enter image description here