diff options
author | Karl Berry <karl@freefriends.org> | 2011-11-12 23:34:24 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-11-12 23:34:24 +0000 |
commit | bd590e9b8a789c34737d67e351979ce988402cfb (patch) | |
tree | f40b091366a91e843e2c9c5db928eff06c3fc7e3 /Master/texmf-dist/tex/latex/pgfgantt | |
parent | 84661162e7703f159bcac768002008bbf0f542f6 (diff) |
pgfgantt 2.1 (10nov11)
git-svn-id: svn://tug.org/texlive/trunk@24572 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pgfgantt')
-rw-r--r-- | Master/texmf-dist/tex/latex/pgfgantt/pgfgantt.sty | 71 |
1 files changed, 52 insertions, 19 deletions
diff --git a/Master/texmf-dist/tex/latex/pgfgantt/pgfgantt.sty b/Master/texmf-dist/tex/latex/pgfgantt/pgfgantt.sty index d2437ec3df3..51772768ba7 100644 --- a/Master/texmf-dist/tex/latex/pgfgantt/pgfgantt.sty +++ b/Master/texmf-dist/tex/latex/pgfgantt/pgfgantt.sty @@ -16,7 +16,7 @@ %% and version 1.3 or later is part of all distributions of LaTeX %% version 2005/12/01 or later. %% -\ProvidesPackage{pgfgantt}[2011/10/10 v2.0 Draw Gantt diagrams with TikZ] +\ProvidesPackage{pgfgantt}[2011/11/10 v2.1 Draw Gantt diagrams with TikZ] \NeedsTeXFormat{LaTeX2e}[1999/12/01] \RequirePackage{tikz} @@ -117,6 +117,8 @@ \@gtt@keydef{name} \@gtt@keydef{time slot modifier} +\newif\ifgtt@inline +\pgfkeys{/pgfgantt/inline/.is if=gtt@inline} \@gtt@stylekeydef{bar} \pgfkeysdef{/pgfgantt/bar label text}{% @@ -124,6 +126,7 @@ } \@gtt@keydef{bar label font} \@gtt@stylekeydef{bar label anchor} +\@gtt@stylekeydef{bar label inline anchor} \@gtt@keydef{bar left shift} \@gtt@keydef{bar right shift} \@gtt@keydef{bar top shift} @@ -135,6 +138,7 @@ } \@gtt@keydef{group label font} \@gtt@stylekeydef{group label anchor} +\@gtt@stylekeydef{group label inline anchor} \@gtt@keydef{group left shift} \@gtt@keydef{group right shift} \@gtt@keydef{group top shift} @@ -182,6 +186,7 @@ } \@gtt@keydef{milestone label font} \@gtt@stylekeydef{milestone label anchor} +\@gtt@stylekeydef{milestone label inline anchor} \@gtt@keydef{milestone width} \@gtt@keydef{milestone height} \@gtt@keydef{milestone xshift} @@ -224,10 +229,12 @@ include title in canvas, name={}, time slot modifier=-1, + inline=false, bar={fill=white}, bar label text={\strut#1}, bar label font=\normalsize, bar label anchor={anchor=east}, + bar label inline anchor={anchor=center}, bar left shift=0, bar right shift=0, bar top shift=.3, @@ -236,6 +243,7 @@ group label text={\strut#1}, group label font=\normalsize\bfseries, group label anchor={anchor=east}, + group label inline anchor={anchor=south}, group left shift=-.1, group right shift=.1, group top shift=.4, @@ -250,6 +258,7 @@ milestone label text={\strut#1}, milestone label font=\normalsize\itshape, milestone label anchor={anchor=east}, + milestone label inline anchor={anchor=south}, milestone width=.8, milestone height=.4, milestone xshift=0, @@ -312,7 +321,12 @@ }% } +\newif\ifgtt@tikzpicture + \newenvironment{ganttchart}[2][]{% + \@ifundefined{useasboundingbox}% + {\gtt@tikzpicturefalse\begin{tikzpicture}}% + {\gtt@tikzpicturetrue}% \ganttset{#1}% \setcounter{gtt@width}{#2}% \setcounter{gtt@currentline}{0}% @@ -370,6 +384,7 @@ [anchor=north] {\@gtt@get{today label}};% \fi% \end{scope}% + \ifgtt@tikzpicture\else\end{tikzpicture}\fi% } \newcommand\ganttnewline[1][]{% @@ -482,12 +497,6 @@ \ifx\gtt@name\@empty\edef\gtt@name{elem\thegtt@elementid}\fi% \node[shape=chart element] (\@gtt@get{name}) at ($(\x@left pt, \y@upper pt)!.5!(\x@right pt, \y@lower pt)$) {}; - \def\@tempa{#2}% - \ifx\@tempa\@empty\else% - \node at ($(0pt, \y@upper pt)!.5!(0pt, \y@lower pt)$) - [/pgfgantt/bar label anchor@style] - {\@gtt@get{bar label font}{\gtt@barlabeltext{#2}}};% - \fi% \def\@tempa{none}% \ifx\gtt@progress\@tempa% \def\gtt@progress{100}% @@ -524,6 +533,18 @@ \draw[/pgfgantt/bar@style, fill=none] (\x@left pt, \y@upper pt) rectangle (\x@right pt, \y@lower pt);% \gtt@pl@draw% + \def\@tempa{#2}% + \ifx\@tempa\@empty\else% + \ifgtt@inline% + \node at (\@gtt@get{name}.center) + [/pgfgantt/bar label inline anchor@style] + {\@gtt@get{bar label font}{\gtt@barlabeltext{#2}}};% + \else% + \node at ($(0pt, \y@upper pt)!.5!(0pt, \y@lower pt)$) + [/pgfgantt/bar label anchor@style] + {\@gtt@get{bar label font}{\gtt@barlabeltext{#2}}};% + \fi% + \fi% \xdef\gtt@lastelement{\gtt@currentelement}% \xdef\gtt@currentelement{\@gtt@get{name}}% \stepcounter{gtt@elementid}% @@ -619,12 +640,6 @@ \ifx\gtt@name\@empty\edef\gtt@name{elem\thegtt@elementid}\fi% \node[shape=chart element] (\@gtt@get{name}) at ($(\x@left pt, \y@upper pt)!.5!(\x@right pt, \y@lower pt)$) {}; - \def\@tempa{#2}% - \ifx\@tempa\@empty\else% - \node at ($(0pt, \y@upper pt)!.5!(0pt, \y@lower pt)$) - [/pgfgantt/group label anchor@style] - {\@gtt@get{group label font}{\gtt@grouplabeltext{#2}}};% - \fi% \def\@tempa{none}% \ifx\gtt@progress\@tempa% \def\gtt@progress{100}% @@ -704,6 +719,18 @@ (\x@left pt, \y@lower pt) -- cycle;% \gtt@pl@draw% + \def\@tempa{#2}% + \ifx\@tempa\@empty\else% + \ifgtt@inline% + \node at (\@gtt@get{name}.center) + [/pgfgantt/group label inline anchor@style] + {\@gtt@get{group label font}{\gtt@grouplabeltext{#2}}};% + \else% + \node at ($(0pt, \y@upper pt)!.5!(0pt, \y@lower pt)$) + [/pgfgantt/group label anchor@style] + {\@gtt@get{group label font}{\gtt@grouplabeltext{#2}}};% + \fi% + \fi% \xdef\gtt@lastelement{\gtt@currentelement}% \xdef\gtt@currentelement{\@gtt@get{name}}% \stepcounter{gtt@elementid}% @@ -745,18 +772,24 @@ \ifx\gtt@name\@empty\edef\gtt@name{elem\thegtt@elementid}\fi% \node[shape=chart element] (\@gtt@get{name}) at ($(\x@left pt, \y@upper pt)!.5!(\x@right pt, \y@lower pt)$) {}; - \def\@tempa{#2}% - \ifx\@tempa\@empty\else% - \node at (0pt, \y@mid pt) - [/pgfgantt/milestone label anchor@style] - {\@gtt@get{milestone label font}{\gtt@milestonelabeltext{#2}}};% - \fi% \path[/pgfgantt/milestone@style] (\x@left pt, \y@mid pt) -- (\x@mid pt, \y@lower pt) -- (\x@right pt, \y@mid pt) -- (\x@mid pt, \y@upper pt) -- cycle;% + \def\@tempa{#2}% + \ifx\@tempa\@empty\else% + \ifgtt@inline% + \node at (\@gtt@get{name}.center) + [/pgfgantt/milestone label inline anchor@style] + {\@gtt@get{milestone label font}{\gtt@milestonelabeltext{#2}}};% + \else% + \node at (0pt, \y@mid pt) + [/pgfgantt/milestone label anchor@style] + {\@gtt@get{milestone label font}{\gtt@milestonelabeltext{#2}}};% + \fi% + \fi% \xdef\gtt@lastelement{\gtt@currentelement}% \xdef\gtt@currentelement{\@gtt@get{name}}% \stepcounter{gtt@elementid}% |