[Tex/LaTex] how to create specific layout for year/month in moderncv

moderncv

I`m trying to fix a problem related to a post already answered from you guys

moderncv date year on top month

how can illustrate the date such as year and month in a cv like in the pics i uploaded?

using a moderncv template from this page
Download Zip File for cv-template

thx in advance!!

status quo wanted

the solutions you guys provided worked well, big up!!!

i'm trying to edit the given problem a little bit more:

i wanna illustrate the date in the same way, except the the second date is the word "now" or in german language "Heute"

the picture beneath show my wanted result

wanted design

my MWE looks like this, but i guess i gotta renewcommand sth. to get the result?!

enter image description here

\cventry{\dates[10.2014-Heute]}{Studium: Zahnmedizin}{Universität zu Köln}{}{Deutschland}{Abschlussziel: Dr. med. dent.; voraussichtlicher Abschluss: Frühjahr 2020}

Best Answer

I've tried the solution that you linked. Using the new \dates[] command as the first argument to the \cventry command gives the output you're looking for, I think.

You can also use the \yearabove command to simply display two texts (like month and date) above each other. If the text is too long and creates a linebreak, it might be necessary to increase \hintscolumnwidth, the width of the date column (see the example).

You can also skip using the \dates command altogether and display German month names only using the \yearabove command (see the second \cventry).

Using the \dates command with arguments other than numbers (in the format #1.#2-#3.#4, where #1, #3 are numbers) will result in errors, as the command expects numbers to convert them to the name of the month, i.e. 1 to January.

\documentclass[11pt,a4paper,sans]{moderncv} 
\moderncvstyle{classic} % options: 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{grey}                               % color options 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'

% https://tex.stackexchange.com/questions/310612/moderncv-date-year-on-top-month
\usepackage{datetime}
\def\dates[#1.#2-#3.#4]{\yearabove{\monthname[#1]}{#2}--\yearabove{\monthname[#3]}{#4}}
\newcommand{\yearabove}[2]{\parbox[t]{10mm}{\centering{#2\par\vspace{-2mm} \tiny{#1}}}}

\setlength{\hintscolumnwidth}{3cm} % change the width of the column with the dates

\name{First}{Last}

\begin{document}
\makecvtitle

\section{Section}
\cventry{\dates[09.2014-02.2015]}{Title}{institution}{place}{}{Description.}

% the \yearabove command, which the \dates command uses internally, takes any two texts and displays one above the other
\cventry{\yearabove{mytext}{year}--\yearabove{mytext2}{year2}}{Title}{institution}{place}{}{Description.}

\cventry{\yearabove{Oktober}{2014}-- Heute}{Title}{institution}{place}{}{Description.}

\end{document}

Example