With style banking
class moderncv
uses moderncvheadiii
to build the shown header for cv and letter. To change there the order you have to change the hard coded order from the class. To do that I copied the code from the class and changed it.
Please see the following MWE (check the added code between \makeatletter
and \makeatother
and see the main changing marked with <========
)
\documentclass[11pt,a4paper,sans]{moderncv}
% moderncv themes
\moderncvstyle{banking} % casual, classic, banking, oldstyle and fancy
\moderncvcolor{blue}
%\renewcommand{\familydefault}{\sfdefault} % \rmdefault
%\nopagenumbers{}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}
%\setlength{\hintscolumnwidth}{3cm}
%\settowidth{\hintscolumnwidth}{Jun-Sep, 2011}
%\setlength{\makecvtitlenamewidth}{10cm} % for the 'classic' style
% 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\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}\makeatother
%\renewcommand{\refname}{Articles}
\setlength{\footskip}{66pt}
\makeatletter % <===========================================================
\@initializecommand{\makehead}{%
\setlength{\makeheaddetailswidth}{0.8\textwidth}%
\hfil%
\parbox{\makeheaddetailswidth}{%
\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)
% optional detailed information
\if@details{%
\addressfont\color{color2}%
\ifthenelse{\isundefined{\@homepage}}{}{\addtomakeheaddetails{\homepagesymbol\httplink{\@homepage}}}% <========================== moved
\ifthenelse{\isundefined{\@addressstreet}}{}{\addtomakeheaddetails{\addresssymbol\@addressstreet}%
\ifthenelse{\equal{\@addresscity}{}}{}{\addtomakeheaddetails[~--~]{\@addresscity}}% if \addresstreet is defined, \addresscity and \addresscountry will always be defined but could be empty
\ifthenelse{\equal{\@addresscountry}{}}{}{\addtomakeheaddetails[~--~]{\@addresscountry}}%
\flushmakeheaddetails\@firstmakeheaddetailselementtrue\\\null}%
\collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
\addtomakeheaddetails{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%
\ifthenelse{\isundefined{\@email}}{}{\addtomakeheaddetails{\emailsymbol\emaillink{\@email}}}%
% \ifthenelse{\isundefined{\@homepage}}{}{\addtomakeheaddetails{\homepagesymbol\httplink{\@homepage}}}% <=============================================== original place
\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
\addtomakeheaddetails{\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}%
\ifthenelse{\isundefined{\@extrainfo}}{}{\addtomakeheaddetails{\@extrainfo}}%
\flushmakeheaddetails}\fi}\\[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 \makehead
\makeatother % <============================================================
\begin{document}
\makecvtitle
\section{Education}
\cventry{year--year}{Degree}{Institution--3}{City--4}{\textit{Grade}--5}{Description--6} % arguments 3 to 6 can be left empty
\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}
\subsection{Miscellaneous}
\cventry{year--year}{Job title}{Employer}{City}{}{Description}
\section{Languages}
\cvitemwithcomment{Language 1}{Skill level}{Comment}
\cvitemwithcomment{\textbf{Language} 2}{\textbf{Skill} level}{Comment}
\cvitemwithcomment{Language 3}{Skill level}{Comment}
\section{Computer skills}
\cvdoubleitem{category 1}{XXX, YYY, ZZZ}{category 4}{XXX, YYY, ZZZ}
\cvdoubleitem{category 2}{XXX, YYY, ZZZ}{category 5}{XXX, YYY, ZZZ}
\cvdoubleitem{category 3}{XXX, YYY, ZZZ}{category 6}{XXX, YYY, ZZZ}
\section{Interests}
\cvitem{hobby 1}{Description}
\cvitem{hobby 2}{Description}
\cvitem{hobby 3}{Description}
\section{Extra 1}
\cvlistitem{Item 1}
\cvlistitem{Item 2}
\cvlistitem{Item 3. This item is particularly long and therefore normally spans over several lines. Did you notice the indentation when the line wraps?}
\section{Extra 2}
\cvlistdoubleitem{Item 1}{Item 4}
\cvlistdoubleitem{Item 2}{Item 5}
\cvlistdoubleitem{Item 3}{Item 6. Like item 3 in the single column list before, this item is particularly long to wrap over several lines.}
\section{References}
\begin{cvcolumns}
\cvcolumn{Category 1}{\begin{itemize}\item Person 1\item Person 2\item Person 3\end{itemize}}
\cvcolumn{Category 2}{Amongst others:\begin{itemize}\item Person 1, and\item Person 2\end{itemize}(more upon request)}
\cvcolumn[0.5]{All the rest \& some more}{\textit{That} person, and \textbf{those} also (all available upon request).}
\end{cvcolumns}
%\nocite{*}
%\bibliographystyle{plain}
%\bibliography{publications} % 'publications' is the name of a BibTeX file
\clearpage
%----- letter ---------------------------------------------------------
% 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{}} % use an optional argument to use a string other than "Enclosure", or redefine \enclname
\makelettertitle
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.
Suspendisse commodo, massa eu congue tincidunt, elit mauris pellentesque
orci, cursus tempor odio nisl euismod augue. Aliquam adipiscing nibh ut
odio sodales et pulvinar tortor laoreet. Mauris a accumsan ligula.
Class aptent taciti sociosqu ad litora torquent per conubia nostra, per
inceptos himenaeos. Suspendisse vulputate sem vehicula ipsum varius nec
tempus dui dapibus. Phasellus et est urna, ut auctor erat. Sed tincidunt
odio id odio aliquam mattis. Donec sapien nulla, feugiat eget adipiscing
sit amet, lacinia ut dolor. Phasellus tincidunt, leo a fringilla
consectetur, felis diam aliquam urna, vitae aliquet lectus orci nec
velit. Vivamus dapibus varius blandit.
Duis sit amet magna ante, at sodales diam. Aenean consectetur porta risus et sagittis. Ut interdum, enim varius pellentesque tincidunt, magna libero sodales tortor, ut fermentum nunc metus a ante. Vivamus odio leo, tincidunt eu luctus ut, sollicitudin sit amet metus. Nunc sed orci lectus. Ut sodales magna sed velit volutpat sit amet pulvinar diam venenatis.
Albert Einstein discovered that $e=mc^2$ in 1905.
\[ e=\lim_{n \to \infty} \left(1+\frac{1}{n}\right)^n \]
\makeletterclosing
\end{document}
and the resulting pdf:
Please see that if you change the style from banking
to classic
or ... another file moderncvhead???
is called and therefore you have to change that code ...
With your used style oldstyle
of class moderncv
, version 2.0.0 you need to redefine the two commands \makeletterhead
and \makecvhead
to get what you want.
In command \makeletterhead
you need to move the details up like:
\renewcommand*{\makeletterhead}{%
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\leftskip=0pt% needs to be set before \recomputeletterlengths
\recomputeletterlengths%
% sender contact info
\if@details% % <======================================================
\hspace{0pt}%
\marginpar{%
\addressfont\textcolor{color2}{%
{\bfseries\@firstname~\@lastname}\@firstdetailselementfalse%
\ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%
\ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and \addresscountry will always be defined but could be empty
\ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
\collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
\makenewline\hbox to 1.0em{\csname\collectionloopkey phonesymbol\endcsname}~\collectionloopitem}%
\ifthenelse{\isundefined{\@email}}{}{\makenewline\hbox to 1.0em{\emailsymbol}~\emaillink{\@email}}%
\ifthenelse{\isundefined{\@homepage}}{}{\makenewline\hbox to 1.0em{\homepagesymbol}~\httplink{\@homepage}}%
\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
\makenewline\hbox to 1.0em{\csname\collectionloopkey socialsymbol\endcsname}~\collectionloopitem}%
\ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}}%
% ensure no extra spacing after \makelettertitle due to a possible blank line
%\ignorespacesafterend% not working
\par\vspace{-\baselineskip}\vspace{-\parskip}\fi
% recipient block
{\addressfont%
{\bfseries\upshape\@recipientname}\\%
\@recipientaddress}\\[1em]%
% date
\@date\\[2em]%
% opening
\@opening\\[1.5em]%
}
In command \makecvhead
you can simple comment out the detailed informations and add that what you need as an own \section
:
\renewcommand*{\makecvhead}{
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputecvlengths%
% optional picture box
\newbox{\makecvheadpicturebox}%
\savebox{\makecvheadpicturebox}{%
\ifthenelse{\isundefined{\@photo}}%
{}%
{%
\color{color1}%
\setlength\fboxrule{\@photoframewidth}%
\ifdim\@photoframewidth=0pt%
\setlength{\fboxsep}{0pt}\fi%
\framebox{\includegraphics[width=\@photowidth]{\@photo}}}}%
% name and optional title
\newlength{\makecvheadpicturewidth}\settowidth{\makecvheadpicturewidth}{\usebox{\makecvheadpicturebox}}%
\newlength{\makecvheadnamewidth}\setlength{\makecvheadnamewidth}{\textwidth-\makecvheadpicturewidth}%
\begin{minipage}[b]{\makecvheadnamewidth}%
\namestyle{\@firstname\ \@lastname}%
\ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}%
\end{minipage}%
% optional photo
\usebox{\makecvheadpicturebox}\\[2.5em]%
% optional quote
\ifthenelse{\isundefined{\@quote}}%
{}%
{{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}%
% optional details
%\if@details%
%\makecvheadinfo{%
%\addressfont\color{color2}%
%\ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%
%\ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and \addresscountry will always be defined but could be empty
%\ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
%\collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
%\makenewline\hbox to 1.0em{\csname\collectionloopkey phonesymbol\endcsname}~\collectionloopitem}%
%\ifthenelse{\isundefined{\@email}}{}{\makenewline\hbox to 1.0em{\emailsymbol}~\emaillink{\@email}}%
%\ifthenelse{\isundefined{\@homepage}}{}{\makenewline\hbox to 1.0em{\homepagesymbol}~\httplink{\@homepage}}%
%\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
%\makenewline\hbox to 1.0em{\csname\collectionloopkey socialsymbol\endcsname}~\collectionloopitem}%
%\ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}\fi
}
So with the complete MWE
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{oldstyle}
\moderncvcolor{blue}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[scale=0.75]{geometry}
\setlength{\hintscolumnwidth}{5cm}
\usepackage{blindtext}
\makeatletter % <=======================================================
\renewcommand*{\makeletterhead}{%
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\leftskip=0pt% needs to be set before \recomputeletterlengths
\recomputeletterlengths%
% sender contact info
\if@details% % <======================================================
\hspace{0pt}%
\marginpar{%
\addressfont\textcolor{color2}{%
{\bfseries\@firstname~\@lastname}\@firstdetailselementfalse%
\ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%
\ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and \addresscountry will always be defined but could be empty
\ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
\collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
\makenewline\hbox to 1.0em{\csname\collectionloopkey phonesymbol\endcsname}~\collectionloopitem}%
\ifthenelse{\isundefined{\@email}}{}{\makenewline\hbox to 1.0em{\emailsymbol}~\emaillink{\@email}}%
\ifthenelse{\isundefined{\@homepage}}{}{\makenewline\hbox to 1.0em{\homepagesymbol}~\httplink{\@homepage}}%
\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
\makenewline\hbox to 1.0em{\csname\collectionloopkey socialsymbol\endcsname}~\collectionloopitem}%
\ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}}%
% ensure no extra spacing after \makelettertitle due to a possible blank line
%\ignorespacesafterend% not working
\par\vspace{-\baselineskip}\vspace{-\parskip}\fi
% recipient block
{\addressfont%
{\bfseries\upshape\@recipientname}\\%
\@recipientaddress}\\[1em]%
% date
\@date\\[2em]%
% opening
\@opening\\[1.5em]%
}
\renewcommand*{\makecvhead}{
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputecvlengths%
% optional picture box
\newbox{\makecvheadpicturebox}%
\savebox{\makecvheadpicturebox}{%
\ifthenelse{\isundefined{\@photo}}%
{}%
{%
\color{color1}%
\setlength\fboxrule{\@photoframewidth}%
\ifdim\@photoframewidth=0pt%
\setlength{\fboxsep}{0pt}\fi%
\framebox{\includegraphics[width=\@photowidth]{\@photo}}}}%
% name and optional title
\newlength{\makecvheadpicturewidth}\settowidth{\makecvheadpicturewidth}{\usebox{\makecvheadpicturebox}}%
\newlength{\makecvheadnamewidth}\setlength{\makecvheadnamewidth}{\textwidth-\makecvheadpicturewidth}%
\begin{minipage}[b]{\makecvheadnamewidth}%
\namestyle{\@firstname\ \@lastname}%
\ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}%
\end{minipage}%
% optional photo
\usebox{\makecvheadpicturebox}\\[2.5em]%
% optional quote
\ifthenelse{\isundefined{\@quote}}%
{}%
{{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}%
% optional details
%\if@details%
%\makecvheadinfo{%
%\addressfont\color{color2}%
%\ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%
%\ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and \addresscountry will always be defined but could be empty
%\ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
%\collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
%\makenewline\hbox to 1.0em{\csname\collectionloopkey phonesymbol\endcsname}~\collectionloopitem}%
%\ifthenelse{\isundefined{\@email}}{}{\makenewline\hbox to 1.0em{\emailsymbol}~\emaillink{\@email}}%
%\ifthenelse{\isundefined{\@homepage}}{}{\makenewline\hbox to 1.0em{\homepagesymbol}~\httplink{\@homepage}}%
%\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
%\makenewline\hbox to 1.0em{\csname\collectionloopkey socialsymbol\endcsname}~\collectionloopitem}%
%\ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}\fi
}
\makeatother
% personal data
\name{Peter}{Bode}
\title{M.Sc.}
\address{Glücksstr. 13}{55444 Glücksdorf}{Deutschland \medskip}
\phone[mobile]{+49~(176)~111~2222}
\email{hglueck@bsp.de}
\photo[3.0cm][0.2pt]{example-image}
%--------------------------------------------------------------------
% content
%-------------------------------------------------------------------
\begin{document}
% cover letter.............
\recipient{Max Mustermann AG}{Personalwesen \\ Hans-Beispiel-Straße 2 \\ 55555 Beispielhausen}
\date{\today}
\opening{Sehr geehrter Damen und Herren,}
\closing{Mit freundlichen Grüßen, \vspace{0,3cm} \\
%\includegraphics[width=4.5cm]{image.png}
\vspace{-2,0cm}}
%\enclosure[Anhänge]{Lebenslauf, Zeugnisse} % use an optional argument to use a string other than "Enclosure", or redefine \enclname
\makelettertitle
\blindtext
\bigskip
\makeletterclosing
% CV......................
\newpage
\makecvtitle
\section{Persönliche Daten} % <=========================================
\cvitem{Adresse}{Glücksstr. 13, 55444 Glücksdorf}
\makeatletter
\ifthenelse{\isundefined{\@email}}{}{\cvitem{\emailsymbol}{\emaillink{\@email}}}
\makeatother
\section{Ausbildung}
\cventry{10/04--05/05}{Master}{Karl Tux Institut für Technologie}{}{\textit{Note: 1,1}}{Pinguinkunde, Hauptfächer Prokrastination und Bummelei I, Celebrare maximus und systematische Zeitverschwendung.}
\cventry{10/96--07/02}{Abitur}{Hans Pinguin Gymnasium}{Tuxdorf}{\textit{Note: "`sehr gut"'}}{Allgemeine Hochschulreife, Technisches Gymnasium}
\section{Masterarbeit}
\cvitem{Thema}{\emph{Pressures Produced When Penguins Pooh -- Calculations on Avian Defaecation", Note: 1,0}}
\cvitem{Betreuer}{Prof. Dr. Tom Tux, Dipl.-Ing. Tina Tinker}
\cvitem{Abstrakt}{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.}
\section{Bachelorarbeit}
\cvitem{Thema}{\emph{Untersuchung der Gleitfähigkeit von Bananenschalen, Note: 1,5}}
\cvitem{Betreuer}{Prof. Dr. Andreas Code, Dipl.-Ing. Johan Github}
\newpage
\section{Berufserfahrung}
\section{Praktika}
\section{Soziales Engagement}
\section{Sprachen}
\cvitemwithcomment{Deutsch}{Muttersprache}{}
\cvitemwithcomment{Englisch}{Verhandlungssicher}{}
\cvitemwithcomment{Spanisch}{Gute Kenntnisse}{}
\cvitemwithcomment{Portugisisch}{Grundkenntnisse}{}
\section{EDV}
\cvdoubleitem{Betriebssysteme}{Windows, Linux}{Programmieren}{Java, C, Python}
\cvdoubleitem{Office}{Microsoft Office, LibreOffice}{CAD}{SolidWorks}
\cvdoubleitem{Mathematik}{OriginPro, Maple}{Textsatz}{\LaTeX}
\section{Referenzen}
\cvitem{Prof. Dr.-Ing. habil. Tom Tuxer}{Fraunhofer Institut für Pinguinkunde, tom.tuxer@pingu.edu, (098)~7654~321}
%\nocite{*}
%\bibliographystyle{plain}
%\bibliography{publications} % 'publications' is the name of a BibTeX file
\clearpage
\end{document}
you get the following resulting pages:
and
Best Answer
You should just set this information as-is using the same style as what is used by
\enclosure
:The above output is produced from the
moderncv
template.tex
with the addition ofimmediately before the start of the bibliography.