summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/moderntimeline
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-09-30 23:00:33 +0000
committerKarl Berry <karl@freefriends.org>2011-09-30 23:00:33 +0000
commita9243fed05552cc82824e67eec609e4656ed3382 (patch)
tree625aa571199123751b6b1c3b38f698814d4d9c37 /Master/texmf-dist/tex/latex/moderntimeline
parente16cf95fe5c387feb9e2a3b5f90c3dce8ea66c6a (diff)
moderntimeline (30sep11)
git-svn-id: svn://tug.org/texlive/trunk@24158 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/moderntimeline')
-rw-r--r--Master/texmf-dist/tex/latex/moderntimeline/moderntimeline.sty25
1 files changed, 15 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/latex/moderntimeline/moderntimeline.sty b/Master/texmf-dist/tex/latex/moderntimeline/moderntimeline.sty
index 69bd05149a1..6a68a773a8a 100644
--- a/Master/texmf-dist/tex/latex/moderntimeline/moderntimeline.sty
+++ b/Master/texmf-dist/tex/latex/moderntimeline/moderntimeline.sty
@@ -20,7 +20,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{moderntimeline}
- [2011/09/28 0.1 Add timelines to moderncv entries]
+ [2011/09/29 0.3 Add timelines to moderncv entries]
\ProvidesPackage{moderntimeline}
\RequirePackage{tikz}
\newcommand{\tlwidth}[1]{%
@@ -33,25 +33,28 @@
\newcommand{\tlrunningcolor}[1]{%
\def\tl@runningcolor{#1}
}
-\newcommand{\tltextstart}[1]{%
+\newcommand{\tlsince}[1]{%
+ \def\tl@since{#1}
+}
+\newcommand{\tltextstart}[2][base west]{%
\tikzset{
tlstartyear/.style={
- font=#1,
+ font=#2,
name=tlstartyear,
above=\tl@textstartabove,
inner xsep=0pt,
- anchor=base west,
+ anchor=#1,
}
}
}
-\newcommand{\tltextend}[1]{%
+\newcommand{\tltextend}[2][north east]{%
\tikzset{
tlendyear/.style={
- font=#1,
+ font=#2,
name=tlendyear,
below,
inner xsep=0pt,
- anchor=north east,
+ anchor=#1,
}
}
}
@@ -63,6 +66,7 @@
\tlwidth{0.8ex}
\tlrunningwidth{0.05ex}
\tlrunningcolor{gray}
+\tlsince{}
\newcommand{\tlmaxdates}[2]{%
\def\tlfirstyear{#1}
\def\tllastyear{#2}
@@ -72,7 +76,7 @@
\pgfmathsetmacro\tlendyear{\tllastyear}
\pgfmathsetmacro\tlstartfraction{(#2-\tlfirstyear)/(\tllastyear-\tlfirstyear)}%
\pgfmathsetmacro\tlendfraction{(\tlendyear-\tlfirstyear)/(\tllastyear-\tlfirstyear)}%
- \cventry{\tikz[baseline=(tlendyear.north)]{
+ \cventry{\tikz{
\fill [\tl@runningcolor] (0,0)
rectangle (\hintscolumnwidth,\tl@runningwidth);
\fill [#1] (0,0)
@@ -87,7 +91,7 @@
\pgfmathsetmacro\tlendyear{\tllastyear}
\pgfmathsetmacro\tlstartfraction{(#2-\tlfirstyear)/(\tllastyear-\tlfirstyear)}%
\pgfmathsetmacro\tlendfraction{(\tlendyear-\tlfirstyear)/(\tllastyear-\tlfirstyear)}%
- \cventry{\tikz[baseline=(tlendyear.north)]{
+ \cventry{\tikz{
\fill [\tl@runningcolor] (0,0)
rectangle (\hintscolumnwidth,\tl@runningwidth);
\fill [#1] (0,0)
@@ -102,12 +106,13 @@
\pgfmathsetmacro\tlendyear{ifthenelse(#3==0,\tllastyear,#3)}
\pgfmathsetmacro\tlstartfraction{(#2-\tlfirstyear)/(\tllastyear-\tlfirstyear)}%
\pgfmathsetmacro\tlendfraction{(\tlendyear-\tlfirstyear)/(\tllastyear-\tlfirstyear)}%
+\ifnum #3=0 \def\tlstartlabel{\tl@since #2} \else \def\tlstartlabel{#2} \fi
\cventry{\tikz[baseline=(tlendyear.north)]{
\fill [\tl@runningcolor] (0,0)
rectangle (\hintscolumnwidth,\tl@runningwidth);
\fill [#1] (0,0)
++(\tlstartfraction*\hintscolumnwidth,0pt)
- node [tlstartyear] {#2}
+ node [tlstartyear] {\tlstartlabel}
rectangle (\tlendfraction*\hintscolumnwidth,\tl@width-1pt)
node [tlendyear] {\pgfmathparse{ifthenelse(#3==0,,#3)}\pgfmathresult}
(\hintscolumnwidth,0pt) ;