Debian Codegraph @

texmf-dist/source/latex/moderntimeline/moderntimeline.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 2011-2015 by Raphaël Pinson <[email protected]>
4 % ---------------------------------------------------------------------------
5 % This work may be distributed and/or modified under the
6 % conditions of the LaTeX Project Public License, either version 1.3
7 % of this license or (at your option) any later version.
8 % The latest version of this license is in
9 % http://www.latex-project.org/lppl.txt
10 % and version 1.3 or later is part of all distributions of LaTeX
11 % version 2005/12/01 or later.
12 %
13 % This work has the LPPL maintenance status `maintained'.
14 %
15 % The Current Maintainer of this work is Raphaël Pinson.
16 %
17 % This work consists of the files moderntimeline.dtx and moderntimeline.ins
18 % and the derived filebase moderntimeline.sty.
19 %
20 % \fi
21 %
22 % \iffalse
23 %<*driver>
24 \ProvidesFile{moderntimeline.dtx}
25 %</driver>
26 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
27 %<package>\ProvidesPackage{moderntimeline}
28 %<*package>
29 [2020/06/11 0.11 Add timelines to moderncv entries]
30 %</package>
31 %
32 %<*driver>
33 \documentclass{ltxdoc}
34 \usepackage{moderntimeline}[2020/06/11]
35 \EnableCrossrefs
36 \CodelineIndex
37 \RecordChanges
38 \begin{document}
39 \DocInput{moderntimeline.dtx}
40 \PrintChanges
41 \PrintIndex
42 \end{document}
43 %</driver>
44 % \fi
45 %
46 % \CheckSum{413}
47 %
48 % \CharacterTable
49 % {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
50 % Lower-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
51 % Digits \0\1\2\3\4\5\6\7\8\9
52 % Exclamation \! Double quote \" Hash (number) \#
53 % Dollar \$ Percent \% Ampersand \&
54 % Acute accent \' Left paren \( Right paren \)
55 % Asterisk \* Plus \+ Comma \,
56 % Minus \- Point \. Solidus \/
57 % Colon \: Semicolon \; Less than \<
58 % Equals \= Greater than \> Question mark \?
59 % Commercial at \@ Left bracket \[ Backslash \\
60 % Right bracket \] Circumflex \^ Underscore \_
61 % Grave accent \` Left brace \{ Vertical bar \|
62 % Right brace \} Tilde \~}
63 %
64 %
65 % \changes{0.11}{2020/06/11}{Add support for timeline bar marks, thanks to jordieh}
66 % \changes{0.10}{2019/03/04}{Add support to specify label for end date, thanks to ypid and Astrinus}
67 % \changes{0.9}{2015/08/31}{Add month support, thanks to Astrinus}
68 % \changes{0.8}{2015/02/25}{Add the tlsetnotshadedfraction command, thanks to Stefano Gronchi}
69 % \changes{0.7}{2012/04/26}{Various fixes by Jake to allow fractional years in tllabelcventry}
70 % \changes{0.6}{2012/01/17}{Fix compatibility with moderncv 0.15.1}
71 % \changes{0.5}{2011/11/15}{Fix positions in tlcventry and tldatecventry, add tltextsingle, thanks to Stéphane Dupille}
72 % \changes{0.4}{2011/10/02}{Add firstyear and lastyear options}
73 % \changes{0.3}{2011/09/29}{Bugfix: initialize tlsince}
74 % \changes{0.2}{2011/09/29}{Add tlsince and options for tltext*}
75 % \changes{0.1}{2011/09/28}{Initial release}
76 %
77 % \DoNotIndex{\newcommand,\newenvironment}
78 %
79 % \providecommand*{\url}{\texttt}
80 % \GetFileInfo{moderntimeline.dtx}
81 % \title{The \textsf{moderntimeline} package}
82 % \author{Raphaël Pinson \\ \url{[email protected]}}
83 % \date{\fileversion~from \filedate}
84 %
85 % \maketitle
86 %
87 % \section{Introduction}
88 %
89 % As I was reworking my CV (which uses \textsf{moderncv}),
90 % the thought came to me that instead of just putting
91 % dates in front of each entries, it would be nice to have
92 % timelines to make them more graphical and get a better
93 % grasp of the time span of each entry.
94 %
95 % After playing a bit, I asked a question on
96 % stackexchange.com\footnote{\url{http://tex.stackexchange.com/questions/29725/putting-a-timeline-for-dates-in-moderncv}}
97 % and adapted the answer provided by Jake\footnote{\url{http://tex.stackexchange.com/users/2552/jake}}
98 % and turned it into this package.
99 %
100 % \section{Usage}
101 %
102 % This package is to be used together with the \textsf{moderncv} class,
103 % and can be loaded with:
104 %
105 % \begin{verbatim}
106 % \usepackage[firstyear=1999,lastyear=2012,
107 % marksyr=0.4ex,marksmo=0.2ex
108 % ]{moderntimeline}
109 % \end{verbatim}
110 %
111 % The \texttt{firstyear} and \texttt{lastyear} options indicate the maximum dates used
112 % to calibrate the time line. They are not mandatory and can be set later
113 % by means of the |\ltmaxdates| macro.
114 % The \texttt{marksyr} and \texttt{marksmo} options behave exactly the same as
115 % the |\tlenablemarksyr| and |\tlenablemarksmo| (and associated) macros.
116 %
117 % \subsection{Settings}
118 %
119 % Before you typeset entries, you need to adjust
120 % the settings for this package.
121 %
122 % \DescribeMacro{\tlwidth}
123 % You can optionally set the width of the time line
124 % by calling |\tlwidth| with a dimension.
125 %
126 % \DescribeMacro{\tlrunningwidth}
127 % For each entry, a running line is traced behind the
128 % time line. You can set the width of this line by
129 % means of the |\tlrunningwidth| macro.
130 %
131 % \DescribeMacro{\tlrunningcolor}
132 % To set the color of the running line placed behind
133 % the time line, you can use the |\tlrunningcolor| macro.
134 %
135 % \DescribeMacro{\tltextstart}
136 % If you wish to set the size of the start date label,
137 % you can do so by using |\tltextstart|, passing it
138 % a text size macro.
139 %
140 % It also takes an optional first argument to set the
141 % position of the label, for example if you wish
142 % to center the label on the start of the line
143 % and set the text size to |\scriptsize|:
144 %
145 % \begin{verbatim}
146 % \tltextstart[base]{\scriptsize}
147 % \end{verbatim}
148 %
149 %
150 % \DescribeMacro{\tltextend}
151 % If you wish to set the size of the end date label,
152 % you can do so by using |\tltextend|, passing it
153 % a text size macro.
154 %
155 % It also takes an optional first argument to set the
156 % position of the label, for example if you wish
157 % to center the label on the start of the line
158 % and set the text size to |\scriptsize|:
159 %
160 % \begin{verbatim}
161 % \tltextend[base]{\scriptsize}
162 % \end{verbatim}
163 %
164 %
165 % \DescribeMacro{\tltextsingle}
166 % If you wish to set the size of single date labels,
167 % you can do so by using |\tltextsingle|, passing it
168 % a text size macro.
169 %
170 % For example if you wish to set the text size to
171 % |\scriptsize|:
172 %
173 % \begin{verbatim}
174 % \tltextsingle{\scriptsize}
175 % \end{verbatim}
176 %
177 %
178 % \DescribeMacro{\tltext}
179 % You can set the sizes of both the start and end dates
180 % by calling the |\tltext| macro with a text size macro.
181 %
182 %
183 % \DescribeMacro{\tlmaxdates}
184 % Before you can typeset any entry, you need to specify
185 % the maximal range of dates which will serve as a reference.
186 % This range will be mapped to the width of the left column,
187 % and dates will be positionned accordingly.
188 % To set the range, use the |\tlmaxdates| macro, passing it
189 % the first and last dates you will be using:
190 %
191 % \begin{verbatim}
192 % \tlmaxdates{1999}{2012}
193 % \end{verbatim}
194 %
195 % If you are going to use the last date of the range
196 % as a start date or a unique date for an entry,
197 % you should probably set the max date a bit higher
198 % to prevent the date label from overflowing into
199 % the entry text.
200 %
201 % Since version 0.4, you can set these dates by passing the
202 % \texttt{firstyear} and \texttt{lastyear} options to the package.
203 %
204 %
205 % \DescribeMacro{\tlsince}
206 % When using a date range without an end year,
207 % you might want to add "Since" in front of the starting year.
208 % In order to do this, you can use the |\tlsince| macro:
209 %
210 % \begin{verbatim}
211 % \tlsince{Since~}
212 % \end{verbatim}
213 %
214 % \DescribeMacro{\tlsetnotshadedfraction}
215 % If last year in |\tlcventry| and |\tllabelcventry| is 0, the bar
216 % is shaded. With this command you control the fraction of the bar
217 % that is not shaded (default = 0):
218 %
219 % \begin{verbatim}
220 % \tlsetnotshadedfraction{0.4} % The first 40% of the bar is not shaded
221 % \end{verbatim}
222 %
223 %
224 % \DescribeMacro{\tlenablemonths}
225 % If you want to use months when drawing bars with |\tlcventry| and
226 % |\tllabelcventry|, issue this command. This feature is not enabled
227 % by default since it changes the way the bar are drawn if the month
228 % is not specified.
229 %
230 % \DescribeMacro{\tldisablemonths}
231 % This macro (default behaviour) does not in fact ignore months, but
232 % retain the historical behaviour of this package to draw the bars at
233 % the beginning of the year, so is not advisable to use months in dates.
234 % Default.
235 %
236 % \DescribeMacro{\tlenablemarksmo}
237 % This macro places vertical lines on the timeline bar at every month and year.
238 % You can set the height of the marks with |\tlmarkheightmo| (default = 0.2ex).
239 %
240 % \DescribeMacro{\tlenablemakrsyr}
241 % This macro places vertical lines on the timeline bar at every year.
242 % You can set the height of the marks with |\tlmarkheightyr| (default = 0.4ex).
243 %
244 % \DescribeMacro{\tldisablemarksyr}
245 % Disables the vertical lines marking years on the timeline bar.
246 % This is the opposite of |\tlenablemarksyr|.
247 %
248 % \DescribeMacro{\tldisablemarksmo}
249 % Disables the vertical lines marking months and years on the timeline bar.
250 % This is the opposite of |\tlenablemarksmo|.
251 %
252 % \subsection{CV entries}
253 %
254 % This package provides new CV entry commands
255 % for the \textsf{moderncv} class.
256 % They are described in this section.
257 %
258 %
259 % \DescribeMacro{\tlcventry}
260 % The |\tlcventry| macro lets you typeset
261 % a date range.
262 % In addition to the standard CV entry, one option
263 % and two mandatory arguments are added:
264 %
265 % \begin{verbatim}
266 % \tlcventry{1999}{2002}{WYSIWYG User}{Unnamed Company}
267 % {Somewhere}{}{Tried hard to typeset documents}
268 % \tlcventry[blue]{2002}{0}{Happy TeXnician}{Any Company}
269 % {Anywhere}{}{Achieved nice typography and shared code with friends}
270 % \end{verbatim}
271 %
272 % The option sets the color of the time line.
273 % If unset, the color defaults to the theme color of the CV.
274 %
275 % The two arguments added in the beginning of the call
276 % are the start and end dates for the entry.
277 % If the position is still held, use \texttt{0} as the end date.
278 % This will add a gradient at the end of the time line.
279 %
280 % You can also specify months (which are used only for adjusting the bar length:
281 % they are not shown in the labels), separated by a slash from the year:
282 %
283 % \begin{verbatim}
284 % \tlcventry{1999/2}{2002/6}{WYSIWYG User}{Unnamed Company}
285 % {Somewhere}{}{Tried hard to typeset documents}
286 % \tlcventry[blue]{2002/8}{0}{Happy TeXnician}{Any Company}
287 % {Anywhere}{}{Achieved nice typography and shared code with friends}
288 % \end{verbatim}
289 %
290 % Don't use a leading zero, since this make PGF think the number is in octal,
291 % so it complains when sees \texttt{08} and \texttt{09}.
292 %
293 %
294 % \DescribeMacro{\tllabelcventry}
295 % The |\tllabelcventry| macro is similar to |\tlcventry|,
296 % but it takes yet a third additional argument, which lets you
297 % set a label for the time line.
298 % When this is used, the dates are not typeset around the time line,
299 % only the label is placed where the start date would normally be.
300 %
301 % This is useful when your dates contain month names, or if the
302 % time span is too short to properly typeset the dates above
303 % and under the time line:
304 %
305 % \begin{verbatim}
306 % \tllabelcventry[magenta]{2002}{2003}{July--November 2002}
307 % {Scribus Student}{GNU School}
308 % {The Internet}{}{Tried Scribus for a short while}
309 % \end{verbatim}
310 %
311 % It is also possible to place a label where the end date would by making use
312 % of the separator |///|:
313 %
314 % \begin{verbatim}
315 % \tllabelcventry[magenta]{2002}{2003}{July///November 2002}
316 % {Scribus Student}{GNU School}
317 % {The Internet}{}{Tried Scribus for a short while}
318 % \end{verbatim}
319 %
320 % You can enter months for adjusting bar length as in |\tlcventry|.
321 %
322 %
323 % \DescribeMacro{\tldatecventry}
324 % Positions usually last long enough to draw time lines,
325 % but there are also punctual entries, such as diplomas.
326 % The |\tldatecventry| lets to typeset unique dates.
327 % It places a bullet on the date and typesets the date above it:
328 %
329 % \begin{verbatim}
330 % \tldatecventry[brown]{2011}{Trusted TeX.SX user}{}{tex.stackexchange.com}
331 % {The Internet}{}{Achived 20k reputation on TeX.SX}
332 % \end{verbatim}
333 %
334 %
335 % \DescribeMacro{\tldatelabelcventry}
336 % Similarly to |\tllabelcventry|, you might want to place
337 % a label on a unique date entry, such as an exact date
338 % or a month. The |\tldatelabelcventry| provides a parameter to achive this:
339 %
340 % \begin{verbatim}
341 % \tldatelabelcventry[brown]{2011}{Christmas 2011}{Happy TeXer}{}{Home}
342 % {Townville}{}{Received Don Knuth's \emph{3:16} as a gift.}
343 % \end{verbatim}
344 %
345 %
346 % \StopEventually{}
347 %
348 % \section{Implementation}
349 %
350 % \iffalse
351 %<*package>
352 % \fi
353 %
354 % \begin{macrocode}
355 \ProvidesPackage{moderntimeline}
356 \RequirePackage{tikz}
357 \RequirePackage{kvoptions}
358 \SetupKeyvalOptions{
359 family=moderntimeline,
360 prefix=tl@,
361 }
362 \DeclareStringOption{firstyear}
363 \DeclareStringOption{lastyear}
364 \DeclareStringOption{marksmo}[0.2ex]
365 \DeclareStringOption{marksyr}[0.4ex]
366 \ProcessKeyvalOptions*
367 \newif\ifstartyear
368 \newif\ifissince
369 % \end{macrocode}
370 %
371 % \begin{macro}{\tlwidth}
372 % \begin{macrocode}
373 \newcommand{\tlwidth}[1]{%
374 \def\tl@width{#1}
375 \pgfmathsetmacro\tl@textstartabove{\tl@width+1pt}
376 }
377 % \end{macrocode}
378 % \end{macro}
379 %
380 % \begin{macro}{\tlrunningwidth}
381 % \begin{macrocode}
382 \newcommand{\tlrunningwidth}[1]{%
383 \def\tl@runningwidth{#1}
384 }
385 % \end{macrocode}
386 % \end{macro}
387 %
388 % \begin{macro}{\tlrunningcolor}
389 % \begin{macrocode}
390 \newcommand{\tlrunningcolor}[1]{%
391 \def\tl@runningcolor{#1}
392 }
393 % \end{macrocode}
394 % \end{macro}
395 %
396 % \begin{macro}{\tlmarkheightmo}
397 % \begin{macrocode}
398 \newcommand{\tlmarkheightmo}[1]{%
399 \def\tl@marksmo{#1}
400 }
401 % \end{macrocode}
402 % \end{macro}
403 %
404 % \begin{macro}{\tlmarkheightyr}
405 % \begin{macrocode}
406 \newcommand{\tlmarkheightyr}[1]{%
407 \def\tl@marksyr{#1}
408 }
409 % \end{macrocode}
410 % \end{macro}
411 %
412 % \begin{macro}{\tlsince}
413 % \begin{macrocode}
414 \newcommand{\tlsince}[1]{%
415 \def\tl@since{#1}
416 }
417 % \end{macrocode}
418 % \end{macro}
419 %
420 % \begin{macro}{\tltextstart}
421 % \begin{macrocode}
422 \newcommand{\tltextstart}[2][base west]{%
423 \tikzset{
424 tl@startyear/.style={
425 font=#2,
426 name=tl@startyear,
427 above=\tl@textstartabove,
428 inner xsep=0pt,
429 anchor=#1,
430 }
431 }
432 }
433 % \end{macrocode}
434 % \end{macro}
435 %
436 %
437 % \begin{macro}{\tltextend}
438 % \begin{macrocode}
439 \newcommand{\tltextend}[2][north east]{%
440 \tikzset{
441 tl@endyear/.style={
442 font=#2,
443 name=tl@endyear,
444 below,
445 inner xsep=0pt,
446 anchor=#1,
447 }
448 }
449 }
450 % \end{macrocode}
451 % \end{macro}
452 %
453 %
454 % \begin{macro}{\tltextsingle}
455 % \begin{macrocode}
456 \newcommand{\tltextsingle}[1]{%
457 \tikzset{
458 tl@singleyear/.style={
459 font=#1,
460 name=tl@singleyear,
461 above=1pt,
462 inner xsep=0pt,
463 }
464 }
465 }
466 % \end{macrocode}
467 % \end{macro}
468 %
469 %
470 % \begin{macro}{\tltext}
471 % \begin{macrocode}
472 \newcommand{\tltext}[1]{%
473 % \end{macrocode}
474 % \begin{macrocode}
475 \tltextstart{#1}%
476 \tltextend{#1}%
477 \tltextsingle{#1}%
478 }
479 % \end{macrocode}
480 % \end{macro}
481 %
482 %
483 % \begin{macro}{\tlsetnotshadedfraction}
484 % \begin{macrocode}
485 \newcommand{\tlsetnotshadedfraction}[1]{%
486 \def\tl@nsfrac{#1}
487 }
488 % \end{macrocode}
489 % \end{macro}
490 %
491 %
492 % \begin{macro}{\tlenablemonths}
493 % \begin{macrocode}
494 \newcommand{\tlenablemonths}{%
495 \def\tl@nomonthvalue{6}
496 }
497 % \end{macrocode}
498 % \end{macro}
499 %
500 %
501 % \begin{macro}{\tldisablemonths}
502 % \begin{macrocode}
503 \newcommand{\tldisablemonths}{%
504 \def\tl@nomonthvalue{0}
505 }
506 % \end{macrocode}
507 % \end{macro}
508 %
509 %
510 % \begin{macro}{\tldisablemarksyr}
511 % \begin{macrocode}
512 \newcommand{\tldisablemarksyr}{%
513 \def\tl@marksyr{}
514 }
515 % \end{macrocode}
516 % \end{macro}
517 %
518 %
519 % \begin{macro}{\tlenablemarksyr}
520 % \begin{macrocode}
521 \newcommand{\tlenablemarksyr}{%
522 \def\tl@marksyr{0.4ex}
523 }
524 % \end{macrocode}
525 % \end{macro}
526 %
527 %
528 % \begin{macro}{\tldisablemarksmo}
529 % \begin{macrocode}
530 \newcommand{\tldisablemarksmo}{%
531 \def\tl@marksmo{}
532 }
533 % \end{macrocode}
534 % \end{macro}
535 %
536 %
537 % \begin{macro}{\tlenablemarksmo}
538 % \begin{macrocode}
539 \newcommand{\tlenablemarksmo}{%
540 \def\tl@marksmo{0.2ex}
541 }
542 % \end{macrocode}
543 % \end{macro}
544 %
545 %
546 % Defaults
547 % \begin{macrocode}
548 \tltext{\scriptsize}
549 \tlwidth{0.8ex}
550 \tlrunningwidth{0.05ex}
551 \tlrunningcolor{gray}
552 \tlsince{}
553 \tlsetnotshadedfraction{0}
554 \tldisablemonths
555 % \end{macrocode}
556 %
557 %
558 % \begin{macro}{\tlmaxdates}
559 % \begin{macrocode}
560 \newcommand{\tlmaxdates}[2]{%
561 \def\tl@firstyear{#1}
562 \def\tl@lastyear{#2}
563 \pgfmathsetmacro\tl@yearrange{\tl@lastyear-\tl@firstyear}
564 }
565 % \end{macrocode}
566 % \end{macro}
567 %
568 % \begin{macro}{\tl@yearfraction}
569 % \begin{macrocode}
570 \newcommand{\tl@yearfraction}[1]{% Month 1 - 12 -> 0 - 11
571 \gdef\tl@tmpyear{-1}% Resetting
572 \gdef\tl@tmpmonth{-1}%
573 \begingroup%
574 \edef\@tempa{#1/}%
575 \expandafter\endgroup\expandafter\tl@yearfraction@auxi\@tempa\@nnil%
576 \ifstartyear
577 \pgfmathsetmacro\tl@startyear{\tl@tmpyear+(\tl@tmpmonth-1)/12}%
578 \else
579 \ifnum\tl@tmpyear=0
580 \pgfmathsetmacro\tl@endyear{\tl@lastyear}%
581 \issincetrue%
582 \else
583 \pgfmathsetmacro\tl@endyear{\tl@tmpyear+\tl@tmpmonth/12}%
584 \issincefalse%
585 \fi
586 \fi
587 }
588 % \end{macrocode}
589 % \end{macro}
590 %
591 % \begin{macro}{\tl@yearfraction@auxi}
592 % \begin{macrocode}
593 \newcommand{\tl@yearfraction@auxi}[2]{}
594 \def\tl@yearfraction@auxi#1/#2\@nnil{%
595 \ifnum\tl@tmpyear<0 % First call
596 \pgfmathsetmacro\tl@tmpyear{+#1}%
597 \ifx\@nnil#2\@nnil
598 \pgfmathsetmacro\tl@tmpmonth{+\tl@nomonthvalue}%
599 \else
600 \expandafter\tl@yearfraction@auxi#2\@nnil%
601 \fi
602 \else
603 \pgfmathsetmacro\tl@tmpmonth{#1}%
604 \fi
605 }
606 % \end{macrocode}
607 % \end{macro}
608 %
609 % \begin{macro}{\tl@tlcvbar}
610 % \begin{macrocode}
611 \newcommand{\tl@tlcvbar}{
612 \pgfmathsetmacro\tl@yearrange{\tl@lastyear-\tl@firstyear}
613 \pgfmathsetmacro\tl@totalmonths{12*\tl@yearrange}%
614 \pgfmathsetmacro\tl@tickdistmo{\hintscolumnwidth/\tl@totalmonths}%
615 \pgfmathsetmacro\tl@tickdistyr{\hintscolumnwidth/\tl@yearrange}%
616 \useasboundingbox (0,-1.5ex) rectangle (\hintscolumnwidth,1ex);
617 \fill [\tl@runningcolor] (0,0)
618 rectangle (\hintscolumnwidth,\tl@runningwidth);
619 \ifx\tl@marksyr\empty\relax\else
620 \foreach \x in {0, ..., \tl@yearrange}
621 \draw [\tl@runningcolor](\x*\tl@tickdistyr pt,0ex) -- (\x*\tl@tickdistyr pt,\tl@marksyr);
622 \fi
623 \ifx\tl@marksmo\empty\relax\else
624 \foreach \x in {0, ..., \tl@totalmonths}
625 \draw [\tl@runningcolor](\x*\tl@tickdistmo pt,0ex) -- (\x*\tl@tickdistmo pt,\tl@marksmo);
626 \fi
627 }
628 % \end{macrocode}
629 % \end{macro}
630 %
631 % \begin{macro}{\tl@splitlabels}
632 % \begin{macrocode}
633 \newcommand{\tl@splitlabels}[1]{
634 \gdef\tl@startlabel{}% Resetting
635 \begingroup%
636 \edef\@tempa{#1///}%
637 \expandafter\endgroup\expandafter\tl@splitlabels@auxi\@tempa\@nnil%
638 \ifx\tl@startlabel\empty\relax%
639 \gdef\tl@startlabel{#1}
640 \fi
641 \ifissince%
642 \xdef\tl@startlabel{\tl@since \tl@startlabel}
643 \fi
644 }
645 % \end{macrocode}
646 % \end{macro}
647 %
648 % \begin{macro}{\tl@splitlabels@auxi}
649 % \begin{macrocode}
650 \newcommand{\tl@splitlabels@auxi}[2]{}
651 \def\tl@splitlabels@auxi#1///#2\@nnil{%
652 \ifx\tl@startlabel\empty\relax% First call
653 \gdef\tl@startlabel{#1}
654 \ifx\@nnil#2\@nnil
655 \gdef\tl@startlabel{}
656 \else
657 \expandafter\tl@splitlabels@auxi#2\@nnil%
658 \fi
659 \else
660 \gdef\tl@endlabel{#1}
661 \fi
662 }
663 % \end{macrocode}
664 % \end{macro}
665 %
666 % \begin{macro}{\tl@formatstartyear}
667 % \begin{macrocode}
668 \newcommand{\tl@formatstartyear}[1]{
669 \startyeartrue
670 \tl@yearfraction{#1}
671 \pgfmathsetmacro\tl@startfraction{(\tl@startyear-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}%
672 \ifissince
673 \xdef\tl@startlabel{\tl@since \tl@tmpyear}
674 \else
675 \xdef\tl@startlabel{\tl@tmpyear}
676 \fi
677 }
678 % \end{macrocode}
679 % \end{macro}
680 %
681 % \begin{macro}{\tl@formatendyear}
682 % \begin{macrocode}
683 \newcommand{\tl@formatendyear}[1]{
684 \startyearfalse%
685 \tl@yearfraction{#1}
686 \pgfmathsetmacro\tl@endfraction{(\tl@endyear-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}%
687 \ifissince%
688 \xdef\tl@endlabel{}
689 \else
690 \xdef\tl@endlabel{\tl@tmpyear}
691 \fi
692 }
693 % \end{macrocode}
694 % \end{macro}
695 %
696 % \begin{macro}{\tldatelabelcventry}
697 % \begin{macrocode}
698 \newcommand{\tldatelabelcventry}[8][color1]{%
699 % \end{macrocode}
700 % \begin{macrocode}
701 \issincefalse
702 \tl@formatstartyear{#2}
703 \cventry{\tikz[baseline=0pt]{
704 \tl@tlcvbar
705 \fill [#1] (0,0)
706 ++(\tl@startfraction*\hintscolumnwidth,0pt)
707 node [tl@startyear] {#3}
708 node {$\bullet$};
709 }
710 }
711 {#4}{#5}{#6}{#7}{#8}
712 }
713 % \end{macrocode}
714 % \end{macro}
715 %
716 % \begin{macro}{\tldatecventry}
717 % \begin{macrocode}
718 \newcommand{\tldatecventry}[7][color1]{%
719 % \end{macrocode}
720 % \begin{macrocode}
721 \issincefalse
722 \tl@formatstartyear{#2}
723 \cventry{\tikz[baseline=0pt]{
724 \tl@tlcvbar
725 \fill [#1] (0,0)
726 ++(\tl@startfraction*\hintscolumnwidth,0pt)
727 node [tl@singleyear] {#2}
728 node {$\bullet$};
729 }%
730 }%
731 {#3}{#4}{#5}{#6}{#7}%
732 }
733 % \end{macrocode}
734 % \end{macro}
735 %
736 % \begin{macro}{\tlcventry}
737 % \begin{macrocode}
738 \newcommand{\tlcventry}[8][color1]{%
739 % \end{macrocode}
740 % \begin{macrocode}
741 \tl@formatendyear{#3}
742 \tl@formatstartyear{#2}
743 \cventry{\tikz[baseline=0pt]{
744 \tl@tlcvbar
745 \fill [#1] (0,0)
746 ++(\tl@startfraction*\hintscolumnwidth,0pt)
747 node [tl@startyear] {\tl@startlabel}
748 rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width-1pt)
749 node [tl@endyear] {\tl@endlabel}
750 (\hintscolumnwidth,0pt) ;
751 \ifissince
752 \newdimen\fullcolorwidth
753 \pgfmathsetlength\fullcolorwidth{\tl@startfraction*(1+(1-\tl@startfraction)*\tl@nsfrac)*\hintscolumnwidth}
754 \shade [left color=#1,right color=#1]
755 (\tl@startfraction*\hintscolumnwidth,0)
756 rectangle (\fullcolorwidth,\tl@width);
757 \shade [left color=#1] (\fullcolorwidth,0)
758 rectangle (\tl@endfraction*\hintscolumnwidth + 1,\tl@width);
759 \else
760 \fill [#1] (\tl@startfraction*\hintscolumnwidth,0)
761 rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width);
762 \fi
763 }%
764 }%
765 {#4}{#5}{#6}{#7}{#8}%
766 }
767 % \end{macrocode}
768 % \end{macro}
769 %
770 % \begin{macro}{\tllabelcventry}
771 % \begin{macrocode}
772 \newcommand{\tllabelcventry}[9][color1]{%
773 % \end{macrocode}
774 % \begin{macrocode}
775 \tl@formatendyear{#3}
776 \tl@formatstartyear{#2}
777 \tl@splitlabels{#4}
778 \cventry{\tikz[baseline=0pt]{
779 \tl@tlcvbar
780 \fill [#1] (0,0)
781 ++(\tl@startfraction*\hintscolumnwidth,0pt)
782 node [tl@startyear] {\tl@startlabel}
783 rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width-1pt)
784 node [tl@endyear] {\tl@endlabel}
785 (\hintscolumnwidth,0pt) ;
786 \ifissince
787 \newdimen\fullcolorwidth
788 \pgfmathsetlength\fullcolorwidth{\tl@startfraction*(1+(1-\tl@startfraction)*\tl@nsfrac)*\hintscolumnwidth}
789 \shade [left color=#1,right color=#1]
790 (\tl@startfraction*\hintscolumnwidth,0)
791 rectangle (\fullcolorwidth,\tl@width);
792 \shade [left color=#1] (\fullcolorwidth,0)
793 rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width);
794 \else
795 \fill [#1] (\tl@startfraction*\hintscolumnwidth,0)
796 rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width);
797 \fi
798 }
799 }
800 {#5}{#6}{#7}{#8}{#9}%
801 }
802 % \end{macrocode}
803 % \end{macro}
804 %
805 % \iffalse
806 %</package>
807 % \fi
808 %
809 % \Finale
810 \endinput