# Add \photo to a mix of moderncv styles and change position

This is a follow-up question to Banking style of moderncv doesnt reconize \makecvheadnamewidth for fiting long names and to How to mix/combine moderncv styles?.

Now I am looking to add the definition of the command \photo to the banking style I already read ModernCV Banking photo title and this How to include picture in banking style with exactly position but since I have mixed styles things got confused I don't know how to make it to work.

• I want my photo besides the title not above it,
• a plus would be to choose whether to put it on the left or on the right of the header.

MWE:

\documentclass{moderncv}
\moderncvstyle{classic}
\moderncvcolor{blue}

\usepackage[scale=0.85]{geometry}
\usepackage{xpatch}

\makeatletter  %to fix the issue of the long name in banking style
\titlestyle{~|~\@title}%
}{%
\\\vspace*{10pt}\titlestyle{\@title}\vspace*{10pt}%
}{}{false}
\makeatother

\makeatletter
\let\oldmakecvtitle\makecvtitle
\renewcommand*{\makecvtitle}{%
{\framebox{\includegraphics[width=\@photowidth]{\@photo}}\par\vspace{10pt}}%
\oldmakecvtitle%
}%
\makeatother

%%%%%%%%%%%%%%%%
\nopagenumbers{}
\title{Curriculum Vitae}
\firstname{my long name}
\familyname{familyname}
\phone[mobile]{00~00~00~00~00}
\email{myemail@gmail.com}
\extrainfo{xx ans Permis B}
\photo[64pt][40pt]{example-image.png}
\begin{document}
\makecvtitle
\end{document}


You need to have a look into the sources of class moderncv. Then you can find, that the code of header for style classic differes to the code of header for banking. In your case you need to change the code of header for banking.

That is the reason you have to use:

\patchcmd{\makehead}
{}
{false2}
{\\[2.5em]}
{\hfil\raisebox{-1.6cm}{\framebox{\includegraphics[width=\@photowidth]{\@photo}}}\\[2.5em]}
{}
{failure}


\let\oldmakecvtitle\makecvtitle
\renewcommand*{\makecvtitle}{%
{\framebox{\includegraphics[width=\@photowidth]{\@photo}}\par\vspace{10pt}}%
\oldmakecvtitle%
}%


you tried.

Depending on the used image you have to change the value in command \raisebox to your needs.

With the following complete MWE

\documentclass{moderncv}
\moderncvstyle{classic}
\moderncvcolor{blue}

\usepackage[scale=0.85]{geometry}
\usepackage{xpatch}

\makeatletter  %to fix the issue of the long name in banking style
\titlestyle{~|~\@title}%
}{%
\\\vspace*{10pt}\titlestyle{\@title}\vspace*{10pt}%
}{}{false}

{}
{false2}
{\\[2.5em]}
{\hfil\raisebox{-1.6cm}{\framebox{\includegraphics[width=\@photowidth]{\@photo}}}\\[2.5em]}
{}
{failure}
\makeatother

%%%%%%%%%%%%%%%%
\nopagenumbers{}
\title{Curriculum Vitae}
\firstname{my long name}
\familyname{familyname}
\phone[mobile]{00~00~00~00~00}
\email{myemail@gmail.com}
\extrainfo{xx ans Permis B}
\photo[64pt][40pt]{example-image-10x16} % --> change \raisebox{-1.6cm}{} to your needs ...
\begin{document}
\makecvtitle
\end{document}


you get the photo on the right side on the paper, see the following result:

To get the photo to the left needs to rebuild the header completely using a tabular environment. That is better done in a complete new header I think ...