2

See code :

\documentclass[10pt,a4paper]{moderncv}
\moderncvtheme[blue]{classic}                
\usepackage[utf8]{inputenc}
\usepackage{color}
\usepackage{amsmath}
\usepackage{amssymb}

\usepackage{soul}% http://ctan.org/pkg/soul
\usepackage[normalem]{ulem}
\usepackage[T1]{fontenc}
\renewcommand*{\sectionfont}{\Large\textbf\textsc}

\usepackage[inner=1.2cm,outer=1.2cm,top=0.9cm,bottom=0.9cm]{geometry}

\firstname{\Large{AAAA}}
\familyname{\Large{\textsc{CCCC}}}
\title{\small \textcolor{light-gray}{\textbf{CCCCC} }}
\address{\textbf{CCCCC}}{\textbf{CCCCC}}  
\mobile{\textbf{CCCC}}             
\email{CCCC@aol.fr} 
\extrainfo{\textbf{CCC}}  


\renewcommand*{\emaillink}[2][]{
\ifthenelse{\equal{#1}{}}
{\textbf{\href{mailto:#2}{#2}}}
{\textbf{\href{mailto:#2}{#1}}}}

\renewcommand*{\emailsymbol}{\marvosymbol{66}}


\begin{document}

\cvitem{$\rhd$}{\small{\textbf{Xxxxxxx}}}
\cvline{-}{\small{Yyyyyyyyyyyyy}}
\cvline{-}{\small{Zzzzzzzzzzzzz}}

\cvitem{$\rhd$}{\small{\textbf{Aaaaaaaaaaaaaaaaaa}}}
\cvline{-}      {\small{Bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb}}
\cvline{-}{\small{Cccccccccccccccccccccccccccccc}}
\cvline{-}{\small{Dddddddddddddddddddddddddddddddddddd}}
\cvline{-}{\small{Eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee}}

\vspace{4cm}

%Mini page ?

\begin{minipage}[t]{0.1\textwidth}
\cvitem{$\rhd$}{\small{\textbf{Xxxxxxx}}}
\cvline{-}{\small{Yyyyyyyyyyyyy}}
\cvline{-}{\small{Zzzzzzzzzzzzz}}
\end{minipage} \hfill
\begin{minipage}[t]{0.6\textwidth}
\cvitem{$\rhd$}{\small{\textbf{Aaaaaaaaaaaaaaaaaa}}}
\cvline{-}{\small{Bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb}}
\cvline{-}{\small{Cccccccccccccccccccccccccccccc}}
\cvline{-}{\small{Dddddddddddddddddddddddddddddddddddd}}
\cvline{-}{\small{Eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee}}
\end{minipage}



\end{document}

What I want to do is what you see after %Mini Page ? but as you can see some text goes outside page margin. How could I adapt it automatically (go to the next line) ?

  • Tell LaTeX where some long words can be hyphenated. – JPi Aug 19 '16 at 17:23
  • Hi, thanks. Then how would you do this ? – abel Aug 19 '16 at 17:24
  • See tex.stackexchange.com/questions/27890/… – JPi Aug 19 '16 at 17:38
  • 1
    \Large\textbf\textsc is the same as \Large\textbf{\textsc} it can't possibly work can it? shouldn't this be Large\bfseries\scshape ? – David Carlisle Aug 19 '16 at 18:26
  • 1
    font size commands do not take an argument \small{\textbf{Xxxxxxx}} is the same as \small\textbf{Xxxxxxx} – David Carlisle Aug 19 '16 at 18:27
2

The problem is that \cvline and \cvitem have a fixed width. If you put them into a small minipage, all you get are overfull hboxes, but the lines keep their width. This means that you have to adjust the width of \cvline and \cvitem to achieve what you want. Put the following definition into your preamble:

\newenvironment{minicv}[2][60.37605pt]%
 {\begin{minipage}[t]{#2}%
  \maincolumnwidth=#2%
  \hintscolumnwidth=#1%
  \advance\maincolumnwidth-\hintscolumnwidth
  \advance\maincolumnwidth-\separatorcolumnwidth
 }%
 {\end{minipage}%
 }

Now you can write in your document:

\begin{minicv}{5cm}
  \cvline{-}{\small This is the text. Usually you don't have to care
      about hyphenation. If you notice that TeX doesn't know about a
      certain hy\-phe\-na\-tion point that it should use, insert it
      using back\-slash mi\-nus like shown in the source code of
      this text.}
  \cvline{-}{Another CV item.}
\end{minicv}

The minicv environment has an optional argument for adjusting the width of the first column that contains the item markers. \begin{minicv}[1cm]{5cm} sets the width of the first column to 1cm.

After this change you will be able to put stacks of \cvlines side by side, but you will discover, that they are not top-aligned, even though minipage is used with the option t. The reason is that \cvline and \cvitem are implemented as a tabular that is centered, not top-aligned. To fix this, put the following two lines into your preamble.

\usepackage{xpatch}
\xpatchcmd{\cvitem}{\begin{tabular}}{\begin{tabular}[t]}{}{}
  • Seems i have completely wasted my time with the other answer :-) Especially looking at the OPs profile and the last active date. – Johannes_B Aug 23 '16 at 4:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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