summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/moderntimeline
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-09-30 23:00:33 +0000
committerKarl Berry <karl@freefriends.org>2011-09-30 23:00:33 +0000
commita9243fed05552cc82824e67eec609e4656ed3382 (patch)
tree625aa571199123751b6b1c3b38f698814d4d9c37 /Master/texmf-dist/source/latex/moderntimeline
parente16cf95fe5c387feb9e2a3b5f90c3dce8ea66c6a (diff)
moderntimeline (30sep11)
git-svn-id: svn://tug.org/texlive/trunk@24158 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/moderntimeline')
-rw-r--r--Master/texmf-dist/source/latex/moderntimeline/moderntimeline.dtx68
1 files changed, 54 insertions, 14 deletions
diff --git a/Master/texmf-dist/source/latex/moderntimeline/moderntimeline.dtx b/Master/texmf-dist/source/latex/moderntimeline/moderntimeline.dtx
index 1237d75c1a4..d19b321bb15 100644
--- a/Master/texmf-dist/source/latex/moderntimeline/moderntimeline.dtx
+++ b/Master/texmf-dist/source/latex/moderntimeline/moderntimeline.dtx
@@ -26,7 +26,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{moderntimeline}
%<*package>
- [2011/09/28 0.1 Add timelines to moderncv entries]
+ [2011/09/29 0.3 Add timelines to moderncv entries]
%</package>
%
%<*driver>
@@ -43,7 +43,7 @@
%</driver>
% \fi
%
-% \CheckSum{184}
+% \CheckSum{198}
%
% \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,8 @@
% Right brace \} Tilde \~}
%
%
+% \changes{0.3}{2011/09/29}{Bugfix: initialize tlsince}
+% \changes{0.2}{2011/09/29}{Add tlsince and options for tltext*}
% \changes{0.1}{2011/09/28}{Initial release}
%
% \DoNotIndex{\newcommand,\newenvironment}
@@ -119,15 +121,36 @@
% you can do so by using |\tltextstart|, passing it
% a text size macro.
%
+% It also takes an optional first argument to set the
+% position of the label, for example if you wish
+% to center the label on the start of the line
+% and set the text size to |\scriptsize|:
+%
+% \begin{verbatim}
+% \tltextstart[base]{\scriptsize}
+% \end{verbatim}
+%
+%
% \DescribeMacro{\tltextend}
% If you wish to set the size of the end date label,
% you can do so by using |\tltextend|, passing it
% a text size macro.
%
+% It also takes an optional first argument to set the
+% position of the label, for example if you wish
+% to center the label on the start of the line
+% and set the text size to |\scriptsize|:
+%
+% \begin{verbatim}
+% \tltextend[base]{\scriptsize}
+% \end{verbatim}
+%
+%
% \DescribeMacro{\tltext}
% You can set the sizes of both the start and end dates
% by calling the |\tltext| macro with a text size macro.
%
+%
% \DescribeMacro{\tlmaxdates}
% Before you can typeset any entry, you need to specify
% the maximal range of dates which will serve as a reference.
@@ -146,6 +169,17 @@
% to prevent the date label from overflowing into
% the entry text.
%
+%
+% \DescribeMacro{\tlsince}
+% When using a date range without an end year,
+% you might want to add "Since" in front of the starting year.
+% In order to do this, you can use the |\tlsince| macro:
+%
+% \begin{verbatim}
+% \tlsince{Since~}
+% \end{verbatim}
+%
+%
% \subsection{CV entries}
%
% This package provides new CV entry commands
@@ -253,18 +287,24 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\tltextstart}
+% \begin{macro}{\tlsince}
% \begin{macrocode}
-\newcommand{\tltextstart}[1]{%
+\newcommand{\tlsince}[1]{%
+ \def\tl@since{#1}
+}
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\tltextstart}
% \begin{macrocode}
+\newcommand{\tltextstart}[2][base west]{%
\tikzset{
tlstartyear/.style={
- font=#1,
+ font=#2,
name=tlstartyear,
above=\tl@textstartabove,
inner xsep=0pt,
- anchor=base west,
+ anchor=#1,
}
}
}
@@ -274,16 +314,14 @@
%
% \begin{macro}{\tltextend}
% \begin{macrocode}
-\newcommand{\tltextend}[1]{%
-% \end{macrocode}
-% \begin{macrocode}
+\newcommand{\tltextend}[2][north east]{%
\tikzset{
tlendyear/.style={
- font=#1,
+ font=#2,
name=tlendyear,
below,
inner xsep=0pt,
- anchor=north east,
+ anchor=#1,
}
}
}
@@ -308,6 +346,7 @@
\tlwidth{0.8ex}
\tlrunningwidth{0.05ex}
\tlrunningcolor{gray}
+\tlsince{}
% \end{macrocode}
%
%
@@ -332,7 +371,7 @@
\pgfmathsetmacro\tlendfraction{(\tlendyear-\tlfirstyear)/(\tllastyear-\tlfirstyear)}%
% \end{macrocode}
% \begin{macrocode}
- \cventry{\tikz[baseline=(tlendyear.north)]{
+ \cventry{\tikz{
\fill [\tl@runningcolor] (0,0)
rectangle (\hintscolumnwidth,\tl@runningwidth);
\fill [#1] (0,0)
@@ -356,7 +395,7 @@
\pgfmathsetmacro\tlendfraction{(\tlendyear-\tlfirstyear)/(\tllastyear-\tlfirstyear)}%
% \end{macrocode}
% \begin{macrocode}
- \cventry{\tikz[baseline=(tlendyear.north)]{
+ \cventry{\tikz{
\fill [\tl@runningcolor] (0,0)
rectangle (\hintscolumnwidth,\tl@runningwidth);
\fill [#1] (0,0)
@@ -378,12 +417,13 @@
\pgfmathsetmacro\tlendyear{ifthenelse(#3==0,\tllastyear,#3)}
\pgfmathsetmacro\tlstartfraction{(#2-\tlfirstyear)/(\tllastyear-\tlfirstyear)}%
\pgfmathsetmacro\tlendfraction{(\tlendyear-\tlfirstyear)/(\tllastyear-\tlfirstyear)}%
+\ifnum #3=0 \def\tlstartlabel{\tl@since #2} \else \def\tlstartlabel{#2} \fi
\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 [tlstartyear] {\tlstartlabel}
rectangle (\tlendfraction*\hintscolumnwidth,\tl@width-1pt)
node [tlendyear] {\pgfmathparse{ifthenelse(#3==0,,#3)}\pgfmathresult}
(\hintscolumnwidth,0pt) ;