From 7fe7dded5bf2ae143d4f7ae1c5da9e394022a684 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 16 Nov 2011 01:16:52 +0000 Subject: moderntimeline (15nov11) git-svn-id: svn://tug.org/texlive/trunk@24607 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/moderntimeline/moderntimeline.sty | 87 +++++++++++++--------- 1 file changed, 50 insertions(+), 37 deletions(-) (limited to 'Master/texmf-dist/tex/latex/moderntimeline') diff --git a/Master/texmf-dist/tex/latex/moderntimeline/moderntimeline.sty b/Master/texmf-dist/tex/latex/moderntimeline/moderntimeline.sty index 767f1df331d..69a58ba75eb 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/10/02 0.4 Add timelines to moderncv entries] + [2011/11/15 0.5 Add timelines to moderncv entries] \ProvidesPackage{moderntimeline} \RequirePackage{tikz} \RequirePackage{kvoptions} @@ -46,9 +46,9 @@ } \newcommand{\tltextstart}[2][base west]{% \tikzset{ - tlstartyear/.style={ + tl@startyear/.style={ font=#2, - name=tlstartyear, + name=tl@startyear, above=\tl@textstartabove, inner xsep=0pt, anchor=#1, @@ -66,9 +66,20 @@ } } } +\newcommand{\tltextsingle}[1]{% + \tikzset{ + tl@singleyear/.style={ + font=#1, + name=tl@singleyear, + above=1pt, + inner xsep=0pt, + } + } +} \newcommand{\tltext}[1]{% \tltextstart{#1}% - \tltextend{#1} + \tltextend{#1}% + \tltextsingle{#1}% } \tltext{\scriptsize} \tlwidth{0.8ex} @@ -89,51 +100,53 @@ rectangle (\hintscolumnwidth,\tl@runningwidth); \fill [#1] (0,0) ++(\tl@startfraction*\hintscolumnwidth,0pt) - node [tlstartyear] {#3} + node [tl@startyear] {#3} node {$\bullet$}; } } {#4}{#5}{#6}{#7}{#8} } \newcommand{\tldatecventry}[7][sectionrectanglecolor]{% -\pgfmathsetmacro\tl@endyear{\tl@lastyear} +\pgfmathsetmacro\tl@endyear{\tl@lastyear}% \pgfmathsetmacro\tl@startfraction{(#2-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}% \pgfmathsetmacro\tl@endfraction{(\tl@endyear-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}% - \cventry{\tikz{ - \fill [\tl@runningcolor] (0,0) - rectangle (\hintscolumnwidth,\tl@runningwidth); - \fill [#1] (0,0) - ++(\tl@startfraction*\hintscolumnwidth,0pt) - node [tlstartyear] {#2} - node {$\bullet$}; - } -} -{#3}{#4}{#5}{#6}{#7} +\cventry{\tikz[baseline=0pt]{ + \useasboundingbox (0,-1.5ex) rectangle (\hintscolumnwidth,1ex); + \fill [\tl@runningcolor] (0,0) + rectangle (\hintscolumnwidth,\tl@runningwidth); + \fill [#1] (0,0) + ++(\tl@startfraction*\hintscolumnwidth,0pt) + node [tl@singleyear] {#2} + node {$\bullet$}; + }% +}% +{#3}{#4}{#5}{#6}{#7}% } \newcommand{\tlcventry}[8][sectionrectanglecolor]{% -\pgfmathsetmacro\tl@endyear{ifthenelse(#3==0,\tl@lastyear,#3)} +\pgfmathsetmacro\tl@endyear{ifthenelse(#3==0,\tl@lastyear,#3)}% \pgfmathsetmacro\tl@startfraction{(#2-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}% \pgfmathsetmacro\tl@endfraction{(\tl@endyear-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}% \ifnum #3=0 \def\tl@startlabel{\tl@since #2} \else \def\tl@startlabel{#2} \fi - \cventry{\tikz[baseline=(tl@endyear.north)]{ - \fill [\tl@runningcolor] (0,0) - rectangle (\hintscolumnwidth,\tl@runningwidth); - \fill [#1] (0,0) - ++(\tl@startfraction*\hintscolumnwidth,0pt) - node [tlstartyear] {\tl@startlabel} - rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width-1pt) - node [tl@endyear] {\pgfmathparse{ifthenelse(#3==0,,#3)}\pgfmathresult} - (\hintscolumnwidth,0pt) ; - \ifnum #3=0 - \shade [left color=#1] (\tl@startfraction*\hintscolumnwidth,0) - rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width); - \else - \fill [#1] (\tl@startfraction*\hintscolumnwidth,0) - rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width); - \fi - } -} -{#4}{#5}{#6}{#7}{#8} + \cventry{\tikz[baseline=0pt]{ + \useasboundingbox (0,-1.5ex) rectangle (\hintscolumnwidth,1ex); + \fill [\tl@runningcolor] (0,0) + rectangle (\hintscolumnwidth,\tl@runningwidth); + \fill [#1] (0,0) + ++(\tl@startfraction*\hintscolumnwidth,0pt) + node [tl@startyear] {\tl@startlabel} + rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width-1pt) + node [tl@endyear] {\pgfmathparse{ifthenelse(#3==0,,#3)}\pgfmathresult} + (\hintscolumnwidth,0pt) ; + \ifnum #3=0 + \shade [left color=#1] (\tl@startfraction*\hintscolumnwidth,0) + rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width); + \else + \fill [#1] (\tl@startfraction*\hintscolumnwidth,0) + rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width); + \fi + }% +}% +{#4}{#5}{#6}{#7}{#8}% } \newcommand{\tllabelcventry}[9][sectionrectanglecolor]{% \pgfmathsetmacro\tl@endyear{ifthenelse(#3==0,\tl@lastyear,#3)} @@ -144,7 +157,7 @@ rectangle (\hintscolumnwidth,\tl@runningwidth); \fill [#1] (0,0) ++(\tl@startfraction*\hintscolumnwidth,0pt) - node [tlstartyear] {#4} + node [tl@startyear] {#4} rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width-1pt); \ifnum #3=0 \shade [left color=#1] (\tl@startfraction*\hintscolumnwidth,0) -- cgit v1.2.3