summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2004-07-12 00:00:00 +0200
committerHans Hagen <pragma@wxs.nl>2004-07-12 00:00:00 +0200
commit599c5089a184d1967ec8dc66307de52378e911d4 (patch)
treebca60153e27195d99616b39b4c287d441d7f45cb
parentdbea9c7447611a8d5dc6837ee565637256293b29 (diff)
downloadcontext-599c5089a184d1967ec8dc66307de52378e911d4.tar.gz
stable 2004.07.12
-rw-r--r--context/data/cont-cz.tws1
-rw-r--r--context/data/cont-de.tws1
-rw-r--r--context/data/cont-en.tws1
-rw-r--r--context/data/cont-it.tws1
-rw-r--r--context/data/cont-nl.tws1
-rw-r--r--context/data/cont-ro.tws1
-rw-r--r--context/data/context.properties7
-rw-r--r--metapost/context/base/mp-tool.mp109
-rw-r--r--scripts/context/perl/mptopdf.pl80
-rw-r--r--scripts/context/perl/texexec.pl24
-rw-r--r--scripts/context/ruby/texmfstart.rb2
-rw-r--r--tex/context/base/colo-hex.tex32
-rw-r--r--tex/context/base/colo-ini.tex33
-rw-r--r--tex/context/base/cont-new.tex234
-rw-r--r--tex/context/base/core-box.tex35
-rw-r--r--tex/context/base/core-con.tex3
-rw-r--r--tex/context/base/core-fig.tex18
-rw-r--r--tex/context/base/core-fnt.tex12
-rw-r--r--tex/context/base/core-int.tex4
-rw-r--r--tex/context/base/core-lnt.tex51
-rw-r--r--tex/context/base/core-mar.tex71
-rw-r--r--tex/context/base/core-ref.tex15
-rw-r--r--tex/context/base/core-rul.tex35
-rw-r--r--tex/context/base/core-sec.tex40
-rw-r--r--tex/context/base/core-spa.tex100
-rw-r--r--tex/context/base/core-uti.tex4
-rw-r--r--tex/context/base/m-cweb.tex16
-rw-r--r--tex/context/base/mult-com.tex18
-rw-r--r--tex/context/base/mult-con.tex8
-rw-r--r--tex/context/base/mult-sys.tex2
-rw-r--r--tex/context/base/page-app.tex68
-rw-r--r--tex/context/base/page-imp.tex1
-rw-r--r--tex/context/base/page-mak.tex2
-rw-r--r--tex/context/base/page-mar.tex60
-rw-r--r--tex/context/base/page-num.tex18
-rw-r--r--tex/context/base/page-txt.tex6
-rw-r--r--tex/context/base/s-abr-01.tex1
-rw-r--r--tex/context/base/s-chi-00.tex18
-rw-r--r--tex/context/base/s-dtk-01.tex92
-rw-r--r--tex/context/base/s-map-01.tex26
-rw-r--r--tex/context/base/setupb.tex22
-rw-r--r--tex/context/base/spec-fdf.tex7
-rw-r--r--tex/context/base/supp-box.tex8
-rw-r--r--tex/context/base/supp-mis.tex13
-rw-r--r--tex/context/base/supp-pdf.tex10
-rw-r--r--tex/context/base/supp-vis.tex221
-rw-r--r--tex/context/base/syst-etx.tex2
-rw-r--r--tex/context/base/syst-ext.tex2
-rw-r--r--tex/context/base/syst-new.tex2
-rw-r--r--tex/context/base/x-contml.tex2
-rw-r--r--tex/context/base/xtag-ini.tex298
-rw-r--r--tex/context/base/xtag-pre.tex21
-rw-r--r--tex/context/base/xtag-run.tex12
53 files changed, 1200 insertions, 671 deletions
diff --git a/context/data/cont-cz.tws b/context/data/cont-cz.tws
index dcf3cbbf4..7078cfe90 100644
--- a/context/data/cont-cz.tws
+++ b/context/data/cont-cz.tws
@@ -2259,6 +2259,7 @@ var:sirka:*dimenze::
var:vyska:*dimenze::
var:svrchnimezera:*dimenze::
var:zpetnamezera:*dimenze::
+var:volba:max,prizpusobive::
stopsetup
startsetup
diff --git a/context/data/cont-de.tws b/context/data/cont-de.tws
index 6e251c662..8dfa23d4e 100644
--- a/context/data/cont-de.tws
+++ b/context/data/cont-de.tws
@@ -2259,6 +2259,7 @@ var:breite:*Dimension::
var:hoehe:*Dimension::
var:kopfspatium:*Dimension::
var:rumpfspatium:*Dimension::
+var:option:max,passend::
stopsetup
startsetup
diff --git a/context/data/cont-en.tws b/context/data/cont-en.tws
index d6ebe90b3..c3ad4f80b 100644
--- a/context/data/cont-en.tws
+++ b/context/data/cont-en.tws
@@ -2259,6 +2259,7 @@ var:width:*dimension::
var:height:*dimension::
var:topspace:*dimension::
var:backspace:*dimension::
+var:option:max,fit::
stopsetup
startsetup
diff --git a/context/data/cont-it.tws b/context/data/cont-it.tws
index e1355b559..abdb1b9d0 100644
--- a/context/data/cont-it.tws
+++ b/context/data/cont-it.tws
@@ -2259,6 +2259,7 @@ var:ampiezza:*dimensione::
var:altezza:*dimensione::
var:spaziocima:*dimensione::
var:backspace:*dimensione::
+var:opzione:max,adatta::
stopsetup
startsetup
diff --git a/context/data/cont-nl.tws b/context/data/cont-nl.tws
index 65a282aa1..554e2a165 100644
--- a/context/data/cont-nl.tws
+++ b/context/data/cont-nl.tws
@@ -2259,6 +2259,7 @@ var:breedte:*maat::
var:hoogte:*maat::
var:kopwit:*maat::
var:rugwit:*maat::
+var:optie:max,passend::
stopsetup
startsetup
diff --git a/context/data/cont-ro.tws b/context/data/cont-ro.tws
index ae806b0b4..3a36f7eba 100644
--- a/context/data/cont-ro.tws
+++ b/context/data/cont-ro.tws
@@ -2259,6 +2259,7 @@ var:latime:*dimensiune::
var:inaltime:*dimensiune::
var:spatiusus:*dimensiune::
var:spatiuspate:*dimensiune::
+var:optiune:max,ajustat::
stopsetup
startsetup
diff --git a/context/data/context.properties b/context/data/context.properties
index 8c49ce3ca..52144e11d 100644
--- a/context/data/context.properties
+++ b/context/data/context.properties
@@ -47,7 +47,7 @@ import latex-scite
# Example : patterns
file.patterns.xml=
-file.patterns.example=*.xml;*.xsd;*.exa;*.rlb;*.rlg;*.rlv;*.rng;*.xfdf;*.xslt;*.dtd
+file.patterns.example=*.xml;*.xsd;*.fo;*.exa;*.rlb;*.rlg;*.rlv;*.rng;*.xfdf;*.xslt;*.dtd
filter.example=eXaMpLe|$(file.patterns.example)|
@@ -106,6 +106,7 @@ command.save.before=1
command.compile.$(file.patterns.context)=$(name.context.concheck) $(FileNameExt)
command.compile.$(file.patterns.metafun)=
command.compile.$(file.patterns.example)=$(name.example.xmlcheck) $(FileNameExt)
+command.compile.*.fo=$(name.example.xmlcheck) $(FileNameExt)
#command.compile.subsystem.$(file.patterns.context)=1
#command.compile.subsystem.$(file.patterns.metafun)=1
@@ -114,18 +115,22 @@ command.compile.$(file.patterns.example)=$(name.example.xmlcheck) $(FileNameExt)
command.build.$(file.patterns.context)=$(name.context.texexec) --pdf $(FileNameExt)
command.build.$(file.patterns.metafun)=$(name.context.texexec) --pdf --mptex $(FileNameExt)
command.build.$(file.patterns.example)=$(name.context.texexec) --pdf --xml $(FileNameExt)
+command.build.*.fo=$(name.context.texexec) --pdf --autopdf --xml --use=fo,foe $(FileNameExt)
command.build.subsystem.$(file.patterns.context)=1
command.build.subsystem.$(file.patterns.metafun)=1
command.build.subsystem.$(file.patterns.example)=1
+command.build.subsystem.*.fo=1
command.go.$(file.patterns.context)=$(FileName).pdf
command.go.$(file.patterns.metafun)=$(FileName).pdf
command.go.$(file.patterns.example)=$(FileName).pdf
+command.go.*.fo=$(FileName).pdf
command.go.subsystem.$(file.patterns.context)=2
command.go.subsystem.$(file.patterns.metafun)=2
command.go.subsystem.$(file.patterns.example)=2
+command.go.subsystem.*.fo=2
# 0 : syntax checking
diff --git a/metapost/context/base/mp-tool.mp b/metapost/context/base/mp-tool.mp
index d78ee43ea..3064cf239 100644
--- a/metapost/context/base/mp-tool.mp
+++ b/metapost/context/base/mp-tool.mp
@@ -1499,17 +1499,21 @@ enddef ;
% nice: currentpicture := inverted currentpicture ;
primarydef p uncolored c =
- image
- (for i within p :
- addto currentpicture
- if stroked i or filled i :
- if filled i : contour else : doublepath fi pathpart i
- dashed dashpart i withpen penpart i
- else :
- also i
- fi
- withcolor c-(redpart i, greenpart i, bluepart i) ;
- endfor ; )
+ if color p :
+ c - p
+ else :
+ image
+ (for i within p :
+ addto currentpicture
+ if stroked i or filled i :
+ if filled i : contour else : doublepath fi pathpart i
+ dashed dashpart i withpen penpart i
+ else :
+ also i
+ fi
+ withcolor c-(redpart i, greenpart i, bluepart i) ;
+ endfor ; )
+ fi
enddef ;
vardef inverted primary p =
@@ -1517,34 +1521,67 @@ vardef inverted primary p =
enddef ;
primarydef p softened c =
- image
- (save cc ; color cc ; cc := tripled(c) ;
- for i within p :
- addto currentpicture
- if stroked i or filled i :
- if filled i : contour else : doublepath fi pathpart i
- dashed dashpart i withpen penpart i
- else :
- also i
- fi
- withcolor (redpart cc * redpart i,
- greenpart cc * greenpart i,
- bluepart cc * bluepart i) ;
- endfor ;)
+ if color p :
+ tripled(c) * p
+ else :
+ image
+ (save cc ; color cc ; cc := tripled(c) ;
+ for i within p :
+ addto currentpicture
+ if stroked i or filled i :
+ if filled i : contour else : doublepath fi pathpart i
+ dashed dashpart i withpen penpart i
+ else :
+ also i
+ fi
+ withcolor (redpart cc * redpart i,
+ greenpart cc * greenpart i,
+ bluepart cc * bluepart i) ;
+ endfor ;)
+ fi
+enddef ;
+
+primarydef p softened c =
+ begingroup
+ save cc ; color cc ; cc := tripled(c) ;
+ if color p :
+ (redpart cc * redpart p,
+ greenpart cc * greenpart p,
+ bluepart cc * bluepart p)
+ else :
+ image
+ (for i within p :
+ addto currentpicture
+ if stroked i or filled i :
+ if filled i : contour else : doublepath fi pathpart i
+ dashed dashpart i withpen penpart i
+ else :
+ also i
+ fi
+ withcolor (redpart cc * redpart i,
+ greenpart cc * greenpart i,
+ bluepart cc * bluepart i) ;
+ endfor ;)
+ fi
+ endgroup
enddef ;
vardef grayed primary p =
- image
- (for i within p :
- addto currentpicture
- if stroked i or filled i :
- if filled i : contour else : doublepath fi pathpart i
- dashed dashpart i withpen penpart i
- else :
- also i
- fi
- withcolor tripled(.30redpart i+.59greenpart i+.11bluepart i) ;
- endfor ; )
+ if color p :
+ tripled(.30redpart p+.59greenpart p+.11bluepart p)
+ else :
+ image
+ (for i within p :
+ addto currentpicture
+ if stroked i or filled i :
+ if filled i : contour else : doublepath fi pathpart i
+ dashed dashpart i withpen penpart i
+ else :
+ also i
+ fi
+ withcolor tripled(.30redpart i+.59greenpart i+.11bluepart i) ;
+ endfor ; )
+ fi
enddef ;
% yes or no: "text" infont "cmr12" at 24pt ;
diff --git a/scripts/context/perl/mptopdf.pl b/scripts/context/perl/mptopdf.pl
index 337869519..026d8d80b 100644
--- a/scripts/context/perl/mptopdf.pl
+++ b/scripts/context/perl/mptopdf.pl
@@ -1,7 +1,7 @@
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q'
if 0;
-# MikTeX users can set environment variable TEXSYSTEM to "miktex".
+# MikTeX users can set environment variable TEXSYSTEM to "miktex".
#D \module
#D [ file=mptopdf.pl,
@@ -17,24 +17,24 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $
#C therefore copyrighted by \PRAGMA. See licen-en.pdf for
#C details.
-# use File::Copy ; # not in every perl
+# use File::Copy ; # not in every perl
use Config ;
use Getopt::Long ;
-use strict ;
+use strict ;
$Getopt::Long::passthrough = 1 ; # no error message
$Getopt::Long::autoabbrev = 1 ; # partial switch accepted
-my $Help = my $Latex = my $RawMP = 0 ;
-my $PassOn = '' ;
+my $Help = my $Latex = my $RawMP = 0 ;
+my $PassOn = '' ;
&GetOptions
( "help" => \$Help ,
- "rawmp" => \$RawMP,
+ "rawmp" => \$RawMP,
"passon" => \$PassOn,
"latex" => \$Latex ) ;
-
+
my $program = "MPtoPDF 1.2" ;
my $pattern = $ARGV[0] ;
my $done = 0 ;
@@ -44,41 +44,41 @@ my $latexswitch = " --tex=latex --format=latex " ;
## $dosish = ($Config{'osname'} =~ /dos|mswin/i) ;
my $dosish = ($Config{'osname'} =~ /^(ms)?dos|^os\/2|^(ms|cyg)win/i) ;
-my $miktex = ($ENV{"TEXSYSTEM"} =~ /miktex/io);
+my $miktex = ($ENV{"TEXSYSTEM"} =~ /miktex/io);
-my @files ;
-my $command = my $mpbin = '' ;
+my @files ;
+my $command = my $mpbin = '' ;
-sub CopyFile # agressive copy, works for open files like in gs
- { my ($From,$To) = @_ ;
- return unless open(INP,"<$From") ; binmode INP ;
- return unless open(OUT,">$To") ; binmode OUT ;
- while (<INP>) { print OUT $_ }
- close (INP) ;
+sub CopyFile # agressive copy, works for open files like in gs
+ { my ($From,$To) = @_ ;
+ return unless open(INP,"<$From") ; binmode INP ;
+ return unless open(OUT,">$To") ; binmode OUT ;
+ while (<INP>) { print OUT $_ }
+ close (INP) ;
close (OUT) }
if (($pattern eq '')||($Help))
{ print "\n$program : provide MP output file (or pattern)\n" ;
exit }
-elsif ($pattern =~ /\.mp$/io)
- { shift @ARGV ; my $rest = join(" ", @ARGV) ;
+elsif ($pattern =~ /\.mp$/io)
+ { shift @ARGV ; my $rest = join(" ", @ARGV) ;
if (open(INP,$pattern))
- { while (<INP>)
- { if (/(documentstyle|documentclass|begin\{document\})/io)
- { $Latex = 1 ; last } }
- close (INP) }
- if ($Latex)
- { $rest .= " $latexswitch" }
+ { while (<INP>)
+ { if (/(documentstyle|documentclass|begin\{document\})/io)
+ { $Latex = 1 ; last } }
+ close (INP) }
+ if ($Latex)
+ { $rest .= " $latexswitch" }
if ($RawMP)
- { $mpbin = 'mpost' }
+ { $mpbin = 'mpost' }
else
- { $mpbin = 'texexec --mptex $PassOn' }
+ { $mpbin = 'texexec --mptex $PassOn' }
my $error = system ("$mpbin $rest $pattern") ;
- if ($error)
- { print "\n$program : error while processing mp file\n" ; exit }
- else
- { $pattern =~ s/\.mp$//io ;
- @files = glob "$pattern.*" } }
+ if ($error)
+ { print "\n$program : error while processing mp file\n" ; exit }
+ else
+ { $pattern =~ s/\.mp$//io ;
+ @files = glob "$pattern.*" } }
elsif (-e $pattern)
{ @files = ($pattern) }
elsif ($pattern =~ /.\../o)
@@ -90,15 +90,15 @@ else
foreach my $file (@files)
{ $_ = $file ;
if (s/\.(\d+|mps)$// && -e $file)
- { if ($miktex)
- { if ($dosish)
- { $command = "pdfetex &mptopdf" }
+ { if ($miktex)
+ { if ($dosish)
+ { $command = "pdfetex &mptopdf" }
else
{ $command = "pdfetex \\&mptopdf" } }
- else
-# { $command = "pdfetex -progname=pdfetex -efmt=mptopdf" }
- { $command = "pdfetex -progname=context -efmt=mptopdf" }
- if ($dosish)
+ else
+# { $command = "pdfetex -progname=pdfetex -efmt=mptopdf" }
+ { $command = "pdfetex -progname=context \&mptopdf" }
+ if ($dosish)
{ system ("$command \\relax $file") }
else
{ system ("$command \\\\relax $file") }
@@ -108,8 +108,8 @@ foreach my $file (@files)
$report .= " $_-$1.pdf" ;
++$done } }
-if ($report eq '')
- { $report = '*' }
+if ($report eq '')
+ { $report = '*' }
if ($done)
{ print "\n$program : $pattern is converted to$report\n" }
diff --git a/scripts/context/perl/texexec.pl b/scripts/context/perl/texexec.pl
index a68135ded..eb1664357 100644
--- a/scripts/context/perl/texexec.pl
+++ b/scripts/context/perl/texexec.pl
@@ -182,7 +182,8 @@ my $AllPatterns = 0;
my $ForceXML = 0;
my $Random = 0;
my $Filters = '';
-my $NoMapFiles = 0;
+my $NoMapFiles = 0 ;
+my $Foxet = 0 ;
my $StartLine = 0 ;
my $StartColumn = 0 ;
@@ -283,6 +284,7 @@ my $MakeMpy = '';
"modefile=s" => \$ModeFile, # additional modes file
"globalfile" => \$GlobalFile,
"nomapfiles" => \$NoMapFiles,
+ "foxet" => \$Foxet,
#### exxperiment
"startline=s" => \$StartLine,
"startcolumn=s" => \$StartColumn,
@@ -290,6 +292,12 @@ my $MakeMpy = '';
"endcolumn=s" => \$EndColumn
); # don't check name
+if ($Foxet) {
+ $ProducePdfT = 1 ;
+ $ForceXML = 1 ;
+ $Modules = "foxet" ;
+}
+
# a set file (like blabla.bat) can set paths now
if ( $SetFile ne "" ) { load_set_file( $SetFile, $Verbose ); $SetFile = "" }
@@ -713,10 +721,10 @@ if ( $MpFormatFlag eq "" ) {
#~ if ( $TeXFormatFlag eq "" ) { $TeXFormatFlag = "&" }
#~ if ( $MpFormatFlag eq "" ) { $MpFormatFlag = "&" }
-#~ unless ( $dosish && !$escapeshell ) {
- #~ if ( $TeXFormatFlag eq "&" ) { $TeXFormatFlag = "\\&" }
- #~ if ( $MpFormatFlag eq "&" ) { $MpFormatFlag = "\\&" }
-#~ }
+unless ( $dosish && !$escapeshell ) {
+ if ( $TeXFormatFlag eq "&" ) { $TeXFormatFlag = "\\&" }
+ if ( $MpFormatFlag eq "&" ) { $MpFormatFlag = "\\&" }
+}
if ($TeXProgram) { $TeXExecutable = $TeXProgram }
@@ -1527,7 +1535,7 @@ my $DummyFile = 0;
sub isXMLfile {
my $Name = shift;
- if ( ($ForceXML) || ( $Name =~ /\.(xml|fo)$/io ) ) { return 1 }
+ if ( ($ForceXML) || ( $Name =~ /\.(xml|fo|fox)$/io ) ) { return 1 }
else {
open( XML, $Name );
my $str = <XML>;
@@ -1549,7 +1557,7 @@ sub RunConTeXtFile {
system("pdfclose --all") unless $ok ;
}
if ( -e "$JobName.$JobSuffix" ) {
- $DummyFile = ( ($ForceXML) || ( $JobSuffix =~ /(xml|fo)/io ) );
+ $DummyFile = ( ($ForceXML) || ( $JobSuffix =~ /(xml|fo|fox)/io ) );
}
# to be considered :
# { $DummyFile = isXMLfile("$JobName.$JobSuffix") }
@@ -1561,7 +1569,7 @@ sub RunConTeXtFile {
}
if ($DummyFile) {
open( TMP, ">$JobName.run" );
- if ( ( $JobSuffix =~ /(xml|fo)/io ) || $ForceXML ) {
+ if ( ( $JobSuffix =~ /(xml|fo|fox)/io ) || $ForceXML ) {
if ( $Filters ne "" ) {
print " using xml filters : $Filters\n";
}
diff --git a/scripts/context/ruby/texmfstart.rb b/scripts/context/ruby/texmfstart.rb
index c1577679c..8d5175325 100644
--- a/scripts/context/ruby/texmfstart.rb
+++ b/scripts/context/ruby/texmfstart.rb
@@ -286,7 +286,7 @@ def find(filename,program)
if suffix =~ /(#{$scriptlist})/ then
begin
report("using 'kpsewhich' to locate '#{filename}' in suffix space '#{suffix}' (1)")
- fullname = `kpsewhich -progname=#{program} -format=scripts #{filename}.#{suffix}`.chomp
+ fullname = `kpsewhich -progname=#{program} -format=texmfscripts #{filename}.#{suffix}`.chomp
rescue
report("kpsewhich cannot locate '#{filename}' in suffix space '#{suffix}' (1)")
fullname = nil
diff --git a/tex/context/base/colo-hex.tex b/tex/context/base/colo-hex.tex
index 76423ada0..25f4d22e0 100644
--- a/tex/context/base/colo-hex.tex
+++ b/tex/context/base/colo-hex.tex
@@ -11,6 +11,12 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+\ifx\dodododefinecolor\undefined
+ \beginTEX \endinput \endTEX
+\else
+ \endinput
+\fi
+
\writestatus{loading}{Context Color Macros / hexadecimal}
% \edef\testcolor{\string#FFC0C0}
@@ -41,23 +47,25 @@
\def\hexcolorspec #1{\expandafter\dohexcolorspec #1\empty\empty\empty\empty\relax}
\def\hexcolorpattern#1{\expandafter\dohexcolorpattern#1\empty\empty\empty\empty\relax}
-\def\hexcolorcomponent#1%
- {\ifnum"#1=\zerocount0\else\ifnum"#1=\plusone1\else
- \expandafter\withoutpt\the\dimexpr("#1\hexcolorfraction)%
+\ifx\dohexstringtonumber\undefined \def\dohexstringtonumber{"} \fi
+
+\def\hexcolorcomponent#1#2%
+ {\ifnum\dohexstringtonumber#1#2=\zerocount0\else\ifnum\dohexstringtonumber#1#2=\plusone1\else
+ \expandafter\withoutpt\the\dimexpr(\dohexstringtonumber#1#2\hexcolorfraction)%
\fi\fi}
\def\dohexcolorspec#1#2#3#4#5#6#7#8\relax
{\ifx#4\empty
- s=\hexcolorcomponent{#2#3}%
+ s=\hexcolorcomponent#2#3%
\else
- r=\hexcolorcomponent{#2#3},g=\hexcolorcomponent{#4#5},b=\hexcolorcomponent{#6#7}%
+ r=\hexcolorcomponent#2#3,g=\hexcolorcomponent#4#5,b=\hexcolorcomponent#6#7%
\fi}
\def\dohexcolorpattern#1#2#3#4#5#6#7#8\relax
{0\ifx#4\empty
- S:\hexcolorcomponent{#2#3}%
+ S:\hexcolorcomponent#2#3%
\else
- R:\hexcolorcomponent{#2#3}:\hexcolorcomponent{#4#5}:\hexcolorcomponent{#6#7}%
+ R:\hexcolorcomponent#2#3:\hexcolorcomponent#4#5:\hexcolorcomponent#6#7%
\fi:0:0}
\def\doifhexcolorelse#1%
@@ -70,15 +78,19 @@
\expandafter\secondoftwoarguments
\fi}
+\def\docheckhexcolor#1%
+ {\doifhexcolorelse{#1}{\doifundefined{#1}{\setxvalue{\??cr#1}{\hexcolorpattern{#1}}}}\donothing}
+
\def\checkhexcolor[#1]%
- {\doifhexcolorelse{#1}{\doifundefined{#1}%
- {\expanded{\setxvalue{\??cr#1}{\hexcolorpattern#1}}}}\donothing}
+ {\expanded{\docheckhexcolor{#1}}}
+
+\def\colorHpattern{\@EA\hexcolorpattern\@EA{\@EA*\@@cl@@h}} % * == dummy placeholder
\let\dodododefinecolor\dododefinecolor % we will overload this one
\def\dododefinecolor#1#2#3#4[#5][#6]%
{\doifhexcolorelse{#6}
- {\setxvalue{\??cr#5}{\hexcolorpattern#6}}
+ {\setxvalue{\??cr#5}{\hexcolorpattern{#6}}}
{\dodododefinecolor#1#2#3#4[#5][#6]}}
\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/colo-ini.tex b/tex/context/base/colo-ini.tex
index e4b63d21c..60be87005 100644
--- a/tex/context/base/colo-ini.tex
+++ b/tex/context/base/colo-ini.tex
@@ -236,7 +236,8 @@
{\let\@@cl@@r\@@cl@@z\let\@@cl@@g\@@cl@@z\let\@@cl@@b\@@cl@@z
\let\@@cl@@c\@@cl@@z\let\@@cl@@m\@@cl@@z\let\@@cl@@y\@@cl@@z
\let\@@cl@@k\@@cl@@z\let\@@cl@@s\@@cl@@z\let\@@cl@@p\@@cl@@o
- \let\@@cl@@t\@@cl@@z\let\@@cl@@a\@@cl@@z\let\@@cl@@n\empty}
+ \let\@@cl@@t\@@cl@@z\let\@@cl@@a\@@cl@@z
+ \let\@@cl@@h\empty \let\@@cl@@n\empty}
\def\@@cl@@A{\@@cl@@a} % a hook for symbolic conversion, see below
@@ -306,18 +307,22 @@
% \unexpanded\setvalue{#1}{\color[#1]}} % \unexpanded toegevoegd
\def\dododefinecolor#1#2#3#4[#5][#6]% #2==set(g)value #3==set[e|x]value
- {#1\addtocommalist{#5}\colorlist
+ {#1\addtocommalist{#5}\colorlist % optional
\doifassignmentelse{#6}
{\@@resetcolorparameters
\getparameters[\??cl @@][#6]%
- \doifelse{\@@cl@@r\@@cl@@g\@@cl@@b}{\@@cl@@z\@@cl@@z\@@cl@@z}
- {\doifelse{\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k}{\@@cl@@z\@@cl@@z\@@cl@@z\@@cl@@z}
- {\doifelse\@@cl@@s\@@cl@@z
- {\showmessage\m!colors8{{[#6]},#5}%
- #3{\??cr#5}{\colorZpattern}}
- {#3{\??cr#5}{\colorSpattern}}}
- {#3{\??cr#5}{\colorCpattern}}}
- {#3{\??cr#5}{\colorRpattern}}}
+ \ifx\@@cl@@h\empty
+ \doifelse{\@@cl@@r\@@cl@@g\@@cl@@b}{\@@cl@@z\@@cl@@z\@@cl@@z}
+ {\doifelse{\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k}{\@@cl@@z\@@cl@@z\@@cl@@z\@@cl@@z}
+ {\doifelse\@@cl@@s\@@cl@@z
+ {\showmessage\m!colors8{{[#6]},#5}%
+ #3{\??cr#5}{\colorZpattern}}
+ {#3{\??cr#5}{\colorSpattern}}}
+ {#3{\??cr#5}{\colorCpattern}}}
+ {#3{\??cr#5}{\colorRpattern}}%
+ \else
+ \setxvalue{\??cr#5}{\colorHpattern}%
+ \fi}
{\doifdefinedelse{\??cr#6}
{\doifelse{#5}{#6}
{% this way we can freeze \definecolor[somecolor][somecolor]
@@ -330,6 +335,11 @@
\unexpanded#2{#5}{\switchtocolor[#5]}% \unexpanded toegevoegd
\fi}
+%D Hex color support is not enabled by default. You need to say \setupcolor
+%D [hex] to get this working.
+
+\ifx\colorHpattern\undefined \let\colorHpattern\colorZpattern \fi
+
%D New and experimental.
\let\allspotcolors\empty
@@ -2341,6 +2351,9 @@
{\scaledMPcolor{#2}{#1}}
\def\doMPblack#1\end#2\end
+ {\unknownMPcolor}
+
+\def\unknownMPcolor
{(0,0,0)}
%D \macros
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex
index 40ae9efab..c156137f9 100644
--- a/tex/context/base/cont-new.tex
+++ b/tex/context/base/cont-new.tex
@@ -21,8 +21,197 @@
\writestatus{\m!systems}{beware: some patches loaded from cont-new.tex!}
+\def\doifelsefontsynonym#1%
+ {\ifcsname\??ff\fontclass#1\endcsname
+ \expandafter\firstoftwoarguments
+ \else
+ \expandafter\secondoftwoarguments
+ \fi}
+
+\def\expandfontsynonym#1#2% #2 := onelevelexpansion(#1)
+ {\ifcsname\??ff\fontclass#2\endcsname
+ \expandafter\def\expandafter#1\expandafter{\csname\??ff\fontclass#2\endcsname}%
+ \fi}
+
+\long\def\startprocesscommalist[#1]#2\stopprocesscommalist
+ {\long\def\currentcommalistcommand##1{\def\currentcommalistitem{##1}#2}%
+ \processcommalist[#1]\currentcommalistcommand}
+
+\long\def\startexpanded#1\stopexpanded % beware, this time no \noexpand before #1
+ {\long\xdef\@@expanded{#1}\@@expanded}
+
\tracefonthandlingtrue
+% \def\resetXMLelement[#1]% handy in case only singular
+% {\@EA\let\csname\@@XMLelement:#1\endcsname \donothing
+% \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
+% \@EA\let\csname\@@XMLelement:#1/\endcsname\donothing}
+%
+% is the same as:
+
+\def\resetXMLelement[#1]{\dododefineXMLprocess{#1}}
+
+\let\dorecalculatelayout\recalculatelayout
+
+\def\recalculatelayout
+ {\doifsomething{\layoutparameter\c!pagina\layoutparameter\c!papier}
+ {\dododosetuppapersize[\layoutparameter\c!pagina][\layoutparameter\c!papier]}%
+ \dorecalculatelayout}
+
+\def\dodosetuppapersize[#1][#2]%
+ {\ifsecondargument
+ \dododosetuppapersize[#1][#2]%
+ \calculatehsizes
+ \calculatevsizes
+ \recalculatelogos
+ \recalculatebackgrounds
+ \recalculatelayout
+ \else\iffirstargument
+ \setuppapersize[#1][#2]%
+ \else\ifx\papersize\undefined\else
+ \restorepapersize
+ \fi\fi\fi}
+
+\def\dododosetuppapersize[#1][#2]%
+ {\xdef\restorepapersize
+ {\noexpand\setuppapersize[#1][#2]}%
+ \dostelpapierrichtingin{#1}\paperlandscape\paperrotation\paperreverse\papermirror
+ \dostelpapierrichtingin{#2}\printlandscape\printrotation\printreverse\printmirror
+ \def\docommando##1%
+ {\doifsomething{##1}{\doifdefined{\??pp##1\c!breedte}
+ {\global\papierbreedte\getvalue{\??pp##1\c!breedte}%
+ \global\papierhoogte\getvalue{\??pp##1\c!hoogte}%
+ \calculatepaperoffsets{##1}%
+ \xdef\papersize{##1}}}}%
+ \processcommacommand[#1]\docommando
+ \doifdefinedelse{\??pp#1\c!schaal}
+ {\edef\paperscale{\getvalue{\??pp#1\c!schaal}}}
+ {\edef\paperscale{1}}%
+ \def\docommando##1%
+ {\doifsomething{##1}{\doifdefined{\??pp##1\c!breedte}
+ {\global\printpapierbreedte\getvalue{\??pp##1\c!breedte}%
+ \global\printpapierhoogte\getvalue{\??pp##1\c!hoogte}%
+ \xdef\printpapersize{##1}}}}%
+ \processcommacommand[#2]\docommando
+ \global\setdimentoatleast\papierbreedte \onepoint
+ \global\setdimentoatleast\papierhoogte \onepoint
+ \global\setdimentoatleast\printpapierbreedte\onepoint
+ \global\setdimentoatleast\printpapierhoogte \onepoint
+ \ifcase\paperlandscape\else
+ \doglobal\swapdimens\papierbreedte\papierhoogte
+ \fi
+ \ifcase\printlandscape\else
+ \doglobal\swapdimens\printpapierbreedte\printpapierhoogte
+ \fi
+ % this check can be confusing, so we've added the possibility
+ % to bypass this test: \setuppapersize[option=fit]
+ \doif\@@ppoptie\v!max % \v!fit is
+ {\bgroup
+ % we need to pre-swap else we get the wrong paper size
+ \doifinset\paperrotation{90,270}{\swapdimens\papierbreedte\papierhoogte}%
+ \doifinset\printrotation{90,270}{\swapdimens\printpapierbreedte\printpapierhoogte}%
+ \ifdim\papierhoogte>\printpapierhoogte
+ \global\printpapierhoogte\papierhoogte
+ \writestatus\m!systems{print height forced to paper height}%
+ \fi
+ \ifdim\papierbreedte>\printpapierbreedte
+ \global\printpapierbreedte\papierbreedte
+ \writestatus\m!systems{print width forced to paper width}%
+ \fi
+ \egroup}}
+
+\setuplayout
+ [\c!papier=,
+ \c!pagina=]
+
+\def\parseTR[#1][#2]% [#2] is dummy that kills spaces / no #3 argument
+ {\def\currentcol{0}\increment\maximumrow
+ \let\currentcolpos\currentcol
+ \let\eTR\relax
+ \setupTABLE[\v!rij][\maximumrow][#1]}
+
+\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,\c!n=\currentcol,#1]%
+ % goto first cell % NEW, n=cellnumber
+ \increment\currentcolpos
+ \doifvaluesomething{\@@tbl\c!n}
+ {\ifnum\getvalue{\@@tbl\c!n}=\currentcol\else
+ \scratchcounter\getvalue{\@@tbl\c!n}%
+ \advance\scratchcounter-\currentcol
+ \advance\scratchcounter\plusone
+ \expanded{\parseTD[][\c!nx=\the\scratchcounter]}\eTD
+ \getparameters[\@@tbl][\c!ny=\tblnr,\c!nx=\tblnc,nc=1,nr=1,\c!n=\currentcol,#1]%
+ \fi}%
+ \doloop
+ {\increment\currentcol
+ \doifnottbltag\maximumrow\currentcol\exitloop}%
+ % fill r*c cells and set span
+ \let\row\maximumrow
+ \let\col\currentcol
+ \dorecurse\tblny
+ {\let\col\currentcol
+ \settblcol\row\col\tblnx
+ \ifnum\tblnx>\maximumrowspan\relax
+ \let\maximumrowspan\tblnx
+ \fi
+ \dorecurse\tblnx
+ {\settbltag\row\col\tblnone
+ \increment\col}%
+ \increment\row}%
+ % check max column
+ \decrement\col
+ \ifnum\col>\maximumcol\relax
+ \let\maximumcol\col
+ \fi
+ % set values
+ \settbltag\maximumrow\currentcol\tblcell
+ \settblcol\maximumrow\currentcol\tblnx
+ \settblrow\maximumrow\currentcol\tblny
+ % save text
+ \edef\celltag{{\maximumrow}{\currentcol}}%
+ \@EA\settbltxt\@EA\maximumrow\@EA\currentcol\@EA
+ {\@EA\handleTBLcell\celltag[#1]{#3}}}
+
+\newif\ifpercentdimendone
+
+\bgroup % usage: \setpercentdimen\somedimen{% or dimen} todo: pct
+\catcode124=\@@comment
+\catcode 37=\@@active
+\gdef\setpercentdimen#1#2|
+ {\xdef\@@expanded{#2}|
+ \ifx\@@expanded\empty\else
+ \bgroup
+ \global\percentdimendonefalse
+ \def\%{\dimexpr(#1/100)\global\percentdimendonetrue\ignorespaces}| scantokens add's a space
+ \catcode`%=\@@active
+ \let%\%|
+ \global\globalscratchdimen\scantokens\@EA{\@@expanded}| i'm lazy and use etex
+ \egroup
+ #1\globalscratchdimen
+ \fi}
+\egroup
+
+\bgroup
+
+\obeylines
+
+\gdef\collapsedspace#1%
+ {\ifx#1^^M%
+ \expandafter\collapsedspace
+ \else
+ \space
+ \expandafter#1%
+ \fi}
+
+\gdef\collapsespaces%
+ {\prependtoksonce\relax\to\everyeof%
+ \ignorelines%
+ \ignoretabs%
+ \let\obeyedspace\collapsedspace%
+ \obeyspaces}
+
+\egroup
+
\def\complexdozieregister[#1]#2#3%
{\begingroup
\thisisnextinternal\s!ind
@@ -54,6 +243,21 @@
{\leftofreference#1\rightofreference}{#2#3}[#4]%
\fi}
+\dostepwiserecurse{0}{9}{1}{\setevalue{@@uc@@\recurselevel}{\recurselevel}}
+
+\setvalue{@@uc@@a}{A} \setvalue{@@uc@@A}{A}
+\setvalue{@@uc@@b}{B} \setvalue{@@uc@@B}{B}
+\setvalue{@@uc@@c}{C} \setvalue{@@uc@@C}{C}
+\setvalue{@@uc@@d}{D} \setvalue{@@uc@@D}{D}
+\setvalue{@@uc@@e}{E} \setvalue{@@uc@@E}{E}
+\setvalue{@@uc@@f}{F} \setvalue{@@uc@@F}{F}
+
+\def\hexstringtonumber#1% {FF}
+ {\dohexstringtonumber#1}
+
+\def\dohexstringtonumber#1#2% FF
+ {"\csname @@uc@@#1\endcsname\csname @@uc@@#2\endcsname}
+
% \def\doshowpardata#1#2{\hbox{\string#1: \the#2}\endgraf}
%
% \def\showpardata
@@ -1541,6 +1745,7 @@
\newtoks\everyfirstparagraphintro
\newtoks\everynextparagraphintro
+\newtoks\@@everyparagraphtoks
\chardef\everyparagraphintro\zerocount
@@ -1561,24 +1766,43 @@
\doglobal\appendtoks#2\to\everyfirstparagraphintro
\doglobal\appendtoks#2\to\everynextparagraphintro]}
+% \def\doinsertparagraphintro
+% {\ifcase\everyparagraphintro\relax
+% % no data
+% \@@everyparagraphtoks\emptytoks
+% \or
+% % first data
+% \global\chardef\everyparagraphintro\plustwo
+% \@@everyparagraphtoks\everyfirstparagraphintro
+% \global\everyfirstparagraphintro\emptytoks
+% \or
+% % next data
+% \@@everyparagraphtoks\everynextparagraphintro
+% \fi
+% \the\@@everyparagraphtoks}
+
\def\doinsertparagraphintro
- {\ifcase\everyparagraphintro\relax
+ {%\begingroup
+ %\everypar\emptytoks
+ \ifcase\everyparagraphintro\relax
% no data
+ \@@everyparagraphtoks\emptytoks
\or
% first data
\global\chardef\everyparagraphintro\plustwo
- \scratchtoks\everyfirstparagraphintro
+ \@@everyparagraphtoks\everyfirstparagraphintro
\global\everyfirstparagraphintro\emptytoks
\or
% next data
- \scratchtoks\everynextparagraphintro
+ \@@everyparagraphtoks\everynextparagraphintro
\fi
- \the\scratchtoks}
+ \the\@@everyparagraphtoks
+ }%\endgroup}
\def\insertparagraphintro
{\ifcase\everyparagraphintro\else\@EA\doinsertparagraphintro\fi}
-\appendtoks\insertparagraphintro\to\everypar
+\appendtoksonce\insertparagraphintro\to\everypar
%D \starttypen
%D \setupparagraphintro[first][\hbox to 3.5em{\tt FIRST \hss}]
diff --git a/tex/context/base/core-box.tex b/tex/context/base/core-box.tex
index 361b467a1..9ee21e7a6 100644
--- a/tex/context/base/core-box.tex
+++ b/tex/context/base/core-box.tex
@@ -723,7 +723,7 @@
{\dodoubleempty\dooffsetbox[]}
% left/right/top/bottomoffset -> dimensions change
-% x/y -> dimensions don't change
+% x/y | method=fixed -> dimensions don't change
\def\dooffsetbox[#1][#2]%
{\bgroup
@@ -739,12 +739,37 @@
\c!rechteroffset=\zeropoint,
\c!bovenoffset=\zeropoint,
\c!onderoffset=\zeropoint,
+ \c!methode=,
#2]%
\donefalse
- \ifdim\@@oxlinkeroffset >\zeropoint\donetrue\fi
- \ifdim\@@oxrechteroffset>\zeropoint\donetrue\fi
- \ifdim\@@oxbovenoffset >\zeropoint\donetrue\fi
- \ifdim\@@oxonderoffset >\zeropoint\donetrue\fi
+ \ifdim\@@oxlinkeroffset =\zeropoint\else\donetrue\fi
+ \ifdim\@@oxrechteroffset=\zeropoint\else\donetrue\fi
+ \ifdim\@@oxbovenoffset =\zeropoint\else\donetrue\fi
+ \ifdim\@@oxonderoffset =\zeropoint\else\donetrue\fi
+ \ifdone
+ \doif\@@oxmethode\v!vast % new
+ {\ifdim\@@oxlinkeroffset=\zeropoint
+ \ifdim\@@oxrechteroffset=\zeropoint \else
+ \scratchdimen-\@@oxrechteroffset
+ \edef\@@oxx{\the\scratchdimen}%
+ \let\@@oxrechteroffset\zeropoint
+ \fi
+ \else
+ \let\@@oxx\@@oxlinkeroffset
+ \let\@@oxlinkeroffset\zeropoint
+ \fi
+ \ifdim\@@oxbovenoffset=\zeropoint
+ \ifdim\@@oxonderoffset=\zeropoint \else
+ \scratchdimen-\@@oxonderoffset
+ \edef\@@oxy{\the\scratchdimen}%
+ \let\@@oxonderoffset\zeropoint
+ \fi
+ \else
+ \let\@@oxy\@@oxbovenoffset
+ \let\@@oxbovenoffset\zeropoint
+ \fi
+ \donefalse}%
+ \fi
\ifdone
\setbox\nextbox\vbox
{\forgetall\offinterlineskip
diff --git a/tex/context/base/core-con.tex b/tex/context/base/core-con.tex
index f5da17cfe..f034a3112 100644
--- a/tex/context/base/core-con.tex
+++ b/tex/context/base/core-con.tex
@@ -828,6 +828,8 @@
\defineconversion [N] [\Numbers]
\defineconversion [m] [\mediaeval]
+\defineconversion [i] [\romannumerals]
+\defineconversion [I] [\Romannumerals]
\defineconversion [r] [\romannumerals]
\defineconversion [R] [\Romannumerals]
\defineconversion [KR] [\kap\romannumerals]
@@ -837,6 +839,7 @@
\defineconversion [G] [\Greeknumerals]
\defineconversion [o] [\oldstylenumerals]
+\defineconversion [O] [\oldstylenumerals]
\defineconversion [or] [\oldstyleromannumerals]
\defineconversion [\v!letter] [\character]
diff --git a/tex/context/base/core-fig.tex b/tex/context/base/core-fig.tex
index 628200837..37b22bd40 100644
--- a/tex/context/base/core-fig.tex
+++ b/tex/context/base/core-fig.tex
@@ -2090,6 +2090,24 @@
\externalfigure[\bufferprefix typeset-\noftypesetbuffers.pdf][#2]%
\egroup}
+% for me only (manuals and sucn)
+
+\definesystemvariable{tz}
+
+\def\definetypesetting{\dotripleempty\dodefinetypesetting}
+\def\typesetfile {\dotripleempty\dotypesetfile}
+
+\def\dodefinetypesetting[#1][#2][#3]%
+ {\doifsomething{#1}{\setvalue{\??tz#1}{\dodotypesetfile{#2}{#3}}}}
+
+\def\dotypesetfile[#1][#2][#3]%
+ {\executeifdefined{\??tz#1}\gobbletwoarguments{#2}{#3}}
+
+\def\dodotypesetfile#1#2#3#4% args settings file settings
+ {\doifmode{*\v!eerste}{\executesystemcommand{texmfstart texexec.pl --batch --pdf #1 #3}}%
+ \doglobal\beforesplitstring#3\at.\to\typesetfilename
+ \externalfigure[\typesetfilename.pdf][#2,#4]}
+
\appendtoks \setupexternalfigures[\c!optie=\v!leeg] \to \everyfastmode
\appendtoks \runMPgraphicsfalse \to \everyfastmode
\appendtoks \insertMPgraphicsfalse \to \everyfastmode
diff --git a/tex/context/base/core-fnt.tex b/tex/context/base/core-fnt.tex
index 1187774fe..95d2906c3 100644
--- a/tex/context/base/core-fnt.tex
+++ b/tex/context/base/core-fnt.tex
@@ -560,6 +560,18 @@
{\dodoubleargument\getparameters[\??on]}
%D \macros
+%D {shiftedword, shiftedwords}
+%D
+%D Used as \type {\shiftedwords {10pt} {some text}} this macro will
+%D move
+
+% \def\shiftedword#1% #2%
+% {\raise#1\hbox} % {#2}} % officially: {\ifdim#1>\zeropoint\raise\else\lower\fi#1\hbox{#2}}
+
+% \def\shiftedwords#1#2%
+% {\processisolatedwords{#2}{\shiftedword{#1}}}
+
+%D \macros
%D {low, high, lohi}
%D
%D Although \TEX\ is pretty well aware of super- and
diff --git a/tex/context/base/core-int.tex b/tex/context/base/core-int.tex
index 9f7252588..af6dcf792 100644
--- a/tex/context/base/core-int.tex
+++ b/tex/context/base/core-int.tex
@@ -1277,8 +1277,8 @@
\def\syncprefix{sync}
\def\syncmarker{syncmark}
-%\definieermarkering[\syncmarker]
-%\stelmarkeringin[\syncmarker][\c!expansie=\v!ja]
+%\definemarking[\syncmarker]
+%\setupmarking[\syncmarker][\c!expansie=\v!ja]
\newmark\syncmarker
diff --git a/tex/context/base/core-lnt.tex b/tex/context/base/core-lnt.tex
index b1082bd01..30eab8b24 100644
--- a/tex/context/base/core-lnt.tex
+++ b/tex/context/base/core-lnt.tex
@@ -29,13 +29,13 @@
\global\collectedlinenotes\emptytoks
\to \beforeeverylinenumbering
-% \def\handlelinenote#1#2%
+% \def\dohandlelinenote#1#2#3%
% {\bgroup
-% \expanded{\beforesplitstring#1}\at--\to\linenotelinenumber
+% \expanded{\beforesplitstring#2}\at--\to\linenotelinenumber
% \ifnum\linenotelinenumber=\linenumber\relax
-% % todo: \onlyfootnote{#1}{#2}% == configurable
-% \setupfootnotes[\c!nummercommando=\gobbleoneargument]%
-% \footnotetext{#1: #2}%
+% % todo: \onlyfootnote{#2}{#3}% == configurable
+% \setupnote[#1][\c!nummercommando=\gobbleoneargument]%
+% \setnotetext[#1]{#2: #3}%
% \fi
% \egroup}
@@ -44,25 +44,14 @@
\expanded{\beforesplitstring#2}\at--\to\linenotelinenumber
\ifnum\linenotelinenumber=\linenumber\relax
% todo: \onlyfootnote{#2}{#3}% == configurable
- \setupnote[#1][\c!nummercommando=\gobbleoneargument]%
- \setnotetext[#1]{#2: #3}%
+ % \setupnote[#1][\c!nummercommando=\gobbleoneargument]%
+ % \setnotetext[#1]{\rawreference\s!fnt{\s!fnt:f:\internalfootreference}{}#2: #3}%
+ \def\linenotelinenumber##1{#2}%
+ \setupnote[#1][\c!nummercommando=\linenotelinenumber]%
+ \setnote[#1]{#3}%
\fi
\egroup}
-% \def\tracedlinenote#1%
-% {\iftracelinenotes
-% \hbox to \zeropoint
-% {\forgetall
-% \localcolortrue
-% \hsize\zeropoint
-% \hss
-% \vbox to \strutheight{\llap{\red\infofont\setstrut\linenotecounter}\vss}%
-% {\blue\vl}%
-% \vbox to \strutheight{\rlap{\red\infofont\setstrut#1}\vss}%
-% \hss}%
-% \prewordbreak
-% \fi}
-
\def\dotracedlinenote#1%
{\iftracelinenotes
\hbox to \zeropoint
@@ -77,15 +66,6 @@
\prewordbreak
\fi}
-% \def\linenote#1%
-% {\doglobal\increment\linenotecounter
-% \doifreferencefoundelse{\??rr:\linenotecounter}%
-% {\doglobal\@EA\appendtoks\@EA\handlelinenote\@EA
-% {\currenttextreference}{#1}\to\collectedlinenotes}
-% \donothing
-% \tracedlinenote\empty
-% \expanded{\eenregel[\??rr:\linenotecounter]}}
-
\def\dolinenote#1#2%
{\doglobal\increment\linenotecounter
\doifreferencefoundelse{\??rr:\linenotecounter}%
@@ -95,14 +75,6 @@
\dotracedlinenote\empty
\expanded{\eenregel[\??rr:\linenotecounter]}}
-% \def\startlinenote[#1]#2%
-% {\doifreferencefoundelse{\??rr:#1}%
-% {\doglobal\@EA\appendtoks\@EA\handlelinenote\@EA
-% {\currenttextreference}{#2}\to\collectedlinenotes}
-% \donothing
-% \tracedlinenote{#1}%
-% \startregel[\??rr:#1]}
-
\def\dostartlinenote#1[#2]#3%
{\doifreferencefoundelse{\??rr:#2}%
{\expanded{\doglobal\noexpand\appendtoks\noexpand\dohandlelinenote
@@ -111,9 +83,6 @@
\dotracedlinenote{#2}%
\startregel[\??rr:#2]}
-% \def\stoplinenote[#1]%
-% {\stopregel[\??rr:#1]}
-
\def\dostoplinenote#1[#2]%
{\stopregel[\??rr:#2]}
diff --git a/tex/context/base/core-mar.tex b/tex/context/base/core-mar.tex
index 55aaf660e..1ec951f8a 100644
--- a/tex/context/base/core-mar.tex
+++ b/tex/context/base/core-mar.tex
@@ -22,20 +22,20 @@
%
% \fetchmark[naam][plaats]
-% nog expansie in hoofdmarkering
+% nog expansie in mainmarking
% ook nog reset koppelen aan sectie
-%\def\hoofdmarkering#1%
+%\def\mainmarking#1%
% {\csname\??mk#1\c!koppeling\endcsname}
%
%\def\fastresetmarker#1%
-% {\doifdefined{\??mk\hoofdmarkering{#1}}
-% {\expandafter\resetmark\csname\??mk\hoofdmarkering{#1}\endcsname}}
+% {\doifdefined{\??mk\maimarking{#1}}
+% {\expandafter\resetmark\csname\??mk\mainmarking{#1}\endcsname}}
\beginTEX
-\def\hoofdmarkering#1%
+\def\mainmarking#1%
{\@EA\ifx\csname\??mk#1\c!koppeling\endcsname\else
\csname\??mk#1\c!koppeling\endcsname
\fi}
@@ -49,7 +49,7 @@
\beginETEX \ifcsname
-\def\hoofdmarkering#1%
+\def\mainmarking#1%
{\ifcsname\??mk#1\c!koppeling\endcsname
\csname\??mk#1\c!koppeling\endcsname
\fi}
@@ -64,18 +64,18 @@
\def\fastresetmarkerlist[#1]%
{\expanded{\rawprocesscommalist[#1]}\fastresetmarker}
-\def\doresetmarkering[#1]%
+\def\doresetmarking[#1]%
{\processcommalist[#1]\fastresetmarker}
-\def\resetmarkering
- {\dosingleargument\doresetmarkering}
+\def\resetmarking
+ {\dosingleargument\doresetmarking}
-\def\dostelmarkeringin[#1][#2]%
+\def\dosetupmarking[#1][#2]%
{\def\docommando##1{\getparameters[\??mk##1][#2]}%
\processcommalist[#1]\docommando}
-\def\stelmarkeringin
- {\dodoubleargument\dostelmarkeringin}
+\def\setupmarking
+ {\dodoubleargument\dosetupmarking}
% betere protectie
@@ -84,30 +84,45 @@
\letvalue{\??mk\??mk\v!laatste}\getbotmark
\letvalue{\??mk\??mk\v!huidige}\getcurrentmark
-\def\dododefinieermarkering[#1][#2]%
- {\stelmarkeringin[#1]
+\ifx\decouplemarking\undefined \def\decouplemarking[#1]{} \fi
+
+\def\dododefinemarking[#1][#2]%
+ {\getparameters[\??mk#1]
[\c!expansie=\v!nee, % saves a macro
\c!scheider={ --- }, % watch the spaces
\c!limittext=\@@kolimittext,
\c!status=\v!start]%
- \ontkoppelmarkering[#1]% % no coupling with sections
+ \decouplemarking[#1]% % no coupling with sections
\setevalue{\??mk#1\c!koppeling}{#2}%
\expandafter\newmark\csname\??mk#2\endcsname
\showmessage\m!systems{13}{#1,[#2]}}
-\def\dodefinieermarkering[#1][#2]%
+\def\dodefinemarking[#1][#2]%
{\doifelsenothing{#2}
- {\dododefinieermarkering[#1][#1]}
- {\dododefinieermarkering[#1][#2]}}
+ {\dododefinemarking[#1][#1]}
+ {\dododefinemarking[#1][#2]}}
+
+\def\definemarking
+ {\dodoubleempty\dodefinemarking}
+
+\def\definerawmarking[#1]% global ! ! ! !
+ {\getgparameters[\??mk#1]
+ [\c!expansie=\v!nee, % saves a macro
+ \c!scheider={ --- }, % watch the spaces
+ \c!limittext=,
+ \c!status=\v!start]%
+ \setxvalue{\??mk#1\c!koppeling}{#1}%
+ \expandafter\newmark\csname\??mk#1\endcsname
+ \showmessage\m!systems{13}{#1}}
-\def\definieermarkering
- {\dodoubleempty\dodefinieermarkering}
+\let\nomarking\empty
-\let\geenmarkering\empty
+\def\doifmarkingelse#1%
+ {\doifdefinedelse{\??mk#1}}
% \def\fetchmark[#1][#2]% never \unexpanded
% {\@EA\@EA\csname\??mk\??mk#2\endcsname
-% \csname\??mk\hoofdmarkering{#1}\endcsname}
+% \csname\??mk\mainmarking{#1}\endcsname}
\beginTEX
@@ -145,11 +160,11 @@
{\fetchmark[#1][\v!vorige]\getvalue{\??mk#1\c!scheider}}}}%
\fetchtwomarks[#1]}
-\def\dohaalmarkering[#1][#2]%
+\def\dogetmarking[#1][#2]%
{\doifvalue{\??mk#1\c!status}\v!start
{\bgroup
- %\def\geenmarkering##1{\unknown\ }%
- \def\geenmarkering{\splitsequence{\getvalue{\??mk#1\c!limittext}}}%
+ %\def\nomarking##1{\unknown\ }%
+ \def\nomarking{\splitsequence{\getvalue{\??mk#1\c!limittext}}}%
\setfullsectionnumber{\??mk#1}%
\processaction % slow
[#2]
@@ -159,11 +174,11 @@
\s!unknown=>{\fetchmark [#1][#2]}]%
\egroup}}
-\def\nohaalmarkering[#1][#2]%
+\def\nogetmarking[#1][#2]%
{}
-\unexpanded\def\haalmarkering%
- {\dodoubleargument\dohaalmarkering}
+\unexpanded\def\getmarking
+ {\dodoubleargument\dogetmarking}
\let\setsomemark\setmark
diff --git a/tex/context/base/core-ref.tex b/tex/context/base/core-ref.tex
index 9d213f3df..4a1733368 100644
--- a/tex/context/base/core-ref.tex
+++ b/tex/context/base/core-ref.tex
@@ -602,10 +602,18 @@
\fi}
{\realreferencepagefalse}}
+\def\currentfolioreference{0}
+
\def\dogetreferenceelements#1#2#3#4#5%
{\chardef\currentreferencetype=\ifx#1\relax0\else#1\fi\relax
\ifnum\currentreferencetype<2
- \def\currentpagereference{\referencepagenumber[#2]}%
+ \edef\currentpagereference{#2}%
+ \ifx\currentpagereference \empty
+ \let\currentfolioreference\folio
+ \else
+ \def \currentpagereference {\referencepagenumber[#2]}%
+ \edef\currentfolioreference{\dosplitofffoliopart[#2]}%
+ \fi
\edef\currentrealreference{#3}%
\settextreferences#4\end
\ifnum0#5<\crossreferencenumber
@@ -614,8 +622,9 @@
\forwardreferencefalse
\fi
\else
- \edef\currentrealreference{#3}%
- \def\currentdatareference{#2}%
+ \edef\currentrealreference {#3}%
+ \def \currentdatareference {#2}%
+ \let \currentfolioreference\folio
\settextreferences#4\end
\forwardreferencefalse
\fi
diff --git a/tex/context/base/core-rul.tex b/tex/context/base/core-rul.tex
index 2e5dee6a4..73f432dab 100644
--- a/tex/context/base/core-rul.tex
+++ b/tex/context/base/core-rul.tex
@@ -638,7 +638,7 @@
{\copyparameters[#1][#3]%
[\c!breedte,\c!hoogte,\c!offset,\c!leeg,\c!lijndikte,%
\c!straal,\c!hoek,\c!diepte,\c!kader,\c!kaderkleur,%
- \c!voorgrondletter,\c!voorgrondkleur,\c!regels,%
+ \c!voorgrondletter,\c!voorgrondkleur,\c!regels,\c!orientatie,%
\c!bovenkader,\c!onderkader,\c!linkerkader,\c!rechterkader,%
\c!lijndikte,\c!kaderoffset,\c!achtergrond,\c!component,%
\c!achtergrondoffset,\c!achtergrondraster,\c!achtergrondkleur,%
@@ -687,6 +687,8 @@
%D Because it is used so often the he next macro is (and
%D looks) rather optimized.
+\let\postprocessframebox\relax
+
\let\@@framed\s!unknown
\def\framedparameter#1%
@@ -727,8 +729,9 @@
\edef\localformat{\framedparameter\c!uitlijnen}%
\edef\localstrut {\framedparameter\c!strut}%
% these are not
- \edef\@@localframing {\framedparameter\c!kader}%
- \edef\@@locallocation{\framedparameter\c!plaats}%
+ \edef\@@localframing {\framedparameter\c!kader}%
+ \edef\@@locallocation {\framedparameter\c!plaats}%
+ \edef\@@localorientation{\framedparameter\c!orientatie}%
%
\ifx\@@localframing\v!overlay % no frame, no offset, no framewidth
\boxhasframefalse
@@ -891,22 +894,23 @@
{\ifdim\!!heighta>\zeropoint\the\!!heighta\else\zeropoint\fi}%
% first alternative
%\def\dowithframedbox%
- % {\let\postprocessframebox\undefined %new
+ % {\let\postprocessframebox\relax %new
% \aftergroup\stoplocalframed}%
% \afterassignment\dowithframedbox
% \setbox\framebox=\next}
% second alternative
%\dowithnextbox
% {\setbox\framebox\flushnextbox
- % \let\postprocessframebox\undefined %new
+ % \let\postprocessframebox\relax %new
% \stoplocalframed}
% \next}
% third alternative
+ \@@startframedorientation
\afterassignment\dodowithframebox
\setbox\framebox\next}
\def\dowithframebox
- {\let\postprocessframebox\undefined
+ {% moved : \let\postprocessframebox\relax
\stoplocalframed}
\def\dodowithframebox
@@ -949,6 +953,7 @@
\def\stoplocalframed
{\dontshowcomposition
+ \@@stopframedorientation
\ifboxhasformat
\ifx\localwidth\v!passend
\ifreshapeframebox\doreshapeframedbox\fi
@@ -981,8 +986,10 @@
\ifboxisoverlaid \else
\dolocateframebox
\fi
- \ifx\postprocessframebox\undefined \else
- \postprocessframebox\framebox
+ \ifx\postprocessframebox\relax \else
+ \let\next\postprocessframebox
+ \let\postprocessframebox\relax % prevent nesting
+ \next\framebox
\fi
\edef\overlaylinecolor{\framedparameter\c!kaderkleur}%
\edef\overlaylinewidth{\the\ruledlinewidth}% \@@...
@@ -1001,6 +1008,9 @@
\egroup
\egroup}
+\let\@@startframedorientation\relax
+\let\@@stopframedorientation \relax
+
%D The last conditional takes care of the special situation of
%D in||line \inframed[hoogte=3cm]{framed} boxes. Such boxes have
%D to be \inframed{aligned} with the running text.
@@ -1394,6 +1404,7 @@
\def\doformatboxSomeFormat
{\vbox to \!!heighta
\bgroup
+ \let\postprocessframebox\relax
\forgetall
\oninterlineskip
\hsize\!!widtha
@@ -1412,6 +1423,7 @@
\def\doformatboxNoFormat
{\vbox to \!!heighta
\bgroup
+ \let\postprocessframebox\relax
\forgetall
\oninterlineskip
\hsize\!!widtha
@@ -1430,6 +1442,7 @@
\def\doformatboxHeight
{\vbox to \!!heighta
\bgroup
+ \let\postprocessframebox\relax
\forgetall
\oninterlineskip
\doframedsetups
@@ -1446,6 +1459,7 @@
\def\doformatboxWidth
{\vbox
\bgroup
+ \let\postprocessframebox\relax
\forgetall
\oninterlineskip
\hsize\!!widtha
@@ -1463,6 +1477,7 @@
\def\doformatboxVSize
{\vbox to \!!heighta
\bgroup
+ \let\postprocessframebox\relax
\forgetall
\vsize\!!heighta
\doframedsetups
@@ -1480,6 +1495,7 @@
\def\doformatboxHSize
{\hbox to \!!widtha
\bgroup
+ \let\postprocessframebox\relax
\forgetall
\doframedsetups
\hss
@@ -1493,6 +1509,7 @@
\def\doformatboxNoSize
{\hbox
\bgroup
+ \let\postprocessframebox\relax
\doframedsetups
\localstrut
\@@handleoneliner
@@ -2479,6 +2496,7 @@
\c!regelcorrectie=\v!aan,
\c!dieptecorrectie=\v!aan,
\c!marge=\v!standaard,
+ \c!orientatie=,
#2]%
\setvalue{\e!start#1}{\dostartframedtext[#1]}%
\setvalue{\e!stop #1}{\dostopframedtext }%
@@ -3295,6 +3313,7 @@
\c!boven=,
\c!strut=\v!ja,
\c!plaats=\v!normaal,
+ \c!orientatie=,
\c!setups=]
\setupscreens
diff --git a/tex/context/base/core-sec.tex b/tex/context/base/core-sec.tex
index 8e5040e73..512dd2e94 100644
--- a/tex/context/base/core-sec.tex
+++ b/tex/context/base/core-sec.tex
@@ -296,23 +296,23 @@
%%%%%%%%%
-\def\dokoppelmarkering[#1][#2]%
+\def\docouplemarking[#1][#2]%
{\doifdefinedelse{\??ko#2\c!sectie}
- {\dokoppelmarkering[#1][\getvalue{\??ko#2\c!sectie}]}
+ {\docouplemarking[#1][\getvalue{\??ko#2\c!sectie}]}
{\def\donexttrackcommando##1%
- {\edef\gekoppeldemarkeringen{\getvalue{\??se##1\c!markering}}%
+ {\edef\coupledmarkings{\getvalue{\??se##1\c!markering}}%
\doifelse{##1}{#2}
- {\addtocommalist{#1}\gekoppeldemarkeringen}
- {\removefromcommalist{#1}\gekoppeldemarkeringen}%
- \setevalue{\??se##1\c!markering}{\gekoppeldemarkeringen}%
+ {\addtocommalist{#1}\coupledmarkings}
+ {\removefromcommalist{#1}\coupledmarkings}%
+ \setevalue{\??se##1\c!markering}{\coupledmarkings}%
\donexttracklevel{##1}}%
\donexttracklevel{\zerosection}}} % \firstsection
-\def\koppelmarkering
- {\dodoubleargument\dokoppelmarkering}
+\def\couplemarking
+ {\dodoubleargument\docouplemarking}
-\def\ontkoppelmarkering[#1]%
- {\koppelmarkering[#1][]}
+\def\decouplemarking[#1]%
+ {\couplemarking[#1][]}
\def\definieersectie[#1]%
{\doifundefined{\??se#1}
@@ -401,7 +401,7 @@
% {\doifdefinedelse{\??se#1}
% {\let\donexttrackcommando\doresetsectionmarks
% \donexttracklevel{#1}}%
-% {\fastresetmarker[\hoofdmarkering{#1}]}} % redundant \hoofdmarkering
+% {\fastresetmarker[\mainmarking{#1}]}} % redundant \mainmarking
% \def\doresetsectionmarks#1%
% {\ifundefined{\??se#1\c!markering}\else % skip zero level
@@ -420,7 +420,7 @@
\def\resetsectionmarks#1%
{\ifundefined{\??se#1}%
- \fastresetmarker[\hoofdmarkering{#1}]% % redundant \hoofdmarkering
+ \fastresetmarker[\mainmarking{#1}]% % redundant \mainmarking
\else
\let\donexttrackcommando\doresetsectionmarks
\donexttracklevel{#1}%
@@ -1622,7 +1622,7 @@
\dontconvertfont
\dostartattributes\@@sectie{#1}{#2}\empty
\setupinterlinespace
- \begstrut\haalmarkering[\hoofdmarkering{#4#3}]\endstrut
+ \begstrut\getmarking[\mainmarking{#4#3}]\endstrut
\endgraf
\dostopattributes
\dostopattributes
@@ -2091,12 +2091,12 @@
\doifsomething{\getvalue{\??ko#1\c!sectie}}
{\doifelsemarking{#1}% \doifundefined{\??mk#1}
{}% marking #1 already defined
- {\definieermarkering[#1]%
- \koppelmarkering[#1][\getvalue{\??ko#1\c!sectie}]%
- \definieermarkering[#1\v!nummer]%
+ {\definemarking[#1]%
+ \couplemarking[#1][\getvalue{\??ko#1\c!sectie}]%
+ \definemarking[#1\v!nummer]%
% klopt dit wel ?
- \koppelmarkering[#1\v!nummer][\getvalue{\??ko#1\c!sectie}]}}%
-% \koppelmarkering[#1\v!nummer][\getvalue{\??ko#1\c!sectie}\v!nummer]}}%
+ \couplemarking[#1\v!nummer][\getvalue{\??ko#1\c!sectie}]}}%
+% \couplemarking[#1\v!nummer][\getvalue{\??ko#1\c!sectie}\v!nummer]}}%
\doifundefined{\??li#1}{\definieerlijst[#1]}}
{\ConvertToConstant\doifelse{#1}{#2}
{\doifundefined{\??li#1}{\definieerlijst[#1]}}
@@ -2114,8 +2114,8 @@
\c!uitlijnen,\c!titeluitlijnen,\c!tolerantie,\c!grid,
\c!nummercommando,\c!tekstcommando,\c!margetekst,\c!marge]%
\getparameters[\??ko#1][\c!expansie=]% iig een value, rather fuzzy
- \definieermarkering[#1][#2]%
- \definieermarkering[#1\v!nummer][#2\v!nummer]%
+ \definemarking[#1][#2]%
+ \definemarking[#1\v!nummer][#2\v!nummer]%
\doifundefined{\??li#1}{\definieerlijst[#1][#2]}}}%
\addtocommalist{#1}\@@kolijst
\setevalue{\??sk#1}%
diff --git a/tex/context/base/core-spa.tex b/tex/context/base/core-spa.tex
index 19eafd07d..efbb4890e 100644
--- a/tex/context/base/core-spa.tex
+++ b/tex/context/base/core-spa.tex
@@ -153,6 +153,8 @@
\let\strutheightfactor\@@ithoogte
\let\strutdepthfactor \@@itdiepte
\fi
+ \let\minimumstrutheight\@@itminhoogte
+ \let\minimumstrutdepth \@@itmindiepte
\let\minimallinedistance\@@itafstand
\let\normallineheight\@@itregel % let ! ! ! ! ! ivm ex
\let\topskipfactor\@@itboven
@@ -1177,7 +1179,7 @@
% but, since not all fonts have .5em digits:
\def\fixedspace
- {\setbox\scratchbox\hbox\ifmmode{$0$}\else{0}\fi
+ {\setbox\scratchbox\normalhbox\ifmmode{$0$}\else{0}\fi
\hskip\wd\scratchbox\relax}
\def\fixedspaces
@@ -1650,6 +1652,9 @@
\def\baselinefactor {2.8}
\def\baselinegluefactor {0}
+\def\minimumstrutheight {0pt}
+\def\minimumstrutdepth {0pt}
+
\def\normallineheight {\baselinefactor ex}
\def\minimallinedistance {\lineskip}
@@ -1701,6 +1706,18 @@
\vskip-\openstrutheight
\fi}
+% \def\settopskip % the extra test is needed for the lbr family
+% {\topskip\systemtopskipfactor\globalbodyfontsize
+% \ifgridsnapping \else
+% \ifr@ggedbottom\!!plus5\globalbodyfontsize\fi
+% \fi
+% \relax % the skip
+% \topskipgap\topskip
+% \advance\topskipgap -\openstrutheight\relax
+% \ifdim\topskip<\strutheightfactor\openlineheight
+% \topskip\strutheightfactor\openlineheight\relax
+% \fi}
+
\def\settopskip % the extra test is needed for the lbr family
{\topskip\systemtopskipfactor\globalbodyfontsize
\ifgridsnapping \else
@@ -1709,9 +1726,15 @@
\relax % the skip
\topskipgap\topskip
\advance\topskipgap -\openstrutheight\relax
+\ifdim\minimumstrutheight>\zeropoint
+ \ifdim\topskip<\minimumstrutheight
+ \topskip\minimumstrutheight\relax
+ \fi
+\else
\ifdim\topskip<\strutheightfactor\openlineheight
\topskip\strutheightfactor\openlineheight\relax
- \fi}
+ \fi
+\fi}
\def\setmaxdepth
{\maxdepth\systemmaxdepthfactor\globalbodyfontsize}
@@ -1721,13 +1744,41 @@
\lineskip\normallineskip
\lineskiplimit\normallineskiplimit}
+% \def\setnormalbaselines
+% {\ifdim\normallineheight>\zeropoint
+% \lineheight\normallineheight
+% \fi
+% \openlineheight\spacingfactor\lineheight
+% \openstrutheight\strutheightfactor\openlineheight
+% \openstrutdepth \strutdepthfactor \openlineheight
+% \normalbaselineskip\openlineheight
+% \!!plus\baselinegluefactor\openlineheight
+% \!!minus\baselinegluefactor\openlineheight
+% \normallineskip\minimallinedistance\relax % \onepoint\relax
+% \normallineskiplimit\zeropoint\relax
+% \normalbaselines}
+
\def\setnormalbaselines
{\ifdim\normallineheight>\zeropoint
\lineheight\normallineheight
\fi
\openlineheight\spacingfactor\lineheight
+\ifdim\minimumstrutheight>\zeropoint
+ \openstrutheight\minimumstrutheight % new
+\else
\openstrutheight\strutheightfactor\openlineheight
+\fi
+\ifdim\minimumstrutdepth>\zeropoint
+ \openstrutdepth \minimumstrutdepth % new
+\else
\openstrutdepth \strutdepthfactor \openlineheight
+\fi
+\scratchdimen\minimumstrutdepth
+\advance\scratchdimen\minimumstrutheight
+\ifdim\scratchdimen>\zeropoint
+ \openlineheight\openstrutheight % new
+ \advance\openlineheight\openstrutdepth % new
+\fi
\normalbaselineskip\openlineheight
\!!plus\baselinegluefactor\openlineheight
\!!minus\baselinegluefactor\openlineheight
@@ -1735,6 +1786,7 @@
\normallineskiplimit\zeropoint\relax
\normalbaselines}
+
\def\setspacingfactor#1\to#2\by#3\\%
{\strutdimen#2\points
\strutdimen#3\strutdimen
@@ -1771,7 +1823,7 @@
\newbox\strutbox
- \setbox\strutbox=\hbox{\vrule height8.5pt depth3.5pt width\z@}
+ \setbox\strutbox=\normalhbox{\vrule height8.5pt depth3.5pt width\z@}
%\def\strut{\relax\ifmmode\copy\strutbox\else\unhcopy\strutbox\fi}
\def\strut{\relax\ifmmode\copy\else\unhcopy\fi\strutbox}
@@ -1800,23 +1852,53 @@
% \setstrutdimen\strutdepth \strutdepthfactor \spacingfactor
% \dosetstrut}
+% \def\setstrut
+% {\strutdimen\normallineheight
+% \strutdimen\strutheightfactor\strutdimen
+% \strutdimen\spacingfactor\strutdimen
+% \edef\strutheight{\the\strutdimen}%
+% \strutdimen\normallineheight
+% \ifgridsnapping
+% \advance\strutdimen-\strutheight
+% \else
+% \strutdimen\strutdepthfactor\strutdimen
+% \strutdimen\spacingfactor\strutdimen
+% \fi
+% \edef\strutdepth{\the\strutdimen}%
+% \dosetstrut}
+
\def\setstrut
- {\strutdimen\normallineheight
+ {% height
+ \strutdimen\normallineheight
+\ifdim\minimumstrutheight>\zeropoint
+ \strutdimen\minimumstrutheight
+\else
\strutdimen\strutheightfactor\strutdimen
+\fi
\strutdimen\spacingfactor\strutdimen
\edef\strutheight{\the\strutdimen}%
+ % depth
\strutdimen\normallineheight
\ifgridsnapping
+\ifdim\minimumstrutdepth>\zeropoint
+ \strutdimen\minimumstrutdepth
+\else
\advance\strutdimen-\strutheight
+\fi
\else
+\ifdim\minimumstrutdepth>\zeropoint
+ \strutdimen\minimumstrutdepth
+\else
\strutdimen\strutdepthfactor\strutdimen
+\fi
\strutdimen\spacingfactor\strutdimen
\fi
\edef\strutdepth{\the\strutdimen}%
+ % finish
\dosetstrut}
\def\setcharstrut#1%
- {\setbox\strutbox\hbox{#1}%
+ {\setbox\strutbox\normalhbox{#1}%
\edef\strutheight{\the\strutht}%
\edef\strutdepth {\the\strutdp}%
\dosetstrut}
@@ -3560,10 +3642,10 @@
{\dowithnextboxcontent
{\forgetall}
{\ifcase\graphicvadjustmode \@EA \fakedvadjust \else \@EA\normalvadjust \fi
- {\dostartgraphicgroup
+ {\dostartgraphicgroup % don't ask
\localstarttextcolor
\unvbox\nextbox
- \localstoptextcolor
+ \localstoptextcolor % don't ask
\dostopgraphicgroup
\ifcase\graphicvadjustmode \or \or
% corrects for one line paragraphs
@@ -3616,7 +3698,9 @@
\def\@@blankona {\blanko[\v!na]} %
\setupinterlinespace
- [\c!hoogte=.72,
+ [\c!minhoogte=0pt, % only special purpose
+ \c!mindiepte=0pt, % only special purpose
+ \c!hoogte=.72,
\c!diepte=.28,
\c!boven=1.0,
\c!onder=0.4,
diff --git a/tex/context/base/core-uti.tex b/tex/context/base/core-uti.tex
index 6f593a70c..c8859ac64 100644
--- a/tex/context/base/core-uti.tex
+++ b/tex/context/base/core-uti.tex
@@ -58,11 +58,15 @@
\def\checksectionseparator % catches backward compatibility conflict
{\doifnot\sectionseparator:\endinput} % this dependency may go in a few years
+\def\dosplitofffoliopart[#1::#2::#3]{#3}
+
\def\thisissectionseparator#1%
{\bgroup
\globallet\checksectionseparator\relax
\convertcommand \sectionseparator\to\asciiA
\convertargument #1\to\asciiB
+ \expanded{\gdef\noexpand\dosplitofffoliopart[####1\sectionseparator
+ \sectionseparator####2\sectionseparator\sectionseparator####3]{####3}}%
\ifx\asciiA\asciiB
\egroup
\else
diff --git a/tex/context/base/m-cweb.tex b/tex/context/base/m-cweb.tex
index 57b1ab8b9..805ec3b77 100644
--- a/tex/context/base/m-cweb.tex
+++ b/tex/context/base/m-cweb.tex
@@ -300,7 +300,7 @@
%D \CWEBquote at sign for control text (not needed in versions
%D $>=$ 2.9).
-\defCWEBmacro\AT{@}
+\defCWEBmacro\AT{@}
%D \macros{ATL,postATL,NOATL}{}
%D
@@ -641,7 +641,7 @@
\def\theCWEByskip {\blanko[\v!klein]}
\def\theCWEBvskip {\blanko[\v!groot]}
-\protect
+\protect
\defCWEBmacro\Y%
{\par
@@ -1101,10 +1101,10 @@
\defCWEBmacro\X#1:#2\X%
{\newCWEBmacroX#1:#2\X}
-\definieermarkering[CWEBfilename]
-\definieermarkering[CWEBsectiontitle]
-\definieermarkering[CWEBsectionnumber]
-\definieermarkering[CWEBsectiondepth]
+\definemarking[CWEBfilename]
+\definemarking[CWEBsectiontitle]
+\definemarking[CWEBsectionnumber]
+\definemarking[CWEBsectiondepth]
\defCWEBmacro\M#1%
{\MN{#1}%
@@ -1167,7 +1167,7 @@
{\linktoCWEBfiletrue
\def\otherCWEBfile{#1}}
-\unprotect
+\unprotect
\def\gotoCWEBsection#1[#2]%
{\iflinktoCWEBfile
@@ -1181,7 +1181,7 @@
#1%
\fi}
-\protect
+\protect
\defCWEBmacro\startsection%
{\rightskip=0pt % get out of C mode (cf. \B)
diff --git a/tex/context/base/mult-com.tex b/tex/context/base/mult-com.tex
index b89489942..cb8dafc1a 100644
--- a/tex/context/base/mult-com.tex
+++ b/tex/context/base/mult-com.tex
@@ -734,10 +734,10 @@ stelnummerin: stelnummerin setupnumber
setupfootertexts: stelvoettekstenin setupfootertexts
stellefusszeilentextein nastavtextyupati
impostatestipdp seteazatextesubsol
- stelpaginanummerin: stelpaginanummerin setuppagenumber
+ setuppagenumber: stelpaginanummerin setuppagenumber
stelleseitennummerein nastavcislostrany
impostanumeropagina seteazanumarpagina
- stelsubpaginanummerin: stelsubpaginanummerin setupsubpagenumber
+ setupsubpagenumber: stelsubpaginanummerin setupsubpagenumber
stelleunterseitennummerein nastavpodcislostrany
impostanumerosottopagina seteazanumarsubpagina
setuptext: steltekstin setuptext
@@ -857,28 +857,28 @@ stelnummerin: stelnummerin setupnumber
bepaalkopnummer: bepaalkopnummer determineheadnumber
bestimmekopfnummer stanovcislonadpisu
determinanumerotesta determinanumartitlu
- resetmarkering: resetmarkering resetmarking
+ resetmarking: resetmarkering resetmarking
ruecksetztenbeschriftung resetznaceni
reimpostamarcatura reseteazamarcaje
- stelmarkeringin: stelmarkeringin setupmarking
+ setupmarking: stelmarkeringin setupmarking
stellebeschriftungein nastavznaceni
impostamarcatura seteazamarcaje
- definieermarkering: definieermarkering definemarking
+ definemarking: definieermarkering definemarking
definierebeschriftung definujznaceni
definiscimarcatura definestemarcaje
- geenmarkering: geenmarkering nomarking
+ nomarking: geenmarkering nomarking
keinebeschriftung zadneznaceni
nientemarcatura faramarcaje
marking: markeer marking
beschriftung znaceni
marcatura marcaje
- ontkoppelmarkering: ontkoppelmarkering decouplemarking
+ decouplemarking: ontkoppelmarkering decouplemarking
entknuepfebeschriftung rozpojeneznaceni
separamarcatura decupleazamarcaje % GB
- koppelmarkering: koppelmarkering couplemarking
+ couplemarking: koppelmarkering couplemarking
verknuepfebeschriftung propojeneznaceni
accoppiamarcatura cupleazamarcaje % GB
- haalmarkering: haalmarkering getmarking
+ getmarking: haalmarkering getmarking
holebeschriftung ziskejznaceni
prendimarcatura adumarcaje % GB
definelayout: definieerlayout definelayout
diff --git a/tex/context/base/mult-con.tex b/tex/context/base/mult-con.tex
index 66e8f7692..587a0c9a1 100644
--- a/tex/context/base/mult-con.tex
+++ b/tex/context/base/mult-con.tex
@@ -638,6 +638,9 @@ component: component component
minhoogte: minhoogte minheight
minhoehe minvyska
altezzamin inaltimeminima
+ mindiepte: mindiepte mindepth
+ mindepth mindepth
+ mindeoth mindepth % new GB
huidige: huidige current
aktuell aktualni
corrente curent
@@ -1049,6 +1052,11 @@ proces: proces process
rotatie: rotatie rotation
rotation rotace
rotazione rotatie
+% new
+ orientatie: orientatie orientation
+ orientation orientation
+ orientation orientation
+
rugoffset: rugoffset horoffset
rumpfabstand horoffset
horoffset offsetoriz % GB
diff --git a/tex/context/base/mult-sys.tex b/tex/context/base/mult-sys.tex
index 4cdb8470f..dda3bd8c9 100644
--- a/tex/context/base/mult-sys.tex
+++ b/tex/context/base/mult-sys.tex
@@ -342,6 +342,8 @@
\newdimen \onebasepoint \onebasepoint = 1bp
\chardef \scaledpoint = 1
+\let\onerealpoint\onepoint % needed for latex
+
\newcount\medcard \medcard\!!medcard % used in font module
\newcount\maxcard \maxcard\!!maxcard % used in font module
diff --git a/tex/context/base/page-app.tex b/tex/context/base/page-app.tex
index d3f7a1e94..6f21c82f2 100644
--- a/tex/context/base/page-app.tex
+++ b/tex/context/base/page-app.tex
@@ -18,16 +18,6 @@
\unprotect
-\def\dostartfittingpage[#1][#2]%
- {\pagina % this is kind of tricky! there can be preceding page refs
- \bgroup % resulting in a zero height page; test fig-make !
- \dontcomplain
- % runs under current page regime, i.e. page variables passed to mp
- \setbox\scratchbox\hbox
- \bgroup
- \getparameters[#1][#2]%
- \schaal[\c!schaal=\getvalue{#1\c!schaal}]\bgroup\localframed[#1]\bgroup}
-
\definepapersize
[\??fp\s!dummy]
[\c!breedte=\fittingwd,
@@ -45,8 +35,64 @@
\c!rechtermarge=\!!zeropoint,\c!rechterrand=\!!zeropoint,
\c!hoofd=\!!zeropoint,\c!voet=\!!zeropoint]
+% \def\dostartfittingpage[#1][#2]%
+% {\pagina % this is kind of tricky! there can be preceding page refs
+% \bgroup % resulting in a zero height page; test fig-make !
+% \dontcomplain
+% % runs under current page regime, i.e. page variables passed to mp
+% \setbox\scratchbox\hbox
+% \bgroup
+% \getparameters[#1][#2]%
+% \schaal[\c!schaal=\getvalue{#1\c!schaal}]\bgroup\localframed[#1]\bgroup}
+
+% \def\dostopfittingpage
+% {\egroup\egroup\egroup
+% \edef\fittingwd{\the\wd\scratchbox}%
+% \edef\fittinght{\the\ht\scratchbox}%
+% \startlocallayout
+% \ifdim\fittinght<\lineheight
+% % write status : too small
+% \setbox\scratchbox\vbox to \lineheight{\vss\box\scratchbox\vss}%
+% \edef\fittinght{\the\lineheight}%
+% \fi
+% \let\checkcurrentlayout\relax % else interference with odd/even layout
+% \setuppapersize
+% [\??fp\s!dummy][\??fp\s!dummy]%
+% \definelayout
+% [\v!pagina]%
+% [\c!plaats=\v!midden,
+% \c!breedte=\fittingwd,
+% \c!hoogte=\fittinght]%
+% \setuplayout
+% [\v!pagina]%
+% \startmakeup[\v!standaard][\c!tekststatus=\v!leeg,\c!dubbelzijdig=\v!nee,\c!pagina=]%
+% \centerbox{\box\scratchbox}%
+% \stopmakeup
+% \stoplocallayout
+% \egroup}
+
+\def\dostartfittingpage[#1][#2]%
+ {\pagina % this is kind of tricky! there can be preceding page refs
+ \bgroup % resulting in a zero height page; test fig-make !
+ \dontcomplain
+ % runs under current page regime, i.e. page variables passed to mp
+ \setbox\scratchbox\hbox
+ \bgroup
+ \getparameters[#1][#2]%
+ \doifvalue{#1\c!marge}{\v!pagina}
+ {\offsetbox
+ [\c!linkeroffset=\rugwit,
+ \c!rechteroffset=\snijwit,
+ \c!bovenoffset=\kopwit,
+ \c!onderoffset=\bodemwit]\hbox}%
+ \bgroup
+ \schaal[\c!schaal=\getvalue{#1\c!schaal}]\bgroup\localframed[#1]\bgroup}
+
\def\dostopfittingpage
- {\egroup\egroup\egroup
+ {\egroup % localframed
+ \egroup % scale
+ \egroup % offsetbox
+ \egroup % scratchbox
\edef\fittingwd{\the\wd\scratchbox}%
\edef\fittinght{\the\ht\scratchbox}%
\startlocallayout
diff --git a/tex/context/base/page-imp.tex b/tex/context/base/page-imp.tex
index ac2d2b0c5..3c9a899bd 100644
--- a/tex/context/base/page-imp.tex
+++ b/tex/context/base/page-imp.tex
@@ -138,6 +138,7 @@
\def\actualshipout#1%
{\global\advance\shippedoutpages\plusone
+ % this is not resource safe!
\ifx\pagestoshipout\empty
\ifcase\whichpagetoshipout\relax
\donetrue
diff --git a/tex/context/base/page-mak.tex b/tex/context/base/page-mak.tex
index 03caf2fba..f4155de67 100644
--- a/tex/context/base/page-mak.tex
+++ b/tex/context/base/page-mak.tex
@@ -167,7 +167,7 @@
{\globalpushmacro\@@pnstatus % new
\makeupparameter\c!voor
\vbox{\hbox{\color[\makeupparameter\c!kleur]{\box\makeupbox}}}%
- \stelpaginanummerin[\c!status=\makeupparameter\c!paginastatus]%
+ \setuppagenumber[\c!status=\makeupparameter\c!paginastatus]%
\setupmakeuplayout
\pagina
\makeupparameter\c!na
diff --git a/tex/context/base/page-mar.tex b/tex/context/base/page-mar.tex
index 09882ba9e..939007808 100644
--- a/tex/context/base/page-mar.tex
+++ b/tex/context/base/page-mar.tex
@@ -331,41 +331,6 @@
\egroup
\fi}
-% \def\doflushmargincontents% % links + rechts
-% {\bgroup
-% \forgetall
-% \global\marginheight\!!zeropoint
-% \dorecurse{\margincontent}
-% {\bgroup
-% \edef\margetekstafstand {\getvalue{\??im\recurselevel\c!afstand}}%
-% \edef\margetekstregels {\getvalue{\??im\recurselevel\c!regel}}%
-% \edef\margetekstscheider{\getvalue{\??im\recurselevel\c!scheider}}%
-% \let\margetekstnummer=\recurselevel
-% \getvalue{\??im\recurselevel}%
-% \global\setvalue{\??im\recurselevel}{}%
-% \egroup}%
-% \ifdim\marginheight>\lineheight % This is something real dirty!
-% \advance\marginheight by \pagetotal
-% \advance\marginheight by \lineheight % a sort of bonus
-% \ifdim\marginheight>\pagegoal
-% \xdef\restoreinterlinepenalty%
-% {\global\let\restoreinterlinepenalty\relax
-% \global\interlinepenalty=\the\interlinepenalty}%
-% \global\interlinepenalty=10000
-% \fi
-% \else % We need the above because interlinepenalties overrule vadjusted \nobreaks.
-% %\vadjust
-% % {\forgetall
-% % \global\advance\marginheight by \lineheight
-% % \global\divide\marginheight by \lineheight
-% % \dorecurse{\number\marginheight}
-% % {\nobreak\vskip\lineheight}%
-% % \kern-\number\marginheight\lineheight}%
-% \vadjust{\nobreak}%
-% \fi
-% \doglobal\newcounter\margincontent
-% \egroup}
-
\def\doflushmargincontents % links + rechts
{\bgroup
\forgetall
@@ -379,14 +344,14 @@
\getvalue{\??im\recurselevel}%
\letgvalue{\??im\recurselevel}\empty
\egroup}%
-\ifbinnenkolommen
- \donetrue % how fuzzy
-\else\ifdim\marginheight>\lineheight\relax
- \donetrue % how dirty
-\else
- \donefalse % how needed
-\fi\fi
-\ifdone
+ \ifbinnenkolommen
+ \donetrue % how fuzzy
+ \else\ifdim\marginheight>\lineheight\relax
+ \donetrue % how dirty
+ \else
+ \donefalse % how needed
+ \fi\fi
+ \ifdone
\advance\marginheight \pagetotal
\advance\marginheight \lineheight % a sort of bonus
\ifdim\marginheight>\pagegoal
@@ -396,19 +361,12 @@
\global\interlinepenalty10000
\fi
\else % We need the above because interlinepenalties overrule vadjusted \nobreaks.
- %\vadjust
- % {\forgetall
- % \global\advance\marginheight by \lineheight
- % \global\divide\marginheight by \lineheight
- % \dorecurse{\number\marginheight}
- % {\nobreak\vskip\lineheight}%
- % \kern-\number\marginheight\lineheight}%
\vadjust{\nobreak}%
\fi
\doglobal\newcounter\margincontent
\egroup}
-% Some day: \definieermarkering[\v!margetitel]
+% Some day: \definemarking[\v!margetitel]
\def\docomplexmargewoord#1#2#3%
{\@EA\setgvalue\@EA{\@EA\??im\@EA\margincontent\@EA}\@EA
diff --git a/tex/context/base/page-num.tex b/tex/context/base/page-num.tex
index c112fee0d..324bf5308 100644
--- a/tex/context/base/page-num.tex
+++ b/tex/context/base/page-num.tex
@@ -13,6 +13,8 @@
\writestatus{loading}{Context Core Macros / Numbering}
+% todo: {}{}{} ipv ...--...-...-...--... in pag ref
+
\unprotect
% \gotonextsubpage : voor de pagebody
@@ -51,7 +53,7 @@
% so far for sync, see \gotonext...
-\def\dostelsubpaginanummerin[#1]%
+\def\dosetupsubpagenumber[#1]%
{\doifelse{#1}{\v!reset}
{\resetsubpaginanummer} % \resetnumber[\s!subpage]
{\getparameters[\??sn][#1]%
@@ -74,8 +76,8 @@
\def\subpaginanummer
{\ifshowingsubpage\the\subpageno\else0\fi}
-\def\stelsubpaginanummerin
- {\dosingleargument\dostelsubpaginanummerin}
+\def\setupsubpagenumber
+ {\dosingleargument\dosetupsubpagenumber}
\def\newnofsubpages{0}
\def\nofsubpages {0}
@@ -289,7 +291,7 @@
\global\let\@@pnstatus\@@pnstatus
-\def\dostelpaginanummerin[#1]%
+\def\dosetuppagenumber[#1]%
{\getparameters[\??pn][\c!nummer=,#1]%
\global\let\@@pnstatus\@@pnstatus
\doifsomething\@@pnnummer
@@ -300,8 +302,8 @@
\global\shiftedrealpagenotrue
\fi \fi}
-\def\stelpaginanummerin
- {\dosingleargument\dostelpaginanummerin}
+\def\setuppagenumber
+ {\dosingleargument\dosetuppagenumber}
% long time used alternative
%
@@ -570,11 +572,11 @@
{\doifelsenothing{#1}{?}% \prepare had got lost
{\preparepaginaprefix\??rf\paginaprefix\??rf[#1]\translatednumber[#1]}}
-\stelpaginanummerin
+\setuppagenumber
[\c!status=\v!start,
\c!nummer=1]
-\stelsubpaginanummerin
+\setupsubpagenumber
[\c!wijze=\v!per\v!deel,
\c!status=\v!stop]
diff --git a/tex/context/base/page-txt.tex b/tex/context/base/page-txt.tex
index 86668840c..48f770fa8 100644
--- a/tex/context/base/page-txt.tex
+++ b/tex/context/base/page-txt.tex
@@ -195,7 +195,7 @@
% {\placetextlinestrut{#1}% here !
% %\doifdefinedelse{\??mk\ascii\c!koppeling} % brrr
% \doifelsemarking\ascii
-% {\dolimitatetexts{#1#2#5}{\haalmarkering[\ascii][\v!eerste]}}
+% {\dolimitatetexts{#1#2#5}{\getmarking[\ascii][\v!eerste]}}
% {\ConvertConstantAfter\doifelse{\v!paginanummer}{#6}
% {\@@plaatspaginanummer}
% {\ConvertConstantAfter\doifelse{\v!datum}{#6}
@@ -213,7 +213,7 @@
{\placetextlinestrut{#1}% here !
%\doifdefinedelse{\??mk\ascii\c!koppeling} % brrr
\doifelsemarking\ascii
- {\dolimitatetexts{#1#2#5}{\haalmarkering[\ascii][\v!eerste]}}
+ {\dolimitatetexts{#1#2#5}{\getmarking[\ascii][\v!eerste]}}
{\ConvertConstantAfter\doifelse\v!paginanummer{#6}
\@@plaatspaginanummer
{\ConvertConstantAfter\doifelse\v!datum{#6}
@@ -317,7 +317,7 @@
\setvalue{\string\placelayouttextline\v!geenmarkering}#1#2%
{\bgroup
\resettextlinestatus{#1}%
- \let\dohaalmarkering\nohaalmarkering
+ \let\dogetmarking\nogetmarking
\doplacelayouttextline{#1}{#2}%
\egroup}
diff --git a/tex/context/base/s-abr-01.tex b/tex/context/base/s-abr-01.tex
index 9ad78078e..93c8e93d4 100644
--- a/tex/context/base/s-abr-01.tex
+++ b/tex/context/base/s-abr-01.tex
@@ -76,6 +76,7 @@
%logo [FGBBS] {fgbbs}
\logo [FPTEX] {fp\TeX}
\logo [FREEBSD] {FreeBSD}
+\logo [FOXET] {foXet}
\logo [FTP] {ftp}
\logo [GHOSTSCRIPT]{Ghost\-Script}
\logo [GHOSTVIEW] {Ghost\-View}
diff --git a/tex/context/base/s-chi-00.tex b/tex/context/base/s-chi-00.tex
index 30df05757..6d3560d8d 100644
--- a/tex/context/base/s-chi-00.tex
+++ b/tex/context/base/s-chi-00.tex
@@ -9,14 +9,14 @@
%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.
-\mainlanguage[cn]
+\mainlanguage[cn]
-\setupbodyfont[chi]
+\setupbodyfont[chi]
-\unprotect
+\unprotect
\stelsectiein [\v!sectionlevel-1] [\c!kopconversie=\s!chinese]
\stelsectiein [\v!sectionlevel-2] [\c!kopconversie=\s!chinese]
@@ -31,22 +31,22 @@
\stellijstin [\v!hoofdstuk] [\c!koplabel=\v!ja,\c!kopconversie=\v!ja,\c!breedte=5em]
\stellijstin [\v!paragraaf] [\c!koplabel=\v!ja,\c!kopconversie=\v!ja,\c!breedte=5em]
-\stelmarkeringin [\v!hoofdstuk\v!nummer] [\c!koplabel=\v!ja,\c!kopconversie=\v!ja]
-\stelmarkeringin [\v!paragraaf\v!nummer] [\c!koplabel=\v!ja,\c!kopconversie=\v!ja]
+\setupmarking [\v!hoofdstuk\v!nummer] [\c!koplabel=\v!ja,\c!kopconversie=\v!ja]
+\setupmarking [\v!paragraaf\v!nummer] [\c!koplabel=\v!ja,\c!kopconversie=\v!ja]
\setuplabeltext[cn][\v!sub\v!paragraaf={\symbol[S]\kern.25em}]
\setuplabeltext[cn][\v!sub\v!sub\v!paragraaf={\symbol[S]\kern.25em}]
\setuplabeltext[cn][\v!sub\v!sub\v!sub\v!paragraaf={\symbol[S]\kern.25em}]
\setuplabeltext[cn][\v!sub\v!sub\v!sub\v!sub\v!paragraaf={\symbol[S]\kern.25em}]
-% nog taalonafhankelijk maken -> \e!tabel enz
+% nog taalonafhankelijk maken -> \e!tabel enz
\definereferenceformat [intable] [\c!label=\v!tabel]
\definereferenceformat [infigure] [\c!label=\v!figuur]
\definereferenceformat [inchapter] [\c!label=\v!hoofdstuk]
\definereferenceformat [insection] [\c!label=\v!paragraaf]
-% important
+% important
\setuptyping[\c!tab=\v!nee]
diff --git a/tex/context/base/s-dtk-01.tex b/tex/context/base/s-dtk-01.tex
index 6f4a80c98..6c55b8da5 100644
--- a/tex/context/base/s-dtk-01.tex
+++ b/tex/context/base/s-dtk-01.tex
@@ -3,50 +3,50 @@
%D version=1999.08.15,
%D title=\CONTEXT\ Style File,
%D subtitle=\DTK\ basis stijl,
-%D author=Hans Hagen \& Taco Hoekwater,
+%D author=Hans Hagen \& Taco Hoekwater,
%D date=\currentdate,
%D copyright=PRAGMA]
%C
%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-%D Preliminary. Still dutch and english intermixed.
+%D Preliminary. Still dutch and english intermixed.
\unprotect
-%D Temp hack.
+%D Temp hack.
\let\doverbatimgoodbreak\donothing
-%D Fonts.
+%D Fonts.
-\definebodyfontenvironment
- [8pt]
- [\c!interlinie=9pt,
- \c!groot=9pt,
+\definebodyfontenvironment
+ [8pt]
+ [\c!interlinie=9pt,
+ \c!groot=9pt,
\c!klein=7pt]
-\definebodyfontenvironment
- [9pt]
+\definebodyfontenvironment
+ [9pt]
[\c!interlinie=11pt,
- \c!groot=10pt,
+ \c!groot=10pt,
\c!klein=8pt]
-\definebodyfontenvironment
- [10pt]
+\definebodyfontenvironment
+ [10pt]
[\c!interlinie=12pt,
- \c!groot=12pt,
+ \c!groot=12pt,
\c!klein=8pt]
\definebodyfontenvironment
- [12pt]
+ [12pt]
[\c!interlinie=14pt,
\c!groot=14.4pt,
\c!klein=10pt]
\definebodyfontenvironment
- [14.4pt]
+ [14.4pt]
[\c!interlinie=18pt,
\c!groot=14.4pt,
\c!klein=12pt]
@@ -57,51 +57,51 @@
%D Color.
\setupcolors
- [\c!conversie=\v!altijd]
+ [\c!conversie=\v!altijd]
%D Default language.
\mainlanguage[en] \language[en]
-%D Paper size and layout. The Dante style depends on the
-%D driver to sort out the margins. Therefore we are not
-%D really typesetting in A5, but on something larger.
+%D Paper size and layout. The Dante style depends on the
+%D driver to sort out the margins. Therefore we are not
+%D really typesetting in A5, but on something larger.
\definepapersize
[DanteA5]
- [breedte=486.54pt]
+ [breedte=486.54pt]
\setuppapersize
- [DanteA5][A4]
+ [DanteA5][A4]
-\setuplayout % w=342pt h=484pt
+\setuplayout % w=342pt h=484pt
[\c!rugwit=1in,
\c!kopwit=1in,
\c!plaats=\v!enkelzijdig,
- \c!breedte=342pt,
- \c!hoogte=548pt,
- \c!hoofd=17pt,
+ \c!breedte=342pt,
+ \c!hoogte=548pt,
+ \c!hoofd=17pt,
\c!hoofdafstand=17pt,
\c!voetafstand=17pt,
- \c!voet=17pt]
+ \c!voet=17pt]
%D Headers and footers.
-
+
\setupheader [\c!voor=\vfill,\c!na=]
\setupfooter [\c!voor=\vfill,\c!na=]
-%D Numbering.
+%D Numbering.
\setuppagenumbering
[\c!plaats=,
\c!variant=\v!dubbelzijdig]
-%D Spacing.
+%D Spacing.
\setupwhitespace [\v!halveregel]
\setupblank [\v!halveregel]
-%D Itemize.
+%D Itemize.
\stelopsommingin [\v!elk] [\c!afstand=0pt,\c!marge=.5em]
\stelopsommingin [1] [\c!breedte=1.0em,\c!symbool=circle]
@@ -111,14 +111,14 @@
\stelopsommingin [1] [\v!opelkaar]
-%D Verbatim.
+%D Verbatim.
\setuptyping [\c!optie=,\c!blanko=halveregel]
-%D Footnotes.
+%D Footnotes.
\def\VoetNootLijn%
- {\hrule width 5pc height .4pt}
+ {\hrule width 5pc height .4pt}
\setupfootnotes
[\c!korps=8pt,
@@ -132,17 +132,17 @@
\c!kopletter=\v!normaal,
\c!afstand=.5em]
-% Abbreviations and logos.
+% Abbreviations and logos.
\usemodule[abr-03]
-%D Some real macros:
+%D Some real macros:
\def\startAbstract%
{\dostartbuffer[abstract][startAbstract][stopAbstract]}
-%D And some dummies (for \MAPS\ style compatibility):
+%D And some dummies (for \MAPS\ style compatibility):
\def\startKeywords#1\stopKeywords
{}
@@ -150,7 +150,7 @@
\def\Keywords#1%
{}
-%D We will pick up some user settings.
+%D We will pick up some user settings.
\def\DTKTypering[#1]%
{\getparameters
@@ -182,19 +182,19 @@
\setupheadertexts [\DTKTitel] [\pagenumber]
\setupfootertexts [\DTKFooter] []
-%D It all starts here:
+%D It all starts here:
\def\dostartBijdrage[#1]%
{\pagina
\DTKTypering[#1]
\setupheader[\c!status=\v!leeg]
- \stelpaginanummerin[\c!nummer=\DTKPagina]
+ \setuppagenumber[\c!nummer=\DTKPagina]
\bgroup
\setupwhitespace[\v!geen]
\bgroup
\switchtobodyfont[14.4pt,ss]
\setupalign[\v!rechts]
- \let\\=\par
+ \let\\=\par
\DTKTitel\par
\doifsomething{\DTKSubtitel}
{\bgroup
@@ -206,8 +206,8 @@
\vskip12pt
\bgroup
\switchtobodyfont[12pt,ss]
- \def\\{\unskip\space\ignorespaces}
- \DTKAuteur
+ \def\\{\unskip\space\ignorespaces}
+ \DTKAuteur
\par
\egroup
\vskip12pt
@@ -252,6 +252,6 @@
\c!voor=,
\c!na=]
-%D Done.
+%D Done.
\protect \endinput
diff --git a/tex/context/base/s-map-01.tex b/tex/context/base/s-map-01.tex
index f99a874e8..9250b20ae 100644
--- a/tex/context/base/s-map-01.tex
+++ b/tex/context/base/s-map-01.tex
@@ -1,5 +1,5 @@
-% This is an old version, I still have to patch the latest
-% changes into this file.
+% This is an old version, I still have to patch the latest
+% changes into this file.
%D \module
%D [ file=s-map-01,
@@ -11,12 +11,12 @@
%D copyright={NTG / MAPS}]
%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 The \MAPS\ layout is designed by Taco Hoekwater and Siep
-%D Kroonenberg, who on behalf of the \MAPS/\NTG\ own the
-%D copyright to the design.
+%D The \MAPS\ layout is designed by Taco Hoekwater and Siep
+%D Kroonenberg, who on behalf of the \MAPS/\NTG\ own the
+%D copyright to the design.
%D In deze file wordt zowel de dubbelzijdig als de enkelzijdige
%D layout van de \MAPS\ gedefinieerd. Naast deze file
@@ -71,7 +71,7 @@
%
%\stopnotmode
-%D We gebruiken echte small caps:
+%D We gebruiken echte small caps:
\stelsorterenin
[logo]
@@ -418,7 +418,7 @@
\haalbuffer[s-maps-1] % see later on
\fi
\setupheader[\c!status=\v!leeg]
- \stelpaginanummerin[\c!nummer=\MapsPagina]
+ \setuppagenumber[\c!nummer=\MapsPagina]
\setuplayout[\c!grid=\MapsGrid]
\ifgridsnapping % nog controleren
\setupblank[\v!regel]
@@ -448,10 +448,10 @@
\bgroup
\forgetall
\kern 7.5pt
- \ifMapsInKolommen
- \setupalign[\v!links]
+ \ifMapsInKolommen
+ \setupalign[\v!links]
\else
- \setupalign[\v!rechts]
+ \setupalign[\v!rechts]
\fi
{\bf\MapsTitel\par}
{\bfx\MapsSubtitel\par}
@@ -551,7 +551,7 @@
\c!tussen=]
%D Gezien het brede karakter van de \MAPS\ gebruiken we andere
-%D waarden voor links geraffeld uitlijnen. The low level macro
+%D waarden voor links geraffeld uitlijnen. The low level macro
%D used here is subjected to changes!
\def\raggedleft%
diff --git a/tex/context/base/setupb.tex b/tex/context/base/setupb.tex
index 9d934fdd9..666971b4f 100644
--- a/tex/context/base/setupb.tex
+++ b/tex/context/base/setupb.tex
@@ -3062,7 +3062,7 @@
\startsetup
\command
- [\y!definieermarkering]
+ [\y!definemarking]
\type
[\c!val!\c!opt!\c!val!]
\value
@@ -3075,7 +3075,7 @@
\startsetup
\command
- [\y!koppelmarkering]
+ [\y!couplemarking]
\type
[\c!val!\c!val!]
\value
@@ -3088,7 +3088,7 @@
\startsetup
\command
- [\y!ontkoppelmarkering]
+ [\y!decouplemarking]
\type
[\c!val!]
\value
@@ -3098,7 +3098,7 @@
\startsetup
\command
- [\y!resetmarkering]
+ [\y!resetmarking]
\type
[\c!val!]
\value
@@ -3108,7 +3108,7 @@
\startsetup
\command
- [\y!stelmarkeringin]
+ [\y!setupmarking]
\type
[\c!val!\c!var!]
\value
@@ -3143,7 +3143,7 @@
\startsetup
\command
- [\y!haalmarkering]
+ [\y!getmarking]
\type
[\c!val!\c!val!]
\value
@@ -3156,7 +3156,7 @@
\startsetup
\command
- [\y!geenmarkering]
+ [\y!nomarking]
\type
[\c!arg!]
\value
@@ -4701,7 +4701,7 @@
\startsetup
\command
- [\y!stelpaginanummerin]
+ [\y!setuppagenumber]
\type
[\c!vars!]
\variable
@@ -4716,7 +4716,7 @@
\startsetup
\command
- [\y!stelsubpaginanummerin]
+ [\y!setupsubpagenumber]
\type
[\c!vars!]
\variable
@@ -4822,6 +4822,10 @@
[\c!rugwit]
[\c!dimension!]
[0pt]
+ \variable
+ [\c!optie]
+ [\c!max,\v!passend]
+ [\c!max]
\stopsetup
\startsetup
diff --git a/tex/context/base/spec-fdf.tex b/tex/context/base/spec-fdf.tex
index f8d04ed03..0a4013b6f 100644
--- a/tex/context/base/spec-fdf.tex
+++ b/tex/context/base/spec-fdf.tex
@@ -2854,8 +2854,11 @@
%D
%D Scaling is rather straightforward:
-\def\doPDFstartscaling#1#2%
- {\PDFcode{q #1\space 0 0 #2\space 0 0 cm}}
+\def\@@PDFzeroscale{.0001}
+
+\def\doPDFstartscaling#1#2% the test is needed because acrobat is bugged!
+ {\PDFcode{q \ifdim#1\points=\zeropoint\@@PDFzeroscale\else#1\fi\space 0 0
+ \ifdim#2\points=\zeropoint\@@PDFzeroscale\else#2\fi\space 0 0 cm}}
\def\doPDFstopscaling%
{\PDFcode{Q}}
diff --git a/tex/context/base/supp-box.tex b/tex/context/base/supp-box.tex
index a8bf8ba6c..847e76167 100644
--- a/tex/context/base/supp-box.tex
+++ b/tex/context/base/supp-box.tex
@@ -1276,7 +1276,7 @@
%D When needed, spacing can be suppressed by \type
%D {\nothingbetweenisolatedwords}.
-\newif\ifisolatedwords
+\newif\ifisolatedwords % public, e.g. used in core-ref
\def\betweenisolatedwords
{\hskip\currentspaceskip}
@@ -1286,13 +1286,17 @@
\newskip\isolatedlastskip
+\chardef\isolatedwordsmode=0 % no nesting
+
\def\processisolatedwords#1#2% todo: vbox ipv hbox ivm afbreken!
{\bgroup % todo: doloop
\fakecompoundhyphen
\mindermeldingen
\forgetall
\nopenalties
- \def\processisolatedwords##1##2{##2{##1}}% we split only once
+ \ifcase\isolatedwordsmode
+ \def\processisolatedwords##1##2{##2{##1}}% we split only once
+ \fi
\global\let\localbetweenisolatedwords\betweenisolatedwords
\setbox0\normalhbox % we default to spaces, but from inside out
{\ignorespaces#1% \localbetweenisolatedwords can be overruled
diff --git a/tex/context/base/supp-mis.tex b/tex/context/base/supp-mis.tex
index 20bb1f8f5..2f169dd0d 100644
--- a/tex/context/base/supp-mis.tex
+++ b/tex/context/base/supp-mis.tex
@@ -186,11 +186,14 @@
\ifnocontextobject \thousandpoint \do \newdimen \thousandpoint \fi
-\thousandpoint=1000pt
-\zeropoint = 0pt
-\onepoint = 1pt
-\onebasepoint = 1bp
-\minusone = -1
+\ifnocontextobject \onerealpoint \do \newdimen \onerealpoint \fi % latex has a funny \onepoint
+
+\thousandpoint = 1000pt
+\zeropoint = 0pt
+\onepoint = 1pt
+\onebasepoint = 1bp
+\minusone = -1
+\onerealpoint = 1pt
\ifnocontextobject \emptytoks \do \newtoks \emptytoks \fi
diff --git a/tex/context/base/supp-pdf.tex b/tex/context/base/supp-pdf.tex
index d79e2e715..e5a9dc371 100644
--- a/tex/context/base/supp-pdf.tex
+++ b/tex/context/base/supp-pdf.tex
@@ -1858,7 +1858,15 @@
\doprocessMPtoPDFfile}
\def\doprocessMPtoPDFfile#1#2#3% file xscale yscale
- {\setMPspecials
+ {% the following line is needed for latex where onepoint is not
+ % onepoint but a number (maxdimen); some day i'll make a latex
+ % variant of this file so that i no longer have to deal with such
+ % issues; then i'll also speed up this module using a few context
+ % tricks
+ %
+ \let\onepoint\onerealpoint
+ %
+ \setMPspecials
\the\everyMPtoPDFconversion
\catcode`\^^M=\@@endofline
\startMPscanning
diff --git a/tex/context/base/supp-vis.tex b/tex/context/base/supp-vis.tex
index bf982d82f..93bb5126e 100644
--- a/tex/context/base/supp-vis.tex
+++ b/tex/context/base/supp-vis.tex
@@ -8,8 +8,8 @@
%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 \gdef\ShowBufferedExample% private typeseting macro
%D {\startregelcorrectie
@@ -53,8 +53,8 @@
%D that does not support buffering. In \CONTEXT\ we show the
%D commands in the margin, use bit more advanced way of
%D numbering, and typeset the source in \TEX nicolored
-%D verbatim. Sorry for this inconvenience.\fi
-%D
+%D verbatim. Sorry for this inconvenience.\fi
+%D
%D Depending on my personal needs and those of whoever uses it,
%D the macros will be improved in terms of visualization,
%D efficiency and compatibility. These rather low level
@@ -62,7 +62,7 @@
%D visualize baselines, the page layout and whatever deserves
%D attention. Most of those macros can be found in \type
%D {core-vis} and other core modules. Their integration in
-%D \CONTEXT\ prohibits generic applications.
+%D \CONTEXT\ prohibits generic applications.
\ifx \undefined \writestatus \input supp-mis.tex \fi
@@ -124,10 +124,10 @@
%D \macros
%D {normaloffinterlineskip}
%D
-%D The next hack is needed because in \CONTEXT\ we redefine
-%D \type{\offinterlineskip}.
+%D The next hack is needed because in \CONTEXT\ we redefine
+%D \type{\offinterlineskip}.
-\ifx\undefined\normaloffinterlineskip
+\ifx\undefined\normaloffinterlineskip
\let\normaloffinterlineskip\offinterlineskip
\fi
@@ -141,10 +141,10 @@
%D baseline behavior. Especially \type{\vtop}'s need our
%D special attention.
-\ifx \normalhbox \undefined \let \normalhbox = \hbox \fi
-\ifx \normalvbox \undefined \let \normalvbox = \vbox \fi
-\ifx \normalvtop \undefined \let \normalvtop = \vtop \fi
-\ifx \normalvcenter \undefined \let \normalvcenter = \vcenter \fi
+\ifx \normalhbox \undefined \let \normalhbox = \hbox \fi
+\ifx \normalvbox \undefined \let \normalvbox = \vbox \fi
+\ifx \normalvtop \undefined \let \normalvtop = \vtop \fi
+\ifx \normalvcenter \undefined \let \normalvcenter = \vcenter \fi
%D \macros
%D {normalhskip,
@@ -238,14 +238,14 @@
%D option off in those (unpredictable) situations, we just
%D redefine a few \PLAIN\ macros.
-\ifx\tlap\undefined
+\ifx\tlap\undefined
\def\rlap#1{\normalhbox to \zeropoint{#1\normalhss}}
\def\llap#1{\normalhbox to \zeropoint{\normalhss#1}}
\def\blap#1{\normalvbox to \zeropoint{#1\normalvss}}
\def\tlap#1{\normalvbox to \zeropoint{\normalvss#1}}
-\fi
+\fi
\def~{\normalpenalty\!!tenthousand\ }
@@ -253,9 +253,9 @@
%D {makeruledbox}
%D
%D Ruled boxes can be typeset is many ways. Here we present
-%D just one alternative. This implementation may be a little
-%D complicated, but it supports all three kind of boxes. The
-%D next command expects a \BOX\ specification, like:
+%D just one alternative. This implementation may be a little
+%D complicated, but it supports all three kind of boxes. The
+%D next command expects a \BOX\ specification, like:
%D
%D \starttypen
%D \makeruledbox0
@@ -263,9 +263,9 @@
%D \macros
%D {baselinerule,baselinefill}
-%D
+%D
%D We can make the baseline of a box visible, both dashed and
-%D as a rule. The line is drawn on top of the baseline. All
+%D as a rule. The line is drawn on top of the baseline. All
%D we have to say is:
%D
%D \starttypen
@@ -281,7 +281,7 @@
%D \macros
%D {iftoprule,ifbottomrule,ifleftrule,ifrightrule}
-%D
+%D
%D Rules can be turned on and off, but by default we have:
%D
%D \starttypen
@@ -300,7 +300,7 @@
%D \macros
%D {boxrulewidth}
-%D
+%D
%D The width in the surrounding rules can be specified by
%D assigning an apropriate value to the dimension used. This
%D module defaults the width to:
@@ -389,21 +389,21 @@
%D Just in case one didn't notice: the rules are in fact layed
%D over the box. This way the contents of a box cannot
%D visually interfere with the rules around (upon) it. A more
-%D advanced version of ruled boxes can be found in one of the
-%D core modules of \CONTEXT. There we take offsets, color,
+%D advanced version of ruled boxes can be found in one of the
+%D core modules of \CONTEXT. There we take offsets, color,
%D rounded corners, backgrounds and alignment into account too.
%D \macros
%D {ruledhbox,
%D ruledvbox,ruledvtop,
%D ruledvcenter}
-%D
+%D
%D These macro's can be used instead of \type{\hbox},
%D \type{\vbox}, \type{\vtop} and, when in math mode,
%D \type{\vcenter}. They just do what their names state. Using
%D an auxiliary macro would save us a few words of memory, but
-%D it would make their appearance even more obscure.
-%D
+%D it would make their appearance even more obscure.
+%D
%D \startbuffer
%D \hbox
%D {\strut
@@ -459,11 +459,11 @@
%D \startbuffer
%D \hbox
-%D {$\vcenter{\hsize.2\hsize
+%D {$\vcenter{\hsize.2\hsize
%D alfa \par beta}$
-%D $\vcenter to 3cm{\hsize.2\hsize
+%D $\vcenter to 3cm{\hsize.2\hsize
%D alfa \par beta \par gamma}$
-%D $\vcenter{\hsize.2\hsize
+%D $\vcenter{\hsize.2\hsize
%D alfa \par beta}$}
%D \stopbuffer
%D
@@ -562,6 +562,33 @@
\negativefalse \else
\negativetrue \fi}
+% etex
+%
+% \def\investigateskip#1%
+% {\relax
+% \ifdim\scratchskip=\zeropoint
+% \ifdim\gluestretch\scratchskip=\zeropoint
+% \ifdim\glueshrink\scratchskip=\zeropoint
+% \flexiblefalse
+% \else
+% \flexibletrue
+% \fi
+% \else
+% \flexibletrue
+% \fi
+% \else
+% \flexibletrue
+% \fi
+% \ifdim#1=\zeropoint\relax
+% \zerotrue \else
+% \zerofalse \fi
+% \ifdim#1<\zeropoint\relax
+% \positivefalse \else
+% \positivetrue \fi
+% \ifdim#1>\zeropoint\relax
+% \negativefalse \else
+% \negativetrue \fi}
+
\def\investigatecount#1%
{\relax
\flexiblefalse
@@ -610,32 +637,32 @@
%D \macros
%D {ifcenteredvcue,normalvcue}
%D
-%D Depending on the context, one can force visual vertical cues
-%D being centered along \type{\hsize} or being put at the
-%D current position. Although centering often looks better,
-%D we've chosen the second alternative as default. The main
-%D reason for doing so is that often when we don't set the
-%D \type{\hsize} ourselves, \TEX\ takes the value of the
-%D surrounding box. As a result the visual cues can migrate
-%D outside the current context.
-%D
-%D This behavior is accomplished by a small but effective
-%D auxiliary macro, which behavior can be influenced by the
-%D boolean \type{\centeredvcue}. By saying
-%D
-%D \starttypen
+%D Depending on the context, one can force visual vertical cues
+%D being centered along \type{\hsize} or being put at the
+%D current position. Although centering often looks better,
+%D we've chosen the second alternative as default. The main
+%D reason for doing so is that often when we don't set the
+%D \type{\hsize} ourselves, \TEX\ takes the value of the
+%D surrounding box. As a result the visual cues can migrate
+%D outside the current context.
+%D
+%D This behavior is accomplished by a small but effective
+%D auxiliary macro, which behavior can be influenced by the
+%D boolean \type{\centeredvcue}. By saying
+%D
+%D \starttypen
%D \centeredvcuetrue
%D \stoptypen
-%D
-%D one turns centering on. As said, we turn it off.
+%D
+%D one turns centering on. As said, we turn it off.
\newif\ifcenteredvcue \centeredvcuefalse
\def\normalvcue#1%
{\normalhbox \ifcenteredvcue to \hsize \fi {\normalhss#1\normalhss}}
-%D We could have used the more robust version
-%D
+%D We could have used the more robust version
+%D
%D \starttypen
%D \def\normalvcue%
%D {\normalhbox \ifcenteredvcue to \hsize \fi
@@ -643,9 +670,9 @@
%D \aftergroup\normalhss\aftergroup\egroup
%D \let\next=}
%D \stoptypen
-%D
-%D or the probably best one:
-%D
+%D
+%D or the probably best one:
+%D
%D \starttypen
%D \def\normalvcue%
%D {\hbox \ifcenteredvcue to \hsize
@@ -656,9 +683,9 @@
%D \fi
%D \let\next=}
%D \stoptypen
-%D
-%D Because we don't have to preserve \CATCODES\ and only use
-%D small arguments, we stick to the first alternative.
+%D
+%D Because we don't have to preserve \CATCODES\ and only use
+%D small arguments, we stick to the first alternative.
%D \macros
%D {testrulewidth}
@@ -681,11 +708,11 @@
%D \macros
%D {visiblestretch}
-%D
+%D
%D A second variable is introduced because of the stretch
%D components of \SKIPS. At the cost of some accuracy we can
-%D make this stretch visible.
-%D
+%D make this stretch visible.
+%D
%D \starttypen
%D \visiblestretchtrue
%D \stoptypen
@@ -736,8 +763,8 @@
\egroup}
%D The horizontal fillers differ in their boundary
-%D visualization. Watch the small dots. Fillers can be
-%D combined within reasonable margins.
+%D visualization. Watch the small dots. Fillers can be
+%D combined within reasonable margins.
%D
%D \startregelcorrectie
%D \baselinerulefalse
@@ -761,7 +788,7 @@
%D \baselinerulefalse
%D \ruledhbox to \hsize
%D {\strut
-%D \type{\hfil}\type{\hfil}\ruledhfil\ruledhfil
+%D \type{\hfil}\type{\hfil}\ruledhfil\ruledhfil
%D test%
%D \ruledhfil\type{\hfil}}
%D \stopregelcorrectie
@@ -831,12 +858,12 @@
\dontcomplain
\normaloffinterlineskip
\setvisiblevfilbox0\to422%
- \setbox2\normalvcue
+ \setbox2\normalvcue
{\normalhskip -#3\testrulewidth\copy0}%
\smashbox2%
\copy2
\bgroup
- \setbox2\normalvcue
+ \setbox2\normalvcue
{\normalhskip -2\testrulewidth\copy0}%
\smashbox2%
\copy2
@@ -876,9 +903,9 @@
%D {\hsize.18\hsize
%D \type{\vfillneg}\ruledvfillneg last line}}
%D \stopregelcorrectie
-%D
+%D
%D Keep in mind that \type{\vfillneg} is not part of \PLAIN\
-%D \TEX, but are mimmicked by a macro.
+%D \TEX, but are mimmicked by a macro.
\unexpanded\def\ruledvss
{\doruledvfiller\normalvss\normalvfilneg{2}}
@@ -960,7 +987,7 @@
\fi
\normalhfill
\ifflexible
- \normalhskip\ifnegative\else-\fi\scratchskip
+ \normalhskip\ifnegative\else-\fi\scratchskip
\normalhskip2\testrulewidth
\cleaders
\normalhbox
@@ -1064,9 +1091,9 @@
%D
%D \ShowBufferedExample
%D
-%D We have to postpone \type{\prevdepth}. Although this
-%D precaution probably is not completely waterproof, it works
-%D quite well.
+%D We have to postpone \type{\prevdepth}. Although this
+%D precaution probably is not completely waterproof, it works
+%D quite well.
\def\dodoruledvskip
{\nextdepth\prevdepth
@@ -1122,12 +1149,12 @@
\smashbox0%
\fi
\ifvisiblestretch
- \ifflexible
- \skip2\scratchskip
+ \ifflexible
+ \skip2\scratchskip
\advance\skip2 -1\scratchskip
- \divide\skip2 2
- \advance\scratchskip -\skip2
- \normalvskip\skip2
+ \divide\skip2 2
+ \advance\scratchskip -\skip2
+ \normalvskip\skip2
\fi
\fi
\normalpenalty\!!tenthousand
@@ -1180,8 +1207,8 @@
%D
%D Positive and negative kerns are placed on top or below the
%D baseline, so we are able to track their added result. We
-%D didn't mention spacings of 0~pt yet. Zero values are
-%D visualized a bit different, because we want to see them
+%D didn't mention spacings of 0~pt yet. Zero values are
+%D visualized a bit different, because we want to see them
%D anyhow.
\def\doruledhkern
@@ -1255,8 +1282,8 @@
%D
%D \ShowBufferedExample
%D
-%D Like before, we have to postpone \type{\prevdepth}. If we
-%D leave out this trick, we got ourselves some wrong spacing.
+%D Like before, we have to postpone \type{\prevdepth}. If we
+%D leave out this trick, we got ourselves some wrong spacing.
\def\dodoruledvkern
{\nextdepth\prevdepth
@@ -1299,7 +1326,7 @@
\smashbox0%
\setbox0\normalvbox
{\ifnegative\normalvskip\scratchskip\fi
- \normalvcue
+ \normalvcue
{\ifnegative\normalhskip-16\testrulewidth\fi\box0}}%
\smashbox0%
\normalpenalty\!!tenthousand
@@ -1332,7 +1359,7 @@
\normalkern}
%D A a bit more \TEX nice solution is:
-%D
+%D
%D \starttypen
%D \unexpanded\def\ruledkern%
%D {\csname ruled\ifvmode v\else h\fi kern\endcsname\normalkern}
@@ -1393,7 +1420,7 @@
\def\doruledvglue
{\endgraf % \par
- \nextdepth\prevdepth
+ \nextdepth\prevdepth
\visualhrule\!!height\zeropoint
\normalpenalty\!!tenthousand
\ruledvkern\normalvskip\scratchskip
@@ -1646,7 +1673,7 @@
\def\doruledvpenalty
{\ifdim\pagegoal=\maxdimen
\else
- \nextdepth\prevdepth
+ \nextdepth\prevdepth
\dontinterfere
\dontcomplain
\investigatecount\scratchcounter
@@ -1673,7 +1700,7 @@
\smashbox0%
\normalpenalty\!!tenthousand
\nointerlineskip
- \dp0\nextdepth % not \prevdepth=\nextdepth
+ \dp0\nextdepth % not \prevdepth=\nextdepth
\normalvbox
{\normalvcue{\box0}}%
\fi
@@ -1692,7 +1719,7 @@
\expandafter\ruledhpenalty
\fi}
-%D At the cost of some more tokens, a bit more clever
+%D At the cost of some more tokens, a bit more clever
%D implementation would be:
%D
%D \starttypen
@@ -1778,19 +1805,19 @@
%D for turning the options on, one for turning them off, and a
%D boolean for enabling the mechanism outside the scope of the
%D user. The first two macros only do their job when we are
-%D actually showing the composition.
+%D actually showing the composition.
%D
%D \starttypen
%D \showingcompositiontrue
%D \showcomposition
%D \stoptypen
-%D
+%D
%D Because the output routine can do tricky things, like
%D multiple column typesetting and manipulation of the
%D pagebody, shifting things around and so on, the macro
%D \type{\dontshowcomposition} best can be called when we enter
%D this routine. Too much visual cues just don't make sense. In
-%D \CONTEXT\ this has been taken care of.
+%D \CONTEXT\ this has been taken care of.
\newif\ifshowingcomposition
@@ -1820,8 +1847,8 @@
%D \showmakeup
%D \stoptypen
%D
-%D For the sake of those who don't (yet) use \CONTEXT\ we
-%D preset \type{\defaulttestrulewidth} to the already set
+%D For the sake of those who don't (yet) use \CONTEXT\ we
+%D preset \type{\defaulttestrulewidth} to the already set
%D value. Otherwise we default to a bodyfontsize related value.
%D
%D \starttypen
@@ -1843,11 +1870,11 @@
\protect
-%D \ifCONTEXT \let\next=\relax \else \let\next=\endinput
+%D \ifCONTEXT \let\next=\relax \else \let\next=\endinput
%D The documented source you have been reading was processed
%D using some surrogate makeup. When this file is processed
%D in \CONTEXT, a few more examples show up here, like a local
-%D table of contents and a local register.
+%D table of contents and a local register.
%D \fi \next
% %D Lets end with some more advanced examples. When visualized,
@@ -1855,15 +1882,15 @@
% %D
% %D {\showmakeup\plaatsinhoud[criterium=vorige]}
% %D
-%D Lets end with some more advanced examples.
-%D Definitions and enumerations come in many flavors. The
-%D next one for instance is defined as:
+%D Lets end with some more advanced examples.
+%D Definitions and enumerations come in many flavors. The
+%D next one for instance is defined as:
%D
%D \starttypen
%D \definedescription[test][place=left,hang=3,width=6em]
%D \stoptypen
%D
-%D When applied to some text, this would look like:
+%D When applied to some text, this would look like:
%D
%D \bgroup
%D \showmakeup
@@ -1872,11 +1899,11 @@
%D \test{visual\\debugger} I would be very pleased if \TEX\
%D had two more primitives: \type{\vnop} and \type{\hnop}. Both
%D should act and show up as normal boxes, but stay invisible
-%D for \TEX\ when it's doing calculations. The \type{\vnop}
-%D for instance should not interact with the internal mechanism
+%D for \TEX\ when it's doing calculations. The \type{\vnop}
+%D for instance should not interact with the internal mechanism
%D responsible for the disappearing skips, kerns and penalties
-%D at a pagebreak. As long as we don't have these two boxtypes,
-%D visual debugging will never be perfect.
+%D at a pagebreak. As long as we don't have these two boxtypes,
+%D visual debugging will never be perfect.
%D
%D \egroup
%D
diff --git a/tex/context/base/syst-etx.tex b/tex/context/base/syst-etx.tex
index adb98ba09..d2821de7e 100644
--- a/tex/context/base/syst-etx.tex
+++ b/tex/context/base/syst-etx.tex
@@ -200,7 +200,7 @@
%D But, for critical editions, we may need many more, so
%D here we go again:
-\chardef\@@insallocation=24
+\chardef\@@insallocation=16 % 24
%D My low level allocation macro now comes down to:
diff --git a/tex/context/base/syst-ext.tex b/tex/context/base/syst-ext.tex
index f109eaa75..a613847f5 100644
--- a/tex/context/base/syst-ext.tex
+++ b/tex/context/base/syst-ext.tex
@@ -3932,7 +3932,7 @@
{\futurelet\nexthandledtoken\dodohandletokens}
\long\def\handletokens#1\with#2%
- {\global\let\dododohandletokens#2%
+ {\gdef\dododohandletokens{#2}% permits more complex #2's
\dohandletokens#1\end}
%D A previous version said \type{\docommando=#2}, but to enable
diff --git a/tex/context/base/syst-new.tex b/tex/context/base/syst-new.tex
index b2efa163e..6a167dfa3 100644
--- a/tex/context/base/syst-new.tex
+++ b/tex/context/base/syst-new.tex
@@ -520,7 +520,7 @@
{\if#4"\@EA#1\else\if#4'\@EAEAEA#2\else\@EAEAEA#3\fi\fi#4}
\def\unstringed
- {\dowithstringed\unstringdouble\unstringsingle\unstringnothing}
+ {\dowithstringed\unstringdouble\unstringsingle\unstringspaced}
\long\def\unstringdouble"#1"{#1}
\long\def\unstringsingle'#1'{#1}
diff --git a/tex/context/base/x-contml.tex b/tex/context/base/x-contml.tex
index ed2e069f8..e50fed733 100644
--- a/tex/context/base/x-contml.tex
+++ b/tex/context/base/x-contml.tex
@@ -477,3 +477,5 @@
\defineXMLpickup [combinationcaption]
{\appendtoks\bgroup}{\egroup\to\scratchtoks}
+
+\endinput \ No newline at end of file
diff --git a/tex/context/base/xtag-ini.tex b/tex/context/base/xtag-ini.tex
index 42168e04b..ff475e162 100644
--- a/tex/context/base/xtag-ini.tex
+++ b/tex/context/base/xtag-ini.tex
@@ -26,6 +26,13 @@
\endinput
\endTEX
+% to be moved
+
+\ifx\globalscratchtoks \undefined \newtoks \globalscratchtoks \fi
+\ifx\globalscratchdimen\undefined \newdimen\globalscratchdimen \fi
+
+% tzt nog eens child grabber maken; mooier in mathml
+
%D This module is highly optimized for speed, which sometimes
%D reads to rather unreadable code. Sorry for this.
@@ -695,9 +702,13 @@
\long\def\cleanupXMLarguments
{\ifnum\kindofXMLelement=\emptyXMLtag
\ifx\currentXMLarguments\empty \else
- \@EA\docleanupXMLarguments\currentXMLarguments/ \relax
+ \@EA\docleanupXMLarguments\currentXMLarguments/ \relax
\fi
- \fi}
+ \else\ifnum\kindofXMLelement=\beginXMLtag
+ \ifx\currentXMLarguments\space
+ \let\currentXMLarguments\empty
+ \fi
+ \fi\fi}
% \long\def\docleanupXMLarguments#1/ #2\relax % space added earlier
% {\edef\currentXMLarguments{#1}}
@@ -862,6 +873,9 @@
\csname\@@XMLdepth:\the\numexpr(\XMLdepth-#1)\endcsname
\fi}
+\def\XMLpureparent
+ {\XMLpureancestor\plusone}
+
% \def\XMLpureancestor#1%
% {\csname
% \ifnum\numexpr(\XMLdepth-#1)>\zerocount
@@ -918,10 +932,10 @@
%D \defineXMLenvironment[two]
%D {\beginXMLelement
%D \starttabulate
-%D \NC parent 1 \NC \XMLparent{1} \NC \NR
-%D \NC parent 2 \NC \XMLparent{2} \NC \NR
-%D \NC parent 3 \NC \XMLparent{3} \NC \NR
-%D \NC parent 4 \NC \XMLparent{4} \NC \NR
+%D \NC parent 1 \NC \XMLancestor{1} \NC \NR
+%D \NC parent 2 \NC \XMLancestor{2} \NC \NR
+%D \NC parent 3 \NC \XMLancestor{3} \NC \NR
+%D \NC parent 4 \NC \XMLancestor{4} \NC \NR
%D \stoptabulate}
%D {\endXMLelement}
%D
@@ -1491,8 +1505,6 @@
\def\theXMLarguments#1%
{\ifcsname\@@XMLmap:#1\endcsname\csname\@@XMLmap:#1\endcsname\fi}
-\newtoks\globalscratchtoks
-
\def\doexpandXMLvalue#1#2%
{\ifcsname#2\endcsname
\bgroup
@@ -1567,222 +1579,167 @@
\bgroup \catcode`<=\@@active
-% \long\gdef\dododefineXMLsingular#1#2%
-% {\long\setvalue{\@@XMLelement:#1/}{#2}}
-
\long\gdef\dododefineXMLsingular#1#2%
{\long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2}}
-% \long\gdef\dododefineXMLcommand#1#2%
-% {\long\setvalue{\@@XMLelement:#1/}{#2}%
-% \long\setvalue{\@@XMLelement:#1}{#2}}
-
\long\gdef\dododefineXMLcommand#1#2%
- {\long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2}%
- \long\@EA\def\csname\@@XMLelement:#1\endcsname{#2}}
-
-% \long\gdef\dododefineXMLgrouped#1#2%
-% {\long\setvalue{\@@XMLelement:#1}{\groupedcommand{#2}{}\bgroup}%
-% \long\setvalue{\@@XMLelement:/#1}{\egroup}}
+ {\long\@EA\def\csname\@@XMLelement:#1\endcsname{#2}%
+ \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
+ \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2}}
\long\gdef\dododefineXMLgrouped#1#2%
{\long\@EA\def\csname\@@XMLelement:#1\endcsname{\groupedcommand{#2}\donothing\bgroup}%
- \@EA\let\csname\@@XMLelement:/#1\endcsname\egroup}
-
-% \long\gdef\dododefineXMLargument#1#2% watch the {} around ##1
-% {\long\setvalue{\@@XMLelement:#1/}{#2{}}%
-% \long\setvalue{\@@XMLelement:#1}##1</#1>{#2{##1}}}
-
-% \long\gdef\dododefineXMLargument#1#2% watch the {} around ##1
-% {\long\setvalue{\@@XMLelement:#1/}{#2{}}%
-% \long\setvalue{\@@XMLelement:#1}{\redoXMLargument{#1}{#2}}}
+ \@EA\let\csname\@@XMLelement:/#1\endcsname\egroup
+ \@EA\let\csname\@@XMLelement:#1/\endcsname\donothing}
\long\gdef\dododefineXMLargument#1#2% watch the {} around ##1
- {\long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2{}}%
- \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLargument{#1}{#2}}}
+ {\long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLargument{#1}{#2}}
+ \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
+ \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2{}}}
\long\gdef\redoXMLargument#1#2% potential optimization: globalnext
{\long\@EA\gdef\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>{#2{##1}}%
\next}
-%\long\gdef\dododefineXMLignore#1%
-% {\long\setvalue{\@@XMLelement:#1/}{}%
-% \long\setvalue{\@@XMLelement:#1}##1</#1>{}}
-
-% \long\gdef\dododefineXMLignore#1%
-% {\long\setvalue{\@@XMLelement:#1/}{}%
-% \long\setvalue{\@@XMLelement:#1}{\redoXMLignore{#1}}}
-
\long\gdef\dododefineXMLignore#1%
- {\@EA\let\csname\@@XMLelement:#1/\endcsname\donothing
- \@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLignore{#1}}}
+ {\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLignore{#1}}
+ \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
+ \@EA\let\csname\@@XMLelement:#1/\endcsname\donothing}
\long\gdef\redoXMLignore#1%
{\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>{}%
\next}
-% \long\gdef\dododefineXMLpickup#1#2#3%
-% {\long\setvalue{\@@XMLelement:#1/}{#2#3}%
-% \long\setvalue{\@@XMLelement:#1}##1</#1>{#2##1#3}}
-
-% \long\gdef\dododefineXMLpickup#1#2#3%
-% {\long\setvalue{\@@XMLelement:#1/}{#2#3}%
-% \long\setvalue{\@@XMLelement:#1}{\redoXMLpickup{#1}{#2}{#3}}}
-
\long\gdef\dododefineXMLpickup#1#2#3%
- {\long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2#3}%
- \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLpickup{#1}{#2}{#3}}}
+ {\long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLpickup{#1}{#2}{#3}}
+ \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
+ \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2#3}}
\long\gdef\redoXMLpickup#1#2#3%
{\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>{#2##1#3}%
\next}
-% \long\gdef\dododefineXMLenvironment#1#2#3%
-% {\long\setvalue{\@@XMLelement:#1/}{#2#3}%
-% \long\setvalue{\@@XMLelement:#1}{#2}%
-% \long\setvalue{\@@XMLelement:/#1}{#3}}
-
\long\gdef\dododefineXMLenvironment#1#2#3%
- {\long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2#3}%
- \long\@EA\def\csname\@@XMLelement:#1\endcsname{#2}%
- \long\@EA\def\csname\@@XMLelement:/#1\endcsname{#3}}
-
-% \long\gdef\dododefineXMLsave#1%
-% {\letvalue{\@@XMLdata:#1}\longempty
-% \long\setvalue{\@@XMLelement:#1/}{\long\setvalue{\@@XMLdata:#1}{}}%
-% \long\setvalue{\@@XMLelement:#1}##1</#1>{\long\setvalue{\@@XMLdata:#1}{##1}}}
-
-% \long\gdef\dododefineXMLsave#1%
-% {\letvalue{\@@XMLdata:#1}\longempty
-% \long\setvalue{\@@XMLelement:#1/}{\long\setvalue{\@@XMLdata:#1}{}}%
-% \long\setvalue{\@@XMLelement:#1}{\redoXMLsave{#1}}}
+ {\long\@EA\def\csname\@@XMLelement:#1\endcsname{#2}%
+ \long\@EA\def\csname\@@XMLelement:/#1\endcsname{#3}%
+ \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2#3}}
\long\gdef\dododefineXMLsave#1%
{\@EA\let\csname\@@XMLdata:#1\endcsname\longempty
- \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}%
- \long\@EA\def\csname\@@XMLelement:#1\endcsname {\redoXMLsave{#1}}}
-
-% \long\gdef\dododefineXMLsavecontent#1#2%
-% {\long\setvalue{\@@XMLdata:#1}{#2}%
-% \long\setvalue{\@@XMLelement:#1/}{}%
-% \long\setvalue{\@@XMLelement:#1}{\redoXMLsave{#1}}}
+ \long\@EA\def\csname\@@XMLelement:#1\endcsname {\redoXMLsave{#1}}%
+ \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
+ \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}}
\long\gdef\dododefineXMLsavecontent#1#2%
{\long\@EA\def\csname\@@XMLdata:#1\endcsname{#2}%
- \@EA\let\csname\@@XMLelement:#1/\endcsname\donothing
- \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLsave{#1}}}
+ \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLsave{#1}}%
+ \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
+ \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}}
\gdef\redoXMLsave#1%
{\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>%
{\long\@EA\def\csname\@@XMLdata:#1\endcsname{##1}}%
\next}
-% \long\gdef\dododefineXMLgsave#1%
-% {\letgvalue{\@@XMLdata:#1}\longempty
-% \long\setvalue{\@@XMLelement:#1/}{\long\setgvalue{\@@XMLdata:#1}{}}%
-% \long\setvalue{\@@XMLelement:#1}{\redoXMLgsave{#1}}}
-
\long\gdef\dododefineXMLgsave#1%
{\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty
- \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}%
- \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLgsave{#1}}}
-
-% \long\gdef\dododefineXMLgsavecontent#1#2%
-% {\long\setvalue{\@@XMLdata:#1}{#2}%
-% %\long\setvalue{\@@XMLelement:#1/}{}%
-% \long\setvalue{\@@XMLelement:#1/}{\long\setgvalue{\@@XMLdata:#1}{}}%
-% \long\setvalue{\@@XMLelement:#1}{\redoXMLgsave{#1}}}
+ \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLgsave{#1}}%
+ \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
+ \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}}
\long\gdef\dododefineXMLgsavecontent#1#2%
{\long\@EA\gdef\csname\@@XMLdata:#1\endcsname{#2}%
- \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}%
- \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLgsave{#1}}}
+ \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLgsave{#1}}%
+ \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
+ \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}}
\gdef\redoXMLgsave#1%
{\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>%
{\long\@EA\gdef\csname\@@XMLdata:#1\endcsname{##1}}%
\next}
-% \long\gdef\dododefineXMLenvironmentsave#1#2#3%
-% {\letvalue{\@@XMLdata:#1}\longempty
-% \long\setvalue{\@@XMLelement:#1/}{#2\long\setvalue{\@@XMLdata:#1}{}#3}%
-% \long\setvalue{\@@XMLelement:#1}##1</#1>{#2\long\setvalue{\@@XMLdata:#1}{##1}#3}}
-
-% \long\gdef\dododefineXMLenvironmentsave#1#2#3%
-% {\letvalue{\@@XMLdata:#1}\longempty
-% \long\setvalue{\@@XMLelement:#1/}{#2\long\setvalue{\@@XMLdata:#1}{}#3}%
-% \long\setvalue{\@@XMLelement:#1}{\redoXMLenvironmentsave{#1}{#2}{#3}}}
-
\long\gdef\dododefineXMLenvironmentsave#1#2#3%
{\@EA\let\csname\@@XMLdata:#1\endcsname\longempty
- \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2\@EA\let\csname\@@XMLdata:#1\endcsname\longempty#3}%
- \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLenvironmentsave{#1}{#2}{#3}}}
+ \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLenvironmentsave{#1}{#2}{#3}}%
+ \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
+ \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2\@EA\let\csname\@@XMLdata:#1\endcsname\longempty#3}}
+
+% maybe \globalnext
\gdef\redoXMLenvironmentsave#1#2#3%
{\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>%
{#2\long\@EA\def\csname\@@XMLdata:#1\endcsname{##1}#3}%
\next}
-% \long\gdef\dododefineXMLenvironmentgsave#1#2#3%
-% {\letgvalue{\@@XMLdata:#1}\longempty
-% \long\setvalue{\@@XMLelement:#1/}{#2\long\setgvalue{\@@XMLdata:#1}{}#3}%
-% \long\setvalue{\@@XMLelement:#1}{\redoXMLenvironmentgsave{#1}{#2}{#3}}}
-
\long\gdef\dododefineXMLenvironmentgsave#1#2#3%
{\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty
- \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty#3}%
- \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLenvironmentgsave{#1}{#2}{#3}}}
+ \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLenvironmentgsave{#1}{#2}{#3}}%
+ \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
+ \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty#3}}
\gdef\redoXMLenvironmentgsave#1#2#3%
{\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>%
{#2\long\@EA\gdef\csname\@@XMLdata:#1\endcsname{##1}#3}%
\next}
-% \long\gdef\dododefineXMLprocess#1%
-% {\long\setvalue{\@@XMLelement:#1/}{}%
-% \long\setvalue{\@@XMLelement:#1}{}%
-% \long\setvalue{\@@XMLelement:/#1}{}}
-
-% \long\gdef\dododefineXMLprocess#1%
-% {\letvalue{\@@XMLelement:#1/}\donothing
-% \letvalue{\@@XMLelement:#1}\donothing
-% \letvalue{\@@XMLelement:/#1}\donothing}
-
\long\gdef\dododefineXMLprocess#1%
- {\@EA\let\csname\@@XMLelement:#1/\endcsname\donothing
- \@EA\let\csname\@@XMLelement:#1\endcsname\donothing
- \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing}
-
-% \long\gdef\dododefineXMLnestedenvironment#1#2#3%
-% {\long\setvalue{\@@XMLelement:#1}{\getXMLgroupedenvironment{#1}{#2}{#3}}}
+ {\@EA\let\csname\@@XMLelement:#1\endcsname\donothing
+ \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
+ \@EA\let\csname\@@XMLelement:#1/\endcsname\donothing}
\long\gdef\dododefineXMLnestedenvironment#1#2#3%
{\long\@EA\def\csname\@@XMLelement:#1\endcsname{\getXMLgroupedenvironment{#1}{#2}{#3}}}
-% \long\gdef\dododefineXMLnestedargument#1#2%
-% {\long\setvalue{\@@XMLelement:#1}{\getXMLgroupedargument{#1}{#2}}}
-
\long\gdef\dododefineXMLnestedargument#1#2%
- {\long\@EA\def\csname\@@XMLelement:#1\endcsname{\getXMLgroupedargument{#1}{#2}}}
+ {\long\@EA\def\csname\@@XMLelement:#1\endcsname{\getXMLgroupedargument{#1}{#2}}%
+ \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
+ \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2{}}}
+
+\long\gdef\dododefineXMLnestedsave#1%
+ {\@EA\let\csname\@@XMLdata:#1\endcsname\longempty
+ \long\@EA\def\csname\@@XMLelement:#1\endcsname {\getXMLgroupednestedsave{#1}}%
+ \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
+ \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}}
+
+\long\unexpanded\gdef\getXMLgroupednestedsave#1%
+ {\collectXMLgroupedtrue
+ \long\def\dodogetgrouped{\long\@EA\edef\csname\@@XMLdata:#1\endcsname{\the\groupedtoks}}%
+ \getXMLgrouped{#1}}
+
+\long\gdef\dododefineXMLnestedenvironmentsave#1#2#3%
+ {\@EA\let\csname\@@XMLdata:#1\endcsname\longempty
+ \long\@EA\def\csname\@@XMLelement:#1\endcsname {\getXMLgroupednestedenvironmentsave{#1}{#2}{#3}}%
+ \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
+ \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2\@EA\let\csname\@@XMLdata:#1\endcsname\longempty#3}}
+
+\long\unexpanded\gdef\getXMLgroupednestedenvironmentsave#1#2#3%
+ {\collectXMLgroupedtrue
+ \long\def\dodogetgrouped{#2\long\@EA\edef\csname\@@XMLdata:#1\endcsname{\the\groupedtoks}#3}%
+ \getXMLgrouped{#1}}
\egroup
%D The high level definition macros.
-\def\defineXMLsingular {\dotripleempty\dodefineXMLsingular}
-\def\defineXMLcommand {\dotripleempty\dodefineXMLcommand}
-\def\defineXMLgrouped {\dotripleempty\dodefineXMLgrouped}
-\def\defineXMLargument {\dotripleempty\dodefineXMLargument}
-\def\defineXMLignore {\dotripleempty\dodefineXMLignore}
-\def\defineXMLpickup {\dotripleempty\dodefineXMLpickup}
-\def\defineXMLenvironment {\dotripleempty\dodefineXMLenvironment}
-\def\defineXMLsave {\dotripleempty\dodefineXMLsave}
-\def\defineXMLsavecontent {\dotripleempty\dodefineXMLsavecontent}
-\def\defineXMLgsave {\dotripleempty\dodefineXMLgsave}
-\def\defineXMLgsavecontent {\dotripleempty\dodefineXMLgsavecontent}
-\def\defineXMLenvironmentsave {\dotripleempty\dodefineXMLenvironmentsave}
-\def\defineXMLenvironmentgsave{\dotripleempty\dodefineXMLenvironmentgsave}
-\def\defineXMLprocess {\dotripleempty\dodefineXMLprocess}
+\def\defineXMLsingular {\dotripleempty\dodefineXMLsingular}
+\def\defineXMLcommand {\dotripleempty\dodefineXMLcommand}
+\def\defineXMLgrouped {\dotripleempty\dodefineXMLgrouped}
+\def\defineXMLargument {\dotripleempty\dodefineXMLargument}
+\def\defineXMLignore {\dotripleempty\dodefineXMLignore}
+\def\defineXMLpickup {\dotripleempty\dodefineXMLpickup}
+\def\defineXMLenvironment {\dotripleempty\dodefineXMLenvironment}
+\def\defineXMLsave {\dotripleempty\dodefineXMLsave}
+\def\defineXMLsavecontent {\dotripleempty\dodefineXMLsavecontent}
+\def\defineXMLgsave {\dotripleempty\dodefineXMLgsave}
+\def\defineXMLgsavecontent {\dotripleempty\dodefineXMLgsavecontent}
+\def\defineXMLenvironmentsave {\dotripleempty\dodefineXMLenvironmentsave}
+\def\defineXMLenvironmentgsave {\dotripleempty\dodefineXMLenvironmentgsave}
+\def\defineXMLprocess {\dotripleempty\dodefineXMLprocess}
+\def\defineXMLnested {\dotripleempty\dodefineXMLnestedenvironment}
+\def\defineXMLnestedenvironment {\dotripleempty\dodefineXMLnestedenvironment}
+\def\defineXMLnestedargument {\dotripleempty\dodefineXMLnestedargument}
+\def\defineXMLnestedsave {\dotripleempty\dodefineXMLnestedsave}
+\def\defineXMLnestedenvironmentsave{\dotripleempty\dodefineXMLnestedenvironmentsave}
% push is (not yet) a real push, so:
@@ -1791,10 +1748,6 @@
% goes for all types
-\def\defineXMLnested {\dotripleempty\dodefineXMLnestedenvironment}
-\def\defineXMLnestedenvironment{\dotripleempty\dodefineXMLnestedenvironment}
-\def\defineXMLnestedargument {\dotripleempty\dodefineXMLnestedargument}
-
\long\def\dodefineXMLsingular[#1][#2][#3]#4%
{\defineXMLmethod\dododefineXMLsingular{#1}{#2}{#3}{#4}{}}
@@ -1843,6 +1796,12 @@
\long\def\dodefineXMLnestedargument[#1][#2][#3]#4%
{\defineXMLmethod\dododefineXMLnestedargument{#1}{#2}{#3}{#4}{}}
+\long\def\dodefineXMLnestedsave[#1][#2][#3]%
+ {\defineXMLmethod\dododefineXMLnestedsave{#1}{#2}{#3}{}{}}
+
+\long\def\dodefineXMLnestedenvironmentsave[#1][#2][#3]#4#5%
+ {\defineXMLmethod\dododefineXMLnestedenvironmentsave{#1}{#2}{#3}{#4}{#5}}
+
% [key=val] => \presetXMLarguments{element} => default key/vals
% [blabla] => \theXMLarguments{blabla} => user key/vals
% [blabla] [key=val] => \presetXMLarguments{element} => default key/vals
@@ -2040,8 +1999,13 @@
%D We can pick up key|/|value pairs, but we still need a way
%D to process these.
-\def\mapXMLvalue#1#2#3% td align center -> middle
- {\setvalue{\@@XMLvalue:#1:#2:#3}}
+% bugged
+%
+% \def\mapXMLvalue#1#2#3% td align center -> middle
+% {\setvalue{\@@XMLvalue:#1:#2:#3}}
+
+\def\mapXMLvalue#1#2#3% td:align center -> middle
+ {\setvalue{\@@XMLvalue:#1:#2}{#3}} % keep #3 to grab spaces
\def\XMLvar#1#2#3% td align center
{\ifcsname\@@XMLvariable:#1:#2\endcsname
@@ -2054,12 +2018,22 @@
% {\XMLval{#1}{#2}{\ifcsname\@@XMLvariable:#1:#2\endcsname
% \csname\@@XMLvariable:#1:#2\endcsname\else#3\fi}}
-\def\XMLval#1#2#3%
+% \def\XMLval#1#2#3% td:align value default
+% {\ifcsname\@@XMLvalue:#1:#2\endcsname
+% \csname\@@XMLvalue:#1:#2\endcsname
+% \else
+% #3%
+% \fi}
+%
+% The next one permits commands instead of strings in #3
+
+\def\XMLval#1#2% #1=td:align #2=value #3=default
{\ifcsname\@@XMLvalue:#1:#2\endcsname
- \csname\@@XMLvalue:#1:#2\endcsname
+ \@EA\firstoftwoarguments
\else
- #3%
- \fi}
+ \@EA\secondoftwoarguments
+ \fi
+ {\csname\@@XMLvalue:#1:#2\endcsname}}
\def\XMLpar#1#2#3%
{\ifcsname\@@XMLvariable:#1:#2\endcsname
@@ -2173,10 +2147,14 @@
\def\ownXMLelement{\rawXMLnamespace\rawXMLidentifier}
\def\XMLop#1% ownpar
- {\csname\@@XMLvariable:\ownXMLelement:#1\endcsname}
+ {\csname\ifcsname\@@XMLvariable:\ownXMLelement:#1\endcsname
+ \@@XMLvariable:\ownXMLelement:#1\else\s!empty
+ \fi\endcsname}
\def\XMLtp#1% texpar
- {\csname\@@XMLmapmap\interfaced{#1}\endcsname}
+ {\csname\ifcsname\@@XMLmapmap\interfaced{#1}\endcsname
+ \@@XMLmapmap\interfaced{#1}\else\s!empty
+ \endcsname\fi}
\def\doifelseXMLop#1{\doifelse{\XMLop{#1}}}
\def\doifXMLop #1{\doif {\XMLop{#1}}}
@@ -2195,6 +2173,8 @@
\def\doifnothingXMLtp #1{\doifnothing {\XMLtp{#1}}}
\def\XMLflushself{\csname\@@XMLdata:\ownXMLelement\endcsname}
+
+\def\showXMLdata#1{\showvalue{\@@XMLdata:#1}}
\def\XMLta {\theXMLarguments\@@XMLmapmap}
\def\getXMLta {\expanded{\getparameters[\@@XMLmapmap][\XMLta]}}
diff --git a/tex/context/base/xtag-pre.tex b/tex/context/base/xtag-pre.tex
index c478d1dea..1c5933f3e 100644
--- a/tex/context/base/xtag-pre.tex
+++ b/tex/context/base/xtag-pre.tex
@@ -134,14 +134,27 @@
%D Watch this rather obscure definition (we need to pass an
%D \type {[} to the macro.
-% \defineXMLescape [{CDATA[}]
-% {\skipfirstverbatimlinefalse
-% \processtaggeddisplayverbatim{]]>}}
+\chardef\XMLcdatamethod=1
-\defineXMLescape [CDATA]
+\newtoks \everyXMLcdata % \appendtoks \tt \to \everyXMLcdata
+
+\setvalue{XMLcdatamethod1}%
{\skipfirstverbatimlinefalse
\processtaggeddisplayverbatim{]]>}}
+\setvalue{XMLcdatamethod2}%
+ {\begingroup
+ \obeylines
+ \obeyspaces
+ \the\everyXMLcdata
+ \processXMLcdata}
+
+\long\def\processXMLcdata#1]]>%
+ {#1\endgroup}
+
+\defineXMLescape [CDATA]
+ {\executeifdefined{XMLcdatamethod\number\XMLcdatamethod}{\begingroup\processXMLcdata}}
+
%D \starttypen
%D <!ENTITY crap "very new [&#x7B;] crap">
%D <!ENTITY crap SYSTEM "crapfile.xml">
diff --git a/tex/context/base/xtag-run.tex b/tex/context/base/xtag-run.tex
index b187f7817..bc88b5cc3 100644
--- a/tex/context/base/xtag-run.tex
+++ b/tex/context/base/xtag-run.tex
@@ -116,10 +116,13 @@
\ifnum\kindofXMLelement=2\string/\fi
\currentXMLelement
\stopcolor
- \ifcase#1\or\ifx\currentXMLarguments\empty\else
- \cleanupXMLarguments
- \startcolor[xtag:0]\hbox{\space}\showXMLarguments\unskip\stopcolor
- \fi\fi
+ \ifcase#1\or
+ \cleanupXMLarguments % get rid of spurious end space and end /
+ \ifx\currentXMLarguments\empty\else
+ \setbox\scratchbox\hbox{\space}\hskip\wd\scratchbox % hm, slow
+ \startcolor[xtag:0]\showXMLarguments\unskip\stopcolor\unskip
+ \fi
+ \fi
\startcolor[xtag:\ifnum\scratchcounter<0 0\else\number\scratchcounter\fi]%
\ifnum\kindofXMLelement=3\string/\fi
\string>%
@@ -227,6 +230,7 @@
\enableXML\verbatimXML
\enableregime[utf]%
\chardef\utfunicodetracer8
+ \veryraggedright
\readfile{\truefilename{#1}}\donothing\donothing\endgraf
\removelastskip % really needed
\stopopelkaar