Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

As a continuation of this question moderncv banking style: How to move the title block all the way to the left?, I would like to bring in the contents, one in each line like :
street and number
city -postcode
country
ph no 1
ph no 2
email
web page

The bullet points are to be removed. the code is:

\documentclass[12pt,letterpaper]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{blue}
\usepackage{libertine}
\usepackage[scale=0.75]{geometry}

\makeatletter
\renewcommand*{\flushmaketitle}{%
  \strut\usebox{\maketitlebox}%
  \savebox{\maketitlebox}{}%
  \savebox{\maketitletempbox}{}%
  \setlength{\maketitleboxwidth}{0pt}}
\renewcommand*{\maketitle}{%
%  \setlength{\maketitlewidth}{0.8\textwidth}% ORIGINAL
  \setlength{\maketitlewidth}{\textwidth}% NEW
  %\hfil% ORIGINAL
  \parbox{\maketitlewidth}{%
%    \centering% ORIGINAL
    \raggedright% NEW
    % name and title
    \namestyle{\@firstname~\@lastname}%
    \\% \isundefined doesn't work on \@title, as LaTeX itself defines \@title (before it possibly gets redefined by \title)
    % detailed information
    \addressfont\color{color2}%
    \ifthenelse{\isundefined{\@addressstreet}}{}{\addtomaketitle{\addresssymbol\@addressstreet}%
      \ifthenelse{\equal{\@addresscity}{}}{}{\addtomaketitle{\@addresscity}}% if \addresstreet is defined, \addresscity and \addresscountry will always be defined but could be empty
      \ifthenelse{\equal{\@addresscountry}{}}{}{\addtomaketitle{\@addresscountry}}%
      \flushmaketitle\@firstmaketitleelementtrue\\}%
    \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
      \addtomaketitle{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%
    \ifthenelse{\isundefined{\@email}}{}{\addtomaketitle{\emailsymbol\emaillink{\@email}}}%
    \ifthenelse{\isundefined{\@homepage}}{}{\addtomaketitle{\homepagesymbol\httplink{\@homepage}}}%
    \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
      \addtomaketitle{\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}%
    \ifthenelse{\isundefined{\@extrainfo}}{}{\addtomaketitle{\@extrainfo}}%
    \flushmaketitle}\\[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 \maketitle
\makeatother


\name{John}{Doe}
\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}
\quote{Some quote}

\begin{document}
\makecvtitle

\section{A test section}
Some test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text
\end{document} 

enter image description here

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Just use some extra

\flushmaketitle\@firstmaketitleelementtrue\\        %%% <--- HK here

at appropriate places:

\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{blue}
\usepackage[scale=0.75]{geometry}

\makeatletter
%\renewcommand*{\maketitlesymbol}{}%
%
\renewcommand*{\flushmaketitle}{%
  \strut\usebox{\maketitlebox}%
  \savebox{\maketitlebox}{}%
  \savebox{\maketitletempbox}{}%
  \setlength{\maketitleboxwidth}{0pt}}
\renewcommand*{\maketitle}{%
%  \setlength{\maketitlewidth}{0.8\textwidth}% ORIGINAL
  \setlength{\maketitlewidth}{\textwidth}% NEW
  %\hfil% ORIGINAL
  \parbox{\maketitlewidth}{%
%    \centering% ORIGINAL
    \raggedright% NEW
    % 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)
    % detailed information
    \addressfont\color{color2}%
    \ifthenelse{\isundefined{\@addressstreet}}{}{\addtomaketitle{\addresssymbol\@addressstreet}%
    \flushmaketitle\@firstmaketitleelementtrue\\       %%% <--- HK here
      \ifthenelse{\equal{\@addresscity}{}}{}{\addtomaketitle[~--~]{\@addresscity}}% if \addresstreet is defined, \addresscity and \addresscountry will always be defined but could be empty
      \flushmaketitle\@firstmaketitleelementtrue\\     %%% <--- HK here
      \ifthenelse{\equal{\@addresscountry}{}}{}{\addtomaketitle[~--~]{\@addresscountry}}%
      \flushmaketitle\@firstmaketitleelementtrue\\}%
    \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
      \addtomaketitle{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}
      \flushmaketitle\@firstmaketitleelementtrue\\}%           %% <--- HK here
    \ifthenelse{\isundefined{\@email}}{}{\addtomaketitle{\emailsymbol\emaillink{\@email}}}%
    \flushmaketitle\@firstmaketitleelementtrue\\           %% <--- HK here    
    \ifthenelse{\isundefined{\@homepage}}{}{\addtomaketitle{\homepagesymbol\httplink{\@homepage}}}%
    \flushmaketitle\@firstmaketitleelementtrue\\           %% <--- HK here
    \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
      \addtomaketitle{\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}
      \flushmaketitle\@firstmaketitleelementtrue\\}           %% <--- HK here}% 
    \ifthenelse{\isundefined{\@extrainfo}}{}{\addtomaketitle{\@extrainfo}}%
    \flushmaketitle}\\[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 \maketitle
\makeatother


\name{John}{Doe}
\title{Resume title}
\address{street and number}{city postcode}{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} 
\quote{Some quote}

\begin{document}
\makecvtitle

\section{A test section}
Some test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text
\end{document}

enter image description here

Answer to the comment:

You can use additional parboxes:

\makeatletter
%\renewcommand*{\maketitlesymbol}{}%
%
\renewcommand*{\flushmaketitle}{%
  \strut\usebox{\maketitlebox}%
  \savebox{\maketitlebox}{}%
  \savebox{\maketitletempbox}{}%
  \setlength{\maketitleboxwidth}{0pt}}
\renewcommand*{\maketitle}{%
%  \setlength{\maketitlewidth}{0.8\textwidth}% ORIGINAL
  \setlength{\maketitlewidth}{\textwidth}% NEW
  %\hfil% ORIGINAL
  \parbox{\maketitlewidth}{%
%    \centering% ORIGINAL
    \raggedright% NEW
    % 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)
    % detailed information
    \addressfont\color{color2}%
    \parbox[t]{0.45\maketitlewidth}{%
    \ifthenelse{\isundefined{\@addressstreet}}{}{\addtomaketitle{\addresssymbol\@addressstreet}%
    \flushmaketitle\@firstmaketitleelementtrue\\       %%% <--- HK here
      \ifthenelse{\equal{\@addresscity}{}}{}{\addtomaketitle[~--~]{\@addresscity}}% if \addresstreet is defined, \addresscity and \addresscountry will always be defined but could be empty
      \flushmaketitle\@firstmaketitleelementtrue\\     %%% <--- HK here
      \ifthenelse{\equal{\@addresscountry}{}}{}{\addtomaketitle[~--~]{\@addresscountry}}%
  \flushmaketitle\@firstmaketitleelementtrue\\     %%% <--- HK here
      }}%
      \hfill
    \parbox[t]{0.45\maketitlewidth}{%
    \raggedleft%    %% optional  
    \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
      \addtomaketitle{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}
      \flushmaketitle\@firstmaketitleelementtrue\\}%           %% <--- HK here
    \ifthenelse{\isundefined{\@email}}{}{\addtomaketitle{\emailsymbol\emaillink{\@email}}}%
    \flushmaketitle\@firstmaketitleelementtrue\\           %% <--- HK here    
    \ifthenelse{\isundefined{\@homepage}}{}{\addtomaketitle{\homepagesymbol\httplink{\@homepage}}}%
    \flushmaketitle\@firstmaketitleelementtrue\\           %% <--- HK here
    \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
      \addtomaketitle{\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}
      \flushmaketitle\@firstmaketitleelementtrue\\}           %% <--- HK here 
    \ifthenelse{\isundefined{\@extrainfo}}{}{\addtomaketitle{\@extrainfo}}%
    \flushmaketitle}}\\[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 \maketitle
\makeatother

enter image description here

share|improve this answer
    
Now, a little modification, name, the street and number, city postcode, country on left side and the rest on the right side. How to do that? –  subham soni Apr 25 at 5:56

The following is a simplified version of \maketitle that avoid adding contents to a box and only setting it at the end. Instead, the contents is set sequentially as it is inspected. I think it makes for code that is a little (shorter and) easier to understand/modify:

enter image description here

\documentclass[12pt,letterpaper]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{blue}
\usepackage{libertine}
\usepackage[scale=0.75]{geometry}

\makeatletter
\renewcommand*{\maketitle}{%
  \setlength{\maketitlewidth}{\textwidth}%
  \parbox{\maketitlewidth}{%
    \raggedright% NEW
    \namestyle{\@firstname~\@lastname}% name and title
    \\% \isundefined doesn't work on \@title, as LaTeX itself defines \@title (before it possibly gets redefined by \title)
    % detailed information
    \addressfont\color{color2}%
    \begin{tabular}{@{}p{\linewidth}@{}}
      \ifthenelse{\isundefined{\@addressstreet}}{}{\addresssymbol\@addressstreet \par}%
      \ifthenelse{\equal{\@addresscity}{}}{}{\@addresscity \par}% if \addresstreet is defined, \addresscity and \addresscountry will always be defined but could be empty
      \ifthenelse{\equal{\@addresscountry}{}}{}{\@addresscountry \par}%
      \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
        \csname\collectionloopkey phonesymbol\endcsname\collectionloopitem \endgraf}%
      \ifthenelse{\isundefined{\@email}}{}{\emailsymbol\emaillink{\@email} \par}%
      \ifthenelse{\isundefined{\@homepage}}{}{\homepagesymbol\httplink{\@homepage}}%
    \end{tabular}}\\[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 \maketitle
\makeatother

\name{John}{Doe}
\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}
\quote{Some quote}

\begin{document}
\makecvtitle

\section{A test section}
Some test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text
\end{document}

The following version of \maketitle provides a left-and-right alignment of the details:

enter image description here

\makeatletter
\renewcommand*{\maketitle}{%
  \setlength{\maketitlewidth}{\textwidth}%
  \parbox{\maketitlewidth}{%
    \raggedright% NEW
    \namestyle{\@firstname~\@lastname}% name and title
    \\% \isundefined doesn't work on \@title, as LaTeX itself defines \@title (before it possibly gets redefined by \title)
    % detailed information
    \addressfont\color{color2}%
    \begin{tabular}{@{}p{.5\linewidth}@{}p{.5\linewidth}@{}}
      \ifthenelse{\isundefined{\@addressstreet}}{}{\addresssymbol\@addressstreet \par}%
      \ifthenelse{\equal{\@addresscity}{}}{}{\@addresscity \par}% if \addresstreet is defined, \addresscity and \addresscountry will always be defined but could be empty
      \ifthenelse{\equal{\@addresscountry}{}}{}{\@addresscountry} &%
      \raggedleft% For right-aligned content
      \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
        \csname\collectionloopkey phonesymbol\endcsname\collectionloopitem \endgraf}%
      \ifthenelse{\isundefined{\@email}}{}{\emailsymbol\emaillink{\@email} \par}%
      \ifthenelse{\isundefined{\@homepage}}{}{\homepagesymbol\httplink{\@homepage}}%
    \end{tabular}}\\[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 \maketitle
\makeatother
share|improve this answer
    
Now, a little modification, name, the street and number, city postcode, country on left side and the rest on the right side. How to do that? –  subham soni Apr 25 at 5:59
    
@subhamsoni: Note that I've left out all of the \social and \extrainfo stuff, since it didn't seem needed in the original request. In terms of the follow-up question, what should the alignment of "the rest on the right side" be? Right-aligned or left-aligned? –  Werner Apr 25 at 6:06
    
right aligned... –  subham soni Apr 25 at 6:07
    
@subhamsoni: I've added two columns to the inner tabular to easily separate the content into a left- and right-hand side. –  Werner Apr 25 at 6:12
    
Thanks a lot..... :-) –  subham soni Apr 25 at 6:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.