1

Basically I want to have the Name and Title sections in Modern CV on separate lines and not have the "|" separator. I figured out that to get rid of the separator I can just remove it in the moderncvbanking.sty file and then I replace it with \newline.

Problem is the text is now off centre, how could I fix this?

enter image description here

2
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
    – user11232
    Commented Aug 31, 2014 at 0:53
  • Please provide a minimal working example (MWE).
    – user11232
    Commented Aug 31, 2014 at 0:53

2 Answers 2

1

Modifying moderncvstylebanking.sty file itself, is a very very bad idea. Don't do it!

Add the following to your preamble:

\usepackage{xpatch}
    \makeatletter
    \xpatchcmd{\maketitle}{\titlestyle{~|~\@title}}{\par\vskip1ex\titlestyle{\@title}}{}{}
    \makeatother

MWE:

\documentclass[12pt,letterpaper,sans]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{blue}
\usepackage[scale=0.85]{geometry}
\usepackage{multicol}
\firstname{John}
\familyname{Doe}
\title{Banking Executive}
\address{Address line 1}{Address line 2}
\mobile{Phone}
\email{Email}
\social[linkedin]{linkedin}
\social[github]{github}
\quote{Some quote}

\usepackage{xpatch}
\makeatletter
\xpatchcmd{\maketitle}{\titlestyle{~|~\@title}}{\par\vskip1ex\titlestyle{\@title}}{}{}
\makeatother
\begin{document}
\makecvtitle
\section{Section}
\end{document}

enter image description here

2
  • 1
    In current (2016) versions of moderncv, \maketitle has to be replaced by \makehead in the patch command, i.e., the line now reads \xpatchcmd{\makehead}{\titlestyle{~|~\@title}}{\par\vskip1ex\titlestyle{\@title}}{}{}
    – gernot
    Commented Aug 19, 2016 at 13:20
  • 1
    By the way, this shows that it is no bad idea at all to modify a local copy of a style file: The modified local version will stay around indefinitely and the document can be typeset also 10 years later, whereas the above patch broke when the global moderncv class/style was replaced by a new version (breaking also the document). And I'm sure that sooner or later my patch of the patch will also be outdated.
    – gernot
    Commented Aug 19, 2016 at 13:48
2

Addendum to Harish Kumar's solution: In current (2016) versions of moderncv, \maketitle has to be replaced by \makehead in the patch command, i.e., the modification in the preamble now reads

\usepackage{xpatch}
\makeatletter
\xpatchcmd{\makehead}{\titlestyle{~|~\@title}}{\par\vskip1ex\titlestyle{\@title}‌​}{}{}
\makeatother
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .