summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2002-03-27 00:00:00 +0100
committerHans Hagen <pragma@wxs.nl>2002-03-27 00:00:00 +0100
commit953aec80be6e084ee21459d3618af2221fc5df08 (patch)
tree0b4921a0234a00fd5de5370085f91b4aed1d81c1 /tex
parent9637343330dd2328e6fb2bcfb4fc0d0a25616965 (diff)
downloadcontext-953aec80be6e084ee21459d3618af2221fc5df08.tar.gz
stable 2002.03.27
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/cont-fil.tex1
-rw-r--r--tex/context/base/cont-new.tex309
-rw-r--r--tex/context/base/context.tex2
-rw-r--r--tex/context/base/core-fig.tex158
-rw-r--r--tex/context/base/core-fil.tex2
-rw-r--r--tex/context/base/core-fld.tex51
-rw-r--r--tex/context/base/core-grd.tex4
-rw-r--r--tex/context/base/core-itm.tex5
-rw-r--r--tex/context/base/core-new.tex4
-rw-r--r--tex/context/base/core-not.tex6
-rw-r--r--tex/context/base/core-ntb.tex6
-rw-r--r--tex/context/base/core-pos.tex1
-rw-r--r--tex/context/base/core-ref.tex23
-rw-r--r--tex/context/base/core-sec.tex3
-rw-r--r--tex/context/base/core-spa.tex22
-rw-r--r--tex/context/base/core-ver.tex4
-rw-r--r--tex/context/base/enco-ec.tex35
-rw-r--r--tex/context/base/enco-ini.tex19
-rw-r--r--tex/context/base/font-run.tex17
-rw-r--r--tex/context/base/meta-ini.tex3
-rw-r--r--tex/context/base/meta-pag.tex1
-rw-r--r--tex/context/base/mult-sys.tex1
-rw-r--r--tex/context/base/page-lay.tex1
-rw-r--r--tex/context/base/page-sid.tex8
-rw-r--r--tex/context/base/s-abr-01.tex1
-rw-r--r--tex/context/base/spec-tpd.tex2
-rw-r--r--tex/context/base/supp-fil.tex2
-rw-r--r--tex/context/base/supp-mps.tex3
-rw-r--r--tex/context/base/syst-ext.tex7
-rw-r--r--tex/context/base/syst-gen.tex3
-rw-r--r--tex/context/base/xtag-ext.tex22
-rw-r--r--tex/context/base/xtag-ini.tex59
-rw-r--r--tex/context/base/xtag-xsl.tex8
33 files changed, 402 insertions, 391 deletions
diff --git a/tex/context/base/cont-fil.tex b/tex/context/base/cont-fil.tex
index c76490924..f576bc699 100644
--- a/tex/context/base/cont-fil.tex
+++ b/tex/context/base/cont-fil.tex
@@ -32,6 +32,7 @@
\definefilesynonym [fig-base] [fig-00]
\definefilesynonym [fig-make] [fig-01]
\definefilesynonym [fig-fake] [fig-02]
+\definefilesynonym [fig-missing] [fig-06]
\definefilesynonym [pre-general] [pre-00]
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex
index b4a3d19b2..49fcde411 100644
--- a/tex/context/base/cont-new.tex
+++ b/tex/context/base/cont-new.tex
@@ -26,6 +26,16 @@
\def\@@itemcounter {\s!itemcount\currentitemgroup}
+\long\def\startexternalfigure
+ {\dotripleempty\dostartexternalfigure}
+
+\long\def\dostartexternalfigure[#1][#2][#3]#4\stopexternalfigure
+ {\gdef\figuredescription{#4}%
+ \externalfigure[#1][#2][#3]%
+ \global\let\figuredescription\empty}
+
+\let\figuredescription\empty
+
% very experimental
\def\redoanalyzefigurefiles#1%
@@ -47,8 +57,131 @@
\doanalyzefigurefiles\doanalyzefigurefilesA
\doanalyzefigurefiles\doanalyzefigurefilesB
\doanalyzefigurefiles\doanalyzefigurefilesC}
+
+\def\dodefineexternalfigure[#1][#2]%
+ {\setvalue{\??ef\??ef#1}%
+ {\doplaceexternalfigure[\dopresetfigure][#1][][#2][]}}
+\def\defineexternalfigure
+ {\dodoubleargument\dodefineexternalfigure}
+\def\dodoplaceexternalfigure[#1][#2][#3][#4][#5][#6]%
+ {\doifsomething{#3}% catches \defineexternalfigure dummies
+ {\bgroup
+ \def\textunderscore{_}% brrr, temp hack
+ \calculateexternalfigure[#1][#2][#3][#4][#5][#6]%
+ \calculateexternalscreenfigure[#1][#2][#3][#4][#5][#6]%
+ \box\foundexternalfigure
+ \egroup}}
+
+\definesystemvariable {bl} % bleeding
+
+\newcounter\nofbleeds % per pag
+
+\def\setupbleeding
+ {\dodoubleempty\getparameters[\??bl]}
+
+\setupbleeding
+ [\c!plaats=l,
+ \c!rek=\v!ja,
+ \c!breedte=3cm,
+ \c!hoogte=3cm,
+ \c!offset=2mm,
+ \c!voffset=\@@bloffset,
+ \c!hoffset=\@@bloffset]
+
+\def\bleed
+ {\dosingleempty\dobleed}
+
+\def\dobleed[#1]#2%
+ {\hbox\bgroup
+ \def\bleedwidth {\hsize}%
+ \def\bleedheight{\vsize}%
+ \doglobal\increment\nofbleeds
+ \getparameters[\??bl][#1]%
+ \!!doneafalse % left
+ \!!donebfalse % right
+ \!!donecfalse % top
+ \!!donedfalse % bottom
+ \processaction
+ [\@@blplaats]
+ [ t=>\!!donectrue\let\@@blhoffset\!!zeropoint,
+ b=>\!!donedtrue\let\@@blhoffset\!!zeropoint,
+ l=>\!!doneatrue\let\@@blvoffset\!!zeropoint,
+ r=>\!!donebtrue\let\@@blvoffset\!!zeropoint,
+ bl=>\!!doneatrue\!!donedtrue,
+ lb=>\!!doneatrue\!!donedtrue,
+ br=>\!!donebtrue\!!donedtrue,
+ rb=>\!!donebtrue\!!donedtrue,
+ tl=>\!!doneatrue\!!donectrue,
+ lt=>\!!doneatrue\!!donectrue,
+ tr=>\!!donebtrue\!!donectrue,
+ rt=>\!!donebtrue\!!donectrue]%
+ \doifelse\@@blrek\v!ja\donetrue\donefalse
+ \scratchdimen\@@blbreedte
+ \ifdone
+ \if!!donea
+ \advance\scratchdimen\MPx{\??bl:\nofbleeds}%
+ \else\if!!doneb
+ \scratchdimen\papierbreedte
+ \advance\scratchdimen-\MPx{\??bl:\nofbleeds}%
+ \fi\fi
+ \fi
+ \advance\scratchdimen\@@blhoffset
+ \edef\bleedwidth{\the\scratchdimen}%
+ \scratchdimen\@@blhoogte
+ \ifdone
+ \if!!donec
+ \scratchdimen\papierhoogte
+ \advance\scratchdimen-\MPy{\??bl:\nofbleeds}%
+ \else\if!!doned
+ \advance\scratchdimen\MPy{\??bl:\nofbleeds}%
+ \fi\fi
+ \fi
+ \advance\scratchdimen\@@blvoffset
+ \edef\bleedheight{\the\scratchdimen}%
+ \hsize\bleedwidth
+ \vsize\bleedheight
+ \setbox\scratchbox\hbox{#2}%
+ \setbox\scratchbox\hbox to \@@blbreedte
+ {\if!!donea\hss\fi\box\scratchbox\if!!doneb\hss\fi}%
+ \if!!doned
+ \setbox\scratchbox\hbox
+ {\lower\bleedheight\hbox{\raise\@@blhoogte\box\scratchbox}}%
+ \fi
+ \wd\scratchbox\@@blbreedte
+ \ht\scratchbox\@@blhoogte
+ \dp\scratchbox\zeropoint
+ \ifdone
+ \hpos{\??bl:\nofbleeds}{\box\scratchbox}%
+ \else
+ \box\scratchbox
+ \fi
+ \egroup}
+
+\setupbleeding[\c!rek=\v!ja]
+
+\defineexternalfigure[bleed][\c!breedte=\bleedwidth,\c!hoogte=\bleedheight]
+
+% \placefloat[left]{none}
+% {\bleed[width=5cm,height=3cm,location=lt]{\externalfigure[koe][bleed]}}
+%
+% \input tufte
+%
+% \placefloat[left]{none}
+% {\bleed[width=5cm,height=3cm,location=l]{\externalfigure[koe][bleed]}}
+%
+% \input tufte
+%
+% \placesomefloat[right]{none}
+% {\bleed[width=5cm,height=3cm,location=r]{\externalfigure[koe][bleed]}}
+%
+% \input tufte
+%
+% \placesomefloat[right]{none}
+% {\bleed[width=5cm,height=3cm,location=rb]{\externalfigure[koe][bleed]}}
+%
+% \input tufte
\def\OTRSETgotocell#1#2% not that robust
{\endgraf
@@ -85,47 +218,6 @@
\fi
\OTRSETsetvsize}
-\def\setsidefloat% nilling everypar saves time and redudant pos's
- {% removed here dec 2001
- %{\everypar\emptytoks\forgetall\vbox{\strut}\vskip-\lineheight}%
- %
- \kern\sidefloattopskip
- \edef\presidefloatdepth{\the\prevdepth}%
- \nointerlineskip
- \bgroup
- \everypar\emptytoks
- \parskip\zeropoint
- \logsidefloat
- \ifrightfloat
- \hfill
- \ifmarginfloat
-% \rlap{\hskip\rechtermargeafstand\hskip\rightskip\unhbox\floatbox}%
-\rlap{\tbox{\hskip\rechtermargeafstand\hskip\rightskip\unhbox\floatbox}}%
- \else
- \unhbox\floatbox
- \fi
- \else
- \noindent
- \ifmarginfloat
-% \llap{\unhbox\floatbox\hskip\leftskip\hskip\linkermargeafstand}%
-\llap{\tbox{\unhbox\floatbox\hskip\leftskip\hskip\linkermargeafstand}}%
- \else
- \unhbox\floatbox
- \fi
- \hfill
- \fi
- \egroup
- \par
- \kern-\sidefloatheight
- \penalty10001 % oeps, this will change
- \normalbaselines
- \prevdepth=\presidefloatdepth
- %\noindent
- \resetsidefloatparagraph
- \ignorespaces}
-
-
-
\def\setlocalfloatdimensions#1#2% experimental ! ! ! !
{\doifvaluesomething{\??fl#1\c!maxbreedte}
{\scratchdimen=\getvalue{\??fl#1\c!maxbreedte}\relax
@@ -382,137 +474,6 @@
\endETEX
-\def\dofield[#1][#2][#3]%
- {\iffirstargument
- \bgroup
- \getfield{#2}%
- \ifsecondargument
- \def\@@FieldLabel{#3}%
- \else
- \let\@@FieldLabel\@@FieldName
- \fi
- \ifx\@@FieldType\empty
- \writestatus{\m!fields}{unknown field #2}%
- \else\ifcase\@@FieldFree\relax
- \doifdefinedelse{\strippedcsname\setupfield\@@FieldGroup}
- {\let\dosetupfield=#1\getvalue{\strippedcsname\setupfield\@@FieldGroup}}
- {#1[\@@FieldName][\v!label,\v!kader,\v!horizontaal][][][]}%
-\iftrialtypesetting\else
- \def\@@FieldFree{1}%
- \changefield{#2}%
-\fi
- \else\ifcase\@@FieldAuto\relax
- % \writestatus{\m!fields}{field #2 already typeset}%
- \else
- % \writestatus{\m!fields}{field #2 automatically copied}%
- \nextsystemfield
- \copyfield[\@@FieldName][\currentsystemfield]%
- \dotripleempty\dofield[#1][\currentsystemfield][#3]% get the if's right
- \fi\fi\fi
- \egroup
- \fi}
-
-\def\typesetfield%
- {\useJSscripts[fld]%
- \ifx\@@FieldRoot\empty \else
- \let\@@SavedFieldName\@@FieldName
- \getfield\@@FieldRoot
- \ifcase\@@FieldFree\relax
- \dosetfieldstatus\@@FieldMode\@@FieldParent\@@FieldKids\@@FieldRoot
- \dopresetrecord
-\iftrialtypesetting\else
- \def\@@FieldFree{1}%
- \changefield\@@FieldName
-\fi
- \fi
- \getfield\@@SavedFieldName
- \fi
- \ifx\@@FieldKids\empty
- \donefalse
- \else
- \donetrue
- \fi
- \ifdone
- \let\@@FieldParent\@@FieldName
- %\addtocommalist\@@FieldParent\@@FieldKids
- \appendtocommalist\@@FieldParent\@@FieldKids
- \dosetfieldstatus\@@FieldMode\@@FieldParent\@@FieldKids\@@FieldRoot
- \dopresetfield
- \let\@@FieldMode\fieldchildmode
- \fi
- \dosetfieldstatus\@@FieldMode\@@FieldParent\@@FieldKids\@@FieldRoot
- \dopresetfield}
-
-\def\dopresetfield
- {\iftrialtypesetting\else\iflocation\getvalue{preset\@@FieldType field}\fi\fi}
-
-\def\dopresetrecord
- {\iftrialtypesetting\else\iflocation\getvalue{preset\@@FieldType record}\fi\fi}
-
-\def\doclonefield[#1][#2][#3][#4]% parent children setupgroup values
- {\ifsecondargument
- \getfield{#1}%
-\iftrialtypesetting\else
- \ifx\@@FieldType\empty
- \writestatus{\m!fields}{unknown field #1}%
- \else
- \let\@@FieldMode=\fieldparentmode
- %\def\docommando##1{\addtocommalist{##1}\@@FieldKids}%
- \def\docommando##1{\appendtocommalist{##1}\@@FieldKids}%
- \processcommalist[#2]\docommando
- \changefield{#1}%
- \let\@@FieldAutoParent=\@@FieldAuto
- \def\@@FieldParent{#1}%
- \let\@@FieldKids=\empty
- \let\@@FieldRoot=\empty
- \let\@@FieldMode=\fieldchildmode
- \def\@@FieldFree{0}%
- \def\@@FieldAuto{0}%
- \doifsomething{#3}{\edef\@@FieldGroup{#3}}%
- \doifsomething{#4}{\edef\@@FieldValues{#4}}%
- \def\docommando##1%
- {\ifcase\@@FieldAutoParent\else
- \setmainfieldkid{\@@FieldParent}{##1}%
- \fi
- \changefield{##1}}%
- \processcommalist[#2]\docommando
- \fi
-\fi
- \else
- \writestatus{\m!fields}{pass parent field and clones}%
- \fi}
-
-\def\docopyfield[#1][#2]% parent children
- {\ifsecondargument
- \getfield{#1}%
-\iftrialtypesetting\else
- \ifx\@@FieldType\empty
- \writestatus{\m!fields}{unknown field #1}%
- \else
- \let\@@FieldMode=\fieldparentmode
- %\def\docommando##1{\addtocommalist{##1}\@@FieldKids}%
- \def\docommando##1{\appendtocommalist{##1}\@@FieldKids}%
- \processcommalist[#2]\docommando
- \changefield{#1}%
- \let\@@FieldAutoParent=\@@FieldAuto
- \def\@@FieldParent{#1}%
- \let\@@FieldKids=\empty
- \let\@@FieldRoot=\empty
- \let\@@FieldMode=\fieldcopymode
- \def\@@FieldFree{0}%
- \def\@@FieldAuto{0}%
- \def\docommando##1%
- {\ifcase\@@FieldAutoParent\else
- \setmainfieldkid{\@@FieldParent}{##1}%
- \fi
- \changefield{##1}}%
- \processcommalist[#2]\docommando
- \fi
-\fi
- \else
- \writestatus{\m!fields}{pass parent field and copies}%
- \fi}
-
\newtoks\everyfirstparagraphintro
\newtoks\everynextparagraphintro
@@ -771,10 +732,6 @@
\localhsize\hsize
\fi \fi}
-\long\def\parseTR[#1][#2]#3\eTR% [#2] is dummy that kills spaces
- {\def\currentcol{0}\increment\maximumrow
- \setupTABLE[\v!rij][\maximumrow][#1]#3}
-
\def\obeyfollowingtoken{{}} % end \cs scanning
\def\gobbleparameters{\doquadrupleempty\dogobbleparameters}
diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex
index 5fd0bda0f..0ee260743 100644
--- a/tex/context/base/context.tex
+++ b/tex/context/base/context.tex
@@ -15,7 +15,7 @@
\catcode`\{=1 \catcode`\}=2
-\def\contextversion{2002.3.12}
+\def\contextversion{2002.3.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-fig.tex b/tex/context/base/core-fig.tex
index 8435757b9..014ad788f 100644
--- a/tex/context/base/core-fig.tex
+++ b/tex/context/base/core-fig.tex
@@ -155,7 +155,7 @@
%D Another switch tells \CONTEXT\ to locate and calculate a
%D figure, but does not actually insert it. Especially when we
%D use \PDFTEX\ this saves a lot of time on trialruns. (Keep
-%D in mind that \PDFTEX\ is both a \TEX\ pre|| and postcessor.)
+%D in mind that \PDFTEX\ is both a \TEX\ pre|| and postprocessor.)
\newif\ifskipexternalfigures % \skipexternalfigurestrue
@@ -614,10 +614,10 @@
\doifsomething{\@@efmaxhoogte}
{\ifdim\fighei>\@@efmaxhoogte \global\fighei=\@@efmaxhoogte #3\relax\fi}}
-\def\setdimensionfiguresize%
+\def\setdimensionfiguresize
{\ifdim\figwid>\zeropoint\relax
\ifdim\fighei>\zeropoint\relax
- \dosetdimensionfiguresize%
+ \dosetdimensionfiguresize
{\docalculatefigurescale\fighei\@@eph\figysca
\docalculatefigurescale\figwid\@@epw\figxsca}%
{\docalculatefigurescale\fighei\@@eph\figysca
@@ -625,19 +625,19 @@
{\docalculatefigurescale\fighei\@@eph\figysca
\docalculatefigurescale\figwid\@@epw\figxsca}%
\else
- \dosetdimensionfiguresize%
+ \dosetdimensionfiguresize
{\docalculatefigurescales\figwid\@@epw\fighei\@@eph}%
{\docalculatefigurescales\figwid\@@epw\fighei\@@eph}%
{\docalculatefigurescales\figwid\@@epw\fighei\@@eph}%
\fi
\else
\ifdim\fighei>\zeropoint\relax
- \dosetdimensionfiguresize%
+ \dosetdimensionfiguresize
{\docalculatefigurescales\fighei\@@eph\figwid\@@epw}%
{\docalculatefigurescales\fighei\@@eph\figwid\@@epw}%
{\docalculatefigurescales\fighei\@@eph\figwid\@@epw}%
\else
- \dosetdimensionfiguresize%
+ \dosetdimensionfiguresize
{\doapplyfigurescale\figwid\@@epw\figxsca
\doapplyfigurescale\fighei\@@eph\figysca}%
{\docalculatefigurescales\figwid\@@epw\fighei\@@eph}%
@@ -836,8 +836,8 @@
\let\@@efextension #1%
\let\@@efobject \v!nee
\let\@@efpreset \v!nee
- \ifx\@@efbreedte\empty\def\@@breedte{4cm}\fi
- \ifx\@@efhoogte \empty\def\@@hoogte {3cm}\fi}
+ \ifx\@@efbreedte\empty\def\@@efbreedte{4cm}\fi
+ \ifx\@@efhoogte \empty\def\@@efhoogte {3cm}\fi}
\def\presetfiguremov{\presetundefinedfigure\c!mov}
\def\presetfigureavi{\presetundefinedfigure\c!avi}
@@ -861,13 +861,16 @@
% where the second one inherited some characteristics from
% the factor=max one some 30 pages back. Sigh.
-% this macro will be cleaned up when the tuf format has
-% become replaced by its xml counterpart
+% This macro will be cleaned up when the tuf format has
+% become replaced by its xml counterpart; for that I first
+% need to patch texutil.
\def\calculateexternalfigure[#1][#2][#3][#4][#5][#6]%
{\mindermeldingen
- \global\figwid=\zeropoint \figxsca=1 % see note *
- \global\fighei=\zeropoint \figysca=1 % see note *
+ \setupexternalfigures
+ \the\externalfigureresets % hook, see resource libraries
+ \global\figwid\zeropoint \figxsca1 % see note *
+ \global\fighei\zeropoint \figysca1 % see note *
\global\setbox\foundexternalfigure=\box\voidb@x
\edef\expandedfigurename{#3}% needed e.g. in [\get...] cases
\expandafter\beforesplitstring\expandedfigurename\at.\to\@@effilename
@@ -1121,8 +1124,63 @@
\global\let\appliedfigurexscale\scax
\global\let\appliedfigureyscale\scay}%
\global\wd\foundexternalfigure=\figwid
- \the\externalfigurepostprocessors}
+ \finalizeexternalfigure{#2}{#3}}
+
+\def\finalizeexternalfigure#1#2%
+ {\pushmacro\figurewidth
+ \pushmacro\figureheight
+ \xdef\figurewidth {\the\figwid}%
+ \xdef\figureheight{\the\fighei}%
+ \global\setbox\foundexternalfigure\vbox
+ {\forgetall
+ \ifconditional\externalfigurelevel % probably background
+ \ifskipexternalfigures
+ % nothing
+ \else\ifcase\figurestatus
+ % nothing
+ \else
+ \the\externalfigurepostprocessors
+ \box\foundexternalfigure
+ \fi\fi
+ \else
+ \settrue\externalfigurelevel
+ \ifskipexternalfigures
+ \externalfigurereplacement{#1}{#2}{skipped}%
+ \else\ifcase\figurestatus
+ \externalfigurereplacement{#1}{#2}{unknown}%
+ \else
+ \the\externalfigurepostprocessors
+ \doifelse\@@efreset\v!ja
+ {\ht\foundexternalfigure\figureheight
+ \dp\foundexternalfigure\zeropoint
+ \wd\foundexternalfigure\figurewidth
+ \box\foundexternalfigure}
+ {\localframed % should also be applied to high res !
+ [\??ef]
+ [\c!offset=\v!overlay,
+ \c!breedte=\figurewidth,
+ \c!hoogte=\figureheight]
+ {\vfilll\box\foundexternalfigure}}%
+ \fi\fi
+ \fi}%
+ \popmacro\figureheight
+ \popmacro\figurewidth}
+
+\def\externalfigurereplacement#1#2#3%
+ {\expanded{\localframed
+ [\??ef]
+ [\c!breedte=\figurewidth,
+ \c!hoogte=\figureheight,
+ \c!achtergrond=\v!raster,
+ \c!achtergrondraster=.5,
+ %\c!kader=\ifincolor\v!uit\else\v!aan\fi]
+ \c!kader=\ifincolor\@@efkader\else\v!aan\fi]}%
+ {\ttx \nohyphens
+ name: \expanded{\verbatimstring{#1}}\\%
+ file: \expanded{\verbatimstring{#2}}\\%
+ state: \expanded{\verbatimstring{#3}}}}
+\newtoks\externalfigureresets
\newtoks\externalfigurepostprocessors
\gdef\appliedfigurexscale{1}
@@ -1151,6 +1209,8 @@
\let\lastfigureobjectname\empty
+%D The next macro does not work well with figure bases yet.
+
\def\calculateexternalscreenfigure[#1][#2][#3][#4][#5][#6]%
{\ifx\@@efscherm\empty\else
\doifnot{\@@efobject}{\v!nee}
@@ -1195,66 +1255,19 @@
\presetlocalframed[\??ef]
+\newconditional\externalfigurelevel
+
\def\doplaceexternalfigure% used direct and indirect
{\dosixtupleempty\dodoplaceexternalfigure}
-\newconditional\externalfigurelevel
-
\def\dodoplaceexternalfigure[#1][#2][#3][#4][#5][#6]%
{\bgroup
- \setupexternalfigures
+ \def\textunderscore{_}% brrr, temp hack
\calculateexternalfigure[#1][#2][#3][#4][#5][#6]%
- \setupexternalfigures
\calculateexternalscreenfigure[#1][#2][#3][#4][#5][#6]%
-\pushmacro\figurewidth
-\pushmacro\figureheight
- \xdef\figurewidth {\the\figwid}%
- \xdef\figureheight{\the\fighei}%
- \ifconditional\externalfigurelevel % probably background
- \ifskipexternalfigures
- % nothing
- \else\ifcase\figurestatus
- % nothing
- \else
- \box\foundexternalfigure
- \fi\fi
- \else
- \settrue\externalfigurelevel
- \ifskipexternalfigures
- \externalfigurereplacement{#2}{#3}{skipped}% {name: #2 \\ file: #3 \\ skipped}%
- \else\ifcase\figurestatus
- \externalfigurereplacement{#2}{#3}{unknown}% {name: #2 \\ file: #3 \\ unknown}%
- \else
- \doifelse\@@efreset\v!ja
- {\ht\foundexternalfigure\figureheight
- \dp\foundexternalfigure\zeropoint
- \wd\foundexternalfigure\figurewidth
- \box\foundexternalfigure}
- {\localframed
- [\??ef]
- [\c!breedte=\figurewidth,
- \c!hoogte=\figureheight,
- \c!offset=\v!overlay]
- {\vfilll\box\foundexternalfigure}}%
- \fi\fi
- \fi
-\popmacro\figureheight
-\popmacro\figurewidth
+ \box\foundexternalfigure
\egroup}
-\def\externalfigurereplacement#1#2#3%
- {\expanded{\localframed
- [\??ef]
- [\c!breedte=\figurewidth,
- \c!hoogte=\figureheight,
- \c!achtergrond=\v!raster,
- \c!achtergrondraster=.5,
- %\c!kader=\ifincolor\v!uit\else\v!aan\fi]
- \c!kader=\ifincolor\@@efkader\else\v!aan\fi]}%
- {\ttx name: \expanded{\verbatimstring{#1}}\\%
- file: \expanded{\verbatimstring{#2}}\\%
- state: \expanded{\verbatimstring{#3}}}}
-
\def\getexternalfigure#1%
{\getvalue{\??ef\??ef#1}}
@@ -1282,16 +1295,7 @@
% 4cm breed: \externalfigure[beta] [breedte=4cm] \par
% 5cm breed: \externalfigure[gamma][breedte=5cm] \par
-\def\douseexternalfigure[#1][#2][#3][#4]%
- {\doifelsenothing{#1}
- {\doifsomething{#2}
- {\dosetuseexternalfigure[#2][#2][#3][#4]}}
- {\doifelsenothing{#2}
- {\dosetuseexternalfigure[#1][#1][#3][#4]}
- {\dosetuseexternalfigure[#1][#2][#3][#4]}}}
-
\def\dosetuseexternalfigure[#1][#2][#3][#4]%
-% {\doifinstringelse{=}{#3}
{\doifassignmentelse{#3}
{\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[\dopresetfigure][#1][#2][#3][#4]}}
{\doifelsenothing{#3} % catch [1][2][leeg][leeg]
@@ -1299,6 +1303,14 @@
{\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[\doprecopfigure][#1][#2][#3][#4]}}}%
\doifundefined{#1}{\setvalue{#1}{\getexternalfigure{#1}}}} % upward compatible
+\def\douseexternalfigure[#1][#2][#3][#4]%
+ {\doifelsenothing{#1}
+ {\doifsomething{#2}
+ {\dosetuseexternalfigure[#2][#2][#3][#4]}}
+ {\doifelsenothing{#2}
+ {\dosetuseexternalfigure[#1][#1][#3][#4]}
+ {\dosetuseexternalfigure[#1][#2][#3][#4]}}}
+
\def\useexternalfigure%
{\doquadrupleempty\douseexternalfigure}
diff --git a/tex/context/base/core-fil.tex b/tex/context/base/core-fil.tex
index 012772586..49506bda7 100644
--- a/tex/context/base/core-fil.tex
+++ b/tex/context/base/core-fil.tex
@@ -256,7 +256,9 @@
\def\dofetchruntimecommand#1#2%
{\doifnotflagged{#2}
{\let#1\undefined
+ \startreadingfile
\readfile{#2}\donothing\donothing
+ \stopreadingfile
\doglobal\setflag{#2}}%
\ifx#1\undefined
\writestatus{\m!systems}{command \string#1 not found in file #2}%
diff --git a/tex/context/base/core-fld.tex b/tex/context/base/core-fld.tex
index 4967eada5..af64a3975 100644
--- a/tex/context/base/core-fld.tex
+++ b/tex/context/base/core-fld.tex
@@ -520,8 +520,9 @@
\fi}
\def\doclonefield[#1][#2][#3][#4]% parent children setupgroup values
- {\ifsecondargument
+ {\ifsecondargument
\getfield{#1}%
+\iftrialtypesetting\else
\ifx\@@FieldType\empty
\writestatus{\m!fields}{unknown field #1}%
\else
@@ -531,7 +532,7 @@
\processcommalist[#2]\docommando
\changefield{#1}%
\let\@@FieldAutoParent=\@@FieldAuto
- \def\@@FieldParent{#1}%
+ \def\@@FieldParent{#1}%
\let\@@FieldKids=\empty
\let\@@FieldRoot=\empty
\let\@@FieldMode=\fieldchildmode
@@ -540,22 +541,24 @@
\doifsomething{#3}{\edef\@@FieldGroup{#3}}%
\doifsomething{#4}{\edef\@@FieldValues{#4}}%
\def\docommando##1%
- {\ifcase\@@FieldAutoParent\else
+ {\ifcase\@@FieldAutoParent\else
\setmainfieldkid{\@@FieldParent}{##1}%
\fi
\changefield{##1}}%
\processcommalist[#2]\docommando
\fi
+\fi
\else
\writestatus{\m!fields}{pass parent field and clones}%
- \fi}
+ \fi}
\def\clonefield%
{\doquadrupleempty\doclonefield}
-\def\docopyfield[#1][#2]% parent children
- {\ifsecondargument
+\def\docopyfield[#1][#2]% parent children
+ {\ifsecondargument
\getfield{#1}%
+\iftrialtypesetting\else
\ifx\@@FieldType\empty
\writestatus{\m!fields}{unknown field #1}%
\else
@@ -565,22 +568,23 @@
\processcommalist[#2]\docommando
\changefield{#1}%
\let\@@FieldAutoParent=\@@FieldAuto
- \def\@@FieldParent{#1}%
+ \def\@@FieldParent{#1}%
\let\@@FieldKids=\empty
\let\@@FieldRoot=\empty
\let\@@FieldMode=\fieldcopymode
\def\@@FieldFree{0}%
\def\@@FieldAuto{0}%
\def\docommando##1%
- {\ifcase\@@FieldAutoParent\else
+ {\ifcase\@@FieldAutoParent\else
\setmainfieldkid{\@@FieldParent}{##1}%
\fi
\changefield{##1}}%
\processcommalist[#2]\docommando
\fi
+\fi
\else
\writestatus{\m!fields}{pass parent field and copies}%
- \fi}
+ \fi}
\def\copyfield%
{\dodoubleempty\docopyfield}
@@ -596,9 +600,9 @@
\bgroup
\getfield{#2}%
\ifsecondargument
- \def\@@FieldLabel{#3}%
+ \def\@@FieldLabel{#3}%
\else
- \let\@@FieldLabel=\@@FieldName
+ \let\@@FieldLabel\@@FieldName
\fi
\ifx\@@FieldType\empty
\writestatus{\m!fields}{unknown field #2}%
@@ -606,8 +610,10 @@
\doifdefinedelse{\strippedcsname\setupfield\@@FieldGroup}
{\let\dosetupfield=#1\getvalue{\strippedcsname\setupfield\@@FieldGroup}}
{#1[\@@FieldName][\v!label,\v!kader,\v!horizontaal][][][]}%
+\iftrialtypesetting\else
\def\@@FieldFree{1}%
\changefield{#2}%
+\fi
\else\ifcase\@@FieldAuto\relax
% \writestatus{\m!fields}{field #2 already typeset}%
\else
@@ -616,40 +622,45 @@
\copyfield[\@@FieldName][\currentsystemfield]%
\dotripleempty\dofield[#1][\currentsystemfield][#3]% get the if's right
\fi\fi\fi
- \egroup
+ \egroup
\fi}
\def\typesetfield%
- {\useJSscripts[fld]%
+ {\useJSscripts[fld]%
\ifx\@@FieldRoot\empty \else
- \let\@@SavedFieldName=\@@FieldName
+ \let\@@SavedFieldName\@@FieldName
\getfield\@@FieldRoot
\ifcase\@@FieldFree\relax
\dosetfieldstatus\@@FieldMode\@@FieldParent\@@FieldKids\@@FieldRoot
\dopresetrecord
+\iftrialtypesetting\else
\def\@@FieldFree{1}%
\changefield\@@FieldName
+\fi
\fi
\getfield\@@SavedFieldName
\fi
- \ifx\@@FieldKids\empty
+ \ifx\@@FieldKids\empty
\donefalse
\else
\donetrue
\fi
\ifdone
- \let\@@FieldParent=\@@FieldName
- %\addtocommalist\@@FieldParent\@@FieldKids
+ \let\@@FieldParent\@@FieldName
+ %\addtocommalist\@@FieldParent\@@FieldKids
\appendtocommalist\@@FieldParent\@@FieldKids
\dosetfieldstatus\@@FieldMode\@@FieldParent\@@FieldKids\@@FieldRoot
\dopresetfield
- \let\@@FieldMode=\fieldchildmode
+ \let\@@FieldMode\fieldchildmode
\fi
\dosetfieldstatus\@@FieldMode\@@FieldParent\@@FieldKids\@@FieldRoot
\dopresetfield}
-\def\dopresetfield {\iflocation\getvalue{preset\@@FieldType field}\fi}
-\def\dopresetrecord{\iflocation\getvalue{preset\@@FieldType record}\fi}
+\def\dopresetfield
+ {\iftrialtypesetting\else\iflocation\getvalue{preset\@@FieldType field}\fi\fi}
+
+\def\dopresetrecord
+ {\iftrialtypesetting\else\iflocation\getvalue{preset\@@FieldType record}\fi\fi}
\def\dodefinethefieldset[#1][#2]%
{\dodefinefieldset{#1}{#2}}
diff --git a/tex/context/base/core-grd.tex b/tex/context/base/core-grd.tex
index 22a392bc2..427660dbe 100644
--- a/tex/context/base/core-grd.tex
+++ b/tex/context/base/core-grd.tex
@@ -840,6 +840,4 @@
\global\chardef\fuzzysnappedleft0
\fi\fi\fi}
-\protect
-
-\endinput
+\protect \endinput
diff --git a/tex/context/base/core-itm.tex b/tex/context/base/core-itm.tex
index f6d9961d9..9651315f0 100644
--- a/tex/context/base/core-itm.tex
+++ b/tex/context/base/core-itm.tex
@@ -537,6 +537,9 @@
\ifnum\noflistelements=1 % tgv bv kolommen/nesting
\findtwopassdata\s!list{\noflists:}% % wordt soms de volgorde
\fi % verstoord, vandaar \find
+\iftwopassdatafound
+ \ifcase0\twopassdata\relax \twopassdatafoundfalse \fi
+\fi
\iftwopassdatafound
\ifnum\twopassdata=3
\ifnum\noflistelements>1
@@ -564,7 +567,7 @@
{\ifheaditem
\doitemattributes\itemlevel\c!kopletter\c!kopkleur{\listitem}%
\else\ifsymbolitem
- \symsymbol
+ \symsymbol
\else
\doitemattributes\itemlevel\c!letter\c!kleur{\listitem}%
\fi\fi}%
diff --git a/tex/context/base/core-new.tex b/tex/context/base/core-new.tex
index 69b796925..96dbdba5c 100644
--- a/tex/context/base/core-new.tex
+++ b/tex/context/base/core-new.tex
@@ -267,8 +267,8 @@
{\bgroup
\dowithnextbox
{\getparameters[\??ox]
- [\c!x=\!!zeropoint,
- \c!y=\!!zeropoint,
+ [\c!x=\zeropoint,
+ \c!y=\zeropoint,
\c!breedte=\wd\nextbox,
\c!hoogte=\wd\nextbox,
\c!diepte=\dp\nextbox,
diff --git a/tex/context/base/core-not.tex b/tex/context/base/core-not.tex
index e86f8352a..26c9e7d93 100644
--- a/tex/context/base/core-not.tex
+++ b/tex/context/base/core-not.tex
@@ -104,7 +104,7 @@
{\ifvmode
\color
[\@@vnlijnkleur]
- {\hrule\!!width.2\hsize\!!height\@@vnlijndikte\!!depth\!!zeropoint}
+ {\hrule\!!width.2\hsize\!!height\@@vnlijndikte\!!depth\!!zeropoint}%
\kern\strutdepth
\fi}
@@ -201,7 +201,7 @@
\def\startpopfootnotes {\bgroup
\setfootnotehsize
\setrigidcolumnhsize\hsize\@@vnkolomafstand\@@vnn
- \setbox0=\vbox\bgroup}
+ \setbox0=\vbox\bgroup}%
\def\stoppopfootnotes {\egroup
\setbox0=\vbox
{\unvbox0\setbox0\lastbox
@@ -349,7 +349,7 @@
\else
\@EAEAEA\dodofootnote
\fi
- \else
+ \else % todo: \iftrialtypesetting
\@EA\gobbletwoarguments
\fi{#2}}
diff --git a/tex/context/base/core-ntb.tex b/tex/context/base/core-ntb.tex
index 2ffc6ffae..0af157422 100644
--- a/tex/context/base/core-ntb.tex
+++ b/tex/context/base/core-ntb.tex
@@ -217,8 +217,12 @@
\getvalue{\@@tblprefix\c!x#2}%
\getvalue{\@@tblprefix\c!x#2\c!y#1}\relax}
+%\long\def\parseTR[#1][#2]#3\eTR% [#2] is dummy that kills spaces
+% {\def\currentcol{0}\increment\maximumrow#3}
+
\long\def\parseTR[#1][#2]#3\eTR% [#2] is dummy that kills spaces
- {\def\currentcol{0}\increment\maximumrow#3}
+ {\def\currentcol{0}\increment\maximumrow
+ \setupTABLE[\v!rij][\maximumrow][#1]#3}
% \long\def\parseTD[#1][#2]#3\eTD% [#2] is dummy that kills spaces
% {\getparameters[\@@tbl][\c!ny=\tblnr,\c!nx=\tblnc,nc=1,nr=1,#1]%
diff --git a/tex/context/base/core-pos.tex b/tex/context/base/core-pos.tex
index 3edbd1b15..3b6b16737 100644
--- a/tex/context/base/core-pos.tex
+++ b/tex/context/base/core-pos.tex
@@ -114,7 +114,6 @@
%\setxvalue{\POSprefix#1}{\@@posp,\@@posx,\@@posy,\@@posw,\@@posh,\@@posd}}%
\@EA\xdef\csname\POSprefix#1\endcsname{\@@posp,\@@posx,\@@posy,\@@posw,\@@posh,\@@posd}}%
-
\def\setpospxyplus#1#2#3#4#5#6#7#8%
{\dosetpositionnm\@@posp{#2}%
\dosetpositionpt\@@posx{#3}%
diff --git a/tex/context/base/core-ref.tex b/tex/context/base/core-ref.tex
index 7fe973205..fdd01417f 100644
--- a/tex/context/base/core-ref.tex
+++ b/tex/context/base/core-ref.tex
@@ -241,37 +241,30 @@
\newcount\crossreferencenumber \crossreferencenumber=1
-% \def\writereference#1#2#3#4%
-% {\ifreferencing
-% \doifsomething{#1}
-% {\def\dowritereference##1%
-% {\xdef\lastreference{##1}%
-% \@EA\dodowritereference\lastreference\empty\empty\end
-% {#2}{#3}{#4}}%
-% \processcommalist[#1]\dowritereference}%
-% \fi}
-
\def\writereference#1#2#3#4%
{\ifreferencing
\edef\!!stringa{#1}%
\ifx\!!stringa\empty \else
\def\dowritereference##1%
- {\def\lastreference{##1}%
+ {\xdef\lastreference{##1}%
\@EA\dodowritereference\lastreference\empty\empty\end{#2}{#3}{#4}}%
\rawprocesscommalist[\!!stringa]\dowritereference
\fi
\fi}
-\def\dodowritereference#1#2#3\end#4#5#6%
- {\bgroup
+%D Beware: \type {#2} gobbles space in references so that
+%D \typ {a nice ref} becomes \typ {anice ref}.
+
+\def\dodowritereference#1#2#3\end#4#5#6%
+ {\bgroup
\global\advance\crossreferencenumber 1
\if#1-\if#2:%
\let\referenceprefix\empty
\xdef\lastreference{#3}%
\else
- \xdef\lastreference{#1#2#3}%
+ % \xdef\lastreference{#1#2#3}% here we loose the space
\fi\else
- \xdef\lastreference{#1#2#3}%
+ % \xdef\lastreference{#1#2#3}% here we loose the space
\fi
\ifx\lastreference\empty \else
\doiffirstreferenceoccurance\lastreference
diff --git a/tex/context/base/core-sec.tex b/tex/context/base/core-sec.tex
index 73347fb25..d6a0e7d52 100644
--- a/tex/context/base/core-sec.tex
+++ b/tex/context/base/core-sec.tex
@@ -1195,6 +1195,7 @@
\doifelsevalue{\??ko#1\c!eigennummer}{\v!ja} % brrr
{\edef\finalsectionnumber{#3}}
{\bepaalkopnummer[#1]}%
+% todo : geen markering (leeg maken)
\expanded{\marking[#1\v!nummer]{\finalsectionnumber}}}%
\writesection{#1}{-}{#4}%
\fi
@@ -1321,6 +1322,8 @@
\newif\ifheadnumbercontent % niet meer wijzigen / wordt mode
+% todo: kap
+
\def\doplaatskoptekst#1#2#3#4%
{\beginheadplacement{#1}%
\setbox0=\ifvertical\vbox\else\hbox\fi % \vhbox
diff --git a/tex/context/base/core-spa.tex b/tex/context/base/core-spa.tex
index 891fed3f2..7223de12a 100644
--- a/tex/context/base/core-spa.tex
+++ b/tex/context/base/core-spa.tex
@@ -495,18 +495,24 @@
\def\complexdoblanko
{\flushfootnotes
- \ifopelkaar
- \ifinpagebody
- \@EAEAEA\docomplexdoblanko
+ \ifmmode
+ \let\next\nocomplexdoblanko
+ \else
+ \ifopelkaar
+ \ifinpagebody
+ \let\next\docomplexdoblanko
+ \else
+ \let\next\nocomplexdoblanko
+ \fi
\else
- \@EAEAEA\nocomplexdoblanko
+ \let\next\docomplexdoblanko
\fi
- \else
- \@EA\docomplexdoblanko
- \fi}
+ \fi
+ \next}
\def\nocomplexdoblanko[#1]%
- {\par}
+ {% evt blokkeerfalse
+ \ifmmode\else\par\fi}
\def\docomplexdoblanko[#1]% pas op \relax's zijn nodig ivm volgende \if
{\global\blankoresetfalse
diff --git a/tex/context/base/core-ver.tex b/tex/context/base/core-ver.tex
index 3061ea280..15715da32 100644
--- a/tex/context/base/core-ver.tex
+++ b/tex/context/base/core-ver.tex
@@ -129,7 +129,9 @@
\installnewpretty X {\setupprettiesintype{XML}\setupprettytype}
\def\setupcommonverbatim#1%
- {\def\prettyidentifier{TEX}%
+ {\eightbitcharactersfalse % obey regime / encoding
+ %
+ \def\prettyidentifier{TEX}%
%
\doifelsevalue{#1\c!tekst}{\v!ja}
{\naturaltextexttrue}{\naturaltextextfalse}%
diff --git a/tex/context/base/enco-ec.tex b/tex/context/base/enco-ec.tex
index 5e2cb46ad..3f9bc896f 100644
--- a/tex/context/base/enco-ec.tex
+++ b/tex/context/base/enco-ec.tex
@@ -3,9 +3,9 @@
%D version=1999.16.7,
%D title=\CONTEXT\ Encoding Macros,
%D subtitle=\LATEX\ EC Encoding,
-%D author=Taco Hoekwater,
+%D author={Hans Hagen, Taco Hoekwater, Patrick Gundlach},
%D date=\currentdate,
-%D copyright={Hans Hagen \& Taco Hoekwater}]
+%D copyright={Hans Hagen \& Taco Hoekwater \& Patrick Gundlach}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
@@ -59,14 +59,29 @@
\definecharacter textcedilla 11
\definecharacter textogonek 12
-\definecharacter textunderscore 95
-
+\definecharacter quotesinglebase 13 % singlebasequote
+\definecharacter guilsingleleft 14 % singleleftguillemot
+\definecharacter guilsingleright 15 % singlerightguillemot
+\definecharacter quotedblleft 16 % doubleleftquote
+\definecharacter quotedblright 17 % doublerightquote
+\definecharacter quotedblbase 18 % doiublebasequote
\definecharacter leftguillemot 19
\definecharacter rightguillemot 20
-
+\definecharacter endash 21 % lig
+\definecharacter emdash 22 % lig
+\definecharacter cwm 23 % compoundwordmark
+\definecharacter perthousand 24
\definecharacter dotlessi 25
\definecharacter dotlessj 26
+\definecharacter textbackslash 92
+\definecharacter textasciicircum 94 % ?
+\definecharacter textunderscore 95
+\definecharacter textbraceleft 123 % textleftbrace
+\definecharacter textbraceright 125 % textrightbrace
+\definecharacter texttilde 126
+\definecharacter softhyphen 127 % ?
+
\definecharacter Abreve 128
\definecharacter Aogonek 129
\definecharacter Cacute 130
@@ -98,7 +113,7 @@
\definecharacter IJligature 156
\definecharacter Idotaccent 157
\definecharacter dmacron 158
-
+\definecharacter sectionmark 159
\definecharacter abreve 160
\definecharacter aogonek 161
\definecharacter cacute 162
@@ -128,7 +143,9 @@
\definecharacter zcaron 186
\definecharacter zdotaccent 187
\definecharacter ijligature 188
-
+\definecharacter exclamdown 189 % lig
+\definecharacter questiondown 190 % lig
+\definecharacter pounds 191
\definecharacter Agrave 192
\definecharacter Aacute 193
\definecharacter Acircumflex 194
@@ -145,7 +162,7 @@
\definecharacter Iacute 205
\definecharacter Icircumflex 206
\definecharacter Idiaeresis 207
-
+\definecharacter Eth 208
\definecharacter Ntilde 209
\definecharacter Ograve 210
\definecharacter Oacute 211
@@ -177,7 +194,7 @@
\definecharacter iacute 237
\definecharacter icircumflex 238
\definecharacter idiaeresis 239
-
+\definecharacter eth 240
\definecharacter ntilde 241
\definecharacter ograve 242
\definecharacter oacute 243
diff --git a/tex/context/base/enco-ini.tex b/tex/context/base/enco-ini.tex
index 8f5fe8ab4..ee79b4052 100644
--- a/tex/context/base/enco-ini.tex
+++ b/tex/context/base/enco-ini.tex
@@ -748,18 +748,25 @@
\def\stoppatternaccents%
{\let\char\savedpatternchar}
-% \def\presetcharacter#1%
-% {\setvalue{#1}{\dohandlecharacter{#1}}}
-
\def\definecharacter#1 #2 %
{\ifundefined{#1}\setvalue{#1}{\dohandlecharacter{#1}}\fi
-% {\setvalue{#1}{\dohandlecharacter{#1}}%
-% {\@EA\presetcharacter\@EA{\@EA\strippedcsname\csname#1\endcsname}%
\doifnumberelse{\string#2}
{\setvalue{\characterencoding\string#1}{\char#2 }% watch the space
\doautosetregime{#1}{#2}}
{\setvalue{\characterencoding\string#1}{#2}}}
+% better
+%
+% \def\definecharacter#1 #2 %
+% {\ifundefined{#1}\setvalue{#1}{\dohandlecharacter{#1}}\fi
+% \doifnumberelse{\string#2}
+% {\setevalue{\characterencoding\string#1}{\noexpand\charofnum{\number#2}}% watch the space
+% \doautosetregime{#1}{#2}}
+% {\setvalue{\characterencoding\string#1}{#2}}}
+%
+% \def\charofnum#1{\char#1 }
+% \def\byteofnum#1{\rawcharacter{#1}}
+
\beginTEX
\def\dohandlecharacter#1%
@@ -1111,7 +1118,7 @@
\ifx\obeylccodes\undefined
-\def\obeylccodes%
+\def\obeylccodes
{\scratchcounter32
\loop
\ifnum\scratchcounter<127
diff --git a/tex/context/base/font-run.tex b/tex/context/base/font-run.tex
index 0ed13e09e..12c607a04 100644
--- a/tex/context/base/font-run.tex
+++ b/tex/context/base/font-run.tex
@@ -130,7 +130,8 @@
{\red
\dostepwiserecurse{0}{15}{1}
{\let\col\recurselevel
- \scratchcounter="\hexnumber\row\hexnumber\col\relax
+ \@EA\scratchcounter\normaldblquote\hexnumber\row\hexnumber\col\relax
+ \edef\rowcol{\the\scratchcounter}%
\iffontchar\font\scratchcounter
\setbox\scratchbox\ruledhbox{\black\char\scratchcounter}%
\ifdim\wd\scratchbox>\!!zeropoint\relax
@@ -147,8 +148,8 @@
\setbox\scratchbox=\hbox
{\raise.5\dp\scratchbox\hbox
{\lower.5\ht\scratchbox\copy\scratchbox}}%
- \ht\scratchbox\!!zeropoint
- \dp\scratchbox\!!zeropoint
+ \ht\scratchbox\zeropoint
+ \dp\scratchbox\zeropoint
\else
\ht\scratchbox\ht\strutbox
\dp\scratchbox\dp\strutbox
@@ -160,17 +161,17 @@
{\ifdone
\blue \hsize2.4em
\edef\ascii
- {\ifnum\hyphenchar\font=\scratchcounter
+ {\ifnum\hyphenchar\font=\rowcol
hyph%
- \else\ifnum\skewchar\font=\scratchcounter
+ \else\ifnum\skewchar\font=\rowcol
skew%
\fi\fi}%
\tinyfont
{\red\ascii}\hfill
- \number\scratchcounter
+ \number\rowcol
\vfill
- \octnumber\scratchcounter\hfill
- \lchexnumbers\scratchcounter\par
+ \octnumber\rowcol\hfill
+ \lchexnumbers\rowcol\par
\fi}}
\stopoverlay}}}
\par}}
diff --git a/tex/context/base/meta-ini.tex b/tex/context/base/meta-ini.tex
index dd90344c2..d9b407fff 100644
--- a/tex/context/base/meta-ini.tex
+++ b/tex/context/base/meta-ini.tex
@@ -328,7 +328,8 @@
\convertcommand\!!stringa\to\ascii % otherwise problems
\doifcolorelse{\ascii} % with 2\bodyfontsize
{\setevalue{#1}{\MPcolor{\getvalue{#1}}}}
- {\setbox\scratchbox=\hbox{\scratchdimen=\getvalue{#1}sp}%
+ {% can be aux macro
+ \setbox\scratchbox=\hbox{\scratchdimen=\getvalue{#1}sp}%
\ifdim\wd\scratchbox=\zeropoint
\scratchcounter=\getvalue{#1}\relax
\setevalue{#1}{\the\scratchcounter}%
diff --git a/tex/context/base/meta-pag.tex b/tex/context/base/meta-pag.tex
index ccc41a1cd..f33fa3ee2 100644
--- a/tex/context/base/meta-pag.tex
+++ b/tex/context/base/meta-pag.tex
@@ -40,6 +40,7 @@
PrintPaperHeight := \the\printpapierhoogte ;
PrintPaperWidth := \the\printpapierbreedte ;
TopSpace := \the\kopwit ;
+ BottomSpace := \the\bodemwit ;
BackSpace := \the\rugwit ;
CutSpace := \the\snijwit ;
MakeupHeight := \the\zethoogte ;
diff --git a/tex/context/base/mult-sys.tex b/tex/context/base/mult-sys.tex
index 02600c603..e1dda1c36 100644
--- a/tex/context/base/mult-sys.tex
+++ b/tex/context/base/mult-sys.tex
@@ -431,6 +431,7 @@
\definesystemvariable {op} % OPsomming
\definesystemvariable {os} % OffSet
\definesystemvariable {ov} % OVerlay
+\definesystemvariable {ox} % OffsetBox
\definesystemvariable {pa} % PAlet
\definesystemvariable {pb} % PuBlicatie
\definesystemvariable {pc} % PageComment
diff --git a/tex/context/base/page-lay.tex b/tex/context/base/page-lay.tex
index bd3a7d2f9..72f03c9ce 100644
--- a/tex/context/base/page-lay.tex
+++ b/tex/context/base/page-lay.tex
@@ -53,6 +53,7 @@
\newdimen\kopwit \kopwit = 2cm
\newdimen\rugwit \rugwit = \kopwit
\newdimen\snijwit \snijwit = 0pt
+\newdimen\bodemwit \bodemwit = 0pt
\newdimen\hoofdhoogte \hoofdhoogte = 2cm
\newdimen\voethoogte \voethoogte = \hoofdhoogte
diff --git a/tex/context/base/page-sid.tex b/tex/context/base/page-sid.tex
index b2fe14f78..13bfd6224 100644
--- a/tex/context/base/page-sid.tex
+++ b/tex/context/base/page-sid.tex
@@ -308,14 +308,16 @@
\ifrightfloat
\hfill
\ifmarginfloat
- \rlap{\hskip\rechtermargeafstand\hskip\rightskip\unhbox\floatbox}%
+% \rlap{\hskip\rechtermargeafstand\hskip\rightskip\unhbox\floatbox}%
+\rlap{\tbox{\hskip\rechtermargeafstand\hskip\rightskip\unhbox\floatbox}}%
\else
\unhbox\floatbox
\fi
\else
\noindent
\ifmarginfloat
- \llap{\unhbox\floatbox\hskip\leftskip\hskip\linkermargeafstand}%
+% \llap{\unhbox\floatbox\hskip\leftskip\hskip\linkermargeafstand}%
+\llap{\tbox{\unhbox\floatbox\hskip\leftskip\hskip\linkermargeafstand}}%
\else
\unhbox\floatbox
\fi
@@ -330,7 +332,7 @@
%\noindent
\resetsidefloatparagraph
\ignorespaces}
-
+
\newcount\sidefloatparagraph
\def\iffirstsidefloatparagraph%
diff --git a/tex/context/base/s-abr-01.tex b/tex/context/base/s-abr-01.tex
index a1347030a..b6bb47f81 100644
--- a/tex/context/base/s-abr-01.tex
+++ b/tex/context/base/s-abr-01.tex
@@ -49,6 +49,7 @@
\logo [EMACS] {emacs}
\logo [EMTEX] {em\TeX}
\logo [EPS] {eps}
+\logo [EXAMPLE] {eXaMpLe}
\logo [ETEX] {\eTeX}
\logo [EUROMATH] {EuroMath}
\logo [EUROTEX] {Euro\TeX}
diff --git a/tex/context/base/spec-tpd.tex b/tex/context/base/spec-tpd.tex
index 5b9d66613..438519981 100644
--- a/tex/context/base/spec-tpd.tex
+++ b/tex/context/base/spec-tpd.tex
@@ -237,7 +237,7 @@
\doifnumberelse{\commalistelement}
{\ifcase\commalistelement\else
\edef\pdfimagepagenumber{page \commalistelement}%
- \message{(pdf image \pdfimagepagenumber)}%
+ %\message{(pdf image \pdfimagepagenumber)}%
\fi}
{}}
diff --git a/tex/context/base/supp-fil.tex b/tex/context/base/supp-fil.tex
index bf5e6fed5..43449ef93 100644
--- a/tex/context/base/supp-fil.tex
+++ b/tex/context/base/supp-fil.tex
@@ -583,7 +583,7 @@
%%
%% \def\setspecialcatcodes%
%% {\catcode`/=\@@other
-%% \catcode`"=\@@other
+%% \catcode`"=\@@letter
%% \catcode`<=\@@other
%% \catcode`>=\@@other}
diff --git a/tex/context/base/supp-mps.tex b/tex/context/base/supp-mps.tex
index 97be8f30a..deb669db7 100644
--- a/tex/context/base/supp-mps.tex
+++ b/tex/context/base/supp-mps.tex
@@ -1190,7 +1190,8 @@
\def\dodohandleMPcolor#1 #2 #3setrgbcolor#4setrgbcolor*\\%
{\bgroup
-\ifdim\MPspecialsignal=.123pt % color spec / hardcoded hack
+%\ifnum\MPspecialsignal=123 % color spec / hardcoded hack
+\ifdim#1pt=.123pt
\immediate\write\scratchwrite{#1 #2 #3 setrgbcolor}%
\else
\ifforcegrayMPcolors
diff --git a/tex/context/base/syst-ext.tex b/tex/context/base/syst-ext.tex
index 2276f894a..624deaec7 100644
--- a/tex/context/base/syst-ext.tex
+++ b/tex/context/base/syst-ext.tex
@@ -4050,8 +4050,11 @@
%D
%D This macro needs a speed-up!
-\def\gobblespacetokens % will go to syst-ext.tex + speed up
- {\doifnextcharelse\empty\donothing\donothing} % no {}\do\do !
+%\def\gobblespacetokens
+% {\doifnextcharelse\empty\donothing\donothing} % no {}\do\do !
+
+\def\gobblespacetokens
+ {\afterassignment\nexttoken\let\nexttoken=}
%D \macros
%D {verbatimargument}
diff --git a/tex/context/base/syst-gen.tex b/tex/context/base/syst-gen.tex
index fb6788018..f65eaf75f 100644
--- a/tex/context/base/syst-gen.tex
+++ b/tex/context/base/syst-gen.tex
@@ -290,7 +290,8 @@
\newdimen\!!widthb \newdimen\!!heightb \newdimen\!!depthb
\newdimen\!!widthc \newdimen\!!heightc \newdimen\!!depthc
-\newif\if!!donea \newif\if!!doneb \newif\if!!donec
+\newif\if!!donea \newif\if!!doneb
+\newif\if!!donec \newif\if!!doned
\ifx \z@\undefined \else \let\zeropoint\z@ \fi
\ifx \@ne\undefined \else \let\plusone \@ne \fi
diff --git a/tex/context/base/xtag-ext.tex b/tex/context/base/xtag-ext.tex
index 0645cea38..d6f140a33 100644
--- a/tex/context/base/xtag-ext.tex
+++ b/tex/context/base/xtag-ext.tex
@@ -115,32 +115,35 @@
\bgroup \catcode`\<=\active
\gdef\saveasXMLdata#1#2% name raw data
- {\dodoglobal\setevalue{\@@XMLsave#1}{#2}} % \edef!
+ {\dodoglobal\setevalue{\@@XMLsave:#1}{#2}} % \edef!
\gdef\saveXMLdata#1#2% name data-name ; definitely no \edef
- {\dodoglobal\copycsname\@@XMLsave#1\endcsname\csname\@@XMLdata:#2\endcsname}
+ {\dodoglobal\copycsname\@@XMLsave:#1\endcsname\csname\@@XMLdata:#2\endcsname}
\gdef\saveXMLdatainelement#1#2#3% name element data
- {\dodoglobal\setevalue{\@@XMLsave#1}% todo: one level expansion
+ {\dodoglobal\setevalue{\@@XMLsave:#1}% todo: one level expansion
{<#2 \currentXMLarguments>\XMLflush{#3}</#2>}}
\gdef\saveXMLdatastructure#1#2#3#4#5#6% name element args before data after
- {\dodoglobal\setevalue{\@@XMLsave#1}% todo: one level expansion
+ {\dodoglobal\setevalue{\@@XMLsave:#1}% todo: one level expansion
{<#2 #3 \currentXMLarguments>#4\XMLflush{#5}#6</#2>}}
\gdef\doifelseXMLelement#1%
- {\doifdefinedelse{\@@XMLsave#1}}
+ {\doifdefinedelse{\@@XMLsave:#1}}
\gdef\flushXMLelement#1%
- {\csname\@@XMLsave#1\endcsname}
+ {\csname\@@XMLsave:#1\endcsname}
\gdef\showXMLelement#1%
- {\showvalue{\@@XMLsave#1}}
+ {\showvalue{\@@XMLsave:#1}}
+
+\gdef\eraseXMLelement#1%
+ {\dodoglobal\letbeundefined{\@@XMLsave:#1}}
\gdef\processXMLelement#1%
{\bgroup
\enableXMLelements
- \getvalue{\@@XMLsave#1}%
+ \getvalue{\@@XMLsave:#1}%
\egroup}
\gdef\texXMLelement#1%
@@ -148,10 +151,9 @@
\setnormalcatcodes
\scantokens\@EA\@EA\@EA{\csname\@@XMLsave#1\endcsname}%
\endgroup}
-
\egroup
-
+
\def\potentialXMLentity#1%
{\doifXMLentityelse{#1}{\getXMLentity{#1}}{#1}}
diff --git a/tex/context/base/xtag-ini.tex b/tex/context/base/xtag-ini.tex
index e3db7939e..b768731b7 100644
--- a/tex/context/base/xtag-ini.tex
+++ b/tex/context/base/xtag-ini.tex
@@ -11,6 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+% todo: XMLfullsave == also attributes
+
% csnames
\beginTEX
@@ -364,32 +366,10 @@
\long\def\xparseXMLprocess ?#1 #2>{\parseXMLprocess{#1}{#2}}
\long\def\xparseXMLelement #1>{\parseXMLelement #1 >}
-% this kind of optimizations are only faster in a more
-% extensive if tree combined with equally spread occurance of
-% #1 (also tested for arguments)
-%
-% \long\def\doXMLelement#1%
-% {\csname<\if#1!!\else\if#1??\else.\fi\fi>\endcsname#1}
-%
-% \long\setvalue{<!>}!#1 {\parseXMLescape{#1}}
-% \long\setvalue{<?>}?#1 {\parseXMLprocess{#1}}
-% \long\setvalue{<.>}#1>{\parseXMLelement#1 >}
-
%D The escape handler takes care of the fuzzy \type {<!}
%D constructs. Unfortunately, we need to catch \type {<--text}
%D too, so we need another handler:
-% \long\def\xparseXMLescape !#1#2%
-% {\if#1-%
-% \if#2-%
-% \expandafter\expandafter\expandafter\xxparseXMLescape
-% \else
-% \expandafter\expandafter\expandafter\xyparseXMLescape
-% \fi
-% \else
-% \expandafter\xyparseXMLescape
-% \fi#1#2}
-
\long\def\xparseXMLescape !#1#2%
{\if#1-%
\if#2-%
@@ -405,7 +385,6 @@
\fi
\fi#1#2}
-
\long\def\xxparseXMLescape--#1{\parseXMLescape{--}#1}
\long\def\xyparseXMLescape#1 {\parseXMLescape{#1}}
\long\def\xzparseXMLescape[#1[{\parseXMLescape{#1}}
@@ -421,10 +400,6 @@
\def\parseXMLescape#1% #2> parsing takes place in macros
{\executeifdefined{\@@XMLescape:#1}{\csname\@@XMLescape:\s!default\endcsname}}
-\let\normalparseXMLescape \parseXMLescape
-\let\normalparseXMLelement\parseXMLelement
-\let\normalparseXMLprocess\parseXMLprocess
-
%D In our case, processing instructions are only needed if
%D we want specific \CONTEXT\ support. This may be useful in
%D applications where the data is generated by an
@@ -464,6 +439,12 @@
\noexpand\gobbleoneargument
{\expandafter\noexpand\currentXMLprocess}}}
+%D One never knows:
+
+\let\normalparseXMLescape \parseXMLescape
+\let\normalparseXMLelement\parseXMLelement
+\let\normalparseXMLprocess\parseXMLprocess
+
%D Next we will implement the normal element handler. This
%D piece of code is complicated by the fact that we need to
%D handle namespaces.
@@ -1199,19 +1180,27 @@
\newtoks\globalscratchtoks
-\def\expandXMLvalue#1%
- {\ifcsname#1\endcsname
+\def\doexpandXMLvalue#1#2%
+ {\ifcsname#2\endcsname
\bgroup
-\enableXMLexpansion
+ \enableXMLexpansion
\let\getXMLentity\expandedXMLentity
- \expanded{\global\globalscratchtoks{\csname#1\endcsname}}%
+ #1% simplify maps entities back to _ and alike
+ \expanded{\global\globalscratchtoks{\csname#2\endcsname}}%
\egroup
- \@EA\edef\csname#1\endcsname{\the\globalscratchtoks}%
+ \@EA\edef\csname#2\endcsname{\the\globalscratchtoks}%
\fi}
-\def\expandTEXpar #1#2{\expandXMLvalue{#1\interfaced{#2}}}
-\def\expandXMLpar #1#2{\expandXMLvalue{\@@XMLvariable:#1:#2}}
-\def\expandXMLarguments#1{\expandXMLvalue{\@@XMLmap:#1}}
+\def\expandXMLvalue {\doexpandXMLvalue\relax}
+\def\simplifyXMLvalue{\doexpandXMLvalue\XMLsimpleentitiestrue}
+
+\def\expandTEXpar #1#2{\expandXMLvalue{#1\interfaced{#2}}}
+\def\expandXMLpar #1#2{\expandXMLvalue{\@@XMLvariable:#1:#2}}
+\def\expandXMLarguments #1{\expandXMLvalue{\@@XMLmap:#1}}
+
+\def\simplifyTEXpar #1#2{\simplifyXMLvalue{#1\interfaced{#2}}}
+\def\simplifyXMLpar #1#2{\simplifyXMLvalue{\@@XMLvariable:#1:#2}}
+\def\simplifyXMLarguments#1{\simplifyXMLvalue{\@@XMLmap:#1}}
%D \startbuffer[tex]
%D \defineXMLsingular [fx:root]
diff --git a/tex/context/base/xtag-xsl.tex b/tex/context/base/xtag-xsl.tex
index ac88845b9..e0a3e2f4e 100644
--- a/tex/context/base/xtag-xsl.tex
+++ b/tex/context/base/xtag-xsl.tex
@@ -107,14 +107,6 @@
{\expanded{\applyXSLTscript
[#1][\TEXbufferfile{\ifsecondargument#2\else\jobname\fi}]}}
-%D \startMPdrawing
-%D \stopMPdrawing
-%D \pushMPdrawing
-%D \popMPdrawing
-%D \resetMPdrawing
-%D \ifMPdrawingdone
-%D \getMPdrawing
-
\def\resetXSLTscripting#1%
{\setgvalue{\??xl\s!dummy}{\doXSLTscript{#1}{}}}