From 332324fd9c3ea44b44a430649856775c140fc38a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 11 Jun 2020 21:10:43 +0000 Subject: moderntimeline (11jun20) git-svn-id: svn://tug.org/texlive/trunk@55518 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/moderntimeline/moderntimeline.sty | 58 ++++++++++++++++------ 1 file changed, 43 insertions(+), 15 deletions(-) (limited to 'Master/texmf-dist/tex/latex') diff --git a/Master/texmf-dist/tex/latex/moderntimeline/moderntimeline.sty b/Master/texmf-dist/tex/latex/moderntimeline/moderntimeline.sty index 4e93ed18950..642ff02d2d4 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} - [2015/08/31 0.9 Add timelines to moderncv entries] + [2020/06/11 0.11 Add timelines to moderncv entries] \ProvidesPackage{moderntimeline} \RequirePackage{tikz} \RequirePackage{kvoptions} @@ -30,6 +30,8 @@ } \DeclareStringOption{firstyear} \DeclareStringOption{lastyear} +\DeclareStringOption{marksmo}[0.2ex] +\DeclareStringOption{marksyr}[0.4ex] \ProcessKeyvalOptions* \newif\ifstartyear \newif\ifissince @@ -43,6 +45,12 @@ \newcommand{\tlrunningcolor}[1]{% \def\tl@runningcolor{#1} } +\newcommand{\tlmarkheightmo}[1]{% + \def\tl@marksmo{#1} +} +\newcommand{\tlmarkheightyr}[1]{% + \def\tl@marksyr{#1} +} \newcommand{\tlsince}[1]{% \def\tl@since{#1} } @@ -92,6 +100,18 @@ \newcommand{\tldisablemonths}{% \def\tl@nomonthvalue{0} } +\newcommand{\tldisablemarksyr}{% + \def\tl@marksyr{} +} +\newcommand{\tlenablemarksyr}{% + \def\tl@marksyr{0.4ex} +} +\newcommand{\tldisablemarksmo}{% + \def\tl@marksmo{} +} +\newcommand{\tlenablemarksmo}{% + \def\tl@marksmo{0.2ex} +} \tltext{\scriptsize} \tlwidth{0.8ex} \tlrunningwidth{0.05ex} @@ -135,6 +155,23 @@ \pgfmathsetmacro\tl@tmpmonth{#1}% \fi } +\newcommand{\tl@tlcvbar}{ + \pgfmathsetmacro\tl@yearrange{\tl@lastyear-\tl@firstyear} + \pgfmathsetmacro\tl@totalmonths{12*\tl@yearrange}% + \pgfmathsetmacro\tl@tickdistmo{\hintscolumnwidth/\tl@totalmonths}% + \pgfmathsetmacro\tl@tickdistyr{\hintscolumnwidth/\tl@yearrange}% + \useasboundingbox (0,-1.5ex) rectangle (\hintscolumnwidth,1ex); + \fill [\tl@runningcolor] (0,0) + rectangle (\hintscolumnwidth,\tl@runningwidth); + \ifx\tl@marksyr\empty\relax\else + \foreach \x in {0, ..., \tl@yearrange} + \draw [\tl@runningcolor](\x*\tl@tickdistyr pt,0ex) -- (\x*\tl@tickdistyr pt,\tl@marksyr); + \fi + \ifx\tl@marksmo\empty\relax\else + \foreach \x in {0, ..., \tl@totalmonths} + \draw [\tl@runningcolor](\x*\tl@tickdistmo pt,0ex) -- (\x*\tl@tickdistmo pt,\tl@marksmo); + \fi +} \newcommand{\tl@splitlabels}[1]{ \gdef\tl@startlabel{}% Resetting \begingroup% @@ -184,9 +221,7 @@ \issincefalse \tl@formatstartyear{#2} \cventry{\tikz[baseline=0pt]{ - \useasboundingbox (0,-1.5ex) rectangle (\hintscolumnwidth,1ex); - \fill [\tl@runningcolor] (0,0) - rectangle (\hintscolumnwidth,\tl@runningwidth); + \tl@tlcvbar \fill [#1] (0,0) ++(\tl@startfraction*\hintscolumnwidth,0pt) node [tl@startyear] {#3} @@ -199,9 +234,7 @@ \issincefalse \tl@formatstartyear{#2} \cventry{\tikz[baseline=0pt]{ - \useasboundingbox (0,-1.5ex) rectangle (\hintscolumnwidth,1ex); - \fill [\tl@runningcolor] (0,0) - rectangle (\hintscolumnwidth,\tl@runningwidth); + \tl@tlcvbar \fill [#1] (0,0) ++(\tl@startfraction*\hintscolumnwidth,0pt) node [tl@singleyear] {#2} @@ -214,9 +247,7 @@ \tl@formatendyear{#3} \tl@formatstartyear{#2} \cventry{\tikz[baseline=0pt]{ - \useasboundingbox (0,-1.5ex) rectangle (\hintscolumnwidth,1ex); - \fill [\tl@runningcolor] (0,0) - rectangle (\hintscolumnwidth,\tl@runningwidth); + \tl@tlcvbar \fill [#1] (0,0) ++(\tl@startfraction*\hintscolumnwidth,0pt) node [tl@startyear] {\tl@startlabel} @@ -230,7 +261,7 @@ (\tl@startfraction*\hintscolumnwidth,0) rectangle (\fullcolorwidth,\tl@width); \shade [left color=#1] (\fullcolorwidth,0) - rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width); + rectangle (\tl@endfraction*\hintscolumnwidth + 1,\tl@width); \else \fill [#1] (\tl@startfraction*\hintscolumnwidth,0) rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width); @@ -244,10 +275,7 @@ \tl@formatstartyear{#2} \tl@splitlabels{#4} \cventry{\tikz[baseline=0pt]{ - \fill [\tl@runningcolor] (0,0) - rectangle (\hintscolumnwidth,\tl@runningwidth); - \useasboundingbox (0,-1.5ex) - rectangle (\hintscolumnwidth,1ex); + \tl@tlcvbar \fill [#1] (0,0) ++(\tl@startfraction*\hintscolumnwidth,0pt) node [tl@startyear] {\tl@startlabel} -- cgit v1.2.3