From 1b64f6bc515ace3fb763a3c3b8110007e44119af Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Mon, 24 Jan 2011 10:00:00 +0100 Subject: beta 2011.01.24 10:00 --- tex/context/base/colo-hex.mkii | 125 ------- tex/context/base/colo-hex.mkiv | 28 -- tex/context/base/colo-hex.tex | 3 - tex/context/base/colo-ini.mkiv | 2 +- tex/context/base/cont-fil.mkiv | 20 +- tex/context/base/cont-log.tex | 1 - tex/context/base/cont-new.mkii | 2 +- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/cont-old.tex | 48 --- tex/context/base/context.tex | 2 +- tex/context/base/core-job.mkii | 3 +- tex/context/base/l-os.lua | 4 +- tex/context/base/m-arabtex.mkii | 450 +++++++++++++++++++++++++ tex/context/base/m-arabtex.tex | 450 ------------------------- tex/context/base/m-directives.mkiv | 3 + tex/context/base/m-directives.tex | 5 - tex/context/base/m-dratex.mkii | 21 ++ tex/context/base/m-dratex.tex | 21 -- tex/context/base/m-edtsnc.mkii | 207 ++++++++++++ tex/context/base/m-edtsnc.tex | 207 ------------ tex/context/base/m-level.mkii | 94 ++++++ tex/context/base/m-level.tex | 94 ------ tex/context/base/m-mkivhacks.mkiv | 50 +++ tex/context/base/m-mkivhacks.tex | 52 --- tex/context/base/m-pdfsnc.mkii | 200 ++++++++++++ tex/context/base/m-pdfsnc.tex | 200 ------------ tex/context/base/m-plus.tex | 30 -- tex/context/base/m-tex4ht.mkii | 9 + tex/context/base/m-tex4ht.tex | 9 - tex/context/base/m-timing.mkiv | 100 ++++++ tex/context/base/m-timing.tex | 102 ------ tex/context/base/m-trackers.mkiv | 3 + tex/context/base/m-trackers.tex | 5 - tex/context/base/m-translate.mkiv | 96 ++++++ tex/context/base/m-translate.tex | 98 ------ tex/context/base/m-tryout.tex | 55 ---- tex/context/base/s-chi-00.mkii | 76 +++++ tex/context/base/s-chi-00.tex | 76 ----- tex/context/base/s-def-01.mkiv | 10 + tex/context/base/s-fnt-01.mkii | 61 ++++ tex/context/base/s-fnt-01.tex | 61 ---- tex/context/base/s-fnt-02.mkii | 133 ++++++++ tex/context/base/s-fnt-02.tex | 133 -------- tex/context/base/s-fnt-10.mkiv | 176 ++++++++++ tex/context/base/s-fnt-10.tex | 176 ---------- tex/context/base/s-fnt-11.mkiv | 73 +++++ tex/context/base/s-fnt-11.tex | 73 ----- tex/context/base/s-fnt-20.mkiv | 140 ++++++++ tex/context/base/s-fnt-20.tex | 140 -------- tex/context/base/s-fnt-21.mkiv | 46 +++ tex/context/base/s-fnt-21.tex | 46 --- tex/context/base/s-fnt-23.mkiv | 271 ++++++++++++++++ tex/context/base/s-fnt-23.tex | 271 ---------------- tex/context/base/s-fnt-24.mkiv | 83 +++++ tex/context/base/s-fnt-24.tex | 83 ----- tex/context/base/s-fnt-25.mkiv | 195 +++++++++++ tex/context/base/s-fnt-25.tex | 195 ----------- tex/context/base/s-fnt-26.mkiv | 74 +++++ tex/context/base/s-fnt-26.tex | 74 ----- tex/context/base/s-fnt-28.mkiv | 46 +++ tex/context/base/s-fnt-28.tex | 46 --- tex/context/base/s-fnt-29.mkiv | 69 ++++ tex/context/base/s-fnt-29.tex | 69 ---- tex/context/base/s-fnt-30.mkiv | 45 +++ tex/context/base/s-fnt-30.tex | 45 --- tex/context/base/s-fnt-31.mkiv | 144 ++++++++ tex/context/base/s-fnt-31.tex | 144 -------- tex/context/base/s-grk-00.mkii | 77 +++++ tex/context/base/s-grk-00.tex | 77 ----- tex/context/base/s-inf-01.mkiv | 218 +++++++++++++ tex/context/base/s-inf-01.tex | 217 ------------- tex/context/base/s-inf-02.mkiv | 27 ++ tex/context/base/s-inf-02.tex | 27 -- tex/context/base/s-jap-00.mkii | 23 ++ tex/context/base/s-jap-00.tex | 23 -- tex/context/base/s-lan-03.mkiv | 40 +++ tex/context/base/s-lan-03.tex | 40 --- tex/context/base/s-pre-69.mkiv | 335 +++++++++++++++++++ tex/context/base/s-pre-69.tex | 335 ------------------- tex/context/base/s-pre-70.mkiv | 172 ++++++++++ tex/context/base/s-pre-70.tex | 174 ---------- tex/context/base/s-reg-01.mkiv | 60 ++++ tex/context/base/s-reg-01.tex | 60 ---- tex/context/base/s-set-31.mkiv | 118 +++++++ tex/context/base/s-set-31.tex | 118 ------- tex/context/base/x-fdf-00.mkii | 41 +++ tex/context/base/x-fdf-00.tex | 41 --- tex/context/base/x-fig-00.mkii | 252 ++++++++++++++ tex/context/base/x-fig-00.tex | 252 -------------- tex/context/base/x-fig-01.mkii | 461 ++++++++++++++++++++++++++ tex/context/base/x-fig-01.tex | 461 -------------------------- tex/context/base/x-fig-02.mkii | 78 +++++ tex/context/base/x-fig-02.tex | 78 ----- tex/context/base/x-fig-03.mkii | 44 +++ tex/context/base/x-fig-03.tex | 44 --- tex/context/base/x-ldx.ctx | 23 -- tex/context/base/x-ldx.tex | 191 ----------- tex/context/base/x-openmath.mkii | 4 + tex/context/base/x-openmath.tex | 4 - tex/context/base/x-res-00.mkii | 67 ++++ tex/context/base/x-res-00.tex | 67 ---- tex/context/base/x-res-01.mkii | 487 ++++++++++++++++++++++++++++ tex/context/base/x-res-01.mkiv | 487 ++++++++++++++++++++++++++++ tex/context/base/x-res-01.tex | 487 ---------------------------- tex/context/base/x-res-02.mkii | 72 ++++ tex/context/base/x-res-02.tex | 72 ---- tex/context/base/x-res-03.mkii | 44 +++ tex/context/base/x-res-03.tex | 44 --- tex/context/base/x-res-04.mkii | 336 +++++++++++++++++++ tex/context/base/x-res-04.tex | 336 ------------------- tex/context/base/x-res-08.mkii | 129 ++++++++ tex/context/base/x-res-08.tex | 129 -------- tex/context/base/x-res-09.mkii | 69 ++++ tex/context/base/x-res-09.tex | 69 ---- tex/context/base/x-res-10.mkii | 75 +++++ tex/context/base/x-res-10.tex | 75 ----- tex/context/base/x-res-11.mkii | 110 +++++++ tex/context/base/x-res-11.tex | 110 ------- tex/context/base/x-res-12.mkii | 53 +++ tex/context/base/x-res-12.tex | 53 --- tex/context/base/x-res-20.mkii | 231 +++++++++++++ tex/context/base/x-res-20.tex | 231 ------------- tex/context/base/x-res-50.mkiv | 2 + tex/context/base/x-sch-00.mkii | 382 ++++++++++++++++++++++ tex/context/base/x-sch-00.tex | 382 ---------------------- tex/context/base/x-sch-01.mkii | 122 +++++++ tex/context/base/x-sch-01.tex | 122 ------- tex/context/base/x-xml-01.mkii | 91 ++++++ tex/context/base/x-xml-01.tex | 91 ------ tex/context/base/x-xml-02.mkii | 91 ++++++ tex/context/base/x-xml-02.tex | 91 ------ tex/context/base/x-xml-11.mkii | 134 ++++++++ tex/context/base/x-xml-11.tex | 134 -------- tex/generic/context/luatex-fonts-merged.lua | 2 +- 134 files changed, 7826 insertions(+), 7841 deletions(-) delete mode 100644 tex/context/base/colo-hex.mkii delete mode 100644 tex/context/base/colo-hex.mkiv delete mode 100644 tex/context/base/colo-hex.tex delete mode 100644 tex/context/base/cont-old.tex create mode 100644 tex/context/base/m-arabtex.mkii delete mode 100644 tex/context/base/m-arabtex.tex create mode 100644 tex/context/base/m-directives.mkiv delete mode 100644 tex/context/base/m-directives.tex create mode 100644 tex/context/base/m-dratex.mkii delete mode 100644 tex/context/base/m-dratex.tex create mode 100644 tex/context/base/m-edtsnc.mkii delete mode 100644 tex/context/base/m-edtsnc.tex create mode 100644 tex/context/base/m-level.mkii delete mode 100644 tex/context/base/m-level.tex create mode 100644 tex/context/base/m-mkivhacks.mkiv delete mode 100644 tex/context/base/m-mkivhacks.tex create mode 100644 tex/context/base/m-pdfsnc.mkii delete mode 100644 tex/context/base/m-pdfsnc.tex delete mode 100644 tex/context/base/m-plus.tex create mode 100644 tex/context/base/m-tex4ht.mkii delete mode 100644 tex/context/base/m-tex4ht.tex create mode 100644 tex/context/base/m-timing.mkiv delete mode 100644 tex/context/base/m-timing.tex create mode 100644 tex/context/base/m-trackers.mkiv delete mode 100644 tex/context/base/m-trackers.tex create mode 100644 tex/context/base/m-translate.mkiv delete mode 100644 tex/context/base/m-translate.tex delete mode 100644 tex/context/base/m-tryout.tex create mode 100644 tex/context/base/s-chi-00.mkii delete mode 100644 tex/context/base/s-chi-00.tex create mode 100644 tex/context/base/s-def-01.mkiv create mode 100644 tex/context/base/s-fnt-01.mkii delete mode 100644 tex/context/base/s-fnt-01.tex create mode 100644 tex/context/base/s-fnt-02.mkii delete mode 100644 tex/context/base/s-fnt-02.tex create mode 100644 tex/context/base/s-fnt-10.mkiv delete mode 100644 tex/context/base/s-fnt-10.tex create mode 100644 tex/context/base/s-fnt-11.mkiv delete mode 100644 tex/context/base/s-fnt-11.tex create mode 100644 tex/context/base/s-fnt-20.mkiv delete mode 100644 tex/context/base/s-fnt-20.tex create mode 100644 tex/context/base/s-fnt-21.mkiv delete mode 100644 tex/context/base/s-fnt-21.tex create mode 100644 tex/context/base/s-fnt-23.mkiv delete mode 100644 tex/context/base/s-fnt-23.tex create mode 100644 tex/context/base/s-fnt-24.mkiv delete mode 100644 tex/context/base/s-fnt-24.tex create mode 100644 tex/context/base/s-fnt-25.mkiv delete mode 100644 tex/context/base/s-fnt-25.tex create mode 100644 tex/context/base/s-fnt-26.mkiv delete mode 100644 tex/context/base/s-fnt-26.tex create mode 100644 tex/context/base/s-fnt-28.mkiv delete mode 100644 tex/context/base/s-fnt-28.tex create mode 100644 tex/context/base/s-fnt-29.mkiv delete mode 100644 tex/context/base/s-fnt-29.tex create mode 100644 tex/context/base/s-fnt-30.mkiv delete mode 100644 tex/context/base/s-fnt-30.tex create mode 100644 tex/context/base/s-fnt-31.mkiv delete mode 100644 tex/context/base/s-fnt-31.tex create mode 100644 tex/context/base/s-grk-00.mkii delete mode 100644 tex/context/base/s-grk-00.tex create mode 100644 tex/context/base/s-inf-01.mkiv delete mode 100644 tex/context/base/s-inf-01.tex create mode 100644 tex/context/base/s-inf-02.mkiv delete mode 100644 tex/context/base/s-inf-02.tex create mode 100644 tex/context/base/s-jap-00.mkii delete mode 100644 tex/context/base/s-jap-00.tex create mode 100644 tex/context/base/s-lan-03.mkiv delete mode 100644 tex/context/base/s-lan-03.tex create mode 100644 tex/context/base/s-pre-69.mkiv delete mode 100644 tex/context/base/s-pre-69.tex create mode 100644 tex/context/base/s-pre-70.mkiv delete mode 100644 tex/context/base/s-pre-70.tex create mode 100644 tex/context/base/s-reg-01.mkiv delete mode 100644 tex/context/base/s-reg-01.tex create mode 100644 tex/context/base/s-set-31.mkiv delete mode 100644 tex/context/base/s-set-31.tex create mode 100644 tex/context/base/x-fdf-00.mkii delete mode 100644 tex/context/base/x-fdf-00.tex create mode 100644 tex/context/base/x-fig-00.mkii delete mode 100644 tex/context/base/x-fig-00.tex create mode 100644 tex/context/base/x-fig-01.mkii delete mode 100644 tex/context/base/x-fig-01.tex create mode 100644 tex/context/base/x-fig-02.mkii delete mode 100644 tex/context/base/x-fig-02.tex create mode 100644 tex/context/base/x-fig-03.mkii delete mode 100644 tex/context/base/x-fig-03.tex delete mode 100644 tex/context/base/x-ldx.ctx delete mode 100644 tex/context/base/x-ldx.tex create mode 100644 tex/context/base/x-openmath.mkii delete mode 100644 tex/context/base/x-openmath.tex create mode 100644 tex/context/base/x-res-00.mkii delete mode 100644 tex/context/base/x-res-00.tex create mode 100644 tex/context/base/x-res-01.mkii create mode 100644 tex/context/base/x-res-01.mkiv delete mode 100644 tex/context/base/x-res-01.tex create mode 100644 tex/context/base/x-res-02.mkii delete mode 100644 tex/context/base/x-res-02.tex create mode 100644 tex/context/base/x-res-03.mkii delete mode 100644 tex/context/base/x-res-03.tex create mode 100644 tex/context/base/x-res-04.mkii delete mode 100644 tex/context/base/x-res-04.tex create mode 100644 tex/context/base/x-res-08.mkii delete mode 100644 tex/context/base/x-res-08.tex create mode 100644 tex/context/base/x-res-09.mkii delete mode 100644 tex/context/base/x-res-09.tex create mode 100644 tex/context/base/x-res-10.mkii delete mode 100644 tex/context/base/x-res-10.tex create mode 100644 tex/context/base/x-res-11.mkii delete mode 100644 tex/context/base/x-res-11.tex create mode 100644 tex/context/base/x-res-12.mkii delete mode 100644 tex/context/base/x-res-12.tex create mode 100644 tex/context/base/x-res-20.mkii delete mode 100644 tex/context/base/x-res-20.tex create mode 100644 tex/context/base/x-sch-00.mkii delete mode 100644 tex/context/base/x-sch-00.tex create mode 100644 tex/context/base/x-sch-01.mkii delete mode 100644 tex/context/base/x-sch-01.tex create mode 100644 tex/context/base/x-xml-01.mkii delete mode 100644 tex/context/base/x-xml-01.tex create mode 100644 tex/context/base/x-xml-02.mkii delete mode 100644 tex/context/base/x-xml-02.tex create mode 100644 tex/context/base/x-xml-11.mkii delete mode 100644 tex/context/base/x-xml-11.tex (limited to 'tex') diff --git a/tex/context/base/colo-hex.mkii b/tex/context/base/colo-hex.mkii deleted file mode 100644 index db67f1841..000000000 --- a/tex/context/base/colo-hex.mkii +++ /dev/null @@ -1,125 +0,0 @@ -%D \module -%D [ file=colo-hex, -%D version=2004.06.23, -%D title=\CONTEXT\ Color Macros, -%D subtitle=Hex Colors, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\ifdefined \hexcolorprefix - \expandafter \endinput -\fi - -\writestatus{loading}{ConTeXt Color Macros / Hexadecimal} - -% \edef\testcolor{\string#FFC0C0} -% \edef\testcolor{\string#55} -% -% \setupcolors[state=start] -% -% \expanded{\definecolor[thehexcolor][\hexcolorspec\testcolor]} -% -% \checkhexcolor[\testcolor] -% -% \definecolor[thehexcolor][\testcolor] -% -% \starttext -% -% test \color[thehexcolor]{rood} -% test \color[red]{rood} -% test \color[\testcolor]{rood} -% -% \stoptext - -\unprotect - -% \definecolor[rgbtestcolor] [r=0.87843,g=0.87451,b=0.89020] % RGB(224,223,227) -% \definecolor[hextestcolor] [h=E0DFE3] -% -% \startMPpage -% path p ; % example by Peter Rolf -% p := unitsquare xyscaled(5cm,5cm) ; -% fill (point 0 of p -- point 1 of p -- point 2 of p --cycle) withcolor \MPcolor{rgbtestcolor} ; % bottom right part of the square -% fill (point 0 of p -- point 3 of p -- point 2 of p --cycle) withcolor \MPcolor{hextestcolor} ; % top left part -% \stopMPpage - -\newdimen\hexcolorfraction \hexcolorfraction=\dimexpr1pt/255\relax - -\chardef\hexcolorprefix=`# - -\def\hexcolorspec #1{\expandafter\dohexcolorspec #1\empty\empty\empty\empty\relax} -\def\hexcolorpattern#1{\expandafter\dohexcolorpattern#1\empty\empty\empty\empty\relax} - -\ifx\dohexstringtonumber\undefined \def\dohexstringtonumber{"} \fi - -\def\hexcolorcomponent#1#2% - {\ifnum\dohexstringtonumber#1#2=\zerocount0\else\ifnum\dohexstringtonumber#1#2=\plusone1\else - \expandafter\withoutpt\the\dimexpr\dohexstringtonumber#1#2\hexcolorfraction\relax - \fi\fi} - -\def\dohexcolorspec#1#2#3#4#5#6#7#8\relax - {\ifx#4\empty - s=\hexcolorcomponent#2#3% - \else - r=\hexcolorcomponent#2#3,g=\hexcolorcomponent#4#5,b=\hexcolorcomponent#6#7% - \fi} - -\def\dohexcolorpattern#1#2#3#4#5#6#7#8\relax - {0\ifx#4\empty - S:\hexcolorcomponent#2#3% - \else - R:\hexcolorcomponent#2#3:\hexcolorcomponent#4#5:\hexcolorcomponent#6#7% - \fi:0:0} - -\def\doifhexcolorelse#1% - {\expandafter\dodoifhexcolorelse#10\od} % 0 is a dirty trick to catch an empty #1 - -\def\dodoifhexcolorelse#1#2\od - {\ifnum`#1=\hexcolorprefix - \expandafter\firstoftwoarguments - \else - \expandafter\secondoftwoarguments - \fi} - -\def\docheckhexcolor#1% - {\doifhexcolorelse{#1}{\doifundefined{#1}{\setxvalue{\??cr#1}{\hexcolorpattern{#1}}}}\donothing} - -\def\checkhexcolor[#1]% - {\expanded{\docheckhexcolor{#1}}} - -\def\colorHpattern{\@EA\hexcolorpattern\@EA{\@EA*\@@cl@@h}} % * == dummy placeholder - -\let\dodododefinecolor\dododefinecolor % we will overload this one - -\def\dododefinecolor#1#2#3#4[#5][#6]% - {\doifhexcolorelse{#6} - {\setxvalue{\??cr#5}{\hexcolorpattern{#6}}} - {\dodododefinecolor#1#2#3#4[#5][#6]}} - -%D For Adam Lindsay and his XeTeX special driver: - -% because we intercept the zero condition, the .23pt in 1.23pt will disappear in the -% ifcase zero part branch - -\def\colorhexcomponent#1% - {\ifdim#1\points<.005\points - 00\else\lchexnumbers{\the\dimexpr255\dimexpr#1\points\relax+.5\points\relax}% - \fi} - -% the faster one - -\newdimen\hex@color@a \hex@color@a=.005pt -\newdimen\hex@color@b \hex@color@b=.5pt -\chardef \hex@color@c =255 - -\def\colorhexcomponent#1% - {\ifdim#1\points<\hex@color@a - 00\else\lchexnumbers{\the\dimexpr#1\points*\hex@color@c+\hex@color@b\relax}% - \fi} - -\protect \endinput diff --git a/tex/context/base/colo-hex.mkiv b/tex/context/base/colo-hex.mkiv deleted file mode 100644 index f661b2445..000000000 --- a/tex/context/base/colo-hex.mkiv +++ /dev/null @@ -1,28 +0,0 @@ -%D \module -%D [ file=colo-hex, -%D version=2004.06.23, -%D title=\CONTEXT\ Color Macros, -%D subtitle=Hex Colors, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This is built in. - -% \definecolor[rgbtestcolor] [r=0.87843,g=0.87451,b=0.89020] % RGB(224,223,227) -% \definecolor[hextestcolor] [\letterhash E0DFE3] % or [h=E0DFE3] -% -% \startMPpage -% path p ; % example by Peter Rolf -% p := unitsquare xyscaled(5cm,5cm) ; -% fill (point 0 of p -- point 1 of p -- point 2 of p --cycle) withcolor \MPcolor{rgbtestcolor} ; % bottom right part of the square -% fill (point 0 of p -- point 3 of p -- point 2 of p --cycle) withcolor \MPcolor{hextestcolor} ; % top left part -% \stopMPpage - -\def\checkhexcolor[#1]{\doifcolorelse{#1}\donothing{\definecolor[#1][x=#1]}} % is this ok? - -\endinput diff --git a/tex/context/base/colo-hex.tex b/tex/context/base/colo-hex.tex deleted file mode 100644 index 7d223c131..000000000 --- a/tex/context/base/colo-hex.tex +++ /dev/null @@ -1,3 +0,0 @@ -% this is just a stub - -\loadmarkfile{colo-hex} diff --git a/tex/context/base/colo-ini.mkiv b/tex/context/base/colo-ini.mkiv index 2d45c8edd..3b84634d2 100644 --- a/tex/context/base/colo-ini.mkiv +++ b/tex/context/base/colo-ini.mkiv @@ -219,7 +219,7 @@ {\def\colorstyle{#1}% \processcommalist[#1]\dodosetupcolor}} -\def\dodosetupcolor#1% +\def\dodosetupcolor#1% todo: mkii / mkiv {\startreadingfile \readsysfile{\truefilename{\f!colorprefix#1}} {\showcolormessage\m!colors4\colorstyle} diff --git a/tex/context/base/cont-fil.mkiv b/tex/context/base/cont-fil.mkiv index 181a881b5..2468f2998 100644 --- a/tex/context/base/cont-fil.mkiv +++ b/tex/context/base/cont-fil.mkiv @@ -28,19 +28,19 @@ \definefilesynonym [int-load] [set-11] \definefilesynonym [int-make] [set-12] -\definefilesynonym [fig-base] [fig-00] -\definefilesynonym [fig-make] [fig-01] -\definefilesynonym [fig-fake] [fig-02] -\definefilesynonym [fig-missing] [fig-06] + \definefilesynonym [fig-base] [fig-00] + \definefilesynonym [fig-make] [fig-01] + \definefilesynonym [fig-fake] [fig-02] + \definefilesynonym [fig-missing] [fig-06] \definefilesynonym [exi-interface] [exi-21] -\definefilesynonym [res-make] [res-01] -\definefilesynonym [res-base] [res-04] -\definefilesynonym [res-crop] [res-07] -\definefilesynonym [res-trace] [res-08] -\definefilesynonym [res-log] [res-09] -\definefilesynonym [res-identify] [res-12] + \definefilesynonym [res-make] [res-01] + \definefilesynonym [res-base] [res-04] + \definefilesynonym [res-crop] [res-07] + \definefilesynonym [res-trace] [res-08] + \definefilesynonym [res-log] [res-09] + \definefilesynonym [res-identify] [res-12] \definefilesynonym [med-show] [res-50] diff --git a/tex/context/base/cont-log.tex b/tex/context/base/cont-log.tex index 2d39c95e7..c89a2dd8f 100644 --- a/tex/context/base/cont-log.tex +++ b/tex/context/base/cont-log.tex @@ -254,7 +254,6 @@ \c!rulethickness=2pt] {Mk\ifnum\texengine=\luatexengine IV\else II\fi\\approved}} - % \unexpanded\def\luaTeX % {\dontleavehmode\begingroup % Lua% diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index 07c33cbd0..a1600a876 100644 --- a/tex/context/base/cont-new.mkii +++ b/tex/context/base/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2011.01.23 22:05} +\newcontextversion{2011.01.24 10:00} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index cfc6ddc10..e4ad7d28a 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2011.01.23 22:05} +\newcontextversion{2011.01.24 10:00} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/cont-old.tex b/tex/context/base/cont-old.tex deleted file mode 100644 index 360b5f2e6..000000000 --- a/tex/context/base/cont-old.tex +++ /dev/null @@ -1,48 +0,0 @@ -%D \module -%D [ file=cont-old, -%D version=1995.10.10, -%D title=\CONTEXT\ Miscellaneous Macros, -%D subtitle=Old Macros, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Old Macros} - -\unprotect - -\def\middleraggedness {6\bodyfontsize} - -\def\dosubstitutecommand#1#2% - {\writestatus\m!systems{\string#1\normalspace -> \string#2}% - \gdef#1{#2}% - #2} - -\def\substitutecommand#1#2% - {\gdef#1{\dosubstitutecommand{#1}{#2}}} - -\substitutecommand \volgendehoofdstuk {\setupheadnumber[hoofdstuk][+1]} -\substitutecommand \volgendeparagraaf {\setupheadnumber[paragraaf][+1]} -\substitutecommand \volgendesubparagraaf {\setupheadnumber[subparagraaf][+1]} -\substitutecommand \volgendesubsubparagraaf {\setupheadnumber[subsubparagraaf][+1]} - -\substitutecommand \volledigeinhoudsopgave \volledigeinhoud -\substitutecommand \plaatsinhoudsopgave \plaatsinhoud -\substitutecommand \stelinhoudsopgavein \stelinhoudin - -\substitutecommand \streep \onderstreep -\substitutecommand \strepen \onderstrepen - -\substitutecommand \pragmakenmerk \referral - -\substitutecommand \definieersynoniem \definesynonyms - -\substitutecommand \setupintermezzos \setupintermezzi - -\let \Everybodyfont \EveryBodyFont - -\protect \endinput diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex index bab5325eb..a58bf3377 100644 --- a/tex/context/base/context.tex +++ b/tex/context/base/context.tex @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2011.01.23 21:48} +\edef\contextversion{2011.01.24 10:00} %D For those who want to use this: diff --git a/tex/context/base/core-job.mkii b/tex/context/base/core-job.mkii index 1b7f9138e..2cd22e409 100644 --- a/tex/context/base/core-job.mkii +++ b/tex/context/base/core-job.mkii @@ -149,7 +149,8 @@ \disableXML \readsysfile{\f!errfilename.\mksuffix}\donothing\donothing \egroup - \to\everygoodbye}}}} + \to\everygoodbye}% + \donothing}}} %D Loading of \type {cont-usr.tex} (edited by the user) %D and \type {cont-fmt.tex} (generated by texexec). This is diff --git a/tex/context/base/l-os.lua b/tex/context/base/l-os.lua index c2e229834..0448710ff 100644 --- a/tex/context/base/l-os.lua +++ b/tex/context/base/l-os.lua @@ -212,7 +212,7 @@ elseif os.type == "windows" then elseif name == "linux" then function os.resolvers.platform(t,k) - -- we sometims have HOSTTYPE set so let's check that first + -- we sometimes have HOSTTYPE set so let's check that first local platform, architecture = "", os.getenv("HOSTTYPE") or os.resultof("uname -m") or "" if find(architecture,"x86_64") then platform = "linux-64" @@ -290,7 +290,7 @@ elseif name == "freebsd" then elseif name == "kfreebsd" then function os.resolvers.platform(t,k) - -- we sometims have HOSTTYPE set so let's check that first + -- we sometimes have HOSTTYPE set so let's check that first local platform, architecture = "", os.getenv("HOSTTYPE") or os.resultof("uname -m") or "" if find(architecture,"x86_64") then platform = "kfreebsd-amd64" diff --git a/tex/context/base/m-arabtex.mkii b/tex/context/base/m-arabtex.mkii new file mode 100644 index 000000000..61e56e93a --- /dev/null +++ b/tex/context/base/m-arabtex.mkii @@ -0,0 +1,450 @@ +%D \module +%D [ file=m-arabtex, % was font-arb, +%D version=2003.02.22, % 1999.11.06, +%D title=\CONTEXT\ Modules, +%D subtitle=Arabic, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% I still need to hook in some features into the setup +% macro. I also have to (re)define farsi etc. in ways +% similar to arab, so that we have dedicated environments. +% +% keywords needed: vocalize transscribe +% +% \startarabic[option=vocalize] % or vocalize=yes +% ...... +% \stoparabic + +\writestatus{loading}{ConTeXt Font Macros / ArabTeX support} + +%D At the \NTG\ 10\high{th} anniversary meeting Klaus Lagally +%D introduced the audience to arabic typesetting, and after +%D that I knew that some day I really had to look into his +%D generic package. And then, sort of simultaniously Maarten +%D Wisse and Imran Ahsan Nyazee asked me if \CONTEXT\ could +%D support \ARABTEX, a package that provides right to left +%D typesetting of (several variants of) arab and hebrew. +%D Having implemented support for chinese a few weeks before, +%D I could not resist to build in support for arab and hebrew +%D too. Writing support for languages that don't give me any +%D cue on how to pronounce their script, is kind of special. + +%D This is a beta version, since I still have to take care of some +%D macros that conflict with existing stuff. + +\unprotect + +\definesystemvariable{ARABTEX} + +\def\setupARABTEX + {\getparameters[\??ARABTEX]} + +\setupARABTEX + [\s!rscale=1.2, + \c!before=, + \c!after=, + \c!inner=\setarab, + \c!style=\setarabicfont\fontstylesuffix] + +%D A few (maybe too) simple hooks into the font mechanism. The +%D hook into the language module is not yet done. + +% \unexpanded\def\setarabicfont#1% rscale +% {\scratchdimen\@@ARABTEXrscale\bodyfontsize +% \font\arbfont\truefontname{Arabic#1} at \currentfontscale\scratchdimen +% \setx@skels +% \newfonttrue +% \arbfont} +% +% more modern +% +% \unexpanded\def\setarabicfont#1% rscale +% {\definefont[arbfont][Arabic#1 sa \@@ARABTEXrscale]% +% \setx@skels +% \newfonttrue +% \arbfont} +% +% more efficient + +\unexpanded\def\setarabicfont#1% + {\setx@skels + \newfonttrue + \definedfont[Arabic#1 sa \ARABTEXparameter\s!rscale]} + +%D Just to be compatible with Arab\TEX\ we define: + +\unexpanded\def\nash {\setarabicfont\s!Regular} +\unexpanded\def\nashbf {\setarabicfont\s!Bold } +\unexpanded\def\pnash {\setarabicfont\s!Regular} +\unexpanded\def\pnashbf{\setarabicfont\s!Bold } +\unexpanded\def\xnash {\setarabicfont\s!Regular} +\unexpanded\def\xnashbf{\setarabicfont\s!Bold } + +%D The display arabic environment (will be an installable +%D object) uses a few conditionals. Let's do it the +%D \CONTEXT\ way and define an anvironment that we later can +%D adapt. + +\newif\if@ignore +\newif\if@endpe + +\def\setupARABTEXalternative[#1]% + {\dodoubleempty\getparameters[\??ARABTEX#1]} + +\def\defineARABTEXalternative + {\dodoubleempty\dodefineARABTEXalternative} + +\def\dodefineARABTEXalternative[#1][#2]% + {\iffirstargument % \startarab is defined but used already + \getparameters + [\??ARABTEX#1] + [\c!before=\@@ARABTEXbefore, + \c!after=\@@ARABTEXafter, + \c!inner=\@@ARABTEXinner, + \c!style=\@@ARABTEXstyle, + \s!rscale=\@@ARABTEXrscale, + #2]% + \setvalue {\e!start#1}{\displayARABTEXalternative{#1}}% + \unexpanded\setvalue{#1}{\inlineARABTEXalternative {#1}}% + \unexpanded\def\RL{\getvalue{#1}}% + \unexpanded\def\LR{\a@LR}% + \let\R=\RL + \let\L=\LR + \expandafter\all@wcmd\csname\e!stop#1\endcsname + \else + \defineARABTEXalternative[arabic]% + \fi} + +\def\initializeARABTEXinternals + {\ARABTEXparameter\c!inner + \the\everyARABTEXpreset} + +\newtoks \everyARABTEXpreset + +\let\currentARABTEXalternative\empty + +\def\ARABTEXparameter#1% + {\csname\??ARABTEX\currentARABTEXalternative#1\endcsname} + +\def\inlineARABTEXalternative#1#2% + {\bgroup + \edef\currentARABTEXalternative{#1}% + \initializeARABTEXinternals + \a@RL{#2}% + \egroup} + +\def\displayARABTEXalternative#1% + {\dodoubleempty\dostartARABTEXalternative[#1]} + +\def\dostartARABTEXalternative[#1][#2]% + {\begingroup + \edef\currentARABTEXalternative{#1}% + \getparameters[\??ARABTEX\currentARABTEXalternative][#2]% + \ifnum1<0\ARABTEXparameter\c!n\relax + \startcolumns + \else + \ARABTEXparameter\c!before + \fi + \initializeARABTEXinternals + \initializeARABTEXend + \arabtext + \initializeARABTEXalternative} + +\def\initializeARABTEXalternative + {\ARABTEXparameter\c!style} + +\def\initializeARABTEXend% \CONTEXT\ does use \end quite differently + {\long\def\end##1% + {\endarabtext + \ifnum1<0\ARABTEXparameter\c!n\relax + \stopcolumns + \else + \ARABTEXparameter\c!after + \fi + \endgroup}% + \let\a@l@end\end + \letvalue{\e!stop\currentARABTEXalternative}=\end + \long\def\end##1% + {\endarabtext + \endgroup + \if@ignore\global\@ignorefalse\expandafter\ignorespaces\fi}} + +%D Arabic verbatim. + +\def\typearab{\a@@verb} + +%D Some \LATEX\ macros. + +\def \makeatletter{\unprotect} +\def \makeatother {\protect} +\def \typeout {\writestatus{arabtex}} + +%D We have to save some macros. + +\let\ARABTEXversion=\empty + +\def\startloadingARABTEX% ugly hacks + {\catcode`!=12 + \catcode`?=12 + \pushmacro\output \let \output \scratchtoks + \pushmacro\LaTeX \let \LaTeX \undefined + \pushmacro\CJK \let \CJK \undefined +% \pushmacro\peek@token \let \peek@token \undefined +% \pushmacro\edmacloaded \let \edmacloaded \undefined + \pushmacro\year \let \year \normalyear + \pushmacro\month \let \month \normalmonth + \pushmacro\day \let \day \normalday + \pushmacro\input \def \input ##1 {\normalinput ##1 } + \pushmacro\linewidth + \pushmacro\datum \def\datum {\toks0} + \pushmacro\version \def\version {\toks2} + \pushmacro\theversion \let\theversion \ARABTEXversion + \pushmacro\emphasize + \pushmacro\cap} + +\def\stoploadingARABTEX + {\catcode`!=11 + \catcode`?=11 + \popmacro\cap + \popmacro\emphasize + \popmacro\theversion + \popmacro\version + \popmacro\datum + \popmacro\linewidth + \popmacro\input + \popmacro\day + \popmacro\month + \popmacro\year +% \popmacro\edmacloaded +% \popmacro\peek@token + \popmacro\CJK + \popmacro\LaTeX + \popmacro\output} + +%D We save some macros: + +\startloadingARABTEX + +%D When loading \ARABTEX\ we have to set back the~! and~?. + +\input arabtex.sty + +%D Since \ARABTEX\ has its own \type {\cap}, we save the +%D new meaning. We also redefine some \PLAIN\ macros, which +%D happen to have a different meaning in \LATEX. + +\let\ARABTEXversion\theversion +\let\ARABTEXcap \cap + +\appendtoks + \let\cap\ARABTEXcap +\to \everyARABTEXpreset + +\def\ARABTEXsh@ft#1% + {\dimen@.00#1ex + \multiply\dimen@\slantperpoint + \kern-.0156\dimen@} + +\appendtoks + \let\sh@ft\ARABTEXsh@ft +\to \everyARABTEXpreset + +\def\ARABTEXd#1% + {{\o@lign{\relax#1\crcr\hidewidth\sh@ft{10}% + .\hidewidth}}} + +\def\ARABTEXb#1% + {{\o@lign{\relax#1\crcr\hidewidth\sh@ft{29}% + \vbox to.2ex{\hbox{\char22}\vss}\hidewidth}}} + +\appendtoks + \let\b\ARABTEXb + \let\d\ARABTEXd +\to \everyARABTEXpreset + +\def \ARABTEXbreakA {\hfill\break} +\def \ARABTEXbreakB {\break} +\edef\ARABTEXbar {\string|} +\def \ARABTEXcomma {\relax\ifmmode\mskip\thinmuskip\else\thinspace\fi} + +\appendtoks + \let\\=\ARABTEXbreakA + \let\|=\ARABTEXbreakB + \let |=\ARABTEXbar + \let\,=\ARABTEXcomma +\to \everyARABTEXpreset + +\let\ARABTEXprotect\relax + +\appendtoks + \let\protect\ARABTEXprotect +\to \everyARABTEXpreset + +%D Now we can pop the saved macros. + +\stoploadingARABTEX + +%D Ah, we have to get rid of some \type {\protect} stuff but +%D to permit testing we add it in the \CONTEXT\ way. + +% \bgroup +% \catcode`\<=\@other +% \unexpanded\gdef\a@ins +% {\ifmmode +% \expandafter<% +% \else +% \dontleavehmode \bgroup +% \arab@codes \set@arabfont \@waslafalse \@wasfalse +% \expandafter\arab@insert +% \fi} +% \unexpanded\gdef\<{\a@ins} +% \catcode`\<=\active +% \global\let<=\a@ins +% \egroup +% +% cleaner: + +\defineactivecharacter < {\a@ins} \unexpanded\gdef\<{\a@ins}% + +\def\normal@a@ins + {\dontleavehmode % context prefers this instead of \leavevmode + \bgroup + \arab@codes + \set@arabfont + \@waslafalse + \@wasfalse + \arab@insert} + +\unexpanded\gdef\a@ins + {\mathortext<\normal@a@ins} + +%D We also need to register a few macros: + +\all@wcmd\initializeARABTEXalternative % no argument, internal command +\all@wcmd\tx % no argument, small font +\all@wcmd\txx % no argument, smaller font + +%D We also hook it into the presetter. + +\appendtoks + \let\normaltx \tx \def\tx {\normaltx \setarabicfont\fontstylesuffix}% + \let\normaltxx\txx\def\txx{\normaltxx\setarabicfont\fontstylesuffix}% +\to \everyARABTEXpreset + +%D The main definitions are: + +\definefontsynonym [ArabicRegular] [xnsh14] +\definefontsynonym [ArabicBold] [xnsh14bf] + +\defineARABTEXalternative + [arabic] + [\c!inner=\setarab, + \c!style=\setarabicfont\fontstylesuffix] + +\defineARABTEXalternative + [farsi] + [\c!inner=\setfarsi, + \c!style=\setarabicfont\fontstylesuffix] + +\defineARABTEXalternative + [urdu] + [\c!inner=\seturdu, + \c!style=\setarabicfont\fontstylesuffix] + +\defineARABTEXalternative + [maghribi] + [\c!inner=\setmaghribi, + \c!style=\setarabicfont\fontstylesuffix] + +%D Apart from such definitions, one can adapt the settings +%D using \type {\setupARABTEXalternative}. +%D +%D A few years ago at the Holland Festivities, I attended {\em +%D The Cave}, one of the most impressive combinations of music +%D and video I know. This composition of Steve Reich (music) +%D and .. (video) concentrates on the common grounds of arabs +%D and jews: their ancestor Abram. Listening to the \CDROM's +%D of {\em The Cave}, provided me the right ambiance for +%D filling in the details of this module. In {\em The Cave}, +%D interviews, music, and |<|believe it or not|>| rhythmic +%D typography are the cornerstones. Remembering those big +%D screens, it strikes me that like music, \TEX\ too is a +%D perfect instrument to cross cultural and linguistic +%D borders. So, let's load Hebrew support as well: + +\unexpanded\def\sethebrewfont#1% + {\setx@skels + \newfonttrue + \definedfont[Hebrew#1 sa \ARABTEXparameter\s!rscale]} + +% \let \setheb \sethebrew + +\unexpanded\def\pheb {\sethebrewfont\s!Regular} +\unexpanded\def\phebbf{\sethebrewfont\s!Bold} + +% \startloadingARABTEX + +% \ReadFile{hebtex.sty} +% \ReadFile{apatch.sty} +% \ReadFile{hepatch.sty} + +% \stoploadingARABTEX + +\definefontsynonym [HebrewRegular] [hclassic] +\definefontsynonym [HebrewBold] [hcaption] + +\defineARABTEXalternative + [hebrew] + [\c!inner=\sethebrew, + \c!style=\sethebrewfont\fontstylesuffix] + +%D Now we're done: + +\protect \endinput + +% everyoutput : \charsubdefmax \arab@charsubdefmax + +% \defineconversion [abjad] [\abj@d] +% +% voetnoten verbatim lijsten indexen tabellen uitlijnen +% +% \v!hoofdstuk=al-fa.slu +% \v!inhoud=al-mu.htawayAtu +% \v!figuren=qA'imaTu al-.suwaru +% \v!tabellen=qA'imaTu al-^gadAwilu +% \v!grafieken=qA'imaTu al-rusUmu +% \v!index=al-fihrisu +% \v!bijlage=al-mul.haqu + +% \usemodule[arabtex] +% +% \usetypescript[postscript] \switchtotypeface[postscript] +% +% \setarab \novocalize +% +% \starttext +% +% \placecontent +% +% \section{\} % short arabic use \< .. > +% \section{\} % short arabic use \< .. > +% +% \startarabic +% mu.hammad 'i_d q"aAm zay"d" + i_d yaqUm zyd + A_d zyd q"aAm +% +% mu.hammad 'i_d q"aAm zay"d" + i_d yaqUm zyd + A_d zyd q"aAm +% \stoparabic +% +% \section{\} +% +% \startarabic +% mu.hammad 'i_d q"aAm zay"d" + i_d yaqUm zyd + A_d zyd q"aAm +% \stoparabic +% +% \stoptext diff --git a/tex/context/base/m-arabtex.tex b/tex/context/base/m-arabtex.tex deleted file mode 100644 index 61e56e93a..000000000 --- a/tex/context/base/m-arabtex.tex +++ /dev/null @@ -1,450 +0,0 @@ -%D \module -%D [ file=m-arabtex, % was font-arb, -%D version=2003.02.22, % 1999.11.06, -%D title=\CONTEXT\ Modules, -%D subtitle=Arabic, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% I still need to hook in some features into the setup -% macro. I also have to (re)define farsi etc. in ways -% similar to arab, so that we have dedicated environments. -% -% keywords needed: vocalize transscribe -% -% \startarabic[option=vocalize] % or vocalize=yes -% ...... -% \stoparabic - -\writestatus{loading}{ConTeXt Font Macros / ArabTeX support} - -%D At the \NTG\ 10\high{th} anniversary meeting Klaus Lagally -%D introduced the audience to arabic typesetting, and after -%D that I knew that some day I really had to look into his -%D generic package. And then, sort of simultaniously Maarten -%D Wisse and Imran Ahsan Nyazee asked me if \CONTEXT\ could -%D support \ARABTEX, a package that provides right to left -%D typesetting of (several variants of) arab and hebrew. -%D Having implemented support for chinese a few weeks before, -%D I could not resist to build in support for arab and hebrew -%D too. Writing support for languages that don't give me any -%D cue on how to pronounce their script, is kind of special. - -%D This is a beta version, since I still have to take care of some -%D macros that conflict with existing stuff. - -\unprotect - -\definesystemvariable{ARABTEX} - -\def\setupARABTEX - {\getparameters[\??ARABTEX]} - -\setupARABTEX - [\s!rscale=1.2, - \c!before=, - \c!after=, - \c!inner=\setarab, - \c!style=\setarabicfont\fontstylesuffix] - -%D A few (maybe too) simple hooks into the font mechanism. The -%D hook into the language module is not yet done. - -% \unexpanded\def\setarabicfont#1% rscale -% {\scratchdimen\@@ARABTEXrscale\bodyfontsize -% \font\arbfont\truefontname{Arabic#1} at \currentfontscale\scratchdimen -% \setx@skels -% \newfonttrue -% \arbfont} -% -% more modern -% -% \unexpanded\def\setarabicfont#1% rscale -% {\definefont[arbfont][Arabic#1 sa \@@ARABTEXrscale]% -% \setx@skels -% \newfonttrue -% \arbfont} -% -% more efficient - -\unexpanded\def\setarabicfont#1% - {\setx@skels - \newfonttrue - \definedfont[Arabic#1 sa \ARABTEXparameter\s!rscale]} - -%D Just to be compatible with Arab\TEX\ we define: - -\unexpanded\def\nash {\setarabicfont\s!Regular} -\unexpanded\def\nashbf {\setarabicfont\s!Bold } -\unexpanded\def\pnash {\setarabicfont\s!Regular} -\unexpanded\def\pnashbf{\setarabicfont\s!Bold } -\unexpanded\def\xnash {\setarabicfont\s!Regular} -\unexpanded\def\xnashbf{\setarabicfont\s!Bold } - -%D The display arabic environment (will be an installable -%D object) uses a few conditionals. Let's do it the -%D \CONTEXT\ way and define an anvironment that we later can -%D adapt. - -\newif\if@ignore -\newif\if@endpe - -\def\setupARABTEXalternative[#1]% - {\dodoubleempty\getparameters[\??ARABTEX#1]} - -\def\defineARABTEXalternative - {\dodoubleempty\dodefineARABTEXalternative} - -\def\dodefineARABTEXalternative[#1][#2]% - {\iffirstargument % \startarab is defined but used already - \getparameters - [\??ARABTEX#1] - [\c!before=\@@ARABTEXbefore, - \c!after=\@@ARABTEXafter, - \c!inner=\@@ARABTEXinner, - \c!style=\@@ARABTEXstyle, - \s!rscale=\@@ARABTEXrscale, - #2]% - \setvalue {\e!start#1}{\displayARABTEXalternative{#1}}% - \unexpanded\setvalue{#1}{\inlineARABTEXalternative {#1}}% - \unexpanded\def\RL{\getvalue{#1}}% - \unexpanded\def\LR{\a@LR}% - \let\R=\RL - \let\L=\LR - \expandafter\all@wcmd\csname\e!stop#1\endcsname - \else - \defineARABTEXalternative[arabic]% - \fi} - -\def\initializeARABTEXinternals - {\ARABTEXparameter\c!inner - \the\everyARABTEXpreset} - -\newtoks \everyARABTEXpreset - -\let\currentARABTEXalternative\empty - -\def\ARABTEXparameter#1% - {\csname\??ARABTEX\currentARABTEXalternative#1\endcsname} - -\def\inlineARABTEXalternative#1#2% - {\bgroup - \edef\currentARABTEXalternative{#1}% - \initializeARABTEXinternals - \a@RL{#2}% - \egroup} - -\def\displayARABTEXalternative#1% - {\dodoubleempty\dostartARABTEXalternative[#1]} - -\def\dostartARABTEXalternative[#1][#2]% - {\begingroup - \edef\currentARABTEXalternative{#1}% - \getparameters[\??ARABTEX\currentARABTEXalternative][#2]% - \ifnum1<0\ARABTEXparameter\c!n\relax - \startcolumns - \else - \ARABTEXparameter\c!before - \fi - \initializeARABTEXinternals - \initializeARABTEXend - \arabtext - \initializeARABTEXalternative} - -\def\initializeARABTEXalternative - {\ARABTEXparameter\c!style} - -\def\initializeARABTEXend% \CONTEXT\ does use \end quite differently - {\long\def\end##1% - {\endarabtext - \ifnum1<0\ARABTEXparameter\c!n\relax - \stopcolumns - \else - \ARABTEXparameter\c!after - \fi - \endgroup}% - \let\a@l@end\end - \letvalue{\e!stop\currentARABTEXalternative}=\end - \long\def\end##1% - {\endarabtext - \endgroup - \if@ignore\global\@ignorefalse\expandafter\ignorespaces\fi}} - -%D Arabic verbatim. - -\def\typearab{\a@@verb} - -%D Some \LATEX\ macros. - -\def \makeatletter{\unprotect} -\def \makeatother {\protect} -\def \typeout {\writestatus{arabtex}} - -%D We have to save some macros. - -\let\ARABTEXversion=\empty - -\def\startloadingARABTEX% ugly hacks - {\catcode`!=12 - \catcode`?=12 - \pushmacro\output \let \output \scratchtoks - \pushmacro\LaTeX \let \LaTeX \undefined - \pushmacro\CJK \let \CJK \undefined -% \pushmacro\peek@token \let \peek@token \undefined -% \pushmacro\edmacloaded \let \edmacloaded \undefined - \pushmacro\year \let \year \normalyear - \pushmacro\month \let \month \normalmonth - \pushmacro\day \let \day \normalday - \pushmacro\input \def \input ##1 {\normalinput ##1 } - \pushmacro\linewidth - \pushmacro\datum \def\datum {\toks0} - \pushmacro\version \def\version {\toks2} - \pushmacro\theversion \let\theversion \ARABTEXversion - \pushmacro\emphasize - \pushmacro\cap} - -\def\stoploadingARABTEX - {\catcode`!=11 - \catcode`?=11 - \popmacro\cap - \popmacro\emphasize - \popmacro\theversion - \popmacro\version - \popmacro\datum - \popmacro\linewidth - \popmacro\input - \popmacro\day - \popmacro\month - \popmacro\year -% \popmacro\edmacloaded -% \popmacro\peek@token - \popmacro\CJK - \popmacro\LaTeX - \popmacro\output} - -%D We save some macros: - -\startloadingARABTEX - -%D When loading \ARABTEX\ we have to set back the~! and~?. - -\input arabtex.sty - -%D Since \ARABTEX\ has its own \type {\cap}, we save the -%D new meaning. We also redefine some \PLAIN\ macros, which -%D happen to have a different meaning in \LATEX. - -\let\ARABTEXversion\theversion -\let\ARABTEXcap \cap - -\appendtoks - \let\cap\ARABTEXcap -\to \everyARABTEXpreset - -\def\ARABTEXsh@ft#1% - {\dimen@.00#1ex - \multiply\dimen@\slantperpoint - \kern-.0156\dimen@} - -\appendtoks - \let\sh@ft\ARABTEXsh@ft -\to \everyARABTEXpreset - -\def\ARABTEXd#1% - {{\o@lign{\relax#1\crcr\hidewidth\sh@ft{10}% - .\hidewidth}}} - -\def\ARABTEXb#1% - {{\o@lign{\relax#1\crcr\hidewidth\sh@ft{29}% - \vbox to.2ex{\hbox{\char22}\vss}\hidewidth}}} - -\appendtoks - \let\b\ARABTEXb - \let\d\ARABTEXd -\to \everyARABTEXpreset - -\def \ARABTEXbreakA {\hfill\break} -\def \ARABTEXbreakB {\break} -\edef\ARABTEXbar {\string|} -\def \ARABTEXcomma {\relax\ifmmode\mskip\thinmuskip\else\thinspace\fi} - -\appendtoks - \let\\=\ARABTEXbreakA - \let\|=\ARABTEXbreakB - \let |=\ARABTEXbar - \let\,=\ARABTEXcomma -\to \everyARABTEXpreset - -\let\ARABTEXprotect\relax - -\appendtoks - \let\protect\ARABTEXprotect -\to \everyARABTEXpreset - -%D Now we can pop the saved macros. - -\stoploadingARABTEX - -%D Ah, we have to get rid of some \type {\protect} stuff but -%D to permit testing we add it in the \CONTEXT\ way. - -% \bgroup -% \catcode`\<=\@other -% \unexpanded\gdef\a@ins -% {\ifmmode -% \expandafter<% -% \else -% \dontleavehmode \bgroup -% \arab@codes \set@arabfont \@waslafalse \@wasfalse -% \expandafter\arab@insert -% \fi} -% \unexpanded\gdef\<{\a@ins} -% \catcode`\<=\active -% \global\let<=\a@ins -% \egroup -% -% cleaner: - -\defineactivecharacter < {\a@ins} \unexpanded\gdef\<{\a@ins}% - -\def\normal@a@ins - {\dontleavehmode % context prefers this instead of \leavevmode - \bgroup - \arab@codes - \set@arabfont - \@waslafalse - \@wasfalse - \arab@insert} - -\unexpanded\gdef\a@ins - {\mathortext<\normal@a@ins} - -%D We also need to register a few macros: - -\all@wcmd\initializeARABTEXalternative % no argument, internal command -\all@wcmd\tx % no argument, small font -\all@wcmd\txx % no argument, smaller font - -%D We also hook it into the presetter. - -\appendtoks - \let\normaltx \tx \def\tx {\normaltx \setarabicfont\fontstylesuffix}% - \let\normaltxx\txx\def\txx{\normaltxx\setarabicfont\fontstylesuffix}% -\to \everyARABTEXpreset - -%D The main definitions are: - -\definefontsynonym [ArabicRegular] [xnsh14] -\definefontsynonym [ArabicBold] [xnsh14bf] - -\defineARABTEXalternative - [arabic] - [\c!inner=\setarab, - \c!style=\setarabicfont\fontstylesuffix] - -\defineARABTEXalternative - [farsi] - [\c!inner=\setfarsi, - \c!style=\setarabicfont\fontstylesuffix] - -\defineARABTEXalternative - [urdu] - [\c!inner=\seturdu, - \c!style=\setarabicfont\fontstylesuffix] - -\defineARABTEXalternative - [maghribi] - [\c!inner=\setmaghribi, - \c!style=\setarabicfont\fontstylesuffix] - -%D Apart from such definitions, one can adapt the settings -%D using \type {\setupARABTEXalternative}. -%D -%D A few years ago at the Holland Festivities, I attended {\em -%D The Cave}, one of the most impressive combinations of music -%D and video I know. This composition of Steve Reich (music) -%D and .. (video) concentrates on the common grounds of arabs -%D and jews: their ancestor Abram. Listening to the \CDROM's -%D of {\em The Cave}, provided me the right ambiance for -%D filling in the details of this module. In {\em The Cave}, -%D interviews, music, and |<|believe it or not|>| rhythmic -%D typography are the cornerstones. Remembering those big -%D screens, it strikes me that like music, \TEX\ too is a -%D perfect instrument to cross cultural and linguistic -%D borders. So, let's load Hebrew support as well: - -\unexpanded\def\sethebrewfont#1% - {\setx@skels - \newfonttrue - \definedfont[Hebrew#1 sa \ARABTEXparameter\s!rscale]} - -% \let \setheb \sethebrew - -\unexpanded\def\pheb {\sethebrewfont\s!Regular} -\unexpanded\def\phebbf{\sethebrewfont\s!Bold} - -% \startloadingARABTEX - -% \ReadFile{hebtex.sty} -% \ReadFile{apatch.sty} -% \ReadFile{hepatch.sty} - -% \stoploadingARABTEX - -\definefontsynonym [HebrewRegular] [hclassic] -\definefontsynonym [HebrewBold] [hcaption] - -\defineARABTEXalternative - [hebrew] - [\c!inner=\sethebrew, - \c!style=\sethebrewfont\fontstylesuffix] - -%D Now we're done: - -\protect \endinput - -% everyoutput : \charsubdefmax \arab@charsubdefmax - -% \defineconversion [abjad] [\abj@d] -% -% voetnoten verbatim lijsten indexen tabellen uitlijnen -% -% \v!hoofdstuk=al-fa.slu -% \v!inhoud=al-mu.htawayAtu -% \v!figuren=qA'imaTu al-.suwaru -% \v!tabellen=qA'imaTu al-^gadAwilu -% \v!grafieken=qA'imaTu al-rusUmu -% \v!index=al-fihrisu -% \v!bijlage=al-mul.haqu - -% \usemodule[arabtex] -% -% \usetypescript[postscript] \switchtotypeface[postscript] -% -% \setarab \novocalize -% -% \starttext -% -% \placecontent -% -% \section{\} % short arabic use \< .. > -% \section{\} % short arabic use \< .. > -% -% \startarabic -% mu.hammad 'i_d q"aAm zay"d" + i_d yaqUm zyd + A_d zyd q"aAm -% -% mu.hammad 'i_d q"aAm zay"d" + i_d yaqUm zyd + A_d zyd q"aAm -% \stoparabic -% -% \section{\} -% -% \startarabic -% mu.hammad 'i_d q"aAm zay"d" + i_d yaqUm zyd + A_d zyd q"aAm -% \stoparabic -% -% \stoptext diff --git a/tex/context/base/m-directives.mkiv b/tex/context/base/m-directives.mkiv new file mode 100644 index 000000000..8b551b27a --- /dev/null +++ b/tex/context/base/m-directives.mkiv @@ -0,0 +1,3 @@ +\starttext + \showdirectives +\stoptext diff --git a/tex/context/base/m-directives.tex b/tex/context/base/m-directives.tex deleted file mode 100644 index c958f6cad..000000000 --- a/tex/context/base/m-directives.tex +++ /dev/null @@ -1,5 +0,0 @@ -\doifnotmode{mkiv} {\endinput} - -\starttext - \showdirectives -\stoptext diff --git a/tex/context/base/m-dratex.mkii b/tex/context/base/m-dratex.mkii new file mode 100644 index 000000000..6c088daf9 --- /dev/null +++ b/tex/context/base/m-dratex.mkii @@ -0,0 +1,21 @@ +%D \module +%D [ file=m-dratex, +%D version=2005.11.25, +%D title=\CONTEXT\ Extra Modules, +%D subtitle=\DRATEX\ Loading Macros, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details + +\readfile{DraTex.sty}{}{\readfile{dratex.sty}{}{\endinput}} + +\letvalue{:NewCount}\newcount +\letvalue{:NewDimen}\newdimen + +\readfile{AlDraTex.sty}{}{\readfile{aldratex.sty}{}{\endinput}} + +\endinput diff --git a/tex/context/base/m-dratex.tex b/tex/context/base/m-dratex.tex deleted file mode 100644 index 6c088daf9..000000000 --- a/tex/context/base/m-dratex.tex +++ /dev/null @@ -1,21 +0,0 @@ -%D \module -%D [ file=m-dratex, -%D version=2005.11.25, -%D title=\CONTEXT\ Extra Modules, -%D subtitle=\DRATEX\ Loading Macros, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details - -\readfile{DraTex.sty}{}{\readfile{dratex.sty}{}{\endinput}} - -\letvalue{:NewCount}\newcount -\letvalue{:NewDimen}\newdimen - -\readfile{AlDraTex.sty}{}{\readfile{aldratex.sty}{}{\endinput}} - -\endinput diff --git a/tex/context/base/m-edtsnc.mkii b/tex/context/base/m-edtsnc.mkii new file mode 100644 index 000000000..0926f4488 --- /dev/null +++ b/tex/context/base/m-edtsnc.mkii @@ -0,0 +1,207 @@ +%D \module +%D [ file=m-editsnc, +%D version=2003.12.23, +%D title=\CONTEXT\ Modules, +%D subtitle=Editor Synchronization, +%D author={Hans Hagen \& Ton Otten}, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.edit for +%C details. + +% \enablemode[demo] + +% This file is a variation of the file m-pdfsync. This time we do it +% in a more abstract way and prepare ourselves for support in dvi +% output. + +% \enableeditsync +% \disableeditsync +% \editsync +% \editsynctext {string} +% \editsyncnode {char} +% \editsynctracemode [chardef: 0-4] + +\writestatus{editsync}{loading and enabling editor synchronization support} + +\unprotect % not really needed + +\ifx\pdfoutput\undefined + \donefalse +\else\ifcase\pdfoutput + \donefalse +\else\ifx\pdfsavepos\undefined + \donefalse +\else + \donetrue +\fi\fi\fi + +\chardef \editsyncstate \zerocount +\chardef \editsynctracemode \zerocount +\newcount \editsynccounter +\newwrite \editsyncwrite + +\def\enableeditsync {\chardef\editsyncstate\plusone} +\def\disableeditsync{\chardef\editsyncstate\zerocount} + +% The following definitions can go into the special drivers, but +% for the moment we do it this way. + +\ifdone + + \def\dostarteditsync + {\immediate\openout\editsyncwrite\jobname.pdfsync + \immediate\write\editsyncwrite{\jobname}% + \immediate\write\editsyncwrite{version 0}} + + \def\dostopeditsync + {\closeout\editsyncwrite} + + \def\doeditsyncregisterpage#1{\immediate\write\editsyncwrite{s\space\number#1}} + \def\doeditsyncopenfile #1{\immediate\write\editsyncwrite{(\space#1}} + \def\doeditsyncclosefile #1{\immediate\write\editsyncwrite{)}} + + \def\doregistereditsyncnode#1#2#3% tag counter linenumber + {\pdfsavepos + \immediate\write\editsyncwrite{l\space\number#2\space\number#3}% + \expanded{\write\editsyncwrite{p\ifnum#1=\plusone*\fi\space\number#2\space\noexpand\the\pdflastxpos\space\noexpand\the\pdflastypos}}} + +\else + + \let\dostarteditsync \relax + \let\dostopeditsync \relax + + \let\doeditsyncregisterpage\gobbleoneargument + \let\doeditsyncopenfile \gobbleoneargument + \let\doeditsyncclosefile \gobbleoneargument + \let\doregistereditsyncnode\gobblethreearguments + + % These specials could be filtered by a dvitopdf backend and + % written to a jobname.pdfsync file. In that case, the x and + % y coordinates have to be to be resolved by driver. + + % \def\doeditsyncregisterpage#1{\special{pdfsync: s\space\number#1}} + % \def\doeditsyncopenfile #1{\special{pdfsync: ( #1}} + % \def\doeditsyncclosefile #1{\special{pdfsync: )}} + + % \def\doregistereditsyncnode#1#2#3% + % {\special{pdfsync: l the\editsynccounter\space\number#3}% + % \special{pdfsync: p\ifnum#1=\plusone*\fi\space\number#2}} + +\fi + +\let\editsynctracer\gobbleoneargument + +\editsynccounter\minusone % counting starts at zero and we increment beforehand + +\def\registereditsyncnode#1% we assume #1 is one token + {\ifcase\editsyncstate + \expandafter\gobbleoneargument + \else + \global\advance\editsynccounter\plusone + \doregistereditsyncnode#1\editsynccounter\inputlineno + \expandafter\editsynctracer + \fi} + +\def\editsync {\registereditsyncnode\plusone *} +\def\editsyncnode{\registereditsyncnode\zerocount} +\def\editsynctext{\registereditsyncnode\plusone } + +\appendtoks \dostarteditsync \to \everystarttext +%appendtoks \dostopeditsync \to \everystoptext +\appendtoks \doeditsyncregisterpage\realfolio \to \everyshipout +\appendtoks \doeditsyncopenfile\readfilename \to \everybeforereadfile +\appendtoks \doeditsyncclosefile\readfilename \to \everyafterreadfile + +\appendtoks \enableeditsync \to \everystarttext +\appendtoks \disableeditsync \to \everypagebody + +\def\editsynctracer#1% + {\ifcase\editsynctracemode\else + \begingroup + \forgetall + \disableeditsync + \ifcase\editsynctracemode\or % could be done more efficient, box around ifcase + \setbox\scratchbox\hbox to \zeropoint{\hss\infofont#1\hss}% 1 + \else + \setbox\scratchbox\hbox to \zeropoint{\hss\traceboxplacementtrue\boxcursor\hss}% 2/3/4 + \fi + \smashbox\scratchbox\box\scratchbox + \ifcase\editsynctracemode\or\or\or + \setbox\scratchbox\hbox to \zeropoint{\hss\raise1.25ex\hbox{\infofont#1}\hss}% 3 + \smashbox\scratchbox\box\scratchbox + \or + \setbox\scratchbox\hbox to \zeropoint{\hss\lower1.25ex\hbox{\infofont#1}\hss}% 4 + \smashbox\scratchbox\box\scratchbox + \fi + \endgroup + \fi} + +% \def\editsynctracer#1% more efficient but unreadable +% {\ifcase\editsynctracemode\else +% \ifcase\editsyncstate\else +% \begingroup +% \forgetall +% \disableeditsync +% \setbox\scratchbox\hbox to \zeropoint +% {\hss +% \ifcase\editsynctracemode\or +% \infofont#1% 1 +% \else +% \traceboxplacementtrue\boxcursor% 2/3/4 +% \fi +% \hss}% +% \smashbox\scratchbox\box\scratchbox +% \setbox\scratchbox\hbox to \zeropoint +% {\hss +% \ifcase\editsynctracemode\or\or\or +% \raise1.25ex\hbox{\infofont#1}% 3 +% \or +% \lower1.25ex\hbox{\infofont#1}% 4 +% \fi +% \hss}% +% \smashbox\scratchbox\box\scratchbox +% \endgroup +% \fi +% \fi} + +% beware, adding nodes this way will interfere with the typesetting + +\appendtoks \editsyncnode p\to \everypar +\appendtoks \editsyncnode m\to \everymath +\appendtoks \editsyncnode d\to \everydisplay +\appendtoks \editsyncnode h\to \everyhbox + +% For compatibility with 'pdfsync4context' we provide: + +\let\pdfsyncstart\enableeditsync +\let\pdfsyncstop \disablepdfsync +\let\pdfsync \editsync + +\protect + +\doifnotmode{demo}{\endinput} + +\chardef\editsynctracemode=3 + +\starttext + +\chapter{Test} + +\processfile{tufte} + +\startitemize +\item first +\item second +\stopitemize + +\processfile{tufte} + +\startlines +some local \editsync sync and \editsynctext{here}a marked point +some local \editsync sync and \editsyncnode{here}a marked point +\stoplines + +\stoptext diff --git a/tex/context/base/m-edtsnc.tex b/tex/context/base/m-edtsnc.tex deleted file mode 100644 index 0926f4488..000000000 --- a/tex/context/base/m-edtsnc.tex +++ /dev/null @@ -1,207 +0,0 @@ -%D \module -%D [ file=m-editsnc, -%D version=2003.12.23, -%D title=\CONTEXT\ Modules, -%D subtitle=Editor Synchronization, -%D author={Hans Hagen \& Ton Otten}, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.edit for -%C details. - -% \enablemode[demo] - -% This file is a variation of the file m-pdfsync. This time we do it -% in a more abstract way and prepare ourselves for support in dvi -% output. - -% \enableeditsync -% \disableeditsync -% \editsync -% \editsynctext {string} -% \editsyncnode {char} -% \editsynctracemode [chardef: 0-4] - -\writestatus{editsync}{loading and enabling editor synchronization support} - -\unprotect % not really needed - -\ifx\pdfoutput\undefined - \donefalse -\else\ifcase\pdfoutput - \donefalse -\else\ifx\pdfsavepos\undefined - \donefalse -\else - \donetrue -\fi\fi\fi - -\chardef \editsyncstate \zerocount -\chardef \editsynctracemode \zerocount -\newcount \editsynccounter -\newwrite \editsyncwrite - -\def\enableeditsync {\chardef\editsyncstate\plusone} -\def\disableeditsync{\chardef\editsyncstate\zerocount} - -% The following definitions can go into the special drivers, but -% for the moment we do it this way. - -\ifdone - - \def\dostarteditsync - {\immediate\openout\editsyncwrite\jobname.pdfsync - \immediate\write\editsyncwrite{\jobname}% - \immediate\write\editsyncwrite{version 0}} - - \def\dostopeditsync - {\closeout\editsyncwrite} - - \def\doeditsyncregisterpage#1{\immediate\write\editsyncwrite{s\space\number#1}} - \def\doeditsyncopenfile #1{\immediate\write\editsyncwrite{(\space#1}} - \def\doeditsyncclosefile #1{\immediate\write\editsyncwrite{)}} - - \def\doregistereditsyncnode#1#2#3% tag counter linenumber - {\pdfsavepos - \immediate\write\editsyncwrite{l\space\number#2\space\number#3}% - \expanded{\write\editsyncwrite{p\ifnum#1=\plusone*\fi\space\number#2\space\noexpand\the\pdflastxpos\space\noexpand\the\pdflastypos}}} - -\else - - \let\dostarteditsync \relax - \let\dostopeditsync \relax - - \let\doeditsyncregisterpage\gobbleoneargument - \let\doeditsyncopenfile \gobbleoneargument - \let\doeditsyncclosefile \gobbleoneargument - \let\doregistereditsyncnode\gobblethreearguments - - % These specials could be filtered by a dvitopdf backend and - % written to a jobname.pdfsync file. In that case, the x and - % y coordinates have to be to be resolved by driver. - - % \def\doeditsyncregisterpage#1{\special{pdfsync: s\space\number#1}} - % \def\doeditsyncopenfile #1{\special{pdfsync: ( #1}} - % \def\doeditsyncclosefile #1{\special{pdfsync: )}} - - % \def\doregistereditsyncnode#1#2#3% - % {\special{pdfsync: l the\editsynccounter\space\number#3}% - % \special{pdfsync: p\ifnum#1=\plusone*\fi\space\number#2}} - -\fi - -\let\editsynctracer\gobbleoneargument - -\editsynccounter\minusone % counting starts at zero and we increment beforehand - -\def\registereditsyncnode#1% we assume #1 is one token - {\ifcase\editsyncstate - \expandafter\gobbleoneargument - \else - \global\advance\editsynccounter\plusone - \doregistereditsyncnode#1\editsynccounter\inputlineno - \expandafter\editsynctracer - \fi} - -\def\editsync {\registereditsyncnode\plusone *} -\def\editsyncnode{\registereditsyncnode\zerocount} -\def\editsynctext{\registereditsyncnode\plusone } - -\appendtoks \dostarteditsync \to \everystarttext -%appendtoks \dostopeditsync \to \everystoptext -\appendtoks \doeditsyncregisterpage\realfolio \to \everyshipout -\appendtoks \doeditsyncopenfile\readfilename \to \everybeforereadfile -\appendtoks \doeditsyncclosefile\readfilename \to \everyafterreadfile - -\appendtoks \enableeditsync \to \everystarttext -\appendtoks \disableeditsync \to \everypagebody - -\def\editsynctracer#1% - {\ifcase\editsynctracemode\else - \begingroup - \forgetall - \disableeditsync - \ifcase\editsynctracemode\or % could be done more efficient, box around ifcase - \setbox\scratchbox\hbox to \zeropoint{\hss\infofont#1\hss}% 1 - \else - \setbox\scratchbox\hbox to \zeropoint{\hss\traceboxplacementtrue\boxcursor\hss}% 2/3/4 - \fi - \smashbox\scratchbox\box\scratchbox - \ifcase\editsynctracemode\or\or\or - \setbox\scratchbox\hbox to \zeropoint{\hss\raise1.25ex\hbox{\infofont#1}\hss}% 3 - \smashbox\scratchbox\box\scratchbox - \or - \setbox\scratchbox\hbox to \zeropoint{\hss\lower1.25ex\hbox{\infofont#1}\hss}% 4 - \smashbox\scratchbox\box\scratchbox - \fi - \endgroup - \fi} - -% \def\editsynctracer#1% more efficient but unreadable -% {\ifcase\editsynctracemode\else -% \ifcase\editsyncstate\else -% \begingroup -% \forgetall -% \disableeditsync -% \setbox\scratchbox\hbox to \zeropoint -% {\hss -% \ifcase\editsynctracemode\or -% \infofont#1% 1 -% \else -% \traceboxplacementtrue\boxcursor% 2/3/4 -% \fi -% \hss}% -% \smashbox\scratchbox\box\scratchbox -% \setbox\scratchbox\hbox to \zeropoint -% {\hss -% \ifcase\editsynctracemode\or\or\or -% \raise1.25ex\hbox{\infofont#1}% 3 -% \or -% \lower1.25ex\hbox{\infofont#1}% 4 -% \fi -% \hss}% -% \smashbox\scratchbox\box\scratchbox -% \endgroup -% \fi -% \fi} - -% beware, adding nodes this way will interfere with the typesetting - -\appendtoks \editsyncnode p\to \everypar -\appendtoks \editsyncnode m\to \everymath -\appendtoks \editsyncnode d\to \everydisplay -\appendtoks \editsyncnode h\to \everyhbox - -% For compatibility with 'pdfsync4context' we provide: - -\let\pdfsyncstart\enableeditsync -\let\pdfsyncstop \disablepdfsync -\let\pdfsync \editsync - -\protect - -\doifnotmode{demo}{\endinput} - -\chardef\editsynctracemode=3 - -\starttext - -\chapter{Test} - -\processfile{tufte} - -\startitemize -\item first -\item second -\stopitemize - -\processfile{tufte} - -\startlines -some local \editsync sync and \editsynctext{here}a marked point -some local \editsync sync and \editsyncnode{here}a marked point -\stoplines - -\stoptext diff --git a/tex/context/base/m-level.mkii b/tex/context/base/m-level.mkii new file mode 100644 index 000000000..67d598733 --- /dev/null +++ b/tex/context/base/m-level.mkii @@ -0,0 +1,94 @@ +%D \module +%D [ file=level, +%D version=2002.10.20, +%D title=\CONTEXT\ Extra Modules, +%D subtitle=Catching Nesting Errors, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=\PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\unprotect + +\newcount\currentnesting + +\def\startnesting#1% + {\global\advance\currentnesting\plusone + \setxvalue{level::\number\currentnesting}{#1}} + +\def\stopnesting#1% + {\edef\nestingstring{#1}% + \relax\ifnum\currentnesting>\zerocount + \doifelsevalue{level::\number\currentnesting}\nestingstring + {\global\advance\currentnesting\minusone} + {\@EA\reportnestingerror\@EA\stoptext} + \else + \@EA\reportnestingerror\@EA\stoptext + \fi} + +\def\checknesting + {\relax\ifnum\currentnesting>\zerocount + \def\nestingstring{end of document}% + \@EA\reportnestingerror + \fi} + +\def\reportnestingerror + {\endgraf + \global\let\checknesting\relax + \bgroup \definedfont[Mono at 18pt]\incolortrue + \setupinterlinespace + \raggedright + \bgroup \red + \ifnum\currentnesting>\plusone + wrong end level + \else + too many end levels + \fi + at \nestingstring\space in line \number\inputlineno + \ifnum\currentnesting>\zerocount, stack:\fi\endgraf + \egroup + \dostepwiserecurse\currentnesting\plusone\minusone + {\space\getvalue{level::\recurselevel}} + \endgraf + \egroup + \writestatus\m!systems{quitting due to level error}\wait + \batchmode} + +\prependtoks + \checknesting +\to \everystoptext + +\protect \doifnotmode{demo}{\endinput} + +\starttext + +% \startnesting{eerste} +% \startnesting{tweede} +% \startnesting{derde} +% \startnesting{vierde} +% test +% \stopnesting{vierde} +% \stopnesting{eerste} + +% \startnesting{eerste} +% \startnesting{tweede} +% test +% \stopnesting{vierde} +% \stopnesting{derde} +% \stopnesting{tweede} +% \stopnesting{eerste} + +\startnesting{eerste} + \startnesting{tweede} + \startnesting{derde} + \startnesting{vierde} + test + \stopnesting{vierde} + \stopnesting{derde} + \stopnesting{tweede} +\stopnesting{eerste} + +\stoptext diff --git a/tex/context/base/m-level.tex b/tex/context/base/m-level.tex deleted file mode 100644 index 67d598733..000000000 --- a/tex/context/base/m-level.tex +++ /dev/null @@ -1,94 +0,0 @@ -%D \module -%D [ file=level, -%D version=2002.10.20, -%D title=\CONTEXT\ Extra Modules, -%D subtitle=Catching Nesting Errors, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=\PRAGMA] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\unprotect - -\newcount\currentnesting - -\def\startnesting#1% - {\global\advance\currentnesting\plusone - \setxvalue{level::\number\currentnesting}{#1}} - -\def\stopnesting#1% - {\edef\nestingstring{#1}% - \relax\ifnum\currentnesting>\zerocount - \doifelsevalue{level::\number\currentnesting}\nestingstring - {\global\advance\currentnesting\minusone} - {\@EA\reportnestingerror\@EA\stoptext} - \else - \@EA\reportnestingerror\@EA\stoptext - \fi} - -\def\checknesting - {\relax\ifnum\currentnesting>\zerocount - \def\nestingstring{end of document}% - \@EA\reportnestingerror - \fi} - -\def\reportnestingerror - {\endgraf - \global\let\checknesting\relax - \bgroup \definedfont[Mono at 18pt]\incolortrue - \setupinterlinespace - \raggedright - \bgroup \red - \ifnum\currentnesting>\plusone - wrong end level - \else - too many end levels - \fi - at \nestingstring\space in line \number\inputlineno - \ifnum\currentnesting>\zerocount, stack:\fi\endgraf - \egroup - \dostepwiserecurse\currentnesting\plusone\minusone - {\space\getvalue{level::\recurselevel}} - \endgraf - \egroup - \writestatus\m!systems{quitting due to level error}\wait - \batchmode} - -\prependtoks - \checknesting -\to \everystoptext - -\protect \doifnotmode{demo}{\endinput} - -\starttext - -% \startnesting{eerste} -% \startnesting{tweede} -% \startnesting{derde} -% \startnesting{vierde} -% test -% \stopnesting{vierde} -% \stopnesting{eerste} - -% \startnesting{eerste} -% \startnesting{tweede} -% test -% \stopnesting{vierde} -% \stopnesting{derde} -% \stopnesting{tweede} -% \stopnesting{eerste} - -\startnesting{eerste} - \startnesting{tweede} - \startnesting{derde} - \startnesting{vierde} - test - \stopnesting{vierde} - \stopnesting{derde} - \stopnesting{tweede} -\stopnesting{eerste} - -\stoptext diff --git a/tex/context/base/m-mkivhacks.mkiv b/tex/context/base/m-mkivhacks.mkiv new file mode 100644 index 000000000..0e959110e --- /dev/null +++ b/tex/context/base/m-mkivhacks.mkiv @@ -0,0 +1,50 @@ +%D \module +%D [ file=m-mkivhacks, +%D version=2008.10.20, +%D title=\CONTEXT\ Modules, +%D subtitle=Temporary Compatilibility Hacks, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D For Aditya, who needed it for his thesis. + +\startluacode + -- -- a lot or work + -- + -- mathematics.slots.euler = { + -- [0x03B1] = { "mr", 0x0B }, -- alpha + -- } + -- + -- mathematics.slots.euler = table.merge(mathematics.slots.traditional,mathematics.slots.euler) + -- + -- versus a quick hack + + document.hacks = document.hacks or { } + + function document.hacks() + mathematics.families.lcgreek = mathematics.families.mr + mathematics.families.ucgreek = mathematics.families.mr + mathematics.families.vargreek = mathematics.families.mr + + mathematics.define(mathematics.slots.euler) + end +\stopluacode + +% \usemodule[mkivhacks] \setups{eulermath} +% \definetypeface[modern][mm][math][euler][default] +% \usemathcollection[eul] +% \switchtobodyfont[modern,11pt] +% \starttext +% $\alpha$ +% \stoptext + +\startsetups eulermath + \ctxlua{document.hacks()} +\stopsetups + +\endinput diff --git a/tex/context/base/m-mkivhacks.tex b/tex/context/base/m-mkivhacks.tex deleted file mode 100644 index f47658739..000000000 --- a/tex/context/base/m-mkivhacks.tex +++ /dev/null @@ -1,52 +0,0 @@ -%D \module -%D [ file=m-mkivhacks, -%D version=2008.10.20, -%D title=\CONTEXT\ Modules, -%D subtitle=Temporary Compatilibility Hacks, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\doifnotmode{mkiv}{\endinput} - -%D For Aditya, who needed it for his thesis. - -\startluacode - -- -- a lot or work - -- - -- mathematics.slots.euler = { - -- [0x03B1] = { "mr", 0x0B }, -- alpha - -- } - -- - -- mathematics.slots.euler = table.merge(mathematics.slots.traditional,mathematics.slots.euler) - -- - -- versus a quick hack - - document.hacks = document.hacks or { } - - function document.hacks() - mathematics.families.lcgreek = mathematics.families.mr - mathematics.families.ucgreek = mathematics.families.mr - mathematics.families.vargreek = mathematics.families.mr - - mathematics.define(mathematics.slots.euler) - end -\stopluacode - -% \usemodule[mkivhacks] \setups{eulermath} -% \definetypeface[modern][mm][math][euler][default] -% \usemathcollection[eul] -% \switchtobodyfont[modern,11pt] -% \starttext -% $\alpha$ -% \stoptext - -\startsetups eulermath - \ctxlua{document.hacks()} -\stopsetups - -\endinput diff --git a/tex/context/base/m-pdfsnc.mkii b/tex/context/base/m-pdfsnc.mkii new file mode 100644 index 000000000..da59ab5d8 --- /dev/null +++ b/tex/context/base/m-pdfsnc.mkii @@ -0,0 +1,200 @@ +%D \module +%D [ file=m-pdfsnc, +%D version=2003.12.23, +%D title=\CONTEXT\ Modules, +%D subtitle=Editor Synchronization, +%D author={Hans Hagen \& Ton Otten}, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% \enablemode[demo] + +% This file is a variation of the file pdfsync4context.tex that ships +% with the pdfsync package (used by iTeXMac and TeXShop) by Piero +% D'Ancona and Jérôme Laurens. I made the macros a bit more efficient +% and added some basic tracing options as well as a few more options. +% I made this one while playing a bit with the Mac and TeX). Maybe I'll +% add a bit of support to the kernel in in order to get rid of redundant +% markers. Also, this had better be rewritten in a bit less \pdf +% dependent way so that it can also be supported by dvipdfmx. I could +% write a generic file as well, but since there is already support for +% other packages I'll not do that (now). + +% compatible commands: +% +% \pdfsyncstart \pdfsyncstop \pdfsync +% +% extra commands: +% +% \enablepdfsync \disablepdfsync \pdfsynctext \pdfsyncnode \pdfsynctracemode + +\ifx\pdfoutput\undefined + \donefalse +\else\ifcase\pdfoutput + \donefalse +\else\ifx\pdfsavepos\undefined + \donefalse +\else + \donetrue +\fi\fi\fi + +\chardef \pdfsyncstate \zerocount +\chardef \pdfsynctracemode \zerocount + +\ifdone + + \writestatus{pdfsync}{loading and enabling synchronization support} + +\else + + \writestatus{pdfsync}{synchronization is only available with pdftex} + + \let \pdfsyncstart \relax % brr, not per se symmetrically used, so + \let \pdfsyncstop \relax % enable and disable are better names + \let \pdfsync \relax + + \let \pdfsynctext \gobbleoneargument + \let \pdfsyncnode \gobbleoneargument + + \let \enablepdfsync \pdfsyncstart + \let \disablepdfsync \pdfsyncstop + + \expandafter\endinput +\fi + +\unprotect % not really needed + +\newcount \pdfsynccounter +\newwrite \pdfsyncwrite + +\def\pdfsyncstart{\chardef\pdfsyncstate\plusone} \let\enablepdfsync \pdfsyncstart +\def\pdfsyncstop {\chardef\pdfsyncstate\zerocount} \let\disablepdfsync\pdfsyncstop + +\def\dostartpdfsync + {\immediate\openout\pdfsyncwrite\jobname.pdfsync + \immediate\write\pdfsyncwrite{\jobname}% + \immediate\write\pdfsyncwrite{version 0}} + +\def\dostoppdfsync + {\immediate\closeout\pdfsyncwrite} + +\def\doregisterpdfsyncpage + {\immediate\write\pdfsyncwrite{s\space\realfolio}} + +\def\dopdfsyncopenfile + {\immediate\write\pdfsyncwrite{(\space\readfilename}} + +\def\dopdfsyncclosefile + {\immediate\write\pdfsyncwrite{)}} + +\def\doregisterpdfsyncnode#1% + {\ifcase\pdfsyncstate\else + \pdfsavepos + \immediate\write\pdfsyncwrite{l\space\the\pdfsynccounter\space\the\inputlineno}% + \expanded{\write\pdfsyncwrite{p\ifnum#1=\plusone*\fi\space\the\pdfsynccounter\space\noexpand\the\pdflastxpos\space\noexpand\the\pdflastypos}}% + \global\advance\pdfsynccounter\plusone + \fi} + +\let\pdfsynctracer\gobbleoneargument + +\def\pdfsync {\doregisterpdfsyncnode\plusone \pdfsynctracer*} +\def\pdfsyncnode{\doregisterpdfsyncnode\zerocount\pdfsynctracer} +\def\pdfsynctext{\doregisterpdfsyncnode\plusone \pdfsynctracer} + +\appendtoks \dostartpdfsync \to \everystarttext +%appendtoks \dostoppdfsync \to \everystoptext +\appendtoks \doregisterpdfsyncpage \to \everyshipout +\appendtoks \dopdfsyncopenfile \to \everybeforereadfile +\appendtoks \dopdfsyncclosefile \to \everyafterreadfile + +\appendtoks \enablepdfsync \to \everystarttext +\appendtoks \disablepdfsync \to \everypagebody + +% beware, adding nodes this way will interfere with the typesetting + +\appendtoks \pdfsyncnode p\to \everypar +\appendtoks \pdfsyncnode m\to \everymath +\appendtoks \pdfsyncnode h\to \everyhbox + +% just for fun + +\def\pdfsynctracer#1% + {\ifcase\pdfsynctracemode\else + \ifcase\pdfsyncstate\else + \begingroup + \forgetall + \disablepdfsync + \ifcase\pdfsynctracemode\or % could be done more efficient, box around ifcase + \setbox\scratchbox\hbox to \zeropoint{\hss\infofont#1\hss}% 1 + \else + \setbox\scratchbox\hbox to \zeropoint{\hss\traceboxplacementtrue\boxcursor\hss}% 2/3/4 + \fi + \smashbox\scratchbox\box\scratchbox + \ifcase\pdfsynctracemode\or\or\or + \setbox\scratchbox\hbox to \zeropoint{\hss\raise1.25ex\hbox{\infofont#1}\hss}% 3 + \smashbox\scratchbox\box\scratchbox + \or + \setbox\scratchbox\hbox to \zeropoint{\hss\lower1.25ex\hbox{\infofont#1}\hss}% 4 + \smashbox\scratchbox\box\scratchbox + \fi + \endgroup + \fi + \fi} + +% \def\pdfsynctracer#1% more efficient but unreadable +% {\ifcase\pdfsynctracemode\else +% \ifcase\pdfsyncstate\else +% \begingroup +% \forgetall +% \disablepdfsync +% \setbox\scratchbox\hbox to \zeropoint +% {\hss +% \ifcase\pdfsynctracemode\or +% \infofont#1% 1 +% \else +% \traceboxplacementtrue\boxcursor% 2/3/4 +% \fi +% \hss}% +% \smashbox\scratchbox\box\scratchbox +% \setbox\scratchbox\hbox to \zeropoint +% {\hss +% \ifcase\pdfsynctracemode\or\or\or +% \raise1.25ex\hbox{\infofont#1}% 3 +% \or +% \lower1.25ex\hbox{\infofont#1}% 4 +% \fi +% \hss}% +% \smashbox\scratchbox\box\scratchbox +% \endgroup +% \fi +% \fi} + +\protect + +\doifnotmode{demo}{\endinput} + +\chardef\pdfsynctracemode=3 + +\starttext + +\chapter{Test} + +\processfile{tufte} + +\startitemize +\item first +\item second +\stopitemize + +\processfile{tufte} + +\startlines +some local \pdfsync sync and \pdfsynctext{here}a marked point +some local \pdfsync sync and \pdfsyncnode{here}a marked point +\stoplines + +\stoptext diff --git a/tex/context/base/m-pdfsnc.tex b/tex/context/base/m-pdfsnc.tex deleted file mode 100644 index da59ab5d8..000000000 --- a/tex/context/base/m-pdfsnc.tex +++ /dev/null @@ -1,200 +0,0 @@ -%D \module -%D [ file=m-pdfsnc, -%D version=2003.12.23, -%D title=\CONTEXT\ Modules, -%D subtitle=Editor Synchronization, -%D author={Hans Hagen \& Ton Otten}, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% \enablemode[demo] - -% This file is a variation of the file pdfsync4context.tex that ships -% with the pdfsync package (used by iTeXMac and TeXShop) by Piero -% D'Ancona and Jérôme Laurens. I made the macros a bit more efficient -% and added some basic tracing options as well as a few more options. -% I made this one while playing a bit with the Mac and TeX). Maybe I'll -% add a bit of support to the kernel in in order to get rid of redundant -% markers. Also, this had better be rewritten in a bit less \pdf -% dependent way so that it can also be supported by dvipdfmx. I could -% write a generic file as well, but since there is already support for -% other packages I'll not do that (now). - -% compatible commands: -% -% \pdfsyncstart \pdfsyncstop \pdfsync -% -% extra commands: -% -% \enablepdfsync \disablepdfsync \pdfsynctext \pdfsyncnode \pdfsynctracemode - -\ifx\pdfoutput\undefined - \donefalse -\else\ifcase\pdfoutput - \donefalse -\else\ifx\pdfsavepos\undefined - \donefalse -\else - \donetrue -\fi\fi\fi - -\chardef \pdfsyncstate \zerocount -\chardef \pdfsynctracemode \zerocount - -\ifdone - - \writestatus{pdfsync}{loading and enabling synchronization support} - -\else - - \writestatus{pdfsync}{synchronization is only available with pdftex} - - \let \pdfsyncstart \relax % brr, not per se symmetrically used, so - \let \pdfsyncstop \relax % enable and disable are better names - \let \pdfsync \relax - - \let \pdfsynctext \gobbleoneargument - \let \pdfsyncnode \gobbleoneargument - - \let \enablepdfsync \pdfsyncstart - \let \disablepdfsync \pdfsyncstop - - \expandafter\endinput -\fi - -\unprotect % not really needed - -\newcount \pdfsynccounter -\newwrite \pdfsyncwrite - -\def\pdfsyncstart{\chardef\pdfsyncstate\plusone} \let\enablepdfsync \pdfsyncstart -\def\pdfsyncstop {\chardef\pdfsyncstate\zerocount} \let\disablepdfsync\pdfsyncstop - -\def\dostartpdfsync - {\immediate\openout\pdfsyncwrite\jobname.pdfsync - \immediate\write\pdfsyncwrite{\jobname}% - \immediate\write\pdfsyncwrite{version 0}} - -\def\dostoppdfsync - {\immediate\closeout\pdfsyncwrite} - -\def\doregisterpdfsyncpage - {\immediate\write\pdfsyncwrite{s\space\realfolio}} - -\def\dopdfsyncopenfile - {\immediate\write\pdfsyncwrite{(\space\readfilename}} - -\def\dopdfsyncclosefile - {\immediate\write\pdfsyncwrite{)}} - -\def\doregisterpdfsyncnode#1% - {\ifcase\pdfsyncstate\else - \pdfsavepos - \immediate\write\pdfsyncwrite{l\space\the\pdfsynccounter\space\the\inputlineno}% - \expanded{\write\pdfsyncwrite{p\ifnum#1=\plusone*\fi\space\the\pdfsynccounter\space\noexpand\the\pdflastxpos\space\noexpand\the\pdflastypos}}% - \global\advance\pdfsynccounter\plusone - \fi} - -\let\pdfsynctracer\gobbleoneargument - -\def\pdfsync {\doregisterpdfsyncnode\plusone \pdfsynctracer*} -\def\pdfsyncnode{\doregisterpdfsyncnode\zerocount\pdfsynctracer} -\def\pdfsynctext{\doregisterpdfsyncnode\plusone \pdfsynctracer} - -\appendtoks \dostartpdfsync \to \everystarttext -%appendtoks \dostoppdfsync \to \everystoptext -\appendtoks \doregisterpdfsyncpage \to \everyshipout -\appendtoks \dopdfsyncopenfile \to \everybeforereadfile -\appendtoks \dopdfsyncclosefile \to \everyafterreadfile - -\appendtoks \enablepdfsync \to \everystarttext -\appendtoks \disablepdfsync \to \everypagebody - -% beware, adding nodes this way will interfere with the typesetting - -\appendtoks \pdfsyncnode p\to \everypar -\appendtoks \pdfsyncnode m\to \everymath -\appendtoks \pdfsyncnode h\to \everyhbox - -% just for fun - -\def\pdfsynctracer#1% - {\ifcase\pdfsynctracemode\else - \ifcase\pdfsyncstate\else - \begingroup - \forgetall - \disablepdfsync - \ifcase\pdfsynctracemode\or % could be done more efficient, box around ifcase - \setbox\scratchbox\hbox to \zeropoint{\hss\infofont#1\hss}% 1 - \else - \setbox\scratchbox\hbox to \zeropoint{\hss\traceboxplacementtrue\boxcursor\hss}% 2/3/4 - \fi - \smashbox\scratchbox\box\scratchbox - \ifcase\pdfsynctracemode\or\or\or - \setbox\scratchbox\hbox to \zeropoint{\hss\raise1.25ex\hbox{\infofont#1}\hss}% 3 - \smashbox\scratchbox\box\scratchbox - \or - \setbox\scratchbox\hbox to \zeropoint{\hss\lower1.25ex\hbox{\infofont#1}\hss}% 4 - \smashbox\scratchbox\box\scratchbox - \fi - \endgroup - \fi - \fi} - -% \def\pdfsynctracer#1% more efficient but unreadable -% {\ifcase\pdfsynctracemode\else -% \ifcase\pdfsyncstate\else -% \begingroup -% \forgetall -% \disablepdfsync -% \setbox\scratchbox\hbox to \zeropoint -% {\hss -% \ifcase\pdfsynctracemode\or -% \infofont#1% 1 -% \else -% \traceboxplacementtrue\boxcursor% 2/3/4 -% \fi -% \hss}% -% \smashbox\scratchbox\box\scratchbox -% \setbox\scratchbox\hbox to \zeropoint -% {\hss -% \ifcase\pdfsynctracemode\or\or\or -% \raise1.25ex\hbox{\infofont#1}% 3 -% \or -% \lower1.25ex\hbox{\infofont#1}% 4 -% \fi -% \hss}% -% \smashbox\scratchbox\box\scratchbox -% \endgroup -% \fi -% \fi} - -\protect - -\doifnotmode{demo}{\endinput} - -\chardef\pdfsynctracemode=3 - -\starttext - -\chapter{Test} - -\processfile{tufte} - -\startitemize -\item first -\item second -\stopitemize - -\processfile{tufte} - -\startlines -some local \pdfsync sync and \pdfsynctext{here}a marked point -some local \pdfsync sync and \pdfsyncnode{here}a marked point -\stoplines - -\stoptext diff --git a/tex/context/base/m-plus.tex b/tex/context/base/m-plus.tex deleted file mode 100644 index 312d9f931..000000000 --- a/tex/context/base/m-plus.tex +++ /dev/null @@ -1,30 +0,0 @@ -%D \module -%D [ file=m-plus, -%D version=2003.03.16, -%D title=\CONTEXT\ Extra Modules, -%D subtitle=Loading extra features, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Somewhere in 2001 I started collecting new functionality -%D in a module \type {m-yesno}. As the name suggests, I was -%D not entirely sure if this functionality belonged in the -%D kernel. When (again) on the \CONTEXT\ list a request for -%D side bars was posted, I decided to move such code to plus -%D modules. Users who want this additional functionality can -%D put the following call in their \type {cont-sys.tex} file: -%D -%D \starttyping -%D \usemodule[plus] -%D \stoptyping - -% \readfile {plus-rul} \donothing \donothing -% \readfile {page-str} \donothing \donothing -% \readfile {page-plg} \donothing \donothing - -\endinput diff --git a/tex/context/base/m-tex4ht.mkii b/tex/context/base/m-tex4ht.mkii new file mode 100644 index 000000000..8a3dc9dbb --- /dev/null +++ b/tex/context/base/m-tex4ht.mkii @@ -0,0 +1,9 @@ +%D Preliminaty module + +\input tex4ht.sty + +\appendtoks + \Preamble{\env{ht-1},\env{ht-2},html}\EndPreamble +\to \everystarttext + +\endinput \ No newline at end of file diff --git a/tex/context/base/m-tex4ht.tex b/tex/context/base/m-tex4ht.tex deleted file mode 100644 index 8a3dc9dbb..000000000 --- a/tex/context/base/m-tex4ht.tex +++ /dev/null @@ -1,9 +0,0 @@ -%D Preliminaty module - -\input tex4ht.sty - -\appendtoks - \Preamble{\env{ht-1},\env{ht-2},html}\EndPreamble -\to \everystarttext - -\endinput \ No newline at end of file diff --git a/tex/context/base/m-timing.mkiv b/tex/context/base/m-timing.mkiv new file mode 100644 index 000000000..a91891a1b --- /dev/null +++ b/tex/context/base/m-timing.mkiv @@ -0,0 +1,100 @@ +%D \module +%D [ file=m-timing, +%D version=2007.12.23, +%D title=\CONTEXT\ Modules, +%D subtitle=Timing, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=Hans Hagen] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\ifx\ShowNamedUsage\undefined \else \endinput \fi + +%D Written at the end of 2007, this module is dedicated to Taco. Reaching this +%D point in \LUATEX\ was a non trivial effort. By visualizing a bit what happens +%D when pages come out of \LUATEX, you may get an idea what is involved. It took +%D much time an dedication to reach this point in the development. Add to that +%D those daily Skype intense discussion, testing and debugging moments. Time flies +%D but progress is impressive. The motto of this module could be: what you see +%D is what you get. An there is much more to come \unknown. + +% \usemodule[timing] +% \setupcolors[state=start] +% \starttext +% \dorecurse{200}{\input tufte \par} \ShowUsage{} +% \stoptext + +\definecolor[usage:line] [darkred] +\definecolor[usage:time] [darkblue] +\definecolor[usage:frame][darkgray] + +\ctxloadluafile{trac-tim}{} + +\startluacode +local progress = moduledata.progress + +function progress.show(filename,parameters,nodes,other) + for n, name in pairs(parameters or progress.parameters(filename)) do + context.ShowNamedUsage(filename or progress.defaultfilename,name,other or "") + end + for n, name in pairs(nodes or progress.nodes(filename)) do + context.ShowNamedUsage(filename or progress.defaultfilename,name,other or "") + end +end +\stopluacode + +% \everyfirstshipout + +\startnotmode[no-timing] + \appendtoks\ctxlua{moduledata.progress.store()}\to\everystarttext + \appendtoks\ctxlua{moduledata.progress.store()}\to\everyshipout + \ctxlua{luatex.registerstopactions(function() moduledata.progress.save() end)} +\stopnotmode + +\def\ShowNamedUsage#1#2#3% + {\setbox\scratchbox\vbox\bgroup\startMPcode + begingroup ; save p, q, b, h, w ; + path p, q, b ; numeric h, w ; + p := \ctxlua{tex.sprint(moduledata.progress.path("#1","#2"))} ; +% p := p shifted -llcorner p ; + if bbwidth(p) > 1 : + h := 100 ; w := 2 * h ; + w := \the\textwidth-3pt ; % correct for pen + p := p xstretched w ; + b := boundingbox (llcorner p -- llcorner p shifted (w,h)) ; + pickup pencircle scaled 3pt ; linecap := butt ; + draw b withcolor \MPcolor{usage:frame} ; + draw p withcolor \MPcolor{usage:line} ; + if ("#3" <> "") and ("#3" <> "#2") : + q := \ctxlua{tex.sprint(moduledata.progress.path("#1","#3"))} ; +% q := q shifted -llcorner q ; + if bbwidth(q) > 1 : + q := q xstretched w ; + pickup pencircle scaled 1.5pt ; linecap := butt ; + draw q withcolor \MPcolor{usage:time} ; + fi ; + fi ; + fi ; + endgroup ; + \stopMPcode\egroup + \scratchdimen\wd\scratchbox + \ifdim\scratchdimen>\zeropoint + \startlinecorrection + \box\scratchbox \endgraf + \hbox to \scratchdimen{\tttf\strut\detokenize{#2}\hss + min:\ctxlua{tex.sprint(moduledata.progress.bot("#1","\detokenize{#2}"))}, % + max:\ctxlua{tex.sprint(moduledata.progress.top("#1","\detokenize{#2}"))}, % + pages:\ctxlua{tex.sprint(moduledata.progress.pages("#1"))}% + }% + \stoplinecorrection + \fi} + +\def\LoadUsage #1{\ctxlua{moduledata.progress.convert("#1")}} +\def\ShowUsage #1{\ctxlua{moduledata.progress.show("#1",nil,nil,"elapsed_time")}} +\def\ShowMemoryUsage#1{\ctxlua{moduledata.progress.show("#1",nil,{}, "elapsed_time")}} +\def\ShowNodeUsage #1{\ctxlua{moduledata.progress.show("#1",{},nil, "elapsed_time")}} + +\endinput diff --git a/tex/context/base/m-timing.tex b/tex/context/base/m-timing.tex deleted file mode 100644 index 8ecdd2d69..000000000 --- a/tex/context/base/m-timing.tex +++ /dev/null @@ -1,102 +0,0 @@ -%D \module -%D [ file=m-timing, -%D version=2007.12.23, -%D title=\CONTEXT\ Modules, -%D subtitle=Timing, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=Hans Hagen] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\doifnotmode{mkiv}{\endinput} - -\ifx\ShowNamedUsage\undefined \else \endinput \fi - -%D Written at the end of 2007, this module is dedicated to Taco. Reaching this -%D point in \LUATEX\ was a non trivial effort. By visualizing a bit what happens -%D when pages come out of \LUATEX, you may get an idea what is involved. It took -%D much time an dedication to reach this point in the development. Add to that -%D those daily Skype intense discussion, testing and debugging moments. Time flies -%D but progress is impressive. The motto of this module could be: what you see -%D is what you get. An there is much more to come \unknown. - -% \usemodule[timing] -% \setupcolors[state=start] -% \starttext -% \dorecurse{200}{\input tufte \par} \ShowUsage{} -% \stoptext - -\definecolor[usage:line] [darkred] -\definecolor[usage:time] [darkblue] -\definecolor[usage:frame][darkgray] - -\ctxloadluafile{trac-tim}{} - -\startluacode -local progress = moduledata.progress - -function progress.show(filename,parameters,nodes,other) - for n, name in pairs(parameters or progress.parameters(filename)) do - context.ShowNamedUsage(filename or progress.defaultfilename,name,other or "") - end - for n, name in pairs(nodes or progress.nodes(filename)) do - context.ShowNamedUsage(filename or progress.defaultfilename,name,other or "") - end -end -\stopluacode - -% \everyfirstshipout - -\startnotmode[no-timing] - \appendtoks\ctxlua{moduledata.progress.store()}\to\everystarttext - \appendtoks\ctxlua{moduledata.progress.store()}\to\everyshipout - \ctxlua{luatex.registerstopactions(function() moduledata.progress.save() end)} -\stopnotmode - -\def\ShowNamedUsage#1#2#3% - {\setbox\scratchbox\vbox\bgroup\startMPcode - begingroup ; save p, q, b, h, w ; - path p, q, b ; numeric h, w ; - p := \ctxlua{tex.sprint(moduledata.progress.path("#1","#2"))} ; -% p := p shifted -llcorner p ; - if bbwidth(p) > 1 : - h := 100 ; w := 2 * h ; - w := \the\textwidth-3pt ; % correct for pen - p := p xstretched w ; - b := boundingbox (llcorner p -- llcorner p shifted (w,h)) ; - pickup pencircle scaled 3pt ; linecap := butt ; - draw b withcolor \MPcolor{usage:frame} ; - draw p withcolor \MPcolor{usage:line} ; - if ("#3" <> "") and ("#3" <> "#2") : - q := \ctxlua{tex.sprint(moduledata.progress.path("#1","#3"))} ; -% q := q shifted -llcorner q ; - if bbwidth(q) > 1 : - q := q xstretched w ; - pickup pencircle scaled 1.5pt ; linecap := butt ; - draw q withcolor \MPcolor{usage:time} ; - fi ; - fi ; - fi ; - endgroup ; - \stopMPcode\egroup - \scratchdimen\wd\scratchbox - \ifdim\scratchdimen>\zeropoint - \startlinecorrection - \box\scratchbox \endgraf - \hbox to \scratchdimen{\tttf\strut\detokenize{#2}\hss - min:\ctxlua{tex.sprint(moduledata.progress.bot("#1","\detokenize{#2}"))}, % - max:\ctxlua{tex.sprint(moduledata.progress.top("#1","\detokenize{#2}"))}, % - pages:\ctxlua{tex.sprint(moduledata.progress.pages("#1"))}% - }% - \stoplinecorrection - \fi} - -\def\LoadUsage #1{\ctxlua{moduledata.progress.convert("#1")}} -\def\ShowUsage #1{\ctxlua{moduledata.progress.show("#1",nil,nil,"elapsed_time")}} -\def\ShowMemoryUsage#1{\ctxlua{moduledata.progress.show("#1",nil,{}, "elapsed_time")}} -\def\ShowNodeUsage #1{\ctxlua{moduledata.progress.show("#1",{},nil, "elapsed_time")}} - -\endinput diff --git a/tex/context/base/m-trackers.mkiv b/tex/context/base/m-trackers.mkiv new file mode 100644 index 000000000..95c34b16f --- /dev/null +++ b/tex/context/base/m-trackers.mkiv @@ -0,0 +1,3 @@ +\starttext + \showtrackers +\stoptext diff --git a/tex/context/base/m-trackers.tex b/tex/context/base/m-trackers.tex deleted file mode 100644 index cfcbbabff..000000000 --- a/tex/context/base/m-trackers.tex +++ /dev/null @@ -1,5 +0,0 @@ -\doifnotmode{mkiv} {\endinput} - -\starttext - \showtrackers -\stoptext diff --git a/tex/context/base/m-translate.mkiv b/tex/context/base/m-translate.mkiv new file mode 100644 index 000000000..c0e4aad72 --- /dev/null +++ b/tex/context/base/m-translate.mkiv @@ -0,0 +1,96 @@ +%D \module +%D [ file=m-translate, +%D version=2008.10.09, +%D title=\CONTEXT\ Modules, +%D subtitle=Translations, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=Hans Hagen] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D We can make this module more clever (wildcards and such) but since +%D it's only a demo we stick to the simple case for now. After all, it's +%D better to fix your source. + +\startluacode + local translators = { } + + moduledata.translators = translators + + local compiled, list = nil, nil + + function translators.register(from,to) + local l = lpeg.P(from)/to + if not list then + list = l + else + list = list + l + end + compiled = nil + end + + function translators.translate(s) + if list then + if not compiled then + compiled = lpeg.Cs((list + lpeg.P(1))^0) + end + return compiled:match(s) + else + return s + end + end + + local textlineactions = resolvers.openers.helpers.textlineactions + + utilities.sequencers.appendaction(textlineactions,"after","moduledata.translators.translate") + + function translators.enable() + utilities.sequencers.enableaction(textlineactions,"moduledata.translators.translate") + end + + function translators.disable() + utilities.sequencers.disableaction(textlineactions,"moduledata.translators.translate") + end + + function translators.reset(s) + translators.enable() + list, compiled = nil, nil + end + + translators.disable() +\stopluacode + +\unprotect + +\def\translateinput{\dodoubleargument\dotranslateinput} + +\def\dotranslateinput[#1][#2]{\ctxlua{moduledata.translators.register(\!!bs#1\!!es,\!!bs#2\!!es)}} + +\def\resetinputtranslation {\ctxlua{moduledata.translators.reset()}} +\def\enableinputtranslation {\ctxlua{moduledata.translators.enable()}} +\def\disableinputtranslation{\ctxlua{moduledata.translators.disable()}} + +\def\readtranslatedfile#1% + {\enableinputtranslation + \readfile{#1}\donothing\donothing + \disableinputtranslation} + +\protect + +\doifnotmode{demo}{\endinput} + +\starttext + + \translateinput[Moica][Mojca] + \translateinput[Idris][Idris (aka ادريس)] + + \enableinputtranslation + + Well, it's not that hard to satisfy Idris and Moica. + + \readtranslatedfile{tufte} + +\stoptext diff --git a/tex/context/base/m-translate.tex b/tex/context/base/m-translate.tex deleted file mode 100644 index 25e3c8618..000000000 --- a/tex/context/base/m-translate.tex +++ /dev/null @@ -1,98 +0,0 @@ -%D \module -%D [ file=m-translate, -%D version=2008.10.09, -%D title=\CONTEXT\ Modules, -%D subtitle=Translations, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=Hans Hagen] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\doifnotmode{mkiv}{\endinput} - -%D We can make this module more clever (wildcards and such) but since -%D it's only a demo we stick to the simple case for now. After all, it's -%D better to fix your source. - -\startluacode - local translators = { } - - moduledata.translators = translators - - local compiled, list = nil, nil - - function translators.register(from,to) - local l = lpeg.P(from)/to - if not list then - list = l - else - list = list + l - end - compiled = nil - end - - function translators.translate(s) - if list then - if not compiled then - compiled = lpeg.Cs((list + lpeg.P(1))^0) - end - return compiled:match(s) - else - return s - end - end - - local textlineactions = resolvers.openers.helpers.textlineactions - - utilities.sequencers.appendaction(textlineactions,"after","moduledata.translators.translate") - - function translators.enable() - utilities.sequencers.enableaction(textlineactions,"moduledata.translators.translate") - end - - function translators.disable() - utilities.sequencers.disableaction(textlineactions,"moduledata.translators.translate") - end - - function translators.reset(s) - translators.enable() - list, compiled = nil, nil - end - - translators.disable() -\stopluacode - -\unprotect - -\def\translateinput{\dodoubleargument\dotranslateinput} - -\def\dotranslateinput[#1][#2]{\ctxlua{moduledata.translators.register(\!!bs#1\!!es,\!!bs#2\!!es)}} - -\def\resetinputtranslation {\ctxlua{moduledata.translators.reset()}} -\def\enableinputtranslation {\ctxlua{moduledata.translators.enable()}} -\def\disableinputtranslation{\ctxlua{moduledata.translators.disable()}} - -\def\readtranslatedfile#1% - {\enableinputtranslation - \readfile{#1}\donothing\donothing - \disableinputtranslation} - -\protect - -\doifnotmode{demo}{\endinput} - -\starttext - - \translateinput[Moica][Mojca] - \translateinput[Idris][Idris (aka ادريس)] - - \enableinputtranslation - - Well, it's not that hard to satisfy Idris and Moica. - - \readtranslatedfile{tufte} - -\stoptext diff --git a/tex/context/base/m-tryout.tex b/tex/context/base/m-tryout.tex deleted file mode 100644 index 4aa50376d..000000000 --- a/tex/context/base/m-tryout.tex +++ /dev/null @@ -1,55 +0,0 @@ -%D \module -%D [ file=m-tryout, -%D version=2002.05.10, -%D title=\CONTEXT\ Extra Modules, -%D subtitle=Tryout Features, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\endinput - -\unprotect - -%D The following macros make sure that active colons work well -%D in French, a feature enabled with: -%D -%D \starttyping -%D \useencoding[ffr] \mainlanguage[fr] -%D \stoptyping -%D -%D This trick will disappear when proved robust. - -\startmode[activecolon] - -% this is now default - -\gdef\sectionseparator{-} - -\gdef\@@filterfirstpart [#1--#2]{#1} -\gdef\@@filtersecondpart [#1--#2]{#2} - -\gdef\@@filterblockpart [#1--#2--#3]{#1} -\gdef\@@filternumberpart [#1--#2--#3]{#2} -\gdef\@@filterpagepart [#1--#2--#3]{#3} -\gdef\@@filterblocknumberpart[#1--#2--#3]{#1--#2} - -\gdef\@@filterheadpart[#1]{\@EA\@@dofilterheadpart\@EA[#1-0]} -\gdef\@@filtertailpart[#1]{\@EA\@@dofiltertailpart\@EA[#1-0]} - -\gdef\@@dofilterheadpart[#1-#2]{#1} -\gdef\@@dofiltertailpart[#1-#2]{#2} - -\gdef\@@filterlevelpart[#1--#2--#3]{\@@dofilterlevelpart[#2-0-0-0-0]} - -\gdef\@@dofilterlevelpart[#1-0-0-0-#2]{#1} - -\reopenutilities - -\stopmode - -\protect \endinput diff --git a/tex/context/base/s-chi-00.mkii b/tex/context/base/s-chi-00.mkii new file mode 100644 index 000000000..bec86f6d2 --- /dev/null +++ b/tex/context/base/s-chi-00.mkii @@ -0,0 +1,76 @@ +%D \module +%D [ file=s-chi-00, +%D version=1999.12.21, +%D title=\CONTEXT\ Style File, +%D subtitle=Basic Chinese Style, +%D author=Hans Hagen, +%D date=\currentdate, +%D suggestions=Wang Lei, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\input font-chi.mkii % faster than \setupbodyfont[chi] + +\mainlanguage [cn] + +\unprotect + +\setupsection [\s!section-1] [\c!headconversion=\s!chinese] +\setupsection [\s!section-2] [\c!headconversion=\s!chinese] +\setupsection [\s!section-3] [\c!headconversion=\s!chinese] + +\setupsection [\s!section-2] [\v!appendix\c!conversion=] + +\setuphead [\v!chapter] [\c!distance=1.25em] +\setuphead [\v!section] [\c!distance=1.25em] +\setuphead [\v!subsection] [\c!distance=1.00em] + +\setuplist [\v!chapter] [\c!headlabel=\v!yes,\c!headconversion=\v!yes,\c!width=5em] +\setuplist [\v!section] [\c!headlabel=\v!yes,\c!headconversion=\v!yes,\c!width=5em] + +\setupmarking [\v!chapter\v!number] [\c!headlabel=\v!yes,\c!headconversion=\v!yes] +\setupmarking [\v!section\v!number] [\c!headlabel=\v!yes,\c!headconversion=\v!yes] + +\setuplabeltext [cn] [\v!subsection={\symbol[S]\kern.25em}] +\setuplabeltext [cn] [\v!subsubsection={\symbol[S]\kern.25em}] +\setuplabeltext [cn] [\v!subsubsubsection={\symbol[S]\kern.25em}] +\setuplabeltext [cn] [\v!subsubsubsubsection={\symbol[S]\kern.25em}] + +% nog taalonafhankelijk maken -> \e!tabel enz + +\definereferenceformat [intable] [\c!label=\v!table] +\definereferenceformat [infigure] [\c!label=\v!figure] +\definereferenceformat [inchapter] [\c!label=\v!chapter] +\definereferenceformat [insection] [\c!label=\v!section] + +% important + +\setuptyping[\c!tab=\v!no] + +%D This module (and font support) adapts to the \UTF\ regime, but you +%D need to enable \UTF\ first! +%D +%D \starttyping +%D \enableregime[utf] \usemodule[chi-00] +%D +%D \starttext +%D +%D 兡也包因沘氓侷柵苗孫孫財 +%D 崧淫設弼ç¶è·‘æ„窟榜蒸奭稽 +%D 霄瓢館縲擻鼕孃魔é‡ä½‰æ²Žå²  +%D 狋垚柛胅娭涘罞åŸæƒˆç‰»èºå‚’ +%D 焱èé…¡å»…æ»˜çµºèµ©å¡´æ¦—ç®‚è¸ƒå¬ +%D 澕蓴醊ç§èž—餟燱螬駸礑鎞瀧 +%D 鄿瀯騬醹躕鱕 +%D +%D \blank +%D +%D Wang Lei is written as: 王磊 +%D +%D \stoptext +%D \stoptyping + +\protect \endinput diff --git a/tex/context/base/s-chi-00.tex b/tex/context/base/s-chi-00.tex deleted file mode 100644 index bec86f6d2..000000000 --- a/tex/context/base/s-chi-00.tex +++ /dev/null @@ -1,76 +0,0 @@ -%D \module -%D [ file=s-chi-00, -%D version=1999.12.21, -%D title=\CONTEXT\ Style File, -%D subtitle=Basic Chinese Style, -%D author=Hans Hagen, -%D date=\currentdate, -%D suggestions=Wang Lei, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\input font-chi.mkii % faster than \setupbodyfont[chi] - -\mainlanguage [cn] - -\unprotect - -\setupsection [\s!section-1] [\c!headconversion=\s!chinese] -\setupsection [\s!section-2] [\c!headconversion=\s!chinese] -\setupsection [\s!section-3] [\c!headconversion=\s!chinese] - -\setupsection [\s!section-2] [\v!appendix\c!conversion=] - -\setuphead [\v!chapter] [\c!distance=1.25em] -\setuphead [\v!section] [\c!distance=1.25em] -\setuphead [\v!subsection] [\c!distance=1.00em] - -\setuplist [\v!chapter] [\c!headlabel=\v!yes,\c!headconversion=\v!yes,\c!width=5em] -\setuplist [\v!section] [\c!headlabel=\v!yes,\c!headconversion=\v!yes,\c!width=5em] - -\setupmarking [\v!chapter\v!number] [\c!headlabel=\v!yes,\c!headconversion=\v!yes] -\setupmarking [\v!section\v!number] [\c!headlabel=\v!yes,\c!headconversion=\v!yes] - -\setuplabeltext [cn] [\v!subsection={\symbol[S]\kern.25em}] -\setuplabeltext [cn] [\v!subsubsection={\symbol[S]\kern.25em}] -\setuplabeltext [cn] [\v!subsubsubsection={\symbol[S]\kern.25em}] -\setuplabeltext [cn] [\v!subsubsubsubsection={\symbol[S]\kern.25em}] - -% nog taalonafhankelijk maken -> \e!tabel enz - -\definereferenceformat [intable] [\c!label=\v!table] -\definereferenceformat [infigure] [\c!label=\v!figure] -\definereferenceformat [inchapter] [\c!label=\v!chapter] -\definereferenceformat [insection] [\c!label=\v!section] - -% important - -\setuptyping[\c!tab=\v!no] - -%D This module (and font support) adapts to the \UTF\ regime, but you -%D need to enable \UTF\ first! -%D -%D \starttyping -%D \enableregime[utf] \usemodule[chi-00] -%D -%D \starttext -%D -%D 兡也包因沘氓侷柵苗孫孫財 -%D 崧淫設弼ç¶è·‘æ„窟榜蒸奭稽 -%D 霄瓢館縲擻鼕孃魔é‡ä½‰æ²Žå²  -%D 狋垚柛胅娭涘罞åŸæƒˆç‰»èºå‚’ -%D 焱èé…¡å»…æ»˜çµºèµ©å¡´æ¦—ç®‚è¸ƒå¬ -%D 澕蓴醊ç§èž—餟燱螬駸礑鎞瀧 -%D 鄿瀯騬醹躕鱕 -%D -%D \blank -%D -%D Wang Lei is written as: 王磊 -%D -%D \stoptext -%D \stoptyping - -\protect \endinput diff --git a/tex/context/base/s-def-01.mkiv b/tex/context/base/s-def-01.mkiv new file mode 100644 index 000000000..c54cee764 --- /dev/null +++ b/tex/context/base/s-def-01.mkiv @@ -0,0 +1,10 @@ +% yes or no + +\unprotect + +\startsetups defaults:frontpart:pagenumbers:roman + \definestructureconversionset[\c!frontpart:\c!pagenumber][][romannumerals] + \setupuserpagenumber[\c!way=\v!byblock] +\stopsetups + +\protect diff --git a/tex/context/base/s-fnt-01.mkii b/tex/context/base/s-fnt-01.mkii new file mode 100644 index 000000000..69c8efab9 --- /dev/null +++ b/tex/context/base/s-fnt-01.mkii @@ -0,0 +1,61 @@ +%D \module +%D [ file=s-fnt-01, +%D version=2001.08.22, +%D title=\CONTEXT\ Style File, +%D subtitle=Font Environment 1, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This file is used by the \type {texfont.pl} installation +%D script. It is of no use for \MKIV. + +%D Modes: compact + +\dontcomplain + +\setupbodyfont + [10pt] + +\setuplayout + [backspace=30pt, + topspace=30pt, + footer=0pt, + header=36pt, + width=middle, + height=middle] + +\setupcolors + [state=start] + +\def\ShowFont + {\dotripleempty\doShowFont} + +\def\doShowFont[#1][#2][#3]% + {\doifsomething{#1} + {\bgroup + \ifthirdargument + \definefontsynonym[WhateverName][#2][encoding=#3] + \definefont[WhateverFont][WhateverName] + \setupheadertexts[\tttf#2\quad#1\quad#3] + \WhateverFont + \setupinterlinespace + \showfont[WhateverName] + \showligatures[WhateverName] + \doifnotmode{compact}{\showaccents\showcharacters} + \else + \definefontsynonym[WhateverName][#2] + \definefont[WhateverFont][WhateverName] + \setupheadertexts[\tttf#2\quad#1\quad(special font)] + \WhateverFont + \setupinterlinespace + \showfont[WhateverName] + \fi + \page + \egroup}} + +\endinput diff --git a/tex/context/base/s-fnt-01.tex b/tex/context/base/s-fnt-01.tex deleted file mode 100644 index 69c8efab9..000000000 --- a/tex/context/base/s-fnt-01.tex +++ /dev/null @@ -1,61 +0,0 @@ -%D \module -%D [ file=s-fnt-01, -%D version=2001.08.22, -%D title=\CONTEXT\ Style File, -%D subtitle=Font Environment 1, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This file is used by the \type {texfont.pl} installation -%D script. It is of no use for \MKIV. - -%D Modes: compact - -\dontcomplain - -\setupbodyfont - [10pt] - -\setuplayout - [backspace=30pt, - topspace=30pt, - footer=0pt, - header=36pt, - width=middle, - height=middle] - -\setupcolors - [state=start] - -\def\ShowFont - {\dotripleempty\doShowFont} - -\def\doShowFont[#1][#2][#3]% - {\doifsomething{#1} - {\bgroup - \ifthirdargument - \definefontsynonym[WhateverName][#2][encoding=#3] - \definefont[WhateverFont][WhateverName] - \setupheadertexts[\tttf#2\quad#1\quad#3] - \WhateverFont - \setupinterlinespace - \showfont[WhateverName] - \showligatures[WhateverName] - \doifnotmode{compact}{\showaccents\showcharacters} - \else - \definefontsynonym[WhateverName][#2] - \definefont[WhateverFont][WhateverName] - \setupheadertexts[\tttf#2\quad#1\quad(special font)] - \WhateverFont - \setupinterlinespace - \showfont[WhateverName] - \fi - \page - \egroup}} - -\endinput diff --git a/tex/context/base/s-fnt-02.mkii b/tex/context/base/s-fnt-02.mkii new file mode 100644 index 000000000..69f976102 --- /dev/null +++ b/tex/context/base/s-fnt-02.mkii @@ -0,0 +1,133 @@ +% output=pdftex modes=demo + +% nice example: +% +% \usemodule[s-fnt-02] +% +% \usetypescriptfile[type-ghz.tex] +% +% \usetypescript [sans] [optima,optima-nova] [texnansi] +% +% \setvariables +% [glyphs] +% [name-1=OptimaLT, +% name-2=OptimaNovaLT-Regular] +% +% \starttext +% +% \setups[show-glyphs] +% +% \stoptext +% +% see end, for other example (or run texexec s-fnt-02 --mode=demo) + +\setvariables + [glyphs] + [frame=on, + name-1=cmr10, + name-2=cmtt10, + map-1=, + map-2=] + +\setuppapersize[S4][S4] + +\setupcolors[state=start] + +\setuplayout[page] + +\definecolor[Gray] [s=.2] +\definecolor[ColorNone][s=1,t=.5,a=1] +\definecolor[ColorOne] [r=1,t=.5,a=1] +\definecolor[ColorTwo] [g=1,t=.5,a=1] +\definecolor[BackOne] [b=1,t=.5,a=1] +\definecolor[BackTwo] [r=1,g=1,t=.5,a=1] + +\setupbackgrounds + [page] + [background=color, + backgroundcolor=Gray] + +\startsetups[show-glyphs] + + \doifnothing{\getvariable{glyphs}{name-1}}{\endinput} + \doifnothing{\getvariable{glyphs}{name-2}}{\endinput} + + \doifsomething{\getvariable{glyphs}{map-1}}{\loadmapfile[\getvariable{glyphs}{map-1}]} + \doifsomething{\getvariable{glyphs}{map-2}}{\loadmapfile[\getvariable{glyphs}{map-2}]} + + \definefont[FontOne][\getvariable{glyphs}{name-1} at 280pt] + \definefont[FontTwo][\getvariable{glyphs}{name-2} at 280pt] + +% \dostepwiserecurse{0}{255}{1} +% {\doiffontcharelse{\getvariable{glyphs}{name-1}}{\recurselevel} +% {\doiffontcharelse{\getvariable{glyphs}{name-2}}{\recurselevel} +% {\startstandardmakeup +% \doifelse{\getvariable{glyphs}{frame}}{on} % too many box calculations when off, but who cares +% {\boxrulewidth=2pt} +% {\boxrulewidth=0pt} +% \setbox 0=\hbox{\white\ruledhbox{\FontOne \char\recurselevel}} +% \setbox 2=\hbox{\white\ruledhbox{\FontTwo \char\recurselevel}} +% \setbox 4=\hbox{\FontOne \ColorOne \char\recurselevel} +% \setbox 6=\hbox{\FontTwo \ColorTwo \char\recurselevel} +% \setbox 8=\hbox{\BackOne \ruledhbox{\FontOne \phantom{\char\recurselevel}}} +% \setbox10=\hbox{\BackTwo \ruledhbox{\FontTwo \phantom{\char\recurselevel}}} +% \vfill +% \hbox{\dostepwiserecurse{0}{10}{2}{\hbox to \hsize{\hss\box\recurselevel\hss}\hskip-\hsize}} +% \vfill +% \tttf +% \setstrut +% \hbox to \hsize{\strut\hss +% {\ColorOne \getvariable{glyphs}{name-1}}\quad +% {\ColorTwo \getvariable{glyphs}{name-2}}\quad +% {\ColorNone char \recurselevel }\hss} +% \stopstandardmakeup} +% {}} +% {}} + + \dostepwiserecurse{0}{255}{1} + {\donefalse + \doiffontcharelse{\getvariable{glyphs}{name-1}}{\recurselevel}{\donetrue}{}% + \doiffontcharelse{\getvariable{glyphs}{name-2}}{\recurselevel}{\donetrue}{}% + \ifdone + \startstandardmakeup + \doifelse{\getvariable{glyphs}{frame}}{on} % too many box calculations when off, but who cares + {\boxrulewidth=2pt} + {\boxrulewidth=0pt} + \setbox 0=\hbox{\white\ruledhbox{\FontOne \char\recurselevel}} + \setbox 2=\hbox{\white\ruledhbox{\FontTwo \char\recurselevel}} + \setbox 4=\hbox{\FontOne \ColorOne \char\recurselevel} + \setbox 6=\hbox{\FontTwo \ColorTwo \char\recurselevel} + \setbox 8=\hbox{\BackOne \ruledhbox{\FontOne \phantom{\char\recurselevel}}} + \setbox10=\hbox{\BackTwo \ruledhbox{\FontTwo \phantom{\char\recurselevel}}} + \vfill + \hbox{\dostepwiserecurse{0}{10}{2}{\hbox to \hsize{\hss\box\recurselevel\hss}\hskip-\hsize}} + \vfill + \tttf + \setstrut + \hbox to \hsize{\strut\hss + {\ColorOne \getvariable{glyphs}{name-1}}\quad + {\ColorTwo \getvariable{glyphs}{name-2}}\quad + {\ColorNone char \recurselevel }\hss} + \stopstandardmakeup + \fi} + +\stopsetups + +\doifnotmode{demo}{\endinput} + +\starttext + + \setupencoding[default=ec] + + \loadmapline [=][aer10 = 0 then + NC() context(name) NC() context(unicode) NC() char(unicode) NC() NR() + end + end + context.stoptabulate() + end + end +end + +function fonts.show_all() + local tfmdata = fonts.identifiers[font.current()] + if tfmdata then + local NC, NR, HL, char, bold, tttf = context.NC, context.NR, context.HL, context.char, context.bold, context.tttf + local chars = tfmdata.characters + local descs = tfmdata.descriptions or { } + local data = characters.data + -- context.setuptabulate { header = "repeat" } + context.starttabulatehead() + NC() bold("unicode") + NC() bold("visual") + NC() bold("index") + NC() bold("glyph") + NC() bold("adobe") + NC() bold("context") + NC() NR() + context.stoptabulatehead() + context.starttabulate { "|l|c|l|p|p|p|" } + for k, unicode in ipairs(table.sortedkeys(chars)) do +-- for unicode, _ in table.sortedpairs(chars) do + if unicode >= 0 then + local chr, des, dat = chars[unicode], descs[unicode], data[unicode] + local index = chr.index or 0 + local cname = (dat and dat.contextname) or "" + local aname = (dat and dat.adobename) or "" + local gname = (des and des.name) or "" + local mname = dat and dat.mathname + if type(mname) ~= "string" then + mname = "" + end + local mspec = dat and dat.mathspec + if mspec then + for m=1,#mspec do + local n = mspec[m].name + if n then + if mname == "" then + mname = n + else + mname = mname .. " " .. n + end + end + end + end + if mname ~= "" then + mname = "m: " .. mname + if cname ~= "" then + cname = cname .. " " .. mname + else + cname = mname + end + end + NC() tttf() context("U+%05X",unicode) + NC() char(unicode) + NC() tttf() context("%05X",index) + NC() tttf() context(gname) + NC() tttf() context(aname) + NC() tttf() context(cname) + NC() NR() + end + end + context.stoptabulate() + else + context("problems") + end +end + +function fonts.show_glyphs() + local tfmdata = fonts.identifiers[font.current()] + if tfmdata then + for k, v in ipairs(table.sortedkeys(tfmdata.characters)) do + if v >=0 then + context.showglyph(v) -- local macro + end + end + end +end +\stopluacode + +\def\ShowCompleteFont#1#2#3% + {\bgroup + \page + \font\TestFont=#1 at #2 + \setuplayout[style=\TestFont] + \setupheadertexts[] + \setupfootertexts[#1 -- \pagenumber] + \setupfootertexts[pagenumber] + \setuplayout[width=middle,height=middle,topspace=1cm,backspace=1cm] + \TestFont + \nonknuthmode + \startcolumns[n=#3] + \TestFont + \ctxlua { fonts.show_all() } + \stopcolumns + \page + \egroup} + +\def\ShowAllGlyphs#1#2#3% + {\bgroup + \page + \def\showglyph##1{\dontleavehmode\strut\char##1\relax\par} + \font\TestFontA=#1 at 12pt + \font\TestFontB=#1 at #2 + \setuplayout[style=\TestFontA] + \setupheadertexts[] + \setupfootertexts[#1 -- \pagenumber] + \setuplayout[width=middle,height=middle,topspace=1cm,backspace=1cm,header=1cm,footer=2cm] + \TestFontB \setupinterlinespace[line=1.2\dimexpr#2\relax] \raggedcenter + \nonknuthmode + \startcolumns[n=#3] + \TestFontB + \ctxlua { fonts.show_glyphs() } + \stopcolumns + \page + \egroup} + +\doifnotmode{demo} {\endinput} + +\starttext + +% \ShowCompleteFont{name:dejavusansmono}{10pt}{1} +% \ShowCompleteFont{name:dejavuserif}{10pt}{2} +% \ShowCompleteFont{name:officinasansbookitcregular}{10pt}{2} +% \ShowCompleteFont{name:officinaserifbookitcregular}{10pt}{2} +% \ShowCompleteFont{name:serpentineserifeflight}{10pt}{2} +% \ShowCompleteFont{name:lmtypewriter10-regular}{10pt}{2} +% \ShowCompleteFont{lt55485}{10pt}{2} +% \ShowCompleteFont{lmr10}{10pt}{2} +% \ShowCompleteFont{lbr}{10pt}{2} +% \ShowCompleteFont{name:Cambria}{10pt}{2} +% \ShowCompleteFont{name:CambriaMath}{10pt}{2} +% \ShowCompleteFont{name:texgyrepagella-regular}{10pt}{2} +% \ShowCompleteFont{name:texgyrechorus-mediumitalic}{10pt}{2} +% \ShowAllGlyphs {name:texgyrepagella-regular} {48pt}{2} +% \ShowAllGlyphs {name:texgyrechorus-mediumitalic}{48pt}{2} +% \ShowCompleteFont{name:euler10-regular}{10pt}{2} + +% \ShowCompleteFont{name:palatinosansinformalcombold}{20pt}{2} +% \ShowCompleteFont{name:palatinonovaregular}{11pt}{2} +\ShowCompleteFont{pirat.ttf}{12pt}{1} + +\stoptext diff --git a/tex/context/base/s-fnt-10.tex b/tex/context/base/s-fnt-10.tex deleted file mode 100644 index a8ef90c5e..000000000 --- a/tex/context/base/s-fnt-10.tex +++ /dev/null @@ -1,176 +0,0 @@ -%D \module -%D [ file=s-fnt-01, -%D version=2006.10.10, % guess -%D title=\CONTEXT\ Style File, -%D subtitle=Listing Glyphs in Large Fonts, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\startluacode -local format, sprint = string.format, tex.sprint - -function fonts.otf.show_all() - local tfmdata = fonts.identifiers[font.current()] - if tfmdata and tfmdata.shared then - local NC, NR, char = context.NC, context.NR, context.char - local otfdata = tfmdata.shared.otfdata - if otfdata and otfdata.luatex then - local unicodes = otfdata.luatex.unicodes - context.starttabulate { "|l|r|c|" } - for i, name in ipairs(table.sortedkeys(unicodes)) do - local unicode = unicodes[name] - if unicode >= 0 then - NC() context(name) NC() context(unicode) NC() char(unicode) NC() NR() - end - end - context.stoptabulate() - end - end -end - -function fonts.show_all() - local tfmdata = fonts.identifiers[font.current()] - if tfmdata then - local NC, NR, HL, char, bold, tttf = context.NC, context.NR, context.HL, context.char, context.bold, context.tttf - local chars = tfmdata.characters - local descs = tfmdata.descriptions or { } - local data = characters.data - -- context.setuptabulate { header = "repeat" } - context.starttabulatehead() - NC() bold("unicode") - NC() bold("visual") - NC() bold("index") - NC() bold("glyph") - NC() bold("adobe") - NC() bold("context") - NC() NR() - context.stoptabulatehead() - context.starttabulate { "|l|c|l|p|p|p|" } - for k, unicode in ipairs(table.sortedkeys(chars)) do --- for unicode, _ in table.sortedpairs(chars) do - if unicode >= 0 then - local chr, des, dat = chars[unicode], descs[unicode], data[unicode] - local index = chr.index or 0 - local cname = (dat and dat.contextname) or "" - local aname = (dat and dat.adobename) or "" - local gname = (des and des.name) or "" - local mname = dat and dat.mathname - if type(mname) ~= "string" then - mname = "" - end - local mspec = dat and dat.mathspec - if mspec then - for m=1,#mspec do - local n = mspec[m].name - if n then - if mname == "" then - mname = n - else - mname = mname .. " " .. n - end - end - end - end - if mname ~= "" then - mname = "m: " .. mname - if cname ~= "" then - cname = cname .. " " .. mname - else - cname = mname - end - end - NC() tttf() context("U+%05X",unicode) - NC() char(unicode) - NC() tttf() context("%05X",index) - NC() tttf() context(gname) - NC() tttf() context(aname) - NC() tttf() context(cname) - NC() NR() - end - end - context.stoptabulate() - else - context("problems") - end -end - -function fonts.show_glyphs() - local tfmdata = fonts.identifiers[font.current()] - if tfmdata then - for k, v in ipairs(table.sortedkeys(tfmdata.characters)) do - if v >=0 then - context.showglyph(v) -- local macro - end - end - end -end -\stopluacode - -\def\ShowCompleteFont#1#2#3% - {\bgroup - \page - \font\TestFont=#1 at #2 - \setuplayout[style=\TestFont] - \setupheadertexts[] - \setupfootertexts[#1 -- \pagenumber] - \setupfootertexts[pagenumber] - \setuplayout[width=middle,height=middle,topspace=1cm,backspace=1cm] - \TestFont - \nonknuthmode - \startcolumns[n=#3] - \TestFont - \ctxlua { fonts.show_all() } - \stopcolumns - \page - \egroup} - -\def\ShowAllGlyphs#1#2#3% - {\bgroup - \page - \def\showglyph##1{\dontleavehmode\strut\char##1\relax\par} - \font\TestFontA=#1 at 12pt - \font\TestFontB=#1 at #2 - \setuplayout[style=\TestFontA] - \setupheadertexts[] - \setupfootertexts[#1 -- \pagenumber] - \setuplayout[width=middle,height=middle,topspace=1cm,backspace=1cm,header=1cm,footer=2cm] - \TestFontB \setupinterlinespace[line=1.2\dimexpr#2\relax] \raggedcenter - \nonknuthmode - \startcolumns[n=#3] - \TestFontB - \ctxlua { fonts.show_glyphs() } - \stopcolumns - \page - \egroup} - -\doifnotmode{demo} {\endinput} - -\starttext - -% \ShowCompleteFont{name:dejavusansmono}{10pt}{1} -% \ShowCompleteFont{name:dejavuserif}{10pt}{2} -% \ShowCompleteFont{name:officinasansbookitcregular}{10pt}{2} -% \ShowCompleteFont{name:officinaserifbookitcregular}{10pt}{2} -% \ShowCompleteFont{name:serpentineserifeflight}{10pt}{2} -% \ShowCompleteFont{name:lmtypewriter10-regular}{10pt}{2} -% \ShowCompleteFont{lt55485}{10pt}{2} -% \ShowCompleteFont{lmr10}{10pt}{2} -% \ShowCompleteFont{lbr}{10pt}{2} -% \ShowCompleteFont{name:Cambria}{10pt}{2} -% \ShowCompleteFont{name:CambriaMath}{10pt}{2} -% \ShowCompleteFont{name:texgyrepagella-regular}{10pt}{2} -% \ShowCompleteFont{name:texgyrechorus-mediumitalic}{10pt}{2} -% \ShowAllGlyphs {name:texgyrepagella-regular} {48pt}{2} -% \ShowAllGlyphs {name:texgyrechorus-mediumitalic}{48pt}{2} -% \ShowCompleteFont{name:euler10-regular}{10pt}{2} - -% \ShowCompleteFont{name:palatinosansinformalcombold}{20pt}{2} -% \ShowCompleteFont{name:palatinonovaregular}{11pt}{2} -\ShowCompleteFont{pirat.ttf}{12pt}{1} - -\stoptext diff --git a/tex/context/base/s-fnt-11.mkiv b/tex/context/base/s-fnt-11.mkiv new file mode 100644 index 000000000..f2171ecd0 --- /dev/null +++ b/tex/context/base/s-fnt-11.mkiv @@ -0,0 +1,73 @@ +%D \module +%D [ file=s-fnt-11, +%D version=2006.02.01, % or so +%D title=\CONTEXT\ Style File, +%D subtitle=Listing Installed Fonts, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This code usd to be in the kernel but since it's hardly used +%D it's now a module. +%D +%D \starttyping +%D \showinstalledfonts[officinasans.*][all] +%D \showinstalledfonts[officinaserif.*][all] +%D \showinstalledfonts[officina.*itc.*][all] +%D +%D \showinstalledfonts[officina.*itc.*][all,new] +%D \stoptyping + +\startluacode +function fonts.names.table(pattern,reload,all) + local t = fonts.names.list(pattern,reload) + if t then + local NC, NR, HL = context.NC, context.NR, context.HL + context.start() + context.nonknuthmode() + context.starttabulate { "|T|T|T|T|T|" } + NC(false,hashname) + NC(false,type) + NC(false,fontname) + NC(false,filename) + NC() NR() HL() + for v,tv in table.sortedpairs(t) do + local kind, name, file = tv[1], tv[2], tv[3] + if all or v == string.lower(name) then + if kind and name and file then + NC(false,v) + NC(false,kind) + NC(false,name) + NC(false,file) + NC() NR() + else + logs.report("font table", "skipping %s", v) + end + end + end + context.stoptabulate() + context.stop() + end +end +\stopluacode + +\unprotect + +\def\showinstalledfonts + {\dodoubleempty\doshowinstalledfonts} + +\def\doshowinstalledfonts[#1][#2]% + {\bgroup + \def\pattern{#1}% + \def\all{false}% + \def\reload{false}% + \doifnothing\pattern{\def\pattern{.*}}% + \processallactionsinset[#2][\v!new=>\def\reload{true},\v!all=>\def\all{true}]% + \ctxlua{fonts.names.table("#1",\reload,\all)}% + \egroup} + +\protect \endinput diff --git a/tex/context/base/s-fnt-11.tex b/tex/context/base/s-fnt-11.tex deleted file mode 100644 index f2171ecd0..000000000 --- a/tex/context/base/s-fnt-11.tex +++ /dev/null @@ -1,73 +0,0 @@ -%D \module -%D [ file=s-fnt-11, -%D version=2006.02.01, % or so -%D title=\CONTEXT\ Style File, -%D subtitle=Listing Installed Fonts, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This code usd to be in the kernel but since it's hardly used -%D it's now a module. -%D -%D \starttyping -%D \showinstalledfonts[officinasans.*][all] -%D \showinstalledfonts[officinaserif.*][all] -%D \showinstalledfonts[officina.*itc.*][all] -%D -%D \showinstalledfonts[officina.*itc.*][all,new] -%D \stoptyping - -\startluacode -function fonts.names.table(pattern,reload,all) - local t = fonts.names.list(pattern,reload) - if t then - local NC, NR, HL = context.NC, context.NR, context.HL - context.start() - context.nonknuthmode() - context.starttabulate { "|T|T|T|T|T|" } - NC(false,hashname) - NC(false,type) - NC(false,fontname) - NC(false,filename) - NC() NR() HL() - for v,tv in table.sortedpairs(t) do - local kind, name, file = tv[1], tv[2], tv[3] - if all or v == string.lower(name) then - if kind and name and file then - NC(false,v) - NC(false,kind) - NC(false,name) - NC(false,file) - NC() NR() - else - logs.report("font table", "skipping %s", v) - end - end - end - context.stoptabulate() - context.stop() - end -end -\stopluacode - -\unprotect - -\def\showinstalledfonts - {\dodoubleempty\doshowinstalledfonts} - -\def\doshowinstalledfonts[#1][#2]% - {\bgroup - \def\pattern{#1}% - \def\all{false}% - \def\reload{false}% - \doifnothing\pattern{\def\pattern{.*}}% - \processallactionsinset[#2][\v!new=>\def\reload{true},\v!all=>\def\all{true}]% - \ctxlua{fonts.names.table("#1",\reload,\all)}% - \egroup} - -\protect \endinput diff --git a/tex/context/base/s-fnt-20.mkiv b/tex/context/base/s-fnt-20.mkiv new file mode 100644 index 000000000..a57c0ba47 --- /dev/null +++ b/tex/context/base/s-fnt-20.mkiv @@ -0,0 +1,140 @@ +%D \module +%D [ file=s-fnt-20, +%D version=2009.01.10, +%D title=\CONTEXT\ Style File, +%D subtitle=Tracing Feature Application (1), +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This file is used by Idris and me in the process of getting the +%D best arabic fonts getting rendered best. As such it might change. + +% \setvariables +% [otftracker] +% [title=Reverse Chaining, +% figure=test-003-volt.pdf, +% font=husayni, +% sample={ببب بببب ببببب بببببب}] + +\def\checkedfeature#1#2{\ifnum\featureattribute{#1}=\zerocount#2\else#1\fi} + +% we can consider adding a dir key to features + +\definefontfeature + [otftracker-default] + [default] + [mode=node] + +\definefontfeature + [otftracker-arabtype] + [mode=node,analyze=yes, + language=dflt,script=arab,ccmp=yes, + init=yes,medi=yes,fina=yes,isol=yes, + liga=yes,dlig=yes,rlig=yes,clig=yes, + mark=yes,mkmk=yes,kern=yes,curs=yes] + +% \definefontfeature +% [otftracker-husayni] +% [analyze=yes,mode=node, +% language=dflt,script=arab,ccmp=yes, +% init=yes,medi=yes,fina=yes,isol=yes, +% calt=yes, +% mark=yes,mkmk=yes,kern=yes,curs=yes] + +\definefontfeature + [otftracker-husayni] + [analyze=yes,mode=node, + language=dflt,script=arab,ccmp=no, + init=yes,medi=yes,fina=yes, + rlig=yes, + ccmp=yes, + ss01=yes, % full Allah, Muhammad, Allahumma + ss05=yes, % full Jiim stacking + ss09=yes, % full Haa stacking + ss10=yes, % partial dipped Miim + % ss11=yes, % full dipped Miim + ss13=yes, % full stacked Miim + ss15=yes, % full stacked Laam-on-Miim + ss17=yes, % full stacked Ayn-on-Miim + ss19=yes, % LM_im + ss24=yes,ss25=yes,ss26=yes, % BX, LH_im, full Yaa.final specials + ss27=yes, % partial thin Miim.final + ss31=yes, % partial Raa.final contexts + ss34=yes, % partial Raa.final contexts + ss35=yes, % full Kaaf contexts + ss36=yes, % full Laam contexts + ss37=yes, % Miim-Miim contexts + ss38=yes, % fancy thin Haa.medial-Miim.final + ss39=yes, % high and low Baa strings + ss40=yes, % diagonal entry + ss41=yes, % initial alternates + % js06=yes,js08=yes,js10=yes,js11=yes,js17=yes, + % ttwl=yes, + mark=yes,mkmk=yes, + kern=yes,curs=yes] + +\definefontfeature + [otftracker-simplenaskhi] + [analyze=yes,mode=node, + language=dflt,script=arab, + init=yes,medi=yes,fina=yes,calt=yes, + rlig=yes,liga=yes,dlig=yes, + mark=yes,mkmk=yes,curs=yes] + +\setvalue{otftracker-direction-arabtype}{-1} +\setvalue{otftracker-direction-husayni}{-1} +\setvalue{otftracker-direction-simplenaskhi}{-1} + +\setvariables + [otftracker] + [font=Serif, + features=\checkedfeature{otftracker-\getvariable{otftracker}{font}}{otftracker-default}, + size=48pt, + figure=, + title=Feature Check, + sample=no sample, + direction=\executeifdefined{otftracker-direction-\getvariable{otftracker}{font}}{0}, + set=\setups{otftracker}] + +\setuplayout + [topspace=1.5cm, + backspace=1.5cm, + width=middle, + height=middle, + header=1.5cm, + footer=1.5cm] + +\setuphead + [chapter] + [header=high, + number=no] + +\setupfootertexts + [chapter] + +\setupalign + [flushleft] + +\setupcolors + [state=start] + +\startsetups otftracker + \setupbodyfont[tt,10pt] + \starttext + \chapter{\getvariable{otftracker}{title}} + \doifsomething {\getvariable{otftracker}{figure}} { + \startlinecorrection + \externalfigure[\getvariable{otftracker}{figure}] + \stoplinecorrection + } + \showotfcomposition + {\getvariable{otftracker}{font}*\getvariable{otftracker}{features} at \getvariable{otftracker}{size}} + {\getvariable{otftracker}{direction}} + {\getvariable{otftracker}{sample}} + \stoptext +\stopsetups diff --git a/tex/context/base/s-fnt-20.tex b/tex/context/base/s-fnt-20.tex deleted file mode 100644 index a57c0ba47..000000000 --- a/tex/context/base/s-fnt-20.tex +++ /dev/null @@ -1,140 +0,0 @@ -%D \module -%D [ file=s-fnt-20, -%D version=2009.01.10, -%D title=\CONTEXT\ Style File, -%D subtitle=Tracing Feature Application (1), -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This file is used by Idris and me in the process of getting the -%D best arabic fonts getting rendered best. As such it might change. - -% \setvariables -% [otftracker] -% [title=Reverse Chaining, -% figure=test-003-volt.pdf, -% font=husayni, -% sample={ببب بببب ببببب بببببب}] - -\def\checkedfeature#1#2{\ifnum\featureattribute{#1}=\zerocount#2\else#1\fi} - -% we can consider adding a dir key to features - -\definefontfeature - [otftracker-default] - [default] - [mode=node] - -\definefontfeature - [otftracker-arabtype] - [mode=node,analyze=yes, - language=dflt,script=arab,ccmp=yes, - init=yes,medi=yes,fina=yes,isol=yes, - liga=yes,dlig=yes,rlig=yes,clig=yes, - mark=yes,mkmk=yes,kern=yes,curs=yes] - -% \definefontfeature -% [otftracker-husayni] -% [analyze=yes,mode=node, -% language=dflt,script=arab,ccmp=yes, -% init=yes,medi=yes,fina=yes,isol=yes, -% calt=yes, -% mark=yes,mkmk=yes,kern=yes,curs=yes] - -\definefontfeature - [otftracker-husayni] - [analyze=yes,mode=node, - language=dflt,script=arab,ccmp=no, - init=yes,medi=yes,fina=yes, - rlig=yes, - ccmp=yes, - ss01=yes, % full Allah, Muhammad, Allahumma - ss05=yes, % full Jiim stacking - ss09=yes, % full Haa stacking - ss10=yes, % partial dipped Miim - % ss11=yes, % full dipped Miim - ss13=yes, % full stacked Miim - ss15=yes, % full stacked Laam-on-Miim - ss17=yes, % full stacked Ayn-on-Miim - ss19=yes, % LM_im - ss24=yes,ss25=yes,ss26=yes, % BX, LH_im, full Yaa.final specials - ss27=yes, % partial thin Miim.final - ss31=yes, % partial Raa.final contexts - ss34=yes, % partial Raa.final contexts - ss35=yes, % full Kaaf contexts - ss36=yes, % full Laam contexts - ss37=yes, % Miim-Miim contexts - ss38=yes, % fancy thin Haa.medial-Miim.final - ss39=yes, % high and low Baa strings - ss40=yes, % diagonal entry - ss41=yes, % initial alternates - % js06=yes,js08=yes,js10=yes,js11=yes,js17=yes, - % ttwl=yes, - mark=yes,mkmk=yes, - kern=yes,curs=yes] - -\definefontfeature - [otftracker-simplenaskhi] - [analyze=yes,mode=node, - language=dflt,script=arab, - init=yes,medi=yes,fina=yes,calt=yes, - rlig=yes,liga=yes,dlig=yes, - mark=yes,mkmk=yes,curs=yes] - -\setvalue{otftracker-direction-arabtype}{-1} -\setvalue{otftracker-direction-husayni}{-1} -\setvalue{otftracker-direction-simplenaskhi}{-1} - -\setvariables - [otftracker] - [font=Serif, - features=\checkedfeature{otftracker-\getvariable{otftracker}{font}}{otftracker-default}, - size=48pt, - figure=, - title=Feature Check, - sample=no sample, - direction=\executeifdefined{otftracker-direction-\getvariable{otftracker}{font}}{0}, - set=\setups{otftracker}] - -\setuplayout - [topspace=1.5cm, - backspace=1.5cm, - width=middle, - height=middle, - header=1.5cm, - footer=1.5cm] - -\setuphead - [chapter] - [header=high, - number=no] - -\setupfootertexts - [chapter] - -\setupalign - [flushleft] - -\setupcolors - [state=start] - -\startsetups otftracker - \setupbodyfont[tt,10pt] - \starttext - \chapter{\getvariable{otftracker}{title}} - \doifsomething {\getvariable{otftracker}{figure}} { - \startlinecorrection - \externalfigure[\getvariable{otftracker}{figure}] - \stoplinecorrection - } - \showotfcomposition - {\getvariable{otftracker}{font}*\getvariable{otftracker}{features} at \getvariable{otftracker}{size}} - {\getvariable{otftracker}{direction}} - {\getvariable{otftracker}{sample}} - \stoptext -\stopsetups diff --git a/tex/context/base/s-fnt-21.mkiv b/tex/context/base/s-fnt-21.mkiv new file mode 100644 index 000000000..dd8de398d --- /dev/null +++ b/tex/context/base/s-fnt-21.mkiv @@ -0,0 +1,46 @@ +%D \module +%D [ file=s-fnt-20, +%D version=2009.01.10, +%D title=\CONTEXT\ Style File, +%D subtitle=Tracing Feature Application (2), +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This module is related to: + +\usemodule[fnt-20] + +\setvariables + [otftracker] + [set=\setups{araball}] + +\startsetups araball + \begingroup + \setupcolors[state=start]% + \enabletrackers[otf.analyzing]% beware, kind of global + \ruledhbox \bgroup + \definedfont[\getvariable{otftracker}{font}*\getvariable{otftracker}{features} at \getvariable{otftracker}{size}]% + \ifnum\getvariable{otftracker}{direction}<0 \textdir TRT\else\ifnum\getvariable{otftracker}{direction}>0 \textdir TLT\fi\fi\relax + \getvariable{otftracker}{sample}% + \egroup + \disabletrackers[otf.analyzing]% + \endgroup +\stopsetups + +\def\ShowOtfTrackerSample#1% + {\doiffile{#1} + {\blank + \startlinecorrection + \vbox \bgroup + \forgetall + \setbox\scratchbox\hbox{\component #1 \relax} + \hbox{\copy\scratchbox\quad\lower\dp\scratchbox\hbox{\ruledhbox{\externalfigure[#1-volt.pdf][height=\htdp\scratchbox]}}} + \hbox{\strut\tttf#1}% + \egroup + \stoplinecorrection + \blank}} diff --git a/tex/context/base/s-fnt-21.tex b/tex/context/base/s-fnt-21.tex deleted file mode 100644 index dd8de398d..000000000 --- a/tex/context/base/s-fnt-21.tex +++ /dev/null @@ -1,46 +0,0 @@ -%D \module -%D [ file=s-fnt-20, -%D version=2009.01.10, -%D title=\CONTEXT\ Style File, -%D subtitle=Tracing Feature Application (2), -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This module is related to: - -\usemodule[fnt-20] - -\setvariables - [otftracker] - [set=\setups{araball}] - -\startsetups araball - \begingroup - \setupcolors[state=start]% - \enabletrackers[otf.analyzing]% beware, kind of global - \ruledhbox \bgroup - \definedfont[\getvariable{otftracker}{font}*\getvariable{otftracker}{features} at \getvariable{otftracker}{size}]% - \ifnum\getvariable{otftracker}{direction}<0 \textdir TRT\else\ifnum\getvariable{otftracker}{direction}>0 \textdir TLT\fi\fi\relax - \getvariable{otftracker}{sample}% - \egroup - \disabletrackers[otf.analyzing]% - \endgroup -\stopsetups - -\def\ShowOtfTrackerSample#1% - {\doiffile{#1} - {\blank - \startlinecorrection - \vbox \bgroup - \forgetall - \setbox\scratchbox\hbox{\component #1 \relax} - \hbox{\copy\scratchbox\quad\lower\dp\scratchbox\hbox{\ruledhbox{\externalfigure[#1-volt.pdf][height=\htdp\scratchbox]}}} - \hbox{\strut\tttf#1}% - \egroup - \stoplinecorrection - \blank}} diff --git a/tex/context/base/s-fnt-23.mkiv b/tex/context/base/s-fnt-23.mkiv new file mode 100644 index 000000000..35973d27e --- /dev/null +++ b/tex/context/base/s-fnt-23.mkiv @@ -0,0 +1,271 @@ +%D \module +%D [ file=s-fnt-23, +%D version=2009.03.04, +%D title=\CONTEXT\ Style File, +%D subtitle=Tracing Feature Application (3), +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% last_data was written wrong so it needs checking + +\startluacode + local last_data = nil + local format = string.format + function fonts.otf.show_shape(n) + local tfmdata = fonts.identifiers[font.current()] + last_data = tfmdata + local charnum = tonumber(n) + if not charnum then + charnum = tfmdata.unicodes[n] + end + local c = tfmdata.characters[charnum] + local d = tfmdata.descriptions[charnum] + if d then + local factor = (tfmdata.size/tfmdata.units)*((7200/7227)/65536) + local llx, lly, urx, ury = unpack(d.boundingbox) + llx, lly, urx, ury = llx*factor, lly*factor, urx*factor, ury*factor + local width, italic = (d.width or 0)*factor, (d.italic or 0)*factor + local top_accent, bot_accent = (d.top_accent or 0)*factor, (d.bot_accent or 0)*factor + local anchors, math = d.anchors, d.math + context.startMPcode() + context("pickup pencircle scaled .25bp ; ") + context('picture p ; p := image(draw textext.drt("\\gray\\char%s");); draw p ;',charnum) + context('draw (%s,%s)--(%s,%s)--(%s,%s)--(%s,%s)--cycle withcolor green ;',llx,lly,urx,lly,urx,ury,llx,ury) + context('draw (%s,%s)--(%s,%s) withcolor green ;',llx,0,urx,0) + context('draw boundingbox p withcolor .2white withpen pencircle scaled .065bp ;') + context("defaultscale := 0.05 ; ") + -- inefficient but non critical + local function slant_1(v,dx,dy,txt,xsign,ysign,loc,labloc) + if #v > 0 then + local l = { } + for kk, vv in ipairs(v) do + local h, k = vv.height, vv.kern + if h and k then + l[#l+1] = format("((%s,%s) shifted (%s,%s))",xsign*k*factor,ysign*h*factor,dx,dy) + end + end + context("draw ((%s,%s) shifted (%s,%s))--%s dashed (evenly scaled .25) withcolor .5white;", xsign*v[1].kern*factor,lly,dx,dy,l[1]) + context("draw laddered (%s) withcolor .5white ;",table.concat(l,"..")) + context("draw ((%s,%s) shifted (%s,%s))--%s dashed (evenly scaled .25) withcolor .5white;", xsign*v[#v].kern*factor,ury,dx,dy,l[#l]) + for k, v in ipairs(l) do + context("draw %s withcolor blue withpen pencircle scaled 1bp;",v) + end + end + end + local function slant_2(v,dx,dy,txt,xsign,ysign,loc,labloc) + if #v > 0 then + local l = { } + for kk, vv in ipairs(v) do + local h, k = vv.height, vv.kern + if h and k then + l[#l+1] = format("((%s,%s) shifted (%s,%s))",xsign*k*factor,ysign*h*factor,dx,dy) + end + end + if loc == "top" then + context('label.%s("\\type{%s}",%s shifted (0,-1bp)) ;',loc,txt,l[#l]) + else + context('label.%s("\\type{%s}",%s shifted (0,2bp)) ;',loc,txt,l[1]) + end + for kk, vv in ipairs(v) do + local h, k = vv.height, vv.kern + if h and k then + context('label.top("(%s,%s)",%s shifted (0,-2bp));',k,h,l[kk]) + end + end + end + end + if math then + local kerns = math.kerns + if kerns then + for _, slant in ipairs { slant_1, slant_2 } do + for k,v in pairs(kerns) do + if k == "top_right" then + slant(v,width+italic,0,k,1,1,"top","ulft") + elseif k == "bottom_right" then + slant(v,width,0,k,1,1,"bot","lrt") + elseif k == "top_left" then + slant(v,0,0,k,-1,1,"top","ulft") + elseif k == "bottom_left" then + slant(v,0,0,k,-1,1,"bot","lrt") + end + end + end + end + end + local function show(x,y,txt) + local xx, yy = x*factor, y*factor + context("draw (%s,%s) withcolor blue withpen pencircle scaled 1bp;",xx,yy) + context('label.top("\\type{%s}",(%s,%s-2bp)) ;',txt,xx,yy) + context('label.bot("(%s,%s)",(%s,%s+2bp)) ;',x,y,xx,yy) + end + if anchors then + local a = anchors.baselig + if a then + for k, v in pairs(a) do + for kk, vv in ipairs(v) do + show(vv[1],vv[2],k .. ":" .. kk) + end + end + end + local a = anchors.mark + if a then + for k, v in pairs(a) do + show(v[1],v[2],k) + end + end + local a = anchors.basechar + if a then + for k, v in pairs(a) do + show(v[1],v[2],k) + end + end + local ba = anchors.centry + if a then + for k, v in pairs(a) do + show(v[1],v[2],k) + end + end + local a = anchors.cexit + if a then + for k, v in pairs(a) do + show(v[1],v[2],k) + end + end + end + if italic ~= 0 then + context('draw (%s,%s-1bp)--(%s,%s-0.5bp) withcolor blue;',width,ury,width,ury) + context('draw (%s,%s-1bp)--(%s,%s-0.5bp) withcolor blue;',width+italic,ury,width+italic,ury) + context('draw (%s,%s-1bp)--(%s,%s-1bp) withcolor blue;',width,ury,width+italic,ury) + context('label.lft("\\type{%s}",(%s+2bp,%s-1bp));',"italic",width,ury) + context('label.rt("%s",(%s-2bp,%s-1bp));',d.italic,width+italic,ury) + end + if top_accent ~= 0 then + context('draw (%s,%s+1bp)--(%s,%s-1bp) withcolor blue;',top_accent,ury,top_accent,ury) + context('label.bot("\\type{%s}",(%s,%s+1bp));',"top_accent",top_accent,ury) + context('label.top("%s",(%s,%s-1bp));',d.top_accent,top_accent,ury) + end + if bot_accent ~= 0 then + context('draw (%s,%s+1bp)--(%s,%s-1bp) withcolor blue;',bot_accent,lly,bot_accent,lly) + context('label.top("\\type{%s}",(%s,%s-1bp));',"bot_accent",top_accent,ury) + context('label.bot("%s",(%s,%s+1bp));',d.bot_accent,bot_accent,lly) + end + context('draw origin withcolor red withpen pencircle scaled 1bp;') + context("setbounds currentpicture to boundingbox currentpicture enlarged 1bp ;") + context("currentpicture := currentpicture scaled 8 ;") + context.stopMPcode() + elseif c then + local factor = (7200/7227)/65536 + context.startMPcode() + context("pickup pencircle scaled .25bp ; ") + context('picture p ; p := image(draw textext.drt("\\gray\\char%s");); draw p ;',charnum) + context('draw boundingbox p withcolor .2white withpen pencircle scaled .065bp ;') + context("defaultscale := 0.05 ; ") + local italic, top_accent, bot_accent = (c.italic or 0)*factor, (c.top_accent or 0)*factor, (c.bot_accent or 0)*factor + local width, height, depth = (c.width or 0)*factor, (c.height or 0)*factor, (c.depth or 0)*factor + local ury = height + if italic ~= 0 then + context('draw (%s,%s-1bp)--(%s,%s-0.5bp) withcolor blue;',width,ury,width,ury) + context('draw (%s,%s-1bp)--(%s,%s-0.5bp) withcolor blue;',width+italic,ury,width+italic,ury) + context('draw (%s,%s-1bp)--(%s,%s-1bp) withcolor blue;',width,ury,width+italic,height) + context('label.lft("\\type{%s}",(%s+2bp,%s-1bp));',"italic",width,height) + context('label.rt("%6.3f bp",(%s-2bp,%s-1bp));',italic,width+italic,height) + end + if top_accent ~= 0 then + context('draw (%s,%s+1bp)--(%s,%s-1bp) withcolor blue;',top_accent,ury,top_accent,height) + context('label.bot("\\type{%s}",(%s,%s+1bp));',"top_accent",top_accent,height) + context('label.top("%6.3f bp",(%s,%s-1bp));',top_accent,top_accent,height) + end + if bot_accent ~= 0 then + context('draw (%s,%s+1bp)--(%s,%s-1bp) withcolor blue;',bot_accent,lly,bot_accent,height) + context('label.top("\\type{%s}",(%s,%s-1bp));',"bot_accent",top_accent,height) + context('label.bot("%6.3f bp",(%s,%s+1bp));',bot_accent,bot_accent,height) + end + context('draw origin withcolor red withpen pencircle scaled 1bp;') + context("setbounds currentpicture to boundingbox currentpicture enlarged 1bp ;") + context("currentpicture := currentpicture scaled 8 ;") + context.stopMPcode() + else + context("no such shape: %s",n) + end + end + function fonts.otf.show_all_shapes(start,stop) + local tfmdata = fonts.identifiers[font.current()] + last_data = tfmdata + start, stop = start or "\\startTEXpage\\gobbleoneargument", stop or "\\stopTEXpage" + local unicodes, indices, descriptions = tfmdata.unicodes, tfmdata.indices, tfmdata.descriptions + for _, unicode in next, table.sortedkeys(descriptions) do + local d = descriptions[unicode] + local name = d.name + context("%s{%s}%%",start,unicode) + context("\\writestatus{glyph}{U+%04X -> %s}%%",unicode,name) + fonts.otf.show_shape(unicode) + context(stop) + end + end + function fonts.otf.show_shape_field(unicode,name) + local tfmdata = last_data or fonts.identifiers[font.current()] + local d = tfmdata.descriptions[unicode] + if d then + if name == "unicode" then + context("U+%04X",unicode) + else + d = d[name] + if d then + context(d) + end + end + end + end +\stopluacode + +\setupcolors + [state=start] + +\def\GetGlyphField#1#2% + {\ctxlua{fonts.otf.show_shape_field(#1,"#2")}} + +\def\StartShowGlyphShape#1% + {\startTEXpage + \nonknuthmode + \def\GlyphUnicode{#1}} + +\def\StopShowGlyphShape + {\par + \midaligned{\tttf\setstrut\strut\GetGlyphField\GlyphUnicode{unicode}: \GetGlyphField\GlyphUnicode{name}}% + \stopTEXpage} + +\def\ShowGlyphShape#1#2#3% name size glyph + {\begingroup + \definedfont[#1 at #2]% + \obeyMPboxdepth + \ctxlua{fonts.otf.show_shape("#3")}% + \endgroup} + +\def\ShowAllGlyphShapes#1#2% name size + {\begingroup + \nonknuthmode + \definedfont[#1 at #2]% + \ctxlua{fonts.otf.show_all_shapes("\\StartShowGlyphShape","\\StopShowGlyphShape")}% + \endgroup} + +\setupcolors + [state=start] + +\doifnotmode{demo}{\endinput} + +\starttext + +\startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{0x62A} \stopTEXpage +\startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{0x2004} \stopTEXpage +\startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{0xF0299} \stopTEXpage +\startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{NameMe.1190} \stopTEXpage + +\ShowAllGlyphShapes{simplenaskhi}{100bp} +% \ShowAllGlyphShapes{xits}{100bp} + +\stoptext diff --git a/tex/context/base/s-fnt-23.tex b/tex/context/base/s-fnt-23.tex deleted file mode 100644 index 35973d27e..000000000 --- a/tex/context/base/s-fnt-23.tex +++ /dev/null @@ -1,271 +0,0 @@ -%D \module -%D [ file=s-fnt-23, -%D version=2009.03.04, -%D title=\CONTEXT\ Style File, -%D subtitle=Tracing Feature Application (3), -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% last_data was written wrong so it needs checking - -\startluacode - local last_data = nil - local format = string.format - function fonts.otf.show_shape(n) - local tfmdata = fonts.identifiers[font.current()] - last_data = tfmdata - local charnum = tonumber(n) - if not charnum then - charnum = tfmdata.unicodes[n] - end - local c = tfmdata.characters[charnum] - local d = tfmdata.descriptions[charnum] - if d then - local factor = (tfmdata.size/tfmdata.units)*((7200/7227)/65536) - local llx, lly, urx, ury = unpack(d.boundingbox) - llx, lly, urx, ury = llx*factor, lly*factor, urx*factor, ury*factor - local width, italic = (d.width or 0)*factor, (d.italic or 0)*factor - local top_accent, bot_accent = (d.top_accent or 0)*factor, (d.bot_accent or 0)*factor - local anchors, math = d.anchors, d.math - context.startMPcode() - context("pickup pencircle scaled .25bp ; ") - context('picture p ; p := image(draw textext.drt("\\gray\\char%s");); draw p ;',charnum) - context('draw (%s,%s)--(%s,%s)--(%s,%s)--(%s,%s)--cycle withcolor green ;',llx,lly,urx,lly,urx,ury,llx,ury) - context('draw (%s,%s)--(%s,%s) withcolor green ;',llx,0,urx,0) - context('draw boundingbox p withcolor .2white withpen pencircle scaled .065bp ;') - context("defaultscale := 0.05 ; ") - -- inefficient but non critical - local function slant_1(v,dx,dy,txt,xsign,ysign,loc,labloc) - if #v > 0 then - local l = { } - for kk, vv in ipairs(v) do - local h, k = vv.height, vv.kern - if h and k then - l[#l+1] = format("((%s,%s) shifted (%s,%s))",xsign*k*factor,ysign*h*factor,dx,dy) - end - end - context("draw ((%s,%s) shifted (%s,%s))--%s dashed (evenly scaled .25) withcolor .5white;", xsign*v[1].kern*factor,lly,dx,dy,l[1]) - context("draw laddered (%s) withcolor .5white ;",table.concat(l,"..")) - context("draw ((%s,%s) shifted (%s,%s))--%s dashed (evenly scaled .25) withcolor .5white;", xsign*v[#v].kern*factor,ury,dx,dy,l[#l]) - for k, v in ipairs(l) do - context("draw %s withcolor blue withpen pencircle scaled 1bp;",v) - end - end - end - local function slant_2(v,dx,dy,txt,xsign,ysign,loc,labloc) - if #v > 0 then - local l = { } - for kk, vv in ipairs(v) do - local h, k = vv.height, vv.kern - if h and k then - l[#l+1] = format("((%s,%s) shifted (%s,%s))",xsign*k*factor,ysign*h*factor,dx,dy) - end - end - if loc == "top" then - context('label.%s("\\type{%s}",%s shifted (0,-1bp)) ;',loc,txt,l[#l]) - else - context('label.%s("\\type{%s}",%s shifted (0,2bp)) ;',loc,txt,l[1]) - end - for kk, vv in ipairs(v) do - local h, k = vv.height, vv.kern - if h and k then - context('label.top("(%s,%s)",%s shifted (0,-2bp));',k,h,l[kk]) - end - end - end - end - if math then - local kerns = math.kerns - if kerns then - for _, slant in ipairs { slant_1, slant_2 } do - for k,v in pairs(kerns) do - if k == "top_right" then - slant(v,width+italic,0,k,1,1,"top","ulft") - elseif k == "bottom_right" then - slant(v,width,0,k,1,1,"bot","lrt") - elseif k == "top_left" then - slant(v,0,0,k,-1,1,"top","ulft") - elseif k == "bottom_left" then - slant(v,0,0,k,-1,1,"bot","lrt") - end - end - end - end - end - local function show(x,y,txt) - local xx, yy = x*factor, y*factor - context("draw (%s,%s) withcolor blue withpen pencircle scaled 1bp;",xx,yy) - context('label.top("\\type{%s}",(%s,%s-2bp)) ;',txt,xx,yy) - context('label.bot("(%s,%s)",(%s,%s+2bp)) ;',x,y,xx,yy) - end - if anchors then - local a = anchors.baselig - if a then - for k, v in pairs(a) do - for kk, vv in ipairs(v) do - show(vv[1],vv[2],k .. ":" .. kk) - end - end - end - local a = anchors.mark - if a then - for k, v in pairs(a) do - show(v[1],v[2],k) - end - end - local a = anchors.basechar - if a then - for k, v in pairs(a) do - show(v[1],v[2],k) - end - end - local ba = anchors.centry - if a then - for k, v in pairs(a) do - show(v[1],v[2],k) - end - end - local a = anchors.cexit - if a then - for k, v in pairs(a) do - show(v[1],v[2],k) - end - end - end - if italic ~= 0 then - context('draw (%s,%s-1bp)--(%s,%s-0.5bp) withcolor blue;',width,ury,width,ury) - context('draw (%s,%s-1bp)--(%s,%s-0.5bp) withcolor blue;',width+italic,ury,width+italic,ury) - context('draw (%s,%s-1bp)--(%s,%s-1bp) withcolor blue;',width,ury,width+italic,ury) - context('label.lft("\\type{%s}",(%s+2bp,%s-1bp));',"italic",width,ury) - context('label.rt("%s",(%s-2bp,%s-1bp));',d.italic,width+italic,ury) - end - if top_accent ~= 0 then - context('draw (%s,%s+1bp)--(%s,%s-1bp) withcolor blue;',top_accent,ury,top_accent,ury) - context('label.bot("\\type{%s}",(%s,%s+1bp));',"top_accent",top_accent,ury) - context('label.top("%s",(%s,%s-1bp));',d.top_accent,top_accent,ury) - end - if bot_accent ~= 0 then - context('draw (%s,%s+1bp)--(%s,%s-1bp) withcolor blue;',bot_accent,lly,bot_accent,lly) - context('label.top("\\type{%s}",(%s,%s-1bp));',"bot_accent",top_accent,ury) - context('label.bot("%s",(%s,%s+1bp));',d.bot_accent,bot_accent,lly) - end - context('draw origin withcolor red withpen pencircle scaled 1bp;') - context("setbounds currentpicture to boundingbox currentpicture enlarged 1bp ;") - context("currentpicture := currentpicture scaled 8 ;") - context.stopMPcode() - elseif c then - local factor = (7200/7227)/65536 - context.startMPcode() - context("pickup pencircle scaled .25bp ; ") - context('picture p ; p := image(draw textext.drt("\\gray\\char%s");); draw p ;',charnum) - context('draw boundingbox p withcolor .2white withpen pencircle scaled .065bp ;') - context("defaultscale := 0.05 ; ") - local italic, top_accent, bot_accent = (c.italic or 0)*factor, (c.top_accent or 0)*factor, (c.bot_accent or 0)*factor - local width, height, depth = (c.width or 0)*factor, (c.height or 0)*factor, (c.depth or 0)*factor - local ury = height - if italic ~= 0 then - context('draw (%s,%s-1bp)--(%s,%s-0.5bp) withcolor blue;',width,ury,width,ury) - context('draw (%s,%s-1bp)--(%s,%s-0.5bp) withcolor blue;',width+italic,ury,width+italic,ury) - context('draw (%s,%s-1bp)--(%s,%s-1bp) withcolor blue;',width,ury,width+italic,height) - context('label.lft("\\type{%s}",(%s+2bp,%s-1bp));',"italic",width,height) - context('label.rt("%6.3f bp",(%s-2bp,%s-1bp));',italic,width+italic,height) - end - if top_accent ~= 0 then - context('draw (%s,%s+1bp)--(%s,%s-1bp) withcolor blue;',top_accent,ury,top_accent,height) - context('label.bot("\\type{%s}",(%s,%s+1bp));',"top_accent",top_accent,height) - context('label.top("%6.3f bp",(%s,%s-1bp));',top_accent,top_accent,height) - end - if bot_accent ~= 0 then - context('draw (%s,%s+1bp)--(%s,%s-1bp) withcolor blue;',bot_accent,lly,bot_accent,height) - context('label.top("\\type{%s}",(%s,%s-1bp));',"bot_accent",top_accent,height) - context('label.bot("%6.3f bp",(%s,%s+1bp));',bot_accent,bot_accent,height) - end - context('draw origin withcolor red withpen pencircle scaled 1bp;') - context("setbounds currentpicture to boundingbox currentpicture enlarged 1bp ;") - context("currentpicture := currentpicture scaled 8 ;") - context.stopMPcode() - else - context("no such shape: %s",n) - end - end - function fonts.otf.show_all_shapes(start,stop) - local tfmdata = fonts.identifiers[font.current()] - last_data = tfmdata - start, stop = start or "\\startTEXpage\\gobbleoneargument", stop or "\\stopTEXpage" - local unicodes, indices, descriptions = tfmdata.unicodes, tfmdata.indices, tfmdata.descriptions - for _, unicode in next, table.sortedkeys(descriptions) do - local d = descriptions[unicode] - local name = d.name - context("%s{%s}%%",start,unicode) - context("\\writestatus{glyph}{U+%04X -> %s}%%",unicode,name) - fonts.otf.show_shape(unicode) - context(stop) - end - end - function fonts.otf.show_shape_field(unicode,name) - local tfmdata = last_data or fonts.identifiers[font.current()] - local d = tfmdata.descriptions[unicode] - if d then - if name == "unicode" then - context("U+%04X",unicode) - else - d = d[name] - if d then - context(d) - end - end - end - end -\stopluacode - -\setupcolors - [state=start] - -\def\GetGlyphField#1#2% - {\ctxlua{fonts.otf.show_shape_field(#1,"#2")}} - -\def\StartShowGlyphShape#1% - {\startTEXpage - \nonknuthmode - \def\GlyphUnicode{#1}} - -\def\StopShowGlyphShape - {\par - \midaligned{\tttf\setstrut\strut\GetGlyphField\GlyphUnicode{unicode}: \GetGlyphField\GlyphUnicode{name}}% - \stopTEXpage} - -\def\ShowGlyphShape#1#2#3% name size glyph - {\begingroup - \definedfont[#1 at #2]% - \obeyMPboxdepth - \ctxlua{fonts.otf.show_shape("#3")}% - \endgroup} - -\def\ShowAllGlyphShapes#1#2% name size - {\begingroup - \nonknuthmode - \definedfont[#1 at #2]% - \ctxlua{fonts.otf.show_all_shapes("\\StartShowGlyphShape","\\StopShowGlyphShape")}% - \endgroup} - -\setupcolors - [state=start] - -\doifnotmode{demo}{\endinput} - -\starttext - -\startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{0x62A} \stopTEXpage -\startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{0x2004} \stopTEXpage -\startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{0xF0299} \stopTEXpage -\startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{NameMe.1190} \stopTEXpage - -\ShowAllGlyphShapes{simplenaskhi}{100bp} -% \ShowAllGlyphShapes{xits}{100bp} - -\stoptext diff --git a/tex/context/base/s-fnt-24.mkiv b/tex/context/base/s-fnt-24.mkiv new file mode 100644 index 000000000..de485557b --- /dev/null +++ b/tex/context/base/s-fnt-24.mkiv @@ -0,0 +1,83 @@ +%D \module +%D [ file=s-fnt-24, +%D version=2009.02.06, +%D title=\CONTEXT\ Style File, +%D subtitle=CJK Glyph Combination Testing, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\unprotect + +\def\ShowChineseCombiChar#1#2#3#4% + {\blank[small] + \dontleavehmode + \hbox\bgroup + \dontcomplain + \setstrut + \hbox to 7em{\ruledhbox{\char#1}\hskip.25em\type{+}\hskip.25em\ruledhbox{\char#2}\hskip.25em\type{=}\hskip.25em\ruledhbox{\char#1\char#2}\hss}\relax + \ruledvtop{\hsize1em\char#1\char#2}\relax + \hskip2em + \ruledvtop{\hsize.625em\char#1\char#2}\relax + \hskip2em + \ruledvtop{\hsize1.5em\char#1\char#2}\relax + \hskip2em + \type{#3 + #4}\relax + \egroup + \blank[small]} + +\startluacode +local example = { + korean = 0x0AC00, + chinese = 0x04E55, + full_width_open = 0x03008, + full_width_close = 0x03009, + half_width_open = 0x02018, + half_width_close = 0x02019, + hyphen = 0x02026, + non_starter = 0x03005, + other = 0x0004D, -- M +} + +function fonts.analyzers.cjktest(first,second) + for k, v in next, example do + if (not first or first == "") or first == k then + for kk, vv in next, example do + if (not second or second == "") or second == kk then + context.ShowChineseCombiChar(v,vv,k,kk) + end + end + end + end +end +\stopluacode + +\def\ShowCombinationsKorean + {\dodoubleempty\doShowCombinationsKorean} + +\def\doShowCombinationsKorean[#1][#2]% + {\startpacked + \setscript[hangul] + \setupcolors[\c!state=\v!start] + \enabletrackers[cjk.analyzing] + \ctxlua{fonts.analyzers.cjktest("#1","#2")}\par % ! + \disabletrackers[cjk.analyzing] + \stoppacked} + +\def\ShowCombinationsChinese + {\dodoubleempty\doShowCombinationsChinese} + +\def\doShowCombinationsChinese[#1][#2]% + {\startpacked + \setscript[hanzi] + \setupcolors[\c!state=\v!start] + \enabletrackers[cjk.analyzing] + \ctxlua{fonts.analyzers.cjktest("#1","#2")}\par % ! + \disabletrackers[cjk.analyzing] + \stoppacked} + +\protect \endinput diff --git a/tex/context/base/s-fnt-24.tex b/tex/context/base/s-fnt-24.tex deleted file mode 100644 index de485557b..000000000 --- a/tex/context/base/s-fnt-24.tex +++ /dev/null @@ -1,83 +0,0 @@ -%D \module -%D [ file=s-fnt-24, -%D version=2009.02.06, -%D title=\CONTEXT\ Style File, -%D subtitle=CJK Glyph Combination Testing, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\unprotect - -\def\ShowChineseCombiChar#1#2#3#4% - {\blank[small] - \dontleavehmode - \hbox\bgroup - \dontcomplain - \setstrut - \hbox to 7em{\ruledhbox{\char#1}\hskip.25em\type{+}\hskip.25em\ruledhbox{\char#2}\hskip.25em\type{=}\hskip.25em\ruledhbox{\char#1\char#2}\hss}\relax - \ruledvtop{\hsize1em\char#1\char#2}\relax - \hskip2em - \ruledvtop{\hsize.625em\char#1\char#2}\relax - \hskip2em - \ruledvtop{\hsize1.5em\char#1\char#2}\relax - \hskip2em - \type{#3 + #4}\relax - \egroup - \blank[small]} - -\startluacode -local example = { - korean = 0x0AC00, - chinese = 0x04E55, - full_width_open = 0x03008, - full_width_close = 0x03009, - half_width_open = 0x02018, - half_width_close = 0x02019, - hyphen = 0x02026, - non_starter = 0x03005, - other = 0x0004D, -- M -} - -function fonts.analyzers.cjktest(first,second) - for k, v in next, example do - if (not first or first == "") or first == k then - for kk, vv in next, example do - if (not second or second == "") or second == kk then - context.ShowChineseCombiChar(v,vv,k,kk) - end - end - end - end -end -\stopluacode - -\def\ShowCombinationsKorean - {\dodoubleempty\doShowCombinationsKorean} - -\def\doShowCombinationsKorean[#1][#2]% - {\startpacked - \setscript[hangul] - \setupcolors[\c!state=\v!start] - \enabletrackers[cjk.analyzing] - \ctxlua{fonts.analyzers.cjktest("#1","#2")}\par % ! - \disabletrackers[cjk.analyzing] - \stoppacked} - -\def\ShowCombinationsChinese - {\dodoubleempty\doShowCombinationsChinese} - -\def\doShowCombinationsChinese[#1][#2]% - {\startpacked - \setscript[hanzi] - \setupcolors[\c!state=\v!start] - \enabletrackers[cjk.analyzing] - \ctxlua{fonts.analyzers.cjktest("#1","#2")}\par % ! - \disabletrackers[cjk.analyzing] - \stoppacked} - -\protect \endinput diff --git a/tex/context/base/s-fnt-25.mkiv b/tex/context/base/s-fnt-25.mkiv new file mode 100644 index 000000000..fc78ddfda --- /dev/null +++ b/tex/context/base/s-fnt-25.mkiv @@ -0,0 +1,195 @@ +%D \module +%D [ file=s-fnt-25, +%D version=2009.01.25, +%D title=\CONTEXT\ Style File, +%D subtitle=Math Glyph Checking, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\def\enableshowmathfontvirtual + {\ctxlua{fonts.tfm.auto_cleanup=false}} + +\def\showmathfontcharacters + {\dodoubleempty\doshowmathfontcharacters} + +\def\doshowmathfontcharacters[#1][#2]% + {\begingroup + \dontcomplain + \doifelsenothing{#1} + {\definedfont[MathRoman*math-text]} + {\definedfont[#1]}% + \doifelsenothing{#2} + {\ctxlua{document.showmathfont(font.current())}} + {\def\dodoshowmathfontcharacters##1{\ctxlua{document.showmathfont(font.current(),##1)}}% + \processcommalist[#2]\dodoshowmathfontcharacters}% + \endgroup} + +\def\startmathfontlist + {\startpacked} + +\def\stopmathfontlist + {\stoppacked} + +\def\startmathfontlistentry + {\blank + \begingroup} + +\def\stopmathfontlistentry + {\endgroup + \blank} + +\def\mathfontlistentryhexdectit#1#2#3% + {#1: \char#2\enspace\ruledhbox{\char#2}\enspace#3\par + \advance\leftskip 1em\relax} + +\def\mathfontlistentrywdhtdpic#1#2#3#4% + {width: #1, height: #2, depth: #3, italic: #4\par} + +\def\mathfontlistentryresource#1% + {virtual: #1\par} + +\def\mathfontlistentrynext#1#2% + {#1~\ruledhbox{\char#2}} + +\def\mathfontlistentrynextlist#1% + {next: #1\par} + +\def\fontlistentryvariants#1#2% + {#1~\ruledhbox{\char#2}} + +\def\mathfontlistentryvariantslist#1% + {variants: #1\par} + +\def\mathfontlistentrynextvariantslist#1#2% + {next: #1 => variants: #2\par} + +\def\mathfontlistentryclassname#1#2% + {mathclass: #1, mathname: #2\par} + +\def\mathfontlistentrysymbol#1#2% + {mathsymbol: #1~\ruledhbox{\char#2}\par} + +\startluacode +local concat = table.concat +local format, lower = string.format, string.lower + +function document.showmathfont(id,slot) + local data = characters.data + local tfmdata = fonts.identifiers[id] + local characters = tfmdata.characters + local sorted = (slot and { slot }) or table.sortedkeys(characters) + local virtual, names = tfmdata.type == "virtual", { } + if virtual then + for k, v in ipairs(tfmdata.fonts) do + local name = fonts.identifiers[v.id].name + names[k] = (name and file.basename(name)) or v.id + end + end + local round = math.round + local limited = true + for _, s in next, sorted do + if not limited or s < 0xF0000 then + local char = characters[s] + if char then + local info = data[s] + local cnext, cvert_variants, choriz_variants = char.next, char.vert_variants, char.horiz_variants + context.startmathfontlistentry() + context.mathfontlistentryhexdectit(format("U+%05X",s),s,lower(info.description or "no description, private to font")) + context.mathfontlistentrywdhtdpic(round(char.width or 0),round(char.height or 0),round(char.depth or 0),round(char.italic or 0)) + if virtual then + local commands = char.commands + if commands then + local t = { } + for i=1,#commands do + local ci = commands[i] + if ci[1] == "slot" then + local fnt, idx = ci[2], ci[3] + t[#t+1] = format("%s/%0X",names[fnt] or fnt,idx) + end + end + if #t > 0 then + context.mathfontlistentryresource(concat(t,", ")) + end + end + end + if info.mathclass then + context.mathfontlistentryclassname(info.mathclass,info.mathname or "no name") + end + if info.mathspec then + for i=1,#info.mathspec do + context.mathfontlistentryclassname(info.mathspec[i].class,info.mathspec[i].name or "no name") + end + end + if info.mathsymbol then + context.mathfontlistentrysymbol(format("U+%05X",info.mathsymbol),info.mathsymbol) + end + if cnext then + local t, done = { }, { } + while cnext do + if done[cnext] then + t[#t+1] = "CYCLE" + break + else + done[cnext] = true + t[#t+1] = context.nested.mathfontlistentrynext(format("U+%05X",cnext),cnext) + cnext = characters[cnext] + cvert_variants = cnext.vert_variants or cvert_variants + choriz_variants = cnext.horiz_variants or choriz_variants + if cnext then + cnext = cnext.next + end + end + end + cnext = t + end + if cvert_variants then + local t = { } + for k, v in next, cvert_variants do + t[#t+1] = context.nested.fontlistentryvariants(format("U+%05X",v.glyph),v.glyph) + end + cvert_variants = t + end + if choriz_variants then + local t = { } + for k, v in next, choriz_variants do + t[#t+1] = context.nested.fontlistentryvariants(format("U+%05X",v.glyph),v.glyph) + end + choriz_variants = t + end + local cvariants = choriz_variants or cvert_variants + if cvariants and cnext then + context.mathfontlistentrynextvariantslist(concat(cnext," => "),concat(cvariants," => ")) + else + if cnext then + context.mathfontlistentrynextlist(concat(cnext," => ")) + end + if cvariants then + context.mathfontlistentryvariantslist(concat(cvariants," ")) + end + end + context.stopmathfontlistentry() + end + end + end +end +\stopluacode + +\endinput + +\starttext + \setupbodyfont[cambria, 12pt] \showmathfontcharacters +% \setupbodyfont[lmvirtual,12pt] \showmathfontcharacters +% \setupbodyfont[pxvirtual,12pt] \showmathfontcharacters +% \setupbodyfont[txvirtual,12pt] \showmathfontcharacters +% \setupbodyfont[palatino, 10pt] \showmathfontcharacters +% \setupbodyfont[mathtimes,12pt] \showmathfontcharacters +% \setupbodyfont[stix, 12pt] \showmathfontcharacters +% \setupbodyfont[xits, 12pt] \showmathfontcharacters +% \setupbodyfont[lucida, 12pt] \showmathfontcharacters +\stoptext + diff --git a/tex/context/base/s-fnt-25.tex b/tex/context/base/s-fnt-25.tex deleted file mode 100644 index fc78ddfda..000000000 --- a/tex/context/base/s-fnt-25.tex +++ /dev/null @@ -1,195 +0,0 @@ -%D \module -%D [ file=s-fnt-25, -%D version=2009.01.25, -%D title=\CONTEXT\ Style File, -%D subtitle=Math Glyph Checking, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\def\enableshowmathfontvirtual - {\ctxlua{fonts.tfm.auto_cleanup=false}} - -\def\showmathfontcharacters - {\dodoubleempty\doshowmathfontcharacters} - -\def\doshowmathfontcharacters[#1][#2]% - {\begingroup - \dontcomplain - \doifelsenothing{#1} - {\definedfont[MathRoman*math-text]} - {\definedfont[#1]}% - \doifelsenothing{#2} - {\ctxlua{document.showmathfont(font.current())}} - {\def\dodoshowmathfontcharacters##1{\ctxlua{document.showmathfont(font.current(),##1)}}% - \processcommalist[#2]\dodoshowmathfontcharacters}% - \endgroup} - -\def\startmathfontlist - {\startpacked} - -\def\stopmathfontlist - {\stoppacked} - -\def\startmathfontlistentry - {\blank - \begingroup} - -\def\stopmathfontlistentry - {\endgroup - \blank} - -\def\mathfontlistentryhexdectit#1#2#3% - {#1: \char#2\enspace\ruledhbox{\char#2}\enspace#3\par - \advance\leftskip 1em\relax} - -\def\mathfontlistentrywdhtdpic#1#2#3#4% - {width: #1, height: #2, depth: #3, italic: #4\par} - -\def\mathfontlistentryresource#1% - {virtual: #1\par} - -\def\mathfontlistentrynext#1#2% - {#1~\ruledhbox{\char#2}} - -\def\mathfontlistentrynextlist#1% - {next: #1\par} - -\def\fontlistentryvariants#1#2% - {#1~\ruledhbox{\char#2}} - -\def\mathfontlistentryvariantslist#1% - {variants: #1\par} - -\def\mathfontlistentrynextvariantslist#1#2% - {next: #1 => variants: #2\par} - -\def\mathfontlistentryclassname#1#2% - {mathclass: #1, mathname: #2\par} - -\def\mathfontlistentrysymbol#1#2% - {mathsymbol: #1~\ruledhbox{\char#2}\par} - -\startluacode -local concat = table.concat -local format, lower = string.format, string.lower - -function document.showmathfont(id,slot) - local data = characters.data - local tfmdata = fonts.identifiers[id] - local characters = tfmdata.characters - local sorted = (slot and { slot }) or table.sortedkeys(characters) - local virtual, names = tfmdata.type == "virtual", { } - if virtual then - for k, v in ipairs(tfmdata.fonts) do - local name = fonts.identifiers[v.id].name - names[k] = (name and file.basename(name)) or v.id - end - end - local round = math.round - local limited = true - for _, s in next, sorted do - if not limited or s < 0xF0000 then - local char = characters[s] - if char then - local info = data[s] - local cnext, cvert_variants, choriz_variants = char.next, char.vert_variants, char.horiz_variants - context.startmathfontlistentry() - context.mathfontlistentryhexdectit(format("U+%05X",s),s,lower(info.description or "no description, private to font")) - context.mathfontlistentrywdhtdpic(round(char.width or 0),round(char.height or 0),round(char.depth or 0),round(char.italic or 0)) - if virtual then - local commands = char.commands - if commands then - local t = { } - for i=1,#commands do - local ci = commands[i] - if ci[1] == "slot" then - local fnt, idx = ci[2], ci[3] - t[#t+1] = format("%s/%0X",names[fnt] or fnt,idx) - end - end - if #t > 0 then - context.mathfontlistentryresource(concat(t,", ")) - end - end - end - if info.mathclass then - context.mathfontlistentryclassname(info.mathclass,info.mathname or "no name") - end - if info.mathspec then - for i=1,#info.mathspec do - context.mathfontlistentryclassname(info.mathspec[i].class,info.mathspec[i].name or "no name") - end - end - if info.mathsymbol then - context.mathfontlistentrysymbol(format("U+%05X",info.mathsymbol),info.mathsymbol) - end - if cnext then - local t, done = { }, { } - while cnext do - if done[cnext] then - t[#t+1] = "CYCLE" - break - else - done[cnext] = true - t[#t+1] = context.nested.mathfontlistentrynext(format("U+%05X",cnext),cnext) - cnext = characters[cnext] - cvert_variants = cnext.vert_variants or cvert_variants - choriz_variants = cnext.horiz_variants or choriz_variants - if cnext then - cnext = cnext.next - end - end - end - cnext = t - end - if cvert_variants then - local t = { } - for k, v in next, cvert_variants do - t[#t+1] = context.nested.fontlistentryvariants(format("U+%05X",v.glyph),v.glyph) - end - cvert_variants = t - end - if choriz_variants then - local t = { } - for k, v in next, choriz_variants do - t[#t+1] = context.nested.fontlistentryvariants(format("U+%05X",v.glyph),v.glyph) - end - choriz_variants = t - end - local cvariants = choriz_variants or cvert_variants - if cvariants and cnext then - context.mathfontlistentrynextvariantslist(concat(cnext," => "),concat(cvariants," => ")) - else - if cnext then - context.mathfontlistentrynextlist(concat(cnext," => ")) - end - if cvariants then - context.mathfontlistentryvariantslist(concat(cvariants," ")) - end - end - context.stopmathfontlistentry() - end - end - end -end -\stopluacode - -\endinput - -\starttext - \setupbodyfont[cambria, 12pt] \showmathfontcharacters -% \setupbodyfont[lmvirtual,12pt] \showmathfontcharacters -% \setupbodyfont[pxvirtual,12pt] \showmathfontcharacters -% \setupbodyfont[txvirtual,12pt] \showmathfontcharacters -% \setupbodyfont[palatino, 10pt] \showmathfontcharacters -% \setupbodyfont[mathtimes,12pt] \showmathfontcharacters -% \setupbodyfont[stix, 12pt] \showmathfontcharacters -% \setupbodyfont[xits, 12pt] \showmathfontcharacters -% \setupbodyfont[lucida, 12pt] \showmathfontcharacters -\stoptext - diff --git a/tex/context/base/s-fnt-26.mkiv b/tex/context/base/s-fnt-26.mkiv new file mode 100644 index 000000000..18d1d6573 --- /dev/null +++ b/tex/context/base/s-fnt-26.mkiv @@ -0,0 +1,74 @@ +%D \module +%D [ file=s-fnt-26, +%D version=2009.10.26, +%D title=\CONTEXT\ Style File, +%D subtitle=Goodies Tables, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\startluacode + + function document.show_goodies_stylistics(name) + local goodies = fonts.goodies.get(name) + local stylistics = goodies and goodies.stylistics + if stylistics then + local col, row, type = context.NC, context.NR, context.type + context.starttabulate { "|l|pl|" } + col() context("feature") col() context("meaning") col() row() + for feature, meaning in table.sortedpairs(stylistics) do + col() type(feature) col() type(meaning) col() row() + end + context.stoptabulate() + end + end + + function document.show_goodies_featuresets(name) + local goodies = fonts.goodies.get(name) + local featuresets = goodies and goodies.featuresets + if featuresets then + local col, row, type = context.NC, context.NR, context.type + context.starttabulate { "|l|pl|" } + col() context("featureset") col() context("definitions") col() row() + for featureset, definitions in table.sortedpairs(featuresets) do + col() type(featureset) col() + for k, v in table.sortedpairs(definitions) do + type(string.format("%s=%s",k,tostring(v))) + context.quad() + end + col() row() + end + context.stoptabulate() + end + end + + function document.show_goodies_colorschemes(name) + local goodies = fonts.goodies.get(name) + local colorschemes = goodies and goodies.colorschemes + if colorschemes then + local col, row, type = context.NC, context.NR, context.type + context.starttabulate { "|l|pl|" } + col() context("colorscheme") col() context("numbers") col() row() + for colorscheme, numbers in table.sortedpairs(colorschemes) do + col() type(colorscheme) col() + for i=1,#numbers do + type(i) + context.quad() + end + col() row() + end + context.stoptabulate() + end + end + +\stopluacode + +\def\showgoodiesstylistics #1{\ctxlua{document.show_goodies_stylistics ("#1")}} +\def\showgoodiesfeaturesets #1{\ctxlua{document.show_goodies_featuresets ("#1")}} +\def\showgoodiescolorschemes#1{\ctxlua{document.show_goodies_colorschemes("#1")}} + +\endinput diff --git a/tex/context/base/s-fnt-26.tex b/tex/context/base/s-fnt-26.tex deleted file mode 100644 index 18d1d6573..000000000 --- a/tex/context/base/s-fnt-26.tex +++ /dev/null @@ -1,74 +0,0 @@ -%D \module -%D [ file=s-fnt-26, -%D version=2009.10.26, -%D title=\CONTEXT\ Style File, -%D subtitle=Goodies Tables, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\startluacode - - function document.show_goodies_stylistics(name) - local goodies = fonts.goodies.get(name) - local stylistics = goodies and goodies.stylistics - if stylistics then - local col, row, type = context.NC, context.NR, context.type - context.starttabulate { "|l|pl|" } - col() context("feature") col() context("meaning") col() row() - for feature, meaning in table.sortedpairs(stylistics) do - col() type(feature) col() type(meaning) col() row() - end - context.stoptabulate() - end - end - - function document.show_goodies_featuresets(name) - local goodies = fonts.goodies.get(name) - local featuresets = goodies and goodies.featuresets - if featuresets then - local col, row, type = context.NC, context.NR, context.type - context.starttabulate { "|l|pl|" } - col() context("featureset") col() context("definitions") col() row() - for featureset, definitions in table.sortedpairs(featuresets) do - col() type(featureset) col() - for k, v in table.sortedpairs(definitions) do - type(string.format("%s=%s",k,tostring(v))) - context.quad() - end - col() row() - end - context.stoptabulate() - end - end - - function document.show_goodies_colorschemes(name) - local goodies = fonts.goodies.get(name) - local colorschemes = goodies and goodies.colorschemes - if colorschemes then - local col, row, type = context.NC, context.NR, context.type - context.starttabulate { "|l|pl|" } - col() context("colorscheme") col() context("numbers") col() row() - for colorscheme, numbers in table.sortedpairs(colorschemes) do - col() type(colorscheme) col() - for i=1,#numbers do - type(i) - context.quad() - end - col() row() - end - context.stoptabulate() - end - end - -\stopluacode - -\def\showgoodiesstylistics #1{\ctxlua{document.show_goodies_stylistics ("#1")}} -\def\showgoodiesfeaturesets #1{\ctxlua{document.show_goodies_featuresets ("#1")}} -\def\showgoodiescolorschemes#1{\ctxlua{document.show_goodies_colorschemes("#1")}} - -\endinput diff --git a/tex/context/base/s-fnt-28.mkiv b/tex/context/base/s-fnt-28.mkiv new file mode 100644 index 000000000..839c7d4ae --- /dev/null +++ b/tex/context/base/s-fnt-28.mkiv @@ -0,0 +1,46 @@ +%D \module +%D [ file=s-fnt-28, +%D version=2010.09.22, +%D title=\CONTEXT\ Style File, +%D subtitle=Tracing Names, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\startluacode + function fonts.tracers.files(goodyfile) + local goodies = fonts.goodies.get(goodyfile) + if goodies then + local files = goodies.files + if files and files.list then + for filename, specification in table.sortedpairs(files.list) do + context.start() + context.dontleavehmode() + context.definedfont{ filename .. "*default" } + context("%s-%s-%s-%s-%s", + specification.name or files.name, + specification.weight or "normal", + specification.style or "normal", + specification.width or "normal", + specification.variant or "normal") + context.par() + context.stop() + end + end + end + end +\stopluacode + +\doifnotmode{demo}{\endinput} + +\starttext + + \loadfontgoodies[antykwapoltawskiego] + + \ctxlua{fonts.tracers.files("antykwapoltawskiego")} + +\stoptext diff --git a/tex/context/base/s-fnt-28.tex b/tex/context/base/s-fnt-28.tex deleted file mode 100644 index 839c7d4ae..000000000 --- a/tex/context/base/s-fnt-28.tex +++ /dev/null @@ -1,46 +0,0 @@ -%D \module -%D [ file=s-fnt-28, -%D version=2010.09.22, -%D title=\CONTEXT\ Style File, -%D subtitle=Tracing Names, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\startluacode - function fonts.tracers.files(goodyfile) - local goodies = fonts.goodies.get(goodyfile) - if goodies then - local files = goodies.files - if files and files.list then - for filename, specification in table.sortedpairs(files.list) do - context.start() - context.dontleavehmode() - context.definedfont{ filename .. "*default" } - context("%s-%s-%s-%s-%s", - specification.name or files.name, - specification.weight or "normal", - specification.style or "normal", - specification.width or "normal", - specification.variant or "normal") - context.par() - context.stop() - end - end - end - end -\stopluacode - -\doifnotmode{demo}{\endinput} - -\starttext - - \loadfontgoodies[antykwapoltawskiego] - - \ctxlua{fonts.tracers.files("antykwapoltawskiego")} - -\stoptext diff --git a/tex/context/base/s-fnt-29.mkiv b/tex/context/base/s-fnt-29.mkiv new file mode 100644 index 000000000..86f40e2f8 --- /dev/null +++ b/tex/context/base/s-fnt-29.mkiv @@ -0,0 +1,69 @@ +%D \module +%D [ file=s-fnt-29, +%D version=2010.09.27, +%D title=\CONTEXT\ Style File, +%D subtitle=Tracing Shapes, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\startluacode + + function fonts.tracers.shapes() -- todo: ranges + local NC, NR = context.NC, context.NR + local char = context.char + local chrs = fonts.identifiers[font.current()].characters + -- local desc = fonts.identifiers[font.current()].descriptions + context.starttabulate { "|l|c|c|c|c|l|" } + context.FL() + NC() context("unicode") + NC() context("glyph") + NC() context("shape") + NC() context("lower") + NC() context("upper") + -- NC() context("name") + NC() context("description") + NC() NR() + context.TL() + for k, v in next, characters.data do + if chrs[k] then + NC() context("0x%05X",k) + NC() char(k) + NC() char(v.shcode) + NC() char(v.lccode or k) + NC() char(v.uccode or k) + -- NC() context(desc[k].name) + NC() context(v.description) + NC() NR() + end + end + context.stoptabulate() + end + +\stopluacode + +\doifnotmode{demo}{\endinput} + +\setupbodyfont[dejavu,tt,9pt] + +\setuplayout + [backspace=1cm, + topspace=1cm, + footer=1cm, + header=0cm, + height=middle, + width=middle] + +\setupfootertexts + [] + [\fontname\font\quad\pagenumber] + +\starttext + + \ctxlua{fonts.tracers.shapes()} + +\stoptext diff --git a/tex/context/base/s-fnt-29.tex b/tex/context/base/s-fnt-29.tex deleted file mode 100644 index 86f40e2f8..000000000 --- a/tex/context/base/s-fnt-29.tex +++ /dev/null @@ -1,69 +0,0 @@ -%D \module -%D [ file=s-fnt-29, -%D version=2010.09.27, -%D title=\CONTEXT\ Style File, -%D subtitle=Tracing Shapes, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\startluacode - - function fonts.tracers.shapes() -- todo: ranges - local NC, NR = context.NC, context.NR - local char = context.char - local chrs = fonts.identifiers[font.current()].characters - -- local desc = fonts.identifiers[font.current()].descriptions - context.starttabulate { "|l|c|c|c|c|l|" } - context.FL() - NC() context("unicode") - NC() context("glyph") - NC() context("shape") - NC() context("lower") - NC() context("upper") - -- NC() context("name") - NC() context("description") - NC() NR() - context.TL() - for k, v in next, characters.data do - if chrs[k] then - NC() context("0x%05X",k) - NC() char(k) - NC() char(v.shcode) - NC() char(v.lccode or k) - NC() char(v.uccode or k) - -- NC() context(desc[k].name) - NC() context(v.description) - NC() NR() - end - end - context.stoptabulate() - end - -\stopluacode - -\doifnotmode{demo}{\endinput} - -\setupbodyfont[dejavu,tt,9pt] - -\setuplayout - [backspace=1cm, - topspace=1cm, - footer=1cm, - header=0cm, - height=middle, - width=middle] - -\setupfootertexts - [] - [\fontname\font\quad\pagenumber] - -\starttext - - \ctxlua{fonts.tracers.shapes()} - -\stoptext diff --git a/tex/context/base/s-fnt-30.mkiv b/tex/context/base/s-fnt-30.mkiv new file mode 100644 index 000000000..d6d298011 --- /dev/null +++ b/tex/context/base/s-fnt-30.mkiv @@ -0,0 +1,45 @@ +%D \module +%D [ file=s-fnt-30, +%D version=2006.05.10, % abou tthen, quite old already +%D title=\CONTEXT\ Style File, +%D subtitle=Showing Character Data, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\startluacode +function document.show_character_data(n) + local n = characters.number(n) + local d = characters.data[n] + local NC, NR = context.NC, context.NR + if d then + local function entry(label,name) + NC() context(label) + NC() context(d[name]) + NC() NR() + end + context.starttabulate { "|Tl|Tl|]" } + entry("unicode index" , "unicodeslot") + entry("context name" , "contextname") + entry("adobe name" , "adobename") + entry("category" , "category") + entry("description" , "description") + entry("uppercase code", "uccode") + entry("lowercase code", "lccode") + entry("specials" , "specials") + context.stoptabulate() + end +end +\stopluacode + +\def\ShowCharacterData#1% + {\ctxlua{document.show_character_data(#1)}} + +% \ShowCharacterData{123} +% \ShowCharacterData{0x7B} + +% \dostepwiserecurse{`A}{`Z}{1}{\ShowCharacterData{#1}} diff --git a/tex/context/base/s-fnt-30.tex b/tex/context/base/s-fnt-30.tex deleted file mode 100644 index d6d298011..000000000 --- a/tex/context/base/s-fnt-30.tex +++ /dev/null @@ -1,45 +0,0 @@ -%D \module -%D [ file=s-fnt-30, -%D version=2006.05.10, % abou tthen, quite old already -%D title=\CONTEXT\ Style File, -%D subtitle=Showing Character Data, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\startluacode -function document.show_character_data(n) - local n = characters.number(n) - local d = characters.data[n] - local NC, NR = context.NC, context.NR - if d then - local function entry(label,name) - NC() context(label) - NC() context(d[name]) - NC() NR() - end - context.starttabulate { "|Tl|Tl|]" } - entry("unicode index" , "unicodeslot") - entry("context name" , "contextname") - entry("adobe name" , "adobename") - entry("category" , "category") - entry("description" , "description") - entry("uppercase code", "uccode") - entry("lowercase code", "lccode") - entry("specials" , "specials") - context.stoptabulate() - end -end -\stopluacode - -\def\ShowCharacterData#1% - {\ctxlua{document.show_character_data(#1)}} - -% \ShowCharacterData{123} -% \ShowCharacterData{0x7B} - -% \dostepwiserecurse{`A}{`Z}{1}{\ShowCharacterData{#1}} diff --git a/tex/context/base/s-fnt-31.mkiv b/tex/context/base/s-fnt-31.mkiv new file mode 100644 index 000000000..8ef65b204 --- /dev/null +++ b/tex/context/base/s-fnt-31.mkiv @@ -0,0 +1,144 @@ +\startluacode + +local format, upper, find = string.format, string.upper, string.find +local chardata = characters.data + +function fonts.tracers.coverage(fontfiles,pattern) -- todo: patterns + + local present, names = { }, { } + local pattern = pattern and upper(pattern) + + for i=1,#fontfiles do + local fontname = format("testfont-%s",i) + local fontfile = fontfiles[i] + local fontsize = tex.dimen.bodyfontsize + local id, fontdata = fonts.definers.define { + name = fontfile, + size = fontsize, + cs = fontname, + } + for k, v in next, fontdata.characters do + present[k] = true + end + names[i] = fontname + end + + context.starttabulate {"|Tr" .. string.rep("|l",#names) .. "|" } + for i=1,#names do + context.NC() + context(i) + context.NC() + -- context.getvalue(names[i]) + context.type(fontfiles[i]) + context.NC() + context.NR() + end + context.stoptabulate() + + context.starttabulate {"|Tl" .. string.rep("|c",#names) .. "|Tl|" } + context.NC() + context.type("unicode") + context.NC() + for i=1,#names do + context.type(i) + context.NC() + end + context.type("description") + context.NC() + context.NR() + context.HL() + for k, v in table.sortedpairs(present) do + local description = chardata[k].description + if not pattern or (pattern == k) or (description and find(description,pattern)) then + context.NC() + context(format("%05X",k)) + context.NC() + for i=1,#names do + context.getvalue(names[i]) + context.char(k) + context.NC() + end + context(description) + context.NC() + context.NR() + end + end + context.stoptabulate() + +end + +\stopluacode + +\doifnotmode{demo}{\endinput} + +\setupbodyfont[10pt] + +\setuplayout + [backspace=1cm, + topspace=1cm, + footer=1cm, + header=0cm, + height=middle, + width=middle] + +\starttext + +% \startluacode +% fonts.tracers.coverage { +% "pirat.ttf", +% } +% \stopluacode + +% \startluacode +% fonts.tracers.coverage { +% -- "cambria.ttf", +% "lbr.afm", +% "LucidaBrightRegular.ttf", +% "lbi.afm", +% "LucidaBrightItalic.ttf", +% "lbd.afm", +% "LucidaBrightDemiBold.ttf", +% "lbdi.afm", +% "LucidaBrightDemiItalic.ttf", +% } +% \stopluacode + +% \startluacode +% fonts.tracers.coverage ( { +% "LucidaBrightRegular.ttf", +% "cambria.ttf", +% "iwona-regular.otf", +% "texgyrepagella-regular.otf", +% "texgyretermes-regular.otf", +% "texgyrebonum-regular.otf", +% "antpolt-regular.otf", +% }, "OGONEK") +% \stopluacode + +% \loadfontgoodies[lucida-math] +% \loadfontgoodies[lm-math] + +% \startluacode +% fonts.tracers.coverage { +% "LucidaBrightRegular.ttf", +% "LucidaBrightOne@lucida-math", +% "cambria.ttc(Cambria Math)", +% "xits-math.otf", +% "LMMath10-Regular@lmroman10-math", +% } +% \stopluacode + +\loadfontgoodies[px-math] +\loadfontgoodies[lm-math] + +\startluacode + fonts.tracers.coverage { + "cambria.ttc(Cambria Math)", + "xits-math.otf", + "LMMath10-Regular@lmroman10-math", + "pxmath@px-math", + "LinLibertine_Re-4.7.5.otf", + } +\stopluacode + +\stoptext diff --git a/tex/context/base/s-fnt-31.tex b/tex/context/base/s-fnt-31.tex deleted file mode 100644 index 8ef65b204..000000000 --- a/tex/context/base/s-fnt-31.tex +++ /dev/null @@ -1,144 +0,0 @@ -\startluacode - -local format, upper, find = string.format, string.upper, string.find -local chardata = characters.data - -function fonts.tracers.coverage(fontfiles,pattern) -- todo: patterns - - local present, names = { }, { } - local pattern = pattern and upper(pattern) - - for i=1,#fontfiles do - local fontname = format("testfont-%s",i) - local fontfile = fontfiles[i] - local fontsize = tex.dimen.bodyfontsize - local id, fontdata = fonts.definers.define { - name = fontfile, - size = fontsize, - cs = fontname, - } - for k, v in next, fontdata.characters do - present[k] = true - end - names[i] = fontname - end - - context.starttabulate {"|Tr" .. string.rep("|l",#names) .. "|" } - for i=1,#names do - context.NC() - context(i) - context.NC() - -- context.getvalue(names[i]) - context.type(fontfiles[i]) - context.NC() - context.NR() - end - context.stoptabulate() - - context.starttabulate {"|Tl" .. string.rep("|c",#names) .. "|Tl|" } - context.NC() - context.type("unicode") - context.NC() - for i=1,#names do - context.type(i) - context.NC() - end - context.type("description") - context.NC() - context.NR() - context.HL() - for k, v in table.sortedpairs(present) do - local description = chardata[k].description - if not pattern or (pattern == k) or (description and find(description,pattern)) then - context.NC() - context(format("%05X",k)) - context.NC() - for i=1,#names do - context.getvalue(names[i]) - context.char(k) - context.NC() - end - context(description) - context.NC() - context.NR() - end - end - context.stoptabulate() - -end - -\stopluacode - -\doifnotmode{demo}{\endinput} - -\setupbodyfont[10pt] - -\setuplayout - [backspace=1cm, - topspace=1cm, - footer=1cm, - header=0cm, - height=middle, - width=middle] - -\starttext - -% \startluacode -% fonts.tracers.coverage { -% "pirat.ttf", -% } -% \stopluacode - -% \startluacode -% fonts.tracers.coverage { -% -- "cambria.ttf", -% "lbr.afm", -% "LucidaBrightRegular.ttf", -% "lbi.afm", -% "LucidaBrightItalic.ttf", -% "lbd.afm", -% "LucidaBrightDemiBold.ttf", -% "lbdi.afm", -% "LucidaBrightDemiItalic.ttf", -% } -% \stopluacode - -% \startluacode -% fonts.tracers.coverage ( { -% "LucidaBrightRegular.ttf", -% "cambria.ttf", -% "iwona-regular.otf", -% "texgyrepagella-regular.otf", -% "texgyretermes-regular.otf", -% "texgyrebonum-regular.otf", -% "antpolt-regular.otf", -% }, "OGONEK") -% \stopluacode - -% \loadfontgoodies[lucida-math] -% \loadfontgoodies[lm-math] - -% \startluacode -% fonts.tracers.coverage { -% "LucidaBrightRegular.ttf", -% "LucidaBrightOne@lucida-math", -% "cambria.ttc(Cambria Math)", -% "xits-math.otf", -% "LMMath10-Regular@lmroman10-math", -% } -% \stopluacode - -\loadfontgoodies[px-math] -\loadfontgoodies[lm-math] - -\startluacode - fonts.tracers.coverage { - "cambria.ttc(Cambria Math)", - "xits-math.otf", - "LMMath10-Regular@lmroman10-math", - "pxmath@px-math", - "LinLibertine_Re-4.7.5.otf", - } -\stopluacode - -\stoptext diff --git a/tex/context/base/s-grk-00.mkii b/tex/context/base/s-grk-00.mkii new file mode 100644 index 000000000..ec5ddf1f7 --- /dev/null +++ b/tex/context/base/s-grk-00.mkii @@ -0,0 +1,77 @@ +%D \module +%D [ file=s-grk-00, +%D version=2004.08.23, +%D title=\CONTEXT\ Style File, +%D subtitle=CB Greek Support, +%D author=Hans Hagen, +%D date=\currentdate, +%D suggestions=Giuseppe Bilotta, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\usetypescriptfile[type-cbg] + +\usetypescript [all] [cbgreek-medium] + +\startsetups [cbgreek] + + \catcode`~=\other + \catcode`|=\other + + \language[greek] + \switchtobodyfont[cbgreek] + +\stopsetups + +\definestartstop + [greek] + [commands=\directsetup{cbgreek}] + +\doifnotmode{demo}{\endinput} + +% The following sample file was submitted to the \CONTEXT\ +% mailing list by Giuseppe Bilotta, along with the right +% typescripts. + +% already loaded: \usemodule[greek] + +\mainlanguage[english] + +\starttext + +We can easily use plain English for normal text, and then switch +to greek when we want; as a first try we type the lower and +upper case 26 letters of the latin alphabet and see how they come +out in greek: + +\startgreek +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 \par +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 +\stopgreek + +As it can be observed, some uppercase letters have strange +outcomes; also, j gives \greek{j} and c gives the +end-of-word sigma \greek{c}; interestingly, s gives either the +normal sigma or the end-of-word one, depending on whether it's at +the end of the word or not: \greek{satrapws}. + +Of course we can use the various diacritical signs: accents +(\greek{`a, 'a, ~a}), breathings (\greek{w, a"}) and +subscribed iotas (\greek{a|, h|, w|}) (these last are pretty ugly in my +opinion); observe how they automatically get the correct position +with uppercase letters: (\greek{`A, 'A, ~A, A, A|}). + +Can the thing be used for serious work? + +\startgreek +>>'Andra moi >'ennepe, Mo~usa, pol'utropon, >'os m'ala poll`a\hfill\break +pl'agqjh, >epe`i Tro'ihs 'eperse;\hfill\break +poll~wn d" >anjr'wpwn >'iden >'astea ka`i n'oon >'egnw,\hfill\break +poll`a d" <'o g" >en p'ontw| p'ajen >'algea <`on kat`a jum'on,\hfill\break +>>arn'umenos <'hn te yuq`hn ka`i n'oston w, a"}) and -subscribed iotas (\greek{a|, h|, w|}) (these last are pretty ugly in my -opinion); observe how they automatically get the correct position -with uppercase letters: (\greek{`A, 'A, ~A, A, A|}). - -Can the thing be used for serious work? - -\startgreek ->>'Andra moi >'ennepe, Mo~usa, pol'utropon, >'os m'ala poll`a\hfill\break -pl'agqjh, >epe`i Tro'ihs 'eperse;\hfill\break -poll~wn d" >anjr'wpwn >'iden >'astea ka`i n'oon >'egnw,\hfill\break -poll`a d" <'o g" >en p'ontw| p'ajen >'algea <`on kat`a jum'on,\hfill\break ->>arn'umenos <'hn te yuq`hn ka`i n'oston max then max = v[i] end end + end + return max, what, function(n) return n/max end + end + + function document.context_state_1(what) + local max, what, norm = prepare(what) + context.starttabulate { "|Tc|T|T|T|T|T|" } + context.NC() + context(category) + context.NC() + for i, t in ipairs(types) do + local n, m = 0, 0 + for k, v in pairs(list) do + local nn, mm = what[k][i], what[k][i+5] + n = n + nn + m = m + (mm or nn) + end + context.Top(t,norm(max),n,m) + context.NC() + end + context.NC() + context.NR() + context.HL() + for k, v in table.sortedpairs(what) do + local c = (what == size and comp[k]) or nope + context.NC() + context("%s~%s~~%s~~%s", + (used.mkii[k] and "ii") or "~~", + (used.mkiv[k] and "iv") or "~~", + (used.mkvi[k] and "vi") or "~~", + k + ) + context.NC() + for i, t in ipairs(types) do + context.Bar(t,v[i],c[i],norm(v[i])) + context.NC() + end + context.NR() + end + context.stoptabulate() + end + + function document.context_state_2(what) + local max, what, norm = prepare(what) + for k, v in table.sortedpairs(what) do + local c = (what == size and comp[k]) or nope + context.StartUp(k) + for i, t in ipairs(types) do + context.Up(t,norm(v[i])) + end + context.StopUp() + end + end + +\stopluacode + +\definecolor[bar:tex] [middlegreen] +\definecolor[bar:mkii][middleblue] +\definecolor[bar:mkiv][middlered] +\definecolor[bar:mkvi][middleyellow] +\definecolor[bar:lua] [middlegray] + +\def\Top#1#2#3#4% + {\hbox to 5em{\hss#3}% + \enspace +% \hbox to #2\dimexpr 20em\relax{#1\ifnum#3=#4\else~#4\rlap{~+}\fi\hss}} + \hbox {#1\ifnum#3=#4\else~#4\rlap{~+}\fi\hss}} + +\def\Bar#1#2#3#4% + {\ifcase#2\else + \hbox to 5em{\hss\ifcase#3\else\llap{-~}\fi#2}% + \enspace + \blackrule[color=bar:#1,width=#4\dimexpr 20em\relax,height=.8\strutht]% + \fi} + +\newcount\UpCounter + +\def\StartUp#1% + {\dontleavehmode\framed[frame=off,align={middle,low},height=18em]\bgroup + \def\StopUp + {\par\nointerlineskip\blackrule[height=1pt,width=4em,depth=0pt,color=darkgray]% + \par\tttf\strut#1\par + \egroup + \ifnum\UpCounter=17 \par \UpCounter\zerocount\else \kern1em \advance\UpCounter\plusone \fi}} + +\def\Up#1#2% + {\scratchdimen#2\dimexpr 16em\relax + \ifdim\scratchdimen=\zeropoint + \kern1em + \else + \ifdim\scratchdimen<\onepoint \scratchdimen\onepoint \fi + \blackrule[color=bar:#1,height=\scratchdimen,width=1em]% + \fi} + +\def\Show#1#2#3% + {\startTEXpage[offset=1em,width=fit] + \hbox{\tttf\strut\currentdate~-~#1} + \ctxlua{document.context_state_\number#2("#3")} + \stopTEXpage} + +% \doifnotmode{demo}{\endinput} + +\starttext + \Show + {The number of files used in ConTeXt (modules and styles are excluded).} + {1}{number} + \Show + {The size of (core) files used in ConTeXt (- indicates exclusion of large data files; + indicates inclusion of large data files; comment and spaces removed.)} + {1}{size} + \Show + {The relative number of files used in ConTeXt (tex, mkii, mkiv, mkvi, lua).} + {2}{number} + \Show + {The relative size of files used in ConTeXt (tex, mkii, mkiv, mkvi, lua).} + {2}{size} +\stoptext diff --git a/tex/context/base/s-inf-01.tex b/tex/context/base/s-inf-01.tex deleted file mode 100644 index 1dfb66d6a..000000000 --- a/tex/context/base/s-inf-01.tex +++ /dev/null @@ -1,217 +0,0 @@ -%D \module -%D [ file=s-inf-01, -%D version=2009.07.09, -%D title=\CONTEXT\ Style File, -%D subtitle=Information 1 (\MKII/\MKIV\ usage), -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Some day I will generalize this table mechanism. - -\startluacode - local format, gsub, find, match = string.format, string.gsub, string.find, string.match - - local list, size, comp, used, nope = { }, { }, { }, { mkii = { }, mkiv = { }, mkvi = { } }, { 0, 0, 0, 0, 0 } - - local omit = { - "char%-def%.lua", - "mult%-def%.lua", "mult%-..%.mkii", "mult%-m..%.mkii", - } - local skip = { - "prag%-.*%.tex", "docs%-.*.tex", "list%-.*%.tex", "test%-.*%.tex", "demo%-.*%.tex", - "opti%-.*%.tex", "chrt%-.*%.tex", ".*%-old", ".*%-obs", ".*%-tst", "supp%-.*%.tex", - "colo%-pan.tex", - } - local types = { - "tex", "mkii", "mkiv", "mkvi", "lua" - } - - local function collect(list,suffix,n) - local path = file.dirname(resolvers.find_file("context.tex"),".") - local pattern = path .. "/*." .. suffix - local texfiles = dir.glob(pattern) - for _, name in ipairs(texfiles) do - local base = file.basename(name) - local category = match(base,"^([a-z][a-z][a-z][a-z])%-[a-z0-9]+%.[a-z]+") - if category and lfs.isfile(name) then - local okay = true - for s=1,#skip do - if find(base,skip[s]) then - okay = false - break - end - end - if okay then - local lm, sm, cm = list[category], size[category], comp[category] - if not lm then - lm, sm, cm = { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 } - list[category], size[category], comp[category] = lm, sm, cm - end - lm[n] = lm[n] + 1 - local done = true - for o=1,#omit do - if find(base,omit[o]) then - done = false - break - end - end - local data = io.loaddata(name) - if suffix == "lua" then - data = gsub(data,"%-%-%[%[.-%]%]%-%-","") - data = gsub(data,"%-%-.-[\n\r]","") - else - data = gsub(data,"%%.-[\n\r]","") - end - data = gsub(data,"%s","") - sm[n+5] = sm[n+5] + #data - if done then - sm[n] = sm[n] + #data - else - cm[n] = cm[n] + 1 - end - end - end - end - end - - local function prepare(what) - if next(list) then - -- already loaded - else - for k, v in ipairs(types) do - collect(list,v,k) - end - for category, _ in pairs(list) do - pattern ="{"..category.."%-" - for suffix, t in pairs(used) do - local data = io.loaddata(resolvers.find_file("context."..suffix)) - if data and find(data,pattern) then - t[category] = true - end - end - end - end - local max, what = 0, (what == "size" and size) or list - for k, v in table.sortedpairs(what) do - for i=1,5 do if v[i] > max then max = v[i] end end - end - return max, what, function(n) return n/max end - end - - function document.context_state_1(what) - local max, what, norm = prepare(what) - context.starttabulate { "|Tc|T|T|T|T|T|" } - context.NC() - context(category) - context.NC() - for i, t in ipairs(types) do - local n, m = 0, 0 - for k, v in pairs(list) do - local nn, mm = what[k][i], what[k][i+5] - n = n + nn - m = m + (mm or nn) - end - context.Top(t,norm(max),n,m) - context.NC() - end - context.NC() - context.NR() - context.HL() - for k, v in table.sortedpairs(what) do - local c = (what == size and comp[k]) or nope - context.NC() - context("%s~%s~~%s~~%s", - (used.mkii[k] and "ii") or "~~", - (used.mkiv[k] and "iv") or "~~", - (used.mkvi[k] and "vi") or "~~", - k - ) - context.NC() - for i, t in ipairs(types) do - context.Bar(t,v[i],c[i],norm(v[i])) - context.NC() - end - context.NR() - end - context.stoptabulate() - end - - function document.context_state_2(what) - local max, what, norm = prepare(what) - for k, v in table.sortedpairs(what) do - local c = (what == size and comp[k]) or nope - context.StartUp(k) - for i, t in ipairs(types) do - context.Up(t,norm(v[i])) - end - context.StopUp() - end - end - -\stopluacode - -\definecolor[bar:tex] [middlegreen] -\definecolor[bar:mkii][middleblue] -\definecolor[bar:mkiv][middlered] -\definecolor[bar:mkvi][middleyellow] -\definecolor[bar:lua] [middlegray] - -\def\Top#1#2#3#4% - {\hbox to 5em{\hss#3}% - \enspace -% \hbox to #2\dimexpr 20em\relax{#1\ifnum#3=#4\else~#4\rlap{~+}\fi\hss}} - \hbox {#1\ifnum#3=#4\else~#4\rlap{~+}\fi\hss}} - -\def\Bar#1#2#3#4% - {\ifcase#2\else - \hbox to 5em{\hss\ifcase#3\else\llap{-~}\fi#2}% - \enspace - \blackrule[color=bar:#1,width=#4\dimexpr 20em\relax,height=.8\strutht]% - \fi} - -\newcount\UpCounter - -\def\StartUp#1% - {\dontleavehmode\framed[frame=off,align={middle,low},height=18em]\bgroup - \def\StopUp - {\par\nointerlineskip\blackrule[height=1pt,width=4em,depth=0pt,color=darkgray]% - \par\tttf\strut#1\par - \egroup - \ifnum\UpCounter=17 \par \UpCounter\zerocount\else \kern1em \advance\UpCounter\plusone \fi}} - -\def\Up#1#2% - {\scratchdimen#2\dimexpr 16em\relax - \ifdim\scratchdimen=\zeropoint - \kern1em - \else - \ifdim\scratchdimen<\onepoint \scratchdimen\onepoint \fi - \blackrule[color=bar:#1,height=\scratchdimen,width=1em]% - \fi} - -\def\Show#1#2#3% - {\startTEXpage[offset=1em,width=fit] - \hbox{\tttf\strut\currentdate~-~#1} - \ctxlua{document.context_state_\number#2("#3")} - \stopTEXpage} - -% \doifnotmode{demo}{\endinput} - -\starttext - \Show - {The number of files used in ConTeXt (modules and styles are excluded).} - {1}{number} - \Show - {The size of (core) files used in ConTeXt (- indicates exclusion of large data files; + indicates inclusion of large data files; comment and spaces removed.)} - {1}{size} - \Show - {The relative number of files used in ConTeXt (tex, mkii, mkiv, mkvi, lua).} - {2}{number} - \Show - {The relative size of files used in ConTeXt (tex, mkii, mkiv, mkvi, lua).} - {2}{size} -\stoptext diff --git a/tex/context/base/s-inf-02.mkiv b/tex/context/base/s-inf-02.mkiv new file mode 100644 index 000000000..77a3f650c --- /dev/null +++ b/tex/context/base/s-inf-02.mkiv @@ -0,0 +1,27 @@ +%D \module +%D [ file=s-inf-02, +%D version=2009.11.25, +%D title=\CONTEXT\ Style File, +%D subtitle=Information 2 (filenames), +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\starttext + +\starttabulate [|T|T|] + \NC \type{\jobname} \NC \jobname \NC \NR + \NC \type{\jobfilename} \NC \jobfilename \NC \NR + \NC \type{\jobfilesuffix} \NC \jobfilesuffix \NC \NR + \NC \type{\inputfilename} \NC \inputfilename \NC \NR + \NC \type{\inputfilebarename} \NC \inputfilebarename \NC \NR + \NC \type{\inputfilesuffix} \NC \inputfilesuffix \NC \NR + \NC \type{\outputfilename} \NC \outputfilename \NC \NR + \NC \type{\operatingsystem} \NC \operatingsystem \NC \NR +\stoptabulate + +\stoptext diff --git a/tex/context/base/s-inf-02.tex b/tex/context/base/s-inf-02.tex deleted file mode 100644 index 77a3f650c..000000000 --- a/tex/context/base/s-inf-02.tex +++ /dev/null @@ -1,27 +0,0 @@ -%D \module -%D [ file=s-inf-02, -%D version=2009.11.25, -%D title=\CONTEXT\ Style File, -%D subtitle=Information 2 (filenames), -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\starttext - -\starttabulate [|T|T|] - \NC \type{\jobname} \NC \jobname \NC \NR - \NC \type{\jobfilename} \NC \jobfilename \NC \NR - \NC \type{\jobfilesuffix} \NC \jobfilesuffix \NC \NR - \NC \type{\inputfilename} \NC \inputfilename \NC \NR - \NC \type{\inputfilebarename} \NC \inputfilebarename \NC \NR - \NC \type{\inputfilesuffix} \NC \inputfilesuffix \NC \NR - \NC \type{\outputfilename} \NC \outputfilename \NC \NR - \NC \type{\operatingsystem} \NC \operatingsystem \NC \NR -\stoptabulate - -\stoptext diff --git a/tex/context/base/s-jap-00.mkii b/tex/context/base/s-jap-00.mkii new file mode 100644 index 000000000..28cb6c241 --- /dev/null +++ b/tex/context/base/s-jap-00.mkii @@ -0,0 +1,23 @@ +%D \module +%D [ file=s-jap-00, +%D version=2006.01.19, +%D title=\CONTEXT\ Style File, +%D subtitle=Basic Japanese Style, +%D author=Hans Hagen, +%D date=\currentdate, +%D suggestions=Richard Gabriel, +%D copyright=\PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\input font-jap.tex % faster than \setupbodyfont[jap] + +\mainlanguage [ja] + +\unprotect + +\setuptyping[\c!tab=\v!no] + +\protect \endinput diff --git a/tex/context/base/s-jap-00.tex b/tex/context/base/s-jap-00.tex deleted file mode 100644 index 28cb6c241..000000000 --- a/tex/context/base/s-jap-00.tex +++ /dev/null @@ -1,23 +0,0 @@ -%D \module -%D [ file=s-jap-00, -%D version=2006.01.19, -%D title=\CONTEXT\ Style File, -%D subtitle=Basic Japanese Style, -%D author=Hans Hagen, -%D date=\currentdate, -%D suggestions=Richard Gabriel, -%D copyright=\PRAGMA] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\input font-jap.tex % faster than \setupbodyfont[jap] - -\mainlanguage [ja] - -\unprotect - -\setuptyping[\c!tab=\v!no] - -\protect \endinput diff --git a/tex/context/base/s-lan-03.mkiv b/tex/context/base/s-lan-03.mkiv new file mode 100644 index 000000000..b8d24539b --- /dev/null +++ b/tex/context/base/s-lan-03.mkiv @@ -0,0 +1,40 @@ +%D \module +%D [ file=s-lan-03, +%D version=2010.10.21, +%D title=\CONTEXT\ Style File, +%D subtitle=Language Environment 3, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\startluacode +languages.words.tracers = languages.words.tracers or { } + +function languages.words.tracers.showwords(filename) + filename = filename or file.addsuffix(tex.jobname,"words") + if lfs.isfile(filename) then + local w = dofile(filename) + if w then + -- table.print(w) + for cname, category in table.sortedpairs(w.categories) do + for lname, language in table.sortedpairs(category.languages) do + context.bold(string.format("category: %s, language: %s, total: %s, unique: %s:", + cname, lname, language.total or 0, language.unique or 0) + ) + for word, n in table.sortedpairs(language.list) do + context(" %s (%s)",word,n) + end + context.par() + end + end + end + end +end +\stopluacode + +% \ctxlua{languages.words.tracers.showwords("words-003.words")} + diff --git a/tex/context/base/s-lan-03.tex b/tex/context/base/s-lan-03.tex deleted file mode 100644 index b8d24539b..000000000 --- a/tex/context/base/s-lan-03.tex +++ /dev/null @@ -1,40 +0,0 @@ -%D \module -%D [ file=s-lan-03, -%D version=2010.10.21, -%D title=\CONTEXT\ Style File, -%D subtitle=Language Environment 3, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\startluacode -languages.words.tracers = languages.words.tracers or { } - -function languages.words.tracers.showwords(filename) - filename = filename or file.addsuffix(tex.jobname,"words") - if lfs.isfile(filename) then - local w = dofile(filename) - if w then - -- table.print(w) - for cname, category in table.sortedpairs(w.categories) do - for lname, language in table.sortedpairs(category.languages) do - context.bold(string.format("category: %s, language: %s, total: %s, unique: %s:", - cname, lname, language.total or 0, language.unique or 0) - ) - for word, n in table.sortedpairs(language.list) do - context(" %s (%s)",word,n) - end - context.par() - end - end - end - end -end -\stopluacode - -% \ctxlua{languages.words.tracers.showwords("words-003.words")} - diff --git a/tex/context/base/s-pre-69.mkiv b/tex/context/base/s-pre-69.mkiv new file mode 100644 index 000000000..9cf6fdfd5 --- /dev/null +++ b/tex/context/base/s-pre-69.mkiv @@ -0,0 +1,335 @@ +%D \module +%D [ file=s-pre-69, +%D version=2010.04.28, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Environment 69, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\setuppapersize[S6][S6] +\setuppapersize[SM][SM] + +\usemodule + [abr-01,pre-60] + +\setupinteraction + [state=start, + contrastcolor=white, + color=white, + click=no] + +\setuplayout + [location=middle, + topspace=60pt, + bottomspace=80pt, + backspace=80pt, + header=0pt, + footer=0pt, + width=middle, + height=middle] + +\setupcolors + [textcolor=white] + +\setupbodyfont[euler] + +\definecolor[maincolor] [blue] +\definecolor[extracolor][green] + +% \definecolor[maincolor] [red] +% \definecolor[extracolor][blue] + +\startMPinitializations + if unknown MyColor[1] : + color MyColor[] ; + MyColor[1] := transparent(1,.25,\MPcolor{maincolor}) ; + MyColor[2] := transparent(1,.25,\MPcolor{extracolor}) ; + + picture MySoFar ; MySoFar := nullpicture ; + path MyLastOne ; MyLastOne := origin -- cycle ; + color MyPageColor ; MyPageColor := MyColor[1] ; + path MyLeftSteps, MyRightSteps ; + boolean MyPageDone ; MyPageDone := false ; + + vardef MySmallShape(expr parent) = + path p ; p := boundingbox parent ; + p := boundingbox parent ; + numeric w, h ; w := bbwidth(p) ; h := bbheight(p) ; + urcorner p shifted (-uniformdeviate w/4,0) -- + lrcorner p shifted (0,uniformdeviate h/4) -- + llcorner p shifted (uniformdeviate w/4,0) -- + ulcorner p shifted (0,-uniformdeviate h/4) -- cycle + enddef ; + + vardef MyShape(expr parent) = + path p ; p := boundingbox parent ; + if MyPageDone : + MyPageDone := false ; + urcorner p shifted (-EmWidth + -uniformdeviate CutSpace/2,0) -- + lrcorner p shifted (0,EmWidth + uniformdeviate BottomSpace/2) -- + llcorner p shifted (EmWidth + uniformdeviate BackSpace/2,0) -- + ulcorner p shifted (0,-EmWidth + -uniformdeviate TopSpace/2) -- cycle + else : + MyPageDone := true ; + urcorner p shifted (0,-EmWidth + -uniformdeviate TopSpace/2) -- + lrcorner p shifted (-EmWidth + -uniformdeviate CutSpace/2,0) -- + llcorner p shifted (0,EmWidth + uniformdeviate BottomSpace/2) -- + ulcorner p shifted (EmWidth + uniformdeviate BackSpace/2,0) -- cycle + fi + enddef ; + + vardef MyMakeOne = + MyLastOne := MyShape(Page) ; + enddef ; + + vardef MyAddOne = + addto MySoFar also image(fill MyLastOne withcolor MyPageColor ; ) ; + enddef ; + + vardef MyDrawOne = + fill MyLastOne withcolor black ; + fill MyLastOne withcolor MyPageColor ; + enddef ; + + vardef MyDrawPage = + draw MySoFar ; + enddef ; + + vardef MySetSteps = + path l, r ; numeric s ; path ll[], rr[] ; path t ; + l := point 2 of MyLastOne -- point 3 of MyLastOne ; + r := point 0 of MyLastOne -- point 1 of MyLastOne ; + t := topboundary Field[Text][Text] rightenlarged TextWidth leftenlarged TextWidth ; + s := bbheight(Field[Text][Text])/LineHeight + 2 ; + t := t shifted (0,-TopSkip) ; + for i=1 upto s : + ll[i] := t intersectionpoint l ; + rr[i] := t intersectionpoint r ; + t := t shifted (0,-LineHeight) ; + endfor ; + MyLeftSteps := for i=1 upto s : ll[i] -- endfor cycle ; + MyRightSteps := for i=1 upto s : rr[i] -- endfor cycle ; + enddef ; + + vardef MyDrawText(expr txt) = + pair a ; a := (point 1 of MyLastOne) - (point 2 of MyLastOne) ; + picture p ; p := txt ; + p := p + shifted (-EmWidth,EmWidth) + shifted ulcorner txt + shifted point 1 of MyLastOne ; + p := p rotatedaround(lrcorner p, radian * tan(ypart a/xpart a)) ; + setbounds p to origin -- cycle ; + draw p ; + enddef ; + + vardef MyDrawTitle(expr txt) = + % pair a ; a := (point 2 of MyLastOne) - (point 3 of MyLastOne) ; + pair a ; a := (point 3 of MyLastOne) - (point 4 of MyLastOne) ; + picture p ; + if bbheight(txt) > bbwidth(txt) : + p := txt ysized(0.8*TextHeight) ; + else : + p := txt xsized(0.8*TextWidth) ; + fi ; + numeric d ; d := arclength(point 2 of MyLastOne -- point 3 of MyLastOne) - bbheight(p) ; + p := p + shifted (BackSpace,-d/2) + shifted -ulcorner p + shifted point 3 of MyLastOne ; + % p := p rotatedaround(ulcorner p, - radian * tan(xpart a/ypart a)) ; + % p := p rotatedaround(ulcorner p, radian * tan(ypart a/xpart a)) ; + setbounds p to origin -- cycle ; + draw p ; + enddef ; + + vardef MyDrawSteps = + s := bbheight(Field[Text][Text])/LineHeight + 2 ; + for i=1 upto s : + draw ll[i] withpen pencircle scaled 1mm ; + draw rr[i] withpen pencircle scaled 1mm ; + draw ll[i] -- rr[i] ; + endfor ; + draw Field[Text][Text] ; + enddef ; + + fi ; +\stopMPinitializations + +\startuseMPgraphic{initialization} + StartPage ; + MySoFar := image(fill Page enlarged 12pt withcolor MyPageColor) ; + MyMakeOne ; + MySetSteps ; + StopPage ; +\stopuseMPgraphic + +\appendtoks + \startnointerference + \useMPgraphic{initialization} + \stopnointerference +\to \everystarttext + +\startuseMPgraphic{page} + StartPage ; + MyDrawPage ; + MyDrawOne ; + MySetSteps ; + MyDrawTitle(textext("\getvariable{document}{title}")) ; + MyDrawText(textext("\getvariable{document}{topic}")) ; + % + % we have multiple runs when we have text + % +% MyDrawSteps ; +% MyMakeOne ; +% MySetSteps ; + StopPage ; +\stopuseMPgraphic + +\appendtoks + \startnointerference + \startMPcode + MyAddOne ; + MyMakeOne ; + MySetSteps ; + \stopMPcode + \stopnointerference +\to \everyshipout + +\defineoverlay[page][\useMPgraphic{page}] + +\startuseMPgraphic{symbol} + color cc ; cc := MyColor[2] ; + path p ; p := MySmallShape(unitsquare scaled (.6*LineHeight)) ; + fill p withcolor white ; + fill p withcolor cc ; +\stopuseMPgraphic + +\definesymbol[mysymbol][\struttedbox{\useMPgraphic{symbol}}] + +\setupitemgroup[itemize][1][symbol=mysymbol] + +\setupbackgrounds + [page] + [background=page] + +\startluacode + local texdimen = tex.dimen + function document.SetParShape() + local leftpath = metapost.getclippath("metafun","metafun","clip currentpicture to MyLeftSteps ;") + local rightpath = metapost.getclippath("metafun","metafun","clip currentpicture to MyRightSteps ;") + local shape = { } + for i=1,#leftpath do + local left = leftpath[i].x_coord + local right = rightpath[i].x_coord + local hsize = right - left - (texdimen.backspace + texdimen.cutspace)*number.dimenfactors.bp + shape[#shape+1] = string.format("%sbp %sbp",left,hsize) + end + -- print(table.serialize(shape)) + tex.sprint(tex.ctxcatcodes,string.format("\\parshape %s %s",#shape,table.concat(shape," "))) + end +\stopluacode + +\nopenalties \dontcomplain + +\setupwhitespace[none] + +\def\StartText#1#2% + {\starttext + \setvariable{document}{title}{\framed[frame=off,offset=0pt,align=flushleft,foregroundstyle=\tfd\setupinterlinespace]{\begstrut#1\endstrut}} + \setvariable{document}{topic}{\tfb#2} + \startstandardmakeup + % dummy page + \stopstandardmakeup + \setvariable{document}{title}{} + \setvariable{document}{topic}{}} + +\def\StopText + {\stoptext} + +\def\StartItems#1% + {\setvariable{document}{topic}{\tfb#1} + \startstandardmakeup[top=,bottom=\vss] + \startelement[items][title={#1}]% + \ctxlua{document.SetParShape()} + \StartSteps} + +\def\StopItems + {\StopSteps + \stopelement + \stopstandardmakeup} + +\def\StartItem + {\dontleavehmode + \startelement[item]% + \llap{\symbol[mysymbol]\quad}% graphic + \ignorespaces} + +\def\StopItem + {\removeunwantedspaces + \nobreak + \crlf + \stopelement + \crlf + \FlushStep} + +\def\ShapeParagraph + {\ctxlua{document.SetParShape()}} + +% no parshape yet + +\def\StartParagraphs#1% + {\setvariable{document}{topic}{\tfb#1} + \startstandardmakeup[top=,bottom=\vss] + %\ctxlua{document.SetParShape()} + \startelement[paragraphs]% + \StartSteps} + +\def\StopParagraphs + {\StopSteps + \stopelement + \stopstandardmakeup} + +\def\StartParagraph + {\startelement[paragraph]} + +\def\StopParagraph + {\par + \stopelement + \FlushStep} + +% experiment .. likely to change + +\setelementexporttag[items] [nature][display] +\setelementexporttag[item] [nature][mixed] +\setelementexporttag[paragraphs][nature][display] +\setelementexporttag[paragraph] [nature][mixed] + +\doifnotmode{demo}{\endinput} + +% finetuning: \StartText{\TEX\ and Reality\vskip2exClashing Mindsets?\vskip1ex}{Bacho\TEX, May 1, 2010} + +\StartText{Just\\A Demo}{Bacho\TEX, May 1, 2010} + +\StartItems{Quote from Tufte and Ward} + \StartItem + \input tufte + \StopItem + \StartItem + \input ward + \StopItem +\StopItems + +% \dorecurse{20}{ +% \ctxlua{document.SetParShape()} +% \input tufte +% \page +% } + +\StopText + diff --git a/tex/context/base/s-pre-69.tex b/tex/context/base/s-pre-69.tex deleted file mode 100644 index 9cf6fdfd5..000000000 --- a/tex/context/base/s-pre-69.tex +++ /dev/null @@ -1,335 +0,0 @@ -%D \module -%D [ file=s-pre-69, -%D version=2010.04.28, -%D title=\CONTEXT\ Style File, -%D subtitle=Presentation Environment 69, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\setuppapersize[S6][S6] -\setuppapersize[SM][SM] - -\usemodule - [abr-01,pre-60] - -\setupinteraction - [state=start, - contrastcolor=white, - color=white, - click=no] - -\setuplayout - [location=middle, - topspace=60pt, - bottomspace=80pt, - backspace=80pt, - header=0pt, - footer=0pt, - width=middle, - height=middle] - -\setupcolors - [textcolor=white] - -\setupbodyfont[euler] - -\definecolor[maincolor] [blue] -\definecolor[extracolor][green] - -% \definecolor[maincolor] [red] -% \definecolor[extracolor][blue] - -\startMPinitializations - if unknown MyColor[1] : - color MyColor[] ; - MyColor[1] := transparent(1,.25,\MPcolor{maincolor}) ; - MyColor[2] := transparent(1,.25,\MPcolor{extracolor}) ; - - picture MySoFar ; MySoFar := nullpicture ; - path MyLastOne ; MyLastOne := origin -- cycle ; - color MyPageColor ; MyPageColor := MyColor[1] ; - path MyLeftSteps, MyRightSteps ; - boolean MyPageDone ; MyPageDone := false ; - - vardef MySmallShape(expr parent) = - path p ; p := boundingbox parent ; - p := boundingbox parent ; - numeric w, h ; w := bbwidth(p) ; h := bbheight(p) ; - urcorner p shifted (-uniformdeviate w/4,0) -- - lrcorner p shifted (0,uniformdeviate h/4) -- - llcorner p shifted (uniformdeviate w/4,0) -- - ulcorner p shifted (0,-uniformdeviate h/4) -- cycle - enddef ; - - vardef MyShape(expr parent) = - path p ; p := boundingbox parent ; - if MyPageDone : - MyPageDone := false ; - urcorner p shifted (-EmWidth + -uniformdeviate CutSpace/2,0) -- - lrcorner p shifted (0,EmWidth + uniformdeviate BottomSpace/2) -- - llcorner p shifted (EmWidth + uniformdeviate BackSpace/2,0) -- - ulcorner p shifted (0,-EmWidth + -uniformdeviate TopSpace/2) -- cycle - else : - MyPageDone := true ; - urcorner p shifted (0,-EmWidth + -uniformdeviate TopSpace/2) -- - lrcorner p shifted (-EmWidth + -uniformdeviate CutSpace/2,0) -- - llcorner p shifted (0,EmWidth + uniformdeviate BottomSpace/2) -- - ulcorner p shifted (EmWidth + uniformdeviate BackSpace/2,0) -- cycle - fi - enddef ; - - vardef MyMakeOne = - MyLastOne := MyShape(Page) ; - enddef ; - - vardef MyAddOne = - addto MySoFar also image(fill MyLastOne withcolor MyPageColor ; ) ; - enddef ; - - vardef MyDrawOne = - fill MyLastOne withcolor black ; - fill MyLastOne withcolor MyPageColor ; - enddef ; - - vardef MyDrawPage = - draw MySoFar ; - enddef ; - - vardef MySetSteps = - path l, r ; numeric s ; path ll[], rr[] ; path t ; - l := point 2 of MyLastOne -- point 3 of MyLastOne ; - r := point 0 of MyLastOne -- point 1 of MyLastOne ; - t := topboundary Field[Text][Text] rightenlarged TextWidth leftenlarged TextWidth ; - s := bbheight(Field[Text][Text])/LineHeight + 2 ; - t := t shifted (0,-TopSkip) ; - for i=1 upto s : - ll[i] := t intersectionpoint l ; - rr[i] := t intersectionpoint r ; - t := t shifted (0,-LineHeight) ; - endfor ; - MyLeftSteps := for i=1 upto s : ll[i] -- endfor cycle ; - MyRightSteps := for i=1 upto s : rr[i] -- endfor cycle ; - enddef ; - - vardef MyDrawText(expr txt) = - pair a ; a := (point 1 of MyLastOne) - (point 2 of MyLastOne) ; - picture p ; p := txt ; - p := p - shifted (-EmWidth,EmWidth) - shifted ulcorner txt - shifted point 1 of MyLastOne ; - p := p rotatedaround(lrcorner p, radian * tan(ypart a/xpart a)) ; - setbounds p to origin -- cycle ; - draw p ; - enddef ; - - vardef MyDrawTitle(expr txt) = - % pair a ; a := (point 2 of MyLastOne) - (point 3 of MyLastOne) ; - pair a ; a := (point 3 of MyLastOne) - (point 4 of MyLastOne) ; - picture p ; - if bbheight(txt) > bbwidth(txt) : - p := txt ysized(0.8*TextHeight) ; - else : - p := txt xsized(0.8*TextWidth) ; - fi ; - numeric d ; d := arclength(point 2 of MyLastOne -- point 3 of MyLastOne) - bbheight(p) ; - p := p - shifted (BackSpace,-d/2) - shifted -ulcorner p - shifted point 3 of MyLastOne ; - % p := p rotatedaround(ulcorner p, - radian * tan(xpart a/ypart a)) ; - % p := p rotatedaround(ulcorner p, radian * tan(ypart a/xpart a)) ; - setbounds p to origin -- cycle ; - draw p ; - enddef ; - - vardef MyDrawSteps = - s := bbheight(Field[Text][Text])/LineHeight + 2 ; - for i=1 upto s : - draw ll[i] withpen pencircle scaled 1mm ; - draw rr[i] withpen pencircle scaled 1mm ; - draw ll[i] -- rr[i] ; - endfor ; - draw Field[Text][Text] ; - enddef ; - - fi ; -\stopMPinitializations - -\startuseMPgraphic{initialization} - StartPage ; - MySoFar := image(fill Page enlarged 12pt withcolor MyPageColor) ; - MyMakeOne ; - MySetSteps ; - StopPage ; -\stopuseMPgraphic - -\appendtoks - \startnointerference - \useMPgraphic{initialization} - \stopnointerference -\to \everystarttext - -\startuseMPgraphic{page} - StartPage ; - MyDrawPage ; - MyDrawOne ; - MySetSteps ; - MyDrawTitle(textext("\getvariable{document}{title}")) ; - MyDrawText(textext("\getvariable{document}{topic}")) ; - % - % we have multiple runs when we have text - % -% MyDrawSteps ; -% MyMakeOne ; -% MySetSteps ; - StopPage ; -\stopuseMPgraphic - -\appendtoks - \startnointerference - \startMPcode - MyAddOne ; - MyMakeOne ; - MySetSteps ; - \stopMPcode - \stopnointerference -\to \everyshipout - -\defineoverlay[page][\useMPgraphic{page}] - -\startuseMPgraphic{symbol} - color cc ; cc := MyColor[2] ; - path p ; p := MySmallShape(unitsquare scaled (.6*LineHeight)) ; - fill p withcolor white ; - fill p withcolor cc ; -\stopuseMPgraphic - -\definesymbol[mysymbol][\struttedbox{\useMPgraphic{symbol}}] - -\setupitemgroup[itemize][1][symbol=mysymbol] - -\setupbackgrounds - [page] - [background=page] - -\startluacode - local texdimen = tex.dimen - function document.SetParShape() - local leftpath = metapost.getclippath("metafun","metafun","clip currentpicture to MyLeftSteps ;") - local rightpath = metapost.getclippath("metafun","metafun","clip currentpicture to MyRightSteps ;") - local shape = { } - for i=1,#leftpath do - local left = leftpath[i].x_coord - local right = rightpath[i].x_coord - local hsize = right - left - (texdimen.backspace + texdimen.cutspace)*number.dimenfactors.bp - shape[#shape+1] = string.format("%sbp %sbp",left,hsize) - end - -- print(table.serialize(shape)) - tex.sprint(tex.ctxcatcodes,string.format("\\parshape %s %s",#shape,table.concat(shape," "))) - end -\stopluacode - -\nopenalties \dontcomplain - -\setupwhitespace[none] - -\def\StartText#1#2% - {\starttext - \setvariable{document}{title}{\framed[frame=off,offset=0pt,align=flushleft,foregroundstyle=\tfd\setupinterlinespace]{\begstrut#1\endstrut}} - \setvariable{document}{topic}{\tfb#2} - \startstandardmakeup - % dummy page - \stopstandardmakeup - \setvariable{document}{title}{} - \setvariable{document}{topic}{}} - -\def\StopText - {\stoptext} - -\def\StartItems#1% - {\setvariable{document}{topic}{\tfb#1} - \startstandardmakeup[top=,bottom=\vss] - \startelement[items][title={#1}]% - \ctxlua{document.SetParShape()} - \StartSteps} - -\def\StopItems - {\StopSteps - \stopelement - \stopstandardmakeup} - -\def\StartItem - {\dontleavehmode - \startelement[item]% - \llap{\symbol[mysymbol]\quad}% graphic - \ignorespaces} - -\def\StopItem - {\removeunwantedspaces - \nobreak - \crlf - \stopelement - \crlf - \FlushStep} - -\def\ShapeParagraph - {\ctxlua{document.SetParShape()}} - -% no parshape yet - -\def\StartParagraphs#1% - {\setvariable{document}{topic}{\tfb#1} - \startstandardmakeup[top=,bottom=\vss] - %\ctxlua{document.SetParShape()} - \startelement[paragraphs]% - \StartSteps} - -\def\StopParagraphs - {\StopSteps - \stopelement - \stopstandardmakeup} - -\def\StartParagraph - {\startelement[paragraph]} - -\def\StopParagraph - {\par - \stopelement - \FlushStep} - -% experiment .. likely to change - -\setelementexporttag[items] [nature][display] -\setelementexporttag[item] [nature][mixed] -\setelementexporttag[paragraphs][nature][display] -\setelementexporttag[paragraph] [nature][mixed] - -\doifnotmode{demo}{\endinput} - -% finetuning: \StartText{\TEX\ and Reality\vskip2exClashing Mindsets?\vskip1ex}{Bacho\TEX, May 1, 2010} - -\StartText{Just\\A Demo}{Bacho\TEX, May 1, 2010} - -\StartItems{Quote from Tufte and Ward} - \StartItem - \input tufte - \StopItem - \StartItem - \input ward - \StopItem -\StopItems - -% \dorecurse{20}{ -% \ctxlua{document.SetParShape()} -% \input tufte -% \page -% } - -\StopText - diff --git a/tex/context/base/s-pre-70.mkiv b/tex/context/base/s-pre-70.mkiv new file mode 100644 index 000000000..60462cf7a --- /dev/null +++ b/tex/context/base/s-pre-70.mkiv @@ -0,0 +1,172 @@ +%D \module +%D [ file=s-pre-70, +%D version=2008.04.15, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Environment 70, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA / Hans Hagen] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D At the cost of more runtime and a larger output file, we +%D turn on randomization. The instances are cached in the +%D MkIV cache, so successive runs use the same shapes. + +% \usemodule[punk] \usetypescript[punk] \setupbodyfont[punk,20pt] +% +% \EnableRandomPunk + +\setupbodyfont[punknova,20pt] % we now use the opentype variant + +%D We use the regular screen size paper and layout setup. + +\setuppapersize + [S6][S6] + +\setuplayout + [topspace=30pt, + backspace=30pt, + width=middle, + height=fit, + header=0pt, + footer=0pt, + bottomdistance=24pt, + bottom=30pt, + bottom=18pt, + top=0pt] + +\setupinterlinespace + [top=height, + line=1.25\bodyfontsize] + +\setupcolors + [state=start, + textcolor=white] + +\setupinteraction + [state=start, + %click=off, + menu=on] + +%D We predefine a few palets. Of course you can define more. + +\definecolor[punkblue] [r=.4,b=.8,g=.4] +\definecolor[punkgreen] [r=.4,b=.4,g=.8] +\definecolor[punkred] [r=.8,b=.4,g=.4] +\definecolor[punkyellow][r=.6,g=.6,b=.2] + +\definepalet [punk-one] [textcolor=punkblue,pagecolor=punkgreen] +\definepalet [punk-two] [textcolor=punkred,pagecolor=punkyellow] +\definepalet [punk-three] [textcolor=punkblue,pagecolor=punkyellow] +\definepalet [punk-one-reverse] [textcolor=punkgreen,pagecolor=punkblue] +\definepalet [punk-two-reverse] [textcolor=punkyellow,pagecolor=punkred] +\definepalet [punk-three-reverse] [textcolor=punkyellow,pagecolor=punkblue] + +\setuppalet[punk-one] + +%D We use a few backgrounds. The hyperlink that invokes the +%D stepper is hooked into the text background. + +\definelayer + [page] + [width=\paperwidth, + height=\paperheight] + +\setupbackgrounds + [page] + [background={color,page}, + backgroundcolor=pagecolor, + setups=pagestuff] + +\setupbackgrounds + [text] + [background={color,invoke}, + backgroundoffset=12pt, + backgroundcolor=textcolor] + +%D We need different symbols for itemized lists. + +\definesymbol[1][\hbox{\lower1ex\hbox{*}}] +\definesymbol[2][\endash] +\definesymbol[3][\letterhash] +\definesymbol[3][>] + +%D We don't want these reversed clicked areas in Acrobat. + +\setupinteraction + [click=no, + color=white, % pagecolor, + contrastcolor=white] % pagecolor, + +%D We define a rather simple navigational panel at the +%D bottom + +\setupinteractionmenu + [bottom] + [color=white, % pagecolor, + contrastcolor=white, % pagecolor, + background=color, + backgroundcolor=textcolor, + frame=off, + height=24pt, + left=\hfill, + middle=\hskip12pt] + +\setupsubpagenumber + [state=start] + +\startinteractionmenu[bottom] + \txt + \interactionbar + [alternative=d, + symbol=yes, + color=white, + contrastcolor=textcolor] + \\ + \hfilll + \but [previouspage] < < < \\ + \but [nextpage] > > > \\ +\stopinteractionmenu + +%D Instead of the normal symbols we use more punky ones. + +\startsymbolset [punk] + \definesymbol[previous] [\string<\string<] + \definesymbol[somewhere] [\string^\string^] + \definesymbol[next] [\string>\string>] +\stopsymbolset + +\setupinteraction[symbolset=punk] + +%D Because the font is rather large, we use less whitespace. + +\setuphead + [chapter] + [after={\blank[big]}] + +%D Run this file with the command: \type {context --mode=demo s-pre-70} +%D in order to get an example. + +\doifnotmode{demo} {\endinput} + +\usemodule[pre-60] % use the stepper + +\starttext + +\title {Punk for dummies} + +\dorecurse{10} { + \title{Just a few dummy pages} + \StartSteps \startitemize[packed] + \startitemize + \startitem bla \FlushStep \stopitem + \startitem bla bla \FlushStep \stopitem + \startitem bla bla bla \FlushStep \stopitem + \startitem bla bla bla bla \FlushStep \stopitem + \stopitemize \StopSteps +} + +\stoptext diff --git a/tex/context/base/s-pre-70.tex b/tex/context/base/s-pre-70.tex deleted file mode 100644 index 7e3049ab0..000000000 --- a/tex/context/base/s-pre-70.tex +++ /dev/null @@ -1,174 +0,0 @@ -% engine=luatex - -%D \module -%D [ file=s-pre-70, -%D version=2008.04.15, -%D title=\CONTEXT\ Style File, -%D subtitle=Presentation Environment 70, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA / Hans Hagen] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D At the cost of more runtime and a larger output file, we -%D turn on randomization. The instances are cached in the -%D MkIV cache, so successive runs use the same shapes. - -% \usemodule[punk] \usetypescript[punk] \setupbodyfont[punk,20pt] -% -% \EnableRandomPunk - -\setupbodyfont[punknova,20pt] % we now use the opentype variant - -%D We use the regular screen size paper and layout setup. - -\setuppapersize - [S6][S6] - -\setuplayout - [topspace=30pt, - backspace=30pt, - width=middle, - height=fit, - header=0pt, - footer=0pt, - bottomdistance=24pt, - bottom=30pt, - bottom=18pt, - top=0pt] - -\setupinterlinespace - [top=height, - line=1.25\bodyfontsize] - -\setupcolors - [state=start, - textcolor=white] - -\setupinteraction - [state=start, - %click=off, - menu=on] - -%D We predefine a few palets. Of course you can define more. - -\definecolor[punkblue] [r=.4,b=.8,g=.4] -\definecolor[punkgreen] [r=.4,b=.4,g=.8] -\definecolor[punkred] [r=.8,b=.4,g=.4] -\definecolor[punkyellow][r=.6,g=.6,b=.2] - -\definepalet [punk-one] [textcolor=punkblue,pagecolor=punkgreen] -\definepalet [punk-two] [textcolor=punkred,pagecolor=punkyellow] -\definepalet [punk-three] [textcolor=punkblue,pagecolor=punkyellow] -\definepalet [punk-one-reverse] [textcolor=punkgreen,pagecolor=punkblue] -\definepalet [punk-two-reverse] [textcolor=punkyellow,pagecolor=punkred] -\definepalet [punk-three-reverse] [textcolor=punkyellow,pagecolor=punkblue] - -\setuppalet[punk-one] - -%D We use a few backgrounds. The hyperlink that invokes the -%D stepper is hooked into the text background. - -\definelayer - [page] - [width=\paperwidth, - height=\paperheight] - -\setupbackgrounds - [page] - [background={color,page}, - backgroundcolor=pagecolor, - setups=pagestuff] - -\setupbackgrounds - [text] - [background={color,invoke}, - backgroundoffset=12pt, - backgroundcolor=textcolor] - -%D We need different symbols for itemized lists. - -\definesymbol[1][\hbox{\lower1ex\hbox{*}}] -\definesymbol[2][\endash] -\definesymbol[3][\letterhash] -\definesymbol[3][>] - -%D We don't want these reversed clicked areas in Acrobat. - -\setupinteraction - [click=no, - color=white, % pagecolor, - contrastcolor=white] % pagecolor, - -%D We define a rather simple navigational panel at the -%D bottom - -\setupinteractionmenu - [bottom] - [color=white, % pagecolor, - contrastcolor=white, % pagecolor, - background=color, - backgroundcolor=textcolor, - frame=off, - height=24pt, - left=\hfill, - middle=\hskip12pt] - -\setupsubpagenumber - [state=start] - -\startinteractionmenu[bottom] - \txt - \interactionbar - [alternative=d, - symbol=yes, - color=white, - contrastcolor=textcolor] - \\ - \hfilll - \but [previouspage] < < < \\ - \but [nextpage] > > > \\ -\stopinteractionmenu - -%D Instead of the normal symbols we use more punky ones. - -\startsymbolset [punk] - \definesymbol[previous] [\string<\string<] - \definesymbol[somewhere] [\string^\string^] - \definesymbol[next] [\string>\string>] -\stopsymbolset - -\setupinteraction[symbolset=punk] - -%D Because the font is rather large, we use less whitespace. - -\setuphead - [chapter] - [after={\blank[big]}] - -%D Run this file with the command: \type {context --mode=demo s-pre-70} -%D in order to get an example. - -\doifnotmode{demo} {\endinput} - -\usemodule[pre-60] % use the stepper - -\starttext - -\title {Punk for dummies} - -\dorecurse{10} { - \title{Just a few dummy pages} - \StartSteps \startitemize[packed] - \startitemize - \startitem bla \FlushStep \stopitem - \startitem bla bla \FlushStep \stopitem - \startitem bla bla bla \FlushStep \stopitem - \startitem bla bla bla bla \FlushStep \stopitem - \stopitemize \StopSteps -} - -\stoptext diff --git a/tex/context/base/s-reg-01.mkiv b/tex/context/base/s-reg-01.mkiv new file mode 100644 index 000000000..d3e456881 --- /dev/null +++ b/tex/context/base/s-reg-01.mkiv @@ -0,0 +1,60 @@ +%D \module +%D [ file=s-reg-01, +%D version=2005.04.25, +%D title=\CONTEXT\ Style File, +%D subtitle=Extra Regime Support, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D \macros +%D {showregime} +%D +%D This code is moved from the kernel to here. (We could make it +%D auto-loadable). + +\startluacode +--[[ldx-- +

The following code is rather specific.

+--ldx]]-- + +function regimes.show(regime) + regime = regimes.synonyms[regime] or regime + local r = regimes.data[regime] + if r then + local chardata = characters.data + context.starttabulate { "|rT|T|rT|lT|lT|lT|" } + for k, v in ipairs(r) do + local chr = chardata[v] + if chr then + context.NC() context(k) + context.NC() context.getvalue(chr.contextname]) + context.NC() context("%U+05X",v) + context.NC() context(chr.contextname) + context.NC() context(chr.category) + context.NC() context(chr.description) + context.NC() context.NR() + else + -- can't happen + end + end + context.stoptabulate() + else + context("unknown regime %s",regime) + end +end +\stopluacode + +\unprotect + +\def\showregime + {\dosingleempty\doshowregime} + +\def\doshowregime[#1]% + {\ctxlua{regimes.show("#1")}} + +\protect \endinput diff --git a/tex/context/base/s-reg-01.tex b/tex/context/base/s-reg-01.tex deleted file mode 100644 index d3e456881..000000000 --- a/tex/context/base/s-reg-01.tex +++ /dev/null @@ -1,60 +0,0 @@ -%D \module -%D [ file=s-reg-01, -%D version=2005.04.25, -%D title=\CONTEXT\ Style File, -%D subtitle=Extra Regime Support, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D \macros -%D {showregime} -%D -%D This code is moved from the kernel to here. (We could make it -%D auto-loadable). - -\startluacode ---[[ldx-- -

The following code is rather specific.

---ldx]]-- - -function regimes.show(regime) - regime = regimes.synonyms[regime] or regime - local r = regimes.data[regime] - if r then - local chardata = characters.data - context.starttabulate { "|rT|T|rT|lT|lT|lT|" } - for k, v in ipairs(r) do - local chr = chardata[v] - if chr then - context.NC() context(k) - context.NC() context.getvalue(chr.contextname]) - context.NC() context("%U+05X",v) - context.NC() context(chr.contextname) - context.NC() context(chr.category) - context.NC() context(chr.description) - context.NC() context.NR() - else - -- can't happen - end - end - context.stoptabulate() - else - context("unknown regime %s",regime) - end -end -\stopluacode - -\unprotect - -\def\showregime - {\dosingleempty\doshowregime} - -\def\doshowregime[#1]% - {\ctxlua{regimes.show("#1")}} - -\protect \endinput diff --git a/tex/context/base/s-set-31.mkiv b/tex/context/base/s-set-31.mkiv new file mode 100644 index 000000000..53037a78d --- /dev/null +++ b/tex/context/base/s-set-31.mkiv @@ -0,0 +1,118 @@ +% show missing translations + +\startluacode +function interfaces.show_missing(whatinterfaces) + whatinterfaces = whatinterfaces or interfaces.interfaces + local list = dofile(resolvers.find_file("mult-def.lua")) + local NC, NR, HL = context.NC, context.NR, context.HL + for k,v in table.sortedhash(list) do + context.title(k) + context.starttabulate { string.rep("|",#whatinterfaces+1) } + for i=1,#whatinterfaces do + NC() + context(whatinterfaces[i]) + end + NC() NR() HL() + for kk, vv in next, v do + if not string.find(kk,"subsub") then + local okay = true + for i=1,#whatinterfaces do + local int = whatinterfaces[i] + local str = vv[int] + if not str or (int ~= "en" and str == vv.en) then + okay = false + break + end + end + if not okay then + for i=1,#whatinterfaces do + local int = whatinterfaces[i] + local str = vv[int] + context.NC() + if not str then + -- nothing + elseif int == "en" then + context.color( { "darkgreen" }, str ) + elseif str == vv.en then + context.color( { "darkred" }, str ) + elseif int == "pe" then + context("\\righttoleft " .. str) + else + context(str) + end + end + NC() NR() + end + end + end + context.stoptabulate() + end +end + +function interfaces.show_missing_messages(whatinterfaces) + whatinterfaces = whatinterfaces or interfaces.interfaces + local list = dofile(resolvers.find_file("mult-mes.lua")) + local NC, NR, HL = context.NC, context.NR, context.HL + for k,v in table.sortedhash(list) do + context.title("message: " .. k) + context.starttabulate { "|l|" .. string.rep("pl|",#whatinterfaces) } + NC() + for i=1,#whatinterfaces do + NC() + context(whatinterfaces[i]) + end + NC() NR() HL() + local sorted = table.sortedkeys(v) + for i=1,#sorted do + local kk = sorted[i] + local vv = v[kk] + if kk ~= "files" then + local okay = true + for i=1,#whatinterfaces do + local int = whatinterfaces[i] + local str = vv[int] + if not str or (int ~= "en" and str == vv.en) then + okay = false + break + end + end + if not okay then + context.NC() + context(kk) + for i=1,#whatinterfaces do + local int = whatinterfaces[i] + local str = vv[int] + NC() + if not str then + -- nothing + elseif int == "en" then + context.color( { "darkgreen" }, str ) + elseif str == vv.en then + context.color( { "darkred" }, str ) + elseif int == "pe" then + context("\\righttoleft " .. str) + else + context(str) + end + end + NC() NR() + end + end + end + context.stoptabulate() + end +end +\stopluacode + +\starttext + +\setupbodyfont[dejavu,7pt,tt] +\setuppapersize[A4,landscape][A4,landscape] +\setuplayout[backspace=.5cm,width=middle,topspace=.5cm,height=middle,header=1cm,footer=0cm] + +\startluacode + interfaces.show_missing() -- { "en","nl" } + interfaces.show_missing_messages() -- { "en","nl" } +\stopluacode + +\stoptext diff --git a/tex/context/base/s-set-31.tex b/tex/context/base/s-set-31.tex deleted file mode 100644 index 53037a78d..000000000 --- a/tex/context/base/s-set-31.tex +++ /dev/null @@ -1,118 +0,0 @@ -% show missing translations - -\startluacode -function interfaces.show_missing(whatinterfaces) - whatinterfaces = whatinterfaces or interfaces.interfaces - local list = dofile(resolvers.find_file("mult-def.lua")) - local NC, NR, HL = context.NC, context.NR, context.HL - for k,v in table.sortedhash(list) do - context.title(k) - context.starttabulate { string.rep("|",#whatinterfaces+1) } - for i=1,#whatinterfaces do - NC() - context(whatinterfaces[i]) - end - NC() NR() HL() - for kk, vv in next, v do - if not string.find(kk,"subsub") then - local okay = true - for i=1,#whatinterfaces do - local int = whatinterfaces[i] - local str = vv[int] - if not str or (int ~= "en" and str == vv.en) then - okay = false - break - end - end - if not okay then - for i=1,#whatinterfaces do - local int = whatinterfaces[i] - local str = vv[int] - context.NC() - if not str then - -- nothing - elseif int == "en" then - context.color( { "darkgreen" }, str ) - elseif str == vv.en then - context.color( { "darkred" }, str ) - elseif int == "pe" then - context("\\righttoleft " .. str) - else - context(str) - end - end - NC() NR() - end - end - end - context.stoptabulate() - end -end - -function interfaces.show_missing_messages(whatinterfaces) - whatinterfaces = whatinterfaces or interfaces.interfaces - local list = dofile(resolvers.find_file("mult-mes.lua")) - local NC, NR, HL = context.NC, context.NR, context.HL - for k,v in table.sortedhash(list) do - context.title("message: " .. k) - context.starttabulate { "|l|" .. string.rep("pl|",#whatinterfaces) } - NC() - for i=1,#whatinterfaces do - NC() - context(whatinterfaces[i]) - end - NC() NR() HL() - local sorted = table.sortedkeys(v) - for i=1,#sorted do - local kk = sorted[i] - local vv = v[kk] - if kk ~= "files" then - local okay = true - for i=1,#whatinterfaces do - local int = whatinterfaces[i] - local str = vv[int] - if not str or (int ~= "en" and str == vv.en) then - okay = false - break - end - end - if not okay then - context.NC() - context(kk) - for i=1,#whatinterfaces do - local int = whatinterfaces[i] - local str = vv[int] - NC() - if not str then - -- nothing - elseif int == "en" then - context.color( { "darkgreen" }, str ) - elseif str == vv.en then - context.color( { "darkred" }, str ) - elseif int == "pe" then - context("\\righttoleft " .. str) - else - context(str) - end - end - NC() NR() - end - end - end - context.stoptabulate() - end -end -\stopluacode - -\starttext - -\setupbodyfont[dejavu,7pt,tt] -\setuppapersize[A4,landscape][A4,landscape] -\setuplayout[backspace=.5cm,width=middle,topspace=.5cm,height=middle,header=1cm,footer=0cm] - -\startluacode - interfaces.show_missing() -- { "en","nl" } - interfaces.show_missing_messages() -- { "en","nl" } -\stopluacode - -\stoptext diff --git a/tex/context/base/x-fdf-00.mkii b/tex/context/base/x-fdf-00.mkii new file mode 100644 index 000000000..fd4bea7e7 --- /dev/null +++ b/tex/context/base/x-fdf-00.mkii @@ -0,0 +1,41 @@ +% +% +% +% first +% +% +% second +% +% +% +% +% previous method: +% +% object +% data +% fields +% field + +\defineXMLprocess[fdf:xfdf] +\defineXMLprocess[fdf:fields] +\defineXMLignore [fdf:f] +\defineXMLpush [fdf:value] + +\defineXMLenvironment [fdf:field] [name=,value=] + {\XMLerase{fdf:value}} + {\gsaveXMLdata{fdf:\XMLop{name}}{fdf:value}} + +\defineXMLsingular [fdf:field] [name=,value=] + {\gsaveXMLasdata{fdf:\XMLop{name}}{\XMLop{value}}} + +\def\doifelseFDFfield#1{\doifelseXMLelement{fdf:#1}} +\def\flushFDFfield #1{\flushXMLelement {fdf:#1}} +\def\processFDFfield #1{\processXMLelement {fdf:#1}} + +\def\loadFDFfile#1% + {\bgroup + \autoXMLnamespace[fdf]% + \processXMLfilegrouped{#1}% + \egroup} + +\endinput diff --git a/tex/context/base/x-fdf-00.tex b/tex/context/base/x-fdf-00.tex deleted file mode 100644 index fd4bea7e7..000000000 --- a/tex/context/base/x-fdf-00.tex +++ /dev/null @@ -1,41 +0,0 @@ -% -% -% -% first -% -% -% second -% -% -% -% -% previous method: -% -% object -% data -% fields -% field - -\defineXMLprocess[fdf:xfdf] -\defineXMLprocess[fdf:fields] -\defineXMLignore [fdf:f] -\defineXMLpush [fdf:value] - -\defineXMLenvironment [fdf:field] [name=,value=] - {\XMLerase{fdf:value}} - {\gsaveXMLdata{fdf:\XMLop{name}}{fdf:value}} - -\defineXMLsingular [fdf:field] [name=,value=] - {\gsaveXMLasdata{fdf:\XMLop{name}}{\XMLop{value}}} - -\def\doifelseFDFfield#1{\doifelseXMLelement{fdf:#1}} -\def\flushFDFfield #1{\flushXMLelement {fdf:#1}} -\def\processFDFfield #1{\processXMLelement {fdf:#1}} - -\def\loadFDFfile#1% - {\bgroup - \autoXMLnamespace[fdf]% - \processXMLfilegrouped{#1}% - \egroup} - -\endinput diff --git a/tex/context/base/x-fig-00.mkii b/tex/context/base/x-fig-00.mkii new file mode 100644 index 000000000..d293dc39f --- /dev/null +++ b/tex/context/base/x-fig-00.mkii @@ -0,0 +1,252 @@ +%D \module +%D [ file=x-fig-00, +%D version=2001.03.21, +%D title=\CONTEXT\ Style File, +%D subtitle=Figure Base Loading, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% \readfile{x-res-04} \donothing \donothing \endinput + +% naast label, ook fig als ref en dan naar fig ref springen + +%D This module implements an interface to a figure database +%D and file. The database is formatted in \XML\ conforming +%D the following \DTD: +%D +%D \typefile{x-fig-00.dtd} +%D +%D A figure base coded this way looks like: +%D +%D \starttyping +%D +%D +%D +%D +%D +%D PRAGMA Advanced Document Engineering +%D Manuals +%D Beginners Manual +%D A bunch of figures. +%D +%D +%D
+%D koe.pdf +%D +%D Corel Draw Suite +%D I bet that you've seen this cow before. +%D
+%D +%D
+%D non existent +%D +%D Nobody +%D When will we talk about European cows? +%D
+%D +%D
+%D \stoptyping +%D +%D You can convert this base into a \PDF\ file using +%D \TEXEXEC\ and another module in this suite. +%D +%D \starttyping +%D texexec --pdf --use=fig-make yourfile.xml +%D \stoptyping +%D +%D You can now select a graphic from this file using the +%D +%D \starttyping +%D \externalfigure[a dutch cow][width=4cm] +%D \stoptyping +%D +%D This module overloads this command so that a figure is +%D it first searched in the list of databases. +%D +%D \starttyping +%D \usemodule [fig-base] +%D \usefigurebases[yourfile] +%D \stoptyping +%D +%D The special keyword \type {reset} can be used to reset +%D this list. + +%D We park some mkiv code here. Eventually we will hook this into mkiv +%D searching differently (just a standard feature, no need for loading +%D modules because we need less code). Actually, what we do here is more +%D like res-*: we load the xml file once. + +% \startluacode +% +% document.figurebases = { } +% document.figurebases.data = { } +% document.figurebases.found = { } +% +% function document.figurebases.find(basename,askedlabel) +% document.figurebases.found = { } +% local base = document.figurebases.data[basename] +% local page = 0 +% if not base then +% base = xml.load(basename) +% document.figurebases.data[basename] = base +% end +% for e, d, k in xml.elements(base,"figurelibrary/figure/label") do +% page = page + 1 +% if xml.content(d[k]) == askedlabel then +% document.figurebases.found = { +% name = xml.filters.text(e,"file"), +% page = page, +% } +% return true +% end +% end +% return false +% end +% +% function commands.findfigurefilenameinbase(basename,askedlabel) +% if document.figurebases.find(basename,askedlabel) then +% commands.xdef("figurefilename",document.figurebases.found.name or "") +% commands.xdef("figurefilepage",document.figurebases.found.page or "") +% end +% end +% +% \stopluacode +% +% \def\findfigurefilenameinbase#1#2% +% {\ctxlua{commands.findfigurefilenameinbase("#1","\askedlabel")}} + +\startcommands dutch english + german czech + italian romanian + + usefigurebase: gebruikfiguurbestand usefigurebase + usefigurebase usefigurebase + usefigurebase usefigurebase + +\stopcommands + +\unprotect + +\consultutilityfilefalse + +\startXMLmapping [-] [figbase] + +\defineXMLprocess [figurelibrary] +\defineXMLignore [description] +\defineXMLignore [copyright] +\defineXMLignore [comment] +\defineXMLignore [status] +\defineXMLpush [file] +\defineXMLpush [label] +\defineXMLpush [dummy] +\defineXMLenvironment [figure] \figbase@StartFigure \figbase@StopFigure + +\stopXMLmapping + +\newcounter\figurefilepage + +\def\figbase@StartFigure + {\bgroup} + +\def\figbase@StopFigure + {\doglobal\increment\figurefilepage + \doif\askedlabel{\XMLpop{label}} + {\doglobal\settrue\figurefiledone + \xdef\figurefilename{\XMLpop{file}}\endinput}% + \egroup} + +\def\findfigurefilenameinbase#1#2% sets \figurefilename and \figurefilepage + {\processXMLfilegrouped{#1}} + +\def\getfigurefilename#1#2% + {\startnointerference + \traceXMLelementsfalse + \startXMLmapping[-][figbase] + \resetfigurefilebase + \XMLerase{file} + \XMLerase{dummy} + \XMLerase{label} + \xdef\figurefilebase{#1}% + \doglobal\newcounter\figurefilepage + \def\askedlabel{#2} + \processcommacommand[\figurepathlist]\dogetfigurefilename + \stopXMLmapping + \stopnointerference} + +\globalletempty\figurebasepath + +\def\dogetfigurefilename#1% + {\ifx\figurefilename\empty + \bgroup + \xdef\figurefilebasepath{#1}% + \assignfullfilename{#1}{\figurefilebase}\to\filename + \doiffileelse{\filename.xml} + {\doshowfigurestate{base file : \filename}% + \expanded{\findfigurefilenameinbase{\filename.xml}{\askedlabel}}} + \donothing + \ifx\figurefilename\empty\else +% \globallet\figurefilebase\figurefilebase + \globallet\figurefilebase\filename % hm, bad omen that this is needed + \fi + \egroup + \fi} + +\def\resetfigurefilebase + {\globalletempty\figurefilebase + \globalletempty\figurefilename + \globalletempty\figurefilebasepath + \globalletempty\figurefilepage} + +\def\doanalyzefiguredimensionsfromfile + {\ifcase\figurestatus \ifx\figurebaselist\empty \else + \resetfigurefilebase + \doshowfigurestate{base list : \figurebaselist}% + \processcommacommand[\figurebaselist]\dodoanalyzefiguredimensionsfromfile + \ifx\figurefilename\empty + \doshowfigurestate{base warning : no matching name found}% + \else + \doiffileelse{\figurefilebase.pdf} + {\doshowfigurestate{base file : \figurefilebase.pdf}% + \doshowfigurestate{base page : \figurefilepage}% + \let\figurepathlist\figurefilebasepath + \analyzefigurefilename{\figurefilebase.pdf}\wantedfigurelabel + \let\wantedfigurepage\figurefilepage} + {\doshowfigurestate{base missing : \figurefilebase.pdf}} + \fi + \ifcase\figurestatus + \analyzefigurefilename\expandedfigurename\wantedfigurelabel + \fi + \fi \fi} + +\def\dodoanalyzefiguredimensionsfromfile#1% + {\doshowfigurestate{base check : \wantedfigurename\space in #1}% + \getfigurefilename{#1}\wantedfigurename + \ifx\figurefilename\empty\else + \quitcommalist + \fi} + +\def\usefigurebase[#1]% + {\doifelse{#1}\v!reset + {\let\figurebaselist\empty} + {\addtocommalist{#1}\figurebaselist}} + +\let\figurebaselist\empty + +\resetfigurefilebase + +\protect \endinput + +\usefigurebase[figtest] + +\externalfigure[koetje] [width=3cm] +\externalfigure[de molen op de dijk][width=3cm] +\externalfigure[de molen op de dijk][width=2cm] +\externalfigure[weet ik veel] [width=3cm] +\externalfigure[weet ik veel] [width=2cm] +\externalfigure[weet ik wat] [width=2cm] +\externalfigure[koe] [width=2cm] diff --git a/tex/context/base/x-fig-00.tex b/tex/context/base/x-fig-00.tex deleted file mode 100644 index d293dc39f..000000000 --- a/tex/context/base/x-fig-00.tex +++ /dev/null @@ -1,252 +0,0 @@ -%D \module -%D [ file=x-fig-00, -%D version=2001.03.21, -%D title=\CONTEXT\ Style File, -%D subtitle=Figure Base Loading, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% \readfile{x-res-04} \donothing \donothing \endinput - -% naast label, ook fig als ref en dan naar fig ref springen - -%D This module implements an interface to a figure database -%D and file. The database is formatted in \XML\ conforming -%D the following \DTD: -%D -%D \typefile{x-fig-00.dtd} -%D -%D A figure base coded this way looks like: -%D -%D \starttyping -%D -%D -%D -%D -%D -%D PRAGMA Advanced Document Engineering -%D Manuals -%D Beginners Manual -%D A bunch of figures. -%D -%D -%D
-%D koe.pdf -%D -%D Corel Draw Suite -%D I bet that you've seen this cow before. -%D
-%D -%D
-%D non existent -%D -%D Nobody -%D When will we talk about European cows? -%D
-%D -%D
-%D \stoptyping -%D -%D You can convert this base into a \PDF\ file using -%D \TEXEXEC\ and another module in this suite. -%D -%D \starttyping -%D texexec --pdf --use=fig-make yourfile.xml -%D \stoptyping -%D -%D You can now select a graphic from this file using the -%D -%D \starttyping -%D \externalfigure[a dutch cow][width=4cm] -%D \stoptyping -%D -%D This module overloads this command so that a figure is -%D it first searched in the list of databases. -%D -%D \starttyping -%D \usemodule [fig-base] -%D \usefigurebases[yourfile] -%D \stoptyping -%D -%D The special keyword \type {reset} can be used to reset -%D this list. - -%D We park some mkiv code here. Eventually we will hook this into mkiv -%D searching differently (just a standard feature, no need for loading -%D modules because we need less code). Actually, what we do here is more -%D like res-*: we load the xml file once. - -% \startluacode -% -% document.figurebases = { } -% document.figurebases.data = { } -% document.figurebases.found = { } -% -% function document.figurebases.find(basename,askedlabel) -% document.figurebases.found = { } -% local base = document.figurebases.data[basename] -% local page = 0 -% if not base then -% base = xml.load(basename) -% document.figurebases.data[basename] = base -% end -% for e, d, k in xml.elements(base,"figurelibrary/figure/label") do -% page = page + 1 -% if xml.content(d[k]) == askedlabel then -% document.figurebases.found = { -% name = xml.filters.text(e,"file"), -% page = page, -% } -% return true -% end -% end -% return false -% end -% -% function commands.findfigurefilenameinbase(basename,askedlabel) -% if document.figurebases.find(basename,askedlabel) then -% commands.xdef("figurefilename",document.figurebases.found.name or "") -% commands.xdef("figurefilepage",document.figurebases.found.page or "") -% end -% end -% -% \stopluacode -% -% \def\findfigurefilenameinbase#1#2% -% {\ctxlua{commands.findfigurefilenameinbase("#1","\askedlabel")}} - -\startcommands dutch english - german czech - italian romanian - - usefigurebase: gebruikfiguurbestand usefigurebase - usefigurebase usefigurebase - usefigurebase usefigurebase - -\stopcommands - -\unprotect - -\consultutilityfilefalse - -\startXMLmapping [-] [figbase] - -\defineXMLprocess [figurelibrary] -\defineXMLignore [description] -\defineXMLignore [copyright] -\defineXMLignore [comment] -\defineXMLignore [status] -\defineXMLpush [file] -\defineXMLpush [label] -\defineXMLpush [dummy] -\defineXMLenvironment [figure] \figbase@StartFigure \figbase@StopFigure - -\stopXMLmapping - -\newcounter\figurefilepage - -\def\figbase@StartFigure - {\bgroup} - -\def\figbase@StopFigure - {\doglobal\increment\figurefilepage - \doif\askedlabel{\XMLpop{label}} - {\doglobal\settrue\figurefiledone - \xdef\figurefilename{\XMLpop{file}}\endinput}% - \egroup} - -\def\findfigurefilenameinbase#1#2% sets \figurefilename and \figurefilepage - {\processXMLfilegrouped{#1}} - -\def\getfigurefilename#1#2% - {\startnointerference - \traceXMLelementsfalse - \startXMLmapping[-][figbase] - \resetfigurefilebase - \XMLerase{file} - \XMLerase{dummy} - \XMLerase{label} - \xdef\figurefilebase{#1}% - \doglobal\newcounter\figurefilepage - \def\askedlabel{#2} - \processcommacommand[\figurepathlist]\dogetfigurefilename - \stopXMLmapping - \stopnointerference} - -\globalletempty\figurebasepath - -\def\dogetfigurefilename#1% - {\ifx\figurefilename\empty - \bgroup - \xdef\figurefilebasepath{#1}% - \assignfullfilename{#1}{\figurefilebase}\to\filename - \doiffileelse{\filename.xml} - {\doshowfigurestate{base file : \filename}% - \expanded{\findfigurefilenameinbase{\filename.xml}{\askedlabel}}} - \donothing - \ifx\figurefilename\empty\else -% \globallet\figurefilebase\figurefilebase - \globallet\figurefilebase\filename % hm, bad omen that this is needed - \fi - \egroup - \fi} - -\def\resetfigurefilebase - {\globalletempty\figurefilebase - \globalletempty\figurefilename - \globalletempty\figurefilebasepath - \globalletempty\figurefilepage} - -\def\doanalyzefiguredimensionsfromfile - {\ifcase\figurestatus \ifx\figurebaselist\empty \else - \resetfigurefilebase - \doshowfigurestate{base list : \figurebaselist}% - \processcommacommand[\figurebaselist]\dodoanalyzefiguredimensionsfromfile - \ifx\figurefilename\empty - \doshowfigurestate{base warning : no matching name found}% - \else - \doiffileelse{\figurefilebase.pdf} - {\doshowfigurestate{base file : \figurefilebase.pdf}% - \doshowfigurestate{base page : \figurefilepage}% - \let\figurepathlist\figurefilebasepath - \analyzefigurefilename{\figurefilebase.pdf}\wantedfigurelabel - \let\wantedfigurepage\figurefilepage} - {\doshowfigurestate{base missing : \figurefilebase.pdf}} - \fi - \ifcase\figurestatus - \analyzefigurefilename\expandedfigurename\wantedfigurelabel - \fi - \fi \fi} - -\def\dodoanalyzefiguredimensionsfromfile#1% - {\doshowfigurestate{base check : \wantedfigurename\space in #1}% - \getfigurefilename{#1}\wantedfigurename - \ifx\figurefilename\empty\else - \quitcommalist - \fi} - -\def\usefigurebase[#1]% - {\doifelse{#1}\v!reset - {\let\figurebaselist\empty} - {\addtocommalist{#1}\figurebaselist}} - -\let\figurebaselist\empty - -\resetfigurefilebase - -\protect \endinput - -\usefigurebase[figtest] - -\externalfigure[koetje] [width=3cm] -\externalfigure[de molen op de dijk][width=3cm] -\externalfigure[de molen op de dijk][width=2cm] -\externalfigure[weet ik veel] [width=3cm] -\externalfigure[weet ik veel] [width=2cm] -\externalfigure[weet ik wat] [width=2cm] -\externalfigure[koe] [width=2cm] diff --git a/tex/context/base/x-fig-01.mkii b/tex/context/base/x-fig-01.mkii new file mode 100644 index 000000000..c2f97fea9 --- /dev/null +++ b/tex/context/base/x-fig-01.mkii @@ -0,0 +1,461 @@ +%D \module +%D [ file=x-fig-01, +%D version=2001.03.21, +%D title=\CONTEXT\ Style File, +%D subtitle=Figure Base Generation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% \readfile {x-res-01} \donothing \donothing \endinput + +%D See \type {x-fig-00.tex} for more information on how to use +%D and generate figure databases. This file loads the file +%D named \type {\jobfilename} (\TEXEXEC\ will set this +%D variable). You can apply this style to a database by +%D saying: +%D +%D \starttyping +%D texexec --pdf --use=fig-make yourfile.xml +%D \stoptyping +%D +%D The following modes are supported: +%D +%D \starttabulate[|lT|l|] +%D \NC letter \NC map the preview on letter size \NC \NR +%D \NC compact \NC use an alternative presentation \NC \NR +%D \stoptabulate +%D +%D The resulting file has the following characteristics: +%D +%D \startitemize[packed] +%D \item the document is split into three sections: first each +%D figure is shown at its own page, then an overview of +%D figures is shown with some data alongside, and +%D finally an index and table of contents shows up +%D \item there is no title page, which means that one can +%D access a figure by page number without offset +%D \item the document is opened at the first overview page, +%D that is, when the viewer supports it +%D \item the graphic is shown 3~times: on a page of its own, +%D scaled to a fixed dimension, and relative to a4 or +%D letter paper size +%D \item the labels can be accessed in an index and list at +%D the end of the document +%D \stopitemize +%D +%D We use named destinations, which means that one can +%D access a figure by name from an external application. + +\usemodule[fig-00] + +\setupoutput[pdftex] \overcomePDFspacefalse + +\doifnothing {\jobfilename} {\end} +\doiffileelse {\jobfilename.xml} {} {\end} + +\definesymbol [attachment] [{\bf\color[darkred]{\jobname.xml}}] +\setupattachments [symbol=attachment] +\useattachment [datafile] [\jobname.xml] + +\def\StartDescription + {\bgroup + \defineXMLpush[organization] + \defineXMLpush[project] + \defineXMLpush[product] + \defineXMLpush[comment]} + +\def\StopDescription + {\subject {Figure collection} + \starttabulate[|lBe|p|] + \doifXMLdataelse{organization} + {\NC organization \NC \XMLpop{organization} \NC \NR}{} + \doifXMLdataelse{project} + {\NC project \NC \XMLpop{project} \NC \NR}{} + \doifXMLdataelse{product} + {\NC product \NC \XMLpop{product} \NC \NR}{} + \doifXMLdataelse{comment} + {\NC comment \NC \XMLpop{comment} \NC \NR}{} + \NC specification \NC \attachment[datafile] \NC \NR + \stoptabulate + \blank[2*big] + \egroup} + +\def\StartFigureA + {\bgroup + \defineXMLpush[file] + \XMLassign{file}{buffer} + \defineXMLpush[dummy] + \defineXMLpush[label] + \defineXMLpush[copyright] + \defineXMLpush[comment] + \defineXMLpush[status]} + +\defineoverlay[page][\overlaybutton{Description}] + +\startbuffer + \framed + [width=\XMLpar{dummy}{width}{12cm}, + height=\XMLpar{dummy}{height}{8cm}, + background=color, + backgroundcolor=gray, + foregroundcolor=darkred, + frame=off] + {\bf \XMLpop{dummy}} +\stopbuffer + +\def\StopFigureA + {\doglobal\increment\CurrentPage + \setupbackgrounds[page][background=page] + \doifelsenothing{\XMLpop{label}} + {\expanded{\definereference[Description][about: \XMLpop{file}]}% + \pagereference[\XMLpop{file}]} + {\expanded{\definereference[Description][about: \XMLpop{label}]}% + \pagereference[\XMLpop{label}]} + \pagefigure[\XMLpop{file}] + \setupbackgrounds[page][background=] + \egroup} + +\def\StartFigureB + {\StartFigureA} + +\defineregister + [figureindex] + [figureindices] + +\setupregister + [figureindex] + [ownnumber=yes, + criterium=text, + interaction=text, + indicator=no] + +\definelist + [figurelist] + +\setuplist + [figurelist] + [criterium=text, + pagenumber=no, + width=2em, + interaction=all] + +\setupcolors + [state=start] + +\setuptolerance + [verytolerant] + +% Ugly: + +\startnotmode[previewpage-letter,previewpage-S6] + \enablemode[previewpage-A4] +\stopnotmode + +\startmode[letter] % downward compatible + \enablemode[previewpage-letter] +\stopmode + +%startbuffer[paper] +\startsetups[paper] +\startmode[previewpage-A4] + \framed + [width=210mm,height=297mm,offset=overlay,frame=off, + background=color,backgroundcolor=white] + {\externalfigure[\XMLpop{file}][reset=yes]} +\stopmode +\startmode[previewpage-letter] + \framed + [width=8.5in,height=11in,offset=overlay,frame=off, + background=color,backgroundcolor=white] + {\externalfigure[\XMLpop{file}][reset=yes]} +\stopmode +\startmode[previewpage-S6] + \framed + [width=600pt,height=450pt,offset=overlay,frame=off, + background=color,backgroundcolor=white] + {\externalfigure[\XMLpop{file}][reset=yes]} +\stopmode +\stopsetups +%stopbuffer + +\setupbuttons + [offset=10pt, + width=broad, + strut=no, + rulethickness=1pt, + framecolor=darkred] + +\def\StopFigureB + {\par + \doglobal\increment\CurrentPage + \doifelsenothing{\XMLpop{label}} + {\expanded{\definereference[Figure][\XMLpop{file}]}% + \expanded{\definereference[GridPg][grid:\XMLpop{file}]}} + {\expanded{\definereference[Figure][\XMLpop{label}]}% + \expanded{\definereference[GridPg][grid:\XMLpop{label}]}}% + \button % content in setup + {\hbox to \hsize + {\forgetall \dontcomplain + \doifelsenothing{\XMLpop{label}} + {\pagereference[about: \XMLpop{file}]} + {\pagereference[about: \XMLpop{label}]}% + % moved here, because descriptions may be absent + \ifnum\CurrentPage=1 \pagereference[begin]\fi + % + \expanded{\writetolist[figurelist]{\CurrentPage}{\XMLpop{label}}}% + \expanded{\figureindex{\CurrentPage}{\XMLpop{label}}}% + \startnotmode[compact]% + \vbox to 100pt + {\hsize30pt + \vskip5pt + \hbox to \hsize{\hss\strut\bf\CurrentPage\hss}% + \vfill}% + \advance\hsize by -30pt + \stopnotmode + \startmode[compact]% + \advance\hsize by -10pt + \hskip10pt + \stopmode + \button % \framed + [width=150pt,height=100pt,offset=10pt,frame=off, + background=color,backgroundcolor=white,color=] + {\externalfigure + [\XMLpop{file}] + [maxheight=80pt,frame=off,maxwidth=130pt,factor=max]}% + [GridPg]% + \let\FigWid\figurenaturalwidth + \let\FigHei\figurenaturalheight + \advance\hsize by -150pt + \hskip10pt + \advance\hsize by -10pt + \vbox to 100pt + {\hsize40pt + %\externalfigure + % [paper] + % [type=buffer,frame=on, + % framecolor=darkred,rulethickness=.5pt, + % width=40pt,object=no] + \framed + [offset=overlay, + framecolor=darkred, + rulethickness=.5pt] + {\scale[width=40pt]{\setups[paper]}}% {\disableXML\getbuffer[paper]}}% + \startmode[compact]% + \vfill + \hbox to \hsize{\hss\strut\bf\CurrentPage\hss}% + \stopmode + \vfill}% + \advance\hsize by -40pt + \hskip10pt + \advance\hsize by -10pt + \vbox to 100pt + {\blank[disable] + \starttabulate[|Bel|p|] + \NC file \NC \XMLpop{file} \NC \NR + \doifXMLdata{label} + {\NC label \NC \XMLpop{label} \NC \NR} + \NC w$\times$h \NC \FigWid$\times$\FigHei \NC \NR + \doifXMLdata{copyright} + {\NC copyright \NC \XMLpop{copyright} \NC \NR} + \doifXMLdata{status} + {\doifelse{\XMLpop{status}}{obsolete} + {\NC status \NC \bf\darkred\XMLpop{status} \NC \NR} + {\NC status \NC \XMLpop{status} \NC \NR}} + \doifXMLdata{comment} + {\NC comment \NC \XMLpop{comment} \NC \NR} + \stoptabulate + \vfill}}}% + [Figure] + \vskip10pt + \egroup} + +\def\StartFigureC + {\StartFigureA} + +\def\StopFigureC + {\doglobal\increment\NumberOfFigures + \egroup} + +\setuplayout + [topspace=15pt,backspace=15pt, + header=0pt,footer=0pt,bottom=20pt,bottomdistance=10pt, + width=middle,height=fit] + +\setupbackgrounds + [page] + [background=, + backgroundcolor=gray] + +\setupinteractionscreen + [width=max, + height=max] + +\setupcolors + [state=start] + +\setupinteraction + [style=, + color=, + contrastcolor=, + state=start] + +\setuphead + [section] + [style=bfb] + +\setupbodyfont + [pos] + +\setupinteractionmenu + [bottom] + [left=\hfill, + middle=\hskip10pt, + frame=off, + style=bold, + background=color, + backgroundcolor=darkred, + foregroundcolor=white] + +\startinteractionmenu[bottom] + \but [begin] begin \\ + \but [index] index \\ + \but [list] list \\ + \but [CloseDocument] close \\ + \but [PreviousJump] go back \\ +\stopinteractionmenu + +\setupinteraction + [openaction=begin] + +\defineXMLenvironment [figurelibrary] \StartLibrary \StopLibrary + +\starttext + +\def\StartLibrary{\mainlanguage[\XMLpar{figurelibrary}{language}{en}]} +\def\StopLibrary {} + +\defineXMLignore [description] +\defineXMLenvironment [figure] \StartFigureC \StopFigureC + +\doglobal\newcounter\CurrentPage + +\processXMLfilegrouped{\jobfilename.xml} + +\increment\NumberOfFigures + +\defineXMLignore [description] +\defineXMLenvironment [figure] \StartFigureA \StopFigureA + +\doglobal\newcounter\CurrentPage + +\processXMLfilegrouped{\jobfilename.xml} + +\setuppapersize + [S6][S6] + +\setupbackgrounds + [page] + [background=color] + +\setupinteraction + [menu=on] + +\defineXMLenvironment [description] \StartDescription \StopDescription +\defineXMLenvironment [figure] \StartFigureB \StopFigureB + +\doglobal\newcounter\CurrentPage + +\processXMLfilegrouped{\jobfilename.xml} \page + +\subject [list] {List of figures} + +\placelist[figurelist] \page + +\subject [index] {Index of figures} + +\startcolumns +\placeregister[figureindex] +\stopcolumns + +\doifmodeelse{clipgrid-distance,clipgrid-steps}{\page}{\stoptext} + +\startuniqueMPgraphic{clipgrid}{dx,dy,nx,ny,type} + numeric gdx, gdy, lbx, lby ; + if \MPvar{type}=1 : + gdx := \MPvar{dy} ; + gdy := \MPvar{dx} ; + else : + gdx := OverlayWidth /\MPvar{nx} ; + gdy := OverlayHeight/\MPvar{ny} ; + fi ; + lbx := gdx ; + lby := gdy ; + defaultfont := "\truefontname{Mono}" ; + defaultscale := .5 ; + numeric pen ; pen := .25pt ; + def MyGrid text t = + draw vlingrid (0,OverlayWidth ,gdy,OverlayWidth ,OverlayHeight) t ; + draw hlingrid (0,OverlayHeight,gdx,OverlayHeight,OverlayWidth ) t ; + enddef ; + pickup pencircle scaled pen ; + MyGrid withcolor white ; + MyGrid dashed evenly scaled pen ; + draw OverlayBox withcolor white ; + draw OverlayBox dashed evenly scaled pen ; + draw vlinlabel.bot(0,eps+OverlayWidth /lby,2,OverlayWidth ) ; + draw hlinlabel.lft(0,eps+OverlayHeight/lbx,2,OverlayHeight) ; + setbounds currentpicture to OverlayBox enlarged (2*EmWidth) ; +\stopuniqueMPgraphic + +\presetMPvariable[clipgrid][dx=10pt] +\presetMPvariable[clipgrid][dy=10pt] +\presetMPvariable[clipgrid][nx=10] +\presetMPvariable[clipgrid][ny=10] + +\startmode[clipgrid-distance] + \defineoverlay[grid][\uniqueMPgraphic{clipgrid}{type=1}] +\stopmode + +\startmode[clipgrid-steps] + \defineoverlay[grid][\uniqueMPgraphic{clipgrid}{type=2}] +\stopmode + +\setupexternalfigures + [background={color,foreground,grid}, + backgroundcolor=white] + +\def\StartFigureD + {\StartFigureA} + +\def\StopFigureD + {\doglobal\increment\CurrentPage + \setupbackgrounds[page][background=page] + \startpagefigure[\XMLpop{file}][offset=20pt]% + \doifelsenothing{\XMLpop{label}} + {\expanded{\definereference[Description][about: \XMLpop{file}]}% + \pagereference[grid:\XMLpop{file}]} + {\expanded{\definereference[Description][about: \XMLpop{label}]}% + \pagereference[grid:\XMLpop{label}]} + \stoppagefigure + %\pagefigure[\XMLpop{file}][offset=20pt] + \setupbackgrounds[page][background=] + \egroup} + +\defineXMLignore + [description] + +\defineXMLenvironment + [figure] + \StartFigureD + \StopFigureD + +\doglobal\newcounter\CurrentPage + +\processXMLfilegrouped{\jobfilename.xml} \page + +\stoptext diff --git a/tex/context/base/x-fig-01.tex b/tex/context/base/x-fig-01.tex deleted file mode 100644 index c2f97fea9..000000000 --- a/tex/context/base/x-fig-01.tex +++ /dev/null @@ -1,461 +0,0 @@ -%D \module -%D [ file=x-fig-01, -%D version=2001.03.21, -%D title=\CONTEXT\ Style File, -%D subtitle=Figure Base Generation, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% \readfile {x-res-01} \donothing \donothing \endinput - -%D See \type {x-fig-00.tex} for more information on how to use -%D and generate figure databases. This file loads the file -%D named \type {\jobfilename} (\TEXEXEC\ will set this -%D variable). You can apply this style to a database by -%D saying: -%D -%D \starttyping -%D texexec --pdf --use=fig-make yourfile.xml -%D \stoptyping -%D -%D The following modes are supported: -%D -%D \starttabulate[|lT|l|] -%D \NC letter \NC map the preview on letter size \NC \NR -%D \NC compact \NC use an alternative presentation \NC \NR -%D \stoptabulate -%D -%D The resulting file has the following characteristics: -%D -%D \startitemize[packed] -%D \item the document is split into three sections: first each -%D figure is shown at its own page, then an overview of -%D figures is shown with some data alongside, and -%D finally an index and table of contents shows up -%D \item there is no title page, which means that one can -%D access a figure by page number without offset -%D \item the document is opened at the first overview page, -%D that is, when the viewer supports it -%D \item the graphic is shown 3~times: on a page of its own, -%D scaled to a fixed dimension, and relative to a4 or -%D letter paper size -%D \item the labels can be accessed in an index and list at -%D the end of the document -%D \stopitemize -%D -%D We use named destinations, which means that one can -%D access a figure by name from an external application. - -\usemodule[fig-00] - -\setupoutput[pdftex] \overcomePDFspacefalse - -\doifnothing {\jobfilename} {\end} -\doiffileelse {\jobfilename.xml} {} {\end} - -\definesymbol [attachment] [{\bf\color[darkred]{\jobname.xml}}] -\setupattachments [symbol=attachment] -\useattachment [datafile] [\jobname.xml] - -\def\StartDescription - {\bgroup - \defineXMLpush[organization] - \defineXMLpush[project] - \defineXMLpush[product] - \defineXMLpush[comment]} - -\def\StopDescription - {\subject {Figure collection} - \starttabulate[|lBe|p|] - \doifXMLdataelse{organization} - {\NC organization \NC \XMLpop{organization} \NC \NR}{} - \doifXMLdataelse{project} - {\NC project \NC \XMLpop{project} \NC \NR}{} - \doifXMLdataelse{product} - {\NC product \NC \XMLpop{product} \NC \NR}{} - \doifXMLdataelse{comment} - {\NC comment \NC \XMLpop{comment} \NC \NR}{} - \NC specification \NC \attachment[datafile] \NC \NR - \stoptabulate - \blank[2*big] - \egroup} - -\def\StartFigureA - {\bgroup - \defineXMLpush[file] - \XMLassign{file}{buffer} - \defineXMLpush[dummy] - \defineXMLpush[label] - \defineXMLpush[copyright] - \defineXMLpush[comment] - \defineXMLpush[status]} - -\defineoverlay[page][\overlaybutton{Description}] - -\startbuffer - \framed - [width=\XMLpar{dummy}{width}{12cm}, - height=\XMLpar{dummy}{height}{8cm}, - background=color, - backgroundcolor=gray, - foregroundcolor=darkred, - frame=off] - {\bf \XMLpop{dummy}} -\stopbuffer - -\def\StopFigureA - {\doglobal\increment\CurrentPage - \setupbackgrounds[page][background=page] - \doifelsenothing{\XMLpop{label}} - {\expanded{\definereference[Description][about: \XMLpop{file}]}% - \pagereference[\XMLpop{file}]} - {\expanded{\definereference[Description][about: \XMLpop{label}]}% - \pagereference[\XMLpop{label}]} - \pagefigure[\XMLpop{file}] - \setupbackgrounds[page][background=] - \egroup} - -\def\StartFigureB - {\StartFigureA} - -\defineregister - [figureindex] - [figureindices] - -\setupregister - [figureindex] - [ownnumber=yes, - criterium=text, - interaction=text, - indicator=no] - -\definelist - [figurelist] - -\setuplist - [figurelist] - [criterium=text, - pagenumber=no, - width=2em, - interaction=all] - -\setupcolors - [state=start] - -\setuptolerance - [verytolerant] - -% Ugly: - -\startnotmode[previewpage-letter,previewpage-S6] - \enablemode[previewpage-A4] -\stopnotmode - -\startmode[letter] % downward compatible - \enablemode[previewpage-letter] -\stopmode - -%startbuffer[paper] -\startsetups[paper] -\startmode[previewpage-A4] - \framed - [width=210mm,height=297mm,offset=overlay,frame=off, - background=color,backgroundcolor=white] - {\externalfigure[\XMLpop{file}][reset=yes]} -\stopmode -\startmode[previewpage-letter] - \framed - [width=8.5in,height=11in,offset=overlay,frame=off, - background=color,backgroundcolor=white] - {\externalfigure[\XMLpop{file}][reset=yes]} -\stopmode -\startmode[previewpage-S6] - \framed - [width=600pt,height=450pt,offset=overlay,frame=off, - background=color,backgroundcolor=white] - {\externalfigure[\XMLpop{file}][reset=yes]} -\stopmode -\stopsetups -%stopbuffer - -\setupbuttons - [offset=10pt, - width=broad, - strut=no, - rulethickness=1pt, - framecolor=darkred] - -\def\StopFigureB - {\par - \doglobal\increment\CurrentPage - \doifelsenothing{\XMLpop{label}} - {\expanded{\definereference[Figure][\XMLpop{file}]}% - \expanded{\definereference[GridPg][grid:\XMLpop{file}]}} - {\expanded{\definereference[Figure][\XMLpop{label}]}% - \expanded{\definereference[GridPg][grid:\XMLpop{label}]}}% - \button % content in setup - {\hbox to \hsize - {\forgetall \dontcomplain - \doifelsenothing{\XMLpop{label}} - {\pagereference[about: \XMLpop{file}]} - {\pagereference[about: \XMLpop{label}]}% - % moved here, because descriptions may be absent - \ifnum\CurrentPage=1 \pagereference[begin]\fi - % - \expanded{\writetolist[figurelist]{\CurrentPage}{\XMLpop{label}}}% - \expanded{\figureindex{\CurrentPage}{\XMLpop{label}}}% - \startnotmode[compact]% - \vbox to 100pt - {\hsize30pt - \vskip5pt - \hbox to \hsize{\hss\strut\bf\CurrentPage\hss}% - \vfill}% - \advance\hsize by -30pt - \stopnotmode - \startmode[compact]% - \advance\hsize by -10pt - \hskip10pt - \stopmode - \button % \framed - [width=150pt,height=100pt,offset=10pt,frame=off, - background=color,backgroundcolor=white,color=] - {\externalfigure - [\XMLpop{file}] - [maxheight=80pt,frame=off,maxwidth=130pt,factor=max]}% - [GridPg]% - \let\FigWid\figurenaturalwidth - \let\FigHei\figurenaturalheight - \advance\hsize by -150pt - \hskip10pt - \advance\hsize by -10pt - \vbox to 100pt - {\hsize40pt - %\externalfigure - % [paper] - % [type=buffer,frame=on, - % framecolor=darkred,rulethickness=.5pt, - % width=40pt,object=no] - \framed - [offset=overlay, - framecolor=darkred, - rulethickness=.5pt] - {\scale[width=40pt]{\setups[paper]}}% {\disableXML\getbuffer[paper]}}% - \startmode[compact]% - \vfill - \hbox to \hsize{\hss\strut\bf\CurrentPage\hss}% - \stopmode - \vfill}% - \advance\hsize by -40pt - \hskip10pt - \advance\hsize by -10pt - \vbox to 100pt - {\blank[disable] - \starttabulate[|Bel|p|] - \NC file \NC \XMLpop{file} \NC \NR - \doifXMLdata{label} - {\NC label \NC \XMLpop{label} \NC \NR} - \NC w$\times$h \NC \FigWid$\times$\FigHei \NC \NR - \doifXMLdata{copyright} - {\NC copyright \NC \XMLpop{copyright} \NC \NR} - \doifXMLdata{status} - {\doifelse{\XMLpop{status}}{obsolete} - {\NC status \NC \bf\darkred\XMLpop{status} \NC \NR} - {\NC status \NC \XMLpop{status} \NC \NR}} - \doifXMLdata{comment} - {\NC comment \NC \XMLpop{comment} \NC \NR} - \stoptabulate - \vfill}}}% - [Figure] - \vskip10pt - \egroup} - -\def\StartFigureC - {\StartFigureA} - -\def\StopFigureC - {\doglobal\increment\NumberOfFigures - \egroup} - -\setuplayout - [topspace=15pt,backspace=15pt, - header=0pt,footer=0pt,bottom=20pt,bottomdistance=10pt, - width=middle,height=fit] - -\setupbackgrounds - [page] - [background=, - backgroundcolor=gray] - -\setupinteractionscreen - [width=max, - height=max] - -\setupcolors - [state=start] - -\setupinteraction - [style=, - color=, - contrastcolor=, - state=start] - -\setuphead - [section] - [style=bfb] - -\setupbodyfont - [pos] - -\setupinteractionmenu - [bottom] - [left=\hfill, - middle=\hskip10pt, - frame=off, - style=bold, - background=color, - backgroundcolor=darkred, - foregroundcolor=white] - -\startinteractionmenu[bottom] - \but [begin] begin \\ - \but [index] index \\ - \but [list] list \\ - \but [CloseDocument] close \\ - \but [PreviousJump] go back \\ -\stopinteractionmenu - -\setupinteraction - [openaction=begin] - -\defineXMLenvironment [figurelibrary] \StartLibrary \StopLibrary - -\starttext - -\def\StartLibrary{\mainlanguage[\XMLpar{figurelibrary}{language}{en}]} -\def\StopLibrary {} - -\defineXMLignore [description] -\defineXMLenvironment [figure] \StartFigureC \StopFigureC - -\doglobal\newcounter\CurrentPage - -\processXMLfilegrouped{\jobfilename.xml} - -\increment\NumberOfFigures - -\defineXMLignore [description] -\defineXMLenvironment [figure] \StartFigureA \StopFigureA - -\doglobal\newcounter\CurrentPage - -\processXMLfilegrouped{\jobfilename.xml} - -\setuppapersize - [S6][S6] - -\setupbackgrounds - [page] - [background=color] - -\setupinteraction - [menu=on] - -\defineXMLenvironment [description] \StartDescription \StopDescription -\defineXMLenvironment [figure] \StartFigureB \StopFigureB - -\doglobal\newcounter\CurrentPage - -\processXMLfilegrouped{\jobfilename.xml} \page - -\subject [list] {List of figures} - -\placelist[figurelist] \page - -\subject [index] {Index of figures} - -\startcolumns -\placeregister[figureindex] -\stopcolumns - -\doifmodeelse{clipgrid-distance,clipgrid-steps}{\page}{\stoptext} - -\startuniqueMPgraphic{clipgrid}{dx,dy,nx,ny,type} - numeric gdx, gdy, lbx, lby ; - if \MPvar{type}=1 : - gdx := \MPvar{dy} ; - gdy := \MPvar{dx} ; - else : - gdx := OverlayWidth /\MPvar{nx} ; - gdy := OverlayHeight/\MPvar{ny} ; - fi ; - lbx := gdx ; - lby := gdy ; - defaultfont := "\truefontname{Mono}" ; - defaultscale := .5 ; - numeric pen ; pen := .25pt ; - def MyGrid text t = - draw vlingrid (0,OverlayWidth ,gdy,OverlayWidth ,OverlayHeight) t ; - draw hlingrid (0,OverlayHeight,gdx,OverlayHeight,OverlayWidth ) t ; - enddef ; - pickup pencircle scaled pen ; - MyGrid withcolor white ; - MyGrid dashed evenly scaled pen ; - draw OverlayBox withcolor white ; - draw OverlayBox dashed evenly scaled pen ; - draw vlinlabel.bot(0,eps+OverlayWidth /lby,2,OverlayWidth ) ; - draw hlinlabel.lft(0,eps+OverlayHeight/lbx,2,OverlayHeight) ; - setbounds currentpicture to OverlayBox enlarged (2*EmWidth) ; -\stopuniqueMPgraphic - -\presetMPvariable[clipgrid][dx=10pt] -\presetMPvariable[clipgrid][dy=10pt] -\presetMPvariable[clipgrid][nx=10] -\presetMPvariable[clipgrid][ny=10] - -\startmode[clipgrid-distance] - \defineoverlay[grid][\uniqueMPgraphic{clipgrid}{type=1}] -\stopmode - -\startmode[clipgrid-steps] - \defineoverlay[grid][\uniqueMPgraphic{clipgrid}{type=2}] -\stopmode - -\setupexternalfigures - [background={color,foreground,grid}, - backgroundcolor=white] - -\def\StartFigureD - {\StartFigureA} - -\def\StopFigureD - {\doglobal\increment\CurrentPage - \setupbackgrounds[page][background=page] - \startpagefigure[\XMLpop{file}][offset=20pt]% - \doifelsenothing{\XMLpop{label}} - {\expanded{\definereference[Description][about: \XMLpop{file}]}% - \pagereference[grid:\XMLpop{file}]} - {\expanded{\definereference[Description][about: \XMLpop{label}]}% - \pagereference[grid:\XMLpop{label}]} - \stoppagefigure - %\pagefigure[\XMLpop{file}][offset=20pt] - \setupbackgrounds[page][background=] - \egroup} - -\defineXMLignore - [description] - -\defineXMLenvironment - [figure] - \StartFigureD - \StopFigureD - -\doglobal\newcounter\CurrentPage - -\processXMLfilegrouped{\jobfilename.xml} \page - -\stoptext diff --git a/tex/context/base/x-fig-02.mkii b/tex/context/base/x-fig-02.mkii new file mode 100644 index 000000000..22d49d27a --- /dev/null +++ b/tex/context/base/x-fig-02.mkii @@ -0,0 +1,78 @@ +%D \module +%D [ file=x-fig-02, +%D version=2001.03.21, +%D title=\CONTEXT\ Style File, +%D subtitle=Figure Base Inclusion (I), +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% \readfile {x-res-02} \donothing \donothing \endinput + +%D This module enables non||\ConTeXt\ users to access the +%D database. For this, you need to run +%D +%D \starttyping +%D texexec --pdf --use=fig-fake yourfile.xml +%D \stoptyping +%D +%D The resulting file, \type {yourfile.fig}, can be loaded +%D in the normal way. The figures can be accessed with: +%D +%D \starttyping +%D \getfigurefile{label} +%D \getfigurepage{label} +%D \stoptyping +%D +%D A a bonus, the following macro is defined: +%D +%D \starttyping +%D \includefigurefile width 10cm {label} +%D \stoptyping + +\usemodule[fig-00] + +\doifnothing {\jobfilename} {\end} +\doiffileelse {\jobfilename.xml} {} {\end} + +\defineXMLenvironment [figurelibrary] \StartLibrary \StopLibrary +\defineXMLignore [description] +\defineXMLenvironment [figure] \StartFigure \StopFigure + +\def\StartLibrary + {\immediate\openout \scratchwrite=\jobfilename.fig + \immediate\write\scratchwrite{\string\input\space x-fig-03.tex \string\relax} + \immediate\write\scratchwrite{}} + +\def\StopLibrary + {\immediate\write\scratchwrite{} + \immediate\write\scratchwrite{\string\endinput} + \immediate\closeout\scratchwrite} + +\def\StartFigure + {\defineXMLpush[file] + \defineXMLpush[dummy] + \defineXMLpush[label] + \defineXMLpush[copyright] + \defineXMLpush[comment] + \defineXMLpush[status]} + +\def\StopFigure + {\doglobal\increment\CurrentPage + \immediate\write\scratchwrite + {\string\setfiguredata\space + {\XMLpop{label}} + {\jobfilename} + {\CurrentPage}}} + +\doglobal\newcounter\CurrentPage + +\starttext + +\processXMLfilegrouped{\jobfilename.xml} + +\stoptext diff --git a/tex/context/base/x-fig-02.tex b/tex/context/base/x-fig-02.tex deleted file mode 100644 index 22d49d27a..000000000 --- a/tex/context/base/x-fig-02.tex +++ /dev/null @@ -1,78 +0,0 @@ -%D \module -%D [ file=x-fig-02, -%D version=2001.03.21, -%D title=\CONTEXT\ Style File, -%D subtitle=Figure Base Inclusion (I), -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% \readfile {x-res-02} \donothing \donothing \endinput - -%D This module enables non||\ConTeXt\ users to access the -%D database. For this, you need to run -%D -%D \starttyping -%D texexec --pdf --use=fig-fake yourfile.xml -%D \stoptyping -%D -%D The resulting file, \type {yourfile.fig}, can be loaded -%D in the normal way. The figures can be accessed with: -%D -%D \starttyping -%D \getfigurefile{label} -%D \getfigurepage{label} -%D \stoptyping -%D -%D A a bonus, the following macro is defined: -%D -%D \starttyping -%D \includefigurefile width 10cm {label} -%D \stoptyping - -\usemodule[fig-00] - -\doifnothing {\jobfilename} {\end} -\doiffileelse {\jobfilename.xml} {} {\end} - -\defineXMLenvironment [figurelibrary] \StartLibrary \StopLibrary -\defineXMLignore [description] -\defineXMLenvironment [figure] \StartFigure \StopFigure - -\def\StartLibrary - {\immediate\openout \scratchwrite=\jobfilename.fig - \immediate\write\scratchwrite{\string\input\space x-fig-03.tex \string\relax} - \immediate\write\scratchwrite{}} - -\def\StopLibrary - {\immediate\write\scratchwrite{} - \immediate\write\scratchwrite{\string\endinput} - \immediate\closeout\scratchwrite} - -\def\StartFigure - {\defineXMLpush[file] - \defineXMLpush[dummy] - \defineXMLpush[label] - \defineXMLpush[copyright] - \defineXMLpush[comment] - \defineXMLpush[status]} - -\def\StopFigure - {\doglobal\increment\CurrentPage - \immediate\write\scratchwrite - {\string\setfiguredata\space - {\XMLpop{label}} - {\jobfilename} - {\CurrentPage}}} - -\doglobal\newcounter\CurrentPage - -\starttext - -\processXMLfilegrouped{\jobfilename.xml} - -\stoptext diff --git a/tex/context/base/x-fig-03.mkii b/tex/context/base/x-fig-03.mkii new file mode 100644 index 000000000..131752823 --- /dev/null +++ b/tex/context/base/x-fig-03.mkii @@ -0,0 +1,44 @@ +%D \module +%D [ file=x-fig-03, +%D version=2001.03.21, +%D title=\CONTEXT\ Style File, +%D subtitle=Figure Base Inclusion (II), +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\ifx \undefined \convertMPtoPDF \input supp-pdf.mkii \fi +\ifx \undefined \includefigurefile \else \expandafter \endinput \fi + +\gdef\getfigurefile#1% + {\expandafter\ifx\csname x-fig-f-#1\endcsname\relax + \currentfigurefile + \else + \csname x-fig-f-#1\endcsname + \fi} + +\gdef\getfigurepage#1% + {\expandafter\ifx\csname x-fig-p-#1\endcsname\relax + 1% + \else + \csname x-fig-p-#1\endcsname + \fi} + +\gdef\setfiguredata#1#2#3% + {\gdef\currentfigurefile{#2}% + \expandafter\gdef\csname x-fig-f-#1\endcsname{#2}% + \expandafter\gdef\csname x-fig-p-#1\endcsname{#3}} + +\def\includefigurefile#1#% + {\doincludefigurefile{#1}} + +\def\doincludefigurefile#1#2% + {\edef\next{\noexpand\pdfimage + #1 page \getfigurepage{#2} {\getfigurefile{#2}.pdf}}% + \next} + +\endinput diff --git a/tex/context/base/x-fig-03.tex b/tex/context/base/x-fig-03.tex deleted file mode 100644 index 131752823..000000000 --- a/tex/context/base/x-fig-03.tex +++ /dev/null @@ -1,44 +0,0 @@ -%D \module -%D [ file=x-fig-03, -%D version=2001.03.21, -%D title=\CONTEXT\ Style File, -%D subtitle=Figure Base Inclusion (II), -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\ifx \undefined \convertMPtoPDF \input supp-pdf.mkii \fi -\ifx \undefined \includefigurefile \else \expandafter \endinput \fi - -\gdef\getfigurefile#1% - {\expandafter\ifx\csname x-fig-f-#1\endcsname\relax - \currentfigurefile - \else - \csname x-fig-f-#1\endcsname - \fi} - -\gdef\getfigurepage#1% - {\expandafter\ifx\csname x-fig-p-#1\endcsname\relax - 1% - \else - \csname x-fig-p-#1\endcsname - \fi} - -\gdef\setfiguredata#1#2#3% - {\gdef\currentfigurefile{#2}% - \expandafter\gdef\csname x-fig-f-#1\endcsname{#2}% - \expandafter\gdef\csname x-fig-p-#1\endcsname{#3}} - -\def\includefigurefile#1#% - {\doincludefigurefile{#1}} - -\def\doincludefigurefile#1#2% - {\edef\next{\noexpand\pdfimage - #1 page \getfigurepage{#2} {\getfigurefile{#2}.pdf}}% - \next} - -\endinput diff --git a/tex/context/base/x-ldx.ctx b/tex/context/base/x-ldx.ctx deleted file mode 100644 index 0dddc9734..000000000 --- a/tex/context/base/x-ldx.ctx +++ /dev/null @@ -1,23 +0,0 @@ - - - - Lua Documentation Generator - - - mtxrun --internal x-ldx.lua - - - - - - - purge - forcexml - - - - ldx - - - - diff --git a/tex/context/base/x-ldx.tex b/tex/context/base/x-ldx.tex deleted file mode 100644 index 44f936d32..000000000 --- a/tex/context/base/x-ldx.tex +++ /dev/null @@ -1,191 +0,0 @@ -\doifnotmode{mkiv}{\endinput} - -\setupxml[default=hidden] - -\usemodule[x][mathml] - -\xmlregisterdocumentsetup{ldx}{xml:mml:define} -\xmlregisterdocumentsetup{ldx}{xml:ldx:define} - -\xmlregisterns{ldx}{ldx} - -\startxmlsetups xml:ldx:define -% \xmlgrab {\xmldocument} {ldx:*} {*} - \xmlsetsetup {#1} {ldx:*} {ldx:*} -\stopxmlsetups - -% % % - -\startxmlsetups ldx:p - \xmlflush{#1}\par -\stopxmlsetups - -\startxmlsetups ldx:source - \source{\xmlflush{#1}} -\stopxmlsetups - -\startxmlsetups ldx:key - \dontleavehmode{\bf\xmlflush{#1}} -\stopxmlsetups - -\startxmlsetups ldx:variable - \xmlflush{#1} -% \expanded{\variable{\xmlflush{#1}}} -\stopxmlsetups - -\startxmlsetups ldx:function - \dontleavehmode{\bf function}\space\xmlflush{#1} -% \expanded{\function{\xmlflush{#1}}} -\stopxmlsetups - -\startxmlsetups ldx:com - \dontleavehmode{\tt--\xmlflush{#1}} -\stopxmlsetups - -\startxmlsetups ldx:document - \page - \xmlflush{#1} - \determineregistercharacteristics[function] - \startmode[*register] - \testpage[4] - \extra{Functions} - \placeregister[function] - \stopmode - \determineregistercharacteristics[variable] - \startmode[*register] - \testpage[4] - \extra{Variables} - \placeregister[variable] - \stopmode -\stopxmlsetups - -\newcounter\CommentCounter - -\startxmlsetups ldx:comment - \blank - \doglobal\increment\CommentCounter - \margintitle{\bf\CommentCounter} - \xmlflush{#1} - \blank -\stopxmlsetups - -\startxmlsetups ldx:dqs - \dontleavehmode\bgroup\tt"\xmlflush{#1}"\egroup -\stopxmlsetups - -\startxmlsetups ldx:sqs - \dontleavehmode\bgroup\tt'\xmlflush{#1}'\egroup -\stopxmlsetups - -\startxmlsetups ldx:code - \startpacked - \xmlflush{#1}\relax - \stoppacked -\stopxmlsetups - -\startxmlsetups ldx:lines - \startpacked - \xmlflush{#1} - \stoppacked -\stopxmlsetups - -\startxmlsetups ldx:line - \doifelsenothing {\xmlflush{#1}} { - \xmlflush{#1}\crlf - } { - \dontleavehmode \hbox to \hsize \bgroup - \strut - \hskip.25\dimexpr\xmlattdef{#1}{n}{0}em\relax\relax % extra relax needed ! - \doif {\xmlatt{#1}{comment}} {yes} {\tt} - \xmlflush{#1} - \hss - \egroup - \endgraf - } -\stopxmlsetups - -\startxmlsetups ldx:logo - \uppercasestring\xmlatt{#1}{label}\xmlatt{#1}{name}\to\ascii - \ifx\ascii\empty\else\getvalue{\ascii}\fi -\stopxmlsetups - -\startxmlsetups ldx:l - \uppercasestring\xmlatt{#1}{l}\xmlatt{#1}{n}\to\ascii - \ifx\ascii\empty\else\getvalue{\ascii}\fi -\stopxmlsetups - -\startxmlsetups ldx:typing - \blank - \startpacked \tt - \xmlverbatim{#1} - \stoppacked - \blank -\stopxmlsetups - -\startxmlsetups ldx:type - \dontleavehmode{\tt\xmlflush{#1}} -\stopxmlsetups - -\startxmlsetups ldx:t - \dontleavehmode{\tt\xmlflush{#1}} -\stopxmlsetups - -% - -\def\xmldocument{ldx} - -\usemodule[abr-02] - -% key -> kw -% dqs -> dq -% sqs -> sq -% line -> ln -% code -> cd -% comment -> tx (text) - -\definetypeface[mainfacenormal] [ss][sans] [iwona] [default] -\definetypeface[mainfacenormal] [rm][serif][palatino] [default] -\definetypeface[mainfacenormal] [tt][mono] [modern] [default][rscale=1] % 1.1 -\definetypeface[mainfacenormal] [mm][math] [iwona] [default][encoding=default] - -\definetypeface[mainfacemedium] [ss][sans] [iwona-medium][default] -\definetypeface[mainfacenormal] [rm][serif][palatino] [default] -\definetypeface[mainfacemedium] [tt][mono] [modern] [default][rscale=1] % 1.1 -\definetypeface[mainfacemedium] [mm][math] [iwona-medium][default][encoding=default] - -\definetypeface[mainfacenarrowtt][tt][mono] [modern-cond] [default][rscale=1] % 1.1 - -\setupbodyfont - [mainfacenormal,11pt] - -\setupwhitespace - [big] - -\defineregister[function][functions] -\defineregister[variable][variables] - -\definehead[source][subject] -\definehead[extra] [subsubject] -\definehead[topic] [subsubsubject] - -\setuphead - [source] - [style=\bfb] - -\setuphead - [extra] - [style=\bfa] - -\setuphead - [topic] - [style=\bf] - -\setuplayout - [width=middle, - height=middle, - backspace=2cm, - topspace=2cm] - -% \usemodule[inf-02] - -\endinput diff --git a/tex/context/base/x-openmath.mkii b/tex/context/base/x-openmath.mkii new file mode 100644 index 000000000..38474996e --- /dev/null +++ b/tex/context/base/x-openmath.mkii @@ -0,0 +1,4 @@ +% This module is yet empty. We assume a transformation using +% x-openmath.xsl. + +\endinput diff --git a/tex/context/base/x-openmath.tex b/tex/context/base/x-openmath.tex deleted file mode 100644 index 38474996e..000000000 --- a/tex/context/base/x-openmath.tex +++ /dev/null @@ -1,4 +0,0 @@ -% This module is yet empty. We assume a transformation using -% x-openmath.xsl. - -\endinput diff --git a/tex/context/base/x-res-00.mkii b/tex/context/base/x-res-00.mkii new file mode 100644 index 000000000..9878d0a58 --- /dev/null +++ b/tex/context/base/x-res-00.mkii @@ -0,0 +1,67 @@ +%D \module +%D [ file=x-res-00, +%D version=2001.03.21, +%D title=\CONTEXT\ Style File, +%D subtitle=Resource Libraries, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\unprotect + +% \defineXMLcommandpush [rl:instance] (todo) +% \rawframed == [frame=off,offset=overlay] + +% resource library + +\defineXMLprocess [rl:figurelibrary] % not to be used any longer +\defineXMLprocess [rl:library] + +% resource library description + +\defineXMLignore [rl:description] + +\defineXMLpush [rl:organization] +\defineXMLpush [rl:product] +\defineXMLpush [rl:project] +\defineXMLpush [rl:collection] + +% resource library entries (better use XMLignore) + +\defineXMLignore [rl:applet] +\defineXMLignore [rl:application] +\defineXMLignore [rl:figure] +\defineXMLignore [rl:movie] +\defineXMLignore [rl:sound] + +\defineXMLpush [rl:type] +\defineXMLpush [rl:state] +\defineXMLpush [rl:width] +\defineXMLpush [rl:height] +\defineXMLpush [rl:file] +\defineXMLpush [rl:label] +\defineXMLpush [rl:original] +\defineXMLpush [rl:title] +\defineXMLpush [rl:alternative] +\defineXMLpush [rl:dummy] +\defineXMLpush [rl:icon] +\defineXMLpush [rl:copyright] +\defineXMLpush [rl:comment] +\defineXMLpush [rl:status] +\defineXMLpush [rl:original] +\defineXMLpush [rl:manipulation] + +% instances + +\defineXMLignore [rl:instance] + +\defineXMLpush [rl:background] +\defineXMLpush [rl:viewport] +\defineXMLpush [rl:dimension] +\defineXMLpush [rl:position] + +\protect \endinput diff --git a/tex/context/base/x-res-00.tex b/tex/context/base/x-res-00.tex deleted file mode 100644 index 9878d0a58..000000000 --- a/tex/context/base/x-res-00.tex +++ /dev/null @@ -1,67 +0,0 @@ -%D \module -%D [ file=x-res-00, -%D version=2001.03.21, -%D title=\CONTEXT\ Style File, -%D subtitle=Resource Libraries, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\unprotect - -% \defineXMLcommandpush [rl:instance] (todo) -% \rawframed == [frame=off,offset=overlay] - -% resource library - -\defineXMLprocess [rl:figurelibrary] % not to be used any longer -\defineXMLprocess [rl:library] - -% resource library description - -\defineXMLignore [rl:description] - -\defineXMLpush [rl:organization] -\defineXMLpush [rl:product] -\defineXMLpush [rl:project] -\defineXMLpush [rl:collection] - -% resource library entries (better use XMLignore) - -\defineXMLignore [rl:applet] -\defineXMLignore [rl:application] -\defineXMLignore [rl:figure] -\defineXMLignore [rl:movie] -\defineXMLignore [rl:sound] - -\defineXMLpush [rl:type] -\defineXMLpush [rl:state] -\defineXMLpush [rl:width] -\defineXMLpush [rl:height] -\defineXMLpush [rl:file] -\defineXMLpush [rl:label] -\defineXMLpush [rl:original] -\defineXMLpush [rl:title] -\defineXMLpush [rl:alternative] -\defineXMLpush [rl:dummy] -\defineXMLpush [rl:icon] -\defineXMLpush [rl:copyright] -\defineXMLpush [rl:comment] -\defineXMLpush [rl:status] -\defineXMLpush [rl:original] -\defineXMLpush [rl:manipulation] - -% instances - -\defineXMLignore [rl:instance] - -\defineXMLpush [rl:background] -\defineXMLpush [rl:viewport] -\defineXMLpush [rl:dimension] -\defineXMLpush [rl:position] - -\protect \endinput diff --git a/tex/context/base/x-res-01.mkii b/tex/context/base/x-res-01.mkii new file mode 100644 index 000000000..dc14e7054 --- /dev/null +++ b/tex/context/base/x-res-01.mkii @@ -0,0 +1,487 @@ +%D \module +%D [ file=x-fig-01, +%D version=2001.03.21, +%D title=\CONTEXT\ Style File, +%D subtitle=Figure Base Generation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D See \type {x-fig-00.tex} and \type {x-fig-04.tex} for more +%D information on how to use and generate figure databases. +%D This file loads the file named \type {\jobfilename} +%D (\TEXEXEC\ will set this variable). You can apply this +%D style to a database by saying: +%D +%D \starttyping +%D texexec --pdf --use=fig-make yourfile.xml +%D \stoptyping +%D +%D The following modes are supported: +%D +%D \starttabulate[|lT|l|] +%D \NC letter \NC map the preview on letter size \NC \NR +%D \NC compact \NC use an alternative presentation \NC \NR +%D \NC clipgrid-distance \NC add a copy with grid overlayed \NC \NR +%D \NC clipgrid-steps \NC add a copy with grid overlayed \NC \NR +%D \NC previewpage-A4 \NC show graphic relative to A4 \NC \NR +%D \NC previewpage-letter \NC show graphic relative to letter \NC \NR +%D \NC previewpage-S6 \NC show graphic relative to S6 \NC \NR +%D \stoptabulate +%D +%D The resulting file has the following characteristics: +%D +%D \startitemize[packed] +%D \item the document is split into three sections: first each +%D figure is shown at its own page, then an overview of +%D figures is shown with some data alongside, and +%D finally an index and table of contents shows up +%D \item there is no title page, which means that one can +%D access a figure by page number without offset +%D \item the document is opened at the first overview page, +%D that is, when the viewer supports it +%D \item the graphic is shown 3~times: on a page of its own, +%D scaled to a fixed dimension, and relative to a4 or +%D letter paper size +%D \item the labels can be accessed in an index and list at +%D the end of the document +%D \stopitemize +%D +%D We use named destinations, which means that one can +%D access a figure by name from an external application. + +\usemodule[res-00] + +\autoXMLnamespace[rl] + +\setupoutput[pdftex] \overcomePDFspacefalse + +\setjobfullname {xml} % default suffix + +\doifnothing {\jobfullname} {\end} +\doiffileelse {\jobfullname} {} {\end} + +\definesymbol [attachment] [{\bf\color[darkred]{\jobname.xml}}] +\setupattachments [symbol=attachment] +\useattachment [datafile] [\jobname.xml] + +\def\StartDescription + {\bgroup} + +\def\StopDescription + {\subject {Figure collection} + \starttabulate[|lBe|p|] + \doifXMLdataelse{rl:organization} + {\NC organization \NC \XMLflush{rl:organization} \NC \NR}{} + \doifXMLdataelse{rl:project} + {\NC project \NC \XMLflush{rl:project} \NC \NR}{} + \doifXMLdataelse{rl:product} + {\NC product \NC \XMLflush{rl:product} \NC \NR}{} + \doifXMLdataelse{rl:comment} + {\NC comment \NC \XMLflush{rl:comment} \NC \NR}{} + \NC specification \NC \attachment[datafile] \NC \NR + \stoptabulate + \blank[2*big] + \egroup} + + +\def\localexternalfigurereplacement#1#2#3% hack, no reuse of dummies (yet), todo: pass objname + {\doifelsenothing{\XMLflush{rl:label}} + {\edef\FigureName{\XMLflush{rl:label}}} + {\edef\FigureName{\XMLflush{rl:file}}}% + \doifobjectfoundelse{rl}\FigureName + {} + {\setobject{rl}\FigureName\vbox{\normalexternalfigurereplacement{#1}{#2}{#3}}}% + \getobject{rl}\FigureName} + +\startmode[dummy] + + \useMPlibrary[dum] + + \def\StartFigureA + {\bgroup + \XMLassign{rl:file}{dummy}} + + \let\normalexternalfigurereplacement\externalfigurereplacement + \let\externalfigurereplacement \localexternalfigurereplacement + +\stopmode + +\startnotmode[dummy] + + \def\StartFigureA + {\bgroup + \XMLassign{rl:file}{unknown}} + +\stopnotmode + +\startbuffer[unknown] + \framed + [width=\XMLpar{rl:dummy}{width}{12cm}, + height=\XMLpar{rl:dummy}{height}{8cm}, + background=color, + backgroundcolor=gray, + foregroundcolor=darkred, + align={lohi,middle}, % normal, + frame=off] + {\bf \XMLflush{rl:dummy}} +\stopbuffer + +\useexternalfigure[unknown][unknown][type=buffer,object=no] + +\defineoverlay[page][\overlaybutton{Description}] + +% \def\externalfigurereplacement#1#2#3% +% {\getbuffer[rl-unknown]} + +\def\StopFigureA + {\doglobal\increment\CurrentPage + \setupbackgrounds[page][background=page] + \doifelsenothing{\XMLflush{rl:label}} + {\expanded{\definereference[Description][about:\XMLflush{rl:file}]}% + \expanded{\pagereference[\XMLflush{rl:file}]}} + {\expanded{\definereference[Description][about:\XMLflush{rl:label}]}% + \expanded{\pagereference[\XMLflush{rl:label}]}} + \pagefigure[\XMLflush{rl:file}] + \setupbackgrounds[page][background=] + \egroup} + +\def\StartFigureB + {\StartFigureA} + +\defineregister + [figureindex] + [figureindices] + +\setupregister + [figureindex] + [ownnumber=yes, + criterium=text, + interaction=text, + indicator=no] + +\definelist + [figurelist] + +\setuplist + [figurelist] + [criterium=text, + pagenumber=no, + width=2em, + interaction=all] + +\setupcolors + [state=start] + +\setuptolerance + [verytolerant] + +% Ulgy: + +\startmode[letter] % downward compatible + \enablemode[previewpage-letter] +\stopmode + +\startnotmode[previewpage-letter,previewpage-S6] + \enablemode[previewpage-A4] +\stopnotmode + +\startsetups[paper] +\startmode[previewpage-A4] + \framed + [width=210mm,height=297mm,offset=overlay,frame=off, + background=color,backgroundcolor=white] + {\externalfigure[\XMLflush{rl:file}][reset=yes]} +\stopmode +\startmode[previewpage-letter] + \framed + [width=8.5in,height=11in,offset=overlay,frame=off, + background=color,backgroundcolor=white] + {\externalfigure[\XMLflush{rl:file}][reset=yes]} +\stopmode +\startmode[previewpage-S6] + \framed + [width=600pt,height=450pt,offset=overlay,frame=off, + background=color,backgroundcolor=white] + {\externalfigure[\XMLflush{rl:file}][reset=yes]} +\stopmode +\stopsetups + +\setupbuttons + [offset=10pt, + width=broad, + strut=no, + rulethickness=1pt, + framecolor=darkred] + +\definecolor[XMLRLcolor][white] + +\def\StopFigureB + {\doglobal\increment\CurrentPage + \doifelsenothing{\XMLflush{rl:label}} + {\expanded{\definereference[Figure][\XMLflush{rl:file}]}% + \expanded{\definereference[GridPg][grid:\XMLflush{rl:file}]}} + {\expanded{\definereference[Figure][\XMLflush{rl:label}]}% + \expanded{\definereference[GridPg][grid:\XMLflush{rl:label}]}}% + \button + {\hbox to \hsize + {\forgetall \dontcomplain + \doifelsenothing{\XMLflush{rl:label}} + {\expanded{\pagereference[about:\XMLflush{rl:file}]}} + {\expanded{\pagereference[about:\XMLflush{rl:label}]}}% + % moved here, because descriptions may be absent + \ifnum\CurrentPage=1 \pagereference[begin]\fi + % + \expanded{\writetolist[figurelist]{\CurrentPage}{\XMLflush{rl:label}}}% + \expanded{\figureindex{\CurrentPage}{\XMLflush{rl:label}}}% + \startnotmode[compact]% + \vbox to 100pt + {\hsize30pt + \vskip5pt + \hbox to \hsize{\hss\strut\bf\CurrentPage\hss}% + \vfill}% + \advance\hsize by -30pt + \stopnotmode + \startmode[compact]% + \advance\hsize by -10pt + \hskip10pt + \stopmode + \button % \framed + [width=150pt,height=100pt,offset=10pt,frame=off, + background=color,backgroundcolor=white,color=] + {\externalfigure + [\XMLflush{rl:file}] + %[maxheight=80pt,frame=off,maxwidth=130pt,factor=max]}% + [factor=max]}% + [GridPg]% + \let\FigWid\figurenaturalwidth + \let\FigHei\figurenaturalheight + \advance\hsize by -150pt + \hskip10pt + \advance\hsize by -10pt + \vbox to 100pt + {\hsize40pt + %\externalfigure + % [paper] + % [type=buffer,frame=on, + % framecolor=darkred,rulethickness=.5pt, + % width=40pt,object=no] + \framed + [offset=overlay, + framecolor=darkred, + rulethickness=.5pt] + {\scale[width=40pt]{\setups[paper]}}% + \startmode[compact]% + \vfill + \hbox to \hsize{\hss\strut\bf\CurrentPage\hss}% + \stopmode + \vfill}% + \advance\hsize by -40pt + \hskip10pt + \advance\hsize by -10pt + \vbox to 100pt + {\blank[disable] + \starttabulate[|Bel|p|] + \NC file \NC \XMLflush{rl:file} \NC \NR + \doifXMLdata{rl:label} + {\NC label \NC \XMLflush{rl:label} \NC \NR} + \NC w$\times$h \NC \FigWid$\times$\FigHei \NC \NR + \doifXMLdata{rl:copyright} + {\NC copyright \NC \XMLflush{rl:copyright} \NC \NR} + \doifXMLdata{rl:status} + {\doifelse{\XMLflush{rl:status}}{obsolete} + {\NC status \NC \dontleavehmode \color[darkred]{\bf\XMLflush{rl:status}} \NC \NR} + {\NC status \NC \XMLflush{rl:status} \NC \NR}} + \doifXMLdata{rl:comment} + {\NC comment \NC \XMLflush{rl:comment} \NC \NR} + \stoptabulate + \vfill}}}% + [Figure] + \vskip10pt + \egroup} + +\def\StartFigureC + {\StartFigureA} + +\def\StopFigureC + {\doglobal\increment\NumberOfFigures + \egroup} + +\setuplayout + [topspace=15pt,backspace=15pt, + header=0pt,footer=0pt,bottom=20pt,bottomdistance=10pt, + width=middle,height=fit] + +\setupbackgrounds + [page] + [background=, + backgroundcolor=gray] + +\setupinteractionscreen + [width=max, + height=max] + +\setupcolors + [state=start] + +\setupinteraction + [style=, + color=, + contrastcolor=, + state=start] + +\setuphead + [section] + [style=bfb] + +% \setupbodyfont +% [pos] + +\setupinteractionmenu + [bottom] + [left=\hfill, + middle=\hskip10pt, + frame=off, + style=bold, + background=color, + backgroundcolor=darkred, + foregroundcolor=white] + +\startinteractionmenu[bottom] + \but [begin] begin \\ + \but [index] index \\ + \but [list] list \\ + \but [CloseDocument] close \\ + \but [PreviousJump] go back \\ +\stopinteractionmenu + +\setupinteraction + [openaction=begin] + +\defineXMLenvironment [rl:figurelibrary] \StartLibrary \StopLibrary +\defineXMLenvironment [rl:library] \StartLibrary \StopLibrary + +\starttext + +\def\StartLibrary{\mainlanguage[\XMLpar{rl:library}{language}{en}]} +\def\StopLibrary {} + +\defineXMLignore [rl:description] +\defineXMLenvironment [rl:figure] \StartFigureC \StopFigureC + +\doglobal\newcounter\CurrentPage + +\processXMLfilegrouped{\jobfullname} + +\increment\NumberOfFigures + +\defineXMLignore [rl:description] +\defineXMLenvironment [rl:figure] \StartFigureA \StopFigureA + +\doglobal\newcounter\CurrentPage + +\processXMLfilegrouped{\jobfullname} + +\setuppapersize + [S6][S6] + +\setupbackgrounds + [page] + [background=color] + +\setupinteraction + [menu=on] + +\defineXMLenvironment [rl:description] \StartDescription \StopDescription +\defineXMLenvironment [rl:figure] \StartFigureB \StopFigureB + +\doglobal\newcounter\CurrentPage + +\processXMLfilegrouped{\jobfullname} \page + +\subject [list] {List of figures} + +\placelist[figurelist] \page + +\subject [index] {Index of figures} + +\startcolumns +\placeregister[figureindex] +\stopcolumns + +\doifmodeelse{clipgrid-distance,clipgrid-steps}{\page}{\stoptext} + +\startuniqueMPgraphic{clipgrid}{dx,dy,nx,ny,type} + numeric gdx, gdy, lbx, lby ; + if \MPvar{type}=1 : + gdx := \MPvar{dy} ; + gdy := \MPvar{dx} ; + else : + gdx := OverlayWidth /\MPvar{nx} ; + gdy := OverlayHeight/\MPvar{ny} ; + fi ; + lbx := gdx ; + lby := gdy ; + defaultfont := "\truefontname{Mono}" ; + defaultscale := .5 ; + numeric pen ; pen := .25pt ; + def MyGrid text t = + draw vlingrid (0,OverlayWidth ,gdy,OverlayWidth ,OverlayHeight) t ; + draw hlingrid (0,OverlayHeight,gdx,OverlayHeight,OverlayWidth ) t ; + enddef ; + pickup pencircle scaled pen ; + MyGrid withcolor white ; + MyGrid dashed evenly scaled pen ; + draw OverlayBox withcolor white ; + draw OverlayBox dashed evenly scaled pen ; + draw vlinlabel.bot(0,eps+OverlayWidth /lby,2,OverlayWidth ) ; + draw hlinlabel.lft(0,eps+OverlayHeight/lbx,2,OverlayHeight) ; + setbounds currentpicture to OverlayBox enlarged (2*EmWidth) ; +\stopuniqueMPgraphic + +\presetMPvariable[clipgrid][dx=10pt] +\presetMPvariable[clipgrid][dy=10pt] +\presetMPvariable[clipgrid][nx=10] +\presetMPvariable[clipgrid][ny=10] + +\startmode[clipgrid-distance] + \defineoverlay[grid][\uniqueMPgraphic{clipgrid}{type=1}] +\stopmode + +\startmode[clipgrid-steps] + \defineoverlay[grid][\uniqueMPgraphic{clipgrid}{type=2}] +\stopmode + +\setupexternalfigures + [background={color,foreground,grid}, + backgroundcolor=white] + +\def\StartFigureD + {\StartFigureA} + +\def\StopFigureD + {\doglobal\increment\CurrentPage + \setupbackgrounds[page][background=page] + \startpagefigure[\XMLflush{rl:file}][offset=20pt]% + \doifelsenothing{\XMLflush{rl:label}} + {\expanded{\definereference[Description][about:\XMLflush{rl:file}]}% + \expanded{\pagereference[grid:\XMLflush{rl:file}]}} + {\expanded{\definereference[Description][about:\XMLflush{rl:label}]}% + \expanded{\pagereference[grid:\XMLflush{rl:label}]}} + \stoppagefigure + %\pagefigure[\XMLflush{rl:file}][offset=20pt] + \setupbackgrounds[page][background=] + \egroup} + +\defineXMLignore [rl:description] +\defineXMLenvironment [rl:figure] \StartFigureD \StopFigureD + +\doglobal\newcounter\CurrentPage + +\processXMLfilegrouped{\jobfullname} \page + +\stoptext diff --git a/tex/context/base/x-res-01.mkiv b/tex/context/base/x-res-01.mkiv new file mode 100644 index 000000000..dc14e7054 --- /dev/null +++ b/tex/context/base/x-res-01.mkiv @@ -0,0 +1,487 @@ +%D \module +%D [ file=x-fig-01, +%D version=2001.03.21, +%D title=\CONTEXT\ Style File, +%D subtitle=Figure Base Generation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D See \type {x-fig-00.tex} and \type {x-fig-04.tex} for more +%D information on how to use and generate figure databases. +%D This file loads the file named \type {\jobfilename} +%D (\TEXEXEC\ will set this variable). You can apply this +%D style to a database by saying: +%D +%D \starttyping +%D texexec --pdf --use=fig-make yourfile.xml +%D \stoptyping +%D +%D The following modes are supported: +%D +%D \starttabulate[|lT|l|] +%D \NC letter \NC map the preview on letter size \NC \NR +%D \NC compact \NC use an alternative presentation \NC \NR +%D \NC clipgrid-distance \NC add a copy with grid overlayed \NC \NR +%D \NC clipgrid-steps \NC add a copy with grid overlayed \NC \NR +%D \NC previewpage-A4 \NC show graphic relative to A4 \NC \NR +%D \NC previewpage-letter \NC show graphic relative to letter \NC \NR +%D \NC previewpage-S6 \NC show graphic relative to S6 \NC \NR +%D \stoptabulate +%D +%D The resulting file has the following characteristics: +%D +%D \startitemize[packed] +%D \item the document is split into three sections: first each +%D figure is shown at its own page, then an overview of +%D figures is shown with some data alongside, and +%D finally an index and table of contents shows up +%D \item there is no title page, which means that one can +%D access a figure by page number without offset +%D \item the document is opened at the first overview page, +%D that is, when the viewer supports it +%D \item the graphic is shown 3~times: on a page of its own, +%D scaled to a fixed dimension, and relative to a4 or +%D letter paper size +%D \item the labels can be accessed in an index and list at +%D the end of the document +%D \stopitemize +%D +%D We use named destinations, which means that one can +%D access a figure by name from an external application. + +\usemodule[res-00] + +\autoXMLnamespace[rl] + +\setupoutput[pdftex] \overcomePDFspacefalse + +\setjobfullname {xml} % default suffix + +\doifnothing {\jobfullname} {\end} +\doiffileelse {\jobfullname} {} {\end} + +\definesymbol [attachment] [{\bf\color[darkred]{\jobname.xml}}] +\setupattachments [symbol=attachment] +\useattachment [datafile] [\jobname.xml] + +\def\StartDescription + {\bgroup} + +\def\StopDescription + {\subject {Figure collection} + \starttabulate[|lBe|p|] + \doifXMLdataelse{rl:organization} + {\NC organization \NC \XMLflush{rl:organization} \NC \NR}{} + \doifXMLdataelse{rl:project} + {\NC project \NC \XMLflush{rl:project} \NC \NR}{} + \doifXMLdataelse{rl:product} + {\NC product \NC \XMLflush{rl:product} \NC \NR}{} + \doifXMLdataelse{rl:comment} + {\NC comment \NC \XMLflush{rl:comment} \NC \NR}{} + \NC specification \NC \attachment[datafile] \NC \NR + \stoptabulate + \blank[2*big] + \egroup} + + +\def\localexternalfigurereplacement#1#2#3% hack, no reuse of dummies (yet), todo: pass objname + {\doifelsenothing{\XMLflush{rl:label}} + {\edef\FigureName{\XMLflush{rl:label}}} + {\edef\FigureName{\XMLflush{rl:file}}}% + \doifobjectfoundelse{rl}\FigureName + {} + {\setobject{rl}\FigureName\vbox{\normalexternalfigurereplacement{#1}{#2}{#3}}}% + \getobject{rl}\FigureName} + +\startmode[dummy] + + \useMPlibrary[dum] + + \def\StartFigureA + {\bgroup + \XMLassign{rl:file}{dummy}} + + \let\normalexternalfigurereplacement\externalfigurereplacement + \let\externalfigurereplacement \localexternalfigurereplacement + +\stopmode + +\startnotmode[dummy] + + \def\StartFigureA + {\bgroup + \XMLassign{rl:file}{unknown}} + +\stopnotmode + +\startbuffer[unknown] + \framed + [width=\XMLpar{rl:dummy}{width}{12cm}, + height=\XMLpar{rl:dummy}{height}{8cm}, + background=color, + backgroundcolor=gray, + foregroundcolor=darkred, + align={lohi,middle}, % normal, + frame=off] + {\bf \XMLflush{rl:dummy}} +\stopbuffer + +\useexternalfigure[unknown][unknown][type=buffer,object=no] + +\defineoverlay[page][\overlaybutton{Description}] + +% \def\externalfigurereplacement#1#2#3% +% {\getbuffer[rl-unknown]} + +\def\StopFigureA + {\doglobal\increment\CurrentPage + \setupbackgrounds[page][background=page] + \doifelsenothing{\XMLflush{rl:label}} + {\expanded{\definereference[Description][about:\XMLflush{rl:file}]}% + \expanded{\pagereference[\XMLflush{rl:file}]}} + {\expanded{\definereference[Description][about:\XMLflush{rl:label}]}% + \expanded{\pagereference[\XMLflush{rl:label}]}} + \pagefigure[\XMLflush{rl:file}] + \setupbackgrounds[page][background=] + \egroup} + +\def\StartFigureB + {\StartFigureA} + +\defineregister + [figureindex] + [figureindices] + +\setupregister + [figureindex] + [ownnumber=yes, + criterium=text, + interaction=text, + indicator=no] + +\definelist + [figurelist] + +\setuplist + [figurelist] + [criterium=text, + pagenumber=no, + width=2em, + interaction=all] + +\setupcolors + [state=start] + +\setuptolerance + [verytolerant] + +% Ulgy: + +\startmode[letter] % downward compatible + \enablemode[previewpage-letter] +\stopmode + +\startnotmode[previewpage-letter,previewpage-S6] + \enablemode[previewpage-A4] +\stopnotmode + +\startsetups[paper] +\startmode[previewpage-A4] + \framed + [width=210mm,height=297mm,offset=overlay,frame=off, + background=color,backgroundcolor=white] + {\externalfigure[\XMLflush{rl:file}][reset=yes]} +\stopmode +\startmode[previewpage-letter] + \framed + [width=8.5in,height=11in,offset=overlay,frame=off, + background=color,backgroundcolor=white] + {\externalfigure[\XMLflush{rl:file}][reset=yes]} +\stopmode +\startmode[previewpage-S6] + \framed + [width=600pt,height=450pt,offset=overlay,frame=off, + background=color,backgroundcolor=white] + {\externalfigure[\XMLflush{rl:file}][reset=yes]} +\stopmode +\stopsetups + +\setupbuttons + [offset=10pt, + width=broad, + strut=no, + rulethickness=1pt, + framecolor=darkred] + +\definecolor[XMLRLcolor][white] + +\def\StopFigureB + {\doglobal\increment\CurrentPage + \doifelsenothing{\XMLflush{rl:label}} + {\expanded{\definereference[Figure][\XMLflush{rl:file}]}% + \expanded{\definereference[GridPg][grid:\XMLflush{rl:file}]}} + {\expanded{\definereference[Figure][\XMLflush{rl:label}]}% + \expanded{\definereference[GridPg][grid:\XMLflush{rl:label}]}}% + \button + {\hbox to \hsize + {\forgetall \dontcomplain + \doifelsenothing{\XMLflush{rl:label}} + {\expanded{\pagereference[about:\XMLflush{rl:file}]}} + {\expanded{\pagereference[about:\XMLflush{rl:label}]}}% + % moved here, because descriptions may be absent + \ifnum\CurrentPage=1 \pagereference[begin]\fi + % + \expanded{\writetolist[figurelist]{\CurrentPage}{\XMLflush{rl:label}}}% + \expanded{\figureindex{\CurrentPage}{\XMLflush{rl:label}}}% + \startnotmode[compact]% + \vbox to 100pt + {\hsize30pt + \vskip5pt + \hbox to \hsize{\hss\strut\bf\CurrentPage\hss}% + \vfill}% + \advance\hsize by -30pt + \stopnotmode + \startmode[compact]% + \advance\hsize by -10pt + \hskip10pt + \stopmode + \button % \framed + [width=150pt,height=100pt,offset=10pt,frame=off, + background=color,backgroundcolor=white,color=] + {\externalfigure + [\XMLflush{rl:file}] + %[maxheight=80pt,frame=off,maxwidth=130pt,factor=max]}% + [factor=max]}% + [GridPg]% + \let\FigWid\figurenaturalwidth + \let\FigHei\figurenaturalheight + \advance\hsize by -150pt + \hskip10pt + \advance\hsize by -10pt + \vbox to 100pt + {\hsize40pt + %\externalfigure + % [paper] + % [type=buffer,frame=on, + % framecolor=darkred,rulethickness=.5pt, + % width=40pt,object=no] + \framed + [offset=overlay, + framecolor=darkred, + rulethickness=.5pt] + {\scale[width=40pt]{\setups[paper]}}% + \startmode[compact]% + \vfill + \hbox to \hsize{\hss\strut\bf\CurrentPage\hss}% + \stopmode + \vfill}% + \advance\hsize by -40pt + \hskip10pt + \advance\hsize by -10pt + \vbox to 100pt + {\blank[disable] + \starttabulate[|Bel|p|] + \NC file \NC \XMLflush{rl:file} \NC \NR + \doifXMLdata{rl:label} + {\NC label \NC \XMLflush{rl:label} \NC \NR} + \NC w$\times$h \NC \FigWid$\times$\FigHei \NC \NR + \doifXMLdata{rl:copyright} + {\NC copyright \NC \XMLflush{rl:copyright} \NC \NR} + \doifXMLdata{rl:status} + {\doifelse{\XMLflush{rl:status}}{obsolete} + {\NC status \NC \dontleavehmode \color[darkred]{\bf\XMLflush{rl:status}} \NC \NR} + {\NC status \NC \XMLflush{rl:status} \NC \NR}} + \doifXMLdata{rl:comment} + {\NC comment \NC \XMLflush{rl:comment} \NC \NR} + \stoptabulate + \vfill}}}% + [Figure] + \vskip10pt + \egroup} + +\def\StartFigureC + {\StartFigureA} + +\def\StopFigureC + {\doglobal\increment\NumberOfFigures + \egroup} + +\setuplayout + [topspace=15pt,backspace=15pt, + header=0pt,footer=0pt,bottom=20pt,bottomdistance=10pt, + width=middle,height=fit] + +\setupbackgrounds + [page] + [background=, + backgroundcolor=gray] + +\setupinteractionscreen + [width=max, + height=max] + +\setupcolors + [state=start] + +\setupinteraction + [style=, + color=, + contrastcolor=, + state=start] + +\setuphead + [section] + [style=bfb] + +% \setupbodyfont +% [pos] + +\setupinteractionmenu + [bottom] + [left=\hfill, + middle=\hskip10pt, + frame=off, + style=bold, + background=color, + backgroundcolor=darkred, + foregroundcolor=white] + +\startinteractionmenu[bottom] + \but [begin] begin \\ + \but [index] index \\ + \but [list] list \\ + \but [CloseDocument] close \\ + \but [PreviousJump] go back \\ +\stopinteractionmenu + +\setupinteraction + [openaction=begin] + +\defineXMLenvironment [rl:figurelibrary] \StartLibrary \StopLibrary +\defineXMLenvironment [rl:library] \StartLibrary \StopLibrary + +\starttext + +\def\StartLibrary{\mainlanguage[\XMLpar{rl:library}{language}{en}]} +\def\StopLibrary {} + +\defineXMLignore [rl:description] +\defineXMLenvironment [rl:figure] \StartFigureC \StopFigureC + +\doglobal\newcounter\CurrentPage + +\processXMLfilegrouped{\jobfullname} + +\increment\NumberOfFigures + +\defineXMLignore [rl:description] +\defineXMLenvironment [rl:figure] \StartFigureA \StopFigureA + +\doglobal\newcounter\CurrentPage + +\processXMLfilegrouped{\jobfullname} + +\setuppapersize + [S6][S6] + +\setupbackgrounds + [page] + [background=color] + +\setupinteraction + [menu=on] + +\defineXMLenvironment [rl:description] \StartDescription \StopDescription +\defineXMLenvironment [rl:figure] \StartFigureB \StopFigureB + +\doglobal\newcounter\CurrentPage + +\processXMLfilegrouped{\jobfullname} \page + +\subject [list] {List of figures} + +\placelist[figurelist] \page + +\subject [index] {Index of figures} + +\startcolumns +\placeregister[figureindex] +\stopcolumns + +\doifmodeelse{clipgrid-distance,clipgrid-steps}{\page}{\stoptext} + +\startuniqueMPgraphic{clipgrid}{dx,dy,nx,ny,type} + numeric gdx, gdy, lbx, lby ; + if \MPvar{type}=1 : + gdx := \MPvar{dy} ; + gdy := \MPvar{dx} ; + else : + gdx := OverlayWidth /\MPvar{nx} ; + gdy := OverlayHeight/\MPvar{ny} ; + fi ; + lbx := gdx ; + lby := gdy ; + defaultfont := "\truefontname{Mono}" ; + defaultscale := .5 ; + numeric pen ; pen := .25pt ; + def MyGrid text t = + draw vlingrid (0,OverlayWidth ,gdy,OverlayWidth ,OverlayHeight) t ; + draw hlingrid (0,OverlayHeight,gdx,OverlayHeight,OverlayWidth ) t ; + enddef ; + pickup pencircle scaled pen ; + MyGrid withcolor white ; + MyGrid dashed evenly scaled pen ; + draw OverlayBox withcolor white ; + draw OverlayBox dashed evenly scaled pen ; + draw vlinlabel.bot(0,eps+OverlayWidth /lby,2,OverlayWidth ) ; + draw hlinlabel.lft(0,eps+OverlayHeight/lbx,2,OverlayHeight) ; + setbounds currentpicture to OverlayBox enlarged (2*EmWidth) ; +\stopuniqueMPgraphic + +\presetMPvariable[clipgrid][dx=10pt] +\presetMPvariable[clipgrid][dy=10pt] +\presetMPvariable[clipgrid][nx=10] +\presetMPvariable[clipgrid][ny=10] + +\startmode[clipgrid-distance] + \defineoverlay[grid][\uniqueMPgraphic{clipgrid}{type=1}] +\stopmode + +\startmode[clipgrid-steps] + \defineoverlay[grid][\uniqueMPgraphic{clipgrid}{type=2}] +\stopmode + +\setupexternalfigures + [background={color,foreground,grid}, + backgroundcolor=white] + +\def\StartFigureD + {\StartFigureA} + +\def\StopFigureD + {\doglobal\increment\CurrentPage + \setupbackgrounds[page][background=page] + \startpagefigure[\XMLflush{rl:file}][offset=20pt]% + \doifelsenothing{\XMLflush{rl:label}} + {\expanded{\definereference[Description][about:\XMLflush{rl:file}]}% + \expanded{\pagereference[grid:\XMLflush{rl:file}]}} + {\expanded{\definereference[Description][about:\XMLflush{rl:label}]}% + \expanded{\pagereference[grid:\XMLflush{rl:label}]}} + \stoppagefigure + %\pagefigure[\XMLflush{rl:file}][offset=20pt] + \setupbackgrounds[page][background=] + \egroup} + +\defineXMLignore [rl:description] +\defineXMLenvironment [rl:figure] \StartFigureD \StopFigureD + +\doglobal\newcounter\CurrentPage + +\processXMLfilegrouped{\jobfullname} \page + +\stoptext diff --git a/tex/context/base/x-res-01.tex b/tex/context/base/x-res-01.tex deleted file mode 100644 index dc14e7054..000000000 --- a/tex/context/base/x-res-01.tex +++ /dev/null @@ -1,487 +0,0 @@ -%D \module -%D [ file=x-fig-01, -%D version=2001.03.21, -%D title=\CONTEXT\ Style File, -%D subtitle=Figure Base Generation, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D See \type {x-fig-00.tex} and \type {x-fig-04.tex} for more -%D information on how to use and generate figure databases. -%D This file loads the file named \type {\jobfilename} -%D (\TEXEXEC\ will set this variable). You can apply this -%D style to a database by saying: -%D -%D \starttyping -%D texexec --pdf --use=fig-make yourfile.xml -%D \stoptyping -%D -%D The following modes are supported: -%D -%D \starttabulate[|lT|l|] -%D \NC letter \NC map the preview on letter size \NC \NR -%D \NC compact \NC use an alternative presentation \NC \NR -%D \NC clipgrid-distance \NC add a copy with grid overlayed \NC \NR -%D \NC clipgrid-steps \NC add a copy with grid overlayed \NC \NR -%D \NC previewpage-A4 \NC show graphic relative to A4 \NC \NR -%D \NC previewpage-letter \NC show graphic relative to letter \NC \NR -%D \NC previewpage-S6 \NC show graphic relative to S6 \NC \NR -%D \stoptabulate -%D -%D The resulting file has the following characteristics: -%D -%D \startitemize[packed] -%D \item the document is split into three sections: first each -%D figure is shown at its own page, then an overview of -%D figures is shown with some data alongside, and -%D finally an index and table of contents shows up -%D \item there is no title page, which means that one can -%D access a figure by page number without offset -%D \item the document is opened at the first overview page, -%D that is, when the viewer supports it -%D \item the graphic is shown 3~times: on a page of its own, -%D scaled to a fixed dimension, and relative to a4 or -%D letter paper size -%D \item the labels can be accessed in an index and list at -%D the end of the document -%D \stopitemize -%D -%D We use named destinations, which means that one can -%D access a figure by name from an external application. - -\usemodule[res-00] - -\autoXMLnamespace[rl] - -\setupoutput[pdftex] \overcomePDFspacefalse - -\setjobfullname {xml} % default suffix - -\doifnothing {\jobfullname} {\end} -\doiffileelse {\jobfullname} {} {\end} - -\definesymbol [attachment] [{\bf\color[darkred]{\jobname.xml}}] -\setupattachments [symbol=attachment] -\useattachment [datafile] [\jobname.xml] - -\def\StartDescription - {\bgroup} - -\def\StopDescription - {\subject {Figure collection} - \starttabulate[|lBe|p|] - \doifXMLdataelse{rl:organization} - {\NC organization \NC \XMLflush{rl:organization} \NC \NR}{} - \doifXMLdataelse{rl:project} - {\NC project \NC \XMLflush{rl:project} \NC \NR}{} - \doifXMLdataelse{rl:product} - {\NC product \NC \XMLflush{rl:product} \NC \NR}{} - \doifXMLdataelse{rl:comment} - {\NC comment \NC \XMLflush{rl:comment} \NC \NR}{} - \NC specification \NC \attachment[datafile] \NC \NR - \stoptabulate - \blank[2*big] - \egroup} - - -\def\localexternalfigurereplacement#1#2#3% hack, no reuse of dummies (yet), todo: pass objname - {\doifelsenothing{\XMLflush{rl:label}} - {\edef\FigureName{\XMLflush{rl:label}}} - {\edef\FigureName{\XMLflush{rl:file}}}% - \doifobjectfoundelse{rl}\FigureName - {} - {\setobject{rl}\FigureName\vbox{\normalexternalfigurereplacement{#1}{#2}{#3}}}% - \getobject{rl}\FigureName} - -\startmode[dummy] - - \useMPlibrary[dum] - - \def\StartFigureA - {\bgroup - \XMLassign{rl:file}{dummy}} - - \let\normalexternalfigurereplacement\externalfigurereplacement - \let\externalfigurereplacement \localexternalfigurereplacement - -\stopmode - -\startnotmode[dummy] - - \def\StartFigureA - {\bgroup - \XMLassign{rl:file}{unknown}} - -\stopnotmode - -\startbuffer[unknown] - \framed - [width=\XMLpar{rl:dummy}{width}{12cm}, - height=\XMLpar{rl:dummy}{height}{8cm}, - background=color, - backgroundcolor=gray, - foregroundcolor=darkred, - align={lohi,middle}, % normal, - frame=off] - {\bf \XMLflush{rl:dummy}} -\stopbuffer - -\useexternalfigure[unknown][unknown][type=buffer,object=no] - -\defineoverlay[page][\overlaybutton{Description}] - -% \def\externalfigurereplacement#1#2#3% -% {\getbuffer[rl-unknown]} - -\def\StopFigureA - {\doglobal\increment\CurrentPage - \setupbackgrounds[page][background=page] - \doifelsenothing{\XMLflush{rl:label}} - {\expanded{\definereference[Description][about:\XMLflush{rl:file}]}% - \expanded{\pagereference[\XMLflush{rl:file}]}} - {\expanded{\definereference[Description][about:\XMLflush{rl:label}]}% - \expanded{\pagereference[\XMLflush{rl:label}]}} - \pagefigure[\XMLflush{rl:file}] - \setupbackgrounds[page][background=] - \egroup} - -\def\StartFigureB - {\StartFigureA} - -\defineregister - [figureindex] - [figureindices] - -\setupregister - [figureindex] - [ownnumber=yes, - criterium=text, - interaction=text, - indicator=no] - -\definelist - [figurelist] - -\setuplist - [figurelist] - [criterium=text, - pagenumber=no, - width=2em, - interaction=all] - -\setupcolors - [state=start] - -\setuptolerance - [verytolerant] - -% Ulgy: - -\startmode[letter] % downward compatible - \enablemode[previewpage-letter] -\stopmode - -\startnotmode[previewpage-letter,previewpage-S6] - \enablemode[previewpage-A4] -\stopnotmode - -\startsetups[paper] -\startmode[previewpage-A4] - \framed - [width=210mm,height=297mm,offset=overlay,frame=off, - background=color,backgroundcolor=white] - {\externalfigure[\XMLflush{rl:file}][reset=yes]} -\stopmode -\startmode[previewpage-letter] - \framed - [width=8.5in,height=11in,offset=overlay,frame=off, - background=color,backgroundcolor=white] - {\externalfigure[\XMLflush{rl:file}][reset=yes]} -\stopmode -\startmode[previewpage-S6] - \framed - [width=600pt,height=450pt,offset=overlay,frame=off, - background=color,backgroundcolor=white] - {\externalfigure[\XMLflush{rl:file}][reset=yes]} -\stopmode -\stopsetups - -\setupbuttons - [offset=10pt, - width=broad, - strut=no, - rulethickness=1pt, - framecolor=darkred] - -\definecolor[XMLRLcolor][white] - -\def\StopFigureB - {\doglobal\increment\CurrentPage - \doifelsenothing{\XMLflush{rl:label}} - {\expanded{\definereference[Figure][\XMLflush{rl:file}]}% - \expanded{\definereference[GridPg][grid:\XMLflush{rl:file}]}} - {\expanded{\definereference[Figure][\XMLflush{rl:label}]}% - \expanded{\definereference[GridPg][grid:\XMLflush{rl:label}]}}% - \button - {\hbox to \hsize - {\forgetall \dontcomplain - \doifelsenothing{\XMLflush{rl:label}} - {\expanded{\pagereference[about:\XMLflush{rl:file}]}} - {\expanded{\pagereference[about:\XMLflush{rl:label}]}}% - % moved here, because descriptions may be absent - \ifnum\CurrentPage=1 \pagereference[begin]\fi - % - \expanded{\writetolist[figurelist]{\CurrentPage}{\XMLflush{rl:label}}}% - \expanded{\figureindex{\CurrentPage}{\XMLflush{rl:label}}}% - \startnotmode[compact]% - \vbox to 100pt - {\hsize30pt - \vskip5pt - \hbox to \hsize{\hss\strut\bf\CurrentPage\hss}% - \vfill}% - \advance\hsize by -30pt - \stopnotmode - \startmode[compact]% - \advance\hsize by -10pt - \hskip10pt - \stopmode - \button % \framed - [width=150pt,height=100pt,offset=10pt,frame=off, - background=color,backgroundcolor=white,color=] - {\externalfigure - [\XMLflush{rl:file}] - %[maxheight=80pt,frame=off,maxwidth=130pt,factor=max]}% - [factor=max]}% - [GridPg]% - \let\FigWid\figurenaturalwidth - \let\FigHei\figurenaturalheight - \advance\hsize by -150pt - \hskip10pt - \advance\hsize by -10pt - \vbox to 100pt - {\hsize40pt - %\externalfigure - % [paper] - % [type=buffer,frame=on, - % framecolor=darkred,rulethickness=.5pt, - % width=40pt,object=no] - \framed - [offset=overlay, - framecolor=darkred, - rulethickness=.5pt] - {\scale[width=40pt]{\setups[paper]}}% - \startmode[compact]% - \vfill - \hbox to \hsize{\hss\strut\bf\CurrentPage\hss}% - \stopmode - \vfill}% - \advance\hsize by -40pt - \hskip10pt - \advance\hsize by -10pt - \vbox to 100pt - {\blank[disable] - \starttabulate[|Bel|p|] - \NC file \NC \XMLflush{rl:file} \NC \NR - \doifXMLdata{rl:label} - {\NC label \NC \XMLflush{rl:label} \NC \NR} - \NC w$\times$h \NC \FigWid$\times$\FigHei \NC \NR - \doifXMLdata{rl:copyright} - {\NC copyright \NC \XMLflush{rl:copyright} \NC \NR} - \doifXMLdata{rl:status} - {\doifelse{\XMLflush{rl:status}}{obsolete} - {\NC status \NC \dontleavehmode \color[darkred]{\bf\XMLflush{rl:status}} \NC \NR} - {\NC status \NC \XMLflush{rl:status} \NC \NR}} - \doifXMLdata{rl:comment} - {\NC comment \NC \XMLflush{rl:comment} \NC \NR} - \stoptabulate - \vfill}}}% - [Figure] - \vskip10pt - \egroup} - -\def\StartFigureC - {\StartFigureA} - -\def\StopFigureC - {\doglobal\increment\NumberOfFigures - \egroup} - -\setuplayout - [topspace=15pt,backspace=15pt, - header=0pt,footer=0pt,bottom=20pt,bottomdistance=10pt, - width=middle,height=fit] - -\setupbackgrounds - [page] - [background=, - backgroundcolor=gray] - -\setupinteractionscreen - [width=max, - height=max] - -\setupcolors - [state=start] - -\setupinteraction - [style=, - color=, - contrastcolor=, - state=start] - -\setuphead - [section] - [style=bfb] - -% \setupbodyfont -% [pos] - -\setupinteractionmenu - [bottom] - [left=\hfill, - middle=\hskip10pt, - frame=off, - style=bold, - background=color, - backgroundcolor=darkred, - foregroundcolor=white] - -\startinteractionmenu[bottom] - \but [begin] begin \\ - \but [index] index \\ - \but [list] list \\ - \but [CloseDocument] close \\ - \but [PreviousJump] go back \\ -\stopinteractionmenu - -\setupinteraction - [openaction=begin] - -\defineXMLenvironment [rl:figurelibrary] \StartLibrary \StopLibrary -\defineXMLenvironment [rl:library] \StartLibrary \StopLibrary - -\starttext - -\def\StartLibrary{\mainlanguage[\XMLpar{rl:library}{language}{en}]} -\def\StopLibrary {} - -\defineXMLignore [rl:description] -\defineXMLenvironment [rl:figure] \StartFigureC \StopFigureC - -\doglobal\newcounter\CurrentPage - -\processXMLfilegrouped{\jobfullname} - -\increment\NumberOfFigures - -\defineXMLignore [rl:description] -\defineXMLenvironment [rl:figure] \StartFigureA \StopFigureA - -\doglobal\newcounter\CurrentPage - -\processXMLfilegrouped{\jobfullname} - -\setuppapersize - [S6][S6] - -\setupbackgrounds - [page] - [background=color] - -\setupinteraction - [menu=on] - -\defineXMLenvironment [rl:description] \StartDescription \StopDescription -\defineXMLenvironment [rl:figure] \StartFigureB \StopFigureB - -\doglobal\newcounter\CurrentPage - -\processXMLfilegrouped{\jobfullname} \page - -\subject [list] {List of figures} - -\placelist[figurelist] \page - -\subject [index] {Index of figures} - -\startcolumns -\placeregister[figureindex] -\stopcolumns - -\doifmodeelse{clipgrid-distance,clipgrid-steps}{\page}{\stoptext} - -\startuniqueMPgraphic{clipgrid}{dx,dy,nx,ny,type} - numeric gdx, gdy, lbx, lby ; - if \MPvar{type}=1 : - gdx := \MPvar{dy} ; - gdy := \MPvar{dx} ; - else : - gdx := OverlayWidth /\MPvar{nx} ; - gdy := OverlayHeight/\MPvar{ny} ; - fi ; - lbx := gdx ; - lby := gdy ; - defaultfont := "\truefontname{Mono}" ; - defaultscale := .5 ; - numeric pen ; pen := .25pt ; - def MyGrid text t = - draw vlingrid (0,OverlayWidth ,gdy,OverlayWidth ,OverlayHeight) t ; - draw hlingrid (0,OverlayHeight,gdx,OverlayHeight,OverlayWidth ) t ; - enddef ; - pickup pencircle scaled pen ; - MyGrid withcolor white ; - MyGrid dashed evenly scaled pen ; - draw OverlayBox withcolor white ; - draw OverlayBox dashed evenly scaled pen ; - draw vlinlabel.bot(0,eps+OverlayWidth /lby,2,OverlayWidth ) ; - draw hlinlabel.lft(0,eps+OverlayHeight/lbx,2,OverlayHeight) ; - setbounds currentpicture to OverlayBox enlarged (2*EmWidth) ; -\stopuniqueMPgraphic - -\presetMPvariable[clipgrid][dx=10pt] -\presetMPvariable[clipgrid][dy=10pt] -\presetMPvariable[clipgrid][nx=10] -\presetMPvariable[clipgrid][ny=10] - -\startmode[clipgrid-distance] - \defineoverlay[grid][\uniqueMPgraphic{clipgrid}{type=1}] -\stopmode - -\startmode[clipgrid-steps] - \defineoverlay[grid][\uniqueMPgraphic{clipgrid}{type=2}] -\stopmode - -\setupexternalfigures - [background={color,foreground,grid}, - backgroundcolor=white] - -\def\StartFigureD - {\StartFigureA} - -\def\StopFigureD - {\doglobal\increment\CurrentPage - \setupbackgrounds[page][background=page] - \startpagefigure[\XMLflush{rl:file}][offset=20pt]% - \doifelsenothing{\XMLflush{rl:label}} - {\expanded{\definereference[Description][about:\XMLflush{rl:file}]}% - \expanded{\pagereference[grid:\XMLflush{rl:file}]}} - {\expanded{\definereference[Description][about:\XMLflush{rl:label}]}% - \expanded{\pagereference[grid:\XMLflush{rl:label}]}} - \stoppagefigure - %\pagefigure[\XMLflush{rl:file}][offset=20pt] - \setupbackgrounds[page][background=] - \egroup} - -\defineXMLignore [rl:description] -\defineXMLenvironment [rl:figure] \StartFigureD \StopFigureD - -\doglobal\newcounter\CurrentPage - -\processXMLfilegrouped{\jobfullname} \page - -\stoptext diff --git a/tex/context/base/x-res-02.mkii b/tex/context/base/x-res-02.mkii new file mode 100644 index 000000000..a29f446f3 --- /dev/null +++ b/tex/context/base/x-res-02.mkii @@ -0,0 +1,72 @@ +%D \module +%D [ file=x-res-02, +%D version=2001.03.21, +%D title=\CONTEXT\ Style File, +%D subtitle=Figure Base Inclusion (I), +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This module enables non||\ConTeXt\ users to access the +%D database. For this, you need to run +%D +%D \starttyping +%D texexec --pdf --use=fig-fake yourfile.xml +%D \stoptyping +%D +%D The resulting file, \type {yourfile.fig}, can be loaded +%D in the normal way. The figures can be accessed with: +%D +%D \starttyping +%D \getfigurefile{label} +%D \getfigurepage{label} +%D \stoptyping +%D +%D A a bonus, the following macro is defined: +%D +%D \starttyping +%D \includefigurefile width 10cm {label} +%D \stoptyping + +\usemodule[res-00] + +\doifnothing {\jobfullname} {\end} +\doiffileelse {\jobfullname} {} {\end} + +\defineXMLenvironment [rl:figurelibrary] \StartLibrary \StopLibrary +\defineXMLenvironment [rl:library] \StartLibrary \StopLibrary +\defineXMLenvironment [rl:figure] \StartFigure \StopFigure + +\def\StartLibrary + {\immediate\openout \scratchwrite=\jobfilename.fig + \immediate\write\scratchwrite{\string\input\space x-fig-03.tex \string\relax} + \immediate\write\scratchwrite{}} + +\def\StopLibrary + {\immediate\write\scratchwrite{} + \immediate\write\scratchwrite{\string\endinput} + \immediate\closeout\scratchwrite} + +\def\StartFigure + {\bgroup} + +\def\StopFigure + {\doglobal\increment\CurrentPage + \immediate\write\scratchwrite + {\string\setfiguredata\space + {\XMLpop{rl:label}} + {\jobfilename} + {\CurrentPage}} + \egroup} + +\doglobal\newcounter\CurrentPage + +\starttext + +\processXMLfilegrouped{\jobfullname} + +\stoptext diff --git a/tex/context/base/x-res-02.tex b/tex/context/base/x-res-02.tex deleted file mode 100644 index a29f446f3..000000000 --- a/tex/context/base/x-res-02.tex +++ /dev/null @@ -1,72 +0,0 @@ -%D \module -%D [ file=x-res-02, -%D version=2001.03.21, -%D title=\CONTEXT\ Style File, -%D subtitle=Figure Base Inclusion (I), -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This module enables non||\ConTeXt\ users to access the -%D database. For this, you need to run -%D -%D \starttyping -%D texexec --pdf --use=fig-fake yourfile.xml -%D \stoptyping -%D -%D The resulting file, \type {yourfile.fig}, can be loaded -%D in the normal way. The figures can be accessed with: -%D -%D \starttyping -%D \getfigurefile{label} -%D \getfigurepage{label} -%D \stoptyping -%D -%D A a bonus, the following macro is defined: -%D -%D \starttyping -%D \includefigurefile width 10cm {label} -%D \stoptyping - -\usemodule[res-00] - -\doifnothing {\jobfullname} {\end} -\doiffileelse {\jobfullname} {} {\end} - -\defineXMLenvironment [rl:figurelibrary] \StartLibrary \StopLibrary -\defineXMLenvironment [rl:library] \StartLibrary \StopLibrary -\defineXMLenvironment [rl:figure] \StartFigure \StopFigure - -\def\StartLibrary - {\immediate\openout \scratchwrite=\jobfilename.fig - \immediate\write\scratchwrite{\string\input\space x-fig-03.tex \string\relax} - \immediate\write\scratchwrite{}} - -\def\StopLibrary - {\immediate\write\scratchwrite{} - \immediate\write\scratchwrite{\string\endinput} - \immediate\closeout\scratchwrite} - -\def\StartFigure - {\bgroup} - -\def\StopFigure - {\doglobal\increment\CurrentPage - \immediate\write\scratchwrite - {\string\setfiguredata\space - {\XMLpop{rl:label}} - {\jobfilename} - {\CurrentPage}} - \egroup} - -\doglobal\newcounter\CurrentPage - -\starttext - -\processXMLfilegrouped{\jobfullname} - -\stoptext diff --git a/tex/context/base/x-res-03.mkii b/tex/context/base/x-res-03.mkii new file mode 100644 index 000000000..bf5ea226c --- /dev/null +++ b/tex/context/base/x-res-03.mkii @@ -0,0 +1,44 @@ +%D \module +%D [ file=x-fig-03, +%D version=2001.03.21, +%D title=\CONTEXT\ Style File, +%D subtitle=Figure Base Inclusion (II), +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\ifx \undefined \convertMPtoPDF \input supp-pdf.tex \fi +\ifx \undefined \includefigurefile \else \expandafter \endinput \fi + +\gdef\getfigurefile#1% + {\expandafter\ifx\csname x-fig-f-#1\endcsname\relax + \currentfigurefile + \else + \csname x-fig-f-#1\endcsname + \fi} + +\gdef\getfigurepage#1% + {\expandafter\ifx\csname x-fig-p-#1\endcsname\relax + 1% + \else + \csname x-fig-p-#1\endcsname + \fi} + +\gdef\setfiguredata#1#2#3% + {\gdef\currentfigurefile{#2}% + \expandafter\gdef\csname x-fig-f-#1\endcsname{#2}% + \expandafter\gdef\csname x-fig-p-#1\endcsname{#3}} + +\def\includefigurefile#1#% + {\doincludefigurefile{#1}} + +\def\doincludefigurefile#1#2% + {\edef\next{\noexpand\pdfimage + #1 page \getfigurepage{#2} {\getfigurefile{#2}.pdf}}% + \next} + +\endinput diff --git a/tex/context/base/x-res-03.tex b/tex/context/base/x-res-03.tex deleted file mode 100644 index bf5ea226c..000000000 --- a/tex/context/base/x-res-03.tex +++ /dev/null @@ -1,44 +0,0 @@ -%D \module -%D [ file=x-fig-03, -%D version=2001.03.21, -%D title=\CONTEXT\ Style File, -%D subtitle=Figure Base Inclusion (II), -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\ifx \undefined \convertMPtoPDF \input supp-pdf.tex \fi -\ifx \undefined \includefigurefile \else \expandafter \endinput \fi - -\gdef\getfigurefile#1% - {\expandafter\ifx\csname x-fig-f-#1\endcsname\relax - \currentfigurefile - \else - \csname x-fig-f-#1\endcsname - \fi} - -\gdef\getfigurepage#1% - {\expandafter\ifx\csname x-fig-p-#1\endcsname\relax - 1% - \else - \csname x-fig-p-#1\endcsname - \fi} - -\gdef\setfiguredata#1#2#3% - {\gdef\currentfigurefile{#2}% - \expandafter\gdef\csname x-fig-f-#1\endcsname{#2}% - \expandafter\gdef\csname x-fig-p-#1\endcsname{#3}} - -\def\includefigurefile#1#% - {\doincludefigurefile{#1}} - -\def\doincludefigurefile#1#2% - {\edef\next{\noexpand\pdfimage - #1 page \getfigurepage{#2} {\getfigurefile{#2}.pdf}}% - \next} - -\endinput diff --git a/tex/context/base/x-res-04.mkii b/tex/context/base/x-res-04.mkii new file mode 100644 index 000000000..b5032f550 --- /dev/null +++ b/tex/context/base/x-res-04.mkii @@ -0,0 +1,336 @@ +%D \module +%D [ file=x-fig-04, +%D version=2001.03.21, +%D title=\CONTEXT\ Style File, +%D subtitle=Figure Base Loading, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% hele base laden + +\setXMLfallbackmode3 + +% icon : preview +% caption : \figurebasevariable{caption} +% background : rgb cmyk gray name +% dimensions : width height offset (l,r,t,b) area +% alternative : tag label / evt list +% +% movie +% sound +% applet +% application + +\usemodule[res-00] % basic element definitions + +%D This module implements an interface to a figure database +%D and file. The database is formatted in \XML\ conforming +%D the following \DTD: +%D +%D \typefile{x-fig-00.dtd} +%D +%D A figure base coded this way looks like: +%D +%D \starttyping +%D +%D +%D +%D +%D +%D +%D +%D PRAGMA Advanced Document Engineering +%D Manuals +%D Beginners Manual +%D A bunch of figures. +%D +%D +%D +%D koe.pdf +%D a dutch cow +%D Corel Draw Suite +%D I bet that you've seen this cow before. +%D +%D +%D +%D non existent +%D a european cow +%D Nobody +%D When will we talk about European cows? +%D +%D +%D +%D \stoptyping +%D +%D You can convert this base into a \PDF\ file using +%D \TEXEXEC\ and another module in this suite. +%D +%D \starttyping +%D texexec --pdf --use=fig-make yourfile.xml +%D \stoptyping +%D +%D You can now select a graphic from this file using the +%D +%D \starttyping +%D \externalfigure[a dutch cow][width=4cm] +%D \stoptyping +%D +%D This module overloads this command so that a figure is +%D it first searched in the list of databases. +%D +%D \starttyping +%D \usemodule [fig-base] +%D \usefigurebases[yourfile] +%D \stoptyping +%D +%D The special keyword \type {reset} can be used to reset +%D this list. + +\startcommands dutch english + german czech + italian romanian + + usefigurebase: gebruikfiguurbestand usefigurebase + usefigurebase usefigurebase + usefigurebase usefigurebase + +\stopcommands + +\unprotect + +\consultutilityfilefalse + +% 0 = no loading +% 1 = selective loading +% 2 = full loading + +\chardef\figurebasemode=1 % 2 + +\newcounter\figurefilepage + +% loading a complete figure base + +\startXMLmapping[rl:load] + +\defineXMLenvironmentsave [rl:figure] + {\bgroup} + {\XMLflush{rl:figure} + \doglobal\increment\figurefilepage + \figbase@savedata{\XMLflush{rl:label}}\figurefilepage + \egroup} + +\stopXMLmapping + +\def\loadfigurebase#1% + {\doifnotflagged{rl:#1} + {\writestatus{figbase}{loading #1 into memory}% + \startnointerference + \autoXMLnamespace[rl] + \startXMLmapping[rl:load] + \doglobal\newcounter\figurefilepage + \processXMLfilegrouped{#1.xml} + \stopXMLmapping + \doglobal\setflag{rl:#1} + \stopnointerference}} + +\def\figbase@savedata#1#2% + {%\writestatus{figbase}{data of #1 loaded}% + \doglobal\saveXMLdatastructure{rl:rl:#1}{record}{page="#2"}{}{rl:figure}{}} + +% locating and if needed loading one figure record + +\startXMLmapping[rl:find] + +\defineXMLenvironment[rl:instance] + {\bgroup} + {\doif\askedlabel{\XMLflush{rl:label}} + {\doglobal\saveXMLdata{rl:g:manipulation}{rl:manipulation}% + \doifXMLdata{rl:original} + {\xdef\askedlabel{\XMLflush{rl:original}}}}% + \egroup} + +\defineXMLenvironmentsave [rl:figure] + {\bgroup} + {\XMLflush{rl:figure} + \doglobal\increment\figurefilepage + %\doshowfigurestate{base : comparing \askedlabel\space with \XMLflush{rl:label}}% + \doif\askedlabel{\XMLflush{rl:label}} + {\doshowfigurestate{base label : found \askedlabel}% + \ifnum\figurebasemode=\plusone % load used ones + \figbase@savedata\askedlabel\figurefilepage + \fi + \doglobal\saveXMLdata{rl:l:manipulation}{rl:manipulation}% + \xdef\figurefilelabel {\XMLflush{rl:label}}% + \xdef\figurefilefile {\XMLflush{rl:file}}% + \xdef\figurefileoriginal{\XMLflush{rl:original}}% + \xdef\figurefilename {\XMLflush{rl:file}} + \endinput}% + \egroup} + +\defineXMLenvironment [rl:record] + {} + {\xdef\figurefilename{\XMLpop{rl:file}} + \xdef\figurefilepage{\XMLop {page}}} + +\stopXMLmapping + +\def\getfigurefilename#1#2% + {\ifnum\figurebasemode=\plustwo \loadfigurebase{#1} \fi + \startnointerference + \traceXMLelementsfalse + \resetfigurefilebase + \doglobal\newcounter\figurefilepage + \autoXMLnamespace[rl] + \startXMLmapping[rl:find] + \xdef\figurefilebase{#1}% + \def\askedlabel{#2}% + \doifelseXMLelement{rl:rl:\askedlabel} + {\enableXMLelements\flushXMLelement{rl:rl:\askedlabel}} + {\doshowfigurestate{base path : \figurepathlist}% + \processcommacommand[\figurepathlist]\dogetfigurefilename}% + \stopXMLmapping + \stopnointerference} + +% todo: niet toegekende naam doorgeven aan calculate en pad +% in padstring + +\def\dogetfigurefilename#1% + {\ifx\figurefilename\empty + \bgroup + \doglobal\newcounter\figurefilepage + \globalletempty\figurefilelabel + \globalletempty\figurefileoriginal + \globalletempty\figurefilefile + \xdef\figurefilebasepath{#1}% + \assignfullfilename{#1}{\figurefilebase}\to\filename + \doiffileelse{\filename.xml} + {\doshowfigurestate{base file : \filename}% + \expanded{\processXMLfilegrouped{\filename.xml}}} + \donothing + \ifx\figurefilename\empty \else +% \global\let\figurefilebase\figurefilebase + \globallet\figurefilebase\filename % hm, bad omen that this is needed + \fi + \egroup + \fi} + +\newtoks\figurebaseresets + +\appendtoks + \globalletempty\figurefilebase + \globalletempty\figurefilename + \globalletempty\figurefilebasepath + \globalletempty\figurefilepage + \globalletempty\figurefilelabel + %\globalletempty\figurefileoriginal + %\globalletempty\figurefilefile +\to\figurebaseresets + +\def\resetfigurefilebase + {\the\figurebaseresets} + +\ifx\doshowfigurestate\undefined \let\doshowfigurestate\gobbleoneargument \fi + +\def\doanalyzefiguredimensionsfromfile + {\ifcase\figurestatus \ifx\figurebaselist\empty \else + \resetfigurefilebase + \doshowfigurestate{base list : \figurebaselist}% + \processcommacommand[\figurebaselist]\dodoanalyzefiguredimensionsfromfile + \ifx\figurefilename\empty + \doshowfigurestate{base warning : no matching name found}% + \else + \doiffileelse{\figurefilebase.pdf} + {\doshowfigurestate{base file : \figurefilebase.pdf}% + \doshowfigurestate{base page : \figurefilepage}% + \let\figurepathlist\figurefilebasepath + \analyzefigurefilename{\figurefilebase.pdf}\wantedfigurelabel + \let\wantedfigurepage\figurefilepage} + {\doshowfigurestate{base missing : \figurefilebase.pdf}} + \fi + \ifcase\figurestatus + \analyzefigurefilename\expandedfigurename\wantedfigurelabel + \fi + \fi \fi} + +\def\dodoanalyzefiguredimensionsfromfile#1% + {\doshowfigurestate{base check : \wantedfigurename\space in #1}% + \getfigurefilename{#1}\wantedfigurename + \ifx\figurefilename\empty\else + \quitcommalist + \fi} + +% management + +% will become \useresourcelibrary + +\def\usefigurebase[#1]% + {\doifelse{#1}\v!reset + {\let\figurebaselist\empty} + {\addtocommalist{#1}\figurebaselist}} + +\let\figurebaselist\empty + +\resetfigurefilebase + +% manipulations / todo: fixed order + +\defineXMLsave [rl:manipulation] + +\defineXMLsingular [rl:background] [r=0,g=0,b=0,s=0,c=0,m=0,y=0,k=0] + {\global\setbox\foundexternalfigure\vbox + {\definecolor + [XMLRLcolor] + [r=\XMLop{r},g=\XMLop{g},b=\XMLop{b},s=\XMLop{s},% + c=\XMLop{c},m=\XMLop{m},y=\XMLop{y},k=\XMLop{k}]% + \framed + [\c!frame=\v!off,\c!offset=\v!overlay, + \c!background=\v!color,\c!backgroundcolor=XMLRLcolor] + {\box\foundexternalfigure}}} + +\defineXMLsingular [rl:viewport] [\??cp] % [] + {\global\setbox\foundexternalfigure\vbox + {\expandXMLta \getXMLta + \clip + [\XMLta] + {\box\foundexternalfigure}}% + \global\setbox\foundexternalfigure\vbox + {\scale + [\c!width=\figurewidth,\c!height=\figureheight] + {\box\foundexternalfigure}}} + +\defineXMLsingular [rl:dimensions] [width=,height=] + {} + +\defineXMLsingular [rl:position] [offset=,width=,height=,hoffset=,voffset=] + {} + +\appendtoks + \doglobal\eraseXMLelement{rl:l:manipulation}% + \doglobal\eraseXMLelement{rl:g:manipulation}% +\to \figurebaseresets + +\appendtoks + \startnointerference + \processXMLelement{rl:l:manipulation}% + \processXMLelement{rl:g:manipulation}% + \stopnointerference +\to \externalfigurepostprocessors + +\protect \doifnotmode{demo}{\endinput} + +\starttext + +\setupcolors[state=start] + +\usefigurebase[d-fig-01] + +\externalfigure[part of a dutch cow][width=3cm,frame=on] +\externalfigure[a simple dutch cow][width=5cm,frame=on] +\externalfigure[another simple dutch cow][width=5cm,frame=on] + +\stoptext diff --git a/tex/context/base/x-res-04.tex b/tex/context/base/x-res-04.tex deleted file mode 100644 index b5032f550..000000000 --- a/tex/context/base/x-res-04.tex +++ /dev/null @@ -1,336 +0,0 @@ -%D \module -%D [ file=x-fig-04, -%D version=2001.03.21, -%D title=\CONTEXT\ Style File, -%D subtitle=Figure Base Loading, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% hele base laden - -\setXMLfallbackmode3 - -% icon : preview -% caption : \figurebasevariable{caption} -% background : rgb cmyk gray name -% dimensions : width height offset (l,r,t,b) area -% alternative : tag label / evt list -% -% movie -% sound -% applet -% application - -\usemodule[res-00] % basic element definitions - -%D This module implements an interface to a figure database -%D and file. The database is formatted in \XML\ conforming -%D the following \DTD: -%D -%D \typefile{x-fig-00.dtd} -%D -%D A figure base coded this way looks like: -%D -%D \starttyping -%D -%D -%D -%D -%D -%D -%D -%D PRAGMA Advanced Document Engineering -%D Manuals -%D Beginners Manual -%D A bunch of figures. -%D -%D -%D -%D koe.pdf -%D a dutch cow -%D Corel Draw Suite -%D I bet that you've seen this cow before. -%D -%D -%D -%D non existent -%D a european cow -%D Nobody -%D When will we talk about European cows? -%D -%D -%D -%D \stoptyping -%D -%D You can convert this base into a \PDF\ file using -%D \TEXEXEC\ and another module in this suite. -%D -%D \starttyping -%D texexec --pdf --use=fig-make yourfile.xml -%D \stoptyping -%D -%D You can now select a graphic from this file using the -%D -%D \starttyping -%D \externalfigure[a dutch cow][width=4cm] -%D \stoptyping -%D -%D This module overloads this command so that a figure is -%D it first searched in the list of databases. -%D -%D \starttyping -%D \usemodule [fig-base] -%D \usefigurebases[yourfile] -%D \stoptyping -%D -%D The special keyword \type {reset} can be used to reset -%D this list. - -\startcommands dutch english - german czech - italian romanian - - usefigurebase: gebruikfiguurbestand usefigurebase - usefigurebase usefigurebase - usefigurebase usefigurebase - -\stopcommands - -\unprotect - -\consultutilityfilefalse - -% 0 = no loading -% 1 = selective loading -% 2 = full loading - -\chardef\figurebasemode=1 % 2 - -\newcounter\figurefilepage - -% loading a complete figure base - -\startXMLmapping[rl:load] - -\defineXMLenvironmentsave [rl:figure] - {\bgroup} - {\XMLflush{rl:figure} - \doglobal\increment\figurefilepage - \figbase@savedata{\XMLflush{rl:label}}\figurefilepage - \egroup} - -\stopXMLmapping - -\def\loadfigurebase#1% - {\doifnotflagged{rl:#1} - {\writestatus{figbase}{loading #1 into memory}% - \startnointerference - \autoXMLnamespace[rl] - \startXMLmapping[rl:load] - \doglobal\newcounter\figurefilepage - \processXMLfilegrouped{#1.xml} - \stopXMLmapping - \doglobal\setflag{rl:#1} - \stopnointerference}} - -\def\figbase@savedata#1#2% - {%\writestatus{figbase}{data of #1 loaded}% - \doglobal\saveXMLdatastructure{rl:rl:#1}{record}{page="#2"}{}{rl:figure}{}} - -% locating and if needed loading one figure record - -\startXMLmapping[rl:find] - -\defineXMLenvironment[rl:instance] - {\bgroup} - {\doif\askedlabel{\XMLflush{rl:label}} - {\doglobal\saveXMLdata{rl:g:manipulation}{rl:manipulation}% - \doifXMLdata{rl:original} - {\xdef\askedlabel{\XMLflush{rl:original}}}}% - \egroup} - -\defineXMLenvironmentsave [rl:figure] - {\bgroup} - {\XMLflush{rl:figure} - \doglobal\increment\figurefilepage - %\doshowfigurestate{base : comparing \askedlabel\space with \XMLflush{rl:label}}% - \doif\askedlabel{\XMLflush{rl:label}} - {\doshowfigurestate{base label : found \askedlabel}% - \ifnum\figurebasemode=\plusone % load used ones - \figbase@savedata\askedlabel\figurefilepage - \fi - \doglobal\saveXMLdata{rl:l:manipulation}{rl:manipulation}% - \xdef\figurefilelabel {\XMLflush{rl:label}}% - \xdef\figurefilefile {\XMLflush{rl:file}}% - \xdef\figurefileoriginal{\XMLflush{rl:original}}% - \xdef\figurefilename {\XMLflush{rl:file}} - \endinput}% - \egroup} - -\defineXMLenvironment [rl:record] - {} - {\xdef\figurefilename{\XMLpop{rl:file}} - \xdef\figurefilepage{\XMLop {page}}} - -\stopXMLmapping - -\def\getfigurefilename#1#2% - {\ifnum\figurebasemode=\plustwo \loadfigurebase{#1} \fi - \startnointerference - \traceXMLelementsfalse - \resetfigurefilebase - \doglobal\newcounter\figurefilepage - \autoXMLnamespace[rl] - \startXMLmapping[rl:find] - \xdef\figurefilebase{#1}% - \def\askedlabel{#2}% - \doifelseXMLelement{rl:rl:\askedlabel} - {\enableXMLelements\flushXMLelement{rl:rl:\askedlabel}} - {\doshowfigurestate{base path : \figurepathlist}% - \processcommacommand[\figurepathlist]\dogetfigurefilename}% - \stopXMLmapping - \stopnointerference} - -% todo: niet toegekende naam doorgeven aan calculate en pad -% in padstring - -\def\dogetfigurefilename#1% - {\ifx\figurefilename\empty - \bgroup - \doglobal\newcounter\figurefilepage - \globalletempty\figurefilelabel - \globalletempty\figurefileoriginal - \globalletempty\figurefilefile - \xdef\figurefilebasepath{#1}% - \assignfullfilename{#1}{\figurefilebase}\to\filename - \doiffileelse{\filename.xml} - {\doshowfigurestate{base file : \filename}% - \expanded{\processXMLfilegrouped{\filename.xml}}} - \donothing - \ifx\figurefilename\empty \else -% \global\let\figurefilebase\figurefilebase - \globallet\figurefilebase\filename % hm, bad omen that this is needed - \fi - \egroup - \fi} - -\newtoks\figurebaseresets - -\appendtoks - \globalletempty\figurefilebase - \globalletempty\figurefilename - \globalletempty\figurefilebasepath - \globalletempty\figurefilepage - \globalletempty\figurefilelabel - %\globalletempty\figurefileoriginal - %\globalletempty\figurefilefile -\to\figurebaseresets - -\def\resetfigurefilebase - {\the\figurebaseresets} - -\ifx\doshowfigurestate\undefined \let\doshowfigurestate\gobbleoneargument \fi - -\def\doanalyzefiguredimensionsfromfile - {\ifcase\figurestatus \ifx\figurebaselist\empty \else - \resetfigurefilebase - \doshowfigurestate{base list : \figurebaselist}% - \processcommacommand[\figurebaselist]\dodoanalyzefiguredimensionsfromfile - \ifx\figurefilename\empty - \doshowfigurestate{base warning : no matching name found}% - \else - \doiffileelse{\figurefilebase.pdf} - {\doshowfigurestate{base file : \figurefilebase.pdf}% - \doshowfigurestate{base page : \figurefilepage}% - \let\figurepathlist\figurefilebasepath - \analyzefigurefilename{\figurefilebase.pdf}\wantedfigurelabel - \let\wantedfigurepage\figurefilepage} - {\doshowfigurestate{base missing : \figurefilebase.pdf}} - \fi - \ifcase\figurestatus - \analyzefigurefilename\expandedfigurename\wantedfigurelabel - \fi - \fi \fi} - -\def\dodoanalyzefiguredimensionsfromfile#1% - {\doshowfigurestate{base check : \wantedfigurename\space in #1}% - \getfigurefilename{#1}\wantedfigurename - \ifx\figurefilename\empty\else - \quitcommalist - \fi} - -% management - -% will become \useresourcelibrary - -\def\usefigurebase[#1]% - {\doifelse{#1}\v!reset - {\let\figurebaselist\empty} - {\addtocommalist{#1}\figurebaselist}} - -\let\figurebaselist\empty - -\resetfigurefilebase - -% manipulations / todo: fixed order - -\defineXMLsave [rl:manipulation] - -\defineXMLsingular [rl:background] [r=0,g=0,b=0,s=0,c=0,m=0,y=0,k=0] - {\global\setbox\foundexternalfigure\vbox - {\definecolor - [XMLRLcolor] - [r=\XMLop{r},g=\XMLop{g},b=\XMLop{b},s=\XMLop{s},% - c=\XMLop{c},m=\XMLop{m},y=\XMLop{y},k=\XMLop{k}]% - \framed - [\c!frame=\v!off,\c!offset=\v!overlay, - \c!background=\v!color,\c!backgroundcolor=XMLRLcolor] - {\box\foundexternalfigure}}} - -\defineXMLsingular [rl:viewport] [\??cp] % [] - {\global\setbox\foundexternalfigure\vbox - {\expandXMLta \getXMLta - \clip - [\XMLta] - {\box\foundexternalfigure}}% - \global\setbox\foundexternalfigure\vbox - {\scale - [\c!width=\figurewidth,\c!height=\figureheight] - {\box\foundexternalfigure}}} - -\defineXMLsingular [rl:dimensions] [width=,height=] - {} - -\defineXMLsingular [rl:position] [offset=,width=,height=,hoffset=,voffset=] - {} - -\appendtoks - \doglobal\eraseXMLelement{rl:l:manipulation}% - \doglobal\eraseXMLelement{rl:g:manipulation}% -\to \figurebaseresets - -\appendtoks - \startnointerference - \processXMLelement{rl:l:manipulation}% - \processXMLelement{rl:g:manipulation}% - \stopnointerference -\to \externalfigurepostprocessors - -\protect \doifnotmode{demo}{\endinput} - -\starttext - -\setupcolors[state=start] - -\usefigurebase[d-fig-01] - -\externalfigure[part of a dutch cow][width=3cm,frame=on] -\externalfigure[a simple dutch cow][width=5cm,frame=on] -\externalfigure[another simple dutch cow][width=5cm,frame=on] - -\stoptext diff --git a/tex/context/base/x-res-08.mkii b/tex/context/base/x-res-08.mkii new file mode 100644 index 000000000..3d79b00e4 --- /dev/null +++ b/tex/context/base/x-res-08.mkii @@ -0,0 +1,129 @@ +%D \module +%D [ file=x-fig-08, +%D version=2002.06.27, +%D title=\CONTEXT\ Style File, +%D subtitle=Resource Reporting, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D TODO: make rlxtools callable from texexec (class), speeds up things. + +%D Experimental module! +%D +%D \starttyping +%D +%D +%D figure +%D found|missing +%D filename +%D filesuffix +%D width in pt +%D height in pt +%D text +%D +%D +%D \stoptyping + +\unprotect \doifnotmode{\systemmodeprefix\v!first}{\protect\endinput} + +\def\XMLrlprefix{rl:} + +\newwrite\XMLrllog + +\def\openXMLresourcelog + {\immediate\openout\XMLrllog\jobname.rlg\relax + \immediate\write\XMLrllog{\XMLbanner{standalone='yes'}}% + \immediate\write\XMLrllog{\writtenXMLstart{\XMLrlprefix library}}} + +\def\closeXMLresourcelog + {\immediate\write\XMLrllog{\writtenXMLend{\XMLrlprefix library}}% + \immediate\closeout\XMLrllog} + +\let\figurefilelabel \empty +\let\figurefileoriginal \empty +\let\figurefilefile \empty +\let\figurefilepath \empty +\let\figurefileconversion\empty +\let\figurefileprefix \empty + +\def\XMLfeedbackresource#1#2% + {\begingroup + \defconvertedcommand\currentresourcecomment\currentresourcecomment + \doifnothing\figurefilefile{\edef\figurefilefile{\figurefilename.\figurefiletype}}% + \immediate\write\XMLrllog + {\writtenXMLelement{\XMLrlprefix usage}% + {\writtenXMLelement{\XMLrlprefix type}{#2}% 'figure' not the type in \extenalfigure + \writtenXMLelement{\XMLrlprefix state}{#1}% 'missing' 'found' etc + \ifx\figurefilelabel\empty + \ifx\figurelabel\s!dummy \else % otherwise label equals filename + \writtenXMLelementcs{\XMLrlprefix label}\figurelabel + \fi + \writtenXMLelementcs{\XMLrlprefix file}\figurefilefile % complete name + \writtenXMLelementcs{\XMLrlprefix name}\figurefilename % no suffix + \writtenXMLelementcs{\XMLrlprefix suffix}\figurefiletype + \else + % \figurefilelabel is set in x-res-04 and since + % we fetch from this base using the normal + % \externalfigure macro, the label becomes the + % name of the figurebase + \writtenXMLelementcs{\XMLrlprefix base}\figurefilename + \writtenXMLelementcs{\XMLrlprefix label}\figurefilelabel + \writtenXMLelementcs{\XMLrlprefix file}\figurefilefile + \fi + \writtenXMLelementcs{\XMLrlprefix path}\figurefilepath + \writtenXMLelementcs{\XMLrlprefix original}\figurefileoriginal + \writtenXMLelementcs{\XMLrlprefix conversion}\figurefileconversion + \writtenXMLelementcs{\XMLrlprefix prefix}\figurefileprefix + \writtenXMLelementcs{\XMLrlprefix cache}\figurefilecache + \ifnum\figurefilepage>\zerocount + \writtenXMLelement{\XMLrlprefix page}\figurefilepage + \fi + \writtenXMLelementcs{\XMLrlprefix comment}\currentresourcecomment + \ifconditional\externalfigureflush + \writtenXMLelementcs{\XMLrlprefix width}\figurewidth + \writtenXMLelementcs{\XMLrlprefix height}\figureheight + \fi}}% + \endgroup} + +\def\XMLfeedbackexternalfigure + {\doifmodeelse{*\v!figure}% + {\XMLfeedbackresource{found}}% + {\XMLfeedbackresource{\ifconditional\externalfigureflush missing\else registered\fi}}% + {figure}} + +\setvariables + [rl:manipulate] + [file=rlxtools.rlx] + +% \startsetups[rl:manipulate] +% \doiflocfileelse{\jobname.rlx} +% {\installprogram{texmfstart rlxtools --manipulate kpse:\jobname.rlx \jobname.rlg}} +% {\installprogram{texmfstart rlxtools --manipulate kpse:\getvariabledefault{rl:manipulate}{file}{rlxtools.rlx} \jobname.rlg}} +% \stopsetups +% +% no longer need for \setups[rl:manipulate] + +\ifx\nofconversionfigures\undefined \chardef\nofconversionfigures\plusone \fi + +\appendtoks + \ifcase\nofconversionfigures + \writestatus\m!systems{not registering rlxtools (manipulator)}% + \else + \writestatus\m!systems{registering rlxtools (manipulator)}% + \doiflocfileelse{\jobname.rlx} + {\installprogram{texmfstart rlxtools --manipulate "kpse:\jobname.rlx" "\jobname.rlg"}} + {\installprogram{texmfstart rlxtools --manipulate "kpse:\getvariabledefault{rl:manipulate}{file}{rlxtools.rlx}" "\jobname.rlg"}}% + \fi +\to \everybye % \everylastshipout + +\appendtoks \openXMLresourcelog \to \everystarttext +\appendtoks \closeXMLresourcelog \to \everystoptext + +\let \feedbackexternalfigure \XMLfeedbackexternalfigure + +\protect \endinput diff --git a/tex/context/base/x-res-08.tex b/tex/context/base/x-res-08.tex deleted file mode 100644 index 3d79b00e4..000000000 --- a/tex/context/base/x-res-08.tex +++ /dev/null @@ -1,129 +0,0 @@ -%D \module -%D [ file=x-fig-08, -%D version=2002.06.27, -%D title=\CONTEXT\ Style File, -%D subtitle=Resource Reporting, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D TODO: make rlxtools callable from texexec (class), speeds up things. - -%D Experimental module! -%D -%D \starttyping -%D -%D -%D figure -%D found|missing -%D filename -%D filesuffix -%D width in pt -%D height in pt -%D text -%D -%D -%D \stoptyping - -\unprotect \doifnotmode{\systemmodeprefix\v!first}{\protect\endinput} - -\def\XMLrlprefix{rl:} - -\newwrite\XMLrllog - -\def\openXMLresourcelog - {\immediate\openout\XMLrllog\jobname.rlg\relax - \immediate\write\XMLrllog{\XMLbanner{standalone='yes'}}% - \immediate\write\XMLrllog{\writtenXMLstart{\XMLrlprefix library}}} - -\def\closeXMLresourcelog - {\immediate\write\XMLrllog{\writtenXMLend{\XMLrlprefix library}}% - \immediate\closeout\XMLrllog} - -\let\figurefilelabel \empty -\let\figurefileoriginal \empty -\let\figurefilefile \empty -\let\figurefilepath \empty -\let\figurefileconversion\empty -\let\figurefileprefix \empty - -\def\XMLfeedbackresource#1#2% - {\begingroup - \defconvertedcommand\currentresourcecomment\currentresourcecomment - \doifnothing\figurefilefile{\edef\figurefilefile{\figurefilename.\figurefiletype}}% - \immediate\write\XMLrllog - {\writtenXMLelement{\XMLrlprefix usage}% - {\writtenXMLelement{\XMLrlprefix type}{#2}% 'figure' not the type in \extenalfigure - \writtenXMLelement{\XMLrlprefix state}{#1}% 'missing' 'found' etc - \ifx\figurefilelabel\empty - \ifx\figurelabel\s!dummy \else % otherwise label equals filename - \writtenXMLelementcs{\XMLrlprefix label}\figurelabel - \fi - \writtenXMLelementcs{\XMLrlprefix file}\figurefilefile % complete name - \writtenXMLelementcs{\XMLrlprefix name}\figurefilename % no suffix - \writtenXMLelementcs{\XMLrlprefix suffix}\figurefiletype - \else - % \figurefilelabel is set in x-res-04 and since - % we fetch from this base using the normal - % \externalfigure macro, the label becomes the - % name of the figurebase - \writtenXMLelementcs{\XMLrlprefix base}\figurefilename - \writtenXMLelementcs{\XMLrlprefix label}\figurefilelabel - \writtenXMLelementcs{\XMLrlprefix file}\figurefilefile - \fi - \writtenXMLelementcs{\XMLrlprefix path}\figurefilepath - \writtenXMLelementcs{\XMLrlprefix original}\figurefileoriginal - \writtenXMLelementcs{\XMLrlprefix conversion}\figurefileconversion - \writtenXMLelementcs{\XMLrlprefix prefix}\figurefileprefix - \writtenXMLelementcs{\XMLrlprefix cache}\figurefilecache - \ifnum\figurefilepage>\zerocount - \writtenXMLelement{\XMLrlprefix page}\figurefilepage - \fi - \writtenXMLelementcs{\XMLrlprefix comment}\currentresourcecomment - \ifconditional\externalfigureflush - \writtenXMLelementcs{\XMLrlprefix width}\figurewidth - \writtenXMLelementcs{\XMLrlprefix height}\figureheight - \fi}}% - \endgroup} - -\def\XMLfeedbackexternalfigure - {\doifmodeelse{*\v!figure}% - {\XMLfeedbackresource{found}}% - {\XMLfeedbackresource{\ifconditional\externalfigureflush missing\else registered\fi}}% - {figure}} - -\setvariables - [rl:manipulate] - [file=rlxtools.rlx] - -% \startsetups[rl:manipulate] -% \doiflocfileelse{\jobname.rlx} -% {\installprogram{texmfstart rlxtools --manipulate kpse:\jobname.rlx \jobname.rlg}} -% {\installprogram{texmfstart rlxtools --manipulate kpse:\getvariabledefault{rl:manipulate}{file}{rlxtools.rlx} \jobname.rlg}} -% \stopsetups -% -% no longer need for \setups[rl:manipulate] - -\ifx\nofconversionfigures\undefined \chardef\nofconversionfigures\plusone \fi - -\appendtoks - \ifcase\nofconversionfigures - \writestatus\m!systems{not registering rlxtools (manipulator)}% - \else - \writestatus\m!systems{registering rlxtools (manipulator)}% - \doiflocfileelse{\jobname.rlx} - {\installprogram{texmfstart rlxtools --manipulate "kpse:\jobname.rlx" "\jobname.rlg"}} - {\installprogram{texmfstart rlxtools --manipulate "kpse:\getvariabledefault{rl:manipulate}{file}{rlxtools.rlx}" "\jobname.rlg"}}% - \fi -\to \everybye % \everylastshipout - -\appendtoks \openXMLresourcelog \to \everystarttext -\appendtoks \closeXMLresourcelog \to \everystoptext - -\let \feedbackexternalfigure \XMLfeedbackexternalfigure - -\protect \endinput diff --git a/tex/context/base/x-res-09.mkii b/tex/context/base/x-res-09.mkii new file mode 100644 index 000000000..608236156 --- /dev/null +++ b/tex/context/base/x-res-09.mkii @@ -0,0 +1,69 @@ +%D \module +%D [ file=x-fig-09, +%D version=2002.06.27, +%D title=\CONTEXT\ Style File, +%D subtitle=Resource Reporting (2), +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\usemodule[res-00] + +\defineXMLenvironment [rl:library] + {\starttext} + {\stoptext} + +\defineXMLenvironment [rl:usage] + {\bgroup} + {\doifnot{\XMLflush{rl:file}}{dummy}{\setups[rl:usage]}% + \egroup} + +\defineXMLsave [rl:base] % base +\defineXMLsave [rl:type] % figure +\defineXMLsave [rl:state] % found|missing +\defineXMLsave [rl:label] % label +\defineXMLsave [rl:file] % filename +\defineXMLsave [rl:suffix] % filesuffix +\defineXMLsave [rl:comment] % text +\defineXMLsave [rl:width] % width in pt +\defineXMLsave [rl:height] % height in pt +\defineXMLsave [rl:page] % page from file + +\def\XMLbpentry#1% + {\PointsToWholeBigPoints{\XMLflush{#1}}\temp\temp bp} + +% \def\XMLrlentry#1#2#3% +% {\doiftextelse{\XMLflush{#2}} +% {\NC\bf#1\NC\XMLflush{#2}\doif{#3}{1}{ (\XMLbpentry{#2})}\NC\NR} +% {}} + +\def\XMLrlentry#1#2#3% + {\tableiftextelse{\XMLflush{#2}} + {\NC\bf#1\NC\XMLflush{#2}\doif{#3}{1}{ (\XMLbpentry{#2})}\NC\NR}{}} + +\startsetups[rl:usage] + +% by using a dedicated tabulation, we permit usage in dutch interface + +\definetabulate[XMLRLG][|lw(4.5em)|p|] + +\startXMLRLG + \XMLrlentry {base} {rl:base} {0} + \XMLrlentry {type} {rl:type} {0} + \XMLrlentry {state} {rl:state} {0} + \XMLrlentry {file} {rl:file} {0} + \XMLrlentry {label} {rl:label} {0} + \XMLrlentry {suffix} {rl:suffix} {0} + \XMLrlentry {page} {rl:page} {0} + \XMLrlentry {width} {rl:width} {1} + \XMLrlentry {height} {rl:height} {1} + \XMLrlentry {comment}{rl:comment}{0} +\stopXMLRLG + +\stopsetups + +\endinput diff --git a/tex/context/base/x-res-09.tex b/tex/context/base/x-res-09.tex deleted file mode 100644 index 608236156..000000000 --- a/tex/context/base/x-res-09.tex +++ /dev/null @@ -1,69 +0,0 @@ -%D \module -%D [ file=x-fig-09, -%D version=2002.06.27, -%D title=\CONTEXT\ Style File, -%D subtitle=Resource Reporting (2), -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\usemodule[res-00] - -\defineXMLenvironment [rl:library] - {\starttext} - {\stoptext} - -\defineXMLenvironment [rl:usage] - {\bgroup} - {\doifnot{\XMLflush{rl:file}}{dummy}{\setups[rl:usage]}% - \egroup} - -\defineXMLsave [rl:base] % base -\defineXMLsave [rl:type] % figure -\defineXMLsave [rl:state] % found|missing -\defineXMLsave [rl:label] % label -\defineXMLsave [rl:file] % filename -\defineXMLsave [rl:suffix] % filesuffix -\defineXMLsave [rl:comment] % text -\defineXMLsave [rl:width] % width in pt -\defineXMLsave [rl:height] % height in pt -\defineXMLsave [rl:page] % page from file - -\def\XMLbpentry#1% - {\PointsToWholeBigPoints{\XMLflush{#1}}\temp\temp bp} - -% \def\XMLrlentry#1#2#3% -% {\doiftextelse{\XMLflush{#2}} -% {\NC\bf#1\NC\XMLflush{#2}\doif{#3}{1}{ (\XMLbpentry{#2})}\NC\NR} -% {}} - -\def\XMLrlentry#1#2#3% - {\tableiftextelse{\XMLflush{#2}} - {\NC\bf#1\NC\XMLflush{#2}\doif{#3}{1}{ (\XMLbpentry{#2})}\NC\NR}{}} - -\startsetups[rl:usage] - -% by using a dedicated tabulation, we permit usage in dutch interface - -\definetabulate[XMLRLG][|lw(4.5em)|p|] - -\startXMLRLG - \XMLrlentry {base} {rl:base} {0} - \XMLrlentry {type} {rl:type} {0} - \XMLrlentry {state} {rl:state} {0} - \XMLrlentry {file} {rl:file} {0} - \XMLrlentry {label} {rl:label} {0} - \XMLrlentry {suffix} {rl:suffix} {0} - \XMLrlentry {page} {rl:page} {0} - \XMLrlentry {width} {rl:width} {1} - \XMLrlentry {height} {rl:height} {1} - \XMLrlentry {comment}{rl:comment}{0} -\stopXMLRLG - -\stopsetups - -\endinput diff --git a/tex/context/base/x-res-10.mkii b/tex/context/base/x-res-10.mkii new file mode 100644 index 000000000..f23c50358 --- /dev/null +++ b/tex/context/base/x-res-10.mkii @@ -0,0 +1,75 @@ +%D \module +%D [ file=x-fig-10, +%D version=2003.08.02, +%D title=\CONTEXT\ Style File, +%D subtitle=Resource Dummy Generation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\usemodule[res-00] + +\defineXMLenvironment [rl:library] + {\starttext} + {\stoptext} + +\defineXMLenvironment [rl:usage] + {\bgroup} + {\doif{\XMLflush{rl:type}-\XMLflush{rl:state}}{figure-missing} + {\doifnot{\XMLflush{rl:file}}{dummy}{\setups[rl:usage]}} + \egroup} + +\defineXMLsave [rl:type] % figure +\defineXMLsave [rl:state] % found|missing +\defineXMLsave [rl:file] % filename + +\defineXMLsavecontent [rl:width] {12cm} % width in pt +\defineXMLsavecontent [rl:height] {9cm} % height in pt + +\useMPlibrary + [dum] + +\setupcolors + [state=start] + +\defineoverlay + [rl:banner] + [\setups{rl:banner}] + +\startsetups[rl:banner] + + \framed [frame=off,offset=none,align={lohi,middle}] + \bgroup + \tt \white \XMLflush{rl:file} + \egroup + +\stopsetups + +\startsetups[rl:usage] + + \startTEXpage + + % \externalfigure + % [\XMLflush{rl:file}] % goes wrong when file present + % [object=no, + % backgroundcolor=green,background={foreground,color,rl:banner}, + % width=\XMLflush{rl:width}, + % height=\XMLflush{rl:height}] + + \def\figurewidth {\XMLflush{rl:width}} + \def\figureheight{\XMLflush{rl:height}} + + \externalfigurereplacement + {\XMLflush{rl:file}} + {\XMLflush{rl:file}} + {\XMLflush{rl:state}} + + \stopTEXpage + +\stopsetups + +\endinput diff --git a/tex/context/base/x-res-10.tex b/tex/context/base/x-res-10.tex deleted file mode 100644 index f23c50358..000000000 --- a/tex/context/base/x-res-10.tex +++ /dev/null @@ -1,75 +0,0 @@ -%D \module -%D [ file=x-fig-10, -%D version=2003.08.02, -%D title=\CONTEXT\ Style File, -%D subtitle=Resource Dummy Generation, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\usemodule[res-00] - -\defineXMLenvironment [rl:library] - {\starttext} - {\stoptext} - -\defineXMLenvironment [rl:usage] - {\bgroup} - {\doif{\XMLflush{rl:type}-\XMLflush{rl:state}}{figure-missing} - {\doifnot{\XMLflush{rl:file}}{dummy}{\setups[rl:usage]}} - \egroup} - -\defineXMLsave [rl:type] % figure -\defineXMLsave [rl:state] % found|missing -\defineXMLsave [rl:file] % filename - -\defineXMLsavecontent [rl:width] {12cm} % width in pt -\defineXMLsavecontent [rl:height] {9cm} % height in pt - -\useMPlibrary - [dum] - -\setupcolors - [state=start] - -\defineoverlay - [rl:banner] - [\setups{rl:banner}] - -\startsetups[rl:banner] - - \framed [frame=off,offset=none,align={lohi,middle}] - \bgroup - \tt \white \XMLflush{rl:file} - \egroup - -\stopsetups - -\startsetups[rl:usage] - - \startTEXpage - - % \externalfigure - % [\XMLflush{rl:file}] % goes wrong when file present - % [object=no, - % backgroundcolor=green,background={foreground,color,rl:banner}, - % width=\XMLflush{rl:width}, - % height=\XMLflush{rl:height}] - - \def\figurewidth {\XMLflush{rl:width}} - \def\figureheight{\XMLflush{rl:height}} - - \externalfigurereplacement - {\XMLflush{rl:file}} - {\XMLflush{rl:file}} - {\XMLflush{rl:state}} - - \stopTEXpage - -\stopsetups - -\endinput diff --git a/tex/context/base/x-res-11.mkii b/tex/context/base/x-res-11.mkii new file mode 100644 index 000000000..b8569d22e --- /dev/null +++ b/tex/context/base/x-res-11.mkii @@ -0,0 +1,110 @@ +%D \module +%D [ file=x-fig-11, +%D version=2003.02.08, +%D title=\CONTEXT\ Style File, +%D subtitle=Resource Reporting (3), +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\usemodule[res-00] + +\defineXMLenvironment [rl:library] + {\starttext + \doiffileelse{\outputfilename.zip}{\setups[rl:attach]}{} + \disablemode[rl:used]} + {\doifnotmode{rl:used}{No images processed.} + \page + \stoptext} + +\defineXMLenvironment [rl:usage] + {\bgroup} + {\doifnot{\XMLflush{rl:file}}{dummy} + {\setups[rl:usage] + \enablemode[rl:used]} + \egroup} + +\defineXMLsave [rl:base] % base +\defineXMLsave [rl:type] % figure +\defineXMLsave [rl:state] % found|missing +\defineXMLsave [rl:label] % label +\defineXMLsave [rl:file] % filename +\defineXMLsave [rl:suffix] % filesuffix +\defineXMLsave [rl:comment] % text +\defineXMLsave [rl:width] % width in pt +\defineXMLsave [rl:height] % height in pt +\defineXMLsave [rl:page] % page from file + +\def\XMLbpentry#1% + {\PointsToWholeBigPoints{\XMLflush{#1}}\temp\temp bp} + +\def\XMLrlentry#1#2#3% + {\tableiftextelse{\XMLflush{#2}} + {\NC\bf#1\NC\XMLflush{#2}\doif{#3}{1}{ (\XMLbpentry{#2})}\NC\NR}{}} + +\unprotect + +\setuplayout[\v!middle] + +\startsetups[rl:figure] + + \externalfigure[\XMLflush{rl:file}][\c!width=4cm] + +\stopsetups + +\startsetups[rl:table] + +% by using a dedicated tabulation, we permit usage in dutch interface + +\definetabulate[XMLRLG][|lw(4.5em)|p|] + +\startXMLRLG + \XMLrlentry {base} {rl:base} {0} + \XMLrlentry {type} {rl:type} {0} + \XMLrlentry {state} {rl:state} {0} + \XMLrlentry {file} {rl:file} {0} + \XMLrlentry {label} {rl:label} {0} + \XMLrlentry {suffix} {rl:suffix} {0} + \XMLrlentry {page} {rl:page} {0} + \XMLrlentry {width} {rl:width} {1} + \XMLrlentry {height} {rl:height} {1} + \XMLrlentry {comment}{rl:comment}{0} +\stopXMLRLG + +\stopsetups + +\startsetups[rl:usage] + + \startfiguretext {\v!none} {\setups[rl:figure]} + \setups[rl:table] + \stopfiguretext + +\stopsetups + +\startsetups[rl:attach] + + \useMPlibrary[nav] + + \setupcolors[\c!state=\v!start] + + \setupinteraction[\c!state=\v!start] + + \useattachment[whatever][\outputfilename.zip] + + \startlocalsetups[rl:attach:button] + + \inframed + [\c!offset=\v!overlay,\c!frame=\v!off] + {\attachment[whatever]} + + \stoplocalsetups + + \setupfootertexts[archive with dummies: \setups{rl:attach:button}] + +\stopsetups + +\protect \endinput diff --git a/tex/context/base/x-res-11.tex b/tex/context/base/x-res-11.tex deleted file mode 100644 index b8569d22e..000000000 --- a/tex/context/base/x-res-11.tex +++ /dev/null @@ -1,110 +0,0 @@ -%D \module -%D [ file=x-fig-11, -%D version=2003.02.08, -%D title=\CONTEXT\ Style File, -%D subtitle=Resource Reporting (3), -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\usemodule[res-00] - -\defineXMLenvironment [rl:library] - {\starttext - \doiffileelse{\outputfilename.zip}{\setups[rl:attach]}{} - \disablemode[rl:used]} - {\doifnotmode{rl:used}{No images processed.} - \page - \stoptext} - -\defineXMLenvironment [rl:usage] - {\bgroup} - {\doifnot{\XMLflush{rl:file}}{dummy} - {\setups[rl:usage] - \enablemode[rl:used]} - \egroup} - -\defineXMLsave [rl:base] % base -\defineXMLsave [rl:type] % figure -\defineXMLsave [rl:state] % found|missing -\defineXMLsave [rl:label] % label -\defineXMLsave [rl:file] % filename -\defineXMLsave [rl:suffix] % filesuffix -\defineXMLsave [rl:comment] % text -\defineXMLsave [rl:width] % width in pt -\defineXMLsave [rl:height] % height in pt -\defineXMLsave [rl:page] % page from file - -\def\XMLbpentry#1% - {\PointsToWholeBigPoints{\XMLflush{#1}}\temp\temp bp} - -\def\XMLrlentry#1#2#3% - {\tableiftextelse{\XMLflush{#2}} - {\NC\bf#1\NC\XMLflush{#2}\doif{#3}{1}{ (\XMLbpentry{#2})}\NC\NR}{}} - -\unprotect - -\setuplayout[\v!middle] - -\startsetups[rl:figure] - - \externalfigure[\XMLflush{rl:file}][\c!width=4cm] - -\stopsetups - -\startsetups[rl:table] - -% by using a dedicated tabulation, we permit usage in dutch interface - -\definetabulate[XMLRLG][|lw(4.5em)|p|] - -\startXMLRLG - \XMLrlentry {base} {rl:base} {0} - \XMLrlentry {type} {rl:type} {0} - \XMLrlentry {state} {rl:state} {0} - \XMLrlentry {file} {rl:file} {0} - \XMLrlentry {label} {rl:label} {0} - \XMLrlentry {suffix} {rl:suffix} {0} - \XMLrlentry {page} {rl:page} {0} - \XMLrlentry {width} {rl:width} {1} - \XMLrlentry {height} {rl:height} {1} - \XMLrlentry {comment}{rl:comment}{0} -\stopXMLRLG - -\stopsetups - -\startsetups[rl:usage] - - \startfiguretext {\v!none} {\setups[rl:figure]} - \setups[rl:table] - \stopfiguretext - -\stopsetups - -\startsetups[rl:attach] - - \useMPlibrary[nav] - - \setupcolors[\c!state=\v!start] - - \setupinteraction[\c!state=\v!start] - - \useattachment[whatever][\outputfilename.zip] - - \startlocalsetups[rl:attach:button] - - \inframed - [\c!offset=\v!overlay,\c!frame=\v!off] - {\attachment[whatever]} - - \stoplocalsetups - - \setupfootertexts[archive with dummies: \setups{rl:attach:button}] - -\stopsetups - -\protect \endinput diff --git a/tex/context/base/x-res-12.mkii b/tex/context/base/x-res-12.mkii new file mode 100644 index 000000000..1cff48717 --- /dev/null +++ b/tex/context/base/x-res-12.mkii @@ -0,0 +1,53 @@ +%D \module +%D [ file=x-fig-12, +%D version=2005.05.05, +%D title=\CONTEXT\ Style File, +%D subtitle=Resource Checking, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This module implements the dimension checking using \RLXTOOLS. + +\unprotect + +\chardef\figurerlxmode\plusone % rlx permitted + +\startXMLmapping[rli] + \defineXMLprocess[rl:identify] + \defineXMLsavecontent[rl:width] {\!!zeropoint} + \defineXMLsavecontent[rl:height]{\!!zeropoint} +\stopXMLmapping + +\def\doanalyzefiguredimensionsrlx + {\ifcase\figurestatus \ifcase\figurerlxmode \else + \doifnotfile{\wantedfigurefullname.rli} + {% let's try runtime running first + \doshowfiguremessage6\wantedfigurefullname + \executesystemcommand{texmfstart rlxtools --identify \wantedfigurefullname}}% + \doifnotfile{\wantedfigurefullname.rli} + {% we assume that runtime running failed + \doshowfiguremessage6\wantedfigurefullname + \installprogram{texmfstart rlxtools --identify \wantedfigurefullname}}% + \doiffile{\wantedfigurefullname.rli} + {\global\let\analyzedfigurewidth \!!zeropoint + \global\let\analyzedfigureheight\!!zeropoint + \startnointerference % groups + \startXMLmapping[rli]% + \startXMLignore + \processXMLfile{\wantedfigurefullname.rli}% + \xdef\analyzedfigurewidth {\the\dimexpr\XMLflush{rl:width} \relax}% turn whatever into pt + \xdef\analyzedfigureheight{\the\dimexpr\XMLflush{rl:height}\relax}% turn whatever into pt + \stopXMLignore + \stopXMLmapping + \stopnointerference + \setanalyzedfiguredimensions\!!twelve}% + \fi\fi} + +\let\doanalyzefiguredimensionsexternal\doanalyzefiguredimensionsrlx + +\protect \endinput diff --git a/tex/context/base/x-res-12.tex b/tex/context/base/x-res-12.tex deleted file mode 100644 index 1cff48717..000000000 --- a/tex/context/base/x-res-12.tex +++ /dev/null @@ -1,53 +0,0 @@ -%D \module -%D [ file=x-fig-12, -%D version=2005.05.05, -%D title=\CONTEXT\ Style File, -%D subtitle=Resource Checking, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This module implements the dimension checking using \RLXTOOLS. - -\unprotect - -\chardef\figurerlxmode\plusone % rlx permitted - -\startXMLmapping[rli] - \defineXMLprocess[rl:identify] - \defineXMLsavecontent[rl:width] {\!!zeropoint} - \defineXMLsavecontent[rl:height]{\!!zeropoint} -\stopXMLmapping - -\def\doanalyzefiguredimensionsrlx - {\ifcase\figurestatus \ifcase\figurerlxmode \else - \doifnotfile{\wantedfigurefullname.rli} - {% let's try runtime running first - \doshowfiguremessage6\wantedfigurefullname - \executesystemcommand{texmfstart rlxtools --identify \wantedfigurefullname}}% - \doifnotfile{\wantedfigurefullname.rli} - {% we assume that runtime running failed - \doshowfiguremessage6\wantedfigurefullname - \installprogram{texmfstart rlxtools --identify \wantedfigurefullname}}% - \doiffile{\wantedfigurefullname.rli} - {\global\let\analyzedfigurewidth \!!zeropoint - \global\let\analyzedfigureheight\!!zeropoint - \startnointerference % groups - \startXMLmapping[rli]% - \startXMLignore - \processXMLfile{\wantedfigurefullname.rli}% - \xdef\analyzedfigurewidth {\the\dimexpr\XMLflush{rl:width} \relax}% turn whatever into pt - \xdef\analyzedfigureheight{\the\dimexpr\XMLflush{rl:height}\relax}% turn whatever into pt - \stopXMLignore - \stopXMLmapping - \stopnointerference - \setanalyzedfiguredimensions\!!twelve}% - \fi\fi} - -\let\doanalyzefiguredimensionsexternal\doanalyzefiguredimensionsrlx - -\protect \endinput diff --git a/tex/context/base/x-res-20.mkii b/tex/context/base/x-res-20.mkii new file mode 100644 index 000000000..3ff069ffd --- /dev/null +++ b/tex/context/base/x-res-20.mkii @@ -0,0 +1,231 @@ +%D \module +%D [ file=x-res-20, +%D version=2006.08.20, +%D title=\CONTEXT\ Style File, +%D subtitle=Figure Lists, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D For the beginning we have used \TEXUTIL\ to hels us deal with +%D graphics whose dimensions could not be determines and|/|or to +%D provide placeholder info for graphics that were not available. +%D Much of this functionality is now moved to \RLXTOOLS\ and +%D therefore it makes sense to reimplement the code that deals with +%D producing an overview of grapghics as well. At the same time we +%D move some \TEX\ code from \TEXEXEC\ to here. +%D +%D Because the show commands are not used in real documents, but +%D only for special purposed, it does not harm that this +%D functionality is now part of a module. We no longer use the +%D parsing code in \TEXUTIL, but rely on \IMAGEMAGICK's +%D identify functionility. +%D +%D At the end of the file we kept the old code from \type {core-fig}. + +\unprotect + +\startXMLmapping[rlx:list] + + \defineXMLprocess + [rl:identification] + + \defineXMLenvironment + [rl:identify] [name=] + {\bgroup\ignorespaces} + {\removeunwantedspaces\doRLhandlegraphic\egroup} + + \defineXMLsave[rl:size] + \defineXMLsave[rl:path] + \defineXMLsave[rl:width] + \defineXMLsave[rl:height] + +\stopXMLmapping + +\def\showexternalfigures + {\dosingleempty\doshowexternalfigures} + +\let\doRLhandlegraphic\relax +\let\doRLstartgraphics\relax +\let\doRLstopgraphics \relax + +\let\RLfigurewidth \empty +\let\RLfigureheight\empty +\let\RLfiguresize \empty +\let\RLfigurefile \empty + +\def\doRLpresetgraphic + {\edef\RLfigurewidth {\the\dimexpr \XMLflush{rl:width}\relax}% + \edef\RLfigureheight{\the\dimexpr \XMLflush{rl:height}\relax}% + \edef\RLfiguresize {\the\numexpr0\XMLflush{rl:size}\relax}% + \edef\RLfigurefile {\XMLpar{rl:identify}{name}{unknown}}} + +\def\doshowexternalfigures[#1]% + {\bgroup + \dontcomplain + \setupcolors[\c!state=\v!start]% to prevent mps color conversion + \getparameters[\??ex][\c!file=rlxtools.rli,\c!alternative=a,\c!offset=\!!zeropoint,\c!size=,#1]% + \getvalue{\strippedcsname\doRLhandlegraphic\@@exalternative}% + \startXMLmapping[rlx:list]% + \startXMLignore + \doRLstartgraphics + \processXMLfilegrouped{\@@exfile}% \readjobfile\@@exfile\donothing\donothing + \doRLstopgraphics + \stopXMLignore + \stopXMLmapping + \egroup} + +\def\doRLhandlegraphica + {\def\doRLhandlegraphic + {\doRLpresetgraphic + \getvalue{\e!start\v!figure\e!text}[\v!left,\v!none][] + {} + {\hbox + {\externalfigure[\RLfigurefile][\c!frame=\v!on,\c!width=6cm,\c!size=\@@exsize]% + \quad + \framed[\c!width=\figurewidth,\c!height=\figureheight]{}% + \quad}}% + {\hbox{\tt\tfa\setstrut\strut\expanded{\asciistr{\RLfigurefile}}}}% + \blank + \tfx + \starttabulate[|l|l|] + \NC width \EQ \RLfigurewidth \NC \NR + \NC height \EQ \RLfigureheight \NC \NR + \NC size \EQ \RLfiguresize \NC \NR + \stoptabulate + \getvalue{\e!stop\v!figure\e!text}}} + +\def\doRLhandlegraphicb + {\def\doRLhandlegraphic + {\dontleavehmode + \vbox + {\doRLpresetgraphic + \hsize\dimexpr.2\hsize-.8em\relax + \cbox{\externalfigure[\RLfigurefile][\c!frame=\v!on,\c!factor=\v!max,\c!width=\hsize,\c!size=\@@exsize]}% + \vskip.5\lineheight + \midaligned{\tttf\RLfigurefile}}% + \vadjust{\vskip.2\lineheight}% + \quad\allowbreak}} + +\def\doRLhandlegraphicc + {\def\doRLhandlegraphic + {\doRLpresetgraphic + \pagefigure[\RLfigurefile]}} + +\def\doRLhandlegraphicd % this one builds a dimension file for metapost/metafun + {\def\doRLstartgraphics + {\immediate\openout\scratchwrite=mpfigs.mp\relax + \immediate\write\scratchwrite{\letterpercent\space graphic dimension file for metapost/metafun}}% + \def\doRLstopgraphics + {\immediate\closeout\scratchwrite}% + \def\doRLhandlegraphic + {\doRLpresetgraphic + \immediate\write\scratchwrite{registerfigure("\RLfigurefile",\RLfigurewidth,\RLfigureheight);}}} + +% \showexternalfigures[alternative=b] + +\protect \endinput + +%D Old code: + +\def\doshowexternalfigures[#1]% + {\bgroup + \setupcolors[\c!state=\v!start]% to prevent mps color conversion + \getparameters[\??ex][\c!alternative=a,\c!offset=\!!zeropoint,\c!size=,#1]% + \getvalue{\strippedcsname\showexternalfigure\@@exalternative}% + \egroup} + +\def\showexternalfigures + {\dosingleempty\doshowexternalfigures} + +\def\showexternalfigurea + {\bgroup + \dontcomplain + \def\presetfigure[##1][##2]% + {\getvalue{\e!start\v!figure\e!text}[\v!left,\v!none][] + {} + {\hbox + {\externalfigure[##1][\c!frame=\v!on,\c!width=6cm,\c!size=\@@exsize][##2]% + \tfskip + \framed[\c!width=\figurewidth,\c!height=\figureheight]{}}}% + {\tt\tfa\expanded{\asciistr{##1}}}% + \blank + \tfx + \def\docommand####1% + {\beforesplitstring####1\at=\to\asciia + \aftersplitstring ####1\at=\to\asciib + \defconvertedcommand\asciib\asciib + \doifsomething\asciib + {\hsmash{\hbox to .75em{\asciia\hss}: \asciib}\endgraf}}% + \processcommalist[##2]\docommand + \strut + \endgraf + \getvalue{\e!stop\v!figure\e!text}}% + \pushendofline + \readjobfile\@@exfile\donothing\donothing + \popendofline + \egroup} + +\def\showexternalfigureb % instelbaar maken + {\bgroup + \def\total{5}% + \globalletempty\allfigures + \doglobal\newcounter\figurecounter + \dontcomplain + \def\docommand##1{##1&}% + \def\figurecaptions% + {\crcr + \noalign{\nobreak\vskip.5em}% + \@EA\globalprocesscommalist\@EA[\allfigures]\docommand + \globalletempty\allfigures + \crcr + \noalign{\vskip1em\goodbreak}}% + \def\presetfigure[##1][##2]% + {\vbox + {\divide\hsize \total + \advance\hsize -1em + \externalfigure + [##1] + [\c!frame=\v!on,\c!factor=\v!max,\c!width=\hsize,\c!size=\@@exsize][##2]}% + \doglobal\addtocommalist{##1}\allfigures + %\getvalue{\s!figurepreset}% + \doglobal\increment\figurecounter + \ifnum\figurecounter=\total + \doglobal\newcounter\figurecounter + \def\next{\figurecaptions}% + \else + \def\next{&}% + \fi + \next}% + \pushendofline + \tabskip\zeropoint \!!plus 1fill + \halign to \hsize + {&\hss##\hss\cr\readjobfile\@@exfile\donothing\donothing\crcr + \figurecaptions} + \popendofline + \egroup} + +\def\showexternalfigurec + {\bgroup + \def\presetfigure[##1][##2]{\expanded{\pagefigure[##1][\c!size=\@@exsize]}}% else loop + \pushendofline + \readjobfile\@@exfile\donothing\donothing + \popendofline + \egroup} + +\def\showexternalfigured % to be documented; this one builds a dimension file for + {\bgroup % metapost/metafun + \immediate\openout\scratchwrite=mpfigs.mp + \def\presetfigure[##1][##2]% + {\getfiguredimensionsonly[##1]% \pagefigure[##1]% + \immediate\write\scratchwrite + {registerfigure("##1",\figurewidth,\figureheight);}} + \pushendofline + \readjobfile\@@exfile\donothing\donothing + \popendofline + \immediate\closeout\scratchwrite + \egroup} diff --git a/tex/context/base/x-res-20.tex b/tex/context/base/x-res-20.tex deleted file mode 100644 index 3ff069ffd..000000000 --- a/tex/context/base/x-res-20.tex +++ /dev/null @@ -1,231 +0,0 @@ -%D \module -%D [ file=x-res-20, -%D version=2006.08.20, -%D title=\CONTEXT\ Style File, -%D subtitle=Figure Lists, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D For the beginning we have used \TEXUTIL\ to hels us deal with -%D graphics whose dimensions could not be determines and|/|or to -%D provide placeholder info for graphics that were not available. -%D Much of this functionality is now moved to \RLXTOOLS\ and -%D therefore it makes sense to reimplement the code that deals with -%D producing an overview of grapghics as well. At the same time we -%D move some \TEX\ code from \TEXEXEC\ to here. -%D -%D Because the show commands are not used in real documents, but -%D only for special purposed, it does not harm that this -%D functionality is now part of a module. We no longer use the -%D parsing code in \TEXUTIL, but rely on \IMAGEMAGICK's -%D identify functionility. -%D -%D At the end of the file we kept the old code from \type {core-fig}. - -\unprotect - -\startXMLmapping[rlx:list] - - \defineXMLprocess - [rl:identification] - - \defineXMLenvironment - [rl:identify] [name=] - {\bgroup\ignorespaces} - {\removeunwantedspaces\doRLhandlegraphic\egroup} - - \defineXMLsave[rl:size] - \defineXMLsave[rl:path] - \defineXMLsave[rl:width] - \defineXMLsave[rl:height] - -\stopXMLmapping - -\def\showexternalfigures - {\dosingleempty\doshowexternalfigures} - -\let\doRLhandlegraphic\relax -\let\doRLstartgraphics\relax -\let\doRLstopgraphics \relax - -\let\RLfigurewidth \empty -\let\RLfigureheight\empty -\let\RLfiguresize \empty -\let\RLfigurefile \empty - -\def\doRLpresetgraphic - {\edef\RLfigurewidth {\the\dimexpr \XMLflush{rl:width}\relax}% - \edef\RLfigureheight{\the\dimexpr \XMLflush{rl:height}\relax}% - \edef\RLfiguresize {\the\numexpr0\XMLflush{rl:size}\relax}% - \edef\RLfigurefile {\XMLpar{rl:identify}{name}{unknown}}} - -\def\doshowexternalfigures[#1]% - {\bgroup - \dontcomplain - \setupcolors[\c!state=\v!start]% to prevent mps color conversion - \getparameters[\??ex][\c!file=rlxtools.rli,\c!alternative=a,\c!offset=\!!zeropoint,\c!size=,#1]% - \getvalue{\strippedcsname\doRLhandlegraphic\@@exalternative}% - \startXMLmapping[rlx:list]% - \startXMLignore - \doRLstartgraphics - \processXMLfilegrouped{\@@exfile}% \readjobfile\@@exfile\donothing\donothing - \doRLstopgraphics - \stopXMLignore - \stopXMLmapping - \egroup} - -\def\doRLhandlegraphica - {\def\doRLhandlegraphic - {\doRLpresetgraphic - \getvalue{\e!start\v!figure\e!text}[\v!left,\v!none][] - {} - {\hbox - {\externalfigure[\RLfigurefile][\c!frame=\v!on,\c!width=6cm,\c!size=\@@exsize]% - \quad - \framed[\c!width=\figurewidth,\c!height=\figureheight]{}% - \quad}}% - {\hbox{\tt\tfa\setstrut\strut\expanded{\asciistr{\RLfigurefile}}}}% - \blank - \tfx - \starttabulate[|l|l|] - \NC width \EQ \RLfigurewidth \NC \NR - \NC height \EQ \RLfigureheight \NC \NR - \NC size \EQ \RLfiguresize \NC \NR - \stoptabulate - \getvalue{\e!stop\v!figure\e!text}}} - -\def\doRLhandlegraphicb - {\def\doRLhandlegraphic - {\dontleavehmode - \vbox - {\doRLpresetgraphic - \hsize\dimexpr.2\hsize-.8em\relax - \cbox{\externalfigure[\RLfigurefile][\c!frame=\v!on,\c!factor=\v!max,\c!width=\hsize,\c!size=\@@exsize]}% - \vskip.5\lineheight - \midaligned{\tttf\RLfigurefile}}% - \vadjust{\vskip.2\lineheight}% - \quad\allowbreak}} - -\def\doRLhandlegraphicc - {\def\doRLhandlegraphic - {\doRLpresetgraphic - \pagefigure[\RLfigurefile]}} - -\def\doRLhandlegraphicd % this one builds a dimension file for metapost/metafun - {\def\doRLstartgraphics - {\immediate\openout\scratchwrite=mpfigs.mp\relax - \immediate\write\scratchwrite{\letterpercent\space graphic dimension file for metapost/metafun}}% - \def\doRLstopgraphics - {\immediate\closeout\scratchwrite}% - \def\doRLhandlegraphic - {\doRLpresetgraphic - \immediate\write\scratchwrite{registerfigure("\RLfigurefile",\RLfigurewidth,\RLfigureheight);}}} - -% \showexternalfigures[alternative=b] - -\protect \endinput - -%D Old code: - -\def\doshowexternalfigures[#1]% - {\bgroup - \setupcolors[\c!state=\v!start]% to prevent mps color conversion - \getparameters[\??ex][\c!alternative=a,\c!offset=\!!zeropoint,\c!size=,#1]% - \getvalue{\strippedcsname\showexternalfigure\@@exalternative}% - \egroup} - -\def\showexternalfigures - {\dosingleempty\doshowexternalfigures} - -\def\showexternalfigurea - {\bgroup - \dontcomplain - \def\presetfigure[##1][##2]% - {\getvalue{\e!start\v!figure\e!text}[\v!left,\v!none][] - {} - {\hbox - {\externalfigure[##1][\c!frame=\v!on,\c!width=6cm,\c!size=\@@exsize][##2]% - \tfskip - \framed[\c!width=\figurewidth,\c!height=\figureheight]{}}}% - {\tt\tfa\expanded{\asciistr{##1}}}% - \blank - \tfx - \def\docommand####1% - {\beforesplitstring####1\at=\to\asciia - \aftersplitstring ####1\at=\to\asciib - \defconvertedcommand\asciib\asciib - \doifsomething\asciib - {\hsmash{\hbox to .75em{\asciia\hss}: \asciib}\endgraf}}% - \processcommalist[##2]\docommand - \strut - \endgraf - \getvalue{\e!stop\v!figure\e!text}}% - \pushendofline - \readjobfile\@@exfile\donothing\donothing - \popendofline - \egroup} - -\def\showexternalfigureb % instelbaar maken - {\bgroup - \def\total{5}% - \globalletempty\allfigures - \doglobal\newcounter\figurecounter - \dontcomplain - \def\docommand##1{##1&}% - \def\figurecaptions% - {\crcr - \noalign{\nobreak\vskip.5em}% - \@EA\globalprocesscommalist\@EA[\allfigures]\docommand - \globalletempty\allfigures - \crcr - \noalign{\vskip1em\goodbreak}}% - \def\presetfigure[##1][##2]% - {\vbox - {\divide\hsize \total - \advance\hsize -1em - \externalfigure - [##1] - [\c!frame=\v!on,\c!factor=\v!max,\c!width=\hsize,\c!size=\@@exsize][##2]}% - \doglobal\addtocommalist{##1}\allfigures - %\getvalue{\s!figurepreset}% - \doglobal\increment\figurecounter - \ifnum\figurecounter=\total - \doglobal\newcounter\figurecounter - \def\next{\figurecaptions}% - \else - \def\next{&}% - \fi - \next}% - \pushendofline - \tabskip\zeropoint \!!plus 1fill - \halign to \hsize - {&\hss##\hss\cr\readjobfile\@@exfile\donothing\donothing\crcr - \figurecaptions} - \popendofline - \egroup} - -\def\showexternalfigurec - {\bgroup - \def\presetfigure[##1][##2]{\expanded{\pagefigure[##1][\c!size=\@@exsize]}}% else loop - \pushendofline - \readjobfile\@@exfile\donothing\donothing - \popendofline - \egroup} - -\def\showexternalfigured % to be documented; this one builds a dimension file for - {\bgroup % metapost/metafun - \immediate\openout\scratchwrite=mpfigs.mp - \def\presetfigure[##1][##2]% - {\getfiguredimensionsonly[##1]% \pagefigure[##1]% - \immediate\write\scratchwrite - {registerfigure("##1",\figurewidth,\figureheight);}} - \pushendofline - \readjobfile\@@exfile\donothing\donothing - \popendofline - \immediate\closeout\scratchwrite - \egroup} diff --git a/tex/context/base/x-res-50.mkiv b/tex/context/base/x-res-50.mkiv index f29b1d61e..b4c6b4560 100644 --- a/tex/context/base/x-res-50.mkiv +++ b/tex/context/base/x-res-50.mkiv @@ -11,6 +11,8 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +%D TO BE REDONE! + %D This is a preliminary module, using a preliminary xml media format that %D looks as follows (record is embedded in resource library element): %D diff --git a/tex/context/base/x-sch-00.mkii b/tex/context/base/x-sch-00.mkii new file mode 100644 index 000000000..379d19cf2 --- /dev/null +++ b/tex/context/base/x-sch-00.mkii @@ -0,0 +1,382 @@ +%D \module +%D [ file=x-sch-00, +%D version=2001.10.02, +%D title=\CONTEXT\ Style File, +%D subtitle=XML Schema Basics, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Schema support was implemented right after euro\TeX\ 2001, +%D when Tobias Burnus send me a schema for the XML figure +%D base. Since it happened that I needed schemata for other +%D projects too, I wrote this mapper. Thanks to Tobias for +%D testing it. + +\newcounter\XSDprefix +\newif\ifXDScomposite + +\definelist [xsd:names] +\defineregister [xsd:index] [xsd:indices] + +\setuplist [xsd:names] [expansion=yes] +\setupregister [xsd:index] [expansion=yes] + +\def\dodoXSDkeyval#1#2#3% + {\framed + [width=\hsize,background=color,backgroundcolor=xsd:0, + framecolor=xsd:0,frame=off,align=right] + {\hbox to 5em % %to 8em % .2\hsize + {\bf + %\doifsomething{#1}{#1 } + \ignorespaces#2\unskip\hss} + %\ignorespaces#2\unskip:}% + \space + \ignorespaces#3\unskip}} + +\def\doXSDkeyval#1#2#3#4% + {\bgroup + \edef\XSDtemp{\XMLpar{#3}{#4}{}}% + \doifsomething{\XSDtemp} + {\def\doXSDtemp{\dodoXSDkeyval{#1}{#2}{\XSDtemp}}% + \def\doXSDtype{\dodoXSDkeyval{#1}{#2}{\XMLtyp{#3}{#4}{}}}% + \setupinteraction[color=,contrastcolor=,style=]% + \processaction + [#4] + [ value=>\doXSDtype, + name=>{\writetolist[xsd:names]{}{\XSDtemp}% + \writetoregister[xsd:index]{\XSDtemp}% + \ifXDScomposite \else + \pagereference[xsd:\XSDprefix:\XSDtemp]% + \fi + \doXSDtemp}, + type=>{\doifinstringelse{xsd:}{\XSDtemp} + {\doXSDtemp} + {\gotobox{\doXSDtemp}[xsd:\XSDprefix:\XSDtemp]}}, + ref=>{\doifinstringelse{xsd:}{\XSDtemp} + {\doXSDtemp} + {\gotobox{\doXSDtemp}[xsd:\XSDprefix:\XSDtemp]}}, + unknown=>\doXSDtemp]}% + \endgraf + \egroup} + +\def\doXSDkeyvals#1#2#3% + {\def\docommand##1{\doXSDkeyval{#1}{##1}{#2}{##1}}% + \processcommalist[#3]\docommand} + +\def\dodoXSDbanner#1% + {\framed + [width=\hsize,framecolor=xsd:0,frame=off, + background=color,backgroundcolor=xsd:0] + {\ignorespaces#1\unskip}} + +\def\doXSDtitle#1#2#3% + {\edef\XSDtemp{\XMLpar{#2}{#3}{}}% + \dodoXSDbanner + {{\bf\ignorespaces#1\unskip}% + \doifsomething{\XSDtemp} + {:\space\ignorespaces\XSDtemp\unskip + \pagereference[xsd:\XSDprefix:\XSDtemp]}}} + +\def\doXSDbanner#1% + {\dodoXSDbanner{\bf#1}} + +%D We use colored backgrounds for meaningful blocks. + +\definecolor [xsd:0] [white] + +\definecolor [xsd:1] [s=.30] +\definecolor [xsd:2] [s=.55] +\definecolor [xsd:3] [s=.70] +\definecolor [xsd:4] [s=.85] + +\definecolor [xsd:5] [r=.6,g=.7,b=.8] +\definecolor [xsd:6] [r=.7,g=.8,b=.6] +\definecolor [xsd:7] [r=1,g=1,b=.6] +\definecolor [xsd:8] [r=.8,g=.7,b=.6] + +\defineframedtext [XSDannotation] [backgroundcolor=xsd:0] + +\defineframedtext [XSDelement] [backgroundcolor=xsd:5] +\defineframedtext [XSDattribute] [backgroundcolor=xsd:6] +\defineframedtext [XSDsimpleType] [backgroundcolor=xsd:7] +\defineframedtext [XSDcomplexType] [backgroundcolor=xsd:8] + +\defineframedtext [XSDcomplexContent] [backgroundcolor=xsd:1] +\defineframedtext [XSDsimpleContent] [backgroundcolor=xsd:1] +\defineframedtext [XSDattributeGroup] [backgroundcolor=xsd:1] + +\defineframedtext [XSDcapsule] [backgroundcolor=xsd:2] +\defineframedtext [XSDsequence] [backgroundcolor=xsd:3] + +\def\XDSstructures% handy for external settings + {XSDannotation, + XSDcomplexType,XSDsimpleType,XSDelement,XSDattribute, + XSDcomplexContent,XSDsimpleContent,XSDattributeGroup, + XSDcapsule,XSDsequence} + +\setupframedtexts + [\XDSstructures] + [width=\hsize, + offset=.5\bodyfontsize, + location=none, + background=color, + framecolor=xsd:0, + before=\ifinframed\else\blank\fi, + after=\ifinframed\else\blank\fi, + depthcorrection=off, + rulethickness=1pt, + strut=no] + +\definesymbol[xsd][{\blackrule[width=4em]}] + +\def\placeXSDlegenda + {\startbaselinecorrection + \starttabulate[|l|l|] + \HL + \NC \bf color \NC \bf meaning \NC \NR + \HL + \NC \color[xsd:1]{\symbol[xsd]} \NC complexContent \unskip\quad + simpleContent \unskip\quad + attributeGroup \NC \NR + \NC \color[xsd:2]{\symbol[xsd]} \NC capsule \NC \NR + \NC \color[xsd:3]{\symbol[xsd]} \NC sequence \NC \NR + \HL + \NC \color[xsd:5]{\symbol[xsd]} \NC element \NC \NR + \NC \color[xsd:6]{\symbol[xsd]} \NC attribute \NC \NR + \NC \color[xsd:7]{\symbol[xsd]} \NC simpleType \NC \NR + \NC \color[xsd:8]{\symbol[xsd]} \NC complexType \NC \NR + \HL + \stoptabulate + \stopbaselinecorrection} + +\defineXMLenvironment [xsd:all] [id=] + {\startXSDcapsule + \doXSDbanner{all} + \doXSDkeyvals{all}{xsd:all}{id} + \XDScompositetrue} + {\stopXSDcapsule} + +\defineXMLenvironment [xsd:annotation] + {\startXSDcapsule + \doXSDbanner{annotation} + \startXSDannotation} + {\stopXSDannotation + \stopXSDcapsule} + +\defineXMLignore [xsd:appInfo] + +\defineXMLenvironment [xsd:attribute] + [id=,name=,ref=,type=,form=,use=,value=] + {\startXSDattribute + \doifelsenothing{\XMLpar{xsd:attribute}{ref}{}} + {\doXSDkeyvals{attribute}{xsd:attribute}{name,type}} + {\doXSDkeyvals{attribute}{xsd:attribute}{ref}} + \doXSDkeyvals{attribute}{xsd:attribute}{id,form,use,value} + \XDScompositetrue} + {\stopXSDattribute} + +\defineXMLenvironment [xsd:attributeGroup] [id=,name=,ref=] + {\startXSDattributeGroup + \doXSDtitle{attribute group}{xsd:attributeGroup}{name} + \doXSDkeyvals{attr group}{xsd:attributeGroup}{id,name,ref} + \XDScompositetrue} + {\stopXSDattributeGroup} + +\defineXMLenvironment [xsd:choice] [id=,minOccurs=,maxOccurs=] + {\startXSDcapsule + \doXSDbanner{choice} + \doXSDkeyvals{choice}{xsd:choice}{id,minOccurs,maxOccurs} + \XDScompositetrue} + {\stopXSDcapsule} + +\defineXMLenvironment [xsd:complexContent] [id=,mixed=] + {\startXSDcomplexContent + \doXSDkeyvals{complex content}{xsd:complexContent}{id,mixed} + \XDScompositetrue} + {\stopXSDcomplexContent} + +\defineXMLenvironment [xsd:complexType] + [id=,abstract=,block=,final=,mixed=,name=] + {\startXSDcomplexType + \doXSDtitle{complex type}{xsd:complexType}{name} + \doXSDkeyvals{complex type}{xsd:complexType}{id,abstract,block,final,mixed} + \XDScompositetrue} + {\stopXSDcomplexType} + +\defineXMLenvironment [xsd:documentation] [source=,xml:lang=] + {\endgraf\bgroup\setupwhitespace[big]} + {\endgraf\egroup} + +\defineXMLenvironment [xsd:element] + [name=,type=,ref=, + abstract=,block=,default=,final=,fixed=,form=,id=, + minOccurs=,maxOccurs=,nullable=,substitutionGroup=] + {\startXSDelement + \doifelsenothing{\XMLpar{xsd:element}{ref}{}} + {\doXSDkeyvals{element}{xsd:element}{name,type}} + {\doXSDkeyvals{element}{xsd:element}{ref}} + \doXSDkeyvals{element}{xsd:element} + {id,abstract,block,default,final,fixed,form, + minOccurs,maxOccurs,nullable,substitutionGroup} + \XDScompositetrue} + {\stopXSDelement} + +\defineXMLenvironment [xsd:extension] [id=,base=] + {\startXSDcapsule + \doXSDbanner{extension} + \doXSDkeyvals{extension}{xsd:extension}{id,base} + \XDScompositetrue} + {\stopXSDcapsule} + +\defineXMLenvironment [xsd:group] + [id=,name=,ref=,minOccurs=,maxOccurs=] + {\startXSDcapsule + \doXSDbanner{group} + \doXSDkeyvals{group}{xsd:group}{id,name,ref,minOccurs,maxOccurs} + \XDScompositetrue} + {\stopXSDcapsule} + +\defineXMLenvironment [xsd:key] [id=,name=] + {\startXSDcapsule + \doXSDbanner{key} + \doXSDkeyvals{key}{xsd:key}{id,name} + \XDScompositetrue} + {\stopXSDcapsule} + +\defineXMLenvironment [xsd:keyref] [id=,name=,refer=] + {\startXSDcapsule + \doXSDbanner{keyref} + \doXSDkeyvals{key ref}{xsd:keyref}{id,name,refer} + \XDScompositetrue} + {\stopXSDcapsule} + +\defineXMLenvironment [xsd:list] [id=,itemType=] + {\startXSDcapsule + \doXSDbanner{list} + \doXSDkeyvals{list}{xsd:list}{id,itemType} + \XDScompositetrue} + {\stopXSDcapsule} + +\defineXMLenvironment [xsd:redefine] [schemaLocation=] + {\startXSDcapsule + \doXSDbanner{redefine} + \doXSDkeyvals{redefine}{xsd:redefine}{schemaLocation} + \XDScompositetrue} + {\stopXSDcapsule} + +\defineXMLenvironment [xsd:restriction] [id=,base=] + {\startXSDcapsule + \doXSDbanner{restriction} + \doXSDkeyvals{restriction}{xsd:restriction}{id,base} + \XDScompositetrue} + {\stopXSDcapsule} + +\defineXMLenvironment [xsd:schema] + [attributeFormDefault=,blockDefault=,elementFormDefault=, + finalDefault=,id=,targetNamespace=,version=] + {\startXSDcapsule + \doglobal\increment\XSDprefix + \doXSDbanner{schema} + \doXSDkeyvals{schema}{xsd:schema} + {attributeFormDefault,blockDefault,elementFormDefault, + finalDefault,id,targetNamespace,version} + \stopXSDcapsule} + {} + +\defineXMLenvironment [xsd:sequence] [id=,minOccurs=,maxOccurs=] + {\startXSDsequence + \doXSDbanner{sequence} + \doXSDkeyvals{sequence}{xsd:sequence}{id,minOccurs,maxOccurs} + \XDScompositetrue} + {\stopXSDsequence} + +\defineXMLenvironment [xsd:simpleContent] [id=] + {\startXSDsimpleContent + \doXSDkeyvals{simple content}{xsd:simpleContent}{id} + \XDScompositetrue} + {\stopXSDsimpleContent} + +\defineXMLenvironment [xsd:simpleType] [id=,name=] + {\startXSDsimpleType + \doXSDtitle{simple type}{xsd:simpleType}{name} + \doXSDkeyvals{simple type}{xsd:simpleType}{id} + \XDScompositetrue} + {\stopXSDsimpleType} + +\defineXMLenvironment [xsd:union] [id=,memberTypes=] + {\startXSDcapsule + \doXSDbanner{union} + \doXSDkeyvals{union}{xsd:union}{id,memberTypes} + \XDScompositetrue} + {\stopXSDcapsule} + +\defineXMLenvironment [xsd:unique] [id=,name=] + {\startXSDcapsule + \doXSDbanner{unique} + \doXSDkeyvals{unique}{xsd:unique}{id,name} + \XDScompositetrue} + {\stopXSDcapsule} + +\def\defineXSDfacet + {\dotripleempty\dodefineXSDfacet} + +\def\dodefineXSDfacet[#1][#2][#3]% + {\defineXMLenvironment[xsd:#1][#2] + {\startXSDcapsule + \doXSDkeyvals{#1}{xsd:#1}{#3} + \XDScompositetrue} + {\stopXSDcapsule} + \defineXMLsingular[xsd:#1][#2] + {\doXSDkeyvals{#1}{xsd:#1}{#3}}} + +\defineXSDfacet [duration] [id=,value=,fixed=] [id,value,fixed] +\defineXSDfacet [encoding] [id=,value=,fixed=] [id,value,fixed] +\defineXSDfacet [enumeration] [id=,value=,fixed=] [id,value,fixed] + +\defineXSDfacet [length] [id=,value=,fixed=] [id,value,fixed] +\defineXSDfacet [minLength] [id=,value=,fixed=] [id,value,fixed] +\defineXSDfacet [maxLength] [id=,value=,fixed=] [id,value,fixed] +\defineXSDfacet [minInclusive] [id=,value=,fixed=] [id,value,fixed] +\defineXSDfacet [maxInclusive] [id=,value=,fixed=] [id,value,fixed] +\defineXSDfacet [minExclusive] [id=,value=,fixed=] [id,value,fixed] +\defineXSDfacet [maxExclusive] [id=,value=,fixed=] [id,value,fixed] + +\defineXSDfacet [pattern] [id=,value=,fixed=] [id,value,fixed] +\defineXSDfacet [period] [id=,value=,fixed=] [id,value,fixed] +\defineXSDfacet [precision] [id=,value=,fixed=] [id,value,fixed] +\defineXSDfacet [scale] [id=,value=,fixed=] [id,value,fixed] + +\defineXSDfacet [field] [id=,xpath=] [id,xpath] +\defineXSDfacet [selector] [id=,xpath=] [id,xpath] + +\defineXSDfacet + [any] + [id=,namespace=,minOccurs=,maxOccurs=,processContents=] + [id,namespace,minOccurs,maxOccurs,processContent] + +\defineXSDfacet + [anyAttribute] + [id=,namespace=,processContents=] + [id,namespace,processContents] + +\defineXSDfacet + [import] + [id=,namespace=,schemaLocation=] + [id,namespace,schemaLocation] + +\defineXSDfacet + [include] + [id=,schemaLocation=] + [id,schemaLocation] + +\defineXSDfacet + [notation] + [id=,name=,public=,system=] + [id,name,public,system] + +\endinput diff --git a/tex/context/base/x-sch-00.tex b/tex/context/base/x-sch-00.tex deleted file mode 100644 index 379d19cf2..000000000 --- a/tex/context/base/x-sch-00.tex +++ /dev/null @@ -1,382 +0,0 @@ -%D \module -%D [ file=x-sch-00, -%D version=2001.10.02, -%D title=\CONTEXT\ Style File, -%D subtitle=XML Schema Basics, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Schema support was implemented right after euro\TeX\ 2001, -%D when Tobias Burnus send me a schema for the XML figure -%D base. Since it happened that I needed schemata for other -%D projects too, I wrote this mapper. Thanks to Tobias for -%D testing it. - -\newcounter\XSDprefix -\newif\ifXDScomposite - -\definelist [xsd:names] -\defineregister [xsd:index] [xsd:indices] - -\setuplist [xsd:names] [expansion=yes] -\setupregister [xsd:index] [expansion=yes] - -\def\dodoXSDkeyval#1#2#3% - {\framed - [width=\hsize,background=color,backgroundcolor=xsd:0, - framecolor=xsd:0,frame=off,align=right] - {\hbox to 5em % %to 8em % .2\hsize - {\bf - %\doifsomething{#1}{#1 } - \ignorespaces#2\unskip\hss} - %\ignorespaces#2\unskip:}% - \space - \ignorespaces#3\unskip}} - -\def\doXSDkeyval#1#2#3#4% - {\bgroup - \edef\XSDtemp{\XMLpar{#3}{#4}{}}% - \doifsomething{\XSDtemp} - {\def\doXSDtemp{\dodoXSDkeyval{#1}{#2}{\XSDtemp}}% - \def\doXSDtype{\dodoXSDkeyval{#1}{#2}{\XMLtyp{#3}{#4}{}}}% - \setupinteraction[color=,contrastcolor=,style=]% - \processaction - [#4] - [ value=>\doXSDtype, - name=>{\writetolist[xsd:names]{}{\XSDtemp}% - \writetoregister[xsd:index]{\XSDtemp}% - \ifXDScomposite \else - \pagereference[xsd:\XSDprefix:\XSDtemp]% - \fi - \doXSDtemp}, - type=>{\doifinstringelse{xsd:}{\XSDtemp} - {\doXSDtemp} - {\gotobox{\doXSDtemp}[xsd:\XSDprefix:\XSDtemp]}}, - ref=>{\doifinstringelse{xsd:}{\XSDtemp} - {\doXSDtemp} - {\gotobox{\doXSDtemp}[xsd:\XSDprefix:\XSDtemp]}}, - unknown=>\doXSDtemp]}% - \endgraf - \egroup} - -\def\doXSDkeyvals#1#2#3% - {\def\docommand##1{\doXSDkeyval{#1}{##1}{#2}{##1}}% - \processcommalist[#3]\docommand} - -\def\dodoXSDbanner#1% - {\framed - [width=\hsize,framecolor=xsd:0,frame=off, - background=color,backgroundcolor=xsd:0] - {\ignorespaces#1\unskip}} - -\def\doXSDtitle#1#2#3% - {\edef\XSDtemp{\XMLpar{#2}{#3}{}}% - \dodoXSDbanner - {{\bf\ignorespaces#1\unskip}% - \doifsomething{\XSDtemp} - {:\space\ignorespaces\XSDtemp\unskip - \pagereference[xsd:\XSDprefix:\XSDtemp]}}} - -\def\doXSDbanner#1% - {\dodoXSDbanner{\bf#1}} - -%D We use colored backgrounds for meaningful blocks. - -\definecolor [xsd:0] [white] - -\definecolor [xsd:1] [s=.30] -\definecolor [xsd:2] [s=.55] -\definecolor [xsd:3] [s=.70] -\definecolor [xsd:4] [s=.85] - -\definecolor [xsd:5] [r=.6,g=.7,b=.8] -\definecolor [xsd:6] [r=.7,g=.8,b=.6] -\definecolor [xsd:7] [r=1,g=1,b=.6] -\definecolor [xsd:8] [r=.8,g=.7,b=.6] - -\defineframedtext [XSDannotation] [backgroundcolor=xsd:0] - -\defineframedtext [XSDelement] [backgroundcolor=xsd:5] -\defineframedtext [XSDattribute] [backgroundcolor=xsd:6] -\defineframedtext [XSDsimpleType] [backgroundcolor=xsd:7] -\defineframedtext [XSDcomplexType] [backgroundcolor=xsd:8] - -\defineframedtext [XSDcomplexContent] [backgroundcolor=xsd:1] -\defineframedtext [XSDsimpleContent] [backgroundcolor=xsd:1] -\defineframedtext [XSDattributeGroup] [backgroundcolor=xsd:1] - -\defineframedtext [XSDcapsule] [backgroundcolor=xsd:2] -\defineframedtext [XSDsequence] [backgroundcolor=xsd:3] - -\def\XDSstructures% handy for external settings - {XSDannotation, - XSDcomplexType,XSDsimpleType,XSDelement,XSDattribute, - XSDcomplexContent,XSDsimpleContent,XSDattributeGroup, - XSDcapsule,XSDsequence} - -\setupframedtexts - [\XDSstructures] - [width=\hsize, - offset=.5\bodyfontsize, - location=none, - background=color, - framecolor=xsd:0, - before=\ifinframed\else\blank\fi, - after=\ifinframed\else\blank\fi, - depthcorrection=off, - rulethickness=1pt, - strut=no] - -\definesymbol[xsd][{\blackrule[width=4em]}] - -\def\placeXSDlegenda - {\startbaselinecorrection - \starttabulate[|l|l|] - \HL - \NC \bf color \NC \bf meaning \NC \NR - \HL - \NC \color[xsd:1]{\symbol[xsd]} \NC complexContent \unskip\quad - simpleContent \unskip\quad - attributeGroup \NC \NR - \NC \color[xsd:2]{\symbol[xsd]} \NC capsule \NC \NR - \NC \color[xsd:3]{\symbol[xsd]} \NC sequence \NC \NR - \HL - \NC \color[xsd:5]{\symbol[xsd]} \NC element \NC \NR - \NC \color[xsd:6]{\symbol[xsd]} \NC attribute \NC \NR - \NC \color[xsd:7]{\symbol[xsd]} \NC simpleType \NC \NR - \NC \color[xsd:8]{\symbol[xsd]} \NC complexType \NC \NR - \HL - \stoptabulate - \stopbaselinecorrection} - -\defineXMLenvironment [xsd:all] [id=] - {\startXSDcapsule - \doXSDbanner{all} - \doXSDkeyvals{all}{xsd:all}{id} - \XDScompositetrue} - {\stopXSDcapsule} - -\defineXMLenvironment [xsd:annotation] - {\startXSDcapsule - \doXSDbanner{annotation} - \startXSDannotation} - {\stopXSDannotation - \stopXSDcapsule} - -\defineXMLignore [xsd:appInfo] - -\defineXMLenvironment [xsd:attribute] - [id=,name=,ref=,type=,form=,use=,value=] - {\startXSDattribute - \doifelsenothing{\XMLpar{xsd:attribute}{ref}{}} - {\doXSDkeyvals{attribute}{xsd:attribute}{name,type}} - {\doXSDkeyvals{attribute}{xsd:attribute}{ref}} - \doXSDkeyvals{attribute}{xsd:attribute}{id,form,use,value} - \XDScompositetrue} - {\stopXSDattribute} - -\defineXMLenvironment [xsd:attributeGroup] [id=,name=,ref=] - {\startXSDattributeGroup - \doXSDtitle{attribute group}{xsd:attributeGroup}{name} - \doXSDkeyvals{attr group}{xsd:attributeGroup}{id,name,ref} - \XDScompositetrue} - {\stopXSDattributeGroup} - -\defineXMLenvironment [xsd:choice] [id=,minOccurs=,maxOccurs=] - {\startXSDcapsule - \doXSDbanner{choice} - \doXSDkeyvals{choice}{xsd:choice}{id,minOccurs,maxOccurs} - \XDScompositetrue} - {\stopXSDcapsule} - -\defineXMLenvironment [xsd:complexContent] [id=,mixed=] - {\startXSDcomplexContent - \doXSDkeyvals{complex content}{xsd:complexContent}{id,mixed} - \XDScompositetrue} - {\stopXSDcomplexContent} - -\defineXMLenvironment [xsd:complexType] - [id=,abstract=,block=,final=,mixed=,name=] - {\startXSDcomplexType - \doXSDtitle{complex type}{xsd:complexType}{name} - \doXSDkeyvals{complex type}{xsd:complexType}{id,abstract,block,final,mixed} - \XDScompositetrue} - {\stopXSDcomplexType} - -\defineXMLenvironment [xsd:documentation] [source=,xml:lang=] - {\endgraf\bgroup\setupwhitespace[big]} - {\endgraf\egroup} - -\defineXMLenvironment [xsd:element] - [name=,type=,ref=, - abstract=,block=,default=,final=,fixed=,form=,id=, - minOccurs=,maxOccurs=,nullable=,substitutionGroup=] - {\startXSDelement - \doifelsenothing{\XMLpar{xsd:element}{ref}{}} - {\doXSDkeyvals{element}{xsd:element}{name,type}} - {\doXSDkeyvals{element}{xsd:element}{ref}} - \doXSDkeyvals{element}{xsd:element} - {id,abstract,block,default,final,fixed,form, - minOccurs,maxOccurs,nullable,substitutionGroup} - \XDScompositetrue} - {\stopXSDelement} - -\defineXMLenvironment [xsd:extension] [id=,base=] - {\startXSDcapsule - \doXSDbanner{extension} - \doXSDkeyvals{extension}{xsd:extension}{id,base} - \XDScompositetrue} - {\stopXSDcapsule} - -\defineXMLenvironment [xsd:group] - [id=,name=,ref=,minOccurs=,maxOccurs=] - {\startXSDcapsule - \doXSDbanner{group} - \doXSDkeyvals{group}{xsd:group}{id,name,ref,minOccurs,maxOccurs} - \XDScompositetrue} - {\stopXSDcapsule} - -\defineXMLenvironment [xsd:key] [id=,name=] - {\startXSDcapsule - \doXSDbanner{key} - \doXSDkeyvals{key}{xsd:key}{id,name} - \XDScompositetrue} - {\stopXSDcapsule} - -\defineXMLenvironment [xsd:keyref] [id=,name=,refer=] - {\startXSDcapsule - \doXSDbanner{keyref} - \doXSDkeyvals{key ref}{xsd:keyref}{id,name,refer} - \XDScompositetrue} - {\stopXSDcapsule} - -\defineXMLenvironment [xsd:list] [id=,itemType=] - {\startXSDcapsule - \doXSDbanner{list} - \doXSDkeyvals{list}{xsd:list}{id,itemType} - \XDScompositetrue} - {\stopXSDcapsule} - -\defineXMLenvironment [xsd:redefine] [schemaLocation=] - {\startXSDcapsule - \doXSDbanner{redefine} - \doXSDkeyvals{redefine}{xsd:redefine}{schemaLocation} - \XDScompositetrue} - {\stopXSDcapsule} - -\defineXMLenvironment [xsd:restriction] [id=,base=] - {\startXSDcapsule - \doXSDbanner{restriction} - \doXSDkeyvals{restriction}{xsd:restriction}{id,base} - \XDScompositetrue} - {\stopXSDcapsule} - -\defineXMLenvironment [xsd:schema] - [attributeFormDefault=,blockDefault=,elementFormDefault=, - finalDefault=,id=,targetNamespace=,version=] - {\startXSDcapsule - \doglobal\increment\XSDprefix - \doXSDbanner{schema} - \doXSDkeyvals{schema}{xsd:schema} - {attributeFormDefault,blockDefault,elementFormDefault, - finalDefault,id,targetNamespace,version} - \stopXSDcapsule} - {} - -\defineXMLenvironment [xsd:sequence] [id=,minOccurs=,maxOccurs=] - {\startXSDsequence - \doXSDbanner{sequence} - \doXSDkeyvals{sequence}{xsd:sequence}{id,minOccurs,maxOccurs} - \XDScompositetrue} - {\stopXSDsequence} - -\defineXMLenvironment [xsd:simpleContent] [id=] - {\startXSDsimpleContent - \doXSDkeyvals{simple content}{xsd:simpleContent}{id} - \XDScompositetrue} - {\stopXSDsimpleContent} - -\defineXMLenvironment [xsd:simpleType] [id=,name=] - {\startXSDsimpleType - \doXSDtitle{simple type}{xsd:simpleType}{name} - \doXSDkeyvals{simple type}{xsd:simpleType}{id} - \XDScompositetrue} - {\stopXSDsimpleType} - -\defineXMLenvironment [xsd:union] [id=,memberTypes=] - {\startXSDcapsule - \doXSDbanner{union} - \doXSDkeyvals{union}{xsd:union}{id,memberTypes} - \XDScompositetrue} - {\stopXSDcapsule} - -\defineXMLenvironment [xsd:unique] [id=,name=] - {\startXSDcapsule - \doXSDbanner{unique} - \doXSDkeyvals{unique}{xsd:unique}{id,name} - \XDScompositetrue} - {\stopXSDcapsule} - -\def\defineXSDfacet - {\dotripleempty\dodefineXSDfacet} - -\def\dodefineXSDfacet[#1][#2][#3]% - {\defineXMLenvironment[xsd:#1][#2] - {\startXSDcapsule - \doXSDkeyvals{#1}{xsd:#1}{#3} - \XDScompositetrue} - {\stopXSDcapsule} - \defineXMLsingular[xsd:#1][#2] - {\doXSDkeyvals{#1}{xsd:#1}{#3}}} - -\defineXSDfacet [duration] [id=,value=,fixed=] [id,value,fixed] -\defineXSDfacet [encoding] [id=,value=,fixed=] [id,value,fixed] -\defineXSDfacet [enumeration] [id=,value=,fixed=] [id,value,fixed] - -\defineXSDfacet [length] [id=,value=,fixed=] [id,value,fixed] -\defineXSDfacet [minLength] [id=,value=,fixed=] [id,value,fixed] -\defineXSDfacet [maxLength] [id=,value=,fixed=] [id,value,fixed] -\defineXSDfacet [minInclusive] [id=,value=,fixed=] [id,value,fixed] -\defineXSDfacet [maxInclusive] [id=,value=,fixed=] [id,value,fixed] -\defineXSDfacet [minExclusive] [id=,value=,fixed=] [id,value,fixed] -\defineXSDfacet [maxExclusive] [id=,value=,fixed=] [id,value,fixed] - -\defineXSDfacet [pattern] [id=,value=,fixed=] [id,value,fixed] -\defineXSDfacet [period] [id=,value=,fixed=] [id,value,fixed] -\defineXSDfacet [precision] [id=,value=,fixed=] [id,value,fixed] -\defineXSDfacet [scale] [id=,value=,fixed=] [id,value,fixed] - -\defineXSDfacet [field] [id=,xpath=] [id,xpath] -\defineXSDfacet [selector] [id=,xpath=] [id,xpath] - -\defineXSDfacet - [any] - [id=,namespace=,minOccurs=,maxOccurs=,processContents=] - [id,namespace,minOccurs,maxOccurs,processContent] - -\defineXSDfacet - [anyAttribute] - [id=,namespace=,processContents=] - [id,namespace,processContents] - -\defineXSDfacet - [import] - [id=,namespace=,schemaLocation=] - [id,namespace,schemaLocation] - -\defineXSDfacet - [include] - [id=,schemaLocation=] - [id,schemaLocation] - -\defineXSDfacet - [notation] - [id=,name=,public=,system=] - [id,name,public,system] - -\endinput diff --git a/tex/context/base/x-sch-01.mkii b/tex/context/base/x-sch-01.mkii new file mode 100644 index 000000000..d72cbf89c --- /dev/null +++ b/tex/context/base/x-sch-01.mkii @@ -0,0 +1,122 @@ +%D \module +%D [ file=x-sch-01, +%D version=2001.10.04, +%D title=\CONTEXT\ Style File, +%D subtitle=XML Schema Presentation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This style wraps around the core schema visualizer, +%D implemented in \type {x-sch-00}. This is an experimental +%D style, more will follow. +%D +%D \starttyping +%D texexec --use=sch-01 x-fig-00.xsd --pdf +%D \stoptyping + +\doifnothing {\jobfilename} {\end} +\doiffileelse {\jobfilename.xsd} {} {\end} + +\usemodule[sch-00,con-01] + +\remapXMLnamespace [xs] [xsd] + +\setuplayout + [backspace=1.5cm, + topspace=1.5cm, + bottomspace=1cm, + width=middle, + height=middle, + header=1.5cm, + footer=1.5cm] + +\setupcolors + [state=start] + +\setupbackgrounds + [page] + [background=goback] + +\setupbackgrounds + [text] + [background=gonext] + +\defineoverlay + [goback] + [\overlaybutton{PreviousJump}] + +\defineoverlay + [gonext] + [\overlaybutton{nextpage}] + +\setuppagenumbering + [location=footer] + +\usetypescript + [palatino] + [\defaultencoding] + +\setupbodyfont + [palatino,10pt] + +%\setupinteraction +% [state=start, +% color=, +% contrastcolor=, +% style=] + +\setuplist + [xsd:names] + [interaction=all, + width=0pt, + alternative=c] + +\setupregister + [xsd:index] + [interaction=text, + symbol=none] + +\setuphead + [chapter] + [style=\bfd, + header=high] + +\setuphead + [section] + [style=\bfb] + +\lowercasestring \jobfilename \to \lcjobfilename + +\setupheadertexts + [\lcjobfilename] + +\starttext + +\title{Schema \quote{\lcjobfilename.xsd}} + +\subject{Names in order of definition} + +\startcolumns[n=3] + \placelist[xsd:names][criterium=current] +\stopcolumns + +\subject{Names in alphabetic order} + +\startcolumns[n=3] + \placeregister[xsd:index][criterium=current] +\stopcolumns + +\subject{Meaning of background colors} + +\placeXSDlegenda + +\subject{Schema components} + +\processXMLfilegrouped{\jobfilename.xsd} + +\stoptext diff --git a/tex/context/base/x-sch-01.tex b/tex/context/base/x-sch-01.tex deleted file mode 100644 index d72cbf89c..000000000 --- a/tex/context/base/x-sch-01.tex +++ /dev/null @@ -1,122 +0,0 @@ -%D \module -%D [ file=x-sch-01, -%D version=2001.10.04, -%D title=\CONTEXT\ Style File, -%D subtitle=XML Schema Presentation, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This style wraps around the core schema visualizer, -%D implemented in \type {x-sch-00}. This is an experimental -%D style, more will follow. -%D -%D \starttyping -%D texexec --use=sch-01 x-fig-00.xsd --pdf -%D \stoptyping - -\doifnothing {\jobfilename} {\end} -\doiffileelse {\jobfilename.xsd} {} {\end} - -\usemodule[sch-00,con-01] - -\remapXMLnamespace [xs] [xsd] - -\setuplayout - [backspace=1.5cm, - topspace=1.5cm, - bottomspace=1cm, - width=middle, - height=middle, - header=1.5cm, - footer=1.5cm] - -\setupcolors - [state=start] - -\setupbackgrounds - [page] - [background=goback] - -\setupbackgrounds - [text] - [background=gonext] - -\defineoverlay - [goback] - [\overlaybutton{PreviousJump}] - -\defineoverlay - [gonext] - [\overlaybutton{nextpage}] - -\setuppagenumbering - [location=footer] - -\usetypescript - [palatino] - [\defaultencoding] - -\setupbodyfont - [palatino,10pt] - -%\setupinteraction -% [state=start, -% color=, -% contrastcolor=, -% style=] - -\setuplist - [xsd:names] - [interaction=all, - width=0pt, - alternative=c] - -\setupregister - [xsd:index] - [interaction=text, - symbol=none] - -\setuphead - [chapter] - [style=\bfd, - header=high] - -\setuphead - [section] - [style=\bfb] - -\lowercasestring \jobfilename \to \lcjobfilename - -\setupheadertexts - [\lcjobfilename] - -\starttext - -\title{Schema \quote{\lcjobfilename.xsd}} - -\subject{Names in order of definition} - -\startcolumns[n=3] - \placelist[xsd:names][criterium=current] -\stopcolumns - -\subject{Names in alphabetic order} - -\startcolumns[n=3] - \placeregister[xsd:index][criterium=current] -\stopcolumns - -\subject{Meaning of background colors} - -\placeXSDlegenda - -\subject{Schema components} - -\processXMLfilegrouped{\jobfilename.xsd} - -\stoptext diff --git a/tex/context/base/x-xml-01.mkii b/tex/context/base/x-xml-01.mkii new file mode 100644 index 000000000..9502ab71a --- /dev/null +++ b/tex/context/base/x-xml-01.mkii @@ -0,0 +1,91 @@ +%D \module +%D [ file=x-xml-01, +%D version=2001.10.10, +%D title=\CONTEXT\ XML Style File, +%D subtitle=Formatting X?? files, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% texexec --use=xml-format yourfile.x** [--mode=packed,wide] +% +% pdftotext yourfile.pdf yournewfile.x** + +\doifnothing {\inputfilename} {\end} +\doiffileelse {\inputfilename} {} {\end} + +% The following makes pdftotext too slow: +% +% \definepapersize +% [mine] +% [height=.99\maxdimen, +% width=200cm] +% +% \setuppapersize +% [mine] +% [mine] +% +% \setupbodyfont +% [0.4pt,tt] +% +% this is faster +% +% \setuppapersize +% [A0][A0] +% +% but normal A4 combined with 1 pt font size is the best +% +% An alternative is to use a small size, but this leads to +% too many messages +% +% \setupbodyfont +% [1pt,tt] +% +% so we stick to a more normal alternive. + +\unprotect + +\setuplayout + [\c!backspace=0cm, + \c!topspace=0cm, + %\c!width=40em, + \c!width=\v!middle, + \c!height=\v!middle, + \c!header=0cm, + \c!footer=0cm] + +\setupbodyfont [tt,10pt] +\setuptolerance [\v!verytolerant] +\setupalign [\v!broad,\v!right] +\setupXMLfile [\c!level=2] + +\startmode[wide] + + \setuplayout [\c!width=250cm] + +\stopmode + +\startmode[packed] + +% \setupXMLfile [inbetween=] + \setupXMLfile [\c!tussen=] + +\stopmode + +\protect + +% The main text: + +\def\XMLbannerprocessor#1{\string<\string ?xml #1\string ?\string>\endgraf} + +\defineXMLprocessor [xml] {\XMLbannerprocessor} + +\starttext + + \dontcomplain \showXMLfile{\inputfilename} + +\stoptext diff --git a/tex/context/base/x-xml-01.tex b/tex/context/base/x-xml-01.tex deleted file mode 100644 index 9502ab71a..000000000 --- a/tex/context/base/x-xml-01.tex +++ /dev/null @@ -1,91 +0,0 @@ -%D \module -%D [ file=x-xml-01, -%D version=2001.10.10, -%D title=\CONTEXT\ XML Style File, -%D subtitle=Formatting X?? files, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% texexec --use=xml-format yourfile.x** [--mode=packed,wide] -% -% pdftotext yourfile.pdf yournewfile.x** - -\doifnothing {\inputfilename} {\end} -\doiffileelse {\inputfilename} {} {\end} - -% The following makes pdftotext too slow: -% -% \definepapersize -% [mine] -% [height=.99\maxdimen, -% width=200cm] -% -% \setuppapersize -% [mine] -% [mine] -% -% \setupbodyfont -% [0.4pt,tt] -% -% this is faster -% -% \setuppapersize -% [A0][A0] -% -% but normal A4 combined with 1 pt font size is the best -% -% An alternative is to use a small size, but this leads to -% too many messages -% -% \setupbodyfont -% [1pt,tt] -% -% so we stick to a more normal alternive. - -\unprotect - -\setuplayout - [\c!backspace=0cm, - \c!topspace=0cm, - %\c!width=40em, - \c!width=\v!middle, - \c!height=\v!middle, - \c!header=0cm, - \c!footer=0cm] - -\setupbodyfont [tt,10pt] -\setuptolerance [\v!verytolerant] -\setupalign [\v!broad,\v!right] -\setupXMLfile [\c!level=2] - -\startmode[wide] - - \setuplayout [\c!width=250cm] - -\stopmode - -\startmode[packed] - -% \setupXMLfile [inbetween=] - \setupXMLfile [\c!tussen=] - -\stopmode - -\protect - -% The main text: - -\def\XMLbannerprocessor#1{\string<\string ?xml #1\string ?\string>\endgraf} - -\defineXMLprocessor [xml] {\XMLbannerprocessor} - -\starttext - - \dontcomplain \showXMLfile{\inputfilename} - -\stoptext diff --git a/tex/context/base/x-xml-02.mkii b/tex/context/base/x-xml-02.mkii new file mode 100644 index 000000000..24f811c4d --- /dev/null +++ b/tex/context/base/x-xml-02.mkii @@ -0,0 +1,91 @@ +%D \module +%D [ file=x-xml-02, +%D version=2001.10.10, +%D title=\CONTEXT\ XML Style File, +%D subtitle=Pretty Printing, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% texexec --use=xml-pretty yourfile.x** [--mode=letter] + +\doifnothing {\inputfilename} {\end} +\doiffileelse {\inputfilename} {} {\end} + +\startmode[letter] + \setuppapersize[letter][letter] +\stopmode + +\setuplayout + [backspace=1.5cm, + topspace=1.5cm, + bottomspace=1cm, + width=middle, + height=middle, + header=1.5cm, + footer=1.5cm] + +\setupcolors + [state=local] + +\setuppagenumbering + [location=] + +\setuplayout + [style=type] + +\setupbodyfont + [10pt,tt] + +\setuptolerance + [verytolerant] + +\setupalign + [broad,right] + +\lowercasestring\inputfilename \to \lcinputfilename +\defconvertedcommand\lcinputfilename\lcinputfilename % make _ safe + +\setupheadertexts + [\lcinputfilename] + +\setupfootertexts + [\currentdate\space\string| \currenttime\space \string| \pagenumber] + +% let's have a look at the type of content: + +\setupXMLfile + [level=2] + +\startmode[*suffix-xml] + % ok +\stopmode + +\startmode[*suffix-rng] + \showXMLlin[value] +\stopmode + +\startmode[*suffix-rlg] + \showXMLlin + [rl:type,rl:state,rl:name,rl:suffix,rl:label,rl:file,rl:original, + rl:width,rl:height,rl:base,rl:page] +\stopmode + +\startmode[*suffix-exa] + \showXMLlin + [exa:resolve,exa:include] +\stopmode + +\def\XMLbannerprocessor#1{\string<\string ?xml #1\string ?\string>\endgraf} + +\defineXMLprocessor [xml] {\XMLbannerprocessor} + +\starttext + +\showXMLfile{\inputfilename} + +\stoptext diff --git a/tex/context/base/x-xml-02.tex b/tex/context/base/x-xml-02.tex deleted file mode 100644 index 24f811c4d..000000000 --- a/tex/context/base/x-xml-02.tex +++ /dev/null @@ -1,91 +0,0 @@ -%D \module -%D [ file=x-xml-02, -%D version=2001.10.10, -%D title=\CONTEXT\ XML Style File, -%D subtitle=Pretty Printing, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% texexec --use=xml-pretty yourfile.x** [--mode=letter] - -\doifnothing {\inputfilename} {\end} -\doiffileelse {\inputfilename} {} {\end} - -\startmode[letter] - \setuppapersize[letter][letter] -\stopmode - -\setuplayout - [backspace=1.5cm, - topspace=1.5cm, - bottomspace=1cm, - width=middle, - height=middle, - header=1.5cm, - footer=1.5cm] - -\setupcolors - [state=local] - -\setuppagenumbering - [location=] - -\setuplayout - [style=type] - -\setupbodyfont - [10pt,tt] - -\setuptolerance - [verytolerant] - -\setupalign - [broad,right] - -\lowercasestring\inputfilename \to \lcinputfilename -\defconvertedcommand\lcinputfilename\lcinputfilename % make _ safe - -\setupheadertexts - [\lcinputfilename] - -\setupfootertexts - [\currentdate\space\string| \currenttime\space \string| \pagenumber] - -% let's have a look at the type of content: - -\setupXMLfile - [level=2] - -\startmode[*suffix-xml] - % ok -\stopmode - -\startmode[*suffix-rng] - \showXMLlin[value] -\stopmode - -\startmode[*suffix-rlg] - \showXMLlin - [rl:type,rl:state,rl:name,rl:suffix,rl:label,rl:file,rl:original, - rl:width,rl:height,rl:base,rl:page] -\stopmode - -\startmode[*suffix-exa] - \showXMLlin - [exa:resolve,exa:include] -\stopmode - -\def\XMLbannerprocessor#1{\string<\string ?xml #1\string ?\string>\endgraf} - -\defineXMLprocessor [xml] {\XMLbannerprocessor} - -\starttext - -\showXMLfile{\inputfilename} - -\stoptext diff --git a/tex/context/base/x-xml-11.mkii b/tex/context/base/x-xml-11.mkii new file mode 100644 index 000000000..c1b185b55 --- /dev/null +++ b/tex/context/base/x-xml-11.mkii @@ -0,0 +1,134 @@ +%D \module +%D [ file=x-xml-11, +%D version=2004.09.16, +%D title=\CONTEXT\ XML Style File, +%D subtitle=Formatting X?? files, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% xmltools --analyze yourfile.xml +% texexec --use=xml-analyze yourfile.* + +% \doifnothing {\inputfilename} {\end} +% \doiffileelse {\inputfilename} {} {\end} + +\doifnothing {\jobfullname} {\end} +\doiffileelse {\jobfullname} {} {\end} + +\useXMLfilter[ent] +\useXMLfilter[utf] + +\chardef\XMLtokensreduction\plustwo + +\definehead + [SomeElement] + [subsection] + +\setuphead + [SomeElement] + [ownnumber=yes, + style=\tfb, + numberstyle=\tfxx, + alternative=margin] + +\setuplayout + [width=middle, + height=middle, + backspace=2cm, + cutspace=1cm, + topspace=1cm, + header=0pt] + +\setupfootertexts + [\jobfullname] % [\inputfilename] + +\usetypescript[modern][texnansi] \setupbodyfont[modern,tt,10pt] + +\defineXMLenvironment + [document] + {} + {} + +\defineXMLpickup + [entities][n=0] + {\expanded{\SomeElement{\XMLop{n}}{Entities}} + \starttabulate[|l|l|l|]} + {\stoptabulate} + +\defineXMLcommand % ugly hack (make macro of it) + [entity][name=,n=0] + {\startexpanded + \noexpand \NC \XMLop{name} + \noexpand \NC \XMLop{n} + \noexpand \NC \noexpand\doXMLentity\XMLop{name}; + \noexpand \NC + \noexpand \NR + \stopexpanded} + +\defineXMLpickup + [characters][n=0] + {\expanded{\SomeElement{\XMLop{n}}{Characters}} + \bgroup + \let\nonbreakablespace\empty % messes up the table + \starttabulate[|l|r|r|l|l|l|l|]} + {\stoptabulate + \egroup} + +% todo: narrowtt + +\defineXMLcommand + [character][number=,utf=,n=0,uname=,pname=,cname=] + {\startexpanded + \noexpand \NC \noexpand \unicodehexnumber{\XMLop{number}} + \noexpand \NC \XMLop{number} + \noexpand \NC \XMLop{n} + \noexpand \NC \noexpand \unicodechar {\XMLop{number}} + \noexpand \NC \tx \lowercase\expandafter{\XMLop{uname}} + \noexpand \NC \tx \noexpand \unicodepair {\XMLop{number}} + \noexpand \NC \tx \XMLop{cname} + \noexpand \NC + \noexpand \NR + \stopexpanded} + +\defineXMLenvironment + [elements] + {} + {} + +\newtoks \TabulateToks + +\defineXMLpickup + [element][name=,n=0] + {\expanded{\SomeElement{\XMLop{n}}{\XMLop{name}}} + \TabulateToks\emptytoks} + {\starttabulate[|l|r|p|] + \the\TabulateToks + \stoptabulate} + +\defineXMLenvironment + [attribute][name=] + {\xdef\AttributeName{\XMLop{name}}} + {} + +\defineXMLenvironment + [instance][value=,n=0] + {\appendetoks + \noexpand \NC \AttributeName + \noexpand \NC \XMLop{n} + \noexpand \NC \XMLop{value} + \noexpand \NC + \noexpand \NR + \to \TabulateToks} + {\xdef\AttributeName{}} + +\starttext + +% \processXMLfilegrouped{\inputfilename} +\processXMLfilegrouped{\jobfullname} + +\stoptext diff --git a/tex/context/base/x-xml-11.tex b/tex/context/base/x-xml-11.tex deleted file mode 100644 index c1b185b55..000000000 --- a/tex/context/base/x-xml-11.tex +++ /dev/null @@ -1,134 +0,0 @@ -%D \module -%D [ file=x-xml-11, -%D version=2004.09.16, -%D title=\CONTEXT\ XML Style File, -%D subtitle=Formatting X?? files, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% xmltools --analyze yourfile.xml -% texexec --use=xml-analyze yourfile.* - -% \doifnothing {\inputfilename} {\end} -% \doiffileelse {\inputfilename} {} {\end} - -\doifnothing {\jobfullname} {\end} -\doiffileelse {\jobfullname} {} {\end} - -\useXMLfilter[ent] -\useXMLfilter[utf] - -\chardef\XMLtokensreduction\plustwo - -\definehead - [SomeElement] - [subsection] - -\setuphead - [SomeElement] - [ownnumber=yes, - style=\tfb, - numberstyle=\tfxx, - alternative=margin] - -\setuplayout - [width=middle, - height=middle, - backspace=2cm, - cutspace=1cm, - topspace=1cm, - header=0pt] - -\setupfootertexts - [\jobfullname] % [\inputfilename] - -\usetypescript[modern][texnansi] \setupbodyfont[modern,tt,10pt] - -\defineXMLenvironment - [document] - {} - {} - -\defineXMLpickup - [entities][n=0] - {\expanded{\SomeElement{\XMLop{n}}{Entities}} - \starttabulate[|l|l|l|]} - {\stoptabulate} - -\defineXMLcommand % ugly hack (make macro of it) - [entity][name=,n=0] - {\startexpanded - \noexpand \NC \XMLop{name} - \noexpand \NC \XMLop{n} - \noexpand \NC \noexpand\doXMLentity\XMLop{name}; - \noexpand \NC - \noexpand \NR - \stopexpanded} - -\defineXMLpickup - [characters][n=0] - {\expanded{\SomeElement{\XMLop{n}}{Characters}} - \bgroup - \let\nonbreakablespace\empty % messes up the table - \starttabulate[|l|r|r|l|l|l|l|]} - {\stoptabulate - \egroup} - -% todo: narrowtt - -\defineXMLcommand - [character][number=,utf=,n=0,uname=,pname=,cname=] - {\startexpanded - \noexpand \NC \noexpand \unicodehexnumber{\XMLop{number}} - \noexpand \NC \XMLop{number} - \noexpand \NC \XMLop{n} - \noexpand \NC \noexpand \unicodechar {\XMLop{number}} - \noexpand \NC \tx \lowercase\expandafter{\XMLop{uname}} - \noexpand \NC \tx \noexpand \unicodepair {\XMLop{number}} - \noexpand \NC \tx \XMLop{cname} - \noexpand \NC - \noexpand \NR - \stopexpanded} - -\defineXMLenvironment - [elements] - {} - {} - -\newtoks \TabulateToks - -\defineXMLpickup - [element][name=,n=0] - {\expanded{\SomeElement{\XMLop{n}}{\XMLop{name}}} - \TabulateToks\emptytoks} - {\starttabulate[|l|r|p|] - \the\TabulateToks - \stoptabulate} - -\defineXMLenvironment - [attribute][name=] - {\xdef\AttributeName{\XMLop{name}}} - {} - -\defineXMLenvironment - [instance][value=,n=0] - {\appendetoks - \noexpand \NC \AttributeName - \noexpand \NC \XMLop{n} - \noexpand \NC \XMLop{value} - \noexpand \NC - \noexpand \NR - \to \TabulateToks} - {\xdef\AttributeName{}} - -\starttext - -% \processXMLfilegrouped{\inputfilename} -\processXMLfilegrouped{\jobfullname} - -\stoptext diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua index 7285b2c5e..69a2b3e8c 100644 --- a/tex/generic/context/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 01/23/11 21:48:38 +-- merge date : 01/24/11 10:00:19 do -- begin closure to overcome local limits and interference -- cgit v1.2.3