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.
[Tex/LaTex] Add a second website in moderncv banking
cvmoderncvtitles
Related Solutions
You can take from moderncvstylebanking.sty
the parts in charge of formatting the title and use them in your .tex
file with the casual
style; to add your LinkedIn information you can use \social[linkedin]{john.doe}
:
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{casual}
\moderncvcolor{blue}
\usepackage[scale=0.75]{geometry}
\makeatletter
% commands from moderncvstylebanking.sty to have the title
% from that style
\newcommand*{\maketitlesymbol}{%
{~~~{\rmfamily\textbullet}~~~}}% the \rmfamily is required to force Latin Modern fonts when using sans serif, as OMS/lmss/m/n is not defined and gets substituted by OMS/cmsy/m/n
% internal command to add an element to the footer
% it collects the elements in a temporary box, and checks when to flush the box
\newsavebox{\maketitlebox}%
\newsavebox{\maketitletempbox}%
\newlength{\maketitlewidth}%
\newlength{\maketitleboxwidth}%
\newif\if@firstmaketitleelement\@firstmaketitleelementtrue%
% adds an element to the maketitle, separated by maketitlesymbol
% usage: \addtomaketitle[maketitlesymbol]{element}
\newcommand*{\addtomaketitle}[2][\maketitlesymbol]{%
\if@firstmaketitleelement%
\savebox{\maketitletempbox}{\usebox{\maketitlebox}#2}%
\else%
\savebox{\maketitletempbox}{\usebox{\maketitlebox}#1#2}\fi%
\settowidth{\maketitleboxwidth}{\usebox{\maketitletempbox}}%
\ifnum\maketitleboxwidth<\maketitlewidth%
\savebox{\maketitlebox}{\usebox{\maketitletempbox}}%
\@firstmaketitleelementfalse%
\else%
\flushmaketitle{}\\%
\savebox{\maketitlebox}{#2}%
\savebox{\maketitletempbox}{#2}%
\settowidth{\maketitleboxwidth}{\usebox{\maketitlebox}}%
\@firstmaketitleelementfalse\fi}
% internal command to flush the maketitle
\newcommand*{\flushmaketitle}{%
\strut\usebox{\maketitlebox}%
\savebox{\maketitlebox}{}%
\savebox{\maketitletempbox}{}%
\setlength{\maketitleboxwidth}{0pt}}
\renewcommand*{\maketitle}{%
\setlength{\maketitlewidth}{0.8\textwidth}%
\hfil%
\parbox{\maketitlewidth}{%
\centering%
% name and title
\namestyle{\@firstname~\@lastname}%
\ifthenelse{\equal{\@title}{}}{}{\titlestyle{~|~\@title}}\\% \isundefined doesn't work on \@title, as LaTeX itself defines \@title (before it possibly gets redefined by \title)
% detailed information
\addressfont\color{color2}%
\ifthenelse{\isundefined{\@addressstreet}}{}{\addtomaketitle{\addresssymbol\@addressstreet}%
\ifthenelse{\equal{\@addresscity}{}}{}{\addtomaketitle[~--~]{\@addresscity}}% if \addresstreet is defined, \addresscity and \addresscountry will always be defined but could be empty
\ifthenelse{\equal{\@addresscountry}{}}{}{\addtomaketitle[~--~]{\@addresscountry}}%
\flushmaketitle\@firstmaketitleelementtrue\\}%
\collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
\addtomaketitle{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%
\ifthenelse{\isundefined{\@email}}{}{\addtomaketitle{\emailsymbol\emaillink{\@email}}}%
\ifthenelse{\isundefined{\@homepage}}{}{\addtomaketitle{\homepagesymbol\httplink{\@homepage}}}%
\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
\addtomaketitle{\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}%
\ifthenelse{\isundefined{\@extrainfo}}{}{\addtomaketitle{\@extrainfo}}%
\flushmaketitle}\\[2.5em]}% need to force a \par after this to avoid weird spacing bug at the first section if no blank line is left after \maketitle
\renewcommand*{\namefont}{\Huge\bfseries\upshape}
\renewcommand*{\titlefont}{\Huge\mdseries\upshape}
\renewcommand*{\addressfont}{\normalsize\mdseries\upshape}
\renewcommand*{\quotefont}{\large\slshape}
% styles
\renewcommand*{\namestyle}[1]{{\namefont\textcolor{color1}{#1}}}
\renewcommand*{\titlestyle}[1]{{\titlefont\textcolor{color2!85}{#1}}}
\renewcommand*{\addressstyle}[1]{{\addressfont\textcolor{color1}{#1}}}
\renewcommand*{\quotestyle}[1]{{\quotefont\textcolor{color1}{#1}}}
\renewcommand*{\makecvtitle}{%
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputecvlengths%
\maketitle%
% optional quote
\ifthenelse{\isundefined{\@quote}}%
{}%
{{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}%
\par}% to avoid weird spacing bug at the first section if no blank line is left after \maketitle}
\makeatother
% personal data
\name{John}{Doe}
\title{The title}
\address{street and number}{postcode city}{country}
\phone[mobile]{+1~(234)~567~890}
\phone[fixed]{+2~(345)~678~901}
\phone[fax]{+3~(456)~789~012}
\email{john@doe.org}
\homepage{www.johndoe.com}
\social[linkedin]{john.doe}
\social[twitter]{jdoe}
\social[github]{jdoe}
\extrainfo{additional information}
\photo[64pt][0.4pt]{picture}
\quote{Some quote}
\begin{document}
\makecvtitle
\section{Education}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}
\section{Master thesis}
\cvitem{title}{\emph{Title}}
\cvitem{supervisors}{Supervisors}
\cvitem{description}{Short thesis abstract}
\section{Experience}
\subsection{Vocational}
\cventry{year--year}{Job title}{Employer}{City}{}{General description no longer than 1--2 lines.\newline{}%
Detailed achievements:%
\begin{itemize}%
\item Achievement 1;
\item Achievement 2, with sub-achievements:
\begin{itemize}%
\item Sub-achievement (a);
\item Sub-achievement (b), with sub-sub-achievements (don't do this!);
\begin{itemize}
\item Sub-sub-achievement i;
\item Sub-sub-achievement ii;
\item Sub-sub-achievement iii;
\end{itemize}
\item Sub-achievement (c);
\end{itemize}
\item Achievement 3.
\end{itemize}}
\cventry{year--year}{Job title}{Employer}{City}{}{Description line 1\newline{}Description line 2}
\end{document}
The output:
Suppose you used the following solution to add the logo (taken from the answer of @karlkoeller):
\makeatletter
\@ifpackageloaded{moderncvstylebanking}{%
\let\oldmakecvtitle\makecvtitle
\renewcommand*{\makecvtitle}{%
{\centering\framebox{\includegraphics[width=\@photowidth]{\@photo}}\par\vspace{10pt}}%
\oldmakecvtitle%
}%
}{%
}
\makeatother
Then you see line \let\oldmakecvtitle\makecvtitle
. That means that the original macro is backuped in the new macro oldmakecvtitle
. So the original macro can be changed to include the photo.
If you want to use the original macro just call the old macro:
\oldmakecvtitle % Instead of \makecvtitle
See the following MWE to get a CV with photo, a letter without photo as you need:
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{blue}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}
% personal data
\name{John}{Doe}
\title{Resumé title}
\address{street and number}{postcode city}{country}
\phone[mobile]{+1~(234)~567~890}
\phone[fixed]{+2~(345)~678~901}
\phone[fax]{+3~(456)~789~012}
\email{john@doe.org}
\homepage{www.johndoe.com}
\social[linkedin]{john.doe}
\social[twitter]{jdoe}
\social[github]{jdoe}
\extrainfo{additional information}
\photo[64pt][0.4pt]{example-image-a}
\quote{Some quote}
\makeatletter
\@ifpackageloaded{moderncvstylebanking}{%
\let\oldmakecvtitle\makecvtitle
\renewcommand*{\makecvtitle}{%
{\centering\framebox{\includegraphics[width=\@photowidth]{\@photo}}\par\vspace{10pt}}%
\oldmakecvtitle%
}%
}{%
}
\makeatother
\begin{document}
\makecvtitle
\section{Education}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}
\section{Master thesis}
\cvitem{title}{\emph{Title}}
\cvitem{supervisors}{Supervisors}
\cvitem{description}{Short thesis abstract}
\clearpage
%\let\makecvtitle\oldmakecvtitle % to change back, if needed
\oldmakecvtitle % <=======================================================
% recipient data
\recipient{Company Recruitment team}{Company, Inc.\\123 somestreet\\some city}
\date{January 01, 1984}
\opening{Dear Sir or Madam,}
\closing{Yours faithfully,}
\enclosure[Attached]{curriculum vit\ae{}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis ullamcorper
neque sit amet lectus facilisis sed luctus nisl iaculis. Vivamus at neque
arcu, sed tempor quam. Curabitur pharetra tincidunt tincidunt. Morbi
volutpat feugiat mauris, quis tempor neque vehicula volutpat. Duis
tristique justo vel massa fermentum accumsan. Mauris ante elit, feugiat
vestibulum tempor eget, eleifend ac ipsum. Donec scelerisque lobortis
ipsum eu vestibulum. Pellentesque vel massa at felis accumsan rhoncus.
Albert Einstein discovered that $e=mc^2$ in 1905.
\[ e=\lim_{n \to \infty} \left(1+\frac{1}{n}\right)^n \]
\makeletterclosing
\end{document}
with the results:
and
If you want to use macro \makecvtitle
instead of \oldmakecvtitle
you can use the following line (before calling \makecvtitle
):
\let\makecvtitle\oldmakecvtitle % to change back, if needed
If you cange the inserted code for the photo to:
\makeatletter
\@ifpackageloaded{moderncvstylebanking}{%
\let\oldmakecvtitle\makecvtitle
\renewcommand*{\makecvtitle}{%
{\framebox{\includegraphics[width=\@photowidth]{\@photo}}%
%\par\vspace{10pt}% <======================
}%
\oldmakecvtitle%
}%
}{%
}
\makeatother
You get the photo right in line with the title.
Best Answer
The following solution provides a general approach to adding two homepages and requires the following addition to your
moderncv
preamble:With the aid of
etoolbox
, thebanking
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).This approach translates directly to the use of emails as well via the following set of instructions:
Now two email addresses are specifier via
\emailA
and\emailB
, respectively: