From 9862d695d4ddf483e63f97fa63f312716db84853 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 29 Sep 2011 22:53:00 +0000 Subject: new latex package moderntimeline (29sep11) git-svn-id: svn://tug.org/texlive/trunk@24138 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/moderntimeline/moderntimeline.sty | 149 +++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/moderntimeline/moderntimeline.sty (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 new file mode 100644 index 00000000000..69bd05149a1 --- /dev/null +++ b/Master/texmf-dist/tex/latex/moderntimeline/moderntimeline.sty @@ -0,0 +1,149 @@ +%% +%% This is file `moderntimeline.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% moderntimeline.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright (C) 2011 by Raphaƫl Pinson +%% -------------------------------------------------------------------------- +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{moderntimeline} + [2011/09/28 0.1 Add timelines to moderncv entries] +\ProvidesPackage{moderntimeline} +\RequirePackage{tikz} +\newcommand{\tlwidth}[1]{% + \def\tl@width{#1} + \pgfmathsetmacro\tl@textstartabove{\tl@width+1pt} +} +\newcommand{\tlrunningwidth}[1]{% + \def\tl@runningwidth{#1} +} +\newcommand{\tlrunningcolor}[1]{% + \def\tl@runningcolor{#1} +} +\newcommand{\tltextstart}[1]{% + \tikzset{ + tlstartyear/.style={ + font=#1, + name=tlstartyear, + above=\tl@textstartabove, + inner xsep=0pt, + anchor=base west, + } + } +} +\newcommand{\tltextend}[1]{% + \tikzset{ + tlendyear/.style={ + font=#1, + name=tlendyear, + below, + inner xsep=0pt, + anchor=north east, + } + } +} +\newcommand{\tltext}[1]{% + \tltextstart{#1}% + \tltextend{#1} +} +\tltext{\scriptsize} +\tlwidth{0.8ex} +\tlrunningwidth{0.05ex} +\tlrunningcolor{gray} +\newcommand{\tlmaxdates}[2]{% + \def\tlfirstyear{#1} + \def\tllastyear{#2} + \pgfmathsetmacro\tlyearrange{\tllastyear-\tlfirstyear} +} +\newcommand{\tldatelabelcventry}[8][sectionrectanglecolor]{% +\pgfmathsetmacro\tlendyear{\tllastyear} +\pgfmathsetmacro\tlstartfraction{(#2-\tlfirstyear)/(\tllastyear-\tlfirstyear)}% +\pgfmathsetmacro\tlendfraction{(\tlendyear-\tlfirstyear)/(\tllastyear-\tlfirstyear)}% + \cventry{\tikz[baseline=(tlendyear.north)]{ + \fill [\tl@runningcolor] (0,0) + rectangle (\hintscolumnwidth,\tl@runningwidth); + \fill [#1] (0,0) + ++(\tlstartfraction*\hintscolumnwidth,0pt) + node [tlstartyear] {#3} + node {$\bullet$}; + } +} +{#4}{#5}{#6}{#7}{#8} +} +\newcommand{\tldatecventry}[7][sectionrectanglecolor]{% +\pgfmathsetmacro\tlendyear{\tllastyear} +\pgfmathsetmacro\tlstartfraction{(#2-\tlfirstyear)/(\tllastyear-\tlfirstyear)}% +\pgfmathsetmacro\tlendfraction{(\tlendyear-\tlfirstyear)/(\tllastyear-\tlfirstyear)}% + \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 {$\bullet$}; + } +} +{#3}{#4}{#5}{#6}{#7} +} +\newcommand{\tlcventry}[8][sectionrectanglecolor]{% +\pgfmathsetmacro\tlendyear{ifthenelse(#3==0,\tllastyear,#3)} +\pgfmathsetmacro\tlstartfraction{(#2-\tlfirstyear)/(\tllastyear-\tlfirstyear)}% +\pgfmathsetmacro\tlendfraction{(\tlendyear-\tlfirstyear)/(\tllastyear-\tlfirstyear)}% + \cventry{\tikz[baseline=(tlendyear.north)]{ + \fill [\tl@runningcolor] (0,0) + rectangle (\hintscolumnwidth,\tl@runningwidth); + \fill [#1] (0,0) + ++(\tlstartfraction*\hintscolumnwidth,0pt) + node [tlstartyear] {#2} + rectangle (\tlendfraction*\hintscolumnwidth,\tl@width-1pt) + node [tlendyear] {\pgfmathparse{ifthenelse(#3==0,,#3)}\pgfmathresult} + (\hintscolumnwidth,0pt) ; + \ifnum #3=0 + \shade [left color=#1] (\tlstartfraction*\hintscolumnwidth,0) + rectangle (\tlendfraction*\hintscolumnwidth,\tl@width); + \else + \fill [#1] (\tlstartfraction*\hintscolumnwidth,0) + rectangle (\tlendfraction*\hintscolumnwidth,\tl@width); + \fi + } +} +{#4}{#5}{#6}{#7}{#8} +} +\newcommand{\tllabelcventry}[9][sectionrectanglecolor]{% +\pgfmathsetmacro\tlendyear{ifthenelse(#3==0,\tllastyear,#3)} +\pgfmathsetmacro\tlstartfraction{(#2-\tlfirstyear)/(\tllastyear-\tlfirstyear)}% +\pgfmathsetmacro\tlendfraction{(\tlendyear-\tlfirstyear)/(\tllastyear-\tlfirstyear)}% + \cventry{\tikz[baseline=(tlendyear.north)]{ + \fill [\tl@runningcolor] (0,0) + rectangle (\hintscolumnwidth,\tl@runningwidth); + \fill [#1] (0,0) + ++(\tlstartfraction*\hintscolumnwidth,0pt) + node [tlstartyear] {#4} + rectangle (\tlendfraction*\hintscolumnwidth,\tl@width-1pt); + \ifnum #3=0 + \shade [left color=#1] (\tlstartfraction*\hintscolumnwidth,0) + rectangle (\tlendfraction*\hintscolumnwidth,\tl@width); + \else + \fill [#1] (\tlstartfraction*\hintscolumnwidth,0) + rectangle (\tlendfraction*\hintscolumnwidth,\tl@width); + \fi + } +} +{#5}{#6}{#7}{#8}{#9} +} +\endinput +%% +%% End of file `moderntimeline.sty'. -- cgit v1.2.3