diff options
author | Karl Berry <karl@freefriends.org> | 2023-08-18 21:28:04 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-08-18 21:28:04 +0000 |
commit | 76ef7dbdfdc0a89abcfa7e926e413903175e052e (patch) | |
tree | 0d2e47f2e3bccebd90f68b24118dc73b5d22d73e /Master/texmf-dist/tex/latex/chronology | |
parent | e207dd4519a04a6395a3c91142ca693d514fb3a8 (diff) |
chronology (18aug23)
git-svn-id: svn://tug.org/texlive/trunk@67973 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/chronology')
-rw-r--r-- | Master/texmf-dist/tex/latex/chronology/chronology.sty | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/latex/chronology/chronology.sty b/Master/texmf-dist/tex/latex/chronology/chronology.sty index 46c06c57467..774a26644e5 100644 --- a/Master/texmf-dist/tex/latex/chronology/chronology.sty +++ b/Master/texmf-dist/tex/latex/chronology/chronology.sty @@ -1,5 +1,5 @@ \NeedsTeXFormat{LaTeX2e}% -\ProvidesPackage{chronology}[2015/03/27 v1.1.1 Horizontal timeline]% +\ProvidesPackage{chronology}[2023/08/20 v2.0 - Horizontal Timeline]% \RequirePackage{calc}% \RequirePackage{tikz}% \RequirePackage{xparse}% @@ -9,7 +9,9 @@ \newlength{\xstart}\newlength{\xstop}% \newlength{\unit}\newlength{\timelinewidth}% \newsavebox{\timelinebox}% +% % Defining TikZ styles for labels and events +% \tikzset{% ,chronevent/.style={fill=black,draw=none,opacity=0.5} ,chronlabel/.style={opacity=1} @@ -17,8 +19,11 @@ ,chroneventlabel/.style={chronlabel} ,eventlabel/.style={chroneventlabel,anchor=south west,yshift=.2\unit,rotate=45} ,flippedeventlabel/.style={chroneventlabel,anchor=north west,yshift=-.2\unit,rotate=-45} + ,eventlabelbottom/.style={chroneventlabel,anchor=south west,yshift=-1cm,rotate=0} % Bottom label } +% % For compatibity with babel. Handling of active characters in TikZ. +% \tikzset{ handle active characters in code, handle active characters in nodes @@ -69,8 +74,11 @@ \fi% }% }% +% +% Event (legacy code for compatibility) +% \makeatother% -\DeclareDocumentCommand \event {o m m}{% +\DeclareDocumentCommand \event {o m m}{% [Startdate] Enddate Label \pgfmathsetlength\xstop{(#2-\theyearstart)*\unit}% \IfNoValueTF {#1} {% \ifflipped% @@ -95,6 +103,30 @@ \fi% }% } +% +% Eventspan +% +\DeclareDocumentCommand \eventspan {m m m O{black} O{0.3} O{0.2} o}{% Startdate Enddate Label Fill Opacity Height Bottom? + \pgfmathsetlength\xstop{(#2-\theyearstart)*\unit}% + \pgfmathsetlength\xstart{(#1-\theyearstart)*\unit}% + \IfNoValueTF {#7} {% + \draw[style={fill=#4,draw=none,opacity=#5},rounded corners=.05\unit]% + (\xstart,-#6\unit) rectangle node[eventlabel] {#3} (\xstop,.2\unit);% + }{% + \draw[style={fill=#4,draw=none,opacity=#5},rounded corners=.05\unit]% Event, bottom label + (\xstart,-#6\unit) rectangle node[eventlabelbottom, anchor=center]{#3} (\xstop,.2\unit);% + }% +} +% +% Eventpoint +% +\DeclareDocumentCommand \eventpoint {m m O{red} O{1} O{0.3}}{% Date Label Fill Opacity Height + \pgfmathsetlength\xstop{(#1-\theyearstart)*\unit}% + \draw[style={fill=#3,draw=none,opacity=#4},rounded corners=0\unit]% + (\xstop, .1\unit) coordinate(A) -- (\xstop-.2*#5\unit,#5\unit) coordinate(B) -- (\xstop+.2*#5\unit,#5\unit)coordinate(C)% + -- cycle node[eventlabel] {#2};% +} +% \newcommand{\decimaldate}[3]{(#1-1)/31/12+(#2-1)/12+#3}% +% \endinput% - |