summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/latex/pgfgantt/README4
-rw-r--r--Master/texmf-dist/doc/latex/pgfgantt/pgfgantt.pdfbin910543 -> 941473 bytes
-rw-r--r--Master/texmf-dist/source/latex/pgfgantt/pgfgantt.dtx465
-rw-r--r--Master/texmf-dist/source/latex/pgfgantt/pgfgantt.ins16
-rw-r--r--Master/texmf-dist/tex/latex/pgfgantt/pgfgantt.sty202
5 files changed, 606 insertions, 81 deletions
diff --git a/Master/texmf-dist/doc/latex/pgfgantt/README b/Master/texmf-dist/doc/latex/pgfgantt/README
index 39c93dd3fff..b46f25054cd 100644
--- a/Master/texmf-dist/doc/latex/pgfgantt/README
+++ b/Master/texmf-dist/doc/latex/pgfgantt/README
@@ -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 @@ Installation: Run pgfgantt.ins through LaTeX and follow the instructions.
--
Wolfgang Skala
-1st June 2013 \ No newline at end of file
+10th January 2018
diff --git a/Master/texmf-dist/doc/latex/pgfgantt/pgfgantt.pdf b/Master/texmf-dist/doc/latex/pgfgantt/pgfgantt.pdf
index 7e75e25d068..5536734a4cb 100644
--- a/Master/texmf-dist/doc/latex/pgfgantt/pgfgantt.pdf
+++ b/Master/texmf-dist/doc/latex/pgfgantt/pgfgantt.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/pgfgantt/pgfgantt.dtx b/Master/texmf-dist/source/latex/pgfgantt/pgfgantt.dtx
index 2023be04d64..7bb4d521388 100644
--- a/Master/texmf-dist/source/latex/pgfgantt/pgfgantt.dtx
+++ b/Master/texmf-dist/source/latex/pgfgantt/pgfgantt.dtx
@@ -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@process,\pgf@x,\pgf@y,\pgf@xa,\pgf@xb,\pgf@xc,\pgf@ya,\pgf@yb,\pgf@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@ifnextchar,\let,\multiply,\newcommand,\newcount,\newenvironment,\newif,\node,\normalcolor,\normalfont,\normalsize,\northeast,\outernortheast,\PackageError,\PackageWarning,\path,\pgf@process,\pgf@x,\pgf@y,\pgf@xa,\pgf@xb,\pgf@xc,\pgf@ya,\pgf@yb,\pgf@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@write,\relax,\RequirePackage,\savedanchor,\scriptsize,\setcounter,\small,\southwest,\stepcounter,\string,\strut,\t,\the,\tikz@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@sbg.ac.at}}}
+% \author{Wolfgang Skala\thanks{Department of Biosciences, University of Salzburg, Austria; \texttt{Wolfgang.Skala@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,16 +1101,16 @@
% \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}[
% 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,14 +1196,16 @@
%
% \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}[
% 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@ifstar}
+% |\@gtt@ifstar| reimplements the \LaTeXe\ kernel's |\@ifstar| macro.
+% This makes it robust to \pack{amsgen}'s reimplementation of
+% |\@ifstar|.
+% \begin{macrocode}
+\def\@gtt@ifstar#1{\kernel@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@hgrid@analyze| adds the multiplier |1| to the input stream.
% \begin{macrocode}
\def\gtt@hgrid@analyze{%
- \@ifstar{\gtt@hgrid@draw}{\gtt@hgrid@draw1}%
+ \@gtt@ifstar{\gtt@hgrid@draw}{\gtt@hgrid@draw1}%
}
% \end{macrocode}
@@ -3043,7 +3179,7 @@
}
\def\gtt@vgrid@analyze{%
- \@ifstar{\gtt@vgrid@draw}{\gtt@vgrid@draw1}%
+ \@gtt@ifstar{\gtt@vgrid@draw}{\gtt@vgrid@draw1}%
}
\def\gtt@vgrid@draw#1#2\relax{%
@@ -3078,12 +3214,16 @@
% \end{macrocode}
% \end{intmacro}
% \begin{intmacro}{\gtt@juliantotimeslot}
-% |\gtt@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@startyear|, |\gtt@startmonth| and |\gtt@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@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@startyear|, |\gtt@startmonth| and |\gtt@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@juliantotimeslot[2]{%
\begingroup%
\@tempcnta=#1\relax%
- \ifgtt@compresscalendar%
+ \ifgtt@timeslotunit@day%
+ \advance\@tempcnta by-\gtt@startjulian\relax%
+ \advance\@tempcnta by1\relax%
+ \fi%
+ \ifgtt@timeslotunit@month%
\pgfcalendarjuliantodate{\@tempcnta}{\@tempa}{\@tempb}{\@tempc}%
\@tempcnta=\@tempa\relax%
\advance\@tempcnta by-\gtt@startyear\relax%
@@ -3091,8 +3231,11 @@
\advance\@tempcnta by\@tempb\relax%
\advance\@tempcnta by-\gtt@startmonth\relax%
\advance\@tempcnta by1\relax%
- \else%
- \advance\@tempcnta by-\gtt@startjulian\relax%
+ \fi%
+ \ifgtt@timeslotunit@year%
+ \pgfcalendarjuliantodate{\@tempcnta}{\@tempa}{\@tempb}{\@tempc}%
+ \@tempcnta=\@tempa\relax%
+ \advance\@tempcnta by-\gtt@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@tsf@getdmy}
% |\gtt@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@day|, |\local@month| and |\local@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@stylekeydef{canvas}{shape=rectangle, draw, fill=white}
+\@gtt@keydef{expand chart}{none}
\@gtt@keydef{today}{none}
\@gtt@keydef{today offset}{1}
\@gtt@stylekeydef{today rule}{dashed, line width=1pt}
@@ -3286,6 +3435,7 @@
% \end{option}
% \end{option}
% \end{option}
+% \end{option}
% \begin{intmacro}{\ifgtt@newlineshortcut}
% \begin{option}{newline shortcut}
% Boolean key that determines if |\\| is equivalent to |\ganttnewline|.
@@ -3306,7 +3456,8 @@
% \begin{intmacro}{\gtt@today@slot}
% \begin{intmacro}{\gtt@startjulian}
% \begin{intmacro}{\gtt@endjulian}
-% The boolean |\ifgtt@tikzpicture| is true if a Gantt chart appears within a \TikZ\ picture. |\ifgtt@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@lasttitleslot| corresponds to the $x$-coordinate of its right border. |\gtt@elementid| enumerates the automatic names of chart elements. |\gtt@today@slot| is the time slot of the today rule. |\gtt@startjulian| and |\gtt@endjulian| contain the Julian dates corresponding to the first and last time slot, respectively.
+% \begin{intmacro}{\gtt@chartid}
+% The boolean |\ifgtt@tikzpicture| is true if a Gantt chart appears within a \TikZ\ picture. |\ifgtt@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@lasttitleslot| corresponds to the $x$-coordinate of its right border. |\gtt@elementid| enumerates the automatic names of chart elements. |\gtt@today@slot| is the time slot of the today rule. |\gtt@startjulian| and |\gtt@endjulian| contain the Julian dates corresponding to the first and last time slot, respectively. |\gtt@chartid| assigns a consecutive number to each chart.
% \begin{macrocode}
\newif\ifgtt@tikzpicture
\newif\ifgtt@intitle
@@ -3315,6 +3466,7 @@
\newcount\gtt@today@slot
\newcount\gtt@startjulian
\newcount\gtt@endjulian
+\newcount\gtt@chartid
% \end{macrocode}
% \end{intmacro}
% \end{intmacro}
@@ -3323,6 +3475,15 @@
% \end{intmacro}
% \end{intmacro}
% \end{intmacro}
+% \end{intmacro}
+% \begin{intmacro}{\gtt@chartextrasize}
+% Each |ganttchart| environment writes a |\gtt@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@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@chartextrasize#1#2{%
+ \global\@namedef{@gtt@chart@#1@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@lasttitleline=0\relax%
\global\gtt@lasttitleslot=0\relax%
% \end{macrocode}
+% \begin{intmacro}{\gtt@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@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@chart@\the\gtt@chartid @extrasize}{%
+ \@gtt@PackageWarning{Gantt chart expansion may have changed.
+ Rerun to get expansion right}%
+ }{%
+ \pgfmathparse{(\ganttvalueof{expand chart}%
+ - \@nameuse{@gtt@chart@\the\gtt@chartid @extrasize})%
+ / \gtt@chartwidth}%
+ \edef\gtt@expanded@xunit{\pgfmathresult pt}%
+ \ganttset{x unit=\gtt@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@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@chartwidth}%
+ \protected@write\@auxout{}{%
+ \string\gtt@chartextrasize{\the\gtt@chartid}{\pgfmathresult pt}}%
+% \end{macrocode}
+% Increase the chart counter.
+% \begin{macrocode}
+ \global\advance\gtt@chartid by1\relax%
+% \end{macrocode}
% At the end of a |ganttchart|, we also close the |tikzpicture| if we started it implicitly.
% \begin{macrocode}
\ifgtt@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@keydef{vrule offset}{1}
+\@gtt@stylekeydef{vrule}{dashed, line width=1pt}
+\@gtt@keydef{vrule label font}{\normalfont}
+\@gtt@stylekeydef{vrule label node}{%
+ anchor=north, font=\ganttvalueof{vrule label font}%
+}
+
+% \end{macrocode}
+% \end{option}
+% \end{option}
+% \end{option}
+% \end{option}
+% \begin{intmacro}{\gtt@vrule@slot}
+% A count for storing the vrule time slot.
+% \begin{macrocode}
+\newcount\gtt@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@tsstojulian{#3}{\gtt@vrule@slot}%
+ \gtt@juliantotimeslot{\gtt@vrule@slot}{\gtt@vrule@slot}%
+ \pgfmathsetmacro\y@upper{%
+ \gtt@lasttitleline * \ganttvalueof{y unit title}%
+ }%
+ \pgfmathsetmacro\y@lower{%
+ \gtt@lasttitleline * \ganttvalueof{y unit title}%
+ + (\gtt@currentline - \gtt@lasttitleline - 1)%
+ * \ganttvalueof{y unit chart}%
+ }%
+ \pgfmathsetmacro\x@mid{%
+ (\gtt@vrule@slot - 1 + \ganttvalueof{vrule offset})%
+ * \ganttvalueof{x unit}%
+ }%
+ \draw [/pgfgantt/vrule]
+ (\x@mid pt, \y@upper pt) -- (\x@mid pt, \y@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@titlelabeltext}
% \begin{option}{title list options}
% \begin{intmacro}{\gtt@titlelistoptions}
% \begin{option}{title left shift}
@@ -3511,7 +3764,7 @@
% \begin{option}{title height}
% \begin{option}{include title in canvas}
% \begin{intmacro}{\ifgtt@includetitle}
-% Keys that influence title elements. Note that |\@gtt@keydef| cannot define \opt{title list options}, since |\@gtt@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@titlelabeltext|. Note that |\@gtt@keydef| cannot define \opt{title list options}, since |\@gtt@titlelistoptions| is expanded after a |\foreach| statement, where |\ganttvalueof| will not work.
% \begin{macrocode}
\@gtt@stylekeydef{title}{shape=rectangle, inner sep=0pt, draw, fill=white}
\@gtt@keydef{title label font}{\small}
@@ -3519,6 +3772,10 @@
anchor=center, font=\ganttvalueof{title label font}%
}
\ganttset{%
+ title label text/.code={%
+ \def\gtt@titlelabeltext##1{#1}%
+ },%
+ title label text=\strut#1,%
title list options/.code={%
\def\gtt@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@compresscalendar}
+% \begin{option}{time slot unit}
+% \begin{intmacro}{\ifgtt@timeslotunit@day}
+% \begin{intmacro}{\ifgtt@timeslotunit@month}
+% \begin{intmacro}{\ifgtt@timeslotunit@year}
% Keys for title calendars.
% \begin{macrocode}
\@gtt@keydef{calendar week text}{Week~\currentweek}
-\newif\ifgtt@compresscalendar
+\newif\ifgtt@timeslotunit@day
+\newif\ifgtt@timeslotunit@month
+\newif\ifgtt@timeslotunit@year
\ganttset{%
- compress calendar/.is if=gtt@compresscalendar,%
- compress calendar=false%
+ time slot unit/.is choice,
+ time slot unit/day/.code={%
+ \gtt@timeslotunit@daytrue%
+ \gtt@timeslotunit@monthfalse%
+ \gtt@timeslotunit@yearfalse%
+ },%
+ time slot unit/month/.code={%
+ \gtt@timeslotunit@dayfalse%
+ \gtt@timeslotunit@monthtrue%
+ \gtt@timeslotunit@yearfalse%
+ },%
+ time slot unit/year/.code={%
+ \gtt@timeslotunit@dayfalse%
+ \gtt@timeslotunit@monthfalse%
+ \gtt@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@mid pt, \y@mid pt)
node [/pgfgantt/title, minimum width=\x@size pt,
minimum height=\y@size pt] {}
- node [/pgfgantt/title label node] {#2};%
+ node [/pgfgantt/title label node] {\gtt@titlelabeltext{#2}};%
\global\advance\gtt@lasttitleslot by#3\relax%
\endgroup%
}
@@ -3628,7 +3908,7 @@
% \begin{macrocode}
\newif\ifgtt@titlecalendarstar
\newcommand\gantttitlecalendar{%
- \@ifstar%
+ \@gtt@ifstar%
{\gtt@titlecalendarstartrue\@gantttitlecalendar}%
{\gtt@titlecalendarstarfalse\@gantttitlecalendar}%
}
@@ -3698,14 +3978,94 @@
% \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@getfourthdigit}
+% \begin{intmacro}{\@gtt@getdecade}
+% |\@gtt@getfourthdigit| returns the fourth digit of a year, while |\@gtt@getdecade| returns the first three digits of a year.
+% \begin{macrocode}
+\def\@gtt@getfourthdigit#1#2#3#4{#4}
+\def\@gtt@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@getfourthdigit\@tempa}
+ \edef\querydecade{\expandafter\@gtt@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@calendar@eol\ganttnewline\fi%
+ \begingroup%
+ \gtt@calendar@slots=1\relax%
+ \ifgtt@timeslotunit@year%
+ \pgfcalendar{}{\gtt@calendar@startdate}{\gtt@calendar@enddate}{%
+ \ifdate{end of decade=2009-12-31}{%
+ \gantttitle{%
+ \expandafter\@gtt@getdecade\pgfcalendarcurrentyear%
+ 0s%
+ }{\the\gtt@calendar@slots}%
+ \gtt@calendar@slots=0\relax%
+ }{
+ \ifdate{equals=01-01}{%
+ \ifnum\pgfcalendarcurrentjulian>\pgfcalendarbeginjulian\relax%
+ \advance\gtt@calendar@slots by1\relax%
+ \fi
+ }{}%
+ }%
+ \ifdate{equals=\pgfcalendarendiso}{%
+ \ifnum\gtt@calendar@slots=0\relax\else%
+ \gantttitle{%
+ \expandafter\@gtt@getdecade\pgfcalendarcurrentyear%
+ 0s%
+ }{\the\gtt@calendar@slots}%
+ \fi%
+ }{}%
+ }%
+ \fi%
+ \endgroup%
+ \gtt@calendar@eoltrue%
+ },%
+% \end{macrocode}
+% Line type |year| draws years.
+% \begin{macrocode}
calendar/year/.code={%
\ifgtt@calendar@eol\ganttnewline\fi%
\begingroup%
\gtt@calendar@slots=1\relax%
- \ifgtt@compresscalendar%
+ \ifgtt@timeslotunit@year%
+ \pgfcalendar{}{\gtt@calendar@startdate}{\gtt@calendar@enddate}{%
+ \ifdate{equals=12-31}{%
+ \gantttitle{\pgfcalendarcurrentyear}{1}%
+ \gtt@calendar@slots=1\relax%
+ }{
+ \advance\gtt@calendar@slots by1\relax%
+ }%
+ \ifdate{equals=\pgfcalendarendiso}{%
+ \ifnum\gtt@calendar@slots=1\relax\else%
+ \gantttitle{\pgfcalendarcurrentyear}{1}%
+ \fi%
+ }{}%
+ }%
+ \fi%
+ \ifgtt@timeslotunit@month%
\pgfcalendar{}{\gtt@calendar@startdate}{\gtt@calendar@enddate}{%
\ifdate{equals=12-31}{%
\gantttitle{\pgfcalendarcurrentyear}{\the\gtt@calendar@slots}%
@@ -3724,7 +4084,8 @@
}%
}{}%
}%
- \else%
+ \fi%
+ \ifgtt@timeslotunit@day%
\pgfcalendar{}{\gtt@calendar@startdate}{\gtt@calendar@enddate}{%
\ifdate{equals=12-31}{%
\gantttitle{\pgfcalendarcurrentyear}{\the\gtt@calendar@slots}%
@@ -3755,7 +4116,8 @@
\gantttitle{%
\csname pgfcalendarmonth#1\endcsname{\pgfcalendarcurrentmonth}%
}{%
- \ifgtt@compresscalendar1\else\the\gtt@calendar@slots\fi%
+ \ifgtt@timeslotunit@month1\fi%
+ \ifgtt@timeslotunit@day\the\gtt@calendar@slots\fi%
}%
\gtt@calendar@slots=1\relax%
}{%
@@ -3767,7 +4129,8 @@
\gantttitle{%
\csname pgfcalendarmonth#1\endcsname{\pgfcalendarcurrentmonth}%
}{%
- \ifgtt@compresscalendar1\else\the\gtt@calendar@slots\fi%
+ \ifgtt@timeslotunit@month1\fi%
+ \ifgtt@timeslotunit@day\the\gtt@calendar@slots\fi%
}%
\fi%
}{}%
@@ -4110,7 +4473,7 @@
% |\newganttchartelement| checks whether it was invoked in the starred or nonstarred form and executes |\@newganttchartelement@one| or |\@newganttchartelement@two|, respectively.
% \begin{macrocode}
\def\newganttchartelement{%
- \@ifstar\@newganttchartelement@one\@newganttchartelement@two%
+ \@gtt@ifstar\@newganttchartelement@one\@newganttchartelement@two%
}
% \end{macrocode}
@@ -5036,4 +5399,4 @@
%</pgfgantt>
% \fi
% \Finale
-\endinput \ No newline at end of file
+\endinput
diff --git a/Master/texmf-dist/source/latex/pgfgantt/pgfgantt.ins b/Master/texmf-dist/source/latex/pgfgantt/pgfgantt.ins
index 71977ad0e93..6e4aa0dd2bd 100644
--- a/Master/texmf-dist/source/latex/pgfgantt/pgfgantt.ins
+++ b/Master/texmf-dist/source/latex/pgfgantt/pgfgantt.ins
@@ -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
diff --git a/Master/texmf-dist/tex/latex/pgfgantt/pgfgantt.sty b/Master/texmf-dist/tex/latex/pgfgantt/pgfgantt.sty
index d87a9a2f7b1..9bac4b1d48d 100644
--- a/Master/texmf-dist/tex/latex/pgfgantt/pgfgantt.sty
+++ b/Master/texmf-dist/tex/latex/pgfgantt/pgfgantt.sty
@@ -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@ifstar#1{\kernel@ifnextchar*{\@firstoftwo{#1}}}
\def\ganttset#1{\pgfqkeys{/pgfgantt}{#1}}
\def\@gtt@keydef#1#2{%
\pgfkeyssetvalue{/pgfgantt/#1}{#2}%
@@ -77,7 +78,7 @@
}
\def\gtt@hgrid@analyze{%
- \@ifstar{\gtt@hgrid@draw}{\gtt@hgrid@draw1}%
+ \@gtt@ifstar{\gtt@hgrid@draw}{\gtt@hgrid@draw1}%
}
\def\gtt@hgrid@draw#1#2\relax{%
@@ -125,7 +126,7 @@
}
\def\gtt@vgrid@analyze{%
- \@ifstar{\gtt@vgrid@draw}{\gtt@vgrid@draw1}%
+ \@gtt@ifstar{\gtt@vgrid@draw}{\gtt@vgrid@draw1}%
}
\def\gtt@vgrid@draw#1#2\relax{%
@@ -146,7 +147,11 @@
\newcommand\gtt@juliantotimeslot[2]{%
\begingroup%
\@tempcnta=#1\relax%
- \ifgtt@compresscalendar%
+ \ifgtt@timeslotunit@day%
+ \advance\@tempcnta by-\gtt@startjulian\relax%
+ \advance\@tempcnta by1\relax%
+ \fi%
+ \ifgtt@timeslotunit@month%
\pgfcalendarjuliantodate{\@tempcnta}{\@tempa}{\@tempb}{\@tempc}%
\@tempcnta=\@tempa\relax%
\advance\@tempcnta by-\gtt@startyear\relax%
@@ -154,8 +159,11 @@
\advance\@tempcnta by\@tempb\relax%
\advance\@tempcnta by-\gtt@startmonth\relax%
\advance\@tempcnta by1\relax%
- \else%
- \advance\@tempcnta by-\gtt@startjulian\relax%
+ \fi%
+ \ifgtt@timeslotunit@year%
+ \pgfcalendarjuliantodate{\@tempcnta}{\@tempa}{\@tempb}{\@tempc}%
+ \@tempcnta=\@tempa\relax%
+ \advance\@tempcnta by-\gtt@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@tsf@getdmy[1]{%
\edef\local@firstarg{#1}%
\def\local@decompose##1.##2.##3\relax{%
@@ -271,6 +283,7 @@
\@gtt@keydef{y unit title}{1cm}
\@gtt@keydef{y unit chart}{1cm}
\@gtt@stylekeydef{canvas}{shape=rectangle, draw, fill=white}
+\@gtt@keydef{expand chart}{none}
\@gtt@keydef{today}{none}
\@gtt@keydef{today offset}{1}
\@gtt@stylekeydef{today rule}{dashed, line width=1pt}
@@ -292,6 +305,10 @@
\newcount\gtt@today@slot
\newcount\gtt@startjulian
\newcount\gtt@endjulian
+\newcount\gtt@chartid
+\def\gtt@chartextrasize#1#2{%
+ \global\@namedef{@gtt@chart@#1@extrasize}{#2}%
+}
\newenvironment{ganttchart}[3][]{%
\ganttset{#1}%
\gtt@tsstojulian{#2}{\gtt@startjulian}%
@@ -314,6 +331,20 @@
\global\gtt@currentline=0\relax%
\global\gtt@lasttitleline=0\relax%
\global\gtt@lasttitleslot=0\relax%
+ \def\@tempa{none}%
+ \edef\@tempb{\ganttvalueof{expand chart}}%
+ \ifx\@tempa\@tempb\else%
+ \@ifundefined{@gtt@chart@\the\gtt@chartid @extrasize}{%
+ \@gtt@PackageWarning{Gantt chart expansion may have changed.
+ Rerun to get expansion right}%
+ }{%
+ \pgfmathparse{(\ganttvalueof{expand chart}%
+ - \@nameuse{@gtt@chart@\the\gtt@chartid @extrasize})%
+ / \gtt@chartwidth}%
+ \edef\gtt@expanded@xunit{\pgfmathresult pt}%
+ \ganttset{x unit=\gtt@expanded@xunit}%
+ }%
+ \fi%
\@ifundefined{useasboundingbox}%
{\gtt@tikzpicturefalse\begin{tikzpicture}}%
{\gtt@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@chartwidth}%
+ \protected@write\@auxout{}{%
+ \string\gtt@chartextrasize{\the\gtt@chartid}{\pgfmathresult pt}}%
+ \global\advance\gtt@chartid by1\relax%
\ifgtt@tikzpicture\else\end{tikzpicture}\fi%
}
@@ -409,12 +448,48 @@
\endgroup%
}
+\@gtt@keydef{vrule offset}{1}
+\@gtt@stylekeydef{vrule}{dashed, line width=1pt}
+\@gtt@keydef{vrule label font}{\normalfont}
+\@gtt@stylekeydef{vrule label node}{%
+ anchor=north, font=\ganttvalueof{vrule label font}%
+}
+
+\newcount\gtt@vrule@slot
+
+\newcommand\ganttvrule[3][]{%
+ \begingroup
+ \ganttset{#1}
+ \gtt@tsstojulian{#3}{\gtt@vrule@slot}%
+ \gtt@juliantotimeslot{\gtt@vrule@slot}{\gtt@vrule@slot}%
+ \pgfmathsetmacro\y@upper{%
+ \gtt@lasttitleline * \ganttvalueof{y unit title}%
+ }%
+ \pgfmathsetmacro\y@lower{%
+ \gtt@lasttitleline * \ganttvalueof{y unit title}%
+ + (\gtt@currentline - \gtt@lasttitleline - 1)%
+ * \ganttvalueof{y unit chart}%
+ }%
+ \pgfmathsetmacro\x@mid{%
+ (\gtt@vrule@slot - 1 + \ganttvalueof{vrule offset})%
+ * \ganttvalueof{x unit}%
+ }%
+ \draw [/pgfgantt/vrule]
+ (\x@mid pt, \y@upper pt) -- (\x@mid pt, \y@lower pt)
+ node [/pgfgantt/vrule label node] {#2};%
+ \endgroup
+}
+
\@gtt@stylekeydef{title}{shape=rectangle, inner sep=0pt, draw, fill=white}
\@gtt@keydef{title label font}{\small}
\@gtt@stylekeydef{title label node}{%
anchor=center, font=\ganttvalueof{title label font}%
}
\ganttset{%
+ title label text/.code={%
+ \def\gtt@titlelabeltext##1{#1}%
+ },%
+ title label text=\strut#1,%
title list options/.code={%
\def\gtt@titlelistoptions{[#1]}%
},%
@@ -430,10 +505,27 @@
include title in canvas
}
\@gtt@keydef{calendar week text}{Week~\currentweek}
-\newif\ifgtt@compresscalendar
+\newif\ifgtt@timeslotunit@day
+\newif\ifgtt@timeslotunit@month
+\newif\ifgtt@timeslotunit@year
\ganttset{%
- compress calendar/.is if=gtt@compresscalendar,%
- compress calendar=false%
+ time slot unit/.is choice,
+ time slot unit/day/.code={%
+ \gtt@timeslotunit@daytrue%
+ \gtt@timeslotunit@monthfalse%
+ \gtt@timeslotunit@yearfalse%
+ },%
+ time slot unit/month/.code={%
+ \gtt@timeslotunit@dayfalse%
+ \gtt@timeslotunit@monthtrue%
+ \gtt@timeslotunit@yearfalse%
+ },%
+ time slot unit/year/.code={%
+ \gtt@timeslotunit@dayfalse%
+ \gtt@timeslotunit@monthfalse%
+ \gtt@timeslotunit@yeartrue%
+ },%
+ time slot unit=day
}
\newcommand\gantttitle[3][]{%
@@ -470,7 +562,7 @@
\path (\x@mid pt, \y@mid pt)
node [/pgfgantt/title, minimum width=\x@size pt,
minimum height=\y@size pt] {}
- node [/pgfgantt/title label node] {#2};%
+ node [/pgfgantt/title label node] {\gtt@titlelabeltext{#2}};%
\global\advance\gtt@lasttitleslot by#3\relax%
\endgroup%
}
@@ -484,7 +576,7 @@
\newif\ifgtt@titlecalendarstar
\newcommand\gantttitlecalendar{%
- \@ifstar%
+ \@gtt@ifstar%
{\gtt@titlecalendarstartrue\@gantttitlecalendar}%
{\gtt@titlecalendarstarfalse\@gantttitlecalendar}%
}
@@ -520,12 +612,79 @@
\newcount\gtt@calendar@slots
\newcount\gtt@calendar@weeknumber
\newcount\gtt@calendar@startofweek
+\def\@gtt@getfourthdigit#1#2#3#4{#4}
+\def\@gtt@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@getfourthdigit\@tempa}
+ \edef\querydecade{\expandafter\@gtt@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@calendar@eol\ganttnewline\fi%
+ \begingroup%
+ \gtt@calendar@slots=1\relax%
+ \ifgtt@timeslotunit@year%
+ \pgfcalendar{}{\gtt@calendar@startdate}{\gtt@calendar@enddate}{%
+ \ifdate{end of decade=2009-12-31}{%
+ \gantttitle{%
+ \expandafter\@gtt@getdecade\pgfcalendarcurrentyear%
+ 0s%
+ }{\the\gtt@calendar@slots}%
+ \gtt@calendar@slots=0\relax%
+ }{
+ \ifdate{equals=01-01}{%
+ \ifnum\pgfcalendarcurrentjulian>\pgfcalendarbeginjulian\relax%
+ \advance\gtt@calendar@slots by1\relax%
+ \fi
+ }{}%
+ }%
+ \ifdate{equals=\pgfcalendarendiso}{%
+ \ifnum\gtt@calendar@slots=0\relax\else%
+ \gantttitle{%
+ \expandafter\@gtt@getdecade\pgfcalendarcurrentyear%
+ 0s%
+ }{\the\gtt@calendar@slots}%
+ \fi%
+ }{}%
+ }%
+ \fi%
+ \endgroup%
+ \gtt@calendar@eoltrue%
+ },%
calendar/year/.code={%
\ifgtt@calendar@eol\ganttnewline\fi%
\begingroup%
\gtt@calendar@slots=1\relax%
- \ifgtt@compresscalendar%
+ \ifgtt@timeslotunit@year%
+ \pgfcalendar{}{\gtt@calendar@startdate}{\gtt@calendar@enddate}{%
+ \ifdate{equals=12-31}{%
+ \gantttitle{\pgfcalendarcurrentyear}{1}%
+ \gtt@calendar@slots=1\relax%
+ }{
+ \advance\gtt@calendar@slots by1\relax%
+ }%
+ \ifdate{equals=\pgfcalendarendiso}{%
+ \ifnum\gtt@calendar@slots=1\relax\else%
+ \gantttitle{\pgfcalendarcurrentyear}{1}%
+ \fi%
+ }{}%
+ }%
+ \fi%
+ \ifgtt@timeslotunit@month%
\pgfcalendar{}{\gtt@calendar@startdate}{\gtt@calendar@enddate}{%
\ifdate{equals=12-31}{%
\gantttitle{\pgfcalendarcurrentyear}{\the\gtt@calendar@slots}%
@@ -544,7 +703,8 @@
}%
}{}%
}%
- \else%
+ \fi%
+ \ifgtt@timeslotunit@day%
\pgfcalendar{}{\gtt@calendar@startdate}{\gtt@calendar@enddate}{%
\ifdate{equals=12-31}{%
\gantttitle{\pgfcalendarcurrentyear}{\the\gtt@calendar@slots}%
@@ -572,7 +732,8 @@
\gantttitle{%
\csname pgfcalendarmonth#1\endcsname{\pgfcalendarcurrentmonth}%
}{%
- \ifgtt@compresscalendar1\else\the\gtt@calendar@slots\fi%
+ \ifgtt@timeslotunit@month1\fi%
+ \ifgtt@timeslotunit@day\the\gtt@calendar@slots\fi%
}%
\gtt@calendar@slots=1\relax%
}{%
@@ -584,7 +745,8 @@
\gantttitle{%
\csname pgfcalendarmonth#1\endcsname{\pgfcalendarcurrentmonth}%
}{%
- \ifgtt@compresscalendar1\else\the\gtt@calendar@slots\fi%
+ \ifgtt@timeslotunit@month1\fi%
+ \ifgtt@timeslotunit@day\the\gtt@calendar@slots\fi%
}%
\fi%
}{}%
@@ -832,7 +994,7 @@
}
\def\newganttchartelement{%
- \@ifstar\@newganttchartelement@one\@newganttchartelement@two%
+ \@gtt@ifstar\@newganttchartelement@one\@newganttchartelement@two%
}
\newcommand\@newganttchartelement@one[1]{%