diff options
author | Hans Hagen <pragma@wxs.nl> | 2002-03-04 00:00:00 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2002-03-04 00:00:00 +0100 |
commit | 6a8becf936f346438dfcb463bbb195bf4dd45d7d (patch) | |
tree | c9409681dfad52e714480dcf041a144a861ef1dd | |
parent | 492154026fb3d8fa46a58ed89edce6a596e341ad (diff) | |
download | context-6a8becf936f346438dfcb463bbb195bf4dd45d7d.tar.gz |
stable 2002.03.04
91 files changed, 3208 insertions, 846 deletions
diff --git a/context/data/cont-cz.tws b/context/data/cont-cz.tws index c7f5d8702..432691b8f 100644 --- a/context/data/cont-cz.tws +++ b/context/data/cont-cz.tws @@ -729,6 +729,7 @@ var:roh:zaobleny,pravouhly:: var:polomer:*dimenze:: var:prazdne:ano,ne:: var:foregroundcolor:*jmeno:: +var:foregroundstyle:*jmeno:: val:*text:: stopsetup @@ -1640,6 +1641,7 @@ var:vzdalenostpravehrany:*dimenze:: var:horoffset:*dimenze:: var:offsethlavicky:*dimenze:: var:pismeno:normalni,tucne,sklonene,tucnesklonene,opis,kap,male...,*prikaz:: +var:barva:*jmeno:: var:znaceni:zap,vyp,barevne:: var:misto:vlevo,nastred,vpravo,spodek,vrsek, jednostranne,dvoustranny:: var:meritko:*dimenze:: @@ -1675,7 +1677,7 @@ stopsetup startsetup com:premistinamrizku: typ:val/: -val:vrsek,obe,spodek:obe: +val:vrsek,obe,spodek,-vrsek,-obe,-spodek, vysoko,nastred,nizko,stranka,standardni,zadny, siroky,prizpusobive:standardni: stopsetup startsetup @@ -1780,7 +1782,7 @@ startsetup com:nastavpopisky: typ:vars/: var:misto:vrsek,spodek,zadny,vysoko,nizko,nastred:: -var:sirka:prizpusobive,max,*dimenze:: +var:sirka:prizpusobive,siroky,max,*dimenze:: var:stylhlavicky:normalni,tucne,sklonene,tucnesklonene,opis,kap,male...,*prikaz:: var:pismeno:normalni,tucne,sklonene,tucnesklonene,opis,kap,male...,*prikaz:: var:cislo:ano,ne:: @@ -3212,7 +3214,8 @@ var:EQ:*text:: var:barvalinky:*jmeno:: var:zarovnani:vlevo,nastred,vpravo,normalni:: var:tloustkalinky:*dimenze:: -var:vzdalenost:prazdny,podlehloubky,*dimenze,male,stredni,velke,zadny:: +var:vzdalenost:prazdny,mrizka,podlehloubky,*dimenze,male,stredni,velke,zadny:: +var:zakladnifont:5pt,...,12pt,male,velke:: stopsetup startsetup @@ -3232,6 +3235,7 @@ var:zarovnani:vlevo,nastred,vpravo,normalni:: var:pozadi:rastr,barevne,zadny:: var:rastrpozadi:*cislo:: var:barvapozadi:*jmeno:: +var:zakladnifont:5pt,...,12pt,male,velke:: stopsetup startsetup diff --git a/context/data/cont-de.tws b/context/data/cont-de.tws index e89fe84b7..438c87f33 100644 --- a/context/data/cont-de.tws +++ b/context/data/cont-de.tws @@ -729,6 +729,7 @@ var:winkel:rund,rechteckig:: var:radius:*Dimension:: var:leer:ja,nein:: var:foregroundcolor:*Name:: +var:foregroundstyle:*Name:: val:*Text:: stopsetup @@ -1640,6 +1641,7 @@ var:rechterkantenabstand:*Dimension:: var:rumpfabstand:*Dimension:: var:kopfoffset:*Dimension:: var:stil:normal,fett,geneigt,fettgeneigt,tippen,kap,klein...,*Befehl:: +var:farbe:*Name:: var:beschriftung:an,aus,farbe:: var:platz:links,mittig,rechts,unten,oben, einzelseitig,doppelseitig:: var:format:*Dimension:: @@ -1675,7 +1677,7 @@ stopsetup startsetup com:amgitterneuausrichten: typ:val/: -val:oben,beide,unten:beide: +val:oben,beide,unten,-oben,-beide,-unten, hoch,mittig,tief,seite,standard,kein, breit,passend:standard: stopsetup startsetup @@ -1780,7 +1782,7 @@ startsetup com:stellebilderunterschriftein: typ:vars/: var:platz:oben,unten,kein,hoch,tief,mittig:: -var:breite:passend,max,*Dimension:: +var:breite:passend,breit,max,*Dimension:: var:kopfstil:normal,fett,geneigt,fettgeneigt,tippen,kap,klein...,*Befehl:: var:stil:normal,fett,geneigt,fettgeneigt,tippen,kap,klein...,*Befehl:: var:nummer:ja,nein:: @@ -3212,7 +3214,8 @@ var:EQ:*Text:: var:linienfarbe:*Name:: var:ausrichtung:links,mittig,rechts,normal:: var:liniendicke:*Dimension:: -var:abstand:blanko,tiefe,*Dimension,klein,mittel,gross,kein:: +var:abstand:blanko,gritter,tiefe,*Dimension,klein,mittel,gross,kein:: +var:fliesstext:5pt,...,12pt,klein,gross:: stopsetup startsetup @@ -3232,6 +3235,7 @@ var:ausrichtung:links,mittig,rechts,normal:: var:hintergrund:raster,farbe,kein:: var:hintergrundraster:*Nummer:: var:hintergrundfarbe:*Name:: +var:fliesstext:5pt,...,12pt,klein,gross:: stopsetup startsetup diff --git a/context/data/cont-en.tws b/context/data/cont-en.tws index c7cba86e2..4994117cc 100644 --- a/context/data/cont-en.tws +++ b/context/data/cont-en.tws @@ -729,6 +729,7 @@ var:corner:round,rectangular:: var:radius:*dimension:: var:empty:yes,no:: var:foregroundcolor:*name:: +var:foregroundstyle:*name:: val:*text:: stopsetup @@ -1640,6 +1641,7 @@ var:rightedgedistance:*dimension:: var:horoffset:*dimension:: var:veroffset:*dimension:: var:style:normal,bold,slanted,boldslanted,type,cap,small...,*command:: +var:color:*name:: var:marking:on,off,color:: var:location:left,middle,right,bottom,top, singlesided,doublesided:: var:scale:*dimension:: @@ -1675,7 +1677,7 @@ stopsetup startsetup com:moveongrid: typ:val/: -val:top,both,bottom:both: +val:top,both,bottom,-top,-both,-bottom, high,middle,low,page,standard,none, broad,fit:standard: stopsetup startsetup @@ -1780,7 +1782,7 @@ startsetup com:setupcaptions: typ:vars/: var:location:top,bottom,none,high,low,middle:: -var:width:fit,max,*dimension:: +var:width:fit,broad,max,*dimension:: var:headstyle:normal,bold,slanted,boldslanted,type,cap,small...,*command:: var:style:normal,bold,slanted,boldslanted,type,cap,small...,*command:: var:number:yes,no:: @@ -3212,7 +3214,8 @@ var:EQ:*text:: var:rulecolor:*name:: var:align:left,middle,right,normal:: var:rulethickness:*dimension:: -var:distance:blank,depth,*dimension,small,medium,big,none:: +var:distance:blank,grid,depth,*dimension,small,medium,big,none:: +var:bodyfont:5pt,...,12pt,small,big:: stopsetup startsetup @@ -3232,6 +3235,7 @@ var:align:left,middle,right,normal:: var:background:screen,color,none:: var:backgroundscreen:*number:: var:backgroundcolor:*name:: +var:bodyfont:5pt,...,12pt,small,big:: stopsetup startsetup diff --git a/context/data/cont-it.tws b/context/data/cont-it.tws index 05cb71c38..b4c59e3e1 100644 --- a/context/data/cont-it.tws +++ b/context/data/cont-it.tws @@ -729,6 +729,7 @@ var:angolo:rotondo,rettangolare:: var:raggio:*dimension:: var:vuoto:si,no:: var:coloreprimopiano:*name:: +var:foregroundstyle:*name:: val:*text:: stopsetup @@ -1640,6 +1641,7 @@ var:distanzabordodestro:*dimension:: var:horoffset:*dimension:: var:veroffset:*dimension:: var:stile:normale,grassetto,inclinato,grassettoinclinato,type,cap,piccolo...,*command:: +var:colore:*name:: var:marcatura:attivo,disattivo,colore:: var:luogo:sinistra,centro,destra,fondo,cima, facciasingola,doppiafaccia:: var:scala:*dimension:: @@ -1675,7 +1677,7 @@ stopsetup startsetup com:spostaagriglia: typ:val/: -val:cima,entrambi,fondo:entrambi: +val:cima,entrambi,fondo,-cima,-entrambi,-fondo, alto,centro,basso,pagina,standard,nessuno, ampio,adatta:standard: stopsetup startsetup @@ -1780,7 +1782,7 @@ startsetup com:impostacaptions: typ:vars/: var:luogo:cima,fondo,nessuno,alto,basso,centro:: -var:ampiezza:adatta,max,*dimension:: +var:ampiezza:adatta,ampio,max,*dimension:: var:stiletesta:normale,grassetto,inclinato,grassettoinclinato,type,cap,piccolo...,*command:: var:stile:normale,grassetto,inclinato,grassettoinclinato,type,cap,piccolo...,*command:: var:numero:si,no:: @@ -3212,7 +3214,8 @@ var:EQ:*text:: var:colorelinea:*name:: var:allinea:sinistra,centro,destra,normale:: var:spessorelinea:*dimension:: -var:distanza:rigovuoto,profondita,*dimension,piccolo,medio,grande,nessuno:: +var:distanza:rigovuoto,griglia,profondita,*dimension,piccolo,medio,grande,nessuno:: +var:fonttesto:5pt,...,12pt,piccolo,grande:: stopsetup startsetup @@ -3232,6 +3235,7 @@ var:allinea:sinistra,centro,destra,normale:: var:sfondo:schermo,colore,nessuno:: var:schermosfondo:*number:: var:coloresfondo:*name:: +var:fonttesto:5pt,...,12pt,piccolo,grande:: stopsetup startsetup diff --git a/context/data/cont-nl.tws b/context/data/cont-nl.tws index 7117c813d..985d86d93 100644 --- a/context/data/cont-nl.tws +++ b/context/data/cont-nl.tws @@ -729,6 +729,7 @@ var:hoek:rond,recht:: var:straal:*maat:: var:leeg:ja,nee:: var:voorgrondkleur:*naam:: +var:voorgrondletter:*naam:: val:*tekst:: stopsetup @@ -1640,6 +1641,7 @@ var:rechterrandafstand:*maat:: var:rugoffset:*maat:: var:kopoffset:*maat:: var:letter:normaal,vet,schuin,vetschuin,type,kap,klein...,*commando:: +var:kleur:*naam:: var:markering:aan,uit,kleur:: var:plaats:links,midden,rechts,onder,boven, enkelzijdig,dubbelzijdig:: var:schaal:*maat:: @@ -1675,7 +1677,7 @@ stopsetup startsetup com:verplaatsopgrid: typ:val/: -val:boven,beide,onder:beide: +val:boven,beide,onder,-boven,-beide,-onder, hoog,midden,laag,pagina,standaard,geen, ruim,passend:standaard: stopsetup startsetup @@ -1780,7 +1782,7 @@ startsetup com:stelblokkopjesin: typ:vars/: var:plaats:boven,onder,geen,hoog,laag,midden:: -var:breedte:passend,max,*maat:: +var:breedte:passend,ruim,max,*maat:: var:kopletter:normaal,vet,schuin,vetschuin,type,kap,klein...,*commando:: var:letter:normaal,vet,schuin,vetschuin,type,kap,klein...,*commando:: var:nummer:ja,nee:: @@ -3212,7 +3214,8 @@ var:EQ:*tekst:: var:lijnkleur:*naam:: var:uitlijnen:links,midden,rechts,normaal:: var:lijndikte:*maat:: -var:afstand:blanko,diepte,*maat,klein,middel,groot,geen:: +var:afstand:blanko,grid,diepte,*maat,klein,middel,groot,geen:: +var:korps:5pt,...,12pt,klein,groot:: stopsetup startsetup @@ -3232,6 +3235,7 @@ var:uitlijnen:links,midden,rechts,normaal:: var:achtergrond:raster,kleur,geen:: var:achtergrondraster:*getal:: var:achtergrondkleur:*naam:: +var:korps:5pt,...,12pt,klein,groot:: stopsetup startsetup diff --git a/context/data/cont-ro.tws b/context/data/cont-ro.tws index dab9da453..4728da501 100644 --- a/context/data/cont-ro.tws +++ b/context/data/cont-ro.tws @@ -729,6 +729,7 @@ var:colt:rotund,rectangular:: var:raza:*dimensiune:: var:gol:da,nu:: var:foregroundcolor:*nume:: +var:foregroundstyle:*nume:: val:*text:: stopsetup @@ -1640,6 +1641,7 @@ var:distantacoltdreapta:*dimensiune:: var:offsetoriz:*dimensiune:: var:veroffset:*dimensiune:: var:stil:normal,aldin,inclinat,aldininclinat,type,cap,mic...,*comanda:: +var:culoare:*nume:: var:marcaje:on,dezactivat,culoare:: var:locatie:stanga,centru,dreapta,subsol,sus, ofata,douafete:: var:scala:*dimensiune:: @@ -1675,7 +1677,7 @@ stopsetup startsetup com:mutapegrid: typ:val/: -val:sus,ambele,subsol:ambele: +val:sus,ambele,subsol,-sus,-ambele,-subsol, inalt,centru,jos,pagina,standard,niciunul, broad,ajustat:standard: stopsetup startsetup @@ -1780,7 +1782,7 @@ startsetup com:seteazalegendele: typ:vars/: var:locatie:sus,subsol,niciunul,inalt,jos,centru:: -var:latime:ajustat,max,*dimensiune:: +var:latime:ajustat,broad,max,*dimensiune:: var:stiltitlu:normal,aldin,inclinat,aldininclinat,type,cap,mic...,*comanda:: var:stil:normal,aldin,inclinat,aldininclinat,type,cap,mic...,*comanda:: var:numar:da,nu:: @@ -3212,7 +3214,8 @@ var:EQ:*text:: var:culoarerigla:*nume:: var:aliniere:stanga,centru,dreapta,normal:: var:grosimerigla:*dimensiune:: -var:distanta:blank,adancime,*dimensiune,mic,mediu,mare,niciunul:: +var:distanta:blank,grila,adancime,*dimensiune,mic,mediu,mare,niciunul:: +var:fonttext:5pt,...,12pt,mic,mare:: stopsetup startsetup @@ -3232,6 +3235,7 @@ var:aliniere:stanga,centru,dreapta,normal:: var:fundal:ecran,culoare,niciunul:: var:ecranfundal:*numar:: var:culoarefundal:*nume:: +var:fonttext:5pt,...,12pt,mic,mare:: stopsetup startsetup diff --git a/context/data/type-buy.dat b/context/data/type-buy.dat index 2835f0338..31590b2d1 100644 --- a/context/data/type-buy.dat +++ b/context/data/type-buy.dat @@ -67,3 +67,18 @@ --en=? --ve=adobe --co=myriad --so=adobe/myriad --sl=* MyriadMM-we* --en=? --ve=adobe --co=myriad --so=adobe/myriad --ca=* MyriadMM-we* + +# adobe frutiger + +--en=? --ve=adobe --co=frutiger --re +--en=? --ve=adobe --co=frutiger --so=adobe/frutiger --ma --in + +# itc mendoza + +--en=? --ve=itc --co=mendoza --re +--en=? --ve=itc --co=mendoza --so=itc/mendoza --ma --in + +# linotype univers + +--en=? --ve=linotype --co=univers --re +--en=? --ve=linotype --co=univers --so=linotype/univers --ma --in diff --git a/context/perltk/fdf2tan.pl b/context/perltk/fdf2tan.pl index c612f9886..c612f9886 100644..100755 --- a/context/perltk/fdf2tan.pl +++ b/context/perltk/fdf2tan.pl diff --git a/context/perltk/fdf2tex.pl b/context/perltk/fdf2tex.pl index f9684cd9f..f9684cd9f 100644..100755 --- a/context/perltk/fdf2tex.pl +++ b/context/perltk/fdf2tex.pl diff --git a/context/perltk/makempy.pl b/context/perltk/makempy.pl index 600cb9944..600cb9944 100644..100755 --- a/context/perltk/makempy.pl +++ b/context/perltk/makempy.pl diff --git a/context/perltk/mptopdf.pl b/context/perltk/mptopdf.pl index e55fb74b2..e55fb74b2 100644..100755 --- a/context/perltk/mptopdf.pl +++ b/context/perltk/mptopdf.pl diff --git a/context/perltk/texexec.pl b/context/perltk/texexec.pl index 7d7a27af5..920645bd7 100755 --- a/context/perltk/texexec.pl +++ b/context/perltk/texexec.pl @@ -232,7 +232,7 @@ if (($LogFile ne '')&&($LogFile =~ /\w+\.log$/io)) *STDOUT = *LOGFILE ; *STDERR = *LOGFILE } -my $Program = " TeXExec 2.6 - ConTeXt / PRAGMA ADE 1997-2001" ; +my $Program = " TeXExec 2.7 - ConTeXt / PRAGMA ADE 1997-2001" ; print "\n$Program\n\n"; @@ -883,12 +883,16 @@ sub MakeOptionFile elsif ($Arrange||$PdfArrange) { $FinalRunNeeded = 1 ; if ($FinalRun) - { if ($PrintFormat =~ /.*up/goi) - { print OPT "\\setuparranging[2UP,\\v!geroteerd,\\v!dubbelzijdig]\n" } + { if ($NoDuplex) + {$DupStr = "" } + else + {$DupStr = ",\\v!dubbelzijdig" } + if ($PrintFormat =~ /.*up/goi) + { print OPT "\\setuparranging[2UP,\\v!geroteerd$DupStr]\n" } elsif ($PrintFormat =~ /.*down/goi) - { print OPT "\\setuparranging[2DOWN,\\v!geroteerd,\\v!dubbelzijdig]\n" } + { print OPT "\\setuparranging[2DOWN,\\v!geroteerd$DupStr]\n" } elsif ($PrintFormat =~ /.*side/goi) - { print OPT "\\setuparranging[2SIDE,\\v!geroteerd,\\v!dubbelzijdig]\n" } + { print OPT "\\setuparranging[2SIDE,\\v!geroteerd$DupStr]\n" } else { print OPT "\\setuparranging[$PrintFormat]\n" } } else @@ -946,7 +950,8 @@ sub MakeUserFile $MainLanguage = $MainLanguages[0] ; print USR "\\setupcurrentlanguage[\\s!$MainLanguage]\n" } if ($MainBodyFont ne 'standard') - { print USR "\\definefilesynonym[font-cmr][font-$MainBodyFont]\n" } + { print USR "\\definetypescriptsynonym[cmr][$MainBodyFont]" ; + print USR "\\definefilesynonym[font-cmr][font-$MainBodyFont]\n" } print USR "\\protect\n" ; print USR "\\endinput\n" ; close (USR) ; @@ -1001,24 +1006,40 @@ sub CompareFiles # 2 = tuo { return 0 } } sub CheckPositions - { return if ($DVIspec eq '') ; - my $JobName = shift ; my $TuoName = "$JobName.tuo" ; - if (open(POS,"$TuoName")) - { seek POS, (-s $TuoName) - 5000, 0 ; - while (<POS>) - { if (/\% *position commands *\: *(\d*) *\(unresolved\)/io) - { if ($1) - { print " dvi positions : $1 ($DVIspec ." ; - close (POS) ; - open(POS,">>$TuoName") ; - $ENV{uc "$DVIspec.TEXFONTSDIR"} = $TeXFontsPath ; - print POS "\%\n\% extracted from dvi file by $DVIspec:\n\%\n" ; - close(POS) ; - print "." ; - RunPerlScript ($DVIspec, "$JobName >> $TuoName") ; - print ".)\n" } - last } } - close (POS) } } + { return if ($DVIspec eq '') ; + my $JobName = shift ; my $TuoName = "$JobName.tuo" ; + if (open(POS,"$TuoName")) + { seek POS, (-s $TuoName) - 5000, 0 ; + while (<POS>) + { if (/\% *position commands *\: *(\d*) *\(unresolved\)/io) + { if ($1) + { print " dvi positions : $1 ($DVIspec ." ; + close (POS) ; + open(POS,">>$TuoName") ; + $ENV{uc "$DVIspec.TEXFONTSDIR"} = $TeXFontsPath ; + print POS "\%\n\% extracted from dvi file by $DVIspec:\n\%\n" ; + close(POS) ; + print "." ; + RunPerlScript ($DVIspec, "$JobName >> $TuoName") ; + print ".)\n" } + last } } + close (POS) } } + +# my @ExtraPrograms = () ; +# +# sub CheckExtraPrograms +# { my $JobName = shift ; my $TuoName = "$JobName.tuo" ; +# if (open(PRO,"$TuoName")) +# { seek PRO, (-s $TuoName) - 5000, 0 ; +# while (<PRO>) +# { if (/\%\s*extra\s*program\s*\:\s*(.*)\s*$/io) +# { push @ExtraPrograms, $1 } } +# close (PRO) } +# foreach my $EP (@ExtraPrograms) +# { if ($EP =~ /(.+)\s*(.*)/o) +# { print "\n extra program : $1\n" ; +# system($EP) ; +# print "\n" } } } my $ConTeXtVersion = "unknown" ; my $ConTeXtModes = '' ; @@ -1153,6 +1174,7 @@ sub RunTeXutil ($TeXUtil, "--ref --ij --high $TcXPath $JobName" ); if (-e "$JobName.tuo") { CheckPositions ($JobName) ; + # CheckExtraPrograms($JobName) ; $StopRunning = CompareFiles("$JobName.tup", "$JobName.tuo") } else { $StopRunning = 1 } # otherwise potential loop @@ -1997,7 +2019,9 @@ elsif ($MakeFormats) else { RunFormats } } elsif (@ARGV) - { @ARGV = <@ARGV> ; RunFiles } + { @ARGV = <@ARGV> ; +foreach (@ARGV) { s/\\/\//goi } + RunFiles } else { print $Help{HELP} ; unless ($Verbose) { print $Help{VERBOSE} } } diff --git a/context/perltk/texfind.pl b/context/perltk/texfind.pl index 53a560c79..53a560c79 100644..100755 --- a/context/perltk/texfind.pl +++ b/context/perltk/texfind.pl diff --git a/context/perltk/texfont.pl b/context/perltk/texfont.pl index 3b86e9cd0..3b86e9cd0 100644..100755 --- a/context/perltk/texfont.pl +++ b/context/perltk/texfont.pl diff --git a/context/perltk/texshow.pl b/context/perltk/texshow.pl index d52508476..d52508476 100644..100755 --- a/context/perltk/texshow.pl +++ b/context/perltk/texshow.pl diff --git a/context/perltk/texutil.pl b/context/perltk/texutil.pl index dbb6ae549..6b3a1a680 100755 --- a/context/perltk/texutil.pl +++ b/context/perltk/texutil.pl @@ -289,6 +289,9 @@ if ($UserInterface eq "nl") $MS{"Entries"} = "ingangen" ; $MS{"References"} = "verwijzingen" ; + $MS{"PlugInInit"} = " plugin initialized :" ; + $MS{"PlugInReport"} = " plugin report :" ; + } # end of dutch section elsif ($UserInterface eq "de") @@ -377,6 +380,9 @@ elsif ($UserInterface eq "de") $MS{"Entries"} = "Eintraege" ; $MS{"References"} = "Referenzen" ; + $MS{"PlugInInit"} = " plugin initialized :" ; + $MS{"PlugInReport"} = " plugin report :" ; + } # end of german section elsif ($UserInterface eq "it") @@ -462,6 +468,9 @@ elsif ($UserInterface eq "it") $MS{"Entries"} = "voci" ; $MS{"References"} = "riferimenti" ; + $MS{"PlugInInit"} = " plugin initialized :" ; + $MS{"PlugInReport"} = " plugin report :" ; + } # end of italian section else @@ -547,6 +556,9 @@ else $MS{"Entries"} = "entries" ; $MS{"References"} = "references" ; + $MS{"PlugInInit"} = " plugin initialized :" ; + $MS{"PlugInReport"} = " plugin report :" ; + } # end of english section #D \stopcompressdefinitions @@ -949,6 +961,91 @@ sub HandleCommand sub FlushCommands { Report ("PassedCommands", $NOfCommands) } +#D Experimental: Extra +#D +#D s p : extra programs + +my @ExtraPrograms = () ; + +sub InitializeExtra + { } + +sub HandleExtra + { if ($RestOfLine =~ /(.)\s+(.*)\s*$/o) + { if ($1 eq "p") + { my $str = $2 ; $str =~ s/^\{(.*)\}$/$1/o ; + push @ExtraPrograms,$str } } } + +sub FlushExtra + { print TUO "%\n" . "% $Program / System\n" . "%\n" ; + foreach $EP (@ExtraPrograms) + { print TUO "% extra program : $EP\n" } } + +sub RunExtraPrograms + { foreach $EP (@ExtraPrograms) + { system($EP) } } + +#D Plugins +#D +#D test.pm: +#D +#D \starttypen +#D see plugtest.pm +#D \stoptypen +#D +#D utility format: +#D +#D \starttypen +#D p u {name} {data} {data} ... +#D \stoptypen + +my $pm_path ; + +BEGIN + { # $pm_path = `kpsewhich --format="other text files" --progname=context texutil.pl` ; + # chomp($pm_path) ; + # $pm_path =~ s/texutil\.pl.*// } + $pm_path = $0 ; + $pm_path =~ s/\\/\//o ; + $pm_path =~ s/texutil\.pl.*//io ; + if ($pm_path eq "") { $pm_path = "./" } } + +use lib $pm_path ; + +my %UserPlugIns ; + +sub HandlePlugIn + { if ($RestOfLine =~ /\s*u\s*\{(.*?)\}\s*(.*)\s*/io) + { my $tag = $1 ; + my $arg = $2 ; + if (! defined($UserPlugIns{$tag})) + { $UserPlugIns{$tag} = 1 ; + eval("use $tag") ; + my $result = $tag->identify ; + if ($result ne "") + { Report ("PlugInInit", "$tag -> $result") } + else + { Report ("PlugInInit", $tag ) } + $tag->initialize() } + if (defined($UserPlugIns{$tag})) + { $arg =~ s/\{(.*)\}/$1/o ; + my @args = split(/\}\s*\{/o, $arg) ; + $tag->handle(@args) } } } + +sub FlushPlugIns + { foreach my $tag (keys %UserPlugIns) + { my @report = $tag->report ; + foreach $rep (@report) + { my ($key,$val) = split (/\s*\:\s*/,$rep) ; + if ($val ne "") + { Report ("PlugInReport", "$tag -> $key -> $val") } + else + { Report ("PlugInReport", "$tag -> $key") } } + $tag->process ; + print TUO "%\n" . "% $Program / $tag->identify\n" . "%\n" ; + foreach my $str ($tag->results) + { print TUO "\\plugincommand\{$str\}\n" } } } + #D Synonyms are a sort of key||value pairs and are used for #D ordered lists like abbreviations and units. #D @@ -1297,7 +1394,8 @@ if ($SortN) #D be. The totals, when changed, force texexec to do a second pass. sub FlushData - { print TUO "" . + { print TUO "%\n" . "% $Program / Status\n" . "%\n" ; + print TUO "" . "% embedded files : $NOfFiles ($NOfBadFiles errors)\n" . "% synonym entries : $NOfSynonyms ($NOfBadSynonyms errors)\n" . "% register entries : $NOfEntries ($NOfBadEntries errors)\n" . @@ -1341,6 +1439,10 @@ sub NormalHandleReferences { HandleFile } elsif ($FirstTag eq "k") { HandleKey } + elsif ($FirstTag eq "e") + { HandleExtra } + elsif ($FirstTag eq "p") + { HandlePlugIn } elsif ($FirstTag eq "q") { $ValidOutput = 0 ; last } } @@ -1349,9 +1451,12 @@ sub NormalHandleReferences FlushKeys ; FlushRegisters ; FlushSynonyms ; + FlushPlugIns ; FlushFiles ; FlushData ; - close (TUO) } + FlushExtra ; + close (TUO) ; + RunExtraPrograms } else { close (TUO) ; unlink "$InputFile.tuo" ; @@ -1451,6 +1556,7 @@ sub HandleReferences { Report("Option", "ProcessingQuotes") } InitializeKeys ; InitializeCommands ; + InitializeExtra ; InitializeRegisters ; InitializeSynonyms ; InitializeFiles ; diff --git a/context/perltk/utiplug.pm b/context/perltk/utiplug.pm new file mode 100644 index 000000000..2bc162e1e --- /dev/null +++ b/context/perltk/utiplug.pm @@ -0,0 +1,30 @@ +package utiplug ; + +my @data ; +my @result ; + +sub utiplug::initialize + { @data = () } + +sub utiplug::process + { @data = sort @data ; + for (my $i=0; $i<@data; $i++) + { @result[$i] = "\\plugintest\{$i\}\{$data[$i]\}" } } + +sub utiplug::handle + { my ($self,$text,$rest) = @_ ; push @data, $text } + +sub utiplug::identify + { return "utiplug test plugin" } + +sub utiplug::report + { my $keys = @data ; + if ($keys) + { return ("done", "keys:$keys") } + else + { return ("nothing done") } } + +sub utiplug::results + { return @result } + +1 ; diff --git a/metapost/context/mp-grph.mp b/metapost/context/mp-grph.mp index 207b2b4f0..8c94d68d0 100644 --- a/metapost/context/mp-grph.mp +++ b/metapost/context/mp-grph.mp @@ -142,6 +142,19 @@ def regraphictext (expr t) = dofinishgraphictext enddef ; +%D Believe it or not, but it took me half a day to uncover +%D the following neccessity: +%D +%D \starttypen +%D save withfillcolor, withdrawcolor ; +%D \stoptypen +%D +%D When we have more than one graphictext, these will be +%D defined after the first graphic. For some obscure reason, +%D this means that in the next graphic they will be called, but +%D afterwards the data and boolean are not set. Don't ask me +%D why. + def dofinishgraphictext text x_op_x = protectgraphicmacros ; interim linecap := butt ; % normally rounded @@ -150,6 +163,7 @@ def dofinishgraphictext text x_op_x = let normalwithshade = withshade ; save foundpicture, scratchpicture, str ; save fill, draw, withshade, reversefill, outlinefill ; + save withfillcolor, withdrawcolor ; % quite important numeric foundpicture ; picture scratchpicture ; string str ; def draw expr p = % the first, naive implementation was: diff --git a/metapost/context/mp-spec.mp b/metapost/context/mp-spec.mp index 1ec8164bc..563c45067 100644 --- a/metapost/context/mp-spec.mp +++ b/metapost/context/mp-spec.mp @@ -156,15 +156,17 @@ fi ; %D Shade allocation. +newinternal shadefactor ; shadefactor := 1 ; + vardef define_linear_shade (expr a, b, ca, cb) = - flush_special(30, 15, "0 1 1" & + flush_special(30, 15, "0 1 " & decimal shadefactor & " " & dddecimal ca & ddecimal a & dddecimal cb & ddecimal b ) ; _special_counter_ enddef ; vardef define_circular_shade (expr a, b, ra, rb, ca, cb) = - flush_special(31, 17, "0 1 1" & + flush_special(31, 17, "0 1 " & decimal shadefactor & " " & dddecimal ca & ddecimal a & " " & decimal ra & dddecimal cb & ddecimal b & " " & decimal rb ) ; _special_counter_ diff --git a/metapost/context/mp-symb.mp b/metapost/context/mp-symb.mp new file mode 100644 index 000000000..edf2b44d3 --- /dev/null +++ b/metapost/context/mp-symb.mp @@ -0,0 +1,352 @@ +%D \module +%D [ file=mp-symb.mp, +%D version=very old, +%D title=\CONTEXT\ \METAPOST\ graphics, +%D subtitle=navigation symbol macros, +%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. + +%D Instead of these symbols, you can use the \type {contnav} +%D font by Taco Hoekwater that is derived form this file. + +u := 3; +h := 5u; +wt := 5u; +wb := .25wt; +o := .1u; +pw := .5u; + +drawoptions (withpen pencircle scaled pw); + +path lefttriangle, righttriangle, sublefttriangle, subrighttriangle; + +pair s ; s = (2wb,0) ; + + +x1t = x2t = 0; +x3t = wt; +y3t = .5h; +z1t-z2t = (z3t-z2t) rotated 60; + +z4t = (z2t--z3t) intersectionpoint ((z1t--z2t) shifted s) ; +z5t = (z3t--z1t) intersectionpoint ((z1t--z2t) shifted s) ; + +righttriangle = z1t--z2t--z3t--cycle; +lefttriangle = righttriangle rotatedaround((0,.5h), 180) shifted (wt,0); + +subrighttriangle = z4t--((z2t--z3t--z1t) shifted s)--z5t ; +sublefttriangle = subrighttriangle rotatedaround((0,.5h), 180) shifted (wt,0); + +path sidebar; + +x1b = x4b = 0; +x2b = x3b = wb; +y1b = y2b = y1t; +y3b = y4b = y2t; + +sidebar = z1b--z2b--z3b--z4b--cycle; + +path midbar, onebar, twobar; + +hh = abs(y1t-y2t); + +%midbar := unitsquare scaled 2hh/3; +midbar := unitsquare scaled hh; +onebar := unitsquare xscaled (hh/3) yscaled hh; +twobar := onebar; + +def prepareglyph = + drawoptions (withpen pencircle scaled .5u); +enddef; + +def finishglyph = + set_outer_boundingbox currentpicture; + bboxmargin := o; + setbounds currentpicture to bbox currentpicture; +% draw boundingbox currentpicture withcolor red withpen pencircle scaled 1; +enddef; + +beginfig (1); + prepareglyph; + fill lefttriangle; + draw lefttriangle; % draw gets the bbox right, filldraw doesn't + finishglyph; +endfig; + +beginfig (2); + prepareglyph; + fill righttriangle; + draw righttriangle; + finishglyph; +endfig; + +beginfig (3); + prepareglyph; + fill sidebar; + draw sidebar; + fill lefttriangle shifted (.5s); + draw lefttriangle shifted (.5s); + finishglyph; +endfig; + +beginfig (4); + prepareglyph; + fill righttriangle; + draw righttriangle; + fill sidebar shifted (wt,0); + draw sidebar shifted (wt,0); + finishglyph; +endfig; + +beginfig (5); + prepareglyph; + fill lefttriangle; + draw lefttriangle; + fill lefttriangle shifted s; + draw lefttriangle shifted s; + finishglyph; +endfig; + +beginfig (6); + prepareglyph; + fill righttriangle; + draw righttriangle; + fill righttriangle shifted s; + draw righttriangle shifted s; + finishglyph; +endfig; + +beginfig (7); + prepareglyph; + fill midbar; + draw midbar; + finishglyph; +endfig; + +beginfig (8); + prepareglyph; + fill onebar; + draw onebar; + finishglyph; +endfig; + +beginfig (9); + prepareglyph; + fill twobar; + draw twobar; + fill twobar shifted (pw+hh/2,0); + draw twobar shifted (pw+hh/2,0); + finishglyph; +endfig; + +beginfig(101); + prepareglyph; + draw lefttriangle; + finishglyph; +endfig; + +beginfig(102); + prepareglyph; + draw righttriangle; + finishglyph; +endfig; + +beginfig(103); + prepareglyph; + draw sidebar; + draw lefttriangle shifted (.5s); + finishglyph; +endfig; + +beginfig(104); + prepareglyph; + draw righttriangle; + draw sidebar shifted (wt,0); + finishglyph; +endfig; + +beginfig(105); + prepareglyph; + draw lefttriangle; + draw lefttriangle shifted s; + finishglyph; +endfig; + +beginfig(106); + prepareglyph; + draw righttriangle; + draw righttriangle shifted s; + finishglyph; +endfig; + +beginfig(107); + prepareglyph; + draw midbar; + finishglyph; +endfig; + +beginfig(108); + prepareglyph; + draw onebar; + finishglyph; +endfig; + +beginfig(109); + prepareglyph; + draw twobar; + draw twobar shifted (pw+hh/2,0); + finishglyph; +endfig; + +beginfig(201); + prepareglyph; + draw lefttriangle; + finishglyph; +endfig; + +beginfig(202); + prepareglyph; + draw righttriangle; + finishglyph; +endfig; + +beginfig(203); + prepareglyph; + draw sidebar; + draw lefttriangle shifted (.5s); + finishglyph; +endfig; + +beginfig(204); + prepareglyph; + draw righttriangle; + draw sidebar shifted (wt,0); + finishglyph; +endfig; + +beginfig(205); + prepareglyph; + draw sublefttriangle shifted s; + draw lefttriangle shifted s; + finishglyph; +endfig; + +beginfig(206); + prepareglyph; + draw subrighttriangle; + draw righttriangle; + finishglyph; +endfig; + +beginfig(207); + prepareglyph; + draw midbar; + finishglyph; +endfig; + +beginfig(208); + prepareglyph; + draw onebar; + finishglyph; +endfig; + +beginfig(209); + prepareglyph; + draw twobar; + draw twobar shifted (pw+hh/2,0); + finishglyph; +endfig; + + +beginfig(999); + +picture collection [] ; + +prepareglyph ; +draw lefttriangle ; +finishglyph ; +collection[201] := currentpicture ; +currentpicture := nullpicture ; + +prepareglyph ; +draw righttriangle ; +finishglyph ; +collection[202] := currentpicture ; +currentpicture := nullpicture ; + +prepareglyph ; +draw sidebar ; +draw lefttriangle shifted (.5s) ; +finishglyph ; +collection[203] := currentpicture ; +currentpicture := nullpicture ; + +prepareglyph ; +draw righttriangle ; +draw sidebar shifted (wt,0) ; +finishglyph ; +collection[204] := currentpicture ; +currentpicture := nullpicture ; + +prepareglyph ; +draw sublefttriangle shifted s ; +draw lefttriangle shifted s ; +finishglyph ; +collection[205] := currentpicture ; +currentpicture := nullpicture ; + +prepareglyph ; +draw subrighttriangle ; +draw righttriangle ; +finishglyph ; +collection[206] := currentpicture ; +currentpicture := nullpicture ; + +prepareglyph ; +draw midbar ; +finishglyph ; +collection[207] := currentpicture ; +currentpicture := nullpicture ; + +prepareglyph ; +draw onebar ; +finishglyph ; +collection[208] := currentpicture ; +currentpicture := nullpicture ; + +prepareglyph ; +draw twobar ; +draw twobar shifted (pw+hh/2,0) ; +finishglyph ; +collection[209] := currentpicture ; +currentpicture := nullpicture ; + +for i=201 upto 209 : + collection[i] := collection[i] shifted - center collection[i] ; +endfor ; + +addto currentpicture also collection[205] shifted ( 0, 0) + withcolor (.3,.4,.5) ; +addto currentpicture also collection[202] shifted ( 0,1.5h) + withcolor (.5,.6,.7) ; +addto currentpicture also collection[201] shifted (1.5h, 0) + withcolor (.6,.7,.8) ; +addto currentpicture also collection[206] shifted (1.5h,1.5h) + withcolor (.4,.5,.6) ; + +collection[210] := currentpicture ; +currentpicture := nullpicture ; + +bboxmargin := .25u; + +fill bbox collection[210] withcolor .95(1,1,0); +addto currentpicture also collection[210] ; + +endfig ; + +end diff --git a/pdftex/config/context/pl0-ams-cmr.map b/pdftex/config/context/pl0-ams-cmr.map index 70807f50c..a217781bd 100644 --- a/pdftex/config/context/pl0-ams-cmr.map +++ b/pdftex/config/context/pl0-ams-cmr.map @@ -26,7 +26,7 @@ plmi7 <plmi7.pfb plmi8 <plmi8.pfb plmi9 <plmi9.pfb plmib10 <plmib10.pfb -plr10 <plr10.pfb +plr10 <plr10.pfb plr12 <plr12.pfb plr17 <plr17.pfb plr5 <plr5.pfb diff --git a/tex/context/base/colo-ini.tex b/tex/context/base/colo-ini.tex index ae7934699..269f17318 100644 --- a/tex/context/base/colo-ini.tex +++ b/tex/context/base/colo-ini.tex @@ -657,10 +657,12 @@ %D in three digits precision. \def\realcolorvalue#1% - {\ifnum#1<10 0.00\the#1\else - \ifnum#1<100 0.0\the#1\else - \ifnum#1<1000 0.\the#1\else - 1\fi\fi\fi} + {\ifnum#1>0 % important, first encountered in --modu supp-mpe + \ifnum#1<10 0.00\the#1\else + \ifnum#1<100 0.0\the#1\else + \ifnum#1<1000 0.\the#1\else + 1\fi\fi\fi + \else 0\fi} \def\doconvertCMYKtoRGB#1\k#2\to#3% {\ifdim#2\s!pt<#1\s!pt diff --git a/tex/context/base/cont-it.tex b/tex/context/base/cont-it.tex index b689a31d4..21d6418c7 100644 --- a/tex/context/base/cont-it.tex +++ b/tex/context/base/cont-it.tex @@ -22,7 +22,7 @@ \loaduserspecifications \installlanguage [\s!en] [\c!status=\v!start] -%\installlanguage [\s!uk] [\c!status=\v!start] +\installlanguage [\s!uk] [\c!status=\v!start] \installlanguage [\s!de] [\c!status=\v!start] \installlanguage [\s!fr] [\c!status=\v!start] \installlanguage [\s!es] [\c!status=\v!start] diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex index 578cbfda1..5e771da8b 100644 --- a/tex/context/base/cont-new.tex +++ b/tex/context/base/cont-new.tex @@ -17,48 +17,557 @@ %D excellent place for hacks and new features. \unprotect - + \writestatus{\m!systems}{beware: some patches loaded from cont-new.tex!} -% \layered[layer id][layer settings][framed setting]{data} -% \layered[layer id][combined settings]{data} +% \def\@@itemcounter {\s!itemcount} -> non nested continue +% +% todo : option to merge itemgroup [ig-one a b c] [ig-two d e f] + +\def\@@itemcounter {\s!itemcount\currentitemgroup} + +\def\OTRSETgotocell#1#2% not that robust + {\endgraf + \gdef\gotocellcounter{0}% + \doloop + {\ifnum\mofcolumns<#1\relax + \doglobal\increment\gotocellcounter\relax + \ifnum\gotocellcounter>#1\relax + \line{\strut}\crlf + \line{\strut}\crlf + \column + \writestatus{columnset}{quitting goto cell}% + \exitloop + \else + \column + \fi + \else + \exitloop + \fi}% + \ifnum\mofcolumns=#1\relax + \ifnum#2>1 + \scratchcounter=0 + \currenthcell\mofcolumns + \currentvcell#2\advance\currentvcell -1 + \dorecurse\currentvcell + {\OTRSETdoifcellelse\mofcolumns\recurselevel\donothing + {\advance\scratchcounter1\relax}} + \getnoflines\pagetotal + \advance\scratchcounter-\noflines + \ifnum\scratchcounter>0 + \dorecurse\scratchcounter{\line{\strut}}% + \fi + \fi + \fi + \OTRSETsetvsize} + +\def\setsidefloat% nilling everypar saves time and redudant pos's + {% removed here dec 2001 + %{\everypar\emptytoks\forgetall\vbox{\strut}\vskip-\lineheight}% + % + \kern\sidefloattopskip + \edef\presidefloatdepth{\the\prevdepth}% + \nointerlineskip + \bgroup + \everypar\emptytoks + \parskip\zeropoint + \logsidefloat + \ifrightfloat + \hfill + \ifmarginfloat +% \rlap{\hskip\rechtermargeafstand\hskip\rightskip\unhbox\floatbox}% +\rlap{\tbox{\hskip\rechtermargeafstand\hskip\rightskip\unhbox\floatbox}}% + \else + \unhbox\floatbox + \fi + \else + \noindent + \ifmarginfloat +% \llap{\unhbox\floatbox\hskip\leftskip\hskip\linkermargeafstand}% +\llap{\tbox{\unhbox\floatbox\hskip\leftskip\hskip\linkermargeafstand}}% + \else + \unhbox\floatbox + \fi + \hfill + \fi + \egroup + \par + \kern-\sidefloatheight + \penalty10001 % oeps, this will change + \normalbaselines + \prevdepth=\presidefloatdepth + %\noindent + \resetsidefloatparagraph + \ignorespaces} + + + +\def\setlocalfloatdimensions#1#2% experimental ! ! ! ! + {\doifvaluesomething{\??fl#1\c!maxbreedte} + {\scratchdimen=\getvalue{\??fl#1\c!maxbreedte}\relax + \ifdim\wd\nextbox>\scratchdimen + \setbox\nextbox=\hbox to \scratchdimen + {\doifcommonelse{\v!rechts,\v!inrechter,\v!links,\v!inlinker}{#2} + {\doifnotcommon{\v!rechts,\v!inrechter}{#2}\hss + \box\nextbox + \doifnotcommon{\v!links ,\v!inlinker }{#2}\hss}% + {\doifvalue{\??fl#1\c!plaats}\v!rechts\hss + \box\nextbox + \doifvalue{\??fl#1\c!plaats}\v!links \hss}}% + \fi}} + +\def\phantombox[#1]% + {\hbox\bgroup + \getparameters + [\??ol] + [\c!breedte=\zeropoint,\c!hoogte=\zeropoint,\c!diepte=\zeropoint,#1]% + \setbox\scratchbox\null + \wd\scratchbox\@@olbreedte + \ht\scratchbox\@@olhoogte + \dp\scratchbox\@@oldiepte + \box\scratchbox + \egroup} + +\long\@EA\def\csname\e!start\e!instellingen\endcsname#1 % + {\bgroup + \catcode`\^^M=\@@ignore + \xdostartsetups{#1}} + +\expanded + {\long\noexpand\def\noexpand\xdostartsetups##1##2\csname\e!stop\e!instellingen\endcsname% + {\egroup + \long\noexpand\setvalue{\??su##1}{##2}}} + +\def\startsetups#1 % for international purposes + {\bgroup + \catcode`\^^M=\@@ignore + \dostartsetups{#1}} + +\long\def\dostartsetups#1#2\stopsetups + {\egroup + \long\setvalue{\??su#1}{#2}} + +\def\definefont + {\dotripleempty\dodefinefont} + +\def\dodefinefont[#1][#2][#3]% [name][spec][1.6 | line=10pt | setup_id] + {\doifinstringelse{ }{#2} + {\ifthirdargument + \unexpanded\setvalue{#1}{\redodefinefont{#1}{#2}{#3}}% + \else + \unexpanded\setvalue{#1}{\dododefinefont{#1}{#2}}% + \fi} + {\definefont[#1][#2 sa 1][#3]}} + +\def\redodefinefont#1#2#3% + {\dododefinefont{#1}{#2}% + \doifnumberelse{#3} + {\stelinterliniein[#3]\stelspatieringin} + {\doifassignmentelse{#3} + {\stelinterliniein[#3]\stelspatieringin} + {\setups[#3]}}} + +% todo, but now more easy to do:\definepage + +\def\docomplexpagina[#1]% + {\flushfootnotes + \bgroup + \def\dodocomplexpagina##1% + {\csname + @@\v!pagina\ifundefined{@@\v!pagina##1}\s!unknown\else##1\fi + \endcsname}% + \processcommalist[#1]\dodocomplexpagina + \egroup} + +\def\installpagehandler#1#2% + {\setvalue{@@\v!pagina#1}{#2}} + +\installpagehandler \s!unknown + {\let\@@pagespecification\commalistelement + \doifinstringelse{+}\@@pagespecification + {\ejectinsert\ejectpage + \dorecurse\@@pagespecification\ejectdummypage} + {\doifnumberelse\@@pagespecification + {\ejectinsert\ejectpage + \doloop + {\ifnum\userpageno<\@@pagespecification\relax + \ejectdummypage + \else + \exitloop + \fi}} + {}}} + +\installpagehandler \s!default + {} % do nothing if empty + +\installpagehandler \v!reset + {\global\paginageblokkeerdfalse} + +\installpagehandler \v!blokkeer + {\global\paginageblokkeerdtrue} + +\installpagehandler \v!ja + {\ifpaginageblokkeerd\else + \ejectinsert + \ejectpage + \ifbinnenkolommen + \ejectpage % anders soms geen overgang + \fi + \fi} + +\installpagehandler \v!opmaak + {\ifpaginageblokkeerd\else + \eject + \fi} + +\installpagehandler \v!blanko + {\pagebodyornamentsfalse} + +\installpagehandler \v!nee + {\ifpaginageblokkeerd\else + \dosomebreak\nobreak + \fi} + +\installpagehandler \v!voorkeur + {\ifpaginageblokkeerd\else + \ifbinnenkolommen + \dosomebreak\goodbreak + \else + \testpagina[3][\!!zeropoint]% + \fi + \fi} + +\installpagehandler \v!grotevoorkeur + {\ifpaginageblokkeerd\else + \ifbinnenkolommen + \dosomebreak\goodbreak + \else + \testpagina[5][\!!zeropoint]% + \fi + \fi} + +\installpagehandler \v!leeg + {\ejectinsert + \ejectpage + \doifnotvalue{\??tk\v!hoofd\c!status}{\v!stop} + {\setupheader[\c!status=\v!leeg]}% + \doifnotvalue{\??tk\v!voet\c!status}{\v!stop} + {\setupfooter[\c!status=\v!leeg]}% + \ejectdummypage} + +\installpagehandler \v!links + {\ejectinsert + \superejectpage + \doifbothsidesoverruled + \orsideone + \resetcurrentsectionmarks + \ejectdummypage + \orsidetwo + \od} + +\installpagehandler \v!rechts + {\ejectinsert + \superejectpage + \doifbothsidesoverruled + \orsideone + \orsidetwo + \resetcurrentsectionmarks + \ejectdummypage + \od} + +\installpagehandler \v!even + {\pagina + \doifonevenpaginaelse + {\resetcurrentsectionmarks\ejectdummypage}{}} + +\installpagehandler \v!oneven + {\pagina + \doifonevenpaginaelse + {}{\resetcurrentsectionmarks\ejectdummypage}} + +\installpagehandler \v!viertal + {\ifdubbelzijdig + \!!counta=\realpageno + \!!countb=\realpageno + \divide\!!counta 4 + \divide\!!countb 2 + \ifnum\!!counta=\!!countb + \else + \pagina + \pagina[\v!leeg]% + \pagina[\v!leeg]% + \fi + \fi} + +\installpagehandler \v!laatste + {\ejectinsert + \superejectpage\relax + \doifbothsidesoverruled + \naastpagina + \orsideone + \orsidetwo + %\ifodd\realpageno \else % kan weer weg + \noheaderandfooterlines + \ejectdummypage + %\fi + \od + \filluparrangedpages} + +% \setlayerframed[layer id][layer settings][framed setting]{data} +% \setlayerframed[layer id][combined settings]{data} -\def\layered - {\dotripleempty\dolayered} +\def\setlayerframed + {\dotripleempty\dosetlayerframed} -\def\dolayered +\def\dosetlayerframed {\ifthirdargument - \expandafter\dolayeredT + \expandafter\dosetlayerframedT \else - \expandafter\dolayeredS - \fi} + \expandafter\dosetlayerframedS + \fi} -\def\dolayeredT[#1][#2][#3]% +\def\dosetlayerframedT[#1][#2][#3]% {\dowithnextbox{\setlayer[#1][#2]{\box\nextbox}}% - \hbox\framed[#3]} + \hbox\framed[#3]} -\def\dolayeredS[#1][#2][#3]% +\def\dosetlayerframedS[#1][#2][#3]% {\dowithnextbox {\setlayer [#1] [\c!breedte=\wd\nextbox,\c!hoogte=\ht\nextbox, \c!offset=\!!zeropoint,#2] {\box\nextbox}}% - \hbox\framed[\c!plaats=\v!normaal,#2]} + \hbox\framed[\c!plaats=\v!normaal,#2]} + +\beginETEX + +\definepapersize + [oversized] + [\c!breedte=\dimexpr(\papierbreedte+1.5cm), + \c!hoogte=\dimexpr(\papierhoogte+1.5cm)] + +\definepapersize + [doublesized] + [\c!breedte=\dimexpr(\papierbreedte), + \c!hoogte=\dimexpr(2\papierhoogte)] + +\definepapersize + [doubleoversized] + [\c!breedte=\dimexpr(\papierhoogte+1.5cm), + \c!hoogte=\dimexpr(2\papierbreedte+1.5cm)] + +\endETEX + +\def\dofield[#1][#2][#3]% + {\iffirstargument + \bgroup + \getfield{#2}% + \ifsecondargument + \def\@@FieldLabel{#3}% + \else + \let\@@FieldLabel\@@FieldName + \fi + \ifx\@@FieldType\empty + \writestatus{\m!fields}{unknown field #2}% + \else\ifcase\@@FieldFree\relax + \doifdefinedelse{\strippedcsname\setupfield\@@FieldGroup} + {\let\dosetupfield=#1\getvalue{\strippedcsname\setupfield\@@FieldGroup}} + {#1[\@@FieldName][\v!label,\v!kader,\v!horizontaal][][][]}% +\iftrialtypesetting\else + \def\@@FieldFree{1}% + \changefield{#2}% +\fi + \else\ifcase\@@FieldAuto\relax + % \writestatus{\m!fields}{field #2 already typeset}% + \else + % \writestatus{\m!fields}{field #2 automatically copied}% + \nextsystemfield + \copyfield[\@@FieldName][\currentsystemfield]% + \dotripleempty\dofield[#1][\currentsystemfield][#3]% get the if's right + \fi\fi\fi + \egroup + \fi} + +\def\typesetfield% + {\useJSscripts[fld]% + \ifx\@@FieldRoot\empty \else + \let\@@SavedFieldName\@@FieldName + \getfield\@@FieldRoot + \ifcase\@@FieldFree\relax + \dosetfieldstatus\@@FieldMode\@@FieldParent\@@FieldKids\@@FieldRoot + \dopresetrecord +\iftrialtypesetting\else + \def\@@FieldFree{1}% + \changefield\@@FieldName +\fi + \fi + \getfield\@@SavedFieldName + \fi + \ifx\@@FieldKids\empty + \donefalse + \else + \donetrue + \fi + \ifdone + \let\@@FieldParent\@@FieldName + %\addtocommalist\@@FieldParent\@@FieldKids + \appendtocommalist\@@FieldParent\@@FieldKids + \dosetfieldstatus\@@FieldMode\@@FieldParent\@@FieldKids\@@FieldRoot + \dopresetfield + \let\@@FieldMode\fieldchildmode + \fi + \dosetfieldstatus\@@FieldMode\@@FieldParent\@@FieldKids\@@FieldRoot + \dopresetfield} + +\def\dopresetfield + {\iftrialtypesetting\else\iflocation\getvalue{preset\@@FieldType field}\fi\fi} + +\def\dopresetrecord + {\iftrialtypesetting\else\iflocation\getvalue{preset\@@FieldType record}\fi\fi} + +\def\doclonefield[#1][#2][#3][#4]% parent children setupgroup values + {\ifsecondargument + \getfield{#1}% +\iftrialtypesetting\else + \ifx\@@FieldType\empty + \writestatus{\m!fields}{unknown field #1}% + \else + \let\@@FieldMode=\fieldparentmode + %\def\docommando##1{\addtocommalist{##1}\@@FieldKids}% + \def\docommando##1{\appendtocommalist{##1}\@@FieldKids}% + \processcommalist[#2]\docommando + \changefield{#1}% + \let\@@FieldAutoParent=\@@FieldAuto + \def\@@FieldParent{#1}% + \let\@@FieldKids=\empty + \let\@@FieldRoot=\empty + \let\@@FieldMode=\fieldchildmode + \def\@@FieldFree{0}% + \def\@@FieldAuto{0}% + \doifsomething{#3}{\edef\@@FieldGroup{#3}}% + \doifsomething{#4}{\edef\@@FieldValues{#4}}% + \def\docommando##1% + {\ifcase\@@FieldAutoParent\else + \setmainfieldkid{\@@FieldParent}{##1}% + \fi + \changefield{##1}}% + \processcommalist[#2]\docommando + \fi +\fi + \else + \writestatus{\m!fields}{pass parent field and clones}% + \fi} + +\def\docopyfield[#1][#2]% parent children + {\ifsecondargument + \getfield{#1}% +\iftrialtypesetting\else + \ifx\@@FieldType\empty + \writestatus{\m!fields}{unknown field #1}% + \else + \let\@@FieldMode=\fieldparentmode + %\def\docommando##1{\addtocommalist{##1}\@@FieldKids}% + \def\docommando##1{\appendtocommalist{##1}\@@FieldKids}% + \processcommalist[#2]\docommando + \changefield{#1}% + \let\@@FieldAutoParent=\@@FieldAuto + \def\@@FieldParent{#1}% + \let\@@FieldKids=\empty + \let\@@FieldRoot=\empty + \let\@@FieldMode=\fieldcopymode + \def\@@FieldFree{0}% + \def\@@FieldAuto{0}% + \def\docommando##1% + {\ifcase\@@FieldAutoParent\else + \setmainfieldkid{\@@FieldParent}{##1}% + \fi + \changefield{##1}}% + \processcommalist[#2]\docommando + \fi +\fi + \else + \writestatus{\m!fields}{pass parent field and copies}% + \fi} + + + +\newtoks\everyfirstparagraphintro +\newtoks\everynextparagraphintro + +\chardef\everyparagraphintro=0 + +\def\setupparagraphintro + {\dodoubleempty\dosetupparagraphintro} + +\def\dosetupparagraphintro[#1][#2]% + {\processallactionsinset + [#1] + [ \v!reset=>\global\chardef\everyparagraphintro=0 + \global\everyfirstparagraphintro\emptytoks + \global\everynextparagraphintro \emptytoks, + \v!eerste=>\global\chardef\everyparagraphintro=1 + \doglobal\appendtoks#2\to\everyfirstparagraphintro, + \v!volgende=>\ifcase\everyparagraphintro\global\chardef\everyparagraphintro=2\fi + \doglobal\appendtoks#2\to\everynextparagraphintro, + \v!elk=>\ifcase\everyparagraphintro\global\chardef\everyparagraphintro=2\fi + \doglobal\appendtoks#2\to\everyfirstparagraphintro + \doglobal\appendtoks#2\to\everynextparagraphintro]} + +\def\doinsertparagraphintro + {\ifcase\everyparagraphintro\relax + % no data + \or + % first data + \global\chardef\everyparagraphintro=2 + \scratchtoks\everyfirstparagraphintro + \global\everyfirstparagraphintro\emptytoks + \or + % next data + \scratchtoks\everynextparagraphintro + \fi + \the\scratchtoks} + +\def\insertparagraphintro + {\ifcase\everyparagraphintro\else\@EA\doinsertparagraphintro\fi} + +\appendtoks\insertparagraphintro\to\everypar + +%D \starttext +%D +%D \setupparagraphintro[first][\hbox to 3.5em{\tt FIRST \hss}] +%D \setupparagraphintro[first][\hbox to 3.5em{\tt TSRIF \hss}] +%D \setupparagraphintro[next] [\hbox to 3.5em{\tt NEXT \hss}] +%D \setupparagraphintro[next] [\hbox to 3.5em{\tt TXEN \hss}] +%D \setupparagraphintro[each] [\hbox to 3.0em{\tt EACH \hss}] +%D \setupparagraphintro[each] [\hbox to 3.0em{\tt HCEA \hss}] +%D +%D some paragraph \par +%D some paragraph \par +%D some paragraph \par +%D +%D \definelabel[parnumber] +%D +%D \setupparagraphintro[reset,each][\inleft{\slxx\parnumber}] +%D +%D some paragraph \par +%D some paragraph \par +%D some paragraph \par +%D +%D \stoptext \def\@@themaintextcolor{themaintextcolor} -\def\starttextcolor[#1]% +\def\starttextcolor[#1]% {\doifsomething{#1} {\bgroup - \def\stoptextcolor % also goes ok with \page after - {\let\maintextcolor\empty % this one because the top of - \stopregistercolor % page sets the color right (side - \egroup}% % effect) + \def\stoptextcolor % also goes ok with \page after + {\let\maintextcolor\empty % this one because the top of + \stopregistercolor % page sets the color right (side + \egroup}% % effect) \def\starttextcolor[##1]% {\bgroup \definecolor[\@@themaintextcolor][##1]% - \let\stoptextcolor\relax\egroup}% + \let\stoptextcolor\egroup}% \startregistercolor[\@@themaintextcolor]% \definecolor[\@@themaintextcolor][#1]% \let\maintextcolor\@@themaintextcolor}} @@ -71,7 +580,7 @@ \doinitializemaintextcolor}} \def\doinitializemaintextcolor - {\appendtoks\starttextcolor[\@@themaintextcolor]\to\everystarttext + {\appendtoks\starttextcolor[\@@themaintextcolor]\to\everystarttext \appendtoks\stoptextcolor \to\everystoptext \let\doinitializemaintextcolor\relax} @@ -256,11 +765,80 @@ {\def\currentvariableclass{#1}% \getparameters[vars:#1:][#2]} -\def\getvariable#1#2% - {\ifundefined{vars:#1:#2}\else\getvalue{vars:#1:#2}\fi} +% \def\getvariable#1#2% +% {\ifundefined{vars:#1:#2}\else\getvalue{vars:#1:#2}\fi} + +\def\getvariable#1#2% to be sped up + {\csname\ifundefined{vars:#1:#2}empty\else vars:#1:#2\fi\endcsname} \let\currentvariableclass\empty +% Let's see how fast Mr Bigfoot aka GB tracks down this new +% feature -) + +\def\defineTABLEdivisions + {\global\TABLEdivisionfalse % in start + \let\DL\TableDL + \let\DC\TableDC + \let\DV\TableDV + \let\DR\TableDR} + +\def\defineTABLErules + {\let\VL\TableVL + \let\VC\TableVC + \let\HL\TableHL + \let\HC\TableHC + \let\VS\TableVS + \let\VD\TableVD + \let\VT\TableVT} + +\def\TableVS{\gdef\@VLn{1}\VL} +\def\TableVD{\gdef\@VLn{2}\VL} +\def\TableVT{\gdef\@VLn{3}\VL} + +\def\@VLn{1} +\def\@VLd{.125em} + +\def\do!ttInsertVrule % will be merged in 2005 + {\vrule \!thWidth + \ifnum\!tgCode=1 + \ifx\!tgValue\empty + \LineThicknessFactor + \else + \!tgValue + \fi + \LineThicknessUnit + \else + \!tgValue + \fi + \hskip\@VLd} + +\def\!ttInsertVrule% + {\hfil + \TABLEbeforebar % added + \startglobalTABLEcolor % added + % we could do without this speedup, some day merge 'm + \ifcase\@VLn\or + \do!ttInsertVrule + \unskip + \else + \dorecurse\@VLn\do!ttInsertVrule + \gdef\@VLn{1}% + \unskip + \fi + \stopglobalTABLEcolor % added + \TABLEafterbar % added + \hfil + &} + +%D \starttable[|||] +%D \HL +%D \VL test \VS test \VL \FR +%D \VL test \VD test \VL \MR +%D \VL test \VT test \VL \LR +%D \HL +%D \stoptable + %D To be documented, \type {\includemenu[menu]}. %D To be documented, \type {\emphbf} cum suis. @@ -331,6 +909,8 @@ % already taken care of: \definesystemvariable{ks} +% is buggy now and does not work any longer + \def\setupcolumnspan[#1]% {\getparameters[\??ks][#1]} @@ -384,6 +964,7 @@ \else \snaptogrid\vbox{\box\columnspanbox} \fi + \endgraf \prevdepth\dp\strutbox \egroup} \vbox\bgroup diff --git a/tex/context/base/cont-sys.ori b/tex/context/base/cont-sys.ori index a571c8c60..7ea324ae3 100644 --- a/tex/context/base/cont-sys.ori +++ b/tex/context/base/cont-sys.ori @@ -94,6 +94,7 @@ % \runMPgraphicstrue % \runMPTEXgraphicstrue + % \recycleMPslotstrue % This saves some runtime, but needs a format, which you can diff --git a/tex/context/base/cont-sys.tex b/tex/context/base/cont-sys.tex index 7eb75f86d..c39daf8b6 100644 --- a/tex/context/base/cont-sys.tex +++ b/tex/context/base/cont-sys.tex @@ -22,7 +22,7 @@ % % You can let \CONTEXT\ load the map files for \PDFTEX. % -\autoloadmapfilestrue +% \autoloadmapfilestrue % % If you use the more verbose naming scheme, uncomment this: % @@ -94,6 +94,7 @@ \runMPgraphicstrue \runMPTEXgraphicstrue + \recycleMPslotstrue % This saves some runtime, but needs a format, which you can @@ -120,4 +121,3 @@ % So far. \protect \endinput - diff --git a/tex/context/base/cont-usr.ori b/tex/context/base/cont-usr.ori index 38dbab706..f70072c9a 100644 --- a/tex/context/base/cont-usr.ori +++ b/tex/context/base/cont-usr.ori @@ -70,7 +70,8 @@ \installlanguage [\s!cz] [\s!mapping={il2,ec},\s!encoding={il2,ec}] \installlanguage [\s!hr] [\s!mapping={il2,ec},\s!encoding={il2,ec}] -\installlanguage [\s!pl] [\s!mapping=pl0,\s!encoding=pl0] +%installlanguage [\s!pl] [\s!mapping=pl0,\s!encoding=pl0] +\installlanguage [\s!pl] [\s!mapping={pl0,ec},\s!encoding={pl0,ec}] \installlanguage [\s!sk] [\s!mapping={il2,ec},\s!encoding={il2,ec}] %D Sometimes these are not wanted: diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex index cbf62363b..c8bba2123 100644 --- a/tex/context/base/context.tex +++ b/tex/context/base/context.tex @@ -15,7 +15,7 @@ \catcode`\{=1 \catcode`\}=2 -\def\contextversion{2002.1.24} +\def\contextversion{2002.3.4} %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-des.tex b/tex/context/base/core-des.tex index 1d4ef327a..064c13144 100644 --- a/tex/context/base/core-des.tex +++ b/tex/context/base/core-des.tex @@ -713,22 +713,57 @@ \def\doorspringen% {\dodoubleargumentwithset\dodoorspringen} +% \def\dodoorlabel[#1][#2]% +% {\getvalue{\s!number#1\c!voor}% +% \bgroup +% \doifvalue{\s!number#1\c!plaats}{\v!marge} +% {\setvalue{\s!number#1\c!plaats}{\v!inmarge}}% +% \doattributes{\s!number#1}\c!kopletter\c!kopkleur +% {\getvalue{\e!volgende#1}[#2]}% +% \egroup +% \getvalue{\s!number#1\c!na}}% +% +% \def\dovolgendedoorlabel[#1][#2]% +% {\volgendenummer[#1][\s!lab][#2]} +% +% \def\dodoorlabelen[#1][#2]% +% {\definieernummer +% [#1][\c!voor=,\c!na=,\c!kopletter=,\c!wijze=\@@nrwijze,#2]% +% \setvalue {#1}{\dodoubleempty\dodoorlabel[#1]}% +% \setvalue{\s!reset #1}{\resetnummer[#1]}% +% \setvalue{\e!verhoog #1}{\verhoognummer[#1]}% +% \setvalue{\e!volgende#1}{\dodoubleempty\dovolgendedoorlabel[#1]}% +% \setvalue{\c!huidige #1}{\huidigenummer[#1]}} +% +% \def\doorlabelen% +% {\dodoubleargumentwithset\dodoorlabelen} + \def\dodoorlabel[#1][#2]% - {\getvalue{\s!number#1\c!voor}% - \bgroup - \doifvalue{\s!number#1\c!plaats}{\v!marge} - {\setvalue{\s!number#1\c!plaats}{\v!inmarge}}% - \doattributes{\s!number#1}\c!kopletter\c!kopkleur - {\getvalue{\e!volgende#1}[#2]}% - \egroup - \getvalue{\s!number#1\c!na}}% + {\getvalue{\??lb#1\c!voor}% + \getvalue{\??lb#1\c!commando}% + {\doattributes{\??lb#1}\c!kopletter\c!kopkleur + {\dotextprefix{\getvalue{\??lb#1\c!tekst}}% + \getvalue{\e!volgende#1}[#2]}}% + \getvalue{\??lb#1\c!na}}% \def\dovolgendedoorlabel[#1][#2]% {\volgendenummer[#1][\s!lab][#2]} \def\dodoorlabelen[#1][#2]% - {\definieernummer - [#1][\c!voor=,\c!na=,\c!kopletter=,\c!wijze=\@@nrwijze,#2]% + {\getparameters + [\??lb#1] + [\c!wijze=\@@nrwijze,\c!commando=,\c!plaats=,#2]% + % downward compatible + \processaction + [\getvalue{\??lb#1\c!plaats}] + [ \v!inmarge=>\setvalue{\??lb#1\c!commando}{\inmarge }, + \v!inlinker=>\setvalue{\??lb#1\c!commando}{\inlinker }, + \v!inrechter=>\setvalue{\??lb#1\c!commando}{\inrechter}, + \v!marge=>\setvalue{\??lb#1\c!commando}{\inmarge }]% + % inefficient, we need to redesign this command + \definieernummer + [#1][\c!wijze=\@@nrwijze]% \getvalue{\??lb#1\c!wijze}]% + % generated commands \setvalue {#1}{\dodoubleempty\dodoorlabel[#1]}% \setvalue{\s!reset #1}{\resetnummer[#1]}% \setvalue{\e!verhoog #1}{\verhoognummer[#1]}% diff --git a/tex/context/base/core-fig.tex b/tex/context/base/core-fig.tex index fa6db84d8..2316691cd 100644 --- a/tex/context/base/core-fig.tex +++ b/tex/context/base/core-fig.tex @@ -1763,20 +1763,26 @@ %D Todo: like external figures, also search on path, %D although, they need to be present ar viewing time, so ... -\def\useexternalsoundtrack% +\def\useexternalsoundtrack {\dodoubleargument\douseexternalsoundtrack} \def\douseexternalsoundtrack[#1][#2]% - {\setgvalue{\??sd#1}{#2}} + {\setgvalue{\??sd:#1}{#2}} \def\checksoundtrack#1% {\iflocation - \doifdefined{\??sd#1}{\doifvaluesomething{\??sd#1} - {\doinsertsoundtrack{\getvalue{\??sd#1}}{#1}{}% - \setgvalue{\??sd#1}{}}}% + \doifdefined{\??sd:#1}{\doifvaluesomething{\??sd:#1} + {\doinsertsoundtrack{\getvalue{\??sd:#1}}{#1}\@@sdoptie + \setgvalue{\??sd:#1}{}}}% \fi} \setexecutecommandcheck {startsound} \checksoundtrack + +\def\setupexternalsoundtracks + {\dodoubleargument\getparameters[\??sd]} + +\setupexternalsoundtracks + [\c!optie=] \appendtoks \setupexternalfigures[\c!optie=\v!leeg] \to \everyfastmode \appendtoks \runMPgraphicsfalse \to \everyfastmode diff --git a/tex/context/base/core-fld.tex b/tex/context/base/core-fld.tex index 806f6af44..93fa01d61 100644 --- a/tex/context/base/core-fld.tex +++ b/tex/context/base/core-fld.tex @@ -607,9 +607,9 @@ \def\@@FieldFree{1}% \changefield{#2}% \else\ifcase\@@FieldAuto\relax - \writestatus{\m!fields}{field #2 already typeset}% + % \writestatus{\m!fields}{field #2 already typeset}% \else - \writestatus{\m!fields}{field #2 automatically copied}% + % \writestatus{\m!fields}{field #2 automatically copied}% \nextsystemfield \copyfield[\@@FieldName][\currentsystemfield]% \dotripleempty\dofield[#1][\currentsystemfield][#3]% get the if's right diff --git a/tex/context/base/core-grd.tex b/tex/context/base/core-grd.tex index 0d179ed7a..22a392bc2 100644 --- a/tex/context/base/core-grd.tex +++ b/tex/context/base/core-grd.tex @@ -268,7 +268,11 @@ \newif\iftracegridsnapping \newif\ifshowfuzzyskips -\chardef\@@alignsnap=0 +\chardef\@@alignsnap =0 +\chardef\@@alignsnapbox=0 + +\let\presnapskip \!!zeropoint \def\presnap {--} +\let\postsnapskip\!!zeropoint \let\postsnap\presnap \def\tracesnapping% {\iftracegridsnapping @@ -291,103 +295,226 @@ \def\dosnaptogrid[#1]% {\ifgridsnapping - \iffirstargument\verplaatsopgrid[#1]\fi\expandafter\dodosnaptogrid + \iffirstargument\doifsomething{#1}{\verplaatsopgrid[#1]}\fi + \expandafter\dodosnaptogrid \fi} -\def\dodosnaptogrid% +% \def\dodosnaptogrid% +% {\dowithnextbox +% {\bgroup +% \ifcase\@@alignsnap\else % 1=top 2=high 3=middle 4=low +% \getnoflines{\ht\nextbox} +% \setbox\nextbox=\vbox to \noflines\lineheight +% {\ifnum\@@alignsnap=1 \kern\lineheight\kern-\topskip\fi +% \ifnum\@@alignsnap>2 \vfill\fi +% \box\nextbox +% \ifnum\@@alignsnap<4 \vfill\fi} +% \fi +% \forgetall +% \par +% \ifvbox\nextbox +% \setbox\nextbox=\hbox{\box\nextbox}% don't ask +% \fi +% \scratchskip=\lastskip +% \edef\presnapskip{\the\lastskip}% +% % mixing single/double columns sometimes goes wrong, +% % check 'som' document +% \ifbinnenkolommen +% \forcepresnaptrue +% \fi +% \ifforcepresnap +% \vbox{\hsize\zeropoint\strut}\nobreak\vskip-\openlineheight +% \fi +% % +% \ifdim\ht\nextbox>\ht\strutbox +% \scratchdimen=\ht\nextbox +% \ifcase\@@presnap +% \ifdim\scratchskip>\zeropoint\relax +% \scratchcounter=\scratchskip +% \advance\scratchcounter by -\openlineheight +% \ifnum\scratchcounter<0 +% \scratchcounter=-\scratchcounter +% \fi +% \ifnum\scratchcounter<10 % \lastkip is about \openlineheight +% \advance\scratchdimen by -\openstrutdepth +% \edef\presnapskip{*\presnapskip}% +% \else\ifdim\scratchskip>\openlineheight +% %<\openlineheight \else +% \advance\scratchdimen by -\openstrutdepth +% \edef\presnapskip{*\presnapskip}% +% \fi\fi +% \fi +% \fi +% \getnoflines\scratchdimen +% \advance\noflines by -1 +% \ifnum\noflines>0 +% \scratchdimen=\noflines\lineheight +% \else +% \scratchdimen=\zeropoint +% \fi +% \else +% \scratchdimen=\zeropoint +% \fi +% \ifnum\@@extrasnap=1 \advance\scratchdimen by \extrasnapsign\lineheight \fi +% \ifnum\@@extrasnap=2 \advance\scratchdimen by \extrasnapsign.5\lineheight \fi +% \edef\presnap{\the\scratchdimen}% +% \ifstrutsnapping +% \ifdim\scratchdimen=\zeropoint\else\vskip\scratchdimen\fi +% \fi +% \ifdim\dp\nextbox>\dp\strutbox +% \getnoflines{\dp\nextbox}% +% \advance\noflines by -1 +% \ifnum\noflines>0 +% \scratchdimen=\noflines\lineheight +% \else +% \scratchdimen=\zeropoint +% \fi +% \else +% \scratchdimen=\zeropoint +% \fi +% \ifnum\@@extrasnap=2 \advance\scratchdimen by \extrasnapsign.5\lineheight \fi +% \ifnum\@@extrasnap=3 \advance\scratchdimen by \extrasnapsign\lineheight \fi +% \edef\postsnap{\the\scratchdimen}% +% \ifstrutsnapping +% \ht\nextbox=\ht\strutbox +% \dp\nextbox=\dp\strutbox +% \else +% \scratchdimen=\presnap +% \advance\scratchdimen by \ht\strutbox +% \ht\nextbox=\scratchdimen +% \scratchdimen=\postsnap +% \advance\scratchdimen by \dp\strutbox +% \dp\nextbox=\scratchdimen +% \fi +% \hbox{\tracesnapping\box\nextbox}% +% \ifstrutsnapping +% \ifdim\scratchdimen=\zeropoint\else\vskip\scratchdimen\fi +% \fi +% \extrasnapreset +% \enablepresnapcorrection +% \global\chardef\@@alignsnap0 +% \egroup}} + +\def\dodosnaptogrid {\dowithnextbox {\bgroup - \ifcase\@@alignsnap\else % 1=top 2=high 3=middle 4=low - \getnoflines{\ht\nextbox} - \setbox\nextbox=\vbox to \noflines\lineheight - {\ifnum\@@alignsnap=1 \kern\lineheight\kern-\topskip\fi - \ifnum\@@alignsnap>2 \vfill\fi - \box\nextbox - \ifnum\@@alignsnap<4 \vfill\fi} - \fi - \forgetall - \par - \ifvbox\nextbox - \setbox\nextbox=\hbox{\box\nextbox}% don't ask - \fi - \scratchskip=\lastskip - \edef\presnapskip{\the\lastskip}% - % mixing single/double columns sometimes goes wrong, - % check 'som' document - \ifbinnenkolommen - \forcepresnaptrue - \fi - \ifforcepresnap - \vbox{\hsize\zeropoint\strut}\nobreak\vskip-\openlineheight - \fi - % - \ifdim\ht\nextbox>\ht\strutbox - \scratchdimen=\ht\nextbox - \ifcase\@@presnap - \ifdim\scratchskip>\zeropoint\relax - \scratchcounter=\scratchskip - \advance\scratchcounter by -\openlineheight - \ifnum\scratchcounter<0 - \scratchcounter=-\scratchcounter + \ifcase\@@alignsnapbox\relax + \ifcase\@@alignsnap\else % 1=top 2=high 3=middle 4=low + \getnoflines{\ht\nextbox} + \setbox\nextbox\vbox to \noflines\lineheight + {\ifnum\@@alignsnap=1 \kern\lineheight\kern-\topskip\fi + \ifnum\@@alignsnap>2 \vfill\fi + \box\nextbox + \ifnum\@@alignsnap<4 \vfill\fi} + \fi + \forgetall + \par + \ifvbox\nextbox + \setbox\nextbox\hbox{\box\nextbox}% don't ask + \fi + \scratchskip\lastskip + \edef\presnapskip{\the\lastskip}% + % mixing single/double columns sometimes goes wrong, + % check 'som' document + \ifbinnenkolommen + \forcepresnaptrue + \fi + \ifforcepresnap + \vbox{\hsize\zeropoint\strut}\nobreak\vskip-\openlineheight + \fi + % + \ifdim\ht\nextbox>\ht\strutbox + \scratchdimen\ht\nextbox + \ifcase\@@presnap + \ifdim\scratchskip>\zeropoint\relax + \scratchcounter\scratchskip + \advance\scratchcounter -\openlineheight + \ifnum\scratchcounter<0 + \scratchcounter-\scratchcounter + \fi + \ifnum\scratchcounter<10 % \lastkip is about \openlineheight + \advance\scratchdimen -\openstrutdepth + \edef\presnapskip{*\presnapskip}% + \else\ifdim\scratchskip>\openlineheight + %<\openlineheight \else + \advance\scratchdimen -\openstrutdepth + \edef\presnapskip{*\presnapskip}% + \fi\fi \fi - \ifnum\scratchcounter<10 % \lastkip is about \openlineheight - \advance\scratchdimen by -\openstrutdepth - \edef\presnapskip{*\presnapskip}% - \else\ifdim\scratchskip>\openlineheight - %<\openlineheight \else - \advance\scratchdimen by -\openstrutdepth - \edef\presnapskip{*\presnapskip}% - \fi\fi \fi + \getnoflines\scratchdimen + \advance\noflines -1 + \ifnum\noflines>0 + \scratchdimen\noflines\lineheight + \else + \scratchdimen\zeropoint + \fi + \else + \scratchdimen\zeropoint \fi - \getnoflines\scratchdimen - \advance\noflines by -1 - \ifnum\noflines>0 - \scratchdimen=\noflines\lineheight + \ifnum\@@extrasnap=1 \advance\scratchdimen \extrasnapsign\lineheight \fi + \ifnum\@@extrasnap=2 \advance\scratchdimen \extrasnapsign.5\lineheight \fi + \edef\presnap{\the\scratchdimen}% + \ifstrutsnapping + \ifdim\scratchdimen=\zeropoint\else\vskip\scratchdimen\fi + \fi + \ifdim\dp\nextbox>\dp\strutbox + \getnoflines{\dp\nextbox}% + \advance\noflines -1 + \ifnum\noflines>0 + \scratchdimen\noflines\lineheight + \else + \scratchdimen\zeropoint + \fi \else - \scratchdimen=\zeropoint + \scratchdimen\zeropoint \fi - \else - \scratchdimen=\zeropoint - \fi - \ifnum\@@extrasnap=1 \advance\scratchdimen by \extrasnapsign\lineheight \fi - \ifnum\@@extrasnap=2 \advance\scratchdimen by \extrasnapsign.5\lineheight \fi - \edef\presnap{\the\scratchdimen}% - \ifstrutsnapping - \ifdim\scratchdimen=\zeropoint\else\vskip\scratchdimen\fi - \fi - \ifdim\dp\nextbox>\dp\strutbox - \getnoflines{\dp\nextbox}% - \advance\noflines by -1 - \ifnum\noflines>0 - \scratchdimen=\noflines\lineheight + \ifnum\@@extrasnap=2 \advance\scratchdimen \extrasnapsign.5\lineheight \fi + \ifnum\@@extrasnap=3 \advance\scratchdimen \extrasnapsign\lineheight \fi + \edef\postsnap{\the\scratchdimen}% + \ifstrutsnapping + \ht\nextbox\ht\strutbox + \dp\nextbox\dp\strutbox \else - \scratchdimen=\zeropoint + \scratchdimen\presnap + \advance\scratchdimen \ht\strutbox + \ht\nextbox\scratchdimen + \scratchdimen\postsnap + \advance\scratchdimen \dp\strutbox + \dp\nextbox\scratchdimen + \fi + \hbox{\tracesnapping\box\nextbox}% + \ifstrutsnapping + \ifdim\scratchdimen=\zeropoint\else\vskip\scratchdimen\fi \fi \else - \scratchdimen=\zeropoint - \fi - \ifnum\@@extrasnap=2 \advance\scratchdimen by \extrasnapsign.5\lineheight \fi - \ifnum\@@extrasnap=3 \advance\scratchdimen by \extrasnapsign\lineheight \fi - \edef\postsnap{\the\scratchdimen}% - \ifstrutsnapping - \ht\nextbox=\ht\strutbox - \dp\nextbox=\dp\strutbox - \else - \scratchdimen=\presnap - \advance\scratchdimen by \ht\strutbox - \ht\nextbox=\scratchdimen - \scratchdimen=\postsnap - \advance\scratchdimen by \dp\strutbox - \dp\nextbox=\scratchdimen - \fi - \hbox{\tracesnapping\box\nextbox}% - \ifstrutsnapping - \ifdim\scratchdimen=\zeropoint\else\vskip\scratchdimen\fi + \scratchdimen\ht\nextbox + %\advance\scratchdimen\dp\nextbox % add dp as option + \ifcase\@@alignsnapbox\or + \getrawnoflines\scratchdimen + \else + \getnoflines \scratchdimen + \fi + \scratchdimen\noflines\lineheight\relax + \ifnum\pagetotal>\zeropoint\else % disable this as option + \advance\scratchdimen-\strutheight + \advance\scratchdimen+\topskip + \fi + \setbox\nextbox\vbox to \scratchdimen + {\ifnum\@@alignsnapbox>2 \vfill\fi % 3 4 + \box\nextbox + \ifnum\@@alignsnapbox<4 \vfill\fi % 2 3 + \kern\zeropoint}% + \ifnum\@@alignsnapbox>2 \def\presnap {++}\fi + \ifnum\@@alignsnapbox<4 \def\postsnap{++}\fi + \setbox\nextbox\hbox{\tracesnapping\box\nextbox}% + \dp\nextbox\zeropoint + \box\nextbox \fi \extrasnapreset \enablepresnapcorrection \global\chardef\@@alignsnap0 + \global\chardef\@@alignsnapbox0 \egroup}} \def\snaptomathgrid% probably not working ok @@ -480,11 +607,32 @@ \def\gridwarning#1{\message{[beware of #1 extra snap]}} -\def\doverplaatsopgrid[#1]% +% \def\doverplaatsopgrid[#1]% +% {\ifgridsnapping +% \global\chardef\@@alignsnap0 +% \processaction +% [#1] +% [ \v!boven=>\gridwarning+\positiveextrasnap\extrasnapbefore, +% \v!onder=>\gridwarning+\positiveextrasnap\extrasnapafter, +% \v!beide=>\positiveextrasnap\extrasnaparound, +% -\v!boven=>\gridwarning-\negativeextrasnap\extrasnapbefore, +% -\v!onder=>\gridwarning-\negativeextrasnap\extrasnapafter, +% -\v!beide=>\negativeextrasnap\extrasnaparound, +% \v!pagina=>\global\chardef\@@alignsnap1, % topskip +% \v!hoog=>\global\chardef\@@alignsnap2, +% \v!midden=>\global\chardef\@@alignsnap3, +% \v!laag=>\global\chardef\@@alignsnap4, +% \v!reset=>\positiveextrasnap\extrasnapreset, +% \s!default=>\positiveextrasnap\extrasnaparound, +% \s!unknown=>\positiveextrasnap\extrasnapreset]% +% \fi} + +\def\doverplaatsopgrid[#1]% some day : speed up {\ifgridsnapping - \global\chardef\@@alignsnap0 - \processaction - [#1] + \global\chardef\@@alignsnap0 + \global\chardef\@@alignsnapbox0 + \donefalse + \ExpandFirstAfter\processallactionsinset[#1] [ \v!boven=>\gridwarning+\positiveextrasnap\extrasnapbefore, \v!onder=>\gridwarning+\positiveextrasnap\extrasnapafter, \v!beide=>\positiveextrasnap\extrasnaparound, @@ -495,7 +643,12 @@ \v!hoog=>\global\chardef\@@alignsnap2, \v!midden=>\global\chardef\@@alignsnap3, \v!laag=>\global\chardef\@@alignsnap4, + \v!passend=>\global\chardef\@@alignsnapbox1, % new + \v!ruim=>\global\chardef\@@alignsnapbox2, % new \v!reset=>\positiveextrasnap\extrasnapreset, + \v!geen=>\global\chardef\@@alignsnap0 + \global\chardef\@@alignsnapbox0, + \v!standaard=>\positiveextrasnap\extrasnaparound, \s!default=>\positiveextrasnap\extrasnaparound, \s!unknown=>\positiveextrasnap\extrasnapreset]% \fi} diff --git a/tex/context/base/core-int.tex b/tex/context/base/core-int.tex index eeb0a44b2..e030b612d 100644 --- a/tex/context/base/core-int.tex +++ b/tex/context/base/core-int.tex @@ -2527,17 +2527,21 @@ \def\plaatsboventekstblok {\vbox to \bovenhoogte {\vsize\bovenhoogte - \getvalue{\??tk\v!boven\v!tekst\c!voor} +% \getvalue{\??tk\v!boven\v!tekst\c!voor} + \getvalue{\??tk\v!boven\c!voor} \interactiemenus[\v!boven] - \getvalue{\??tk\v!boven\v!tekst\c!na} +% \getvalue{\??tk\v!boven\v!tekst\c!na} + \getvalue{\??tk\v!boven\c!na} \kern\zeropoint}} \def\plaatsondertekstblok {\vbox to \onderhoogte {\vsize\onderhoogte - \getvalue{\??tk\v!onder\v!tekst\c!voor} +% \getvalue{\??tk\v!onder\v!tekst\c!voor} + \getvalue{\??tk\v!onder\c!voor} \interactiemenus[\v!onder] - \getvalue{\??tk\v!onder\v!tekst\c!na} +% \getvalue{\??tk\v!onder\v!tekst\c!na} + \getvalue{\??tk\v!onder\c!na} \kern\zeropoint}} \ifx\leftedgetextcontent\undefined \else @@ -2588,7 +2592,9 @@ \c!kader=\v!aan, \c!achtergrond=, \c!achtergrondraster=\@@rsraster, - \c!achtergrondkleur=] + \c!achtergrondkleur=, + \c!zelfdepagina=\v!ja, + \c!onbekendeverwijzing=\v!ja] \stelsynchronisatiebalkin [\c!variant=\v!pagina, diff --git a/tex/context/base/core-itm.tex b/tex/context/base/core-itm.tex index 6eb40f6c5..059ef7d33 100644 --- a/tex/context/base/core-itm.tex +++ b/tex/context/base/core-itm.tex @@ -70,7 +70,7 @@ \let\currentitemgroup\empty -\def\itemreferences{0} +\def\unknownitemreference{0} \let\itemreferences\unknownitemreference % #1=level #2=parameter diff --git a/tex/context/base/core-job.tex b/tex/context/base/core-job.tex index 0e0b13532..443cdf12b 100644 --- a/tex/context/base/core-job.tex +++ b/tex/context/base/core-job.tex @@ -166,7 +166,7 @@ %appendtoks \checkutilityfile \to \everyjob % obsolete \appendtoks \openutilities \to \everyjob \appendtoks \loadoptionfile \to \everyjob -\appendtoks \loadtwopassdata \to \everyjob +%appendtoks \loadtwopassdata \to \everyjob \appendtoks \setupfootnotes \to \everyjob % depends on bodyfont \appendtoks \initializeMPgraphics \to \everyjob % after loading system files @@ -181,7 +181,9 @@ \appendtoks \stopcopyingblocks \to \everygoodbye \appendtoks \closespecialfile \to \everygoodbye -\appendtoks \checkreferences \to \everystarttext % nieuw 4-12-1999 +\prependtoks \resetutilities \to \everystarttext % moved 28-02-2002 +\prependtoks \loadtwopassdata \to \everystarttext % moved 28-02-2002 +\appendtoks \checkreferences \to \everystarttext % new 04-12-1999 \def\doateverystarttext% {\the\everystarttext @@ -237,9 +239,12 @@ {\def\startomgeving ##1 {}% \let\stopomgeving\relax \startreadingfile - \processfile{#1}% \readlocfile{#1}{}{}% + \processfile{#1}% was : \readlocfile{#1}{}{} \stopreadingfile} +\def\onderdeel #1 % at outermost level only + {\processfile{#1}} + \def\environment{\omgeving} % for the moment, no \let ! \newcounter\filelevel @@ -349,9 +354,6 @@ % Het <pagina>-karakter (FormFeed), wordt omgezet in \par -\edef\oldlinefeed{\the\catcode`\^^L} - -\catcode`\^^L=\oldlinefeed \catcode`\^^L=\@@endofline % NOT TOEVOEGEN: \the\everytrace diff --git a/tex/context/base/core-mar.tex b/tex/context/base/core-mar.tex index ab1207c42..4768caefe 100644 --- a/tex/context/base/core-mar.tex +++ b/tex/context/base/core-mar.tex @@ -77,10 +77,12 @@ \def\stelmarkeringin% {\dodoubleargument\dostelmarkeringin} -\letvalue{\??mk \v!vorige}\gettopmark -\letvalue{\??mk \v!eerste}\getfirstmark -\letvalue{\??mk\v!laatste}\getbotmark -\letvalue{\??mk\v!huidige}\getcurrentmark +% betere protectie + +\letvalue{\??mk\??mk \v!vorige}\gettopmark +\letvalue{\??mk\??mk \v!eerste}\getfirstmark +\letvalue{\??mk\??mk\v!laatste}\getbotmark +\letvalue{\??mk\??mk\v!huidige}\getcurrentmark \def\dododefinieermarkering[#1][#2]% {\stelmarkeringin[#1] @@ -102,25 +104,15 @@ \let\geenmarkering=\relax -%\def\fetchmark[#1][#2]% geen \def, anders problemen in \doif... -% {\def\dofetchmark{\csname\??mk#2\endcsname}% -% \expandafter\dofetchmark\csname\??mk\hoofdmarkering{#1}\endcsname} - -%\def\dofetchmark#1#2% needed because we need to expand -% {\csname\??mk#2\endcsname#1} -% -%\def\fetchmark[#1][#2]% never \unexpanded -% {\expandafter\dofetchmark\csname\??mk\hoofdmarkering{#1}\endcsname{#2}} - \def\fetchmark[#1][#2]% never \unexpanded - {\@EA\@EA\csname\??mk#2\endcsname + {\@EA\@EA\csname\??mk\??mk#2\endcsname \csname\??mk\hoofdmarkering{#1}\endcsname} \beginTEX \def\fetchmark[#1][#2]% never \unexpanded {\@EA\ifx\csname\??mk#1\c!koppeling\endcsname\else - \@EA\@EA\csname\??mk#2\endcsname + \@EA\@EA\csname\??mk\??mk#2\endcsname \csname\??mk\csname\??mk#1\c!koppeling\endcsname\endcsname \fi} @@ -130,7 +122,7 @@ \def\fetchmark[#1][#2]% never \unexpanded {\ifcsname\??mk#1\c!koppeling\endcsname - \@EA\@EA\csname\??mk#2\endcsname + \@EA\@EA\csname\??mk\??mk#2\endcsname \csname\??mk\csname\??mk#1\c!koppeling\endcsname\endcsname \fi} @@ -159,8 +151,8 @@ [#2] [ \v!beide=>{\fetchtwomarks[#1]}, \v!alles=>{\fetchallmarks[#1]}, - \s!default=>{\fetchmark[#1][\v!eerste]}, - \s!unknown=>{\fetchmark[#1][#2]}]% + \s!default=>{\fetchmark [#1][\v!eerste]}, + \s!unknown=>{\fetchmark [#1][#2]}]% \egroup}} \def\nohaalmarkering[#1][#2]% diff --git a/tex/context/base/core-mis.tex b/tex/context/base/core-mis.tex index 3b27f592c..b35bad64d 100644 --- a/tex/context/base/core-mis.tex +++ b/tex/context/base/core-mis.tex @@ -510,10 +510,12 @@ \def\breuk#1#2% {\mathematics{#1\over#2}} -%\def\bedrag#1% -% {\mathematics{f~}\hbox{#1}} +% \def\bedrag#1% +% {\mathematics{f~}\hbox{#1}} -\def\bedragprefix{\mathematics{f\normalfixedspace}} +% \def\bedragprefix{\mathematics{f\normalfixedspace}} + +\def\bedragprefix{\euro\normalfixedspace} \def\bedragsuffix{} \def\bedrag#1% diff --git a/tex/context/base/core-pos.tex b/tex/context/base/core-pos.tex index 65773bcf4..f833a09ed 100644 --- a/tex/context/base/core-pos.tex +++ b/tex/context/base/core-pos.tex @@ -1497,10 +1497,10 @@ % so far \setbox#1=\hbox {\setposition{\s!margin:\currentmarginpos}\raise\scratchdimen\box#1}% - \dp#1=\!!zeropoint - \ht#1=\!!zeropoint + \dp#1=\zeropoint + \ht#1=\zeropoint \fi - \vadjust{\box#1}% + \graphicvadjust{\box#1}% \egroup} %D For a right menu, a sequence of calls to \type diff --git a/tex/context/base/core-rul.tex b/tex/context/base/core-rul.tex index d04f34c8d..f84808242 100644 --- a/tex/context/base/core-rul.tex +++ b/tex/context/base/core-rul.tex @@ -640,8 +640,9 @@ {\copyparameters[#1][#3]% [\c!breedte,\c!hoogte,\c!offset,\c!leeg,\c!lijndikte,% \c!straal,\c!hoek,\c!diepte,\c!kader,\c!kaderkleur,% + \c!voorgrondletter,\c!voorgrondkleur,% \c!bovenkader,\c!onderkader,\c!linkerkader,\c!rechterkader,% - \c!lijndikte,\c!kaderoffset,\c!voorgrondkleur,\c!achtergrond,% + \c!lijndikte,\c!kaderoffset,\c!achtergrond,% \c!achtergrondoffset,\c!achtergrondraster,\c!achtergrondkleur,% \c!uitlijnen,\c!onder,\c!boven,\c!strut,\c!plaats]% \copyparameters[#1\c!achtergrond][#1]% @@ -705,6 +706,9 @@ \ifsecondargument % faster \getparameters[\@@framed][#2]% here ! \fi + % to get the right spacing + \doifvaluesomething{\@@framed\c!voorgrondletter} + {\@EA\doconvertfont\csname\@@framed\c!voorgrondletter\endcsname\empty}% % beware, both the frame and background offset can be overruled \edef\localoffset{\getvalue{\@@framed\c!offset}}% \edef\localwidth{\getvalue{\@@framed\c!breedte}}% @@ -2313,6 +2317,7 @@ \c!straal=.5\bodyfontsize, \c!hoek=\v!recht, \c!voorgrondkleur=, + \c!voorgrondletter=, \c!achtergrond=, \c!achtergrondkleur=, \c!achtergrondraster=\@@rsraster, @@ -2381,52 +2386,111 @@ \ifx\checkframedtext\undefined \let\checkframedtext\relax \fi +% \def\dododostartframedtext[#1][#2][#3]% +% {\processaction +% [#2] +% [ \v!links=>\letvalue{\??kd#1\c!links }=\relax +% \letvalue{\??kd#1\c!rechts}=\hfill, +% \v!rechts=>\letvalue{\??kd#1\c!links }=\hfill +% \letvalue{\??kd#1\c!rechts}=\relax, +% \v!midden=>\letvalue{\??kd#1\c!links }=\hfill +% \letvalue{\??kd#1\c!rechts}=\hfill, +% \v!geen=>\letvalue{\??kd#1\c!links }=\relax % new +% \letvalue{\??kd#1\c!rechts}=\relax]% new +% % % removed 06/2001 +% % \forgetparindent +% % added 06/2001 [see demo-bbv] +% \localhsize\hsize \checkframedtext +% % so far +% \setbox\framebox=\vbox +% \bgroup +% \hsize\localhsize +% % \insidefloattrue % ? +% \expanded{\switchtobodyfont[\getvalue{\??kd#1\c!korps}]}% +% \localframed[\??kd#1][\c!strut=\v!nee,#3]% +% \bgroup +% \blanko[\v!blokkeer]% +% \let\\=\endgraf +% % \getvalue{\??kd#1\c!binnen}% +% \dostartattributes{\??kd#1}\c!letter\c!kleur{}% +% \def\dostopframedtext{\dodostopframedtext{#1}{#2}}} + \def\dododostartframedtext[#1][#2][#3]% {\processaction [#2] - [ \v!links=>\letvalue{\??kd#1\c!links }=\relax - \letvalue{\??kd#1\c!rechts}=\hfill, - \v!rechts=>\letvalue{\??kd#1\c!links }=\hfill - \letvalue{\??kd#1\c!rechts}=\relax, - \v!midden=>\letvalue{\??kd#1\c!links }=\hfill - \letvalue{\??kd#1\c!rechts}=\hfill, - \v!geen=>\letvalue{\??kd#1\c!links }=\relax % new - \letvalue{\??kd#1\c!rechts}=\relax]% new + [ \v!links=>\letvalue{\??kd#1\c!links }\relax + \letvalue{\??kd#1\c!rechts}\hfill, + \v!rechts=>\letvalue{\??kd#1\c!links }\hfill + \letvalue{\??kd#1\c!rechts}\relax, + \v!midden=>\letvalue{\??kd#1\c!links }\hfill + \letvalue{\??kd#1\c!rechts}\hfill, + \v!geen=>\letvalue{\??kd#1\c!links }\relax % new + \letvalue{\??kd#1\c!rechts}\relax]% new % removed 06/2001 % \forgetparindent % added 06/2001 [see demo-bbv] \localhsize\hsize \checkframedtext % so far \setbox\framebox=\vbox - \bgroup + \startboxedcontent \hsize\localhsize - % \insidefloattrue % ? + % \insidefloattrue % ? better \expanded{\switchtobodyfont[\getvalue{\??kd#1\c!korps}]}% + \startcolor[\getvalue{\??kd#1\c!kleur}]% \localframed[\??kd#1][\c!strut=\v!nee,#3]% \bgroup - \blanko[\v!blokkeer]% \let\\=\endgraf \getvalue{\??kd#1\c!binnen}% - \dostartattributes{\??kd#1}\c!letter\c!kleur{}% + \doifvalue{\??kd#1\c!dieptecorrectie}{\v!aan} % new, inside box + {\bgroup + \vbox{\strut} + \vskip-\lineheight}% + \blanko[\v!blokkeer]% plaatst signal + \doconvertfont{\getvalue{\??kd#1\c!letter}}{}% \def\dostopframedtext{\dodostopframedtext{#1}{#2}}} %D The \type {none} option is handy for nested usage, as %D in the presentation styles, where we don't want %D interference. -\def\dodostopframedtext#1#2% +% \def\dodostopframedtext#1#2% +% {\endgraf +% \removelastskip +% \dostopattributes +% \doifvalue{\??kd#1\c!dieptecorrectie}{\v!aan} % new, inside box +% {\baselinecorrection}% +% \egroup +% \egroup +% \doif{#2}{\v!geen}{\insidefloattrue}% new +% \ifinsidefloat +% \box\framebox +% \else +% \doplaats[\??kd#1][]{\box\framebox}% +% \fi +% \egroup} + +\def\dodostopframedtext#1#2% % no \baselinecorrection, see faq docs {\endgraf \removelastskip - \dostopattributes - \doifvalue{\??kd#1\c!dieptecorrectie}{\v!aan} % new, inside box - {\baselinecorrection}% - \egroup + \doifvalue{\??kd#1\c!dieptecorrectie}{\v!aan} % local and global + {\forgetall + \vskip-\lineheight + \vbox{\strut} + \egroup + \forgetall + \vskip-\lineheight +% will be an option +\setbaselinecorrections +\donegbotbaselinecorrection + \vbox{\strut}} + \stopboxedcontent + \stopcolor \egroup \doif{#2}{\v!geen}{\insidefloattrue}% new \ifinsidefloat \box\framebox \else - \doplaats[\??kd#1][]{\box\framebox}% + \doplaats[\??kd#1][\c!dieptecorrectie=\v!uit]{\box\framebox}% \fi \egroup} @@ -2959,6 +3023,7 @@ \c!hoek=\v!recht, \c!diepte=\!!zeropoint, \c!voorgrondkleur=, + \c!voorgrondletter=, \c!achtergrond=, \c!achtergrondraster=\@@rsraster, \c!achtergrondkleur=, diff --git a/tex/context/base/core-sec.tex b/tex/context/base/core-sec.tex index e144f68db..73347fb25 100644 --- a/tex/context/base/core-sec.tex +++ b/tex/context/base/core-sec.tex @@ -190,10 +190,13 @@ {\maakhetnummer[#1]% \hetnummer} -\def\huidigenummer[#1]% - {%\getvalue{\getvalue{\@@thenumber{#1}\c!zetwijze}}% - \getvalue{\getvalue{\@@thenumber{#1}\c!plaats}}% - {\dotextprefix{\getvalue{\@@thenumber{#1}\c!tekst}}\lossenummer[#1]}} +%\def\huidigenummer[#1]% +% {%\getvalue{\getvalue{\@@thenumber{#1}\c!zetwijze}}% +% \getvalue{\getvalue{\@@thenumber{#1}\c!plaats}}% +% {\dotextprefix{\getvalue{\@@thenumber{#1}\c!tekst}}\lossenummer[#1]}} + +\def\huidigenummer[#1]% kan tekst hier weg ? + {\dotextprefix{\getvalue{\@@thenumber{#1}\c!tekst}}\lossenummer[#1]} \def\volgendenummer[#1][#2][#3]% {\verhoognummer[#1]% @@ -886,7 +889,8 @@ \xdef\@@koniveau{\getvalue{\??se\@@sectie\c!niveau}}} \def\dohandelpaginaafBB#1#2#3% - {\doifinset{\getvalue{\??tk#2\v!tekst\c!status}}{\v!normaal,\v!start} +% {\doifinset{\getvalue{\??tk#2\v!tekst\c!status}}{\v!normaal,\v!start} + {\doifinset{\getvalue{\??tk#2\c!status}}{\v!normaal,\v!start} {\doifvaluesomething{\??ko#1#3} {\setuplayouttext[#2][\c!status=\getvalue{\??ko#1#3}]}}} @@ -1418,7 +1422,7 @@ % \let\unknownreference\gobbleoneargument \ifdisplaysectionhead \let\headlastlinewidth\!!zeropoint - \snaptogrid\hbox + \snaptogrid[\getvalue{\??ko#1\c!grid}]\hbox {\iflocation \ifautocrossdocument \doifreferencefoundelse{\getvalue{\??ko#1\c!file}::#1} @@ -1622,6 +1626,7 @@ \c!tolerantie=, \c!file=, \c!expansie=, + \c!grid=, #2]% \ConvertToConstant\doifnot{#1}{\getvalue{\??ko#1\c!default}} {\doifsomething{\getvalue{\??ko#1\c!default}} @@ -1633,10 +1638,12 @@ \c!letter,\c!kleur,\c!afstand,\c!variant,\c!springvolgendein, %\c!nummerletter,\c!tekstletter, %\c!expansie, % why njet ? - \c!uitlijnen,\c!tolerantie,\c!nummercommando,\c!tekstcommando]}}% + \c!uitlijnen,\c!tolerantie,\c!grid, + \c!nummercommando,\c!tekstcommando]}}% \getparameters[\??ko#1][#2]% \doifsomething{\getvalue{\??ko#1\c!sectie}} - {\doifundefined{\??mk#1} + {\doifelsemarking{#1}% \doifundefined{\??mk#1} + {}% marking #1 already defined {\definieermarkering[#1]% \koppelmarkering[#1][\getvalue{\??ko#1\c!sectie}]% \definieermarkering[#1\v!nummer]% @@ -1654,7 +1661,8 @@ \c!letter,\c!kleur,\c!afstand,\c!variant,\c!springvolgendein, %\c!nummerletter,\c!tekstletter, %\c!expansie, % why njet ? - \c!uitlijnen,\c!tolerantie,\c!nummercommando,\c!tekstcommando]% + \c!uitlijnen,\c!tolerantie,\c!grid, + \c!nummercommando,\c!tekstcommando]% \getparameters[\??ko#1][\c!expansie=]% iig een value, rather fuzzy \definieermarkering[#1][#2]% \definieermarkering[#1\v!nummer][#2\v!nummer]% diff --git a/tex/context/base/core-spa.tex b/tex/context/base/core-spa.tex index 471fe1a17..88079adf1 100644 --- a/tex/context/base/core-spa.tex +++ b/tex/context/base/core-spa.tex @@ -2512,6 +2512,26 @@ \definehspace [\v!normaal] [1\spaceamount] \definehspace [\v!default] [\v!groot] +% Very nasty but needed for margin stuff inside colored +% paragraphs. + +\let\normalvadjust\vadjust + +\def\graphicvadjust % bad, those low level color calls here + {\dowithnextbox + {\normalvadjust + {\dostartgraphicgroup + \ifx\maintextcolor\empty + \stopcolormode + \unvbox\nextbox + \else + \startcolormode\maintextcolor + \unvbox\nextbox + \stopcolormode + \fi + \dostopgraphicgroup}}% + \vbox} + \stelwitruimtein [\v!geen] diff --git a/tex/context/base/core-tbl.tex b/tex/context/base/core-tbl.tex index 2baf2bcda..fbba941f5 100644 --- a/tex/context/base/core-tbl.tex +++ b/tex/context/base/core-tbl.tex @@ -494,11 +494,11 @@ \doifundefined{\??tt#1::\c!eenheid} {\copyparameters [\??tt#1::][\??tt\e!tabulate::]% - [\c!afstand,\c!eenheid,\c!voor,\c!na,\c!binnen,\c!inspringen, + [\c!afstand,\c!eenheid,\c!voor,\c!korps,\c!na,\c!binnen,\c!inspringen, \c!uitlijnen,\c!lijnkleur,\c!lijndikte,EQ]}% \copyparameters [\??tt#1::#2][\??tt#1::]% - [\c!eenheid,\c!afstand,\c!voor,\c!na,\c!binnen,\c!inspringen, + [\c!eenheid,\c!afstand,\c!voor,\c!korps,\c!na,\c!binnen,\c!inspringen, \c!uitlijnen,\c!lijnkleur,\c!lijndikte,EQ]% \setvalue{\e!start#1::#2}{\dofinalstarttabulate[#1][#2][#3]}% \setvalue{\e!start#1}{\bgroup\dosubstarttabulate[#1]}% @@ -592,7 +592,12 @@ \getvalue{\??tt\currenttabulate\c!voor}% \fi \bgroup -\postponefootnotes % new, to be tested + % todo: spacing around tabulate when bodyfont is set + % expansion en test needed ? + \doifvaluesomething{\??tt\currenttabulate\c!korps} + {\expanded{\switchtobodyfont + [\getvalue{\??tt\currenttabulate\c!korps}]}}% + \postponefootnotes % new, to be tested \chardef\tabulatepass=1 \widowpenalty=0 % otherwise lines are not broken \clubpenalty =0 % but overlap in funny ways @@ -672,6 +677,7 @@ \v!middel=>\def\factor{.5}, \v!groot=>, \v!geen=>\scratchskip=\zeropoint\def\factor{0}, + \v!grid=>\scratchskip=\zeropoint\def\factor{0}, \s!unknown=>\scratchskip=\commalistelement]% \scratchdimen=\factor\scratchskip \ifconditional\tabulatesomeamble\kern\else\vskip\fi\scratchdimen % new @@ -681,7 +687,9 @@ {\color [\getvalue{\??tt\currenttabulate\c!lijnkleur}] {\scratchdimen=\getvalue{\??tt\currenttabulate\c!lijndikte}% - \hrule\!!height.5\scratchdimen\!!depth.5\scratchdimen}} + \hrule\!!height.5\scratchdimen\!!depth.5\scratchdimen\relax + \doifvalue{\??tt\currenttabulate\c!afstand}{\v!grid} + {\kern-\scratchdimen}}} % experimental tm-prikkels %D When set to true, no (less) break optimization is done. @@ -881,6 +889,8 @@ \chardef\tabulatepass=2 \@EA\halign\@EA{\the\!!toksa\cr\fulltabulatecontent\crcr}% \prevdepth\dp\strutbox % nog eens beter, temporary hack + \doifvalue{\??tt\currenttabulate\c!afstand}{\v!grid} + {\vskip-\dp\strutbox}% experimental tm-prikkels \egroup \ifinsidefloat \else \getvalue{\??tt\currenttabulate\c!na}% @@ -902,6 +912,7 @@ \setuptabulate [\c!eenheid=1em, EQ={:}, + \c!korps=, \c!lijnkleur=, \c!lijndikte=\linewidth, \c!binnen=, diff --git a/tex/context/base/core-uti.tex b/tex/context/base/core-uti.tex index c9d2e3269..39d084d87 100644 --- a/tex/context/base/core-uti.tex +++ b/tex/context/base/core-uti.tex @@ -186,6 +186,7 @@ \long\def\doutilities#1#2#3#4#5% % introduceren in utility file {\restorecatcodes \resetutilities + %\message{#1}% \def\docommando##1% % more than one utility thing {\csname\s!set##1\endcsname}% % can be handled in one pass, \processcommacommand[#1]\docommando % for instance lists @@ -432,4 +433,59 @@ \def\plaatsvolledig#1#2#3#4% kop, ref, tit, do {#1[#2]{#3}#4\pagina[\v!ja]} +% Experiment +% +%\installprogram{Hello World} + +\def\installprogram#1% + {\immediatewriteutility{e p {#1}}} + +% \writeplugindata{texutil}{{alpha}} +% \writeplugindata{texutil}{{beta}} +% \writeplugindata{texutil}{{gamma}} +% \writeplugindata{texutil}{{delta}} +% +% \loadplugindata {plugintest} + +\def\immediatewriteplugindata#1#2% + {\immediatewriteutility{p u {#1} #2}} + +\def\writeplugindata#1#2% + {\writeutility{p u {#1} #2}} + +\def\loadplugindata#1% + {\doutilities{#1}{\jobname}{}{}{}{}} + +% \plugincommand{\command{}{}{}} +% +% this way we can catch undefined commands + +\long\def\plugincommand#1% + {\doplugincommand#1\relax} + +\long\def\doplugincommand#1% + {\ifx#1\undefined + \expandafter\noplugincommand + \else + \expandafter#1% + \fi} + +\long\def\noplugincommand#1\relax + {} + +% \addutilityreset{plugintest} +% +% \def\resetplugintest{\let\plugintest\gobbletwoarguments} +% \def\setplugintest {\let\plugintest\writestatus} +% +% \installplugin +% {plugintest} +% {\let\plugintest\gobbletwoarguments} +% {\let\plugintest\writestatus} + +\long\def\installplugin#1#2#3% + {\addutilityreset {#1}% + \long\setvalue{\s!reset#1}{#2}% + \long\setvalue{\s!set #1}{#3}} + \protect \endinput diff --git a/tex/context/base/core-ver.tex b/tex/context/base/core-ver.tex index 55eba3397..c9d5a4093 100644 --- a/tex/context/base/core-ver.tex +++ b/tex/context/base/core-ver.tex @@ -101,9 +101,9 @@ \installprettytype [MP] [MP] \installprettytype [MF] [MP] -\installprettytype [JAVASCRIPT] [JV] +\installprettytype [JAVASCRIPT] [JS] \installprettytype [JAVA] [JV] -\installprettytype [JS] [JV] +\installprettytype [JS] [JS] \installprettytype [JV] [JV] \installprettytype [SQL] [SQL] diff --git a/tex/context/base/enco-pol.tex b/tex/context/base/enco-pol.tex index e64540392..588c5e673 100644 --- a/tex/context/base/enco-pol.tex +++ b/tex/context/base/enco-pol.tex @@ -15,25 +15,45 @@ \startmapping[pl0] -\definecasemap 161 185 165 % a ogonek -\definecasemap 162 230 198 % c acute -\definecasemap 166 234 202 % e ogonek -\definecasemap 170 179 163 % l crossed -\definecasemap 171 241 209 % n acute -\definecasemap 243 243 211 % o acute -\definecasemap 177 156 140 % s acute -\definecasemap 185 159 143 % z acute -\definecasemap 187 191 175 % z dot - -\definecasemap 129 165 185 % A ogonek -\definecasemap 130 198 230 % C accute -\definecasemap 134 202 234 % E ogonek -\definecasemap 138 163 179 % L crossed -\definecasemap 139 209 241 % N accute -\definecasemap 211 211 243 % O acute -\definecasemap 145 140 156 % S acute -\definecasemap 153 143 159 % Z acute -\definecasemap 155 175 191 % Z dot +%\definecasemap 161 185 165 % a ogonek +%\definecasemap 162 230 198 % c acute +%\definecasemap 166 234 202 % e ogonek +%\definecasemap 170 179 163 % l crossed +%\definecasemap 171 241 209 % n acute +%\definecasemap 243 243 211 % o acute +%\definecasemap 177 156 140 % s acute +%\definecasemap 185 159 143 % z acute +%\definecasemap 187 191 175 % z dot + +%\definecasemap 129 165 185 % A ogonek +%\definecasemap 130 198 230 % C accute +%\definecasemap 134 202 234 % E ogonek +%\definecasemap 138 163 179 % L crossed +%\definecasemap 139 209 241 % N accute +%\definecasemap 211 211 243 % O acute +%\definecasemap 145 140 156 % S acute +%\definecasemap 153 143 159 % Z acute +%\definecasemap 155 175 191 % Z dot + +\definecasemap 161 161 129 % a ogonek +\definecasemap 162 162 130 % c acute +\definecasemap 166 166 134 % e ogonek +\definecasemap 170 170 138 % l crossed +\definecasemap 171 171 139 % n acute +\definecasemap 243 243 211 % o acute +\definecasemap 177 177 145 % s acute +\definecasemap 185 185 153 % z acute +\definecasemap 187 187 155 % z dot + +\definecasemap 129 161 129 % A ogonek +\definecasemap 130 162 130 % C accute +\definecasemap 134 166 134 % E ogonek +\definecasemap 138 170 138 % L crossed +\definecasemap 139 171 139 % N accute +\definecasemap 211 243 211 % O acute +\definecasemap 145 177 145 % S acute +\definecasemap 153 185 153 % Z acute +\definecasemap 155 187 155 % Z dot \stopmapping diff --git a/tex/context/base/font-ini.tex b/tex/context/base/font-ini.tex index 01d879eaa..c0dd478d9 100644 --- a/tex/context/base/font-ini.tex +++ b/tex/context/base/font-ini.tex @@ -57,11 +57,14 @@ % new +\newtoks \everydefinedfont \relax + \def\dodefinedfont[#1]% {\iffirstargument\definefont[\string\definedfont][#1]\fi - \csname\string\definedfont\endcsname} + \csname\string\definedfont\endcsname + \the\everydefinedfont} -\def\definedfont% +\unexpanded\def\definedfont% {\dosingleempty\dodefinedfont} %%% message 14 added @@ -1305,6 +1308,8 @@ \fi \fi} +\let\definefontfile\definefontsynonym % dedicated to Taco Hoekwater + \def\setupfontsynonym% {\dodoubleempty\dosetupfontsynonym} diff --git a/tex/context/base/hand-ini.tex b/tex/context/base/hand-ini.tex index 9a209bfe7..fbbeabeaa 100644 --- a/tex/context/base/hand-ini.tex +++ b/tex/context/base/hand-ini.tex @@ -178,7 +178,8 @@ \def\startfonthandling[#1]% {\def\fonthandling{#1}% \doifundefined{\@fha@\fonthandling} - {\expanded{\newtoks\csname\@fha@\fonthandling\endcsname}}} + {\getparameters[\@fha@\@fha@#1][\c!links=1,\c!rechts=1]% new + \expanded{\newtoks\csname\@fha@\fonthandling\endcsname}}} \def\stopfonthandling% {\let\fonthandling\empty} @@ -202,61 +203,13 @@ \def\enablehandling% {\dodoubleempty\doenablehandling} -%\def\doenablehandling[#1][#2]% handling / symbolic fontname -% {\doifdefinedelse{\@fha@\@fha@#1}% -% {\setprotrudingfactor -% {\getvalue{\@fha@\@fha@#1\c!links}} -% {\getvalue{\@fha@\@fha@#1\c!rechts}}% -% \edef\fonthandling{\getvalue{\@fha@\@fha@#1}}% -% \checkfonthandling{#2}% -% \@EA\rawprocesscommalist\@EA[\fonthandling]\dodoenablehandling -% \registerfonthandling{#2}} -% {\edef\fonthandling{#1}% new -% \dodoenablehandling{#1}}} -% -%\def\dodoenablehandling#1% weg met die @EA -% {\doifdefined{\@fha@#1}{\@EA\the\csname\@fha@#1\endcsname}} -% -%\def\checkfonthandling#1% -% {\doifelsevalue{#1\s!handling\c!file}{\purefontname\font} -% \skipprotrudingdeftrue\skipprotrudingdeffalse} -% -%\def\registerfonthandling#1% -% {%\ifskipprotrudingdef\else\message{#1->#2->\purefontname\font}\wait\fi -% \setxvalue{#1\s!handling\c!file}{\purefontname\font}} -% -%\def\registerfonthandling#1% -% {%\ifskipprotrudingdef\else\message{#1->#2->\purefontname\font}\wait\fi -% \setxvalue{#1\s!handling\c!file}{\purefontname\font}} - \def\doenablehandling[#1][#2]% handling / symbolic fontname {\fastenablehandling{#1}{#2}} % for the moment the same as: -% fast one for font switch: - -% \def\fastenablehandling#1#2% -% {\@EA\ifx\csname\@fha@\@fha@#1\endcsname\relax -% \edef\fonthandling{#1}% new -% \dodoenablehandling{#1}% -% \else -% \setprotrudingfactor -% {\csname\@fha@\@fha@#1\c!links\endcsname} -% {\csname\@fha@\@fha@#1\c!rechts\endcsname}% -% \edef\fonthandling{\csname\@fha@\@fha@#1\endcsname}% -% \checkfonthandling{#2}% -% \@EA\rawprocesscommalist\@EA[\fonthandling]\dodoenablehandling -% \registerfonthandling{#2}% -% \fi} -% -% \def\dodoenablehandling#1% -% {\@EA\ifx\csname\@fha@#1\endcsname\relax\else -% \the\csname\@fha@#1\endcsname -% \fi} - \beginTEX \def\fastenablehandling#1% - {\def\askedfonthandling{#1}% + {\edef\askedfonthandling{#1}% \@EA\ifx\csname\@fha@\@fha@\askedfonthandling\endcsname\relax \expandafter\nofastenablehandling \else @@ -268,7 +221,7 @@ \beginETEX \ifcsname \def\fastenablehandling#1% also gets #2 passed - {\def\askedfonthandling{#1}% + {\edef\askedfonthandling{#1}% \ifcsname\@fha@\@fha@\askedfonthandling\endcsname \expandafter\dofastenablehandling \else @@ -287,7 +240,10 @@ \registerfonthandling{#1}} \def\nofastenablehandling#1% - {\let\fonthandling\askedfonthandling + {\setprotrudingfactor + {\csname\@fha@\@fha@\askedfonthandling\c!links \endcsname} + {\csname\@fha@\@fha@\askedfonthandling\c!rechts\endcsname}% + \let\fonthandling\askedfonthandling \dodoenablehandling\fonthandling} \beginTEX @@ -308,13 +264,15 @@ \endETEX -\def\checkfonthandling#1% we need a fast compare - {\doifelsevalue{#1\s!handling\c!file}{\purefontname\font} - \skipprotrudingdeftrue\skipprotrudingdeffalse} +%D We must not use \type {\purefontname} here (was a bug)! + +\def\checkfonthandling#1% we need a fast compare + {\doifelsevalue{#1\s!handling\c!file}{\fontname\font} + \skipprotrudingdeftrue\skipprotrudingdeffalse} \def\registerfonthandling#1% - {%\ifskipprotrudingdef\else\message{#1->#2->\purefontname\font}\wait\fi - \@EA\xdef\csname#1\s!handling\c!file\endcsname{\purefontname\font}} + {%\ifskipprotrudingdef\else\message{#1->#2->\fontname\font}\wait\fi + \@EA\xdef\csname#1\s!handling\c!file\endcsname{\fontname\font}} %D \macros %D {usehandling} @@ -339,6 +297,8 @@ %D Let's now see if this macro works: +\setupfonthandling[\s!default][\c!links=1,\c!rechts=1] + \usehandling [def] \protect \endinput diff --git a/tex/context/base/lang-ini.tex b/tex/context/base/lang-ini.tex index 0aee0de61..0f7442576 100644 --- a/tex/context/base/lang-ini.tex +++ b/tex/context/base/lang-ini.tex @@ -11,6 +11,8 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +%D Todo : --language=pl,en,nl : nl incs number of language + %D This module implements the (for the moment still simple) %D multi||language support of \CONTEXT, which should not be %D confused with the multi||lingual interface. This support @@ -318,8 +320,8 @@ \let\normalpatterns\patterns -\def\dodoloadpatterns#1#2#3#4% - {\normallanguage\loadedlanguage +\def\dodoloadpatterns#1#2#3#4% beware, loaded language also incr + {\normallanguage\loadedlanguage % when not really needed % \letvalue{\??la\??la#2}\loadedlanguage \bgroup \scratchtoks\everyjob % we don't want additional junk put there @@ -334,7 +336,9 @@ %\def\patterns##1{\message{#1/#2/#3/#4/##1}\normalpatterns{##1}}% \readsysfile{\truefilename{\f!languageprefix#2.\f!patternsextension}} {\setxvalue{\??la#1\s!patterns}{#2}% - \xdef\preloadedpatterns{\preloadedpatterns\showpatterns{#2}}% + \xdef\preloadedpatterns + {\preloadedpatterns + \number\normallanguage:\showpatterns{#2}}% \showmessage{\m!linguals}{1}{#2,#1,\loadedlanguage}} {\readsysfile{\f!languageprefix#2.\f!patternsextension} {\setxvalue{\??la#1\s!patterns}{#2}% diff --git a/tex/context/base/m-units.tex b/tex/context/base/m-units.tex index f775ad7bc..423ca5e70 100644 --- a/tex/context/base/m-units.tex +++ b/tex/context/base/m-units.tex @@ -8,8 +8,8 @@ %D copyright={PRAGMA / Hans Hagen \& Ton Otten}] %C %C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. %D Scientific units can be typeset in math mode pretty well, %D but occasionally one has to take care of spacing. @@ -22,8 +22,8 @@ %D \stoptypen %D %D This example shows that we use the order in which we say -%D things, instead of typeset things. There is a separate -%D manual for this module. +%D things, instead of typeset things. There is a separate +%D manual for this module. %D Message number~1 deals with overruling the \type {\Degrees} %D macro defined in the core modules. Let's say that this is @@ -89,8 +89,8 @@ %D %D We have to use the command \type {\unitmeaning} instead %D of \type {\meaning}, simply because the latter is a \TEX\ -%D primitive we don't want to loose. We use the label text -%D mechanism for translations. +%D primitive we don't want to loose. We use the label text +%D mechanism for translations. %D \macros %D {dimension} @@ -131,8 +131,8 @@ \def\mathematicstypeface{\rm} \def\dimensiontypeface {\tf} -\def\dimensionhalfspace {\,} -\def\dimensionbackspace {\!} +\def\dimensionhalfspace {\ifmmode\,\else\hskip+.1em\relax\fi} +\def\dimensionbackspace {\ifmmode\!\else\hskip-.1em\relax\fi} %D \macros %D {smashdimensionpower} @@ -154,18 +154,60 @@ \let\thedimensionpower = \empty %D \macros -%D {spaceddimensions} -%D +%D {spaceddimensions,textdimensions} +%D %D The actual definition of \type {\dimension} overruled the -%D one in the core modules. The boolean can be used to -%D force spacing between units. Vergelijk {\Newton \Meter} -%D eens met {\spaceddimensionstrue \Newton \Meter}. The -%D rather ugly test prevents problems with nested dimensions. +%D one in the core modules. The boolean can be used to +%D force spacing between units. Vergelijk {\Newton \Meter} +%D eens met {\spaceddimensionstrue \Newton \Meter}. The +%D rather ugly test prevents problems with nested dimensions. \newif\ifspaceddimensions \spaceddimensionsfalse % user switch +\newif\iftextdimensions \textdimensionsfalse % user switch + +%D You can see the consequence of forcing text dimensions +%D when you compare the following code: +%D +%D \starttyping +%D {\rm test \Square \Meter \Per \Second\ ziezo\Degrees} \par +%D {\ss test \Square \Meter \Per \Second\ ziezo} \par +%D {\tt test \Square \Meter \Per \Second\ ziezo} +%D +%D \textdimensionstrue +%D +%D {\rm test \Square \Meter \Per \Second\ ziezo} \par +%D {\ss test \Square \Meter \Per \Second\ ziezo} \par +%D {\tt test \Square \Meter \Per \Second\ ziezo} +%D \stoptyping + \newif\ifnesteddimension \nesteddimensionfalse % local switch -\unexpanded\def\dimension#1% +\def\dodimensionpower#1% + {\iftextdimensions\expandafter\high\else\expandafter^\fi{#1}} + +\def\ustartmathmode {\iftextdimensions\else\startmathmode \fi} +\def\ustopmathmode {\iftextdimensions\else\stopmathmode \fi} +\def\umathematicstypeface{\iftextdimensions\else\mathematicstypeface\fi} + +%D In forced text mode, we ignore spacing in monospaced fonts. + +\def\udimensionhalfspace {\dodimensionspace\dimensionhalfspace} +\def\udimensionbackspace {\dodimensionspace\dimensionbackspace} + +\def\dodimensionspace + {\iftextdimensions + \begingroup + \setbox0=\hbox{i}% + \setbox2=\hbox{m}% + \ifdim\wd0=\wd2 + \endgroup + \@EAEAEA\gobbleoneargument + \else + \endgroup + \fi + \fi} + +\unexpanded\def\dimension#1% {\begingroup \global\let\savedthedimensionprefix\thedimensionprefix \global\let\savedthedimensionpower\thedimensionpower @@ -173,11 +215,11 @@ \let\dimensionprefix\dimension \let\dimensionmidfix\dimension \let\dimensionsuffix\dimension - \let\dimensionpower\dimension + \let\dimensionpower \dimension \global\nesteddimensionfalse - \setbox0=\hbox{\startmathmode#1\stopmathmode}% + \setbox0=\hbox{\ustartmathmode#1\ustopmathmode}% \global\let\thedimensionprefix\savedthedimensionprefix - \global\let\thedimensionpower\savedthedimensionpower + \global\let\thedimensionpower \savedthedimensionpower \endgroup \ifnesteddimension#1\else\dodimension{#1}\fi} @@ -185,29 +227,34 @@ {\dontbreakdimension \ifdim\scratchdimen=\zeropoint\relax \ifmmode - \dimensionhalfspace - \dimensionhalfspace + \udimensionhalfspace + \udimensionhalfspace \fi - \startmathmode\dimensiontypeface + \ustartmathmode\dimensiontypeface \else - \startmathmode\dimensiontypeface + \ustartmathmode\dimensiontypeface \ifdim\scratchdimen=\dimensionsignal\relax - \ifspaceddimensions\dimensionhalfspace\fi + \ifspaceddimensions\udimensionhalfspace\fi \fi \fi - \mathematicstypeface\thedimensionprefix#1% + \umathematicstypeface\thedimensionprefix#1% \ifx\thedimensionpower\empty \else\ifsmashdimensionpower - \setbox\scratchbox=\hbox{$\scriptstyle\thedimensionpower$}% + \setbox\scratchbox=\hbox + {\iftextdimensions + \tx\thedimensionpower + \else + $\scriptstyle\thedimensionpower$% + \fi}% \ht\scratchbox=\zeropoint - ^{\box\scratchbox}% + \dodimensionpower{\box\scratchbox}% \else - ^{\thedimensionpower}% + \dodimensionpower{\thedimensionpower}% \fi\fi - \stopmathmode + \ustopmathmode % otherwise nobreak before space in 2 \Milli \Meter\ blabla - \doifnotmode{atpragma}{\nobreak}% this was always \nobreak - % only test this at pragma + \doifnotmode{atpragma}{\nobreak}% this was always \nobreak + % only test this at pragma \ifx\thedimensionpower\empty \hskip\dimensionsignal \else @@ -236,35 +283,36 @@ \def\dimensionaddfix#1% {\unskip - \mathematics{\mathematicstypeface#1}% + %\mathematics{\umathematicstypeface#1}% + \ustartmathmode\umathematicstypeface#1\ustopmathmode \nobreak \hskip\dimensionaddfixsignal} \def\dimensionnopfix#1% {\dontbreakdimension \ifdim\scratchdimen=\dimensionpowersignal\relax - \startmathmode + \ustartmathmode \else - \startmathmode - \dimensionhalfspace + \ustartmathmode + \udimensionhalfspace \nobreak \fi - \mathematicstypeface#1% - \stopmathmode + \umathematicstypeface#1% + \ustopmathmode \nobreak \hskip\dimensionsignal} \def\dimensionmidfix#1% {\dontbreakdimension \ifdim\scratchdimen=\dimensionpowersignal\relax - \startmathmode - \dimensionbackspace + \ustartmathmode + \udimensionbackspace \nobreak \else - \startmathmode + \ustartmathmode \fi - \mathematicstypeface#1% - \stopmathmode + \umathematicstypeface#1% + \ustopmathmode \nobreak \hskip\dimensionmidfixsignal} @@ -286,15 +334,15 @@ %D %D We can fake the degrees symbol with: -\def\Degrees{\dimensionaddfix{^\circ}} +\def\Degrees{\dimensionaddfix{\mathematics{^\circ}}} %D \macro %D {Unit, NoUnit} %D %D When a dimension has no leading number, we can use \type -%D {\Unit}, and when no unit is appended, \type {\NoUnit} is -%D to be used, just to prevent the prefix migrating to the -%D next occasion. +%D {\Unit}, and when no unit is appended, \type {\NoUnit} is +%D to be used, just to prevent the prefix migrating to the +%D next occasion. \def\Unit {\hskip\dimensionsignal} \def\NoUnit {\dimension{}} @@ -306,7 +354,7 @@ \def\Femto {\dimensionprefix{f}} \def\Pico {\dimensionprefix{p}} \def\Nano {\dimensionprefix{n}} -\def\Micro {\dimensionprefix{\mu}} +\def\Micro {\dimensionprefix{\iftextunits u\else\mu\fi}} \def\Milli {\dimensionprefix{m}} \def\Centi {\dimensionprefix{c}} \def\Deci {\dimensionprefix{d}} @@ -314,13 +362,13 @@ \def\Kilo {\dimensionprefix{k}} \def\Mega {\dimensionprefix{M}} \def\Giga {\dimensionprefix{G}} -\def\Terra {\dimensionprefix{T}} -\def\Peta {\dimensionprefix{P}} -\def\Exa {\dimensionprefix{E}} - +\def\Terra {\dimensionprefix{T}} +\def\Peta {\dimensionprefix{P}} +\def\Exa {\dimensionprefix{E}} + %D and operators: -\def\Times {\dimensionnopfix{\cdot}} +\def\Times {\dimensionnopfix{\iftextunits.\else\cdot\fi}} \def\Solidus {\dimensionmidfix{/}} \def\Per {\dimensionmidfix{/}} \def\OutOf {\dimensionnopfix{:}} @@ -350,7 +398,11 @@ \getvalue{\v!eenheid} [hMeter] {\Hecto \Meter} {hectometer} \getvalue{\v!eenheid} [kMeter] {\Kilo \Meter} {kilometer} -\getvalue{\v!eenheid} [Liter] {L} {liter} +%D After some discussion on the \CONTEXT\ mailing list in +%D february 2002 it was decided to go from L to l for liters +%D (Karel Wesselings alternative: \mathematics{\ell}). + +\getvalue{\v!eenheid} [Liter] {l} {liter} \getvalue{\v!eenheid} [mLiter] {\Milli \Liter} {milliliter} \getvalue{\v!eenheid} [cLiter] {\Centi \Liter} {centiliter} \getvalue{\v!eenheid} [dLiter] {\Deci \Liter} {deciliter} @@ -432,8 +484,8 @@ %D Then we define some angles. -\getvalue{\v!eenheid} [Rad] {rad} {\labeltext{u:rad}} -\getvalue{\v!eenheid} [Deg] {{^\circ}} {\labeltext{u:deg}} +\getvalue{\v!eenheid} [Rad] {rad} {\labeltext{u:rad}} +\getvalue{\v!eenheid} [Deg] {{\mathematics{^\circ}}} {\labeltext{u:deg}} \setuplabeltext [\s!nl] @@ -538,7 +590,7 @@ \getvalue{\v!eenheid} [Celsius] {C} {Celsius} \getvalue{\v!eenheid} [Kelvin] {K} {Kelvin} -\getvalue{\v!eenheid} [Fahrenheit] {F} {Fahrenheit} +\getvalue{\v!eenheid} [Fahrenheit] {F} {Fahrenheit} %D Some chemic related units are: @@ -618,7 +670,7 @@ \getvalue{\v!eenheid} [Sievert] {Sv} {Sievert} \getvalue{\v!eenheid} [mSievert] {\Milli \Sievert} {milli Sievert} -%D Light: +%D Light: \getvalue{\v!eenheid} [Candela] {cd} {Candela} @@ -645,15 +697,15 @@ \def\xPercent {\dimensionaddfix{\percent }} \def\xPromille{\dimensionaddfix{\promille}} -\getvalue{\v!eenheid} [Percent] {\xPercent } {percent} -\getvalue{\v!eenheid} [Permille] {\xPromille} {promille} -\getvalue{\v!eenheid} [Promille] {\xPromille} {promille} +\getvalue{\v!eenheid} [Percent] {\xPercent } {percent} +\getvalue{\v!eenheid} [Permille] {\xPromille} {promille} +\getvalue{\v!eenheid} [Promille] {\xPromille} {promille} -%D Some more, thanks to Tobias: +%D Some more, thanks to Tobias: -\getvalue{\v!eenheid} [Gray] {Gr} {Gray} -\getvalue{\v!eenheid} [Weber] {Wb} {Weber} -\getvalue{\v!eenheid} [Henry] {H} {Henry} +\getvalue{\v!eenheid} [Gray] {Gr} {Gray} +\getvalue{\v!eenheid} [Weber] {Wb} {Weber} +\getvalue{\v!eenheid} [Henry] {H} {Henry} \getvalue{\v!eenheid} [Sterant] {sr} {Sterant} \getvalue{\v!eenheid} [Angstrom] {\AA} {\AA ngstr\"om} \getvalue{\v!eenheid} [Gauss] {G} {Gauss} diff --git a/tex/context/base/meta-fig.tex b/tex/context/base/meta-fig.tex index efbd48f0e..8a0e41ce6 100644 --- a/tex/context/base/meta-fig.tex +++ b/tex/context/base/meta-fig.tex @@ -68,7 +68,7 @@ \c!snijwit=\!!zeropoint,\c!bodemwit=\!!zeropoint, \c!hoofd=\!!zeropoint,\c!voet=\!!zeropoint]% \stoplocal % which saves us the trouble of push/pop - \startmakeup[\v!standaard][\c!dubbelzijdig=\v!nee,\c!pagina=]% + \startmakeup[\v!standaard][\c!tekststatus=\v!leeg,\c!dubbelzijdig=\v!nee,\c!pagina=]% \centerbox{\box\scratchbox}% \stopmakeup \egroup} diff --git a/tex/context/base/meta-ini.tex b/tex/context/base/meta-ini.tex index f7c337645..dd90344c2 100644 --- a/tex/context/base/meta-ini.tex +++ b/tex/context/base/meta-ini.tex @@ -749,6 +749,10 @@ \def\doifelseMPgraphic#1{\doifdefinedelse{\@@MPG#1}} +%D New: + +% \appendtoks \closeMPgraphicfiles \to \everystoptext + \protect \endinput % also: diff --git a/tex/context/base/mult-con.tex b/tex/context/base/mult-con.tex index b7f1ee84a..791438739 100644 --- a/tex/context/base/mult-con.tex +++ b/tex/context/base/mult-con.tex @@ -390,7 +390,10 @@ voorgrondkleur: voorgrondkleur foregroundcolor foregroundcolor foregroundcolor coloreprimopiano foregroundcolor - achtergrondoffset: achtergrondoffset backgroundoffset + voorgrondletter: voorgrondletter foregroundstyle + foregroundstyle foregroundstyle + foregroundstyle foregroundstyle + achtergrondoffset: achtergrondoffset backgroundoffset hintergrundoffset offsetpozadi offsetsfondo offsetfundal achtergrondraster: achtergrondraster backgroundscreen @@ -2261,7 +2264,7 @@ correntelocale localcurent in: in - ein - - in in + - - instellingen: instellingen setups impostazioni einstellungen nastaveni setari diff --git a/tex/context/base/mult-sys.tex b/tex/context/base/mult-sys.tex index fdd5e9155..02600c603 100644 --- a/tex/context/base/mult-sys.tex +++ b/tex/context/base/mult-sys.tex @@ -406,6 +406,7 @@ \definesystemvariable {kt} % KonTakten \definesystemvariable {kw} % KontaktWaarde \definesystemvariable {la} % LAnguage +\definesystemvariable {lb} % LaBels \definesystemvariable {ld} % LegenDa \definesystemvariable {lg} % taal (LanGuage) \definesystemvariable {li} % LIjst diff --git a/tex/context/base/page-flt.tex b/tex/context/base/page-flt.tex index a768f972c..43d11babe 100644 --- a/tex/context/base/page-flt.tex +++ b/tex/context/base/page-flt.tex @@ -263,6 +263,8 @@ \docompletefloat{#1}{#2}{#3}{#4}{#5}{#6}{\box\nextbox}% \fi} +% pas op, maxbreedte niet instellen als plaats=links/rechts + \def\setlocalfloatdimensions#1#2% experimental ! ! ! ! {\doifvaluesomething{\??fl#1\c!maxbreedte} {\scratchdimen=\getvalue{\??fl#1\c!maxbreedte}\relax @@ -1248,8 +1250,7 @@ \par \doifcommonelse {#1} - {\v!links,\v!rechts,\v!inlinker,\v!inrechter,% - \v!inmarge} + {\v!links,\v!rechts,\v!inlinker,\v!inrechter,\v!inmarge} {\global\parfloattrue} {\global\parfloatfalse}% \ifbinnenkolommen diff --git a/tex/context/base/page-imp.tex b/tex/context/base/page-imp.tex index fb4684f4c..6cc0c2bd8 100644 --- a/tex/context/base/page-imp.tex +++ b/tex/context/base/page-imp.tex @@ -62,8 +62,8 @@ \else \donetrue \fi - \else % testen, aangepast - \expandbothargsafter\doifinsetelse{\the\shippedoutpages}{\pagestoshipout} + \else % testen, aangepast / expanded nodig ? + \expanded{\doifinsetelse{\the\shippedoutpages}{\pagestoshipout}}% \donetrue\donefalse \fi \ifdone @@ -231,7 +231,7 @@ \multiply\scratchcounter \arrangedpageT \advance\scratchcounter \realpageno \advance\scratchcounter -1 - \dorecurse\scratchcounter{\noheaderandfooterlines\ejectdummypage} + \dorecurse\scratchcounter{\noheaderandfooterlines\ejectdummypage}% \fi} \def\handlearrangedpageXY#1#2#3#4#5% @@ -781,7 +781,7 @@ \c!kader=\@@ipkader]% \fi}}% \stopbaselinecorrection - \ifnum\combinedpagescounter<\@@ipn + \ifnum\combinedpagescounter<\@@ipn\relax \@@iptussen \else \exitloop diff --git a/tex/context/base/page-ini.tex b/tex/context/base/page-ini.tex index 528102b18..a18882f4d 100644 --- a/tex/context/base/page-ini.tex +++ b/tex/context/base/page-ini.tex @@ -629,6 +629,8 @@ \def\nextcolumn {\OTRcommand\nextcolumn} +\def\flushsavedfloats {\OTRcommand\flushsavedfloats} + % beter een \installotr#1 met #1 = macro en auto test \newif\iftraceotr @@ -869,7 +871,7 @@ \dosupereject \fi \inpagebodytrue % needed for enabling \blanko ! - \dosetbothinserts % to be reconsidered !!!!!!!!!!!!!! + \flushsavedfloats % was \dosetbothinserts; only otr one ! \setvsize % this is needed for interacting components, like floats and multicolumns \adaptfuzzypagegoal} % watch this hack! @@ -877,7 +879,8 @@ {\beforefinaloutput \the\everybeforeshipout \ifspecialbasedsettings - \myshipout{\hbox{\hbox to \zeropoint{\the\pageboundsettings}\hbox{\dopagebody#1#2\setpagecounters}}}% + \myshipout{\hbox{\hbox to \zeropoint{\the\pageboundsettings}% + \hbox{\dopagebody#1#2\setpagecounters}}}% \else \the\pageboundsettings \myshipout{\hbox{\dopagebody#1#2\setpagecounters}}% @@ -904,17 +907,17 @@ {\checkpageversion \ifverwerken \ifgeselecteerd - \dofinaloutput#1#2% + \@EAEAEA\dofinaloutput \else - \donofinaloutput#1#2% + \@EAEAEA\donofinaloutput \fi \else \ifgeselecteerd - \donofinaloutput#1#2% + \@EAEAEA\donofinaloutput \else - \dofinaloutput#1#2% + \@EAEAEA\dofinaloutput \fi - \fi + \fi#1#2% \resetselectiepagina \verhoogpaginanummer \checkpagedimensions @@ -1172,9 +1175,11 @@ % \getbackgroundbox % \getlogobox \bgroup % else footnotes get inconsistent font/baseline - \doconvertfont{\@@lyletter}{}% layoutparameter ? - \offinterlineskip - \gettextboxes + % \doconvertfont\@@lyletter\empty + \dostartattributes\??ly\c!letter\c!kleur\empty + \offinterlineskip + \gettextboxes + \dostopattributes \egroup \fi \getmainbox#1#2}% including footnotes @@ -1317,9 +1322,11 @@ \fi}, \v!leeg=>{\ejectinsert \ejectpage - \doifnotvalue{\??tk\v!hoofd\v!tekst\c!status}{\v!stop} +% \doifnotvalue{\??tk\v!hoofd\v!tekst\c!status}{\v!stop} + \doifnotvalue{\??tk\v!hoofd\c!status}{\v!stop} {\setupheader[\c!status=\v!leeg]}% - \doifnotvalue{\??tk\v!voet\v!tekst\c!status}{\v!stop} +% \doifnotvalue{\??tk\v!voet\v!tekst\c!status}{\v!stop} + \doifnotvalue{\??tk\v!voet\c!status}{\v!stop} {\setupfooter[\c!status=\v!leeg]}% \ejectdummypage}, \v!links=>{\ejectinsert diff --git a/tex/context/base/page-lay.tex b/tex/context/base/page-lay.tex index e0b19cc8f..bd3a7d2f9 100644 --- a/tex/context/base/page-lay.tex +++ b/tex/context/base/page-lay.tex @@ -763,12 +763,9 @@ \newif\ifdubbelzijdig \dubbelzijdigfalse \newif\ifenkelzijdig \enkelzijdigtrue -%\def\doifsometextlineelse#1#2#3% ! omgekeerd ! -% {\doifinsetelse{\getvalue{\??tk#1\v!tekst\c!status}}{\v!geen,\v!hoog} -% {#3}{#2}} - \def\doifsometextlineelse#1% - {\edef\!!stringa{\csname\??tk#1\v!tekst\c!status\endcsname}% +% {\edef\!!stringa{\csname\??tk#1\v!tekst\c!status\endcsname}% + {\edef\!!stringa{\csname\??tk#1\c!status\endcsname}% \ifx\!!stringa\v!geen \@EA\secondoftwoarguments \else\ifx\!!stringa\v!hoog @@ -975,6 +972,7 @@ \c!rugoffset=\!!zeropoint, \c!tekstbreedte=, % dangerous option \c!letter=, + \c!kleur=, \c!markering=\v!uit, \c!plaats=, % \v!enkelzijdig, but empty is signal \c!schaal=1, diff --git a/tex/context/base/page-lyr.tex b/tex/context/base/page-lyr.tex index a9bc11ac7..2796ba228 100644 --- a/tex/context/base/page-lyr.tex +++ b/tex/context/base/page-lyr.tex @@ -110,6 +110,8 @@ %D \setlayer [identifier] [optional parameters] {data} %D \stoptypen +\def\currentlayerdata{0} + \def\setlayer% {\dodoubleargument\dosetlayer} @@ -193,6 +195,98 @@ \newdimen\@@layerxsiz \newdimen\@@layerxoff \newdimen\@@layerxpos \newdimen\@@layerysiz \newdimen\@@layeryoff \newdimen\@@layerypos +\let\lastlayerxpos\!!zeropoint +\let\lastlayerypos\!!zeropoint + +% \def\dododosetlayer[#1][#2]% will be sped up +% {\getparameters[\??ll#1][#2]% +% \doifvalue{\??ll#1\c!positie}\v!overlay % slow +% {\getparameters[\??ll#1] +% [\c!breedte=\!!zeropoint, +% \c!hoogte=\!!zeropoint, +% \c!positie=\v!ja]}% +% \@@layerxsiz\getvalue{\??ll#1\c!breedte}% +% \@@layerysiz\getvalue{\??ll#1\c!hoogte }% +% \@@layerxpos\getvalue{\??ll#1\c!x}% +% \@@layerypos\getvalue{\??ll#1\c!y}% +% \doifelsevalue{\??ll#1\c!hoffset}\v!max +% {\@@layerxoff\@@layerxsiz} +% {\@@layerxoff\getvalue{\??ll#1\c!hoffset}}% +% \doifelsevalue{\??ll#1\c!voffset}\v!max +% {\@@layeryoff\@@layerysiz} +% {\@@layeryoff\getvalue{\??ll#1\c!voffset}}% +% \advance\@@layerxoff \getvalue{\??ll#1\c!offset}% +% \advance\@@layeryoff \getvalue{\??ll#1\c!offset}% +% \@@layerxpos\getvalue{\??ll#1\c!sx}\@@layerxpos +% \@@layerypos\getvalue{\??ll#1\c!sy}\@@layerypos +% \@@layerxoff\getvalue{\??ll#1\c!sx}\@@layerxoff +% \@@layeryoff\getvalue{\??ll#1\c!sy}\@@layeryoff +% \doifelsevalue{\??ll#1\c!positie}{\v!ja} % combine ^ +% {\edef\layerpage{\MPp{lyr:\currentlayerdata}}% +% \scratchdimen\MPx{lyr:#1:\layerpage}% +% \scratchdimen-\scratchdimen +% \advance\scratchdimen\MPx{lyr:\currentlayerdata}% +% \xdef\lastlayerxpos{\the\scratchdimen}% +% \@@layerxpos\scratchdimen +% \scratchdimen\MPy{lyr:#1:\layerpage}% +% \advance\scratchdimen-\MPy{lyr:\currentlayerdata}% +% \@@layerypos\scratchdimen +% \xdef\lastlayerypos{\the\scratchdimen}% +% \setxvalue{\??ll#1\layerpage\c!positie}{\v!ja}% +% \setxvalue{\??ll#1\c!status}{\v!start}% needed ? +% \setbox\layerbox\vbox to \@@layerysiz +% {\hbox to \@@layerxsiz{\xypos{lyr:\currentlayerdata}\hss}\vss}} +% {\setbox\layerbox=\emptybox +% \global\let\lastlayerxpos\!!zeropoint +% \global\let\lastlayerypos\!!zeropoint +% \doifvalue{\??ll#1\c!hoek}{\v!onder} +% {\ifdim\@@layerysiz>\zeropoint +% \advance\@@layerypos-\@@layerysiz +% \@@layerypos-\@@layerypos +% \@@layeryoff-\@@layeryoff +% \fi}% +% \edef\layerpage{\getvalue{\??ll#1\c!pagina}}}% +% \doifsomething{\layerpage} +% {\edef\layerpage{:\layerpage}% +% \doifundefined{\@@layerbox#1\layerpage} +% {\global\expandafter\newbox\csname\@@layerbox#1\layerpage\endcsname}}% +% \global\setbox\csname\@@layerbox#1\layerpage\endcsname=\vbox +% {\offinterlineskip +% \ifvoid\csname\@@layerbox#1\layerpage\endcsname\else +% \ht\csname\@@layerbox#1\layerpage\endcsname\zeropoint +% \dp\csname\@@layerbox#1\layerpage\endcsname\zeropoint +% \wd\csname\@@layerbox#1\layerpage\endcsname\zeropoint +% \doifnotvalue{\??ll#1\c!richting}{\v!omgekeerd} +% {\box\csname\@@layerbox#1\layerpage\endcsname}% +% \fi +% \setbox\nextbox=\hbox +% {\alignedbox[\getvalue{\??ll#1\c!plaats}]\vbox{\box\nextbox}}% +% \smashbox\nextbox +% \vskip\@@layerypos +% \vskip\@@layeryoff +% \hskip\@@layerxpos +% \hskip\@@layerxoff +% \box\nextbox +% \ifvoid\csname\@@layerbox#1\layerpage\endcsname +% % already flushed +% \else +% % the reverse case % check ! +% \vskip-\@@layerypos +% \vskip-\@@layeryoff +% \box\csname\@@layerbox#1\layerpage\endcsname +% \fi}% +% \ifvoid\layerbox\else\box\layerbox\fi} + +\def\setlastlayerpos#1% + {\edef\layerpage{\MPp{lyr:\currentlayerdata}}% + \scratchdimen\MPx{lyr:#1:\layerpage}% + \scratchdimen-\scratchdimen + \advance\scratchdimen\MPx{lyr:\currentlayerdata}% + \xdef\lastlayerxpos{\the\scratchdimen}% + \scratchdimen\MPy{lyr:#1:\layerpage}% + \advance\scratchdimen-\MPy{lyr:\currentlayerdata}% + \xdef\lastlayerypos{\the\scratchdimen}} + \def\dododosetlayer[#1][#2]% will be sped up {\getparameters[\??ll#1][#2]% \doifvalue{\??ll#1\c!positie}\v!overlay % slow @@ -204,8 +298,12 @@ \@@layerysiz\getvalue{\??ll#1\c!hoogte }% \@@layerxpos\getvalue{\??ll#1\c!x}% \@@layerypos\getvalue{\??ll#1\c!y}% - \@@layerxoff\getvalue{\??ll#1\c!hoffset}% - \@@layeryoff\getvalue{\??ll#1\c!voffset}% + \doifelsevalue{\??ll#1\c!hoffset}\v!max + {\@@layerxoff\@@layerxsiz} + {\@@layerxoff\getvalue{\??ll#1\c!hoffset}}% + \doifelsevalue{\??ll#1\c!voffset}\v!max + {\@@layeryoff\@@layerysiz} + {\@@layeryoff\getvalue{\??ll#1\c!voffset}}% \advance\@@layerxoff \getvalue{\??ll#1\c!offset}% \advance\@@layeryoff \getvalue{\??ll#1\c!offset}% \@@layerxpos\getvalue{\??ll#1\c!sx}\@@layerxpos @@ -213,19 +311,26 @@ \@@layerxoff\getvalue{\??ll#1\c!sx}\@@layerxoff \@@layeryoff\getvalue{\??ll#1\c!sy}\@@layeryoff \doifelsevalue{\??ll#1\c!positie}{\v!ja} % combine ^ - {\edef\layerpage{\MPp{lyr:\currentlayerdata}}% - \scratchdimen\MPx{lyr:#1:\layerpage}% - \scratchdimen-\scratchdimen - \advance\scratchdimen\MPx{lyr:\currentlayerdata}% - \@@layerxpos\scratchdimen - \scratchdimen\MPy{lyr:#1:\layerpage}% - \advance\scratchdimen-\MPy{lyr:\currentlayerdata}% - \@@layerypos\scratchdimen + {%\edef\layerpage{\MPp{lyr:\currentlayerdata}}% + %\scratchdimen\MPx{lyr:#1:\layerpage}% + %\scratchdimen-\scratchdimen + %\advance\scratchdimen\MPx{lyr:\currentlayerdata}% + %\xdef\lastlayerxpos{\the\scratchdimen}% + %\@@layerxpos\scratchdimen + %\scratchdimen\MPy{lyr:#1:\layerpage}% + %\advance\scratchdimen-\MPy{lyr:\currentlayerdata}% + %\@@layerypos\scratchdimen + %\xdef\lastlayerypos{\the\scratchdimen}% +\setlastlayerpos{#1}% +\@@layerxpos\lastlayerxpos +\@@layerypos\lastlayerypos \setxvalue{\??ll#1\layerpage\c!positie}{\v!ja}% \setxvalue{\??ll#1\c!status}{\v!start}% needed ? \setbox\layerbox\vbox to \@@layerysiz {\hbox to \@@layerxsiz{\xypos{lyr:\currentlayerdata}\hss}\vss}} {\setbox\layerbox=\emptybox + \global\let\lastlayerxpos\!!zeropoint + \global\let\lastlayerypos\!!zeropoint \doifvalue{\??ll#1\c!hoek}{\v!onder} {\ifdim\@@layerysiz>\zeropoint \advance\@@layerypos-\@@layerysiz diff --git a/tex/context/base/page-mak.tex b/tex/context/base/page-mak.tex index 7578020ef..b10562679 100644 --- a/tex/context/base/page-mak.tex +++ b/tex/context/base/page-mak.tex @@ -58,6 +58,7 @@ \c!voetstatus=\v!stop, \c!paginastatus=\v!stop, \c!kleur=, + \c!uitlijnen=, #2]% \setvalue{\e!start#1\e!opmaak}{\startmakeup[#1]}% \setvalue{\e!stop #1\e!opmaak}{\stopmakeup}} @@ -87,8 +88,8 @@ \def\dostartmakeup[#1][#2]% {\bgroup - \the\everymakeup \edef\currentmakeup{#1}% + \the\everymakeup \iffirstargument \setupmakeup[\currentmakeup][#2]% \let\stopmakeup\dodostopmakeup @@ -104,7 +105,7 @@ {\pagina \setupheader[\c!status=\v!leeg]% \setupfooter[\c!status=\v!leeg]% - \vbox to \teksthoogte\bgroup} + \vbox to \teksthoogte\bgroup\hsize\tekstbreedte} \def\donostopmakeup% {\egroup @@ -126,7 +127,9 @@ \global\setbox\makeupbox=\vbox to \makeupparameter\c!hoogte \bgroup \forgetall - \hsize=\makeupparameter\c!breedte + \hsize\makeupparameter\c!breedte + \doifsomething{\makeupparameter\c!uitlijnen} + {\expanded{\steluitlijnenin[\makeupparameter\c!uitlijnen]}}% \makeupparameter\c!boven} \def\dodostopmakeup% @@ -134,7 +137,7 @@ \makeupparameter\c!onder \egroup \flushmarks % new, here, else empty pages - \stopregistercolor +\stopregistercolor \doflushmakeup \egroup \calculatehsizes diff --git a/tex/context/base/page-mar.tex b/tex/context/base/page-mar.tex index 6dbd27198..d1f7bf7ab 100644 --- a/tex/context/base/page-mar.tex +++ b/tex/context/base/page-mar.tex @@ -137,15 +137,24 @@ \ht0=\!!zeropoint \dp0=\!!zeropoint \gdef\margestrutheight{\the\ht\strutbox}% - %\vadjust{\box0}} % fails in high math lines, let it be + %\graphicvadjust{\box0}} % fails in high math lines, let it be %\hbox{\lower\dp\strutbox\box0}} % alas, wrong lapping, therefore useless \dopositionmarginbox0} %D This approach permits us to implement a better mechanism -%D later. +%D later. We need the \type {\graphicvadjust} in order to +%D handle: +%D +%D \starttypen +%D \inlinker{test} {\red \dorecurse{40}{test }\par} +%D {\red \inlinker{test} \dorecurse{40}{test }\par} +%D \stoptypen +%D +%D The outer margin color is either black or color set as +%D main text color. \ifx\dopositionmarginbox\undefined - \def\dopositionmarginbox#1{\vadjust{\box#1}} + \def\dopositionmarginbox#1{\graphicvadjust{\box#1}} \fi \def\doinlinker#1% @@ -375,7 +384,7 @@ \def\oplinker#1% {\strut - \vadjust + \graphicvadjust {\mindermeldingen \setbox0=\vtop{\forgetall\strut#1}% \getboxheight\dimen0\of\box0 diff --git a/tex/context/base/page-mul.tex b/tex/context/base/page-mul.tex index b07f0358e..6ab5bebfd 100644 --- a/tex/context/base/page-mul.tex +++ b/tex/context/base/page-mul.tex @@ -36,7 +36,8 @@ \let\OTRMULdotopinsertions \relax \let\OTRMULdobotinsertions \relax \let\OTRMULdosetbothinserts \relax - +\let\OTRMULflushsavedfloats \relax + \newtoks \OTRMULoutput % check \count<insert> multiplications diff --git a/tex/context/base/page-num.tex b/tex/context/base/page-num.tex index b14ffab1a..815029aef 100644 --- a/tex/context/base/page-num.tex +++ b/tex/context/base/page-num.tex @@ -267,7 +267,7 @@ {\setuserpageno{\ruwenummer[\s!page]}% \doifelse\@@snstatus\v!stop {\global\subpageno\zerocount} - {\global\subpageno\ruwenummer[\s!subpage]}} + {\global\subpageno\ruwenummer[\s!subpage]}\relax} % Standaard is \count0 in Plain TeX de paginateller. Omwille % van de afhandeling van lokaal nummeren, definieren we @@ -320,7 +320,7 @@ \newcounter \nofpagesets -\definetwopasslist{\s!page} +\definetwopasslist\s!page \def\dopagesetreference% {\doglobal\increment\nofpagesets\relax @@ -334,7 +334,7 @@ \def\getpagestatus% hierboven gebruiken {\ifdubbelzijdig - \gettwopassdata{\s!page}% + \gettwopassdata\s!page \iftwopassdatafound \else \let\twopassdata=\realpageno \fi diff --git a/tex/context/base/page-one.tex b/tex/context/base/page-one.tex index 9bf96232b..9d0286b16 100644 --- a/tex/context/base/page-one.tex +++ b/tex/context/base/page-one.tex @@ -335,6 +335,9 @@ \fi \fi} +\def\OTRONEflushsavedfloats + {\dosetbothinserts} + \def\OTRONEsomeherefloat[#1]% spacing between two successive must be better {\baselinecorrection \doplacefloatbox diff --git a/tex/context/base/page-set.tex b/tex/context/base/page-set.tex index 1b7bee5f8..7deece704 100644 --- a/tex/context/base/page-set.tex +++ b/tex/context/base/page-set.tex @@ -67,7 +67,7 @@ \columnspreadfalse \fi \ifcolumnspread - \dorecurse{\nofcolumns} + \dorecurse\nofcolumns {\let\!!stringa\recurselevel \scratchcounter=\recurselevel \advance\scratchcounter\lofcolumns \edef\!!stringb{\the\scratchcounter}% @@ -91,7 +91,7 @@ \fi \fi}}% \else - \dorecurse{\tofcolumns} + \dorecurse\tofcolumns {\let\!!stringa\recurselevel \dostepwiserecurse{0}{\columnmaxcells}{1} {\ifcsname\@otr@:\!!stringa:\recurselevel\endcsname @@ -100,7 +100,7 @@ \expandafter\newbox\csname\@otr@:\!!stringa:\recurselevel\endcsname \fi}}% \fi - \dorecurse{\tofcolumns} + \dorecurse\tofcolumns {\global\setbox\csname\@otr@:\recurselevel:\columnmaxcells\endcsname\copy\placeholderboxa}% \global\columnfirstcell=0 \global\columnlastcell=\columnfirstcell @@ -118,7 +118,7 @@ \columnspreadfalse \fi \ifcolumnspread - \dorecurse{\nofcolumns} + \dorecurse\nofcolumns {\let\!!stringa\recurselevel \scratchcounter=\recurselevel \advance\scratchcounter\lofcolumns \edef\!!stringb{\the\scratchcounter}% @@ -142,7 +142,7 @@ \fi \fi}}% \else - \dorecurse{\tofcolumns} + \dorecurse\tofcolumns {\let\!!stringa\recurselevel \dostepwiserecurse{0}{\columnmaxcells}{1} {\expandafter\ifx\csname\@otr@:\!!stringa:\recurselevel\endcsname\relax @@ -151,7 +151,7 @@ \global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\box\voidb@x \fi}}% \fi - \dorecurse{\tofcolumns} + \dorecurse\tofcolumns {\global\setbox\csname\@otr@:\recurselevel:\columnmaxcells\endcsname\copy\placeholderboxa}% \global\columnfirstcell=0 \global\columnlastcell=\columnfirstcell @@ -187,7 +187,7 @@ %\message{no cells a}% \else \doloop - {\ifnum\columnfirstcell>\columnmaxcells + {\ifnum\columnfirstcell>\columnmaxcells\relax \exitloop \else \OTRSETdoifcellelse{#1}\columnfirstcell @@ -196,7 +196,7 @@ \fi}% \global\columnlastcell=\columnfirstcell \doloop - {\ifnum\columnlastcell>\columnmaxcells + {\ifnum\columnlastcell>\columnmaxcells\relax \exitloop \else \OTRSETdoifcellelse{#1}\columnlastcell @@ -423,6 +423,8 @@ \immediatewriteutilitycommand {\twopassentry{\s!colset}{\the\scratchcounter}{##1}}}% \processcommacommand[\OTRSETbalancinglist]\docommando} + +\let\OTRSETflushsavedfloats\relax \definesystemvariable {mc} \definesystemvariable {mt} @@ -480,7 +482,7 @@ \par \egroup \fi - \page\relax + \page\relax % hack. \page should be page \OTRSETsethsize} \newtoks\OTRSETeverystartofcolumn @@ -902,6 +904,7 @@ \OTRSETsetfreecells\mofcolumns\columnfirstcell \ifsomefreecolumncells \getnoflines{\ht\OTRSETsavedfootnotes}% \footins +\relax \ifnum\columnfreecells<\noflines \global\somefreecolumncellsfalse \else @@ -940,11 +943,18 @@ \setbox#2=\vbox spread \columnslotspacing\lineheight {\vss\box#2\vss}% \fi -%\dp#2=\zeropoint + %\dp#2=\zeropoint \doifdefinedelse{\strippedcsname\OTRSETstoreincolumnslot#1} {\getvalue{\strippedcsname\OTRSETstoreincolumnslot#1}{#2}} {\copy#2}} +\def\OTRSETdocheckiffloatfits % eigenlijk moet else float anders + {\ifnofloatpermitted + \global\roomforfloatfalse + \else + \global\roomforfloattrue + \fi} + %\def\OTRSETsavebox#1% % {\setbox\floatbox=\box#1\dosavefloat} @@ -988,10 +998,31 @@ \newif\ifcentergridcells \centergridcellstrue +\newif\ifcentergridcellonly \centergridcellonlyfalse +\newif\ifautocentergridcellonly \autocentergridcellonlytrue + \def\OTRSETcentergridcells% {\ifcentergridcells - \dorecurse{\nofcolumns} + \dorecurse{\nofcolumns} {\currenthcell=\recurselevel +\ifautocentergridcellonly + % we prevent centering when the next column is empty + % to be checked ! ! ! ! + \advance\currenthcell 1 + \centergridcellonlytrue + \ifnum\currenthcell>\nofcolumns + % ok already + \else + % only span if there is a next column with content + \dorecurse{\columnmaxcells} + {\ifdim\ht\OTRSETgridcell\currenthcell\currentvcell>\zeropoint + \centergridcellonlyfalse + \else\ifdim\dp\OTRSETgridcell\currenthcell\currentvcell>\zeropoint + \centergridcellonlyfalse + \fi\fi}% + \fi +\fi + \currenthcell=\recurselevel \dorecurse{\columnmaxcells} {\currentvcell=\recurselevel\relax \ifdim\ht\OTRSETgridcell\currenthcell\currentvcell>\zeropoint @@ -1006,6 +1037,7 @@ \!!countb=\currenthcell \!!countc=\currenthcell \advance\!!countc 1 \!!donebtrue +\ifcentergridcellonly \!!countc=\maxdimen \fi \dostepwiserecurse{\!!countc}{\nofcolumns}{1} {\if!!doneb \let\xrecurselevel\recurselevel @@ -1307,6 +1339,7 @@ \OTRSEToutput {\OTRSETnaturalflush % \OTRSETgotonextpage +\OTRSETdoflushfloats % zou eigenlijk in \flushsavedfloats moeten (gaat fout) \OTRSETcheckfreelines \OTRSETchecksidefloat} @@ -1329,18 +1362,22 @@ \fi} \def\OTRSEThandlepreposttext% - {\getnoflines{\ht\precolumnbox}% - \doOTRSETsetgridcells - {\copy\placeholderboxe} - 11\nofcolumns\noflines - {\box\precolumnbox}% - \getnoflines{\ht\postcolumnbox}% - \advance\columnfreecells -\noflines - \advance\columnfreecells 1 - \doOTRSETsetgridcells - {\copy\placeholderboxe} - 1\columnfreecells\nofcolumns\noflines - {\box\postcolumnbox}} + {\ifdim\ht\precolumnbox>\zeropoint % new + \getnoflines{\ht\precolumnbox}% + \doOTRSETsetgridcells + {\copy\placeholderboxe} + 11\nofcolumns\noflines + {\box\precolumnbox}% + \fi + \ifdim\ht\postcolumnbox>\zeropoint % new, otherwise empty bottom line + \getnoflines{\ht\postcolumnbox}% + \advance\columnfreecells -\noflines + \advance\columnfreecells 1 + \doOTRSETsetgridcells + {\copy\placeholderboxe} + 1\columnfreecells\nofcolumns\noflines + {\box\postcolumnbox}% + \fi} \def\OTRSETchecksidefloat% {} % {\sidefloatoutput} @@ -1485,7 +1522,7 @@ \def\OTRSETsometopfloat {\def\floatmethod{TOPS}\OTRSETsomeslotfloat} % check \def\OTRSETsomebottomfloat{\def\floatmethod{BOTS}\OTRSETsomeslotfloat} % check -\def\OTRONEsomeslotfloat {\let\floatmethod\v!hier\OTRONEsomeelsefloat} +% \def\OTRSETsomeslotfloat {\let\floatmethod\v!hier\OTRONEsomeelsefloat} \def\OTRSETflushfloatbox% nog verder doorvoeren en meer info in marge {\iftestfloatbox\ruledhbox\fi{\box\floatbox}} @@ -1738,6 +1775,8 @@ \def\startcolumnsetspan% {\dotripleempty\dostartcolumnsetspan} +%%%%%%%%%%%%%%%% TODO + \def\dostartcolumnsetspan[#1][#2][#3]% [#3] gobbles space {\bgroup \!!countc\getvalue{\??kd cs:#1\c!n} % \framedtextparameter{cs:\c!n}% @@ -1746,7 +1785,7 @@ \setcolumnsetspanhsize\mofcolumns\!!countc % a/b used \hsize\columnsetspanhsize \setupframedtexts[cs:#1][\c!breedte=\columnsetspanhsize,#2] - \setbox\scratchbox\ruledhbox \bgroup + \setbox\scratchbox\hbox \bgroup \dostartframedtext[cs:#1][\v!geen] \vskip-\lineheight\par\strut\par} diff --git a/tex/context/base/page-txt.tex b/tex/context/base/page-txt.tex index cafc15ed4..383c2a389 100644 --- a/tex/context/base/page-txt.tex +++ b/tex/context/base/page-txt.tex @@ -67,11 +67,20 @@ \def\setuplayouttext% {\dotripleempty\dosetuplayouttext} +% \def\dosetuplayouttext[#1][#2][#3]% +% {\ifthirdargument +% \getparameters[\??tk#1#2][#3]% +% \else +% \getparameters[\??tk#1\v!tekst][#2]% +% \fi +% \calculatevsizes} + \def\dosetuplayouttext[#1][#2][#3]% {\ifthirdargument \getparameters[\??tk#1#2][#3]% \else - \getparameters[\??tk#1\v!tekst][#2]% + %\getparameters[\??tk#1\v!tekst][#2]% + \getparameters[\??tk#1][#2]% \fi \calculatevsizes} @@ -182,12 +191,18 @@ %D The next macro will be cleaned up amd made less messy and %D dependent. +%\def\placetextlinestrut#1% +% {\doifvalue{#1\v!tekst\c!strut}{\v!ja}{\setstrut\strut}} + +\def\placetextlinestrut#1% + {\doifvalue{#1\c!strut}{\v!ja}{\setstrut\strut}} + \def\dosingletexts#1#2#3#4#5#6% {\bgroup \convertargument#6\to\ascii \doifsomething{\ascii} {\doattributes{#1#2}#3#4% - {\doifvalue{#1\v!tekst\c!strut}{\v!ja}{\setstrut\strut}% here! + {\placetextlinestrut{#1}% here ! %\doifdefinedelse{\??mk\ascii\c!koppeling} % brrr \doifelsemarking\ascii {\dolimitatetexts{#1#2#5}{\haalmarkering[\ascii][\v!eerste]}} @@ -231,20 +246,32 @@ %D Instead we will map the values of status onto macro %D expansions. +%\def\settextlinestatus#1% +% {\edef\textlinestatus{\csname\??tk#1\v!tekst\c!status\endcsname}} + +\def\settextlinestatus#1% + {\edef\textlinestatus{\csname\??tk#1\c!status\endcsname}} + +%\def\resettextlinestatus#1% +% {\global\letvalue{\??tk#1\v!tekst\c!status}\v!normaal} + +\def\resettextlinestatus#1% + {\global\letvalue{\??tk#1\c!status}\v!normaal} + %\def\placelayouttextline#1#2% % handelt o.b.v. tekst -% {\edef\textlinestatus{\getvalue{\??tk#1\v!tekst\c!status}}% +% {\settextlinestatus{#1}% % \doifdefinedelse{\string\placelayouttextline\textlinestatus} % {\getvalue{\string\placelayouttextline\textlinestatus}{#1}{#2}} % {\getvalue{\string\placelayouttextline\s!unknown}{#1}{#2}}} % %\def\placelayouttextline#1% #2 -% {\edef\textlinestatus{\getvalue{\??tk#1\v!tekst\c!status}}% +% {\settextlinestatus{#1}% % \doifundefined{\string\placelayouttextline\textlinestatus} % {\let\textlinestatus\s!unknown}% % \getvalue{\string\placelayouttextline\textlinestatus}{#1}} % {#2} \def\placelayouttextline#1% #2 - {\edef\textlinestatus{\csname\??tk#1\v!tekst\c!status\endcsname}% + {\settextlinestatus{#1}% \ifundefined{\string\placelayouttextline\textlinestatus}% \let\textlinestatus\s!unknown \fi @@ -256,26 +283,25 @@ \letvalue{\string\placelayouttextline\v!hoog }\gobbletwoarguments \setvalue{\string\placelayouttextline\v!leeg}#1#2% - {\setgvalue{\??tk#1\v!tekst\c!status}{\v!normaal}% - }% oeps, bug: \vskip#2\relax} + {\resettextlinestatus{#1}} \setvalue{\string\placelayouttextline\v!start}#1#2% - {\setgvalue{\??tk#1\v!tekst\c!status}{\v!normaal}% + {\resettextlinestatus{#1}% \doplacelayouttextline{#1}{#2}} \setvalue{\string\placelayouttextline\v!stop}#1#2% - {}% oeps, bug:\vskip#2\relax} + {} \setvalue{\string\placelayouttextline\v!geenmarkering}#1#2% {\bgroup - \setgvalue{\??tk#1\v!tekst\c!status}{\v!normaal}% + \resettextlinestatus{#1}% \let\dohaalmarkering=\nohaalmarkering \doplacelayouttextline{#1}{#2}% \egroup} \setvalue{\string\placelayouttextline\s!unknown}#1#2% {\bgroup % new - \setgvalue{\??tk#1\v!tekst\c!status}{\v!normaal}% + \resettextlinestatus{#1}% %\setlocallayoutline{#1\textlinestatus}% %\setlocallayoutline{#1\v!tekst\textlinestatus}% %\setlocallayoutline{#1\v!marge\textlinestatus}% @@ -293,9 +319,14 @@ %D The following macro has to be called after a page %D is flushed. +%\def\resetlayoutline#1% beware: global assignment +% {\doifvalue{\??tk#1\v!tekst\c!status}\v!hoog +% {\resettextlinestatus{#1}% +% \donetrue}} + \def\resetlayoutline#1% beware: global assignment - {\doifvalue{\??tk#1\v!tekst\c!status}\v!hoog - {\global\letvalue{\??tk#1\v!tekst\c!status}\v!normaal + {\doifvalue{\??tk#1\c!status}\v!hoog + {\resettextlinestatus{#1}% \donetrue}} \def\resetlayoutlines% @@ -433,6 +464,83 @@ \def\ignoredlinebreak{\unskip\space\ignorespaces} +% \def\doplacelayouttextline#1#2% +% {\ifdim#2>\zeropoint\relax % prevents pagenumbers when zero height +% \goleftonpage +% \hbox +% {\setbox\scratchpagebox=\vbox to #2 +% {%\forgetall +% \vsize#2\relax +% \normalbaselines +% \let\\\ignoredlinebreak +% \let\crlf\ignoredlinebreak +% \getvalue{\??tk#1\v!tekst\c!voor}% +% \doifbothsidesoverruled +% \dodoplacelayouttextline#1\c!linkertekst\c!middentekst\c!rechtertekst +% \gobbleoneargument\getvalue +% \orsideone +% \dodoplacelayouttextline#1\c!linkertekst\c!middentekst\c!rechtertekst +% \gobbleoneargument\getvalue +% \orsidetwo +% \dodoplacelayouttextline#1\c!rechtertekst\c!middentekst\c!linkertekst +% \getvalue\gobbleoneargument +% \od +% \getvalue{\??tk#1\v!tekst\c!na}% +% \kern\zeropoint}% keep the \dp, beware of \vtops, never change this! +% \dp\scratchpagebox=\zeropoint +% \box\scratchpagebox}% +% \vskip-#2\relax +% \fi} +% +% \def\dodoplacelayouttextline#1#2#3#4#5#6% \hsize toegevoegd +% {\hbox % \hss's niet meer wijzigen +% {\ifdim\linkerrandbreedte>\zeropoint +% \hbox to \linkerrandbreedte +% {\hsize\linkerrandbreedte +% \hss\getvalue{\??tk#1\v!rand#2}}% +% \hskip\linkerrandafstand +% \fi +% \ifdim\linkermargebreedte>\zeropoint +% \hbox to \linkermargebreedte +% {\hsize\linkermargebreedte +% \hbox to \linkermargebreedte +% {\hss\getvalue{\??tk#1\v!marge#2}}% +% \hskip-\linkermargebreedte +% \hbox to \linkermargebreedte +% {\hss#5{\??tk#1\v!marge\c!margetekst}}}% +% \hskip\linkermargeafstand +% \fi +% \ifdim\zetbreedte>\zeropoint +% \hbox to \zetbreedte +% {\hsize\zetbreedte +% \hbox to \zetbreedte +% {\@@nmpre{#5{\??tk#1\v!tekst\c!kantlijntekst}}% +% \getvalue{\??tk#1\v!tekst#2}\hss}% +% \hskip-\zetbreedte +% \hbox to \zetbreedte +% {\hss\getvalue{\??tk#1\v!tekst#3}\hss}% +% \hskip-\zetbreedte +% \hbox to \zetbreedte +% {\hss\getvalue{\??tk#1\v!tekst#4}% +% \@@nmpos{#6{\??tk#1\v!tekst\c!kantlijntekst}}}}% +% \fi +% \ifdim\rechtermargebreedte>\zeropoint +% \hskip\rechtermargeafstand +% \hbox to \rechtermargebreedte +% {\hsize\rechtermargebreedte +% \hbox to \rechtermargebreedte +% {\getvalue{\??tk#1\v!marge#4}\hss}% +% \hskip-\rechtermargebreedte +% \hbox to \rechtermargebreedte +% {#6{\??tk#1\v!marge\c!margetekst}\hss}}% +% \fi +% \ifdim\rechterrandbreedte>\zeropoint +% \hskip\rechterrandafstand +% \hbox to \rechterrandbreedte +% {\hsize\rechterrandbreedte +% \getvalue{\??tk#1\v!rand#4}\hss}% +% \fi}} + \def\doplacelayouttextline#1#2% {\ifdim#2>\zeropoint\relax % prevents pagenumbers when zero height \goleftonpage @@ -443,7 +551,8 @@ \normalbaselines \let\\\ignoredlinebreak \let\crlf\ignoredlinebreak - \getvalue{\??tk#1\v!tekst\c!voor}% + %\getvalue{\??tk#1\v!tekst\c!voor}% + \getvalue{\??tk#1\c!voor}% \doifbothsidesoverruled \dodoplacelayouttextline#1\c!linkertekst\c!middentekst\c!rechtertekst \gobbleoneargument\getvalue @@ -454,25 +563,24 @@ \dodoplacelayouttextline#1\c!rechtertekst\c!middentekst\c!linkertekst \getvalue\gobbleoneargument \od - \getvalue{\??tk#1\v!tekst\c!na}% + %\getvalue{\??tk#1\v!tekst\c!na}% + \getvalue{\??tk#1\c!na}% \kern\zeropoint}% keep the \dp, beware of \vtops, never change this! \dp\scratchpagebox=\zeropoint \box\scratchpagebox}% \vskip-#2\relax \fi} -\def\dodoplacelayouttextline#1#2#3#4#5#6% \hsize toegevoegd - {\hbox % \hss's niet meer wijzigen +\def\dodoplacelayouttextline#1#2#3#4#5#6% \hsize toegevoegd, \hss's niet meer wijzigen + {\hbox {\ifdim\linkerrandbreedte>\zeropoint - \hbox to \linkerrandbreedte - {\hsize\linkerrandbreedte - \hss\getvalue{\??tk#1\v!rand#2}}% + \dododoplacelayouttextline\linkerrandbreedte{#1}\v!rand + {\hss\getvalue{\??tk#1\v!rand#2}}% \hskip\linkerrandafstand \fi \ifdim\linkermargebreedte>\zeropoint - \hbox to \linkermargebreedte - {\hsize\linkermargebreedte - \hbox to \linkermargebreedte + \dododoplacelayouttextline\linkermargebreedte{#1}\v!marge + {\hbox to \linkermargebreedte {\hss\getvalue{\??tk#1\v!marge#2}}% \hskip-\linkermargebreedte \hbox to \linkermargebreedte @@ -480,9 +588,8 @@ \hskip\linkermargeafstand \fi \ifdim\zetbreedte>\zeropoint - \hbox to \zetbreedte - {\hsize\zetbreedte - \hbox to \zetbreedte + \dododoplacelayouttextline\zetbreedte{#1}\v!tekst + {\hbox to \zetbreedte {\@@nmpre{#5{\??tk#1\v!tekst\c!kantlijntekst}}% \getvalue{\??tk#1\v!tekst#2}\hss}% \hskip-\zetbreedte @@ -495,9 +602,8 @@ \fi \ifdim\rechtermargebreedte>\zeropoint \hskip\rechtermargeafstand - \hbox to \rechtermargebreedte - {\hsize\rechtermargebreedte - \hbox to \rechtermargebreedte + \dododoplacelayouttextline\rechtermargebreedte{#1}\v!marge + {\hbox to \rechtermargebreedte {\getvalue{\??tk#1\v!marge#4}\hss}% \hskip-\rechtermargebreedte \hbox to \rechtermargebreedte @@ -505,11 +611,39 @@ \fi \ifdim\rechterrandbreedte>\zeropoint \hskip\rechterrandafstand - \hbox to \rechterrandbreedte - {\hsize\rechterrandbreedte - \getvalue{\??tk#1\v!rand#4}\hss}% + \dododoplacelayouttextline\rechterrandbreedte{#1}\v!rand + {\getvalue{\??tk#1\v!rand#4}\hss}% \fi}} +% \def\dododoplacelayouttextline#1#2#3#4% +% {\hbox to #1{\hsize#1\relax#4}} + +\def\dododoplacelayouttextline#1#2#3#4% + {\vbox % to \vsize + {\hsize#1\relax + %\executeifdefined{\??tk#2#3\c!voor}\relax + \getvalue{\??tk#2#3\c!voor}\relax + \hbox to #1{#4}% + %\executeifdefined{\??tk#2#3\c!na}\relax}} + \getvalue{\??tk#2#3\c!na}\relax}} + +%D Although it is far better to use backgrounds for this +%D purpose, one can add a rule in the following way. This +%D method makes the rules disappear in case of an empty text +%D line. Consider this a feature. +%D +%D \starttypen +%D \setupheadertexts[left][right] +%D +%D \setupheader[text][after=\hrule,style=bold] +%D +%D \starttext +%D \input tufte \page +%D \setupheader[state=empty] +%D \input tufte \page +%D \stoptext +%D \stoptypen + %D The next twosome will be done differently (using an %D existing auxiliary macro). @@ -620,7 +754,7 @@ \def\dodocommando[#1][#2]% {\getparameters [\??tk#1#2] - [\c!status=\v!normaal, + [%\c!status=\v!normaal, % moved, kan tzt weg \c!voor=, \c!na=, \c!strut=, @@ -656,10 +790,16 @@ %D While the header and footer lines are moved away from the %D main text, the top and bottom lines are centered. -\setuptop [\c!voor=\vss, \c!na=\vss, \c!strut=] -\setupheader [\c!voor=, \c!na=\vss, \c!strut=\v!ja] -\setuptext [\c!voor=\vss, \c!na=\vss, \c!strut=] -\setupfooter [\c!voor=\vss, \c!na=, \c!strut=\v!ja] -\setupbottom [\c!voor=\vss, \c!na=\vss, \c!strut=] +%\setuptop [\c!voor=\vss, \c!na=\vss, \c!strut=] +%\setupheader [\c!voor=, \c!na=\vss, \c!strut=\v!ja] +%\setuptext [\c!voor=\vss, \c!na=\vss, \c!strut=] +%\setupfooter [\c!voor=\vss, \c!na=, \c!strut=\v!ja] +%\setupbottom [\c!voor=\vss, \c!na=\vss, \c!strut=] + +\setuptop [\c!status=\v!normaal,\c!voor=\vss,\c!na=\vss,\c!strut=] +\setupheader[\c!status=\v!normaal,\c!voor=, \c!na=\vss,\c!strut=\v!ja] +\setuptext [\c!status=\v!normaal,\c!voor=\vss,\c!na=\vss,\c!strut=] +\setupfooter[\c!status=\v!normaal,\c!voor=\vss,\c!na=, \c!strut=\v!ja] +\setupbottom[\c!status=\v!normaal,\c!voor=\vss,\c!na=\vss,\c!strut=] \protect \endinput diff --git a/tex/context/base/s-pre-07.tex b/tex/context/base/s-pre-07.tex index 8afa22bef..3f4c51087 100644 --- a/tex/context/base/s-pre-07.tex +++ b/tex/context/base/s-pre-07.tex @@ -12,7 +12,7 @@ %C details. %D This style was made for the \NTS\ presentation at -%D \EUROTEX\ 1999. It's a to programming in a webbed way. +%D \EUROTEX\ 1999. It's a wink to programming in a webbed way. %D This is just one way of implementing such a style. Today %D we have more \METAPOST\ interfacing available, and %D thereby moore tools and alternative ways to reach such a @@ -20,8 +20,6 @@ %D the other hand, the presentation can look quite structured. %D %D \starttypen -%D \TitlePage{...\\...\\...} -%D %D \Topics{...} %D %D \StartIdeas diff --git a/tex/context/base/setupb.tex b/tex/context/base/setupb.tex index dc54da3c2..79a63d122 100644 --- a/tex/context/base/setupb.tex +++ b/tex/context/base/setupb.tex @@ -1424,6 +1424,10 @@ [\c!voorgrondkleur] [\c!identifier!] [] + \variable + [\c!voorgrondletter] + [\c!identifier!] + [] \value [\c!text!] [] @@ -3217,6 +3221,10 @@ [\v!normaal,\v!vet,\v!schuin,\v!vet\v!schuin,\v!type,\v!kap,\v!klein...,\c!command!] [\v!normaal] \variable + [\c!kleur] + [\c!identifier!] + [] + \variable [\c!markering] [\v!aan,\v!uit,\v!kleur] [\v!uit] @@ -3304,8 +3312,10 @@ \type [\c!opt!\c!val!] \value - [\v!boven,\v!beide,\v!onder] - [\v!beide] + [\v!boven,\v!beide,\v!onder,-\v!boven,-\v!beide,-\v!onder, + \v!hoog,\v!midden,\v!laag,\v!pagina,\v!standaard,\v!geen, + \v!ruim,\v!passend] + [\v!standaard] \stopsetup \startsetup @@ -3550,7 +3560,7 @@ [\v!onder] \variable [\c!breedte] - [\v!passend,\v!max,\c!dimension!] + [\v!passend,\v!ruim,\v!max,\c!dimension!] [\v!passend] \variable [\c!kopletter] @@ -6794,8 +6804,12 @@ [\lijndikte] \variable [\c!afstand] - [\v!blanko,\v!diepte,\c!dimension!,\v!klein,\v!middel,\v!groot,\v!geen] + [\v!blanko,\v!grid,\v!diepte,\c!dimension!,\v!klein,\v!middel,\v!groot,\v!geen] [\v!diepte,\v!middel] + \variable + [\c!korps] + [5pt,...,12pt,\v!klein,\v!groot] + [] \stopsetup \startsetup @@ -6859,6 +6873,10 @@ [\c!achtergrondkleur] [\c!identifier!] [] + \variable + [\c!korps] + [5pt,...,12pt,\v!klein,\v!groot] + [] \stopsetup \startsetup diff --git a/tex/context/base/spec-def.tex b/tex/context/base/spec-def.tex index ea1fdd192..09c7f27ff 100644 --- a/tex/context/base/spec-def.tex +++ b/tex/context/base/spec-def.tex @@ -282,6 +282,13 @@ \installspecial [\dostartnegative] [or] [0] \installspecial [\dostopnegative] [or] [0] + +%D The following two specials are used in for instance \type +%D {\vadjust}'d margin material inside colored paragraphs. + +\installspecial [\dostartgraphicgroup] [or] [0] +\installspecial [\dostopgraphicgroup ] [or] [0] + %D \macros %D {doselectfirstpaperbin, %D doselectsecondpaperbin} diff --git a/tex/context/base/spec-dvi.tex b/tex/context/base/spec-dvi.tex index be8fdd73c..2e08c7a8b 100644 --- a/tex/context/base/spec-dvi.tex +++ b/tex/context/base/spec-dvi.tex @@ -54,7 +54,7 @@ \advance\dimen0 -\!!onepoint \setbox2=\vsplit0 to \dimen0 \ifdim\ht0>\!!onepoint - \setbox0=\vsplit0 \!!onepoint + \setbox0=\vsplit0 to \!!onepoint \fi \unvbox0\setbox0=\lastbox\unhbox0 \egroup} diff --git a/tex/context/base/spec-fdf.tex b/tex/context/base/spec-fdf.tex index 1c8913957..3b688f097 100644 --- a/tex/context/base/spec-fdf.tex +++ b/tex/context/base/spec-fdf.tex @@ -725,11 +725,16 @@ \def\doPDFinsertsoundtrack#1#2#3% {\bgroup \xdef\currentsound{#2}% + \let\pdf@@actions\empty + \@EA\processallactionsinset\@EA + [#3] + [\v!herhaal=>\edef\pdf@@actions{\pdf@@actions /Mode /Repeat }]% \flushatshipout % since it can be buried in a chained box {\doPDFannotation width 0pt height 0pt data {/Subtype /Movie /T (sound \currentsound) - /Movie <</F (#1)>>}}% + /Movie <</F (#1)>>% + \ifx\pdf@@actions\empty\else/A << \pdf@@actions >>\fi}}% \egroup} %D \macros @@ -1595,16 +1600,48 @@ \def\savesecondaryPDFreference % #1 == \action {\global\@EA\let\csname PDF-SR:\the\nofsecondaryreferences\endcsname} +%\def\getsecondaryPDFreferences% +% {\ifcase\nofsecondaryreferences\else +% %\doifdefined{PDF-SR:\the\nofsecondaryreferences} +% \xdef\secondaryPDFreferences% +% {/Next << \csname PDF-SR:\the\nofsecondaryreferences\endcsname\space +% \secondaryPDFreferences >>}% +% \global\advance\nofsecondaryreferences \minusone +% \expandafter\getsecondaryPDFreferences +% \fi} + +% test should happen in core-ref + +\beginETEX \ifcsname + \def\getsecondaryPDFreferences% {\ifcase\nofsecondaryreferences\else - %\doifdefined{PDF-SR:\the\nofsecondaryreferences} - \xdef\secondaryPDFreferences% - {/Next << \csname PDF-SR:\the\nofsecondaryreferences\endcsname\space - \secondaryPDFreferences >>}% + \ifcsname PDF-SR:\the\nofsecondaryreferences\endcsname + \xdef\secondaryPDFreferences% + {/Next << \csname PDF-SR:\the\nofsecondaryreferences\endcsname\space + \secondaryPDFreferences >>}% + \fi \global\advance\nofsecondaryreferences \minusone \expandafter\getsecondaryPDFreferences \fi} +\endETEX + +\beginTEX + +\def\getsecondaryPDFreferences% + {\ifcase\nofsecondaryreferences\else + \@EA\ifx\csname PDF-SR:\the\nofsecondaryreferences\endcsname\relax\else + \xdef\secondaryPDFreferences% + {/Next << \csname PDF-SR:\the\nofsecondaryreferences\endcsname\space + \secondaryPDFreferences >>}% + \fi + \global\advance\nofsecondaryreferences \minusone + \expandafter\getsecondaryPDFreferences + \fi} + +\endTEX + %D \macros %D {loadFDFfields, showFDFfields, %D getFDFfield, setFDFfield} @@ -1857,12 +1894,12 @@ \def\doPDFovalbox#1#2#3#4#5#6#7% todo: \scratchdimen/\scatchbox {\bgroup \dimen0=#4\divide\dimen0 by 2 - \doPDFovalcalc{0}{+\dimen0}\xmin + \doPDFovalcalc{0pt}{+\dimen0}\xmin \doPDFovalcalc{#1}{-\dimen0}\xmax \doPDFovalcalc{#2}{-\dimen0}\ymax \doPDFovalcalc{-#3}{+\dimen0}\ymin \advance\dimen0 by #5% - \doPDFovalcalc{0}{+\dimen0}\xxmin + \doPDFovalcalc{0pt}{+\dimen0}\xxmin \doPDFovalcalc{#1}{-\dimen0}\xxmax \doPDFovalcalc{#2}{-\dimen0}\yymax \doPDFovalcalc{-#3}{+\dimen0}\yymin @@ -2027,6 +2064,11 @@ \let\presetPDFtransparency \gobbletwoarguments \let\initializetransparency\relax +%D New trickery: + +\definespecial\dostartgraphicgroup{\pdfliteral{q}} +\definespecial\dostopgraphicgroup {\pdfliteral{Q}} + %D And that was all. \stopspecials diff --git a/tex/context/base/spec-ini.tex b/tex/context/base/spec-ini.tex index db56152e6..3b07bec4b 100644 --- a/tex/context/base/spec-ini.tex +++ b/tex/context/base/spec-ini.tex @@ -13,6 +13,13 @@ \newif\ifsimplifyspecials \simplifyspecialstrue % see later +%D We will forbid loading specials after the first page is +%D shipped out. + +\ifx\realpageno\undefined + \countdef\realpageno=0 \realpageno=1 +\fi + %D Specials are \TEX's channel to the outside world. They make %D \TEX\ even more platform independant and permit easy %D adaption to new developments. One major drawback of specials @@ -400,9 +407,11 @@ \showmessage\m!specials1\preloadedspecials}} \def\usespecials[#1]% - {\doifelsenothing{\currentspecial} - {\processcommalist[#1]\dousespecials} - {\showmessage\m!specials6\empty}} + {\ifnum\realpageno<2 + \doifelsenothing{\currentspecial} + {\processcommalist[#1]\dousespecials} + {\showmessage\m!specials6\empty}% + \fi} %D \macros %D {executespecials} @@ -642,6 +651,8 @@ {\showmessage{\m!specials}{7}{#1}}}} \def\setupoutput[#1]% - {\resetspecials\processcommacommand[#1]\dosetupoutput} + {\ifnum\realpageno<2 % new + \resetspecials\processcommacommand[#1]\dosetupoutput + \fi} \protect \endinput diff --git a/tex/context/base/spec-ps.tex b/tex/context/base/spec-ps.tex index b31a4e4c0..409c77e62 100644 --- a/tex/context/base/spec-ps.tex +++ b/tex/context/base/spec-ps.tex @@ -113,6 +113,12 @@ {\@@insertpostscriptliteral grestore}} +\definespecial\dostartgraphicgroup + {\special{\@@insertpostscriptliteral gsave}} + +\definespecial\dostopgraphicgroup + {\special{\@@insertpostscriptliteral grestore}} + %D \macros %D {doovalbox} %D diff --git a/tex/context/base/supp-fun.tex b/tex/context/base/supp-fun.tex index fd95d6691..6856a21ed 100644 --- a/tex/context/base/supp-fun.tex +++ b/tex/context/base/supp-fun.tex @@ -552,8 +552,8 @@ %D Extra: -\def\WidthSpanningText #1#2#3% text width font - {\hbox{\NormalizeFontWidth \temp{#1}{#2}{#3}\temp#1}} +\def\WidthSpanningText#1#2#3% text width font + {\hbox{\NormalizeFontWidth\temp{#1}{#2}{#3}\temp\the\everydefinedfont#1}} %D Consider for instance: %D diff --git a/tex/context/base/supp-mis.tex b/tex/context/base/supp-mis.tex index 053497f47..3f2b803f7 100644 --- a/tex/context/base/supp-mis.tex +++ b/tex/context/base/supp-mis.tex @@ -624,6 +624,10 @@ \immediate\closein\scratchread \next} +%D New. + +\let\donothing\empty + %D That's it. Please forget this junk and take a look at how %D it should be done. diff --git a/tex/context/base/supp-mpe.tex b/tex/context/base/supp-mpe.tex index 6d8a8a18c..222a1947e 100644 --- a/tex/context/base/supp-mpe.tex +++ b/tex/context/base/supp-mpe.tex @@ -284,20 +284,6 @@ \def\@@MPSK{@MPSK@} -% \def\interceptMPcmykcolor -% {\ifMPcmyk -% \ifnum\MPrgbnumber\lastMPgvalue=1 % cmyk color spec -% \doifdefined{\@@MPSK\number\MPrgbnumber\lastMPbvalue} -% {\getvalue{\@@MPSK\number\MPrgbnumber\lastMPbvalue}% -% \resetMPcolor\normalhandleMPcmykcolor}% -% \fi -% \fi} - -%\def\interceptMPcmykcolor % can be used often, so sped up -% {\ifcase\MPrgbnumber\lastMPgvalue \or % 1 == cmyk color spec -% \expandafter\dointerceptMPcmykcolor -% \fi} - \def\interceptMPcmykcolor % todo : \ifMPcmyk {\ifcase\MPrgbnumber\lastMPgvalue % cannot happen @@ -312,16 +298,10 @@ \ifMPcmyk \invokeMPtransparencyspecial \fi \fi} -%\def\dointerceptMPcmykcolor % can be used often, so sped up -% {\@EA\ifx\csname\@@MPSK\number\MPrgbnumber\lastMPbvalue\endcsname\relax\else -% \csname\@@MPSK\number\MPrgbnumber\lastMPbvalue\endcsname -% \resetMPcolor\normalhandleMPcmykcolor -% \fi} - \def\dointerceptMPcmykcolor % can be used often, so sped up {\revokeMPtransparencyspecial \@EA\ifx\csname\@@MPSK\number\MPrgbnumber\lastMPbvalue\endcsname\relax\else - \csname\@@MPSK\number\MPrgbnumber\lastMPbvalue\endcsname + \@EA\@EA\@EA\setMPcmyk\csname\@@MPSK\number\MPrgbnumber\lastMPbvalue\endcsname \normalhandleMPcmykcolor \fi} @@ -559,17 +539,81 @@ \appendtoks \invokeMPshadespecial \to \invokeMPspecials +%D We need to convert the \CMYK\ specials into colors, because +%D we have to do it twice, we define a macro. + +\def\checkMPshadingcolor#1#2#3#4#5% + {\edef\tempMPrvalue{\csname\@@MP0#1\endcsname}% + \edef\tempMPgvalue{\csname\@@MP0#2\endcsname}% + \edef\tempMPbvalue{\csname\@@MP0#3\endcsname}% + \edef#5% + {\ifx\tempMPrvalue\tempMPgvalue + \ifx\tempMPrvalue\tempMPbvalue + \ifx\tempMPgvalue\tempMPbvalue + \tempMPbvalue + \fi + \fi + \fi}% + \edef#4% + {\ifnum\MPrgbnumber\tempMPrvalue=\MPspecialsignal\space + \ifMPcmyk\getvalue{\@@MPSK\number\MPrgbnumber\tempMPbvalue}\fi + \fi}} + +%D We also need to make sure that we have two \RGB\ or +%D \CMYK colors, since we have to set the colorspace. + +\def\setMPshadingcolors#1#2#3#4#5#6% + {\checkMPshadingcolor{#1}{#2}{#3}\MPshadeA\MPshadeAA + \checkMPshadingcolor{#4}{#5}{#6}\MPshadeB\MPshadeBB + \ifx\MPshadeA\empty + \ifx\MPshadeB\empty + \edef\MPshadeA{\gMPs{#1} \gMPs{#2} \gMPs{#3}}% + \edef\MPshadeB{\gMPs{#4} \gMPs{#5} \gMPs{#6}}% + \def \MPshadeC{RGB}% + \else + \ifx\MPshadeAA\empty + \let\MPshadeA\MPcmykWhite + \let\MPshadeB\MPcmykBlack + \else + \scratchdimen=1pt\advance\scratchdimen -\MPshadeAA pt + \edef\MPshadeA{0 0 0 \withoutpt\the\scratchdimen}% + \fi + \def\MPshadeC{CMYK}% + \fi + \else + \ifx\MPshadeB\empty + \ifx\MPshadeBB\empty + \let\MPshadeA\MPcmykWhite + \let\MPshadeB\MPcmykBlack + \else + \scratchdimen=1pt\advance\scratchdimen -\MPshadeBB pt + \edef\MPshadeB{0 0 0 \withoutpt\the\scratchdimen}% + \fi + \fi + \def\MPshadeC{CMYK}% + \fi} + +%D The reason why this macro is a bit complicates is that we +%D handle black and white situations (otherwise we would have +%D to use \CMYK\ b/w in case of a \CMYK\ shade). + +\def\MPcmykBlack{0 0 0 0} +\def\MPcmykWhite{0 0 0 1} + +%D Here are the special handlers: + \defineMPspecial{30} {\startMPshading{14}% type 2 + \setMPshadingcolors{4}{5}{6}{9}{10}{11}% \immediate\pdfobj {<</FunctionType 2 /Domain [\gMPs1 \gMPs2] - /C0 [\gMPs4 \gMPs5 \gMPs6] - /C1 [\gMPs9 \gMPs{10} \gMPs{11}] + /C0 [\MPshadeA] + /C1 [\MPshadeB] /N \gMPs3>>}% \immediate\pdfobj {<</ShadingType 2 - /ColorSpace /DeviceRGB + /ColorSpace /Device\MPshadeC\space /Function \the\pdflastobj\space 0 R /Coords [\gMPs7 \gMPs8 \gMPs{12} \gMPs{13}] /Extend [true true]>>}% @@ -577,15 +621,16 @@ \defineMPspecial{31} {\startMPshading{16}% type 3 + \setMPshadingcolors{4}{5}{6}{10}{11}{12}% \immediate\pdfobj {<</FunctionType 2 /Domain [\gMPs1 \gMPs2] - /C0 [\gMPs4 \gMPs5 \gMPs6] - /C1 [\gMPs{10} \gMPs{11} \gMPs{12}] + /C0 [\MPshadeA] + /C1 [\MPshadeB] /N \gMPs3>>}% \immediate\pdfobj {<</ShadingType 3 - /ColorSpace /DeviceRGB + /ColorSpace /Device\MPshadeC\space /Function \the\pdflastobj\space 0 R /Coords [\gMPs7 \gMPs8 \gMPs9 \gMPs{13} \gMPs{14} \gMPs{15}] /Extend [true true]>>}% @@ -707,12 +752,12 @@ %D {\CMYK\ support disabled, %D conversion to \RGB.} %D {\setupcolors[cmyk=nee,status=start]\haalbuffer[cmyk]} -%D +%D %D \plaatsfiguur %D {\CMYK\ support enabled, %D no support in \METAPOST.} %D {\setupcolors[cmyk=ja,mpcmyk=nee,status=start]\haalbuffer[cmyk]} -%D +%D %D \plaatsfiguur %D {\CMYK\ support enabled, %D no conversion to \RGB, @@ -721,9 +766,9 @@ \defineMPspecial{1} {\ifMPcmyk - \setxvalue{\@@MPSK\gMPs1}{\noexpand\setMPcmyk\gMPs2 \gMPs3 \gMPs4 \gMPs5 }% + \setxvalue{\@@MPSK\gMPs1}{\gMPs2 \gMPs3 \gMPs4 \gMPs5 }% \fi} - + \def\setMPcmyk#1 #2 #3 #4 % {\setvalue{\@@MP01}{#1}% \setvalue{\@@MP02}{#2}% @@ -763,16 +808,16 @@ %D imagine situations where tex has to work with values %D calculated by \METAPOST. %D -%D \startlinecorrection +%D \startregelcorrectie %D \getbuffer -%D \stoplinecorrection +%D \stopregelcorrectie %D %D Later we will implement a more convenient macro: %D -%D \starttyping +%D \starttypen %D \setMPlayer [test] [somepos-1] {Whatever we want here!} %D \setMPlayer [test] [somepos-2] {Whatever we need there!} -%D \stoptyping +%D \stoptypen \ifx\dosavepositionwhd\undefined \let\dosavepositionwhd\gobblesevenarguments @@ -799,10 +844,6 @@ %D \startbuffer %D u := 2cm ; path p ; p := fullcircle scaled u shifted (u/4,0); %D -%D color cyan ; cyan := cmyk(1,0,0,0) ; -%D color magenta ; magenta := cmyk(0,1,0,0) ; -%D color yellow ; yellow := cmyk(0,0,1,0) ; -%D %D fill p rotated 90 withcolor transparent(1,.5,yellow) ; %D fill p rotated 210 withcolor transparent(1,.5,green) ; %D fill p rotated 330 withcolor transparent(1,.5,blue) ; @@ -810,7 +851,7 @@ %D %D \typebuffer %D -%D \startlinecorrection \processMPbuffer \stoplinecorrection +%D \startregelcorrectie \processMPbuffer \stopregelcorrectie %D %D One can also communicate colors between \CONTEXT\ and %D \METAPOST: @@ -831,7 +872,7 @@ %D fill p rotated 330 withcolor \MPcolor{tyellow} ; %D \stopbuffer %D -%D \startlinecorrection \processMPbuffer \stoplinecorrection +%D \startregelcorrectie \processMPbuffer \stopregelcorrectie %D %D We save all the three components needed in one macro, %D just to save hash space. @@ -846,7 +887,7 @@ \defineMPspecial{2} {\edef\currentMPspecial{\gMPs6}% \presetPDFtransparency{\gMPs1}{\gMPs2}% - \setxvalue{\@@MPST\currentMPspecial}% + \setevalue{\@@MPST\currentMPspecial}% was \setxvalue, bug ! {\noexpand\assignMPStransparency {\PDFtransparencyidentifier}% {\PDFtransparencyreference}% @@ -855,7 +896,7 @@ \defineMPspecial{3} {\edef\currentMPspecial{\gMPs7}% \presetPDFtransparency{\gMPs1}{\gMPs2}% - \setxvalue{\@@MPST\currentMPspecial}% + \setevalue{\@@MPST\currentMPspecial}% was \setxvalue, bug ! {\noexpand\assignMPStransparency {\PDFtransparencyidentifier}% {\PDFtransparencyreference}% @@ -907,6 +948,10 @@ \let\revokeMPtransparencyspecial\relax +\appendtoks + \revokeMPtransparencyspecial +\to \MPstopresources + \def\dorevokeMPtransparencyspecial % only called if state is set {\ifx\PDFtransparencyresetidentifier\empty\else \doifinstringelse\PDFtransparencyresetidentifier\currentMPtransparencies @@ -961,22 +1006,31 @@ \let\PDFtransparencyreference \empty \def\initializePDFtransparency - {\presetPDFtransparency{1}{1}% + {\global\let\initializePDFtransparency\relax + \presetPDFtransparency{1}{1}% \xdef\PDFtransparencyresetidentifier{/Tr0}% - \xdef\PDFtransparencyresetreference{\the\pdflastobj\space 0 R}% - \global\initializePDFtransparency\relax} + \xdef\PDFtransparencyresetreference{\the\pdflastobj\space 0 R}} \def\presetPDFtransparency#1#2% {\initializePDFtransparency \@EA\ifx\csname\@@MPSTO#1:#2\endcsname\relax \global\advance\PDFcurrenttransparency 1 - \immediate\pdfobj{\PDFtransparancydictionary{#1}{#2}{}}% + \immediate\pdfobj{\PDFtransparencydictionary{#1}{#2}{}}% \setxvalue{\@@MPSTN#1:#2}{\the\PDFcurrenttransparency}% \setxvalue{\@@MPSTO#1:#2}{\the\pdflastobj}% \fi \edef\PDFtransparencyidentifier{/Tr\getvalue{\@@MPSTN#1:#2}}% \edef\PDFtransparencyreference{\getvalue{\@@MPSTO#1:#2} 0 R}} + \def\PDFtransparencydictionary#1#2#3% type fraction extras + {<</Type /ExtGState + /ca #2 /CA #2 + /BM /\ifcase#1 Normal\or Normal\or Multiply\or Screen\or + Overlay\or SoftLight\or HardLight\or ColorDodge\or + ColorBurn\or Darken\or Lighten\or Difference\or + Exclusion\else Compatible\fi + #3>>} + \fi \appendtoks diff --git a/tex/context/base/supp-mps.tex b/tex/context/base/supp-mps.tex index 7f9ad6b7b..97be8f30a 100644 --- a/tex/context/base/supp-mps.tex +++ b/tex/context/base/supp-mps.tex @@ -426,9 +426,11 @@ \immediate\write\MPwrite{let mprunend = end ;}% \immediate\write\MPwrite{beginfig(\the\currentMPgraphic);}% \fi - \global\let\flushMPgraphics\dodostopwritingMPgraphic + \global\let\flushMPgraphics\closeMPgraphicfiles % \dodostopwritingMPgraphic \global\let\stopwritingMPgraphic=\dostopwritingMPgraphic} +\let\MPgraphicfiles\empty + \def\openMPgraphicfile#1#2% #1=alwaysopen #2=message {%\doifundefinedelse{\@@MPG\@@MPG\MPgraphicfile} % {\donetrue @@ -436,6 +438,7 @@ % {\ifcase#1\donefalse\else\donetrue\fi}% \@EA\ifx\csname\@@MPG\@@MPG\MPgraphicfile\endcsname\relax \donetrue \@EA\newwrite\csname\@@MPG\@@MPG\MPgraphicfile\endcsname + \doglobal\addtocommalist\MPgraphicfile\MPgraphicfiles \else \ifcase#1\relax\donefalse\else\donetrue\fi \fi @@ -466,12 +469,24 @@ \donefalse \fi\fi \ifdone - \immediate\write\MPwrite{end.}% - \immediate\closeout\MPwrite + \finishwritingMPgraphics \runMPgraphic\MPgraphicfile \fi \global\let\flushMPgraphics\relax} +\def\finishwritingMPgraphics + {\immediate\write\MPwrite{end.}% + \immediate\closeout\MPwrite} + +\def\closeMPgraphicfiles + {\ifrunMPgraphics \else \ifx\MPgraphicsfiles\empty\else + \def\docommando##1% + {\message{[flush and process ##1.mp afterwards]}% + \@EA\let\@EA\MPwrite\csname\@@MPG\@@MPG##1\endcsname + \finishwritingMPgraphics}% + \processcommacommand[\MPgraphicfiles]\docommando + \fi \fi} + \let\stopwritingMPgraphic\relax \let\flushMPgraphics \relax @@ -713,7 +728,7 @@ {\ifrunMPgraphics \executeMETAPOST{#1}% \else - \message{[flush and process \MPgraphicfile.mp afterwards]}% + % \message{[flush and process \MPgraphicfile.mp afterwards]}% \fi} %D \macros @@ -1175,6 +1190,9 @@ \def\dodohandleMPcolor#1 #2 #3setrgbcolor#4setrgbcolor*\\% {\bgroup +\ifdim\MPspecialsignal=.123pt % color spec / hardcoded hack + \immediate\write\scratchwrite{#1 #2 #3 setrgbcolor}% +\else \ifforcegrayMPcolors \convertRGBtoGRAY{#1}{#2}{#3}% \immediate\write\scratchwrite @@ -1199,6 +1217,7 @@ \withoutpt{\the\dimen4} \space \withoutpt{\the\dimen6} \space setcmykcolor #4}% \fi +\fi \egroup \donetrue} % needed for message diff --git a/tex/context/base/supp-mrk.tex b/tex/context/base/supp-mrk.tex index 8be8dd18f..85c11f428 100644 --- a/tex/context/base/supp-mrk.tex +++ b/tex/context/base/supp-mrk.tex @@ -377,108 +377,7 @@ \endTEX -% %D Here starts the \ETEX\ alternative. -% -% \beginETEX \marks cum suis -% -% \newtoks \listofmarks -% -% \def\@@mrk{mrk:} -% \def\@@trk{trk:} -% \def\@@crk{crk:} -% -% \def\getcurrentmark {\getsomemark\thecurrentmarks} -% \def\gettopmark {\getsomemark\checkedtopmarks} -% \def\getbottommark {\getsomemark\normalbotmarks} -% \def\getfirstmark {\getsomemark\normalfirstmarks} -% \def\getsplitbottommark{\getsomemark\normalsplitbotmarks} -% \def\getsplitfirstmark {\getsomemark\normalsplitfirstmarks} -% -% \def\getbotmark {\getsomemark\normalbotmarks} -% \def\getsplitbotmark {\getsomemark\normalsplitbotmarks} -% \def\getsplittopmark {\getsomemark\normalsplitfirstmarks} -% -% %D \starttypen -% %D \def\getsomemark#1#2% -% %D {\ifnum\getvalue{\@@mrk\string#2}=0\else % still reset -% %D \expandafter\gobbletwoarguments -% %D \fi#1#2} -% %D \stoptypen -% %D -% %D We need a fully expandable (in \type {\edef}) version of -% %D this one ... -% -% \letvalue{@@0}\empty -% \letvalue{@@1}\gobbletwoarguments -% -% \def\getsomemark#1#2% (0,min(1,savedpage)) -% {\csname -% @@\ifcase\csname\@@mrk\string#2\endcsname\space0\else1\fi -% \endcsname#1#2} -% -% %D ... and so we have another ugly but useful hack. -% %D -% %D We will use two state variables per mark, one to signal -% %D that a new mark value is set, and one to trigger (on the -% %D next page) the setting of the top mark. -% -% \def\checkedtopmarks#1{\csname\@@trk\string#1\endcsname} -% \def\thecurrentmarks#1{\csname\@@crk\string#1\endcsname} -% -% \long\def\setmark#1% -% {\global\@EA\let\csname\@@mrk\string#1\endcsname\zerocountervalue -% \ifexpandmarks -% \expandafter\setexpandedmark -% \else -% \expandafter\setnormalmark -% \fi#1} -% -% \def\setexpandedmark#1#2% % marks expand anyway -% {\@EA\xdef\csname\@@crk\string#1\endcsname{#2}% -% \normalmarks#1{#2}} -% -% \def\setnormalmark#1#2% using a tok prevents unwanted expansion in mark -% {\scratchtoks{#2}% -% \@EA\xdef\csname\@@crk\string#1\endcsname{\the\scratchtoks}% -% \normalmarks#1{\the\scratchtoks}} % one level expansion -% -% \def\checktopmark#1% is called often, so its minimized -% {\ifcase\csname\@@mrk\string#1\endcsname\else -% \@EA\dochecktopmark\@EA#1% -% \fi} -% -% \def\dochecktopmark#1% -% {\ifnum\realpageno>\csname\@@mrk\string#1\endcsname\relax -% \@EA\xdef\csname\@@trk\string#1\endcsname{\normalbotmarks#1}% -% \fi} -% -% \def\resetmark#1% we cannot use \normalmarks#1{}} -% {\@EA\xdef\csname\@@mrk\string#1\endcsname{\realfolio}% -% \global\@EA\let\csname\@@trk\string#1\endcsname\empty} -% -% \def\definenewmark#1% -% {\ifcsname\@@mrk\string#1\endcsname\else % this is etex -) -% \newmarks#1% -% \appendtoks\checktopmark#1\to\listofmarks -% \fi -% \global\@EA\let\csname\@@crk\string#1\endcsname\empty -% \global\@EA\let\csname\@@mrk\string#1\endcsname\zerocountervalue -% \@EA\gdef\csname\@@trk\string#1\endcsname{\normaltopmarks#1}}% -% -% \let \newmark \definenewmark -% \let \newpersistentmark \definenewmark -% \let \normalsetmark \setmark -% -% \def\setallmarks{\the\listofmarks} -% -% %D In \type {page-ini} or \type {core-mar} we should say: -% %D -% %D \starttypen -% %D \appendtoks \getallmarks \to \everybeforepagebody -% %D \appendtoks \setallmarks \to \everyafterpagebody -% %D \stoptypen -% -% \endETEX +%D The \ETEX\ way of doing things \unknown \beginETEX \marks cum suis @@ -513,12 +412,12 @@ \def\dochecktopmark#1% {\ifnum\realpageno>\csname\@@mrk\string#1\endcsname\relax - \global\@EA\let\csname\@@trk\string#1\endcsname\normalbotmarks + \@EA\gdef\csname\@@trk\string#1\endcsname{\normalbotmarks#1}% \fi} \def\resetmark#1% we cannot use \normalmarks#1{}} {\@EA\mathchardef\csname\@@mrk\string#1\endcsname\realfolio - \global\@EA\let\csname\@@trk\string#1\endcsname\gobbleoneargument} + \global\@EA\let\csname\@@trk\string#1\endcsname\empty} \def\definenewmark#1% {\ifcsname\@@mrk\string#1\endcsname\else % this is etex -) @@ -526,7 +425,7 @@ \fi \global\@EA\let\csname\@@crk\string#1\endcsname\empty \global\@EA\mathchardef\csname\@@mrk\string#1\endcsname\zerocount - \global\@EA\let\csname\@@trk\string#1\endcsname\normaltopmarks} + \@EA\gdef\csname\@@trk\string#1\endcsname{\normaltopmarks#1}} \let \newmark \definenewmark \let \newpersistentmark \definenewmark @@ -643,6 +542,4 @@ %D can slow down considerably. This drawback is removed in %D \ETEX\ mode. -\readfile{supp-nmk}{}{} - \protect \endinput diff --git a/tex/context/base/symb-nav.tex b/tex/context/base/symb-nav.tex index 60b77ad1d..34c4bbd81 100644 --- a/tex/context/base/symb-nav.tex +++ b/tex/context/base/symb-nav.tex @@ -37,6 +37,11 @@ \definesymbol [\v!eerstesubpagina] [\ContextNavigationGlyph{3}] \definesymbol [\v!laatstesubpagina] [\ContextNavigationGlyph{4}] + \definesymbol [\v!StartSound] [\ContextNavigationGlyph{2}] + \definesymbol [\v!PauseSound] [\ContextNavigationGlyph{8}] + \definesymbol [\v!StopSound] [\ContextNavigationGlyph{7}] + + \stopsymbolset \startsymbolset [navigation 2] @@ -54,6 +59,10 @@ \definesymbol [\v!volgendesubpagina] [\ContextNavigationGlyph{102}] \definesymbol [\v!eerstesubpagina] [\ContextNavigationGlyph{103}] \definesymbol [\v!laatstesubpagina] [\ContextNavigationGlyph{104}] + + \definesymbol [\v!StartSound] [\ContextNavigationGlyph{102}] + \definesymbol [\v!PauseSound] [\ContextNavigationGlyph{108}] + \definesymbol [\v!StopSound] [\ContextNavigationGlyph{107}] \stopsymbolset @@ -73,6 +82,10 @@ \definesymbol [\v!eerstesubpagina] [\ContextNavigationGlyph{203}] \definesymbol [\v!laatstesubpagina] [\ContextNavigationGlyph{204}] + \definesymbol [\v!StartSound] [\ContextNavigationGlyph{202}] + \definesymbol [\v!PauseSound] [\ContextNavigationGlyph{208}] + \definesymbol [\v!StopSound] [\ContextNavigationGlyph{207}] + \stopsymbolset %D \showsymbolset[navigation 1] diff --git a/tex/context/base/syst-ext.tex b/tex/context/base/syst-ext.tex index ed2240c83..f46a0b017 100644 --- a/tex/context/base/syst-ext.tex +++ b/tex/context/base/syst-ext.tex @@ -688,7 +688,7 @@ {\global\advance\outerrecurse \plusone \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname{#2}% \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel - \@EA\dodorecurse\@EA1{\number#1}} + \@EA\dodorecurse\@EA1\@EA{\number#1}} \long\def\ydorecurse#1#2% {\global\advance\outerrecurse \plusone @@ -2408,35 +2408,44 @@ %D %D Significantly faster (especially for longer lists): -\def\cleanedupcommalist#1,,#2\relax{#1} - -\def\xsplitstring#1#2% \cs {item} - {\def\dosplitstring##1#2,##2#2,##3\\% - {\edef\!!stringa{\cleanedupcommalist##1,,\relax}% - \edef\!!stringb{\cleanedupcommalist##2,,\relax}}% - \@EA\dosplitstring#1,#2,#2,\\} - \def\addtocommalist#1#2% {item} \cs - {\expanded{\xsplitstring\noexpand#2{#1}}% - \dodoglobal\edef#2% - {\ifx\!!stringa\empty\else\!!stringa,\fi - \ifx\!!stringb\empty\else\!!stringb,\fi#1}} - -\def\pretocommalist#1#2% - {\expanded{\xsplitstring\noexpand#2{#1}}% - \dodoglobal\edef#2% - {#1% - \ifx\!!stringa\empty\else,\!!stringa\fi - \ifx\!!stringb\empty\else,\!!stringb\fi}} + {\rawdoifinsetelse{#1}#2\resetglobal + {\dodoglobal\edef#2{\ifx#2\empty\else#2,\fi#1}}} + +\def\pretocommalist#1#2% {item} \cs + {\rawdoifinsetelse{#1}#2\resetglobal + {\dodoglobal\edef#2{#1\ifx#2\empty\else,#2\fi}}} + +\def\xsplitstring#1#2% \cs {str} + {\def\dosplitstring##1,#2,##2,#2,##3\\% + {\edef\!!stringa{\bcleanedupcommalist##1\empty\empty\relax}% + \edef\!!stringb{\acleanedupcommalist##2,,\relax}}% + \@EA\dosplitstring\@EA,#1,,#2,,#2,\\} + +\def\bcleanedupcommalist#1#2#3\relax{\if#1,\else#1\fi\if#2,\else#2\fi#3} +\def\bcleanedupcommalist#1#2\relax{\if#1,\else#1\fi#2} +\def\acleanedupcommalist#1,,#2\relax{#1} + +% \def\removefromcommalist#1#2% +% {\expanded{\xsplitstring\noexpand#2{#1}}% +% \dodoglobal\edef#2% +% {\ifx\!!stringa\empty +% \!!stringb +% \else +% \@EA\acleanedupcommalist\!!stringa,,\relax +% \ifx\!!stringb\empty\else,\!!stringb\fi +% \fi}} \def\removefromcommalist#1#2% - {\expanded{\xsplitstring\noexpand#2{#1}}% - \dodoglobal\edef#2% - {\ifx\!!stringa\empty - \!!stringb - \else - \!!stringa\ifx\!!stringb\empty\else,\!!stringb\fi - \fi}} + {\rawdoifinsetelse{#1}#2% + {\expanded{\xsplitstring\noexpand#2{#1}}% + \dodoglobal\edef#2% + {\ifx\!!stringa\empty + \!!stringb + \else + \!!stringa\ifx\!!stringb\empty\else,\!!stringb\fi + \fi}} + \resetglobal} %D A not so useful macro: @@ -2975,7 +2984,7 @@ \def\@@doifallcommonelse#1#2#3#4% slow {\def\p!docommoncheck##1% {\doifnotinset{##1}{#4}\donefalse - \ifdone\else\quitcommalist\fi}% + \ifdone\else\expandafter\quitcommalist\fi}% \donetrue \processcommalist[#3]\p!docommoncheck \ifdone\expandafter#1\else\expandafter#2\fi} @@ -3910,7 +3919,7 @@ \else % old element larger \@EA\def\@EA\newcommalistelement\@EA{\!!tempa,#1}% \replaceincommalist\sortedcommalist\scratchcounter - \quitcommalist + \expandafter\quitcommalist \fi}% \advance\scratchcounter \minusone} diff --git a/tex/context/base/syst-new.tex b/tex/context/base/syst-new.tex index eec5d6f6c..d10273e20 100644 --- a/tex/context/base/syst-new.tex +++ b/tex/context/base/syst-new.tex @@ -504,4 +504,14 @@ \def\grabstringsingle'#1'{\scratchtoks{#1}} \def\grabstringspaced #1 {\scratchtoks{#1}} +% \def\doifdimensionelse#1% +% {\afterassignment\dodoifdimensionelse\scratchdimen=#1pt\relax\empty\empty\empty\empty} +% +% \def\dodoifdimensionelse#1#2#3#4% +% {\ifx#3\relax +% \expandafter\firstoftwoarguments +% \else +% \expandafter\secondoftwoarguments +% \fi} + \protect \endinput diff --git a/tex/context/base/syst-pln.tex b/tex/context/base/syst-pln.tex index dd777854d..d6e1a481b 100644 --- a/tex/context/base/syst-pln.tex +++ b/tex/context/base/syst-pln.tex @@ -628,6 +628,11 @@ \def\rightline #1{\line{\hss#1}} \def\centerline#1{\line{\hss#1\hss}} +%D These are used by TaBlE: + +\newif\ifh@ +\newif\ifv@ + %D Let's end in the plain way: \def\fmtname {ConTeXt Minimized Plain TeX} diff --git a/tex/context/base/type-buy.tex b/tex/context/base/type-buy.tex index a7d98b056..334601299 100644 --- a/tex/context/base/type-buy.tex +++ b/tex/context/base/type-buy.tex @@ -1,5 +1,7 @@ % fallback +% todo \typescriptthree + \starttypescript [serif] [fallback] \definefontsynonym [SerifBold] [Serif] @@ -7,6 +9,7 @@ \definefontsynonym [SerifSlanted] [SerifItalic] \definefontsynonym [SerifBoldItalic] [SerifBold] \definefontsynonym [SerifBoldSlanted] [SerifBoldItalic] + \definefontsynonym [SerifCaps] [Serif] \stoptypescript @@ -17,6 +20,7 @@ \definefontsynonym [SansSlanted] [SansItalic] \definefontsynonym [SansBoldItalic] [SansBold] \definefontsynonym [SansBoldSlanted] [SansBoldItalic] + \definefontsynonym [SansCaps] [Sans] \stoptypescript @@ -27,6 +31,7 @@ \definefontsynonym [MonoSlanted] [MonoItalic] \definefontsynonym [MonoBoldItalic] [MonoBold] \definefontsynonym [MonoBoldSlanted] [MonoBoldItalic] + \definefontsynonym [MonoCaps] [Mono] \stoptypescript @@ -206,7 +211,7 @@ %D Linotype Univers -\starttypescript [map] [texnansi] +\starttypescript [map] [all] % [texnansi] \loadmapfile[texnansi-linotype-univers.map] \stoptypescript @@ -237,17 +242,78 @@ \starttypescript [sans] [univers,univers-black,univers-light] [texnansi,ec,8r] + \definefontsynonym [Univers-Light] [\typefaceencoding-LT50136] [encoding=\typefaceencoding] + \definefontsynonym [Univers-LightOblique] [\typefaceencoding-LT50137] [encoding=\typefaceencoding] + \definefontsynonym [Univers] [\typefaceencoding-LT50138] [encoding=\typefaceencoding] - \definefontsynonym [Univers-Bold] [\typefaceencoding-LT50140] [encoding=\typefaceencoding] \definefontsynonym [Univers-Oblique] [\typefaceencoding-LT50139] [encoding=\typefaceencoding] + \definefontsynonym [Univers-Bold] [\typefaceencoding-LT50140] [encoding=\typefaceencoding] \definefontsynonym [Univers-BoldOblique] [\typefaceencoding-LT50141] [encoding=\typefaceencoding] - \definefontsynonym [Univers-Light] [\typefaceencoding-LT50136] [encoding=\typefaceencoding] - \definefontsynonym [Univers-LightOblique] [\typefaceencoding-LT50137] [encoding=\typefaceencoding] - \definefontsynonym [Univers-Black] [\typefaceencoding-LT50142] [encoding=\typefaceencoding] \definefontsynonym [Univers-BlackOblique] [\typefaceencoding-LT50143] [encoding=\typefaceencoding] \stoptypescript +% mendoza + +\starttypescript [all] + \loadmapfile[texnansi-itc-mendoza.map] +\stoptypescript + +\starttypescript [serif] [mendoza] [name] + + \definefontsynonym [Serif] [MendozaRoman-Book] + \definefontsynonym [SerifCaps] [MendozaRoman-Book] + \definefontsynonym [SerifSlanted] [MendozaRoman-BookItalic] + \definefontsynonym [SerifItalic] [MendozaRoman-BookItalic] + \definefontsynonym [SerifBold] [MendozaRoman-Bold] + \definefontsynonym [SerifBoldSlanted] [MendozaRoman-BoldItalic] + \definefontsynonym [SerifBoldItalic] [MendozaRoman-BoldItalic] + +\stoptypescript + +\starttypescript [serif] [mendoza] [texnansi] + + \definefontsynonym[MendozaRoman-Bold] [texnansi-zab] [encoding=texnansi] + \definefontsynonym[MendozaRoman-BoldItalic] [texnansi-zabi][encoding=texnansi] + \definefontsynonym[MendozaRoman-Medium] [texnansi-zam] [encoding=texnansi] + \definefontsynonym[MendozaRoman-MediumItalic][texnansi-zami][encoding=texnansi] + \definefontsynonym[MendozaRoman-Book] [texnansi-zaw] [encoding=texnansi] + \definefontsynonym[MendozaRoman-BookItalic] [texnansi-zawi][encoding=texnansi] + +\stoptypescript + +% frutiger + +\starttypescript [all] + \loadmapfile[texnansi-adobe-frutiger.map] +\stoptypescript + +\starttypescript [sans] [frutiger] [name] + + \definefontsynonym [Sans] [Frutiger-Roman] + \definefontsynonym [SansCaps] [Frutiger-Roman] + \definefontsynonym [SansItalic] [Frutiger-Italic] + \definefontsynonym [SansSlanted] [Frutiger-Italic] + \definefontsynonym [SansBold] [Frutiger-Bold] + \definefontsynonym [SansBoldItalic] [Frutiger-BoldItalic] + \definefontsynonym [SansBoldSlanted] [Frutiger-BoldItalic] + +\stoptypescript + +\starttypescript [sans] [frutiger] [texnansi] + + \definefontsynonym[Frutiger-Bold] [texnansi-ftb] [encoding=texnansi] + \definefontsynonym[Frutiger-BoldItalic] [texnansi-ftbi] [encoding=texnansi] + \definefontsynonym[Frutiger-Black] [texnansi-ftbl] [encoding=texnansi] + \definefontsynonym[Frutiger-BlackItalic][texnansi-ftbli][encoding=texnansi] + \definefontsynonym[Frutiger-Italic] [texnansi-fti] [encoding=texnansi] + \definefontsynonym[Frutiger-Light] [texnansi-ftl] [encoding=texnansi] + \definefontsynonym[Frutiger-LightItalic][texnansi-ftli] [encoding=texnansi] + \definefontsynonym[Frutiger-Roman] [texnansi-ftr] [encoding=texnansi] + \definefontsynonym[Frutiger-UltraBlack] [texnansi-ftubl][encoding=texnansi] + +\stoptypescript + \endinput diff --git a/tex/context/base/type-ini.tex b/tex/context/base/type-ini.tex index eab99156b..5fba1c9c5 100644 --- a/tex/context/base/type-ini.tex +++ b/tex/context/base/type-ini.tex @@ -20,7 +20,7 @@ \let\typescriptfiles\empty -\def\usetypescriptfile[#1]% +\unexpanded\def\usetypescriptfile[#1]% {\addtocommalist{#1}\typescriptfiles} \usetypescriptfile[\f!typeprefix syn] % font file synonyms @@ -41,7 +41,7 @@ \let\@@typescripttwo \empty \let\typescripttwo \empty \let\@@typescriptthree\empty \let\typescriptthree\empty -\def\usetypescript% +\unexpanded\def\usetypescript% {\dotripleempty\dousetypescript} \def\dousetypescript[#1][#2][#3]% @@ -295,7 +295,8 @@ \setxvalue{#1 \c!status}{2}}} \def\loadallfontmapfiles - {\ifx\allfontmapsfiles\empty \else + {%\message{[\allfontmapsfiles]}% + \ifx\allfontmapsfiles\empty \else \ifautoloadmapfiles \ifcase\pdfoutput \else \ifx\pdfmapfile\undefined \else \processcommacommand[\allfontmapsfiles]\doloadfontmapfile @@ -368,12 +369,12 @@ \def\dododefinetypeface[#1][#2]% saveguard against redefinition {\doifundefined{\??tf#1\s!default}{\setgvalue{\??tf#1\s!default}{#2}}% - \doifundefined{#1}{\setgvalue{#1}{\switchtotypeface[#1][#2]}}} + \doifundefined{#1}{\unexpanded\setgvalue{#1}{\switchtotypeface[#1][#2]}}} \def\setuptypeface% [class] [settings] {\doquadrupleempty\doswitchtotypeface[\setupbodyfont][\fontclass]} -\def\switchtotypeface% [class] [settings] +\unexpanded\def\switchtotypeface% [class] [settings] {\doquadrupleempty\doswitchtotypeface[\switchtobodyfont][\globalfontclass]} \def\doswitchtotypeface[#1][#2][#3][#4]% diff --git a/tex/context/base/verb-js.tex b/tex/context/base/verb-js.tex new file mode 100644 index 000000000..78184c94f --- /dev/null +++ b/tex/context/base/verb-js.tex @@ -0,0 +1,171 @@ +%D \module +%D [ file=verb-js, +%D version=1998.02.7, +%D title=\CONTEXT\ Verbatim Macros, +%D subtitle=Pretty \JAVASCRIPT\ Verbatim, +%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. + +\writestatus{loading}{Context Support Macros / Pretty JavaScript Verbatim} + +%D In \CONTEXT\ we support \JAVASCRIPT\ inclusion in \PDF\ +%D documents and thereby enter the field of authoring. Of +%D course we also want to pretty print such scripts, that look +%D like: +%D +%D \startJS +%D alfa = beta*2 ; // both alfa and beta are numbers // indeed +%D if (odd(alfa)) +%D { do_something() } +%D else +%D { do_nothing() } /* As we can see /* in this example */ there +%D how_about(alfa) ; is no fi needed. Also no semicolons are +%D or_about(beta) ; needed after a right brace. */ +%D \stopJS +%D +%D Because \JAVASCRIPT\ looks much like \PERL, we will use +%D a slightly adapted \PERL\ visualization. First we load the +%D \PERL\ module: + +\ifx\undefined\setupprettyPLtype \input verb-pl \relax \fi + +\unprotect + +%D The main difference between the \JAVASCRIPT\ and \PERL\ +%D interpreters concern comments. Where \TEX, \METAPOST\ and +%D \PERL\ have one comment symbol (\type{%}, \type{%} and +%D \type{#}), \JAVA\ has the one line comment sequence +%D \type{//} and the multi line comment delimiters \type{/*} +%D and \type{*/}. +%D +%D We need a counter to keep track of multi line comment +%D nesting. + +\newcount\JScommentlevel + +%D We handle both \type{%} and \type{#} a bit different: + +\gdef\JSsetspecials% + {\PLsetspecials + \setpretty`\#=32 + \setpretty`\%=41 + \setpretty`\/=43 + \setpretty`\*=44 } + +%D We also need a few more handlers: one for \type{//} and +%D \type{/*} and one for \type{*/}. + +\gdef\JSsethandlers% + {\PLsethandlers + \installprettyhandler 43 \JStypefourthree + \installprettyhandler 44 \JStypefourfour } + +%D We can inherit most of the settings: + +\gdef\JSsetcontrols% + {\PLsetcontrols + \def\flushrestofverbatimline% + {\endPLtypesix + \ifcase\JScommentlevel \inPLcommentfalse \fi + \PLverbosefalse + \PLverboseskipped=0}} + +\gdef\JSsetvariables + {\PLsetvariables + \global\JScommentlevel=0 } + +\gdef\setupprettyJStype% + {\def\prettyidentifier{JS}% + \let\PLidentifiers=\JSidentifiers + \let\PLvariables=\JSvariables + \JSsetvariables + \JSsetcontrols + \JSsethandlers + \JSsetspecials + \PLsetdiagnostics} + +%D The main complication is that we have to look upto four +%D characters ahead. Such macros are hard to understand but +%D they do work! + +\gdef\JStypefourthree% + {\handlenextnextpretty\doJStypefourthree\PLtypefourtwo} + +\gdef\doJStypefourthree#1#2% + {\getprettydata{#2}% + \ifnum\prettytype=43 + \let\next=\dodoJStypefourthree + \else\ifnum\prettytype=44 + \global\advance\JScommentlevel by 1 + \global\inPLcommenttrue + \PLverbosecorrection + \let\next=\JStogglecomment + \else + \let\next=\PLtypefourtwo + \fi\fi + \next{#1}#2} + +\gdef\JStogglecomment#1#2% + {\ifnum\JScommentlevel=1 + \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty + \else + \getpretties{#1}{#2}% + \fi} + +\gdef\dodoJStypefourthree% #1% + {\endPLtypesix + \handlenextnextpretty\dododoJStypefourthree\dodododoPLtypefourthree} + +\gdef\dododoJStypefourthree% + {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoJStypefourthree} + +\gdef\dodododoJStypefourthree#1#2% + {\ifinPLcomment + \getpretties{#1}{#2}% + \else + \global\inPLcommenttrue + \PLverbosecorrection + \ifnaturaltextext + \let\next\naturaltextext + \else + \def\next{\beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty}% + \fi + \expandafter\next + \fi} + +\gdef\JStypefourfour% + {\handlenextnextpretty\doJStypefourfour\PLtypefourtwo} + +\gdef\doJStypefourfour#1#2% + {\getprettydata{#2}% + \ifnum\prettytype=43 + \JStogglecomment{#1}#2% + \global\advance\JScommentlevel by -1 + \ifcase\JScommentlevel \global\inPLcommentfalse \fi + \else + \endPLtypesix + \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty + \expandafter#2% + \fi} + +%D We need different (less) reserved words. This list replaces +%D the \PERL\ one. + +\useprettyidentifiers \JSidentifiers \JSsetspecials + abstract boolean break byte case catch char class const + continue default delete do double else extends false final + finally float for function goto if implements import in + instanceof int interface long native new null package + private protected public return short static super switch + synchronized this throw throws transient true try var void + while with + +\useprettyidentifiers \JSvariables \JSsetspecials + not-yet-defined + +\protect \endinput diff --git a/tex/context/base/verb-jv.tex b/tex/context/base/verb-jv.tex index 4de1a92b3..a7bad3c43 100644 --- a/tex/context/base/verb-jv.tex +++ b/tex/context/base/verb-jv.tex @@ -1,8 +1,8 @@ %D \module -%D [ file=verb-pl, -%D version=1998.02.7, +%D [ file=verb-jv, +%D version=2002.2.27, %D title=\CONTEXT\ Verbatim Macros, -%D subtitle=Pretty \JAVASCRIPT\ Verbatim, +%D subtitle=Pretty \JAVA\ Verbatim, %D author=Hans Hagen, %D date=\currentdate, %D copyright={PRAGMA / Hans Hagen \& Ton Otten}] @@ -11,65 +11,40 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\writestatus{loading}{Context Support Macros / Pretty JavaScript Verbatim} +\writestatus{loading}{Context Support Macros / Pretty Java Verbatim} -%D In \CONTEXT\ we support \JAVASCRIPT\ inclusion in \PDF\ -%D documents and thereby enter the field of authoring. Of -%D course we also want to pretty print such scripts, that look -%D like: -%D -%D \startJS -%D alfa = beta*2 ; // both alfa and beta are numbers // indeed -%D if (odd(alfa)) -%D { do_something() } -%D else -%D { do_nothing() } /* As we can see /* in this example */ there -%D how_about(alfa) ; is no fi needed. Also no semicolons are -%D or_about(beta) ; needed after a right brace. */ -%D \stopJS -%D -%D Because \JAVASCRIPT\ looks much like \PERL, we will use -%D a slightly adapted \PERL\ visualization. First we load the -%D \PERL\ module: +%D This module differs from the \JAVASCRIPT\ driver in its +%D handling of comments. We also need a few more handlers: one +%D for \type {//} and \type {/*} and one for \type {*/} as +%D well as the \JAVA doc trigger \type {/**}. + +%D We build this driver on top of the \PERL\ one. Since this +%D driver looks much like the \JAVASCRIPT\ one, we don't +%D comment it extensively. \ifx\undefined\setupprettyPLtype \input verb-pl \relax \fi \unprotect -%D The main difference between the \JAVASCRIPT\ and \PERL\ -%D interpreters concern comments. Where \TEX, \METAPOST\ and -%D \PERL\ have one comment symbol (\type{%}, \type{%} and -%D \type{#}), \JAVA\ has the one line comment sequence -%D \type{//} and the multi line comment delimiters \type{/*} -%D and \type{*/}. -%D -%D We need a counter to keep track of multi line comment -%D nesting. - \newcount\JVcommentlevel -%D We handle both \type{%} and \type{#} a bit different: - -\gdef\JVsetspecials% +\gdef\JVsetspecials {\PLsetspecials \setpretty`\#=32 \setpretty`\%=41 + \setpretty`\-=45 \setpretty`\/=43 \setpretty`\*=44 } -%D We also need a few more handlers: one for \type{//} and -%D \type{/*} and one for \type{*/}. - -\gdef\JVsethandlers% +\gdef\JVsethandlers {\PLsethandlers \installprettyhandler 43 \JVtypefourthree - \installprettyhandler 44 \JVtypefourfour } + \installprettyhandler 44 \JVtypefourfour + \installprettyhandler 45 \JVtypefourfive } -%D We can inherit most of the settings: - -\gdef\JVsetcontrols% +\gdef\JVsetcontrols {\PLsetcontrols - \def\flushrestofverbatimline% + \def\flushrestofverbatimline {\endPLtypesix \ifcase\JVcommentlevel \inPLcommentfalse \fi \PLverbosefalse @@ -79,36 +54,36 @@ {\PLsetvariables \global\JVcommentlevel=0 } -\gdef\setupprettyJVtype% +\gdef\setupprettyJVtype {\def\prettyidentifier{JV}% - \let\PLidentifiers=\JVidentifiers - \let\PLvariables=\JVvariables + \let\PLidentifiers\JVidentifiers + \let\PLvariables\JVvariables \JVsetvariables \JVsetcontrols \JVsethandlers \JVsetspecials \PLsetdiagnostics} -%D The main complication is that we have to look upto four -%D characters ahead. Such macros are hard to understand but -%D they do work! - -\gdef\JVtypefourthree% +\gdef\JVtypefourthree {\handlenextnextpretty\doJVtypefourthree\PLtypefourtwo} -\gdef\doJVtypefourthree#1#2% +\gdef\doJVtypefourthree#1#2#3% {\getprettydata{#2}% \ifnum\prettytype=43 - \let\next=\dodoJVtypefourthree + \let\next\dodoJVtypefourthree \else\ifnum\prettytype=44 - \global\advance\JVcommentlevel by 1 + \global\advance\JVcommentlevel 1 \global\inPLcommenttrue \PLverbosecorrection - \let\next=\JVtogglecomment + \getprettydata{#3}% + \ifnum\prettytype=44 + \inPLdoctrue + \fi + \let\next\JVtogglecomment \else - \let\next=\PLtypefourtwo + \let\next\PLtypefourtwo \fi\fi - \next{#1}#2} + \next{#1}#2#3} \gdef\JVtogglecomment#1#2% {\ifnum\JVcommentlevel=1 @@ -117,11 +92,11 @@ \getpretties{#1}{#2}% \fi} -\gdef\dodoJVtypefourthree% #1% +\gdef\dodoJVtypefourthree {\endPLtypesix \handlenextnextpretty\dododoJVtypefourthree\dodododoPLtypefourthree} -\gdef\dododoJVtypefourthree% +\gdef\dododoJVtypefourthree {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoJVtypefourthree} \gdef\dodododoJVtypefourthree#1#2% @@ -138,14 +113,36 @@ \expandafter\next \fi} -\gdef\JVtypefourfour% - {\handlenextnextpretty\doJVtypefourfour\PLtypefourtwo} +\gdef\JVtypefourfour + {\ifinPLdoc + \@EA\noJVtypefourfour + \else + \@EA\handlenextnextpretty\@EA\doJVtypefourfour\@EA\PLtypefourtwo + \fi} + +\gdef\noJVtypefourfour#1#2% + {\getprettydata{#2}% + \ifnum\prettytype=43 + \JVtogglecomment{#1}#2% + \inPLdocfalse + \global\advance\JVcommentlevel -1 + \ifcase\JVcommentlevel \global\inPLcommentfalse \fi + \else + \ifPLdocdone + \getpretty{#1}% + \else + \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty + \PLdocdonetrue + \fi + \expandafter#2% + \fi} \gdef\doJVtypefourfour#1#2% {\getprettydata{#2}% \ifnum\prettytype=43 \JVtogglecomment{#1}#2% - \global\advance\JVcommentlevel by -1 + \inPLdocfalse + \global\advance\JVcommentlevel -1 \ifcase\JVcommentlevel \global\inPLcommentfalse \fi \else \endPLtypesix @@ -153,21 +150,73 @@ \expandafter#2% \fi} -%D We need different (less) reserved words. This list replaces -%D the \PERL\ one. +\gdef\JVtypefourfive % permit - in javadoc @tags + {\ifinPLdoc + \@EA\PLtypesixtwo + \else + \@EA\PLtypefourone + \fi} \useprettyidentifiers \JVidentifiers \JVsetspecials - abstract boolean break byte case catch char class const - continue default delete do double else extends false final - finally float for function goto if implements import in - instanceof int interface long native new null package - private protected public return short static super switch - synchronized this throw throws transient true try var void - while with - + abstract assert boolean break byte case catch char class const + continue default do double else extends false final + finally float for goto if implements import instanceof + int interface long native new null package private protected + public return short static strictfp super switch synchronized + this throw throws transient true try void volatile while + \useprettyidentifiers \JVvariables \JVsetspecials - not-yet-defined + @author @docRoot @deprecated @exception @inheritDoc @link + @linkplain @param @return @see @serial @serialData @serialField + @since @throws @value @version -\protect - -\endinput +%D The \JAVA doc feature was requested by Robert F.~Beeger, +%D who also provided this test class: +%D +%D \startJV +%D package de.jwamalpha.handling.web.rbdipl; +%D +%D import java.io.IOException; +%D import java.io.PrintWriter; +%D import javax.servlet.http.HttpServlet; +%D import javax.servlet.http.HttpServletRequest; +%D import javax.servlet.http.HttpServletResponse; +%D import javax.servlet.ServletException; +%D +%D /** +%D * The simple login servlet +%D * +%D * @author Robert F. Beeger +%D * @version 1.0 +%D */ +%D +%D public class LoginServlet extends HttpServlet +%D { +%D // +%D // public interface +%D // +%D /** +%D * Process the get-request. +%D * +%D * @param request the request +%D * @param response the response. +%D */ +%D protected void doGet (HttpServletRequest request, HttpServletResponse response) +%D throws ServletException, IOException +%D { +%D response.setContentType("text/html"); +%D PrintWriter writer = response.getWriter(); +%D writer.println("<html>"); +%D writer.println(" <head>"); +%D writer.println(" <title>Login</title>"); +%D writer.println(" </head>"); +%D writer.println(" <body>"); +%D writer.println(" Hallo, Benutzer " + request.getParameter("username") + "!"); +%D writer.println(" </body>"); +%D writer.println("</html>"); +%D writer.flush(); +%D } +%D } +%D \stopJV + +\protect \endinput diff --git a/tex/context/base/verb-pl.tex b/tex/context/base/verb-pl.tex index 4495be13e..cbe82d49f 100644 --- a/tex/context/base/verb-pl.tex +++ b/tex/context/base/verb-pl.tex @@ -46,6 +46,8 @@ \doglobal\newif\ifinPLsingle \doglobal\newif\ifinPLdouble \doglobal\newif\ifinPLcomment +\doglobal\newif\ifinPLdoc % only used in java filter +\doglobal\newif\ifPLdocdone % only used in java filter \doglobal\newif\ifPLverbose \newcount\PLverboseskipped @@ -53,7 +55,7 @@ \gdef\PLverbosecorrection% {\ifnum\PLverboseskipped>0 \obeyedspace - \advance\PLverboseskipped by -1 + \advance\PLverboseskipped -1 \@EA\PLverbosecorrection \fi} @@ -62,7 +64,7 @@ \def\obeyedspace% {\endPLtypesix \ifPLverbose - \advance\PLverboseskipped by 1 + \advance\PLverboseskipped 1 \else \oldobeyedspace \fi}% @@ -72,6 +74,7 @@ \def\obeyedline% {\PLverbosefalse \PLverboseskipped=0 + \PLdocdonefalse \oldobeyedline}% \let\obeytabs=\ignoretabs} @@ -168,10 +171,29 @@ \fi\fi \fi} -\gdef\PLtypetwo#1% +% \gdef\PLtypetwo#1% +% {\endPLtypesix +% \xdef\PLprefix{\getpretty{#1}}% +% \ifinPLcomment +% \getpretty{#1}% +% \else\ifinPLsingle +% \getpretty{#1}% +% \else\ifinPLdouble +% \getprettydata{#1}% +% \ifnum\prettytype=21 +% \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty +% \else +% \getpretty{#1}% +% \fi +% \else +% \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty +% \fi\fi\fi} + +\gdef\PLtypetwo#1% {\endPLtypesix - \xdef\PLprefix{\getpretty{#1}}% - \ifinPLcomment + \ifinPLdoc + \xdef\PLsequence{\PLsequence\getpretty{#1}}% + \else\ifinPLcomment \getpretty{#1}% \else\ifinPLsingle \getpretty{#1}% @@ -184,7 +206,7 @@ \fi \else \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty - \fi\fi\fi} + \fi\fi\fi\fi} \gdef\PLtypethree#1% {\endPLtypesix @@ -266,9 +288,51 @@ \expandafter\handlenextnextpretty\expandafter\doPLtypefiveA\expandafter\doPLtypefiveB \fi} -\gdef\endPLtypesix% +% \gdef\endPLtypesix% +% {\ifx\PLsequence\empty\else +% \ifinPLcomment +% \PLsequence +% \else\ifinPLsingle +% \PLsequence +% \else\ifinPLdouble +% \PLsequence +% \else\ifPLverbose +% \beginofpretty[\!!prettytwo]\PLsequence\endofpretty +% \PLverbosefalse +% \else\ifx\PLprefix\empty +% \doifprettyidentifierelse{\PLsequence}{\PLverboses} +% {\PLverbosetrue\PLverboseskipped=3 } +% {\doifprettyidentifierelse{\PLsequence}{\PLidentifiers} +% {\beginofpretty[\!!prettytwo]% +% {\prettyidentifierfont\PLsequence}% +% \endofpretty} +% {\ifprettyPLvariables +% \doifprettyidentifierelse{\PLsequence}{\PLvariables} +% {\beginofpretty[\!!prettytwo]% +% {\prettyvariablefont\PLsequence}% +% \endofpretty} +% {\PLsequence}% +% \else +% \PLsequence +% \fi}}% +% \else\ifprettyPLvariables +% \doifprettyidentifierelse{\PLprefix\PLsequence}{\PLvariables} +% {\beginofpretty[\!!prettytwo]% +% {\prettyvariablefont\PLsequence}% +% \endofpretty} +% {\PLsequence}% +% \else +% \PLsequence +% \fi\fi\fi\fi\fi\fi +% \global\let\PLsequence=\empty +% \global\let\PLprefix=\empty +% \fi} + +\gdef\endPLtypesix {\ifx\PLsequence\empty\else - \ifinPLcomment + \ifinPLdoc + \doendPLtypesixvar\!!prettythree + \else\ifinPLcomment \PLsequence \else\ifinPLsingle \PLsequence @@ -278,43 +342,66 @@ \beginofpretty[\!!prettytwo]\PLsequence\endofpretty \PLverbosefalse \else\ifx\PLprefix\empty - \doifprettyidentifierelse{\PLsequence}{\PLverboses} - {\PLverbosetrue\PLverboseskipped=3 } - {\doifprettyidentifierelse{\PLsequence}{\PLidentifiers} - {\beginofpretty[\!!prettytwo]% - {\prettyidentifierfont\PLsequence}% - \endofpretty} - {\ifprettyPLvariables - \doifprettyidentifierelse{\PLsequence}{\PLvariables} - {\beginofpretty[\!!prettytwo]% - {\prettyvariablefont\PLsequence}% - \endofpretty} - {\PLsequence}% - \else - \PLsequence - \fi}}% + \doendPLtypesix\!!prettytwo \else\ifprettyPLvariables - \doifprettyidentifierelse{\PLprefix\PLsequence}{\PLvariables} - {\beginofpretty[\!!prettytwo]% - {\prettyvariablefont\PLsequence}% - \endofpretty} - {\PLsequence}% + \doendPLtypesixvar\!!prettytwo \else \PLsequence - \fi\fi\fi\fi\fi\fi - \global\let\PLsequence=\empty - \global\let\PLprefix=\empty + \fi\fi\fi\fi\fi\fi\fi + \global\let\PLsequence\empty + \global\let\PLprefix\empty \fi} -\gdef\PLtypesixone% +\gdef\doendPLtypesix#1% + {\doifprettyidentifierelse{\PLsequence}{\PLverboses} + {\PLverbosetrue\PLverboseskipped=3 } + {\doifprettyidentifierelse{\PLsequence}{\PLidentifiers} + {\beginofpretty[#1]% + {\prettyidentifierfont\PLsequence}% + \endofpretty} + {\ifprettyPLvariables + \doifprettyidentifierelse{\PLsequence}{\PLvariables} + {\beginofpretty[#1]% + {\prettyvariablefont\PLsequence}% + \endofpretty} + {\PLsequence}% + \else + \PLsequence + \fi}}} + +\gdef\doendPLtypesixvar#1% + {\doifprettyidentifierelse{\PLprefix\PLsequence}{\PLvariables} + {\beginofpretty[#1]% + {\prettyvariablefont\PLsequence}% + \endofpretty} + {\PLsequence}} + +\gdef\PLtypesixone {\ifx\PLsequence\empty \expandafter\getpretty \else \expandafter\PLtypesixtwo \fi} -\gdef\PLtypesixtwo#1% - {\ifinPLcomment +% \gdef\PLtypesixtwo#1% +% {\ifinPLcomment +% \getpretty{#1}% +% \else\ifinPLsingle +% \getpretty{#1}% +% \else\ifinPLdouble +% \ifx\PLprefix\empty +% \getpretty{#1}% +% \else +% \xdef\PLsequence{\PLsequence\getpretty{#1}}% +% \fi +% \else +% \xdef\PLsequence{\PLsequence\getpretty{#1}}% +% \fi\fi\fi} + +\gdef\PLtypesixtwo#1% + {\ifinPLdoc + \xdef\PLsequence{\PLsequence\getpretty{#1}}% + \else\ifinPLcomment \getpretty{#1}% \else\ifinPLsingle \getpretty{#1}% @@ -326,7 +413,7 @@ \fi \else \xdef\PLsequence{\PLsequence\getpretty{#1}}% - \fi\fi\fi} + \fi\fi\fi\fi} \gdef\PLtypesevenone#1% {\endPLtypesix diff --git a/tex/context/base/xtag-ini.tex b/tex/context/base/xtag-ini.tex index 97853ed45..8f018bfd2 100644 --- a/tex/context/base/xtag-ini.tex +++ b/tex/context/base/xtag-ini.tex @@ -864,10 +864,10 @@ {\fastenableencoding\simpleXMLencoding \XMLsimpleentitiestrue} -\gdef\defineXMLentity% +\def\defineXMLentity% {\dodoubleempty\dodefineXMLentity} -\gdef\dodefineXMLentity[#1][#2]#3% +\def\dodefineXMLentity[#1][#2]#3% {\ifsecondargument \defineXMLentities[#1]{#2}{#3}% \else @@ -877,14 +877,14 @@ \def\defineXMLentities[#1]#2#3% {\dododefineXMLentity{#1}{\ifXMLsimpleentities#2\else#3\fi}} -\gdef\dododefineXMLentity#1#2% +\def\dododefineXMLentity#1#2% {\unspaceargument#1\to\ascii % #1 can be {[} or so \long\setvalue{\@@XMLentity:\@EA\firstofoneargument\ascii}{#2}} %D May this wile become dodo (more in tune with rest); %D beware: also remapped in xtag-map. -\gdef\doXMLentity#1#2;% interesting: # is now ## +\def\doXMLentity#1#2;% interesting: # is now ## {\if\string#1\letterhash \@EA\parseXMLcharacter \else\ifXMLrawentities @@ -1027,7 +1027,7 @@ \unexpanded\def\getXMLentity{\expandedXMLentity} -\gdef\doifXMLentityelse#1#2#3% +\def\doifXMLentityelse#1#2#3% {\ifcsname\@@XMLentity:#1\endcsname#2\else#3\fi} % see \defineXML... commands: @@ -1318,6 +1318,16 @@ {\long\@EA\def\csname\@@XMLdata:#1\endcsname{##1}}% \next} +\long\gdef\dododefineXMLgsave#1% + {\letvalue{\@@XMLdata:#1}\longempty + \long\setvalue{\@@XMLelement:#1/}{\long\setgvalue{\@@XMLdata:#1}{}}% + \long\setvalue{\@@XMLelement:#1}{\redoXMLgsave{#1}}} + +\gdef\redoXMLgsave#1% + {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>% + {\long\@EA\gdef\csname\@@XMLdata:#1\endcsname{##1}}% + \next} + %\long\gdef\dododefineXMLenvironmentsave#1#2#3% % {\letvalue{\@@XMLdata:#1}\longempty % \long\setvalue{\@@XMLelement:#1/}{#2\long\setvalue{\@@XMLdata:#1}{}#3}% diff --git a/tex/context/base/xtag-run.tex b/tex/context/base/xtag-run.tex index 7a919d31f..ebfee9e80 100644 --- a/tex/context/base/xtag-run.tex +++ b/tex/context/base/xtag-run.tex @@ -101,7 +101,7 @@ \advance\XMLlevel -1 \DoMod\XMLlevel by\XMLprettycycle to\scratchcounter \advance\scratchcounter 1 - \startcolor[xtag:\number\scratchcounter]% + \startcolor[xtag:\ifnum\scratchcounter<0 0\else\number\scratchcounter\fi]% \string<% \ifnum\kindofXMLelement=2\string/\fi \currentXMLelement @@ -110,7 +110,7 @@ \cleanupXMLarguments \startcolor[xtag:0]\hbox{\space}\showXMLarguments\unskip\stopcolor \fi\fi - \startcolor[xtag:\number\scratchcounter]% + \startcolor[xtag:\ifnum\scratchcounter<0 0\else\number\scratchcounter\fi]% \ifnum\kindofXMLelement=3\string/\fi \string>% \stopcolor diff --git a/tex/context/config/cont-usr.tex b/tex/context/config/cont-usr.tex index 38dbab706..f70072c9a 100644 --- a/tex/context/config/cont-usr.tex +++ b/tex/context/config/cont-usr.tex @@ -70,7 +70,8 @@ \installlanguage [\s!cz] [\s!mapping={il2,ec},\s!encoding={il2,ec}] \installlanguage [\s!hr] [\s!mapping={il2,ec},\s!encoding={il2,ec}] -\installlanguage [\s!pl] [\s!mapping=pl0,\s!encoding=pl0] +%installlanguage [\s!pl] [\s!mapping=pl0,\s!encoding=pl0] +\installlanguage [\s!pl] [\s!mapping={pl0,ec},\s!encoding={pl0,ec}] \installlanguage [\s!sk] [\s!mapping={il2,ec},\s!encoding={il2,ec}] %D Sometimes these are not wanted: diff --git a/tex/context/sample/dawkins.tex b/tex/context/sample/dawkins.tex new file mode 100644 index 000000000..acb47b967 --- /dev/null +++ b/tex/context/sample/dawkins.tex @@ -0,0 +1,20 @@ +I used a similar illustration in one of my Royal +Institution Christmas Lectures in 1991. I said I had reason +to believe that among my audience was a psychic, +clairvoyant individual, capable of influencing events +purely by power of thought. I would try to flush this +individual out. \quotation {Let's first establish,} I said, +\quotation {whether the psychic is in the left half or the +right half of the lecture hall.} I invited everybody to +stand up while my assistant tossed a coin. Everybody on the +left of the hall was asked to \quote {will} the coin to +come down head. Everybody on the right had to will it to be +tails. Obviously one side had to lose, and they were asked +to sit down. Then those who remained were divided into two, +with half \quote {willing} heads and the other half tails. +Again the losers sat down. And so on by successive halvings +until, inevitably. after seven or eight tosses, one +individual was left standing. \quotation {A big round of +applause for our psychic.} He must be psychic, mustn't he, +because he successfully influenced the coin eight times in +a row? diff --git a/tex/context/user/cont-sys.rme b/tex/context/user/cont-sys.rme index a571c8c60..7ea324ae3 100644 --- a/tex/context/user/cont-sys.rme +++ b/tex/context/user/cont-sys.rme @@ -94,6 +94,7 @@ % \runMPgraphicstrue % \runMPTEXgraphicstrue + % \recycleMPslotstrue % This saves some runtime, but needs a format, which you can |