texlive[55518] Master/texmf-dist: moderntimeline (11jun20)

commits+karl at tug.org commits+karl at tug.org
Thu Jun 11 23:10:43 CEST 2020


Revision: 55518
          http://tug.org/svn/texlive?view=revision&revision=55518
Author:   karl
Date:     2020-06-11 23:10:43 +0200 (Thu, 11 Jun 2020)
Log Message:
-----------
moderntimeline (11jun20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/moderntimeline/moderntimeline.pdf
    trunk/Master/texmf-dist/source/latex/moderntimeline/moderntimeline.dtx
    trunk/Master/texmf-dist/tex/latex/moderntimeline/moderntimeline.sty

Modified: trunk/Master/texmf-dist/doc/latex/moderntimeline/moderntimeline.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/moderntimeline/moderntimeline.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/moderntimeline/moderntimeline.dtx	2020-06-11 21:10:07 UTC (rev 55517)
+++ trunk/Master/texmf-dist/source/latex/moderntimeline/moderntimeline.dtx	2020-06-11 21:10:43 UTC (rev 55518)
@@ -26,12 +26,12 @@
 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
 %<package>\ProvidesPackage{moderntimeline}
 %<*package>
-    [2015/08/31 0.9 Add timelines to moderncv entries]
+    [2020/06/11 0.11 Add timelines to moderncv entries]
 %</package>
 %
 %<*driver>
 \documentclass{ltxdoc}
-\usepackage{moderntimeline}[2012/04/26]
+\usepackage{moderntimeline}[2020/06/11]
 \EnableCrossrefs
 \CodelineIndex
 \RecordChanges
@@ -43,7 +43,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{352}
+% \CheckSum{413}
 %
 % \CharacterTable
 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -62,6 +62,7 @@
 %   Right brace   \}     Tilde         \~}
 %
 %
+% \changes{0.11}{2020/06/11}{Add support for timeline bar marks, thanks to jordieh}
 % \changes{0.10}{2019/03/04}{Add support to specify label for end date, thanks to ypid and Astrinus}
 % \changes{0.9}{2015/08/31}{Add month support, thanks to Astrinus}
 % \changes{0.8}{2015/02/25}{Add the tlsetnotshadedfraction command, thanks to Stefano Gronchi}
@@ -102,12 +103,16 @@
 % and can be loaded with:
 %
 % \begin{verbatim}
-%    \usepackage[firstyear=1999,lastyear=2012]{moderntimeline}
+%    \usepackage[firstyear=1999,lastyear=2012,
+%                marksyr=0.4ex,marksmo=0.2ex
+%                ]{moderntimeline}
 % \end{verbatim}
 %
 % The \texttt{firstyear} and \texttt{lastyear} options indicate the maximum dates used
 % to calibrate the time line. They are not mandatory and can be set later
 % by means of the |\ltmaxdates| macro.
+% The \texttt{marksyr} and \texttt{marksmo} options behave exactly the same as
+% the |\tlenablemarksyr| and |\tlenablemarksmo| (and associated) macros.
 %
 % \subsection{Settings}
 %
@@ -228,7 +233,22 @@
 % the beginning of the year, so is not advisable to use months in dates.
 % Default.
 %
+% \DescribeMacro{\tlenablemarksmo}
+% This macro places vertical lines on the timeline bar at every month and year.
+% You can set the height of the marks with |\tlmarkheightmo| (default = 0.2ex).
 %
+% \DescribeMacro{\tlenablemakrsyr}
+% This macro places vertical lines on the timeline bar at every year.
+% You can set the height of the marks with |\tlmarkheightyr| (default = 0.4ex).
+%
+% \DescribeMacro{\tldisablemarksyr}
+% Disables the vertical lines marking years on the timeline bar.
+% This is the opposite of |\tlenablemarksyr|.
+%
+% \DescribeMacro{\tldisablemarksmo}
+% Disables the vertical lines marking months and years on the timeline bar.
+% This is the opposite of |\tlenablemarksmo|.
+%
 % \subsection{CV entries}
 %
 % This package provides new CV entry commands
@@ -341,6 +361,8 @@
 }
 \DeclareStringOption{firstyear}
 \DeclareStringOption{lastyear}
+\DeclareStringOption{marksmo}[0.2ex]
+\DeclareStringOption{marksyr}[0.4ex]
 \ProcessKeyvalOptions*
 \newif\ifstartyear
 \newif\ifissince
@@ -371,6 +393,22 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\tlmarkheightmo}
+%    \begin{macrocode}
+\newcommand{\tlmarkheightmo}[1]{%
+    \def\tl at marksmo{#1}
+}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\tlmarkheightyr}
+%    \begin{macrocode}
+\newcommand{\tlmarkheightyr}[1]{%
+    \def\tl at marksyr{#1}
+}
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\tlsince}
 %    \begin{macrocode}
 \newcommand{\tlsince}[1]{%
@@ -469,6 +507,42 @@
 % \end{macro}
 %
 %
+% \begin{macro}{\tldisablemarksyr}
+%    \begin{macrocode}
+\newcommand{\tldisablemarksyr}{%
+    \def\tl at marksyr{}
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\tlenablemarksyr}
+%    \begin{macrocode}
+\newcommand{\tlenablemarksyr}{%
+    \def\tl at marksyr{0.4ex}
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\tldisablemarksmo}
+%    \begin{macrocode}
+\newcommand{\tldisablemarksmo}{%
+    \def\tl at marksmo{}
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\tlenablemarksmo}
+%    \begin{macrocode}
+\newcommand{\tlenablemarksmo}{%
+    \def\tl at marksmo{0.2ex}
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%
 % Defaults
 %    \begin{macrocode}
 \tltext{\scriptsize}
@@ -532,6 +606,28 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\tl at tlcvbar}
+%    \begin{macrocode}
+\newcommand{\tl at tlcvbar}{
+    \pgfmathsetmacro\tl at yearrange{\tl at lastyear-\tl at firstyear}
+    \pgfmathsetmacro\tl at totalmonths{12*\tl at yearrange}%
+    \pgfmathsetmacro\tl at tickdistmo{\hintscolumnwidth/\tl at totalmonths}%
+    \pgfmathsetmacro\tl at tickdistyr{\hintscolumnwidth/\tl at yearrange}%
+    \useasboundingbox (0,-1.5ex) rectangle (\hintscolumnwidth,1ex);
+    \fill [\tl at runningcolor] (0,0)
+    rectangle (\hintscolumnwidth,\tl at runningwidth);
+    \ifx\tl at marksyr\empty\relax\else
+        \foreach \x in {0, ..., \tl at yearrange}
+        \draw [\tl at runningcolor](\x*\tl at tickdistyr pt,0ex) -- (\x*\tl at tickdistyr pt,\tl at marksyr);
+    \fi
+    \ifx\tl at marksmo\empty\relax\else
+        \foreach \x in {0, ..., \tl at totalmonths}
+        \draw [\tl at runningcolor](\x*\tl at tickdistmo pt,0ex) -- (\x*\tl at tickdistmo pt,\tl at marksmo);
+    \fi
+}
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\tl at splitlabels}
 %    \begin{macrocode}
 \newcommand{\tl at splitlabels}[1]{
@@ -605,9 +701,7 @@
 \issincefalse
 \tl at formatstartyear{#2}
 \cventry{\tikz[baseline=0pt]{
-    \useasboundingbox (0,-1.5ex) rectangle (\hintscolumnwidth,1ex);
-     \fill [\tl at runningcolor] (0,0)
-        rectangle (\hintscolumnwidth,\tl at runningwidth);
+    \tl at tlcvbar
      \fill [#1] (0,0)
         ++(\tl at startfraction*\hintscolumnwidth,0pt)
         node [tl at startyear] {#3}
@@ -627,9 +721,7 @@
 \issincefalse
 \tl at formatstartyear{#2}
 \cventry{\tikz[baseline=0pt]{
-    \useasboundingbox (0,-1.5ex) rectangle (\hintscolumnwidth,1ex);
-    \fill [\tl at runningcolor] (0,0)
-       rectangle (\hintscolumnwidth,\tl at runningwidth);
+    \tl at tlcvbar
     \fill [#1] (0,0)
        ++(\tl at startfraction*\hintscolumnwidth,0pt)
        node [tl at singleyear] {#2}
@@ -649,9 +741,7 @@
 \tl at formatendyear{#3}
 \tl at formatstartyear{#2}
  \cventry{\tikz[baseline=0pt]{
-    \useasboundingbox (0,-1.5ex) rectangle (\hintscolumnwidth,1ex);
-    \fill [\tl at runningcolor] (0,0)
-       rectangle (\hintscolumnwidth,\tl at runningwidth);
+    \tl at tlcvbar
     \fill [#1] (0,0)
        ++(\tl at startfraction*\hintscolumnwidth,0pt)
        node [tl at startyear] {\tl at startlabel}
@@ -665,7 +755,7 @@
 (\tl at startfraction*\hintscolumnwidth,0)
            rectangle (\fullcolorwidth,\tl at width);
        \shade [left color=#1] (\fullcolorwidth,0)
-           rectangle (\tl at endfraction*\hintscolumnwidth,\tl at width);
+           rectangle (\tl at endfraction*\hintscolumnwidth + 1,\tl at width);
     \else
        \fill [#1] (\tl at startfraction*\hintscolumnwidth,0)
            rectangle (\tl at endfraction*\hintscolumnwidth,\tl at width);
@@ -686,10 +776,7 @@
 \tl at formatstartyear{#2}
 \tl at splitlabels{#4}
  \cventry{\tikz[baseline=0pt]{
-     \fill [\tl at runningcolor] (0,0)
-        rectangle (\hintscolumnwidth,\tl at runningwidth);
-     \useasboundingbox (0,-1.5ex)
-        rectangle (\hintscolumnwidth,1ex);
+     \tl at tlcvbar
      \fill [#1] (0,0)
         ++(\tl at startfraction*\hintscolumnwidth,0pt)
         node [tl at startyear] {\tl at startlabel}

Modified: trunk/Master/texmf-dist/tex/latex/moderntimeline/moderntimeline.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/moderntimeline/moderntimeline.sty	2020-06-11 21:10:07 UTC (rev 55517)
+++ trunk/Master/texmf-dist/tex/latex/moderntimeline/moderntimeline.sty	2020-06-11 21:10:43 UTC (rev 55518)
@@ -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 at runningcolor{#1}
 }
+\newcommand{\tlmarkheightmo}[1]{%
+    \def\tl at marksmo{#1}
+}
+\newcommand{\tlmarkheightyr}[1]{%
+    \def\tl at marksyr{#1}
+}
 \newcommand{\tlsince}[1]{%
    \def\tl at since{#1}
 }
@@ -92,6 +100,18 @@
 \newcommand{\tldisablemonths}{%
    \def\tl at nomonthvalue{0}
 }
+\newcommand{\tldisablemarksyr}{%
+    \def\tl at marksyr{}
+}
+\newcommand{\tlenablemarksyr}{%
+    \def\tl at marksyr{0.4ex}
+}
+\newcommand{\tldisablemarksmo}{%
+    \def\tl at marksmo{}
+}
+\newcommand{\tlenablemarksmo}{%
+    \def\tl at marksmo{0.2ex}
+}
 \tltext{\scriptsize}
 \tlwidth{0.8ex}
 \tlrunningwidth{0.05ex}
@@ -135,6 +155,23 @@
     \pgfmathsetmacro\tl at tmpmonth{#1}%
   \fi
 }
+\newcommand{\tl at tlcvbar}{
+    \pgfmathsetmacro\tl at yearrange{\tl at lastyear-\tl at firstyear}
+    \pgfmathsetmacro\tl at totalmonths{12*\tl at yearrange}%
+    \pgfmathsetmacro\tl at tickdistmo{\hintscolumnwidth/\tl at totalmonths}%
+    \pgfmathsetmacro\tl at tickdistyr{\hintscolumnwidth/\tl at yearrange}%
+    \useasboundingbox (0,-1.5ex) rectangle (\hintscolumnwidth,1ex);
+    \fill [\tl at runningcolor] (0,0)
+    rectangle (\hintscolumnwidth,\tl at runningwidth);
+    \ifx\tl at marksyr\empty\relax\else
+        \foreach \x in {0, ..., \tl at yearrange}
+        \draw [\tl at runningcolor](\x*\tl at tickdistyr pt,0ex) -- (\x*\tl at tickdistyr pt,\tl at marksyr);
+    \fi
+    \ifx\tl at marksmo\empty\relax\else
+        \foreach \x in {0, ..., \tl at totalmonths}
+        \draw [\tl at runningcolor](\x*\tl at tickdistmo pt,0ex) -- (\x*\tl at tickdistmo pt,\tl at marksmo);
+    \fi
+}
 \newcommand{\tl at splitlabels}[1]{
   \gdef\tl at startlabel{}% Resetting
   \begingroup%
@@ -184,9 +221,7 @@
 \issincefalse
 \tl at formatstartyear{#2}
 \cventry{\tikz[baseline=0pt]{
-    \useasboundingbox (0,-1.5ex) rectangle (\hintscolumnwidth,1ex);
-     \fill [\tl at runningcolor] (0,0)
-        rectangle (\hintscolumnwidth,\tl at runningwidth);
+    \tl at tlcvbar
      \fill [#1] (0,0)
         ++(\tl at startfraction*\hintscolumnwidth,0pt)
         node [tl at startyear] {#3}
@@ -199,9 +234,7 @@
 \issincefalse
 \tl at formatstartyear{#2}
 \cventry{\tikz[baseline=0pt]{
-    \useasboundingbox (0,-1.5ex) rectangle (\hintscolumnwidth,1ex);
-    \fill [\tl at runningcolor] (0,0)
-       rectangle (\hintscolumnwidth,\tl at runningwidth);
+    \tl at tlcvbar
     \fill [#1] (0,0)
        ++(\tl at startfraction*\hintscolumnwidth,0pt)
        node [tl at singleyear] {#2}
@@ -214,9 +247,7 @@
 \tl at formatendyear{#3}
 \tl at formatstartyear{#2}
  \cventry{\tikz[baseline=0pt]{
-    \useasboundingbox (0,-1.5ex) rectangle (\hintscolumnwidth,1ex);
-    \fill [\tl at runningcolor] (0,0)
-       rectangle (\hintscolumnwidth,\tl at runningwidth);
+    \tl at tlcvbar
     \fill [#1] (0,0)
        ++(\tl at startfraction*\hintscolumnwidth,0pt)
        node [tl at startyear] {\tl at startlabel}
@@ -230,7 +261,7 @@
 (\tl at startfraction*\hintscolumnwidth,0)
            rectangle (\fullcolorwidth,\tl at width);
        \shade [left color=#1] (\fullcolorwidth,0)
-           rectangle (\tl at endfraction*\hintscolumnwidth,\tl at width);
+           rectangle (\tl at endfraction*\hintscolumnwidth + 1,\tl at width);
     \else
        \fill [#1] (\tl at startfraction*\hintscolumnwidth,0)
            rectangle (\tl at endfraction*\hintscolumnwidth,\tl at width);
@@ -244,10 +275,7 @@
 \tl at formatstartyear{#2}
 \tl at splitlabels{#4}
  \cventry{\tikz[baseline=0pt]{
-     \fill [\tl at runningcolor] (0,0)
-        rectangle (\hintscolumnwidth,\tl at runningwidth);
-     \useasboundingbox (0,-1.5ex)
-        rectangle (\hintscolumnwidth,1ex);
+     \tl at tlcvbar
      \fill [#1] (0,0)
         ++(\tl at startfraction*\hintscolumnwidth,0pt)
         node [tl at startyear] {\tl at startlabel}



More information about the tex-live-commits mailing list.