[Tex/LaTex] How to include picture in banking style with exactly position

moderncv

I would like to include a picture in banking style moderncv pacakge. I just want to locate it in right hand side from title. But.. I can do this with a simple

\includegraphics[scale=1]{picture} 

because the picture is above or below title. I´ve thought in TikZ to create a node where I can put the picture but I´m not sure about this solution. Anyone know how could get it?

enter image description here

Best Answer

Update (moderncv v2.0)

With moderncv v2.0, the command to be patched is no more \maketitle but \makehead and the length to be changed is now \makeheaddetailswidth, so the correct patches for this version are

\patchcmd{\makehead}
  {\hfil}
  {\hspace*{0.15\textwidth}}
  {}
  {}
\patchcmd{\makehead}
  {\setlength{\makeheaddetailswidth}{0.8\textwidth}}
  {\setlength{\makeheaddetailswidth}{0.67\textwidth}}
  {}
  {}
\patchcmd{\makehead}
  {\\[2.5em]}
  {\hfil\raisebox{-.7cm}{\framebox{\includegraphics[width=\@photowidth]{\@photo}}}\\[2.5em]}
  {}
  {}

Original answer (works with older versions of moderncv)

Add the following lines in your preamble

\patchcmd{\maketitle}
  {\hfil}
  {\hspace*{0.15\textwidth}}
  {}
  {}
\patchcmd{\maketitle}
  {\setlength{\maketitlewidth}{0.8\textwidth}}
  {\setlength{\maketitlewidth}{0.67\textwidth}}
  {}
  {}
\patchcmd{\maketitle}
  {\\[2.5em]}
  {\hfil\raisebox{-.7cm}{\framebox{\includegraphics[width=\@photowidth]{\@photo}}}\\[2.5em]}
  {}
  {}

and, to insert the picture, use

\photo[64pt][0.4pt]{picture}

MWE:

\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{blue}

\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}

\patchcmd{\maketitle}
  {\hfil}
  {\hspace*{0.15\textwidth}}
  {}
  {}
\patchcmd{\maketitle}
  {\setlength{\maketitlewidth}{0.8\textwidth}}
  {\setlength{\maketitlewidth}{0.67\textwidth}}
  {}
  {}
\patchcmd{\maketitle}
  {\\[2.5em]}
  {\hfil\raisebox{-.7cm}{\framebox{\includegraphics[width=\@photowidth]{\@photo}}}\\[2.5em]}
  {}
  {}

% 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]{picture}

\begin{document}

\makecvtitle

\end{document} 

Output:

enter image description here