summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2003-08-08 00:00:00 +0200
committerHans Hagen <pragma@wxs.nl>2003-08-08 00:00:00 +0200
commit3f9c44091f54eb858cfbb71b6346445e606b8687 (patch)
tree9e30c9fe11ef8906f5c8717a8c42c9fb70ee40c1
parent91f5bdb707b063e6e7acc31073db4cc17bd66593 (diff)
downloadcontext-3f9c44091f54eb858cfbb71b6346445e606b8687.tar.gz
stable 2003.08.08
-rw-r--r--context/config/texexec.rme3
-rw-r--r--context/perltk/texexec.pl474
-rw-r--r--context/perltk/texexec.rme3
-rw-r--r--context/perltk/texfont.pl248
-rw-r--r--tex/context/base/colo-ini.tex22
-rw-r--r--tex/context/base/colo-pra.tex2
-rw-r--r--tex/context/base/colo-rgb.tex2
-rw-r--r--tex/context/base/colo-run.tex2
-rw-r--r--tex/context/base/colo-xwi.tex2
-rw-r--r--tex/context/base/cont-new.tex293
-rw-r--r--tex/context/base/context.tex2
-rw-r--r--tex/context/base/core-box.tex6
-rw-r--r--tex/context/base/core-des.tex181
-rw-r--r--tex/context/base/core-fig.tex31
-rw-r--r--tex/context/base/core-grd.tex91
-rw-r--r--tex/context/base/core-ins.tex2
-rw-r--r--tex/context/base/core-int.tex42
-rw-r--r--tex/context/base/core-itm.tex7
-rw-r--r--tex/context/base/core-lst.tex4
-rw-r--r--tex/context/base/core-mis.tex22
-rw-r--r--tex/context/base/core-new.tex2
-rw-r--r--tex/context/base/core-not.tex4
-rw-r--r--tex/context/base/core-ntb.tex58
-rw-r--r--tex/context/base/core-ref.tex28
-rw-r--r--tex/context/base/core-reg.tex9
-rw-r--r--tex/context/base/core-rul.tex2
-rw-r--r--tex/context/base/core-sec.tex29
-rw-r--r--tex/context/base/core-spa.tex175
-rw-r--r--tex/context/base/core-syn.tex4
-rw-r--r--tex/context/base/core-sys.tex50
-rw-r--r--tex/context/base/core-tbl.tex9
-rw-r--r--tex/context/base/enco-ans.tex8
-rw-r--r--tex/context/base/enco-def.tex2
-rw-r--r--tex/context/base/enco-ec.tex2
-rw-r--r--tex/context/base/enco-ecm.tex2
-rw-r--r--tex/context/base/enco-il2.tex2
-rw-r--r--tex/context/base/enco-mis.tex2
-rw-r--r--tex/context/base/enco-pdf.tex2
-rw-r--r--tex/context/base/enco-pol.tex2
-rw-r--r--tex/context/base/enco-run.tex4
-rw-r--r--tex/context/base/enco-tbo.tex2
-rw-r--r--tex/context/base/font-ini.tex8
-rw-r--r--tex/context/base/font-map.tex2
-rw-r--r--tex/context/base/font-uni.tex4
-rw-r--r--tex/context/base/hand-def.tex2
-rw-r--r--tex/context/base/meta-dum.tex13
-rw-r--r--tex/context/base/meta-ini.tex19
-rw-r--r--tex/context/base/meta-nav.tex4
-rw-r--r--tex/context/base/meta-txt.tex2
-rw-r--r--tex/context/base/mult-com.tex20
-rw-r--r--tex/context/base/mult-ini.tex30
-rw-r--r--tex/context/base/page-flt.tex4
-rw-r--r--tex/context/base/page-ini.tex57
-rw-r--r--tex/context/base/page-lay.tex4
-rw-r--r--tex/context/base/page-lin.tex2
-rw-r--r--tex/context/base/page-mak.tex2
-rw-r--r--tex/context/base/page-mul.tex6
-rw-r--r--tex/context/base/page-not.tex2
-rw-r--r--tex/context/base/regi-ibm.tex2
-rw-r--r--tex/context/base/regi-il1.tex4
-rw-r--r--tex/context/base/s-abr-03.tex2
-rw-r--r--tex/context/base/s-dtk-01.tex18
-rw-r--r--tex/context/base/s-map-01.tex22
-rw-r--r--tex/context/base/s-mod-01.tex4
-rw-r--r--tex/context/base/s-mod-02.tex2
-rw-r--r--tex/context/base/s-pre-05.tex2
-rw-r--r--tex/context/base/setupa.tex2
-rw-r--r--tex/context/base/setupb.tex26
-rw-r--r--tex/context/base/spec-fdf.tex4
-rw-r--r--tex/context/base/spec-mis.tex7
-rw-r--r--tex/context/base/supp-ali.tex2
-rw-r--r--tex/context/base/supp-box.tex18
-rw-r--r--tex/context/base/supp-fun.tex6
-rw-r--r--tex/context/base/supp-lan.tex14
-rw-r--r--tex/context/base/supp-ran.tex3
-rw-r--r--tex/context/base/syst-ext.tex48
-rw-r--r--tex/context/base/syst-gen.tex209
-rw-r--r--tex/context/base/thrd-ran.tex2
-rw-r--r--tex/context/base/type-akb.tex202
-rw-r--r--tex/context/base/type-buy.tex13
-rw-r--r--tex/context/base/type-ini.tex2
-rw-r--r--tex/context/base/verb-js.tex2
-rw-r--r--tex/context/base/verb-jv.tex2
-rw-r--r--tex/context/base/x-res-00.tex6
-rw-r--r--tex/context/base/x-res-01.tex14
-rw-r--r--tex/context/base/x-res-02.tex6
-rw-r--r--tex/context/base/x-res-08.tex1
-rw-r--r--tex/context/base/x-res-09.tex10
-rw-r--r--tex/context/base/x-res-10.tex75
-rw-r--r--tex/context/base/x-res-11.tex110
-rw-r--r--tex/context/base/x-xml-01.tex65
-rw-r--r--tex/context/base/x-xml-02.tex6
-rw-r--r--tex/context/base/xtag-ent.tex15
-rw-r--r--tex/context/base/xtag-ini.tex7
94 files changed, 1993 insertions, 958 deletions
diff --git a/context/config/texexec.rme b/context/config/texexec.rme
index 0a2735a8e..01c0a4dde 100644
--- a/context/config/texexec.rme
+++ b/context/config/texexec.rme
@@ -72,6 +72,7 @@ set TeXFontsPath to l:/tex/texmf;l:/tex/texmf-local;
% For teTeX the next settings will do.
+for tetex set TeXHashExecutable to mktexlsr
for tetex set TeXExecutable to pdfetex
for tetex set TeXVirginFlag to -ini
for tetex set TeXPassString to -progname=context
@@ -85,6 +86,7 @@ for tetex set MpNonStopFlag to -int=nonstopmode
% These also apply to fpTeX.
+for fptex set TeXHashExecutable to mktexlsr
for fptex set TeXExecutable to pdfetex
for fptex set TeXVirginFlag to -ini
for fptex set TeXPassString to -progname=context
@@ -98,6 +100,7 @@ for tetex set MpNonStopFlag to -int=nonstopmode
% MikTeX users probably have to set up some paths too.
+for miktex set TeXHashExecutable to initexmf --update-fndb
for miktex set TeXExecutable to pdfetex
for miktex set TeXVirginFlag to --initialize
for miktex set TeXPassString to --alias=context
diff --git a/context/perltk/texexec.pl b/context/perltk/texexec.pl
index e588318bf..79c871714 100644
--- a/context/perltk/texexec.pl
+++ b/context/perltk/texexec.pl
@@ -4,7 +4,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $
# todo: second run of checksum of mp file with --nomprun changes
# todo: warning if no args
# todo: <<<< in messages
-# todo: cleanup
+# todo: cleanup
#D \module
#D [ file=texexec.pl,
@@ -22,8 +22,8 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $
# Thanks to Tobias Burnus for the german translations.
# Thanks to Thomas Esser for hooking it into web2c
# Thanks to Taco Hoekwater for suggesting improvements
-# Thanks to Wybo Dekker for the advanced help interface
-# Thanks to Fabrice Popineau for windows path trickery
+# Thanks to Wybo Dekker for the advanced help interface
+# Thanks to Fabrice Popineau for windows path trickery
# (I still have to completely understand the help code -)
@@ -58,6 +58,22 @@ $ENV{"MPXCOMMAND"} = "0" ; # otherwise loop
my $TotalTime = time ;
+# start random seed hack
+#
+# This hack is needed since tex has 1 minute resolution, so
+# we need to be smaller about 1440 (== 24*60 == tex's max time)
+# in which case (david a's) random calculator will overflow.
+
+my ($sec,$min,$rest) = gmtime ;
+my $RandomSeed = $min*60+$sec ;
+# i have to look up the mod function -)
+if ($RandomSeed>2880) { $RandomSeed -= 2880 }
+if ($RandomSeed>1440) { $RandomSeed -= 1440 }
+
+# See usage of $Random and $RandomSeed later on.
+#
+# end random seed hack
+
## $dosish = ($Config{'osname'} =~ /dos|mswin/i) ;
## $dosish = ($Config{'osname'} =~ /^(ms)?dos|^os\/2|^(ms|cyg)win/i) ;
my $dosish = ($Config{'osname'} =~ /^(ms)?dos|^os\/2|^mswin/i) ;
@@ -107,7 +123,7 @@ my $NoDuplex = 0 ;
my $NOfRuns = 7 ;
my $NoMPMode = 0 ;
my $NoMPRun = 0 ;
-my $NoBanner = 0 ;
+my $NoBanner = 0 ;
my $AutoMPRun = 0 ;
my $OutputFormat = 'standard' ;
my $Pages = '' ;
@@ -123,7 +139,7 @@ my $ProducePdfT = 0 ;
my $ProducePdfM = 0 ;
my $ProducePdfX = 0 ;
my $Input = "" ;
-my $Result = 0 ;
+my $Result = '' ;
my $Suffix = '' ;
my $RunOnce = 0 ;
my $Selection = '' ;
@@ -135,7 +151,7 @@ my $TextWidth = '0pt' ;
my $TopSpace = '0pt' ;
my $TypesetFigures = 0 ;
my $ForceFullScreen = 0 ;
-my $ScreenSaver = 0 ;
+my $ScreenSaver = 0 ;
my $TypesetListing = 0 ;
my $TypesetModule = 0 ;
my $UseColor = 0 ;
@@ -147,18 +163,20 @@ my $RunPath = "" ;
my $Arguments = "" ;
my $Pretty = 0 ;
my $SetFile = "" ;
-my $TeXTree = "" ;
-my $TeXRoot = "" ;
-my $Purge = 0 ;
-my $Separation = "" ;
-my $ModeFile = "" ;
-my $GlobalFile = 0 ;
-my $AllPatterns = 0 ;
-my $ForceXML = 0 ;
+my $TeXTree = "" ;
+my $TeXRoot = "" ;
+my $Purge = 0 ;
+my $Separation = "" ;
+my $ModeFile = "" ;
+my $GlobalFile = 0 ;
+my $AllPatterns = 0 ;
+my $ForceXML = 0 ;
+my $Random = 0 ;
+my $Filters = '' ;
-# makempy :
+# makempy :
-my $MakeMpy = '' ;
+my $MakeMpy = '' ;
&GetOptions
( "arrange" => \$Arrange ,
@@ -169,7 +187,7 @@ my $MakeMpy = '' ;
"convert=s" => \$Convert ,
"environments=s"=> \$Environments ,
"usemodules=s" => \$Modules ,
- "xml" => \$ForceXML ,
+ "xml" => \$ForceXML ,
"xmlfilters=s" => \$Filters ,
"fast" => \$FastMode ,
"final" => \$FinalMode ,
@@ -185,15 +203,15 @@ my $MakeMpy = '' ;
"mode=s" => \$Mode ,
"module" => \$TypesetModule ,
"figures=s" => \$TypesetFigures ,
- "fullscreen" => \$ForceFullScreen ,
- "screensaver" => \$ScreenSaver ,
+ "fullscreen" => \$ForceFullScreen ,
+ "screensaver" => \$ScreenSaver ,
"listing" => \$TypesetListing ,
"mptex" => \$DoMPTeX ,
"mpxtex" => \$DoMPXTeX ,
"noarrange" => \$NoArrange ,
"nomp" => \$NoMPMode ,
"nomprun" => \$NoMPRun ,
- "nobanner" => \$NoBanner ,
+ "nobanner" => \$NoBanner ,
"automprun" => \$AutoMPRun ,
"once" => \$RunOnce ,
"output=s" => \$OutputFormat ,
@@ -235,15 +253,16 @@ my $MakeMpy = '' ;
"pretty" => \$Pretty ,
"setfile=s" => \$SetFile ,
"purge" => \$Purge ,
- #### yet undocumented #################
- "makempy=s" => \$MakeMpy ,
+ #### yet undocumented #################
+ "random" => \$Random ,
+ "makempy=s" => \$MakeMpy ,
"allpatterns" => \$AllPatterns ,
- "separation=s" => \$Separation ,
- "textree=s" => \$TeXTree ,
- "texroot=s" => \$TeXRoot ,
- "translate=s" => \$TeXTranslation ,
- "modefile=s" => \$ModeFile , # additional modes file
- "globalfile" => \$GlobalFile ) ; # don't check name
+ "separation=s" => \$Separation ,
+ "textree=s" => \$TeXTree ,
+ "texroot=s" => \$TeXRoot ,
+ "translate=s" => \$TeXTranslation ,
+ "modefile=s" => \$ModeFile , # additional modes file
+ "globalfile" => \$GlobalFile ) ; # don't check name
# a set file (like blabla.bat) can set paths now
@@ -258,9 +277,10 @@ if ($ARGV[0] =~ /\.mpx$/io) # catch -tex=.... bug in mpost
{ $TeXProgram = '' ; $DoMPXTeX = 1 ; $NoMPMode = 1 }
if ($ScreenSaver)
- { $ForceFullScreen = 1 ;
+ { $ForceFullScreen = 1 ;
$TypesetFigures = 'c' ;
- $Purge = 1 }
+ $ProducePdfT = 1 ;
+ $Purge = 1 }
if ($DoMPTeX||$DoMPXTeX)
{ $RunOnce = 1 ;
@@ -284,11 +304,11 @@ if (($LogFile ne '')&&($LogFile =~ /\w+\.log$/io))
*STDOUT = *LOGFILE ;
*STDERR = *LOGFILE }
-my $Program = " TeXExec 3.2 - ConTeXt / PRAGMA ADE 1997-2003" ;
+my $Program = " TeXExec 3.3 - ConTeXt / PRAGMA ADE 1997-2003" ;
print "\n$Program\n\n" ;
-if ($Verbose)
+if ($Verbose)
{ print " current path : " . cwd . "\n" }
## $pathslash = '/' ; if ($0 =~ /\\/) { $pathslash = "\\" }
@@ -296,24 +316,24 @@ my $pathslash = '/' ; if ($FindBin::Bin =~ /\\/) { $pathslash = "\\" }
my $cur_path = ".$pathslash" ;
# $own_path = $0 ; $own_path =~ s/texexec(\.pl|\.bat|)//io ;
-# $own_type = $1 ;
-# $own_stub = "" ;
+# $own_type = $1 ;
+# $own_stub = "" ;
# we need to handle window's "Program Files" path (patch by Fabrice P)
my $own_path = "$FindBin::Bin/" ;
-my $own_type = $0 ;
-my $own_type = $FindBin::Script ;
-my $own_quote = ($own_path =~ m/^[^\"].* / ? "\"" : "") ;
-my $own_stub = "" ;
+my $own_type = $0 ;
+my $own_type = $FindBin::Script ;
+my $own_quote = ($own_path =~ m/^[^\"].* / ? "\"" : "") ;
+my $own_stub = "" ;
-if ($own_type =~ /(\.pl|perl)/oi)
- { $own_stub = "perl " }
+if ($own_type =~ /(\.pl|perl)/oi)
+ { $own_stub = "perl " }
-if ($own_type =~ /(\.(pl|bin|exe))$/io)
- { $own_type = $1 }
+if ($own_type =~ /(\.(pl|bin|exe))$/io)
+ { $own_type = $1 }
else
- { $own_type = '' }
+ { $own_type = '' }
sub checked_path
{ my $path = shift ;
@@ -539,6 +559,7 @@ my $TeXProgramPath = IniValue('TeXProgramPath' , '' ) ;
my $TeXFormatPath = IniValue('TeXFormatPath' , '' ) ;
my $ConTeXtPath = IniValue('ConTeXtPath' , '' ) ;
my $TeXScriptsPath = IniValue('TeXScriptsPath' , '' ) ;
+my $TeXHashExecutable = IniValue('TeXHashExecutable' , '' ) ;
my $TeXExecutable = IniValue('TeXExecutable' , 'tex' ) ;
my $TeXVirginFlag = IniValue('TeXVirginFlag' , '-ini' ) ;
my $TeXBatchFlag = IniValue('TeXBatchFlag' , '-int=batchmode' ) ;
@@ -623,7 +644,7 @@ if ($ConTeXtPath) { $ConTeXtPath =~ s/[\/\\]$// ; $ConTeXtPath .= '/' }
if ($SetupPath) { $SetupPath =~ s/[\/\\]$// ; $SetupPath .= '/' }
if ($TeXScriptsPath) { $TeXScriptsPath =~ s/[\/\\]$// ; $TeXScriptsPath .= '/' }
-$SetupPath =~ s/\\/\//go ;
+$SetupPath =~ s/\\/\//go ;
my %OutputFormats ;
@@ -870,16 +891,16 @@ SetInterfaces ( "xx" , "experimental" , "english" ) ;
# Sub-option
-struct Subopt =>
+struct Subopt =>
{ desc => '$' , # description
- vals => '%' } ; # assignable values
+ vals => '%' } ; # assignable values
# Main option
-struct Opt =>
+struct Opt =>
{ desc => '$' , # desciption
vals => '%' , # assignable values
- subs => '%' } ; # suboptions
+ subs => '%' } ; # suboptions
# read a main option plus its
# description,
@@ -888,35 +909,35 @@ struct Opt =>
# description and
# assignable values
-sub read_options
+sub read_options
{ $recurse++ ;
my $v = shift;
chomp ;
my $opt = $recurse ? Subopt->new() : Opt->new() ;
$opt->desc($v) ;
- while(@opts)
+ while(@opts)
{ $_ = shift @opts ;
- if (/^--+/)
+ if (/^--+/)
{ unshift @opts, $_ if $recurse ; last }
- if ($recurse && !/^=/)
+ if ($recurse && !/^=/)
{ unshift @opts, $_ ; last }
chomp ;
- my ($kk,$vv) = split(/\s+/,$_,2); # was \t
+ my ($kk,$vv) = split(/\s+/,$_,2); # was \t
$vv||='' ;
- if (/^=/)
- { $opt->vals($kk,$vv) }
- elsif (!$recurse)
+ if (/^=/)
+ { $opt->vals($kk,$vv) }
+ elsif (!$recurse)
{ $opt->subs($kk,read_options($vv)) } }
$recurse-- ;
$opt }
-my $helpdone = 0 ;
+my $helpdone = 0 ;
-sub print_opt
+sub print_opt
{ my ($k,$opt)=@_ ;
- if ($helpdone) { $shorthelp or print "\n" } $helpdone = 1 ; # hh
- $~ = 'H1' ;
+ if ($helpdone) { $shorthelp or print "\n" } $helpdone = 1 ; # hh
+ $~ = 'H1' ;
write ;
return if $shorthelp<0 ;
for $k (sort keys %{$opt->vals}) {print_val($k,${$opt->vals}{$k}) }
@@ -925,22 +946,22 @@ sub print_opt
format H1 =
@>>>>>>>>>>>>>>>>>>>>> @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
"--$k",$opt->desc
-.
+.
}
-sub print_subopt
+sub print_subopt
{ my ($k,$opt) = @_ ;
- $~ = 'H3' ;
+ $~ = 'H3' ;
write ;
- for $k (sort keys %{$opt->vals})
+ for $k (sort keys %{$opt->vals})
{print_val($k,${$opt->vals}{$k}) }
format H3 =
@>>>>>>>>>>>>>>>>>>>>> @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
"--$k",$opt->desc
-.
+.
}
-sub print_val
+sub print_val
{ my ($k,$opt) = @_ ;
$~ = 'H2' ; write ;
format H2 =
@@ -953,7 +974,7 @@ $k,$opt
$recurse-- ;
@opts = <DATA> ;
-while(@opts)
+while(@opts)
{ $_ = shift @opts ;
last if /^--+/ ;
my ($k,$v) = split(/\s+/,$_,2); # was \t
@@ -963,10 +984,10 @@ while(@opts)
sub show_help_options
{ print # "\n" .
- " --help overview of all options and their values\n" .
- " --help all all about all options\n" .
- " --help short just the main options\n" .
- " --help mode ... pdf all about a few options\n" .
+ " --help overview of all options and their values\n" .
+ " --help all all about all options\n" .
+ " --help short just the main options\n" .
+ " --help mode ... pdf all about a few options\n" .
" --help '*.pdf' all about options containing 'pdf'\n" } ;
# determine what user wants to see
@@ -974,34 +995,34 @@ sub show_help_options
if ($HelpAsked)
{ $shorthelp = 0 ;
@help = (sort keys %Help) ;
- if ("@ARGV" eq "all")
+ if ("@ARGV" eq "all")
{ # everything
- }
- elsif ("@ARGV" eq "short")
- { # nearly everything
- $shorthelp-- }
- elsif ("@ARGV" eq "help")
- { # help on help
- show_help_options ;
- exit }
- elsif (@ARGV)
+ }
+ elsif ("@ARGV" eq "short")
+ { # nearly everything
+ $shorthelp-- }
+ elsif ("@ARGV" eq "help")
+ { # help on help
+ show_help_options ;
+ exit }
+ elsif (@ARGV)
{ # one or a few options, completely
my @h=@ARGV ;
@help = () ;
- for (@h)
+ for (@h)
{ # print "testing $_\n";
# next if (/^[\*\?]/) ; # HH, else error
if (/^[\*\?]/) { $_ = ".$_" } # HH, else error
- $Help{$_} and push(@help,$_) or do
+ $Help{$_} and push(@help,$_) or do
{ my $unknown = $_ ;
- for (keys %Help)
- { /$unknown/ and push(@help,$_) } } } }
- else
+ for (keys %Help)
+ { /$unknown/ and push(@help,$_) } } } }
+ else
{ # all main option and their assignable values
$shorthelp++ } }
sub show_help_info
- { map { print_opt($_,$Help{$_}) } @help }
+ { map { print_opt($_,$Help{$_}) } @help }
# uncomment this to see the structure of a Help element:
# print Dumper($Help{pdfselect});
@@ -1024,16 +1045,16 @@ sub MPJobName
sub RunPerlScript
{ my ($ScriptName, $Options) = @_ ;
- my $cmd = '' ;
+ my $cmd = '' ;
if ($dosish)
- { if (-e "own_path$ScriptName$own_type")
- { $cmd = "$own_stub$own_quote$own_path$ScriptName$own_type$own_quote $Options" }
+ { if (-e "own_path$ScriptName$own_type")
+ { $cmd = "$own_stub$own_quote$own_path$ScriptName$own_type$own_quote $Options" }
elsif (-e "$TeXScriptsPath$ScriptName$own_type")
- { $cmd = "$own_stub$own_quote$TeXScriptsPath$ScriptName$own_type$own_quote $Options" }
- else
+ { $cmd = "$own_stub$own_quote$TeXScriptsPath$ScriptName$own_type$own_quote $Options" }
+ else
{ $cmd = "" } }
else
- { $cmd = "$ScriptName $Options" }
+ { $cmd = "$ScriptName $Options" }
unless ($cmd eq "") { system($cmd) } }
sub ConvertXMLFile
@@ -1064,18 +1085,19 @@ sub CheckOutputFormat
{ $FullFormat = $OutputFormat } } # 'standard' to terminal
sub MakeOptionFile
- { my ($FinalRun, $FastDisabled, $JobName, $JobSuffix) = @_ ;
+ { my ($FinalRun, $FastDisabled, $JobName, $JobSuffix, $KindOfRun) = @_ ;
open (OPT, ">$JobName.top") ;
+ print OPT "\% $JobName.top\n" ;
print OPT "\\unprotect\n" ;
- if ($ModeFile ne '')
- { print OPT "\\readlocfile{$ModeFile}{}{}" }
- if ($Result) # no '' test
+ if ($ModeFile ne '')
+ { print OPT "\\readlocfile{$ModeFile}{}{}" }
+ if ($Result ne '')
{ print OPT "\\setupsystem[file=$Result]\n" }
elsif ($Suffix)
{ print OPT "\\setupsystem[file=$JobName$Suffix]\n" }
if ($RunPath ne "")
{ $RunPath =~ s/\\/\//go ;
- $RunPath =~ s/\/$//go ;
+ $RunPath =~ s/\/$//go ;
print OPT "\\usepath[$RunPath]\n" }
$MainLanguage = lc $MainLanguage ;
unless ($MainLanguage eq "standard")
@@ -1101,9 +1123,10 @@ sub MakeOptionFile
if ($SilentMode)
{ print OPT "\\silentmode\n" }
if ($Separation ne "")
- { print OPT "\\setupcolors[\\c!splitsen=$Separation]\n" }
+ { print OPT "\\setupcolors[\\c!splitsen=$Separation]\n" }
if ($SetupPath)
{ print OPT "\\setupsystem[\\c!gebied=\{$SetupPath\}]\n" }
+ print OPT "\\setupsystem[\\c!n=$KindOfRun]\n" ;
$_ = $PaperFormat ;
#unless (($PdfArrange)||($PdfSelect)||($PdfCombine)||($PdfCopy))
unless (($PdfSelect)||($PdfCombine)||($PdfCopy))
@@ -1112,8 +1135,8 @@ sub MakeOptionFile
elsif (/.5.4/goi)
{ print OPT "\\setuppapersize[A5][A4]\n" }
elsif (!/standard/)
- { s/x/\*/io ;
- if (/\w+\d+/) { $_ = uc $_ }
+ { s/x/\*/io ;
+ if (/\w+\d+/) { $_ = uc $_ }
my ($from,$to) = split (/\*/) ;
if ($to eq "") { $to = $from }
print OPT "\\setuppapersize[$from][$to]\n" } }
@@ -1130,9 +1153,9 @@ sub MakeOptionFile
if ($FinalRun)
{ if ($NoDuplex)
{$DupStr = "" }
- else
+ else
{$DupStr = ",\\v!dubbelzijdig" }
- if ($PrintFormat == '')
+ if ($PrintFormat == '')
{ print OPT "\\setuparranging[\\v!normaal]\n" }
elsif ($PrintFormat =~ /.*up/goi)
{ print OPT "\\setuparranging[2UP,\\v!geroteerd$DupStr]\n" }
@@ -1150,6 +1173,8 @@ sub MakeOptionFile
{ print OPT "\\setupsystem[inputfile=$Input]\n" }
else
{ print OPT "\\setupsystem[inputfile=$JobName.$JobSuffix]\n" }
+ if ($Random)
+ { print OPT "\\setupsystem[\\c!willekeur=$RandomSeed]\n" }
if ($Mode)
{ print OPT "\\enablemode[$Mode]\n" }
if ($Pages)
@@ -1187,7 +1212,7 @@ sub MakeUserFile
if ($AllPatterns)
{ open (USR, ">cont-fmt.tex") ;
print USR "\\preloadallpatterns\n" }
- else
+ else
{ return if (($MainLanguage eq 'standard')&&
($MainBodyFont eq 'standard')) ;
print " preparing user file : cont-fmt.tex\n" ;
@@ -1208,7 +1233,7 @@ sub MakeUserFile
close (USR) ;
ReportUserFile () ;
print "\n" ;
- $UserFileOk = 1 }
+ $UserFileOk = 1 }
sub RemoveResponseFile
{ unlink "mult-def.tex" }
@@ -1257,7 +1282,7 @@ sub CompareFiles # 2 = tuo
{ return 0 } }
#sub CheckPositions
-# { return if ($DVIspec eq '') || ($OutputFormat eq 'pdftex') ;
+# { return if ($DVIspec eq '') || ($OutputFormat eq 'pdftex') ;
# my $JobName = shift ; my $TuoName = "$JobName.tuo" ;
# if (open(POS,"$TuoName"))
# { seek POS, (-s $TuoName) - 5000, 0 ;
@@ -1277,10 +1302,10 @@ sub CompareFiles # 2 = tuo
# close (POS) } }
sub CheckPositions
- { }
+ { }
-# my @ExtraPrograms = () ;
-#
+# my @ExtraPrograms = () ;
+#
# sub CheckExtraPrograms
# { my $JobName = shift ; my $TuoName = "$JobName.tuo" ;
# if (open(PRO,"$TuoName"))
@@ -1288,11 +1313,11 @@ sub CheckPositions
# while (<PRO>)
# { if (/\%\s*extra\s*program\s*\:\s*(.*)\s*$/io)
# { push @ExtraPrograms, $1 } }
-# close (PRO) }
-# foreach my $EP (@ExtraPrograms)
-# { if ($EP =~ /(.+)\s*(.*)/o)
+# close (PRO) }
+# foreach my $EP (@ExtraPrograms)
+# { if ($EP =~ /(.+)\s*(.*)/o)
# { print "\n extra program : $1\n" ;
-# system($EP) ;
+# system($EP) ;
# print "\n" } } }
my $ConTeXtVersion = "unknown" ;
@@ -1393,7 +1418,7 @@ sub RunTeX
sub PushResult
{ my $File = shift ; $File =~ s/\..*$//o ; $Result =~ s/\..*$//o ;
- if ($Result)
+ if (($Result ne '') && ($Result ne $File))
{ print " outputfile : $Result\n" ;
unlink "texexec.tuo" ; rename "$File.tuo", "texexec.tuo" ;
unlink "texexec.log" ; rename "$File.log", "texexec.log" ;
@@ -1407,7 +1432,7 @@ sub PushResult
sub PopResult
{ my $File = shift ; $File =~ s/\..*$//o ; $Result =~ s/\..*$//o ;
- if ($Result)
+ if (($Result ne '') && ($Result ne $File))
{ print " renaming : $File to $Result\n" ;
unlink "$Result.tuo" ; rename "$File.tuo", "$Result.tuo" ;
unlink "$Result.log" ; rename "$File.log", "$Result.log" ;
@@ -1444,8 +1469,8 @@ sub RunTeXutil
sub PurgeFiles
{ my $JobName = shift ;
print "\n purging files : $JobName\n" ;
- RunPerlScript($TeXUtil, "--purge $JobName" ) ;
- unlink($Result . '.log') if (-f $Result . '.log') }
+ RunPerlScript($TeXUtil, "--purge $JobName" ) ;
+ unlink($Result . '.log') if (-f $Result . '.log') }
sub RunTeXMP
{ my $JobName = shift ;
@@ -1456,8 +1481,8 @@ sub RunTeXMP
if ($MPJobName ne "")
{ if (open(MP, "$MPJobName"))
{ $_ = <MP> ; chomp ; # we should handle the prefix as well
- if (/^\%\s+translate.*?\=([\w\d\-]+)/io)
- { $TeXTranslation = $1 }
+ if (/^\%\s+translate.*?\=([\w\d\-]+)/io)
+ { $TeXTranslation = $1 }
if (/collected graphics of job \"(.+)\"/i)
{ $MPFoundJobName = $1 }
close(MP) ;
@@ -1467,8 +1492,8 @@ sub RunTeXMP
{ print " generating graphics : metaposting $MPJobName\n" ;
my $ForceMpy = "" ;
if ($MpyForce) { $ForceMpy = "--mpyforce" }
- my $ForceTCX = '' ;
- if ($TeXTranslation ne '')
+ my $ForceTCX = '' ;
+ if ($TeXTranslation ne '')
{ $ForceTCX = "--translate=$TeXTranslation " }
if ($EnterBatchMode)
{ RunPerlScript ($TeXExec,"$ForceTCX $ForceMpy --mptex --nomp --batch $MPJobName") }
@@ -1508,23 +1533,32 @@ sub CheckChanges # also tub
my $DummyFile = 0 ;
+sub isXMLfile
+ { my $Name = shift ;
+ if (($ForceXML)||($name =~ /\.xml$/io))
+ { return 1 }
+ else
+ { open(XML,$Name) ;
+ my $str = <XML> ;
+ close(XML) ;
+ return ($str =~ /\<\?xml /io) } }
+
sub RunConTeXtFile
{ my ($JobName, $JobSuffix) = @_ ;
$JobName =~ s/\\/\//goi ;
$RunPath =~ s/\\/\//goi ;
my $OriSuffix = $JobSuffix ;
if (-e "$JobName.$JobSuffix")
- # { $DummyFile = (($JobSuffix =~ /(xml|xsd|exa|rng)/io)||($ForceXML)) }
- { $DummyFile = (($JobSuffix =~ /xml/io)||($ForceXML)) }
+ { $DummyFile = (($ForceXML)||($JobSuffix =~ /xml/io)) }
+ # to be considered :
+ # { $DummyFile = isXMLfile("$JobName.$JobSuffix") }
elsif ($RunPath ne "")
- { my @RunPaths = split(/,/,$RunPath) ;
- foreach my $rp (@RunPaths)
+ { my @RunPaths = split(/,/,$RunPath) ;
+ foreach my $rp (@RunPaths)
{ if (-e "$rp/$JobName.$JobSuffix")
{ $DummyFile = 1 ; last } } }
if ($DummyFile)
{ open (TMP,">$JobName.run") ;
- # if ($JobSuffix =~ /(xml|xsd|exa|rng)/io)
- # if ($JobSuffix =~ /xml/io)
if (($JobSuffix =~ /xml/io)||$ForceXML)
{ if ($Filters ne "")
{ print " using xml filters : $Filters\n" }
@@ -1565,6 +1599,7 @@ sub RunConTeXtFile
if ($TeXTranslation ne '')
{ print " translation : $TeXTranslation\n" }
my $Options = '' ;
+ if ($Random) { $Options .= " random" }
if ($FastMode) { $Options .= " fast" }
if ($FinalMode) { $Options .= " final" }
if ($Verbose) { $Options .= " verbose" }
@@ -1600,7 +1635,7 @@ sub RunConTeXtFile
$Problems = 0 ;
my $TeXRuns = 0 ;
if (($PdfArrange)||($PdfSelect)||($RunOnce))
- { MakeOptionFile (1, 1, $JobName, $OriSuffix) ;
+ { MakeOptionFile (1, 1, $JobName, $OriSuffix, 3) ;
print "\n" ;
$Problems = RunTeX($JobName, $JobSuffix) ;
if ($ForceTeXutil)
@@ -1610,8 +1645,11 @@ sub RunConTeXtFile
PopResult($JobName) }
else
{ while (!$StopRunning&&($TeXRuns<$NOfRuns)&&(!$Problems))
- { MakeOptionFile (0, 0, $JobName, $OriSuffix) ;
- ++$TeXRuns ;
+ { ++$TeXRuns ;
+ if ($TeXRuns==1)
+ { MakeOptionFile (0, 0, $JobName, $OriSuffix, 1) }
+ else
+ { MakeOptionFile (0, 0, $JobName, $OriSuffix, 2) }
print " TeX run : $TeXRuns\n\n" ;
my $mpchecksumbefore = $mpchecksumafter = 0 ;
if ($AutoMPRun) { $mpchecksumbefore = CheckChanges($JobName) }
@@ -1629,7 +1667,7 @@ sub RunConTeXtFile
if (($NOfRuns==1)&&$ForceTeXutil)
{ $Ok = RunTeXutil ($JobName) }
if ((!$Problems)&&(($FinalMode||$FinalRunNeeded))&&($NOfRuns>1))
- { MakeOptionFile (1, $FinalMode, $JobName, $OriSuffix) ;
+ { MakeOptionFile (1, $FinalMode, $JobName, $OriSuffix, 4) ;
print " final TeX run : $TeXRuns\n\n" ;
$Problems = RunTeX($JobName, $JobSuffix) }
CopyFile("$JobName.top","$JobName.tmp") ;
@@ -1638,9 +1676,8 @@ sub RunConTeXtFile
PopResult($JobName) }
if ($Purge)
{ PurgeFiles($JobName) }
-# if ($DummyFile) # $JobSuffix == run
-# { unlink "$JobName.$JobSuffix" }
-} }
+ if ($DummyFile) # $JobSuffix == run
+ { unlink "$JobName.$JobSuffix" } } }
sub RunSomeTeXFile
{ my ($JobName, $JobSuffix) = @_ ;
@@ -1711,7 +1748,7 @@ sub RunFigures
print FIG " [topspace=1.5cm,backspace=1.5cm,\n" ;
print FIG " header=1.5cm,footer=0pt,\n" ;
print FIG " width=middle,height=middle]\n" ;
- if ($ForceFullScreen)
+ if ($ForceFullScreen)
{ print FIG "\\setupinteraction\n" ;
print FIG " [state=start]\n" ;
print FIG "\\setupinteractionscreen\n" ;
@@ -1721,7 +1758,7 @@ sub RunFigures
print FIG "\\stoptext\n" ;
close(FIG) ;
$ConTeXtInterface = "en" ;
- RunConTeXtFile($FiguresFile, "tex") ;
+ RunConTeXtFile($FiguresFile, "tex") ;
unlink ('texutil.tuf') if (-f 'texutil.tuf') }
# sub RunGetXMLFigures
@@ -1957,15 +1994,15 @@ sub RunCombine
print COM " footer=1cm,\n" ;
print COM " width=middle,\n" ;
print COM " height=middle]\n" ;
- if ($NoBanner)
+ if ($NoBanner)
{ print COM "\\setuplayout\n" ;
print COM " [footer=0cm]\n" }
print COM "\\setupexternalfigures\n" ;
print COM " [directory=]\n" ;
print COM "\\starttext\n" ;
- for $FileName (@Files)
+ for $FileName (@Files)
{ next if ($FileName =~ /^texexec/io) ;
- next if ($FileName =~ /^$Result/i) ;
+ next if ($FileName =~ /^$Result/i) ;
print " pdffile : $FileName\n" ;
my $CleanFileName = CleanTeXFileName($FileName) ;
print COM "\\setupfootertexts\n" ;
@@ -2020,7 +2057,7 @@ sub RunOneFormat
my $cmd = "$TeXProgramPath$TeXExecutable $TeXVirginFlag " .
"$TeXPassString $PassOn ${TeXPrefix}$FormatName" ;
if ($Verbose) { print "\n$cmd\n\n" }
- $Problems = system ( $cmd ) ;
+ $Problems = system ($cmd) ;
RemoveResponseFile ;
RestoreUserFile ;
if (($TeXFormatPath ne '')&&($CurrentPath ne ''))
@@ -2036,6 +2073,13 @@ sub RunFormats
{ @ConTeXtFormats = $Format; $ConTeXtFormatsPrefix='' ; }
else
{ $ConTeXtFormatsPrefix="cont-" ; }
+ if ($TeXHashExecutable ne '')
+ { my $cmd = "$TeXProgramPath$TeXHashExecutable" ;
+ print "\n" ;
+ print " TeX hash binary : $TeXProgramPath$TeXHashExecutable\n" ;
+ print " comment : hashing may take a while ...\n" ;
+ if ($Verbose) { print "\n$cmd\n\n" }
+ system ($cmd) }
foreach my $Interface (@ConTeXtFormats)
{ if ($Interface eq $MetaFun)
{ RunMpFormat ($MetaFun) ; $MetaFunDone = 1 }
@@ -2135,7 +2179,7 @@ my $mpochecksum = 0 ;
sub checkMPgraphics # also see makempy
{ my $MpName = shift ;
- if ($MakeMpy != '')
+ if ($MakeMpy != '')
{ $MpName .= " --$MakeMpy " } # extra switches
if ($MpyForce)
{ $MpName .= " --force " } # dirty
@@ -2223,7 +2267,7 @@ sub doRunMP ###########
$Problems = system ("$own_quote$DviToMpExecutable$own_quote $MpDvi $MpName.mpx") }
# $Problems = system ("dvicopy $MpDvi texexec.dvi") ;
# $Problems = system ("$own_quote$DviToMpExecutable$own_quote texexec.dvi $MpName.mpx") }
- unlink $MpBck ;
+ unlink $MpBck ;
rename $MpTex, $MpBck ;
unlink $MpDvi } }
print " metapost : $MpName\n" ;
@@ -2308,82 +2352,82 @@ if ($SetFile ne "")
# { print " warning : nothing to do\n" }
# return $problems }
-# sub check_texmf_root
-# { return if ($TeXRoot eq "") ;
-# my $root = $TeXRoot ;
-# $root =~ s/\\/\//goi ;
-# if (-d $root)
+# sub check_texmf_root
+# { return if ($TeXRoot eq "") ;
+# my $root = $TeXRoot ;
+# $root =~ s/\\/\//goi ;
+# if (-d $root)
# { print " using tex root : $root \n" ;
-# $ENV{TEXROOT} = $root ;
-# $ENV{TEXMFCNF} = "$root/texmf-local/web2c" ;
+# $ENV{TEXROOT} = $root ;
+# $ENV{TEXMFCNF} = "$root/texmf-local/web2c" ;
# $ENV{TEXMFFONTS} = "$root/texmf-fonts" ;
-# $ENV{TEXMFLOCAL} = "$root/texmf-local" ;
+# $ENV{TEXMFLOCAL} = "$root/texmf-local" ;
# $ENV{TEXMFMAIN} = "$root/texmf" }
-# else
+# else
# { print " invalid tex root : $root \n" } }
-#
-# sub check_texmf_tree
-# { return if ($TeXTree eq "") ;
-# my $tree = $TeXTree ;
-# unless (-d $tree)
-# { $tree = $ENV{TEXMFLOCAL} ;
-# $tree =~ s/texmf.*//io ;
+#
+# sub check_texmf_tree
+# { return if ($TeXTree eq "") ;
+# my $tree = $TeXTree ;
+# unless (-d $tree)
+# { $tree = $ENV{TEXMFLOCAL} ;
+# $tree =~ s/texmf.*//io ;
# $tree .= $TeXTree }
-# if (-d $tree)
+# if (-d $tree)
# { print " using texmf tree : $tree \n" ;
-# $ENV{TEXMFPROJECT} = $tree ;
+# $ENV{TEXMFPROJECT} = $tree ;
# if ((-f "$tree/web2c/cont-en.efmt")||
# (-f "$tree/web2c/cont-nl.efmt"))
-# { $ENV{TEXFORMATS} = "$tree/web2c" }
+# { $ENV{TEXFORMATS} = "$tree/web2c" }
# $ENV{TEXMF} = '{$TEXMFPROJECT,$TEXMFFONTS,$TEXMFLOCAL,!!$TEXMFMAIN}' }
-# else
+# else
# { print " invalid texmf tree : $tree \n" } }
sub check_texmf_root {}
sub check_texmf_tree {}
-# the main thing
+# the main thing
- if ($HelpAsked)
- { show_help_info }
+ if ($HelpAsked)
+ { show_help_info }
elsif ($TypesetListing)
- { check_texmf_root ;
- check_texmf_tree ;
+ { check_texmf_root ;
+ check_texmf_tree ;
RunListing (@ARGV) }
elsif ($TypesetFigures)
- { check_texmf_root ;
- check_texmf_tree ;
+ { check_texmf_root ;
+ check_texmf_tree ;
RunFigures (@ARGV) }
elsif ($DoMPTeX)
- { check_texmf_root ;
- check_texmf_tree ;
+ { check_texmf_root ;
+ check_texmf_tree ;
RunMP }
elsif ($DoMPXTeX)
- { check_texmf_root ;
- check_texmf_tree ;
+ { check_texmf_root ;
+ check_texmf_tree ;
RunMPX ($ARGV[0]) }
elsif ($MakeFormats)
- { check_texmf_root ;
- check_texmf_tree ;
+ { check_texmf_root ;
+ check_texmf_tree ;
if ($MpDoFormat ne '')
{ RunMpFormat($MpDoFormat) }
else
{ RunFormats } }
elsif (@ARGV)
- { check_texmf_root ;
- check_texmf_tree ;
- @ARGV = <@ARGV> ;
+ { check_texmf_root ;
+ check_texmf_tree ;
+ @ARGV = <@ARGV> ;
RunFiles }
# else
# { # print $Help{HELP} ;
# # unless ($Verbose) { print $Help{VERBOSE} } }
-elsif (!$HelpAsked)
- { show_help_options }
-
+elsif (!$HelpAsked)
+ { show_help_options }
+
$TotalTime = time - $TotalTime ;
-unless ($HelpAsked)
+unless ($HelpAsked)
{ print "\n total run time : $TotalTime seconds\n" }
if ($Problems) { exit 1 }
@@ -2415,17 +2459,17 @@ figures typeset figure directory
=b just graphics
=c one (cropped) per page
paperoffset room left at paper border
-fullscreen force full screen mode (pdf)
+fullscreen force full screen mode (pdf)
-----------
-screensaver turn graphic file into a (pdf) full screen file
+screensaver turn graphic file into a (pdf) full screen file
-----------
final add a final run without skipping
-----------
format fmt file
-=name format file (memory dump)
+=name format file (memory dump)
-----------
mpformat mem file
-=name format file (memory dump)
+=name format file (memory dump)
-----------
interface user interface
=en English
@@ -2435,16 +2479,16 @@ interface user interface
=uk Brittish
=it Italian
-----------
-language main hyphenation language
-=xx standard abbreviation
+language main hyphenation language
+=xx standard abbreviation
-----------
listing produce a verbatim listing
backspace inner margin of the page
-topspace top/bottom margin of the page
-pretty enable pretty printing
-color use color for pretty printing
+topspace top/bottom margin of the page
+pretty enable pretty printing
+color use color for pretty printing
-----------
-make build format files
+make build format files
language patterns to include
bodyfont bodyfont to preload
response response interface language
@@ -2452,7 +2496,7 @@ format TeX format
mpformat MetaPost format
program TeX program
-----------
-mode running mode
+mode running mode
=list modes to set
-----------
module typeset tex/pl/mp module
@@ -2472,12 +2516,12 @@ automprun MetaPost at runtime when needed
once run TeX only once (no TeXUtil either)
-----------
output specials to use
-=pdftex Han The Than's pdf backend
+=pdftex Han The Than's pdf backend
=dvips Thomas Rokicky's dvi to ps converter
-=dvipsone YandY's dvi to ps converter
+=dvipsone YandY's dvi to ps converter
=dviwindo YandY's windows previewer
-=dvipdfm Mark Wicks' dvi to pdf converter
-=dvipdfmx Jin-Hwan Cho's extended dvipdfm
+=dvipdfm Mark Wicks' dvi to pdf converter
+=dvipdfmx Jin-Hwan Cho's extended dvipdfm
-----------
passon switches to pass to TeX (--src for MikTeX)
-----------
@@ -2502,7 +2546,7 @@ noduplex single sided
backspace inner margin of the page
topspace top/bottom margin of the page
markings add cutmarks
-background
+background
=string background graphic
addempty add empty page after
textwidth width of the original (one sided) text
@@ -2511,13 +2555,13 @@ pdfcombine combine pages to one page
paperformat paper format
combination n*m pages per page
paperoffset room left at paper border
-nobanner no footerline
+nobanner no footerline
-----------
pdfcopy scale pages down/up
scale new page scale
paperoffset room left at paper border
markings add cutmarks
-background
+background
=string background graphic
-----------
pdfselect select pdf pages
@@ -2530,39 +2574,39 @@ paperformat paper format
backspace inner margin of the page
topspace top/bottom margin of the page
markings add cutmarks
-background
+background
=string background graphic
addempty add empty page after
textwidth width of the original (one sided) text
-----------
print page imposition scheme
-=up 2 pages per sheet doublesided
-=down 2 rotated pages per sheet doublesided
+=up 2 pages per sheet doublesided
+=down 2 rotated pages per sheet doublesided
-----------
-result resulting file
-=name filename
+result resulting file
+=name filename
-----------
input input file (if used)
-=name filename
+=name filename
-----------
suffix resulting file suffix
-=string suffix
+=string suffix
-----------
-runs maximum number of TeX runs
+runs maximum number of TeX runs
=n number of runs
-----------
silent minimize (status) messages
-----------
-tex TeX binary
-=name binary of executable
+tex TeX binary
+=name binary of executable
-----------
-textree additional texmf tree to be used
-=path subpath of tex root
+textree additional texmf tree to be used
+=path subpath of tex root
-----------
-texroot root of tex trees
-=path tex root
+texroot root of tex trees
+=path tex root
-----------
-verbose shows some additional info
+verbose shows some additional info
-----------
help show this or more, e.g. '--help interface'
-----------
diff --git a/context/perltk/texexec.rme b/context/perltk/texexec.rme
index 0a2735a8e..01c0a4dde 100644
--- a/context/perltk/texexec.rme
+++ b/context/perltk/texexec.rme
@@ -72,6 +72,7 @@ set TeXFontsPath to l:/tex/texmf;l:/tex/texmf-local;
% For teTeX the next settings will do.
+for tetex set TeXHashExecutable to mktexlsr
for tetex set TeXExecutable to pdfetex
for tetex set TeXVirginFlag to -ini
for tetex set TeXPassString to -progname=context
@@ -85,6 +86,7 @@ for tetex set MpNonStopFlag to -int=nonstopmode
% These also apply to fpTeX.
+for fptex set TeXHashExecutable to mktexlsr
for fptex set TeXExecutable to pdfetex
for fptex set TeXVirginFlag to -ini
for fptex set TeXPassString to -progname=context
@@ -98,6 +100,7 @@ for tetex set MpNonStopFlag to -int=nonstopmode
% MikTeX users probably have to set up some paths too.
+for miktex set TeXHashExecutable to initexmf --update-fndb
for miktex set TeXExecutable to pdfetex
for miktex set TeXVirginFlag to --initialize
for miktex set TeXPassString to --alias=context
diff --git a/context/perltk/texfont.pl b/context/perltk/texfont.pl
index 56ad32fc4..e08e4f8ec 100644
--- a/context/perltk/texfont.pl
+++ b/context/perltk/texfont.pl
@@ -8,10 +8,10 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $
#D \module
#D [ file=texfont.pl,
-#D version=2000.12.14,
+#D version=2003.08.08, % 2000.12.14
#D title=Font Handling,
#D subtitle=installing and generating,
-#D author=Hans Hagen,
+#D author=Hans Hagen ++,
#D date=\currentdate,
#D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
#C
@@ -26,6 +26,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $
#D Todo : list of encodings [texnansi, ec, textext]
#D Thanks to George N. White III for solving a couple of bugs.
+#D Thanks to Adam T. Lindsay for adding Open Type support.
use strict ;
@@ -58,7 +59,7 @@ if ($installpath eq "") { $installpath = "TEXMFLOCAL" } # redundant
my $encoding = "texnansi" ;
my $vendor = "" ;
my $collection = "" ;
-my $fontroot = "" ; # /usr/people/gwhite/texmf-fonts" ;
+my $fontroot = "" ; #/usr/people/gwhite/texmf-fonts" ;
my $help = 0 ;
my $makepath = 0 ;
my $show = 0 ;
@@ -85,6 +86,11 @@ my $batch = "" ;
my $weight = "" ;
my $width = "" ;
+my $preproc = 0 ; # atl: formerly OpenType switch
+my $variant = "" ; # atl: encoding variant
+my $extension = "pfb" ; # atl: default font extension
+my $lcdf = "" ; # atl: trigger for lcdf otftopl
+
# todo: parse name for style, take face from command line
#
# @Faces = ("Serif","Sans","Mono") ;
@@ -99,6 +105,7 @@ my $width = "" ;
"show" => \$show,
"install" => \$install,
"encoding=s" => \$encoding,
+ "variant=s" => \$variant, # atl: used as a suffix to $encfile only
"vendor=s" => \$vendor,
"collection=s" => \$collection,
"fontroot=s" => \$fontroot,
@@ -116,7 +123,9 @@ my $width = "" ;
"batch" => \$batch,
"weight=s" => \$weight,
"width=s" => \$width,
- "expert" => \$expert) ;
+ "expert" => \$expert,
+ "preproc" => \$preproc, # atl: trigger conversion to pfb
+ "lcdf" => \$lcdf ) ; # atl: trigger use of lcdf fonttoools
# for/from Fabrice:
@@ -129,6 +138,7 @@ if ($own_type =~ /pl/oi) { $own_stub = "perl " }
# so we can use both combined
+if ($lcdf) { $novirtual = 1 }
if (!$novirtual) { $virtual = 1 }
# A couple of routines.
@@ -149,7 +159,7 @@ sub error
# The banner.
print "\n" ;
-report ("TeXFont 1.7 - ConTeXt / PRAGMA ADE 2000-2003") ;
+report ("TeXFont 1.8 - ConTeXt / PRAGMA ADE 2000-2003") ;
print "\n" ;
# Handy for scripts: one can provide a preferred path, if it
@@ -227,6 +237,7 @@ if ($help)
report "--vendor=name : vendor name/directory" ;
report "--collection=name : font collection" ;
report "--encoding=name : encoding vector (default: $encoding)" ;
+ report "--variant=name : encoding variant (.enc file or otftopl)" ;
print "\n" ;
report "--slant=s : slant glyphs in font by factor (0.0 - 1.5)" ;
report "--extend=s : extend glyphs in font by factor (0.0 - 1.5)" ;
@@ -247,6 +258,9 @@ if ($help)
report "--width : multiple master width" ;
print "\n" ;
report "--expert : also handle expert fonts" ;
+ print "\n" ;
+ report "--preproc : pre-process ttf/otf, converting them to pfb" ;
+ report "--lcdf : use lcdf fonttools to create virtual encoding" ;
exit }
if (($batch)||($ARGV[0] =~ /.+\.dat$/io))
@@ -287,7 +301,12 @@ error ("unknown vendor $vendor") unless $vendor ;
error ("unknown collection $collection") unless $collection ;
error ("unknown tex root $lcfontroot") unless -d $fontroot ;
-my $identifier = "$encoding-$vendor-$collection" ;
+my $varlabel = $variant ;
+if ($lcdf)
+{ $varlabel =~ s/,/-/goi ;
+ $varlabel =~ tr/a-z/A-Z/ }
+
+my $identifier = "$encoding$varlabel-$vendor-$collection" ;
my $outlinepath = $sourcepath ; my $path = "" ;
@@ -298,7 +317,10 @@ if ($sourcepath eq "auto")
else
{ $path = `kpsewhich -expand-path=\\\$$root` }
chomp $path ;
- $sourcepath = "$path/fonts/afm/$vendor/$collection" ;
+ if ($preproc)
+ { $sourcepath = "$path/fonts/truetype/$vendor/$collection" }
+ else
+ { $sourcepath = "$path/fonts/afm/$vendor/$collection" }
unless (-d $sourcepath)
{ my $ven = $vendor ; $ven =~ s/(........).*/$1/ ;
my $col = $collection ; $col =~ s/(........).*/$1/ ;
@@ -309,7 +331,13 @@ if ($sourcepath eq "auto")
if (-d $sourcepath)
{ # $install = 0 ; # no copy needed
$makepath = 1 ; # make on local if needed
- my @files = glob("$sourcepath/*.afm") ;
+ my @files = glob("$sourcepath/*.afm") ;
+ if ($preproc)
+ { @files = glob("$sourcepath/*.otf") ;
+ report("locating : otf files") }
+ unless (@files)
+ { @files = glob("$sourcepath/*.ttf") ;
+ report("locating : ttf files") }
if (@files)
{ if ($listing)
{ report ("fontpath : $sourcepath" ) ;
@@ -322,24 +350,30 @@ if ($sourcepath eq "auto")
if (/^fontname\s+(.*?)$/oi)
{ $name = $1 ; last } }
close (AFM) ;
- $file =~ s/.*\/(.*)\.afm/$1/io ;
+ if ($preproc)
+ { $file =~ s/.*\/(.*)\..tf/$1/io }
+ else
+ { $file =~ s/.*\/(.*)\.afm/$1/io }
report ("$file : $name") } }
exit }
elsif ($remove)
{ error ("no removal from : $root") if ($root eq 'TEXMFMAIN') ;
foreach my $file (@files)
- { $file =~ s/.*\/(.*)\.afm/$1/io ;
+ { if ($preproc)
+ { $file =~ s/.*\/(.*)\..tf/$1/io }
+ else
+ { $file =~ s/.*\/(.*)\.afm/$1/io }
foreach my $sub ("tfm","vf")
{ foreach my $typ ("","-raw")
- { my $nam = "$path/fonts/$sub/$vendor/$collection/$encoding$typ-$file.$sub" ;
+ { my $nam = "$path/fonts/$sub/$vendor/$collection/$encoding$variant$typ-$file.$sub" ;
if (-s $nam)
- { report ("removing : $encoding$typ-$file.$sub") ;
+ { report ("removing : $encoding$variant$typ-$file.$sub") ;
unlink $nam } } } }
- my $nam = "$encoding-$vendor-$collection.tex" ;
+ my $nam = "$encoding$variant-$vendor-$collection.tex" ;
if (-e $nam)
{ report ("removing : $nam") ;
unlink "$nam" }
- my $mapfile = "$encoding-$vendor-$collection" ;
+ my $mapfile = "$encoding$varlabel-$vendor-$collection" ;
my $maproot = "$fontroot/pdftex/config/";
if (-e "$maproot$mapfile.map")
{ report ("renaming : $mapfile.map -> $mapfile.bak") ;
@@ -359,6 +393,7 @@ my $vfpath = "$fontroot/fonts/vf/$vendor/$collection" ;
my $pfbpath = "$fontroot/fonts/type1/$vendor/$collection" ;
my $ttfpath = "$fontroot/fonts/truetype/$vendor/$collection" ;
my $pdfpath = "$fontroot/pdftex/config" ;
+my $encpath = "$fontroot/dvips/local" ;
# are not on local path ! ! ! !
@@ -384,6 +419,10 @@ if ($makepath&&$install)
do_make_path("$fontroot/pdftex") ;
do_make_path("$fontroot/pdftex/config") ;
+if ($lcdf)
+ { do_make_path("$fontroot/dvips") ;
+ do_make_path("$fontroot/dvips/local") }
+
make_path ("vf") ;
make_path ("tfm") ;
@@ -399,12 +438,13 @@ my $mapfile = "$identifier.map" ;
my $bakfile = "$identifier.bak" ;
my $texfile = "$identifier.tex" ;
-report "encoding vector : $encoding" ;
-report "vendor name : $vendor" ;
-report " source path : $sourcepath" ;
-report "font collection : $collection" ;
-report "texmf font root : $lcfontroot" ;
-report "pdftex map file : $mapfile" ;
+ report "encoding vector : $encoding" ;
+if ($variant) { report "encoding variant : $variant" }
+ report "vendor name : $vendor" ;
+ report " source path : $sourcepath" ;
+ report "font collection : $collection" ;
+ report "texmf font root : $lcfontroot" ;
+ report "pdftex map file : $mapfile" ;
if ($install) { report "source path : $sourcepath" }
@@ -417,16 +457,45 @@ my @files ;
sub globafmfiles
{ my ($runpath, $pattern) = @_ ;
my @files = glob("$runpath/$pattern.afm") ;
+ if ($preproc && !$lcdf)
+ { @files = glob("$runpath/$pattern.*tf") ;
+ report("locating otf files : using pattern $pattern");
+ unless (@files)
+ { @files = glob("$sourcepath/$pattern.ttf") ;
+ report("locating ttf files : using pattern $pattern") }
+# if ($lcdf) { $extension = "otf" }
+ }
if (@files) # also elsewhere
{ report("locating afm files : using pattern $pattern") }
else
- { report("locating afm files : using ttf files") ;
- @files = glob("$runpath/$pattern.ttf") ;
- foreach my $file (@files)
- { $file =~ s/\.ttf$//io ;
- report ("generating afm file : $file.afm") ;
- system("ttf2afm $file.ttf -o $file.afm") }
- @files = glob("$runpath/$pattern.afm") }
+ { @files = glob("$runpath/$pattern.ttf") ;
+ if (@files)
+ { report("locating afm files : using ttf files") ;
+ $extension = "ttf" ;
+ foreach my $file (@files)
+ { $file =~ s/\.ttf$//io ;
+ report ("generating afm file : $file.afm") ;
+ system("ttf2afm $file.ttf -o $file.afm") }
+ @files = glob("$runpath/$pattern.afm") }
+ else # try doing the pre-processing earlier
+ { report("locating afm files : using otf files") ;
+ $extension = "otf" ;
+ @files = glob("$runpath/$pattern.otf") ;
+ foreach my $file (@files)
+ { $file =~ s/\.otf$//io ;
+ report ("generating afm file : $file.afm") ;
+ preprocess_font("$file.otf", "$file.bdf") ;
+ if ($preproc)
+ { system("cfftot1 --output=$file.pfb $file.otf") ;
+ report("converting : $file.otf to $file.pfb") ;
+ }
+ }
+ if ($lcdf)
+ { @files = glob("$runpath/$pattern.otf") }
+ else
+ { @files = glob("$runpath/$pattern.afm") }
+ }
+ }
return @files }
@@ -456,7 +525,13 @@ sub copy_files
if ($install)
{ copy_files("afm",$sourcepath,$afmpath) ;
# copy_files("tfm",$sourcepath,$tfmpath) ; # raw supplied names
- copy_files("pfb",$outlinepath,$pfbpath) }
+ copy_files("pfb",$outlinepath,$pfbpath) ;
+ if ($extension eq "ttf")
+ { make_path("truetype") ;
+ copy_files("ttf",$sourcepath,$ttfpath) }
+ if ($extension eq "otf")
+ { make_path("truetype") ;
+ copy_files("otf",$sourcepath,$ttfpath) } }
error ("no afm files found") unless @files ;
@@ -567,13 +642,25 @@ sub removeligatures
my $raw = my $use = my $maplist = my $texlist = my $report = "" ;
-$use = "$encoding-" ; $raw = $use . "raw-" ;
+$use = "$encoding$varlabel-" ; $raw = $use . "raw-" ;
my $encfil = "" ;
if ($encoding ne "") # evt -progname=context
- { $encfil = `kpsewhich -progname=pdftex $encoding.enc` ;
- chomp $encfil ; if ($encfil eq "") { $encfil = "$encoding.enc" } }
+ { $encfil = `kpsewhich -progname=pdftex $encoding$varlabel.enc` ;
+ chomp $encfil ; if ($encfil eq "") { $encfil = "$encoding$varlabel.enc" } }
+
+sub preprocess_font
+ { my ($infont,$pfbfont) = @_ ;
+ if ($infont ne "")
+ { report ("otf/ttf source file : $infont") ;
+ report ("destination file : $pfbfont") ; }
+ else
+ { error ("missing otf/ttf source file") }
+ open (CONVERT, "| pfaedit -script -") || error ("couldn't open pipe to pfaedit") ;
+ report ("pre-processing with : pfaedit") ;
+ print CONVERT "Open('$infont');\n Generate('$pfbfont', '', 1) ;\n" ;
+ close (CONVERT) }
foreach my $file (@files)
{ my $option = my $slant = my $extend = my $vfstr = my $encstr = "" ;
@@ -585,6 +672,14 @@ foreach my $file (@files)
my $fontname = $name ;
my $cleanname = $fontname ;
$cleanname =~ s/\_//gio ;
+ # atl: pre-process an opentype or truetype file by converting to pfb
+ if ($preproc && !$lcdf)
+ { unless (-f "$afmpath/$cleanname.afm" && -f "$pfbpath/$cleanname.pfb")
+ { preprocess_font("$path/$name.$suffix", "$pfbpath/$cleanname.pfb") ;
+ rename("$pfbpath/$cleanname.afm", "$afmpath/$cleanname.afm")
+ || error("couldn't move afm product of pre-process.") }
+ $path = $afmpath ;
+ $file = "$afmpath/$cleanname.afm" }
# cleanup
foreach my $suf ("tfm", "vf", "vpl")
{ unlink "$raw$cleanname$fontsuffix.$suf" ;
@@ -597,8 +692,14 @@ foreach my $file (@files)
{ $vfstr = " -V $raw$cleanname$fontsuffix" }
else # if ($virtual)
{ $vfstr = " -v $raw$cleanname$fontsuffix" }
+ my $font = "";
# let's see what we have here (we force texnansi.enc to avoid error messages)
- my $font = `afm2tfm $file -p texnansi.enc texfont.tfm` ;
+ if ($lcdf)
+ { ( my $fileafm = $file ) =~ s/\.otf$/\.afm/ ;
+ $font = `afm2tfm $fileafm -p texnansi.enc texfont.tfm` ;
+ unlink $fileafm }
+ else
+ { $font = `afm2tfm $file -p texnansi.enc texfont.tfm` }
unlink "texfont.tfm" ;
if ($font =~ /(math|expert)/io) { $strange = lc $1 }
my ($rawfont,$cleanfont,$restfont) = split(/\s/,$font) ;
@@ -615,23 +716,45 @@ foreach my $file (@files)
{ report ("font identifier : $cleanfont$namesuffix -> text -> tfm") }
# don't handle strange fonts
if ($strange eq "")
- { # generate tfm and vpl, $file is on afm path
- report "generating raw tfm/vpl : $raw$cleanname$fontsuffix (from $cleanname)" ;
- my $font = `afm2tfm $file $shape $passon $encstr $vfstr $raw$cleanname$fontsuffix` ;
- # generate vf file if needed
- chomp $font ;
- if ($font =~ /.*?([\d\.]+)\s*ExtendFont/io) { $extend = $1 }
- if ($font =~ /.*?([\d\.]+)\s*SlantFont/io) { $slant = $1 }
- if ($extend ne "") { $option .= " $1 ExtendFont " }
- if ($slant ne "") { $option .= " $1 SlantFont " }
- if ($noligs) { removeligatures("$raw$cleanname$fontsuffix") }
- if ($virtual)
- { report "generating new vf : $use$cleanname$fontsuffix (from $raw$cleanname)" ;
- my $ok = `vptovf $raw$cleanname$fontsuffix.vpl $use$cleanname$fontsuffix.vf $use$cleanname$fontsuffix.tfm ` }
- else
- { report "generating new tfm : $use$cleanname$fontsuffix (from $raw$cleanname)" ;
- my $ok = `pltotf $raw$cleanname$fontsuffix.vpl $use$cleanname$fontsuffix.tfm ` }
- } # end of next stage
+ { # atl: experimental support for lcdf otftopl
+ if ($lcdf && $extension eq "otf")
+ { # no vf, bypass afm, use otftopl to get encoding and tfm
+ my $varstr = my $encout = my $tfmout = "" ;
+ report "processing files : otf -> tfm + enc" ;
+ if ($encoding ne "")
+ { $encfil = `kpsewhich -progname=pdftex $encoding.enc` ;
+ chomp $encfil ; if ($encfil eq "") { $encfil = "$encoding.enc" }
+ $encstr = " -e $encfil " }
+ if ($variant ne "")
+ { ( $varstr = $variant ) =~ s/,/ -f /goi ;
+ $varstr = " -f $varstr" }
+ $encout = "$encpath/$use$cleanfont.enc" ;
+ if (-e $encout)
+ { report ("renaming : $encout -> $use$cleanfont.bak") ;
+ unlink "$encpath/$use$cleanfont.bak" ;
+ rename $encout, "$encpath/$use$cleanfont.bak" }
+ $tfmout = "$use$cleanfont.tfm" ;
+ my $otfcommand = "otftopl $varstr $encstr $shape --tfm --output=$tfmout --output-encoding=$encout $file" ;
+ print "$otfcommand\n" ;
+ system("$otfcommand") ;
+ $encfil = $encout }
+ else
+ { # generate tfm and vpl, $file is on afm path
+ report "generating raw tfm/vpl : $raw$cleanname$fontsuffix (from $cleanname)" ;
+ my $font = `afm2tfm $file $shape $passon $encstr $vfstr $raw$cleanname$fontsuffix` ;
+ # generate vf file if needed
+ chomp $font ;
+ if ($font =~ /.*?([\d\.]+)\s*ExtendFont/io) { $extend = $1 }
+ if ($font =~ /.*?([\d\.]+)\s*SlantFont/io) { $slant = $1 }
+ if ($extend ne "") { $option .= " $1 ExtendFont " }
+ if ($slant ne "") { $option .= " $1 SlantFont " }
+ if ($noligs) { removeligatures("$raw$cleanname$fontsuffix") }
+ if ($virtual)
+ { report "generating new vf : $use$cleanname$fontsuffix (from $raw$cleanname)" ;
+ my $ok = `vptovf $raw$cleanname$fontsuffix.vpl $use$cleanname$fontsuffix.vf $use$cleanname$fontsuffix.tfm ` }
+ else
+ { report "generating new tfm : $use$cleanname$fontsuffix (from $raw$cleanname)" ;
+ my $ok = `pltotf $raw$cleanname$fontsuffix.vpl $use$cleanname$fontsuffix.tfm ` } } }
elsif (-e "$sourcepath/$cleanname.tfm" )
{ report "using existing tfm : $cleanname.tfm" }
elsif (($strange eq "expert")&&($expert))
@@ -680,24 +803,35 @@ foreach my $file (@files)
# adding cleanfont is kind of dangerous
my $thename = my $str = my $theencoding = "" ;
if ($strange ne "")
- { $thename = $cleanname ; $theencoding = "" }
+ { $thename = $cleanname ; $theencoding = "" ; }
+ elsif ($lcdf)
+ { $thename = $usename ; $theencoding = " $encoding$varlabel-$cleanname.enc" }
elsif ($virtual)
- { $thename = $rawname ; $theencoding = " $encoding.enc" }
+ { $thename = $rawname ; $theencoding = " $encoding$varlabel.enc" }
else
- { $thename = $usename ; $theencoding = " $encoding.enc" }
+ { $thename = $usename ; $theencoding = " $encoding$varlabel.enc" }
# quit rest if no type 1 file
my $pfb_sourcepath = $sourcepath ;
$pfb_sourcepath =~ s@/afm/@/type1/@ ;
- unless ((-e "$pfbpath/$fontname.pfb")||
- (-e "$pfb_sourcepath/$fontname.pfb")||
- (-e "$sourcepath/$fontname.pfb"))
+ unless ((-e "$pfbpath/$fontname.$extension")||
+ (-e "$pfb_sourcepath/$fontname.$extension")||
+ (-e "$sourcepath/$fontname.$extension")||
+ (-e "$ttfpath/$fontname.$extension"))
{ if ($tex) { $report .= "missing file: \\type \{$fontname.pfb\}\n" }
report ("missing pfb file : $fontname.pfb") }
# now add entry to map
if ($strange eq "")
- { $str = "$thename $cleanfont $option < $fontname.pfb$theencoding\n" }
+ { if ($extension eq "otf")
+ { if ($preproc)
+ { $str = "$thename $cleanfont $option < $fontname.pfb$theencoding\n"}
+ else
+ # PdfTeX can't subset OTF files, so we have to include the whole thing
+ # It looks like we also need to be explicit on where to find the file
+ { $str = "$thename $cleanfont $option << $ttfpath/$fontname.$extension <[$theencoding\n" } }
+ else
+ { $str = "$thename $cleanfont $option < $fontname.$extension$theencoding\n" } }
else
- { $str = "$thename $cleanfont < $fontname.pfb\n" }
+ { $str = "$thename $cleanfont < $fontname.$extension\n" }
if ($map) # check for redundant entries
{ $mapdata =~ s/^$thename\s.*?$//gmis ;
$maplist .= $str ;
diff --git a/tex/context/base/colo-ini.tex b/tex/context/base/colo-ini.tex
index 73a03b91d..9f45f42ec 100644
--- a/tex/context/base/colo-ini.tex
+++ b/tex/context/base/colo-ini.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=colo-ini,
-%D version=1997.4.1,
+%D version=1997.04.01,
%D title=\CONTEXT\ Color Macros,
%D subtitle=Initialization,
%D author=Hans Hagen,
@@ -1795,11 +1795,27 @@
%D therefore implement \type{\color} as:
\unexpanded\def\color[#1]%
+ {\groupedcommand{\startcolor[#1]}\stopcolor}
+
+% \let\switchtocolor\color
+
+%D When \type {\somecolor} is issued, we can savely assume
+%D grouping. Using \type {\groupedcommand} here (i.e.\ the
+%D definition of \type {\color}) is unsafe because in
+%D interferes with for instance switching attributes.
+
+%D Also wrong, test in combinations: \type{...{}{\red test}}
+%D
+%D \def\switchtocolor[#1]%
+%D {\startcolor[#1]\aftergroup\stopcolor}
+
+\def\switchtocolor[#1]% grouping is realy needed, else migration
+ {\bgroup\startcolor[#1]\aftergroup\stopcolor\aftergroup\egroup}
+
+\unexpanded\def\color[#1]%
{\groupedcommand
{\startcolor[#1]}\stopcolor}
-\let\switchtocolor\color
-
\unexpanded\def\graycolor[#1]% not \gray because this is a color
{\groupedcommand
{\RGBsupportedfalse\CMYKsupportedfalse\startcolor[#1]}\stopcolor}
diff --git a/tex/context/base/colo-pra.tex b/tex/context/base/colo-pra.tex
index a915762cb..228df546a 100644
--- a/tex/context/base/colo-pra.tex
+++ b/tex/context/base/colo-pra.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=colo-pra,
-%D version=1997.1.3,
+%D version=1997.01.03,
%D title=\CONTEXT\ Color Macros,
%D subtitle=PRAGMA,
%D author=Hans Hagen,
diff --git a/tex/context/base/colo-rgb.tex b/tex/context/base/colo-rgb.tex
index 25322b70c..7554ed344 100644
--- a/tex/context/base/colo-rgb.tex
+++ b/tex/context/base/colo-rgb.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=colo-rgb,
-%D version=1995.1.1,
+%D version=1995.01.01,
%D title=\CONTEXT\ Color Macros,
%D subtitle=RGB,
%D author=Hans Hagen,
diff --git a/tex/context/base/colo-run.tex b/tex/context/base/colo-run.tex
index 8c5e89a83..9e03627da 100644
--- a/tex/context/base/colo-run.tex
+++ b/tex/context/base/colo-run.tex
@@ -132,7 +132,7 @@
\let\colorstyle\empty
\setupcolor[#1]%
\fi
- \stelwitruimtein[\v!geen]
+ \setupwhitespace[\v!geen]
\def\rule
{\vrule\!!width4em\!!height\strutht\!!depth\strutdp}
\def\docommand##1%
diff --git a/tex/context/base/colo-xwi.tex b/tex/context/base/colo-xwi.tex
index 863165230..81e09d871 100644
--- a/tex/context/base/colo-xwi.tex
+++ b/tex/context/base/colo-xwi.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=colo-xwi,
-%D version=1995.1.1,
+%D version=1995.01.01,
%D title=\CONTEXT\ Color Macros,
%D subtitle=X Windows,
%D author=Hans Hagen,
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex
index daef14d56..62c7d926a 100644
--- a/tex/context/base/cont-new.tex
+++ b/tex/context/base/cont-new.tex
@@ -17,13 +17,13 @@
\unprotect
-\def\tabulaterule
+\def\tabulaterule % to be redone, not correct
{\dotabulaterule
{\hrule\!!height.5\scratchdimen\!!depth.5\scratchdimen\relax
\doifvalue{\??tt\currenttabulate\c!afstand}\v!grid
{\kern-\scratchdimen}}} % experimental tm-prikkels
-% todo: \stelinterliniein[regel=vast] => ==\the\baselineskip
+% todo: \setupinterlinespace[\c!regel=\v!vast] => ==\the\baselineskip
%%%%%%%% todo: \chardef\snapstruts=1 => d=l-h
@@ -45,98 +45,6 @@
\stopXMLignore
\stopnointerference}
-\long\def\preservePSpar#1\to#2%
- {\bgroup
- \def\par{\rawcharacter{12}\rawcharacter{12}}%
- \expanded{\egroup\noexpand\def\noexpand#2{#1}}}
-
-\appendtoks\optimizeverbatimfalse\to\everytabulate
-
-\def\filterfromvalue#1#2#3% value max n
- {\@EA\@EAEAEA\csname
- \ifcase#2\or
- \ifcase#3\or
- \strippedcsname\firstofoneargument
- \else
- \strippedcsname\gobbleoneargument
- \fi
- \or
- \ifcase#3\or
- \strippedcsname\firstoftwoarguments
- \or
- \strippedcsname\secondoftwoarguments
- \else
- \strippedcsname\gobbletwoarguments
- \fi
- \or
- \ifcase#3\or
- \strippedcsname\firstofthreearguments
- \or
- \strippedcsname\secondofthreearguments
- \or
- \strippedcsname\thirdofthreearguments
- \else
- \strippedcsname\gobblethreearguments
- \fi
- \fi
- \endcsname\csname#1\endcsname}
-
-% \setvalue{xx}{{A}{B}{C}}
-
-% \filterfromvalue{xx}{3}{3}
-% \filterfromvalue{xx}{3}{2}
-% \filterfromvalue{xx}{3}{1}
-
-% new, needed for icare first col of 'doeltabel', experimental
-
-\newif\ifsqueezeTBLspan % \squeezeTBLspantrue
-
-\def\settblspn #1{\setvalue {\@@tblprefix#1:s}{1}}
-\def\doifelsetblspn#1{\doifelsevalue{\@@tblprefix#1:s}{1}}
-
-\long\def\dohandleTBLcellA#1#2[#3]#4%
- {\setbox\scratchbox\hbox
- {\setupTBLcell{#1}{#2}%
- \localframed
- [\@@tbl\@@tbl]
- [#3,\c!achtergrond=,\c!kader=\v!uit]% 25% faster
- {\bTBLCELL\TBLcharalign{#2}{#4}\eTBLCELL\inTBLcell{#1}{#2}}}%
- \scratchdimen\gettblwid\colTBL\relax
- \ifdim\wd\scratchbox>\scratchdimen
- \ifsqueezeTBLspan
- \ifnum0\number\gettblcol{#1}{#2}>1\relax \settblspn\colTBL \fi
- \fi
- \doifelsetblspn\colTBL
- \donothing{\settblwid\colTBL{\the\wd\scratchbox}}% auto set
- \fi
- \let\rowTBLx\rowTBL\increment\rowTBLx
- \scratchdimen\gettblhei\rowTBLx\relax
- \ifdim\ht\scratchbox<\scratchdimen
- \settblhei\rowTBLx{\the\ht\scratchbox}% auto set
- \fi
- \settblht{#1}{#2}{\the\ht\scratchbox}%
- \settblwd{#1}{#2}{\the\wd\scratchbox}%
- \ifautoTBLcheckwidth
- \ifdim\wd\scratchbox<.75\hsize
- \ifdim\ht\scratchbox>2\openlineheight % honor width since this can be a
- \scratchdimen\gettblaut\colTBL\relax % figure or so
- \ifdim\scratchdimen=\zeropoint
- % side effect: when width is set to 0pt,
- % we can force a span that fits the sum of spans widths
- \settblaut\colTBL{\the\scratchdimen}%
- \else\ifdim\wd\scratchbox>\scratchdimen
-% unless span
- \settblaut\colTBL{\the\wd\scratchbox}%
- % to be translated
- \writestatus\m!TABLE{no auto width in (\number#1,\number#2)\space\the\wd\scratchbox/\the\hsize}%
- \fi\fi
- \fi
- \fi
- \fi
- \setbox2\null
- \wd2\wd\scratchbox \ht2\ht\scratchbox \dp2\dp\scratchbox
- \box2}
-
\def\processlinetableXMLfile#1%
{\bgroup
\let\startlinetable\donothing
@@ -169,81 +77,6 @@
\fi
\fi}
-\def\centertogrid % meant for special situations
- {\ifgridsnapping
- \dowithnextboxcontent
- {\ignorespaces}
- {\bgroup
- \par
- \scratchdimen\nextboxht
- \advance\scratchdimen \nextboxdp
- \getnoflines\scratchdimen
- \setbox\nextbox\vbox to \noflines\lineheight
- {\forgetall
- \vss
- \topbaselinecorrection
- \copy\nextbox
- \botbaselinecorrection
- \vss}%
- \setbox\nextbox\hbox{\lower\strutdp\flushnextbox}%
- \noindent\snaptogrid\vbox{\flushnextbox}%
- \egroup}
- \vbox % was \hbox
- \fi}
-
-% \strut Bruggetje
-% \startlinecorrection
-% \startcombination
-% {\framed{test}} {} {\framed{test}} {}
-% \stopcombination
-% \stoplinecorrection
-% \strut Bruggetje
-% \startlinecorrection
-% \startcombination[2*2]
-% {\framed{test}} {} {\framed{test}} {}
-% {\framed{test}} {} {\framed{test}} {}
-% \stopcombination
-% \stoplinecorrection
-% \strut Bruggetje
-% \startlinecorrection[blank]
-% \startcombination
-% {\framed{test}} {} {\framed{test}} {}
-% \stopcombination
-% \stoplinecorrection
-% \strut Bruggetje
-% \startlinecorrection[blank]
-% \startcombination[2*2]
-% {\framed{test}} {} {\framed{test}} {}
-% {\framed{test}} {} {\framed{test}} {}
-% \stopcombination
-% \stoplinecorrection
-% \strut Bruggetje
-% \startlinecorrection
-% \startcombination
-% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
-% \stopcombination
-% \stoplinecorrection
-% \strut Bruggetje
-% \startlinecorrection
-% \startcombination[2*2]
-% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
-% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
-% \stopcombination
-% \stoplinecorrection
-% \strut Bruggetje
-% \startlinecorrection[blank]
-% \startcombination
-% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
-% \stopcombination
-% \stoplinecorrection
-% \strut Bruggetje
-% \startlinecorrection[blank]
-% \startcombination[2*2]
-% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
-% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
-% \stopcombination
-% \stoplinecorrection
-
% experimental: \synchronizegrid bla bla bla
\newcounter\currentgridsync
@@ -322,59 +155,6 @@
% so far
-\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}
-
-% \setupinteraction[state=start]
-%
-% \useattachment[whatever][[new name]][test.tex]
-%
-% % \setupattachments[\c!symbool={symbol-normal,symbol-down}]
-%
-% \starttext \attachment[whatever] \stoptext
-
-\definesystemvariable{at}
-
-\def\useattachment
- {\dotripleempty\douseattachment}
-
-\def\douseattachment[#1][#2][#3]%
- {\setgvalue{\??at :#1}{#2}%
- \setgvalue{\??at::#1}{#3}%
- \doifvaluenothing{\??at :#1}{\setxvalue{\??at :#1}{#1}}%
- \doifvaluenothing{\??at::#1}{\setxvalue{\??at::#1}{\getvalue{\??at:#1}}}}
-
-\def\attachment[#1]%
- {\ifundefined{\??at:#1}\else \iflocation
- \doif\@@atstatus\v!start
- {\doiffileelse{\getvalue{\??at:#1}}%
- {\doPDFattachfile
- {\getvalue{\??at::#1}}%
- {1em}{1ex}\@@atkleur\@@atsymbool
- {\getvalue{\??at:#1}}}%
- {}}%
- \fi \fi}
-
-\def\setupattachments
- {\dodoubleempty\getparameters[\??at]}
-
-\setupattachments
- [\c!status=\v!start,
- \c!kleur=\@@iakleur,
- \c!symbool=]
-
% test this prikkels/pascal margin text before heads (mode
% 1) as well as uitwerkingen (mode 2)
@@ -454,39 +234,12 @@
\long \def\tableiftextelse#1{\tableifelse{\doiftextelse{#1}}}
-\def\ejectinsert
- {\flushnotes
- \bgroup
- \noftopfloats\plusthousand
- \nofbotfloats\zerocount
- % this is needed in case a float that has been stored
- % ends up at the current page; this border case occurs when
- % the calculated room is 'eps' smaller that the room available
- % when just flushing; so now we have (maybe optional):
- \pagebaselinecorrection
- % alas, this is tricky but needed (first surfaced in prikkels)
- \doflushfloats
- \egroup}
-
\def\overloaded#1#2%
{\appendtoks
\writestatus\m!systems{overloaded: \string#2}%
\to \everybye
#1#2}
-\def\toplinebox
- {\dowithnextbox
- {\ifdim\nextboxdp>\strutdepth
- \scratchdimen\nextboxdp
- \advance\scratchdimen-\strutdepth
- \getnoflines\scratchdimen
- \struttedbox{\flushnextbox}%
- \dorecurse\noflines\verticalstrut
- \else
- \flushnextbox
- \fi}%
- \tbox}
-
\def\expandifnonempty#1%
{\@EA\ifx\csname#1\endcsname\empty
\expandafter\secondoftwoarguments
@@ -530,25 +283,6 @@
\def\tightvtop
{\dowithnextbox{\nextboxht\zeropoint\flushnextbox}\vtop}
-\def\startpagefigure
- {\dodoubleempty\dostartpagefigure}
-
-\def\dostartpagefigure[#1][#2]%
- {\bgroup
- \getparameters[\??ex][\c!offset=\!!zeropoint,#2]%
- \startTEXpage[\c!offset=\@@exoffset]%
- \externalfigure[#1][#2]\ignorespaces}
-
-\def\stoppagefigure
- {\stopTEXpage
- \egroup}
-
-\def\pagefigure
- {\dodoubleempty\dopagefigure}
-
-\def\dopagefigure[#1][#2]%
- {\dostartpagefigure[#1][#2]\stoppagefigure}
-
% pretty important (esp since we now ignore shipouts)
%
% actually we should nil all writes, marks, specials
@@ -586,29 +320,6 @@
% \aftergroup\stopcolor
% \aftergroup\egroup}
-% test this for a long time, esp since from now on, by default
-% \commands are not expanded
-
-\setupreferencing
- [\c!expansie=\v!nee]
-
-\def\dotextreference[#1]#2%
- {\bgroup
- \def\asciia{#1}%
- \convertexpanded\??rf{#2}\asciib
- \@EA\rawtextreference\@EA\s!txt\@EA\asciia\@EA{\asciib}%
- \egroup}
-
-\def\dopagereference[#1]%
- {\rawpagereference\s!pag{#1}}
-
-\def\doreference[#1]#2%
- {\bgroup
- \def\asciia{#1}%
- \convertexpanded\??rf{#2}\asciib
- \@EA\rawreference\@EA\s!ref\@EA\asciia\@EA{\asciib}%
- \egroup}
-
% what is this stupid macro meant for:
\def\hyphenationpoint
diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex
index 280f25526..40c9a36a1 100644
--- a/tex/context/base/context.tex
+++ b/tex/context/base/context.tex
@@ -15,7 +15,7 @@
\catcode`\{=1 \catcode`\}=2
-\def\contextversion{2003.7.21}
+\def\contextversion{2003.8.8}
%D Welcome to the main module. When this module is ran through
%D \type{initex} or \type{tex -i} or \type{whatevertex} using
diff --git a/tex/context/base/core-box.tex b/tex/context/base/core-box.tex
index d3a1ce572..1bca2cd24 100644
--- a/tex/context/base/core-box.tex
+++ b/tex/context/base/core-box.tex
@@ -297,7 +297,7 @@
\setcollector
[caption][#1]
{\getparameters[\??du][#2]%
- \dosetfontattribute\??du\c!letter\stelinterliniein
+ \dosetfontattribute\??du\c!letter\setupinterlinespace
\framed % watch the special setting of kader/overlay
[\c!kader=\v!overlay,#2]
{\doattributes\??du\c!letter\c!kleur{#3}}}%
@@ -342,7 +342,7 @@
[caption]
[#1]
{\getparameters[\??du][#2]%
- \dosetfontattribute\??du\c!letter\stelinterliniein
+ \dosetfontattribute\??du\c!letter\setupinterlinespace
\framed
[\c!kader=\v!overlay,,#2]
{\doattributes\??du\c!letter\c!kleur{#3}}}%
@@ -577,7 +577,7 @@
\dowithnextboxcontent
{\forgetall
\hsize\@@lxbreedte
- \expanded{\steluitlijnenin[\@@lxuitlijnen]}%
+ \expanded{\setupalign[\@@lxuitlijnen]}%
\dosetfontattribute\??lx\c!letter}
{\setlayer[#1][#2]{\strut\color[\@@lxkleur]{\flushnextbox}}%
\egroup}%
diff --git a/tex/context/base/core-des.tex b/tex/context/base/core-des.tex
index b6bb525ca..2b27f7d25 100644
--- a/tex/context/base/core-des.tex
+++ b/tex/context/base/core-des.tex
@@ -39,12 +39,19 @@
\def\@@definitiewoord#1%
{\getvalue{\??dd#1\s!do\c!commando}{#1}}
+% \def\normal@@definitiewoord#1[#2]#3#4%
+% {\doattributes
+% {\??dd#1}\c!kopletter\c!kopkleur
+% {\getvalue{\??dd#1\c!commando}% NAAR BUITENSTE NIVEAU !
+% {\begstrut\getvalue{\??dd#1\c!tekst}#4\endstrut}}%
+% \rawreference\s!def{#2}{#3}}
+
\def\normal@@definitiewoord#1[#2]#3#4%
{\doattributes
{\??dd#1}\c!kopletter\c!kopkleur
- {\getvalue{\??dd#1\c!commando}% NAAR BUITENSTE NIVEAU !
- {\begstrut\getvalue{\??dd#1\c!tekst}#4\endstrut}}%
- \rawreference\s!def{#2}{#3}}
+ {\getvalue{\??dd#1\c!commando}{#4}}% NAAR BUITENSTE NIVEAU !
+ \rawreference\s!def{#2}{#3}} % brrr moet in #4
+
\setvalue{@@definitie\v!links}#1%
{\@@definitiehang{#1}\@@definitielinkspure\@@definitielinkshang}
@@ -97,7 +104,7 @@
\hsize\!!widtha
\leftskip\zeropoint
\rightskip\zeropoint
- #2\steluitlijnenin[\getvalue{\??dd#1\c!uitlijnen}]%
+ #2\setupalign[\getvalue{\??dd#1\c!uitlijnen}]%
\unhcopy\@@definitiebox}%
\ht\@@definitiebox\strutht
\dp\@@definitiebox\strutdp}
@@ -136,7 +143,7 @@
{\forgetall
\mindermeldingen
\hsize\!!widtha
- #2\steluitlijnenin[\getvalue{\??dd#1\c!uitlijnen}]#3%
+ #2\setupalign[\getvalue{\??dd#1\c!uitlijnen}]#3%
\unhcopy\@@definitiebox}%
\ht\@@definitiebox\strutht
\dp\@@definitiebox\strutdp
@@ -243,18 +250,51 @@
\let\@@leftdefinitieskip \!!zeropoint
\let\@@rightdefinitieskip\!!zeropoint
+% \def\@@dostartdefinitie#1[#2]#3%
+% {\getvalue{\??dd#1\c!voor}%
+% \begingroup
+% \doadaptleftskip{\getvalue{\??dd#1\c!marge}}%
+% \showcomposition
+% \setbox\@@definitiebox\hbox
+% {\forgetall
+% \mindermeldingen
+% \def\\{\crcr}%
+% \doifelsevalue{\??dd#1\c!plaats}\v!aanelkaar
+% {\@@definitiewoord{#1}[#2]{#3}{#3}}
+% {\@@definitiewoord{#1}[#2]{#3}{\vbox{\halign{\strut##\hss\cr#3\crcr}}}}}%
+% \!!widthb\getvalue{\??dd#1\c!afstand}\relax
+% \ifdim\!!widthb=\zeropoint\relax
+% \doifvalue{\??dd#1\c!breedte}\v!ruim{\!!widthb=1em}%
+% \fi
+% \assignwidth
+% {\!!widtha}
+% {\getvalue{\??dd#1\c!breedte}}
+% {\doifelsevaluenothing{\??dd#1\c!monster}
+% {\unhcopy\@@definitiebox}
+% {\doattributes
+% {\??dd#1}\c!kopletter\c!kopkleur
+% {\getvalue{\??dd#1\c!tekst}\getvalue{\??dd#1\c!monster}}}}
+% {\!!widthb}%
+% % \parindent\zeropoint\relax
+% \doifelsevalue{\??dd#1\c!titeluitlijnen}\v!nee
+% {\edef\@@leftdefinitieskip {\the\leftskip }%
+% \edef\@@rightdefinitieskip{\the\rightskip}}
+% {\ifcase\insidedefinition
+% \edef\@@leftdefinitieskip {\the\leftskip }%
+% \edef\@@rightdefinitieskip{\the\rightskip}%
+% \fi}%
+% \expanded{\inspringen[\getvalue{\??dd#1\c!inspringen}]}%
+% \ifcase\insidedefinition % better a system mode
+% \chardef\insidedefinition\plusone
+% \or
+% \chardef\insidedefinition\plustwo
+% \fi} % now happens elsewhere : \noindent\ignorespaces
+
\def\@@dostartdefinitie#1[#2]#3%
{\getvalue{\??dd#1\c!voor}%
\begingroup
\doadaptleftskip{\getvalue{\??dd#1\c!marge}}%
\showcomposition
- \setbox\@@definitiebox\hbox
- {\forgetall
- \mindermeldingen
- \def\\{\crcr}%
- \doifelsevalue{\??dd#1\c!plaats}\v!aanelkaar
- {\@@definitiewoord{#1}[#2]{#3}{#3}}
- {\@@definitiewoord{#1}[#2]{#3}{\vbox{\halign{\strut##\hss\cr#3\crcr}}}}}%
\!!widthb\getvalue{\??dd#1\c!afstand}\relax
\ifdim\!!widthb=\zeropoint\relax
\doifvalue{\??dd#1\c!breedte}\v!ruim{\!!widthb=1em}%
@@ -268,7 +308,16 @@
{\??dd#1}\c!kopletter\c!kopkleur
{\getvalue{\??dd#1\c!tekst}\getvalue{\??dd#1\c!monster}}}}
{\!!widthb}%
-% \parindent\zeropoint\relax
+ \setbox\@@definitiebox\hbox
+ {\forgetall
+ \mindermeldingen
+ \let\\\endgraf
+ \doifelsevalue{\??dd#1\c!plaats}\v!aanelkaar
+ {\@@definitiewoord{#1}[#2]{#3}%
+ {\begstrut\getvalue{\??dd#1\c!tekst}#3\endstrut}}
+ {\@@definitiewoord{#1}[#2]{#3}%
+ {\vtop{\hsize\!!widtha\advance\hsize-\!!widthb
+ \begstrut\getvalue{\??dd#1\c!tekst}\ignorespaces#3\endstrut}}}}%
\doifelsevalue{\??dd#1\c!titeluitlijnen}\v!nee
{\edef\@@leftdefinitieskip {\the\leftskip }%
\edef\@@rightdefinitieskip{\the\rightskip}}
@@ -276,7 +325,7 @@
\edef\@@leftdefinitieskip {\the\leftskip }%
\edef\@@rightdefinitieskip{\the\rightskip}%
\fi}%
-\expanded{\inspringen[\getvalue{\??dd#1\c!inspringen}]}%
+ \expanded{\inspringen[\getvalue{\??dd#1\c!inspringen}]}%
\ifcase\insidedefinition % better a system mode
\chardef\insidedefinition\plusone
\or
@@ -364,10 +413,17 @@
\def\showdnpuretext#1%
{\strut\getvalue{\??dd#1\c!tekst}} % geen spatie
+% \def\showdntext#1%
+% {\doifelsevaluenothing{\??dd#1\c!tekst}
+% {\ignorespaces}
+% {\strut\getvalue{\??dd#1\c!tekst}\fixedspace}}
+
\def\showdntext#1%
{\doifelsevaluenothing{\??dd#1\c!tekst}
{\ignorespaces}
- {\strut\getvalue{\??dd#1\c!tekst}\fixedspace}}
+ {\strut
+ \getvalue{\??dd#1\c!tekst}%
+ \removeunwantedspaces\fixedspace}}
% \def\showdnnummer#1%
% {\voorafgaandenummer
@@ -401,13 +457,68 @@
% #1=name #2=level #3=\show #4[#5]#6#7=#1[#2]#3#4 van definitie
+% \def\special@@definitiewoord#1#2#3#4[#5]#6#7%
+% {\strut
+% \doifelsevalue{\??dd#1\c!nummer}\v!nee
+% \!!doneafalse
+% {\doifelse{#5}{-}
+% \!!doneafalse
+% \!!doneatrue}%
+% \chardef\definitiekoppeling\zerocount
+% \iflocation
+% \doifvaluesomething{\??dd#1\c!koppeling}
+% {\processaction % genereert > of <
+% [\getvalue{\??dd#1\c!koppelwijze}]
+% [ \v!lokaal=>\chardef\definitiekoppeling1, % old: default
+% \v!globaal=>\chardef\definitiekoppeling2]}% new: global crosslinking
+% \fi
+% \stelnummerin % the number is called indirectly
+% [\getvalue{\??dd#1\??dd\c!nummer}]
+% [\c!sectienummer=\getvalue{\??dd#1\c!sectienummer}]%
+% \if!!donea
+% \getvalue{\e!volgende#2#1}%
+% \iflocation
+% \bgroup
+% \letvalue{\??dd#1\c!sectienummer}\v!ja
+% \protectconversion
+% \maakvoorafgaandenummer[\getvalue{\??dd#1\??dd\c!nummer}]%
+% \preparethenumber{\??dd#1}\voorafgaandenummer\preparednumber
+% \ifcase\definitiekoppeling \or
+% \xdef\internaldoornummer{#3{#1}}%
+% \rawreference\s!num{#1:\internaldoornummer}{}%
+% \or
+% \xdef\internaldoornummer{\countervalue{\??dd\c!koppeling#1}}%
+% \rawreference\s!num{#1:\internaldoornummer}{}%
+% \fi
+% \egroup
+% \fi
+% \maakvoorafgaandenummer[\getvalue{\??dd#1\??dd\c!nummer}]%
+% \preparethenumber{\??dd#1}\voorafgaandenummer\preparednumber
+% \hbox
+% {\let\normalkap\relax % sorry, uppercase causes troubles
+% \doattributes % \nocase primitive needed
+% {\??dd#2#1}\c!kopletter\c!kopkleur
+% {\getvalue{\??dd#1\c!commando}% hook for taco
+% {\showdntext{#2#1}%
+% \domakednnummer{#1}{#2}{#3}}}%
+% \iflocation\ifcase\definitiekoppeling \else
+% \edef\localconnection{\getvalue{\??dd#1\c!koppeling}:\internaldoornummer}%
+% \doifreferencefoundelse\localconnection
+% % {\in[\localconnection]}{}% genereert > of <
+% \fi\fi}%
+% \doifnot{#5}{-}{\rawreference\s!num{#5}{#3{#1}}}%
+% \else % Why was this strange expansion needed?
+% \hbox
+% {\edef\!!stringa{\showdnpuretext{#2#1}}% nog eens testen binnen \expanded
+% \expanded{\doattributes{\??dd#1}\noexpand\c!kopletter\noexpand\c!kopkleur
+% {\noexpand\getvalue{\??dd#1\c!commando}{\!!stringa}}}%
+% \doifnot{#5}{-}{\rawreference\s!num{#5}{}}}%
+% \fi}
+
\def\special@@definitiewoord#1#2#3#4[#5]#6#7%
{\strut
\doifelsevalue{\??dd#1\c!nummer}\v!nee
- \!!doneafalse
- {\doifelse{#5}{-}
- \!!doneafalse
- \!!doneatrue}%
+ \!!doneafalse{\doifelse{#5}{-}\!!doneafalse\!!doneatrue}%
\chardef\definitiekoppeling\zerocount
\iflocation
\doifvaluesomething{\??dd#1\c!koppeling}
@@ -438,25 +549,23 @@
\fi
\maakvoorafgaandenummer[\getvalue{\??dd#1\??dd\c!nummer}]%
\preparethenumber{\??dd#1}\voorafgaandenummer\preparednumber
- \hbox
- {\let\normalkap\relax % sorry, uppercase causes troubles
- \doattributes % \nocase primitive needed
- {\??dd#2#1}\c!kopletter\c!kopkleur
- {\getvalue{\??dd#1\c!commando}% hook for taco
- {\showdntext{#2#1}%
- \domakednnummer{#1}{#2}{#3}}}%
- \iflocation\ifcase\definitiekoppeling \else
- \edef\localconnection{\getvalue{\??dd#1\c!koppeling}:\internaldoornummer}%
- \doifreferencefoundelse\localconnection
- {\in[\localconnection]}{}% genereert > of <
- \fi\fi}%
+ \let\normalkap\relax % sorry, uppercase causes troubles
+ \doattributes % \nocase primitive needed
+ {\??dd#1}\c!kopletter\c!kopkleur
+ {\getvalue{\??dd#1\c!commando}% hook for taco
+ {\showdntext{#2#1}%
+ \domakednnummer{#1}{#2}{#3}}}%
+ \iflocation\ifcase\definitiekoppeling \else
+ \edef\localconnection{\getvalue{\??dd#1\c!koppeling}:\internaldoornummer}%
+ \doifreferencefoundelse\localconnection
+ {\in[\localconnection]}\donothing % genereert > of <
+ \fi\fi
\doifnot{#5}{-}{\rawreference\s!num{#5}{#3{#1}}}%
\else % Why was this strange expansion needed?
- \hbox
- {\edef\!!stringa{\showdnpuretext{#2#1}}% nog eens testen binnen \expanded
- \expanded{\doattributes{\??dd#1}\noexpand\c!kopletter\noexpand\c!kopkleur
- {\noexpand\getvalue{\??dd#1\c!commando}{\!!stringa}}}%
- \doifnot{#5}{-}{\rawreference\s!num{#5}{}}}%
+ \edef\!!stringa{\showdnpuretext{#2#1}}% nog eens testen binnen \expanded
+ \expanded{\doattributes{\??dd#1}\noexpand\c!kopletter\noexpand\c!kopkleur
+ {\noexpand\getvalue{\??dd#1\c!commando}{\!!stringa}}}%
+ \doifnot{#5}{-}{\rawreference\s!num{#5}{}}%
\fi}
\def\@@ddsetsubsubsubnummer#1%
diff --git a/tex/context/base/core-fig.tex b/tex/context/base/core-fig.tex
index 5a1157b68..f9e202528 100644
--- a/tex/context/base/core-fig.tex
+++ b/tex/context/base/core-fig.tex
@@ -1609,17 +1609,36 @@
\popendofline
\egroup}
-\def\pagefigure
- {\dodoubleempty\dopagefigure}
+% \def\pagefigure
+% {\dodoubleempty\dopagefigure}
+%
+% \def\dopagefigure[#1][#2]%
+% {\bgroup
+% \getparameters[\??ex][\c!offset=\v!overlay,#2]%
+% \startTEXpage[\c!offset=\@@exoffset]%
+% \externalfigure[#1][#2]%
+% \stopTEXpage
+% \egroup}
-\def\dopagefigure[#1][#2]%
+\def\startpagefigure
+ {\dodoubleempty\dostartpagefigure}
+
+\def\dostartpagefigure[#1][#2]%
{\bgroup
- \getparameters[\??ex][\c!offset=\!!zeropoint,#2]%
+ \getparameters[\??ex][\c!offset=\v!overlay,#2]%
\startTEXpage[\c!offset=\@@exoffset]%
- \externalfigure[#1][#2]%
- \stopTEXpage
+ \externalfigure[#1][#2]\ignorespaces}
+
+\def\stoppagefigure
+ {\stopTEXpage
\egroup}
+\def\pagefigure
+ {\dodoubleempty\dopagefigure}
+
+\def\dopagefigure[#1][#2]%
+ {\dostartpagefigure[#1][#2]\stoppagefigure}
+
% \starttext \pagefigure[two.1] \stoptext
\def\doshowexternalfigures[#1]%
diff --git a/tex/context/base/core-grd.tex b/tex/context/base/core-grd.tex
index 27387c9d6..2e5675c9e 100644
--- a/tex/context/base/core-grd.tex
+++ b/tex/context/base/core-grd.tex
@@ -976,7 +976,32 @@
\hbox
\fi}
-\def\centertogrid % meant for special situations
+% \def\centertogrid % meant for special situations
+% {\ifgridsnapping
+% \dowithnextboxcontent
+% {\ignorespaces}
+% {\bgroup
+% \par
+% \scratchdimen\nextboxht
+% \advance\scratchdimen \nextboxdp
+% \getnoflines\scratchdimen
+% \setbox\nextbox\vbox to \noflines\lineheight
+% {\forgetall
+% \vskip\zeropoint \!!plus \nextboxht
+% \copy\nextbox
+% \kern.5\strutdp % VOORLOPIGE WAARDE
+% \vskip\zeropoint \!!plus \nextboxdp}%
+% \noindent\snaptogrid\vbox{\flushnextbox}%
+% \egroup}
+% \vbox % was \hbox
+% \fi}
+
+% The next implementation is sub-optimal
+%
+% \def\centertogrid % usage: see ie pascal / stepcharts
+% {\snaptogrid[\v!midden,.5\strutdp]\vbox}
+
+\def\centertogrid % meant for special situations
{\ifgridsnapping
\dowithnextboxcontent
{\ignorespaces}
@@ -987,19 +1012,71 @@
\getnoflines\scratchdimen
\setbox\nextbox\vbox to \noflines\lineheight
{\forgetall
- \vskip\zeropoint \!!plus \nextboxht
+ \vss
+ \topbaselinecorrection
\copy\nextbox
- \kern.5\strutdp % VOORLOPIGE WAARDE
- \vskip\zeropoint \!!plus \nextboxdp}%
+ \botbaselinecorrection
+ \vss}%
+ \setbox\nextbox\hbox{\lower\strutdp\flushnextbox}%
\noindent\snaptogrid\vbox{\flushnextbox}%
\egroup}
\vbox % was \hbox
\fi}
-% The next implementation is sub-optimal
+% testbed for \centertogrid
%
-% \def\centertogrid % usage: see ie pascal / stepcharts
-% {\snaptogrid[\v!midden,.5\strutdp]\vbox}
+% \strut Bruggetje
+% \startlinecorrection
+% \startcombination
+% {\framed{test}} {} {\framed{test}} {}
+% \stopcombination
+% \stoplinecorrection
+% \strut Bruggetje
+% \startlinecorrection
+% \startcombination[2*2]
+% {\framed{test}} {} {\framed{test}} {}
+% {\framed{test}} {} {\framed{test}} {}
+% \stopcombination
+% \stoplinecorrection
+% \strut Bruggetje
+% \startlinecorrection[blank]
+% \startcombination
+% {\framed{test}} {} {\framed{test}} {}
+% \stopcombination
+% \stoplinecorrection
+% \strut Bruggetje
+% \startlinecorrection[blank]
+% \startcombination[2*2]
+% {\framed{test}} {} {\framed{test}} {}
+% {\framed{test}} {} {\framed{test}} {}
+% \stopcombination
+% \stoplinecorrection
+% \strut Bruggetje
+% \startlinecorrection
+% \startcombination
+% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
+% \stopcombination
+% \stoplinecorrection
+% \strut Bruggetje
+% \startlinecorrection
+% \startcombination[2*2]
+% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
+% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
+% \stopcombination
+% \stoplinecorrection
+% \strut Bruggetje
+% \startlinecorrection[blank]
+% \startcombination
+% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
+% \stopcombination
+% \stoplinecorrection
+% \strut Bruggetje
+% \startlinecorrection[blank]
+% \startcombination[2*2]
+% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
+% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
+% \stopcombination
+% \stoplinecorrection
\ifx\startbaselinecorrection\undefined \wait \fi % change order
diff --git a/tex/context/base/core-ins.tex b/tex/context/base/core-ins.tex
index 1cb08e0af..c1185f7de 100644
--- a/tex/context/base/core-ins.tex
+++ b/tex/context/base/core-ins.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=core-ins,
-%D version=2002.4.16,
+%D version=2002.04.16,
%D title=\CONTEXT\ Insertion Macros,
%D subtitle=Insertions,
%D author=Hans Hagen,
diff --git a/tex/context/base/core-int.tex b/tex/context/base/core-int.tex
index 14ffe5b98..771887a6d 100644
--- a/tex/context/base/core-int.tex
+++ b/tex/context/base/core-int.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=core-int,
-%D version=1995.1.1,
+%D version=1995.01.01,
%D title=\CONTEXT\ Core Macros,
%D subtitle=Interaction,
%D author=Hans Hagen,
@@ -872,7 +872,7 @@
\advance\dimen0 -\getvalue{\??am#3\c!onderoffset}%
\setbox0\vbox to \dimen0
{\forgetall % Voor't geval de afstand
- %\stelblankoin[\v!standaard]% % (tijdelijk) is aangepast.
+ %\setupblank[\v!standaard]% % (tijdelijk) is aangepast.
\restorestandardblank
\hsize#2\relax
\executeamboxcommands{#3}{#4}\c!voor\c!tussen\c!na}%
@@ -2233,6 +2233,44 @@
\def\placecomments
{\doflushcomments}
+% \setupinteraction[state=start]
+%
+% \useattachment[whatever][[new name]][test.tex]
+%
+% % \setupattachments[\c!symbool={symbol-normal,symbol-down}]
+%
+% \starttext \attachment[whatever] \stoptext
+
+\definesystemvariable{at}
+
+\def\useattachment
+ {\dotripleempty\douseattachment}
+
+\def\douseattachment[#1][#2][#3]%
+ {\setgvalue{\??at :#1}{#2}%
+ \setgvalue{\??at::#1}{#3}%
+ \doifvaluenothing{\??at :#1}{\setxvalue{\??at :#1}{#1}}%
+ \doifvaluenothing{\??at::#1}{\setxvalue{\??at::#1}{\getvalue{\??at:#1}}}}
+
+\def\attachment[#1]%
+ {\ifundefined{\??at:#1}\else \iflocation
+ \doif\@@atstatus\v!start
+ {\doiffileelse{\getvalue{\??at:#1}}%
+ {\doPDFattachfile
+ {\getvalue{\??at::#1}}%
+ {1em}{1ex}\@@atkleur\@@atsymbool
+ {\getvalue{\??at:#1}}}%
+ {}}%
+ \fi \fi}
+
+\def\setupattachments
+ {\dodoubleempty\getparameters[\??at]}
+
+\setupattachments
+ [\c!status=\v!start,
+ \c!kleur=\@@iakleur,
+ \c!symbool=]
+
% jammer, tussen/midden had erin gemoeten; \c!commando toevoegen
\def\registermenucommand#1%
diff --git a/tex/context/base/core-itm.tex b/tex/context/base/core-itm.tex
index 445b634d4..ad83c0da5 100644
--- a/tex/context/base/core-itm.tex
+++ b/tex/context/base/core-itm.tex
@@ -365,7 +365,7 @@
% \fi
% \dosetraggedcommand{\getitemparameter\itemlevel\c!uitlijnen}\raggedcommand
% \doifsomething{\getitemparameter\itemlevel\c!inspringen}
-% {\expanded{\stelinspringenin[\getitemparameter\itemlevel\c!inspringen]}}%
+% {\expanded{\setupindenting[\getitemparameter\itemlevel\c!inspringen]}}%
% \doifinset\v!kolommen{#1}%
% {\ifbinnenkolommen\else\ifnum\itemcolumndepth=\zerocount
% \globallet\itemcolumndepth\itemlevel
@@ -481,7 +481,8 @@
\fi
\dosetraggedcommand{\getitemparameter\itemlevel\c!uitlijnen}\raggedcommand
\doifsomething{\getitemparameter\itemlevel\c!inspringen}
- {\expanded{\stelinspringenin[\getitemparameter\itemlevel\c!inspringen]}}%
+ {% is \expanded needed?
+ \expanded{\setupindenting[\getitemparameter\itemlevel\c!inspringen]}}%
\doifinset\v!kolommen{#1}%
{\ifbinnenkolommen\else\ifnum\itemcolumndepth=\zerocount
\globallet\itemcolumndepth\itemlevel
@@ -772,7 +773,7 @@
\ignorespaces
\dolistitem
\ifpackeditems
- \stelwitruimtein[\v!geen]%
+ \setupwhitespace[\v!geen]%
\fi
\getitemparameter\itemlevel\c!binnen
\marsymbol
diff --git a/tex/context/base/core-lst.tex b/tex/context/base/core-lst.tex
index a512b5562..535cfddb1 100644
--- a/tex/context/base/core-lst.tex
+++ b/tex/context/base/core-lst.tex
@@ -452,7 +452,7 @@
\edef\lijstelementen
{\getvalue{\??li#1\c!paginaovergangen}}%
\ExpandBothAfter\doifinset{#3}\lijstelementen
- {\showmessage{\m!systems}{14}{#3}%
+ {\showmessage\m!systems{14}{#3}%
\pagina}%
\egroup
\mindermeldingen
@@ -576,7 +576,7 @@
\translatednumber[#5]}}}}}}}%
\vbox
{\hsize\!!widthb
- \expanded{\steluitlijnenin[\getvalue{\??li#1\c!uitlijnen}]}%
+ \setupalign[\getvalue{\??li#1\c!uitlijnen}]%
\ifdim\!!widtha<\hsize
\hangindent=\wd2
\dimen2=\!!widthc % \getvalue{\??li#1\c!afstand}%
diff --git a/tex/context/base/core-mis.tex b/tex/context/base/core-mis.tex
index 85270dec0..fae009b7b 100644
--- a/tex/context/base/core-mis.tex
+++ b/tex/context/base/core-mis.tex
@@ -334,9 +334,9 @@
\hsize\!!widtha % setting \wd afterwards removed
\getvalue{\??al#1\the\alteller\c!binnen}%
\edef\!!stringa{\getvalue{\??al#1\the\alteller\c!uitlijnen}}% nodig?
- \expandafter\steluitlijnenin\expandafter[\!!stringa]%
+ \expandafter\setupalign\expandafter[\!!stringa]%
\edef\!!stringa{\getvalue{\??al#1\the\alteller\c!tolerantie}}% nodig?
- \expandafter\steltolerantiein\expandafter[\!!stringa]%
+ \expandafter\setuptolerance\expandafter[\!!stringa]%
\ignorespaces
\endgraf
\ignorespaces
@@ -1739,7 +1739,7 @@
\def\insidesecondpairedbox
{\forgetall
- \steluitlijnenin[\@@lduitlijnen]%
+ \setupalign[\@@lduitlijnen]%
\tolerantTABLEbreaktrue % hm.
\blanko[\v!blokkeer]%
\everypar{\begstrut}}
@@ -1845,7 +1845,7 @@
\def\nextnext
{\ifx\nexttoken\egroup \else % the next box is empty
\hsize\wd0
- \steluitlijnenin[\combinationparameter\c!uitlijnen]%
+ \setupalign[\combinationparameter\c!uitlijnen]%
\dostartattributes{\??co\currentcombination}\c!letter\c!kleur\empty
\bgroup
\aftergroup\endstrut
@@ -1861,7 +1861,7 @@
%
% \def\dodocombination
% {\vbox
-% {\forgetall % \stelwitruimtein[\v!geen]%
+% {\forgetall % \setupwhitespace[\v!geen]%
% \let\next\vbox
% \ExpandFirstAfter\processallactionsinset
% [\combinationparameter\c!plaats]
@@ -1873,7 +1873,7 @@
% %\vtop % wrong code
% % {\nointerlineskip % recently added
% % \hsize\wd0
-% % \steluitlijnenin[\combinationparameter\c!uitlijnen]% % \raggedcenter
+% % \setupalign[\combinationparameter\c!uitlijnen]% % \raggedcenter
% % \begstrut\unhbox2\endstrut}%
% \box2
% \fi}%
@@ -1883,7 +1883,7 @@
% \ifnum\horcombination=\zerocount
% \def\next
% {\cr\noalign
-% {\forgetall % \stelwitruimtein[\v!geen]% no
+% {\forgetall % \setupwhitespace[\v!geen]% no
% \nointerlineskip
% \combinationparameter\c!na
% \combinationparameter\c!voor
@@ -1903,7 +1903,7 @@
\def\dodocombination
{\vbox
- {\forgetall % \stelwitruimtein[\v!geen]%
+ {\forgetall % \setupwhitespace[\v!geen]%
\let\next\vbox
\ExpandFirstAfter\processallactionsinset
[\combinationparameter\c!plaats]
@@ -1920,7 +1920,7 @@
{\cr
\flushcombinationstack
\noalign
- {\forgetall % \stelwitruimtein[\v!geen]% no
+ {\forgetall % \setupwhitespace[\v!geen]% no
\global\setbox\combinationstack\emptybox
\nointerlineskip
\combinationparameter\c!na
@@ -2005,10 +2005,10 @@
\aftergroup\doplaatsondernaastelkaar
\let\next=}
-\def\plaatsonderelkaar
+\def\placeontopofeachother
{\plaatsondernaastelkaar\halign\hss}
-\def\plaatsnaastelkaar
+\def\placesidebyside
{\plaatsondernaastelkaar\valign\vss}
\def\dogebruikexternefiles[#1][#2]%
diff --git a/tex/context/base/core-new.tex b/tex/context/base/core-new.tex
index 28d667cab..a675ce0ed 100644
--- a/tex/context/base/core-new.tex
+++ b/tex/context/base/core-new.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=core-nav,
-%D version=1995.1.1,
+%D version=1995.01.01,
%D title=\CONTEXT\ Core Macros,
%D subtitle=New ones,
%D author=Hans Hagen,
diff --git a/tex/context/base/core-not.tex b/tex/context/base/core-not.tex
index 77eec6bc7..1340bbb59 100644
--- a/tex/context/base/core-not.tex
+++ b/tex/context/base/core-not.tex
@@ -895,8 +895,8 @@
{\let\setfootnotebodyfont\relax
\restoreglobalbodyfont
\switchtobodyfont[\@@vnkorps]%
- \steltolerantiein[\@@vntolerantie]%
- \steluitlijnenin[\@@vnuitlijnen]}
+ \setuptolerance[\@@vntolerantie]%
+ \setupalign[\@@vnuitlijnen]}
%D The footnote mechanism defaults to a traditional one
%D column way of showing them. By default we precede them by
diff --git a/tex/context/base/core-ntb.tex b/tex/context/base/core-ntb.tex
index d66707523..e7589d82c 100644
--- a/tex/context/base/core-ntb.tex
+++ b/tex/context/base/core-ntb.tex
@@ -110,8 +110,13 @@
\def\doiftblcol #1#2{\doifdefined {\@@tblprefix#1:#2:c}}
\def\doifnottblcol #1#2{\doifundefined {\@@tblprefix#1:#2:c}}
-\def\settblspn#1#2{\setvalue {\@@tblprefix#1:s}{#2}}
-\def\doiftblspn #1{\doifelsevalue{\@@tblprefix#1:s}{1}}
+% \def\settblspn#1#2{\setvalue {\@@tblprefix#1:s}{#2}}
+% \def\doiftblspn #1{\doifelsevalue{\@@tblprefix#1:s}{1}}
+
+\newif\ifsqueezeTBLspan % \squeezeTBLspantrue
+
+\def\settblspn #1{\setvalue {\@@tblprefix#1:s}{1}}
+\def\doifelsetblspn#1{\doifelsevalue{\@@tblprefix#1:s}{1}}
\def\settbltxt#1#2{\long\setvalue{\@@tblprefix:#1:#2:t}}
\def\gettbltxt#1#2{\csname\@@tblprefix:#1:#2:t\endcsname}
@@ -866,6 +871,47 @@
\setsecondpasscharacteralign \checkalignment{#2}% {\strut#2\unskip}%
\ignorespaces}
+% \long\def\dohandleTBLcellA#1#2[#3]#4%
+% {\setbox\scratchbox\hbox
+% {\setupTBLcell{#1}{#2}%
+% \localframed
+% [\@@tbl\@@tbl]
+% [#3,\c!achtergrond=,\c!kader=\v!uit]% 25% faster
+% {\bTBLCELL\TBLcharalign{#2}{#4}\eTBLCELL\inTBLcell{#1}{#2}}}%
+% \scratchdimen\gettblwid\colTBL\relax
+% \ifdim\wd\scratchbox>\scratchdimen
+% \settblwid\colTBL{\the\wd\scratchbox}% auto set
+% \fi
+% \let\rowTBLx\rowTBL\increment\rowTBLx
+% \scratchdimen\gettblhei\rowTBLx\relax
+% \ifdim\ht\scratchbox<\scratchdimen
+% \settblhei\rowTBLx{\the\ht\scratchbox}% auto set
+% \fi
+% \settblht{#1}{#2}{\the\ht\scratchbox}%
+% \settblwd{#1}{#2}{\the\wd\scratchbox}%
+% \ifautoTBLcheckwidth
+% \ifdim\wd\scratchbox<.75\hsize
+% \ifdim\ht\scratchbox>2\openlineheight % honor width since this can be a
+% \scratchdimen\gettblaut\colTBL\relax % figure or so
+% \ifdim\scratchdimen=\zeropoint
+% % side effect: when width is set to 0pt,
+% % we can force a span that fits the sum of spans widths
+% \settblaut\colTBL{\the\scratchdimen}%
+% \else\ifdim\wd\scratchbox>\scratchdimen
+% % unless span
+% \settblaut\colTBL{\the\wd\scratchbox}%
+% % to be translated
+% \writestatus\m!TABLE{no auto width in (\number#1,\number#2)\space\the\wd\scratchbox/\the\hsize}%
+% \fi\fi
+% \fi
+% \fi
+% \fi
+% \setbox2\null
+% \wd2\wd\scratchbox \ht2\ht\scratchbox \dp2\dp\scratchbox
+% \box2}
+
+% new, needed for icare first col of 'doeltabel', experimental
+
\long\def\dohandleTBLcellA#1#2[#3]#4%
{\setbox\scratchbox\hbox
{\setupTBLcell{#1}{#2}%
@@ -875,7 +921,11 @@
{\bTBLCELL\TBLcharalign{#2}{#4}\eTBLCELL\inTBLcell{#1}{#2}}}%
\scratchdimen\gettblwid\colTBL\relax
\ifdim\wd\scratchbox>\scratchdimen
- \settblwid\colTBL{\the\wd\scratchbox}% auto set
+ \ifsqueezeTBLspan
+ \ifnum0\number\gettblcol{#1}{#2}>1\relax \settblspn\colTBL \fi
+ \fi
+ \doifelsetblspn\colTBL
+ \donothing{\settblwid\colTBL{\the\wd\scratchbox}}% auto set
\fi
\let\rowTBLx\rowTBL\increment\rowTBLx
\scratchdimen\gettblhei\rowTBLx\relax
@@ -893,7 +943,7 @@
% we can force a span that fits the sum of spans widths
\settblaut\colTBL{\the\scratchdimen}%
\else\ifdim\wd\scratchbox>\scratchdimen
-% unless span
+ % unless span
\settblaut\colTBL{\the\wd\scratchbox}%
% to be translated
\writestatus\m!TABLE{no auto width in (\number#1,\number#2)\space\the\wd\scratchbox/\the\hsize}%
diff --git a/tex/context/base/core-ref.tex b/tex/context/base/core-ref.tex
index 479b64d47..7c60bcc3a 100644
--- a/tex/context/base/core-ref.tex
+++ b/tex/context/base/core-ref.tex
@@ -148,10 +148,31 @@
\def\reference {\dosingleargument\doreference }
%D These are implemented in a low level form as:
+%D
+%D \starttypen
+%D \def\dotextreference[#1]{\rawtextreference\s!txt{#1}} % #2
+%D \def\dopagereference[#1]{\rawpagereference\s!pag{#1}}
+%D \def\doreference [#1]{\rawreference \s!ref{#1}} % #2
+%D \stoptypen
+%D
+%D or without expansion problems:
+
+\def\dotextreference[#1]#2%
+ {\bgroup
+ \def\asciia{#1}%
+ \convertexpanded\??rf{#2}\asciib
+ \@EA\rawtextreference\@EA\s!txt\@EA\asciia\@EA{\asciib}%
+ \egroup}
+
+\def\dopagereference[#1]%
+ {\rawpagereference\s!pag{#1}}
-\def\dotextreference[#1]{\rawtextreference\s!txt{#1}} % #2
-\def\dopagereference[#1]{\rawpagereference\s!pag{#1}}
-\def\doreference [#1]{\rawreference \s!ref{#1}} % #2
+\def\doreference[#1]#2%
+ {\bgroup
+ \def\asciia{#1}%
+ \convertexpanded\??rf{#2}\asciib
+ \@EA\rawreference\@EA\s!ref\@EA\asciia\@EA{\asciib}%
+ \egroup}
%D Actually there is not much difference between a text and a
%D full reference, but it's the concept that counts. The low
@@ -3568,6 +3589,7 @@
\c!links=\citaat\bgroup,
\c!rechts=\egroup,
\c!globaal=\v!nee,
+ \c!expansie=\v!nee,
\c!scheider=\nonbreakablespace]
\let\nonbreakablespace=~
diff --git a/tex/context/base/core-reg.tex b/tex/context/base/core-reg.tex
index 0a1e95929..3149c800c 100644
--- a/tex/context/base/core-reg.tex
+++ b/tex/context/base/core-reg.tex
@@ -108,10 +108,13 @@
\def\donoregister[#1]%
{\dodoregister[#1]{}}
+% \def\dodoregister[#1]#2#3%
+% {\doprocesspageregister[#1]{#2}{#3}%
+% \ifvmode\nobreak\fi
+% \GotoPar}
+
\def\dodoregister[#1]#2#3%
- {\doprocesspageregister[#1]{#2}{#3}%
- \ifvmode\nobreak\fi
- \GotoPar}
+ {\dogotopar{\doprocesspageregister[#1]{#2}{#3}}}
\def\writetoregister[#1]% to be documented
{\doregister{#1}}
diff --git a/tex/context/base/core-rul.tex b/tex/context/base/core-rul.tex
index e333bdccb..dee031305 100644
--- a/tex/context/base/core-rul.tex
+++ b/tex/context/base/core-rul.tex
@@ -2720,7 +2720,7 @@
%\hangindent=\wd0\relax % tzt hang=yes,n
%\parindent=\hangindent
%\box0\relax
- \stelwitruimtein[\v!groot]%
+ \setupwhitespace[\v!groot]%
\ignorespaces
#4%
\doifsomething{#3}
diff --git a/tex/context/base/core-sec.tex b/tex/context/base/core-sec.tex
index 1697a775d..d00732031 100644
--- a/tex/context/base/core-sec.tex
+++ b/tex/context/base/core-sec.tex
@@ -938,8 +938,17 @@
{\doifvaluesomething{\??ko#1#3}
{\setuplayouttext[#2][\c!status=\getvalue{\??ko#1#3}]}}}
+% \def\dohandelpaginaafB#1%
+% {\doifinset{\getvalue{\??ko#1\c!pagina}}{\v!ja,\v!rechts,\v!links}
+% {\def\resetcurrentsectionmarks% toegevoegd, zie \pagina
+% {\resetsectionmarks{\previoussection\@@sectie}}%
+% \pagina[\getvalue{\??ko#1\c!pagina}]%
+% \dohandelpaginaafBB{#1}\v!hoofd\c!hoofd
+% \dohandelpaginaafBB{#1}\v!tekst\c!tekst
+% \dohandelpaginaafBB{#1}\v!voet \c!voet}}
+
\def\dohandelpaginaafB#1%
- {\doifinset{\getvalue{\??ko#1\c!pagina}}{\v!ja,\v!rechts,\v!links}
+ {\doifvaluesomething{\??ko#1\c!pagina}
{\def\resetcurrentsectionmarks% toegevoegd, zie \pagina
{\resetsectionmarks{\previoussection\@@sectie}}%
\pagina[\getvalue{\??ko#1\c!pagina}]%
@@ -978,17 +987,17 @@
%\def\dolocalheadsetup#1% koppeling met standaard kopcommando / engels
% {\forgetall
% \doifvaluesomething{\??ko#1\c!uitlijnen}
-% {\ExpandFirstAfter\steluitlijnenin[\getvalue{\??ko#1\c!uitlijnen}]}%
+% {\ExpandFirstAfter\setupalign[\getvalue{\??ko#1\c!uitlijnen}]}%
% \doifvaluesomething{\??ko#1\c!tolerantie}
-% {\ExpandFirstAfter\steltolerantiein[\getvalue{\??ko#1\c!tolerantie}]}%
+% {\ExpandFirstAfter\setuptolerance[\getvalue{\??ko#1\c!tolerantie}]}%
% \def\\{\crlf\strut\ignorespaces}}
\def\dolocalheadsetup#1% koppeling met standaard kopcommando / engels
{\forgetall % traag dus ...
\doifvaluesomething{\??ko#1\c!uitlijnen} % wordt al expanded in spa
- {\expanded{\steluitlijnenin[\getvalue{\??ko#1\c!uitlijnen}]}}%
+ {\expanded{\setupalign[\getvalue{\??ko#1\c!uitlijnen}]}}%
\doifvaluesomething{\??ko#1\c!tolerantie} % wordt al expanded in spa
- {\expanded{\steltolerantiein[\getvalue{\??ko#1\c!tolerantie}]}}%
+ {\expanded{\setuptolerance[\getvalue{\??ko#1\c!tolerantie}]}}%
\def\\{\crlf\strut\ignorespaces}}
\def\localkopsetup{\localheadsetup} % kan tzt weg
@@ -1511,7 +1520,7 @@
\dostartattributes\@@sectie\c!letter\c!kleur\empty
\dontconvertfont
\dostartattributes\@@sectie{#1}{#2}\empty
- \stelinterliniein % \setupinterlinespace
+ \setupinterlinespace
\begstrut\haalmarkering[\hoofdmarkering{#4#3}]\endstrut
\endgraf
\dostopattributes
@@ -1560,9 +1569,9 @@
\dostartattributes{\??ko#1}\c!tekstletter\c!tekstkleur\empty
\dontconvertfont
\ifdisplaysectionhead
- \stelinterliniein
+ \setupinterlinespace
\else
- \stelspatieringin
+ \setupspacing
\fi
\ifcase\headtimingmode#2\fi
\getvalue{\??ko#1\c!voorcommando}%
@@ -1618,9 +1627,9 @@
\dostartattributes{\??ko#1}\c!tekstletter\c!tekstkleur\empty
\dontconvertfont
\ifdisplaysectionhead
- \stelinterliniein
+ \setupinterlinespace
\else
- \stelspatieringin
+ \setupspacing
\fi
\ifcase\headtimingmode#2\fi
\placeheadmargintexts{#1}% binnen #3?
diff --git a/tex/context/base/core-spa.tex b/tex/context/base/core-spa.tex
index 7a0872e84..3c231c6b6 100644
--- a/tex/context/base/core-spa.tex
+++ b/tex/context/base/core-spa.tex
@@ -25,22 +25,22 @@
\appendtoks \settopskip \to \everybodyfont
\appendtoks \setmaxdepth \to \everybodyfont
\appendtoks \spacing 1\to \everybodyfont
-\appendtoks \simplestelinspringenin \to \everybodyfont
-\appendtoks \simplestelblankoin \to \everybodyfont
-\appendtoks \simplestelwitruimtein \to \everybodyfont
+\appendtoks \simplesetupindenting \to \everybodyfont
+\appendtoks \simplesetupblank \to \everybodyfont
+\appendtoks \simplesetupwhitespace \to \everybodyfont
%appendtoks \checknotes \to \everybodyfont % not
-\appendtoks \simplestelspatieringin \to \everybodyfont % nieuw
+\appendtoks \simplesetupspacing \to \everybodyfont % nieuw
\appendtoks \setdisplayskips \to \everybodyfont % nieuw
\appendtoks \updateraggedskips \to \everyfontswitch % under test
\prependtoks \let\par\endgraf \to \everypagebody % see \fillinline
-\appendtoks \simplestelspatieringin \to \everydefinedfont
+\appendtoks \simplesetupspacing \to \everydefinedfont
\def\stelfactorenin
- {\simplestelwitruimtein
- \simplestelblankoin
+ {\simplesetupwhitespace
+ \simplesetupblank
\settopskip
\setmaxdepth}
@@ -79,7 +79,7 @@
%D There are two ways to influence the interline spacing. The
%D most general and often most consistent way is using
%D
-%D \showsetup{\y!stelinterliniein}
+%D \showsetup{\y!setupinterlinespace}
%D
%D For instance
%D
@@ -153,22 +153,22 @@
\s!unknown=>\assignvalue{#1}\regelwit{1.00}{1.25}{1.50}%
\spacing\regelwit]}
-\def\complexstelinterliniein[#1]% \commalistelement ipv #1
+\def\complexsetupinterlinespace[#1]% \commalistelement ipv #1
{\doifassignmentelse{#1}
\setupspecifiedinterlinespace\setuprelativeinterlinespace[#1]}
\def\setuplocalinterlinespace[#1]%
{\localinterlinespacetrue
- \stelinterliniein[#1]%
+ \setupinterlinespace[#1]%
\localinterlinespacefalse}
-\def\simplestelinterliniein
+\def\simplesetupinterlinespace
{\localinterlinespacetrue
\setfontparameters
\updateraggedskips % funny one here
\localinterlinespacefalse}
-\definecomplexorsimple\stelinterliniein
+\definecomplexorsimple\setupinterlinespace
% In earlier versions \type{\bigskipamount} was
% \type{\ht\strutbox} and the stretch was plus or minus
@@ -731,7 +731,7 @@
%D [\v!groot]
%D \stoptypen
-\def\dostelblankoin#1% amount are an plain inheritance
+\def\dosetupblank#1% amount are an plain inheritance
{\bigskipamount#1\relax
\ifblankoflexibel \else
\bigskipamount1\bigskipamount
@@ -739,7 +739,7 @@
\medskipamount \bigskipamount \divide\medskipamount 2
\smallskipamount\bigskipamount \divide\smallskipamount 4 }%
-\def\complexstelblankoin[#1]% more \let's
+\def\complexsetupblank[#1]% more \let's
{\ifgridsnapping
\blankoflexibelfalse
\else
@@ -750,18 +750,18 @@
\fi
\ExpandFirstAfter\processallactionsinset
[#1]
- [ \v!flexibel=>\dostelblankoin\deblankoskip,
- \v!vast=>\dostelblankoin\deblankoskip,
+ [ \v!flexibel=>\dosetupblank\deblankoskip,
+ \v!vast=>\dosetupblank\deblankoskip,
\v!regel=>\edef\deblankoskip{\regelafstand}%
- \dostelblankoin\deblankoskip
+ \dosetupblank\deblankoskip
\let\deblanko\v!groot,
\v!halveregel=>\scratchskip.5\regelafstand
\edef\deblankoskip{\the\scratchskip}%
- \dostelblankoin\deblankoskip
+ \dosetupblank\deblankoskip
\let\deblanko\v!middel,
\v!groot=>\ifgridsnapping
\edef\deblankoskip{\regelafstand}%
- \dostelblankoin\deblankoskip
+ \dosetupblank\deblankoskip
\fi
\let\currentblanko\v!groot % was \def, why ?
\let\deblanko\v!groot,
@@ -769,35 +769,35 @@
\let\deblanko\v!middel,
\v!klein=>\let\currentblanko\v!klein % was \def, why ?
\let\deblanko\v!klein,
- \v!normaal=>\dostelblankoin\deblankoskip
+ \v!normaal=>\dosetupblank\deblankoskip
\let\deblanko\v!groot,
\v!standaard=>\edef\deblankoskip{\skipfactor\regelafstand}%
- \dostelblankoin\deblankoskip
+ \dosetupblank\deblankoskip
\let\deblanko\v!groot,
- \s!default=>\dostelblankoin\deblankoskip
+ \s!default=>\dosetupblank\deblankoskip
\let\deblanko\v!groot,
\s!unknown=>\let\deblankoskip\commalistelement
- \dostelblankoin\deblankoskip
+ \dosetupblank\deblankoskip
\let\deblanko\v!groot]%
- \simplestelwitruimtein}
+ \simplesetupwhitespace}
-% \definecomplexorsimpleempty\stelblankoin
+% \definecomplexorsimpleempty\setupblank
%
% speed gain: 60 sec -> 30 sec
-\definecomplexorsimple\stelblankoin
+\definecomplexorsimple\setupblank
-\def\simplestelblankoin % == snelle \stelblankoin[\s!default]
+\def\simplesetupblank % == snelle \setupblank[\s!default]
{\ifgridsnapping
\blankoflexibelfalse
\fi
- \dostelblankoin\deblankoskip
+ \dosetupblank\deblankoskip
\let\deblanko\v!groot
- \simplestelwitruimtein}
+ \simplesetupwhitespace}
\def\restorestandardblank% \v!standaard
{\edef\deblankoskip{\skipfactor\regelafstand}%
- \dostelblankoin\deblankoskip
+ \dosetupblank\deblankoskip
\let\deblanko\v!groot}
\def\dodefinieerblanko[#1][#2]%
@@ -837,18 +837,18 @@
\def\presetindentation
{\doifoutervmode{\ifindentfirstparagraph\else\noindentation\fi}}
-\definecomplexorsimple\stelinspringenin
+\definecomplexorsimple\setupindenting
-\def\complexstelinspringenin[#1]%
+\def\complexsetupindenting[#1]%
{\processallactionsinset
[#1]
[ \v!eerste=>\indentfirstparagraphtrue,
\v!volgende=>\indentfirstparagraphfalse,
- \s!default=>\simplestelinspringenin,
+ \s!default=>\simplesetupindenting,
\s!unknown=>\edef\currentvoorwit{\commalistelement}%
- \simplestelinspringenin]}
+ \simplesetupindenting]}
-\def\simplestelinspringenin
+\def\simplesetupindenting
{\assigndimension\currentvoorwit\voorwit{1em}{1.5em}{2em}%
\parindent\voorwit\relax}
@@ -906,14 +906,14 @@
\definespacingmethod[\v!opelkaar]{\newfrenchspacing}
\definespacingmethod[\v!ruim ]{\nonfrenchspacing}
-\def\complexstelspatieringin[#1]%
+\def\complexsetupspacing[#1]%
{\executeifdefined{\??sg\??sg#1}\relax
\updateraggedskips}
-\def\simplestelspatieringin
+\def\simplesetupspacing
{\updateraggedskips}
-\definecomplexorsimple\stelspatieringin
+\definecomplexorsimple\setupspacing
\catcode`\~=\@@active % to be sure
@@ -1121,17 +1121,17 @@
\def\currentwitruimte {\zeropoint}
% \def\stelwitruimteopnieuwin
-% {\expanded{\stelwitruimtein[\currentwitruimte]}}
+% {\expanded{\setupwhitespace[\currentwitruimte]}}
%
% \newif\ifwitruimteflexibel \witruimteflexibeltrue
%
-% \definecomplexorsimple\stelwitruimtein
+% \definecomplexorsimple\setupwhitespace
%
-% \def\complexstelwitruimtein[#1]%
-% {\expanded{\dostelwitruimtein[#1]}%
-% \dodostelwitruimtein}
+% \def\complexsetupwhitespace[#1]%
+% {\expanded{\dosetupwhitespace[#1]}%
+% \dodosetupwhitespace}
%
-% \def\dostelwitruimtein[#1]%
+% \def\dosetupwhitespace[#1]%
% {\processallactionsinset
% [#1]
% [\v!herstel=>,
@@ -1143,7 +1143,7 @@
% \s!unknown=>\@EA\assigndimension\@EA{\commalistelement} % \@EA is nodig
% \tussenwit\blankokleinmaat\blankomiddelmaat\blankogrootmaat]} % te vangen
%
-% \def\dodostelwitruimtein
+% \def\dodosetupwhitespace
% {\edef\currentwitruimte
% {\ifdim\tussenwit=\zeropoint
% \v!geen
@@ -1161,26 +1161,26 @@
% \fi
% \parskip\tussenwit}
%
-% \def\simplestelwitruimtein% == snelle \stelwitruimtein[\s!default]
+% \def\simplesetupwhitespace% == snelle \setupwhitespace[\s!default]
% {\doifnot\currentwitruimte\v!geen\stelwitruimteopnieuwin
-% \dodostelwitruimtein}
+% \dodosetupwhitespace}
-\definecomplexorsimple\stelwitruimtein
+\definecomplexorsimple\setupwhitespace
-\def\simplestelwitruimtein
- {\doifnot\currentwitruimte\v!geen\dostelwitruimtein}
+\def\simplesetupwhitespace
+ {\doifnot\currentwitruimte\v!geen\dosetupwhitespace}
-\def\complexstelwitruimtein[#1]%
+\def\complexsetupwhitespace[#1]%
{\doifelsenothing{#1}
- {\simplestelwitruimtein}
+ {\simplesetupwhitespace}
{\edef\currentwitruimte{#1}%
- \dostelwitruimtein}}
+ \dosetupwhitespace}}
-\def\dostelwitruimtein
+\def\dosetupwhitespace
{\processcommacommand[\currentwitruimte]\dowhitespacemethod
- \dodostelwitruimtein}
+ \dodosetupwhitespace}
-\def\dodostelwitruimtein
+\def\dodosetupwhitespace
{\ifgridsnapping
\witruimteflexibelfalse
\tussenwit1\tussenwit
@@ -1284,7 +1284,7 @@
\opelkaarfalse
\opelkaartrue
\blanko[\v!blokkeer] % dit is nog niet ok, gaat fout
- \stelwitruimtein[\v!geen] % bovenin vtop (dwz, baseline)
+ \setupwhitespace[\v!geen] % bovenin vtop (dwz, baseline)
\fi}
\def\stopopelkaar
@@ -1539,9 +1539,24 @@
% \!!depth \strutdepth
% \normalkern-\strutwidth}}}
+% \def\setstrut
+% {\setstrutdimen\strutheight\strutheightfactor\spacingfactor
+% \setstrutdimen\strutdepth \strutdepthfactor \spacingfactor
+% \dosetstrut}
+
\def\setstrut
- {\setstrutdimen\strutheight\strutheightfactor\spacingfactor
- \setstrutdimen\strutdepth \strutdepthfactor \spacingfactor
+ {\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\setcharstrut#1%
@@ -1809,7 +1824,7 @@
{\par % else skips forgotten
\egroup}
-\def\stelsmallerin
+\def\setupnarrower
{\dodoubleargument\getparameters[\??sl]}
\newdimen\@@effectivehsize \def\effectivehsize {\hsize}
@@ -2076,10 +2091,10 @@
%\def\forgetparindent
% {\forgeteverypar
% \indentfirstparagraphtrue % recently added
-% \stelinspringenin[\v!geen]}
+% \setupindenting[\v!geen]}
%\def\forgetparskip
-% {\stelwitruimtein[\v!geen]}
+% {\setupwhitespace[\v!geen]}
\def\forgetparindent
{\forgeteverypar
@@ -2694,7 +2709,7 @@
\newif\if@@asragged \@@asraggedtrue % old method
-\def\dodosteluitlijnenin[#1]%
+\def\dodosetupalign[#1]%
{\doifinsetelse\v!ruim {#1}\!!doneatrue\!!doneafalse
\doifinsetelse\v!breed{#1}\!!donebtrue\!!donebfalse
\ExpandFirstAfter\processallactionsinset
@@ -2723,15 +2738,15 @@
\v!nieuw=>\@@asraggedfalse, % so new will give you consistency
\v!reset=>\notragged\normalbottom]}
-\def\dosteluitlijnenin[#1]%
- {\expanded{\dodosteluitlijnenin[#1]}}
+\def\dosetupalign[#1]%
+ {\expanded{\dodosetupalign[#1]}}
-\def\steluitlijnenin
- {\dosingleargument\dosteluitlijnenin}
+\def\setupalign
+ {\dosingleargument\dosetupalign}
\def\startuitlijnen
{\bgroup
- \steluitlijnenin}
+ \setupalign}
\def\stopuitlijnen
{\par
@@ -2798,7 +2813,7 @@
%D ...
-\def\dosteltolerantiein[#1]%
+\def\dosetuptolerance[#1]%
{\doifinsetelse\v!vertikaal{#1}%
{\ExpandFirstAfter\processallactionsinset
[#1]
@@ -2815,8 +2830,8 @@
\v!soepel=>\tolerance3000,
\v!zeersoepel=>\tolerance4500]}}
-\def\steltolerantiein
- {\dosingleargument\dosteltolerantiein}
+\def\setuptolerance
+ {\dosingleargument\dosetuptolerance}
% \def\woordrechts
% {\groupedcommand{\hfill\hbox}{\parfillskip\zeropoint}}
@@ -3007,16 +3022,16 @@
\def\fixedspaceamount#1%
{#1\fontdimen2\font}
-\stelwitruimtein
+\setupwhitespace
[\v!geen]
\inspringen
[\v!nooit]
-\stelinspringenin
+\setupindenting
[\v!geen]
-\stelblankoin
+\setupblank
[\v!standaard,
\v!groot]
@@ -3031,7 +3046,7 @@
\def\@@blankotussen{\blanko[\v!tussen]} % scheelt 5 tokens == >20 bytes
\def\@@blankona {\blanko[\v!na]} %
-\stelinterliniein
+\setupinterlinespace
[\c!hoogte=.72,
\c!diepte=.28,
\c!boven=1.0,
@@ -3040,22 +3055,22 @@
\c!regel=2.8ex,
\c!rek=0]
-\stelsmallerin
+\setupnarrower
[\c!links=1.5em,
\c!rechts=1.5em,
\c!midden=1.5em]
-\steltolerantiein
+\setuptolerance
[\v!horizontaal,\v!zeerstreng]
-\steltolerantiein
+\setuptolerance
[\v!vertikaal,\v!streng]
-\steluitlijnenin
+\setupalign
[\v!onder,
\v!breedte]
-\stelspatieringin
+\setupspacing
[\v!opelkaar]
\protect \endinput
diff --git a/tex/context/base/core-syn.tex b/tex/context/base/core-syn.tex
index 1791899fb..61c46c1e3 100644
--- a/tex/context/base/core-syn.tex
+++ b/tex/context/base/core-syn.tex
@@ -76,7 +76,7 @@
\c!kopletter=,
\c!letter=]%
%
- \stelwitruimtein[\v!geen]%
+ \setupwhitespace[\v!geen]%
\doutilities{#1}\jobname{#2}\relax\par
\endgroup
\ifutilitydone\else\geenwitruimte\fi}
@@ -257,7 +257,7 @@
\def\doplaatslijstmetsorteren#1% NOG EEN RUWE VERSIE MAKEN
{\witruimte % ZONDER WITRUIMTE ETC ETC
\begingroup
- \stelwitruimtein[\v!geen]%
+ \setupwhitespace[\v!geen]%
\doutilities{#1}\jobname{#1}\relax\par
\endgroup
\ifutilitydone\else\geenwitruimte\fi}
diff --git a/tex/context/base/core-sys.tex b/tex/context/base/core-sys.tex
index 746103037..18c38da72 100644
--- a/tex/context/base/core-sys.tex
+++ b/tex/context/base/core-sys.tex
@@ -31,33 +31,73 @@
\appendtoks \splitjobfilename \to \everyjob
+% Some mechanisms (see x-res-01) use either \jobfilename or
+% \jobfilename.somesuffix, in which case we need to use the
+% full name if given or a default (like \jobfilename.xml);
+% this comes down to replacing the default tex suffix.
+
+\def\jobfullname{\jobfilename.\jobfilesuffix}
+
+\def\setjobfullname#1% #1 = default if not given
+ {\doifelsenothing\jobfilename
+ {\let\jobfullname\empty}
+ {\doif\jobfilesuffix\c!tex{\edef\jobfullname{\jobfilename.#1}}}}
+
+% ...
+
\def\dosetupsystem[#1]%
{\getparameters[\??sv][#1]%
\setuprandomize[\@@svwillekeur]%
\beforesplitstring\@@svresolutie\at dpi\to\@@svresolutie
\let\outputresolution\@@svresolutie
+ \ifcase\@@svn
+ % % 0 : unknown
+ \or
+ \setsystemmode\v!eerste % 1 : first run
+ \or
+ % % 2 : successive run
+ \or
+ \setsystemmode\v!eerste % 3 : first and only run
+ \or
+ \setsystemmode\v!laatste % 4 : extra last run
+ \fi
\splitjobfilename}
\def\setupsystem
{\dosingleargument\dosetupsystem}
+%D The system modes set by the setup command can be used in
+%D situations like:
+%D
+%D \starttypen
+%D \startmode[*first]
+%D \executesystemcommand{cleanupxml text.xml clean-text.xml}
+%D \stopmode
+%D
+%D \starttext
+%D \typefile{clean-text.xml}
+%D \stoptext
+%D \stoptypen
+
\def\setuprandomize[#1]%
{\doifsomething{#1}
{\bgroup
- \setrandomseed\minusone
+ \setrandomseed\minusone % signals thrd-ran to reseed
+ % tex's time is in minutes
\processaction
[#1]
- [ \v!klein=>\divide\time 900, % 15 taco vragen hoe
- \v!middel=>\divide\time 1800, % 30 time werkt; nodig voor
- \v!groot=>\divide\time 3600, % 60 random pos deadlock
+ [ \v!klein=>\divide\normaltime 15, % 900,
+ \v!middel=>\divide\normaltime 30, % 1800,
+ \v!groot=>\divide\normaltime 60, % 3600,
\v!normaal=>,
\s!default=>,
- \s!unknown=>\time=#1]%
+ \s!unknown=>\normaltime=#1]%
\nextrandom
\egroup}}
\setupsystem
[\c!gebied=,
+ \c!n=0, % 0:unknown 1: one run 2: first 3: successive 4: final run
\c!resolutie=600dpi,
\c!willekeur=,
\c!file=\jobname,
diff --git a/tex/context/base/core-tbl.tex b/tex/context/base/core-tbl.tex
index 92a791e70..b0a11202c 100644
--- a/tex/context/base/core-tbl.tex
+++ b/tex/context/base/core-tbl.tex
@@ -689,7 +689,16 @@
\fi
\next}
+% The much neede hook:
+
\newtoks\everytabulate
+
+% An example of its usage:
+
+\appendtoks \optimizeverbatimfalse \to \everytabulate
+
+% A status variable:
+
\chardef\tabulatepass=0
\def\dofinalstarttabulate[#1][#2][#3]% identifier sub preamble
diff --git a/tex/context/base/enco-ans.tex b/tex/context/base/enco-ans.tex
index 8d41449c7..a4d255202 100644
--- a/tex/context/base/enco-ans.tex
+++ b/tex/context/base/enco-ans.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=enco-ans,
-%D version=2000.5.7, % 1995.1.1,
+%D version=2000.05.07, % 1995.01.01,
%D title=\CONTEXT\ Encoding Macros,
%D subtitle=\YandY\ texnansi Encoding,
%D author={Patrick Gundlach, Hans Hagen},
@@ -47,6 +47,9 @@
\definecasemap 241 241 209 \definecasemap 209 241 209
\definecasemap 245 245 213 \definecasemap 213 245 213
+\definecasemap 240 240 208 \definecasemap 208 240 208
+\definecasemap 254 254 222 \definecasemap 222 254 222
+
\stopmapping
\startencoding[texnansi]
@@ -81,6 +84,9 @@
\definecharacter thorn 254
\definecharacter Thorn 222
+\definecharacter Eth 208
+\definecharacter eth 240
+
\definecharacter exclamdown 161
\definecharacter questiondown 191
diff --git a/tex/context/base/enco-def.tex b/tex/context/base/enco-def.tex
index d7d9ca82d..0ab1f4850 100644
--- a/tex/context/base/enco-def.tex
+++ b/tex/context/base/enco-def.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=enco-def,
-%D version=2000.5.7, % 2000.20.12, % split from less verbose base file
+%D version=2000.05.07, % 2000.20.12, % split from less verbose base file
%D title=\CONTEXT\ Encoding Macros,
%D subtitle=Default Character Definitions,
%D author=Hans Hagen,
diff --git a/tex/context/base/enco-ec.tex b/tex/context/base/enco-ec.tex
index 0a65c4e3c..f202b4c99 100644
--- a/tex/context/base/enco-ec.tex
+++ b/tex/context/base/enco-ec.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=enco-ec,
-%D version=2000.5.7, % 1999.16.7,
+%D version=2000.05.07, % 1999.16.07,
%D title=\CONTEXT\ Encoding Macros,
%D subtitle=\LATEX\ EC Encoding,
%D author={Patrick Gundlach, Hans Hagen, Taco Hoekwater},
diff --git a/tex/context/base/enco-ecm.tex b/tex/context/base/enco-ecm.tex
index 329f66a9c..5fbbe1c8c 100644
--- a/tex/context/base/enco-ecm.tex
+++ b/tex/context/base/enco-ecm.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=enco-ec,
-%D version=2000.5.7,
+%D version=2000.05.07,
%D title=\CONTEXT\ Encoding Macros,
%D subtitle=Glyphs that may not be present in EC,
%D author=Hans Hagen,
diff --git a/tex/context/base/enco-il2.tex b/tex/context/base/enco-il2.tex
index e8348195f..042ccf075 100644
--- a/tex/context/base/enco-il2.tex
+++ b/tex/context/base/enco-il2.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=enco-il2,
-%D version=2000.5.7, % 1998.12.1,
+%D version=2000.05.07, % 1998.12.01,
%D title=\CONTEXT\ Encoding Macros,
%D subtitle=Czech and Slovak ISO Latin 2 Encoding,
%D author=Hans Hagen,
diff --git a/tex/context/base/enco-mis.tex b/tex/context/base/enco-mis.tex
index d80202994..152e78542 100644
--- a/tex/context/base/enco-mis.tex
+++ b/tex/context/base/enco-mis.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=enco-mis,
-%D version=2000.5.7, % 1999.11.11,
+%D version=2000.05.07, % 1999.11.11,
%D title=\CONTEXT\ Encoding Macros,
%D subtitle=Missing Glyphs,
%D author=Hans Hagen,
diff --git a/tex/context/base/enco-pdf.tex b/tex/context/base/enco-pdf.tex
index 4579c0b54..ca8c96b74 100644
--- a/tex/context/base/enco-pdf.tex
+++ b/tex/context/base/enco-pdf.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=enco-pdf,
-%D version=1995.1.1,
+%D version=1995.01.01,
%D title=\CONTEXT\ Encoding Macros,
%D subtitle=\YandY\ texnansi Encoding,
%D author=Hans Hagen,
diff --git a/tex/context/base/enco-pol.tex b/tex/context/base/enco-pol.tex
index 36336c03a..108969702 100644
--- a/tex/context/base/enco-pol.tex
+++ b/tex/context/base/enco-pol.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=enco-pol,
-%D version=2000.5.7, % 1999.28.8,
+%D version=2000.05.07, % 1999.28.8,
%D title=\CONTEXT\ Encoding Macros,
%D subtitle=Polish Mixed Encoding,
%D author={Taco Hoekwater \& Hans Hagen},
diff --git a/tex/context/base/enco-run.tex b/tex/context/base/enco-run.tex
index a12f82f53..b88c4111a 100644
--- a/tex/context/base/enco-run.tex
+++ b/tex/context/base/enco-run.tex
@@ -37,7 +37,7 @@
\setuptextrules[\c!korps=,\c!letter=]
\starttextrule{\visualizecharacterslegend}
\witruimte
- \restorefont\stelinterliniein
+ \restorefont\setupinterlinespace
\visualizecharacters
\def\do##1%
{{\def\dodo####1%
@@ -85,7 +85,7 @@
\edef\enccols{\number\dimen0}
\visualizecharacters
\startcolumns[\c!n=\enccols,\c!afstand=2em]
- \restorefont\stelinterliniein
+ \restorefont\setupinterlinespace
\def\definecharacter ##1 ##2 %
{\setbox0=\hbox to \hsize{\localcolortrue\hbox to \encwidth{\getvalue{##1}\hss}\tttf##1}%
\ht0\strutheight \dp0\strutdepth \box0 \allowbreak}
diff --git a/tex/context/base/enco-tbo.tex b/tex/context/base/enco-tbo.tex
index 26ea374cf..3e9719c2a 100644
--- a/tex/context/base/enco-tbo.tex
+++ b/tex/context/base/enco-tbo.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=enco-tbo,
-%D version=2000.5.7, % 2001.8.4,
+%D version=2000.05.07, % 2001.8.4,
%D title=\CONTEXT\ Encoding Macros,
%D subtitle=TeXBaseOne Encoding,
%D author={Patrick Gundlach, Hans Hagen},
diff --git a/tex/context/base/font-ini.tex b/tex/context/base/font-ini.tex
index f72d547e9..387e12e3a 100644
--- a/tex/context/base/font-ini.tex
+++ b/tex/context/base/font-ini.tex
@@ -1673,9 +1673,9 @@
%\def\redodefinefont#1#2#3%
% {\dododefinefont{#1}{#2}%
% \doifnumberelse{#3}
-% {\stelinterliniein[#3]\stelspatieringin}
+% {\setupinterlinespace[#3]\setupspacing}
% {\doifassignmentelse{#3}
-% {\stelinterliniein[#3]\stelspatieringin}
+% {\setupinterlinespace[#3]\setupspacing}
% {\setups[#3]}}} % so, we can have setups associated to fonts !
\def\redodefinefont#1#2#3%
@@ -1683,7 +1683,7 @@
\doifsetupselse{#3}
{\setups[#3]} % don't forget to document this !
{\setuplocalinterlinespace[#3]%
- \stelspatieringin}} % needed ?
+ \setupspacing}} % needed ?
% \def\defineclassfont
% {\doquadrupleempty\dodefineclassfont}
@@ -3733,7 +3733,7 @@
%D some typing:
\def\setfont% geen \dosetfont mogelijk
- {\def\next{\nextfont\stelinterliniein}%
+ {\def\next{\nextfont\setupinterlinespace}%
\afterassignment\next\font\nextfont=}
%D One can call this macro as:
diff --git a/tex/context/base/font-map.tex b/tex/context/base/font-map.tex
index a9eccba69..4d4362009 100644
--- a/tex/context/base/font-map.tex
+++ b/tex/context/base/font-map.tex
@@ -2,7 +2,7 @@
%D \module
%D [ file=font-map,
-%D version=1998.3.13,
+%D version=1998.03.13,
%D title=\CONTEXT\ Font Macros,
%D subtitle=Postscript for Maps,
%D author=Taco Hoekwater,
diff --git a/tex/context/base/font-uni.tex b/tex/context/base/font-uni.tex
index 269c0f771..baca33983 100644
--- a/tex/context/base/font-uni.tex
+++ b/tex/context/base/font-uni.tex
@@ -488,8 +488,8 @@
\def\unicodedepth {\getvalue{\??uc#1\c!diepte}}%
\def\unicodedigits {\getvalue{\??uc#1\c!conversie}}%
\def\handleunicodeglyph {\getvalue{\??uc#1\c!commando}}%
- \enableregime[unicode]%
- \doifvalue{\??uc#1\c!interlinie}\v!ja{\stelinterliniein\relax}%
+ \enableregime[unicode]% the following \relax's are realy needed
+ \doifvalue{\??uc#1\c!interlinie}\v!ja\setupinterlinespace\relax
\getvalue{\??uc#1\c!commandos}\relax}
%D \macros
diff --git a/tex/context/base/hand-def.tex b/tex/context/base/hand-def.tex
index 581dc3065..5c6593e0e 100644
--- a/tex/context/base/hand-def.tex
+++ b/tex/context/base/hand-def.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=hand-def, % was enco-pro
-%D version=2000.29.9,
+%D version=2000.29.09,
%D title=\CONTEXT\ Handling Macros,
%D subtitle=Default Protruding Factors,
%D author=Hans Hagen,
diff --git a/tex/context/base/meta-dum.tex b/tex/context/base/meta-dum.tex
index 5e77e8229..644a809b0 100644
--- a/tex/context/base/meta-dum.tex
+++ b/tex/context/base/meta-dum.tex
@@ -70,7 +70,9 @@
[placeholder]
[1=red,2=green,3=blue,4=cyan,5=magenta,6=yellow]
-\newcounter\figurereplacementcycle
+% \newcounter \figurereplacementcycle
+
+\let\figurereplacementcycle\relax
\setupexternalfigures
[\c!reductie=0,
@@ -78,7 +80,12 @@
\def\externalfigurereplacement#1#2#3%
{\getpaletsize[placeholder]%
- \doglobal\increment\figurereplacementcycle
+ \ifx\figurereplacementcycle\relax
+ \getrandomnumber \figurereplacementcycle \!!plusone \paletsize
+ \globallet \figurereplacementcycle \figurereplacementcycle
+ \else
+ \doglobal\increment\figurereplacementcycle
+ \fi
\ifnum\figurereplacementcycle>\paletsize
\globallet\figurereplacementcycle\!!plusone
\fi
@@ -100,7 +107,7 @@
\c!achtergrond=\s!dummy,
\c!voorgrondkleur=white]}%
{\doif\@@eftekst\v!ja
- {\infofont\stelinterliniein \nohyphens
+ {\infofont \setupinterlinespace \nohyphens
\doifelse{#1}\s!dummy \!!doneafalse\!!doneatrue
\doifelse{#2}\s!dummy \!!donebfalse\!!donebtrue
\doifelse{#3}\s!unknown\!!donecfalse\!!donectrue
diff --git a/tex/context/base/meta-ini.tex b/tex/context/base/meta-ini.tex
index 8b6e71042..ee0354d52 100644
--- a/tex/context/base/meta-ini.tex
+++ b/tex/context/base/meta-ini.tex
@@ -795,6 +795,25 @@
\consultutilityfilefalse
\to \everyinsertMPfile
+%D One more: (still needed?)
+
+\appendtoks
+ def initialize_form_numbers =
+ do_initialize_numbers ;
+ enddef ;
+\to \MPinitializations
+
+\appendtoks
+ HSize := \the\hsize ;
+ VSize := \the\vsize ;
+ vardef ForegroundBox =
+ unitsquare xysized(HSize,VSize)
+ enddef ;
+ vardef PageFraction =
+ if \lastpage>1 : (\realfolio-1)/(\lastpage-1) else : 1 fi
+ enddef ;
+\to \MPinitializations
+
%D And some more. These are not really needed since we
%D don't use the normal figure inclusion macros any longer.
diff --git a/tex/context/base/meta-nav.tex b/tex/context/base/meta-nav.tex
index 5628e6f7b..41067a998 100644
--- a/tex/context/base/meta-nav.tex
+++ b/tex/context/base/meta-nav.tex
@@ -11,8 +11,6 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\unprotect
-
\startuniqueMPgraphic{navplus}{size,color,type,mode}
color c ; numeric s, t ; path p ;
t := \MPvar{type} ; c := \MPvar{color} ; s := \MPvar{size} ;
@@ -59,6 +57,8 @@
[attach-down]
[\uniqueMPgraphic{navplus}{type=2,color=navplus:attach,mode=1}]
+\unprotect
+
\setupcomment [\c!symbool={comment-normal,comment-down}]
\setupattachments[\c!symbool={attach-normal,attach-down}]
diff --git a/tex/context/base/meta-txt.tex b/tex/context/base/meta-txt.tex
index 85d12d68e..58ebb399c 100644
--- a/tex/context/base/meta-txt.tex
+++ b/tex/context/base/meta-txt.tex
@@ -48,7 +48,7 @@
\expanded{\switchtobodyfont[\@@shkorps]}%
\dontcomplain
\hsize\parwidth
- \steltolerantiein[\v!zeersoepel,\v!rek]%
+ \setuptolerance[\v!zeersoepel,\v!rek]%
\!!counta=0
\!!toksa=\emptytoks
\def\docommando##1%
diff --git a/tex/context/base/mult-com.tex b/tex/context/base/mult-com.tex
index 217e62763..09f437e42 100644
--- a/tex/context/base/mult-com.tex
+++ b/tex/context/base/mult-com.tex
@@ -518,7 +518,7 @@ atrightmargin: oprechtermarge atrightmargin
blanko: blanko blank
blanko preskoc
rigovuoto blanc
- stelblankoin: stelblankoin setupblank
+ setupblank: stelblankoin setupblank
stelleblankoein nastavpreskok
impostarigovuoto seteazablanc
corrigeerwitruimte: corrigeerwitruimte correctwhitespace
@@ -572,7 +572,7 @@ atrightmargin: oprechtermarge atrightmargin
inspringen: inspringen indenting
einziehen odsazovani
rientro aliniat
- stelinspringenin: stelinspringenin setupindenting
+ setupindenting: stelinspringenin setupindenting
stelleeinziehenein nastavodsazovani
impostarientro seteazaaliniat
startuitlijnen: startuitlijnen startalignment
@@ -626,7 +626,7 @@ emptylines: legeregels emptylines
stopsmaller: stopsmaller stopnarrower
stopenger stopzuzeni
terminapiustretto stopingust
- stelsmallerin: stelsmallerin setupnarrower
+ setupnarrower: stelsmallerin setupnarrower
stelleengerein nastavzuzeni
impostapiustretto seteazaingust
definetabulate: definieertabulatie definetabulate
@@ -928,10 +928,10 @@ setuppaper: stelpapierin setuppaper
setupbackgrounds: stelachtergrondenin setupbackgrounds
stellehintergruendeein nastavpozadi
impostasfondi seteazafundaluri
- steluitlijnenin: steluitlijnenin setupalign
+ setupalign: steluitlijnenin setupalign
stelleausrichtungein nastavzarovnani
impostaallineamento seteazaalinierea
- stelwitruimtein: stelwitruimtein setupwhitespace
+ setupwhitespace: stelwitruimtein setupwhitespace
stellezwischenraumein nastavbilamista
impostaspaziobianco seteazaspatiualb
setupinteraction: stelinteractiein setupinteraction
@@ -1167,10 +1167,10 @@ defineplacement: definieerplaats defineplacement
stopcombination: stopcombinatie stopcombination
stopkombination stopspojeni
terminacombinazione stopcombinare
- plaatsnaastelkaar: plaatsnaastelkaar placesidebyside
+ placesidebyside: plaatsnaastelkaar placesidebyside
platzierenebeneinander umistivedlesebe
mettifiancoafianco punefatainfata
- plaatsonderelkaar: plaatsonderelkaar placeontopofeachother
+ placeontopofeachother: plaatsonderelkaar placeontopofeachother
platziereuntereinander umistinadsebe
mettiunosullaltro punedeasuprafiecareia
stelblokkopjein: stelblokkopjein setupcaption
@@ -1668,13 +1668,13 @@ moveformula: verplaatsformule moveformula
stelkoppeltekenin: stelkoppeltekenin setuphyphenmark
stellebindestrichein nastavdelitko
impostasegnosillabazione seteazaliniesilabe % GB
- stelinterliniein: stelinterliniein setupinterlinespace
+ setupinterlinespace: stelinterliniein setupinterlinespace
stellezeilenabstandein nastavmeziradkovoumezeru
impostainterlinea seteazaspatiuinterliniar
- stelspatieringin: stelspatieringin setupspacing
+ setupspacing: stelspatieringin setupspacing
stellespatiumein nastavradkovani
impostaspaziatura seteazaspatiu
- steltolerantiein: steltolerantiein setuptolerance
+ setuptolerance: steltolerantiein setuptolerance
stelletoleranzein nastavtoleranci
impostatolleranza seteazatoleranta
setupsystem: stelsysteemin setupsystem
diff --git a/tex/context/base/mult-ini.tex b/tex/context/base/mult-ini.tex
index d6f6d4c5b..9902b6b55 100644
--- a/tex/context/base/mult-ini.tex
+++ b/tex/context/base/mult-ini.tex
@@ -1379,20 +1379,38 @@
\newif\ifinterfacetranslation
+% for a long time:
+%
+% \def\getinterfaceconstant#1%
+% {\ifinterfacetranslation
+% \doifdefinedelse{\x!prefix!#1}
+% {\getvalue{\x!prefix!#1}}
+% {#1}%
+% \else
+% #1%
+% \fi}
+%
+% \def\getinterfacevariable#1%
+% {\ifinterfacetranslation
+% \doifdefinedelse{\y!prefix!#1}
+% {\getvalue{\y!prefix!#1}}
+% {#1}%
+% \else
+% #1%
+% \fi}
+%
+% more compact
+
\def\getinterfaceconstant#1%
{\ifinterfacetranslation
- \doifdefinedelse{\x!prefix!#1}
- {\getvalue{\x!prefix!#1}}
- {#1}%
+ \executeifdefined{\x!prefix!#1}{#1}%
\else
#1%
\fi}
\def\getinterfacevariable#1%
{\ifinterfacetranslation
- \doifdefinedelse{\y!prefix!#1}
- {\getvalue{\y!prefix!#1}}
- {#1}%
+ \executeifdefined{\y!prefix!#1}{#1}%
\else
#1%
\fi}
diff --git a/tex/context/base/page-flt.tex b/tex/context/base/page-flt.tex
index ba581cdf7..2dad35404 100644
--- a/tex/context/base/page-flt.tex
+++ b/tex/context/base/page-flt.tex
@@ -981,7 +981,7 @@
\setbox\floattext\vbox to \floattextheight}
{\setbox\floattext\vbox}%
\bgroup
- \forgetall\stelblankoin\stelwitruimtein % new, also needed for footnotes
+ \forgetall \setupblank \setupwhitespace % new, also needed for footnotes
\blanko[\v!blokkeer]
\hsize\floattextwidth
\ignorespaces}
@@ -1918,7 +1918,7 @@
\unvbox\marginbox
\@@mbtussen
\fi
- \steluitlijnenin[\@@mbuitlijnen]%
+ \setupalign[\@@mbuitlijnen]%
\dostartattributes\??mb\c!letter\c!kleur{}%
\begstrut\ignorespaces}
diff --git a/tex/context/base/page-ini.tex b/tex/context/base/page-ini.tex
index c71f85cb2..e7cded9e8 100644
--- a/tex/context/base/page-ini.tex
+++ b/tex/context/base/page-ini.tex
@@ -868,12 +868,26 @@
\def\superejectpage{\doejectpage\supereject}
% floats
+%
+% \def\ejectinsert
+% {\flushnotes
+% \bgroup
+% \noftopfloats\plusthousand
+% \nofbotfloats\zerocount
+% \doflushfloats
+% \egroup}
\def\ejectinsert
{\flushnotes
\bgroup
\noftopfloats\plusthousand
\nofbotfloats\zerocount
+ % this is needed in case a float that has been stored
+ % ends up at the current page; this border case occurs when
+ % the calculated room is 'eps' smaller that the room available
+ % when just flushing; so now we have (maybe optional):
+ \pagebaselinecorrection
+ % alas, this is tricky but needed (first surfaced in prikkels)
\doflushfloats
\egroup}
@@ -1049,7 +1063,7 @@
\gdef\totaltestinfo
{\global\setbox#1\vbox
{\unvbox#1\relax
- \infofont \stelinterliniein
+ \infofont \setupinterlinespace
\hbox
{\strut
\expandafter\doboundtext\expandafter
@@ -1582,6 +1596,26 @@
\od
\filluparrangedpages}
+% nb: \executepagebreakhandler\v!hoofd in other ones
+
+\installpagebreakhandler \v!hoofd
+ {\doifnotvalue{\??tk\v!hoofd\c!status}\v!stop
+ {\setupheader[\c!status=\v!leeg]}}
+
+\installpagebreakhandler \v!voet
+ {\doifnotvalue{\??tk\v!voet\c!status}\v!stop
+ {\setupfooter[\c!status=\v!leeg]}}
+
+% \definepagebreak
+% [chapter]
+% [yes,header,right]
+%
+% \setuphead
+% [chapter]
+% [page=chapter,
+% header=empty,
+% footer=chapter]
+
% public page handler, beware: definepage already in use (core-ref)
%
% \definepagebreak[instance][forsure]
@@ -1640,6 +1674,27 @@
%let\nextcolumn\columnbreak
\let\column \columnbreak
+% We don't want spurious last pages (due to left over marks):
+
+\def\doignorerestoftext
+ {\ifarrangingpages \else
+ \ifnum\textlevel>\zerocount \else
+ \gdef\shipout
+ {\writestatus\m!systems{ignoring further shipouts}%
+ \dowithnextbox{\deadcycles\zerocount}}%
+ \fi
+ \fi}
+
+\let\ignorerestoftext\donothing
+
+\prependtoks % only ignore in a symmetrical doc
+ \globallet\ignorerestoftext\doignorerestoftext
+\to \everystarttext
+
+\appendtoks
+ \ignorerestoftext
+\to \everylastshipout
+
\newif\ifgeselecteerd \geselecteerdtrue
\newif\ifselecteren \selecterenfalse
\newif\ifverwerken \verwerkentrue
diff --git a/tex/context/base/page-lay.tex b/tex/context/base/page-lay.tex
index ff12825e6..c05dab034 100644
--- a/tex/context/base/page-lay.tex
+++ b/tex/context/base/page-lay.tex
@@ -460,8 +460,8 @@
\widowpenalty\defaultwidowpenalty
\clubpenalty \defaultclubpenalty
\fi
- \simplestelwitruimtein
- \simplestelblankoin
+ \simplesetupwhitespace
+ \simplesetupblank
\global\snijwit\layoutparameter\c!snijwit
\relax
\doifelse{\layoutparameter\c!breedte}\v!midden
diff --git a/tex/context/base/page-lin.tex b/tex/context/base/page-lin.tex
index 8038e45b9..31dcdfff1 100644
--- a/tex/context/base/page-lin.tex
+++ b/tex/context/base/page-lin.tex
@@ -43,7 +43,7 @@
\v!even=>\def\@@rgstepno {\parindent\zeropoint }%
\def\@@rgstepyes{\parindent\@@rgparindent}]%
\inregelstrue
- \stelwitruimtein[\v!geen]%
+ \setupwhitespace[\v!geen]%
\obeylines
\let\checkindentation\relax
\@@rgstepno
diff --git a/tex/context/base/page-mak.tex b/tex/context/base/page-mak.tex
index c44ddc59d..4461e021a 100644
--- a/tex/context/base/page-mak.tex
+++ b/tex/context/base/page-mak.tex
@@ -131,7 +131,7 @@
\forgetall
\hsize\makeupparameter\c!breedte
\doifsomething{\makeupparameter\c!uitlijnen}
- {\expanded{\steluitlijnenin[\makeupparameter\c!uitlijnen]}}%
+ {\setupalign[\makeupparameter\c!uitlijnen]}%
\makeupparameter\c!boven}
\def\dodostopmakeup
diff --git a/tex/context/base/page-mul.tex b/tex/context/base/page-mul.tex
index e9ea246a7..4ee48d37d 100644
--- a/tex/context/base/page-mul.tex
+++ b/tex/context/base/page-mul.tex
@@ -1534,10 +1534,10 @@
%
\edef\fixedcolumnheight{\@@klhoogte}%
\edef\minbalancetoplines{\@@klnboven}%
- \steltolerantiein[\@@kltolerantie]% %% \startkolommen
- \stelblankoin[\@@klblanko]%
+ \setuptolerance[\@@kltolerantie]% %% \startkolommen
+ \setupblank[\@@klblanko]%
\ifdim\tussenwit>\zeropoint\relax
- \stelwitruimtein[\@@klblanko]%
+ \setupwhitespace[\@@klblanko]%
\fi
\def\stopkolommen
{\endmulticolumns
diff --git a/tex/context/base/page-not.tex b/tex/context/base/page-not.tex
index b8bd84e90..505b1a5c1 100644
--- a/tex/context/base/page-not.tex
+++ b/tex/context/base/page-not.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=page-not,
-%D version=2002.4.16,
+%D version=2002.04.16,
%D title=\CONTEXT\ Page Macros,
%D subtitle=Footnotes,
%D author=Hans Hagen,
diff --git a/tex/context/base/regi-ibm.tex b/tex/context/base/regi-ibm.tex
index 8f066198b..aebd4951a 100644
--- a/tex/context/base/regi-ibm.tex
+++ b/tex/context/base/regi-ibm.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=regi-ibm,
-%D version=1995.1.1,
+%D version=1995.01.01,
%D title=\CONTEXT\ Encoding Macros,
%D subtitle=The Good Old MSDOS IBM codepage,
%D author=Hans Hagen,
diff --git a/tex/context/base/regi-il1.tex b/tex/context/base/regi-il1.tex
index f02a6f397..7c1838fec 100644
--- a/tex/context/base/regi-il1.tex
+++ b/tex/context/base/regi-il1.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=regi-il1,
-%D version=200.5.7,
+%D version=2000.05.07,
%D title=\CONTEXT\ Encoding Macros,
%D subtitle=ISO Latin 1 keys,
%D author={Daniel Flipo, Hans Hagen, Denis Roegel},
@@ -70,7 +70,7 @@
\defineactivetoken 177 {\textpm}
\defineactivetoken 254 {\thorn}
-\defineactivetoken 222 {\THorn}
+\defineactivetoken 222 {\Thorn}
\defineactivetoken 223 {\ssharp}
diff --git a/tex/context/base/s-abr-03.tex b/tex/context/base/s-abr-03.tex
index 3dfe080d9..b746383f6 100644
--- a/tex/context/base/s-abr-03.tex
+++ b/tex/context/base/s-abr-03.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=s-abr-03,
-%D version=1998.8.10,
+%D version=1998.08.10,
%D title=\CONTEXT\ Style File,
%D subtitle=General Abbreviations 3,
%D author=Hans Hagen,
diff --git a/tex/context/base/s-dtk-01.tex b/tex/context/base/s-dtk-01.tex
index dc0e4032a..6f4a80c98 100644
--- a/tex/context/base/s-dtk-01.tex
+++ b/tex/context/base/s-dtk-01.tex
@@ -17,7 +17,7 @@
%D Temp hack.
-\def\doverbatimgoodbreak{}
+\let\doverbatimgoodbreak\donothing
%D Fonts.
@@ -98,8 +98,8 @@
%D Spacing.
-\stelwitruimtein [\v!halveregel]
-\stelblankoin [\v!halveregel]
+\setupwhitespace [\v!halveregel]
+\setupblank [\v!halveregel]
%D Itemize.
@@ -190,10 +190,10 @@
\setupheader[\c!status=\v!leeg]
\stelpaginanummerin[\c!nummer=\DTKPagina]
\bgroup
- \stelwitruimtein[\v!geen]
+ \setupwhitespace[\v!geen]
\bgroup
\switchtobodyfont[14.4pt,ss]
- \steluitlijnenin[\v!rechts]
+ \setupalign[\v!rechts]
\let\\=\par
\DTKTitel\par
\doifsomething{\DTKSubtitel}
@@ -213,20 +213,20 @@
\vskip12pt
\bgroup
\switchtobodyfont[9pt]
- \stelsmallerin[voor=,na=]
+ \setupnarrower[\c!voor=,\c!na=]
\startsmaller[.05\hsize]
- \stelwitruimtein[\v!halveregel]
+ \setupwhitespace[\v!halveregel]
\haalbuffer[abstract]
\stopsmaller
\egroup
\vskip20pt
\egroup}
-\def\startBijdrage%
+\def\startBijdrage
{\starttekst
\dosingleempty\dostartBijdrage}
-\def\stopBijdrage%
+\def\stopBijdrage
{\stoptekst}
%D Sectioning.
diff --git a/tex/context/base/s-map-01.tex b/tex/context/base/s-map-01.tex
index 4410a5f9d..f99a874e8 100644
--- a/tex/context/base/s-map-01.tex
+++ b/tex/context/base/s-map-01.tex
@@ -143,7 +143,7 @@
%D Waar nodig springen we in. We willen echter niet inspringen
%D na een witruimte, vandaar het trefwoord \type{volgende}.
-\stelinspringenin
+\setupindenting
[\v!volgende,9.5pt]
%D Hoewel niet strikt noodzakelijk, definities en dergelijke
@@ -263,10 +263,10 @@
{\witruimte
\snaptogrid\vbox\bgroup
\forgetall
- \steluitlijnenin[\v!rechts]
+ \setupalign[\v!rechts]
\parfillskip 0pt plus 1 fill
- \steltolerantiein[\v!zeersoepel]
- \stelinspringenin[\v!geen]
+ \setuptolerance[\v!zeersoepel]
+ \setupindenting[\v!geen]
{\ssbf#1}\par
\switchtobodyfont[8pt]
\ss\tf
@@ -421,11 +421,11 @@
\stelpaginanummerin[\c!nummer=\MapsPagina]
\setuplayout[\c!grid=\MapsGrid]
\ifgridsnapping % nog controleren
- \stelblankoin[\v!regel]
+ \setupblank[\v!regel]
\definieerblanko[mapsvoor][\v!halveregel]
\definieerblanko[mapstussen][\v!regel]
\else
- \stelblankoin[\v!halveregel]
+ \setupblank[\v!halveregel]
\definieerblanko[\v!middel][\v!halveregel]
\definieerblanko[mapsvoor][\v!halveregel]
\definieerblanko[mapstussen][\v!halveregel]
@@ -436,7 +436,7 @@
\bgroup
\topskip 0pt
\forgetall
- \ifMapsInKolommen \steluitlijnenin[\v!links] \fi
+ \ifMapsInKolommen \setupalign[\v!links] \fi
\noindent\tf\MapsAffiliatieA
\ifx\MapsCategorie\Bericht
~\strut
@@ -449,9 +449,9 @@
\forgetall
\kern 7.5pt
\ifMapsInKolommen
- \steluitlijnenin[\v!links]
+ \setupalign[\v!links]
\else
- \steluitlijnenin[\v!rechts]
+ \setupalign[\v!rechts]
\fi
{\bf\MapsTitel\par}
{\bfx\MapsSubtitel\par}
@@ -608,9 +608,9 @@
{\witruimte
\snaptogrid\vbox\bgroup
\forgetall
- \steluitlijnenin[\v!links]
+ \setupalign[\v!links]
\steltolerantiein[\v!zeersoepel]
- \stelinspringenin[\v!geen]
+ \setupindenting[\v!geen]
\switchtobodyfont[8pt]
\noindent{\ssbf#1}\par
\ss\tf
diff --git a/tex/context/base/s-mod-01.tex b/tex/context/base/s-mod-01.tex
index 800287ccc..bb901bf93 100644
--- a/tex/context/base/s-mod-01.tex
+++ b/tex/context/base/s-mod-01.tex
@@ -24,10 +24,10 @@
\mainlanguage
[en]
-\stelwitruimtein
+\setupwhitespace
[\v!groot]
-\steltolerantiein
+\setuptolerance
[\v!soepel]
\emergencystretch=5em
diff --git a/tex/context/base/s-mod-02.tex b/tex/context/base/s-mod-02.tex
index 0d7f707f6..c65bad451 100644
--- a/tex/context/base/s-mod-02.tex
+++ b/tex/context/base/s-mod-02.tex
@@ -18,6 +18,8 @@
\input s-mod-00.tex
+% todo: internationalize + setups
+
\stelkopin[paragraaf][expansie=commando]
\def\complexmodule[#1]% redefined
diff --git a/tex/context/base/s-pre-05.tex b/tex/context/base/s-pre-05.tex
index 88d69f6e2..f095ae091 100644
--- a/tex/context/base/s-pre-05.tex
+++ b/tex/context/base/s-pre-05.tex
@@ -123,7 +123,7 @@
\setuplayout[width=550pt,rightedge=0pt]
\startstandardmakeup
\switchtobodyfont[24pt]
- \bfd\stelinterliniein
+ \bfd\setupinterlinespace
\setupalign[middle]
\vfil
\let\\=\vfil}
diff --git a/tex/context/base/setupa.tex b/tex/context/base/setupa.tex
index 770a6404c..6df0fb376 100644
--- a/tex/context/base/setupa.tex
+++ b/tex/context/base/setupa.tex
@@ -564,7 +564,7 @@ sectionnumber: numero sezione
\advance\hsize by -\leftskip
\advance\hsize by -\rightskip
\getvalue{\e!start setuptext}
- \stelwitruimtein[\v!geen]%
+ \setupwhitespace[\v!geen]%
\bgroup
\verbatimsetupvariablepart \edef\first {#2*}%
\protectsetupvariablepart \edef\second{#2}%
diff --git a/tex/context/base/setupb.tex b/tex/context/base/setupb.tex
index 9881a5566..6af370078 100644
--- a/tex/context/base/setupb.tex
+++ b/tex/context/base/setupb.tex
@@ -3422,7 +3422,7 @@
\startsetup
\command
- [\y!stelinterliniein]
+ [\y!setupinterlinespace]
\type
[\c!opt!\c!or!\c!val!\c!vars!]
\value
@@ -3525,7 +3525,7 @@
\startsetup
\command
- [\y!stelsmallerin]
+ [\y!setupnarrower]
\type
[\c!vars!]
\variable
@@ -4710,7 +4710,7 @@
\startsetup
\command
- [\y!stelblankoin]
+ [\y!setupblank]
\type
[\c!opt!\c!val!]
\value
@@ -4729,7 +4729,7 @@
[\c!identifier!]
[]
\inheritvalues
- [\y!stelblankoin]
+ [\y!setupblank]
[]
\stopsetup
@@ -4880,7 +4880,7 @@
\startsetup
\command
- [\y!stelwitruimtein]
+ [\y!setupwhitespace]
\type
[\c!opt!\c!val!]
\value
@@ -4890,7 +4890,7 @@
\startsetup
\command
- [\y!stelinspringenin]
+ [\y!setupindenting]
\type
[\c!vals!]
\value
@@ -5954,7 +5954,7 @@
\startsetup
\command
- [\y!steluitlijnenin]
+ [\y!setupalign]
\type
[\c!val!]
\value
@@ -5970,13 +5970,13 @@
\type
[\c!stp!\c!opt!\c!val!]
\inheritvariables
- [\y!steluitlijnenin]
+ [\y!setupalign]
[]
\stopsetup
\startsetup
\command
- [\y!stelspatieringin]
+ [\y!setupspacing]
\type
[\c!val!]
\value
@@ -5986,7 +5986,7 @@
\startsetup
\command
- [\y!steltolerantiein]
+ [\y!setuptolerance]
\type
[\c!vals!]
\value
@@ -7518,7 +7518,7 @@
\startsetup
\command
- [\y!plaatsnaastelkaar]
+ [\y!placesidebyside]
\type
[\c!arg!\c!arg!]
\value
@@ -7531,7 +7531,7 @@
\startsetup
\command
- [\y!plaatsonderelkaar]
+ [\y!placeontopofeachother]
\type
[\c!arg!\c!arg!]
\value
@@ -8980,7 +8980,7 @@
[\c!font!]
[]
\inheritvariables
- [\y!stelinterliniein]
+ [\y!setupinterlinespace]
[]
\stopsetup
diff --git a/tex/context/base/spec-fdf.tex b/tex/context/base/spec-fdf.tex
index e530f3d1b..387f07b10 100644
--- a/tex/context/base/spec-fdf.tex
+++ b/tex/context/base/spec-fdf.tex
@@ -2240,8 +2240,8 @@
{\doifelsenothing{#1}
{\let\PDFattributes\empty}
{\def\PDFattributes{/C \FDFcolor{#1}}}%
- \def\width {18pt}%
- \def\height{24pt}%
+ \def\width {1.5\bodyfontsize}%
+ \def\height{\bodyfontsize}%
\doifelsenothing{#2}
{\let\PDFsymbol\empty}
{\ifundefined{PDFsymbol#2}%
diff --git a/tex/context/base/spec-mis.tex b/tex/context/base/spec-mis.tex
index 72f76a810..49c7d40dd 100644
--- a/tex/context/base/spec-mis.tex
+++ b/tex/context/base/spec-mis.tex
@@ -178,9 +178,14 @@
\fi
\egroup}
+% \long\def\preservePSpar#1\to#2%
+% {\bgroup
+% \def\par{\rawcharacter{12}}%
+% \expanded{\egroup\noexpand\def\noexpand#2{#1}}}
+
\long\def\preservePSpar#1\to#2%
{\bgroup
- \def\par{\rawcharacter{12}}%
+ \def\par{\rawcharacter{12}\rawcharacter{12}}%
\expanded{\egroup\noexpand\def\noexpand#2{#1}}}
%D \macros
diff --git a/tex/context/base/supp-ali.tex b/tex/context/base/supp-ali.tex
index 87a844e7f..f19497e1d 100644
--- a/tex/context/base/supp-ali.tex
+++ b/tex/context/base/supp-ali.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=supp-ali,
-%D version=2000.4.17,
+%D version=2000.04.17,
%D title=\CONTEXT\ Support Macros,
%D subtitle=Alignment,
%D author=Hans Hagen,
diff --git a/tex/context/base/supp-box.tex b/tex/context/base/supp-box.tex
index ce000ed40..ad8889d78 100644
--- a/tex/context/base/supp-box.tex
+++ b/tex/context/base/supp-box.tex
@@ -2238,6 +2238,24 @@
{\normalhbox{\setbox0\placedbox{#1}\boxoffset=-.5\wd0\rightbox{\box0}}}
%D \macros
+%D {toplinebox}
+%D
+%D See core-tbl.tex for an example of its usage:
+
+\def\toplinebox
+ {\dowithnextbox
+ {\ifdim\nextboxdp>\strutdepth
+ \scratchdimen\nextboxdp
+ \advance\scratchdimen-\strutdepth
+ \getnoflines\scratchdimen
+ \struttedbox{\flushnextbox}%
+ \dorecurse\noflines\verticalstrut
+ \else
+ \flushnextbox
+ \fi}%
+ \tbox}
+
+%D \macros
%D {initializeboxstack,savebox,foundbox}
%D
%D At the cost of some memory, but saving box registers, we
diff --git a/tex/context/base/supp-fun.tex b/tex/context/base/supp-fun.tex
index 547ad1365..4cbdf359f 100644
--- a/tex/context/base/supp-fun.tex
+++ b/tex/context/base/supp-fun.tex
@@ -741,7 +741,7 @@
{\bgroup
\forgetall
\dontcomplain
- \steltolerantiein[\v!zeersoepel]% == \tolerance4500
+ \setuptolerance[\v!zeersoepel]% == \tolerance4500
\hsize#1%
\def\\{\softbreak}%
\!!heighta#4%
@@ -789,7 +789,7 @@
#1%
{\def\+{\global\settrue\NFSpread\gobbleuntil\relax}%
\def\\{\gobbleuntil\relax}% newline
- \stelspatieringin
+ \setupspacing
#6\relax}%
{\scratchdimen}%
{#4}%
@@ -806,7 +806,7 @@
\def\GapText#1#2#3#4#5% width distance font spec title
{\bgroup
\NormalizeFontWidthSpread\DummyFont{#1}{#2}{#3}{#4}{#5}%
- \DummyFont\stelspatieringin\SpreadGapText{#2}{#5}\endgraf
+ \DummyFont\setupspacing\SpreadGapText{#2}{#5}\endgraf
\egroup}
\protect \endinput
diff --git a/tex/context/base/supp-lan.tex b/tex/context/base/supp-lan.tex
index a15b137ad..f05279c3a 100644
--- a/tex/context/base/supp-lan.tex
+++ b/tex/context/base/supp-lan.tex
@@ -547,9 +547,17 @@
\newsignal\compoundbreakpoint
- \def\fakecompoundhyphen%
- {\def|##1|%
- {\doifelsenothing{##1}{\compoundhyphen}{##1}%
+ % \def\fakecompoundhyphen%
+ % {\def|##1|%
+ % {\doifelsenothing{##1}{\compoundhyphen}{##1}%
+ % \kern\compoundbreakpoint\allowbreak}}
+
+ \def\fakecompoundhyphen
+ {\def\|{\mathortext\vert\dofakecompoundhyphen}}
+
+ \def\dofakecompoundhyphen
+ {\def##1|%
+ {\doifelsenothing{##1}\compoundhyphen{##1}%
\kern\compoundbreakpoint\allowbreak}}
\fi
diff --git a/tex/context/base/supp-ran.tex b/tex/context/base/supp-ran.tex
index 06875fca9..fc056813b 100644
--- a/tex/context/base/supp-ran.tex
+++ b/tex/context/base/supp-ran.tex
@@ -77,8 +77,7 @@
\def\nextrandom
{\bgroup
\normalnextrandom
- \gdef\nextrandom
- {\ifcase\randomseedfrozen\normalnextrandom\fi}%
+ \gdef\nextrandom{\ifcase\randomseedfrozen\normalnextrandom\fi}%
\egroup}
% avoid scratch dimens 0 and 2 (already recoded in third-ran
diff --git a/tex/context/base/syst-ext.tex b/tex/context/base/syst-ext.tex
index 1e34137e2..d5c3d53b3 100644
--- a/tex/context/base/syst-ext.tex
+++ b/tex/context/base/syst-ext.tex
@@ -218,6 +218,8 @@
%
% And this is the one optimized for speed:
+% maxcounter = 2\maxdimen=1
+
\def\!!zerocount {0} % alongside \zerocount
\def\!!minusone {-1} % alongside \minusone
\def\!!plusone {1} % alongside \plusone
@@ -4292,6 +4294,9 @@
\def\thelasttwodigits#1#2#3% 0 dig ... \relax
{\ifx#3\relax#1#2\else\@EA\thelasttwodigits\@EA#2\@EA#3\fi}
+%D \macros
+%D {serializecommalist}
+%D
%D Concatenate commalists:
\def\serializecommalist[#1]%
@@ -4299,6 +4304,9 @@
\def\docommando##1{\edef\serializedcommalist{\serializedcommalist##1}}%
\processcommacommand[#1]\docommando}
+%D \macros
+%D {purenumber}
+%D
%D Sometimes we need control over when \TEX\ stops reading a
%D number, especially in full expandable macros where using
%D \type {\relax} would lead to disasters.
@@ -4314,4 +4322,44 @@
\def\purenumber#1{\@EA\firstofoneargument\@EA{\number#1}}
+%D \macros
+%D {filterfromvalue}
+%D
+%D \starttypen
+%D \setvalue{xx}{{A}{B}{C}}
+%D
+%D \filterfromvalue{xx}{3}{3}
+%D \filterfromvalue{xx}{3}{2}
+%D \filterfromvalue{xx}{3}{1}
+%D \stoptypen
+
+\def\filterfromvalue#1#2#3% value max n
+ {\@EA\@EAEAEA\csname
+ \ifcase#2\or
+ \ifcase#3\or
+ \strippedcsname\firstofoneargument
+ \else
+ \strippedcsname\gobbleoneargument
+ \fi
+ \or
+ \ifcase#3\or
+ \strippedcsname\firstoftwoarguments
+ \or
+ \strippedcsname\secondoftwoarguments
+ \else
+ \strippedcsname\gobbletwoarguments
+ \fi
+ \or
+ \ifcase#3\or
+ \strippedcsname\firstofthreearguments
+ \or
+ \strippedcsname\secondofthreearguments
+ \or
+ \strippedcsname\thirdofthreearguments
+ \else
+ \strippedcsname\gobblethreearguments
+ \fi
+ \fi
+ \endcsname\csname#1\endcsname}
+
\protect \endinput
diff --git a/tex/context/base/syst-gen.tex b/tex/context/base/syst-gen.tex
index efe4ddf85..58ca5f964 100644
--- a/tex/context/base/syst-gen.tex
+++ b/tex/context/base/syst-gen.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=syst-gen,
-%D version=1996.3.20,
+%D version=1996.03.20,
%D title=\CONTEXT\ System Macros,
%D subtitle=General,
%D author=Hans Hagen,
@@ -1348,6 +1348,68 @@
%
% \endETEX
+% then we had:
+%
+% \def\p!docheckiteminset#1%
+% {\edef\!!stringb{#1}%
+% \ifx\!!stringa\!!stringb
+% \donetrue
+% \expandafter\quitcommalist
+% \fi}
+%
+% \beginTEX
+%
+% \def\p!doifinsetelse#1#2%
+% {\let\donottest\dontprocesstest
+% \donefalse
+% \edef\!!stringa{#1}%
+% \ifx\!!stringa\empty
+% \else
+% \processcommalist[#2]\p!docheckiteminset
+% \fi
+% \let\donottest\doprocesstest
+% \ifdone}
+%
+% \endTEX
+%
+% % can be sped up with processnext...
+%
+% \beginETEX \protected
+%
+% \def\p!doifinsetelse#1#2%
+% {\donefalse
+% \edef\!!stringa{#1}%
+% \ifx\!!stringa\empty
+% \else
+% \processcommalist[#2]\p!docheckiteminset
+% \fi
+% \ifdone}
+%
+% \endETEX
+%
+% \long\def\doifinsetelse#1#2%
+% {\p!doifinsetelse{#1}{#2}%
+% \expandafter\firstoftwoarguments
+% \else
+% \expandafter\secondoftwoarguments
+% \fi}
+%
+% \long\def\doifinset#1#2%
+% {\p!doifinsetelse{#1}{#2}%
+% \expandafter\firstofoneargument
+% \else
+% \expandafter\gobbleoneargument
+% \fi}
+%
+% \long\def\doifnotinset#1#2%
+% {\p!doifinsetelse{#1}{#2}%
+% \expandafter\gobbleoneargument
+% \else
+% \expandafter\firstofoneargument
+% \fi}
+%
+% now we have
+
\def\p!docheckiteminset#1%
{\edef\!!stringb{#1}%
\ifx\!!stringa\!!stringb
@@ -1357,54 +1419,40 @@
\beginTEX
-\def\p!doifinsetelse#1#2%
+\def\p!doifinsetelse#1#2#3#4%
{\let\donottest\dontprocesstest
\donefalse
- \edef\!!stringa{#1}%
+ \edef\!!stringa{#3}%
\ifx\!!stringa\empty
\else
- \processcommalist[#2]\p!docheckiteminset
+ \processcommalist[#4]\p!docheckiteminset
\fi
\let\donottest\doprocesstest
- \ifdone}
+ \ifdone\expandafter#1\else\expandafter#2\fi}
\endTEX
-% can be sped up with processnext...
-
\beginETEX \protected
-\def\p!doifinsetelse#1#2%
+\def\p!doifinsetelse#1#2#3#4%
{\donefalse
- \edef\!!stringa{#1}%
+ \edef\!!stringa{#3}%
\ifx\!!stringa\empty
\else
- \processcommalist[#2]\p!docheckiteminset
+ \processcommalist[#4]\p!docheckiteminset
\fi
- \ifdone}
+ \ifdone\expandafter#1\else\expandafter#2\fi}
\endETEX
-\long\def\doifinsetelse#1#2%
- {\p!doifinsetelse{#1}{#2}%
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
+\long\def\doifinsetelse
+ {\p!doifinsetelse\firstoftwoarguments\secondoftwoarguments}
-\long\def\doifinset#1#2%
- {\p!doifinsetelse{#1}{#2}%
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
+\long\def\doifinset
+ {\p!doifinsetelse\firstofoneargument\gobbleoneargument}
-\long\def\doifnotinset#1#2%
- {\p!doifinsetelse{#1}{#2}%
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
+\long\def\doifnotinset
+ {\p!doifinsetelse\gobbleoneargument\firstofoneargument}
%D \macros
%D {doifcommon,doifnotcommon,doifcommonelse}
@@ -1493,6 +1541,62 @@
%
% \endETEX
+% \def\p!dodocommoncheck#1%
+% {\edef\!!stringb{#1}%
+% \ifx\!!stringa\!!stringb
+% \donetrue
+% \expandafter\quitprevcommalist
+% \fi}
+%
+% \beginTEX
+%
+% \def\p!doifcommonelse#1#2%
+% {\donefalse
+% \let\donottest\dontprocesstest
+% \def\p!docommoncheck##1%
+% {\edef\!!stringa{##1}%
+% \def\commalistelement{##1}% no let to stringa
+% \processcommalist[#2]\p!dodocommoncheck}%
+% \processcommalist[#1]\p!docommoncheck
+% \let\donottest\doprocesstest
+% \ifdone}
+%
+% \endTEX
+%
+% \beginETEX \protected
+%
+% \def\p!doifcommonelse#1#2%
+% {\donefalse
+% \def\p!docommoncheck##1%
+% {\edef\!!stringa{##1}%
+% \def\commalistelement{##1}%
+% \processcommalist[#2]\p!dodocommoncheck}%
+% \processcommalist[#1]\p!docommoncheck
+% \ifdone}
+%
+% \endETEX
+%
+% \long\def\doifcommonelse#1#2% % #3#4%
+% {\p!doifcommonelse{#1}{#2}% % #3\else#4\fi}
+% \expandafter\firstoftwoarguments
+% \else
+% \expandafter\secondoftwoarguments
+% \fi}
+%
+% \long\def\doifcommon#1#2%
+% {\p!doifcommonelse{#1}{#2}%
+% \expandafter\firstofoneargument
+% \else
+% \expandafter\gobbleoneargument
+% \fi}
+%
+% \long\def\doifnotcommon#1#2%
+% {\p!doifcommonelse{#1}{#2}%
+% \expandafter\gobbleoneargument
+% \else
+% \expandafter\firstofoneargument
+% \fi}
+
\def\p!dodocommoncheck#1%
{\edef\!!stringb{#1}%
\ifx\!!stringa\!!stringb
@@ -1502,52 +1606,40 @@
\beginTEX
-\def\p!doifcommonelse#1#2%
+\def\p!doifcommonelse#1#2#3#4%
{\donefalse
\let\donottest\dontprocesstest
\def\p!docommoncheck##1%
{\edef\!!stringa{##1}%
\def\commalistelement{##1}% no let to stringa
- \processcommalist[#2]\p!dodocommoncheck}%
- \processcommalist[#1]\p!docommoncheck
+ \processcommalist[#4]\p!dodocommoncheck}%
+ \processcommalist[#3]\p!docommoncheck
\let\donottest\doprocesstest
- \ifdone}
+ \ifdone\expandafter#1\else\expandafter#2\fi}
\endTEX
\beginETEX \protected
-\def\p!doifcommonelse#1#2%
+\def\p!doifcommonelse#1#2#3#4%
{\donefalse
\def\p!docommoncheck##1%
{\edef\!!stringa{##1}%
\def\commalistelement{##1}%
- \processcommalist[#2]\p!dodocommoncheck}%
- \processcommalist[#1]\p!docommoncheck
- \ifdone}
+ \processcommalist[#4]\p!dodocommoncheck}%
+ \processcommalist[#3]\p!docommoncheck
+ \ifdone\expandafter#1\else\expandafter#2\fi}
\endETEX
-\long\def\doifcommonelse#1#2% % #3#4%
- {\p!doifcommonelse{#1}{#2}% % #3\else#4\fi}
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
+\def\doifcommonelse
+ {\p!doifcommonelse\firstoftwoarguments\secondoftwoarguments}
-\long\def\doifcommon#1#2%
- {\p!doifcommonelse{#1}{#2}%
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
+\def\doifcommon
+ {\p!doifcommonelse\firstofoneargument \gobbleoneargument}
-\long\def\doifnotcommon#1#2%
- {\p!doifcommonelse{#1}{#2}%
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
+\def\doifnotcommon
+ {\p!doifcommonelse\gobbleoneargument \firstofoneargument}
%D \macros
%D {processcommalist,processcommacommand,quitcommalist,
@@ -2010,7 +2102,7 @@
\fi
\fi}
-\def\doprocessallactionsinset%
+\def\doprocessallactionsinset
{\csname\s!do\the\processlevel\endcsname}
\def\processallactionsinset[#1]#2[#3]% faster version follows
@@ -2132,10 +2224,7 @@
%D By default we expand actions:
-\def\expandactions%
- {\let\expandedaction\edef}
-
-\expandactions
+\def\expandactions{\let\expandedaction\edef} \expandactions
%D But when needed we convert the strings to meaningful
%D sequences of characters.
diff --git a/tex/context/base/thrd-ran.tex b/tex/context/base/thrd-ran.tex
index ea19c7a20..057e51127 100644
--- a/tex/context/base/thrd-ran.tex
+++ b/tex/context/base/thrd-ran.tex
@@ -134,7 +134,7 @@
\global\advance\randomi-\!!countd % random mod 127773
\global\multiply\randomi 16807
\multiply\!!countc 2836
- \global\advance\randomi-\!!countc
+ \global\advance\randomi-\!!countc\relax
\ifnum\randomi<\zerocount
\global\advance\randomi 2147483647
\fi
diff --git a/tex/context/base/type-akb.tex b/tex/context/base/type-akb.tex
new file mode 100644
index 000000000..937e67ac0
--- /dev/null
+++ b/tex/context/base/type-akb.tex
@@ -0,0 +1,202 @@
+%D \module
+%D [ file=type-akb,
+%D version=2001.07.08,
+%D title=\CONTEXT\ Typescript Macros,
+%D subtitle=Adobe's Famous Gang of Fonts,
+%D author=Patrick Gundlach,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D Last Change: Tue Mar 18 16:01:03 2003
+
+%D This module is written by Patrick Gundlach (patrick@gundla.ch)
+%D and maps to the standard postscript fonts conforming the
+%D psnfss system as used by \LaTeX.
+%D
+%D \starttypen
+%D \setupencoding[default=texnansi]
+%D \usetypescript[adobekb][\defaultencoding]
+%D \stoptypen
+%D
+%D The following is not needed since the file is already
+%D registered:
+%D
+%D \starttypen
+%D \usetypescriptfile[akb]
+%D \stoptypen
+
+\starttypescript [adobekb] [8r]
+
+\definefontsynonym [8r-utmr8a] [ptmr8r] [encoding=8r]
+\definefontsynonym [8r-utmri8a] [ptmri8r] [encoding=8r]
+\definefontsynonym [8r-utmb8a] [ptmb8r] [encoding=8r]
+\definefontsynonym [8r-utmbi8a] [ptmbi8r] [encoding=8r]
+
+\definefontsynonym [8r-utmr8a-slanted-167] [ptmro8r] [encoding=8r]
+\definefontsynonym [8r-utmb8a-slanted-167] [ptmbo8r] [encoding=8r]
+
+\definefontsynonym [8r-uhvr8a] [phvr8r] [encoding=8r]
+\definefontsynonym [8r-uhvro8a] [phvro8r] [encoding=8r]
+\definefontsynonym [8r-uhvb8a] [phvb8r] [encoding=8r]
+\definefontsynonym [8r-uhvbo8a] [phvbo8r] [encoding=8r]
+
+\definefontsynonym [8r-ucrr8a] [pcrr8r] [encoding=8r]
+\definefontsynonym [8r-ucrb8a] [pcrb8r] [encoding=8r]
+\definefontsynonym [8r-ucrro8a] [pcrro8r] [encoding=8r]
+\definefontsynonym [8r-ucrbo8a] [pcrbo8r] [encoding=8r]
+
+\definefontsynonym [8r-uplr8a] [pplr8r] [encoding=8r]
+\definefontsynonym [8r-uplri8a] [pplri8r] [encoding=8r]
+\definefontsynonym [8r-uplb8a] [pplb8r] [encoding=8r]
+\definefontsynonym [8r-uplbi8a] [pplbi8r] [encoding=8r]
+\definefontsynonym [8r-uplr8a-slanted-167] [pplro8r] [encoding=8r]
+\definefontsynonym [8r-uplb8a-slanted-167] [pplbo8r] [encoding=8r]
+\definefontsynonym [8r-uplr8a-capitalized-800] [pplr8r] [encoding=8r]
+
+\definefontsynonym [8r-ubkl8a] [pbkl8r] [encoding=8r]
+\definefontsynonym [8r-ubkli8a] [pbkli8r] [encoding=8r]
+\definefontsynonym [8r-ubkd8a] [pbkd8r] [encoding=8r]
+\definefontsynonym [8r-ubkdi8a] [pbkdi8r] [encoding=8r]
+\definefontsynonym [8r-ubkl8a-slanted-167] [pbklo8r] [encoding=8r]
+\definefontsynonym [8r-ubkd8a-slanted-167] [pbkdo8r] [encoding=8r]
+\definefontsynonym [8r-ubkl8a-capitalized-800] [pbkl8r] [encoding=8r]
+
+\definefontsynonym [8r-uzcmi8a] [pzcmi8r] [encoding=8r]
+
+\definefontsynonym [8r-putr8a] [putr8r] [encoding=8r]
+\definefontsynonym [8r-putri8a] [putri8r] [encoding=8r]
+\definefontsynonym [8r-putb8a] [putr8r] [encoding=8r]
+\definefontsynonym [8r-putbi8a] [putbi8r] [encoding=8r]
+\definefontsynonym [8r-putr8a-slanted-167] [putro8r] [encoding=8r]
+\definefontsynonym [8r-putb8a-slanted-167] [putbo8r] [encoding=8r]
+\definefontsynonym [8r-putr8a-capitalized-800] [putr8r] [encoding=8r]
+
+\definefontsynonym [8r-bchr8a] [bchr8r] [encoding=8r]
+\definefontsynonym [8r-bchri8a] [bchri8r] [encoding=8r]
+\definefontsynonym [8r-bchb8a] [bchb8r] [encoding=8r]
+\definefontsynonym [8r-bchbi8a] [bchbi8r] [encoding=8r]
+\definefontsynonym [8r-bchr8a-slanted-167] [bchro8r] [encoding=8r]
+\definefontsynonym [8r-bchb8a-slanted-167] [bchbo8r] [encoding=8r]
+\definefontsynonym [8r-bchr8a-capitalized-800] [bchr8r] [encoding=8r]
+
+\stoptypescript
+
+\starttypescript [adobekb] [ec]
+
+\definefontsynonym [ec-utmr8a] [ptmr8t] [encoding=ec]
+\definefontsynonym [ec-utmri8a] [ptmri8t] [encoding=ec]
+\definefontsynonym [ec-utmb8a] [ptmb8t] [encoding=ec]
+\definefontsynonym [ec-utmbi8a] [ptmbi8t] [encoding=ec]
+
+\definefontsynonym [ec-utmr8a-slanted-167] [ptmro8t] [encoding=ec]
+\definefontsynonym [ec-utmb8a-slanted-167] [ptmbo8t] [encoding=ec]
+
+\definefontsynonym [ec-uhvr8a] [phvr8t] [encoding=ec]
+\definefontsynonym [ec-uhvro8a] [phvro8t] [encoding=ec]
+\definefontsynonym [ec-uhvb8a] [phvb8t] [encoding=ec]
+\definefontsynonym [ec-uhvbo8a] [phvbo8t] [encoding=ec]
+
+\definefontsynonym [ec-ucrr8a] [pcrr8t] [encoding=ec]
+\definefontsynonym [ec-ucrb8a] [pcrb8t] [encoding=ec]
+\definefontsynonym [ec-ucrro8a] [pcrro8t] [encoding=ec]
+\definefontsynonym [ec-ucrbo8a] [pcrbo8t] [encoding=ec]
+
+\definefontsynonym [ec-uplr8a] [pplr8t] [encoding=ec]
+\definefontsynonym [ec-uplri8a] [pplri8t] [encoding=ec]
+\definefontsynonym [ec-uplb8a] [pplb8t] [encoding=ec]
+\definefontsynonym [ec-uplbi8a] [pplbi8t] [encoding=ec]
+\definefontsynonym [ec-uplr8a-slanted-167] [pplro8t] [encoding=ec]
+\definefontsynonym [ec-uplb8a-slanted-167] [pplbo8t] [encoding=ec]
+\definefontsynonym [ec-uplr8a-capitalized-800] [pplr8t] [encoding=ec]
+
+\definefontsynonym [ec-ubkl8a] [pbkl8t] [encoding=ec]
+\definefontsynonym [ec-ubkli8a] [pbkli8t] [encoding=ec]
+\definefontsynonym [ec-ubkd8a] [pbkd8t] [encoding=ec]
+\definefontsynonym [ec-ubkdi8a] [pbkdi8t] [encoding=ec]
+\definefontsynonym [ec-ubkl8a-slanted-167] [pbklo8t] [encoding=ec]
+\definefontsynonym [ec-ubkd8a-slanted-167] [pbkdo8t] [encoding=ec]
+\definefontsynonym [ec-ubkl8a-capitalized-800] [pbkl8t] [encoding=ec]
+
+\definefontsynonym [ec-uzcmi8a] [pzcmi8t] [encoding=ec]
+
+\definefontsynonym [ec-putr8a] [putr8t] [encoding=ec]
+\definefontsynonym [ec-putri8a] [putri8t] [encoding=ec]
+\definefontsynonym [ec-putb8a] [putr8t] [encoding=ec]
+\definefontsynonym [ec-putbi8a] [putbi8t] [encoding=ec]
+\definefontsynonym [ec-putr8a-slanted-167] [putro8t] [encoding=ec]
+\definefontsynonym [ec-putb8a-slanted-167] [putbo8t] [encoding=ec]
+\definefontsynonym [ec-putr8a-capitalized-800] [putr8t] [encoding=ec]
+
+\definefontsynonym [ec-bchr8a] [bchr8t] [encoding=ec]
+\definefontsynonym [ec-bchri8a] [bchri8t] [encoding=ec]
+\definefontsynonym [ec-bchb8a] [bchb8t] [encoding=ec]
+\definefontsynonym [ec-bchbi8a] [bchbi8t] [encoding=ec]
+\definefontsynonym [ec-bchr8a-slanted-167] [bchro8t] [encoding=ec]
+\definefontsynonym [ec-bchb8a-slanted-167] [bchbo8t] [encoding=ec]
+\definefontsynonym [ec-bchr8a-capitalized-800] [bchr8t] [encoding=ec]
+
+\stoptypescript
+
+% the following fonts are normally not present on tex live
+
+\starttypescript [adobekb] [texnansi]
+
+\definefontsynonym [texnansi-utmr8a] [ptmr8y] [encoding=texnansi]
+\definefontsynonym [texnansi-utmri8a] [ptmri8y] [encoding=texnansi]
+\definefontsynonym [texnansi-utmb8a] [ptmb8y] [encoding=texnansi]
+\definefontsynonym [texnansi-utmbi8a] [ptmbi8y] [encoding=texnansi]
+
+\definefontsynonym [texnansi-utmr8a-slanted-167] [ptmro8y] [encoding=texnansi]
+\definefontsynonym [texnansi-utmb8a-slanted-167] [ptmbo8y] [encoding=texnansi]
+
+\definefontsynonym [texnansi-uhvr8a] [phvr8y] [encoding=texnansi]
+\definefontsynonym [texnansi-uhvro8a] [phvro8y] [encoding=texnansi]
+\definefontsynonym [texnansi-uhvb8a] [phvb8y] [encoding=texnansi]
+\definefontsynonym [texnansi-uhvbo8a] [phvbo8y] [encoding=texnansi]
+
+\definefontsynonym [texnansi-ucrr8a] [pcrr8y] [encoding=texnansi]
+\definefontsynonym [texnansi-ucrb8a] [pcrb8y] [encoding=texnansi]
+\definefontsynonym [texnansi-ucrro8a] [pcrro8y] [encoding=texnansi]
+\definefontsynonym [texnansi-ucrbo8a] [pcrbo8y] [encoding=texnansi]
+
+\definefontsynonym [texnansi-uplr8a] [pplr8y] [encoding=texnansi]
+\definefontsynonym [texnansi-uplri8a] [pplri8y] [encoding=texnansi]
+\definefontsynonym [texnansi-uplb8a] [pplb8y] [encoding=texnansi]
+\definefontsynonym [texnansi-uplbi8a] [pplbi8y] [encoding=texnansi]
+\definefontsynonym [texnansi-uplr8a-slanted-167] [pplro8y] [encoding=texnansi]
+\definefontsynonym [texnansi-uplb8a-slanted-167] [pplbo8y] [encoding=texnansi]
+\definefontsynonym [texnansi-uplr8a-capitalized-800] [pplr8y] [encoding=texnansi]
+
+\definefontsynonym [texnansi-ubkl8a] [pbkl8y] [encoding=texnansi]
+\definefontsynonym [texnansi-ubkli8a] [pbkli8y] [encoding=texnansi]
+\definefontsynonym [texnansi-ubkd8a] [pbkd8y] [encoding=texnansi]
+\definefontsynonym [texnansi-ubkdi8a] [pbkdi8y] [encoding=texnansi]
+\definefontsynonym [texnansi-ubkl8a-slanted-167] [pbklo8y] [encoding=texnansi]
+\definefontsynonym [texnansi-ubkd8a-slanted-167] [pbkdo8y] [encoding=texnansi]
+\definefontsynonym [texnansi-ubkl8a-capitalized-800] [pbkl8y] [encoding=texnansi]
+
+\definefontsynonym [texnansi-uzcmi8a] [pzcmi8y] [encoding=texnansi]
+
+\definefontsynonym [texnansi-putr8a] [putr8y] [encoding=texnansi]
+\definefontsynonym [texnansi-putri8a] [putri8y] [encoding=texnansi]
+\definefontsynonym [texnansi-putb8a] [putr8y] [encoding=texnansi]
+\definefontsynonym [texnansi-putbi8a] [putbi8y] [encoding=texnansi]
+\definefontsynonym [texnansi-putr8a-slanted-167] [putro8y] [encoding=texnansi]
+\definefontsynonym [texnansi-putb8a-slanted-167] [putbo8y] [encoding=texnansi]
+\definefontsynonym [texnansi-putr8a-capitalized-800] [putr8y] [encoding=texnansi]
+
+\definefontsynonym [texnansi-bchr8a] [bchr8y] [encoding=texnansi]
+\definefontsynonym [texnansi-bchri8a] [bchri8y] [encoding=texnansi]
+\definefontsynonym [texnansi-bchb8a] [bchb8y] [encoding=texnansi]
+\definefontsynonym [texnansi-bchbi8a] [bchbi8y] [encoding=texnansi]
+\definefontsynonym [texnansi-bchr8a-slanted-167] [bchro8y] [encoding=texnansi]
+\definefontsynonym [texnansi-bchb8a-slanted-167] [bchbo8y] [encoding=texnansi]
+\definefontsynonym [texnansi-bchr8a-capitalized-800] [bchr8y] [encoding=texnansi]
+
+\stoptypescript
+
+\endinput
diff --git a/tex/context/base/type-buy.tex b/tex/context/base/type-buy.tex
index 148c193f6..b87dfe6e9 100644
--- a/tex/context/base/type-buy.tex
+++ b/tex/context/base/type-buy.tex
@@ -1,3 +1,16 @@
+%D \module
+%D [ file=type-buy,
+%D version=2003.07.08, % 2001.04.12,
+%D title=\CONTEXT\ Typescript Macros,
+%D subtitle=A Few Commercial Fonts,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
% fallback
% todo \typescriptthree
diff --git a/tex/context/base/type-ini.tex b/tex/context/base/type-ini.tex
index 9de348af5..effbf2f53 100644
--- a/tex/context/base/type-ini.tex
+++ b/tex/context/base/type-ini.tex
@@ -30,6 +30,8 @@
\usetypescriptfile[\f!typeprefix spe] % special macros
\usetypescriptfile[\f!typeprefix exa] % some examples
\usetypescriptfile[\f!typeprefix loc] % local scripts
+\usetypescriptfile[\f!typeprefix akb] % adobe karl berry names
+
%usetypescriptfile[\f!typeprefix pre] % predefined scripts (compatible)
%usetypescriptfile[typeface] % project scripts
diff --git a/tex/context/base/verb-js.tex b/tex/context/base/verb-js.tex
index 78184c94f..e8c2e6b5d 100644
--- a/tex/context/base/verb-js.tex
+++ b/tex/context/base/verb-js.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=verb-js,
-%D version=1998.02.7,
+%D version=1998.02.07,
%D title=\CONTEXT\ Verbatim Macros,
%D subtitle=Pretty \JAVASCRIPT\ Verbatim,
%D author=Hans Hagen,
diff --git a/tex/context/base/verb-jv.tex b/tex/context/base/verb-jv.tex
index a7bad3c43..d55394d2c 100644
--- a/tex/context/base/verb-jv.tex
+++ b/tex/context/base/verb-jv.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=verb-jv,
-%D version=2002.2.27,
+%D version=2002.02.27,
%D title=\CONTEXT\ Verbatim Macros,
%D subtitle=Pretty \JAVA\ Verbatim,
%D author=Hans Hagen,
diff --git a/tex/context/base/x-res-00.tex b/tex/context/base/x-res-00.tex
index 8cf8606d8..46a278768 100644
--- a/tex/context/base/x-res-00.tex
+++ b/tex/context/base/x-res-00.tex
@@ -29,7 +29,7 @@
\defineXMLpush [rl:product]
\defineXMLpush [rl:project]
-% resource library entries
+% resource library entries (better use XMLignore)
\defineXMLignore [rl:applet]
\defineXMLignore [rl:application]
@@ -37,6 +37,10 @@
\defineXMLignore [rl:movie]
\defineXMLignore [rl:sound]
+\defineXMLpush [rl:type]
+\defineXMLpush [rl:state]
+\defineXMLpush [rl:width]
+\defineXMLpush [rl:height]
\defineXMLpush [rl:file]
\defineXMLpush [rl:label]
\defineXMLpush [rl:original]
diff --git a/tex/context/base/x-res-01.tex b/tex/context/base/x-res-01.tex
index 7928f5a95..d3f888376 100644
--- a/tex/context/base/x-res-01.tex
+++ b/tex/context/base/x-res-01.tex
@@ -55,8 +55,10 @@
\setupoutput[pdftex] \overcomePDFspacefalse
-\doifnothing {\jobfilename} {\end}
-\doiffileelse {\jobfilename.xml} {} {\end}
+\setjobfullname {xml} % default suffix
+
+\doifnothing {\jobfullname} {\end}
+\doiffileelse {\jobfullname} {} {\end}
\def\StartDescription
{\bgroup}
@@ -337,7 +339,7 @@
\doglobal\newcounter\CurrentPage
-\processXMLfilegrouped{\jobfilename.xml}
+\processXMLfilegrouped{\jobfullname}
\increment\NumberOfFigures
@@ -346,7 +348,7 @@
\doglobal\newcounter\CurrentPage
-\processXMLfilegrouped{\jobfilename.xml}
+\processXMLfilegrouped{\jobfullname}
\setuppapersize
[S6][S6]
@@ -363,7 +365,7 @@
\doglobal\newcounter\CurrentPage
-\processXMLfilegrouped{\jobfilename.xml} \page
+\processXMLfilegrouped{\jobfullname} \page
\subject [list] {List of figures}
@@ -444,6 +446,6 @@
\doglobal\newcounter\CurrentPage
-\processXMLfilegrouped{\jobfilename.xml} \page
+\processXMLfilegrouped{\jobfullname} \page
\stoptext
diff --git a/tex/context/base/x-res-02.tex b/tex/context/base/x-res-02.tex
index 4a7ea35d5..19584f921 100644
--- a/tex/context/base/x-res-02.tex
+++ b/tex/context/base/x-res-02.tex
@@ -34,8 +34,8 @@
\usemodule[res-00]
-\doifnothing {\jobfilename} {\end}
-\doiffileelse {\jobfilename.xml} {} {\end}
+\doifnothing {\jobfullname} {\end}
+\doiffileelse {\jobfullname} {} {\end}
\defineXMLenvironment [rl:figurelibrary] \StartLibrary \StopLibrary
\defineXMLenvironment [rl:library] \StartLibrary \StopLibrary
@@ -67,6 +67,6 @@
\starttext
-\processXMLfilegrouped{\jobfilename.xml}
+\processXMLfilegrouped{\jobfullname}
\stoptext
diff --git a/tex/context/base/x-res-08.tex b/tex/context/base/x-res-08.tex
index c7452d1ee..28a48460b 100644
--- a/tex/context/base/x-res-08.tex
+++ b/tex/context/base/x-res-08.tex
@@ -36,6 +36,7 @@
\def\openXMLresourcelog
{%\global\let\openXMLresourcelog\relax
\immediate\openout\XMLrllog\jobname.rlg\relax
+ \immediate\write\XMLrllog{\XMLbanner\empty}%
\immediate\write\XMLrllog{\writtenXMLstart{\XMLrlprefix library}}}
\def\closeXMLresourcelog
diff --git a/tex/context/base/x-res-09.tex b/tex/context/base/x-res-09.tex
index 12ee02a6f..608236156 100644
--- a/tex/context/base/x-res-09.tex
+++ b/tex/context/base/x-res-09.tex
@@ -19,7 +19,7 @@
\defineXMLenvironment [rl:usage]
{\bgroup}
- {\setups[rl:usage]%
+ {\doifnot{\XMLflush{rl:file}}{dummy}{\setups[rl:usage]}%
\egroup}
\defineXMLsave [rl:base] % base
@@ -47,7 +47,11 @@
\startsetups[rl:usage]
-\starttabulate[|lw(4.5em)|p|]
+% by using a dedicated tabulation, we permit usage in dutch interface
+
+\definetabulate[XMLRLG][|lw(4.5em)|p|]
+
+\startXMLRLG
\XMLrlentry {base} {rl:base} {0}
\XMLrlentry {type} {rl:type} {0}
\XMLrlentry {state} {rl:state} {0}
@@ -58,7 +62,7 @@
\XMLrlentry {width} {rl:width} {1}
\XMLrlentry {height} {rl:height} {1}
\XMLrlentry {comment}{rl:comment}{0}
-\stoptabulate
+\stopXMLRLG
\stopsetups
diff --git a/tex/context/base/x-res-10.tex b/tex/context/base/x-res-10.tex
new file mode 100644
index 000000000..f23c50358
--- /dev/null
+++ b/tex/context/base/x-res-10.tex
@@ -0,0 +1,75 @@
+%D \module
+%D [ file=x-fig-10,
+%D version=2003.08.02,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Resource Dummy Generation,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\usemodule[res-00]
+
+\defineXMLenvironment [rl:library]
+ {\starttext}
+ {\stoptext}
+
+\defineXMLenvironment [rl:usage]
+ {\bgroup}
+ {\doif{\XMLflush{rl:type}-\XMLflush{rl:state}}{figure-missing}
+ {\doifnot{\XMLflush{rl:file}}{dummy}{\setups[rl:usage]}}
+ \egroup}
+
+\defineXMLsave [rl:type] % figure
+\defineXMLsave [rl:state] % found|missing
+\defineXMLsave [rl:file] % filename
+
+\defineXMLsavecontent [rl:width] {12cm} % width in pt
+\defineXMLsavecontent [rl:height] {9cm} % height in pt
+
+\useMPlibrary
+ [dum]
+
+\setupcolors
+ [state=start]
+
+\defineoverlay
+ [rl:banner]
+ [\setups{rl:banner}]
+
+\startsetups[rl:banner]
+
+ \framed [frame=off,offset=none,align={lohi,middle}]
+ \bgroup
+ \tt \white \XMLflush{rl:file}
+ \egroup
+
+\stopsetups
+
+\startsetups[rl:usage]
+
+ \startTEXpage
+
+ % \externalfigure
+ % [\XMLflush{rl:file}] % goes wrong when file present
+ % [object=no,
+ % backgroundcolor=green,background={foreground,color,rl:banner},
+ % width=\XMLflush{rl:width},
+ % height=\XMLflush{rl:height}]
+
+ \def\figurewidth {\XMLflush{rl:width}}
+ \def\figureheight{\XMLflush{rl:height}}
+
+ \externalfigurereplacement
+ {\XMLflush{rl:file}}
+ {\XMLflush{rl:file}}
+ {\XMLflush{rl:state}}
+
+ \stopTEXpage
+
+\stopsetups
+
+\endinput
diff --git a/tex/context/base/x-res-11.tex b/tex/context/base/x-res-11.tex
new file mode 100644
index 000000000..c58f868c0
--- /dev/null
+++ b/tex/context/base/x-res-11.tex
@@ -0,0 +1,110 @@
+%D \module
+%D [ file=x-fig-11,
+%D version=2003.02.08,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Resource Reporting (3),
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\usemodule[res-00]
+
+\defineXMLenvironment [rl:library]
+ {\starttext
+ \doiffileelse{\outputfilename.zip}{\setups[rl:attach]}{}
+ \disablemode[rl:used]}
+ {\doifnotmode{rl:used}{No images processed.}
+ \page
+ \stoptext}
+
+\defineXMLenvironment [rl:usage]
+ {\bgroup}
+ {\doifnot{\XMLflush{rl:file}}{dummy}
+ {\setups[rl:usage]
+ \enablemode[rl:used]}
+ \egroup}
+
+\defineXMLsave [rl:base] % base
+\defineXMLsave [rl:type] % figure
+\defineXMLsave [rl:state] % found|missing
+\defineXMLsave [rl:label] % label
+\defineXMLsave [rl:file] % filename
+\defineXMLsave [rl:suffix] % filesuffix
+\defineXMLsave [rl:comment] % text
+\defineXMLsave [rl:width] % width in pt
+\defineXMLsave [rl:height] % height in pt
+\defineXMLsave [rl:page] % page from file
+
+\def\XMLbpentry#1%
+ {\PointsToWholeBigPoints{\XMLflush{#1}}\temp\temp bp}
+
+\def\XMLrlentry#1#2#3%
+ {\tableiftextelse{\XMLflush{#2}}
+ {\NC\bf#1\NC\XMLflush{#2}\doif{#3}{1}{ (\XMLbpentry{#2})}\NC\NR}{}}
+
+\unprotect
+
+\setuplayout[\v!midden]
+
+\startsetups[rl:figure]
+
+ \externalfigure[\XMLflush{rl:file}][\c!breedte=4cm]
+
+\stopsetups
+
+\startsetups[rl:table]
+
+% by using a dedicated tabulation, we permit usage in dutch interface
+
+\definetabulate[XMLRLG][|lw(4.5em)|p|]
+
+\startXMLRLG
+ \XMLrlentry {base} {rl:base} {0}
+ \XMLrlentry {type} {rl:type} {0}
+ \XMLrlentry {state} {rl:state} {0}
+ \XMLrlentry {file} {rl:file} {0}
+ \XMLrlentry {label} {rl:label} {0}
+ \XMLrlentry {suffix} {rl:suffix} {0}
+ \XMLrlentry {page} {rl:page} {0}
+ \XMLrlentry {width} {rl:width} {1}
+ \XMLrlentry {height} {rl:height} {1}
+ \XMLrlentry {comment}{rl:comment}{0}
+\stopXMLRLG
+
+\stopsetups
+
+\startsetups[rl:usage]
+
+ \startfiguretext {\v!geen} {\setups[rl:figure]}
+ \setups[rl:table]
+ \stopfiguretext
+
+\stopsetups
+
+\startsetups[rl:attach]
+
+ \useMPlibrary[nav]
+
+ \setupcolors[\c!status=\v!start]
+
+ \setupinteraction[\c!status=\v!start]
+
+ \useattachment[whatever][\outputfilename.zip]
+
+ \startlocalsetups[rl:attach:button]
+
+ \inframed
+ [\c!offset=\v!overlay,\c!kader=\v!uit]
+ {\attachment[whatever]}
+
+ \stoplocalsetups
+
+ \setupfootertexts[archive with dummies: \setups{rl:attach:button}]
+
+\stopsetups
+
+\protect \endinput
diff --git a/tex/context/base/x-xml-01.tex b/tex/context/base/x-xml-01.tex
index 570641c5e..9660b288c 100644
--- a/tex/context/base/x-xml-01.tex
+++ b/tex/context/base/x-xml-01.tex
@@ -20,7 +20,7 @@
\doifnothing {\inputfilename} {\end}
\doiffileelse {\inputfilename} {} {\end}
-% makes pdftotext too slow
+% The following makes pdftotext too slow:
%
% \definepapersize
% [mine]
@@ -40,49 +40,70 @@
% [A0][A0]
%
% but normal A4 combined with 1 pt font size is the best
-
+%
+% An alternative is to use a small size, but this leads to
% too many messages
%
% \setupbodyfont
% [1pt,tt]
%
-% so:
-
-\setupbodyfont
- [tt,10pt]
+% so we stick to a more normal alternive.
-\setuptolerance
- [verytolerant]
+\unprotect
-\setupalign
- [broad,right]
+% \setuplayout
+% [backspace=0cm,
+% topspace=0cm,
+% %width=40em,
+% width=middle,
+% height=middle,
+% header=0cm,
+% footer=0cm]
\setuplayout
- [backspace=0cm,
- topspace=0cm,
- width=middle,
-% width=40em,
- height=middle,
- header=0cm,
- footer=0cm]
+ [\c!rugwit=0cm,
+ \c!kopwit=0cm,
+ %\c!breedte=40em,
+ \c!breedte=\v!midden,
+ \c!hoogte=\v!midden,
+ \c!hoofd=0cm,
+ \c!voet=0cm]
+
+% \setupbodyfont [tt,10pt]
+% \setuptolerance [verytolerant]
+% \setupalign [broad,right]
+% \setupXMLfile [level=2]
+
-\setupXMLfile
- [level=2]
+\setupbodyfont [tt,10pt]
+\setuptolerance [\v!zeersoepel]
+\setupalign [\v!ruim,\v!rechts]
+\setupXMLfile [\c!niveau=2]
\startmode[wide]
- \setuplayout[width=250cm]
+% \setuplayout [width=250cm]
+ \setuplayout [\c!breedte=250cm]
\stopmode
\startmode[packed]
- \setupXMLfile[inbetween=]
+% \setupXMLfile [inbetween=]
+ \setupXMLfile [\c!tussen=]
\stopmode
+\protect
+
+% The main text:
+
+\def\XMLbannerprocessor#1{\string<\string ?xml #1\string ?\string>\endgraf}
+
+\defineXMLprocessor [xml] {\XMLbannerprocessor}
+
\starttext
-\dontcomplain \showXMLfile{\inputfilename}
+ \dontcomplain \showXMLfile{\inputfilename}
\stoptext
diff --git a/tex/context/base/x-xml-02.tex b/tex/context/base/x-xml-02.tex
index 2f0d18d65..c5b52573c 100644
--- a/tex/context/base/x-xml-02.tex
+++ b/tex/context/base/x-xml-02.tex
@@ -41,7 +41,7 @@
[style=type]
\setupbodyfont
- [10pt]
+ [10pt,tt]
\setuptolerance
[verytolerant]
@@ -81,6 +81,10 @@
[exa:resolve,exa:include]
\stopmode
+\def\XMLbannerprocessor#1{\string<\string ?xml #1\string ?\string>\endgraf}
+
+\defineXMLprocessor [xml] {\XMLbannerprocessor}
+
\starttext
\showXMLfile{\inputfilename}
diff --git a/tex/context/base/xtag-ent.tex b/tex/context/base/xtag-ent.tex
index 4ca930894..1d9706b80 100644
--- a/tex/context/base/xtag-ent.tex
+++ b/tex/context/base/xtag-ent.tex
@@ -1,3 +1,16 @@
+%D \module
+%D [ file=xtag-ent,
+%D version=2000.12.20,
+%D title=\CONTEXT\ XML Support,
+%D subtitle=A bunch of Entities,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
% Here we also define fallbacks
\defineXMLentities [tex] {tex} {\TeX}
@@ -50,7 +63,7 @@
\defineXMLentity [Ugrave] {\Ugrave}
\defineXMLentity [ugrave] {\ugrave}
-\defineXMLentity [THORN] {\THorn}
+\defineXMLentity [THORN] {\Thorn}
\defineXMLentity [thorn] {\thorn}
\defineXMLentity [Aring] {\Aring}
diff --git a/tex/context/base/xtag-ini.tex b/tex/context/base/xtag-ini.tex
index 5391cb245..d275fc986 100644
--- a/tex/context/base/xtag-ini.tex
+++ b/tex/context/base/xtag-ini.tex
@@ -123,6 +123,13 @@
\protect
+%D Formally an \XML\ file starts with an unique sequence
+%D \type {<?xml}, but in most of the unilities that come with
+%D \CONTEXT\ we will be more tolerant, and gobble preceding
+%D spaces.
+
+\def\XMLbanner#1{\string<\string ?xml version='1.0' #1\string ?\string>}
+
%D We will be dealing with elements, which means that we have
%D to take care of \type {<this>} and \type {</that>}, but
%D also with \type {<such/>} and \type {<so />}. In some cases