summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-03-12 23:35:14 +0000
committerKarl Berry <karl@freefriends.org>2012-03-12 23:35:14 +0000
commit6e97d979159e30694e7dab6f6697f6c6376984fa (patch)
treed55f2e6b1a1d173395ee36850958da4a96e7d7ee
parentb38ccc8042a2fbd6c1752bd089345ddf0cc38df1 (diff)
context-gantt (12mar12)
git-svn-id: svn://tug.org/texlive/trunk@25622 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/context/third/gantt/README4
-rw-r--r--Master/texmf-dist/doc/context/third/gantt/examples/gantt-5.tex2
-rw-r--r--Master/texmf-dist/tex/context/third/gantt/gantt-s-mp.tex60
-rw-r--r--Master/texmf-dist/tex/context/third/gantt/gantt-s-tikz.tex117
-rw-r--r--Master/texmf-dist/tex/context/third/gantt/t-gantt.tex10
5 files changed, 100 insertions, 93 deletions
diff --git a/Master/texmf-dist/doc/context/third/gantt/README b/Master/texmf-dist/doc/context/third/gantt/README
index 4f98c254616..dda1088fcfe 100644
--- a/Master/texmf-dist/doc/context/third/gantt/README
+++ b/Master/texmf-dist/doc/context/third/gantt/README
@@ -13,10 +13,10 @@ Usage
\usemodule[gantt]
\starttext
-... \startgantt ...\stopgantt ...
+… \startgantt … \stopgantt …
\stoptext
Options
-------
-- style
+- alternative
diff --git a/Master/texmf-dist/doc/context/third/gantt/examples/gantt-5.tex b/Master/texmf-dist/doc/context/third/gantt/examples/gantt-5.tex
index 0c60af6b9b7..a454ece64ad 100644
--- a/Master/texmf-dist/doc/context/third/gantt/examples/gantt-5.tex
+++ b/Master/texmf-dist/doc/context/third/gantt/examples/gantt-5.tex
@@ -1,7 +1,7 @@
\usemodule[gantt]
%\usemodule[gantt][alternative=mp]
%\usemodule[gantt][alternative=tikz]
-\setuppapersize[landscape][landscape]
+\setuppapersize[A4,landscape][A4,landscape]
\setuplayout[scale=0.8]
\setuppagenumbering[location=]
diff --git a/Master/texmf-dist/tex/context/third/gantt/gantt-s-mp.tex b/Master/texmf-dist/tex/context/third/gantt/gantt-s-mp.tex
index 23c2ab96ff3..391292f932a 100644
--- a/Master/texmf-dist/tex/context/third/gantt/gantt-s-mp.tex
+++ b/Master/texmf-dist/tex/context/third/gantt/gantt-s-mp.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=t-gantt,
-%D version=2011.09.11,
+%D version=2012.03.15,
%D title=\CONTEXT\ User Module,
%D subtitle=Drawing Gantt charts,
%D author={Adam Reviczky and Aditya Mahajan},
@@ -37,7 +37,7 @@
\newdimen\gantttmpb
% workaround for titleelement
-\def\!!row{\numexpr\ganttnum*-1\relax}
+\def\!!row{\numexpr\ganttnum-1\relax}
\def\setupgantt
{\bgroup
@@ -57,7 +57,6 @@
\def\setupganttbar
{\bgroup
- \catcode`\#=\@@other
\dosingleempty
\dosetupganttbar}
@@ -81,8 +80,8 @@
{\getparameters[\????gantt][#1]%
\gdef\gantt!factor{\@@@@ganttfactor}
\gdef\gantt!ganttunitlength{\@@@@ganttxunitlength}
- \gdef\gantt!style{\getvalue{@@ganttstyle}}
- \gdef\gantt!titlestyle{\getvalue{@@gantttitlestyle}}
+ \gdef\gantt!style{\getvalue{@@@@ganttstyle}}
+ \gdef\gantt!titlestyle{\getvalue{@@@@gantttitlestyle}}
\gdef\gantt!drawledgerline{\@@@@ganttdrawledgerline}
\bgroup
@@ -126,16 +125,17 @@
\stopMPdrawing
\MPdrawingdonetrue\getMPdrawing
\resetMPdrawing
+ \doglobal\ganttnum=0
}
% ganttitle is the environment for drawing the title section
\definestartstop[ganttitle][
before={
\ganttlastx = 0cm
+ \doglobal\advance\ganttnum by 1
},
after={
\ganttlastx = 0cm
- \doglobal\decrement\ganttnum
}
]
@@ -148,7 +148,7 @@
\startMPdrawing
draw (\the\ganttlastx,0.5cm-\the\!!row*cm)--(\the\ganttlastx+#2*\gantt!ganttunitlength,0.5cm-\the\!!row*cm)--(\the\ganttlastx+#2*\gantt!ganttunitlength,0.5cm-0.6cm-\the\!!row*cm)--(\the\ganttlastx,0.5cm-0.6cm-\the\!!row*cm)--cycle;
path diam; diam = (\the\ganttlastx,0.5cm-\the\!!row*cm)--(\the\ganttlastx+#2*\gantt!ganttunitlength,0.5cm-0.6cm-\the\!!row*cm);
- label (btex \getvalue{v!titlestyle} #1 etex, center diam);
+ label (textext("\getvalue{gantt!titlestyle}{#1}"), center diam);
\stopMPdrawing
\ganttlastx=\dimexpr\ganttlastx+\gantt!ganttunitlength*#2\relax
@@ -162,7 +162,7 @@
\long\def\donumtitle#1#2#3#4%
{\gantttitlenum=#1
\dostepwiserecurse{#1}{#3}{#2}{
- \titleelement{\the\gantttitlenum}{#4}
+ \titleelement{\the\gantttitlenum}{#4}
\advance\gantttitlenum by #2
}
}
@@ -186,13 +186,13 @@
\doif{\gantt!drawledgerline}{true}{
\startMPdrawing
- draw (0,\ganttnum*cm-0.2cm)--(\the\ganttwidth*\gantt!ganttunitlength,\ganttnum*cm-0.2cm) dashed withdots;
+ draw (0,-\the\ganttnum*cm-0.2cm)--(\the\ganttwidth*\gantt!ganttunitlength,-\the\ganttnum*cm-0.2cm) dashed withdots;
\stopMPdrawing
}
\startMPdrawing
- path diag; diag = (0,\ganttnum*cm+0.1cm)--(0,\ganttnum*cm+0.5cm);
- label.lft (btex \getvalue{v!style} #2 etex, center diag);
- path f; f := (\the\gantttmpa,\ganttnum*cm+0.1cm)--(\the\gantttmpb,\ganttnum*cm+0.1cm)--(\the\gantttmpb,\ganttnum*cm+0.5cm)--(\the\gantttmpa,\ganttnum*cm+0.5cm)--cycle;
+ path diag; diag = (0,-\the\ganttnum*cm+0.1cm)--(0,-\the\ganttnum*cm+0.5cm);
+ label.lft (textext("\getvalue{gantt!style}{#2}"), center diag);
+ path f; f := (\the\gantttmpa,-\the\ganttnum*cm+0.1cm)--(\the\gantttmpb,-\the\ganttnum*cm+0.1cm)--(\the\gantttmpb,-\the\ganttnum*cm+0.5cm)--(\the\gantttmpa,-\the\ganttnum*cm+0.5cm)--cycle;
hatchoptions(withcolor \gantt!color);
draw f withcolor black;
@@ -202,8 +202,8 @@
\stopMPdrawing
\global\ganttlastx=\gantttmpb
- \doglobal\decrement\ganttnum
\egroup
+ \doglobal\advance\ganttnum by 1
}
\def\ganttbar
@@ -244,7 +244,7 @@
interim linecap := squared;
interim linejoin := rounded;
- drawarrow (\the\ganttlastx,\ganttnum*cm+1.1*cm+0.2*cm)--(\the\ganttlastx+0.4*\gantt!ganttunitlength,\ganttnum*cm+1.1*cm+0.2*cm)--(\the\ganttlastx+0.4*\gantt!ganttunitlength,\ganttnum*cm+0.6*cm+0.2*cm)--(\the\ganttlastx-0.4*\gantt!ganttunitlength,\ganttnum*cm+0.6*cm+0.2*cm)--(\the\ganttlastx-0.4*\gantt!ganttunitlength,\ganttnum*cm+0.1*cm+0.2*cm)--(#3*\gantt!ganttunitlength,\ganttnum*cm+0.1*cm+0.2*cm);
+ drawarrow (\the\ganttlastx,-\the\ganttnum*cm+1.1*cm+0.2*cm)--(\the\ganttlastx+0.4*\gantt!ganttunitlength,-\the\ganttnum*cm+1.1*cm+0.2*cm)--(\the\ganttlastx+0.4*\gantt!ganttunitlength,-\the\ganttnum*cm+0.6*cm+0.2*cm)--(\the\ganttlastx-0.4*\gantt!ganttunitlength,-\the\ganttnum*cm+0.6*cm+0.2*cm)--(\the\ganttlastx-0.4*\gantt!ganttunitlength,-\the\ganttnum*cm+0.1*cm+0.2*cm)--(#3*\gantt!ganttunitlength,-\the\ganttnum*cm+0.1*cm+0.2*cm);
endgroup;
\stopMPdrawing
\else
@@ -253,13 +253,14 @@
interim linecap := squared;
interim linejoin := rounded;
- drawarrow (\the\ganttlastx,\ganttnum*cm+1.1*cm+0.2*cm)--(\the\ganttlastx+0.4*\gantt!ganttunitlength,\ganttnum*cm+1.1*cm+0.2*cm)--(\the\ganttlastx+0.4*\gantt!ganttunitlength,\ganttnum*cm+0.1*cm+0.2*cm)--(#3*\gantt!ganttunitlength,\ganttnum*cm+0.1*cm+0.2*cm);
+ drawarrow (\the\ganttlastx,-\the\ganttnum*cm+1.1*cm+0.2*cm)--(\the\ganttlastx+0.4*\gantt!ganttunitlength,-\the\ganttnum*cm+1.1*cm+0.2*cm)--(\the\ganttlastx+0.4*\gantt!ganttunitlength,-\the\ganttnum*cm+0.1*cm+0.2*cm)--(#3*\gantt!ganttunitlength,-\the\ganttnum*cm+0.1*cm+0.2*cm);
endgroup;
\stopMPdrawing
\fi
\ganttbar[#1]{#2}{#3}{#4}
\egroup
+ \doglobal\advance\ganttnum by 1
}
\def\ganttbarcon
@@ -274,21 +275,21 @@
\doif{\gantt!drawledgerline}{true}{
\startMPdrawing
- draw (0,\ganttnum*cm-0.2cm)--(\the\ganttwidth*\gantt!ganttunitlength,\ganttnum*cm-0.2cm) dashed withdots;
+ draw (0,-\the\ganttnum*cm-0.2cm)--(\the\ganttwidth*\gantt!ganttunitlength,-\the\ganttnum*cm-0.2cm) dashed withdots;
\stopMPdrawing
}
\startMPdrawing
pen diamond; diamond := makepen fulldiamond;
- path diag; diag = (0,\ganttnum*cm+0.1cm)--(0,\ganttnum*cm+0.5cm);
- label.lft (btex \getvalue{v!style}\bf #1 etex, center diag);
- fill (\the\gantttmpa-0.14*cm,\ganttnum*cm+0.2cm)--(\the\gantttmpb+0.14*cm,\ganttnum*cm+0.2cm)--(\the\gantttmpb+0.14*cm,\ganttnum*cm+0.4cm)--(\the\gantttmpa-0.14*cm,\ganttnum*cm+0.4cm)--cycle withcolor black;
- fill fulldiamond scaled 0.3cm shifted (\the\gantttmpa+0.01cm,\ganttnum*cm+0.2cm) withcolor black;
- fill fulldiamond scaled 0.3cm shifted (\the\gantttmpb-0.01cm,\ganttnum*cm+0.2cm) withcolor black;
+ path diag; diag = (0,-\the\ganttnum*cm+0.1cm)--(0,-\the\ganttnum*cm+0.5cm);
+ label.lft (textext("\getvalue{gantt!style}{\bf #1}"), center diag);
+ fill (\the\gantttmpa-0.14*cm,-\the\ganttnum*cm+0.2cm)--(\the\gantttmpb+0.14*cm,-\the\ganttnum*cm+0.2cm)--(\the\gantttmpb+0.14*cm,-\the\ganttnum*cm+0.4cm)--(\the\gantttmpa-0.14*cm,-\the\ganttnum*cm+0.4cm)--cycle withcolor black;
+ fill fulldiamond scaled 0.3cm shifted (\the\gantttmpa+0.01cm,-\the\ganttnum*cm+0.2cm) withcolor black;
+ fill fulldiamond scaled 0.3cm shifted (\the\gantttmpb-0.01cm,-\the\ganttnum*cm+0.2cm) withcolor black;
\stopMPdrawing
\global\ganttlastx=\gantttmpb
- \doglobal\decrement\ganttnum
\egroup
+ \doglobal\advance\ganttnum by 1
}
\def\ganttgroup
@@ -310,19 +311,19 @@
\doif{\gantt!drawledgerline}{true}{
\startMPdrawing
- draw (0,\ganttnum*cm-0.2cm)--(\the\ganttwidth*\gantt!ganttunitlength,\ganttnum*cm-0.2cm) dashed withdots;
+ draw (0,-\the\ganttnum*cm-0.2cm)--(\the\ganttwidth*\gantt!ganttunitlength,-\the\ganttnum*cm-0.2cm) dashed withdots;
\stopMPdrawing
}
\startMPdrawing
pen diamond; diamond := makepen fulldiamond;
- path diag; diag = (0,\ganttnum*cm+0.1cm)--(0,\ganttnum*cm+0.5cm);
- label.lft (btex \getvalue{v!style} #2 etex, center diag);
- fill fulldiamond scaled 0.3cm shifted (\the\gantttmpb,\ganttnum*cm+0.3cm) withcolor \gantt!color;
+ path diag; diag = (0,-\the\ganttnum*cm+0.1cm)--(0,-\the\ganttnum*cm+0.5cm);
+ label.lft (textext("\getvalue{gantt!style}{#2}"), center diag);
+ fill fulldiamond scaled 0.3cm shifted (\the\gantttmpb,-\the\ganttnum*cm+0.3cm) withcolor \gantt!color;
\stopMPdrawing
\global\ganttlastx=\gantttmpb
- \doglobal\decrement\ganttnum
\egroup
+ \doglobal\advance\ganttnum by 1
}
\def\ganttmilestone
@@ -343,7 +344,7 @@
interim linecap := squared;
interim linejoin := rounded;
- drawarrow (\the\ganttlastx,\ganttnum*cm+1.1*cm+0.2*cm)--(\the\ganttlastx+0.4*\gantt!ganttunitlength,\ganttnum*cm+1.1*cm+0.2*cm)--(\the\ganttlastx+0.4*\gantt!ganttunitlength,\ganttnum*cm+0.6*cm+0.2*cm)--(\the\ganttlastx-0.4*\gantt!ganttunitlength-0.14*cm,\ganttnum*cm+0.6*cm+0.2*cm)--(\the\ganttlastx-0.4*\gantt!ganttunitlength-0.14*cm,\ganttnum*cm+0.1*cm+0.2*cm)--(#3*\gantt!ganttunitlength-0.14*cm,\ganttnum*cm+0.1*cm+0.2*cm);
+ drawarrow (\the\ganttlastx,-\the\ganttnum*cm+1.1*cm+0.2*cm)--(\the\ganttlastx+0.4*\gantt!ganttunitlength,-\the\ganttnum*cm+1.1*cm+0.2*cm)--(\the\ganttlastx+0.4*\gantt!ganttunitlength,-\the\ganttnum*cm+0.6*cm+0.2*cm)--(\the\ganttlastx-0.4*\gantt!ganttunitlength-0.14*cm,-\the\ganttnum*cm+0.6*cm+0.2*cm)--(\the\ganttlastx-0.4*\gantt!ganttunitlength-0.14*cm,-\the\ganttnum*cm+0.1*cm+0.2*cm)--(#3*\gantt!ganttunitlength-0.14*cm,-\the\ganttnum*cm+0.1*cm+0.2*cm);
endgroup;
\stopMPdrawing
\else
@@ -352,13 +353,14 @@
interim linecap := squared;
interim linejoin := rounded;
- drawarrow (\the\ganttlastx,\ganttnum*cm+1.1*cm+0.2*cm)--(\the\ganttlastx+0.4*\gantt!ganttunitlength,\ganttnum*cm+1.1*cm+0.2*cm)--(\the\ganttlastx+0.4*\gantt!ganttunitlength,\ganttnum*cm+0.1*cm+0.2*cm)--(#3*\gantt!ganttunitlength-0.14*cm,\ganttnum*cm+0.1*cm+0.2*cm);
+ drawarrow (\the\ganttlastx,-\the\ganttnum*cm+1.1*cm+0.2*cm)--(\the\ganttlastx+0.4*\gantt!ganttunitlength,-\the\ganttnum*cm+1.1*cm+0.2*cm)--(\the\ganttlastx+0.4*\gantt!ganttunitlength,-\the\ganttnum*cm+0.1*cm+0.2*cm)--(#3*\gantt!ganttunitlength-0.14*cm,-\the\ganttnum*cm+0.1*cm+0.2*cm);
endgroup;
\stopMPdrawing
\fi
\ganttmilestone[#1]{#2}{#3}
\egroup
+ \doglobal\advance\ganttnum by 1
}
\def\ganttmilestonecon
diff --git a/Master/texmf-dist/tex/context/third/gantt/gantt-s-tikz.tex b/Master/texmf-dist/tex/context/third/gantt/gantt-s-tikz.tex
index 110ef3e994a..67c48ec4e8d 100644
--- a/Master/texmf-dist/tex/context/third/gantt/gantt-s-tikz.tex
+++ b/Master/texmf-dist/tex/context/third/gantt/gantt-s-tikz.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=t-gantt-tikz,
-%D version=2011.09.11,
+%D version=2012.03.15,
%D title=\CONTEXT\ User Module,
%D subtitle=Drawing Gantt charts,
%D author=Adam Reviczky,
@@ -15,7 +15,7 @@
\startmodule[gantt-s-tikz]
\unprotect
-\def\????gantt-tikz{@@@@gantt-tikz}
+\def\??gantt-tikz{@@gantt-tikz}
\usemodule[tikz,pgffor]
\usetikzlibrary[arrows,patterns]
@@ -34,6 +34,9 @@
\newdimen\gantttmpa
\newdimen\gantttmpb
+% workaround for titleelement
+\def\!!row{\numexpr\ganttnum-1\relax}
+
\def\setupgantt
{\bgroup
\dosingleempty
@@ -51,7 +54,6 @@
\def\setupganttbar
{\bgroup
- \catcode`\#=\@@other
\dosingleempty
\dosetupganttbar}
@@ -74,10 +76,10 @@
\long\def\dostartgantt[#1]#2#3%
{\getparameters[\??gantt][#1]%
- \gdef\v!ganttunitlength{\getvalue{@@ganttxunitlength}}
- \gdef\v!fontsize{\getvalue{@@ganttfontsize}}
- \gdef\v!titlefontsize{\getvalue{@@gantttitlefontsize}}
- \gdef\v!drawledgerline{\@@ganttdrawledgerline}
+ \gdef\gantt!ganttunitlength{\getvalue{@@ganttxunitlength}}
+ \gdef\gantt!fontsize{\getvalue{@@ganttfontsize}}
+ \gdef\gantt!titlefontsize{\getvalue{@@gantttitlefontsize}}
+ \gdef\gantt!drawledgerline{\@@ganttdrawledgerline}
\bgroup
\tikzstyle{time}=[coordinate]
@@ -95,15 +97,15 @@
\advance\ganttheight by 1;
\draw (0,0.5) node[above] {\ganttxstringtop} -- (0,1.4-\ganttheight) node[below] {\ganttxstringbottom};
- \draw (\ganttwidth*\v!ganttunitlength,0.5) node[above] {\ganttxstringtop} -- (\ganttwidth*\v!ganttunitlength,1.4-\ganttheight) node[below] {\ganttxstringbottom};
+ \draw (\ganttwidth*\gantt!ganttunitlength,0.5) node[above] {\ganttxstringtop} -- (\ganttwidth*\gantt!ganttunitlength,1.4-\ganttheight) node[below] {\ganttxstringbottom};
% draw grid
\foreach \!!t in {1,2,...,\ganttwidth}{
- \draw[dotted] (\v!ganttunitlength*\!!t,-0.5) node[above] {\ganttxstringtop} -- (\v!ganttunitlength*\!!t,1.4-\ganttheight) node[below] {\ganttxstringbottom};
+ \draw[dotted] (\gantt!ganttunitlength*\!!t,-0.5) node[above] {\ganttxstringtop} -- (\gantt!ganttunitlength*\!!t,1.4-\ganttheight) node[below] {\ganttxstringbottom};
}
% draw x axis
- \draw[] (0,-#2+0.4) -- (\ganttwidth*\v!ganttunitlength,-#2+0.4);
+ \draw[] (0,-#2+0.4) -- (\ganttwidth*\gantt!ganttunitlength,-#2+0.4);
\egroup
}
@@ -112,33 +114,34 @@
\dosingleempty\dostartgantt}
\def\stopgantt%
- {\stoptikzpicture}
+ {\doglobal\ganttnum=0
+ \stoptikzpicture}
% ganttitle is the environment for drawing the title section
\definestartstop[ganttitle][
before={
\ganttlastx = 0cm
+ \doglobal\advance\ganttnum by 1
},
after={
\ganttlastx = 0cm
- \doglobal\decrement\ganttnum
}
]
% \titleelement draws one element of the title
% usage: \titleelement{label}{length}
\long\def\dotitleelement#1#2%
- {\gantttmpa=\dimexpr\v!ganttunitlength*#2\relax
+ {\gantttmpa=\dimexpr\gantt!ganttunitlength*#2\relax
\divide\gantttmpa by 2;
\def\!!xoffset{1.5}
- \draw (\ganttlastx,\ganttnum) rectangle (\ganttlastx+#2*\v!ganttunitlength,\ganttnum+0.6);
- \node [text height=1.5ex,text depth=0.7ex] at (\ganttlastx+\gantttmpa-\!!xoffset,\ganttnum+0.25) {%
- \getvalue{v!titlefontsize} #1%
+ \draw (\ganttlastx,-\the\!!row) rectangle (\ganttlastx+#2*\gantt!ganttunitlength,-\the\!!row+0.6);
+ \node [text height=1.5ex,text depth=0.7ex] at (\ganttlastx+\gantttmpa-\!!xoffset,-\the\!!row+0.25) {%
+ \getvalue{gantt!titlefontsize} #1%
};
- \ganttlastx=\dimexpr\ganttlastx+\v!ganttunitlength*#2\relax
+ \ganttlastx=\dimexpr\ganttlastx+\gantt!ganttunitlength*#2\relax
}
\def\titleelement%
@@ -149,7 +152,7 @@
\long\def\donumtitle#1#2#3#4%
{\gantttitlenum=#1
\dostepwiserecurse{#1}{#3}{#2}{
- \titleelement{\the\gantttitlenum}{#4}
+ \titleelement{\the\gantttitlenum}{#4}
\advance\gantttitlenum by #2;
}
}
@@ -166,22 +169,22 @@
\long\def\doganttbar[#1]#2#3#4%
{\bgroup
\getparameters[\??gantt][#1]%
- \edef\v!pattern{\@@ganttpattern}
- \edef\v!color{\@@ganttcolor}
+ \edef\gantt!pattern{\@@ganttpattern}
+ \edef\gantt!color{\@@ganttcolor}
- \gantttmpa=\dimexpr\v!ganttunitlength*#3\relax
- \gantttmpb=\dimexpr\v!ganttunitlength*#4+\gantttmpa\relax
+ \gantttmpa=\dimexpr\gantt!ganttunitlength*#3\relax
+ \gantttmpb=\dimexpr\gantt!ganttunitlength*#4+\gantttmpa\relax
- \doif{\v!drawledgerline}{true}{
- \draw[dotted] (0,\ganttnum-0.2) -- (\ganttwidth*\v!ganttunitlength,\ganttnum-0.2);
+ \doif{\gantt!drawledgerline}{true}{
+ \draw[dotted] (0,-\the\ganttnum-0.2) -- (\ganttwidth*\gantt!ganttunitlength,-\the\ganttnum-0.2);
}
- \node at (0,\ganttnum) [anchor=base east] {%
- \getvalue{v!fontsize} #2%
+ \node at (0,-\the\ganttnum+0.1) [anchor=base east] {%
+ \getvalue{gantt!fontsize} #2%
};
- \draw[pattern=\v!pattern,pattern color=\v!color] (\gantttmpa,\ganttnum+0.1) rectangle (\gantttmpb,\ganttnum+0.5);
+ \draw[pattern=\gantt!pattern,pattern color=\gantt!color] (\gantttmpa,-\the\ganttnum+0.1) rectangle (\gantttmpb,-\the\ganttnum+0.5);
\global\ganttlastx=\gantttmpb
- \doglobal\decrement\ganttnum
\egroup
+ \doglobal\advance\ganttnum by 1
}
\def\ganttbar
@@ -191,7 +194,7 @@
% usage: \ganttcon{startx}{starty}{endx}{endy}
\long\def\doganttcon#1#2#3#4%
{\bgroup
- \draw[-latex,rounded corners=1pt] (#1*\v!ganttunitlength,-#2+0.1+0.2) -- (#1*\v!ganttunitlength+0.4*\v!ganttunitlength,-#2+0.1+0.2) -- (#1*\v!ganttunitlength+0.4*\v!ganttunitlength,-#2-0.4+0.2) -- (#1*\v!ganttunitlength-0.4*\v!ganttunitlength,-#2-0.4+0.2) -- (#1*\v!ganttunitlength-0.4*\v!ganttunitlength,-#4+0.1+0.2) -- (#3*\v!ganttunitlength,-#4+0.1+0.2);
+ \draw[-latex,rounded corners=1pt] (#1*\gantt!ganttunitlength,-#2+0.1+0.2) -- (#1*\gantt!ganttunitlength+0.4*\gantt!ganttunitlength,-#2+0.1+0.2) -- (#1*\gantt!ganttunitlength+0.4*\gantt!ganttunitlength,-#2-0.4+0.2) -- (#1*\gantt!ganttunitlength-0.4*\gantt!ganttunitlength,-#2-0.4+0.2) -- (#1*\gantt!ganttunitlength-0.4*\gantt!ganttunitlength,-#4+0.1+0.2) -- (#3*\gantt!ganttunitlength,-#4+0.1+0.2);
\egroup
}
@@ -205,19 +208,20 @@
\long\def\doganttbarcon[#1]#2#3#4%
{\bgroup
\getparameters[\??gantt][#1]%
- \edef\v!pattern{\@@ganttpattern}
- \edef\v!color{\@@ganttcolor}
+ \edef\gantt!pattern{\@@ganttpattern}
+ \edef\gantt!color{\@@ganttcolor}
\nextganttlastx = \dimexpr\ganttlastx+\ganttunitlength*1\relax
- \ifdim\nextganttlastx>\dimexpr\v!ganttunitlength*#3\relax
- \draw[-latex,rounded corners=1pt] (\ganttlastx,\ganttnum+1.1+0.2) -- (\ganttlastx+0.4*\v!ganttunitlength,\ganttnum+1.1+0.2) -- (\ganttlastx+0.4*\v!ganttunitlength,\ganttnum+0.6+0.2) -- (\ganttlastx-0.4*\v!ganttunitlength,\ganttnum+0.6+0.2) -- (\ganttlastx-0.4*\v!ganttunitlength,\ganttnum+0.1+0.2) -- (#3*\v!ganttunitlength,\ganttnum+0.1+0.2);
+ \ifdim\nextganttlastx>\dimexpr\gantt!ganttunitlength*#3\relax
+ \draw[-latex,rounded corners=1pt] (\ganttlastx,-\the\ganttnum+1.1+0.2) -- (\ganttlastx+0.4*\gantt!ganttunitlength,-\the\ganttnum+1.1+0.2) -- (\ganttlastx+0.4*\gantt!ganttunitlength,-\the\ganttnum+0.6+0.2) -- (\ganttlastx-0.4*\gantt!ganttunitlength,-\the\ganttnum+0.6+0.2) -- (\ganttlastx-0.4*\gantt!ganttunitlength,-\the\ganttnum+0.1+0.2) -- (#3*\gantt!ganttunitlength,-\the\ganttnum+0.1+0.2);
\else
- \draw[-latex,rounded corners=1pt] (\ganttlastx,\ganttnum+1.1+0.2) -- (\ganttlastx+0.4*\v!ganttunitlength,\ganttnum+1.1+0.2) -- (\ganttlastx+0.4*\v!ganttunitlength,\ganttnum+0.1+0.2) -- (#3*\v!ganttunitlength,\ganttnum+0.1+0.2);
+ \draw[-latex,rounded corners=1pt] (\ganttlastx,-\the\ganttnum+1.1+0.2) -- (\ganttlastx+0.4*\gantt!ganttunitlength,-\the\ganttnum+1.1+0.2) -- (\ganttlastx+0.4*\gantt!ganttunitlength,-\the\ganttnum+0.1+0.2) -- (#3*\gantt!ganttunitlength,-\the\ganttnum+0.1+0.2);
\fi
%hbox overfull!
\ganttbar[#1]{#2}{#3}{#4}
\egroup
+ \doglobal\advance\ganttnum by 1
}
\def\ganttbarcon
@@ -227,21 +231,21 @@
% usage: \ganttgroup{label}{start}{length}
\long\def\doganttgroup#1#2#3%
{\bgroup
- \gantttmpa=\dimexpr\v!ganttunitlength*#2\relax
- \gantttmpb=\dimexpr\v!ganttunitlength*#3+\gantttmpa\relax
+ \gantttmpa=\dimexpr\gantt!ganttunitlength*#2\relax
+ \gantttmpb=\dimexpr\gantt!ganttunitlength*#3+\gantttmpa\relax
- \doif{\v!drawledgerline}{true}{
- \draw[dotted] (0,\ganttnum-0.2) -- (\ganttwidth*\v!ganttunitlength,\ganttnum-0.2);
+ \doif{\gantt!drawledgerline}{true}{
+ \draw[dotted] (0,-\the\ganttnum-0.2) -- (\ganttwidth*\gantt!ganttunitlength,-\the\ganttnum-0.2);
}
- \node at (0,\ganttnum) [anchor=base east] {%
- \getvalue{v!fontsize}\bf #1%
+ \node at (0,-\the\ganttnum+0.1) [anchor=base east] {%
+ \getvalue{gantt!fontsize}\bf #1%
};
- \fill[black] (\gantttmpa-0.14cm,\ganttnum+0.2) rectangle (\gantttmpb+0.14cm,\ganttnum+0.4);
- \draw[diamond-diamond] (\gantttmpa-0.14cm,\ganttnum+0.2) -- (\gantttmpb+0.14cm,\ganttnum+0.2);
+ \fill[black] (\gantttmpa-0.14cm,-\the\ganttnum+0.2) rectangle (\gantttmpb+0.14cm,-\the\ganttnum+0.4);
+ \draw[diamond-diamond] (\gantttmpa-0.14cm,-\the\ganttnum+0.2) -- (\gantttmpb+0.14cm,-\the\ganttnum+0.2);
\global\ganttlastx=\gantttmpb
- \doglobal\decrement\ganttnum
\egroup
+ \doglobal\advance\ganttnum by 1
}
\def\ganttgroup
@@ -260,23 +264,23 @@
\long\def\doganttmilestone[#1]#2#3%
{\bgroup
\getparameters[\??gantt][#1]%
- \edef\v!color{\@@ganttcolor}
+ \edef\gantt!color{\@@ganttcolor}
- \gantttmpa=\dimexpr\v!ganttunitlength*#3\relax
- \gantttmpb=\dimexpr\v!ganttunitlength*0+\gantttmpa\relax
+ \gantttmpa=\dimexpr\gantt!ganttunitlength*#3\relax
+ \gantttmpb=\dimexpr\gantt!ganttunitlength*0+\gantttmpa\relax
- \doif{\v!drawledgerline}{true}{
- \draw[dotted] (0,\ganttnum-0.2) -- (\ganttwidth*\v!ganttunitlength,\ganttnum-0.2);
+ \doif{\gantt!drawledgerline}{true}{
+ \draw[dotted] (0,-\the\ganttnum-0.2) -- (\ganttwidth*\gantt!ganttunitlength,-\the\ganttnum-0.2);
}
- \node at (0,\ganttnum) [anchor=base east] {%
- \getvalue{v!fontsize} #2%
+ \node at (0,-\the\ganttnum) [anchor=base east] {%
+ \getvalue{gantt!fontsize} #2%
};
\pgfonlayer{foreground}
- \draw[diamond-, color=\v!color] (\gantttmpa,\ganttnum+0.1) -- (\gantttmpb,\ganttnum+0.4);
+ \draw[diamond-, color=\gantt!color] (\gantttmpa,-\the\ganttnum+0.1) -- (\gantttmpb,-\the\ganttnum+0.4);
\endpgfonlayer
\global\ganttlastx=\gantttmpb
- \doglobal\decrement\ganttnum
\egroup
+ \doglobal\advance\ganttnum by 1
}
\def\ganttmilestone
@@ -288,17 +292,18 @@
\long\def\doganttmilestonecon[#1]#2#3%
{\bgroup
\getparameters[\??gantt][#1]%
- \edef\v!color{\@@ganttcolor}
+ \edef\gantt!color{\@@ganttcolor}
\nextganttlastx = \dimexpr\ganttlastx+\ganttunitlength*1\relax
- \ifdim\nextganttlastx>\dimexpr\v!ganttunitlength*#3\relax
- \draw[-latex,rounded corners=1pt] (\ganttlastx,\ganttnum+1.1+0.2) -- (\ganttlastx+0.4*\v!ganttunitlength,\ganttnum+1.1+0.2) -- (\ganttlastx+0.4*\v!ganttunitlength,\ganttnum+0.6+0.2) -- (\ganttlastx-0.4*\v!ganttunitlength-1.8,\ganttnum+0.6+0.2) -- (\ganttlastx-0.4*\v!ganttunitlength-1.8,\ganttnum+0.1+0.2) -- (#3*\v!ganttunitlength-1.8,\ganttnum+0.1+0.2);
+ \ifdim\nextganttlastx>\dimexpr\gantt!ganttunitlength*#3\relax
+ \draw[-latex,rounded corners=1pt] (\ganttlastx,-\the\ganttnum+1.1+0.2) -- (\ganttlastx+0.4*\gantt!ganttunitlength,-\the\ganttnum+1.1+0.2) -- (\ganttlastx+0.4*\gantt!ganttunitlength,-\the\ganttnum+0.6+0.2) -- (\ganttlastx-0.4*\gantt!ganttunitlength-1.8,-\the\ganttnum+0.6+0.2) -- (\ganttlastx-0.4*\gantt!ganttunitlength-1.8,-\the\ganttnum+0.1+0.2) -- (#3*\gantt!ganttunitlength-1.8,-\the\ganttnum+0.1+0.2);
\else
- \draw[-latex,rounded corners=1pt] (\ganttlastx,\ganttnum+1.1+0.2) -- (\ganttlastx+0.4*\v!ganttunitlength,\ganttnum+1.1+0.2) -- (\ganttlastx+0.4*\v!ganttunitlength,\ganttnum+0.1+0.2) -- (#3*\v!ganttunitlength-1.8,\ganttnum+0.1+0.2);
+ \draw[-latex,rounded corners=1pt] (\ganttlastx,-\the\ganttnum+1.1+0.2) -- (\ganttlastx+0.4*\gantt!ganttunitlength,-\the\ganttnum+1.1+0.2) -- (\ganttlastx+0.4*\gantt!ganttunitlength,-\the\ganttnum+0.1+0.2) -- (#3*\gantt!ganttunitlength-1.8,-\the\ganttnum+0.1+0.2);
\fi
\ganttmilestone[#1]{#2}{#3}
\egroup
+ \doglobal\advance\ganttnum by 1
}
\def\ganttmilestonecon
diff --git a/Master/texmf-dist/tex/context/third/gantt/t-gantt.tex b/Master/texmf-dist/tex/context/third/gantt/t-gantt.tex
index 32133fc2c90..1eefb554dd7 100644
--- a/Master/texmf-dist/tex/context/third/gantt/t-gantt.tex
+++ b/Master/texmf-dist/tex/context/third/gantt/t-gantt.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=t-gantt,
-%D version=2011.09.11,
+%D version=2012.03.15,
%D title=\CONTEXT\ Module,
%D subtitle=Gantt Module,
%D author={Adam Reviczky and Aditya Mahajan},
@@ -13,11 +13,11 @@
\startmodule[gantt]
\unprotect
-\setupmodule[\c!alternative=]
+\setupmodule[alternative=mp]
-\doifdefinedelse{\currentmoduleparameter\c!alternative}
- {\usemodule[gantt-s][mp]}
- {\usemodule[gantt-s][\currentmoduleparameter\c!alternative]}
+\doiffileelse{gantt-s-\currentmoduleparameter{\c!alternative}}
+ {\ReadFile{gantt-s-\currentmoduleparameter{\c!alternative}}}
+ {\usemodule[gantt-s-\currentmoduleparameter{\c!alternative}]}
\protect
\stopmodule