texlive[46280] Master/texmf-dist: pgfgantt (10jan18)

commits+karl at tug.org commits+karl at tug.org
Wed Jan 10 22:45:07 CET 2018


Revision: 46280
          http://tug.org/svn/texlive?view=revision&revision=46280
Author:   karl
Date:     2018-01-10 22:45:07 +0100 (Wed, 10 Jan 2018)
Log Message:
-----------
pgfgantt (10jan18)

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

Modified: trunk/Master/texmf-dist/doc/latex/pgfgantt/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pgfgantt/README	2018-01-10 21:44:36 UTC (rev 46279)
+++ trunk/Master/texmf-dist/doc/latex/pgfgantt/README	2018-01-10 21:45:07 UTC (rev 46280)
@@ -1,4 +1,4 @@
-The pgfgantt package v4.0
+The pgfgantt package v5.0
 ------------------------------------------------------------------------------
 This package is released under the LaTeX Project Public License v1.3c or later
 (see http://www.latex-project.org/lppl.txt).
@@ -16,4 +16,4 @@
 
 --
 Wolfgang Skala
-1st June 2013
\ No newline at end of file
+10th January 2018

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

Modified: trunk/Master/texmf-dist/source/latex/pgfgantt/pgfgantt.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pgfgantt/pgfgantt.dtx	2018-01-10 21:44:36 UTC (rev 46279)
+++ trunk/Master/texmf-dist/source/latex/pgfgantt/pgfgantt.dtx	2018-01-10 21:45:07 UTC (rev 46280)
@@ -1,19 +1,19 @@
 % \iffalse meta-comment
 %
-% Copyright (C) 2012 by Wolfgang Skala
+% Copyright (C) 2018 by Wolfgang Skala
 %
 % This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
+% conditions of the LaTeX Project Public License, either version 1.3c
 % 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.
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2008/05/04 or later.
 %
 % \fi
 %
 % \iffalse
-%<pgfgantt>\ProvidesPackage{pgfgantt}[2013/06/01 v4.0 Draw Gantt diagrams with TikZ]
+%<pgfgantt>\ProvidesPackage{pgfgantt}[2018/01/10 v5.0 Draw Gantt diagrams with TikZ]
 %<pgfgantt>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
 %
 %<*driver>
@@ -57,7 +57,7 @@
 			ganttlinklabel,ganttvalueof,pgfcalendarweekdayname,pgfcalendarweekdayletter,
 			pgfcalendarmonthshortname,currentweek,startyear,startmonth,startday,x,y,
 			pgfcalendarweekday,pgfcalendarmonth,newgantttimeslotformat,pgfcalendardatetojulian,
-			newganttchartelement,newganttchartelement*,gantt,ganttlinked,ganttfoobar,ganttlinkedfoobar
+			newganttchartelement,newganttchartelement*,gantt,ganttlinked,ganttfoobar,ganttlinkedfoobar,ganttvrule
 		},
 		escapeinside=`',
 		escapebegin=\begin{rmfamily},
@@ -255,8 +255,8 @@
 \EnableCrossrefs
 \CodelineIndex
 \RecordChanges
-\IndexPrologue{\section{Index}\markboth{Index}{Index}Numbers written in bold refer to the page where the corresponding entry is described; numbers in italic refer to the code line of the definition; numbers in roman refer to the code lines where the entry is used.}
-\GlossaryPrologue{\section{Change History}\markboth{Change history}{Change history}}
+\IndexPrologue{\clearpage\section{Index}\markboth{Index}{Index}Bold numbers refer to the page where the corresponding entry is described; italic numbers refer to the code line of the definition; upright numbers refer to the code lines where the entry is used.}
+\GlossaryPrologue{\clearpage\section{Change History}\markboth{Change history}{Change history}}
 
 
 \setkomafont{title}{\rmfamily\bfseries}
@@ -270,7 +270,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{2003}
+% \CheckSum{2245}
 %
 % \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
@@ -291,12 +291,12 @@
 %
 % \GetFileInfo{pgfgantt.sty}
 %
-% \DoNotIndex{\@empty,\@ifstar,\@ifundefined,\@tempa,\@tempb,\@tempc,\@tempcnta,\@tempcntb,\advance,\begin,\begingroup,\bfseries,\breakforeach,\clip,\csname,\def,\divide,\draw,\edef,\else,\end,\endcsname,\endgroup,\expandafter,\fi,\foreach,\global,\i,\ifcase,\ifdate,\ifdim,\ifnum,\ifx,\itshape,\let,\multiply,\newcommand,\newcount,\newenvironment,\newif,\node,\normalcolor,\normalfont,\normalsize,\PackageError,\PackageWarning,\path,\pgf at process,\pgf at x,\pgf at y,\pgf at xa,\pgf at xb,\pgf at xc,\pgf at ya,\pgf at yb,\pgf at yc,\pgfcalendar,\pgfcalendarcurrentday,\pgfcalendarcurrentjulian,\pgfcalendarcurrentmonth,\pgfcalendarcurrentweekday,\pgfcalendarcurrentyear,\pgfcalendardatetojulian,\pgfcalendarendiso,\pgfcalendarjuliantodate,\pgfdeclareshape,\pgfkeys,\pgfkeyscurrentname,\pgfkeyssetvalue,\pgfkeysvalueof,\pgfmathparse,\pgfmathprintnumber,\pgfmathresult,\pgfmathsetlength,\pgfmathsetmacro,\pgfpathclose,\pgfpathlineto,\pgfpathmoveto,\pgfpoint,\pgfpointadd,\pgfpointanchor,\pgfpointscale,\pgfqkeys,\relax,\RequirePackage,\savedanchor,\scriptsize,\setcounter,\small,\stepcounter,\strut,\t,\the,\usetikzlibrary,\value,\x,\xdef}
+% \DoNotIndex{\@auxout,\@empty,\@firstoftwo,\@ifundefined,\@namedef,\@nameuse,\@tempa,\@tempb,\@tempc,\@tempcnta,\@tempcntb,\@tempdima,\advance,\anchor,\backgroundpath,\begin,\begingroup,\bfseries,\breakforeach,\clip,\csname,\def,\divide,\draw,\edef,\else,\end,\endcsname,\endgroup,\expandafter,\fi,\foreach,\global,\i,\ifcase,\ifdate,\ifdim,\ifnum,\ifx,\inheritanchor,\inheritanchorborder,\inheritbackgroundpath,\inheritsavedanchors,\itshape,\kernel at ifnextchar,\let,\multiply,\newcommand,\newcount,\newenvironment,\newif,\node,\normalcolor,\normalfont,\normalsize,\northeast,\outernortheast,\PackageError,\PackageWarning,\path,\pgf at process,\pgf at x,\pgf at y,\pgf at xa,\pgf at xb,\pgf at xc,\pgf at ya,\pgf at yb,\pgf at yc,\pgfcalendar,\pgfcalendarbeginjulian,\pgfcalendarcurrentday,\pgfcalendarcurrentjulian,\pgfcalendarcurrentmonth,\pgfcalendarcurrentweekday,\pgfcalendarcurrentyear,\pgfcalendardatetojulian,\pgfcalendarendiso,\pgfcalendarifdateday,\pgfcalendarifdatemonth,\pgfcalendarifdateyear,\pgfcalendarjuliantodate,\pgfcalendarmatchestrue,\pgfdeclareshape,\pgfextractx,\pgfkeys,\pgfkeyscurrentname,\pgfkeyssetvalue,\pgfkeysvalueof,\pgfmathparse,\pgfmathprintnumber,\pgfmathresult,\pgfmathsetlength,\pgfmathsetmacro,\pgfpathclose,\pgfpathlineto,\pgfpathmoveto,\pgfpoint,\pgfpointadd,\pgfpointanchor,\pgfpointdiff,\pgfpointscale,\pgfqkeys,\protected at write,\relax,\RequirePackage,\savedanchor,\scriptsize,\setcounter,\small,\southwest,\stepcounter,\string,\strut,\t,\the,\tikz at align@newline,\usetikzlibrary,\value,\x,\xdef}
 %
 % 
 % \title{Drawing Gantt Charts in \LaTeX\\with \TikZ}
 % \subtitle{The \texttt{pgfgantt} Package}
-% \author{Wolfgang Skala\thanks{Division of Structural Biology, Department of Molecular Biology, University of Salzburg, Austria; \texttt{Wolfgang.Skala at sbg.ac.at}}}
+% \author{Wolfgang Skala\thanks{Department of Biosciences, University of Salzburg, Austria; \texttt{Wolfgang.Skala at sbg.ac.at}}}
 % \date{\fileversion\\\filedate}
 % \maketitle
 %
@@ -304,7 +304,13 @@
 % The \pack{pgfgantt} package provides the |ganttchart| environment, which draws a Gantt chart within a \TikZ\ picture. The user may add various elements to the chart, for example, titles, bars, groups, milestones and different links between these elements. The appearance of the chart elements is highly customizable, and even new chart elements may be defined.
 % \end{abstract}
 %
-% \tableofcontents
+% \clearpage\tableofcontents
+% \changes{v5.0}{2018/01/10}{\cs{gantttitlecalendar} now recognizes the \texttt{decade} key.}
+% \changes{v5.0}{2018/01/10}{Key \texttt{compress calendar} has been replaced by \texttt{time slot unit} to allow an additional level of compression (year).}
+% \changes{v5.0}{2018/01/10}{The command \cs{ganttvrule} allows to draw general vertical rules (similar to the today rule). The keys \texttt{vrule}, \texttt{vrule offset}, \texttt{vrule label font} and \texttt{vrule label text} configure those rules.}
+% \changes{v5.0}{2018/01/10}{The key \texttt{expand chart} was added, which specifies that a chart should expand horizontally to a given dimension.}
+% \changes{v5.0}{2018/01/10}{The key \texttt{title label text} was added to allow fine-tuning of title label formatting.}
+% \changes{v5.0}{2018/01/10}{Made \pack{pgfgantt} robust to \pack{amsgen}'s redefinition of \cs{@ifstar}.}
 % \changes{v4.0}{2013/06/01}{The key \texttt{link label anchor} was renamed to \texttt{link label node}.}
 % \changes{v4.0}{2013/06/01}{\cs{newganttchartelement} defines completely new chart elements.}
 % \changes{v4.0}{2013/06/01}{The key \texttt{progress label anchor} was replaced by \texttt{bar}/\texttt{group}/\texttt{milestone progress label node}.}
@@ -359,13 +365,25 @@
 % \changes{v1.0}{2011/03/01}{Initial release}
 %
 %
-% \section{Introduction}
+% \clearpage\section{Introduction}
 %
 % The \pack{pgfgantt} package allows you to draw Gantt charts in \LaTeX. Thus, you can describe simple project schedules without having to include images produced by external programs. Similar to Martin Kumm's \pack{gantt} package\footnote{\url{http://www.martin-kumm.de/tex_gantt_package.php}} (which inspired \pack{pgfgantt}'s fundamental aspects), \pack{pgfgantt} bases upon \textsc{pgf} and its \TikZ\ frontend\footnote{\url{http://ctan.org/tex-archive/graphics/pgf/}}. Besides, it provides a comprehensive (and portable) alternative to \pack{pst-gantt}\footnote{\url{http://ctan.org/tex-archive/graphics/pstricks/contrib/pst-gantt/}}.
 %
-% \pack{pgfgantt} requires a \textit{current} \textsc{pgf} installation. \textbf{\color{red}Note that the version number must at least be 2.10, dated October 25th, 2010.} Furthermore, \textbf{\color{red}\pack{pgfgantt}~\fileversion\ and above is not fully downwards compatible.}
+% \paragraph{Requirements} \pack{pgfgantt} requires a \textit{current} \textsc{pgf} installation. Note that the version number must at least be 2.10, dated October 25th, 2010. Furthermore, \pack{pgfgantt}~\fileversion\ and above is not fully downwards compatible.
+% 
+% \paragraph{Suggestions} Please report any suggestions and improvements at the project's GitHub page (\url{https://github.com/skafdasschaf/latex-pgfgantt}).
 %
-% \paragraph{Acknowledgements} I would like to thank Petr Po\v s\'ik (Czech Technical University in Prague), Rapha\"el Clifford (University of Bristol), Holger Karl (Universität Paderborn), Jakob D\o llner M\o nster (Technical University of Denmark), Sascha Yousefi (Universität Freiburg) and Callum Webb for their ideas concerning new features.
+% \paragraph{Acknowledgements} I would like to thank the following people for their ideas concerning new features:
+% Christian Buhtz,
+% Rapha\"el Clifford (University of Bristol),
+% Jakob D\o llner M\o nster (Technical University of Denmark),
+% Holger Karl (Universität Paderborn),
+% Tristan Miller (Technische Universität Darmstadt),
+% Scott Pakin (Los Alamos National Laboratory),
+% Petr Po\v s\'ik (Czech Technical University in Prague),
+% Una Smith,
+% Sascha Yousefi (Universität Freiburg),
+% and Callum Webb.
 %
 %
 % \clearpage\section{User Guide}
@@ -441,6 +459,8 @@
 % 		\textit{Examples:} \texttt{2013-03-14}, \texttt{2013-5-1}
 % 	\item \texttt{isodate-yearmonth} -- ISO-standard dates without days (\texttt{yyyy-mm}). Such dates are automatically converted to the first day of the respective month.\\
 % 		\textit{Examples:} \texttt{2013-03}, \texttt{2013-5}
+% 	\item \texttt{isodate-year} -- year only (\texttt{yyyy}). Such dates are automatically converted to the first day of January.\\
+% 		\textit{Examples:} \texttt{2013}, \texttt{2014}
 % 	\item \texttt{little-endian} -- Gregorian little-endian, i.\,e. day--month--year (the common German date format). Valid day/month and month/year separators are the hyphen (\texttt{-}), slash (\texttt{/}) and period (\texttt{.}). If you enter a two-digit year (for example, \texttt{13} instead of \texttt{2013}), it will be completed according to the value of \opt{time slot format/base century} (see below).\\
 % 		\textit{Examples:} \texttt{14-03-2013}, \texttt{14/03/13}, \texttt{14.3.2013}
 % 	\item \texttt{middle-endian} -- middle-endian, i.\,e. month--day--year (the common US date format). For valid separators and automatic year completion, see \textit{little-endian}.\\
@@ -569,6 +589,28 @@
 % \end{center}
 % \end{key}
 %
+% \begin{key}[]{expand chart}{\texttt{[=none}\space\textbar\space\meta{dimension}\texttt{]}}{none}
+% If the value of this key differs from |none|, the Gantt chart will expand horizontally to \meta{dimension}. Use this key to produce charts that automatically expand to the text width. Two \LaTeX\ runs are required to calculate the correct size of the chart.
+% \par\bigskip\noindent
+% \begin{texcode}
+% \begin{ganttchart}[
+% 		expand chart=\textwidth
+% 	]{1}{6}
+% 	\gantttitle{Title}{6} \\
+% 	\ganttbar{Bar 1}{1}{3} \\
+% 	\ganttbar{}{4}{6}
+% \end{ganttchart}
+% \end{texcode}
+% \begin{center}
+% \begin{ganttchart}[
+% 		expand chart=\textwidth
+% 	]{1}{6}
+% 	\gantttitle{Title}{6} \\
+% 	\ganttbar{Bar 1}{1}{3} \\
+% 	\ganttbar{}{4}{6}
+% \end{ganttchart}
+% \end{center}
+% \end{key}
 % \begin{key}[]{hgrid}{\texttt{[=false}\space\textbar\space\texttt{true}\space\textbar\space\meta{style list}\texttt{]}}{false}
 % \keyline[/.style=]{hgrid style}{\meta{style}}{dotted}
 % \keyline[]{vgrid}{\texttt{[=false}\space\textbar\space\texttt{true}\space\textbar\space\meta{style list}\texttt{]}}{false}
@@ -944,6 +986,7 @@
 % 		\toprule
 % 		\itshape Line type & \meta{output format} & \itshape Example output \\
 % 		\midrule
+% 		\texttt{decade} & n/a & 2000s, 2010s, \dots \\[1ex]
 % 		\texttt{year} & n/a & 2012, 2013, \dots \\[1ex]
 % 		\texttt{month [=}\meta{output format}\texttt{]} & (none) & 01, 02, \dots, 12 \\
 % 			& \texttt{name} & January, February, \dots \\
@@ -1058,8 +1101,8 @@
 % \end{center}
 % \end{key}
 % 
-% \begin{key}{compress calendar}{\meta{boolean}}{false}
-% By default, one \textit{calendar day} is one time slot wide. With \opt{compress calendar}\texttt{=true}, one \textit{month} corresponds to one time slot. Consequently, in compressed calendars only |year| and |month| are sensible line types for |\gantttitlecalendar|. The time slot format \texttt{isodate-yearmonth} is especially suited for compressed calendars.
+% \begin{key}{time slot unit}{\texttt{day}\space\textbar\space\texttt{month}\space\textbar\space\texttt{year}}{day}
+% By default, one \textit{calendar day} is one time slot wide. With \opt{time slot unit}\texttt{=month}, one \textit{month} corresponds to one time slot. Consequently, in such calendars only |year| and |month| are sensible line types for |\gantttitlecalendar|, and the time slot format \texttt{isodate-yearmonth} is especially suited.
 % \par\bigskip\noindent
 % \begin{texcode}
 % \begin{ganttchart}[
@@ -1066,8 +1109,8 @@
 % 		hgrid,
 % 		vgrid,
 % 		time slot format=isodate-yearmonth,
-% 		compress calendar
-% 	]{2012-01}{2013-5}
+% 		time slot unit=month
+% 	]{2012-03}{2014-1}
 % 	\gantttitlecalendar{year, month} \\
 % 	\ganttbar{}{2012-05}{2013-01}
 % \end{ganttchart}
@@ -1077,14 +1120,42 @@
 % 		hgrid,
 % 		vgrid,
 % 		time slot format=isodate-yearmonth,
-% 		compress calendar
-% 	]{2012-01}{2013-5}
+% 		time slot unit=month
+% 	]{2012-03}{2014-1}
 % 	\gantttitlecalendar{year, month} \\
 % 	\ganttbar{}{2012-05}{2013-01}
 % \end{ganttchart}
 % \end{center}
+%
+% With \opt{time slot unit}\texttt{=year}, one \textit{year} corresponds to one time slot. Consequently, in such calendars only |decade| and |year| are sensible line types for |\gantttitlecalendar|, and the time slot format \texttt{isodate-year} is especially suited.
+% \par\bigskip\noindent
+% \begin{texcode}
+% \begin{ganttchart}[
+% 		hgrid,
+% 		vgrid,
+% 		x unit=7.5mm,
+% 		time slot format=isodate-year,
+% 		time slot unit=year
+% 	]{2007}{2020}
+% 	\gantttitlecalendar{decade, year} \\
+% 	\ganttbar{}{2008}{2018}
+% \end{ganttchart}
+% \end{texcode}
+% \begin{center}
+% \begin{ganttchart}[
+% 		hgrid,
+% 		vgrid,
+% 		x unit=7.5mm,
+% 		time slot format=isodate-year,
+% 		time slot unit=year
+% 	]{2007}{2020}
+% 	\gantttitlecalendar{decade, year} \\
+% 	\ganttbar{}{2008}{2018}
+% \end{ganttchart}
+% \end{center}
 % \end{key}
-% 
+%
+%
 % \begin{key}[/.style=]{title}{\meta{style}}{shape=rectangle, inner sep=0pt, draw, fill=white}
 % Sets the appearance of a title element.
 % \par\bigskip\noindent
@@ -1125,7 +1196,8 @@
 %
 % \begin{key}{title label font}{\meta{font commands}}{\string\small}
 % \keyline[/.style=]{title label node}{\meta{options}}{anchor=center, font=\string\ganttvalueof\{title label font\}}
-% The \meta{font commands} and \meta{options} are applied to the title label node, which is positioned at the center of each title element.
+% \keyline{title label text}{\meta{text}}{\string\strut\#1}
+% The \meta{font commands} and \meta{options} are applied to the title label node, which is positioned at the center of each title element. \meta{text} should contain a single parameter token (|#1|), which is replaced by the first mandatory argument of |\gantttitle|. The |\strut| in the standard value ensures equal vertical spacing of the labels.
 % \par\bigskip\noindent
 % \begin{texcode}
 % \begin{ganttchart}[
@@ -1132,7 +1204,8 @@
 % 		vgrid,
 % 		hgrid,
 % 		title label font=\LARGE\color{violet},
-% 		title label node/.append style={anchor=west}
+% 		title label node/.append style={anchor=west},
+% 		title label text=<#1>
 % 	]{1}{6}
 % 	\gantttitle{2011}{6} \\
 % 	\ganttbar{}{1}{2}
@@ -1144,7 +1217,8 @@
 % 		vgrid,
 % 		hgrid,
 % 		title label font=\LARGE\color{violet},
-% 		title label node/.append style={anchor=west}
+% 		title label node/.append style={anchor=west},
+% 		title label text=<#1>
 % 	]{1}{6}
 % 	\gantttitle{2011}{6} \\
 % 	\ganttbar{}{1}{2}
@@ -1266,6 +1340,59 @@
 % \end{key}
 %
 %
+% \subsection{Vertical rules}
+%
+% A \textit{vertical rule} indicates an important date like a deadline. Such rules represent a generalization of the today rule and are drawn by the \DescribeMacro{\ganttvrule}|\ganttvrule| macro:
+% \begin{texcode}
+% \ganttvrule`\oarg{options}\marg{label}\marg{tss}'
+% \end{texcode}
+% This macro draws a \meta{label}ed vertical rule at the given \meta{tss}.
+%
+% \begin{key}{vrule offset}{\meta{number}}{1}
+% \keyline[/.style=]{vrule}{\meta{style}}{dashed, line width=1pt}
+% \keyline{vrule label font}{\meta{font commands}}{\string\normalfont}
+% \keyline[/.style=]{vrule label node}{\meta{style}}{anchor=north, font=\string\ganttvalueof\{vrule label font\}}
+% \opt{vrule offset} determines the exact $y$-coordinate in the time slot and should lie between 0.0 (left border) and 1.0 (right border). The vertical rule appears in the \meta{style} denoted by \opt{vrule}. The label is formatted by \opt{vrule label font} and \opt{vrule label node}.
+% \par\bigskip\noindent
+% \begin{texcode}
+% \begin{ganttchart}[
+% 		vgrid,
+% 		hgrid,
+% 		vrule/.style={very thick, blue},
+% 		vrule label font=\bfseries
+% 	]{1}{8}
+% 	\gantttitle{2018}{8} \\
+% 	\ganttbar{}{1}{2} \\
+% 	\ganttbar{}{4}{8}
+% 	\ganttvrule{day x}{2}
+% 	\ganttvrule[
+% 		vrule/.append style={red, thin},
+% 		vrule offset=.2,
+% 		vrule label node/.append style={anchor=north west}
+% 	]{day z}{6}
+% \end{ganttchart}
+% \end{texcode}
+% \begin{center}
+% \begin{ganttchart}[
+% 		vgrid,
+% 		hgrid,
+% 		vrule/.style={very thick, blue},
+% 		vrule label font=\bfseries
+% 	]{1}{8}
+% 	\gantttitle{2018}{8} \\
+% 	\ganttbar{}{1}{2} \\
+% 	\ganttbar{}{4}{8}
+% 	\ganttvrule{day x}{2}
+% 	\ganttvrule[
+% 		vrule/.append style={red, thin},
+% 		vrule offset=.2,
+% 		vrule label node/.append style={anchor=north west}
+% 	]{day z}{6}
+% \end{ganttchart}
+% \end{center}
+% \end{key}
+%
+%
 % \subsection{Predefined Chart Elements}
 % 
 % \pack{pgfgantt} predefines three chart elements:
@@ -2603,7 +2730,7 @@
 % 		y unit chart=0.5cm,
 % 		vgrid,
 % 		time slot format=isodate-yearmonth,
-% 		compress calendar,
+% 		time slot unit=month,
 % 		title/.append style={draw=none, fill=RoyalBlue!50!black},
 % 		title label font=\sffamily\bfseries\color{white},
 % 		title label node/.append style={below=-1.6ex},
@@ -2647,7 +2774,7 @@
 % 		y unit chart=0.5cm,
 % 		vgrid,
 % 		time slot format=isodate-yearmonth,
-% 		compress calendar,
+% 		time slot unit=month,
 % 		title/.append style={draw=none, fill=RoyalBlue!50!black},
 % 		title label font=\sffamily\bfseries\color{white},
 % 		title label node/.append style={below=-1.6ex},
@@ -2867,6 +2994,15 @@
 %
 % \subsection{Macros for Key and Error Management}
 %
+% \begin{intmacro}{\@gtt at ifstar}
+% |\@gtt at ifstar| reimplements the \LaTeXe\ kernel's |\@ifstar| macro.
+% This makes it robust to \pack{amsgen}'s reimplementation of
+% |\@ifstar|.
+%    \begin{macrocode}
+\def\@gtt at ifstar#1{\kernel at ifnextchar*{\@firstoftwo{#1}}}
+%    \end{macrocode}
+% \end{intmacro}
+%
 % \begin{macro}{\ganttset}
 % |\ganttset| changes the current key path to |/pgfgantt/| and then executes the keys in its mandatory argument.
 %    \begin{macrocode}
@@ -2980,7 +3116,7 @@
 % In the absence of a star as the first token in a style list item, |\gtt at hgrid@analyze| adds the multiplier |1| to the input stream.
 %    \begin{macrocode}
 \def\gtt at hgrid@analyze{%
-  \@ifstar{\gtt at hgrid@draw}{\gtt at hgrid@draw1}%
+  \@gtt at ifstar{\gtt at hgrid@draw}{\gtt at hgrid@draw1}%
 }
 
 %    \end{macrocode}
@@ -3043,7 +3179,7 @@
 }
 
 \def\gtt at vgrid@analyze{%
-  \@ifstar{\gtt at vgrid@draw}{\gtt at vgrid@draw1}%
+  \@gtt at ifstar{\gtt at vgrid@draw}{\gtt at vgrid@draw1}%
 }
 
 \def\gtt at vgrid@draw#1#2\relax{%
@@ -3078,12 +3214,16 @@
 %    \end{macrocode}
 % \end{intmacro}
 % \begin{intmacro}{\gtt at juliantotimeslot}
-% |\gtt at juliantotimeslot|\marg{count 1}\marg{count 2} converts the Julian date stored in \meta{count 1} to a time slot and stores the latter in \meta{count 2}. This macro is called after the start of Gantt chart. Thus, |\gtt at startyear|, |\gtt at startmonth| and |\gtt at startjulian| (see section~\ref{ssc:ImplMain}) have already been initialized. If the chart is compressed, one time slot corresponds to one month; otherwise, it corresponds to one day.
+% |\gtt at juliantotimeslot|\marg{count 1}\marg{count 2} converts the Julian date stored in \meta{count 1} to a time slot and stores the latter in \meta{count 2}. This macro is called after the start of Gantt chart. Thus, |\gtt at startyear|, |\gtt at startmonth| and |\gtt at startjulian| (see section~\ref{ssc:ImplMain}) have already been initialized. Depending on the value of \opt{time slot unit}, one time slot corresponds to one |day|, one |month| or one |year|.
 %    \begin{macrocode}
 \newcommand\gtt at juliantotimeslot[2]{%
   \begingroup%
   \@tempcnta=#1\relax%
-  \ifgtt at compresscalendar%
+  \ifgtt at timeslotunit@day%
+    \advance\@tempcnta by-\gtt at startjulian\relax%
+    \advance\@tempcnta by1\relax%
+  \fi%
+  \ifgtt at timeslotunit@month%
     \pgfcalendarjuliantodate{\@tempcnta}{\@tempa}{\@tempb}{\@tempc}%
     \@tempcnta=\@tempa\relax%
     \advance\@tempcnta by-\gtt at startyear\relax%
@@ -3091,8 +3231,11 @@
     \advance\@tempcnta by\@tempb\relax%
     \advance\@tempcnta by-\gtt at startmonth\relax%
     \advance\@tempcnta by1\relax%
-  \else%
-    \advance\@tempcnta by-\gtt at startjulian\relax%
+  \fi%
+  \ifgtt at timeslotunit@year%
+    \pgfcalendarjuliantodate{\@tempcnta}{\@tempa}{\@tempb}{\@tempc}%
+    \@tempcnta=\@tempa\relax%
+    \advance\@tempcnta by-\gtt at startyear\relax%
     \advance\@tempcnta by1\relax%
   \fi%
   #2=\@tempcnta\relax%
@@ -3113,7 +3256,7 @@
 
 %    \end{macrocode}
 % \end{macro}
-% The predefined time slot formats |simple|, |isodate| and |isodate-yearmonth| are straight forward.
+% The predefined time slot formats |simple|, |isodate|, |isodate-yearmonth| and |isodate-year| are straight forward.
 %    \begin{macrocode}
 \newgantttimeslotformat{simple}{%
   #2=#1\relax%
@@ -3129,6 +3272,10 @@
   \pgfcalendardatetojulian{#1-01}{#2}%
 }
 
+\newgantttimeslotformat{isodate-year}{%
+  \pgfcalendardatetojulian{#1-01-01}{#2}%
+}
+
 %    \end{macrocode}
 % \begin{intmacro}{\gtt at tsf@getdmy}
 % |\gtt at tsf@getdmy|\marg{date} decomposes a \meta{date} |day|[|sep|]|month|[|sep|]|year| (with [|sep|] representing a period, hyphen or slash) into |day|, |month| and |year| and stores these numbers in |\local at day|, |\local at month| and |\local at year|, respectively.
@@ -3261,6 +3408,7 @@
 % \end{option}
 % \end{option}
 % \begin{option}{canvas}
+% \begin{option}{expand chart}
 % \begin{option}{today}
 % \begin{option}{today offset}
 % \begin{option}{today rule}
@@ -3270,6 +3418,7 @@
 % Keys related to the canvas and the today rule.
 %    \begin{macrocode}
 \@gtt at stylekeydef{canvas}{shape=rectangle, draw, fill=white}
+\@gtt at keydef{expand chart}{none}
 \@gtt at keydef{today}{none}
 \@gtt at keydef{today offset}{1}
 \@gtt at stylekeydef{today rule}{dashed, line width=1pt}
@@ -3286,6 +3435,7 @@
 % \end{option}
 % \end{option}
 % \end{option}
+% \end{option}
 % \begin{intmacro}{\ifgtt at newlineshortcut}
 % \begin{option}{newline shortcut}
 % Boolean key that determines if |\\| is equivalent to |\ganttnewline|.
@@ -3306,7 +3456,8 @@
 % \begin{intmacro}{\gtt at today@slot}
 % \begin{intmacro}{\gtt at startjulian}
 % \begin{intmacro}{\gtt at endjulian}
-% The boolean |\ifgtt at tikzpicture| is true if a Gantt chart appears within a \TikZ\ picture. |\ifgtt at intitle| is true at the start of a |ganttchart| environment and set to false as soon as the first non-title element is encountered. |\gtt at lasttitleslot| corresponds to the $x$-coordinate of its right border. |\gtt at elementid| enumerates the automatic names of chart elements. |\gtt at today@slot| is the time slot of the today rule. |\gtt at startjulian| and |\gtt at endjulian| contain the Julian dates corresponding to the first and last time slot, respectively.
+% \begin{intmacro}{\gtt at chartid}
+% The boolean |\ifgtt at tikzpicture| is true if a Gantt chart appears within a \TikZ\ picture. |\ifgtt at intitle| is true at the start of a |ganttchart| environment and set to false as soon as the first non-title element is encountered. |\gtt at lasttitleslot| corresponds to the $x$-coordinate of its right border. |\gtt at elementid| enumerates the automatic names of chart elements. |\gtt at today@slot| is the time slot of the today rule. |\gtt at startjulian| and |\gtt at endjulian| contain the Julian dates corresponding to the first and last time slot, respectively. |\gtt at chartid| assigns a consecutive number to each chart.
 %    \begin{macrocode}
 \newif\ifgtt at tikzpicture
 \newif\ifgtt at intitle
@@ -3315,6 +3466,7 @@
 \newcount\gtt at today@slot
 \newcount\gtt at startjulian
 \newcount\gtt at endjulian
+\newcount\gtt at chartid
 %    \end{macrocode}
 % \end{intmacro}
 % \end{intmacro}
@@ -3323,6 +3475,15 @@
 % \end{intmacro}
 % \end{intmacro}
 % \end{intmacro}
+% \end{intmacro}
+% \begin{intmacro}{\gtt at chartextrasize}
+% Each |ganttchart| environment writes a |\gtt at chartextrasize|\marg{chart id}\marg{extra size} macro to the auxililary file. This macro stores its second argument in a macro of the form |\@gtt at chart@|\meta{chart id}|@extrasize|. The \meta{extra size} is the size of the chart's bounding box less the size of the canvas, calculated as \opt{x unit} times the number of time slots.
+%    \begin{macrocode}
+\def\gtt at chartextrasize#1#2{%
+  \global\@namedef{@gtt at chart@#1 at extrasize}{#2}%
+}
+%    \end{macrocode}
+% \end{intmacro}
 % \begin{environment}{ganttchart}
 % At the beginning of a |ganttchart| environment, the keys in its optional argument are executed. Initialize the macros and counts that contain start dates, end dates, the chart width, \dots
 %    \begin{macrocode}
@@ -3355,6 +3516,25 @@
   \global\gtt at lasttitleline=0\relax%
   \global\gtt at lasttitleslot=0\relax%
 %    \end{macrocode}
+% \begin{intmacro}{\gtt at expanded@xunit}
+% If \opt{expand chart} contains a value different from |none|, scale the chart so that its $x$-extent equals this value. To this end, use the information stored in the auxiliary file. |\gtt at expanded@xunit| will contain the new value for \opt{x unit}.
+%    \begin{macrocode}
+  \def\@tempa{none}%
+  \edef\@tempb{\ganttvalueof{expand chart}}%
+  \ifx\@tempa\@tempb\else%
+    \@ifundefined{@gtt at chart@\the\gtt at chartid @extrasize}{%
+      \@gtt at PackageWarning{Gantt chart expansion may have changed.
+                           Rerun to get expansion right}%
+    }{%
+      \pgfmathparse{(\ganttvalueof{expand chart}%
+                     - \@nameuse{@gtt at chart@\the\gtt at chartid @extrasize})%
+                    / \gtt at chartwidth}%
+      \edef\gtt at expanded@xunit{\pgfmathresult pt}%
+      \ganttset{x unit=\gtt at expanded@xunit}%
+    }%
+  \fi%
+%    \end{macrocode}
+% \end{intmacro}
 % \begin{macro}{\\}
 % \begin{macro}{\ganttalignnewline}
 % If a |ganttchart| appears outside of a |tikzpicture|, we implicitly start this environment. ``Within a |tikzpicture|'' means that |\useasboundingbox| is defined. Since we expect a chart to start with at least one title element, |\ifgtt at intitle| is true. If \opt{newline shortcut} is true, make the control symbol |\\| equivalent to |\ganttnewline|. In any case, |\ganttalignnewline| is defined.
@@ -3455,6 +3635,20 @@
   \end{scope}%
 %    \end{macrocode}
 % \end{intmacro}
+% Store the $x$-extent of the bounding box in |\@tempdima|. Calculate the size by which the bounding box exceeds the ``raw'' canvas size. Write this information to the auxiliary file.
+%    \begin{macrocode}
+  \pgfextractx{\@tempdima}{%
+    \pgfpointdiff{\pgfpointanchor{current bounding box}{south west}}%
+                 {\pgfpointanchor{current bounding box}{north east}}%
+  }%
+  \pgfmathparse{\@tempdima -\ganttvalueof{x unit} * \gtt at chartwidth}%
+  \protected at write\@auxout{}{%
+    \string\gtt at chartextrasize{\the\gtt at chartid}{\pgfmathresult pt}}%
+%    \end{macrocode}
+% Increase the chart counter.
+%    \begin{macrocode}
+  \global\advance\gtt at chartid by1\relax%
+%    \end{macrocode}
 % At the end of a |ganttchart|, we also close the |tikzpicture| if we started it implicitly.
 %    \begin{macrocode}
   \ifgtt at tikzpicture\else\end{tikzpicture}\fi%
@@ -3498,11 +3692,70 @@
 % \end{macro}
 %
 %
+% \subsection{Vertical rules}
+%
+% \begin{option}{vrule offset}
+% \begin{option}{vrule}
+% \begin{option}{vrule label font}
+% \begin{option}{vrule label node}
+% Keys related to the vertical rules.
+%    \begin{macrocode}
+\@gtt at keydef{vrule offset}{1}
+\@gtt at stylekeydef{vrule}{dashed, line width=1pt}
+\@gtt at keydef{vrule label font}{\normalfont}
+\@gtt at stylekeydef{vrule label node}{%
+  anchor=north, font=\ganttvalueof{vrule label font}%
+}
+
+%    \end{macrocode}
+% \end{option}
+% \end{option}
+% \end{option}
+% \end{option}
+% \begin{intmacro}{\gtt at vrule@slot}
+% A count for storing the vrule time slot.
+%    \begin{macrocode}
+\newcount\gtt at vrule@slot
+
+%    \end{macrocode}
+% \end{intmacro}
+% \begin{macro}{\ganttvrule}
+% Calculate the coordinates for the vertical rule and draw it.
+%    \begin{macrocode}
+\newcommand\ganttvrule[3][]{%
+  \begingroup
+  \ganttset{#1}
+  \gtt at tsstojulian{#3}{\gtt at vrule@slot}%
+  \gtt at juliantotimeslot{\gtt at vrule@slot}{\gtt at vrule@slot}%
+  \pgfmathsetmacro\y at upper{%
+    \gtt at lasttitleline * \ganttvalueof{y unit title}%
+  }%
+  \pgfmathsetmacro\y at lower{%
+    \gtt at lasttitleline * \ganttvalueof{y unit title}%
+    + (\gtt at currentline - \gtt at lasttitleline - 1)%
+    * \ganttvalueof{y unit chart}%
+  }%
+  \pgfmathsetmacro\x at mid{%
+    (\gtt at vrule@slot - 1 + \ganttvalueof{vrule offset})%
+    * \ganttvalueof{x unit}%
+  }%
+  \draw [/pgfgantt/vrule]
+    (\x at mid pt, \y at upper pt) -- (\x at mid pt, \y at lower pt)
+    node [/pgfgantt/vrule label node] {#2};%
+  \endgroup
+}
+
+%    \end{macrocode}
+% \end{macro}
+%
+%
 % \subsection{Titles}
-% 
+%
 % \begin{option}{title}
 % \begin{option}{title label font}
 % \begin{option}{title label node}
+% \begin{option}{title label text}
+% \begin{intmacro}{\gtt at titlelabeltext}
 % \begin{option}{title list options}
 % \begin{intmacro}{\gtt at titlelistoptions}
 % \begin{option}{title left shift}
@@ -3511,7 +3764,7 @@
 % \begin{option}{title height}
 % \begin{option}{include title in canvas}
 % \begin{intmacro}{\ifgtt at includetitle}
-% Keys that influence title elements. Note that |\@gtt at keydef| cannot define \opt{title list options}, since |\@gtt at titlelistoptions| is expanded after a |\foreach| statement, where |\ganttvalueof| will not work.
+% Keys that influence title elements. The parameter token |#1| in the value of \opt{title label text} is replaced by the argument of |\gtt at titlelabeltext|. Note that |\@gtt at keydef| cannot define \opt{title list options}, since |\@gtt at titlelistoptions| is expanded after a |\foreach| statement, where |\ganttvalueof| will not work.
 %    \begin{macrocode}
 \@gtt at stylekeydef{title}{shape=rectangle, inner sep=0pt, draw, fill=white}
 \@gtt at keydef{title label font}{\small}
@@ -3519,6 +3772,10 @@
   anchor=center, font=\ganttvalueof{title label font}%
 }
 \ganttset{%
+  title label text/.code={%
+    \def\gtt at titlelabeltext##1{#1}%
+  },%
+  title label text=\strut#1,%
   title list options/.code={%
     \def\gtt at titlelistoptions{[#1]}%
   },%
@@ -3542,23 +3799,46 @@
 % \end{option}
 % \end{intmacro}
 % \end{option}
+% \end{intmacro}
 % \end{option}
 % \end{option}
 % \end{option}
+% \end{option}
 % \begin{option}{calendar week text}
-% \begin{option}{compress calendar}
-% \begin{intmacro}{\ifgtt at compresscalendar}
+% \begin{option}{time slot unit}
+% \begin{intmacro}{\ifgtt at timeslotunit@day}
+% \begin{intmacro}{\ifgtt at timeslotunit@month}
+% \begin{intmacro}{\ifgtt at timeslotunit@year}
 % Keys for title calendars.
 %    \begin{macrocode}
 \@gtt at keydef{calendar week text}{Week~\currentweek}
-\newif\ifgtt at compresscalendar
+\newif\ifgtt at timeslotunit@day
+\newif\ifgtt at timeslotunit@month
+\newif\ifgtt at timeslotunit@year
 \ganttset{%
-  compress calendar/.is if=gtt at compresscalendar,%
-  compress calendar=false%
+  time slot unit/.is choice,
+  time slot unit/day/.code={%
+    \gtt at timeslotunit@daytrue%
+    \gtt at timeslotunit@monthfalse%
+    \gtt at timeslotunit@yearfalse%
+  },%
+  time slot unit/month/.code={%
+    \gtt at timeslotunit@dayfalse%
+    \gtt at timeslotunit@monthtrue%
+    \gtt at timeslotunit@yearfalse%
+  },%
+  time slot unit/year/.code={%
+    \gtt at timeslotunit@dayfalse%
+    \gtt at timeslotunit@monthfalse%
+    \gtt at timeslotunit@yeartrue%
+  },%
+  time slot unit=day
 }
 
 %    \end{macrocode}
 % \end{intmacro}
+% \end{intmacro}
+% \end{intmacro}
 % \end{option}
 % \end{option}
 % \begin{macro}{\gantttitle}
@@ -3600,7 +3880,7 @@
   \path (\x at mid pt, \y at mid pt)
     node [/pgfgantt/title, minimum width=\x at size pt,
           minimum height=\y at size pt] {}
-    node [/pgfgantt/title label node] {#2};%
+    node [/pgfgantt/title label node] {\gtt at titlelabeltext{#2}};%
   \global\advance\gtt at lasttitleslot by#3\relax%
   \endgroup%
 }
@@ -3628,7 +3908,7 @@
 %    \begin{macrocode}
 \newif\ifgtt at titlecalendarstar
 \newcommand\gantttitlecalendar{%
-  \@ifstar%
+  \@gtt at ifstar%
     {\gtt at titlecalendarstartrue\@gantttitlecalendar}%
     {\gtt at titlecalendarstarfalse\@gantttitlecalendar}%
 }
@@ -3698,16 +3978,96 @@
 % \end{intmacro}
 % \end{intmacro}
 % \end{intmacro}
-% For each \meta{line type}, we define a corresponding key |/pgfgantt/calendar/|\meta{line type}. This key performs the necessary calculations and draws one or several |\gantttitle|s. Line type |year| draws years.
+% \begin{intmacro}{\@gtt at getfourthdigit}
+% \begin{intmacro}{\@gtt at getdecade}
+% |\@gtt at getfourthdigit| returns the fourth digit of a year, while |\@gtt at getdecade| returns the first three digits of a year.
 %    \begin{macrocode}
+\def\@gtt at getfourthdigit#1#2#3#4{#4}
+\def\@gtt at getdecade#1#2#3#4{#1#2#3}
+%    \end{macrocode}
+% \end{intmacro}
+% \end{intmacro}
+% We define a new check for |\pgfcalendarifdate| as described in the |pgfcalendar| manual: |end of decade=|\meta{date} returns true if a date marks the end of a decade as defined by \meta{date}. For instance, if \meta{date} is |2009-12-31|, then the conditional will be true for the dates |1999-12-31|, |2009-12-31|, |2019-12-31| and so on.
+%    \begin{macrocode}
+\pgfkeys{%
+  /pgf/calendar/end of decade/.code={
+    \begingroup
+    \pgfcalendardatetojulian{#1}{\@tempcnta}
+    \pgfcalendarjuliantodate{\@tempcnta}{\@tempa}{\@tempb}{\@tempc}
+    \edef\endofdecade{\expandafter\@gtt at getfourthdigit\@tempa}
+    \edef\querydecade{\expandafter\@gtt at getfourthdigit\pgfcalendarifdateyear}
+    \ifnum\endofdecade=\querydecade\relax%
+      \ifnum\pgfcalendarifdatemonth=\@tempb\relax%
+        \ifnum\pgfcalendarifdateday=\@tempc\relax%
+          \global\pgfcalendarmatchestrue%
+        \fi%
+      \fi%
+    \fi%
+    \endgroup
+  }%
+}
+%    \end{macrocode}
+
+% For each \meta{line type}, we define a corresponding key |/pgfgantt/calendar/|\meta{line type}. This key performs the necessary calculations and draws one or several |\gantttitle|s. Line type |decade| draws decades.
+%    \begin{macrocode}
 \ganttset{%
+  calendar/decade/.code={%
+    \ifgtt at calendar@eol\ganttnewline\fi%
+    \begingroup%
+    \gtt at calendar@slots=1\relax%
+    \ifgtt at timeslotunit@year%
+      \pgfcalendar{}{\gtt at calendar@startdate}{\gtt at calendar@enddate}{%
+        \ifdate{end of decade=2009-12-31}{%
+          \gantttitle{%
+            \expandafter\@gtt at getdecade\pgfcalendarcurrentyear%
+            0s%
+          }{\the\gtt at calendar@slots}%
+          \gtt at calendar@slots=0\relax%
+        }{
+          \ifdate{equals=01-01}{%
+            \ifnum\pgfcalendarcurrentjulian>\pgfcalendarbeginjulian\relax%
+              \advance\gtt at calendar@slots by1\relax%
+            \fi
+          }{}%
+        }%
+        \ifdate{equals=\pgfcalendarendiso}{%
+          \ifnum\gtt at calendar@slots=0\relax\else%
+            \gantttitle{%
+              \expandafter\@gtt at getdecade\pgfcalendarcurrentyear%
+              0s%
+            }{\the\gtt at calendar@slots}%
+          \fi%
+        }{}%
+      }%
+    \fi%
+    \endgroup%
+    \gtt at calendar@eoltrue%
+  },%
+%    \end{macrocode}
+% Line type |year| draws years.
+%    \begin{macrocode}
   calendar/year/.code={%
     \ifgtt at calendar@eol\ganttnewline\fi%
     \begingroup%
     \gtt at calendar@slots=1\relax%
-    \ifgtt at compresscalendar%
+    \ifgtt at timeslotunit@year%
       \pgfcalendar{}{\gtt at calendar@startdate}{\gtt at calendar@enddate}{%
         \ifdate{equals=12-31}{%
+          \gantttitle{\pgfcalendarcurrentyear}{1}%
+          \gtt at calendar@slots=1\relax%
+        }{
+          \advance\gtt at calendar@slots by1\relax%
+        }%
+        \ifdate{equals=\pgfcalendarendiso}{%
+          \ifnum\gtt at calendar@slots=1\relax\else%
+            \gantttitle{\pgfcalendarcurrentyear}{1}%
+          \fi%
+        }{}%
+      }%
+    \fi%
+    \ifgtt at timeslotunit@month%
+      \pgfcalendar{}{\gtt at calendar@startdate}{\gtt at calendar@enddate}{%
+        \ifdate{equals=12-31}{%
           \gantttitle{\pgfcalendarcurrentyear}{\the\gtt at calendar@slots}%
           \gtt at calendar@slots=1\relax%
         }{%
@@ -3724,7 +4084,8 @@
           }%
         }{}%
       }%
-    \else%
+    \fi%
+    \ifgtt at timeslotunit@day%
       \pgfcalendar{}{\gtt at calendar@startdate}{\gtt at calendar@enddate}{%
         \ifdate{equals=12-31}{%
           \gantttitle{\pgfcalendarcurrentyear}{\the\gtt at calendar@slots}%
@@ -3755,7 +4116,8 @@
         \gantttitle{%
           \csname pgfcalendarmonth#1\endcsname{\pgfcalendarcurrentmonth}%
         }{%
-          \ifgtt at compresscalendar1\else\the\gtt at calendar@slots\fi%
+          \ifgtt at timeslotunit@month1\fi%
+          \ifgtt at timeslotunit@day\the\gtt at calendar@slots\fi%
         }%
         \gtt at calendar@slots=1\relax%
       }{%
@@ -3767,7 +4129,8 @@
           \gantttitle{%
             \csname pgfcalendarmonth#1\endcsname{\pgfcalendarcurrentmonth}%
           }{%
-            \ifgtt at compresscalendar1\else\the\gtt at calendar@slots\fi%
+            \ifgtt at timeslotunit@month1\fi%
+            \ifgtt at timeslotunit@day\the\gtt at calendar@slots\fi%
           }%
         \fi%
       }{}%
@@ -4110,7 +4473,7 @@
 % |\newganttchartelement| checks whether it was invoked in the starred or nonstarred form and executes |\@newganttchartelement at one| or |\@newganttchartelement at two|, respectively.
 %    \begin{macrocode}
 \def\newganttchartelement{%
-  \@ifstar\@newganttchartelement at one\@newganttchartelement at two%
+  \@gtt at ifstar\@newganttchartelement at one\@newganttchartelement at two%
 }
 
 %    \end{macrocode}
@@ -5036,4 +5399,4 @@
 %</pgfgantt>
 % \fi
 % \Finale
-\endinput
\ No newline at end of file
+\endinput

Modified: trunk/Master/texmf-dist/source/latex/pgfgantt/pgfgantt.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/pgfgantt/pgfgantt.ins	2018-01-10 21:44:36 UTC (rev 46279)
+++ trunk/Master/texmf-dist/source/latex/pgfgantt/pgfgantt.ins	2018-01-10 21:45:07 UTC (rev 46280)
@@ -1,14 +1,14 @@
 %% pgfgantt.ins
 %%
-%% Copyright (C) 2013 by Wolfgang Skala
+%% Copyright (C) 2083 by Wolfgang Skala
 %%
 %% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
+%% conditions of the LaTeX Project Public License, either version 1.3c
 %% 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.
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008/05/04 or later.
 %%
 %% This work has the LPPL maintenance status `maintained'.
 %%
@@ -24,15 +24,15 @@
 
 \preamble
 
-Copyright (C) 2013 by Wolfgang Skala
+Copyright (C) 2018 by Wolfgang Skala
 
 This work may be distributed and/or modified under the
-conditions of the LaTeX Project Public License, either version 1.3
+conditions of the LaTeX Project Public License, either version 1.3c
 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.
+and version 1.3c or later is part of all distributions of LaTeX
+version 2008/05/04 or later.
 
 \endpreamble
 

Modified: trunk/Master/texmf-dist/tex/latex/pgfgantt/pgfgantt.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pgfgantt/pgfgantt.sty	2018-01-10 21:44:36 UTC (rev 46279)
+++ trunk/Master/texmf-dist/tex/latex/pgfgantt/pgfgantt.sty	2018-01-10 21:45:07 UTC (rev 46280)
@@ -6,17 +6,17 @@
 %%
 %% pgfgantt.dtx  (with options: `pgfgantt')
 %% 
-%% Copyright (C) 2013 by Wolfgang Skala
+%% Copyright (C) 2018 by Wolfgang Skala
 %% 
 %% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
+%% conditions of the LaTeX Project Public License, either version 1.3c
 %% 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.
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008/05/04 or later.
 %% 
-\ProvidesPackage{pgfgantt}[2013/06/01 v4.0 Draw Gantt diagrams with TikZ]
+\ProvidesPackage{pgfgantt}[2018/01/10 v5.0 Draw Gantt diagrams with TikZ]
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \RequirePackage{tikz}
 \usetikzlibrary{%
@@ -25,6 +25,7 @@
 }
 \RequirePackage{pgfcalendar}
 
+\def\@gtt at ifstar#1{\kernel at ifnextchar*{\@firstoftwo{#1}}}
 \def\ganttset#1{\pgfqkeys{/pgfgantt}{#1}}
 \def\@gtt at keydef#1#2{%
   \pgfkeyssetvalue{/pgfgantt/#1}{#2}%
@@ -77,7 +78,7 @@
 }
 
 \def\gtt at hgrid@analyze{%
-  \@ifstar{\gtt at hgrid@draw}{\gtt at hgrid@draw1}%
+  \@gtt at ifstar{\gtt at hgrid@draw}{\gtt at hgrid@draw1}%
 }
 
 \def\gtt at hgrid@draw#1#2\relax{%
@@ -125,7 +126,7 @@
 }
 
 \def\gtt at vgrid@analyze{%
-  \@ifstar{\gtt at vgrid@draw}{\gtt at vgrid@draw1}%
+  \@gtt at ifstar{\gtt at vgrid@draw}{\gtt at vgrid@draw1}%
 }
 
 \def\gtt at vgrid@draw#1#2\relax{%
@@ -146,7 +147,11 @@
 \newcommand\gtt at juliantotimeslot[2]{%
   \begingroup%
   \@tempcnta=#1\relax%
-  \ifgtt at compresscalendar%
+  \ifgtt at timeslotunit@day%
+    \advance\@tempcnta by-\gtt at startjulian\relax%
+    \advance\@tempcnta by1\relax%
+  \fi%
+  \ifgtt at timeslotunit@month%
     \pgfcalendarjuliantodate{\@tempcnta}{\@tempa}{\@tempb}{\@tempc}%
     \@tempcnta=\@tempa\relax%
     \advance\@tempcnta by-\gtt at startyear\relax%
@@ -154,8 +159,11 @@
     \advance\@tempcnta by\@tempb\relax%
     \advance\@tempcnta by-\gtt at startmonth\relax%
     \advance\@tempcnta by1\relax%
-  \else%
-    \advance\@tempcnta by-\gtt at startjulian\relax%
+  \fi%
+  \ifgtt at timeslotunit@year%
+    \pgfcalendarjuliantodate{\@tempcnta}{\@tempa}{\@tempb}{\@tempc}%
+    \@tempcnta=\@tempa\relax%
+    \advance\@tempcnta by-\gtt at startyear\relax%
     \advance\@tempcnta by1\relax%
   \fi%
   #2=\@tempcnta\relax%
@@ -183,6 +191,10 @@
   \pgfcalendardatetojulian{#1-01}{#2}%
 }
 
+\newgantttimeslotformat{isodate-year}{%
+  \pgfcalendardatetojulian{#1-01-01}{#2}%
+}
+
 \newcommand\gtt at tsf@getdmy[1]{%
   \edef\local at firstarg{#1}%
   \def\local at decompose##1.##2.##3\relax{%
@@ -271,6 +283,7 @@
 \@gtt at keydef{y unit title}{1cm}
 \@gtt at keydef{y unit chart}{1cm}
 \@gtt at stylekeydef{canvas}{shape=rectangle, draw, fill=white}
+\@gtt at keydef{expand chart}{none}
 \@gtt at keydef{today}{none}
 \@gtt at keydef{today offset}{1}
 \@gtt at stylekeydef{today rule}{dashed, line width=1pt}
@@ -292,6 +305,10 @@
 \newcount\gtt at today@slot
 \newcount\gtt at startjulian
 \newcount\gtt at endjulian
+\newcount\gtt at chartid
+\def\gtt at chartextrasize#1#2{%
+  \global\@namedef{@gtt at chart@#1 at extrasize}{#2}%
+}
 \newenvironment{ganttchart}[3][]{%
   \ganttset{#1}%
   \gtt at tsstojulian{#2}{\gtt at startjulian}%
@@ -314,6 +331,20 @@
   \global\gtt at currentline=0\relax%
   \global\gtt at lasttitleline=0\relax%
   \global\gtt at lasttitleslot=0\relax%
+  \def\@tempa{none}%
+  \edef\@tempb{\ganttvalueof{expand chart}}%
+  \ifx\@tempa\@tempb\else%
+    \@ifundefined{@gtt at chart@\the\gtt at chartid @extrasize}{%
+      \@gtt at PackageWarning{Gantt chart expansion may have changed.
+                           Rerun to get expansion right}%
+    }{%
+      \pgfmathparse{(\ganttvalueof{expand chart}%
+                     - \@nameuse{@gtt at chart@\the\gtt at chartid @extrasize})%
+                    / \gtt at chartwidth}%
+      \edef\gtt at expanded@xunit{\pgfmathresult pt}%
+      \ganttset{x unit=\gtt at expanded@xunit}%
+    }%
+  \fi%
   \@ifundefined{useasboundingbox}%
     {\gtt at tikzpicturefalse\begin{tikzpicture}}%
     {\gtt at tikzpicturetrue}%
@@ -383,6 +414,14 @@
         node [/pgfgantt/today label node] {\ganttvalueof{today label}};%
     \fi%
   \end{scope}%
+  \pgfextractx{\@tempdima}{%
+    \pgfpointdiff{\pgfpointanchor{current bounding box}{south west}}%
+                 {\pgfpointanchor{current bounding box}{north east}}%
+  }%
+  \pgfmathparse{\@tempdima -\ganttvalueof{x unit} * \gtt at chartwidth}%
+  \protected at write\@auxout{}{%
+    \string\gtt at chartextrasize{\the\gtt at chartid}{\pgfmathresult pt}}%
+  \global\advance\gtt at chartid by1\relax%
   \ifgtt at tikzpicture\else\end{tikzpicture}\fi%
 }
 
@@ -409,6 +448,38 @@
   \endgroup%
 }
 
+\@gtt at keydef{vrule offset}{1}
+\@gtt at stylekeydef{vrule}{dashed, line width=1pt}
+\@gtt at keydef{vrule label font}{\normalfont}
+\@gtt at stylekeydef{vrule label node}{%
+  anchor=north, font=\ganttvalueof{vrule label font}%
+}
+
+\newcount\gtt at vrule@slot
+
+\newcommand\ganttvrule[3][]{%
+  \begingroup
+  \ganttset{#1}
+  \gtt at tsstojulian{#3}{\gtt at vrule@slot}%
+  \gtt at juliantotimeslot{\gtt at vrule@slot}{\gtt at vrule@slot}%
+  \pgfmathsetmacro\y at upper{%
+    \gtt at lasttitleline * \ganttvalueof{y unit title}%
+  }%
+  \pgfmathsetmacro\y at lower{%
+    \gtt at lasttitleline * \ganttvalueof{y unit title}%
+    + (\gtt at currentline - \gtt at lasttitleline - 1)%
+    * \ganttvalueof{y unit chart}%
+  }%
+  \pgfmathsetmacro\x at mid{%
+    (\gtt at vrule@slot - 1 + \ganttvalueof{vrule offset})%
+    * \ganttvalueof{x unit}%
+  }%
+  \draw [/pgfgantt/vrule]
+    (\x at mid pt, \y at upper pt) -- (\x at mid pt, \y at lower pt)
+    node [/pgfgantt/vrule label node] {#2};%
+  \endgroup
+}
+
 \@gtt at stylekeydef{title}{shape=rectangle, inner sep=0pt, draw, fill=white}
 \@gtt at keydef{title label font}{\small}
 \@gtt at stylekeydef{title label node}{%
@@ -415,6 +486,10 @@
   anchor=center, font=\ganttvalueof{title label font}%
 }
 \ganttset{%
+  title label text/.code={%
+    \def\gtt at titlelabeltext##1{#1}%
+  },%
+  title label text=\strut#1,%
   title list options/.code={%
     \def\gtt at titlelistoptions{[#1]}%
   },%
@@ -430,10 +505,27 @@
   include title in canvas
 }
 \@gtt at keydef{calendar week text}{Week~\currentweek}
-\newif\ifgtt at compresscalendar
+\newif\ifgtt at timeslotunit@day
+\newif\ifgtt at timeslotunit@month
+\newif\ifgtt at timeslotunit@year
 \ganttset{%
-  compress calendar/.is if=gtt at compresscalendar,%
-  compress calendar=false%
+  time slot unit/.is choice,
+  time slot unit/day/.code={%
+    \gtt at timeslotunit@daytrue%
+    \gtt at timeslotunit@monthfalse%
+    \gtt at timeslotunit@yearfalse%
+  },%
+  time slot unit/month/.code={%
+    \gtt at timeslotunit@dayfalse%
+    \gtt at timeslotunit@monthtrue%
+    \gtt at timeslotunit@yearfalse%
+  },%
+  time slot unit/year/.code={%
+    \gtt at timeslotunit@dayfalse%
+    \gtt at timeslotunit@monthfalse%
+    \gtt at timeslotunit@yeartrue%
+  },%
+  time slot unit=day
 }
 
 \newcommand\gantttitle[3][]{%
@@ -470,7 +562,7 @@
   \path (\x at mid pt, \y at mid pt)
     node [/pgfgantt/title, minimum width=\x at size pt,
           minimum height=\y at size pt] {}
-    node [/pgfgantt/title label node] {#2};%
+    node [/pgfgantt/title label node] {\gtt at titlelabeltext{#2}};%
   \global\advance\gtt at lasttitleslot by#3\relax%
   \endgroup%
 }
@@ -484,7 +576,7 @@
 
 \newif\ifgtt at titlecalendarstar
 \newcommand\gantttitlecalendar{%
-  \@ifstar%
+  \@gtt at ifstar%
     {\gtt at titlecalendarstartrue\@gantttitlecalendar}%
     {\gtt at titlecalendarstarfalse\@gantttitlecalendar}%
 }
@@ -520,14 +612,81 @@
 \newcount\gtt at calendar@slots
 \newcount\gtt at calendar@weeknumber
 \newcount\gtt at calendar@startofweek
+\def\@gtt at getfourthdigit#1#2#3#4{#4}
+\def\@gtt at getdecade#1#2#3#4{#1#2#3}
+\pgfkeys{%
+  /pgf/calendar/end of decade/.code={
+    \begingroup
+    \pgfcalendardatetojulian{#1}{\@tempcnta}
+    \pgfcalendarjuliantodate{\@tempcnta}{\@tempa}{\@tempb}{\@tempc}
+    \edef\endofdecade{\expandafter\@gtt at getfourthdigit\@tempa}
+    \edef\querydecade{\expandafter\@gtt at getfourthdigit\pgfcalendarifdateyear}
+    \ifnum\endofdecade=\querydecade\relax%
+      \ifnum\pgfcalendarifdatemonth=\@tempb\relax%
+        \ifnum\pgfcalendarifdateday=\@tempc\relax%
+          \global\pgfcalendarmatchestrue%
+        \fi%
+      \fi%
+    \fi%
+    \endgroup
+  }%
+}
+
 \ganttset{%
+  calendar/decade/.code={%
+    \ifgtt at calendar@eol\ganttnewline\fi%
+    \begingroup%
+    \gtt at calendar@slots=1\relax%
+    \ifgtt at timeslotunit@year%
+      \pgfcalendar{}{\gtt at calendar@startdate}{\gtt at calendar@enddate}{%
+        \ifdate{end of decade=2009-12-31}{%
+          \gantttitle{%
+            \expandafter\@gtt at getdecade\pgfcalendarcurrentyear%
+            0s%
+          }{\the\gtt at calendar@slots}%
+          \gtt at calendar@slots=0\relax%
+        }{
+          \ifdate{equals=01-01}{%
+            \ifnum\pgfcalendarcurrentjulian>\pgfcalendarbeginjulian\relax%
+              \advance\gtt at calendar@slots by1\relax%
+            \fi
+          }{}%
+        }%
+        \ifdate{equals=\pgfcalendarendiso}{%
+          \ifnum\gtt at calendar@slots=0\relax\else%
+            \gantttitle{%
+              \expandafter\@gtt at getdecade\pgfcalendarcurrentyear%
+              0s%
+            }{\the\gtt at calendar@slots}%
+          \fi%
+        }{}%
+      }%
+    \fi%
+    \endgroup%
+    \gtt at calendar@eoltrue%
+  },%
   calendar/year/.code={%
     \ifgtt at calendar@eol\ganttnewline\fi%
     \begingroup%
     \gtt at calendar@slots=1\relax%
-    \ifgtt at compresscalendar%
+    \ifgtt at timeslotunit@year%
       \pgfcalendar{}{\gtt at calendar@startdate}{\gtt at calendar@enddate}{%
         \ifdate{equals=12-31}{%
+          \gantttitle{\pgfcalendarcurrentyear}{1}%
+          \gtt at calendar@slots=1\relax%
+        }{
+          \advance\gtt at calendar@slots by1\relax%
+        }%
+        \ifdate{equals=\pgfcalendarendiso}{%
+          \ifnum\gtt at calendar@slots=1\relax\else%
+            \gantttitle{\pgfcalendarcurrentyear}{1}%
+          \fi%
+        }{}%
+      }%
+    \fi%
+    \ifgtt at timeslotunit@month%
+      \pgfcalendar{}{\gtt at calendar@startdate}{\gtt at calendar@enddate}{%
+        \ifdate{equals=12-31}{%
           \gantttitle{\pgfcalendarcurrentyear}{\the\gtt at calendar@slots}%
           \gtt at calendar@slots=1\relax%
         }{%
@@ -544,7 +703,8 @@
           }%
         }{}%
       }%
-    \else%
+    \fi%
+    \ifgtt at timeslotunit@day%
       \pgfcalendar{}{\gtt at calendar@startdate}{\gtt at calendar@enddate}{%
         \ifdate{equals=12-31}{%
           \gantttitle{\pgfcalendarcurrentyear}{\the\gtt at calendar@slots}%
@@ -572,7 +732,8 @@
         \gantttitle{%
           \csname pgfcalendarmonth#1\endcsname{\pgfcalendarcurrentmonth}%
         }{%
-          \ifgtt at compresscalendar1\else\the\gtt at calendar@slots\fi%
+          \ifgtt at timeslotunit@month1\fi%
+          \ifgtt at timeslotunit@day\the\gtt at calendar@slots\fi%
         }%
         \gtt at calendar@slots=1\relax%
       }{%
@@ -584,7 +745,8 @@
           \gantttitle{%
             \csname pgfcalendarmonth#1\endcsname{\pgfcalendarcurrentmonth}%
           }{%
-            \ifgtt at compresscalendar1\else\the\gtt at calendar@slots\fi%
+            \ifgtt at timeslotunit@month1\fi%
+            \ifgtt at timeslotunit@day\the\gtt at calendar@slots\fi%
           }%
         \fi%
       }{}%
@@ -832,7 +994,7 @@
 }
 
 \def\newganttchartelement{%
-  \@ifstar\@newganttchartelement at one\@newganttchartelement at two%
+  \@gtt at ifstar\@newganttchartelement at one\@newganttchartelement at two%
 }
 
 \newcommand\@newganttchartelement at one[1]{%



More information about the tex-live-commits mailing list