8

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

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

To avoid something like here: https://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.

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

1 Answer 1

7

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}
3
  • 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, 2013 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, 2013 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, 2013 at 23:50

You must log in to answer this question.

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