diff options
Diffstat (limited to 'tex/context/base')
42 files changed, 1731 insertions, 652 deletions
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex index 451aef0c7..e8ca518a3 100644 --- a/tex/context/base/cont-new.tex +++ b/tex/context/base/cont-new.tex @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2006.04.27 15:59} +\newcontextversion{2006.05.08 12:59} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new @@ -675,6 +675,8 @@ % \egroup % % more generic +% +% IS THIS STILL OK? TO BE CHECKED (UTF AND SUCH) ! ! ! ! \def\XMLexpanded#1% {\bgroup @@ -1277,8 +1279,8 @@ \prependtoks \normalenableXML \to \everyXMLinputmode \appendtoks \processingXMLtrue \to \everyXMLinputmode -\def\enableXML {\setinputmode[XML]} -\def\disableXML{\setinputmode[TEX]} +\unexpanded\def\enableXML {\setinputmode[XML]} % \enableXML is used in edef's and marks +\unexpanded\def\disableXML{\setinputmode[TEX]} \beginTEX diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex index 035091084..e2e646813 100644 --- a/tex/context/base/context.tex +++ b/tex/context/base/context.tex @@ -31,7 +31,7 @@ %D 2004.8.30 the low level interface is english. Watch out and adapt %D your styles an modules. -\def\contextversion{2006.04.27 15:59} +\def\contextversion{2006.05.08 12:59} %D For those who want to use this: @@ -380,15 +380,13 @@ %D Temporary hack, will go when we move to newtexexec: -\unprotect - -\appendtoks % newtexexec/newtexutil, after option file is loaded: - \doif{\systemparameter\c!method} {2} - {\def\TEXEXECcommand{texmfstart newtexexec} % - \readsysfile {sort-ini} {} {}}% -\to \everyjob - -\protect +% \unprotect +% \appendtoks % newtexexec/newtexutil, after option file is loaded: +% \doif{\systemparameter\c!method} {2} +% {\def\TEXEXECcommand{texmfstart newtexexec} % +% \readsysfile {sort-ini} {} {}}% +% \to \everyjob +% \protect % %D The next two modules implement some additional % %D functionality concerning classes of documents and output. diff --git a/tex/context/base/core-des.tex b/tex/context/base/core-des.tex index c38a6b8c0..2f5dafd31 100644 --- a/tex/context/base/core-des.tex +++ b/tex/context/base/core-des.tex @@ -15,6 +15,8 @@ \unprotect +% beware: \insidedescription should be set to zero inside footnotes + % Dit kan en moet dus anders: % % \start... : \vbox\bgroup @@ -51,7 +53,7 @@ \newbox\@@descriptionbox -\def\descriptionparameter #1{\csname\??dd\currentdescription#1\endcsname} +\def\descriptionparameter#1{\csname\??dd\currentdescription#1\endcsname} \def\@@descriptionhandler{\descriptionparameter{\s!do\c!command}} @@ -240,14 +242,14 @@ \advance\leftskip -\leftskipadaption \relax \ifdim\leftskipadaption=\zeropoint \leftskipadaption1.5em % just some default - \ifnum\insidedefinition=\plusone + \ifnum\insidedescription=\plusone \ifdim\leftskip>\zeropoint \relax \leftskipadaption\leftskip \fi \fi \fi - \ifnum\insidedefinition=\plusone - \advance\leftskip \leftskipadaption + \ifnum\insidedescription>\zerocount % was \ifnum\insidedescription=\plusone + \advance\leftskip \leftskipadaption % but we're already further on \fi \hskip-\leftskipadaption \ifhbox\@@descriptionbox\unhcopy\else\copy\fi\@@descriptionbox @@ -266,7 +268,10 @@ %D A new key 'headalign' in definitions. -\chardef\insidedefinition=0 +\def\resetdescriptions % to be used in e.g. footnotes + {\chardef\insidedescription\zerocount} + +\resetdescriptions \let\@@leftdescriptionskip \!!zeropoint \let\@@rightdescriptionskip\!!zeropoint @@ -307,16 +312,16 @@ \doifelse{\descriptionparameter\c!aligntitle}\v!no {\edef\@@leftdescriptionskip {\the\leftskip }% \edef\@@rightdescriptionskip{\the\rightskip}} - {\ifcase\insidedefinition + {\ifcase\insidedescription \edef\@@leftdescriptionskip {\the\leftskip }% \edef\@@rightdescriptionskip{\the\rightskip}% \fi}% \expanded{\indenting[\descriptionparameter\c!indenting]}% % better a system mode - \ifcase\insidedefinition - \chardef\insidedefinition\plusone + \ifcase\insidedescription + \chardef\insidedescription\plusone \or - \chardef\insidedefinition\plustwo + \chardef\insidedescription\plustwo \fi} % now happens elsewhere : \noindent\ignorespaces \def\@@stopdescription#1% @@ -324,9 +329,10 @@ % was \par \dostopattributes % here, else problems with interlinespace and font change \dostopparbasedattributes % == \settrue\parbasedattributes \dostopattributes \endgroup - \descriptionparameter\c!after + \descriptionparameter\c!after %hm, which currentdescription? \egroup % temporary hack - \dochecknextindentation{\??dd#1}% \currentdescription}} + \def\currentdescription{#1}% + \dochecknextindentation{\??dd\currentdescription}% \dorechecknextindentation} \def\@@dodescription @@ -335,18 +341,6 @@ % starters: -% \def\@@startdescription[#1][#2]% -% {\def\currentdescription{#1}% -% \doifelse{\descriptionparameter{\s!do\c!state}}\v!start -% {\@@startsomedescription{#1}[#2]{}} -% {\dowithwargument{\@@startsomedescription{#1}[#2]}}} -% -% \def\@@description[#1][#2]% -% {\def\currentdescription{#1}% -% \doifelse{\descriptionparameter{\s!do\c!state}}\v!start -% {\@@somedescription{#1}[#2]{}} -% {\dowithwargument{\@@somedescription{#1}[#2]}}} - \def\@@startdescription[#1][#2]% {\def\currentdescription{#1}% \doifelse{\descriptionparameter\c!title}\v!yes @@ -374,7 +368,8 @@ % which calls: \def\@@makedescription#1% - {\def\currentdescription{#1}% + {\postponefootnotes % new, assumes grouping + \def\currentdescription{#1}% \executeifdefined {@@description\descriptionparameter\c!location} {\getvalue{@@description\v!left}}} @@ -399,20 +394,6 @@ \def\dodosetupdescriptions[#1]% [#2]% {\getparameters[\??dd#1]} % [#2]} -% \def\dodefinedescription[#1][#2]% -% {\copyparameters[\??dd#1][\??dd] -% [\c!location,\c!headstyle,\c!style,\c!color,\c!headcolor, -% \c!width,\c!hang,\c!sample,\c!before,\c!inbetween,\c!after,\c!margin, -% \c!indenting,\c!indentnext,\c!align,\c!text,\c!distance,\c!titledistance,\c!command]% -% \getparameters[\??dd#1] -% [\s!do\c!state=\v!stop,\s!do\c!command=\normal@@descriptionhandler,\c!level=,#2]% -% %\doifvalue{\??dd#1\c!location}\v!top{\doassign[\??dd#1][\c!inbetween=\blank]}% -% \doifvalue{\??dd#1\c!location}\v!top % we actually need more granularity -% {\doifnotvalue{\??dd#1\c!inbetween}{\doassign[\??dd#1][\c!inbetween=\blank]}}% -% \setvalue {#1}{\dodoubleempty\@@description[#1]}% -% \setvalue{\e!start#1}{\dodoubleempty\@@startdescription[#1]}% -% \setvalue{\e!stop #1}{\@@stopdescription{#1}}}% - \def\dodefinedescription[#1][#2]% {\copyparameters[\??dd#1][\??dd] [\c!location,\c!headstyle,\c!style,\c!color,\c!headcolor,\c!title, @@ -437,62 +418,6 @@ \def\currentdescriptionnumber {\csname\??dd\currentdescription\??dd\c!number\endcsname} -% \def\special@@descriptionhandler[#1]#2#3% -% {\strut -% \doifelse{\descriptionparameter\c!number}\v!no -% \!!doneafalse{\doifelse{#1}{-}\!!doneafalse\!!doneatrue}% -% \chardef\descriptioncoupling\zerocount -% \iflocation -% \doifsomething{\descriptionparameter\c!coupling} -% {\processaction % genereert > of < -% [\descriptionparameter\c!couplingway] -% [ \v!local=>\chardef\descriptioncoupling\plusone, % old: default -% \v!global=>\chardef\descriptioncoupling\plustwo]}% new: global crosslinking -% \fi -% \setupnumber % the number is called indirectly -% [\currentdescriptionnumber] -% [\c!sectionnumber=\descriptionparameter\c!sectionnumber]% -% \if!!donea -% \makeprecedingsectionnumber[\currentdescriptionnumber]% -% \preparethenumber{\??dd\currentdescription}\precedingsectionnumber\preparednumber -% \iftrialtypesetting\startlocal\fi -% \getvalue{\e!next\currentdescription}% tricky but we need the preroll -% \iftrialtypesetting\stoplocal\fi -% % \getvalue{\e!next#2#1}% -% \iflocation -% \bgroup -% \letvalue{\??dd\currentdescription\c!sectionnumber}\v!yes -% \protectconversion -% \makeprecedingsectionnumber[\currentdescriptionnumber]% -% \preparethenumber{\??dd\currentdescription}\precedingsectionnumber\preparednumber -% \ifcase\descriptioncoupling \or -% \xdef\@@internalenumber{\doshowdnnumber}% -% \rawreference\s!num{#1:\@@internalenumber}{}% -% \or -% \xdef\@@internalenumber{\countervalue{\??dd\c!coupling\currentdescription}}% -% \rawreference\s!num{\currentdescription:\@@internalenumber}{}% -% \fi -% \egroup -% \fi -% %\makeprecedingsectionnumber[\currentdescriptionnumber]% -% %\preparethenumber{\??dd\currentdescription}\precedingsectionnumber\preparednumber -% \disablepseudocaps % sorry, uppercase causes troubles -% \doattributes % \nocase primitive needed -% {\??dd\currentdescription}\c!headstyle\c!headcolor % todo: sub as well -% {\descriptionparameter\c!command{\showdntext\domakednnumber}}% hook for taco -% \iflocation\ifcase\descriptioncoupling \else -% \edef\localconnection{\descriptionparameter\c!coupling:\@@internalenumber}% -% \doifreferencefoundelse\localconnection -% {\in[\localconnection]}\donothing % genereert > of < -% \fi\fi -% \doifnot{#1}{-}{\rawreference\s!num{#1}{\doshowdnnumber}}% -% \else % Why was this strange expansion needed? -% \edef\!!stringa{\showdnpuretext}% nog eens testen binnen \expanded -% \expanded{\doattributes{\??dd\currentdescription}\noexpand\c!headstyle\noexpand\c!headcolor -% {\noexpand\descriptionparameter\noexpand\c!command{\!!stringa}}}% -% \doifnot{#1}{-}{\rawreference\s!num{#1}{}}% -% \fi} - \def\special@@descriptionhandler[#1]#2#3% {\strut \doifelse{\descriptionparameter\c!number}\v!no @@ -668,49 +593,6 @@ \def\setupenumerations {\dodoubleempty\dosetupenumerations} -% \def\dododefineenumeration#1#2#3[#4][#5]% -% {\makecounter{\??dd\c!coupling#1}% new: global cross linking -% \dodefinedescription[#3#1]% -% [\s!do\c!state=\v!start,\c!level=#3, -% \s!do\c!command=\special@@descriptionhandler]% -% \copyparameters[\??dd#3#1][\??dn] -% [\c!location,\c!headstyle,\c!style,\c!color,\c!headcolor, -% \c!width,\c!number,\c!distance,\c!command, -% \c!sample,\c!hang,\c!align,\c!before,\c!inbetween,\c!after, -% \c!levels,\c!way,\c!blockway,\c!separator,\c!margin, -% \c!indenting,\c!indentnext,\c!stopper,\c!sectionnumber, -% \c!number]% -% \doifassignmentelse{#4} -% {\getparameters[\??dd#3#1]% -% [\c!text=#1,\??dd\c!number=#1,\c!conversion=, -% \c!left=,\c!right=,\c!coupling=,\c!couplingway=\v!local,#4]}% -% {\doifelsenothing{#4} -% {\getparameters[\??dd#3#1]% -% [\c!text=#1,\??dd\c!number=#1,\c!conversion=, -% \c!stopper=, -% \c!left=,\c!right=,\c!coupling=,\c!couplingway=,#4]}% -% {\copyparameters[\??dd#3#1][\??dd#3#4] -% [\c!location,\c!headstyle,\c!style,\c!color,\c!headcolor, -% \c!width,\c!number,\c!distance,\c!command,\c!margin, -% \c!sample,\c!hang,\c!align,\c!before,\c!inbetween,\c!after, -% \c!stopper,\c!indenting,\c!indentnext,\c!left,\c!right, -% \c!coupling,\c!couplingway]% -% \getparameters[\??dd#3#1] -% [\c!text=#1,\??dd\c!number=#4,\c!conversion=,#5]}}% -% \doifvalue{\??dd#3#1\??dd\c!number}{#1} -% {\definenumber -% [#3#1] -% [\c!way=\descriptionparentparameter\c!way, -% \c!blockway=\descriptionparentparameter\c!blockway, -% \c!sectionnumber=\descriptionparentparameter\c!sectionnumber]% -% \doifvalue{\??dd#1\c!levels}{#2}% % for -% {\doifsomething{\getvalue{\??dd#1\c!conversion}}% % old -% {\setupnumber[#3#1] % times -% [\c!conversion=\descriptionparameter\c!conversion]}}}% % sake -% \setvalue{\s!set #3#1}{\dosetenumerationnumber[#1][#3]}% -% \setvalue{\s!reset#3#1}{\doresetenumerationnumber[#1][#3]}% -% \setvalue{\e!next #3#1}{\dotripleempty\donextenumerationnumber[#1][#3]}} - \def\dododefineenumeration#1#2#3[#4][#5]% {\makecounter{\??dd\c!coupling#1}% new: global cross linking \dodefinedescription[#3#1]% diff --git a/tex/context/base/core-mar.tex b/tex/context/base/core-mar.tex index 836d90430..5933249e8 100644 --- a/tex/context/base/core-mar.tex +++ b/tex/context/base/core-mar.tex @@ -36,12 +36,12 @@ \beginTEX \def\mainmarking#1% - {\@EA\ifx\csname\??mk#1\c!coupling\endcsname\else + {\@EA\ifx\csname\??mk#1\c!coupling\endcsname\relax\else \csname\??mk#1\c!coupling\endcsname \fi} \def\fastresetmarker#1% - {\@EA\ifx\csname\??mk#1\c!coupling\endcsname\else + {\@EA\ifx\csname\??mk#1\c!coupling\endcsname\relax\else \@EA\resetmark\csname\??mk\csname\??mk#1\c!coupling\endcsname\endcsname \fi} @@ -227,14 +227,14 @@ \endETEX -\def\fetchmark[#1][#2]% % expandable / never use \unexpanded - {\ifcsname\??mk::#1\endcsname % saved mark - \csname\??mk::\??mk::#2\@EA\@EA\@EA\endcsname - \csname\??mk::#1\endcsname - \else\ifcsname\??mk#1\c!coupling\endcsname % real mark - \csname\??mk\??mk#2\@EA\endcsname - \csname\??mk\csname\??mk#1\c!coupling\endcsname\endcsname - \fi\fi} +% \def\fetchmark[#1][#2]% % expandable / never use \unexpanded +% {\ifcsname\??mk::#1\endcsname % saved mark +% \csname\??mk::\??mk::#2\@EA\@EA\@EA\endcsname +% \csname\??mk::#1\endcsname +% \else\ifcsname\??mk#1\c!coupling\endcsname % real mark +% \csname\??mk\??mk#2\@EA\endcsname +% \csname\??mk\csname\??mk#1\c!coupling\endcsname\endcsname +% \fi\fi} \letvalue{\??mk::\??mk::\v!previous}\firstoffourarguments \letvalue{\??mk::\??mk::\v!first }\secondoffourarguments @@ -362,7 +362,7 @@ \beginTEX \def\domarking[#1]#2% - {\@EA\ifx\csname\??mk#1\c!coupling\endcsname\else + {\@EA\ifx\csname\??mk#1\c!coupling\endcsname\relax\else \bgroup \doifelsevalue{\??mk#1\c!expansion}\v!yes \expandmarkstrue\expandmarksfalse diff --git a/tex/context/base/core-not.tex b/tex/context/base/core-not.tex index 6ab983ec1..d4c2a5dcf 100644 --- a/tex/context/base/core-not.tex +++ b/tex/context/base/core-not.tex @@ -82,8 +82,8 @@ \def\notedefparameter #1{\csname\??vn\??vn\currentnote#1\endcsname} \def\footnoteparameter #1{\csname\??vn \v!footnote#1\endcsname} -\def\startnotedef {\csname\e!start\??vn\??vn\currentnote\endcsname} -\def\stopnotedef {\csname\e!stop \??vn\??vn\currentnote\endcsname} +\def\startnotedef {\resetdescriptions\csname\e!start\??vn\??vn\currentnote\endcsname} +\def\stopnotedef {\csname\e!stop \??vn\??vn\currentnote\endcsname} \def\noteinsertion #1{\csname\??vn:#1\endcsname} \def\currentnoteins {\csname\??vn:\currentnote\endcsname} @@ -590,9 +590,27 @@ \@EA\gobbletwoarguments \fi} -\def\nododonote#1% - {\doifnot{#1}{-}{\kern.5em}% quick hack, approximation - \gobbleoneargument} +% \def\nododonote#1% +% {\doifnot{#1}{-}{\kern.5em}% quick hack, approximation +% \gobbleoneargument} +% +% more correct: + +\long\def\nododonote#1#2% + {\doifnot{#1}{-} + {\ifconditional\pagewisenotes + \doifreferencefoundelse{\s!fnt:t:\internalfootreference} + {\ifnum\currentrealreference>\lastnotepage\relax + \globallet\lastnotepage\currentrealreference + \resetnumber[\currentnote]% + \fi} + {}% + \fi + \incrementnumber[\currentnote]% + \makesectionnumber[\currentnote]% + \let\lastnotenumber\composedsectionnumber + \dolastnotesymbol + \decrementnumber[\currentnote]}} \def\dododonote#1% {\doglobal\increment\internalfootreference diff --git a/tex/context/base/core-pgr.tex b/tex/context/base/core-pgr.tex index e6a56093b..fa0836dee 100644 --- a/tex/context/base/core-pgr.tex +++ b/tex/context/base/core-pgr.tex @@ -432,9 +432,9 @@ %D The auxiliary \METAPOST\ macros are defined by default, %D by saying: -\appendtoks +\startMPextensions if unknown context_core : input mp-core.mp ; fi ; -\to \MPextensions +\stopMPextensions %D Some of these macros are pretty clever but too complicated %D to be nice. When things are kind of stable I'll clean up @@ -619,9 +619,9 @@ %D We need to treat floats in a special way. -\appendtoks +\startMPinitializations local_multi_par_area:=\iflocalpositioning true\else false\fi; -\to \MPinitializations +\stopMPinitializations \def\textbackgroundoverlay#1% {\iflocalpositioning\v!local\else\v!text\fi#1} diff --git a/tex/context/base/core-sec.tex b/tex/context/base/core-sec.tex index 63a5254cf..35ae5db7a 100644 --- a/tex/context/base/core-sec.tex +++ b/tex/context/base/core-sec.tex @@ -225,7 +225,7 @@ \let#3#2} {% was \unexpanded \edef, but we need it unexpanded ! \edef\numberseparator{\getvalue{#1\c!separator}}% - \edef#3{\@EA\separatednumber\@EA{#2}}}} % hm, etex + \edef#3{\@EA\separatednumber\@EA{#2}\getvalue{#1\c!stopper}}}} % hm, etex \def\sectionnumberonly[#1]% {\makesectionnumber[#1]% @@ -2207,6 +2207,7 @@ \c!alternative=\@@koalternative, \c!command=\normalplacehead, \c!separator=\@@koseparator, + \c!stopper=\@@kostopper, \c!align=\@@koalign, \c!aligntitle=\@@koaligntitle, \c!tolerance=\@@kotolerance, @@ -2223,7 +2224,7 @@ {\copyparameters [\??ko#1][\??ko\getvalue{\??ko#1\c!default}] [\c!before,\c!after,\c!command,\c!file,\c!page,\c!continue, - \c!header,\c!text,\c!footer,\c!separator,\c!resetnumber, + \c!header,\c!text,\c!footer,\c!separator,\c!stopper,\c!resetnumber, \c!number,\c!ownnumber,\c!placehead,\c!incrementnumber, \c!style,\c!color,\c!distance,\c!alternative,\c!indentnext, % new per 20/03/3002 (o-pbu-l) / was too confusing @@ -2246,7 +2247,7 @@ [\??ko#1][\??ko#2] [\c!level,\c!section,\c!coupling,\c!prefix, \c!before,\c!after,\c!command,\c!file,\c!page,\c!continue, - \c!separator, + \c!separator,\c!stopper, \c!header,\c!text,\c!footer,\c!resetnumber, \c!number,\c!ownnumber,\c!placehead,\c!incrementnumber, \c!style,\c!color,\c!distance,\c!alternative,\c!indentnext, @@ -2309,6 +2310,7 @@ [\c!alternative=\v!normal, \c!sectionnumber=\v!yes, \c!separator=., + \c!stopper=, \c!limittext=\v!yes, \c!align=, \c!aligntitle=, diff --git a/tex/context/base/core-var.tex b/tex/context/base/core-var.tex index 5d0cc1d5d..9144606e9 100644 --- a/tex/context/base/core-var.tex +++ b/tex/context/base/core-var.tex @@ -496,6 +496,35 @@ {\executeifdefined{\??vars:#1:#2}}% {#3} %D \macros +%D {defineselector,setupselector} +%D +%D \starttyping +%D \defineselector[caption][max=2,n=2] +%D +%D \start +%D \setupselector[caption][n=1] +%D \placelist[figure][criterium=all] +%D \stop +%D +%D \starttext +%D \placefigure +%D {\select{caption}{zapf}{\input zapf \relax}} +%D {} +%D \stoptext +%D \stoptyping + +\def\defineselector{\dodoubleargument\dodefineselector} +\def\setupselector {\dodoubleargument\dosetupselector} + +\def\dodefineselector[#1][#2]{\getparameters[\??sx#1][\c!max=2,\c!n=1,#2]} +\def\dosetupselector [#1][#2]{\getparameters[\??sx#1][#2]} + +\unexpanded\def\select#1% + {\filterfromnext + {\executeifdefined{\??sx#1\c!max}1} + {\executeifdefined{\??sx#1\c!n }1}} + +%D \macros %D {checkvariables} %D %D I'll probably forget that this on exists. diff --git a/tex/context/base/enco-ini.tex b/tex/context/base/enco-ini.tex index 17c702037..be1cd966c 100644 --- a/tex/context/base/enco-ini.tex +++ b/tex/context/base/enco-ini.tex @@ -1143,6 +1143,8 @@ \else \enablepatterntokens \fi +\let\dochar\thechr +% \enableregime[utf]% \lccode16=16 % brrr, extra quote in ec (turkish) \lccode17=17 % brrr, extra quote in ec (turkish) \lccode`\-=`\- diff --git a/tex/context/base/font-ini.tex b/tex/context/base/font-ini.tex index 1dc28a250..fa8523845 100644 --- a/tex/context/base/font-ini.tex +++ b/tex/context/base/font-ini.tex @@ -1320,6 +1320,81 @@ \def\setforcedfontspec#1 #2\relax]% {\csname\@fs@#1\endcsname#2\relax} +%D For \XETEX\ we need to support a bit more: +%D +%D \starttyping +%D \definedfont[{cmr10} at 40pt] test +%D \definedfont['cmss10' at 40pt] test +%D \definedfont["cmtt10" at 40pt] test +%D +%D \definedfont[{cmr10} at 40pt] test +%D \definedfont['cmss10' at 40pt] test +%D \definedfont["cmtt10" at 40pt] test +%D +%D \definedfont["Gentium" at 40pt] test +%D \stoptyping + +\beginXETEX \font + + % actually, we can use "" in pdftex> 1.20 as well + + \def\parsefontspec#1% + {\xdef\somefontspec{#1\space}% + \@EA\doparsefontspec\somefontspec\relax]% =>#1 \empty] + \donoparsefontspec} + + \def\doparsefontspec#1% + {\ifx"#1% + \@EA\dodqparsefontspec + \else\ifx'#1% + \@EAEAEA\dosqparsefontspec + \else + \@EAEAEA\dodoparsefontspec + \fi\fi#1} + + \def\dqfontquote{"} + \def\sqfontquote{'} + + \def\dodqparsefontspec"#1"#2% + {\def\somefontname{#1}% + \let\somefontquote\dqfontquote + \ifx#2\relax\@EA\setnaturalfontspec\else\@EA\setforcedfontspec\fi#2} + + \def\dosqparsefontspec'#1'#2% + {\def\somefontname{#1}% + \let\somefontquote\sqfontquote + \ifx#2\relax\@EA\setnaturalfontspec\else\@EA\setforcedfontspec\fi#2} + + \def\dodoparsefontspec#1 #2% + {\def\somefontname{#1}% + \let\somefontquote\empty + \ifx\somefontname\empty % space before fontname + \@EA\doparsefontspec + \else\ifx#2\relax + \@EAEAEA\setnaturalfontspec + \else + \@EAEAEA\setforcedfontspec + \fi\fi + #2} + + \def\setnaturalfontspec#1]% + {\@fs@scaled\plusthousand\relax} + + \def\setforcedfontspec#1 #2\relax]% + {\csname\@fs@#1\endcsname#2\relax} + + \def\donoparsefontspec % #1 == \cs + {\edef\fontfile{\somefontquote\truefontname\somefontname\somefontquote}% + \ifx\fontfile\s!unknown \let\fontfile\defaultfontfile \fi + \edef\lastfontname{\fontfile\somefontspec}% + \ifx\fontclass\empty + \expandafter\definefontlocal + \else + \expandafter\definefontglobal + \fi} % #1 == \cs + +\endXETEX + \def\@fs@scaled {\afterassignment\do@fs@scaled\scratchcounter} diff --git a/tex/context/base/lang-ini.tex b/tex/context/base/lang-ini.tex index 845426691..9a6d62124 100644 --- a/tex/context/base/lang-ini.tex +++ b/tex/context/base/lang-ini.tex @@ -350,7 +350,9 @@ \let\synchronizepatterns\relax % needed? \let\enabledmapping \empty % needed? % old (original) patterns -\let\dochar\thechr +% \let\dochar\thechr +\pathypsettings +\enableregime[utf]% just in case (xetex) \doifelsenothing{#3}{\enableencoding[\s!default]}{\enableencoding[#3]}% \doifelsenothing{#4}{\enablemapping [\s!default]}{\enablemapping [#4]}% % \iftrue diff --git a/tex/context/base/m-graph.tex b/tex/context/base/m-graph.tex index 5e45f255b..dd30cef46 100644 --- a/tex/context/base/m-graph.tex +++ b/tex/context/base/m-graph.tex @@ -8,55 +8,57 @@ %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. +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. -%D I finally finished graph support, if only because I could -%D not stand the idea that Karel Wesseling would revert to -%D \PiCTeX. +%D I finally finished graph support, if only because I could +%D not stand the idea that Karel Wesseling would revert to +%D \PiCTeX. -% pre 2000.08.06 version +% pre 2000.08.06 version % -% \forceMPTEXgraphictrue -% -% \appendtoks +% \forceMPTEXgraphictrue +% +% \startMPinitializations % initialize_numbers ; % make sure that pseudo typesetting is set up -% input graph ; % load the graph package -% Autoform := "@g" ; % change the % template char into @ -% \to \MPinitializations +% input graph ; % load the graph package +% Autoform := "@g" ; % change the % template char into @ +% \stopMPinitializations -%D The latest version does things more automatically (and -%D efficiently when no text processing is needed). For -%D definitions embedded in your document, you need to -%D use \type {@} as template character, in external files, -%D \type {%} is also supported. +%D The latest version does things more automatically (and +%D efficiently when no text processing is needed). For +%D definitions embedded in your document, you need to +%D use \type {@} as template character, in external files, +%D \type {%} is also supported. -\appendtoks input graph ; \to \MPinitializations +\startMPinitializations + input graph ; +\stopMPinitializations -%D Graphics that have \type {begingraph} in them are -%D recognized as such and force handling of embedded \TEX\ -%D code. +%D Graphics that have \type {begingraph} in them are +%D recognized as such and force handling of embedded \TEX\ +%D code. \forceMPTEXcheck{begingraph} - -%D If you run into troubles, try: -%D -%D \starttyping -%D \forceMPTEXgraphictrue -%D \stoptyping + +%D If you run into troubles, try: +%D +%D \starttyping +%D \forceMPTEXgraphictrue +%D \stoptyping %D %D A demo can be run with: %D %D \starttyping %D texexec --mode=demo --pdf m-graph -%D \stoptyping - -% No longer needed, since John will fix it. -% -% %D For the moment we need the following patch. Adam T. Lindsay -% %D found out that the following code produced an error: -% %D -% %D \starttyping +%D \stoptyping + +% No longer needed, since John will fix it. +% +% %D For the moment we need the following patch. Adam T. Lindsay +% %D found out that the following code produced an error: +% %D +% %D \starttyping % %D \startMPcode % %D draw begingraph(130mm,35mm); % %D setrange(0,0,10,22000); @@ -64,7 +66,7 @@ % %D autogrid(itick.bot,grid.lft) withcolor .75white ; % %D endgraph; % %D \stopMPcode -% %D +% %D % %D \startMPcode % %D draw begingraph(130mm,35mm); % %D setrange(0,50,10,22000); @@ -72,7 +74,7 @@ % %D autogrid(itick.bot,grid.lft) withcolor .75white ; % %D endgraph; % %D \stopMPcode -% %D +% %D % %D \startMPcode % %D draw begingraph(130mm,35mm); % %D setrange(0,110,10,30000); @@ -80,42 +82,41 @@ % %D autogrid(itick.bot,grid.lft) withcolor .75white ; % %D endgraph; % %D \stopMPcode -% %D \stoptyping +% %D \stoptyping +% %D +% %D The bug is a rather nasty one and needs some tweaking in +% %D the low level graph code. John Hobby suggested for the +% %D moment to initialize \type {setrange} as follows: % %D -% %D The bug is a rather nasty one and needs some tweaking in -% %D the low level graph code. John Hobby suggested for the -% %D moment to initialize \type {setrange} as follows: -% %D -% %D \starttyping +% %D \starttyping % %D setrange(0,0,"22000","22000") -% %D \stoptyping -% %D -% %D Folowing this suggesion, I provide the following -% %D extension: -% -% % \appendtoks +% %D \stoptyping +% %D +% %D Folowing this suggesion, I provide the following +% %D extension: + % def begingraph(expr w, h) = % begingroup % save X_, Y_, Gfin_, Gcur_, Gcbb_, Gneedgr_, Gneedfr_, Gdidsc_; % save Gdpic_, Gppic_, Ggl_, Garw_; % picture Gfin_, Gcur_, Gcbb_, Gdpic_, Gppic_, Ggl_[]; % boolean Gneedgr_, Gneedfr_, Gdidsc_; -% Gfin_ = nullpicture; -% Gcur_ = nullpicture; -% Gcbb_ = nullpicture; -% X_.ctyp = Y_.ctyp = linear; -% Z_.gdim = (w,h); -% X_.sc = Y_.sc = 0; -% Gneedgr_ = true; -% Gneedfr_ = true; -% Gdidsc_ = false; -% Gdpic_ = nullpicture; -% Garw_ = 0; -% scantokens everybegingraph ; +% Gfin_ = nullpicture; +% Gcur_ = nullpicture; +% Gcbb_ = nullpicture; +% X_.ctyp = Y_.ctyp = linear; +% Z_.gdim = (w,h); +% X_.sc = Y_.sc = 0; +% Gneedgr_ = true; +% Gneedfr_ = true; +% Gdidsc_ = false; +% Gdpic_ = nullpicture; +% Garw_ = 0; +% scantokens everybegingraph ; % enddef; -% -% boolean fixsetrange ; fixsetrange := true ; -% +% +% boolean fixsetrange ; fixsetrange := true ; +% % vardef dosetrange(text t) = % interim warningcheck:=0; % save r_; r_=0; @@ -130,19 +131,18 @@ % exitif r_=4; % endfor % enddef; -% +% % vardef setrange(text t) = -% if fixsetrange : dosetrange(0,0,20000,20000) ; fi ; +% if fixsetrange : dosetrange(0,0,20000,20000) ; fi ; % dosetrange(t) ; -% enddef ; -% -% if unknown everybegingraph : +% enddef ; +% +% if unknown everybegingraph : % string everybegingraph ; -% % everybegingraph := "setrange(0,0,20000,20000)" ; -% fi ; -% \to \MPinitializations +% % everybegingraph := "setrange(0,0,20000,20000)" ; +% fi ; -\appendtoks +\startMPinitializations % @# is X_ or Y_; $ is Gxcvlin_ or Gycvlin_; l and h are numeric or string % It would not be OK to set (@#low,@#high) to a pair expression because $ might % try to rescale @#low when evaluating the right-hand side for @#high. @@ -156,19 +156,19 @@ -@\#low = if abs @\#ctyp<>log: $ fi Mlog_Str h ; fi enddef ; -\to \MPinitializations +\stopMPinitializations -\doifnotmode {demo} {\endinput} +\doifnotmode {demo} {\endinput} -%D You need to have the data files in your path, +%D You need to have the data files in your path, %D otherwise the run is aborted. \doiffileelse {agepop91.d} {} {\writestatus{graph}{no data files found}\wait\end} -%D The test: +%D The test: -\starttext +\starttext \startMPpage draw begingraph(3in,2in); diff --git a/tex/context/base/meta-fig.tex b/tex/context/base/meta-fig.tex index 9a46b80d4..638166860 100644 --- a/tex/context/base/meta-fig.tex +++ b/tex/context/base/meta-fig.tex @@ -49,11 +49,33 @@ \def\startMPpage {\dodoubleempty\dostartMPpage} -\long\def\dostartMPpage[#1][#2]#3\stopMPpage % second arg gobbles space +% \long\def\dostartMPpage[#1][#2]#3\stopMPpage % second arg gobbles space +% {\dostartfittingpage[\??mg][#1]% +% \startMPcode#3\stopMPcode +% \dostopfittingpage} + +\long\def\dostartMPpage[#1][#2]% second arg gobbles space {\dostartfittingpage[\??mg][#1]% - \startMPcode#3\stopMPcode + \obeylines\def\obeyedline{\rawcharacter{13}}% + \dodostartMPpage} + +% \long\def\dodostartMPpage#1\stopMPpage +% {\startMPcode#1\stopMPcode +% \dostopfittingpage} +% +% more efficient: + +\long\def\obeyMPlines + {\obeylines + \def\obeyedline{\rawcharacter{13}}} + +\long\def\dodostartMPpage#1\stopMPpage + {\startuseMPgraphic{@@}#1\stopuseMPgraphic + \useMPgraphic{@@}% \dostopfittingpage} +\let\stopMPpage \relax % so that we can use it in \expanded + \setupMPpage [\c!scale=1000, \c!strut=\v!no, @@ -63,14 +85,14 @@ \c!height=\v!fit, \c!frame=\v!off] -%D \macros +%D \macros %D {MPfigure} %D -%D A bit out of place, here but nevertheless: +%D A bit out of place, here but nevertheless: \def\MPfigure#1#2% test for dup figure {\bgroup - \getfiguredimensionsonly[#1]% [\c!object=\v!no] already set + \getfiguredimensionsonly[#1]% [\c!object=\v!no] already set \freezedimenmacro\naturalfigurewidth \freezedimenmacro\naturalfigureheight \startMPcode diff --git a/tex/context/base/meta-ini.tex b/tex/context/base/meta-ini.tex index f9e3cf3e2..38c3ec3bd 100644 --- a/tex/context/base/meta-ini.tex +++ b/tex/context/base/meta-ini.tex @@ -69,38 +69,38 @@ \maxnofMPgraphics = 4000 % metafun disables the 4K boundary -\appendtoks +\startMPextensions if unknown context_tool: input mp-tool; fi; if unknown context_spec: input mp-spec; fi; if unknown context_grph: input mp-grph; fi; -\to \MPextensions +\stopMPextensions %D Since we want lables to follow the document settings, we %D also set the font related variables. -\appendtoks % scale is not yet ok +\startMPinitializations % scale is not yet ok defaultfont:="\truefontname{Regular}"; defaultscale:=\the\bodyfontsize/10pt; -\to \MPinitializations +\stopMPinitializations %D In order to support fancy text features (like outline %D fonts), we set: -\appendtoks +\startMPextensions graphictextformat:="context"; graphictextdirective "\the\everyMPTEXgraphic"; -\to \MPextensions +\stopMPextensions -% \appendtoks +% \startMPextensions % textextdirective "\the\everyMPTEXgraphic"; -% \to \MPextensions +% \stopMPextensions %D A signal that we're in combines \CONTEXT||\METAFUN mode: -\appendtoks +\startMPextensions string contextversion; contextversion:="\contextversion"; -\to \MPextensions +\stopMPextensions %D Some safeguards: %D @@ -253,11 +253,15 @@ \elabelgroup} \long\def\startuniqueMPgraphic - {\dodoublegroupempty\dostartuniqueMPgraphic} - -\long\def\dostartuniqueMPgraphic#1#2#3\stopuniqueMPgraphic% {\blabelgroup - \long\setgvalue{\@@MPG#1}{\handleuniqueMPgraphic{#1}{#2}{#3}}% + \dodoublegroupempty\dostartuniqueMPgraphic} + +\long\def\dostartuniqueMPgraphic + {\obeyMPlines + \dodostartuniqueMPgraphic} + +\long\def\dodostartuniqueMPgraphic#1#2#3\stopuniqueMPgraphic% + {\long\setgvalue{\@@MPG#1}{\handleuniqueMPgraphic{#1}{#2}{#3}}% \elabelgroup} \unexpanded\def\uniqueMPgraphic @@ -268,6 +272,8 @@ \setupMPvariables[#1][#2]% \getvalue{\@@MPG#1}{}% \elabelgroup} + +\let\stopuniqueMPcode \relax % so that we can use it in \expanded \long\def\handleuseMPgraphic#1#2#3% {\blabelgroup @@ -283,19 +289,27 @@ \elabelgroup} \long\def\startuseMPgraphic - {\dodoublegroupempty\dostartuseMPgraphic} - -\long\def\dostartuseMPgraphic#1#2#3\stopuseMPgraphic {\blabelgroup - \long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}{#3}}% + \dodoublegroupempty\dostartuseMPgraphic} + +\long\def\dostartuseMPgraphic + {\obeyMPlines + \dodostartuseMPgraphic} + +\long\def\dodostartuseMPgraphic#1#2#3\stopuseMPgraphic + {\long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}{#3}}% \elabelgroup} \long\def\startusableMPgraphic % redundant but handy - {\dodoublegroupempty\dostartusableMPgraphic} - -\long\def\dostartusableMPgraphic#1#2#3\stopusableMPgraphic {\blabelgroup - \long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}{#3}}% + \dodoublegroupempty\dostartusableMPgraphic} + +\long\def\dostartusableMPgraphic % redundant but handy + {\obeyMPlines + \dodostartusableMPgraphic} + +\long\def\dodostartusableMPgraphic#1#2#3\stopusableMPgraphic + {\long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}{#3}}% \elabelgroup} \long\def\handlereusableMPgraphic#1#2#3% @@ -314,16 +328,15 @@ \elabelgroup} \long\def\startreusableMPgraphic - {\dodoublegroupempty\dostartreusableMPgraphic} + {\blabelgroup + \dodoublegroupempty\dostartreusableMPgraphic} -% \long\def\dostartreusableMPgraphic#1#2#3\stopreusableMPgraphic% -% {\ifundefined{\@@MPG#1}% -% \long\setgvalue{\@@MPG#1}{\handlereusableMPgraphic{#1}{#2}{#3}}% -% \fi} +\def\dostartreusableMPgraphic + {\obeyMPlines + \dodostartreusableMPgraphic} -\long\def\dostartreusableMPgraphic#1#2#3\stopreusableMPgraphic - {\blabelgroup - \long\setgvalue{\@@MPG#1}{\handlereusableMPgraphic{#1}{#2}{#3}}% +\long\def\dodostartreusableMPgraphic#1#2#3\stopreusableMPgraphic + {\long\setgvalue{\@@MPG#1}{\handlereusableMPgraphic{#1}{#2}{#3}}% \elabelgroup} \unexpanded\def\useMPgraphic @@ -337,6 +350,11 @@ \let\reuseMPgraphic\useMPgraphic +\let\stopuseMPcode \relax % so that we can use it in \expanded +\let\stopusableMPcode \relax % so that we can use it in \expanded +\let\stopreusableMPcode \relax % so that we can use it in \expanded +\let\stopuniqueMPcode \relax % so that we can use it in \expanded + \def\enableincludeMPgraphics {\let\handleuseMPgraphic \thirdofthreearguments \let\handlereusableMPgraphic\thirdofthreearguments} @@ -355,11 +373,15 @@ :\MPcolor\overlaycolor:\MPcolor\overlaylinecolor} \long\def\startuniqueMPpagegraphic - {\dodoublegroupempty\dostartuniqueMPpagegraphic} - -\long\def\dostartuniqueMPpagegraphic#1#2#3\stopuniqueMPpagegraphic {\blabelgroup - \long\setgvalue{\@@MPG o:#1}{\handleuniqueMPgraphic{o:#1}{#2}{#3}}% + \dodoublegroupempty\dostartuniqueMPpagegraphic} + +\long\def\dostartuniqueMPpagegraphic + {\obeyMPlines + \dodostartuniqueMPpagegraphic} + +\long\def\dodostartuniqueMPpagegraphic#1#2#3\stopuniqueMPpagegraphic + {\long\setgvalue{\@@MPG o:#1}{\handleuniqueMPgraphic{o:#1}{#2}{#3}}% \long\setgvalue{\@@MPG e:#1}{\handleuniqueMPgraphic{e:#1}{#2}{#3}}% \elabelgroup} @@ -459,13 +481,13 @@ %D We also have to make sure that \METAPOST\ knows this: -\appendtoks +\startMPextensions if not known _data_prefix_: string _data_prefix_,_data_suffix_; fi; _data_prefix_:="\bufferprefix mpd-"; _data_suffix_:=".mpd"; -\to \MPextensions +\stopMPextensions %D \macros %D {getMPdata} @@ -491,10 +513,10 @@ %D We have to enable this mechanism with: -\appendtoks +\startMPextensions boolean collapse_data; collapse_data:=true; _data_suffix_:=".mpd"; % overloads previous one -\to \MPextensions +\stopMPextensions %D For the moment, the next one is a private macro: @@ -506,6 +528,7 @@ {\doprocessMPbuffer[\jobname]} {\bgroup \setnormalcatcodes + \obeyMPlines %\let\par\empty % oeps, this makes dvi mode graphics hang when not found \!!toksa\emptytoks \def\copyMPbufferline{\expandafter\appendtoks\fileline\to\!!toksa}% @@ -691,21 +714,21 @@ \newif\ifMPcmykcolors \MPcmykcolorstrue \newif\ifMPspotcolors \MPspotcolorstrue -\appendtoks +\startMPinitializations cmykcolors:=\ifMPcmykcolors true\else false\fi; spotcolors:=\ifMPspotcolors true\else false\fi; -\to \MPinitializations +\stopMPinitializations %D In order to communicate conveniently with the \TEX\ %D engine, we introduce some typesetting variables. % todo : backgroundoffsets -\appendtoks +\startMPextensions color OverlayColor,OverlayLineColor; -\to \MPextensions +\stopMPextensions -\appendtoks +\startMPinitializations OverlayWidth:=\overlaywidth; OverlayHeight:=\overlayheight; OverlayDepth:=\overlayheight; @@ -730,7 +753,7 @@ PageNumber:=\the\pageno; RealPageNumber:=\the\realpageno; LastPageNumber:= lastpage; -\to \MPinitializations +\stopMPinitializations \appendtoks \baselineskip1\baselineskip @@ -770,9 +793,9 @@ \ifx\undefined\MPprologues \def\MPprologues{0} \fi -\appendtoks +\startMPinitializations prologues:=\MPprologues; -\to \MPinitializations +\stopMPinitializations \appendtoks \def\MPprologues{0}% @@ -868,25 +891,25 @@ %D One more: (still needed?) -\appendtoks +\startMPextensions def initialize_form_numbers = do_initialize_numbers; enddef; -\to \MPextensions +\stopMPextensions -\appendtoks +\startMPinitializations HSize:=\the\hsize ; VSize:=\the\vsize ; -\to \MPinitializations +\stopMPinitializations -\appendtoks +\startMPextensions vardef ForegroundBox = unitsquare xysized(HSize,VSize) enddef ; vardef PageFraction = if \lastpage>1: (\realfolio-1)/(\lastpage-1) else: 1 fi enddef ; -\to \MPextensions +\stopMPextensions %D And some more. These are not really needed since we %D don't use the normal figure inclusion macros any longer. @@ -1006,7 +1029,7 @@ _special_div_ := 1000\ifconditional\manyMPspecials0\fi ; \to \MPextensions -%D Needed: +%D Needed (will become default): \prependtoks \resetlanguagespecifics diff --git a/tex/context/base/meta-pag.tex b/tex/context/base/meta-pag.tex index 8b266add8..cda7dbd96 100644 --- a/tex/context/base/meta-pag.tex +++ b/tex/context/base/meta-pag.tex @@ -19,24 +19,24 @@ \unprotect -\appendtoks +\startMPextensions if unknown context_page: input mp-page; fi; -\to \MPextensions +\stopMPextensions %D The next few macros tell \METAPOST\ how the \CONTEXT\ %D pagebody looks. -\appendtoks +\startMPextensions boolean PageStateAvailable,OnRightPage,InPageBody; PageStateAvailable:=true; -\to \MPextensions +\stopMPextensions -\appendtoks +\startMPinitializations OnRightPage:=true; InPageBody:=\ifinpagebody true \else false \fi; -\to \MPinitializations +\stopMPinitializations -\appendtoks +\startMPinitializations def LoadPageState = OnRightPage:=\MPonrightpage; OnOddPage:=\MPonoddpage; @@ -85,7 +85,7 @@ LayoutColumnDistance:=\the\layoutcolumndistance; LayoutColumnWidth:=\the\layoutcolumnwidth; enddef; -\to \MPinitializations +\stopMPinitializations \def\MPonrightpage{true} \def\MPonoddpage {true} @@ -205,11 +205,11 @@ \def\resetMPlocaltextarea {\global\MPlocaltextareadata\emptytoks} -\appendtoks +\startMPextensions path PlainTextArea; -\to \MPextensions +\stopMPextensions -\appendtoks +\startMPinitializations ResetTextAreas; \the\MPsavedtextareadata; SaveTextAreas; @@ -218,7 +218,7 @@ \the\MPlocaltextareadata; PlainTextArea:=boundingbox(\MPxy{text:\realfolio}--\MPxy{text:\realfolio} shifted (\MPw{text:\realfolio},\MPh{text:\realfolio})); -\to \MPinitializations +\stopMPinitializations \appendtoks \global\MPsavedtextareadata\MPtextareadata diff --git a/tex/context/base/meta-txt.tex b/tex/context/base/meta-txt.tex index 6f8be2e67..e68175635 100644 --- a/tex/context/base/meta-txt.tex +++ b/tex/context/base/meta-txt.tex @@ -26,9 +26,9 @@ \unprotect -\appendtoks +\startMPextensions if unknown context_text: input mp-text; fi; -\to \MPextensions +\stopMPextensions %%%%%%% diff --git a/tex/context/base/mult-sys.tex b/tex/context/base/mult-sys.tex index 12b29de55..653cde3f8 100644 --- a/tex/context/base/mult-sys.tex +++ b/tex/context/base/mult-sys.tex @@ -561,6 +561,7 @@ \definesystemvariable {st} % STickers \definesystemvariable {su} % SetUp \definesystemvariable {sv} % SysteemVariabelen +\definesystemvariable {sx} % Selector \definesystemvariable {sy} % SYnchronisatie \definesystemvariable {ta} % TAb \definesystemvariable {tb} % TekstBlokken diff --git a/tex/context/base/page-flt.tex b/tex/context/base/page-flt.tex index 3b9396d28..cf03fd40a 100644 --- a/tex/context/base/page-flt.tex +++ b/tex/context/base/page-flt.tex @@ -653,6 +653,7 @@ \c!sectionnumber=\@@kjsectionnumber, \c!distance=\@@kjdistance, \c!separator=\@@kjseparator, + \c!stopper=\@@kjstopper, \c!command=\@@kjcommand, \c!conversion=\@@kjconversion]% \definenumber % \definelabel @@ -701,7 +702,7 @@ \c!width,\c!headstyle,\c!headcolor,\c!style,\c!color, \c!textstyle,\c!textcolor,\c!minwidth, \c!align,\c!number,\c!way,\c!blockway, - \c!sectionnumber,\c!separator,\c!distance,\c!conversion]% + \c!sectionnumber,\c!separator,\c!stopper,\c!distance,\c!conversion]% \definenumber[#1][#3]% \presetlabeltext[#1=\labeltext{#3}]% \dodefinefloatcommands[#1][#2]} @@ -1390,29 +1391,6 @@ % \floatparameter -% \def\putcompletecaption#1#2#3#4% -% {\noindent -% \xdef\lastcaptiontag{\strut#2\floatcaptionsuffix}% -% \xdef\floatcaptionnumber{#1}% -% \dostartattributes{\??kj#1}\c!style\c!color\empty -% \ifnofloatnumber -% \else -% \hbox{\doattributes{\??kj#1}\c!headstyle\c!headcolor{\strut#2\floatcaptionsuffix}}% -% \ifnofloatcaption \else \ifemptyfloatcaption \else -% \ifcase#4\relax -% \scratchskip\@@kjkjdistance\relax -% \dotfskip\scratchskip\emergencystretch.5\scratchskip -% \else -% \ifx\@@kjkjinbetween\empty\else\unskip\@@kjkjinbetween\fi -% \fi -% \fi \fi -% \fi -% \ifnofloatcaption \else -% \doattributes{\??kj#1}\c!textstyle\c!textcolor -% {\begstrut#3\endstrut\endgraf}% -% \fi -% \dostopattributes} - \def\putcompletecaption#1#2#3#4% {\noindent \xdef\lastcaptiontag{\strut#2\floatcaptionsuffix}% @@ -1420,7 +1398,7 @@ \dostartattributes{\??kj#1}\c!style\c!color\empty \ifnofloatnumber \else - \hbox{\doattributes{\??kj#1}\c!headstyle\c!headcolor{\strut#2\floatcaptionsuffix}}% + \hbox{\doattributes{\??kj#1}\c!headstyle\c!headcolor{\strut#2\floatcaptionsuffix\@@kjkjstopper}}% \ifnofloatcaption \else \ifemptyfloatcaption \else \ifcase#4\relax \scratchskip\@@kjkjdistance\relax @@ -1825,6 +1803,7 @@ \edef\@@kjkjminwidth {\getvalue{\??kj#4\c!minwidth}}% in geval van automatisch \edef\@@kjkjdistance {\getvalue{\??kj#4\c!distance}}% \edef\@@kjkjalign {\getvalue{\??kj#4\c!align}}% + \def\@@kjkjstopper {\getvalue{\??kj#4\c!stopper}}% \edef\@@flfllocation {\getvalue{\??fl#4\c!location}}% \ifparfloat \@EA\dosetparfloat % {#1}{#2}{#3}{#4}% @@ -2325,6 +2304,7 @@ \c!blockway=\@@nrblockway, \c!sectionnumber=\@@nrsectionnumber, \c!separator=\@@koseparator, + \c!stopper=\@@kostopper, \c!distance=1em, \c!command=, \c!conversion=\v!numbers] diff --git a/tex/context/base/rlxtools.rlx b/tex/context/base/rlxtools.rlx new file mode 100644 index 000000000..308d533d5 --- /dev/null +++ b/tex/context/base/rlxtools.rlx @@ -0,0 +1,81 @@ +<?xml version='1.0 standalone='yes'?> + +<rl:manipulators> + + <!-- pstopdf will be made independent of the example framework --> + + <!-- rl:manipulator name='pdf' suffix='svg'> + <rl:old><rl:value name='path'/>/<rl:value name='file'/></rl:old> + <rl:new><rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file' method='nosuffix'/>.pdf</rl:new> + <rl:step> + inkscape + --without-gui + --print="><rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file' method='nosuffix'/>.ps" + <rl:value name='path'/>/<rl:value name='file' method='nosuffix'/>.svg + </rl:step> + <rl:step> + texmfstart pstopdf + <rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file' method='nosuffix'/>.ps + <rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file' method='nosuffix'/>.pdf + </rl:step> + </rl:manipulator --> + + <!-- rl:manipulator name='pdf' suffix='svgz'> + <rl:old><rl:value name='path'/>/<rl:value name='file'/></rl:old> + <rl:new><rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file' method='nosuffix'/>.pdf</rl:new> + <rl:step> + inkscape + --without-gui + --print="><rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file' method='nosuffix'/>.ps" + <rl:value name='path'/>/<rl:value name='file' method='nosuffix'/>.svgz + </rl:step> + <rl:step> + texmfstart pstopdf + <rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file' method='nosuffix'/>.ps + <rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file' method='nosuffix'/>.pdf + </rl:step> + </rl:manipulator --> + + <rl:manipulator name='pdf' suffix='svg'> + <rl:old><rl:value name='path'/>/<rl:value name='file' method='nosuffix'/>.svg</rl:old> + <rl:new><rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file' method='nosuffix'/>.pdf</rl:new> + <rl:step> + texmfstart pstopdf --convert + <rl:value name='old'/> + <rl:value name='new'/> + </rl:step> + </rl:manipulator> + + <rl:manipulator name='pdf' suffix='svgz'> + <rl:old><rl:value name='path'/>/<rl:value name='file' method='nosuffix'/>.svgz</rl:old> + <rl:new><rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file' method='nosuffix'/>.pdf</rl:new> + <rl:step> + texmfstart pstopdf --convert + <rl:value name='old'/> + <rl:value name='new'/> + </rl:step> + </rl:manipulator> + + <rl:manipulator name='lowres' suffix='pdf'> + <rl:old><rl:value name='path'/>/<rl:value name='file'/></rl:old> + <rl:new><rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file'/></rl:new> + <rl:step> + texmfstart pstopdf --convert --method=4 + --inputpath=<rl:value name='path'/> + --outputpath=<rl:value name='path'/>/<rl:value name='prefix'/> + <rl:value name='file'/> + </rl:step> + </rl:manipulator> + + <rl:manipulator name='medres' suffix='pdf'> + <rl:old><rl:value name='path'/>/<rl:value name='file'/></rl:old> + <rl:new><rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file'/></rl:new> + <rl:step> + texmfstart pstopdf --convert --method=4 + --inputpath=<rl:value name='path'/> + --outputpath=<rl:value name='path'/>/<rl:value name='prefix'/> + <rl:value name='file'/> + </rl:step> + </rl:manipulator> + +</rl:manipulators> diff --git a/tex/context/base/s-abr-01.tex b/tex/context/base/s-abr-01.tex index 3c45346ea..63861acf8 100644 --- a/tex/context/base/s-abr-01.tex +++ b/tex/context/base/s-abr-01.tex @@ -33,6 +33,7 @@ \logo [BIBTEX] {bib\TeX} \logo [BLUESKY] {BlueSky} \logo [BSD] {bsd} +\logo [BMP] {bmp} \logo [CDROM] {cdrom} \logo [CD] {cd} \logo [CMR] {cmr} diff --git a/tex/context/base/s-pre-60.tex b/tex/context/base/s-pre-60.tex index 9945847c2..a50462b29 100644 --- a/tex/context/base/s-pre-60.tex +++ b/tex/context/base/s-pre-60.tex @@ -89,7 +89,7 @@ \def\StopBusy {\removeunwantedspaces\stopproperty} \setupinteraction - [openaction=SetupStepper, + [%openaction=SetupStepper, closeaction=ResetStepper, openpageaction=CheckStepper, closepageaction=ResetStepper] diff --git a/tex/context/base/spec-def.tex b/tex/context/base/spec-def.tex index d24d257c7..a4db1b544 100644 --- a/tex/context/base/spec-def.tex +++ b/tex/context/base/spec-def.tex @@ -961,8 +961,9 @@ \defineoutput [dpx] [dpx] \defineoutput [acrobat] [pdf,ps,tr] -\defineoutput [xetex] [dvi,xtx] -\defineoutput [xtx] [dvi,xtx] +\defineoutput [xetex] [dpx] +\defineoutput [xtx] [dpx] +\defineoutput [xdv] [dvi,xtx] %D Please let me know if we need more. From now on we default %D to: diff --git a/tex/context/base/spec-dpx.tex b/tex/context/base/spec-dpx.tex index 31bcb39ff..2e4aaa6f1 100644 --- a/tex/context/base/spec-dpx.tex +++ b/tex/context/base/spec-dpx.tex @@ -65,7 +65,7 @@ %D \type{"1 0 0 1 -x -y cm"}. %D %D 2. \type{pdf:literal direct #1} puts directly the given PDF commands -%D #1 without changing the text matrix. +%D \type {#1} without changing the text matrix. %D %D Literal \PDF\ inclusion is implemented as: @@ -264,8 +264,7 @@ \def\assignPDFtransparency#1#2% {\def\PDFtransparencyidentifier{/Tr#1}% - %\def\PDFtransparencyreference{\PDFobjref{#2}}} - \def\PDFtransparencyreference{@TR:#2}} + \def\PDFtransparencyreference{@TR:#2}} % todo: \PDFobjref{TR:#2} \def\presetPDFtransparency#1#2% {\initializePDFtransparency @@ -273,12 +272,9 @@ \def\dopresetPDFtransparency#1#2% {\global\advance\PDFcurrenttransparency \plusone - %\immediate\pdfobj{\PDFtransparancydictionary{#1}{#2}{}}% -% \special{pdf: object @TR:\the\PDFcurrenttransparency\space \PDFtransparancydictionary{#1}{#2}{}}% \doPDFreserveDPXobject{TR:\the\PDFcurrenttransparency}{<< >>}% \special{pdf:\doPDFcheckedDPXobject{TR:\the\PDFcurrenttransparency}\PDFtransparancydictionary{#1}{#2}{}}% \edef\PDFtransparencyidentifier{/Tr\the\PDFcurrenttransparency}% - %\edef\PDFtransparencyreference {\PDFobjref\pdflastobj}% \edef\PDFtransparencyreference {@TR:\the\PDFcurrenttransparency}% \setxvalue{\@@PDT#1:#2}% {\noexpand\assignPDFtransparency{\the\PDFcurrenttransparency}{\the\PDFcurrenttransparency}}% @@ -287,15 +283,11 @@ \PDFtransparencyreference\space}} \def\initializePDFtransparency - %{\immediate\pdfobj{\PDFtransparancydictionary{1}{1}{/AIS false}}% -% {\special{pdf: object @TR:0 \PDFtransparancydictionary{1}{1}{/AIS false}}% {\doPDFreserveDPXobject{TR:0}{<< >>}% \special{pdf:\doPDFcheckedDPXobject{TR:0}\PDFtransparancydictionary{1}{1}{/AIS false}}% \xdef\PDFtransparencyresetidentifier{/Tr0}% - %\xdef\PDFtransparencyresetreference{\PDFobjref\pdflastobj}% \xdef\PDFtransparencyresetreference{@TR:0}% \setxvalue{\@@PDT0:0}% - %{\noexpand\assignPDFtransparency{0}{\the\pdflastobj}}% {\noexpand\assignPDFtransparency{0}{0}}% \appendtoPDFdocumentextgstates {\PDFtransparencyresetidentifier\space @@ -404,35 +396,70 @@ % wd nextbox > #3 ivm offset -\definespecial\dostartobject#1#2#3#4#5% +% \definespecial\dostartobject#1#2#3#4#5% +% {\bgroup +% \dowithnextbox +% {\dosetobjectreference{#1}{#2}{@#1::#2}% +% \scratchdimen#3\edef\width {\the\scratchdimen\space}% +% \scratchdimen#4\edef\height{\the\scratchdimen\space}% +% \setbox\nextbox\vbox +% {\special{pdf:bxobj @#1::#2 width \width height \height}% +% % we need to compensate for the box offset (ugly, sigh) +% \scratchdimen\nextboxht +% \advance\scratchdimen\nextboxdp +% \advance\scratchdimen-#4\relax +% \nextboxdp\zeropoint +% \nextboxht\zeropoint +% \hbox to #3{\hss\lower.5\scratchdimen\box\nextbox\hss}% +% \ifx\currentPDFresources\empty +% \else +% \special{pdf:put @resources <<\currentPDFresources>>}% +% \global\let\currentPDFresources\empty +% \fi +% \special{pdf:exobj}}% +% \smashbox\nextbox +% \flushatshipout{\box\nextbox}% +% \egroup}% +% \hbox\bgroup} + +% \definespecial\dostopobject +% {\egroup} + +\def\doDVIPDFMXstartobject#1#2#3#4#5#6% {\bgroup \dowithnextbox - {\dosetobjectreference{#1}{#2}{@#1::#2}% - \scratchdimen#3\edef\width {\the\scratchdimen\space}% - \scratchdimen#4\edef\height{\the\scratchdimen\space}% + {\ifcase#1\or\dosetobjectreference{#2}{#3}{@#2::#3}\fi + \scratchdimen#4\edef\width {\the\scratchdimen\space}% + \scratchdimen#5\edef\height{\the\scratchdimen\space}% \setbox\nextbox\vbox - {\special{pdf:bxobj @#1::#2 width \width height \height}% - % we need to compensate for the box offset (ugly, sigh) - \scratchdimen\nextboxht - \advance\scratchdimen\nextboxdp - \advance\scratchdimen-#4\relax - \nextboxdp\zeropoint - \nextboxht\zeropoint - \hbox to #3{\hss\lower.5\scratchdimen\box\nextbox\hss}% + {\special{pdf:bxobj @#2::#3 width \width height \height}% + % we need to compensate for the box offset (ugly, sigh) + \scratchdimen\nextboxht + \advance\scratchdimen\nextboxdp + \advance\scratchdimen-#5\relax + \nextboxdp\zeropoint + \nextboxht\zeropoint + \hbox to #4{\hss\lower.5\scratchdimen\box\nextbox\hss}% \ifx\currentPDFresources\empty \else - \special{pdf:put @resources <<\currentPDFresources\the\pdfpageresources>>}% + \special{pdf:put @resources <<\currentPDFresources>>}% \global\let\currentPDFresources\empty \fi \special{pdf:exobj}}% - \smashbox\nextbox - \flushatshipout{\box\nextbox}% - \egroup}% + \smashbox\nextbox + \flushatshipout{\box\nextbox}% + \egroup}% \hbox\bgroup} -\definespecial\dostopobject +\def\doDVIPDFMXstopobject {\egroup} +\definespecial\dostartobject#1#2#3#4#5% + {\doDVIPDFMXstartobject\plusone{#1}{#2}{#3}{#4}{#5}} + +\definespecial\dostopobject + {\doDVIPDFMXstopobject} + \definespecial\doinsertobject#1#2% {\hbox {\doPDFgetobjectreference{#1}{#2}\PDFobjectreference @@ -764,11 +791,21 @@ \newcounter\MPPDFcounter -\def\setMPPDFobject#1#2% - {\ifx\currentPDFresources\empty\else\doPDFpageresource{#1}\fi - \def\getMPPDFobject{\box#2}} +\newcounter\MPPDFobjectcounter -\let\getMPPDFobject\relax +\def\setMPPDFobject#1#2% resources boxnumber + {\doglobal\increment\MPPDFobjectcounter + \xdef\getMPPDFobject + {\vbox to \the\ht#2% + {\vss + \hbox to \the\wd#2% + {\scratchdimen\wd#2\scratchdimen.5\scratchdimen\hskip-\the\scratchdimen + \special{pdf:uxobj @MPPDF::\MPPDFobjectcounter}}}}% + \expanded{\doDVIPDFMXstartobject\zerocount{MPPDF}\MPPDFobjectcounter{\the\wd#2}{\the\ht#2}{\the\dp#2}}% + \box#2% + \doDVIPDFMXstopobject} + +\let\getMPPDFobject\gobbletwoarguments \definespecial\doinsertMPfile#1% {\doiffileelse{./#1}{\includeMPasPDF{./#1}}{\message{[MP #1]}}} diff --git a/tex/context/base/spec-xtx.tex b/tex/context/base/spec-xtx.tex index b04098472..ee71a60a2 100644 --- a/tex/context/base/spec-xtx.tex +++ b/tex/context/base/spec-xtx.tex @@ -1,4 +1,11 @@ -%D \module
%D [ file=spec-xtx,
%D version=2004.11.08,
%D title=\CONTEXT\ Special Macros,
%D subtitle=\XETEX\ support,
%D author={Adam Lindsay \& Hans Hagen \& \unknown},
%D date=\currentdate,
%D copyright={Adam Lindsay \& Hans Hagen}] +%D \module +%D [ file=spec-xtx, +%D version=2004.11.08, +%D title=\CONTEXT\ Special Macros, +%D subtitle=\XETEX\ support, +%D author={Adam Lindsay \& Hans Hagen \& \unknown}, +%D date=\currentdate, +%D copyright={Adam Lindsay \& Hans Hagen}] \unprotect @@ -15,7 +22,7 @@ \definespecial\dostartrotation#1% {\special{x:gsave}\special{x:rotate #1}} -\definespecial\dostoprotation% +\definespecial\dostoprotation {\special{x:grestore}} %D Scaling and mirroring are also fine. @@ -23,13 +30,13 @@ \definespecial\dostartscaling#1#2% {\special{x:gsave}\special{x:scale #1 #2}} -\definespecial\dostopscaling% +\definespecial\dostopscaling {\special{x:grestore}} -\definespecial\dostartmirroring% +\definespecial\dostartmirroring {\special{x:gsave}\special{x:scale -1 1}} -\definespecial\dostopmirroring% +\definespecial\dostopmirroring {\special{x:grestore}} %D Colors are done with the \DVIPDFMX\ color model, which are @@ -157,90 +164,4 @@ \stopspecials -\protect - -%\endinput - -% FOR THE MOMENT HERE - -\ifx\dqfontquote\undefined \else \endinput \fi - -\unprotect - -% actually, we can use "" in pdftex> 1.20 as well - -\def\parsefontspec#1% - {\xdef\somefontspec{#1\space}% - \@EA\doparsefontspec\somefontspec\relax]% =>#1 \empty] - \donoparsefontspec} - -\def\doparsefontspec#1% - {\ifx"#1% - \@EA\dodqparsefontspec - \else\ifx'#1% - \@EAEAEA\dosqparsefontspec - \else - \@EAEAEA\dodoparsefontspec - \fi\fi#1} - -\def\dqfontquote{"} -\def\sqfontquote{'} - -\def\dodqparsefontspec"#1"#2% - {\def\somefontname{#1}% - \let\somefontquote\dqfontquote - \ifx#2\relax\@EA\setnaturalfontspec\else\@EA\setforcedfontspec\fi#2} - -\def\dosqparsefontspec'#1'#2% - {\def\somefontname{#1}% - \let\somefontquote\sqfontquote - \ifx#2\relax\@EA\setnaturalfontspec\else\@EA\setforcedfontspec\fi#2} - -\def\dodoparsefontspec#1 #2% - {\def\somefontname{#1}% - \let\somefontquote\empty - \ifx\somefontname\empty % space before fontname - \@EA\doparsefontspec - \else\ifx#2\relax - \@EAEAEA\setnaturalfontspec - \else - \@EAEAEA\setforcedfontspec - \fi\fi - #2} - -\def\setnaturalfontspec#1]% - {\@fs@scaled\plusthousand\relax} - -\def\setforcedfontspec#1 #2\relax]% - {\csname\@fs@#1\endcsname#2\relax} - -\beginXETEX \font - -\def\donoparsefontspec % #1 == \cs - {\edef\fontfile{\somefontquote\truefontname\somefontname\somefontquote}% - \ifx\fontfile\s!unknown \let\fontfile\defaultfontfile \fi - \edef\lastfontname{\fontfile\somefontspec}% - \ifx\fontclass\empty - \expandafter\definefontlocal - \else - \expandafter\definefontglobal - \fi} % #1 == \cs - -\endXETEX - \protect \endinput - -\starttext - -\definedfont[{cmr10} at 40pt] test -\definedfont['cmss10' at 40pt] test -\definedfont["cmtt10" at 40pt] test - -\definedfont[{cmr10} at 40pt] test -\definedfont['cmss10' at 40pt] test -\definedfont["cmtt10" at 40pt] test - -% \definedfont["Gentium" at 40pt] test - -\stoptext - diff --git a/tex/context/base/supp-mps.tex b/tex/context/base/supp-mps.tex index 4b89a37d5..82a5dcb7b 100644 --- a/tex/context/base/supp-mps.tex +++ b/tex/context/base/supp-mps.tex @@ -220,20 +220,58 @@ %D before all other inclusions, the extensions are expanded %D only once per run. -\newtoks \MPinitializations % each graphic +%D The next hack prevents too long lines: + +\long\def\obeyMPlines + {\ifx\rawcharacter\undefined\else + \obeylines + \def\obeyedline{\rawcharacter{10}}% + \fi} + +%D We use two distinguished token registers: + \newtoks \MPextensions % once per run (can be multiple graphics) +\newtoks \MPinitializations % each graphic + +\let\stopMPextensions \relax % so that we can use it in \expanded +\let\stopMPinitializations\relax % so that we can use it in \expanded +\let\stopMPinclusions \relax % so that we can use it in \expanded + +\def\startMPextensions % no text checking done here ! + {\begingroup + \obeyMPlines + \dostartMPextensions} + +\def\dostartMPextensions#1\stopMPextensions + {\endgroup + \MPextensions\expandafter{\the\MPextensions#1}} + +\def\startMPinitializations % no text checking done here ! + {\begingroup + \obeyMPlines + \dostartMPinitializations} + +\def\dostartMPinitializations#1\stopMPinitializations + {\endgroup + \MPinitializations\expandafter{\the\MPinitializations#1}} \def\startMPinclusions - {\dosingleempty\dostartMPinclusions} + {\begingroup + \dosingleempty\dostartMPinclusions} + +\long\def\dostartMPinclusions + {\obeyMPlines + \dodostartMPinclusions} -\long\def\dostartMPinclusions[#1]#2\stopMPinclusions % document wide - {\doifelse{#1}{+} +\long\def\dodostartMPinclusions[#1]#2\stopMPinclusions % document wide + {\endgroup + \doifelse{#1}{+} {\@EA\long\@EA\def\@EA\theMPinclusions\@EA {\theMPinclusions \writeMPgraphic{#2}}} {\long\def\theMPinclusions {% \expanded ! - \@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPextensions;}}% new +% \@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPextensions;}}% new \writeMPgraphic{#2}}}} \def\MPinclusions @@ -242,6 +280,12 @@ \long\def\doMPinclusions[#1]#2% {\startMPinclusions[#1]#2\stopMPinclusions} +\def\theMPextensions + {\@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPextensions;}}} + +\def\theMPinitializations + {\@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPinitializations;}}} + \startMPinclusions \stopMPinclusions %D \macros @@ -254,7 +298,7 @@ \newwrite\MPwrite -\newif\iflongMPlines +\newif\iflongMPlines \longMPlinestrue % we now have \obeyMPlines \ifx \overlaywidth \undefined \def \overlaywidth {4cm} \fi \ifx \overlayheight \undefined \def \overlayheight {3cm} \fi @@ -586,65 +630,6 @@ \endTEX -% buggy (at least in collected graphics, lazy expansion) -% -% \def\startwritingMPgraphic -% {\blabelgroup -% \global\advance\nofMPgraphics 1 -% \ifMPrun \else -% \allocateMPslot\currentMPgraphic -% \fi -% \enableincludeMPgraphics -% \xdef\MPgraphic{\the\currentMPgraphic}% -% \the\everyMPgraphic -% \ifrunMPgraphics -% \openMPgraphicfile1{runtime}% -% % no reset here ! -% \theMPinclusions -% \else -% \openMPgraphicfile0{collected}% -% % reset here ! global added (due to adding \blabelgroup) -% \theMPinclusions -% \global\let\theMPinclusions\relax -% \fi -% \flushMPTEXgraphic -% \ifMPrun \else -% \immediate\write\MPwrite{let mprunend = end ;}% -% \immediate\write\MPwrite{beginfig(\the\currentMPgraphic);}% -% \fi -% \globallet\flushMPgraphics\closeMPgraphicfiles % \dodostopwritingMPgraphic -% \globallet\stopwritingMPgraphic=\dostopwritingMPgraphic} - -% \def\startwritingMPgraphic -% {\blabelgroup -% \global\advance\nofMPgraphics 1 -% \ifMPrun \else -% \allocateMPslot\currentMPgraphic -% \fi -% \enableincludeMPgraphics -% \xdef\MPgraphic{\the\currentMPgraphic}% -% \the\everyMPgraphic -% \ifrunMPgraphics -% \openMPgraphicfile1{runtime}% -% % no reset here ! -% \theMPinclusions -% \@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPinitializations;}}% -% \else -% \openMPgraphicfile0{collected}% -% % reset here ! global added (due to adding \blabelgroup) -% \theMPinclusions -% \global\let\theMPinclusions\relax -% \fi -% \flushMPTEXgraphic -% \ifMPrun \else -% \immediate\write\MPwrite{let mprunend = end ;}% -% \immediate\write\MPwrite{beginfig(\the\currentMPgraphic);}% -% \@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPinitializations;}}% -% \fi -% \globallet\flushMPgraphics\closeMPgraphicfiles % \dodostopwritingMPgraphic -% \globallet\stopwritingMPgraphic=\dostopwritingMPgraphic} - - \def\startwritingMPgraphic {\blabelgroup \global\advance\nofMPgraphics \plusone @@ -658,21 +643,26 @@ \ifrunMPgraphics \openMPgraphicfile1{runtime}% % no reset here ! + \theMPextensions \theMPinclusions - \@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPinitializations;}}% +% \theMPinitializations \else \openMPgraphicfile0{collected}% % reset here ! global added (due to adding \blabelgroup) + \theMPextensions \theMPinclusions + \global\let\theMPextensions\relax \global\let\theMPinclusions\relax \fi - %\flushMPTEXgraphic - \ifMPrun \else + \theMPinitializations % always + \ifMPrun +% \theMPinitializations + \else \immediate\write\MPwrite{let mprunend = end ;}% \immediate\write\MPwrite{beginfig(\the\currentMPgraphic);}% - \ifrunMPgraphics \else - \@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPinitializations;}}% - \fi +% \ifrunMPgraphics \else +% \theMPinitializations +% \fi \fi \globallet\flushMPgraphics\closeMPgraphicfiles % \dodostopwritingMPgraphic \globallet\stopwritingMPgraphic\dostopwritingMPgraphic} @@ -959,6 +949,8 @@ \getvalue{\@@MPG#1}% \elabelgroup} +\let\stopreusableMPgraphic \relax % so that we can use it in \expanded + %D \macros %D {startuseMPgraphic,useMPgraphic} %D @@ -982,18 +974,29 @@ \deallocateMPslot\currentMPgraphic \egroup} -\long\def\startuseMPgraphic#1#2\stopuseMPgraphic +\long\def\startuseMPgraphic#1% {\blabelgroup - \long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}}% + \obeyMPlines + \dostartuseMPgraphic} + +\long\def\dostartuseMPgraphic#1#2\stopuseMPgraphic + {\long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}}% \elabelgroup} -\long\def\startusableMPgraphic#1#2\stopusableMPgraphic % dummy +\long\def\startusableMPgraphic#1% {\blabelgroup - \long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}}% + \obeyMPlines + \dostartusableMPgraphic} + +\long\def\dostartusableMPgraphic#1#2\stopusableMPgraphic + {\long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}}% \elabelgroup} \let\useMPgraphic=\reuseMPgraphic +\let\stopuseMPgraphic \relax % so that we can use it in \expanded +\let\stopusableMPgraphic \relax % so that we can use it in \expanded + %D \macros %D {doifMPgraphicelse} %D @@ -1085,12 +1088,12 @@ \def\MPOSTformatswitch {-progname=mpost -mem=} \def\MPOSTdriver {dvips} - \def\executeMPOST#1% + \def\executeMPOST#1% direct call {mpost \ifcase\interactionmode\MPOSTbatchswitch\or\MPOSTnonstopswitch\fi \space\ifuseMETAFUNformat \MPOSTformatswitch metafun \fi #1} - \def\executeMPTEX#1% + \def\executeMPTEX#1% slower, due to nested texexec call {\TEXEXECcommand\space --batch \ifcase\interactionmode --logfile='mptex.log' \fi --output=\MPOSTdriver\space @@ -1920,7 +1923,16 @@ %D %D this automatically places the graphic -\long\def\startMPcode#1\stopMPcode - {\startuseMPgraphic{@@}#1\stopuseMPgraphic\useMPgraphic{@@}} +\long\def\startMPcode + {\begingroup + \obeyMPlines + \dostartMPcode} + +\long\def\dostartMPcode#1\stopMPcode + {\startuseMPgraphic{@@}#1\stopuseMPgraphic + \useMPgraphic{@@}% + \endgroup} + +\let\stopMPcode \relax % so that we can use it in \expanded \protect \endinput diff --git a/tex/context/base/supp-mrk.tex b/tex/context/base/supp-mrk.tex index 0cab213c4..eb03b5251 100644 --- a/tex/context/base/supp-mrk.tex +++ b/tex/context/base/supp-mrk.tex @@ -411,9 +411,11 @@ \normalmarks#1{#2}} \def\setnormalmark#1#2% using a tok prevents unwanted expansion in mark - {\scratchtoks{#2}% + {\begingroup % don't ask why, but grouping is needed + \scratchtoks{#2}% in order to to mess up scratchtoks \@EA\xdef\csname\@@crk\string#1\endcsname{\the\scratchtoks}% - \normalmarks#1{\the\scratchtoks}} % one level expansion + \normalmarks#1{\the\scratchtoks}% one level expansion + \endgroup} \def\checktopmark#1% {%\writestatus{marks}{checking \string#1}\wait diff --git a/tex/context/base/supp-pdf.tex b/tex/context/base/supp-pdf.tex index 9543d3e57..dffe52446 100644 --- a/tex/context/base/supp-pdf.tex +++ b/tex/context/base/supp-pdf.tex @@ -578,7 +578,6 @@ \def\octalMPcharacter#1#2#3% {\char'#1#2#3\relax} - %D curly braces and squarly brackets are stored in the argument stack %D as part of strings, for instance in: %D diff --git a/tex/context/base/syst-ext.tex b/tex/context/base/syst-ext.tex index 55b1c5687..b9183a9e8 100644 --- a/tex/context/base/syst-ext.tex +++ b/tex/context/base/syst-ext.tex @@ -1139,11 +1139,21 @@ \long\def\convertcommand#1\to#2% {\dodoglobal\edef#2{\convertedcommand#1}} +\long\def\defconvertedargument#1#2% less sensitive for \to + {\long\def#1{#2}% saves a restore + \dodoglobal\edef#1{\convertedcommand#1}} + +\long\def\defconvertedcommand#1#2% less sensitive for \to + {\dodoglobal\edef#1{\convertedcommand#2}} + \endTEX \def\convertvalue#1\to {\expandafter\convertcommand\csname#1\endcsname\to} +\def\defconvertvalue#1#2% less sensitive for \to + {\@EA\defconvertcommand\@EA#1\csname#2\endcsname} + %D \macros %D {convertasciiafter} %D @@ -1174,7 +1184,13 @@ % {\@EA\dodoglobal\@EA\edef\@EA#2\@EA{\@EA\detokenize\@EA{#1}}} \long\def\convertcommand#1\to#2% - {\dodoglobal\edef#2{\@EA\detokenize\@EA{#1}}} + {\dodoglobal\edef#2{\@EA\detokenize\@EA{#1}}} % hm, only second is also ok + +\long\def\defconvertedargument#1#2% less sensitive for \to + {\dodoglobal\edef#1{\detokenize{#2}}} + +\long\def\defconvertedcommand#1#2% less sensitive for \to + {\dodoglobal\edef#1{\detokenize\@EA{#2}}} \endETEX @@ -4685,65 +4701,71 @@ %D I'll implement this when I'm in \quotation {writing dirty %D macros mood}. +\def\dofilterfromstr#1#2% max n + {\ifcase#1\or + \ifcase#2\or + \strippedcsname\firstofoneargument + \else + \strippedcsname\gobbleoneargument + \fi + \or + \ifcase#2\or + \strippedcsname\firstoftwoarguments + \or + \strippedcsname\secondoftwoarguments + \else + \strippedcsname\gobbletwoarguments + \fi + \or + \ifcase#2\or + \strippedcsname\firstofthreearguments + \or + \strippedcsname\secondofthreearguments + \or + \strippedcsname\thirdofthreearguments + \else + \strippedcsname\gobblethreearguments + \fi + \or + \ifcase#2\or + \strippedcsname\firstoffourarguments + \or + \strippedcsname\secondoffourarguments + \or + \strippedcsname\thirdoffourarguments + \or + \strippedcsname\fourthoffourarguments + \else + \strippedcsname\gobblefourarguments + \fi + \or + \ifcase#2\or + \strippedcsname\firstoffivearguments + \or + \strippedcsname\secondoffivearguments + \or + \strippedcsname\thirdoffivearguments + \or + \strippedcsname\fourthoffivearguments + \or + \strippedcsname\fifthoffivearguments + \else + \strippedcsname\gobblefivearguments + \fi + \fi} + \def\filterfromvalue#1#2#3% value max n {\@EA\@EAEAEA\csname % we use the fact that an \@EA\ifx\csname#1\endcsname\relax % undefined cs has become \relax \strippedcsname\gobbleoneargument % which we then gobble here \else - \ifcase#2\or - \ifcase#3\or - \strippedcsname\firstofoneargument - \else - \strippedcsname\gobbleoneargument - \fi - \or - \ifcase#3\or - \strippedcsname\firstoftwoarguments - \or - \strippedcsname\secondoftwoarguments - \else - \strippedcsname\gobbletwoarguments - \fi - \or - \ifcase#3\or - \strippedcsname\firstofthreearguments - \or - \strippedcsname\secondofthreearguments - \or - \strippedcsname\thirdofthreearguments - \else - \strippedcsname\gobblethreearguments - \fi - \or - \ifcase#3\or - \strippedcsname\firstoffourarguments - \or - \strippedcsname\secondoffourarguments - \or - \strippedcsname\thirdoffourarguments - \or - \strippedcsname\fourthoffourarguments - \else - \strippedcsname\gobblefourarguments - \fi - \or - \ifcase#3\or - \strippedcsname\firstoffivearguments - \or - \strippedcsname\secondoffivearguments - \or - \strippedcsname\thirdoffivearguments - \or - \strippedcsname\fourthoffivearguments - \or - \strippedcsname\fifthoffivearguments - \else - \strippedcsname\gobblefivearguments - \fi - \fi + \dofilterfromstr{#2}{#3}% \fi \endcsname\csname#1\endcsname} +\def\filterfromnext#1#2% max n {..}{..}{..}{..} + {\csname\dofilterfromstr{#1}{#2}\endcsname} + %D \macros %D {definemeasure} %D diff --git a/tex/context/base/type-exa.tex b/tex/context/base/type-exa.tex index 0730bd55f..123e2cb4d 100644 --- a/tex/context/base/type-exa.tex +++ b/tex/context/base/type-exa.tex @@ -229,7 +229,7 @@ \stoptypescript -\starttypescript [antykwa-torunska] [texnansi,ec,8r,uc] +\starttypescript [antykwa-torunska] [texnansi,ec,8r,uc,t2a] \definetypeface[antykwa][rm][serif][antykwa-torunska] [default][encoding=\typescripttwo] \definetypeface[antykwa][ss][sans] [modern] [default][encoding=\typescripttwo,rscale=1.05] @@ -238,7 +238,7 @@ \stoptypescript -\starttypescript [iwona,iwona-light,iwona-heavy,iwona-medium] [texnansi,ec,8r,uc] +\starttypescript [iwona,iwona-light,iwona-heavy,iwona-medium] [texnansi,ec,8r,uc,t2a] % todo: rscale diff --git a/tex/context/base/unic-ini.tex b/tex/context/base/unic-ini.tex index 361ff00a9..00651384f 100644 --- a/tex/context/base/unic-ini.tex +++ b/tex/context/base/unic-ini.tex @@ -743,7 +743,7 @@ %D Well, let's at least preload a few familiar ones. Here we %D also load the \UTF\ regime. -\useunicodevector[0,1,2,3,4,5,30,32,33,34,37,39,251] +\useunicodevector[0,1,2,3,4,5,30,31,32,33,34,37,39,251] \useunicodevector[cjk] \useregime[utf] diff --git a/tex/context/base/x-chemml.xsd b/tex/context/base/x-chemml.xsd new file mode 100644 index 000000000..b51121911 --- /dev/null +++ b/tex/context/base/x-chemml.xsd @@ -0,0 +1,93 @@ +<?xml version="1.0"?> + +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + +<xsd:annotation> + <xsd:documentation xml:lang="en"> + <p>This schema covers (basic presentational) Chemical + markup. We will extend this schema with names and + predefined components.</p> + <p>author: Hans Hagen, copyright: PRAGMA-ADE / Hasselt NL</p> + </xsd:documentation> +</xsd:annotation> + +<xsd:element type="chemType"> + <xsd:sequence> + <xsd:element ref="chemicalComponentType" /> + <xsd:choice> + <xsd:element ref="chemicalActionType" /> + <xsd:element ref="chemicalBondType" /> + </xsd:choice> + </xsd:sequence> +</xsd:element> + +<xsd:element name="chem" type="chemType" /> +<xsd:element name="ichem" type="chemType" /> +<xsd:element name="dchem" type="chemType" /> + +<xsd:element name="molecule"> + <xsd:complexType> + <xsd:sequence> + <xsd:choice> + <xsd:element name="ion" /> + <xsd:element name="atom" /> + </xsd:choice> + <xsd:element name="caption" type="chemicalCaptionType" /> + </xsd:sequence> + <xsd:attribute name="n" type="xsd:positiveInteger" /> + </xsd:complexType> +</xsd:element> + +<xsd:element name="ion"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="atom" /> + </xsd:sequence> + <xsd:attribute name="n" type="xsd:positiveInteger" /> + <xsd:attribute name="charge" type="xsd:integer" /> + </xsd:complexType> +</xsd:element> + +<xsd:element name="atom" type="xsd:string"> + <xsd:complexType> + <xsd:attribute name="n" type="xsd:positiveInteger"/> + <xsd:attribute name="charge" type="xsd:integer" /> + <xsd:attribute name="protons" type="xsd:positiveInteger" /> + <xsd:attribute name="weight" type="xsd:positiveInteger" /> + </xsd:complexType> +</xsd:element> + +<xsd:complexType name="chemicalActionType"> + <xsd:choice> + <xsd:element name="plus" type="chemicalCaptionType" /> + <xsd:element name="minus" type="chemicalCaptionType" /> + <xsd:element name="equal" type="chemicalCaptionType" /> + <xsd:element name="gives" type="chemicalCaptionType" /> + <xsd:element name="equilibrium" type="chemicalCaptionType" /> + <xsd:element name="mesomeric" type="chemicalCaptionType" /> + </xsd:choice> +</xsd:complexType> + +<xsd:complexType name="chemicalBondType"> + <xsd:choice> + <xsd:element name="singlebond" /> + <xsd:element name="doublebond" /> + <xsd:element name="triplebond" /> + </xsd:choice> +</xsd:complexType> + +<xsd:complexType name="chemicalComponentType"> + <xsd:choice> + <xsd:element ref="molecule" /> + <xsd:element ref="ion" /> + <xsd:element ref="atom" /> + </xsd:choice> +</xsd:complexType> + +<xsd:complexType name="chemicalCaptionType" minOccurs="0" maxOccurs="2"> + <xsd:sequence> + <xsd:element name="caption" type="xsd:string" minOccurs="0" maxOccurs="2" /> + </xsd:sequence> +</xsd:complexType> + +</xsd:schema> diff --git a/tex/context/base/x-contml.xsd b/tex/context/base/x-contml.xsd new file mode 100644 index 000000000..3b71e31e8 --- /dev/null +++ b/tex/context/base/x-contml.xsd @@ -0,0 +1,375 @@ +<?xml version="1.0"?> + + +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + + +<xsd:annotation> + <xsd:documentation xml:lang="en"> + This schema describes a class of presentations. The structure is + (normally) reflected in the design. + + author: Hans Hagen, copyright: PRAGMA-ADE / Hasselt NL + </xsd:documentation> +</xsd:annotation> + + +<?context-block begin definitions ?> + + <xsd:complexType name="filename.value"> + <xsd:restriction base="xsd:string"> + <xsd:pattern value='[a-zA-Z0-9\-\:\.]*' /> + </xsd:restriction> + </xsd:complexType> + + <xsd:complexType name="filetype.value"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="tex" /> + <xsd:enumeration value="xml" /> + <xsd:enumeration value="txt" /> + </xsd:restriction> + </xsd:complexType> + + <xsd:complexType name="confirmation.value"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="yes" /> + <xsd:enumeration value="no" /> + </xsd:restriction> + </xsd:complexType> + + <xsd:complexType name="conversion.value"> + <xsd:restriction base="xsd:string"> + <xsd:pattern value='(a|A|n|g|G|r|R|1|2|3|4)' /> + </xsd:restriction> + </xsd:complexType> + + <xsd:complexType name="reference.label.value"> + <xsd:restriction base="xsd:string"> + <xsd:pattern value='([a-zA-Z0-9\-\:]*' /> + </xsd:restriction> + </xsd:complexType> + +<?context-block end definitions ?> + + +<?context-block begin text ?> + + <xsd:element name="presentation" mixed="true" /> + +<?context-block end text ?> + + +<?context-block begin p ?> + + <xsd:element name="p" mixed="true" /> + +<?context-block end p ?> + + +<?context-block begin hide ?> + + <xsd:element name="hide" mixed="true" /> + +<?context-block end hide ?> + + +<?context-block begin em ?> + + <xsd:element name="em" mixed="true" /> + +<?context-block end em ?> + + +<?context-block begin b ?> + + <xsd:element name="b" mixed="true" /> + +<?context-block end b ?> + + +<?context-block begin quote ?> + + <xsd:element name="quote" mixed="true" /> + <xsd:element name="quotation" mixed="true" /> + +<?context-block end quote ?> + + +<?context-block begin include ?> + + <xsd:attributeGroup name="include.attributes"> + <xsd:attribute name="file" type="filename.value" use="required" /> + <xsd:attribute name="type" type="filetype.value" /> + </xsd:attributeGroup> + + <xsd:complexType type="include.type"> + <xsd:attributeGroup ref="include.attributes" /> + </xsd:complexType> + + <xsd:element name="include" type="include.type" /> + +<?context-block end include ?> + + +<?context-block begin compound ?> + + <xsd:attributeGroup name="compound.attributes"> + <xsd:attribute name="token" type="xsd:string" /> + </xsd:attributeGroup> + + <xsd:complexType type="compound.type"> + <xsd:attributeGroup ref="compound.attributes" /> + </xsd:complexType> + + <xsd:element name="compound" type="compound.type" /> + +<?context-block end compound ?> + + +<?context-block begin references ?> + + <xsd:attributeGroup name="reference.attributes"> + <xsd:attribute name="label" type="reference.label.value" /> + </xsd:attributeGroup> + + <xsd:complexType type="reference.type"> + <xsd:attributeGroup ref="reference.attributes" /> + </xsd:complexType> + + <xsd:element name="lineref" type="reference.type" /> + <xsd:element name="pageref" type="reference.type" /> + <xsd:element name="textref" type="reference.type" /> + +<?context-block end references ?> + + +<?context-block begin unknown ?> + + <xsd:element name="unknown"/> + +<?context-block end unknown ?> + + +<?context-block begin verbatim ?> <!-- string or anyType --> + + <xsd:complexType name="verbatim.verbatim"> + <xsd:sequence maxOccurs="unbounded" > + <xsd:element name="line" type="xsd:string" /> + </xsd:sequence> + </xsd:complexType> + + <xsd:element name="verbatim" type="verbatim.verbatim" /> + <xsd:element name="typing" type="verbatim.verbatim" /> + + <xsd:element name="verb" type="xsd:string" /> + <xsd:element name="type" type="xsd:string" /> + +<?context-block end verbatim ?> + + +<?context-block begin itemize ?> + + <xsd:attributeGroup name="itemize.attributes"> + <xsd:attribute name="type" type="conversion.value" /> + <xsd:attribute name="packed" type="confirmation.value" /> + <xsd:attribute name="label" type="reference.label.value" /> + </xsd:attributeGroup> + + <xsd:attributeGroup name="item.attributes"> + <xsd:attribute name="label" type="reference.label.value" /> + </xsd:attributeGroup> + + <xsd:complexType name="item.type" mixed="true"> + <xsd:attributeGroup ref="item.attributes" /> + </xsd:complexType> + + <xsd:complexType name="itemize.type"> + <xsd:sequence minOccurs="1" maxOccurs="unbounded"> + <xml:element name="item" type="item.type" /> + </xsd:sequence> + <xsd:attributeGroup ref="itemize.attributes" /> + </xsd:complexType> + + <xsd:element name="itemize" type="itemize.type" /> + +<?context-block end itemize ?> + + +<?context-block begin fixed ?> + + <xsd:complexType name="fixed.type.value"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="figure" /> + <xsd:enumeration value="table" /> + </xsd:restriction> + </xsd:complexType> + + <xsd:complexType name="fixed.location.value"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="high" /> + <xsd:enumeration value="low" /> + <xsd:enumeration value="lohi" /> + </xsd:restriction> + </xsd:complexType> + + <xsd:attributeGroup name="fixed.attributes"> + <xsd:attribute name="type" type="fixed.type.value" /> + <xsd:attribute name="location" type="fixed.location.value" /> + <xsd:attribute name="label" type="reference.label.value" /> + </xsd:attributeGroup> + + <xsd:complexType name="fixed.type"> + <xsd:all> + <xsd:element name="caption" mixed="true" /> + <xsd:element name="content" mixed="true" /> + </xsd:all> + <xsd:attributeGroup ref="fixed.attributes" /> + </xsd:complexType> + + <xsd:element name="fixed" type="fixed.type" /> + +<?context-block end fixed ?> + + +<?context-block begin float ?> + + <xsd:complexType name="float.type.value"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="figure" /> + <xsd:enumeration value="table" /> + </xsd:restriction> + </xsd:complexType> + + <xsd:complexType name="float.location.value"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="high" /> + <xsd:enumeration value="low" /> + <xsd:enumeration value="lohi" /> + </xsd:restriction> + </xsd:complexType> + + <xsd:attributeGroup name="float.attributes"> + <xsd:attribute name="type" type="float.type.value" /> + <xsd:attribute name="location" type="float.location.value" /> + <xsd:attribute name="label" type="reference.label.value" /> + </xsd:attributeGroup> + + <xsd:complexType name="float.type"> + <xsd:all> + <xsd:element name="caption" mixed="true" /> + <xsd:element name="content" mixed="true" /> + </xsd:all> + <xsd:attributeGroup ref="float.attributes" /> + </xsd:complexType> + + <xsd:element name="float" type="float.type" /> + +<?context-block end float ?> + + +<?context-block begin externalfigure ?> + + <xsd:attributeGroup name="externalfigure.attributes"> + <xsd:extension base="context.kernel.externalfigure.attributes"> + <xsd:attribute name="base" type="filename.value"/> + <xsd:attribute name="file" type="filename.value"/> + <xsd:attribute name="label" type="reference.label.value"/> + </xsd:extension> + </xsd:attributeGroup> + + <xsd:complexType name="externalfigure.type"> + <xsd:attributeGroup ref="externalfigure.attributes" /> + </xsd:complexType> + + <xsd:element name="externalfigure" type="externalfigure.type" /> + +<?context-block end externalfigure ?> + + +<?context-block begin table ?> + + <xsd:attributeGroup name="table.attributes"> + <!-- these elements inherit ConTeXt TABLE parameters --> + <xsd:extension base="context.kernel.table.attributes" /> + </xsd:attributeGroup> + + <xsd:complexType name="table.td.type" mixed="true"> + <xsd:attributeGroup name="table.attributes" /> + </xsd:complexType> + + <xsd:complexType name="table.tr.type"> + <xsd:sequence maxOccurs="unbounded"> + <xsd:element name="td" type="table.td.type" /> + </xsd:sequence> + <xsd:attributeGroup name="table.attributes" /> + </xsd:complexType> + + <xsd:complexType name="table.type"> + <xsd:sequence maxOccurs="unbounded"> + <xsd:element name="tr" type="table.tr.type" /> + </xsd:sequence> + <xsd:attributeGroup name="table.attributes" /> + </xsd:complexType> + + <xsd:element name="table" type="table.type" /> + +<?context-block end table ?> + + +<?context-block begin tabulate ?> + + <xsd:complexType name="tabulate.td.type" mixed="true"> + </xsd:complexType> + + <xsd:complexType name="tabulate.tr.type"> + <xsd:sequence maxOccurs="unbounded"> + <xsd:element name="td" type="tabulate.td.type" /> + </xsd:sequence> + </xsd:complexType> + + <xsd:complexType name="tabulate.base.type"> + <xsd:sequence maxOccurs="unbounded"> + <xsd:element name="tr" type="tabulate.tr.type" /> + </xsd:sequence> + </xsd:complexType> + + <xsd:complexType name="tabulate.align.value"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="high" /> + <xsd:enumeration value="low" /> + <xsd:enumeration value="lohi" /> + </xsd:restriction> + </xsd:complexType> + + <xsd:attributeGroup name="tabulate.tcell.attributes"> + <xsd:attribute name="align" type="tabulate.align.value" /> + </xsd:attributeGroup> + + <xsd:complexType name="tabulate.tcell.type" mixed="true"> + <xsd:attributeGroup ref="tabulate.tcell.attributes" /> + </xsd:complexType> + + <xsd:complexType name="tabulate.tcell.type"> + </xsd:complexType> + + <xsd:complexType name="tabulate.tcells.type"> + <xsd:sequence maxOccurs="unbounded"> + <xsd:element name="tcell" type="tabulate.tcell.type" /> + </xsd:sequence> + </xsd:complexType> + + <xsd:complexType name="tabulate.type"> + <xsd:sequence> + <xsd:element name="tcells" type="tabulate.tcells.type" /> + <xsd:element name="thead" type="tabulate.base.type" minOccurs="0" maxOccurs="1" /> + <xsd:element name="ttail" type="tabulate.base.type" minOccurs="0" maxOccurs="1" /> + <xsd:element name="tbody" type="tabulate.base.type" minOccurs="1" maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + + <xsd:element name="tabulate" type="tabulate.type" /> + +<?context-block end tabulate ?> + + +</xsd:schema> diff --git a/tex/context/base/x-corres.rng b/tex/context/base/x-corres.rng new file mode 100644 index 000000000..09de5d267 --- /dev/null +++ b/tex/context/base/x-corres.rng @@ -0,0 +1,170 @@ +<?xml version="1.0" ?> + +<?context-block begin grammar ?> + +<grammar xmlns="http://relaxng.org/ns/structure/1.0"> + + <?context-block end grammar ?> + + <?context-block begin contacts ?> + + <start> + <ref name="contacts"/> + </start> + + <define name="contacts"> + <element name="contacts"> + <zeroOrMore> + <choice> + <ref name="contacts.contact"/> + <ref name="contacts.contactgroup"/> + <ref name="contacts.contactfile"/> + </choice> + </zeroOrMore> + </element> + </define> + + <?context-block end contacts ?> + + <?context-block begin contact ?> + + <define name="contacts.contact"> + <element name="contact"> + <interleave> + <optional> <ref name="contact.initials"/> </optional> + <optional> <ref name="contact.formalname"/> </optional> + <optional> <ref name="contact.informalname"/> </optional> + <optional> <ref name="contact.title"/> </optional> + <optional> <ref name="contact.prefix"/> </optional> + <optional> <ref name="contact.suffix"/> </optional> + <optional> <ref name="contact.telephone"/> </optional> + <optional> <ref name="contact.mobiletelephone"/> </optional> + <optional> <ref name="contact.telefax"/> </optional> + <optional> <ref name="contact.email"/> </optional> + <optional> <ref name="contact.address"/> </optional> + <optional> <ref name="contact.information"/> </optional> + </interleave> + <attribute name="label"/> + </element> + </define> + + <?context-block end contact ?> + + <?context-block begin fields ?> + + <define name="contact.initials"> + <element name="initials"> + <text/> + </element> + </define> + + <define name="contact.formalname"> + <element name="formalname"> + <text/> + </element> + </define> + + <define name="contact.informalname"> + <element name="informalname"> + <text/> + </element> + </define> + + <define name="contact.title"> + <element name="title"> + <text/> + </element> + </define> + + <define name="contact.prefix"> + <element name="prefix"> + <text/> + </element> + </define> + + <define name="contact.suffix"> + <element name="suffix"> + <text/> + </element> + </define> + + <define name="contact.telephone"> + <element name="telephone"> + <text/> + </element> + </define> + + <define name="contact.mobiletelephone"> + <element name="mobiletelephone"> + <text/> + </element> + </define> + + <define name="contact.telefax"> + <element name="telefax"> + <text/> + </element> + </define> + + <define name="contact.email"> + <element name="email"> + <text/> + </element> + </define> + + <define name="contact.address"> + <element name="address"> + <zeroOrMore> + <ref name="contact.address.p"/> + </zeroOrMore> + </element> + </define> + + <define name="contact.information"> + <element name="information"> + <text/> + </element> + </define> + + <define name="contact.address.p"> + <element name="p"> + <text/> + </element> + </define> + + <?context-block end fields ?> + + <?context-block begin contactgroup ?> + + <define name="contacts.contactgroup"> + <element name="contactgroup"> + <zeroOrMore> + <ref name="contactgroup.member"/> + </zeroOrMore> + <attribute name="label"/> + </element> + </define> + + <define name="contactgroup.member"> + <element name="member"> + <text/> + </element> + </define> + + <?context-block end contactgroup ?> + + <?context-block begin contactfile ?> + + <define name="contacts.contactfile"> + <element name="contactfile"> + <text/> + </element> + </define> + + <?context-block end contactfile ?> + + <?context-block begin grammar ?> + +</grammar> + +<?context-block end grammar ?>
\ No newline at end of file diff --git a/tex/context/base/x-fig-00.dtd b/tex/context/base/x-fig-00.dtd new file mode 100644 index 000000000..34b4d0bef --- /dev/null +++ b/tex/context/base/x-fig-00.dtd @@ -0,0 +1,24 @@ +<!-- author : Taco Hoekwater / Hans Hagen + info : x-fig-00.tex / x-fig-01.tex + usage : <!DOCTYPE figurelibrary SYSTEM "x-fig-00.dtd"> + --> + +<!ELEMENT figurelibrary (description?,figure*)> + +<!ATTLIST figurelibrary language CDATA #IMPLIED> +<!ATTLIST dummy width CDATA #IMPLIED> +<!ATTLIST dummy height CDATA #IMPLIED> + +<!ELEMENT description (organization?,project?,product?,comment?)> +<!ELEMENT organization (#PCDATA)> +<!ELEMENT project (#PCDATA)> +<!ELEMENT product (#PCDATA)> + +<!ELEMENT figure (label,file?,dummy?,copyright?,comment?,status?)> +<!ELEMENT dummy (#PCDATA)> +<!ELEMENT file (#PCDATA)> +<!ELEMENT label (#PCDATA)> +<!ELEMENT copyright (#PCDATA)> +<!ELEMENT status (#PCDATA)> + +<!ELEMENT comment (#PCDATA)> diff --git a/tex/context/base/x-fig-00.xsd b/tex/context/base/x-fig-00.xsd new file mode 100644 index 000000000..615841a1e --- /dev/null +++ b/tex/context/base/x-fig-00.xsd @@ -0,0 +1,77 @@ +<?xml version="1.0"?> + +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + +<xsd:annotation> + <xsd:documentation xml:lang="en"> + <p>This schema described the figure database. This base + can be used to collect graphics that later can be used + in applications like ConTeXt.</p> + <p>author: Tobias Burnus & Hans Hagen, copyright: + PRAGMA-ADE / Hasselt NL</p> + </xsd:documentation> +</xsd:annotation> + +<xsd:element name="figurelibrary" type="figureLibraryType" /> + +<xsd:element name="comment" type="nonZeroString" /> + +<xsd:complexType name="figureLibraryType"> + <xsd:sequence> + <xsd:element name="description" type="descriptionType" /> + <xsd:element name="figure" type="figureType" + minOccurs="0" maxOccurs="unbounded" /> + </xsd:sequence> + <xsd:attribute name="language" type="xsd:language" /> +</xsd:complexType> + +<xsd:complexType name="descriptionType"> + <xsd:sequence> + <xsd:element name="organization" type="nonZeroString" /> + <xsd:element name="project" type="nonZeroString" /> + <xsd:element name="product" type="nonZeroString" /> + <xsd:element ref="comment" minOccurs="0" /> + </xsd:sequence> +</xsd:complexType> + +<xsd:complexType name="figureType"> + <xsd:sequence> + <xsd:choice> + <xsd:element name="file" type="NZNormalizedString" /> + <xsd:element name="dummy" type="dummyType" /> + </xsd:choice> + <xsd:element name="label" type="NZNormalizedString" /> + <xsd:element name="copyright" type="nonZeroString" /> + <xsd:element ref="comment" minOccurs="0" /> + </xsd:sequence> +</xsd:complexType> + +<xsd:complexType name="dummyType"> + <xsd:simpleContent> + <xsd:extension base="nonZeroString"> + <xsd:attribute name="width" type="TeXUnit" use="required" /> + <xsd:attribute name="height" type="TeXUnit" use="required" /> + </xsd:extension> + </xsd:simpleContent> +</xsd:complexType> + +<xsd:simpleType name="nonZeroString"> + <xsd:restriction base="xsd:string"> + <xsd:minLength value="1" /> + </xsd:restriction> +</xsd:simpleType> + +<xsd:simpleType name="NZNormalizedString"> + <xsd:restriction base="xsd:normalizedString"> + <xsd:minLength value="1" /> + </xsd:restriction> +</xsd:simpleType> + +<xsd:simpleType name="TeXUnit"> + <xsd:restriction base="xsd:string"> + <xsd:pattern + value='[0-9]*(,|\.|[0-9])?[0-9]*(cm|mm|in|pt|pc|em|ex|bp|dd|cc|sp)' /> + </xsd:restriction> +</xsd:simpleType> + +</xsd:schema> diff --git a/tex/context/base/x-mathml.xsd b/tex/context/base/x-mathml.xsd new file mode 100644 index 000000000..17f0bea2a --- /dev/null +++ b/tex/context/base/x-mathml.xsd @@ -0,0 +1,11 @@ +<?xml version="1.0"?> + +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xds="http://www.w3.org/?"> + +<xsd:schema> + +<xsd:element name="imath" type="mathml:math" /> +<xsd:element name="dmath" type="mathml:math" /> + +</xsd:schema> diff --git a/tex/context/base/x-physml.xsd b/tex/context/base/x-physml.xsd new file mode 100644 index 000000000..865d88c58 --- /dev/null +++ b/tex/context/base/x-physml.xsd @@ -0,0 +1,172 @@ +<?xml version="1.0"?> + +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + +<xsd:annotation> + <xsd:documentation xml:lang="en"> + This schema covers (basic presentational) Physics + markup. It combines the power of MathML and the ConTeXt + units engine. + + author: Hans Hagen, copyright: PRAGMA-ADE / Hasselt NL + </xsd:documentation> +</xsd:annotation> + +<xsd:complexType name="unit.power.type"> + <xsd:element name="Inverse" minOccurs="0" maxOccurs="1" /> + <xsd:choice> + <xsd:element name="Linear" /> + <xsd:element name="Square" /> + <xsd:element name="Cubic" /> + </xsd:choice> +</xsd:complexType> + +<xsd:complexType name="unit.prefix.type"> + <xsd:choice> + <xsd:element name="Atto" /> + <xsd:element name="Femto" /> + <xsd:element name="Pico" /> + <xsd:element name="Nano" /> + <xsd:element name="Micro" /> + <xsd:element name="Milli" /> + <xsd:element name="Centi" /> + <xsd:element name="Deci" /> + <xsd:element name="Hecto" /> + <xsd:element name="Kilo" /> + <xsd:element name="Mega" /> + <xsd:element name="Giga" /> + <xsd:element name="Terra" /> + <xsd:element name="Peta" /> + <xsd:element name="Exa" /> + + <xsd:element name="NoUnit" /> + </xsd:choice> +</xsd:complexType> + +<xsd:complexType name="unit.midfix.type"> + <xsd:choice> + <xsd:element name="Per" /> + <xsd:element name="Times" /> + <xsd:element name="Solidus" /> + <xsd:element name="OutOf" /> + </xsd:choice> +</xsd:complexType> + +<xsd:complexType name="unit.suffix.type"> + <xsd:choice> + <xsd:element name="Ampere" /> + <xsd:element name="Angstrom" /> + <xsd:element name="At" /> + <xsd:element name="Atm" /> + <xsd:element name="Atom" /> + <xsd:element name="Bar" /> + <xsd:element name="Baud" /> + <xsd:element name="Bell" /> + <xsd:element name="Bequerel" /> + <xsd:element name="Bit" /> + <xsd:element name="Byte" /> + <xsd:element name="Cal" /> + <xsd:element name="Candela" /> + <xsd:element name="Celsius" /> + <xsd:element name="Coulomb" /> + <xsd:element name="Day" /> + <xsd:element name="Deg" /> + <xsd:element name="Degrees" /> + <xsd:element name="Equivalent" /> + <xsd:element name="EVolt" /> + <xsd:element name="eVolt" /> + <xsd:element name="Fahrenheit" /> + <xsd:element name="Farad" /> + <xsd:element name="Foot" /> + <xsd:element name="Force" /> + <xsd:element name="Gauss" /> + <xsd:element name="Gram" /> + <xsd:element name="Gray" /> + <xsd:element name="Henry" /> + <xsd:element name="Hertz" /> + <xsd:element name="Hour" /> + <xsd:element name="Inch" /> + <xsd:element name="Joule" /> + <xsd:element name="Kelvin" /> + <xsd:element name="Liter" /> + <xsd:element name="Lux" /> + <xsd:element name="Meter" /> + <xsd:element name="Min" /> + <xsd:element name="Mol" /> + <xsd:element name="Molair" /> + <xsd:element name="Month" /> + <xsd:element name="Newton" /> + <xsd:element name="Ohm" /> + <xsd:element name="Pascal" /> + <xsd:element name="Rad" /> + <xsd:element name="RevPerMin" /> + <xsd:element name="RevPerSec" /> + <xsd:element name="Sec" /> + <xsd:element name="Second" /> + <xsd:element name="Siemens" /> + <xsd:element name="Sievert" /> + <xsd:element name="Sterant" /> + <xsd:element name="Tesla" /> + <xsd:element name="Volt" /> + <xsd:element name="VoltAC" /> + <xsd:element name="VoltDC" /> + <xsd:element name="Watt" /> + <xsd:element name="Weber" /> + <xsd:element name="Week" /> + <xsd:element name="Year" /> + + <xsd:element name="Unit" /> + </xsd:choice> +</xsd:complexType> + +<xsd:complexType name="unit.component.type"> + <xsd:sequence> + <xsd:element ref="unit.power.type" minOccurs="0" maxOccurs="1" /> + <xsd:element ref="unit.prefix.type" minOccurs="0" maxOccurs="1" /> + <xsd:element ref="unit.suffix.type" minOccurs="0" maxOccurs="1" /> + </xsd:sequence> +</xsd:complexType> + +<xsd:complexType name="unit.type"> + <xsd:choice> + <xsd:sequence> + <xsd:element ref="unit.component.type" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + <xsd:sequence> + <xsd:element ref="unit.component.type" minOccurs="1" maxOccurs="1" /> + <xsd:element ref="unit.midfix.type" minOccurs="1" maxOccurs="1" /> + <xsd:element ref="unit.component.type" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:choice> +</xsd:complexType> + +<xsd:element name="unit" type="unit.type" /> + +<xsd:element name="physics.type"> + <choice> + <xsd:element name="apply"> + <xsd:sequence> + <xsd:element name="unit" minOccurs="1" maxOccurs="1" /> + <xsd:element name="some kind of mml result" minOccurs="0" maxOccurs="1" /> + <choice> + <xsd:element name="cu" type=unit.type minOccurs="0" maxOccurs="1" /> + <xsd:element name="cunseq" type=unit.type minOccurs="0" maxOccurs="1" /> + <xsd:element name="csymbol" type=unit.type minOccurs="0" maxOccurs="1" /> + </choice> + </xsd:sequence> + </xsd:element> + <xsd:sequence> + <choice> + <xsd:element name="cn" minOccurs="0" maxOccurs="1" /> + <xsd:element name="ci" minOccurs="0" maxOccurs="1" /> + </choice> + <xsd:element name="cu" type="unit.type" minOccurs="0" maxOccurs="1" /> + </xsd:sequence> + </choice> +</xsd:element> + +<xsd:element name="phys" type="physics.type" /> +<xsd:element name="iphys" type="physics.type" /> +<xsd:element name="dphys" type="physics.type" /> + +</xsd:schema> diff --git a/tex/context/base/x-res-00.tex b/tex/context/base/x-res-00.tex index 46a278768..9878d0a58 100644 --- a/tex/context/base/x-res-00.tex +++ b/tex/context/base/x-res-00.tex @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\unprotect +\unprotect % \defineXMLcommandpush [rl:instance] (todo) % \rawframed == [frame=off,offset=overlay] @@ -19,28 +19,29 @@ % resource library \defineXMLprocess [rl:figurelibrary] % not to be used any longer -\defineXMLprocess [rl:library] +\defineXMLprocess [rl:library] -% resource library description +% resource library description \defineXMLignore [rl:description] \defineXMLpush [rl:organization] \defineXMLpush [rl:product] \defineXMLpush [rl:project] +\defineXMLpush [rl:collection] -% resource library entries (better use XMLignore) +% resource library entries (better use XMLignore) -\defineXMLignore [rl:applet] -\defineXMLignore [rl:application] -\defineXMLignore [rl:figure] -\defineXMLignore [rl:movie] -\defineXMLignore [rl:sound] +\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:type] +\defineXMLpush [rl:state] +\defineXMLpush [rl:width] +\defineXMLpush [rl:height] \defineXMLpush [rl:file] \defineXMLpush [rl:label] \defineXMLpush [rl:original] @@ -54,13 +55,13 @@ \defineXMLpush [rl:original] \defineXMLpush [rl:manipulation] -% instances +% instances \defineXMLignore [rl:instance] \defineXMLpush [rl:background] -\defineXMLpush [rl:viewport] -\defineXMLpush [rl:dimension] -\defineXMLpush [rl:position] +\defineXMLpush [rl:viewport] +\defineXMLpush [rl:dimension] +\defineXMLpush [rl:position] -\protect \endinput +\protect \endinput diff --git a/tex/context/base/x-res-04.tex b/tex/context/base/x-res-04.tex index 826a07d23..066404afd 100644 --- a/tex/context/base/x-res-04.tex +++ b/tex/context/base/x-res-04.tex @@ -39,30 +39,32 @@ %D \starttyping %D <!-- texexec --pdf --use=fig-01 figtest.xml --> %D -%D <figurelibrary language="nl"> +%D <?xml version='1.0'?> %D -%D <description> -%D <organization>PRAGMA Advanced Document Engineering</organization> -%D <project>Manuals</project> -%D <product>Beginners Manual</product> -%D <comment>A bunch of figures.</comment> -%D </description> +%D <rl:library language="nl"> %D -%D <figure> -%D <file>koe.pdf</file> -%D <label>a dutch cow</label> -%D <copyright>Corel Draw Suite</copyright> -%D <comment>I bet that you've seen this cow before.</comment> -%D </figure> +%D <rl:description> +%D <organization>PRAGMA Advanced Document Engineering</rl:organization> +%D <project>Manuals</rl:project> +%D <product>Beginners Manual</rl:product> +%D <comment>A bunch of figures.</rl:comment> +%D </rl:description> %D -%D <figure> -%D <dummy width="4cm" height="3cm">non existent</dummy> -%D <label>a european cow</label> -%D <copyright>Nobody</copyright> -%D <comment>When will we talk about European cows?</comment> -%D </figure> +%D <rl:figure> +%D <rl:file>koe.pdf</rl:file> +%D <rl:label>a dutch cow</rl:label> +%D <rl:copyright>Corel Draw Suite</rl:copyright> +%D <rl:comment>I bet that you've seen this cow before.</rl:comment> +%D </rl:figure> %D -%D </figurelibrary> +%D <rl:figure> +%D <rl:dummy width="4cm" height="3cm">non existent</rl:dummy> +%D <rl:label>a european cow</rl:label> +%D <rl:copyright>Nobody</rl:copyright> +%D <rl:comment>When will we talk about European cows?</rl:comment> +%D </rl:figure> +%D +%D </rl:library> %D \stoptyping %D %D You can convert this base into a \PDF\ file using @@ -183,8 +185,8 @@ \doglobal\newcounter\figurefilepage \autoXMLnamespace[rl] \startXMLmapping[rl:find] - \xdef\figurefilebase{#1} - \def\askedlabel{#2} + \xdef\figurefilebase{#1}% + \def\askedlabel{#2}% \doifelseXMLelement{rl:rl:\askedlabel} {\enableXMLelements\flushXMLelement{rl:rl:\askedlabel}} {\processcommacommand[\figurepathlist]\dogetfigurefilename}% diff --git a/tex/context/base/x-set-11.tex b/tex/context/base/x-set-11.tex index 9c24ae53d..37de793bc 100644 --- a/tex/context/base/x-set-11.tex +++ b/tex/context/base/x-set-11.tex @@ -97,7 +97,7 @@ 2: -- is processed 3: -- is undefined 4: -- is processed again - optional: optioneel + optional: optional displaymath: formula index: entry math: formula diff --git a/tex/context/base/x-sm2om.xsl b/tex/context/base/x-sm2om.xsl index 022d37355..04677f30a 100644 --- a/tex/context/base/x-sm2om.xsl +++ b/tex/context/base/x-sm2om.xsl @@ -1,5 +1,27 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- + This style sheet is used in the Math4All project. This project + will provide an on-line math method for secondary and tertiary + education. In addition to the web-bases content the project + provides high quality typeset output as well. + + This style converts some elements to open math alternatives and + its sole purpose is to easy the input of inline math. + + <i>x</i> identifier (use <v>x</v> when possible) + <n>5</n> number + <v>5</v> variable + <r>1:2</r> interval (range) + <r>x:y</r> interval (range) using variables + + This style is dedicated to Frits Spijkers, an open minded math + author who patiently tested all the related TeX things. + + Hans Hagen, PRAGMA ADE, Hasselt NL / 2006-04-27 + +--> + <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml"/> diff --git a/tex/context/base/xtag-pre.tex b/tex/context/base/xtag-pre.tex index e589e39be..da720bbc7 100644 --- a/tex/context/base/xtag-pre.tex +++ b/tex/context/base/xtag-pre.tex @@ -411,4 +411,24 @@ % % \defineXMLsingular [gobblespacetokens] {\gobblespacetokens} +%D We automatically switch regimes (beware of nested files!): +%D +%D \starttyping +%D \startXMLdata +%D <?xml version='1.0' encoding='utf-8'?> +%D ÀÁÂÃÄÅàáâãäåÆÇæç +%D ÈÉÊËèéêëÌÍÎÏÞìíîïþ +%D ÐðÑñÒÓÔÕÖòóôõöØø +%D ÙÚÛÜùúûÝýÿß +%D \stopXMLdata +%D \stoptyping + +\defineXMLprocessor [xml] {\handleXMLbanner} + +\def\handleXMLbanner#1% + {\getXMLarguments{xml}{\s!encoding='' #1}% + \doifsomething{\XMLpar{xml}\s!encoding\empty} + {\doif\currentregime\s!default % style regimes will take precedence + {\enableregime[\XMLpar{xml}\s!encoding\empty]}\donothing}} + \protect \endinput |