[Tex/LaTex] Moderncv package / cventry with date and year

moderncv

I am creating my resume in moderncv style format.

I wanted to enter a period like (eg: 05/2017--09/2017), and should be in a straight line.

But with the code \cventry{05/2017--09/2017} I am getting it like the image below.

enter image description here

I tried to use \setlength{\hintscolumnwidth}{0.25\textwidth} but, then my contents on the right are also moving.

Could some one suggest how I can get my month and year typed in a straight line.

Best Answer

The layout of command

\cventry{05/2017--09/2017}{Degree}{Institution}{City}{\textit{Grade}}{Description}

is defined in two columns: the first column takes the date {05/2017--09/2017}, the second column takes all other text.

With command \setlength{\hintscolumnwidth}{3cm} you can define 3cm to be used for the first column. In your case 3cm solved your problem ...

Please see the following MWE

\documentclass[11pt,a4paper,sans]{moderncv}

% moderncv themes
\moderncvstyle{classic} % casual, classic, banking, oldstyle and fancy
\moderncvcolor{blue} 

\usepackage[utf8]{inputenc}

\usepackage[scale=0.75]{geometry}
\usepackage{booktabs}

\setlength{\hintscolumnwidth}{3cm} % <==================================

% 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}

\setlength{\footskip}{66pt}


\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{05/2017--09/2017}{Degree}{Institution}{City}{\textit{Grade}}{Description}

\end{document}

and its result:

enter image description here