diff options
author | Hans Hagen <pragma@wxs.nl> | 2003-07-21 00:00:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2003-07-21 00:00:00 +0200 |
commit | 91f5bdb707b063e6e7acc31073db4cc17bd66593 (patch) | |
tree | 56f7dd7e967287dd8e0897c6ed3e013bbd7b7a58 | |
parent | 11bb0fd566ba8f601ead37cb5e05e9b8ad04b96a (diff) | |
download | context-91f5bdb707b063e6e7acc31073db4cc17bd66593.tar.gz |
stable 2003.07.21
71 files changed, 2047 insertions, 469 deletions
diff --git a/context/data/cont-cz.tws b/context/data/cont-cz.tws index 065266a61..60a6061cd 100644 --- a/context/data/cont-cz.tws +++ b/context/data/cont-cz.tws @@ -2362,6 +2362,7 @@ var:textovyprikaz:*\prikaz#1:: var:prefix:+,-,*text:: var:umistihlavicku:ano,ne,prazdne:: var:zvysujicicislo:ano,ne,seznam,*soubor:: +var:resetnumber:ano,ne:: var:soubor:*jmeno:: var:expanzen:ano,prikaz,ne:: var:textmarginalie:ano,ne:: diff --git a/context/data/cont-de.tws b/context/data/cont-de.tws index 8070dc8b5..ee420f45e 100644 --- a/context/data/cont-de.tws +++ b/context/data/cont-de.tws @@ -2362,6 +2362,7 @@ var:textbefehl:*\Befehl#1:: var:prefix:+,-,*Text:: var:setzekopf:ja,nein,leer:: var:nummererhoehen:ja,nein,liste,*Datei:: +var:resetnumber:ja,nein:: var:datei:*Name:: var:expansion:ja,befehl,nein:: var:marginaltext:ja,nein:: diff --git a/context/data/cont-en.tws b/context/data/cont-en.tws index c79b870d0..80faba9e5 100644 --- a/context/data/cont-en.tws +++ b/context/data/cont-en.tws @@ -2362,6 +2362,7 @@ var:textcommand:*\command#1:: var:prefix:+,-,*text:: var:placehead:yes,no,empty:: var:incrementnumber:yes,no,list,*file:: +var:resetnumber:yes,no:: var:file:*name:: var:expansion:yes,command,no:: var:margintext:yes,no:: diff --git a/context/data/cont-it.tws b/context/data/cont-it.tws index 8ac988b91..783356e55 100644 --- a/context/data/cont-it.tws +++ b/context/data/cont-it.tws @@ -2362,6 +2362,7 @@ var:comandotesto:*\comando#1:: var:prefisso:+,-,*testo:: var:mettitesta:si,no,vuoto:: var:incrementanumero:si,no,elenco,*file:: +var:resetnumber:si,no:: var:file:*nome:: var:espansione:si,comando,no:: var:testomargine:si,no:: diff --git a/context/data/cont-nl.tws b/context/data/cont-nl.tws index 199311e96..09d564965 100644 --- a/context/data/cont-nl.tws +++ b/context/data/cont-nl.tws @@ -2362,6 +2362,7 @@ var:tekstcommando:*\commando#1:: var:prefix:+,-,*tekst:: var:plaatskop:ja,nee,leeg:: var:verhoognummer:ja,nee,lijst,*file:: +var:resetnummer:ja,nee:: var:file:*naam:: var:expansie:ja,commando,nee:: var:margetekst:ja,nee:: diff --git a/context/data/cont-ro.tws b/context/data/cont-ro.tws index 1e0fb8dd7..29684165d 100644 --- a/context/data/cont-ro.tws +++ b/context/data/cont-ro.tws @@ -2362,6 +2362,7 @@ var:comandatext:*\comanda#1:: var:prefix:+,-,*text:: var:punetitlu:da,nu,gol:: var:numarincrement:da,nu,lista,*fisier:: +var:resetnumber:da,nu:: var:fisier:*nume:: var:expansiune:da,comanda,nu:: var:textmargine:da,nu:: diff --git a/context/data/type-fsf.dat b/context/data/type-fsf.dat new file mode 100644 index 000000000..df57ed362 --- /dev/null +++ b/context/data/type-fsf.dat @@ -0,0 +1,23 @@ +# fontsite opus + +--en=? --ve=fontsite --co=opus --re +--en=? --ve=fontsite --co=opus --so=fontsite/500 --ma --in opus* + +--en=? --ve=fontsite --co=opus --so=fontsite/500 --sl=* opusrg_* +--en=? --ve=fontsite --co=opus --so=fontsite/500 --sl=* opusb_* + +# fontsite typewriter + +--en=? --ve=fontsite --co=typewriter --re +--en=? --ve=fontsite --co=typewriter --so=fontsite/500 --ma --in type* + +--en=? --ve=fontsite --co=typewriter --so=fontsite/500 --sl=* typerg_* +--en=? --ve=fontsite --co=typewriter --so=fontsite/500 --sl=* typeb_* + +# fontsite garamond + +--en=? --ve=fontsite --co=garamond --re +--en=? --ve=fontsite --co=garamond --so=fontsite/500 --ma --in gara* + +--en=? --ve=fontsite --co=garamond --so=fontsite/500 --sl=* garai_* +--en=? --ve=fontsite --co=garamond --so=fontsite/500 --sl=* garab_* diff --git a/context/perltk/texexec.pl b/context/perltk/texexec.pl index e229601e5..e588318bf 100644 --- a/context/perltk/texexec.pl +++ b/context/perltk/texexec.pl @@ -134,6 +134,8 @@ my $TeXTranslation = '' ; my $TextWidth = '0pt' ; my $TopSpace = '0pt' ; my $TypesetFigures = 0 ; +my $ForceFullScreen = 0 ; +my $ScreenSaver = 0 ; my $TypesetListing = 0 ; my $TypesetModule = 0 ; my $UseColor = 0 ; @@ -154,6 +156,10 @@ my $GlobalFile = 0 ; my $AllPatterns = 0 ; my $ForceXML = 0 ; +# makempy : + +my $MakeMpy = '' ; + &GetOptions ( "arrange" => \$Arrange , "batch" => \$EnterBatchMode , @@ -179,6 +185,8 @@ my $ForceXML = 0 ; "mode=s" => \$Mode , "module" => \$TypesetModule , "figures=s" => \$TypesetFigures , + "fullscreen" => \$ForceFullScreen , + "screensaver" => \$ScreenSaver , "listing" => \$TypesetListing , "mptex" => \$DoMPTeX , "mpxtex" => \$DoMPXTeX , @@ -228,6 +236,7 @@ my $ForceXML = 0 ; "setfile=s" => \$SetFile , "purge" => \$Purge , #### yet undocumented ################# + "makempy=s" => \$MakeMpy , "allpatterns" => \$AllPatterns , "separation=s" => \$Separation , "textree=s" => \$TeXTree , @@ -248,6 +257,11 @@ $SIG{INT} = "IGNORE" ; if ($ARGV[0] =~ /\.mpx$/io) # catch -tex=.... bug in mpost { $TeXProgram = '' ; $DoMPXTeX = 1 ; $NoMPMode = 1 } +if ($ScreenSaver) + { $ForceFullScreen = 1 ; + $TypesetFigures = 'c' ; + $Purge = 1 } + if ($DoMPTeX||$DoMPXTeX) { $RunOnce = 1 ; $ProducePdfT = 0 ; @@ -277,7 +291,8 @@ print "\n$Program\n\n" ; if ($Verbose) { print " current path : " . cwd . "\n" } -my $pathslash = '/' ; if ($0 =~ /\\/) { $pathslash = "\\" } +## $pathslash = '/' ; if ($0 =~ /\\/) { $pathslash = "\\" } +my $pathslash = '/' ; if ($FindBin::Bin =~ /\\/) { $pathslash = "\\" } my $cur_path = ".$pathslash" ; # $own_path = $0 ; $own_path =~ s/texexec(\.pl|\.bat|)//io ; @@ -288,17 +303,18 @@ my $cur_path = ".$pathslash" ; my $own_path = "$FindBin::Bin/" ; my $own_type = $0 ; +my $own_type = $FindBin::Script ; my $own_quote = ($own_path =~ m/^[^\"].* / ? "\"" : "") ; my $own_stub = "" ; +if ($own_type =~ /(\.pl|perl)/oi) + { $own_stub = "perl " } + if ($own_type =~ /(\.(pl|bin|exe))$/io) { $own_type = $1 } else { $own_type = '' } -if ($own_type =~ /pl/oi) - { $own_stub = "perl " } - sub checked_path { my $path = shift ; if ((defined($path))&&($path ne '')) @@ -1371,6 +1387,7 @@ sub RunTeX else { $Problems = system ("$cmd") } my $StopTime = time - $StartTime ; + print "\n return code : $Problems" ; print "\n run time : $StopTime seconds\n" ; return $Problems } @@ -1385,9 +1402,8 @@ sub PushResult if (-e "$Result.tuo") { unlink "$File.tuo" ; rename "$Result.tuo", "$File.tuo" } } -if ($Optimize) - { unlink "$File.tuo" } -} + if ($Optimize) + { unlink "$File.tuo" } } sub PopResult { my $File = shift ; $File =~ s/\..*$//o ; $Result =~ s/\..*$//o ; @@ -1428,7 +1444,8 @@ sub RunTeXutil sub PurgeFiles { my $JobName = shift ; print "\n purging files : $JobName\n" ; - RunPerlScript($TeXUtil, "--purge $JobName" ) } + RunPerlScript($TeXUtil, "--purge $JobName" ) ; + unlink($Result . '.log') if (-f $Result . '.log') } sub RunTeXMP { my $JobName = shift ; @@ -1694,12 +1711,18 @@ sub RunFigures print FIG " [topspace=1.5cm,backspace=1.5cm,\n" ; print FIG " header=1.5cm,footer=0pt,\n" ; print FIG " width=middle,height=middle]\n" ; + if ($ForceFullScreen) + { print FIG "\\setupinteraction\n" ; + print FIG " [state=start]\n" ; + print FIG "\\setupinteractionscreen\n" ; + print FIG " [option=max]\n" } print FIG "\\starttext\n" ; print FIG "\\showexternalfigures[alternative=$TypesetFigures,offset=$PaperOffset]\n" ; print FIG "\\stoptext\n" ; close(FIG) ; $ConTeXtInterface = "en" ; - RunConTeXtFile($FiguresFile, "tex") } + RunConTeXtFile($FiguresFile, "tex") ; + unlink ('texutil.tuf') if (-f 'texutil.tuf') } # sub RunGetXMLFigures # { return if (($Label eq "") or ($Base eq "") ; @@ -2112,6 +2135,8 @@ my $mpochecksum = 0 ; sub checkMPgraphics # also see makempy { my $MpName = shift ; + if ($MakeMpy != '') + { $MpName .= " --$MakeMpy " } # extra switches if ($MpyForce) { $MpName .= " --force " } # dirty else @@ -2390,6 +2415,9 @@ figures typeset figure directory =b just graphics =c one (cropped) per page paperoffset room left at paper border +fullscreen force full screen mode (pdf) +----------- +screensaver turn graphic file into a (pdf) full screen file ----------- final add a final run without skipping ----------- diff --git a/context/perltk/texutil.pl b/context/perltk/texutil.pl index 6609a102d..79c9979ec 100644 --- a/context/perltk/texutil.pl +++ b/context/perltk/texutil.pl @@ -124,6 +124,7 @@ my $dosish = ($Config{'osname'} =~ /^(ms)?dos|^os\/2|^(ms|cyg)win/i) ; "purge" => \$PurgeFiles, "purgeall" => \$PurgeAllFiles, "analyze" => \$AnalyzeFile, + "filter" => \$FilterPages, "help" => \$ProcessHelp, "silent" => \$ProcessSilent, "verbose" => \$ProcessVerbose, @@ -2708,6 +2709,9 @@ sub PurgeFiles # no my in foreach foreach $file (@dontaskprefixes) { if (-e $file) { RemoveContextFile($file) } } + foreach $file (@dontasksuffixes) + { if (-e $file) + { RemoveContextFile($file) } } foreach $suffix (@dontasksuffixes) { foreach (@files) { if (/$suffix$/i) @@ -2769,6 +2773,22 @@ sub AnalyzeFile print " links : $Link ($Named named / $Script scripts / $Cross files)\n" ; print " widgets : $Widget\n" } +sub FilterPages # temp feature / no reporting + { my $filename = $ARGV[0] ; + return unless "$filename.pdf" || -f "$filename.pdf" ; + $old = '' ; $num = 0 ; + if (open(PDF,"<$filename.pdf") && open(TUO,">>$filename.tuo")) + { binmode PDF ; + while (<PDF>) + { chomp ; + if (($_ eq '/Type /Page') && ($old =~ /^(\d+)\s+0\s+obj/o)) + { ++$n ; $p = $1 ; + print TUO "\\objectreference{PDFP}{$n}{$p}{$n}\n" } + else + { $old = $_ } } + close(PDF) ; + close(TUO) } } + #D We're done! All this actions and options are organized in #D one large conditional: @@ -2786,6 +2806,7 @@ elsif ($ProcessLogFile ) { HandleLogFile } elsif ($PurgeFiles ) { PurgeFiles } elsif ($PurgeAllFiles ) { PurgeFiles } elsif ($AnalyzeFile ) { AnalyzeFile } +elsif ($FilterPages ) { FilterPages } elsif ($ProcessHelp ) { ShowHelpInfo } # redundant else { ShowHelpInfo } diff --git a/metapost/context/base/mp-form.mp b/metapost/context/base/mp-form.mp index b5c06b11a..bad87651c 100644 --- a/metapost/context/base/mp-form.mp +++ b/metapost/context/base/mp-form.mp @@ -333,8 +333,12 @@ vardef isfmtseparator primary c = %%% added by HH %%% ((c <> fmt_separator) and (c <> "%")) enddef ; +def initialize_form_numbers = + initialize_numbers ; % in context: do_initialize_numbers ; +enddef ; + vardef dofmt_@#(expr f, x) = %%% adapted by HH %%% - initialize_numbers ; + initialize_form_numbers ; if f = "" : if fmt_metapost : nullpicture else : "" fi else : diff --git a/metapost/context/base/mp-spec.mp b/metapost/context/base/mp-spec.mp index 10118f2c0..3563e982e 100644 --- a/metapost/context/base/mp-spec.mp +++ b/metapost/context/base/mp-spec.mp @@ -516,6 +516,24 @@ vardef transparent(expr n, t, c) = fi enddef ; +%D This function returns true of false, dependent on transparency. + +vardef is_transparent(text t) = + begingroup ; save transparent ; save _c_, _b_ ; + vardef transparent(expr nn, tt, cc) = _b_ := true ; cc enddef ; + boolean _b_ ; _b_ := false ; + color _c_ ; _c_ := t ; _b_ + endgroup +enddef ; + +%D This function returns the not transparent color. + +vardef not_transparent(text t) = + begingroup ; save transparent ; + vardef transparent(expr nn, tt, cc) = cc enddef ; + t endgroup +enddef ; + %D Basic position tracking: def register (expr label, width, height, offset) = diff --git a/metapost/context/base/mp-tool.mp b/metapost/context/base/mp-tool.mp index b1fd6bf22..9f2464e64 100644 --- a/metapost/context/base/mp-tool.mp +++ b/metapost/context/base/mp-tool.mp @@ -260,8 +260,8 @@ vardef invcos primary x = ((acos(x))/radian) enddef ; vardef acosh primary x = ln(x+(x+-+1)) enddef ; vardef asinh primary x = ln(x+(x++1)) enddef ; -vardef sinh primary x = save xx ; xx = exp xx ; (xx-1/xx)/2 enddef ; -vardef cosh primary x = save xx ; xx = exp xx ; (xx+1/xx)/2 enddef ; +vardef sinh primary x = save xx ; xx = exp x ; (xx-1/xx)/2 enddef ; +vardef cosh primary x = save xx ; xx = exp x ; (xx+1/xx)/2 enddef ; %D We provide two macros for drawing stripes across a shape. %D The first method (with the n suffix) uses another method, diff --git a/tex/context/base/colo-ini.tex b/tex/context/base/colo-ini.tex index 790caac58..73a03b91d 100644 --- a/tex/context/base/colo-ini.tex +++ b/tex/context/base/colo-ini.tex @@ -220,6 +220,8 @@ %D \setvalue{\??cr name}{S:s:a:t} %D \stoptypen +% beware: comparisons asked/current on name, not value + \newif\iffreezecolors \freezecolorsfalse \let\colorlist \empty @@ -566,13 +568,13 @@ \def\stopcolormode {\ifincolor\ifpermitcolormode - \dostoptransparency + \supportedstoptransparency \dostopcolormode \fi\fi} \def\restorecolormode {\ifincolor\ifpermitcolormode - \dostoptransparency + \supportedstoptransparency \dostopcolormode \ifx\maintextcolor\empty \else \startcolormode\maintextcolor @@ -601,14 +603,14 @@ \def\execcolorR {\iffilterspotcolor - \@EA\noexeccolor + \@EA\noexeccolorR \else \@EA\doexeccolorR \fi} \def\execcolorC {\iffilterspotcolor - \@EA\noexeccolor + \@EA\noexeccolorC \else \@EA\doexeccolorC \fi} @@ -792,7 +794,8 @@ \ifx#1#2% \dostartgraycolormode\@@cl@@o \else - \fullytransparentcolor + \doregisternonecolor + \dostartnonecolormode \fi \else \dostartgraycolormode\@@cl@@o @@ -801,7 +804,8 @@ \def\dovidecolor#1#2% {\ifhidesplitcolor \ifx#1#2% - \fullytransparentcolor + \doregisternonecolor + \dostartnonecolormode \else \dostartgraycolormode\@@cl@@o \fi @@ -809,11 +813,19 @@ \dostartgraycolormode\@@cl@@o \fi} -\def\fullytransparentcolor - {\dostartgraycolormode\@@cl@@o % better than z - %\global\@EA\chardef\csname\@@currenttransparent\endcsname\plusone - %\global\intransparenttrue - \dostarttransparency10} +% \def\fullytransparentcolor % fails on floats +% {\dostartgraycolormode\@@cl@@o % better than z +% %\global\@EA\chardef\csname\@@currenttransparent\endcsname\plusone +% %\global\intransparenttrue +% \dostarttransparency10} + +\def\noexeccolorR#1:#2:#3:#4\od + {\edef\@@cl@@r{#1}\edef\@@cl@@g{#2}\edef\@@cl@@b{#3}% + \dohidecolor\@@cl@@s\@@cl@@o} + +\def\noexeccolorC#1:#2:#3:#4:#5\od + {\edef\@@cl@@c{#1}\edef\@@cl@@m{#2}\edef\@@cl@@y{#3}\edef\@@cl@@k{#4}% + \dohidecolor\@@cl@@s\@@cl@@o} \def\noexeccolorS#1:#2\od {\edef\@@cl@@s{#1}% @@ -827,7 +839,7 @@ %D we can normalize colors, which comes down to giving equal %D values an equal accuracy and format. This feature is %D turned off by default due to a speed penalty. This macro -%D also handles spot color precentages. +%D also handles spot color percentages. \newif\iffactorizecolor \newif\ifnormalizecolor @@ -917,10 +929,10 @@ %D Transparency is handled similar for all three color modes. We %D can turn transparency off with the following switch: -\newif\iftransparancysupported \transparancysupportedtrue % todo +\newif\iftransparencysupported \transparencysupportedtrue % todo \def\exectransparency - {\iftransparancysupported + {\iftransparencysupported \expandafter\doexectransparency \else \expandafter\noexectransparency @@ -940,7 +952,8 @@ \global\intransparentfalse \else \global\intransparentfalse - \dostarttransparency{#1}{#2}% + %\dostarttransparency{#1}{#2}% + \supportedstarttransparency{#1}{#2}% \global\intransparenttrue \fi} @@ -952,21 +965,51 @@ \newif\ifintransparent \newif\ifoptimizetransparency \optimizetransparencytrue % under test +% due to bugs in pdf viewers we used transparancies for +% hiding colors, but now we use none colors + +% \def\supportedstoptransparency +% {\iffilterspotcolor +% \dostoptransparency +% \else\iftransparencysupported +% \dostoptransparency +% \fi\fi} +% +% \def\conditionalstoptransparency +% {\iffilterspotcolor +% \dostoptransparency +% \else\ifcase\currentcolorchannel +% \ifoptimizetransparency +% \ifintransparent +% \supportedstoptransparency +% \global\intransparentfalse +% \fi +% \else +% \supportedstoptransparency +% \fi +% \else +% \supportedstoptransparency +% \fi\fi} + +\let\supportedstoptransparency\relax + \def\conditionalstoptransparency - {\iffilterspotcolor - \dostoptransparency - \else\ifcase\currentcolorchannel - \ifoptimizetransparency - \ifintransparent - \dostoptransparency - \global\intransparentfalse - \fi - \else - \dostoptransparency + {\ifoptimizetransparency + \ifintransparent + \global\intransparentfalse + \supportedstoptransparency \fi \else - \dostoptransparency - \fi\fi} + \supportedstoptransparency + \fi} + +\def\supportedstarttransparency + {\iftransparencysupported + \globallet\supportedstoptransparency\dostoptransparency + \expandafter\dostarttransparency + \else + \expandafter\gobbletwoarguments + \fi} %D We now use the \type {\@@cl@@A} hook to implement %D symbolic names. These are converted into numbers @@ -1497,7 +1540,8 @@ \global\@EA\let\csname\@@currentcolorstop\endcsname\donoglobalstopcolor \else \doifcolorelse\@@askedcolor - {\docolormark\@@askedcolor + {%\docolormark\@@askedcolor + \ifpermitcolormode\docolormark\@@askedcolor\fi \global\@EA\let\csname\@@currentcolorstop\endcsname\dodoglobalstopcolor \startcolormode\@@askedcolor} {\global\@EA\let\csname\@@currentcolorstop\endcsname\donoglobalstopcolor @@ -1697,7 +1741,7 @@ \startcolormode{\rawgetsplitbotmark\colormark}}} % Private macro: only needed in test cases (like multiple -% seprations in one file); no user command! +% seperations in one file); no user command! \def\resynccolor {\ifdim\pagetotal=\zeropoint @@ -2042,7 +2086,7 @@ [#2] [ \v!cmyk=>\edef\currentcolorspace{C}, \v!rgb=>\edef\currentcolorspace{R}, - \v!gray=>\edef\currentcolorspace{S}, + \v!grijs=>\edef\currentcolorspace{S}, \v!spot=>\edef\currentcolorspace{P}, \v!s=>\edef\currentcolorspace{S}, \s!unknown=>\edef\currentcolorspace{R}]% @@ -2260,7 +2304,7 @@ \def\MPcolor{\scaledMPcolor1} -%D Before we had transparancy available, the following +%D Before we had transparency available, the following %D conversion macro was available: %D %D \starttypen diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex index 540bb32de..daef14d56 100644 --- a/tex/context/base/cont-new.tex +++ b/tex/context/base/cont-new.tex @@ -16,11 +16,35 @@ %D features. \unprotect + +\def\tabulaterule + {\dotabulaterule + {\hrule\!!height.5\scratchdimen\!!depth.5\scratchdimen\relax + \doifvalue{\??tt\currenttabulate\c!afstand}\v!grid + {\kern-\scratchdimen}}} % experimental tm-prikkels + +% todo: \stelinterliniein[regel=vast] => ==\the\baselineskip %%%%%%%% todo: \chardef\snapstruts=1 => d=l-h \writestatus{\m!systems}{beware: some patches loaded from cont-new.tex!} +\def\useMPvariables + {\dodoubleargument\douseMPvariables} + +\def\douseMPvariables[#1][#2]% + {\def\@@meta{#1:}% + \prepareMPvariables{#2}} + +\def\countXMLchildren[#1]#2% + {\startnointerference + \doglobal\newcounter\nofXMLchildren + \defineXMLargument[#1]{\doglobal\increment\nofXMLchildren}% + \startXMLignore + #2% + \stopXMLignore + \stopnointerference} + \long\def\preservePSpar#1\to#2% {\bgroup \def\par{\rawcharacter{12}\rawcharacter{12}}% @@ -28,6 +52,91 @@ \appendtoks\optimizeverbatimfalse\to\everytabulate +\def\filterfromvalue#1#2#3% value max n + {\@EA\@EAEAEA\csname + \ifcase#2\or + \ifcase#3\or + \strippedcsname\firstofoneargument + \else + \strippedcsname\gobbleoneargument + \fi + \or + \ifcase#3\or + \strippedcsname\firstoftwoarguments + \or + \strippedcsname\secondoftwoarguments + \else + \strippedcsname\gobbletwoarguments + \fi + \or + \ifcase#3\or + \strippedcsname\firstofthreearguments + \or + \strippedcsname\secondofthreearguments + \or + \strippedcsname\thirdofthreearguments + \else + \strippedcsname\gobblethreearguments + \fi + \fi + \endcsname\csname#1\endcsname} + +% \setvalue{xx}{{A}{B}{C}} + +% \filterfromvalue{xx}{3}{3} +% \filterfromvalue{xx}{3}{2} +% \filterfromvalue{xx}{3}{1} + +% new, needed for icare first col of 'doeltabel', experimental + +\newif\ifsqueezeTBLspan % \squeezeTBLspantrue + +\def\settblspn #1{\setvalue {\@@tblprefix#1:s}{1}} +\def\doifelsetblspn#1{\doifelsevalue{\@@tblprefix#1:s}{1}} + +\long\def\dohandleTBLcellA#1#2[#3]#4% + {\setbox\scratchbox\hbox + {\setupTBLcell{#1}{#2}% + \localframed + [\@@tbl\@@tbl] + [#3,\c!achtergrond=,\c!kader=\v!uit]% 25% faster + {\bTBLCELL\TBLcharalign{#2}{#4}\eTBLCELL\inTBLcell{#1}{#2}}}% + \scratchdimen\gettblwid\colTBL\relax + \ifdim\wd\scratchbox>\scratchdimen + \ifsqueezeTBLspan + \ifnum0\number\gettblcol{#1}{#2}>1\relax \settblspn\colTBL \fi + \fi + \doifelsetblspn\colTBL + \donothing{\settblwid\colTBL{\the\wd\scratchbox}}% auto set + \fi + \let\rowTBLx\rowTBL\increment\rowTBLx + \scratchdimen\gettblhei\rowTBLx\relax + \ifdim\ht\scratchbox<\scratchdimen + \settblhei\rowTBLx{\the\ht\scratchbox}% auto set + \fi + \settblht{#1}{#2}{\the\ht\scratchbox}% + \settblwd{#1}{#2}{\the\wd\scratchbox}% + \ifautoTBLcheckwidth + \ifdim\wd\scratchbox<.75\hsize + \ifdim\ht\scratchbox>2\openlineheight % honor width since this can be a + \scratchdimen\gettblaut\colTBL\relax % figure or so + \ifdim\scratchdimen=\zeropoint + % side effect: when width is set to 0pt, + % we can force a span that fits the sum of spans widths + \settblaut\colTBL{\the\scratchdimen}% + \else\ifdim\wd\scratchbox>\scratchdimen +% unless span + \settblaut\colTBL{\the\wd\scratchbox}% + % to be translated + \writestatus\m!TABLE{no auto width in (\number#1,\number#2)\space\the\wd\scratchbox/\the\hsize}% + \fi\fi + \fi + \fi + \fi + \setbox2\null + \wd2\wd\scratchbox \ht2\ht\scratchbox \dp2\dp\scratchbox + \box2} + \def\processlinetableXMLfile#1% {\bgroup \let\startlinetable\donothing @@ -135,6 +244,39 @@ % \stopcombination % \stoplinecorrection +% experimental: \synchronizegrid bla bla bla + +\newcounter\currentgridsync + +\def\gridsynctag{grs:\currentgridsync} + +\def\synchronizegrid + {\doglobal\increment\currentgridsync + \par\prevdepth\zeropoint + \nointerlineskip + \hpos\gridsynctag{\strut}\par + \vskip-\lineheight + \nointerlineskip + % top of text + \scratchdimen\MPy{\v!tekst:\MPp\gridsynctag}% + \advance\scratchdimen\MPh{\v!tekst:\MPp\gridsynctag}% + % move to first baseline + \advance\scratchdimen-\topskip + % subtract wrong baseline + \advance\scratchdimen-\MPy\gridsynctag + % get minimal number of lines + \advance\scratchdimen\lineheight + \getnoflines\scratchdimen + % calculate difference + \advance\scratchdimen-\noflines\lineheight\relax + \scratchdimen-\scratchdimen + \ifdim\scratchdimen>\zeropoint + \nointerlineskip + \advance\scratchdimen-\lineheight + \vskip\scratchdimen \strut + \par + \fi} + % needed for extreme \definesystemvariable{ie} @@ -197,7 +339,7 @@ % \setupinteraction[state=start] % -% \useattachment[whatever][test.tex] +% \useattachment[whatever][[new name]][test.tex] % % % \setupattachments[\c!symbool={symbol-normal,symbol-down}] % diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex index d4bdaa905..280f25526 100644 --- a/tex/context/base/context.tex +++ b/tex/context/base/context.tex @@ -15,7 +15,7 @@ \catcode`\{=1 \catcode`\}=2 -\def\contextversion{2003.4.29} +\def\contextversion{2003.7.21} %D Welcome to the main module. When this module is ran through %D \type{initex} or \type{tex -i} or \type{whatevertex} using @@ -262,6 +262,9 @@ \input type-ini.tex +\input prop-ini.tex +\input prop-lay.tex % needs core-ref.tex + \input math-ini.tex % after enco-ini.tex %D Now we're ready for more core modules. diff --git a/tex/context/base/core-box.tex b/tex/context/base/core-box.tex index 8d9f04f7e..d3a1ce572 100644 --- a/tex/context/base/core-box.tex +++ b/tex/context/base/core-box.tex @@ -255,6 +255,24 @@ \global\setbox\csname\@@collectorbox#1\endcsname\emptybox \fi} +\def\adaptcollector + {\dodoubleargument\doadaptcollector} + +\def\doadaptcollector[#1][#2]% + {\bgroup + \def\currentcollector{#1}% + \chardef\collectorbox\csname\@@collectorbox#1\endcsname + \getparameters + [\??cb#1][\c!voffset=\zeropoint,\c!hoffset=\zeropoint,#2]% + \scratchdimen\wd\collectorbox + \advance\scratchdimen\collectorparameter\c!hoffset + \global\wd\collectorbox\scratchdimen + \scratchdimen\ht\collectorbox + \advance\scratchdimen\collectorparameter\c!voffset + \global\ht\collectorbox\scratchdimen + \egroup} + + %\definecollector[test] %\setcollector[test] % [location=rb] @@ -801,7 +819,9 @@ {\hbox\bgroup \getparameters [\??ol] - [\c!breedte=\zeropoint,\c!hoogte=\zeropoint,\c!diepte=\zeropoint,#1]% + [\c!breedte=\zeropoint,% + \c!hoogte=\zeropoint,% + \c!diepte=\zeropoint,#1]% \setbox\scratchbox\null \wd\scratchbox\@@olbreedte \ht\scratchbox\@@olhoogte diff --git a/tex/context/base/core-des.tex b/tex/context/base/core-des.tex index 4a5c26c1c..b6bb525ca 100644 --- a/tex/context/base/core-des.tex +++ b/tex/context/base/core-des.tex @@ -441,7 +441,7 @@ \hbox {\let\normalkap\relax % sorry, uppercase causes troubles \doattributes % \nocase primitive needed - {\??dd#1}\c!kopletter\c!kopkleur + {\??dd#2#1}\c!kopletter\c!kopkleur {\getvalue{\??dd#1\c!commando}% hook for taco {\showdntext{#2#1}% \domakednnummer{#1}{#2}{#3}}}% diff --git a/tex/context/base/core-fig.tex b/tex/context/base/core-fig.tex index 4f873fabf..5a1157b68 100644 --- a/tex/context/base/core-fig.tex +++ b/tex/context/base/core-fig.tex @@ -871,6 +871,7 @@ \let\@@efpreset \v!nee \ifx\@@efbreedte\empty \def\@@efbreedte{8\lineheight}% 4cm + \fi \ifx\@@efhoogte\empty \def\@@efhoogte{6\lineheight}% 3cm \fi} @@ -1327,7 +1328,6 @@ \popmacro\figureheight \popmacro\figurewidth} - \def\externalfigurereplacement#1#2#3% {\setupcolors [\c!status=\v!lokaal]% @@ -2081,7 +2081,9 @@ {\iflocation \doifdefined{\??sd:#1}{\doifvaluesomething{\??sd:#1} {\doinsertsoundtrack{\getvalue{\??sd:#1}}{#1}\@@sdoptie - \letgvalueempty{\??sd:#1}}}% + % brr, \..empty not really needed and maybe even wrong; + % also, not here but in driver + \letgvalueempty{\??sd:#1}}}% \fi} \setexecutecommandcheck {startsound} \checksoundtrack diff --git a/tex/context/base/core-grd.tex b/tex/context/base/core-grd.tex index 08c4ebb92..27387c9d6 100644 --- a/tex/context/base/core-grd.tex +++ b/tex/context/base/core-grd.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. \writestatus{loading}{Context Core Macros / Grid Snapping} @@ -95,7 +95,7 @@ \def\showbaselinecorrection {\def\dobaselinecorrection % visualization is not watertight! {\bgroup -\ifdim\prevdepth>\zeropoint\kern-\prevdepth\fi +\ifdim\prevdepth>\zeropoint\kern-\prevdepth\fi \setbox0\null \wd0\hsize \dp0\strutdp @@ -126,14 +126,14 @@ \fi} \def\pagebaselinecorrection - {\ifdim\pagegoal<\maxdimen - \ifdim\pagetotal>\lineheight % or \topskip + {\ifdim\pagegoal<\maxdimen + \ifdim\pagetotal>\lineheight % or \topskip \scratchdimen\pagetotal - \advance\scratchdimen\lineheight + \advance\scratchdimen\lineheight \ifdim\scratchdimen<\pagegoal - \baselinecorrection - \fi - \fi + \baselinecorrection + \fi + \fi \fi} % Beware, keep this one as it is, see for instance module @@ -192,20 +192,20 @@ % \nointerlineskip % \dotopbaselinecorrection % % \else -% % \ifbinnenkolommen +% % \ifbinnenkolommen % % % \vskip\dimen2 % this could definitely % % % \penalty\outputpenalty % be improved % % \else -% % % % +% % % % % % % \vfill\eject % pretty old and wrong % % % % % % \nobreak % needed for headings -% % % \vskip\parskip % but often splits +% % % \vskip\parskip % but often splits % % % \vskip\dimen2 % normal paragraphs -% % % \penalty\outputpenalty % and therefore +% % % \penalty\outputpenalty % and therefore % % % \vskip-\dimen2 % obsolete % % % -% % % do nothing, sub optimal spacing after headings +% % % do nothing, sub optimal spacing after headings % % % still to be sorted out; use manuals as test case % % \fi % % \fi @@ -264,6 +264,10 @@ \let\showgridboxes\showgridboxestrue +\def\showgridsnapping + {\tracegridsnappingtrue + \showgridboxestrue} + \chardef\@@alignsnap =0 \chardef\@@alignsnapbox=0 @@ -273,7 +277,8 @@ \def\tracedsnapping {\iftracegridsnapping \llap - {\infofont + {\startlayoutcomponent{gridsnaps}{grid snaps}% + \infofont \doglobal\increment\currentsnap \color[grid:three]{\vl\presnapskip \vl\presnap @@ -281,17 +286,18 @@ \ifcase\@@alignsnapbox\relax \vl\ifcase\@@extrasnap 00\or - \extrasnapsign0\or + \extrasnapsign0\or \extrasnapsign\extrasnapsign\or 0\extrasnapsign\fi \fi - \vl\currentsnap\vl}}% + \vl\currentsnap\vl}% + \stoplayoutcomponent}% \fi} \def\snaptogrid% [#1]#2 -> #2 == \hbox|\vbox {\dosingleempty\dosnaptogrid} -\def\dosnaptogrid[#1]% +\def\dosnaptogrid[#1]% {\ifgridsnapping \iffirstargument\doifsomething{#1}{\verplaatsopgrid[#1]}\fi \expandafter\dodosnaptogrid @@ -299,14 +305,14 @@ \def\forcedpresnapcorrection % test this on 'details' {\ifforcepresnap - \ifvmode \else \par \fi % new - % we don't want top of page space when 'top' option + \ifvmode \else \par \fi % new + % we don't want top of page space when 'top' option %\verticalstrut\nobreak\vskip-\struttotal %\verticalstrut\vskip-\struttotal - % nobreak really needed + % nobreak really needed \allowbreak\verticalstrut\nobreak\vskip-\struttotal %\ifdim\pagetotal>\topskip \else - % eigenlijk signal + % eigenlijk signal %\writestatus{grid}{removing dummy at top of page}% %\bgroup %\output{\setbox\scratchbox\box255}% @@ -315,7 +321,7 @@ %\fi \fi} -\newif\ifboxedsnapping \boxedsnappingtrue +\newif\ifboxedsnapping \boxedsnappingtrue % \def\dodosnaptogrid % {\dowithnextbox @@ -333,7 +339,7 @@ % \flushnextbox % \ifnum\@@alignsnap<4 \vfill\fi}% % \fi -% \ifshowgridboxes +% \ifshowgridboxes % \setbox\nextbox\hbox{\color[grid:three]{\ruledhbox{\black\flushnextbox}}}% % \fi % \forgetall @@ -368,7 +374,7 @@ % \fi\fi % \fi % \fi -% \getnoflines\scratchdimen % maybe raw ? +% \getnoflines\scratchdimen % maybe raw ? % \advance\noflines -1 % \ifnum\noflines>0 % \scratchdimen\noflines\lineheight @@ -382,14 +388,14 @@ % \ifnum\@@extrasnap=2 \advance\scratchdimen \extrasnapsign.5\lineheight \fi % \edef\presnap{\the\scratchdimen}% % \ifstrutsnapping -% \ifboxedsnapping +% \ifboxedsnapping % \getrawnoflines\scratchdimen % \advance\scratchdimen-\noflines\lineheight % \vskip\scratchdimen % disappears at top of page % \dorecurse\noflines{\verticalstrut\nobreak}% % \else \ifdim\scratchdimen=\zeropoint -% % nothing to skip -% \else % disappears at top of page +% % nothing to skip +% \else % disappears at top of page % \vskip\scratchdimen % \fi \fi % \fi @@ -427,15 +433,15 @@ % \ifcase\@@alignsnapbox % % can't happen here % \or -% \getrawnoflines\scratchdimen +% \getrawnoflines\scratchdimen % \else % \getnoflines \scratchdimen -% \fi +% \fi % \scratchdimen\noflines\lineheight\relax % \advance\scratchdimen-\strutdepth -% % spoils the whole game (fit/broad/line) +% % spoils the whole game (fit/broad/line) % % \ifnum\pagetotal>\zeropoint -% % \else % disable this as option +% % \else % disable this as option % % \advance\scratchdimen-\strutheight % % \advance\scratchdimen+\topskip % % \fi @@ -449,7 +455,7 @@ % \dimen6=\nextboxdp % \setbox\nextbox\vbox to \scratchdimen % {\forgetall -% \ifnum\@@alignsnap>2 \vfill\fi % 3 4 +% \ifnum\@@alignsnap>2 \vfill\fi % 3 4 % \iftracegridsnapping % \scratchdimen\@@alignsnapamount\relax % \setbox\scratchbox\hbox @@ -458,22 +464,22 @@ % \else % \tracedgridamount\scratchdimen\zeropoint % \fi}% -% \smashbox\scratchbox +% \smashbox\scratchbox % \setbox\nextbox\hbox{\box\scratchbox\flushnextbox}% % \fi % \setbox\nextbox\hbox % {\scratchdimen\@@alignsnapamount\relax % \ifcase\@@alignsnapdepth\or -% % don't change this ever ! +% % don't change this ever ! % \ifdim\dimen0<\lineheight -% % otherwise it is ok, but ending up inside +% % otherwise it is ok, but ending up inside % % the next paragraph is seldom what we want, % % so we move one line up % \advance\scratchdimen-\lineheight % \advance\scratchdimen\strutheight % \else -% % otherwise we can move down to the -% % baseline +% % otherwise we can move down to the +% % baseline % \advance\scratchdimen\dimen6 % \fi % \fi @@ -482,41 +488,259 @@ % \nextboxdp\dimen6 % \flushnextbox % \nointerlineskip % \offinterlineskip -% \ifnum\@@alignsnap<4 \vfill\fi % 2 3 -% \kern\zeropoint}% +% \ifnum\@@alignsnap<4 \vfill\fi % 2 3 +% \kern\zeropoint}% % \ifshowgridboxes % \setbox\nextbox\vbox{\color[grid:three]{\ruledhbox{\black\flushnextbox}}}% % \fi % \scratchdimen\@@alignsnapamount % \edef\presnapskip{\the\scratchdimen}% -% \ifnum\@@alignsnap>2 \def\presnap {+}\fi -% \ifnum\@@alignsnap<4 \def\postsnap{+}\fi +% \ifnum\@@alignsnap>2 \def\presnap {+}\fi +% \ifnum\@@alignsnap<4 \def\postsnap{+}\fi % \setbox\nextbox\hbox{\tracedsnapping\flushnextbox}% % \par % \nextboxht\dimen0 % \nextboxdp\dimen2 % \forcedpresnapcorrection % \nointerlineskip -% \flushnextbox +% \flushnextbox % \fi % \else % \setbox\nextbox\vbox to \teksthoogte % {\ifdim\nextboxdp=\zeropoint % \hbox{\lower\strutdepth\flushnextbox} -% \else % this branch is yet untested +% \else % this branch is yet untested % \vss % \hbox{\lower\nextboxdp\flushnextbox} % \vskip-\strutdepth % \fi}% % \nextboxdp\strutdepth -% \flushnextbox +% \flushnextbox % \fi % \extrasnapreset % \enablepresnapcorrection % \global\chardef\@@alignsnap\zerocount % \global\chardef\@@alignsnapbox\zerocount % \egroup}} - + +% before components (keep for a while: vbox/hbox) +% +% \def\dodosnaptogrid +% {\dowithnextbox +% {\bgroup +% \ifdim\nextboxht<\teksthoogte % handle special case (like page fig) +% \ifcase\@@alignsnapbox\relax +% \ifcase\@@alignsnap\else % 1=top 2=high 3=middle 4=low +% \ifshowgridboxes +% \setbox\nextbox\hbox{\color[grid:two]{\ruledhbox{\black\flushnextbox}}}% +% \fi +% %\getnoflines{\nextboxht}% +% \getnoflines\nextboxht +% \setbox\nextbox\vbox to \noflines\lineheight +% {\ifnum\@@alignsnap=1 \kern\lineheight\kern-\topskip\fi +% \ifnum\@@alignsnap>2 \vfill\fi +% \flushnextbox +% \ifnum\@@alignsnap<4 \vfill\fi}% +% \fi +% \ifshowgridboxes +% \setbox\nextbox\hbox{\color[grid:three]{\ruledhbox{\black\flushnextbox}}}% +% \fi +% \forgetall +% \par +% \ifvbox\nextbox +% \setbox\nextbox\hbox{\flushnextbox}% don't ask +% \fi +% \scratchskip\lastskip +% \edef\presnapskip{\the\lastskip}% +% % mixing single/double columns sometimes goes wrong, +% % check 'som' document +% \ifbinnenkolommen +% \forcepresnaptrue +% \fi +% \forcedpresnapcorrection +% \ifdim\nextboxht>\strutht +% \scratchdimen\nextboxht +% \ifcase\@@presnap\relax +% \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 +% \fi +% \getnoflines\scratchdimen % maybe raw ? +% \advance\noflines -1 +% \ifnum\noflines>0 +% \scratchdimen\noflines\lineheight +% \else +% \scratchdimen\zeropoint +% \fi +% \else +% \scratchdimen\zeropoint +% \fi +% \ifnum\@@extrasnap=1 \advance\scratchdimen \extrasnapsign\lineheight \fi +% \ifnum\@@extrasnap=2 \advance\scratchdimen \extrasnapsign.5\lineheight \fi +% \edef\presnap{\the\scratchdimen}% +% \ifstrutsnapping +% \ifboxedsnapping +% \getrawnoflines\scratchdimen +% \advance\scratchdimen-\noflines\lineheight +% \vskip\scratchdimen % disappears at top of page +% \dorecurse\noflines{\verticalstrut\nobreak}% +% \else \ifdim\scratchdimen=\zeropoint +% % nothing to skip +% \else % disappears at top of page +% \vskip\scratchdimen +% \fi \fi +% \fi +% \ifdim\nextboxdp>\strutdp +% \getnoflines{\nextboxdp}% +% \advance\noflines -1 +% \ifnum\noflines>0 +% \scratchdimen\noflines\lineheight +% \else +% \scratchdimen\zeropoint +% \fi +% \else +% \scratchdimen\zeropoint +% \fi +% \ifnum\@@extrasnap=2 \advance\scratchdimen \extrasnapsign.5\lineheight \fi +% \ifnum\@@extrasnap=3 \advance\scratchdimen \extrasnapsign\lineheight \fi +% \edef\postsnap{\the\scratchdimen}% +% \ifstrutsnapping +% \nextboxht\strutht +% \nextboxdp\strutdp +% \else +% \scratchdimen\presnap +% \advance\scratchdimen \strutht +% \nextboxht\scratchdimen +% \scratchdimen\postsnap +% \advance\scratchdimen \strutdp +% \nextboxdp\scratchdimen +% \fi +% \hbox{\tracedsnapping\flushnextbox}% +% \ifstrutsnapping +% \ifdim\scratchdimen=\zeropoint\else\vskip\scratchdimen\fi +% \fi +% \else +% \scratchdimen\nextboxht\relax +% \ifcase\@@alignsnapbox +% % can't happen here +% \or +% \getrawnoflines\scratchdimen +% \else +% \getnoflines \scratchdimen +% \fi +% \scratchdimen\noflines\lineheight\relax +% \advance\scratchdimen-\strutdepth +% % spoils the whole game (fit/broad/line) +% % \ifnum\pagetotal>\zeropoint \else % disable this as option +% % \advance\scratchdimen-\strutheight +% % \advance\scratchdimen+\topskip +% % \fi +% \dimen0=\scratchdimen +% \dimen2=\strutdepth +% \ifshowgridboxes +% \setbox\nextbox\hbox{\color[grid:two]{\ruledhbox{\black\flushnextbox}}}% +% \fi +% \nextboxdp\strutdp +% \dimen4=\nextboxht +% \dimen6=\nextboxdp +% \iftracegridsnapping +% \setbox\scratchbox\hbox +% {\scratchdimen\@@alignsnapamount\relax +% \ifdim\scratchdimen<\zeropoint +% \tracedgridamount\zeropoint{-\scratchdimen}% +% \else +% \tracedgridamount\scratchdimen\zeropoint +% \fi}% +% \smashbox\scratchbox +% \setbox\nextbox\hbox{\box\scratchbox\flushnextbox}% +% \fi +% \setbox\nextbox\hbox +% {\scratchdimen\@@alignsnapamount\relax +% \ifcase\@@alignsnapdepth\or +% % don't change this ever ! +% \ifdim\dimen0<\lineheight +% % otherwise it is ok, but ending up inside +% % the next paragraph is seldom what we want, +% % so we move one line up +% \advance\scratchdimen-\lineheight +% \advance\scratchdimen\strutheight +% \else +% % otherwise we can move down to the +% % baseline +% \advance\scratchdimen\dimen6 % == \strutdepth +% \fi +% \fi +% \lower\scratchdimen\flushnextbox}% +% \nextboxht\dimen4 +% \nextboxdp\dimen6 +% \ifnum\@@alignsnap<4 % 4 = regel +% \setbox\nextbox\vbox to \scratchdimen +% {\forgetall +% \ifnum\@@alignsnap>2 \vfill\fi % 3 4 +% \flushnextbox +% \nointerlineskip % \offinterlineskip +% \ifnum\@@alignsnap<4 \vfill\fi % 2 3 +% \kern\zeropoint}% +% \fi +% \ifshowgridboxes +% \setbox\nextbox\vbox{\color[grid:three]{\ruledhbox{\black\flushnextbox}}}% +% \fi +% \scratchdimen\@@alignsnapamount +% \edef\presnapskip{\the\scratchdimen}% +% \ifnum\@@alignsnap>2 \def\presnap {+}\fi +% \ifnum\@@alignsnap<4 \def\postsnap{+}\fi +% \setbox\nextbox\hbox{\tracedsnapping\flushnextbox}% +% \par +% \nextboxht\dimen0 +% \nextboxdp\dimen2 +% \forcedpresnapcorrection +% \nointerlineskip +% \flushnextbox +% \fi +% \else +% \setbox\nextbox\vbox to \teksthoogte +% {\ifdim\nextboxdp=\zeropoint +% \hbox{\lower\strutdepth\flushnextbox} +% \else % this branch is yet untested +% \vss +% \hbox{\lower\nextboxdp\flushnextbox} +% \vskip-\strutdepth +% \fi}% +% \nextboxdp\strutdepth +% \flushnextbox +% \fi +% \extrasnapreset +% \enablepresnapcorrection +% \global\chardef\@@alignsnap\zerocount +% \global\chardef\@@alignsnapbox\zerocount +% \egroup}} + +% \def\setgridtracebox#1[#2]% +% {\setbox\nextbox#1% +% {\color[grid:#2]{\ruledhbox{\black\flushnextbox}}}} + +\def\setgridtracebox#1[#2]% % maybe reverse the order + {\setbox\nextbox#1% + {\hbox + {\hbox to \zeropoint + {\startlayoutcomponent{gridsnaps}{grid snaps}% + \color[grid:#2]{\ruledhbox{\fakebox\nextbox}}% + \stoplayoutcomponent + \hss}% + \flushnextbox}}} + \def\dodosnaptogrid {\dowithnextbox {\bgroup @@ -524,7 +748,7 @@ \ifcase\@@alignsnapbox\relax \ifcase\@@alignsnap\else % 1=top 2=high 3=middle 4=low \ifshowgridboxes - \setbox\nextbox\hbox{\color[grid:two]{\ruledhbox{\black\flushnextbox}}}% + \setgridtracebox\hbox[two]% \fi %\getnoflines{\nextboxht}% \getnoflines\nextboxht @@ -534,8 +758,8 @@ \flushnextbox \ifnum\@@alignsnap<4 \vfill\fi}% \fi - \ifshowgridboxes - \setbox\nextbox\hbox{\color[grid:three]{\ruledhbox{\black\flushnextbox}}}% + \ifshowgridboxes + \setgridtracebox\hbox[three]% \fi \forgetall \par @@ -569,7 +793,7 @@ \fi\fi \fi \fi - \getnoflines\scratchdimen % maybe raw ? + \getnoflines\scratchdimen % maybe raw ? \advance\noflines -1 \ifnum\noflines>0 \scratchdimen\noflines\lineheight @@ -583,14 +807,14 @@ \ifnum\@@extrasnap=2 \advance\scratchdimen \extrasnapsign.5\lineheight \fi \edef\presnap{\the\scratchdimen}% \ifstrutsnapping - \ifboxedsnapping + \ifboxedsnapping \getrawnoflines\scratchdimen \advance\scratchdimen-\noflines\lineheight \vskip\scratchdimen % disappears at top of page \dorecurse\noflines{\verticalstrut\nobreak}% \else \ifdim\scratchdimen=\zeropoint - % nothing to skip - \else % disappears at top of page + % nothing to skip + \else % disappears at top of page \vskip\scratchdimen \fi \fi \fi @@ -628,21 +852,21 @@ \ifcase\@@alignsnapbox % can't happen here \or - \getrawnoflines\scratchdimen + \getrawnoflines\scratchdimen \else \getnoflines \scratchdimen - \fi + \fi \scratchdimen\noflines\lineheight\relax \advance\scratchdimen-\strutdepth - % spoils the whole game (fit/broad/line) - % \ifnum\pagetotal>\zeropoint \else % disable this as option + % spoils the whole game (fit/broad/line) + % \ifnum\pagetotal>\zeropoint \else % disable this as option % \advance\scratchdimen-\strutheight % \advance\scratchdimen+\topskip % \fi \dimen0=\scratchdimen \dimen2=\strutdepth \ifshowgridboxes - \setbox\nextbox\hbox{\color[grid:two]{\ruledhbox{\black\flushnextbox}}}% + \setgridtracebox\hbox[two]% \fi \nextboxdp\strutdp \dimen4=\nextboxht @@ -655,23 +879,23 @@ \else \tracedgridamount\scratchdimen\zeropoint \fi}% - \smashbox\scratchbox + \smashbox\scratchbox \setbox\nextbox\hbox{\box\scratchbox\flushnextbox}% \fi \setbox\nextbox\hbox {\scratchdimen\@@alignsnapamount\relax \ifcase\@@alignsnapdepth\or - % don't change this ever ! + % don't change this ever ! \ifdim\dimen0<\lineheight - % otherwise it is ok, but ending up inside + % otherwise it is ok, but ending up inside % the next paragraph is seldom what we want, % so we move one line up \advance\scratchdimen-\lineheight \advance\scratchdimen\strutheight \else - % otherwise we can move down to the - % baseline - \advance\scratchdimen\dimen6 % == \strutdepth + % otherwise we can move down to the + % baseline + \advance\scratchdimen\dimen6 % == \strutdepth \fi \fi \lower\scratchdimen\flushnextbox}% @@ -680,38 +904,38 @@ \ifnum\@@alignsnap<4 % 4 = regel \setbox\nextbox\vbox to \scratchdimen {\forgetall - \ifnum\@@alignsnap>2 \vfill\fi % 3 4 + \ifnum\@@alignsnap>2 \vfill\fi % 3 4 \flushnextbox \nointerlineskip % \offinterlineskip - \ifnum\@@alignsnap<4 \vfill\fi % 2 3 - \kern\zeropoint}% + \ifnum\@@alignsnap<4 \vfill\fi % 2 3 + \kern\zeropoint}% \fi \ifshowgridboxes - \setbox\nextbox\vbox{\color[grid:three]{\ruledhbox{\black\flushnextbox}}}% + \setgridtracebox\vbox[three]% \fi \scratchdimen\@@alignsnapamount \edef\presnapskip{\the\scratchdimen}% - \ifnum\@@alignsnap>2 \def\presnap {+}\fi - \ifnum\@@alignsnap<4 \def\postsnap{+}\fi + \ifnum\@@alignsnap>2 \def\presnap {+}\fi + \ifnum\@@alignsnap<4 \def\postsnap{+}\fi \setbox\nextbox\hbox{\tracedsnapping\flushnextbox}% \par \nextboxht\dimen0 \nextboxdp\dimen2 \forcedpresnapcorrection \nointerlineskip - \flushnextbox + \flushnextbox \fi \else \setbox\nextbox\vbox to \teksthoogte {\ifdim\nextboxdp=\zeropoint \hbox{\lower\strutdepth\flushnextbox} - \else % this branch is yet untested + \else % this branch is yet untested \vss \hbox{\lower\nextboxdp\flushnextbox} \vskip-\strutdepth \fi}% \nextboxdp\strutdepth - \flushnextbox + \flushnextbox \fi \extrasnapreset \enablepresnapcorrection @@ -720,7 +944,9 @@ \egroup}} \def\tracedgridamount#1#2% - {\color[grid:four]{\vrule\!!width\nextboxwd\!!height#1\!!depth#2}} + {\startlayoutcomponent{gridsnaps}{grid snaps}% + \color[grid:four]{\vrule\!!width\nextboxwd\!!height#1\!!depth#2}% + \stoplayoutcomponent} \def\snaptomathgrid % probably not working ok, also kind of obsolete {\ifgridsnapping @@ -750,7 +976,7 @@ \hbox \fi} -\def\centertogrid % meant for special situations +\def\centertogrid % meant for special situations {\ifgridsnapping \dowithnextboxcontent {\ignorespaces} @@ -772,8 +998,8 @@ % The next implementation is sub-optimal % -% \def\centertogrid % usage: see ie pascal / stepcharts -% {\snaptogrid[\v!midden,.5\strutdp]\vbox} +% \def\centertogrid % usage: see ie pascal / stepcharts +% {\snaptogrid[\v!midden,.5\strutdp]\vbox} \ifx\startbaselinecorrection\undefined \wait \fi % change order @@ -788,13 +1014,13 @@ \fi} \def\setgridbox#1#2#3% - {\setbox#1\ruledvbox to #3 % given size + {\setbox#1\ruledvbox to #3 % given size {\forgetall - \resetteststrut + \resetteststrut \offinterlineskip \hsize#2% \baselinerulefalse - \ruledvbox % calculated size + \ruledvbox % calculated size {\getrawnoflines{#3}% \getnoflines{#3}% \vskip\topskip \vskip-\strutht @@ -820,23 +1046,23 @@ \global\let\@@alignsnapamount\!!zeropoint \global\chardef\@@alignsnapdepth0 -\def\@@unknowngriddisplacement +\def\@@unknowngriddisplacement {\global\chardef\@@alignsnapbox3 \global\let\@@alignsnapamount\commalistelement} -\def\doverplaatsopgrid[#1]% +\def\doverplaatsopgrid[#1]% {\ifgridsnapping\doifsomething{#1}{\dodoverplaatsopgrid[#1]}\fi} -% \def\dodoverplaatsopgrid[#1]% some day : speed up -% {\global\chardef\@@alignsnap\zerocount -% \global\chardef\@@alignsnapbox\zerocount -% \global\chardef\@@alignsnapdepth\zerocount +% \def\dodoverplaatsopgrid[#1]% some day : speed up +% {\global\chardef\@@alignsnap\zerocount +% \global\chardef\@@alignsnapbox\zerocount +% \global\chardef\@@alignsnapdepth\zerocount % \global\let\@@alignsnapamount\!!zeropoint -% \donefalse +% \donefalse % \expanded{\processallactionsinset[#1]} % [\v!standaard=>, -% \v!normaal=>, % to be sure -% \v!ja=>, % to be sure +% \v!normaal=>, % to be sure +% \v!ja=>, % to be sure % \v!boven=>\gridwarning+\positiveextrasnap\extrasnapbefore, % \v!onder=>\gridwarning+\positiveextrasnap\extrasnapafter, % \v!beide=>\positiveextrasnap\extrasnaparound, @@ -844,31 +1070,31 @@ % -\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!passend=>\global\chardef\@@alignsnapbox1, % new +% \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!diepte=>\global\chardef\@@alignsnapdepth1, % new +% \v!diepte=>\global\chardef\@@alignsnapdepth1, % new % \v!regel=>\global\chardef\@@alignsnapbox3 -% \global\chardef\@@alignsnap4 -% \global\chardef\@@alignsnapdepth1, +% \global\chardef\@@alignsnap4 +% \global\chardef\@@alignsnapdepth1, % \v!reset=>\positiveextrasnap\extrasnapreset, % \v!geen=>\global\chardef\@@alignsnap0 % \global\chardef\@@alignsnapbox0, % \s!default=>, % \s!unknown=>\@@unknowngriddisplacement]} -\def\dodoverplaatsopgrid[#1]% some day : speed up - {\global\chardef\@@alignsnap\zerocount - \global\chardef\@@alignsnapbox\zerocount - \global\chardef\@@alignsnapdepth\zerocount +\def\dodoverplaatsopgrid[#1]% some day : speed up + {\global\chardef\@@alignsnap\zerocount + \global\chardef\@@alignsnapbox\zerocount + \global\chardef\@@alignsnapdepth\zerocount \global\let\@@alignsnapamount\!!zeropoint - \donefalse + \donefalse \expanded{\processallactionsinset[#1]} [\v!standaard=>, - \v!normaal=>, % to be sure - \v!ja=>, % to be sure + \v!normaal=>, % to be sure + \v!ja=>, % to be sure \v!boven=>\gridwarning+\positiveextrasnap\extrasnapbefore, \v!onder=>\gridwarning+\positiveextrasnap\extrasnapafter, \v!beide=>\positiveextrasnap\extrasnaparound, @@ -876,12 +1102,12 @@ -\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!passend=>\global\chardef\@@alignsnapbox1, % new + \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!diepte=>\global\chardef\@@alignsnapdepth1, % new + \v!diepte=>\global\chardef\@@alignsnapdepth1, % new \v!regel=>\global\chardef\@@alignsnapbox3 % \global\chardef\@@alignsnapdepth1 \global\chardef\@@alignsnap4, @@ -934,7 +1160,7 @@ % \kern-\struttotal % \kern-\lineheight % \nobreak -% \vskip\lineheight +% \vskip\lineheight % \egroup % \fi\fi\fi} @@ -952,7 +1178,7 @@ \def\dosyncfuzzyvskip {\ifvmode\ifdim\lastskip<\lineheight\ifdim\lastskip>\zeropoint - \bgroup % - added 28/2/2003: check this, there was no - + \bgroup % - added 28/2/2003: check this, there was no - \endgraf\forgetall\verticalstrut\nobreak\vskip-\struttotal \egroup \fi\fi\fi} @@ -1048,7 +1274,7 @@ \def\getfuzzysnapcorrection#1% {\global\let\presnapcorrection \relax \global\let\postsnapcorrection\relax - \ifgridsnapping\iffuzzysnapping + \ifgridsnapping\iffuzzysnapping \docheckfuzzysnap{#1}% \iffuzzysnapped \iftracegridsnapping @@ -1076,7 +1302,7 @@ \global\chardef\fuzzysnappedleft0 \fi\fi\fi} -%D New: +%D New: \let\checkgridsnapping\relax diff --git a/tex/context/base/core-lst.tex b/tex/context/base/core-lst.tex index 2725d58e5..a512b5562 100644 --- a/tex/context/base/core-lst.tex +++ b/tex/context/base/core-lst.tex @@ -779,7 +779,7 @@ \endgroup \dosetlistmode} -\def\bepaallijstkenmerken% +\def\bepaallijstkenmerken {\dodoubleempty\dobepaallijstkenmerken} % \definieerreferentielijst diff --git a/tex/context/base/core-ntb.tex b/tex/context/base/core-ntb.tex index d6ad8278a..d66707523 100644 --- a/tex/context/base/core-ntb.tex +++ b/tex/context/base/core-ntb.tex @@ -110,6 +110,9 @@ \def\doiftblcol #1#2{\doifdefined {\@@tblprefix#1:#2:c}} \def\doifnottblcol #1#2{\doifundefined {\@@tblprefix#1:#2:c}} +\def\settblspn#1#2{\setvalue {\@@tblprefix#1:s}{#2}} +\def\doiftblspn #1{\doifelsevalue{\@@tblprefix#1:s}{1}} + \def\settbltxt#1#2{\long\setvalue{\@@tblprefix:#1:#2:t}} \def\gettbltxt#1#2{\csname\@@tblprefix:#1:#2:t\endcsname} diff --git a/tex/context/base/core-obj.tex b/tex/context/base/core-obj.tex index 247a5f5b6..479146bc5 100644 --- a/tex/context/base/core-obj.tex +++ b/tex/context/base/core-obj.tex @@ -252,7 +252,7 @@ %D sometimes occurs. %D %D \starttypen -%D \dosetobjectreference {class} {identifier} {reference value} +%D \dosetobjectreference {class} {identifier} {reference value} {page} %D \dogetobjectreference {class} {identifier} \csname %D \stoptypen %D @@ -268,30 +268,56 @@ \global\let\checkobjectreferences\relax \stopnointerference} +% \def\setobjectreferences +% {\def\objectreference##1##2##3% +% {\ifundefined{\r!driver##1::##2}% +% \setxvalue{\r!driver##1::##2}{##3}% +% \else +% \showmessage\m!references{31}{[##1 ##2=>##3]}% +% \fi}} + \def\setobjectreferences - {\def\objectreference##1##2##3% + {\def\objectreference##1##2##3##4% {\ifundefined{\r!driver##1::##2}% - \setxvalue{\r!driver##1::##2}{##3}% + \setxvalue{\r!driver##1::##2}{{##3}{##4}}% \else - \showmessage\m!references{31}{[##1 ##2=>##3]}% + \showmessage\m!references{31}{[##1 ##2=>##3/##4]}% \fi}} +% \def\resetobjectreferences +% {\let\objectreference\gobblethreearguments} + \def\resetobjectreferences - {\let\objectreference\gobblethreearguments} + {\let\objectreference\gobblefourarguments} \resetobjectreferences +% \def\dosetobjectreference#1#2#3% +% {\checkobjectreferences +% \blabelgroup +% \ifobjectreferencing +% \edef\dowritereference % why not immediate ? +% {\writeutilitycommand{\objectreference{#1}{#2}{#3}}}% +% \dowritereference +% \else +% \global\objectreferencingtrue +% \fi +% \setxvalue{\r!driver#1::#2}{#3}% +% \elabelgroup} + \def\dosetobjectreference#1#2#3% {\checkobjectreferences \blabelgroup - \ifobjectreferencing - \edef\dowritereference % why not immediate ? - {\writeutilitycommand{\objectreference{#1}{#2}{#3}}}% + \ifobjectreferencing + \edef\dowritereference + {\writeutilitycommand{\objectreference{#1}{#2}{#3}{\noexpand\realfolio}}}% \dowritereference \else \global\objectreferencingtrue \fi - \setxvalue{\r!driver#1::#2}{#3}% + \ifundefined{\r!driver#1::#2}% + \setxvalue{\r!driver#1::#2}{{#3}{\noexpand\realfolio}}% + \fi \elabelgroup} \def\dosetdriverreference @@ -301,18 +327,37 @@ {\global\objectreferencingfalse} \def\defaultobjectreference#1#2{0} +\def\defaultobjectpage #1#2{\realfolio} + +% \def\dogetobjectreference#1#2#3% +% {\checkobjectreferences +% \blabelgroup +% \ifundefined{\r!driver#1::#2}% +% \showmessage\m!references +% {30}{[#1 #2=>\defaultobjectreference{#1}{#2}]}% +% \xdef#3{\defaultobjectreference{#1}{#2}}% +% \else +% \global\@EA\let\@EA#3\csname\r!driver#1::#2\endcsname +% \fi +% \elabelgroup} -\def\dogetobjectreference#1#2#3% +\def\dodogetobjectreference#1#2#3#4#5% {\checkobjectreferences - \blabelgroup - \ifundefined{\r!driver#1::#2}% - \showmessage\m!references{30}{[#1 #2=>\defaultobjectreference{#1}{#2}]}% - \xdef#3{\defaultobjectreference{#1}{#2}}% + \blabelgroup + \ifundefined{\r!driver#3::#4}% + \showmessage\m!references{30}{[#3 #4=>#3/#4]}% + \xdef#5{#2{#3}{#4}}% \else - \global\@EA\let\@EA#3\csname\r!driver#1::#2\endcsname + \xdef#5{\@EAEAEA#1\csname\r!driver#3::#4\endcsname}% \fi \elabelgroup} +\def\dogetobjectreference + {\dodogetobjectreference\firstoftwoarguments\defaultobjectreference} + +\def\dogetobjectreferencepage + {\dodogetobjectreference\secondoftwoarguments\defaultobjectpage} + \def\setobject {\global\objectreferencingfalse\dosetobject1} \def\settightobject{\global\objectreferencingfalse\dosetobject0} diff --git a/tex/context/base/core-pos.tex b/tex/context/base/core-pos.tex index dec86b331..cbc7c8195 100644 --- a/tex/context/base/core-pos.tex +++ b/tex/context/base/core-pos.tex @@ -1844,6 +1844,10 @@ \advance\leftskip\leftskipadaption \dosetleftskipadaption{\getvalue{\??td\currenttextbackground\c!rechteroffset}}% \advance\rightskip\leftskipadaption +% new +\dosetraggedcommand{\getvalue{\??td\currenttextbackground\c!uitlijnen}}% +\raggedcommand +% \dostartattributes{\??td\currenttextbackground}\c!letter\c!kleur\empty \geenwitruimte \seteffectivehsize @@ -1960,7 +1964,7 @@ \copyparameters[\??td#1][\??td] [\c!status,\c!plaats,\c!variant,\c!mp,\c!methode, \c!achtergrond,\c!achtergrondkleur,\c!hoek,\c!niveau, - \c!achtergrondoffset,\c!voor,\c!na, + \c!achtergrondoffset,\c!voor,\c!na,\c!uitlijnen, \c!straal,\c!kader,\c!kaderkleur,\c!lijndikte, \c!linkeroffset,\c!rechteroffset,\c!bovenoffset,\c!onderoffset]% \getparameters[\??td#1][#2]% @@ -2016,6 +2020,7 @@ \c!onderoffset=\getvalue{\??td\currenttextbackground\c!bovenoffset}, \c!niveau=-1, \c!variant=0, + \c!uitlijnen=, \c!achtergrond=\v!kleur, \c!achtergrondkleur=lightgray, \c!achtergrondoffset=\!!zeropoint, diff --git a/tex/context/base/core-ref.tex b/tex/context/base/core-ref.tex index 9d263c9dd..479b64d47 100644 --- a/tex/context/base/core-ref.tex +++ b/tex/context/base/core-ref.tex @@ -2101,6 +2101,7 @@ \setglobalsystemreference \rt!exec \v!NextPage {next} \setglobalsystemreference \rt!exec \v!PauseMovie {pausemovie} \setglobalsystemreference \rt!exec \v!PauseSound {pausesound} +\setglobalsystemreference \rt!exec \v!PauseRendering {pauserendering} \setglobalsystemreference \rt!exec \v!PreviousJump {backward} \setglobalsystemreference \rt!exec \v!PreviousPage {previous} \setglobalsystemreference \rt!exec \v!PrintDocument {print} @@ -2109,6 +2110,7 @@ \setglobalsystemreference \rt!exec \v!ResetForm {resetform} \setglobalsystemreference \rt!exec \v!ResumeMovie {resumemovie} \setglobalsystemreference \rt!exec \v!ResumeSound {resumesound} +\setglobalsystemreference \rt!exec \v!ResumeRendering {resumerendering} \setglobalsystemreference \rt!exec \v!SaveDocument {save} \setglobalsystemreference \rt!exec \v!SaveNamedDocument{savenamed} \setglobalsystemreference \rt!exec \v!OpenNamedDocument{opennamed} @@ -2116,8 +2118,10 @@ \setglobalsystemreference \rt!exec \v!SearchAgain {searchagain} \setglobalsystemreference \rt!exec \v!StartMovie {startmovie} \setglobalsystemreference \rt!exec \v!StartSound {startsound} +\setglobalsystemreference \rt!exec \v!StartRendering {startrendering} \setglobalsystemreference \rt!exec \v!StopMovie {stopmovie} \setglobalsystemreference \rt!exec \v!StopSound {stopsound} +\setglobalsystemreference \rt!exec \v!StopRendering {stoprendering} \setglobalsystemreference \rt!exec \v!SubmitForm {submitform} \setglobalsystemreference \rt!exec \v!SwapViewer {swap} \setglobalsystemreference \rt!exec \v!ViewerHelp {help} diff --git a/tex/context/base/core-rul.tex b/tex/context/base/core-rul.tex index 713fe52ae..e333bdccb 100644 --- a/tex/context/base/core-rul.tex +++ b/tex/context/base/core-rul.tex @@ -334,6 +334,33 @@ \vsize\overlayheight \to\everyoverlay +% \long\def\executedefinedoverlay#1\\#2\\#3#4#5#6#7#8#9% +% {\bgroup +% \scratchdimen#3% +% \edef\overlaywidth{\the\scratchdimen\space}% +% \scratchdimen#4% +% \advance\scratchdimen#5% +% \edef\overlayheight{\the\scratchdimen\space}% +% \scratchdimen#5% +% \edef\overlaydepth{\the\scratchdimen\space}% +% \edef\overlaycolor{#6}% +% \let\overlayoffset\backgroundoffset % we steal this one +% %\writestatus +% % {overlay} +% % {#1\space w=\overlaywidth/h+d=\overlayheight/d=\overlaydepth]}% +% \setbox\scratchbox\hbox{\lower\overlaydepth\hbox{\the\everyoverlay#2}}% +% \dimen0\wd\scratchbox \advance\dimen0 -\overlaywidth +% \dimen2\ht\scratchbox \advance\dimen2 -#4% not \overlayheight +% %\wd\scratchbox\overlaywidth +% %\ht\scratchbox\overlayheight +% %\dp\scratchbox\overlaydepth +% \setbox\scratchbox\hbox{\hskip-.5\dimen0\raise-.5\dimen2\box\scratchbox}% +% \wd\scratchbox\overlaywidth +% \ht\scratchbox\overlayheight +% \dp\scratchbox\overlaydepth +% \box\scratchbox +% \egroup} + \long\def\executedefinedoverlay#1\\#2\\#3#4#5#6#7#8#9% {\bgroup \scratchdimen#3% @@ -358,7 +385,9 @@ \wd\scratchbox\overlaywidth \ht\scratchbox\overlayheight \dp\scratchbox\overlaydepth - \box\scratchbox + \startlayoutcomponent{o:#1}{overlay #1}% + \box\scratchbox + \stoplayoutcomponent \egroup} %D The empty case is: @@ -420,7 +449,7 @@ \def\backgroundheight{\the\vsize} \def\dobackgroundbox#1\background#2\color#3\raster#4\offset#5\corner - #6\radius#7\depth#8\\% + #6\radius#7\depth#8\component#9\\% {\vbox {\forgetall\boxmaxdepth\maxdimen \dimen0 #5\relax % space needed @@ -437,8 +466,15 @@ {\vbox to \backgroundheight{\vss\box#1\vss}}% vertical shift \def\docommando##1% {\dodobackgroundbox{##1}{#1}{#3}{#4}{#6}{#7}}% - \hbox to \backgroundwidth % in case 'foreground' is uses as overlay - {\expanded{\rawprocesscommalist[#2]\noexpand\docommando}% + \edef\component{#9}% + \hbox to \backgroundwidth % in case 'foreground' is used as overlay + {\ifx\component\empty + \expanded{\rawprocesscommalist[#2]}\docommando + \else + \startlayoutcomponent{b:\component}{background \component}% + \expanded{\rawprocesscommalist[#2]}\docommando + \stoplayoutcomponent + \fi \box#1\hss}}} %D One can explictly insert the foreground box. For that @@ -590,7 +626,7 @@ \def\defaultframeoffset{.25ex} -\unexpanded\def\framed% +\unexpanded\def\framed {\bgroup \presetlocalframed[\??ol]% \dodoubleempty\startlocalframed[\??ol]} @@ -602,9 +638,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!regels,% + \c!voorgrondletter,\c!voorgrondkleur,\c!regels,\c!component,% \c!bovenkader,\c!onderkader,\c!linkerkader,\c!rechterkader,% - \c!lijndikte,\c!kaderoffset,\c!achtergrond,% + \c!lijndikte,\c!kaderoffset,\c!achtergrond,\c!component,% \c!achtergrondoffset,\c!achtergrondraster,\c!achtergrondkleur,% \c!uitlijnen,\c!onder,\c!boven,\c!strut,\c!plaats]% \copyparameters[#1\c!achtergrond][#1]% @@ -1225,7 +1261,8 @@ \offset \framedparameter{#1}% \corner \framedparameter\c!achtergrondhoek \radius \framedparameter\c!achtergrondstraal - \depth \framedparameter\c!achtergronddiepte\\}} + \depth \framedparameter\c!achtergronddiepte + \component \framedparameter\c!component\\}} %D We handle left, right or middle alignment as well as fixed %D or free widths and heights. Each combination gets its own @@ -2397,7 +2434,7 @@ {\bgroup \verticalstrut \vskip-\struttotal}% - \blanko[\v!blokkeer]% plaatst signal + \doinhibitblank % \blanko[\v!blokkeer]% plaatst signal \doconvertfont{\getvalue{\??kd#1\c!letter}}\empty \def\dostopframedtext{\dodostopframedtext{#1}{#2}}} @@ -2415,9 +2452,9 @@ \egroup \forgetall \vskip-\lineheight - % will be an option - \setbaselinecorrections - \donegbotbaselinecorrection + % will be an option, not default + % \setbaselinecorrections + % \donegbotbaselinecorrection \verticalstrut} \stopboxedcontent \stopcolor @@ -3118,6 +3155,7 @@ \c!achtergrondoffset=\!!zeropoint, \c!kaderkleur=, \c!kaderoffset=\!!zeropoint, + \c!component=, \c!uitlijnen=, \c!onder=\vss, \c!boven=, diff --git a/tex/context/base/core-sec.tex b/tex/context/base/core-sec.tex index 982179bf9..1697a775d 100644 --- a/tex/context/base/core-sec.tex +++ b/tex/context/base/core-sec.tex @@ -331,13 +331,13 @@ \def\@@setsectionnumber#1#2% {\letgvalueempty{\??se#1\s!start}% signal i.p.v. boolean \setcounter{\??se#1}{#2}% - \resetsectioncounters{#1}% + \ifconditional\@@resetsubheadnumbers\resetsectioncounters{#1}\fi \checkpagecounter} \def\@@nextsectionnumber#1% {\letgvalueempty{\??se#1\s!start}% signal i.p.v. boolean \pluscounter{\??se#1}% - \resetsectioncounters{#1}% + \ifconditional\@@resetsubheadnumbers\resetsectioncounters{#1}\fi \checkpagecounter} \def\@@sectionvalue#1% % nog niet overal doorgevoerd @@ -993,12 +993,18 @@ \def\localkopsetup{\localheadsetup} % kan tzt weg +% todo: make them conditionals: + \newif\ifplaatskop \newif\iflegekop \newif\ifnaarlijst \newif\ifverhoognummer \newif\ifkopnummer +% new + +\newconditional\@@resetsubheadnumbers + \def\setsectieenkoppeling#1% {\edef\@@koppeling{\getvalue{\??ko#1\c!koppeling}}% \edef\@@sectie{\getvalue{\??ko#1\c!sectie}}% @@ -1061,9 +1067,10 @@ \setbox0\vbox {\doutilities{#1}{#2}{#1}\relax\relax}% \endgroup - \doifnumberelse{\foundsectionnumber} - {\doif{\foundsectionnumber}{0}{\xdef\foundsectionnumber{1}}} - {\xdef\foundsectionnumber{1}}% an appendix or so + \doifnumberelse\foundsectionnumber + {\doif\foundsectionnumber\!!zerocount + {\globallet\foundsectionnumber\!!plusone}} + {\globallet\foundsectionnumber\!!plusone}% an appendix or so \stelkopnummerin[#1][\foundsectionnumber]% \stelkopnummerin[#1][-1]} @@ -1222,6 +1229,9 @@ [ \v!ja=>\plaatskoptrue \legekopfalse, \v!leeg=>\plaatskoptrue \legekoptrue, \v!nee=>\plaatskopfalse\legekoptrue]% + \doifelsevalue{\??ko#1\c!resetnummer}\v!nee + {\setfalse\@@resetsubheadnumbers}% + {\settrue \@@resetsubheadnumbers}% \naarlijstfalse \processaction [\getvalue{\??ko#1\c!verhoognummer}] @@ -1745,7 +1755,7 @@ #1{#2}% \fi} -\def\dostelkopnummerin[#1][#2#3]% +\def\dostelkopnummerin[#1][#2#3]% todo: = (don't reset) {\bgroup \setsectieenkoppeling{#1}% \doifinstringelse{#2}{+-} @@ -1903,6 +1913,7 @@ \c!kleur=, \c!doorgaan=\v!ja, \c!plaatskop=\v!ja, + \c!resetnummer=\v!ja, \c!verhoognummer=\v!ja, \c!variant=\@@kovariant, \c!commando=\@@plaatskop, @@ -1921,7 +1932,7 @@ {\copyparameters [\??ko#1][\??ko\getvalue{\??ko#1\c!default}] [\c!voor,\c!na,\c!commando,\c!file,\c!pagina,\c!doorgaan, - \c!hoofd,\c!tekst,\c!voet,\c!scheider, + \c!hoofd,\c!tekst,\c!voet,\c!scheider,\c!resetnummer, \c!nummer,\c!eigennummer,\c!plaatskop,\c!verhoognummer, \c!letter,\c!kleur,\c!afstand,\c!variant,\c!springvolgendein, % new per 20/03/3002 (o-pbu-l) / was too confusing @@ -1947,7 +1958,7 @@ [\c!niveau,\c!sectie,\c!koppeling,\c!prefix, \c!voor,\c!na,\c!commando,\c!file,\c!pagina,\c!doorgaan, \c!scheider, - \c!hoofd,\c!tekst,\c!voet, + \c!hoofd,\c!tekst,\c!voet,\c!resetnummer, \c!nummer,\c!eigennummer,\c!plaatskop,\c!verhoognummer, \c!letter,\c!kleur,\c!afstand,\c!variant,\c!springvolgendein, % new per 20/03/3002 (o-pbu-l) / was too confusing diff --git a/tex/context/base/core-tbl.tex b/tex/context/base/core-tbl.tex index cd49e2fc1..92a791e70 100644 --- a/tex/context/base/core-tbl.tex +++ b/tex/context/base/core-tbl.tex @@ -17,6 +17,9 @@ \unprotect +% WATCH OUT: don't change this model else trialtypesetting +% compatibility problems + % watch out, cells expand pretty late on a per row basis % |p2|p3| 2:3 @@ -945,10 +948,10 @@ \ifnum\tabulatemaxplines<\plustwo \dotabulatenobreak \else -\allowbreak % needed with pbreak prevention + \allowbreak % needed with pbreak prevention \fi \else -\allowbreak % needed with pbreak prevention + \allowbreak % needed with pbreak prevention \fi \fi \fi @@ -991,11 +994,11 @@ \def\eskip {\par\egroup \global\let\tabulatehook\dotabulatehook}% -\def\xbskip - {\hbox\bgroup\vbox\bgroup - \global\let\tabulatehook\notabulatehook}% -\def\xeskip - {\par\egroup\egroup + \def\xbskip + {\hbox\bgroup\vbox\bgroup + \global\let\tabulatehook\notabulatehook}% + \def\xeskip + {\par\egroup\egroup \global\let\tabulatehook\dotabulatehook}% \let|\savedbar \global\let\tabulatehook\dotabulatehook @@ -1022,8 +1025,8 @@ \divide\tabulatewidth \nofautotabulate\relax \fi \fi -\def\xbskip{\bskip}% -\def\xeskip{\eskip}% + \def\xbskip{\bskip}% + \def\xeskip{\eskip}% \ifsplittabulate \splittopskip\strutht \global\let\flushtabulatedindeed\empty @@ -1121,9 +1124,10 @@ \verticalstrut \vskip-\struttotal}% \fi}}% + \chardef\tabulatepass\plustwo + % \startframedcontent[\getvalue{\??tt\currenttabulate\c!kader}]% % - \chardef\tabulatepass\plustwo \@EA\halign\@EA{\the\!!toksa\crcr\fulltabulatecontent\crcr}% \prevdepth\strutdp % nog eens beter, temporary hack \doifvalue{\??tt\currenttabulate\c!afstand}\v!grid diff --git a/tex/context/base/core-uti.tex b/tex/context/base/core-uti.tex index b82a7fb39..1503782f9 100644 --- a/tex/context/base/core-uti.tex +++ b/tex/context/base/core-uti.tex @@ -29,6 +29,7 @@ \edef\utilityversion{1998.07.07} % was: 1996.03.15 % status variables \edef\utilityversion{1998.12.20} % was: 1998.07.07 % index attributes +\edef\utilityversion{2003.07.19} % was: 1998.12.20 % object pages % Bepaalde commando's worden als string weggeschreven. Deze % zijn aan het eind van deze file gedefinieerd. @@ -100,7 +101,7 @@ \let\checkedutility\secondoftwoarguments -\def\docheckedutility#1#2{\ifnum#1=\nofshipouts#2\fi} +\def\docheckedutility#1#2{\ifnum#1=\nofshipouts#2\else\letterpercent\fi} \prependtoks \let\checkedutility\docheckedutility diff --git a/tex/context/base/core-var.tex b/tex/context/base/core-var.tex index 41ff5bba7..8d1fd1378 100644 --- a/tex/context/base/core-var.tex +++ b/tex/context/base/core-var.tex @@ -195,4 +195,9 @@ \let\normalabovewithdelims\abovewithdelims \let\normalatopwithdelims \atopwithdelims +%D Add-ons: + +\let\startlayoutcomponent\gobbletwoarguments +\let\stoplayoutcomponent \relax + \protect \endinput diff --git a/tex/context/base/font-ini.tex b/tex/context/base/font-ini.tex index e0676fee9..f72d547e9 100644 --- a/tex/context/base/font-ini.tex +++ b/tex/context/base/font-ini.tex @@ -3298,10 +3298,10 @@ \ifx\mathtext\undefined \let\mathtext\hbox \fi -\def\fraktur #1{\mathortext\mathtext\donothing{\frak#1}} -\def\gothic #1{\mathortext\mathtext\donothing{\goth#1}} -\def\caligraphic#1{\mathortext\mathtext\donothing{\cal #1}} -\def\blackboard #1{\mathortext\mathtext\donothing{\bbd #1}} +\def\fraktur #1{\mathortext\mathtext\donothing{\frak#1}} +\def\gothic #1{\mathortext\mathtext\donothing{\goth#1}} +\def\calligraphic#1{\mathortext\mathtext\donothing{\cal #1}} +\def\blackboard #1{\mathortext\mathtext\donothing{\bbd #1}} %D \macros %D {definebodyfontswitch} diff --git a/tex/context/base/font-run.tex b/tex/context/base/font-run.tex index 9b81ac140..5f6352a81 100644 --- a/tex/context/base/font-run.tex +++ b/tex/context/base/font-run.tex @@ -89,7 +89,7 @@ &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## &\hfil##\hfil&\vrule##&\hfil##\hfil&##\vrule - \tabskip=\!!zeropoint\cr + \tabskip\zeropoint\cr \noalign{\hrule} &\multispan{17}{\vrule\hfil\tttf\strut\title\hfil}\vrule\cr \noalign{\hrule} diff --git a/tex/context/base/m-chart.tex b/tex/context/base/m-chart.tex index 31a75f62d..f40a88a5f 100644 --- a/tex/context/base/m-chart.tex +++ b/tex/context/base/m-chart.tex @@ -93,7 +93,7 @@ % een gobble als default is sneller, en dan alleen setten als % nodig -\def\resetFLOWcell% +\def\resetFLOWcell {% variables \global\let\FLOWname \empty \global\let\FLOWalign \empty @@ -161,7 +161,7 @@ \c!hoogte=\overlayheight]}]% \overlay{\s!dummy}} -\def\doFLOWtext% +\def\doFLOWtext {\dosingleempty\dodoFLOWtext} \def\dodoFLOWtext[#1]% % #2% diff --git a/tex/context/base/meta-dum.tex b/tex/context/base/meta-dum.tex index 01a58c4ba..5e77e8229 100644 --- a/tex/context/base/meta-dum.tex +++ b/tex/context/base/meta-dum.tex @@ -41,20 +41,27 @@ % currently preparempvariables is unable to resolve number % fractions like reduction +% June 22, 2003, this definition was patched to adapt itself +% to transparent colors + \startuseMPgraphic{placeholder}{width,height,color} - numeric w, h, d, r ; color c ; path p ; - c := \MPvar{color} ; + numeric w, h, d, r ; color c, b, cc ; path p ; boolean t ; + t := is_transparent(\MPvar{color}) ; + c := not_transparent(\MPvar{color}) ; + b := not_transparent(white) ; w := \MPvar{width} ; h := \MPvar{height} ; r := \MPvar{reduction} ; d := max(w,h) ; p := unitsquare xyscaled (w,h) ; - fill p withcolor r[.5c,white] ; + cc := r[.5c,b] ; + fill p withcolor if t : transparent(1,.5,cc) else : cc fi ; for i := 1 upto 60 : + cc := r[c randomized(.3,.9),b] ; fill fullcircle scaled (d/5 randomized (d/5)) shifted (center p randomized (d)) - withcolor r[c randomized(.3,.9),white] ; + withcolor if t : transparent(1,.5,cc) else : cc fi ; endfor ; clip currentpicture to p ; \stopuseMPgraphic diff --git a/tex/context/base/meta-ini.tex b/tex/context/base/meta-ini.tex index e32ae3bdf..8b6e71042 100644 --- a/tex/context/base/meta-ini.tex +++ b/tex/context/base/meta-ini.tex @@ -312,7 +312,7 @@ \long\setgvalue{\@@MPG#1}{\handlereusableMPgraphic{#1}{#2}{#3}}% \elabelgroup} -\unexpanded\def\useMPgraphic% +\unexpanded\def\useMPgraphic {\dodoublegroupempty\douseMPgraphic} \def\douseMPgraphic#1#2% @@ -413,7 +413,7 @@ %D %D We redefine a macro from \type {supp-mps.tex}: -\def\MPdatafile% +\def\MPdatafile {\bufferprefix mpd-\the\currentMPgraphic.mpd} %D \macros diff --git a/tex/context/base/mult-con.tex b/tex/context/base/mult-con.tex index 95b17d7b8..9a44cbbd3 100644 --- a/tex/context/base/mult-con.tex +++ b/tex/context/base/mult-con.tex @@ -312,9 +312,9 @@ zitieren citovat menzione minicitat - spraak: spraak speech - speech speech - speech speech + spraak: spraak speech + speech speech + speech speech itemize: opsomming itemize aufzaehlung vycet elenco enumerare @@ -369,10 +369,10 @@ rightspeech rightspeech rightspeech rightspeech %%% - limittext: limiettekst limittext - limittext limittext + limittext: limiettekst limittext limittext limittext - + limittext limittext + datum: datum date datum datum data data @@ -406,9 +406,9 @@ achtergrondhoek: achtergrondhoek backgroundcorner hintergrundwinkel rohpozadi angolosfondo coltfundal -splitskleur: splitskleur splitcolor - splitcolor splitcolor - splitcolor splitcolor +splitskleur: splitskleur splitcolor + splitcolor splitcolor + splitcolor splitcolor achtergrondkleur: achtergrondkleur backgroundcolor hintergrundfarbe barvapozadi coloresfondo culoarefundal @@ -420,7 +420,7 @@ splitskleur: splitskleur splitcolor foregroundstyle foregroundstyle clipoffset: clipoffset clipoffset clipoffset clipoffset - clipoffset clipoffset + clipoffset clipoffset achtergrondoffset: achtergrondoffset backgroundoffset hintergrundoffset offsetpozadi offsetsfondo offsetfundal @@ -508,6 +508,9 @@ clipoffset: clipoffset clipoffset commandos: commandos commands befehle prikazy comandi comenzi +component: component component + component component + component component contrastkleur: contrastkleur contrastcolor kontrastfarbe kontrastnibarva colorecontrasto culoarecontrast @@ -949,12 +952,12 @@ clipoffset: clipoffset clipoffset preview: preview preview vorschau nahled anteprima previzualizare -proces: proces process - process process - process process - spot: spot spot - spot spot - spot spot +proces: proces process + process process + process process + spot: spot spot + spot spot + spot spot punt: punt dot punkt tecka punto punct @@ -1079,8 +1082,8 @@ proces: proces process schritt krok passo pas stapel: stapel stack - stack stack - stack stack % TB GB + stack stack + stack stack % TB GB start: start start start start inizia start @@ -1189,6 +1192,9 @@ proces: proces process verhoognummer: verhoognummer incrementnumber nummererhoehen zvysujicicislo incrementanumero numarincrement +resetnummer: resetnummer resetnumber + resetnumber resetnumber + resetnumber resetnumber verwijzing: verwijzing reference referenz odkaz riferimento referinta @@ -1268,8 +1274,8 @@ proces: proces process selbeseite stejnastranka stessapagina aceeasipagina zijuitlijnen: zijuitlijnen sidealign - sidealign sidealign - sidealign sidealign + sidealign sidealign + sidealign sidealign zij: zij side objektabstand pocitat lato parte @@ -1337,8 +1343,8 @@ zijuitlijnen: zijuitlijnen sidealign cbefehl cprikaz ccomando comandac - tekstafstand: tekstafstand textdistance - textdistance textdistance + tekstafstand: tekstafstand textdistance + textdistance textdistance distanzatesto textdistance % TB TH tekstmarge: tekstmarge textmargin textmargin textmargin @@ -1820,12 +1826,12 @@ trefwoord: trefwoord keyword programma: programma program programm program programma program -proces: proces process - process process - process process - spot: spot spot - spot spot - spot spot +proces: proces process + process process + process process + spot: spot spot + spot spot + spot spot punt: punt dot punkt tecka punto punct @@ -2063,7 +2069,7 @@ proces: proces process laatstepagina: laatstepagina lastpage letzteseite poslednistrana ultimapagina ultimapagina - laatpagenumber: laatstepaginanummer lastpagenumber + lastpagenumber: laatstepaginanummer lastpagenumber lastpagenumber lastpagenumber lastpagenumber lastpagenumber eerstesubpagina: eerstesubpagina firstsubpage @@ -2117,8 +2123,8 @@ proces: proces process segnalibro semncarte geencontrole: geencontrole nocheck - nocheck nocheck - nocheck nocheck + nocheck nocheck + nocheck nocheck % GB TB TH : @@ -2328,7 +2334,7 @@ geencontrole: geencontrole nocheck testoincorniciato textinconjurat itemgroup: itemgroup itemgroup itemgroup itemgroup - itemgroup itemgroup + itemgroup itemgroup typen: typen typing tippen typing typing typing % GB @@ -2437,7 +2443,7 @@ geencontrole: geencontrole nocheck \stopelements -%D These are predefined instances. To be cleaned up. +%D These are predefined instances. To be cleaned up. \startvariables dutch english german czech @@ -2446,7 +2452,7 @@ geencontrole: geencontrole nocheck buffer: buffer buffer puffer buffer buffer buffer - linenote: regelnoot linenote + linenote: regelnoot linenote linenote linenote linenote linenote comment: commentaar comment @@ -2596,6 +2602,24 @@ geencontrole: geencontrole nocheck ResumeSound: HervatGeluid ResumeSound ResumeSound PokracovatZvuk RiprendiSuono RepornesteSunet % TB + +% new + + StartRendering: StartRendering StartRendering + StartRendering StartRendering + StartRendering StartRendering + StopRendering: StopRendering StopRendering + StopRendering StopRendering + StopRendering StopRendering + PauseRendering: PauzeerRendering PauseRendering + PauseRendering PauseRendering + PauseRendering PauseRendering + ResumeRendering: HervatRendering ResumeRendering + ResumeRendering ResumeRendering + ResumeRendering ResumeRendering + +% new + SaveForm: BewaarFormulier SaveForm SpeicheFormular UlozitFormular SalvaForm SalveazaFormular @@ -2622,6 +2646,16 @@ geencontrole: geencontrole nocheck HoehePassend FitHeight FitHeight AjustatInaltime + HideLayer: VerbergLaag HideLayer + HideLayer HideLayer + HideLayer HideLayer + VideLayer: ToonLaag VideLayer + VideLayer VideLayer + VideLayer VideLayer +ToggleLayer: WisselLaag ToggleLayer + ToggleLayer ToggleLayer + ToggleLayer ToggleLayer + \stopvariables %D Here are some symbol names. We capitalize them because they are diff --git a/tex/context/base/mult-sys.tex b/tex/context/base/mult-sys.tex index 36113701d..3903664b0 100644 --- a/tex/context/base/mult-sys.tex +++ b/tex/context/base/mult-sys.tex @@ -470,6 +470,8 @@ \definesystemvariable {pr} % PRogrammas \definesystemvariable {ps} % PoSitioneren \definesystemvariable {pt} % PageshifT +\definesystemvariable {py} % PropertYs +\definesystemvariable {rd} % RenDering \definesystemvariable {rf} % ReFereren \definesystemvariable {rg} % ReGel \definesystemvariable {rl} % ReferentieLijst @@ -479,6 +481,7 @@ \definesystemvariable {rs} % RaSters \definesystemvariable {rt} % RoosTers \definesystemvariable {rv} % ReserVeerfiguur +\definesystemvariable {rw} % RenderingWindow \definesystemvariable {sa} % ScAle \definesystemvariable {sb} % SectieBlok \definesystemvariable {sc} % SCherm @@ -629,6 +632,7 @@ \definefileconstant {symbolprefix} {symb-} \definefileconstant {typeprefix} {type-} \definefileconstant {xtagprefix} {xtag-} +\definefileconstant {propprefix} {prop-} \definefileconstant {moduleprefix} {m-} \definefileconstant {styleprefix} {s-} diff --git a/tex/context/base/page-app.tex b/tex/context/base/page-app.tex index 5b5d49f49..76a056a50 100644 --- a/tex/context/base/page-app.tex +++ b/tex/context/base/page-app.tex @@ -111,6 +111,7 @@ \starttext #2% preamble \startTEXpage[#1]% +\topskip\zeropoint \setbox\scratchbox\hbox{#3}% \saveTEXapplication02% dimensions \box\scratchbox diff --git a/tex/context/base/page-bck.tex b/tex/context/base/page-bck.tex index 073edfdfd..1c7a6a96f 100644 --- a/tex/context/base/page-bck.tex +++ b/tex/context/base/page-bck.tex @@ -133,7 +133,8 @@ {\ifsomebackgroundfound#1\ifdim#3>\zeropoint\ifdim#4>\zeropoint \setbox#2\vbox\localframed [\??ma#1] - [\c!strut=\v!nee,\c!offset=\v!overlay, + [\c!component=#1, + \c!strut=\v!nee,\c!offset=\v!overlay, \c!breedte=#3,\c!hoogte=#4] {\dp#2\zeropoint\box#2}% \fi\fi\fi} @@ -175,8 +176,7 @@ \setbox#1\vbox {\offinterlineskip \doifmarginswapelse - {\copy\leftbackground} - {\copy\rightbackground} + {\copy\leftbackground}{\copy\rightbackground}% \box#1}% \fi} @@ -346,7 +346,8 @@ \ifdim#1>\zeropoint\relax \localframed [\??ma#3#4] - [\c!breedte=#1,\c!hoogte=#2,\c!offset=\v!overlay] + [\c!component=#3-#4, + \c!breedte=#1,\c!hoogte=#2,\c!offset=\v!overlay] {\getvalue{\??ma#3#4\c!commando}}% {\hsize=#1\vsize=#2....} \else \hskip#1% @@ -603,7 +604,8 @@ \dodoglobal\setbox#1\hbox {\localframed [\??ma\v!lokaal] - [\c!kader=\v!uit, + [\c!component=local, + \c!kader=\v!uit, \c!offset=\v!overlay, \c!achtergrond=\localbackground]% {\registerMPlocaltextarea{\box#1}}}% diff --git a/tex/context/base/page-flt.tex b/tex/context/base/page-flt.tex index f3f401ee6..ba581cdf7 100644 --- a/tex/context/base/page-flt.tex +++ b/tex/context/base/page-flt.tex @@ -200,7 +200,7 @@ \def\dodocomplexplaatsblok[#1][#2][#3]#4% {\flushnotes -\flushsidefloats % here ! +\flushsidefloats % here ! \ifsomefloatwaiting % this was \checkwaitingfloats spread all over \doifinsetelse\v!altijd{#2} @@ -360,12 +360,12 @@ % \@EA\firstoftwoarguments % \fi} -\def\doifrightpagefloatelse +\def\doifrightpagefloatelse {\ifdubbelzijdig \ifenkelzijdig \@EAEAEA\firstoftwoarguments \else - \@EAEAEA\doifoddfloatpageelse + \@EAEAEA\doifoddfloatpageelse \fi \else \@EA\firstoftwoarguments @@ -423,30 +423,61 @@ \expanded{\dorepeatwithcommand[#1]}\movedownsidefloat}% \egroup} +% \def\xdocompletefloat#1#2#3#4#5#6% +% {\ifextrafloatactions +% \let\@@extrafloat\empty +% % \sidefloatdownshift will be reset afterwards, and can +% % already be set at this point +% \processallactionsinset +% [#4] % ininner/inouter : for old times sake +% [ \v!binnen=>\xxdocompletefloat\v!links \v!rechts, +% \v!buiten=>\xxdocompletefloat\v!rechts \v!links, +% \v!binnenmarge=>\xxdocompletefloat\v!linkermarge \v!rechtermarge, +% \v!buitenmarge=>\xxdocompletefloat\v!rechtermarge\v!linkermarge, +% \v!binnenrand=>\xxdocompletefloat\v!linkerrand \v!rechterrand, +% \v!buitenrand=>\xxdocompletefloat\v!rechterrand \v!linkerrand, +% \v!rugwit=>\xxdocompletefloat\v!rugwit \v!snijwit, +% \v!snijwit=>\xxdocompletefloat\v!snijwit \v!rugwit, +% \v!links=>\xxdocompletefloat\v!links \v!links, +% \v!rechts=>\xxdocompletefloat\v!rechts \v!rechts, +% \v!regel=>, % only -n*line is handled (see ***) +% \s!unknown=>{\movedownsidefloat[\commalistelement]}]% +% \ifx\@@extrafloat\empty +% \docompletefloat{#1}{#2}{#3}{#4}{#5}{#6}\nextbox +% \else +% \docompletefloat{#1}{#2}{#3}{\@@extrafloat,#4}{#5}{#6}\nextbox +% \fi +% \else % downward compatible +% \docompletefloat{#1}{#2}{#3}{#4}{#5}{#6}\nextbox +% \fi} + \def\xdocompletefloat#1#2#3#4#5#6% {\ifextrafloatactions - \let\@@extrafloat\empty - % \sidefloatdownshift will be reset afterwards, and can - % already be set at this point - \processallactionsinset - [#4] % ininner/inouter : for old times sake - [ \v!binnen=>\xxdocompletefloat\v!links \v!rechts, - \v!buiten=>\xxdocompletefloat\v!rechts \v!links, - \v!binnenmarge=>\xxdocompletefloat\v!linkermarge \v!rechtermarge, - \v!buitenmarge=>\xxdocompletefloat\v!rechtermarge\v!linkermarge, - \v!binnenrand=>\xxdocompletefloat\v!linkerrand \v!rechterrand, - \v!buitenrand=>\xxdocompletefloat\v!rechterrand \v!linkerrand, - \v!rugwit=>\xxdocompletefloat\v!rugwit \v!snijwit, - \v!snijwit=>\xxdocompletefloat\v!snijwit \v!rugwit, - \v!links=>\xxdocompletefloat\v!links \v!links, - \v!rechts=>\xxdocompletefloat\v!rechts \v!rechts, - \v!regel=>, % only -n*line is handled (see ***) - \s!unknown=>{\movedownsidefloat[\commalistelement]}]% - \ifx\@@extrafloat\empty - \docompletefloat{#1}{#2}{#3}{#4}{#5}{#6}\nextbox - \else - \docompletefloat{#1}{#2}{#3}{\@@extrafloat,#4}{#5}{#6}\nextbox - \fi + \doifinsetelse\v!tekst{#4} + {% fuzzy, text overloads left, since then it's a directive + \docompletefloat{#1}{#2}{#3}{#4}{#5}{#6}\nextbox} + {\let\@@extrafloat\empty + % \sidefloatdownshift will be reset afterwards, and can + % already be set at this point + \processallactionsinset + [#4] % ininner/inouter : for old times sake + [ \v!binnen=>\xxdocompletefloat\v!links \v!rechts, + \v!buiten=>\xxdocompletefloat\v!rechts \v!links, + \v!binnenmarge=>\xxdocompletefloat\v!linkermarge \v!rechtermarge, + \v!buitenmarge=>\xxdocompletefloat\v!rechtermarge\v!linkermarge, + \v!binnenrand=>\xxdocompletefloat\v!linkerrand \v!rechterrand, + \v!buitenrand=>\xxdocompletefloat\v!rechterrand \v!linkerrand, + \v!rugwit=>\xxdocompletefloat\v!rugwit \v!snijwit, + \v!snijwit=>\xxdocompletefloat\v!snijwit \v!rugwit, + \v!links=>\xxdocompletefloat\v!links \v!links, + \v!rechts=>\xxdocompletefloat\v!rechts \v!rechts, + \v!regel=>, % only -n*line is handled (see ***) + \s!unknown=>{\movedownsidefloat[\commalistelement]}]% + \ifx\@@extrafloat\empty + \docompletefloat{#1}{#2}{#3}{#4}{#5}{#6}\nextbox + \else + \docompletefloat{#1}{#2}{#3}{\@@extrafloat,#4}{#5}{#6}\nextbox + \fi}% \else % downward compatible \docompletefloat{#1}{#2}{#3}{#4}{#5}{#6}\nextbox \fi} @@ -469,7 +500,7 @@ \box#3% \doifnotvalue{\??fl#1\c!plaats}\v!rechts\hss}% \fi}% - % todo: rand / rug + % todo: rand / rug \doifinset\v!hangend{#2} {\doifcommonelse{\v!inlinker,\v!linkermarge}{#2} {\letvalue{\??fl#1\c!maxbreedte}\linkermargebreedte}% @@ -930,7 +961,7 @@ \def\sometextfloat[#1]% lang, links, rechts, hoog, midden, laag, offset {%\checkwaitingfloats{#1}% - \def\dostoptextfloat{\dodostoptextfloat[#1]}% + \gdef\dostoptextfloat{\dodostoptextfloat[#1]}% brr global \global\floattextwidth\hsize \global\floatwidth\wd\floatbox \global\floatheight\ht\floatbox % forget about the depth @@ -1732,7 +1763,7 @@ \xdef\naturalfloatdepth {\the\dp#1}} \long\def\docompletefloat#1#2#3#4#5#6#7% #7 = box number - {%\flushsidefloats % moved + {%\flushsidefloats % moved \presetfloatvariables{#1}{#4}{#2}{#6}% \bgroup \setnaturalfloatdimensions#7% diff --git a/tex/context/base/page-flw.tex b/tex/context/base/page-flw.tex new file mode 100644 index 000000000..65d18c49c --- /dev/null +++ b/tex/context/base/page-flw.tex @@ -0,0 +1,104 @@ +%D \module +%D [ file=page-flw, +%D version=2003.04.19, % from test-002 (1997) profile experiment +%D title=\CONTEXT\ OTR Macros, +%D subtitle=Text Flows, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA ADE] +%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 OTR Macros / Text Flows} + +\unprotect + +\def\definetextflow + {\dodoubleempty\dodefinetextflow} + +\def\dodefinetextflow[#1][#2]% flow settings + {\iffirstargument + \doiftextflowcollectorelse{#1} + {\setbox\textflowcollector{#1}\emptybox} + {\@EA\newbox\csname\??tx:c:#1\endcsname}% + \getparameters[\??tx:p:#1] + [\c!breedte=\hsize,\c!letter=,#2]% + \fi} + +\def\textflowparameter#1#2{\csname\??tx:p:#1#2\endcsname} +\def\textflowcollector #1{\csname\??tx:c:#1\endcsname} + +\def\doiftextflowcollectorelse#1{\doifdefinedelse{\??tx:c:#1}} + +\def\doiftextflowelse#1% + {\doiftextflowcollectorelse{#1} + {\ifvoid\textflowcollector{#1}% + \expandafter\secondoftwoarguments + \else + \expandafter\firstoftwoarguments + \fi} + {\secondoftwoarguments}} + +\def\doiftextflow#1% + {\doiftextflowelse{#1}\firstofoneargument\gobbleoneargument} + +\def\starttextflow[#1]% + {\doiftextflowcollectorelse{#1} + {\global\setbox\textflowcollector{#1}\vbox + \bgroup + \unvbox\textflowcollector{#1}% + \hsize\textflowparameter{#1}\c!breedte + \doifsomething{\textflowparameter{#1}\c!letter}% + {\doconvertfont{\textflowparameter{#1}\c!letter}}% + \def\stoptextflow{\endgraf\egroup}} + {\let\stoptextflow\relax}} + +\def\flushtextflow#1% + {\doiftextflow{#1} + {\ifdim\ht\textflowcollector{#1}>\vsize + \setbox\scratchbox\vsplit\textflowcollector{#1} to \vsize + \unvbox\scratchbox + \else + \unvbox\textflowcollector{#1}% + \fi}} + +\protect \endinput + +% Example (dutch) +% +% \stelpapierformaatin [S6] +% \steltolerantiein [soepel,rek] +% \stelkleurenin [status=start] +% \stelvoetin [strut=nee] +% \stelwitruimtein [groot] +% +% \stellayoutin +% [rechterrand=5cm,breedte=passend,marge=0pt,randafstand=1cm, +% voet=4cm,voetafstand=1cm,hoofd=0cm] +% +% \stelteksttekstenin[rand][][\flushtextflow{first}] +% \stelvoettekstenin [rand][][\flushtextflow{second}] +% \stelvoettekstenin [\flushtextflow{third}][] +% +% \definetextflow [first] [alfa] [breedte=\rechterrandbreedte] +% \definetextflow [second] [beta] [breedte=\rechterrandbreedte] +% \definetextflow [third] [gamma] [breedte=\voethoogte] +% +% \starttekst +% +% \dorecurse{50} +% {\getrandomnumber{\funny}{0}{8} +% \ifcase\funny \starttextflow[alfa] \input tufte.tex \stoptextflow +% \or \starttextflow[beta] \input knuth.tex \stoptextflow +% \or \starttextflow[gamma] \input materie.tex \stoptextflow +% \or {\bf TUFTE}\quad \input tufte \par +% \or {\bf TUFTE}\quad \input tufte \par +% \or {\bf KNUTH}\quad \input knuth \par +% \or {\bf KNUTH}\quad \input knuth \par +% \or {\bf MATERIE}\quad \input materie \par +% \else {\bf MATERIE}\quad \input materie \par +% \fi} +% +% \stoptekst diff --git a/tex/context/base/page-lay.tex b/tex/context/base/page-lay.tex index 16419e769..ff12825e6 100644 --- a/tex/context/base/page-lay.tex +++ b/tex/context/base/page-lay.tex @@ -1250,6 +1250,7 @@ \definepapersize [S4] [\c!breedte=400pt,\c!hoogte=300pt] \definepapersize [S5] [\c!breedte=500pt,\c!hoogte=375pt] \definepapersize [S6] [\c!breedte=600pt,\c!hoogte=450pt] +\definepapersize [S8] [\c!breedte=800pt,\c!hoogte=600pt] \definepapersize [SW] [\c!breedte=800pt,\c!hoogte=450pt] %D These are handy too: diff --git a/tex/context/base/page-lyr.tex b/tex/context/base/page-lyr.tex index 8a06c3c2f..684d20d3f 100644 --- a/tex/context/base/page-lyr.tex +++ b/tex/context/base/page-lyr.tex @@ -393,6 +393,30 @@ {\dodoflushlayer0{#1}{#2#1:\realfolio}} \stopoverlay}} +% \def\dodoflushlayer#1#2#3% +% {\ifundefined{\@@layerbox#3}% +% \ifcase#1\else\writestatus{layer}{unknown layer #3}\fi +% \else +% \doifvalue{\??ll#2\c!optie}\v!test\tracelayerstrue +% \iftracelayers\traceboxplacementtrue\fi +% \doifelsevalue{\??ll#2\c!methode}\v!tekst\donetrue\donefalse +% \iftracelayers \ruledvbox \else \vbox \fi \ifdone \else to \overlayheight \fi +% {\forgetall +% \hbox \ifdone \else to \overlaywidth \fi +% {% klopt dit? #3 en niet #2 ? +% \doifvalue{\??ll#3\realfolio\c!positie}\v!ja +% {\xypos{lyr:#3:\realfolio}}% +% \let\next\box +% \ifcase#1\else +% \doifnotvalue{\??ll#2\c!positie}\v!ja +% {\doifvalue{\??ll#2\c!status}\v!herhaal +% {\let\next\copy}}% +% \fi +% \next\csname\@@layerbox#3\endcsname +% \hss}% +% \vss}% +% \fi} + \def\dodoflushlayer#1#2#3% {\ifundefined{\@@layerbox#3}% \ifcase#1\else\writestatus{layer}{unknown layer #3}\fi @@ -412,7 +436,11 @@ {\doifvalue{\??ll#2\c!status}\v!herhaal {\let\next\copy}}% \fi - \next\csname\@@layerbox#3\endcsname + \doifoverlayelse{#3} + {\next\csname\@@layerbox#3\endcsname}% + {\startlayoutcomponent{l:#3}{layer #3}% + \next\csname\@@layerbox#3\endcsname + \stoplayoutcomponent}% \hss}% \vss}% \fi} diff --git a/tex/context/base/page-num.tex b/tex/context/base/page-num.tex index bbb224658..20c079306 100644 --- a/tex/context/base/page-num.tex +++ b/tex/context/base/page-num.tex @@ -292,7 +292,7 @@ \def\dostelpaginanummerin[#1]% {\getparameters[\??pn][\c!nummer=,#1]% \global\let\@@pnstatus\@@pnstatus - \doifsomething{\@@pnnummer} + \doifsomething\@@pnnummer {\setnummer[\s!page]{\@@pnnummer}% \setuserpageno{\ruwenummer[\s!page]}}% % this makes starting at an even page possible @@ -541,7 +541,7 @@ {\ifnum\countervalue{\??se##1}>\zerocount \getvalue{##1\c!nummer}\@@nmnummerscheider \fi}% - \doifsomething{\@@nmtekst} + \doifsomething\@@nmtekst {\@@nmtekst\@@nmnummerscheider}% \donexttracklevel{##1}}% \donexttrackcommando{\firstsection}} diff --git a/tex/context/base/page-set.tex b/tex/context/base/page-set.tex index 90a455e8b..4bd1f2188 100644 --- a/tex/context/base/page-set.tex +++ b/tex/context/base/page-set.tex @@ -1100,10 +1100,32 @@ \OTRSETstoreincolumnslotFIXD{#1}% \fi} +% this one looses too wide graphics +% +% \def\OTRSETstoreincolumnslotFIXD#1% fixed column +% {\OTRSETprepareforcolumnslot2{#1}% +% % no flush text sofar here, beware: no width test +% \snaptogrid\vbox{\box#1}} +% +% still imperfect + \def\OTRSETstoreincolumnslotFIXD#1% fixed column - {\OTRSETprepareforcolumnslot2{#1}% - % no flush text sofar here - \snaptogrid\vbox{\box#1}} + {\OTRSETflushtextsofar + \ifdim\wd#1>\tekstbreedte + \OTRSETstoreincolumnslotSOMEWHERE2{#1}% + \else + % crappy test / needed for o-pbu-f / will be replaced + \getnoflines{\ht#1}% + \scratchdimen\dimexpr(\noflines\lineheight+\lineheight)\relax + \advance\scratchdimen\pagetotal\relax + \ifdim\scratchdimen<\pagegoal + \OTRSETprepareforcolumnslot3{#1}% + \snaptogrid\vbox{\box#1}% + \blanko + \else + \OTRSETstoreincolumnslotSOMEWHERE2{#1}% + \fi + \fi} \def\OTRSETstoreincolumnslotSOMEWHERE#1#2% {\OTRSETprepareforcolumnslot{#1}{#2}% diff --git a/tex/context/base/page-txt.tex b/tex/context/base/page-txt.tex index 4fb80a972..5b1d21713 100644 --- a/tex/context/base/page-txt.tex +++ b/tex/context/base/page-txt.tex @@ -414,10 +414,14 @@ \hskip\linkermargeafstand \egroup \settextpagecontent\scratchpagebox{#1}{#2}% +\setbox\scratchpagebox\vbox + {\startlayoutcomponent{textbody}{text body}% + \box\scratchpagebox + \stoplayoutcomponent}% \addtextbackground\scratchpagebox \addtextgridlayer\scratchpagebox \localstarttextcolor - \box\scratchpagebox + \box\scratchpagebox \localstoptextcolor \bgroup \hskip\rechtermargeafstand @@ -457,6 +461,7 @@ \setbox#1\hbox {\ifcase\showgridstate\or\or\box#1\hskip-\zetbreedte\fi \bgroup % color +\startlayoutcomponent{gridcolumns}{grid columns}% \incolortrue \ifcase\layoutcolumns\else \gray @@ -471,8 +476,11 @@ \fi}}% \hskip-\zetbreedte \fi +\stoplayoutcomponent +\startlayoutcomponent{gridlines}{grid lines}% \red \box\scratchbox +\stoplayoutcomponent \egroup \ifcase\showgridstate\or\hskip-\zetbreedte\box#1\fi}% \fi} @@ -557,11 +565,20 @@ {\getvalue{\??tk#1\v!rand#4}\hss}% \fi}} +% \def\dododoplacelayouttextline#1#2#3#4% +% {\vbox % to \vsize +% {\hsize#1\relax +% \getvalue{\??tk#2#3\c!voor} +% \hbox to #1{#4}% +% \getvalue{\??tk#2#3\c!na}}} + \def\dododoplacelayouttextline#1#2#3#4% {\vbox % to \vsize {\hsize#1\relax - \getvalue{\??tk#2#3\c!voor} - \hbox to #1{#4}% + \getvalue{\??tk#2#3\c!voor}% + \startlayoutcomponent{t:#2:#3}{area #2 #3}% + \hbox to #1{#4}% + \stoplayoutcomponent \getvalue{\??tk#2#3\c!na}}} %D Although it is far better to use backgrounds for this diff --git a/tex/context/base/prop-ini.tex b/tex/context/base/prop-ini.tex new file mode 100644 index 000000000..3c077564f --- /dev/null +++ b/tex/context/base/prop-ini.tex @@ -0,0 +1,48 @@ +%D \module +%D [ file=prop-ini, +%D version=2003.04.20, +%D title=\CONTEXT\ Property Macros, +%D subtitle=Initialization, +%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 Property Macros / initialization} + +%D Experimental module. + +%D local or not? like colors? cross pages? needed? + +%D combine with newfont.tex + +\unprotect + +\def\defineproperty + {\dotripleempty\dodefineproperty} + +\def\dodefineproperty[#1][#2][#3]% todo : global def + {\ifundefined{\??py#1\c!titel}% + \getgparameters[\??py#1][\c!titel=#1,#3]% + \setgvalue{\e!start#1}{\getvalue{init#2property}{#1}{#2}}% + \setgvalue{\e!stop #1}{\getvalue{stop#2property}}% + \fi} + +\unexpanded\def\startproperty[#1]% + {\bgroup\edef\currentproperty{#1}% + \csname\e!start\currentproperty\endcsname} + +\unexpanded\def\stopproperty + {\csname\e!stop \currentproperty\endcsname + \egroup} + +\unexpanded\def\property[#1]% + {\groupedcommand + {\edef\currentproperty{#1}% + \csname\e!start\currentproperty\endcsname} + {\csname\e!stop \currentproperty\endcsname}} + +\protect \endinput diff --git a/tex/context/base/prop-lay.tex b/tex/context/base/prop-lay.tex new file mode 100644 index 000000000..d8e7fcb2e --- /dev/null +++ b/tex/context/base/prop-lay.tex @@ -0,0 +1,115 @@ +%D \module +%D [ file=prop-lay, +%D version=2003.04.20, +%D title=\CONTEXT\ Property Macros, +%D subtitle=Layers, +%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 Property Macros / layers} + +%D Highly experimental, will probably change/evolve. + +\unprotect + +\def\initlayerproperty#1#2% + {\dodefineviewerlayer + {#1}% tag + {\getvalue{\??py#1\c!titel}}% title + {1}% visible + {0}% type (1=frozen) + {0}% printable + \setgvalue{\e!start#1}{\getvalue{start#2property}{#1}}% + \getvalue{\e!start#1}} + +\def\startlayerproperty#1% + {\dostartviewerlayer{#1}} + +\def\stoplayerproperty + {\dostopviewerlayer} + +\setglobalsystemreference \rt!exec \v!HideLayer {hidelayer} +\setglobalsystemreference \rt!exec \v!VideLayer {videlayer} +\setglobalsystemreference \rt!exec \v!ToggleLayer {togglelayer} + +\setexecutecommandcheck {hidelayer} \domakelayerpropertylist +\setexecutecommandcheck {videlayer} \domakelayerpropertylist +\setexecutecommandcheck {togglelayer} \domakelayerpropertylist + +\def\domakelayerpropertylist + {\iflocation + \expandafter\domakeviewerlayerlist + \else + \expandafter\gobbleoneargument + \fi} + +% \defineproperty [debugging] [layer] [title=debugging] +% \defineproperty [navigation] [layer] [title=navigation] + +%D \starttext +%D +%D \setuppapersize[S4][S4] +%D \setuplayout[middle] +%D \setupcolors[state=start] +%D \setupinteraction[state=start,color=,contrastcolor=] +%D +%D \defineproperty [L1] [layer] [title=layer 1] +%D \defineproperty [L2] [layer] [title=layer 2] +%D +%D \button{HIDE L1}[HideLayer{L1}] +%D \button{VIDE L1}[VideLayer{L1}] +%D \button{TOGGLE L1}[ToggleLayer{L1}] +%D +%D \button{HIDE L2}[HideLayer{L2}] +%D \button{VIDE L2}[VideLayer{L2}] +%D \button{TOGGLE L2}[ToggleLayer{L2}] +%D +%D \noheaderandfooterlines \centerbox{\startoverlay +%D {\definedfont[Mono at 150pt]% +%D \startproperty[L1]\red TEST\stopproperty} +%D {\definedfont[Mono at 150pt]% +%D \startproperty[L2]\green TEST\stopproperty} +%D \stopoverlay} \page +%D +%D \noheaderandfooterlines \centerbox{\startoverlay +%D {\definedfont[Mono at 15pt]% +%D \goto{\startproperty[L1]\red TEST\stopproperty}[CloseDocument]} +%D {\definedfont[Mono at 15pt]% +%D \goto{\startproperty[L2]\green TEST\stopproperty}[CloseDocument]} +%D \stopoverlay} \page +%D +%D \startproperty[L1] +%D level 1 \startproperty[L2]level 2 \stopproperty level 1 +%D \stopproperty +%D +%D \startproperty[L1] +%D level 1 \page \startproperty[L2]level 2 \stopproperty level 1 +%D \stopproperty +%D +%D \stoptext + +\fetchruntimecommand \showlayoutcomponents {\f!propprefix\s!run} + +\protect \endinput + +% \def\remaplayering +% {\dodoubleargument\doremaplayering} +% +% \def\remaplayering[#1][#2]% +% {\setvalue{\??lm#1}{#2}} +% +% \def\remappedlayering#1% +% {\ifcsname\??lm#1\endcsname +% \@EA\remappedlayering\csname\??lm#1\endcsname\else#1% +% \fi} +% +% \def\startshowlayering#1#2% +% {\ifshowlayering +% \defineproperty[\remappedlayering{#1}][layer][\c!titel=#2]% +% \startproperty[\remappedlayering{#1}]% +% \fi} diff --git a/tex/context/base/prop-run.tex b/tex/context/base/prop-run.tex new file mode 100644 index 000000000..1f4f12d17 --- /dev/null +++ b/tex/context/base/prop-run.tex @@ -0,0 +1,34 @@ +%D \module +%D [ file=prop-run, +%D version=2003.04.20, +%D title=\CONTEXT\ Property Macros, +%D subtitle=Runtime 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. + +\unprotect + +\doglobal\newif\ifshowcomponents + +\gdef\showlayoutcomponents + {\showcomponentstrue} + +\gdef\startlayoutcomponent#1#2% + {\ifshowcomponents + \doifelsenothing{#2}% + {\defineproperty[#1][layer][\c!titel=#1]}% + {\defineproperty[#1][layer][\c!titel=#2]}% + \startproperty[#1]% + \fi} + +\gdef\stoplayoutcomponent + {\ifshowcomponents + \stopproperty + \fi} + +\protect \endinput diff --git a/tex/context/base/s-mag-01.tex b/tex/context/base/s-mag-01.tex index 615dad5db..471a8a6e4 100644 --- a/tex/context/base/s-mag-01.tex +++ b/tex/context/base/s-mag-01.tex @@ -31,7 +31,7 @@ % todo: mp frames -\setvariables[magazine][number=123] +\setvariables[magazine][number=0] \setvariables[magazine][author=] \setvariables[magazine][title={Zero Issue}] \setvariables[magazine][date=\currentdate] @@ -207,7 +207,9 @@ \dp\scratchbox\zeropoint \MainColor \definedfont[Regular sa 2]% - \doifmode{atpragma}{\#\getvariable{magazine}{number}}% + \doifsomething{\getvariable{magazine}{number}} + {\doifnot{\getvariable{magazine}{number}}{0} + {\#\getvariable{magazine}{number}}}% \quad \currentdate \quad diff --git a/tex/context/base/s-pre-04.tex b/tex/context/base/s-pre-04.tex index 6d167e6b2..29b040a8b 100644 --- a/tex/context/base/s-pre-04.tex +++ b/tex/context/base/s-pre-04.tex @@ -219,7 +219,7 @@ \defineoverlay [TitleGraphic] [\useMPgraphic{title}] \defineoverlay [NextPage] [\overlaybutton{nextpage}] -\def\StartTitlePage% +\def\StartTitlePage {\setupbackgrounds[page][background={color,TitleGraphic,NextPage}] \setupbackgrounds[text][text][background=] \setupinteraction[menu=off] @@ -231,7 +231,7 @@ \vfil \let\\=\vfil} -\def\StopTitlePage% +\def\StopTitlePage {\vfil\vfil\vfil \stopstandardmakeup \setupinteraction[menu=on] diff --git a/tex/context/base/setupb.tex b/tex/context/base/setupb.tex index 4f528a13a..9881a5566 100644 --- a/tex/context/base/setupb.tex +++ b/tex/context/base/setupb.tex @@ -5068,6 +5068,10 @@ [\c!verhoognummer] [\v!ja,\v!nee,\v!lijst,\c!filename!] % lijst: wel lijstentry [\v!ja] + \variable + [\c!resetnummer] + [\v!ja,\v!nee] + [\v!ja] % \variable % [\c!scheider] % [\c!text!] diff --git a/tex/context/base/spec-def.tex b/tex/context/base/spec-def.tex index fa7b79b0e..7dc74e59a 100644 --- a/tex/context/base/spec-def.tex +++ b/tex/context/base/spec-def.tex @@ -162,6 +162,9 @@ \installspecial [\doregisterrgbspotcolor] [or] [4] \installspecial [\doregistergrayspotcolor] [or] [2] +\installspecial [\dostartnonecolormode] [or] [0] +\installspecial [\doregisternonecolor] [or] [0] + %D For some drivers, the stop special is of no use and can %D simply call the start one with zero arguments. @@ -689,7 +692,7 @@ % \installspecial [\dogetobjectreference] [or] [3] % % %D The first argument is the name, the second a macro that -% %D gets the assiciated value. +% %D gets the associated value. %D \macros %D {dostartrunprogram, dostoprunprogram, @@ -897,6 +900,15 @@ \installspecial [\doattachfile] [or] [6] +%D Experimental (properties): + +\installspecial[\dostartviewerlayer] [or] [1] +\installspecial[\dostopviewerlayer] [or] [0] +\installspecial[\dodefineviewerlayer] [or] [5] +%installspecial[\doflushviewertextlayers] [or] [0] +%installspecial[\doflushviewerpagelayers] [or] [0] +\installspecial[\domakeviewerlayerlist] [or] [1] + %D We define a couple of backends: \defineoutput [dvipsone] [dvi,ps,yy] diff --git a/tex/context/base/spec-dpm.tex b/tex/context/base/spec-dpm.tex index 92b0f682b..2ddbe4f94 100644 --- a/tex/context/base/spec-dpm.tex +++ b/tex/context/base/spec-dpm.tex @@ -300,34 +300,37 @@ \newif\ifsharePDFactions \sharePDFactionsfalse -\def\doPDFaction width #1 height #2 action #3% +\def\dodoPDFaction#1#2#3#4% {\ifcollectreferenceactions - \xdef\lastPDFaction{#3}% + \xdef\lastPDFaction{#4}% \else \bgroup % this is yet untested %\ifsharePDFactions % \ifcase\similarreference\relax - % \xdef\lastPDFaction{<<#3>>}% + % \xdef\lastPDFaction{<<#4>>}% % \or % \global\advance\nofPDFsimilar by 1 - % \special{pdf: object @PDF::sim:\the\nofPDFsimilar\space<<#3>>}% + % \special{pdf: object @PDF::sim:\the\nofPDFsimilar\space<<#4>>}% % \xdef\lastPDFaction{@PDF::sim:\the\nofPDFsimilar}% % \else % % leave \lastPDFaction untouched % \fi %\else - \xdef\lastPDFaction{<<#3>>}% + \xdef\lastPDFaction{<<#4>>}% %\fi - \scratchdimen#1\edef\width {\the\scratchdimen\space}% - \scratchdimen#2\edef\height{\the\scratchdimen\space}% - \special{pdf: ann width \width height \height + \scratchdimen#2\edef\width {\the\scratchdimen\space}% + \scratchdimen#3\edef\height{\the\scratchdimen\space}% + \special{pdf: ann #1 width \width height \height <</Subtype /Link /Border [0 0 0] \ifhighlighthyperlinks \else /H /N \fi /A \lastPDFaction\space>>}% \egroup \fi} +\def\doPDFaction width #1 height #2 action #3% + {\dodoPDFaction\empty{#1}{#2}{#3}} + \def\doPDFannotation width #1 height #2 data #3% {\bgroup \scratchdimen#1\edef\width {\the\scratchdimen\space}% @@ -337,7 +340,7 @@ \egroup} %D \macros -%D {doPDFannotationobject} +%D {doPDFannotationobject,doPDFactionobject} \def\doPDFannotationobject class #1 name #2 width #3 height #4 data #5% {\bgroup @@ -347,6 +350,10 @@ \dosetobjectreference{#1}{#2}{@#1::#2}% \egroup} +\def\doPDFactionobject class #1 name #2 width #3 height #4 action #5% + {\dodoPDFaction{@#1::#2}{#3}{#4}{#5}% + \dosetobjectreference{#1}{#2}{#1::#2}} + %D \macros %D {doPDFaddtocatalog,doPDFaddtoinfo, %D doPDFpageattribute,doPDFpagesattribute} @@ -397,6 +404,12 @@ {\dogetobjectreference{#1}{#2}#3% \ifx#3\empty\else\edef#3{{#3}}\fi} +% \def\doPDFgetobjectpage #1#2#3{..} +% \def\doPDFgetobjectpagereference#1#2#3{..} + +\def\doPDFgetpagereference#1#2% + {\edef#2{@page#1}} + %D Done. \stopspecials diff --git a/tex/context/base/spec-dpx.tex b/tex/context/base/spec-dpx.tex index affcd5411..bce7d6cb1 100644 --- a/tex/context/base/spec-dpx.tex +++ b/tex/context/base/spec-dpx.tex @@ -1,4 +1,3 @@ -%\unprotect %D \module %D [ file=spec-dpx, %D version=2002.11.28, @@ -214,7 +213,7 @@ %D {dosetupinteraction, %D dosetupopenaction,dosetupcloseaction} -\definespecial\dosetupinteraction% +\definespecial\dosetupinteraction {\showmessage{\m!interactions}{21}{DVIPDFMx}} \definespecial\dosetupopenaction {\doPDFsetupopenaction} @@ -310,7 +309,7 @@ \definespecial\dostartobject#1#2#3#4#5% {\bgroup - \setbox\nextbox=\hbox\bgroup + \setbox\nextbox\hbox\bgroup \dosetobjectreference{#1}{#2}{#1::#2}% \scratchdimen#3\edef\width {\the\scratchdimen\space}% \scratchdimen#4\edef\height{\the\scratchdimen\space}% @@ -319,7 +318,7 @@ %D Modified to support the color shading feature since version %D \type{dvipdfmx-20021128}. -\definespecial\dostopobject% +\definespecial\dostopobject {\ifx\currentPDFresources\empty \special{pdf: exobj}% \else @@ -392,34 +391,37 @@ \newif\ifsharePDFactions \sharePDFactionsfalse -\def\doPDFaction width #1 height #2 action #3% +\def\dodoPDFaction#1#2#3#4% {\ifcollectreferenceactions - \xdef\lastPDFaction{#3}% + \xdef\lastPDFaction{#4}% \else \bgroup % this is yet untested %\ifsharePDFactions % \ifcase\similarreference\relax - % \xdef\lastPDFaction{<<#3>>}% + % \xdef\lastPDFaction{<<#4>>}% % \or % \global\advance\nofPDFsimilar by 1 - % \special{pdf: object @PDF::sim:\the\nofPDFsimilar\space<<#3>>}% + % \special{pdf: object @PDF::sim:\the\nofPDFsimilar\space<<#4>>}% % \xdef\lastPDFaction{@PDF::sim:\the\nofPDFsimilar}% % \else % % leave \lastPDFaction untouched % \fi %\else - \xdef\lastPDFaction{<<#3>>}% + \xdef\lastPDFaction{<<#4>>}% %\fi - \scratchdimen#1\edef\width {\the\scratchdimen\space}% - \scratchdimen#2\edef\height{\the\scratchdimen\space}% - \special{pdf: ann width \width height \height + \scratchdimen#2\edef\width {\the\scratchdimen\space}% + \scratchdimen#3\edef\height{\the\scratchdimen\space}% + \special{pdf: ann #1 width \width height \height <</Subtype /Link /Border [0 0 0] \ifhighlighthyperlinks \else /H /N \fi /A \lastPDFaction\space>>}% \egroup \fi} +\def\doPDFaction width #1 height #2 action #3% + {\dodoPDFaction\empty{#1}{#2}{#3}} + %D \type{\doPDFannotation} in \type{spec-dpm} had a bug. \def\doPDFannotation width #1 height #2 data #3% @@ -430,7 +432,7 @@ \egroup} %D \macros -%D {doPDFannotationobject} +%D {doPDFannotationobject,doPDFactionobject} \def\doPDFannotationobject class #1 name #2 width #3 height #4 data #5% {\bgroup @@ -440,6 +442,10 @@ \dosetobjectreference{#1}{#2}{#1::#2}% \egroup} +\def\doPDFactionobject class #1 name #2 width #3 height #4 action #5% + {\dodoPDFaction{@#1::#2}{#3}{#4}{#5}% + \dosetobjectreference{#1}{#2}{#1::#2}} + %D \macros %D {doPDFaddtocatalog,doPDFaddtoinfo, %D doPDFpageattribute,doPDFpagesattribute} @@ -488,12 +494,18 @@ \def\defaultobjectreference#1#2{#1::#2} -%D \type{\doPDFgetobjectrefernce} in \type{spec-dpm} had a bug. +%D \type{\doPDFgetobjectreference} in \type{spec-dpm} had a bug. \def\doPDFgetobjectreference#1#2#3% {\dogetobjectreference{@#1}{#2}#3% \ifx#3\empty\else\edef#3{#3}\fi} +% \def\doPDFgetobjectpage #1#2#3{..} +% \def\doPDFgetobjectpagereference#1#2#3{..} + +\def\doPDFgetpagereference#1#2% + {\edef#2{@page#1}} + %D Done. % %D 2. Modified codes from \type{spec-fdf} diff --git a/tex/context/base/spec-fdf.tex b/tex/context/base/spec-fdf.tex index bd82f28bb..e530f3d1b 100644 --- a/tex/context/base/spec-fdf.tex +++ b/tex/context/base/spec-fdf.tex @@ -11,6 +11,10 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +%D For the moment we keep this downward compatible hack: + +%% see end of file + %D We need to check if we can use \type {\driverreferenced} %D object in more places. @@ -225,8 +229,9 @@ %D \doPDFpagesattribute #1 %D \doPDFbookmark level #1 n #2 text #3 page #4 open #5 %D -%D \defaultobjectreference #1#2 % class name -%D \doPDFgetobjectreference #1#2#3 % class name \PDFobjectreference +%D \defaultobjectreference #1#2 % class name +%D \doPDFgetobjectreference #1#2#3 % class name \PDFobjectreference +%D \doPDFgetobjectpagereference #1#2#3 % class name \PDFobjectreference %D \stoptypen %D %D The keywords reflect their use. For the moment we stick to @@ -235,6 +240,26 @@ \startspecials[fdf] +%D Common: + +% \def\doPDFgetobjectreference#1#2#3% +% {\def#3{..}} + +\def\doPDFgetobjectpage#1#2#3% + {\dogetobjectreferencepage{#1}{#2}#3% + \ifx#3\empty\def#3{1}\fi} + +\def\doPDFgetobjectpagereference#1#2#3% + {\dogetobjectreferencepage{#1}{#2}#3% + \ifx#3\empty + \doPDFgetpagereference\realfolio#3% + \else + \doPDFgetpagereference#3#3% we assume that #3 gets expanded + \fi} + +% \def\doPDFgetpagereference#1#2%%%%%%%%%%%%%%% +% {\def#2{...}} + %D Due to the fact that \PDFTEX\ has a different concept of %D page attributes, we need: @@ -614,7 +639,7 @@ \def\doPDFstartgotoJS#1#2#3% {\bgroup \doPSsanitizeJScode#3\to\sanitizedJScode - \edef\action% + \edef\action {/S /JavaScript /JS (\sanitizedJScode)}% \ifsecondaryreference \savesecondaryPDFreference\action @@ -701,6 +726,9 @@ \def\PDFexecutefitwidth {/Named /N /FitWidth} \def\PDFexecutefitheight {/Named /N /FitHeight} +\let\PDFobjectclass\empty +\let\PDFobjectname \empty + \def\doPDFstartexecutecommand#1#2#3#4% {\doifdefined{PDFexecute#3} {\bgroup @@ -713,7 +741,16 @@ \savesecondaryPDFreference\action \else \getsecondaryPDFreferences - \doPDFaction +% \ifx\PDFobjectclass\empty +% \let\next\doPDFaction +% \else +% \edef\next{\doPDFactionobject +% class {\PDFobjectclass} name {\PDFobjectname} }% +% \globalletempty\PDFobjectclass +% \globalletempty\PDFobjectname +% \fi +% \next +\doPDFaction width #1 height #2 action {\action \secondaryPDFreferences}% \fi @@ -877,8 +914,10 @@ \def\doPDFattachfile#1#2#3#4#5#6% {\bgroup % title width height color symbol file - \presetPDFsymbolappearance{#4}{#5}% sets width/height \edef\PDFfile{#6}\convertcommand\PDFfile\to\PDFfile + % beware: the symbol may (indirectly) use the file + % reference when typesetting the object number; + \presetPDFsymbolappearance{#4}{#5}% sets width/height \setbox\scratchbox\vbox to #3 {\vfill \doifnotflagged{a:\PDFfile}% @@ -901,7 +940,27 @@ \definespecial \doattachfile {\doPDFattachfile} -% todo +% requested by Jens-Uwe Morawski: permits usage of pdftosrc +% in viewers that don't support attachments: +% +% \definesymbol +% [ObjectNumber] +% % [object number {\PDFattachmentnumber[xx]}] % named +% [object number \PDFattachmentnumber] % current +% +% \useattachment[test][xx][test.tex] +% \setupattachments[symbol=ObjectNumber] +% \attachment[test] + +\def\PDFattachmentnumber + {\dosingleargument\doPDFattachmentnumber} + +\def\doPDFattachmentnumber[#1]% + {\iffirstargument + \doPDFfilestreamidentifier{#1}% + \else + \doPDFfilestreamidentifier\PDFfile + \fi} %D \macros %D {doPDFinsertbookmark} @@ -1822,7 +1881,7 @@ %D In the goto specials we took care of secondary references. %D Here we define the macros used. -\def\doPDFresetgotowhereever% +\def\doPDFresetgotowhereever {\global\let\secondaryPDFreferences\empty} \doPDFresetgotowhereever % just to be sure @@ -2319,6 +2378,9 @@ \def\doPDFstartspotcolormode#1#2% {\PDFcode{/#1 CS #2 SC /#1 cs #2 sc}} +\def\doPDFstartnonecolormode + {\PDFcode{/None CS 1 SC /None cs 1 sc}} + \def\doPDFstopcolormode {\PDFcode{0 g\ifPDFstrokecolor\space0 G\fi}} @@ -2332,6 +2394,10 @@ \def\doPDFregistersomespotcolor#1#2#3#4% {\writestatus\m!systems{missing spot color definition}\wait} +\def\doPDFregisternonecolor % internal command + {\doPDFregistergrayspotcolor{None}{1}% + \globallet\doPDFregisternonecolor\relax} + \def\doPDFregisterrgbspotcolor#1#2#3#4% {\doPDFregistersomespotcolor {#1}{RGB}{[0.0 1.0 0.0 1.0 0.0 1.0]}% @@ -2363,7 +2429,7 @@ 270=>\PDFcode{ 0 -1 1 0 0 0 cm}, 360=>\PDFcode{ 1 0 0 1 0 0 cm}]} -\def\doPDFstoprotation% +\def\doPDFstoprotation {\PDFcode{Q}} %D \macros @@ -2435,7 +2501,20 @@ \expandafter\gobbletwoarguments \fi} -\let\doPDFstoptransparency\relax +% \let\doPDFstoptransparency\relax +% +% This is tricky: because a text stream is handled before +% the page body is built, we can run into stops that will +% match an outer start; however, the stop is needed in case +% of a text color: [text color text] [other color text] on a +% first page combined with color splitting will go wrong if +% we stick to the relaxing method. + +\def\doPDFstoptransparency + {\ifPDFtransparencysupported + \initializetransparency + \dodoPDFstoptransparency + \fi} %D These use: @@ -2453,8 +2532,120 @@ \definespecial\dostartgraphicgroup{\PDFcode{q}} \definespecial\dostopgraphicgroup {\PDFcode{Q}} +%D Even newer trickery: + +\definespecial\dostartviewerlayer {\doPDFstartlayer} +\definespecial\dostopviewerlayer {\doPDFstoplayer} +\definespecial\dodefineviewerlayer{\doPDFdefinelayer} + +\let\PDFtextlayers\empty +\let\PDFpagelayers\empty +\let\PDFhidelayers\empty +\let\PDFvidelayers\empty + +\def\doPDFstartlayer#1{\PDFcode{/OC /#1 BDC}} +\def\doPDFstoplayer {\PDFcode {EMC}} + +% resource -> prop -> mc's -> OCG|OCMD (nested) + +% ocg: + +% /Intent/Design + +% ocmd + +% /P /AllOn + +% kan zelf ocmd bevatten + +\def\doPDFdefinelayer#1#2#3#4#5% tag title visible type printable +% {\driverreferenced \doPDFdictionaryobject class PDLN name #1 data + {\doPDFdictionaryobject class PDLN name #1 data + {/Type /OCG + \ifcase#4 \or + /Intent /Design % disable layer hiding by user + \fi + \ifcase#5 \or + /Usage << /Print << /PrintState /OFF >> >> % printable or not + \fi + /Name (#2)}% + \doPDFgetobjectreference{PDLN}{#1}\PDFobjectreference + \xdef\PDFtextlayers{\PDFtextlayers\space\PDFobjectreference}% + \ifcase#3\relax + \xdef\PDFhidelayers{\PDFhidelayers\space\PDFobjectreference}% + \or + \xdef\PDFvidelayers{\PDFvidelayers\space\PDFobjectreference}% + \fi + %\driverreferenced \doPDFdictionaryobject class PDLD name #1 data + \doPDFdictionaryobject class PDLD name #1 data + {/Type /OCMD + /OCGs [\PDFobjectreference]}% + \doPDFgetobjectreference{PDLD}{#1}\PDFobjectreference + \xdef\PDFpagelayers{\PDFpagelayers\space /#1 \PDFobjectreference}} + +\def\flushPDFtextlayers + {\ifx\PDFtextlayers\empty \else + \driverreferenced \doPDFarrayobject class PDF name textlayers data {\PDFtextlayers}% + \doPDFgetobjectreference{PDF}{textlayers}\!!stringa + \ifx\PDFhidelayers\empty + \def\!!stringb{[null]}% + \else + \driverreferenced \doPDFarrayobject class PDF name hidelayers data {\PDFhidelayers}% + \doPDFgetobjectreference{PDF}{hidelayers}\!!stringb + \fi + \ifx\PDFvidelayers\empty + \def\!!stringc{[null]}% + \else + \driverreferenced \doPDFarrayobject class PDF name videlayers data {\PDFvidelayers}% + \doPDFgetobjectreference{PDF}{videlayers}\!!stringc + \fi + \doPDFaddtocatalog + {/OCProperties + << % display in menu + /D << /Order \!!stringa + /On \!!stringb + /Off \!!stringc >> + % used properties + /OCGs \!!stringa >>}% + \globallet\flushPDFtextlayers\relax + \fi} + +\def\flushPDFpagelayers + {\ifx\PDFpagelayers\empty \else + \doPDFpageresource{/Properties <<\PDFpagelayers>>}% + \fi} + +\prependtoksonce \flushPDFpagelayers \to \everyshipout +\prependtoksonce \flushPDFtextlayers \to \everylastshipout + +\def\PDFlayeractionlist{null} % \PDFlayeractionlist{5 0 R} + +\def\PDFexecutehidelayer {/SetOCGState /State [/OFF \PDFlayeractionlist]} +\def\PDFexecutevidelayer {/SetOCGState /State [/ON \PDFlayeractionlist]} +\def\PDFexecutetogglelayer {/SetOCGState /State [/Toggle \PDFlayeractionlist]} + +\def\domakeviewerlayerlist#1% + {\bgroup + \globallet\PDFlayeractionlist\empty + \def\docommando##1% + {\doPDFgetobjectreference{PDLN}{##1}\PDFobjectreference + \xdef\PDFlayeractionlist{\PDFlayeractionlist\space\PDFobjectreference}}% + \processcommalist[#1]\docommando + \egroup} + %D And that was all. \stopspecials +\ifx\fullytransparentcolor\undefined \else + + \def\fullytransparentcolor + {\doPDFregisternonecolor + \doPDFstartnonecolormode} + + \let\doPDFstarttransparency\gobbletwoarguments + \let\doPDFstoptransparency\relax + +\fi + \protect \endinput diff --git a/tex/context/base/spec-pdf.tex b/tex/context/base/spec-pdf.tex index b59f5d25d..50733a835 100644 --- a/tex/context/base/spec-pdf.tex +++ b/tex/context/base/spec-pdf.tex @@ -320,33 +320,34 @@ \newif\ifsharePDFactions \sharePDFactionstrue -\def\doPDFaction width #1 height #2 action #3% +\def\dodoPDFaction#1#2#3#4% {\ifcollectreferenceactions - \xdef\lastPDFaction{#3}% + \xdef\lastPDFaction{#4}% \else \bgroup % does not work well with distiller 4 %\ifsharePDFactions % \ifcase\similarreference\relax - % \xdef\lastPDFaction{<<#3>>}% + % \xdef\lastPDFaction{<<#4>>}% % \or % \global\advance\nofPDFsimilar by 1 % \special % {\@@insertpostscriptretain % [ /_objdef {PDF::sim:\the\nofPDFsimilar} /type /dict /OBJ pdfmark - % [ {PDF::sim:\the\nofPDFsimilar} <<#3>>\space /PUT pdfmark}% + % [ {PDF::sim:\the\nofPDFsimilar} <<#4>>\space /PUT pdfmark}% % \xdef\lastPDFaction{{PDF::sim:\the\nofPDFsimilar}}% % \else % % leave \lastPDFaction untouched % \fi %\else - \xdef\lastPDFaction{<<#3>>}% + \xdef\lastPDFaction{<<#4>>}% %\fi - \PointsToBigPoints{#1}\width - \PointsToBigPoints{#2}\height + \PointsToBigPoints{#2}\width + \PointsToBigPoints{#1}\height \special {\@@insertpostscriptretain - [ /Action \lastPDFaction\space + [ #1 + /Action \lastPDFaction\space /Rect [0 0 \width\space \height] /Border [0 0 0] \ifhighlighthyperlinks \else /H /N \fi @@ -356,6 +357,9 @@ \egroup \fi} +\def\doPDFaction width #1 height #2 action #3% + {\dodoPDFaction\empty{#1}{#2}{#3}} + \def\doPDFannotation width #1 height #2 data #3% {\bgroup \PointsToBigPoints{#1}\width @@ -380,6 +384,10 @@ \egroup \dosetobjectreference{#1}{#2}{#1::#2}} +\def\doPDFactionobject class #1 name #2 width #3 height #4 action #5% + {\dodoPDFaction{/_objdef {#1::#2}}{#3}{#4}{#5}% + \dosetobjectreference{#1}{#2}{#1::#2}} + %D \macros %D {doPDFdictionaryobject,doPDFarrayobject} %D @@ -462,6 +470,12 @@ \ifx#3\empty\else\edef#3{{#3}}\fi} %\edef#3{\ifx#3\empty null\else{#3}\fi}} +% \def\doPDFgetobjectpage #1#2#3{..} +% \def\doPDFgetobjectpagereference#1#2#3{..} + +\def\doPDFgetpagereference#1#2% + {\edef#2{{page#1}}} + %D Done. \stopspecials diff --git a/tex/context/base/spec-tpd.tex b/tex/context/base/spec-tpd.tex index 6ff4f802e..235ba81b1 100644 --- a/tex/context/base/spec-tpd.tex +++ b/tex/context/base/spec-tpd.tex @@ -462,6 +462,9 @@ \definespecial\doregisterrgbspotcolor {\doPDFregisterrgbspotcolor} \definespecial\doregistergrayspotcolor{\doPDFregistergrayspotcolor} +\definespecial\dostartnonecolormode{\doPDFstartnonecolormode} +\definespecial\doregisternonecolor {\doPDFregisternonecolor} + \def\doPDFregistersomespotcolor#1#2#3#4% {\immediate \pdfobj stream attr {/FunctionType 4 /Domain [0.0 1.0] /Range #3}{#4}% @@ -1022,7 +1025,7 @@ \fi %D \macros -%D {doPDFannotationobject} +%D {doPDFannotationobject,doPDFactionobject} %D %D For field support we need annotation objects. Although in %D many cases we can do without indirect references (and use @@ -1033,6 +1036,10 @@ {\doPDFannotation width #3 height #4 data {#5}% \dosetobjectreference{#1}{#2}{\the\pdflastannot}} +\def\doPDFactionobject class #1 name #2 width #3 height #4 action #5% + {\doPDFaction width {#3} height {#4} action {#5}% + \dosetobjectreference{#1}{#2}{\the\pdflastannot}} + %D \macros %D {doPDFaddtocatalog,doPDFaddtoinfo, %D doPDFpageattribute,doPDFpagesattribute} @@ -1109,6 +1116,15 @@ {\dogetobjectreference{#1}{#2}#3% \edef#3{\ifx#3\empty null\else#3\space0 R\fi}} +% \def\doPDFgetobjectpage #1#2#3{..} +% \def\doPDFgetobjectpagereference#1#2#3{..} + +\def\doPDFgetpagereference % number macro + {\installprogram{texutil --filter \jobname}% + \gdef\doPDFgetpagereference##1% ##2 + {\doPDFgetobjectreference{PDFP}{\number##1}}% {##2} + \doPDFgetpagereference} + %D \macros %D {initializePDFnegative} %D @@ -1123,12 +1139,25 @@ \appendtoPDFdocumentextgstates{/GSpositive \the\pdflastobj\space0 R}% \global\let\initializePDFnegative\relax} -%D File embedding: +%D File embedding. Storing the stream identifier is needed +%D to get access to the number. When typeset, the user can +%D use feed this number to \type {pdftosrc} and filter the +%D file from the \PDF\ file. + +\let\PDFlaststreamobject\s!unknown \def\doPDFfilestreamobject class #1 name #2 file #3% {\immediate\pdfobj stream file{#3}% + \edef\PDFlaststreamobject{\the\pdflastobj}% + \dosetobjectreference{PDFFS}{#2}{\PDFlaststreamobject}% \doPDFdictionaryobject class {#1} name {#2} data - {/Type /Filespec /F (#3) /EF <</F \the\pdflastobj\space0 R>>}} + {/Type /Filespec /F (#3) /EF <</F \PDFlaststreamobject\space0 R>>}} + +\def\doPDFfilestreamidentifier#1% + {\doifsomething{#1} + {\doPDFgetobjectreference{PDFFS}{#1}\PDFobjectreference + \@EA\beforesplitstring\PDFobjectreference\at{ }\to\PDFlaststreamobject + \PDFlaststreamobject}} % %D We can set \METAPOST\ prologues to~2: diff --git a/tex/context/base/supp-box.tex b/tex/context/base/supp-box.tex index 66deb63a3..ce000ed40 100644 --- a/tex/context/base/supp-box.tex +++ b/tex/context/base/supp-box.tex @@ -245,7 +245,7 @@ %D We also take care of non||braced arguments. \def\ph@nt#1#2#3% - {\def\doph@nt% + {\def\doph@nt {\ifmmode \def\mathph@nt####1####2{\makeph@nt#1#2#3{$\m@th####1{####2}$}}% \def\nextph@nt{\mathpalette\mathph@nt}% diff --git a/tex/context/base/supp-lan.tex b/tex/context/base/supp-lan.tex index 5f2c4cbcd..a15b137ad 100644 --- a/tex/context/base/supp-lan.tex +++ b/tex/context/base/supp-lan.tex @@ -328,7 +328,7 @@ \def\dohandlemathmodebar#1% {\getvalue{\strippedcsname\mathmodediscretionary\string#1}} -\def\discretionarycommand% +\def\discretionarycommand {\relax\ifmmode \expandafter\dohandlemathmodebar \else @@ -443,7 +443,7 @@ {\getvalue{\strippedcsname\textmodediscretionary\string#1}}% \futurelet\next\dodotextmodediscretionary} -\def\dododotextmodediscretionary% +\def\dododotextmodediscretionary {\let\nextnextnext=\egroup \ifx\discretionarycommand\next \checkafterdiscretionary diff --git a/tex/context/base/supp-mps.tex b/tex/context/base/supp-mps.tex index 5ce98814a..5ce56b99f 100644 --- a/tex/context/base/supp-mps.tex +++ b/tex/context/base/supp-mps.tex @@ -203,10 +203,18 @@ \newtoks \MPinitializations +% buggy +% +% \long\def\startMPinclusions#1\stopMPinclusions +% {\long\def\theMPinclusions +% {% \expanded ! +% \@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPinitializations;}}% +% \writeMPgraphic{#1}}} + \long\def\startMPinclusions#1\stopMPinclusions {\long\def\theMPinclusions {% \expanded ! - \@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPinitializations;}}% +% \@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPinitializations;}}% \writeMPgraphic{#1}}} \long\def\MPinclusions#1% @@ -459,6 +467,34 @@ \fi \endTEX +% buggy (at least in collected graphics, lazy expansion) +% +% \def\startwritingMPgraphic +% {\blabelgroup +% \global\advance\nofMPgraphics 1 +% \ifMPrun \else +% \allocateMPslot\currentMPgraphic +% \fi +% \enableincludeMPgraphics +% \xdef\MPgraphic{\the\currentMPgraphic}% +% \the\everyMPgraphic +% \ifrunMPgraphics +% \openMPgraphicfile1{runtime}% +% % no reset here ! +% \theMPinclusions +% \else +% \openMPgraphicfile0{collected}% +% % reset here ! global added (due to adding \blabelgroup) +% \theMPinclusions +% \global\let\theMPinclusions\relax +% \fi +% \flushMPTEXgraphic +% \ifMPrun \else +% \immediate\write\MPwrite{let mprunend = end ;}% +% \immediate\write\MPwrite{beginfig(\the\currentMPgraphic);}% +% \fi +% \globallet\flushMPgraphics\closeMPgraphicfiles % \dodostopwritingMPgraphic +% \globallet\stopwritingMPgraphic=\dostopwritingMPgraphic} \def\startwritingMPgraphic {\blabelgroup @@ -473,6 +509,7 @@ \openMPgraphicfile1{runtime}% % no reset here ! \theMPinclusions +\@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPinitializations;}}% \else \openMPgraphicfile0{collected}% % reset here ! global added (due to adding \blabelgroup) @@ -483,6 +520,7 @@ \ifMPrun \else \immediate\write\MPwrite{let mprunend = end ;}% \immediate\write\MPwrite{beginfig(\the\currentMPgraphic);}% +\@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPinitializations;}}% \fi \globallet\flushMPgraphics\closeMPgraphicfiles % \dodostopwritingMPgraphic \globallet\stopwritingMPgraphic=\dostopwritingMPgraphic} @@ -497,7 +535,9 @@ % \@EA\newwrite\csname\@@MPG\@@MPG\MPgraphicfile\endcsname}% % {\ifcase#1\donefalse\else\donetrue\fi}% \@EA\ifx\csname\@@MPG\@@MPG\MPgraphicfile\endcsname\relax - \donetrue \@EA\newwrite\csname\@@MPG\@@MPG\MPgraphicfile\endcsname + %\donetrue \@EA\newwrite\csname\@@MPG\@@MPG\MPgraphicfile\endcsname + % for the sake of plain usage + \donetrue \@EA\@EA\csname newwrite\endcsname\csname\@@MPG\@@MPG\MPgraphicfile\endcsname \doglobal\addtocommalist\MPgraphicfile\MPgraphicfiles \else \ifcase#1\relax\donefalse\else\donetrue\fi diff --git a/tex/context/base/supp-num.tex b/tex/context/base/supp-num.tex index afd733ed8..4132341b3 100644 --- a/tex/context/base/supp-num.tex +++ b/tex/context/base/supp-num.tex @@ -278,13 +278,27 @@ {\ifcase\autodigitmode \doscandigit#1% \else - \setbox\digitsepbox\hbox{\doscandigit#1} + \setbox\digitsepbox\hbox{\doscandigit#1}% \fi - \chardef\skipdigit0} + \chardef\skipdigit0\relax} + +% strange, does not work +% +% \def\digitnop +% {\hphantom{\box\digitsepbox}% +% \hphantom{0}\chardef\skipdigit1\relax} +% +% while this works \def\digitnop - {\hphantom{\box\digitsepbox}% - \hphantom{0}\chardef\skipdigit1} + {\hbox{\hphantom{\box\digitsepbox}}% + \hphantom{0}\chardef\skipdigit1\relax} + +% but this doesn't +% +% \def\digitnop +% {\hphantom{\box\digitsepbox0}% +% \chardef\skipdigit1\relax} \def\digitsgn#1% {\ifcase\digitsignmode#1\else diff --git a/tex/context/base/symb-nav.tex b/tex/context/base/symb-nav.tex index 71c6a8068..20cb2d5d6 100644 --- a/tex/context/base/symb-nav.tex +++ b/tex/context/base/symb-nav.tex @@ -27,10 +27,11 @@ \definesymbol [\v!volgendepagina] [\ContextNavigationGlyph{2}] \definesymbol [\v!eerstepagina] [\ContextNavigationGlyph{3}] \definesymbol [\v!laatstepagina] [\ContextNavigationGlyph{4}] + \definesymbol [\v!PreviousJump] [\ContextNavigationGlyph{5}] \definesymbol [\v!NextJump] [\ContextNavigationGlyph{6}] + \definesymbol [\v!CloseDocument] [\ContextNavigationGlyph{7}] - \definesymbol [\v!PauseMovie] [\ContextNavigationGlyph{8}] \definesymbol [\v!vorigesubpagina] [\ContextNavigationGlyph{1}] \definesymbol [\v!volgendesubpagina] [\ContextNavigationGlyph{2}] @@ -41,6 +42,13 @@ \definesymbol [\v!PauseSound] [\ContextNavigationGlyph{8}] \definesymbol [\v!StopSound] [\ContextNavigationGlyph{7}] + \definesymbol [\v!StartMovie] [\ContextNavigationGlyph{2}] + \definesymbol [\v!PauseMovie] [\ContextNavigationGlyph{8}] + \definesymbol [\v!StopMovie] [\ContextNavigationGlyph{7}] + + \definesymbol [\v!StartRendering] [\ContextNavigationGlyph{2}] + \definesymbol [\v!PauseRendering] [\ContextNavigationGlyph{8}] + \definesymbol [\v!StopRendering] [\ContextNavigationGlyph{7}] \stopsymbolset @@ -50,10 +58,11 @@ \definesymbol [\v!volgendepagina] [\ContextNavigationGlyph{102}] \definesymbol [\v!eerstepagina] [\ContextNavigationGlyph{103}] \definesymbol [\v!laatstepagina] [\ContextNavigationGlyph{104}] + \definesymbol [\v!PreviousJump] [\ContextNavigationGlyph{105}] \definesymbol [\v!NextJump] [\ContextNavigationGlyph{106}] + \definesymbol [\v!CloseDocument] [\ContextNavigationGlyph{107}] - \definesymbol [\v!PauseMovie] [\ContextNavigationGlyph{108}] \definesymbol [\v!vorigesubpagina] [\ContextNavigationGlyph{101}] \definesymbol [\v!volgendesubpagina] [\ContextNavigationGlyph{102}] @@ -63,7 +72,14 @@ \definesymbol [\v!StartSound] [\ContextNavigationGlyph{102}] \definesymbol [\v!PauseSound] [\ContextNavigationGlyph{108}] \definesymbol [\v!StopSound] [\ContextNavigationGlyph{107}] - + + \definesymbol [\v!StartMovie] [\ContextNavigationGlyph{102}] + \definesymbol [\v!PauseMovie] [\ContextNavigationGlyph{108}] + \definesymbol [\v!StopMovie] [\ContextNavigationGlyph{107}] + + \definesymbol [\v!StartRendering] [\ContextNavigationGlyph{102}] + \definesymbol [\v!PauseRendering] [\ContextNavigationGlyph{108}] + \definesymbol [\v!StopRendering] [\ContextNavigationGlyph{107}] \stopsymbolset \startsymbolset [navigation 3] @@ -72,10 +88,11 @@ \definesymbol [\v!volgendepagina] [\ContextNavigationGlyph{202}] \definesymbol [\v!eerstepagina] [\ContextNavigationGlyph{203}] \definesymbol [\v!laatstepagina] [\ContextNavigationGlyph{204}] + \definesymbol [\v!PreviousJump] [\ContextNavigationGlyph{205}] \definesymbol [\v!NextJump] [\ContextNavigationGlyph{206}] + \definesymbol [\v!CloseDocument] [\ContextNavigationGlyph{207}] - \definesymbol [\v!PauseMovie] [\ContextNavigationGlyph{208}] \definesymbol [\v!vorigesubpagina] [\ContextNavigationGlyph{201}] \definesymbol [\v!volgendesubpagina] [\ContextNavigationGlyph{202}] @@ -86,6 +103,14 @@ \definesymbol [\v!PauseSound] [\ContextNavigationGlyph{208}] \definesymbol [\v!StopSound] [\ContextNavigationGlyph{207}] + \definesymbol [\v!StartMovie] [\ContextNavigationGlyph{202}] + \definesymbol [\v!PauseMovie] [\ContextNavigationGlyph{208}] + \definesymbol [\v!StopMovie] [\ContextNavigationGlyph{207}] + + \definesymbol [\v!StartRendering] [\ContextNavigationGlyph{202}] + \definesymbol [\v!PauseRendering] [\ContextNavigationGlyph{208}] + \definesymbol [\v!StopRendering] [\ContextNavigationGlyph{207}] + \stopsymbolset %D \showsymbolset[navigation 1] diff --git a/tex/context/base/syst-ext.tex b/tex/context/base/syst-ext.tex index 0bb8eb49d..1e34137e2 100644 --- a/tex/context/base/syst-ext.tex +++ b/tex/context/base/syst-ext.tex @@ -4091,64 +4091,66 @@ {\@EA\sortcommalist\@EA[#1]} \def\sortcommalist[#1]#2% - {\getcommalistsize[#1]% - \let\sortedcommalist\empty - \ifnum\commalistsize>1 - \let\comparecommand#2% - \processcommalist[#1]\dosortcommacommand - \fi} + {\getcommalistsize[#1]% + \ifnum\commalistsize>1 + \let\sortedcommalist\empty + \let\comparecommand#2% + \processcommalist[#1]\dosortcommacommand + \else + \def\sortedcommalist{#1}% + \fi} \def\dosortcommacommand#1% - {\ifx\sortedcommalist\empty - \def\sortedcommalist{#1}% - \else - \def\!!tempa{#1}% - \ifx\!!tempa\empty\else - \scratchcounter\plusone - \@EA\getcommalistsize\@EA[\sortedcommalist]% - \@EA\processcommalist\@EA[\sortedcommalist]\docompareitems - \fi - \fi} + {\ifx\sortedcommalist\empty + \def\sortedcommalist{#1}% + \else + \def\!!tempa{#1}% + \ifx\!!tempa\empty\else + \scratchcounter\plusone + \@EA\getcommalistsize\@EA[\sortedcommalist]% + \@EA\processcommalist\@EA[\sortedcommalist]\docompareitems + \fi + \fi} %D All those \type{\expandafter}'s are there because I do not %D want to use \type{\edef}. \def\docompareitems#1% - {\doifnotempty{#1} - {\@EA\comparecommand\@EA{\!!tempa}{#1}\relax - %\ifcase\compareresult % equal - \ifnum\comparedresult<2 - \ifnum\scratchcounter=\commalistsize - \@EA\@EA\@EA\def\@EA\@EA\@EA\sortedcommalist - \@EA\@EA\@EA{\@EA\sortedcommalist\@EA,\!!tempa}% - \fi - %\or % new element larger - % \ifnum\scratchcounter=\commalistsize - % \@EA\@EA\@EA\def\@EA\@EA\@EA\sortedcommalist - % \@EA\@EA\@EA{\@EA\sortedcommalist\@EA,\!!tempa}% - % \fi - \else % old element larger - \@EA\def\@EA\newcommalistelement\@EA{\!!tempa,#1}% - \replaceincommalist\sortedcommalist\scratchcounter - \expandafter\quitcommalist - \fi}% - \advance\scratchcounter \minusone} + {\doifnotempty{#1} + {\@EA\comparecommand\@EA{\!!tempa}{#1}\relax + %\ifcase\compareresult % equal + \ifnum\comparedresult<2 + \ifnum\scratchcounter=\commalistsize + \@EA\@EA\@EA\def\@EA\@EA\@EA\sortedcommalist + \@EA\@EA\@EA{\@EA\sortedcommalist\@EA,\!!tempa}% + \fi + %\or % new element larger + % \ifnum\scratchcounter=\commalistsize + % \@EA\@EA\@EA\def\@EA\@EA\@EA\sortedcommalist + % \@EA\@EA\@EA{\@EA\sortedcommalist\@EA,\!!tempa}% + % \fi + \else % old element larger + \@EA\def\@EA\newcommalistelement\@EA{\!!tempa,#1}% + \replaceincommalist\sortedcommalist\scratchcounter + \expandafter\quitcommalist + \fi}% + \advance\scratchcounter \plusone} % bug, was \minusone %D The macro \type{\donumericcompare} considers everything %D that is not a number to be larger than any number. \def\donumericcompare#1#2% - {\doifnumberelse{#1} - {\doifnumberelse{#2} - {\ifnum#1>#2\relax - \comparedresult1 % #1 is larger - \else\ifnum#1<#2\relax - \comparedresult2 % #2 is larger - \else - \comparedresult0 % both are equal - \fi\fi} - {\comparedresult2 }} - {\comparedresult1 }} + {\doifnumberelse{#1} + {\doifnumberelse{#2} + {\ifnum#1>#2\relax + \comparedresult\plusone % #1 is larger + \else\ifnum#1<#2\relax + \comparedresult\plustwo % #2 is larger + \else + \comparedresult\zerocount % both are equal + \fi\fi} + {\comparedresult\plustwo}} + {\comparedresult\plusone}} %D \macros %D {@saveprimitive} diff --git a/tex/context/base/type-enc.tex b/tex/context/base/type-enc.tex index 39527d646..7bc58de34 100644 --- a/tex/context/base/type-enc.tex +++ b/tex/context/base/type-enc.tex @@ -1165,57 +1165,57 @@ \setupencoding[default=texnansi] -\definefontsynonym [ec-utmr8a] [utmr8y] [encoding=texnansi] -\definefontsynonym [ec-utmri8a] [utmri8y] [encoding=texnansi] -\definefontsynonym [ec-utmb8a] [utmb8y] [encoding=texnansi] -\definefontsynonym [ec-utmbi8a] [utmbi8y] [encoding=texnansi] - -\definefontsynonym [ec-utmr8a-slanted-167] [ptmro8y] [encoding=texnansi] -\definefontsynonym [ec-utmb8a-slanted-167] [ptmbo8y] [encoding=texnansi] - -\definefontsynonym [ec-uhvr8a] [uhvr8y] [encoding=texnansi] -\definefontsynonym [ec-uhvro8a] [uhvro8y] [encoding=texnansi] -\definefontsynonym [ec-uhvb8a] [uhvb8y] [encoding=texnansi] -\definefontsynonym [ec-uhvbo8a] [uhvbo8y] [encoding=texnansi] - -\definefontsynonym [ec-ucrr8a] [pcrr8y] [encoding=texnansi] -\definefontsynonym [ec-ucrb8a] [pcrb8y] [encoding=texnansi] -\definefontsynonym [ec-ucrro8a] [pcrro8y] [encoding=texnansi] -\definefontsynonym [ec-ucrbo8a] [pcrbo8y] [encoding=texnansi] - -\definefontsynonym [ec-uplr8a] [uplr8y] [encoding=texnansi] -\definefontsynonym [ec-uplri8a] [uplri8y] [encoding=texnansi] -\definefontsynonym [ec-uplb8a] [uplb8y] [encoding=texnansi] -\definefontsynonym [ec-uplbi8a] [uplbi8y] [encoding=texnansi] -\definefontsynonym [ec-uplr8a-slanted-167] [uplro8y] [encoding=texnansi] -\definefontsynonym [ec-uplb8a-slanted-167] [uplbo8y] [encoding=texnansi] -\definefontsynonym [ec-uplr8a-capitalized-800] [uplr8y] [encoding=texnansi] - -\definefontsynonym [ec-ubkl8a] [ubkl8y] [encoding=texnansi] -\definefontsynonym [ec-ubkli8a] [ubkli8y] [encoding=texnansi] -\definefontsynonym [ec-ubkd8a] [ubkd8y] [encoding=texnansi] -\definefontsynonym [ec-ubkdi8a] [ubkdi8y] [encoding=texnansi] -\definefontsynonym [ec-ubkl8a-slanted-167] [ubklo8y] [encoding=texnansi] -\definefontsynonym [ec-ubkd8a-slanted-167] [ubkdo8y] [encoding=texnansi] -\definefontsynonym [ec-ubkl8a-capitalized-800] [ubkl8y] [encoding=texnansi] - -\definefontsynonym [ec-uzcmi8a] [uzcmi8y] [encoding=texnansi] - -\definefontsynonym [ec-putr8a] [putr8y] [encoding=texnansi] -\definefontsynonym [ec-putri8a] [putri8y] [encoding=texnansi] -\definefontsynonym [ec-putb8a] [putr8y] [encoding=texnansi] -\definefontsynonym [ec-putbi8a] [putbi8y] [encoding=texnansi] -\definefontsynonym [ec-putr8a-slanted-167] [putro8y] [encoding=texnansi] -\definefontsynonym [ec-putb8a-slanted-167] [putbo8y] [encoding=texnansi] -\definefontsynonym [ec-putr8a-capitalized-800] [putr8y] [encoding=texnansi] - -\definefontsynonym [ec-bchr8a] [bchr8y] [encoding=texnansi] -\definefontsynonym [ec-bchri8a] [bchri8y] [encoding=texnansi] -\definefontsynonym [ec-bchb8a] [bchb8y] [encoding=texnansi] -\definefontsynonym [ec-bchbi8a] [bchbi8y] [encoding=texnansi] -\definefontsynonym [ec-bchr8a-slanted-167] [bchro8y] [encoding=texnansi] -\definefontsynonym [ec-bchb8a-slanted-167] [bchbo8y] [encoding=texnansi] -\definefontsynonym [ec-bchr8a-capitalized-800] [bchr8y] [encoding=texnansi] +\definefontsynonym [texnansi-utmr8a] [utmr8y] [encoding=texnansi] +\definefontsynonym [texnansi-utmri8a] [utmri8y] [encoding=texnansi] +\definefontsynonym [texnansi-utmb8a] [utmb8y] [encoding=texnansi] +\definefontsynonym [texnansi-utmbi8a] [utmbi8y] [encoding=texnansi] + +\definefontsynonym [texnansi-utmr8a-slanted-167] [ptmro8y] [encoding=texnansi] +\definefontsynonym [texnansi-utmb8a-slanted-167] [ptmbo8y] [encoding=texnansi] + +\definefontsynonym [texnansi-uhvr8a] [uhvr8y] [encoding=texnansi] +\definefontsynonym [texnansi-uhvro8a] [uhvro8y] [encoding=texnansi] +\definefontsynonym [texnansi-uhvb8a] [uhvb8y] [encoding=texnansi] +\definefontsynonym [texnansi-uhvbo8a] [uhvbo8y] [encoding=texnansi] + +\definefontsynonym [texnansi-ucrr8a] [pcrr8y] [encoding=texnansi] +\definefontsynonym [texnansi-ucrb8a] [pcrb8y] [encoding=texnansi] +\definefontsynonym [texnansi-ucrro8a] [pcrro8y] [encoding=texnansi] +\definefontsynonym [texnansi-ucrbo8a] [pcrbo8y] [encoding=texnansi] + +\definefontsynonym [texnansi-uplr8a] [uplr8y] [encoding=texnansi] +\definefontsynonym [texnansi-uplri8a] [uplri8y] [encoding=texnansi] +\definefontsynonym [texnansi-uplb8a] [uplb8y] [encoding=texnansi] +\definefontsynonym [texnansi-uplbi8a] [uplbi8y] [encoding=texnansi] +\definefontsynonym [texnansi-uplr8a-slanted-167] [uplro8y] [encoding=texnansi] +\definefontsynonym [texnansi-uplb8a-slanted-167] [uplbo8y] [encoding=texnansi] +\definefontsynonym [texnansi-uplr8a-capitalized-800] [uplr8y] [encoding=texnansi] + +\definefontsynonym [texnansi-ubkl8a] [ubkl8y] [encoding=texnansi] +\definefontsynonym [texnansi-ubkli8a] [ubkli8y] [encoding=texnansi] +\definefontsynonym [texnansi-ubkd8a] [ubkd8y] [encoding=texnansi] +\definefontsynonym [texnansi-ubkdi8a] [ubkdi8y] [encoding=texnansi] +\definefontsynonym [texnansi-ubkl8a-slanted-167] [ubklo8y] [encoding=texnansi] +\definefontsynonym [texnansi-ubkd8a-slanted-167] [ubkdo8y] [encoding=texnansi] +\definefontsynonym [texnansi-ubkl8a-capitalized-800] [ubkl8y] [encoding=texnansi] + +\definefontsynonym [texnansi-uzcmi8a] [uzcmi8y] [encoding=texnansi] + +\definefontsynonym [texnansi-putr8a] [putr8y] [encoding=texnansi] +\definefontsynonym [texnansi-putri8a] [putri8y] [encoding=texnansi] +\definefontsynonym [texnansi-putb8a] [putr8y] [encoding=texnansi] +\definefontsynonym [texnansi-putbi8a] [putbi8y] [encoding=texnansi] +\definefontsynonym [texnansi-putr8a-slanted-167] [putro8y] [encoding=texnansi] +\definefontsynonym [texnansi-putb8a-slanted-167] [putbo8y] [encoding=texnansi] +\definefontsynonym [texnansi-putr8a-capitalized-800] [putr8y] [encoding=texnansi] + +\definefontsynonym [texnansi-bchr8a] [bchr8y] [encoding=texnansi] +\definefontsynonym [texnansi-bchri8a] [bchri8y] [encoding=texnansi] +\definefontsynonym [texnansi-bchb8a] [bchb8y] [encoding=texnansi] +\definefontsynonym [texnansi-bchbi8a] [bchbi8y] [encoding=texnansi] +\definefontsynonym [texnansi-bchr8a-slanted-167] [bchro8y] [encoding=texnansi] +\definefontsynonym [texnansi-bchb8a-slanted-167] [bchbo8y] [encoding=texnansi] +\definefontsynonym [texnansi-bchr8a-capitalized-800] [bchr8y] [encoding=texnansi] \stoptypescript diff --git a/tex/context/base/type-fsf.tex b/tex/context/base/type-fsf.tex new file mode 100644 index 000000000..f71fd77ad --- /dev/null +++ b/tex/context/base/type-fsf.tex @@ -0,0 +1,94 @@ +% run texfont from currentpath with the fonts on subpath fontsite/500 + +% texfont --en=texnansi --ve=fontsite --co=opus type-fsf.dat +% texfont --en=texnansi --ve=fontsite --co=typewriter type-fsf.dat + +\starttypescript [sans] [opus] [name] + + \definefontsynonym [Sans] [Opus] + \definefontsynonym [SansCaps] [OpusSmCaps] + \definefontsynonym [SansItalic] [Opus-Italic] + \definefontsynonym [SansBold] [Opus-Bold] + \definefontsynonym [SansBoldCaps] [OpusSmCaps-Bold] + \definefontsynonym [SansBoldItalic] [Opus-BoldItalic] + + \definefontsynonym [SansSlanted] [Opus-Slanted] % faked + \definefontsynonym [SansBoldSlanted] [Opus-BoldSlanted] % faked + +\stoptypescript + +\starttypescript [sans] [opus] [texnansi,ec,8r] + + \loadmapfile[\typefaceencoding-fontsite-opus.map] + + \definefontsynonym [Opus] [\typefaceencoding-opusrg] [encoding=\typefaceencoding] + \definefontsynonym [OpusSmCaps] [\typefaceencoding-opusscrg] [encoding=\typefaceencoding] + \definefontsynonym [Opus-Italic] [\typefaceencoding-opusi] [encoding=\typefaceencoding] + \definefontsynonym [Opus-Bold] [\typefaceencoding-opusb] [encoding=\typefaceencoding] + \definefontsynonym [Opus-BoldItalic] [\typefaceencoding-opusbi] [encoding=\typefaceencoding] + \definefontsynonym [OpusSmCaps-Bold] [\typefaceencoding-opusscb] [encoding=\typefaceencoding] + + \definefontsynonym [Opus-Slanted] [\typefaceencoding-opusrg-slanted-167] [encoding=\typefaceencoding] + \definefontsynonym [Opus-BoldSlanted] [\typefaceencoding-opusb-slanted-167] [encoding=\typefaceencoding] + +\stoptypescript + +\starttypescript [mono] [typewriter] [name] + + \definefontsynonym [Mono] [Typewriter] + \definefontsynonym [MonoItalic] [Typewriter-Italic] + \definefontsynonym [MonoBold] [Typewriter-Bold] + \definefontsynonym [MonoBoldItalic] [Typewriter-BoldItalic] + + \definefontsynonym [MonoSlanted] [Typewriter-Slanted] % faked + \definefontsynonym [MonoBoldSlanted] [Typewriter-BoldSlanted] % faked + +\stoptypescript + +\starttypescript [mono] [typewriter] [texnansi,ec,8r] + + \loadmapfile[\typefaceencoding-fontsite-typewriter.map] + + \definefontsynonym [Typewriter] [\typefaceencoding-typerg] [encoding=\typefaceencoding] + \definefontsynonym [Typewriter-Italic] [\typefaceencoding-typei] [encoding=\typefaceencoding] + \definefontsynonym [Typewriter-Bold] [\typefaceencoding-typeb] [encoding=\typefaceencoding] + \definefontsynonym [Typewriter-BoldItalic] [\typefaceencoding-typebi] [encoding=\typefaceencoding] + + \definefontsynonym [Typewriter-Slanted] [\typefaceencoding-typerg-slanted-167] [encoding=\typefaceencoding] + \definefontsynonym [Typewriter-BoldSlanted] [\typefaceencoding-typeb-slanted-167] [encoding=\typefaceencoding] + + \definefontsynonym [TypewriterCond] [\typefaceencoding-typecrg] + \definefontsynonym [TypewriterCond-Bold] [\typefaceencoding-typecb] + +\stoptypescript + +\starttypescript [serif] [garamond] [name] + + \definefontsynonym [Serif] [FSGaramond] + \definefontsynonym [SerifCaps] [FSGaramondSmCaps] + \definefontsynonym [SerifItalic] [FSGaramond-Italic] + \definefontsynonym [SerifBold] [FSGaramond-Bold] + \definefontsynonym [SerifBoldCaps] [FSGaramondSmCaps-Bold] + + \definefontsynonym [SerifSlanted] [FSGaramond-Slanted] + \definefontsynonym [SerifBoldSlanted] [FSGaramond-BoldSlanted] + +\stoptypescript + +\starttypescript [serif] [garamond] [texnansi,ec,8r] + + \loadmapfile[\typefaceencoding-fontsite-opus.map] + + \definefontsynonym [FSGaramond] [\typefaceencoding-garamond] [encoding=\typefaceencoding] + \definefontsynonym [FSGaramondSmCaps] [\typefaceencoding-garasc] [encoding=\typefaceencoding] + \definefontsynonym [FSGaramond-Italic] [\typefaceencoding-garai] [encoding=\typefaceencoding] + \definefontsynonym [FSGaramond-Bold] [\typefaceencoding-garab] [encoding=\typefaceencoding] + \definefontsynonym [FSGaramond-BoldItalic] [\typefaceencoding-garabi] [encoding=\typefaceencoding] + \definefontsynonym [FSGaramondSmCaps-Bold] [\typefaceencoding-garascb] [encoding=\typefaceencoding] + + \definefontsynonym [FSGaramond-Slanted] [\typefaceencoding-garamond-slanted-167] [encoding=\typefaceencoding] + \definefontsynonym [FSGaramond-BoldSlanted] [\typefaceencoding-garab-slanted-167] [encoding=\typefaceencoding] + +\stoptypescript + +\endinput diff --git a/tex/context/base/type-pre.tex b/tex/context/base/type-pre.tex index 76d57b851..49a4cb2a7 100644 --- a/tex/context/base/type-pre.tex +++ b/tex/context/base/type-pre.tex @@ -154,8 +154,8 @@ \starttypescript [lbr] - \usetypescript [serif,sans,mono,math,handwriting] [lucida] [name,special,\defaultencoding] - \usetypescript [serif,sans,mono,math,handwriting] [default] [size] + \usetypescript [serif,sans,mono,math,calligraphy,handwriting] [lucida] [name,special,\defaultencoding] + \usetypescript [serif,sans,mono,math,calligraphy,handwriting] [default] [size] \usemathcollection[lbr] diff --git a/tex/context/base/verb-ini.tex b/tex/context/base/verb-ini.tex index 9934938ab..029964154 100644 --- a/tex/context/base/verb-ini.tex +++ b/tex/context/base/verb-ini.tex @@ -366,12 +366,14 @@ {\global\let\savedverbatimline\empty \global\chardef\verbatimstatus\ifskipfirstverbatimline0 \else1 \fi} +\let\donextemptyverbatimline\relax + \def\presetemptyverbatimline {\ifcase\verbatimstatus \global\chardef\verbatimstatus1 \or \or - % \ifoptimizeverbatim\else\doemptyverbatimline\fi + \donextemptyverbatimline \or \doflushverbatimline \global\let\savedverbatimline\empty @@ -821,7 +823,7 @@ \global\linepartrue} \def\obeyemptylines - {\def\doemptyverbatimline{\doverbatimline}} + {\let\donextemptyverbatimline\doemptyverbatimline} %D \TEX\ does not offer \type{\everyline}, which is a direct %D result of its advanced multi||pass paragraph typesetting diff --git a/tex/context/base/xtag-ini.tex b/tex/context/base/xtag-ini.tex index 4c5d5d2e0..5391cb245 100644 --- a/tex/context/base/xtag-ini.tex +++ b/tex/context/base/xtag-ini.tex @@ -594,7 +594,7 @@ \fi} \long\def\traceXMLelement - {\edef\originalXMLfullidentifier{\someXMLelement\currentXMLelement}% + {\edef\originalXMLfullidentifier{\someXMLelementID\currentXMLelement}% \cleanupXMLarguments\writestatus{xml-element}{\@@traceXMLelement}} %D We split off the namespace part, construct the @@ -683,7 +683,7 @@ \ifcsname\@@XMLelement:\currentXMLfullidentifier\endcsname \currentXMLfullidentifier \else - \s!default % \defaultXMLelement + \defaultXMLelementID % was \s!default \fi \endcsname} @@ -694,7 +694,7 @@ \else\ifcsname\@@XMLelement:\currentXMLidentifier\endcsname \currentXMLidentifier \else - \s!default % \defaultXMLelement + \defaultXMLelementID % was \s!default \fi\fi \endcsname} @@ -715,7 +715,7 @@ \else\ifcsname\normal@@XMLelement:\currentXMLidentifier\endcsname \normal@@XMLelement:\currentXMLidentifier \else - \@@XMLelement:\s!default % \defaultXMLelement + \normal@@XMLelement:\defaultXMLelementID % was \@@XMLelement:\s!default \fi\fi} \def\setXMLfallbackmode#1% @@ -780,13 +780,13 @@ %D Later we will implement the error handler, here we handle %D the default case. -\def\someXMLelement#1% +\def\someXMLelementID#1% {\ifnum\kindofXMLelement=\endXMLtag /\fi #1% \ifnum\kindofXMLelement=\emptyXMLtag/\fi} -\def\defaultXMLelement - {\someXMLelement\s!default} +\def\defaultXMLelementID + {\someXMLelementID\s!default} %D It is possible to keep track of nesting automatically, %D but this would kind of prohibit things like \type @@ -1546,6 +1546,11 @@ \long\setvalue{\@@XMLelement:#1/}{\long\setvalue{\@@XMLdata:#1}{}}% \long\setvalue{\@@XMLelement:#1}{\redoXMLsave{#1}}} +\long\gdef\dododefineXMLsavecontent#1#2% + {\long\setvalue{\@@XMLdata:#1}{#2}% + \long\setvalue{\@@XMLelement:#1/}{}% + \long\setvalue{\@@XMLelement:#1}{\redoXMLsave{#1}}} + \gdef\redoXMLsave#1% {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>% {\long\@EA\def\csname\@@XMLdata:#1\endcsname{##1}}% @@ -1556,6 +1561,11 @@ \long\setvalue{\@@XMLelement:#1/}{\long\setgvalue{\@@XMLdata:#1}{}}% \long\setvalue{\@@XMLelement:#1}{\redoXMLgsave{#1}}} +\long\gdef\dododefineXMLgsavecontent#1#2% + {\long\setvalue{\@@XMLdata:#1}{#2}% + \long\setvalue{\@@XMLelement:#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}}% @@ -1614,7 +1624,9 @@ \def\defineXMLpickup {\dotripleempty\dodefineXMLpickup} \def\defineXMLenvironment {\dotripleempty\dodefineXMLenvironment} \def\defineXMLsave {\dotripleempty\dodefineXMLsave} +\def\defineXMLsavecontent {\dotripleempty\dodefineXMLsavecontent} \def\defineXMLgsave {\dotripleempty\dodefineXMLgsave} +\def\defineXMLgsavecontent {\dotripleempty\dodefineXMLgsavecontent} \def\defineXMLenvironmentsave {\dotripleempty\dodefineXMLenvironmentsave} \def\defineXMLenvironmentgsave{\dotripleempty\dodefineXMLenvironmentgsave} \def\defineXMLprocess {\dotripleempty\dodefineXMLprocess} @@ -1654,9 +1666,15 @@ \long\def\dodefineXMLsave[#1][#2][#3]% {\defineXMLmethod\dododefineXMLsave{#1}{#2}{#3}{}{}} +\long\def\dodefineXMLsavecontent[#1][#2][#3]#4% + {\defineXMLmethod\dododefineXMLsavecontent{#1}{#2}{#3}{#4}{}} + \long\def\dodefineXMLgsave[#1][#2][#3]% {\defineXMLmethod\dododefineXMLgsave{#1}{#2}{#3}{}{}} +\long\def\dodefineXMLgsavecontent[#1][#2][#3]#4% + {\defineXMLmethod\dododefineXMLgsavecontent{#1}{#2}{#3}{#4}{}} + \long\def\dodefineXMLenvironmentsave[#1][#2][#3]#4#5% {\defineXMLmethod\dododefineXMLenvironmentsave{#1}{#2}{#3}{#4}{#5}} diff --git a/tex/context/base/xtag-pre.tex b/tex/context/base/xtag-pre.tex index f6d6e7ec6..1a309c584 100644 --- a/tex/context/base/xtag-pre.tex +++ b/tex/context/base/xtag-pre.tex @@ -28,7 +28,11 @@ \defineXMLenvironment [\s!default] \defaultXMLelement \defaultXMLelement \defineXMLsingular [\s!default] \defaultXMLelement -\def\defaultXMLelement{\iftraceXMLelements[\currentXMLelement]\fi} +% \def\defaultXMLelement +% {\iftraceXMLelements[\currentXMLfullidentifier]\fi} + +\def\defaultXMLelement + {\iftraceXMLelements{\infofont<\currentXMLfullidentifier>}\fi} %D We can use the default handler to implement automatic %D element hiding. Beware: this overloads the tracer. diff --git a/tex/generic/context/m-metapo.tex b/tex/generic/context/m-metapo.tex index 6c2fa6fee..5a1baa3d3 100644 --- a/tex/generic/context/m-metapo.tex +++ b/tex/generic/context/m-metapo.tex @@ -56,7 +56,7 @@ %D This module needs \type {supp-mps} and \type {supp-mis}, %D that both are present in the \CONTEXT\ path. %D -%D Pleas do not forget to say \type {prologues:=2} at the +%D Please do not forget to say \type {prologues:=2} at the %D top of the metapost file! %D %D For non \LATEX\ (and \CONTEXT) users we provide an diff --git a/tex/generic/context/mptopdf.tex b/tex/generic/context/mptopdf.tex index 1192a8a94..8929ac1e4 100644 --- a/tex/generic/context/mptopdf.tex +++ b/tex/generic/context/mptopdf.tex @@ -117,6 +117,7 @@ \vsize=\hsize \hoffset=-1in \voffset=\hoffset + \topskip=0pt \setbox0=\vbox{\convertMPtoPDF{#1}{1}{1}}% \ifdim\wd0<1in \message{[warning: width<1in]}\fi \ifdim\ht0<1in \message{[warning: height<1in]}\fi |