3

Just trying to have 2 columns spaced a bit. I use a minipage to do it, and it seems I have some space left. For example, I can add words to my right title, and it's still good with columns ratio 0.55/0.45. But if I use column ratio 0.6/0.4, I got a linebreak is the section header of the right column.

I know it is not clear so here are some screenshots:

  1. ratio 0.55/0.45 image1
  2. ratio 0.6/0.4 image2

and here is the code

\begin{minipage}[t]{0.6\textwidth}
\section{Formation}
\cventry{2002 -- 2008}{Diplôme d'ingénieur en informatique}{}{}{EPITA}{Spécialité Multimédia et Technologies de l'Information}
\cventry{2000 -- 2002}{Baccalauréat Scientifique}{}{}{}{Spécialité Mathématiques}
\end{minipage}
%second column
\begin{minipage}[t]{0.4\textwidth}
\section{Langues}
\cvlanguage{Anglais}{Courant}{}
\cvitem{Allemand}{Scolaire}{}
\cvitem{Japonais}{Notions}{}
\end{minipage}

Please help me to space out these columns, thanks!

Edit: here is a sample of the page so people can try it!

% Template : http://blog.madrzejewski.com/creer-cv-elegant-latex-moderncv/

\documentclass[11pt,a4paper]{moderncv}
\moderncvtheme[blue]{classic}
\usepackage[utf8]{inputenc}
\usepackage[top=1cm, bottom=0.5cm, left=1cm, right=1cm]{geometry}
% Largeur de la colonne pour les dates
\setlength{\hintscolumnwidth}{2.8cm}

\firstname{xxx}
\familyname{XXX}
\title{Ingénieur de développement logiciel senior}
\address{xxx}{XXX}
\email{[email protected]}
\social[linkedin]{xxx}
\mobile{xxx} 
\extrainfo{xxx}

\begin{document}
\maketitle

% first column
\begin{minipage}[t]{0.7\textwidth}
\section{Formation}
\cventry{2002 -- 2008}{Diplôme d'ingénieur en informatique}{}{}{EPITA}   {Spécialité Multimédia et Technologies de l'Information}
\cventry{2000 -- 2002}{Baccalauréat Scientifique}{}{}{}{Spécialité Mathématiques}
\end{minipage}
%second column
\begin{minipage}[t]{0.5\textwidth}
\section{Langues}
\cvlanguage{Anglais}{Courant}{}
\cvitem{Allemand}{Scolaire}{}
\cvitem{Japonais}{Notions}{}
\end{minipage}
\end{document}
8
  • 1
    Welcome, a minimal working example would be much better than a thousand screenshots ;-)
    – Johannes_B
    Jun 24, 2015 at 13:16
  • Looking at the code, you have minipages of a combined length of textwidth, plus a space and possibly a parindent. That is more than is allowed on one line.
    – Johannes_B
    Jun 24, 2015 at 13:17
  • Thank you @Joannes_B since your comment led me to the answer. I don't understand very well why but with 0.7/0.5 ratio my minipages are displayed perfectly.
    – Shay
    Jun 24, 2015 at 13:26
  • That cannot be the solution.
    – Johannes_B
    Jun 24, 2015 at 13:27
  • I understand it is not technically beautiful but it produced exactly what I wanted : image I'd be glad to get a more correct solution though.
    – Shay
    Jun 24, 2015 at 13:33

1 Answer 1

3

moderncv is not really set up for two-column curriclum vitaes.

A section heading is constructed of 2 boxes and the separator, setting width of the surrounding minipage will lead to breaking the line in the in the sectiontitle. We can avoid that by issuing \nolinebreak at the appropriate places in the defintion of section.

\documentclass[11pt,a4paper]{moderncv}
\moderncvtheme[blue]{classic}
\usepackage[utf8]{inputenc}
\usepackage[top=1cm, bottom=0.5cm, left=1cm, right=1cm,showframe]{geometry}
% Largeur de la colonne pour les dates

\firstname{xxx}
\familyname{XXX}
\title{Ingénieur de développement logiciel senior}
\address{xxx}{XXX}
\email{[email protected]}
\social[linkedin]{xxx}
\mobile{xxx} 
\extrainfo{xxx}

\setlength{\hintscolumnwidth}{.15\textwidth}
\makeatletter
\RenewDocumentCommand{\section}{sm}{%
  \par\addvspace{2.5ex}%
  \phantomsection{}% reset the anchor for hyperrefs
  \addcontentsline{toc}{section}{#2}%
  \parbox[t]{\hintscolumnwidth}{\strut\raggedleft\raisebox{\baseletterheight}{\color{color1}\rule{\hintscolumnwidth}{0.95ex}}}\nolinebreak%
  \hspace{\separatorcolumnwidth}\nolinebreak%
  \parbox[t]{\maincolumnwidth}{\strut\sectionstyle{#2}}%
  \par\nobreak\addvspace{1ex}\@afterheading}% to avoid a pagebreak after the heading
  \makeatother

\begin{document}
\maketitle

% first column
\fbox{%
\begin{minipage}[t]{0.65\textwidth}
    \section{Formation}
    \cventry{2002 -- 2008}{Diplôme d'ingénieur en informatique}{}{}{EPITA} {Spécialité Multimédia et Technologies de l'Information}
    \cventry{2000 -- 2002}{Baccalauréat Scientifique}{}{}{}{Spécialité Mathématiques}
\end{minipage}}\hfill
%second column
\fbox{%
\begin{minipage}[t]{.35\textwidth}
    \section{Langues}
    \cvlanguage{Anglais}{Courant}{}
    \cvitem{Allemand}{Scolaire}{}
    \cvitem{Japonais}{Notions}{}
\end{minipage}}
\end{document}
\documentclass{moderncv}
\usepackage[utf8]{inputenc} 
\moderncvstyle{banking}     
\moderncvcolor{blue}
\firstname{shay}
\lastname{shay}
\setlength{\textwidth}{15cm}
\begin{document}
\makecvtitle
\begin{minipage}[t]{0.6\textwidth}
    \section{Formation}
    \cventry{2002 -- 2008}{Diplôme d'ingénieur en
    informatique}{}{}{EPITA}{Spécialité Multimédia et
    Technologies de l'Information}
    \cventry{2000 -- 2002}{Baccalauréat
    Scientifique}{}{}{}{Spécialité Mathématiques}
\end{minipage}%
%second column
\begin{minipage}[t]{0.4\textwidth}
    \section{Langues}
    \cvlanguage{Anglais}{Courant}{}
    \cvitem{Allemand}{Scolaire}{}
    \cvitem{Japonais}{Notions}{}
\end{minipage}

\end{document}

Here a minimal example that shows what's going on.

shayModerncvLinebrreak

\documentclass{standalone}
\usepackage{showframe}
\begin{document}
\fbox{\begin{minipage}{.5\linewidth}
    \rule{.4\linewidth}{.9\baselineskip}\rule{.6\linewidth}{.9\baselineskip}\par
    \rule{.4\linewidth}{.9\baselineskip} \rule{.6\linewidth}{.9\baselineskip}\par
    \rule{.4\linewidth}{.9\baselineskip}\nolinebreak \rule{.6\linewidth}{.9\baselineskip}\par
\end{minipage}}
\end{document}

You must log in to answer this question.

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