diff options
author | Karl Berry <karl@freefriends.org> | 2011-09-05 00:20:07 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-09-05 00:20:07 +0000 |
commit | d28e75826d4912c0b2cdf2f13e73058e876017a1 (patch) | |
tree | 55f4aac19ffbc5c05596439edd382c72c65b465a | |
parent | 9baba08cedff104a0d4631edf442b871efe406be (diff) |
context-gantt as ConTeXt package, rm hatching in wrong dir
git-svn-id: svn://tug.org/texlive/trunk@23817 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/tex/context/third/gantt/gantt-s-mp.tex | 98 | ||||
-rw-r--r-- | Master/texmf-dist/tex/context/third/gantt/gantt-s-tikz.tex | 14 | ||||
-rw-r--r-- | Master/texmf-dist/tex/context/third/gantt/t-gantt.tex | 5 | ||||
-rwxr-xr-x | Master/tlpkg/libexec/ctan2tds | 6 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/context-gantt.tlpsrc | 2 |
5 files changed, 35 insertions, 90 deletions
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 9fd632be8f0..f41f534ec29 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,16 +1,18 @@ %D \module %D [ file=t-gantt, -%D version=2011.09.04, +%D version=2011.08.27, %D title=\CONTEXT\ User Module, -%D subtitle=Drawing Gantt charts, -%D author=Adam Reviczky, +%D subtitle=Drawing gantt diagrams, +%D author={Adam Reviczky}, %D date=\currentdate, %D copyright=Adam Reviczky, %D license=Public Domain] -%D Some macros for drawing Gantt charts using MetaPost. +%D Some macros for drawing gantt diagrams using MetaPost. +%D +%D Adam Reviczky, 27.08.2011 (Version 3.2) -\writestatus{loading}{ConTeXt User Module / metapost gantt chart} +\writestatus{loading}{ConTeXt User Module / Drawing gantt diagrams} \startmodule[gantt-s-mp] \unprotect @@ -19,78 +21,10 @@ \definesystemvariable{gantt} -% \startMPinclusions -% % temporary solution for a pattern substitute -% input hatching; -% \stopMPinclusions - -% temporary solution until hatching.mp is in ConTeXt standalone -\startMPextensions -%%% addto clip hatchfill hatchfill_ -%%% numeric color -%%% length withcolor -% This is HATCHING.MP file defining a set of METAPOST macros for -% hatching interior of closed paths. -% -% Made in BOP, Gda\'nsk, Poland -% E-mail contact: B.Jackowski@gust.org.pl -% Public domain software (no copyrights, copylefts, copyups, copydowns, etc.) -% Current version: 11.07.2000 -- ver 0.1 (pre-release) -% Current version: 21.09.2000 -- ver 0.11 (ending semicolon -% added in |extra_beginfig|; |hatchfill_| introduced in order -% to make possible something like |def fill = hatchfill enddef| -def hatchfill_ expr c = addto currentpicture contour c _op_ enddef; - -vardef hatchfill text p = - save c_,p_; path p_; color c_[\\]; c_.num:=0; - save withcolor_; let withcolor_:=withcolor; - def withcolor = ; c_[incr c_.num]:= enddef; - p_:=p; let withcolor:=withcolor_; - for i_:=c_.num downto 1: % find the least ``true'' fill - c_.num':=i_; exitif bluepart(c_[i_])>0; - endfor - if c_.num>0: - for i_:=c_.num' upto c_.num: - if bluepart(c_[i_])<0: draw hatched(p_)c_[i_]; - else: hatchfill_ p_ withcolor c_[i_]; fi - endfor - else: hatchfill_ p_; fi -enddef; - -vardef hatched(expr o) primary c = - save a_, b_, d_, l_, i_, r_, za_, zb_, zc_, zd_; - path b_; picture r_; pair za_, zb_, zc_, zd_; - r_:=image( - a_:=redpart(c) mod 180; l_:=greenpart(c); d_:=-bluepart(c); - b_:=o rotated -a_; - b_:=if a_>=90: (lrcorner b_--llcorner b_--ulcorner b_--urcorner b_--cycle) - else: (llcorner b_--lrcorner b_--urcorner b_--ulcorner b_--cycle) fi - rotated a_; - za_:=point 0 of b_; zb_:=point 1 of b_; - zc_:=point 2 of b_; zd_:=point 3 of b_; - if hatch_match>0: - n_:=round(length(zd_-za_)/l_); if n_<2: n_:=2; fi; l_:=length(zd_-za_)/n_; - else: n_:=length(zd_-za_)/l_; fi - % show (greenpart(c), l_); - for i_:=if hatch_match>0: 1 else: 0 fi upto ceiling n_-1: - draw_hatched_band((i_/n_)[zd_,za_],(i_/n_)[zc_,zb_],a_,l_,d_); - endfor - ); - clip r_ to o; r_ -enddef; - -def draw_hatched_band(expr za,zb,a,l,d) = % normally, |a| and |l| are ignored - draw za--zb withpen pencircle scaled d _hop_; -enddef; - -def hatchoptions(text t) = def _hop_ = t enddef enddef; - -newinternal hatch_match; hatch_match:=1; -hatchoptions(); extra_beginfig:=extra_beginfig & ";hatchoptions();"; - -endinput -%%\end -\stopMPextensions +\startMPinclusions + % temporary solution for a pattern substitute + input mp-hatching; +\stopMPinclusions \newcount\ganttnum \newcount\gantttitlenum @@ -118,7 +52,8 @@ endinput \getparameters[\??gantt][#1]} \setupgantt - [sf=1, + [sx=1, + sy=1, xunitlength=1cm, fontsize=\tf, titlefontsize=\tfx, @@ -148,7 +83,8 @@ endinput % drawledgerline - Switch to enable/disable the drawing of horizontal ledger lines (default value: false) \long\def\dostartgantt[#1]#2#3% {\getparameters[\??gantt][#1]% - \gdef\v!sf{\@@ganttsf} + \gdef\v!sx{\@@ganttsx} + \gdef\v!sy{\@@ganttsy} \gdef\v!ganttunitlength{\@@ganttxunitlength} \gdef\v!fontsize{\getvalue{@@ganttfontsize}} \gdef\v!titlefontsize{\getvalue{@@gantttitlefontsize}} @@ -191,10 +127,8 @@ endinput {\startMPdrawing % debug % draw bbox currentpicture withcolor .625red; - currentpicture := currentpicture scaled \v!sf; \stopMPdrawing - \MPdrawingdonetrue\getMPdrawing - \resetMPdrawing + \scale[sx=\v!sx,sy=\v!sy]{\MPdrawingdonetrue\getMPdrawing} } % ganttitle is the environment for drawing the title section 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 4401a617c9e..49031499829 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,16 +1,20 @@ %D \module %D [ file=t-gantt-tikz, -%D version=2011.09.04, +%D version=2011.08.27, %D title=\CONTEXT\ User Module, -%D subtitle=Drawing Gantt charts, +%D subtitle=Drawing gantt diagrams, %D author={Adam Reviczky}, %D date=\currentdate, %D copyright=Adam Reviczky, -%D license=Public Domain] +%D license=GNU GPL 2.0] -%D Some macros for drawing Gantt charts using TikZ. +%D Some macros for drawing gantt diagrams using TikZ. +%D +%D Adam Reviczky, 27.08.2011 (Version 2.1) +%D Andrés Silva Marambio, 20.03.2011 (Version 1.3) +%D Alan Munn, Martin Kumm, 14.03.2011 (Version 1.2) -\writestatus{loading}{ConTeXt User Module / tikz gantt chart} +\writestatus{loading}{ConTeXt User Module / Drawing gantt diagrams} \startmodule[gantt-s-tikz] \unprotect 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 089e24d191e..ab5a4258d67 100644 --- a/Master/texmf-dist/tex/context/third/gantt/t-gantt.tex +++ b/Master/texmf-dist/tex/context/third/gantt/t-gantt.tex @@ -1,12 +1,11 @@ %D \module %D [ file=t-gantt, -%D version=2011.09.04, +%D version=2011.08.28 %D title=\CONTEXT\ Module, %D subtitle=Gantt Module, %D author=Adam Reviczky, %D date=\currentdate, -%D copyright=Adam Reviczky, -%D license=Public Domain] +%D copyright=Adam Reviczky] \writestatus{loading}{module gantt} diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index 1d69664ad49..05fbcf1456f 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -931,6 +931,7 @@ chomp ($Build = `cd $Master/../Build/source && pwd`); 'biber' => '&POSTbiber', 'bibtex' => '&POSTbibtex', 'context-games' => '&POSTcontext_games', + 'context-gantt' => '&POSTcontext_gantt', 'coordsys' => '&POSTcoordsys', 'ctex' => '&POSTctex', 'dehyph-exptl' => '&POSTdehyph_exptl', @@ -4381,6 +4382,11 @@ sub POSTcontext_games { &SYSTEM ("$RM -rf fonts"); } +sub POSTcontext_gantt { + print "POST$package - remove duplicated hatching\n"; + &SYSTEM ("$RM metapost/context/third/hatching/mp-hatching.mp"); +} + sub POSTcoordsys { print "POST$package - rename `putfile.' to `putfile.maple'.\n"; # Apparently dtx insists on always adding the period; this can make diff --git a/Master/tlpkg/tlpsrc/context-gantt.tlpsrc b/Master/tlpkg/tlpsrc/context-gantt.tlpsrc index 8435abaaee2..be7b8f621be 100644 --- a/Master/tlpkg/tlpsrc/context-gantt.tlpsrc +++ b/Master/tlpkg/tlpsrc/context-gantt.tlpsrc @@ -1 +1,3 @@ +category ConTeXt +depend context depend hatching |