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.
You can use eso-pic
and overlay the photo:
\usepackage{eso-pic}
\newcommand\AtPageUpperMyleft[1]{\AtPageUpperLeft{%
\put(\LenToUnit{1.5cm},\LenToUnit{-3.5cm}){#1}%
}}%
\AddToShipoutPictureBG*{%
\AtPageUpperMyleft{\fboxsep1.5pt\fcolorbox{red}{white}%
{\includegraphics[width=60pt,height=3cm,keepaspectratio]{ctanlion}}}
}
Adjust the dimension 1.5cm
and -3.5cm
as suitable.
\documentclass[12pt,letterpaper,sans]{moderncv}
\moderncvstyle{classic}
\moderncvcolor{red}
\usepackage[scale=0.85]{geometry}
%% ↓
\usepackage{eso-pic}
\newcommand\AtPageUpperMyleft[1]{\AtPageUpperLeft{%
\put(\LenToUnit{1.5cm},\LenToUnit{-3.5cm}){#1}%
}}%
\AddToShipoutPictureBG*{%
\AtPageUpperMyleft{\fboxsep1.5pt\fcolorbox{red}{white}%
{\includegraphics[width=60pt,height=3cm,keepaspectratio]{ctanlion}}}
}
% personal data
\name{}{}
\title{}
\address{123 Main Street}{Anytown, USA 20192}
\phone[mobile]{(555) 555-5555}
\email{dasasd@gmail.com}
\homepage{www.asdasd.com}
\social[linkedin]{asdasdasd}
\social[github]{asdasdasd}
\photo{logo}
\begin{document}
\makecvtitle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Selected Projects}
\end{document}
Best Answer
You can patch
\maketitle
- used by thebanking
style inmoderncv
to create the title.The default width of the title in
banking
is.8\textwidth
, leaving.2\textwidth
"to play with. The patch below inserts an image to the right of the title:You may have to fiddle with the vertical positioning through
\raisebox
: