# Switch positions of startyear and endyear in moderntimeline

How can I switch in package moderntimeline the positions of startyear and endyear without breaking the layout?

Would be nice to have the startyear below and the endyear on top.

I'd like to simply change 2010 with 2007 in the following image:

-
Welcome to TeX.sx! A tip: You can use backticks  to mark your inline code as I did in my edit. –  Kurt Nov 18 '12 at 23:28
Can you please compose a simple, minimal and complete document showing what exactly do you want to change? –  Gonzalo Medina Nov 18 '12 at 23:40
Hope this screenshot is enough? Didn't think that a minimal or complete document will help to solve the problem!? –  Megachip Nov 19 '12 at 0:14
@Megachip A MWE might not help to actually find the solution (although in some cases it actually does), but it certainly saves time. –  Gonzalo Medina Nov 19 '12 at 0:31

You can produce the desired result by setting \tlwidth, \tltextstart, and \tltextend appropriately, as the following simple example shows:

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

\tltextstart[north]{\scriptsize}
\tltextend[south]{\scriptsize}
\tlwidth{-2pt}

\firstname{John}
\familyname{Doe}

\begin{document}

\makecvtitle

\tlcventry[cyan!60!black]{2007}{2010}{test}{test}{test}{}{test}

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

\end{document}


With the above solution the bars are below the timeline; to keep the bars above the timeline, instead of changing \tlwidth to a negative value, one can change the value for \tl@textstartabove:

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

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

\end{document}
`

-
Perfekt, excactly what i want. Thank you very very much. Possible this could add to moderntimeline documentation!? –  Megachip Nov 19 '12 at 12:44
@Megachip You're welcome. I will talk about this with the package creator. Please don't forget to accept the answer (accepting and up-voting are two different actions) if you consider that it solved your problem. In case of doubt please see How do you accept an answer?. –  Gonzalo Medina Nov 19 '12 at 14:54
I've got a little problem with this solution, possible you could help me again and add it to the solution: see link. The \tldatelabelcventry did not work proper anymore. \tllabelcventry works fine. –  Megachip Nov 19 '12 at 17:26
@Megachip I gladly will hel you, but I need to see some sample complete code (similar to the one in my answer) illustrating the problem. Please upload this sample code elsewhere and provide a link. –  Gonzalo Medina Nov 20 '12 at 13:42
–  Megachip Nov 20 '12 at 15:23