# correct alignment of \tldatelabelcventry to the text

\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:

And it should be:

-

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}


-
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
@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