[Tex/LaTex] Moderncv with moderntimeline – how to center the label above the timeline

moderncvmoderntimeline

How to center the label above the timeline bar on an entry regardless its startingpoint.
e.g. like here:

http://i.stack.imgur.com/a0WL7.png

To avoid something like here:
http://i.stack.imgur.com/Y6bXR.png

I do use \tllabelcventry{2006.834}{2009.67}{2006-10 -- 2009-08} to generate the second entry and \tllabelcventry{2009.67}{2010.67}{2009-08 -- 2010-08} for the first one.

In addition \tltextstart[base]{\scriptsize} is set as well.

@Jake Your solution works well for centering all labels based by the created timebar. But what is with centering the label to the overall timeline, Independet of the timerange used. So that the label on the second picture is placed like taht on the first one.
P.S. Sorry, I could not figure out how to comment your answer like you did with this question.

Best Answer

You can use xshift=(0.5-\tl@startfraction)*\hintscolumnwidth to shift the label to the centre of the timeline. The label uses the tl@startyear style, so you can use that to set the xshift option.

\documentclass{moderncv}

\usepackage{moderntimeline}
\moderncvtheme{classic}
\tlmaxdates{2006}{2012}

\firstname{Lorem}
\familyname{Ipsum}
\makeatletter
\tikzset{
    tl@startyear/.append style={
        xshift=(0.5-\tl@startfraction)*\hintscolumnwidth,
        anchor=base
    }
}
\makeatother
\begin{document}
\tllabelcventry{2006.834}{2009.67}{2006-10 -- 2009-08}{I did something cool for almost three years}{}{}{}{}

\end{document}
Related Question