diff options
Diffstat (limited to 'tex')
28 files changed, 469 insertions, 74 deletions
diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex index 7e88bb7cc..355bc7e47 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{2005.07.21} +\def\contextversion{2005.07.27} %D Welcome to the main module. When this module is ran through %D \type{initex} or \type {tex -i} or \type {whatevertex} using diff --git a/tex/context/base/core-con.tex b/tex/context/base/core-con.tex index 364ed89f0..a6d66641c 100644 --- a/tex/context/base/core-con.tex +++ b/tex/context/base/core-con.tex @@ -138,24 +138,24 @@ \beginTEX -\def\doconvertcharacters#1#2% - {\ifnum#2>26 +\def\dodoconvertcharacters#1#2#3% + {\ifnum#3>#1 \bgroup - \!!counta#2\relax + \!!counta#3\relax \ifnum\!!counta>\zerocount \advance\!!counta \minusone \!!countb\!!counta - \divide\!!counta 26 + \divide\!!counta #1% \!!countc\!!counta - \multiply\!!countc 26 + \multiply\!!countc #1% \advance\!!countb -\!!countc - \doconvertcharacters#1{\!!counta}% + \doconvertcharacters#3{\!!counta}% \advance\!!countb \plusone - #1{\the\!!countb}% + #3{\the\!!countb}% \fi \egroup \else - #1{#2}% pure expansion, used in references + #2{#3}% pure expansion, used in references \fi} \endTEX @@ -164,18 +164,20 @@ \beginETEX \numexpr -\def\doconvertcharacters#1#2% - {\ifcase#2\else - \ifnum#2>26 - \expandafter\doconvertcharacters\expandafter#1\expandafter{\the\numexpr(#2+12)/26-1\relax}% - \expandafter#1\expandafter{\the\numexpr#2-((#2+12)/26-)*26\relax}% +\def\dodoconvertcharacters#1#2#3% + {\ifcase#3\else + \ifnum#3>#1 + \expandafter\doconvertcharacters\expandafter#2\expandafter{\the\numexpr(#3+12)/#1-1\relax}% + \expandafter#2\expandafter{\the\numexpr#3-((#3+12)/#1-1)*#1\relax}% \else - \expandafter#1\expandafter{\number#2}% + \expandafter#2\expandafter{\number#3}% \fi \fi} \endETEX +\def\doconvertcharacters{\dodoconvertcharacters{26}} + \def\characters{\doconvertcharacters\character} \def\Characters{\doconvertcharacters\Character} @@ -184,8 +186,8 @@ %D %D Why should we only honour the romans, and not the greek? -\def\greeknumerals#1% watch the \normalxi - {\mathematics +\def\greeknumerals#1% + {% no longer needed: \mathematics {\ifcase#1\unknowncharacter\or \alpha \or \beta \or \gamma \or \delta \or \varepsilon \or \zeta \or \eta \or \theta \or @@ -198,7 +200,7 @@ \fi}} \def\Greeknumerals#1% - {\mathematics + {% no longer needed: \mathematics {\ifcase#1\unknowncharacter \or \Alpha \or \Beta \or \Gamma \or \Delta \or \Epsilon \or \Zeta \or \Eta \or \Theta \or diff --git a/tex/context/base/core-job.tex b/tex/context/base/core-job.tex index 10c601786..b7e203240 100644 --- a/tex/context/base/core-job.tex +++ b/tex/context/base/core-job.tex @@ -249,12 +249,12 @@ %\the\everybye % %\the\everygoodbye % == \end (new) %\expandafter\normalend % - \expandafter\end + \expandafter\finalend \fi} -\let\normalend=\end +\let\normalend\end -\def\end +\def\finalend {\ifnum\textlevel>\zerocount \else \the\everybye \the\everygoodbye @@ -263,6 +263,8 @@ \expandafter\normalend \fi} +\let\end\finalend + \def\emergencyend {\writestatus\m!systems{invalid \@EA\string\csname\e!start\v!text\endcsname...\@EA\string\csname\e!stop\v!text\endcsname\space structure}% \stoptext} diff --git a/tex/context/base/core-pos.tex b/tex/context/base/core-pos.tex index 2b1bbb8e5..429aefeec 100644 --- a/tex/context/base/core-pos.tex +++ b/tex/context/base/core-pos.tex @@ -2364,7 +2364,7 @@ % \vadjust{\box#1}% % \egroup} -\def\dopositionmarginbox#1% +\def\dopositionmarginbox#1% how about page boundaries ! {\bgroup \ifrepositionmarginbox \doglobal\increment\currentmarginpos diff --git a/tex/context/base/core-spa.tex b/tex/context/base/core-spa.tex index e52735f80..c96405246 100644 --- a/tex/context/base/core-spa.tex +++ b/tex/context/base/core-spa.tex @@ -992,8 +992,8 @@ \ifblankflexible \else \bigskipamount1\bigskipamount \fi - \medskipamount \bigskipamount \divide\medskipamount 2 - \smallskipamount\bigskipamount \divide\smallskipamount 4 }% + \medskipamount \bigskipamount \divide\medskipamount \plustwo + \smallskipamount\bigskipamount \divide\smallskipamount\plusfour}% \def\complexsetupblank[#1]% more \let's {\ifgridsnapping @@ -1183,7 +1183,8 @@ % \noindent\hskip\parindent % \fi \fi} -\let\currentindentation\empty % amount +\let\currentindentation\empty % amount/keyword +% \let\normalindentation \empty % used for reinstating normal indentation \let\currentindenting \empty % method \newdimen\ctxparindent @@ -1215,6 +1216,14 @@ \convertcommand\!!stringa\to\!!stringa \executeifdefined{\??in:\!!stringa}{\edef\currentindentation{#1}\simplesetupindenting}} +\def\docomplexsetupindenting#1% + {\edef\!!stringa{#1}% catch #1=\somedimen + \convertcommand\!!stringa\to\!!stringa + \executeifdefined{\??in:\!!stringa} + {\edef\currentindentation{#1}% + \let\normalindentation\currentindentation + \simplesetupindenting}} + \def\simplesetupindenting % empty case {\assigndimension\currentindentation\ctxparindent{1em}{1.5em}{2em}} @@ -1240,6 +1249,11 @@ \defineindentingmethod [\v!odd] {\chardef\indentingtoggle\plusone} \defineindentingmethod [\v!even] {\chardef\indentingtoggle\plustwo} +\defineindentingmethod [\v!normal] {\ifx\normalindentation\empty\else + \let\currentindentation\normalindentation + \simplesetupindenting + \fi} + \def\noindenting{\indenting[\v!no, \v!next ]} % was \nietinspringen \def\doindenting{\indenting[\v!yes,\v!first]} % was \welinspringen @@ -1410,9 +1424,10 @@ \def\packed {\nointerlineskip} -\def\godown[#1]% nog eens mooier, relateren aan blanko - {\nointerlineskip - \vskip#1 } +\def\godown[#1]% + {\relax + \ifhmode\endgraf\fi + \ifvmode\nointerlineskip\vskip#1\relax} %D A couple of plain macros: @@ -4339,7 +4354,7 @@ \!!minus#3\fontdimen4\font} \def\fixedspaceamount#1% - {#1\fontdimen2\font} + {#1\fontdimen2\font} \setupwhitespace [\v!none] diff --git a/tex/context/base/enco-pfr.tex b/tex/context/base/enco-pfr.tex index ee9857a0e..9e1e853b5 100644 --- a/tex/context/base/enco-pfr.tex +++ b/tex/context/base/enco-pfr.tex @@ -124,7 +124,7 @@ {\donefalse % we use boolean due to \par \doifundefined{\pdffontresource}% should be \long {\doif{#1}{\currentencoding}{\donetrue}}% - \ifdone + \ifdone % pdftex ! \immediate\pdfobj stream {#2}% \setxvalue{\pdffontresource}{\the\pdflastobj}% \fi} @@ -189,7 +189,7 @@ \dodoincludepdffontresource \fi} -\def\dodoincludepdffontresource% +\def\dodoincludepdffontresource {\ifx\currentencoding\empty \else \ifx\currentencoding\s!default \else \@EA\ifx\csname\pdffontfileresource\endcsname\relax\else \edef\xpdffontfileresource{\csname\pdffontfileresource\endcsname}% @@ -209,13 +209,21 @@ \endTEX - %D For the moment, we keep this definition here, if only %D because \type {\usepdffontencoding} is not defined in the -%D core. In the end, this will go to enco-il2. +%D core. In the end, this will go to \type {enco-*.tex}. +%D +%D Test: +%D +%D \starttyping +%D \useencoding[pfr] \usetypescript[palatino][ec] \setupbodyfont[palatino] +%D +%D \starttext +%D fi ff ffi +%D \stoptext +%D \stoptyping -\startencoding [il2] - \usepdffontresource il2 -\stopencoding +\startencoding [il2] \usepdffontresource il2 \stopencoding +\startencoding [ec] \usepdffontresource ec \stopencoding \protect \endinput diff --git a/tex/context/base/lang-chi.tex b/tex/context/base/lang-chi.tex index b0ac6b1d5..b6c3ba20a 100644 --- a/tex/context/base/lang-chi.tex +++ b/tex/context/base/lang-chi.tex @@ -34,26 +34,26 @@ \c!date={\v!month,\ ,\v!day,{,\ },\v!year}, \c!state=\v!stop] -\setupheadtext [\s!cn] [\v!content={\cnencoding\cnencodedcontents}] -\setupheadtext [\s!cn] [\v!tables={\cnencoding\cnencodedtables}] -\setupheadtext [\s!cn] [\v!figures={\cnencoding\cnencodedfigures}] -\setupheadtext [\s!cn] [\v!graphics=Graphics] -\setupheadtext [\s!cn] [\v!intermezzi=Intermezzos] -\setupheadtext [\s!cn] [\v!index={\cnencoding\cnencodedindex}] +\setupheadtext [\s!cn] [\v!content={\cnencoding\cnencodedcontents}] +\setupheadtext [\s!cn] [\v!tables={\cnencoding\cnencodedtables}] +\setupheadtext [\s!cn] [\v!figures={\cnencoding\cnencodedfigures}] +\setupheadtext [\s!cn] [\v!graphics=Graphics] +\setupheadtext [\s!cn] [\v!intermezzi=Intermezzos] +\setupheadtext [\s!cn] [\v!index={\cnencoding\cnencodedindex}] \setupheadtext [\s!cn] [\v!abbreviations={\cnencoding\cnencodedabbreviations}] -\setupheadtext [\s!cn] [\v!logos={\cnencoding\cnencodedlogos}] -\setupheadtext [\s!cn] [\v!units={\cnencoding\cnencodedunits}] - -\setuplabeltext [\s!cn] [\v!table={\cnencoding\cnencodedtable}] -\setuplabeltext [\s!cn] [\v!figure={\cnencoding\cnencodedfigure}] -\setuplabeltext [\s!cn] [\v!intermezzo=Intermezzo ] -\setuplabeltext [\s!cn] [\v!graphic=Illustration ] -\setuplabeltext [\s!cn] [\v!appendix=] -\setuplabeltext [\s!cn] [\v!part={\cnencoding\cnencodedintro,\cnencoding\cnencodedpart}] -\setuplabeltext [\s!cn] [\v!chapter={\cnencoding\cnencodedintro,\cnencoding\cnencodedchapter}] -\setuplabeltext [\s!cn] [\v!section={\cnencoding\cnencodedintro,\cnencoding\cnencodedsection}] -\setuplabeltext [\s!cn] [\v!line=line ] -\setuplabeltext [\s!cn] [\v!lines=lines ] +\setupheadtext [\s!cn] [\v!logos={\cnencoding\cnencodedlogos}] +\setupheadtext [\s!cn] [\v!units={\cnencoding\cnencodedunits}] + +\setuplabeltext [\s!cn] [\v!table={\cnencoding\cnencodedtable}] +\setuplabeltext [\s!cn] [\v!figure={\cnencoding\cnencodedfigure}] +\setuplabeltext [\s!cn] [\v!intermezzo=Intermezzo ] +\setuplabeltext [\s!cn] [\v!graphic=Illustration ] +\setuplabeltext [\s!cn] [\v!appendix=] +\setuplabeltext [\s!cn] [\v!part={\cnencoding\cnencodedintro,\cnencoding\cnencodedpart}] +\setuplabeltext [\s!cn] [\v!chapter={\cnencoding\cnencodedintro,\cnencoding\cnencodedchapter}] +\setuplabeltext [\s!cn] [\v!section={\cnencoding\cnencodedintro,\cnencoding\cnencodedsection}] +\setuplabeltext [\s!cn] [\v!line=line ] +\setuplabeltext [\s!cn] [\v!lines=lines ] \setuplabeltext [\s!cn] [\v!subsection=] \setuplabeltext [\s!cn] [\v!subsubsection=] diff --git a/tex/context/base/lang-sla.tex b/tex/context/base/lang-sla.tex index 4d310e8ee..96d537909 100644 --- a/tex/context/base/lang-sla.tex +++ b/tex/context/base/lang-sla.tex @@ -445,4 +445,52 @@ %D \ShowAllLanguageValues [\s!hr] [croatian] {Croatian} {heartthrob} %D \ShowAllLanguageValues [\s!sl] [slovenian] {Slovenian} {mountains} +%D A present from Brooks Moses and Hans hagen for Mojca Miklavec: + +\def\doconvertsloveniancharacters{\dodoconvertcharacters{25}} + +\def\sloveniancharacters{\doconvertsloveniancharacters\sloveniancharacter} +\def\slovenianCharacters{\doconvertsloveniancharacters\slovenianCharacter} + +%D Define general-purpose macros for Slovenian character enumerations: + +\defineconversion [sloveniancharacter] [\sloveniancharacter] +\defineconversion [slovenianCharacter] [\slovenianCharacter] + +\defineconversion [sloveniancharacters] [\sloveniancharacters] +\defineconversion [slovenianCharacters] [\slovenianCharacters] + +%D Define these as the general character enumeration when +%D language is Slovenian. If you feel uncomfortable with this, +%D mail Mojca, since she promised to to take the heat. + +\defineconversion [sl] [character] [\sloveniancharacter] +\defineconversion [sl] [Character] [\slovenianCharacter] + +\defineconversion [sl] [characters] [\sloveniancharacters] +\defineconversion [sl] [Characters] [\slovenianCharacters] + +\defineconversion [sl] [a] [\sloveniancharacters] +\defineconversion [sl] [A] [\slovenianCharacters] +\defineconversion [sl] [AK] [\smallcapped\sloveniancharacters] +\defineconversion [sl] [KA] [\smallcapped\sloveniancharacters] + +%D This may move to \type {core-con.tex}. + +\def\sloveniancharacter#1% + {\ifcase#1\unknowncharacter + \or a\or b\or c\or \ccaron\or d\or e\or f\or g\or h\or i\or j\or k\or l\or m% + \or n\or o\or p\or r\or s\or \scaron\or t\or u\or v\or z\or \zcaron + \else + \unknowncharacter + \fi} + +\def\slovenianCharacter#1% + {\ifcase#1\unknowncharacter + \or A\or B\or C\or \Ccaron\or D\or E\or F\or G\or H\or I\or J\or K\or L\or M% + \or N\or O\or P\or R\or S\or \Scaron\or T\or U\or V\or Z\or \Zcaron + \else + \unknowncharacter + \fi} + \protect \endinput diff --git a/tex/context/base/meta-ini.tex b/tex/context/base/meta-ini.tex index 058fa0bc8..d628e5e6c 100644 --- a/tex/context/base/meta-ini.tex +++ b/tex/context/base/meta-ini.tex @@ -572,6 +572,25 @@ %D %D The \type {\resetMPenvironment} is a quick way to erase %D the token list. +%D +%D You should be aware of independencies. For instance, if you use a font +%D in a graphic that is not used in the main document, you need to load the +%D typescript at the outer level (either directly or by using the global +%D option). +%D +%D \starttyping +%D \usetypescript[palatino][texnansi] +%D +%D \startMPenvironment +%D \usetypescript[palatino][texnansi] +%D \enableregime[utf] +%D \setupbodyfont[palatino] +%D \stopMPenvironment +%D +%D \startMPpage +%D draw btex aap‒noot coördinatie – één etex ; +%D \stopMPpage +%D \stoptyping %D We don't want spurious files, do we? diff --git a/tex/context/base/mult-con.tex b/tex/context/base/mult-con.tex index 8d308def6..201dd1082 100644 --- a/tex/context/base/mult-con.tex +++ b/tex/context/base/mult-con.tex @@ -2344,6 +2344,10 @@ process: proces process knockout knockout knockout knockout % new + xml: xml xml + xml xml + xml xml + \stopvariables \startconstants dutch english @@ -2361,7 +2365,6 @@ process: proces process overprint overprint overprint overprint % new - \stopconstants % so far diff --git a/tex/context/base/page-mar.tex b/tex/context/base/page-mar.tex index 376a190ec..6cec52d04 100644 --- a/tex/context/base/page-mar.tex +++ b/tex/context/base/page-mar.tex @@ -231,7 +231,7 @@ \hsize\getvalue{\??im#1\c!width}\relax \doifnumberelse\margincontenttag {\ifcase\margincontenttag\relax - \let\margincontenttag#1% first one is setups id as well + \edef\margincontenttag{#1}% first one is setups id as well \fi} \donothing \doifnumberelse\margincontenttag diff --git a/tex/context/base/pdfr-ec.tex b/tex/context/base/pdfr-ec.tex new file mode 100644 index 000000000..b6604984c --- /dev/null +++ b/tex/context/base/pdfr-ec.tex @@ -0,0 +1,145 @@ +%D \module +%D [ file=pdfr-ec, +%D version=2005.07.27, +%D title=\CONTEXT\ PDF Font Resources, +%D subtitle=EC encoding, +%D author={Vladimir Volovich / Taco Hoekwater}, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This vector is derived (but reformatted a bit) from +%D the one in \LaTeX's CMap package + +\startpdffontresource[ec] +/CIDInit /ProcSet findresource begin +12 dict begin + begincmap + /CIDSystemInfo + << /Registry (TeX) + /Ordering (T1) + /Supplement 0 + >> def + /CMapName /TeX-T1-0 def + /CMapType 2 def + 1 begincodespacerange + <00> <FF> + endcodespacerange + 10 beginbfrange + <0E> <0F> <2039> + <10> <12> <201C> + <15> <16> <2013> + <21> <26> <0021> + <28> <5F> <0028> + <61> <7E> <0061> + <C0> <D6> <00C0> + <D8> <DE> <00D8> + <E0> <F6> <00E0> + <F8> <FE> <00F8> + endbfrange + 95 beginbfchar + <00> <0060> + <01> <00B4> + <02> <02C6> + <03> <02DC> + <04> <00A8> + <05> <02DD> + <06> <02DA> + <07> <02C7> + <08> <02D8> + <09> <00AF> + <0A> <02D9> + <0B> <00B8> + <0C> <02DB> + <0D> <201A> + <13> <00AB> + <14> <00BB> + <17> <200C> + <19> <0131> + <1B> <00660066> + <1C> <00660069> + <1D> <0066006C> + <1E> <006600660069> + <1F> <00660066006C> + <20> <2423> + <27> <2019> + <60> <2018> + <7F> <002D> + <80> <0102> + <81> <0104> + <82> <0106> + <83> <010C> + <84> <010E> + <85> <011A> + <86> <0118> + <87> <011E> + <88> <0139> + <89> <013D> + <8A> <0141> + <8B> <0143> + <8C> <0147> + <8D> <014A> + <8E> <0150> + <8F> <0154> + <90> <0158> + <91> <015A> + <92> <0160> + <93> <015E> + <94> <0164> + <95> <021A> + <96> <0170> + <97> <016E> + <98> <0178> + <99> <0179> + <9A> <017D> + <9B> <017B> + <9C> <0132> + <9D> <0130> + <9E> <0111> + <9F> <00A7> + <A0> <0103> + <A1> <0105> + <A2> <0107> + <A3> <010D> + <A4> <010F> + <A5> <011B> + <A6> <0119> + <A7> <011F> + <A8> <013A> + <A9> <013E> + <AA> <0142> + <AB> <0144> + <AC> <0148> + <AD> <014B> + <AE> <0151> + <AF> <0155> + <B0> <0159> + <B1> <015B> + <B2> <0161> + <B3> <015F> + <B4> <0165> + <B5> <021B> + <B6> <0171> + <B7> <016F> + <B8> <00FF> + <B9> <017A> + <BA> <017E> + <BB> <017C> + <BC> <0133> + <BD> <00A1> + <BE> <00BF> + <BF> <00A3> + <D7> <0152> + <DF> <00530053> + <F7> <0153> + <FF> <00DF> + endbfchar + endcmap +CMapName currentdict /CMap defineresource pop end +end +\stoppdffontresource + +\endinput diff --git a/tex/context/base/type-pre.tex b/tex/context/base/type-pre.tex index ebf2426ed..05742dd22 100644 --- a/tex/context/base/type-pre.tex +++ b/tex/context/base/type-pre.tex @@ -281,4 +281,16 @@ \stoptypescriptcollection -\endinput +%D Special scripts: + +\unprotect + +\starttypescriptcollection[special scripts] + + \starttypescript[chi] \readfile{\f!fontprefix chi}\donothing\donothing \stoptypescript + \starttypescript[arb] \readfile{\f!fontprefix arb}\donothing\donothing \stoptypescript + \starttypescript[heb] \readfile{\f!fontprefix heb}\donothing\donothing \stoptypescript + +\stoptypescriptcollection + +\protect \endinput diff --git a/tex/context/base/unic-ini.tex b/tex/context/base/unic-ini.tex index fb5ef3e66..b3ba4ec53 100644 --- a/tex/context/base/unic-ini.tex +++ b/tex/context/base/unic-ini.tex @@ -95,17 +95,16 @@ %D which saves tokens and is faster. In this case we gain %D some 10\% time. -\chardef \utf@a=64 -\mathchardef \utf@b=4096 +\chardef \utf@a= 64 +\mathchardef \utf@b= 4096 \newcount\utf@c\utf@c=262144 - -\chardef \utf@d=192 -\chardef \utf@e=224 -\chardef \utf@f=240 - -\chardef \utf@g=128 -\mathchardef \utf@h=256 -\chardef \utf@i=127 +\chardef \utf@d= 192 +\chardef \utf@e= 224 +\chardef \utf@f= 240 +\chardef \utf@g= 128 +\mathchardef \utf@h= 256 +\chardef \utf@i= 127 +\mathchardef \utf@j= 2048 %D The definitions now become: %D @@ -586,6 +585,73 @@ \@EA\utfunifontcommand \fi} +%D We can convert from a number to some UTF code with the folowing +%D conversion macro. + +% The first, na\"ive version: +% +% \def\numbertoutf#1% +% {\ifnum#1<128 +% \rawcharacter{#1}% +% \else\ifnum#1<2048 +% \rawcharacter{\the\numexpr192+#1/64\relax}% +% \rawcharacter{\the\numexpr128+#1-(#1/64)*64\relax}% +% \else % 3 bytes +% \rawcharacter{\the\numexpr224+#1/4096\relax}% +% \rawcharacter{\the\numexpr128+(#1-(#1/4096)*4096)/128\relax}% +% \rawcharacter{\the\numexpr128+(#1-(#1/4096)*4096)+(#1-(#1/4096)*4096)/128\relax}% +% \fi\fi} + +% We have to compensate for etex's rounding (thanks to Taco and +% Nanning) for pointing/sorting this out: + +% \def\numbertoutf#1% +% {\ifnum#1<128 +% \rawcharacter{#1}% +% \else\ifnum#1<2048 +% \rawcharacter{\the\numexpr192+(#1-32)/64\relax}% +% \rawcharacter{\the\numexpr128+(#1-((#1-32)/64)*64)\relax}% +% \else +% \rawcharacter{\the\numexpr224+(#1-2048)/4096\relax}% +% \rawcharacter{\the\numexpr128+(#1-(((#1-2048)/4096)*4096)-32)/64\relax}% +% \rawcharacter{\the\numexpr128+(#1-(((#1-2048)/4096)*4096)-((#1-(((#1-2048)/4096)*4096)-32)/64)*64)\relax}% +% \fi\fi} + +\beginETEX \numexpr + +\chardef \utf@a= 64 +\mathchardef \utf@b= 4096 +\newcount\utf@c\utf@c=262144 +\chardef \utf@d= 192 +\chardef \utf@e= 224 +\chardef \utf@f= 240 +\chardef \utf@g= 128 +\mathchardef \utf@h= 256 +\chardef \utf@i= 127 +\mathchardef \utf@j= 2048 +\chardef \utf@k= 32 + +\def\numbertoutf#1% + {\ifnum#1<\utf@g + \rawcharacter{#1}% + \else\ifnum#1<\utf@j + \rawcharacter{\the\numexpr\utf@d+(#1-\utf@k)/\utf@a\relax}% + \rawcharacter{\the\numexpr\utf@g+(#1-((#1-\utf@k)/\utf@a)*\utf@a)\relax}% + \else + \rawcharacter{\the\numexpr\utf@e+(#1-\utf@j)/\utf@b\relax}% + \rawcharacter{\the\numexpr\utf@g+(#1-(((#1-\utf@j)/\utf@b)*\utf@b)-\utf@k)/\utf@a\relax}% + \rawcharacter{\the\numexpr\utf@g+(#1-(((#1-\utf@j)/\utf@b)*\utf@b)-((#1-(((#1-\utf@j)/\utf@b)*\utf@b)-\utf@k)/\utf@a)*\utf@a)\relax}% + \fi\fi} + +\endETEX + +\beginTEX + +\def\numbertoutf#1% + {[\number#1]} + +\endTEX + %D Goodies: \fetchruntimecommand \showunicodevector {\f!unicprefix\s!run} diff --git a/tex/context/base/xtag-ext.tex b/tex/context/base/xtag-ext.tex index 6d882a67b..aa522cc8c 100644 --- a/tex/context/base/xtag-ext.tex +++ b/tex/context/base/xtag-ext.tex @@ -280,4 +280,52 @@ \def\writtenXMLelementcs#1#2{\ifx#2\empty\else<#1>#2</#1>\fi} \def\writtenXMLemptycs #1#2{\ifx#2\empty<#1/>\else<#1>#2</#1>\fi} +%D This one can be used to get sound tuo files. +%D +%D \starttyping +%D \setuphead[chapter][expansion=xml] +%D % \setuplist[chapter][textcommand=\enableXML] +%D +%D \enableregime[utf] \autoXMLentitiestrue +%D \stoptyping +%D +%D with: +%D +%D \starttyping +%D <chapter>test ë test &ediaeresis; test <e>ediaeresis</e></chapter> +%D \stoptyping +%D +%D This gives: +%D +%D \starttyping +%D test Äk <b>test</b> <e>ediaeresis</e> test <e>ediaeresis</e> +%D \stoptyping + +\def\XMLprocessingparameter#1% + {\csname\??xp#1\endcsname} + +\appendtoks + \defineXMLargument[\XMLprocessingparameter\c!escape]\getXMlentity +\to \aftersetupXMLprocessing + +\setupXMLprocessing + [\c!escape=e] + +\bgroup \catcode`\<=\active + +\long\gdef\expandxmlargument#1\to + {\begingroup + \let\uppercase\firstofoneargument + \def\getXMLhexcharacter##1{\numbertoutf{"##1}}% + \def\getXMLdeccharacter##1{\numbertoutf{##1}}% + \def\getXMLentity##1{<e>##1</e>}% + \def<{\noexpand<}% + \xdef\@@globalexpanded{#1}% + \endgroup + \convertcommand\@@globalexpanded\to} + +\egroup + +\installexpander \v!xml {\expandxmlargument} + \protect \endinput diff --git a/tex/context/base/xtag-ini.tex b/tex/context/base/xtag-ini.tex index 0cc050e01..67a73bb3b 100644 --- a/tex/context/base/xtag-ini.tex +++ b/tex/context/base/xtag-ini.tex @@ -128,6 +128,9 @@ \def\dosetupXMLprocessing[#1]% {\getparameters[\??xp][#1]\the\aftersetupXMLprocessing} +\def\XMLprocessingparameter#1% + {\csname\??xp#1\endcsname} + \protect %D Formally an \XML\ file starts with an unique sequence diff --git a/tex/context/interface/cont-cz.xml b/tex/context/interface/cont-cz.xml index f9f8686b2..04ab11452 100644 --- a/tex/context/interface/cont-cz.xml +++ b/tex/context/interface/cont-cz.xml @@ -5758,6 +5758,9 @@ <cd:constant type="velke"/> <cd:constant type="dalsi"/> <cd:constant type="prvni"/> + <cd:constant type="normalni"/> + <cd:constant type="liche"/> + <cd:constant type="sude"/> <cd:constant type="cd:dimension"/> </cd:keywords> </cd:arguments> diff --git a/tex/context/interface/cont-de.xml b/tex/context/interface/cont-de.xml index dc5ed372e..97cb29779 100644 --- a/tex/context/interface/cont-de.xml +++ b/tex/context/interface/cont-de.xml @@ -5758,6 +5758,9 @@ <cd:constant type="gross"/> <cd:constant type="folgende"/> <cd:constant type="erste"/> + <cd:constant type="normal"/> + <cd:constant type="ungerade"/> + <cd:constant type="gerade"/> <cd:constant type="cd:dimension"/> </cd:keywords> </cd:arguments> diff --git a/tex/context/interface/cont-en.xml b/tex/context/interface/cont-en.xml index ae91da1fb..2c16257e4 100644 --- a/tex/context/interface/cont-en.xml +++ b/tex/context/interface/cont-en.xml @@ -5758,6 +5758,9 @@ <cd:constant type="big"/> <cd:constant type="next"/> <cd:constant type="first"/> + <cd:constant type="normal"/> + <cd:constant type="odd"/> + <cd:constant type="even"/> <cd:constant type="cd:dimension"/> </cd:keywords> </cd:arguments> diff --git a/tex/context/interface/cont-it.xml b/tex/context/interface/cont-it.xml index 36d0297d8..2f9183b5a 100644 --- a/tex/context/interface/cont-it.xml +++ b/tex/context/interface/cont-it.xml @@ -5758,6 +5758,9 @@ <cd:constant type="grande"/> <cd:constant type="successivo"/> <cd:constant type="primo"/> + <cd:constant type="normale"/> + <cd:constant type="dispari"/> + <cd:constant type="pari"/> <cd:constant type="cd:dimension"/> </cd:keywords> </cd:arguments> diff --git a/tex/context/interface/cont-nl.xml b/tex/context/interface/cont-nl.xml index 4bd03dcb0..9b54e77cf 100644 --- a/tex/context/interface/cont-nl.xml +++ b/tex/context/interface/cont-nl.xml @@ -5758,6 +5758,9 @@ <cd:constant type="groot"/> <cd:constant type="volgende"/> <cd:constant type="eerste"/> + <cd:constant type="normaal"/> + <cd:constant type="oneven"/> + <cd:constant type="even"/> <cd:constant type="cd:dimension"/> </cd:keywords> </cd:arguments> diff --git a/tex/context/interface/cont-ro.xml b/tex/context/interface/cont-ro.xml index 432d039eb..007f88b50 100644 --- a/tex/context/interface/cont-ro.xml +++ b/tex/context/interface/cont-ro.xml @@ -5758,6 +5758,9 @@ <cd:constant type="mare"/> <cd:constant type="urmatorul"/> <cd:constant type="primul"/> + <cd:constant type="normal"/> + <cd:constant type="impar"/> + <cd:constant type="par"/> <cd:constant type="cd:dimension"/> </cd:keywords> </cd:arguments> diff --git a/tex/context/interface/keys-cz.xml b/tex/context/interface/keys-cz.xml index 9ac91fa5b..c5a57b820 100644 --- a/tex/context/interface/keys-cz.xml +++ b/tex/context/interface/keys-cz.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> -<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="cz" version="2005.07.21"> +<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="cz" version="2005.07.27"> <cd:variables> <cd:variable name="one" value="jedna"/> @@ -755,6 +755,7 @@ <cd:variable name="nothyphenated" value="nothyphenated"/> <cd:variable name="overprint" value="overprint"/> <cd:variable name="knockout" value="knockout"/> + <cd:variable name="xml" value="xml"/> </cd:variables> <cd:constants> diff --git a/tex/context/interface/keys-de.xml b/tex/context/interface/keys-de.xml index eea7038f7..ad86466dc 100644 --- a/tex/context/interface/keys-de.xml +++ b/tex/context/interface/keys-de.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> -<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="de" version="2005.07.21"> +<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="de" version="2005.07.27"> <cd:variables> <cd:variable name="one" value="eins"/> @@ -755,6 +755,7 @@ <cd:variable name="nothyphenated" value="nothyphenated"/> <cd:variable name="overprint" value="overprint"/> <cd:variable name="knockout" value="knockout"/> + <cd:variable name="xml" value="xml"/> </cd:variables> <cd:constants> diff --git a/tex/context/interface/keys-en.xml b/tex/context/interface/keys-en.xml index 8b0969c70..5f8a2554d 100644 --- a/tex/context/interface/keys-en.xml +++ b/tex/context/interface/keys-en.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> -<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="en" version="2005.07.21"> +<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="en" version="2005.07.27"> <cd:variables> <cd:variable name="one" value="one"/> @@ -755,6 +755,7 @@ <cd:variable name="nothyphenated" value="nothyphenated"/> <cd:variable name="overprint" value="overprint"/> <cd:variable name="knockout" value="knockout"/> + <cd:variable name="xml" value="xml"/> </cd:variables> <cd:constants> diff --git a/tex/context/interface/keys-it.xml b/tex/context/interface/keys-it.xml index 0ca1e49ce..3998abce9 100644 --- a/tex/context/interface/keys-it.xml +++ b/tex/context/interface/keys-it.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> -<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="it" version="2005.07.21"> +<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="it" version="2005.07.27"> <cd:variables> <cd:variable name="one" value="uno"/> @@ -755,6 +755,7 @@ <cd:variable name="nothyphenated" value="nonsillabato"/> <cd:variable name="overprint" value="overprint"/> <cd:variable name="knockout" value="knockout"/> + <cd:variable name="xml" value="xml"/> </cd:variables> <cd:constants> diff --git a/tex/context/interface/keys-nl.xml b/tex/context/interface/keys-nl.xml index aaaacee8c..8132906fe 100644 --- a/tex/context/interface/keys-nl.xml +++ b/tex/context/interface/keys-nl.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> -<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="nl" version="2005.07.21"> +<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="nl" version="2005.07.27"> <cd:variables> <cd:variable name="one" value="een"/> @@ -755,6 +755,7 @@ <cd:variable name="nothyphenated" value="nietafgebroken"/> <cd:variable name="overprint" value="overprint"/> <cd:variable name="knockout" value="knockout"/> + <cd:variable name="xml" value="xml"/> </cd:variables> <cd:constants> diff --git a/tex/context/interface/keys-ro.xml b/tex/context/interface/keys-ro.xml index 323146bef..f8f2a5ca4 100644 --- a/tex/context/interface/keys-ro.xml +++ b/tex/context/interface/keys-ro.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> -<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="ro" version="2005.07.21"> +<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="ro" version="2005.07.27"> <cd:variables> <cd:variable name="one" value="unu"/> @@ -755,6 +755,7 @@ <cd:variable name="nothyphenated" value="nedespsilabe"/> <cd:variable name="overprint" value="overprint"/> <cd:variable name="knockout" value="knockout"/> + <cd:variable name="xml" value="xml"/> </cd:variables> <cd:constants> |