6

Corresponding to this thread and this I tried to create a timeline in my cv. My code is:

\documentclass[11pt,a4paper]{moderncv}
\moderncvtheme[green]{classic}                  
\usepackage[utf8]{inputenc}                  
\usepackage{floatflt}
\usepackage{fancyhdr} 
\usepackage{geometry}
\geometry{a4paper,left=2cm,right=1cm, top=2cm, bottom=1.5cm,headheight=21pt} 
\usepackage{tikz} 
\usepackage{wrapfig}
\usepackage{lipsum} 
\usepackage{xparse}
\usepackage[firstyear=1996,lastyear=2013]{moderntimeline}


% for timeline

\makeatletter
\pgfmathsetmacro\tl@textstartabove{\tl@width-2pt}
\NewDocumentCommand\tldatelabelcventryn{O{center}O{color1}mmmmmmm}{%
\pgfmathsetmacro\tl@endyear{\tl@lastyear}%
\pgfmathsetmacro\tl@startfraction{(#3-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}%
\pgfmathsetmacro\tl@endfraction{(\tl@endyear-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}%
 \cventry{\tikz[baseline]{%
     \useasboundingbox (0,-1.5ex) rectangle (\hintscolumnwidth,1ex);
     \fill [\tl@runningcolor] (0,0)
        rectangle (\hintscolumnwidth,\tl@runningwidth);
     \fill [#2] (0,0)
        ++(\tl@startfraction*\hintscolumnwidth,0pt)
        node [tl@startyear,yshift=5pt,anchor=#1] {#4}
        node {$\bullet$};
   }
}
{#5}{#6}{#7}{#8}{#9}
}
\makeatother
%
\tltextstart[north]{\scriptsize}
\tltextend[south]{\scriptsize}

%
\firstname{C}
\familyname{N}
\title{Curriculum vit\ae{}}              
\address{}{}  
\photo[128pt]{picture}                        

\begin{document}

\makecvtitle
born on .... in xxxxx

\section{school education}
\tlcventry[cyan!60!black]{2000}{2008}{test1}{test}{}{}{grade: 22}
\tlcventry[cyan!60!black]{1996}{2000}{test2}{}{}{}{test}
\section{studies}
\tllabelcventry[cyan!60!black]{2011}{2013}{Oct 01, 2011}{test3}{}{}{}{test}

\tldatelabelcventry[cyan!60!black]{2011}{Apr 06, 2011}{Test4}{}{test}
{test}{}


\tllabelcventry[cyan!60!black]{2009}{2011}{Dec 01,2009--Jan 01,2011}{Test5}{}{}{}{test}


\end{document}

This gives

t1

  1. test1 and test2 are ok
  2. I want to have test3 until today. So that the Oct 01, 2011 is below the line and it goes until today, so it should be Oct01,2011--today, but this is not working, also the descirption should be "today"
  3. As you can see Test4 is (vertically) not centered? The bold Test4 is too much under the grey line, it is not the same as in the previous cases, how can I have this the way as before? Also I want to have the "Apr 06, 2011" above the grey line.
  4. Test 5 does not work. How can I have the Jan 01, 2011 above the grey line.

And one general question: Currently I am only specifying the year, so e.g. 2009, although sometimes I add the specific day in the label. Is it possible to also specify the month, so that the cyan bar is drawn excatly at this month and this year, so to distinguish on this very detailed level?

EDIT:

\tllabelcventryn[cyan!60!black]{2000}{2008.583}{2000}{Jul 11, 2008}{Test}{Test}{}{}{grade: 1.8}

gives

t1

but I want to have the "Jul 11, 2008" shifted/pushed to the right, so like this (I did it with paint):

t2

EDIT 2: Further on, I would like to have the Apr 06, 2011 in the same style, so that the label is not centered about the timeline itself but around the dot, so that it looks like:

te

So it should have the same alignment as the others, in total they should end at the same border, so that it looks like the following:

test1

4
  • OK I found out the answer to my general question: Yes, with dots after the year, so for dec 01,2011 e.g. 2011.92.
    – Jen Bohold
    Sep 15, 2013 at 17:46
  • I think if someone manages to get the "today" at the end of the timeline and above the grey line it will cover the text. So a next question would be: How can I increase the space between the date column and the text? I am not talking about the size of the date column (that would be e.g. \setlength{\hintscolumnwidth}{0.15\textwidth}) but the space between the date column and the text column?
    – Jen Bohold
    Sep 15, 2013 at 17:55
  • 1
    \setlength{\separatorcolumnwidth}{1em}, for example, allows you to change the space between the date column and the text column.
    – Adam Liter
    Sep 16, 2013 at 7:05
  • @Adam Thanks for this hint! I am still searching about solutions to my questions.....
    – Jen Bohold
    Sep 16, 2013 at 7:44

1 Answer 1

6
+100

One possible solution (notice the additional "n" at the end of the newly defined commands):

\documentclass[11pt,a4paper]{moderncv}
\moderncvtheme[green]{classic}                  
\usepackage[utf8]{inputenc}                  
\usepackage{floatflt}
\usepackage{fancyhdr} 
\usepackage{geometry}
\geometry{a4paper,left=2cm,right=1cm, top=2cm, bottom=1.5cm,headheight=21pt} 
\usepackage{tikz} 
\usepackage{wrapfig}
\usepackage{lipsum} 
\usepackage{xparse}
\usepackage[firstyear=1996,lastyear=2013]{moderntimeline}


% for timeline

\makeatletter
\pgfmathsetmacro\tl@textstartabove{\tl@width-2pt}
\NewDocumentCommand\tldatelabelcventryn{O{center}O{color1}mmmmmmm}{%
\pgfmathsetmacro\tl@endyear{\tl@lastyear}%
\pgfmathsetmacro\tl@startfraction{(#3-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}%
\pgfmathsetmacro\tl@endfraction{(\tl@endyear-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}%
 \cventry{\tikz[baseline]{%
     \useasboundingbox (0,-1.5ex) rectangle (\hintscolumnwidth,1ex);
     \fill [\tl@runningcolor] (0,0)
        rectangle (\hintscolumnwidth,\tl@runningwidth);
     \fill [#2] (0,0)
        ++(\tl@startfraction*\hintscolumnwidth,0pt)
        node [tl@startyear,yshift=5pt,anchor=#1] {#4}
        node {$\bullet$};
   }
}
{#5}{#6}{#7}{#8}{#9}
}
\newcommand\tllabelcventryn[9][color1]{%
  \gdef\Argi{#1}%
  \gdef\Argii{#2}%
  \gdef\Argiii{#3}%
  \gdef\Argiv{#4}%
  \gdef\Argv{#5}%
  \gdef\Argvi{#6}%
  \gdef\Argvii{#7}%
  \gdef\Argviii{#8}%
  \gdef\Argix{#9}%
  \auxtllabelcventryn
}
\def\auxtllabelcventryn#1{%
  \gdef\Argx{#1}%
\pgfmathsetmacro\tl@endyear{ifthenelse(\Argiii==0,\tl@lastyear,\Argiii)}
\pgfmathsetmacro\tl@startfraction{(\Argii-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}%
\pgfmathsetmacro\tl@endfraction{(\tl@endyear-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}%
 \cventry{\tikz[baseline=0pt]{
     \fill [\tl@runningcolor] (0,0)
        rectangle (\hintscolumnwidth,\tl@runningwidth);
     \useasboundingbox (0,-1.5ex)
        rectangle (\hintscolumnwidth,1ex);
     \fill [\Argi] (0,0)
        ++(\tl@startfraction*\hintscolumnwidth,0pt)
        node [tl@startyear,anchor=north east] {\Argiv} node [tl@startyear,above] {\Argv}
        rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width-1pt);
     \pgfmathsetlength{\pgf@xa}{\Argiii} \ifdim\pgf@xa=0pt
        \shade [left color=\Argi] (\tl@startfraction*\hintscolumnwidth,0)
            rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width);
     \else
        \fill [\Argi] (\tl@startfraction*\hintscolumnwidth,0)
            rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width);
     \fi
     }
}
{\Argvi}{\Argvii}{\Argviii}{\Argix}{\Argx}%
}
\makeatother
%
\tltextstart[north]{\scriptsize}
\tltextend[south]{\scriptsize}

%
\firstname{C}
\familyname{N}
\title{Curriculum vit\ae{}}              
\address{}{}  
\photo[128pt]{picture}                        

\begin{document}

\makecvtitle
born on .... in xxxxx

\section{school education}
\tlcventry[cyan!60!black]{2000}{2008}{test1}{test}{}{}{grade: 22}
\tlcventry[cyan!60!black]{1996}{2000}{test2}{}{}{}{test}
\section{studies}
\tllabelcventryn[cyan!60!black]{2011}{2013}{Oct 01, 2011}{today}{test3a}{}{}{}{test}

\tllabelcventry[cyan!60!black]{2011}{2013}{Oct 01, 2011--today}{test3b}{}{}{}{test}

\tldatelabelcventryn[east][cyan!60!black]{2011}{Apr 06, 2011}{Test4}{}{test}
{test}{}

\tllabelcventryn[cyan!60!black]{2009}{2011}{Dec 01,2009}{Jan 01,2011}{Test5}{}{}{}{test}


\end{document}

enter image description here

8
  • Thanks a lot for your help! But how can I combine it with your solution to my question here: tex.stackexchange.com/questions/132747/… to suppress the final dots? I don't like the final dots.
    – Jen Bohold
    Sep 18, 2013 at 7:00
  • Ah, I think I got it, I just add the part under % "Suppress final dot in \cventry" up to before the section "% New page style" starts. This works.
    – Jen Bohold
    Sep 18, 2013 at 7:01
  • One last question: If I add the following entry: "\tllabelcventryn[cyan!60!black]{2000}{2008.583}{2000}{Jul 11, 2008}{Test}{Test}{}{}{grade: 1.8}" I have the problem, that the "Jul 11, 2008" is too left. So it is on the left side but not on the right side, how can I get it on the right side? See my edit in my question. Thanks a lot for your help again.
    – Jen Bohold
    Sep 18, 2013 at 7:58
  • Also I want the Test4, the "Apr 06, 2011" in the same style as the others, so the "Apr 06, 2011" should be centered about the dot in the timeline, so it also shifts a bit to the right? See my second edit.
    – Jen Bohold
    Sep 18, 2013 at 8:05
  • With "same style" I mean the other entries like Test5: The label is also over the timeline on the right side. I like it its okay, but I also want to have Apr 06, 2011 in the same style, so because it is in 2011 the label should also "go over" the right margin of the timeline. As the label "Jan 01, 2011$ of Test5 does.
    – Jen Bohold
    Sep 18, 2013 at 8:10

You must log in to answer this question.

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