GeneralQuestions about Moderntimeline in moderncv \tldatelabelcventryn

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
asdfgh
Posts: 2
Joined: Sun Jun 18, 2017 9:52 am

Questions about Moderntimeline in moderncv \tldatelabelcventryn

Post by asdfgh »

What is the unit of xxx?

\tldatelabelcventryn[east][cyan!60!black]{2016.xxx}{xxx}{Test}{Test}{}{}{}

Is it right, that the 1.1.2016 is 2016.0 and the 31.06.2016 is 2016.5 ? 2016.5 is the same than 2016.500?

Code: Select all

Code, edit and compile here:
\documentclass[11pt,a4paper]{moderncv}
\moderncvtheme[green]{classic}
\usepackage[utf8]{inputenc}
\usepackage{floatflt}
\usepackage{fancyhdr}
\usepackage{geometry}
\geometry{a4paper,left=2cm,right=1cm, top=2cm, bottom=1.5cm,headheight=21pt}
\usepackage{tikz}
\usepackage{wrapfig}
\usepackage{lipsum}
\usepackage{xparse}
\usepackage[firstyear=2016,lastyear=2017]{moderntimeline}
% for timeline
\makeatletter
\pgfmathsetmacro\tl@textstartabove{\tl@width-2pt}
\NewDocumentCommand\tldatelabelcventryn{O{center}O{color1}mmmmmmm}{%
\pgfmathsetmacro\tl@endyear{\tl@lastyear}%
\pgfmathsetmacro\tl@startfraction{(#3-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}%
\pgfmathsetmacro\tl@endfraction{(\tl@endyear-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}%
\cventry{\tikz[baseline]{%
\useasboundingbox (0,-1.5ex) rectangle (\hintscolumnwidth,1ex);
\fill [\tl@runningcolor] (0,0)
rectangle (\hintscolumnwidth,\tl@runningwidth);
\fill [#2] (0,0)
++(\tl@startfraction*\hintscolumnwidth,0pt)
node [tl@startyear,yshift=5pt,anchor=#1] {#4}
node {$\bullet$};
}
}
{#5}{#6}{#7}{#8}{#9}
}
\newcommand\tllabelcventryn[9][color1]{%
\gdef\Argi{#1}%
\gdef\Argii{#2}%
\gdef\Argiii{#3}%
\gdef\Argiv{#4}%
\gdef\Argv{#5}%
\gdef\Argvi{#6}%
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
See also
https://tex.stackexchange.com/questions ... elcventryn

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10344
Joined: Mon Mar 10, 2008 9:44 pm

Questions about Moderntimeline in moderncv \tldatelabelcventryn

Post by Stefan Kottwitz »

Thank you for the link to the cross-post! That makes it easy to follow possible already existing answers, great!

So, there is not really a unit. You can state a year, and then that timeline shows that year's position on the line like on a progress bar.

The code calculates a fraction by (#3-\tl@firstyear)/(\tl@lastyear-\tl@firstyear), where #3 is the year you provide, and multiplies the fraction with the whole progress bar width.

See this example, that makes it more clear:

Code: Select all

Code, edit and compile here:
\usepackage[firstyear=2007,lastyear=2017]{moderntimeline}
...
\makecvtitle
The time lines start at 2007 and end at 2017.
\bigskip
\tldatelabelcventryn[east][cyan!60!black]{2007}{Jan 2007}{First job}{Trainee}{}{}{}
\tldatelabelcventryn[east][cyan!60!black]{2010}{2010}{Employment}{Yay}{}{}{}
\tldatelabelcventryn[east][cyan!60!black]{2012}{2012}{Promotion}{Yippie}{}{}{}
\tldatelabelcventryn[east][cyan!60!black]{2017}{Dec 2017}{Freelancer}{More money}{}{}{}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
cv.png
cv.png (16.05 KiB) Viewed 2037 times
Stefan
LaTeX.org admin
Post Reply