Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
\documentclass{moderncv}
\moderncvstyle{casual}
\usepackage[firstyear=1999,lastyear=2012]{moderntimeline}

\makeatletter
\pgfmathsetmacro\tl@textstartabove{\tl@width-2pt}
\makeatother

\tltextstart[north]{\scriptsize}
\tltextend[south]{\scriptsize}

\firstname{John}
\familyname{Doe}

\begin{document}

\makecvtitle

\tlcventry[cyan!60!black]{2007}{2010}{test}{test}{test}{}{test}
\tllabelcventry[cyan!60!black]{2007}{2010}{Test}{test}{test}{test}{}{test}
\tldatelabelcventry{2008}{Okt. 2008}{Test}{}{}{}{}{}

\tldatecventry[brown]{2011}{test}{}{test}{test}{}{test}

\end{document}

The alignment of the \tldatelabelcventry seems not working correctly.

It is: enter image description here

And it should be: enter image description here

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

A redefinition of \tldatelabelcventry is necessary to adjust the position of the timeline and of the label; something along these lines:

\documentclass{moderncv}
\moderncvstyle{casual}
\usepackage[firstyear=1999,lastyear=2012]{moderntimeline}

\makeatletter
\pgfmathsetmacro\tl@textstartabove{\tl@width-2pt}
\renewcommand{\tldatelabelcventry}[8][color1]{%
\pgfmathsetmacro\tl@endyear{\tl@lastyear}
\pgfmathsetmacro\tl@startfraction{(#2-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}%
\pgfmathsetmacro\tl@endfraction{(\tl@endyear-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}%
 \cventry{\tikz[baseline]{
     \fill [\tl@runningcolor] (0,0)
        rectangle (\hintscolumnwidth,\tl@runningwidth);
     \fill [#1] (0,0)
        ++(\tl@startfraction*\hintscolumnwidth,0pt)
        node [tl@startyear,yshift=11pt] {#3}
        node {$\bullet$};
   }
}
{#4}{#5}{#6}{#7}{#8}
}
\makeatother

\tltextstart[north]{\scriptsize}
\tltextend[south]{\scriptsize}

\firstname{John}
\familyname{Doe}

\begin{document}

\makecvtitle

\tlcventry[cyan!60!black]{2007}{2010}{test}{test}{test}{}{test}
\tllabelcventry[cyan!60!black]{2007}{2010}{Test}{test}{test}{test}{}{test}
\tldatelabelcventry{2008}{Okt. 2008}{Test}{}{}{}{}{}

\tldatecventry[brown]{2011}{test}{}{test}{test}{}{test}

\end{document}

enter image description here

share|improve this answer
    
I see this looks like an style inconsistence in moderntimeline. It has nothing to do with tex.stackexchange.com/questions/83259/… –  Megachip Nov 20 '12 at 16:38
1  
@Megachip I updated my answer producing the desired alignment. –  Gonzalo Medina Nov 20 '12 at 17:01
    
Perfect, thx again. –  Megachip Nov 20 '12 at 17:16
    
Another Problem which has something to do with the alignment in moderntimeline: dates on start and end of a bar Possible it could be merged with this problem!? –  Megachip Nov 20 '12 at 19:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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