# Moderncv with moderntimeline - how do I center the label above the timeline?

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

To avoid something like here:

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.

-
Please include a small example document that shows how you generate the timelines (are you using \tllabelcventry?) –  Jake May 6 '12 at 23:20

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}

-
is there a way to "tune" this hack so the label remains on the left or right side (depending of its position in the timeline) but it is aligned (or flushed) to the limits of hintscolumnwidth and does not cross over of its maximum dimensions. (I hope you can understand without a visual example...) –  Katuyci Feb 18 '13 at 22:31
@Katuyci: I'm sorry, I can't really picture what you're trying to achieve. With long labels like the one in the example, it will be unavoidable to extend past the column, either to the left or right side (or both). It would probably be best if you could open a new question with a minimal example document and ideally a mock-up of what you want the result to look like. –  Jake Feb 18 '13 at 22:36
this post quite shows my problem and provides a possible solution. However, I would like something more automatic that would adjust/float accordingly to its position in hintscolumn and time scale used. I just opened a new question. –  Katuyci Feb 18 '13 at 23:50