diff options
35 files changed, 1221 insertions, 419 deletions
diff --git a/context/config/texexec.ini b/context/config/texexec.ini new file mode 100644 index 000000000..30ecfedf0 --- /dev/null +++ b/context/config/texexec.ini @@ -0,0 +1,146 @@ +% == introduction ==  +% +% This is 'texexec.ini', the file used by texexec to determine where  +% to find files, what TeX to use, what flags to pass, etc. Although  +% TeXexec tries to locate things itself, a little help is sometimes  +% needed. One can influence texexec by setting some variables. These  +% are only needed when the automatic determined settings fail.  +%  +% == interfacing == +%  +% UsedInterfaces  nl,en  the formats generated with --make +% UserInterface   nl     the default format used +% +% == binaries ==  +%  +% TeXExecutable      pdfetex  the TeX binary to use  +% MpExecutable       mpost    the MetaPost binary to use   +% MpToTeXExecutable  mpto     the MetaPost to TeX converter +% DviToMpExecutable  dvitomp  the DVI to MetaPost converter +% +% == Scripts ==  +% +% DviSpecialScript   dvispec  the DVI special filter script  +% +% == flags ==  +%            +% TeXFormatFlag  &     the format introducer   +% TeXVirginFlag  -ini  the format generation switch +% +% == paths ==  +% +% TeXFormatPath   texmf/...               fmt files  +% ConTeXtPath     texmf/tex/context/base  sources +% SetupPath       texmf/tex/base/user     cont-sys/usr file +% TeXScriptsPath  texmf/context/perltk    scripts +% TeXFontsPath    texmf                   font files +% +% MpFormatPath    TeXFormatPath           mem files   +% +% == the main shell setting == +% +% As shown below, one can define his/her own sections. We default to  +% the teTeX/fpTeX web2c based settings.  + +set  TeXShell  to  tetex  +%set TeXShell  to  fptex  +%set TeXShell  to  miktex +%set TeXShell  to  private  + +% == setting up the variables == +% +% Here are some general defaults. They can be overruled later.   + +set  UsedInterfaces     to  en nl metafun mptopdf  +set  UserInterface      to  en + +set  TeXExecutable      to  tex  + +set  MpExecutable       to  mpost  +set  MpToTeXExecutable  to  mpto +set  DviToMpExecutable  to  dvitomp +set  DviSpecialScript   to  dvispec + +set  MpFormat           to  metafun + +set  TeXFormatFlag      to  & +set  MpFormatFlag       to  & + +% This one is only for testing, you can leave it untouched. + +set  TeXFontsPath       to  l:/tex/texmf;l:/tex/texmf-local; + +% For teTeX the next settings will do. + +for  tetex  set  TeXExecutable     to  pdfetex +for  tetex  set  TeXVirginFlag     to  -ini +for  tetex  set  TeXPassString     to  -progname=context  +for  tetex  set  TeXBatchFlag      to  -int=batchmode  +for  tetex  set  MpToTeXExecutable to  mpto +for  tetex  set  MpVirginFlag      to  -ini  +for  tetex  set  MpPassString      to  -progname=mpost +for  tetex  set  MpBatchFlag       to  -int=batchmode  + +% These also apply to fpTeX.  + +for  fptex  set  TeXExecutable     to  pdfetex +for  fptex  set  TeXVirginFlag     to  -ini +for  fptex  set  TeXPassString     to  -progname=context  +for  fptex  set  TeXBatchFlag      to  -int=batchmode  +for  fptex  set  MpToTeXExecutable to  mpto +for  fptex  set  MpVirginFlag      to  -ini  +for  fptex  set  MpPassString      to  -progname=mpost +for  fptex  set  MpBatchFlag       to  -int=batchmode + +% MikTeX users probably have to set up some paths too. + +for  miktex  set  TeXExecutable     to  pdfetex +for  miktex  set  TeXVirginFlag     to  --initialize +for  miktex  set  TeXPassString     to  --alias=context  +for  miktex  set  TeXBatchFlag      to  --interaction=batchmode  +for  miktex  set  MpToTeXExecutable to  mptotex +for  miktex  set  MpVirginFlag      to  --initialize +for  miktex  set  MpPassString      to  --alias=mpost +for  miktex  set  MpBatchFlag       to  --interaction=batchmode  + +for  miktex  set  TeXFormatFlag     to  --undump= +for  miktex  set  MpFormatFlag      to  --undump= + +% These are the settings used on some machines at PRAGMA ADE that  +% don't use the texmf tree. They can serve as an example for local  +% settings. Local settings should either be added to the previous  +% one, or go without the 'for' directives. Consider these  +% settings as an example.  + +for  private  set  UsedInterfaces  to  en nl +for  private  set  UserInterface   to  nl +for  private  set  ConTeXtPath     to  t:/sources/ +for  private  set  SetupPath       to  t:/perl/  +for  private  set  TeXScriptsPath  to  t:/perl/ + +% == read this too ==  +% +% If this file is called 'texexec.rme', copy it to 'texexec.ini',  +% check the settings above, change them according to your TeX +% distribution, and say:  +% +%   texexec  --verbose +%  +% When set up properly, you should see your local settings fly by.  +% When these settings are ok, the next call should work:  +% +%   texexec  --make +% +% and you should be able to process a file by saying +% +%   texexec  filename +% +% See 'mtexexec.pdf' for more information on the flags you can use with +% 'texexec'. Also make sure you have the 'texutil' script installed in  +% the same path as 'texexec'.  + +% Experimental  +% +% set  TcXPath     to  d:/tex/texmf/web2c +% set  FmtLanguage to  pl  +% set  FmtBodyFont to  plr  diff --git a/context/data/cont-cz.tws b/context/data/cont-cz.tws index 487f66256..c7f5d8702 100644 --- a/context/data/cont-cz.tws +++ b/context/data/cont-cz.tws @@ -159,6 +159,7 @@ var:redukce:ano,ne::  var:rgb:ano,ne::  var:cmyk:ano,ne::  var:mpcmyk:ano,ne:: +var:barvatextu:*jmeno::  stopsetup  startsetup @@ -765,6 +766,9 @@ var:vyska:*dimenze,max::  var:hloubka:*dimenze,max::  var:alternativa:a,b,c,d::  var:tloustkalinky:*dimenze:: +var:barva:*jmeno:: +var:pozadi:barevne:: +var:barvapozadi:*jmeno::  stopsetup  startsetup diff --git a/context/data/cont-de.tws b/context/data/cont-de.tws index be43a9135..e89fe84b7 100644 --- a/context/data/cont-de.tws +++ b/context/data/cont-de.tws @@ -159,6 +159,7 @@ var:reduktion:ja,nein::  var:rgb:ja,nein::  var:cmyk:ja,nein::  var:mpcmyk:ja,nein:: +var:textfarbe:*Name::  stopsetup  startsetup @@ -765,6 +766,9 @@ var:hoehe:*Dimension,max::  var:tiefe:*Dimension,max::  var:alternative:a,b,c,d::  var:liniendicke:*Dimension:: +var:farbe:*Name:: +var:hintergrund:farbe:: +var:hintergrundfarbe:*Name::  stopsetup  startsetup diff --git a/context/data/cont-en.tws b/context/data/cont-en.tws index a0da7693d..c7cba86e2 100644 --- a/context/data/cont-en.tws +++ b/context/data/cont-en.tws @@ -159,6 +159,7 @@ var:reduction:yes,no::  var:rgb:yes,no::  var:cmyk:yes,no::  var:mpcmyk:yes,no:: +var:textcolor:*name::  stopsetup  startsetup @@ -765,6 +766,9 @@ var:height:*dimension,max::  var:depth:*dimension,max::  var:alternative:a,b,c,d::  var:rulethickness:*dimension:: +var:color:*name:: +var:background:color:: +var:backgroundcolor:*name::  stopsetup  startsetup diff --git a/context/data/cont-it.tws b/context/data/cont-it.tws index 29173a4a2..05cb71c38 100644 --- a/context/data/cont-it.tws +++ b/context/data/cont-it.tws @@ -159,6 +159,7 @@ var:riduzione:si,no::  var:rgb:si,no::  var:cmyk:si,no::  var:mpcmyk:si,no:: +var:coloretesto:*name::  stopsetup  startsetup @@ -765,6 +766,9 @@ var:altezza:*dimension,max::  var:profondita:*dimension,max::  var:alternativa:a,b,c,d::  var:spessorelinea:*dimension:: +var:colore:*name:: +var:sfondo:colore:: +var:coloresfondo:*name::  stopsetup  startsetup diff --git a/context/data/cont-nl.tws b/context/data/cont-nl.tws index b457504fd..7117c813d 100644 --- a/context/data/cont-nl.tws +++ b/context/data/cont-nl.tws @@ -159,6 +159,7 @@ var:reductie:ja,nee::  var:rgb:ja,nee::  var:cmyk:ja,nee::  var:mpcmyk:ja,nee:: +var:tekstkleur:*naam::  stopsetup  startsetup @@ -765,6 +766,9 @@ var:hoogte:*maat,max::  var:diepte:*maat,max::  var:variant:a,b,c,d::  var:lijndikte:*maat:: +var:kleur:*naam:: +var:achtergrond:kleur:: +var:achtergrondkleur:*naam::  stopsetup  startsetup diff --git a/context/data/cont-ro.tws b/context/data/cont-ro.tws index 3d73f5ca5..dab9da453 100644 --- a/context/data/cont-ro.tws +++ b/context/data/cont-ro.tws @@ -159,6 +159,7 @@ var:reducere:da,nu::  var:rgb:da,nu::  var:cmyk:da,nu::  var:mpcmyk:da,nu:: +var:culoaretext:*nume::  stopsetup  startsetup @@ -765,6 +766,9 @@ var:inaltime:*dimensiune,max::  var:inaltime:*dimensiune,max::  var:alternativ:a,b,c,d::  var:grosimerigla:*dimensiune:: +var:culoare:*nume:: +var:fundal:culoare:: +var:culoarefundal:*nume::  stopsetup  startsetup diff --git a/context/perltk/texexec.pl b/context/perltk/texexec.pl index ca9eb8abc..7d7a27af5 100644..100755 --- a/context/perltk/texexec.pl +++ b/context/perltk/texexec.pl @@ -3,6 +3,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $  # todo: second run of checksum of mp file with --nomprun changes  # todo: merge wybo's enhanced help function [along with updating manual] +# todo: warning if no args  #D \module  #D   [       file=texexec.pl, @@ -1974,6 +1975,14 @@ sub load_set_file  if ($SetFile ne "")    { load_set_file ($SetFile,$Verbose) } +# todo : more consistent argv handling +#  +# sub ifargs  +#   { $problems = (@ARGV==0) ;   +#     if ($problems) +#       { print "               warning : nothing to do\n" } +#     return $problems }  +  if ($TypesetListing)    { RunListing (@ARGV) }  elsif ($TypesetFigures) @@ -1988,8 +1997,7 @@ elsif ($MakeFormats)      else        { RunFormats } }  elsif (@ARGV) -  { #foreach (@ARGV) { $_ =~ s/\.tex//io } -    @ARGV = <@ARGV> ; RunFiles } +  { @ARGV = <@ARGV> ; RunFiles }  else    { print $Help{HELP} ;      unless ($Verbose) { print $Help{VERBOSE} } } diff --git a/context/perltk/texutil.pl b/context/perltk/texutil.pl index dbb6ae549..dbb6ae549 100644..100755 --- a/context/perltk/texutil.pl +++ b/context/perltk/texutil.pl diff --git a/metapost/context/mp-page.mp b/metapost/context/mp-page.mp index 285f84c41..679b02ec6 100644 --- a/metapost/context/mp-page.mp +++ b/metapost/context/mp-page.mp @@ -38,6 +38,7 @@ PrintPaperHeight    := 845.04684pt  ;  PrintPaperWidth     := 597.50787pt  ;  TopSpace            :=  71.12546pt  ;  BackSpace           :=  71.13275pt  ; +CutSpace            :=   0.0pt      ;  MakeupHeight        := 711.3191pt   ;   MakeupWidth         := 426.78743pt  ;  TopHeight           :=   0.0pt      ; @@ -101,6 +102,7 @@ endfor ;  def SwapPageState =     if not OnRightPage :             BackSpace := PaperWidth-MakeupWidth-BackSpace ; +            CutSpace := PaperWidth-MakeupWidth-CutSpace ;                     i := LeftMarginWidth ;       LeftMarginWidth := RightMarginWidth ;      RightMarginWidth := i ; diff --git a/metapost/context/mp-spec.mp b/metapost/context/mp-spec.mp index a8dfb96b6..1ec8164bc 100644 --- a/metapost/context/mp-spec.mp +++ b/metapost/context/mp-spec.mp @@ -76,35 +76,84 @@ extra_endfig :=    " reset_extra_specials ; "  &     " insidefigure := false ; " ; -def _current_specials_ =  -  if insidefigure : _local_specials_ else : _global_specials_ fi  +def set_extra_special (expr s) =  +  if insidefigure :  +    _local_specials_  := _local_specials_  & s ;  +  else :  +    _global_specials_ := _global_specials_ & s ;  +  fi   enddef ;   def flush_special (expr typ, siz, dat) =    _special_counter_ := _special_counter_ + 1 ;    if _inline_specials_ : -    _current_specials_ := _current_specials_ -      & "special " +    set_extra_special +      ( "special "        & "(" & ditto        & dat & " "        & decimal _special_counter_ & " "        & decimal typ & " "        & decimal siz        & " special" -      & ditto & ");" ; +      & ditto & ");" ) ;     else : -    _current_specials_ := _current_specials_ -      & "special " +    set_extra_special +      ( "special "        & "(" & ditto        & "%%MetaPostSpecial: "        & decimal siz & " "        & dat & " "        & decimal _special_counter_ & " "        & decimal typ -      & ditto & ");" ; +      & ditto & ");" ) ;    fi ;  enddef ; +%D The next hack is needed in case you use a version of +%D \METAPOST\ that does not provide you the means to configure +%D the buffer size. Patrick Gundlach suggested to use arrays  +%D in this case.  + +boolean bufferhack ; bufferhack := false ; % true ;  + +if bufferhack :  + +  string _global_specials_[] ; numeric _nof_global_specials_ ; +  string _local_specials_[]  ; numeric _nof_local_specials_ ; + +  _nof_global_specials_ := _nof_local_specials_ := 0 ; + +  vardef add_special_signal = % write the version number +    if (_nof_global_specials_>0) or (_nof_local_specials_>0) :  +      special ("%%MetaPostSpecials: 1.0 " & decimal _special_signal_ ) ; +    fi ; +  enddef ; +  +  vardef add_extra_specials = +    for i=1 upto _nof_global_specials_ :  +      scantokens _global_specials_[i] ;  +    endfor; +    for i=1 upto _nof_local_specials_ :  +      scantokens _local_specials_[i] ;    +    endfor; +  enddef ; + +  vardef reset_extra_specials = +    string _local_specials_[]  ; _nof_local_specials_ := 0 ; +  enddef ; + +  def set_extra_special (expr s) =  +    if insidefigure :  +      _local_specials_[incr(_nof_local_specials_)]   := s ;    +    else :  +      _global_specials_[incr(_nof_global_specials_)] := s ; +    fi  +  enddef ;  + +fi ;  + +%D So far for this hack.  +  %D Shade allocation.  vardef define_linear_shade (expr a, b, ca, cb) = diff --git a/metapost/context/mp-tool.mp b/metapost/context/mp-tool.mp index d259a240c..95a89bf54 100644 --- a/metapost/context/mp-tool.mp +++ b/metapost/context/mp-tool.mp @@ -225,42 +225,43 @@ enddef;  numeric Pi ; Pi := 3.1415926 ; -def sqr  (expr x) = (x*x)                                 enddef ; -def log  (expr x) = (if x=0: 0 else: mlog(x)/mlog(10) fi) enddef ; -def ln   (expr x) = (if x=0: 0 else: mlog(x)/256 fi)      enddef ; -def exp  (expr x) = ((mexp 256)**x)                       enddef ; -def inv  (expr x) = (if x=0: 0 else: x**-1 fi)            enddef ; +vardef sqr  primary x = (x*x)                                 enddef ; +vardef log  primary x = (if x=0: 0 else: mlog(x)/mlog(10) fi) enddef ; +vardef ln   primary x = (if x=0: 0 else: mlog(x)/256 fi)      enddef ; +vardef exp  primary x = ((mexp 256)**x)                       enddef ; +vardef inv  primary x = (if x=0: 0 else: x**-1 fi)            enddef ; -def pow  (expr x,p) = (x**p)                              enddef ; +vardef pow (expr x,p) = (x**p)                              enddef ; -def asin (expr x) = (x+(x**3)/6+3(x**5)/40)               enddef ; -def acos (expr x) = (asin(-x))                            enddef ; -def atan (expr x) = (x-(x**3)/3+(x**5)/5-(x**7)/7)        enddef ; -def tand (expr x) = (sind(x)/cosd(x))                     enddef ; +vardef asin primary x = (x+(x**3)/6+3(x**5)/40)               enddef ; +vardef acos primary x = (asin(-x))                            enddef ; +vardef atan primary x = (x-(x**3)/3+(x**5)/5-(x**7)/7)        enddef ; +vardef tand primary x = (sind(x)/cosd(x))                     enddef ; -%D Here are Taco Hoekwater's alternatives:  +%D Here are Taco Hoekwater's alternatives (but  +%D vardef'd and primaried).   pi := 3.1415926 ; radian := 180/pi ; % 2pi*radian = 360 ;  -def tand   (expr x) = (sind(x)/cosd(x))  enddef ; -def cotd   (expr x) = (cosd(x)/sind(x))  enddef ; +vardef tand   primary x = (sind(x)/cosd(x))  enddef ; +vardef cotd   primary x = (cosd(x)/sind(x))  enddef ; -def sin    (expr x) = (sind(x*radian))   enddef ; -def cos    (expr x) = (cosd(x*radian))   enddef ; -def tan    (expr x) = (sin(x)/cos(x))    enddef ; -def cot    (expr x) = (cos(x)/sin(x))    enddef ; +vardef sin    primary x = (sind(x*radian))   enddef ; +vardef cos    primary x = (cosd(x*radian))   enddef ; +vardef tan    primary x = (sin(x)/cos(x))    enddef ; +vardef cot    primary x = (cos(x)/sin(x))    enddef ; -def asin   (expr x) = angle((1+-+x,x))   enddef ; -def acos   (expr x) = angle((x,1+-+x))   enddef ; +vardef asin   primary x = angle((1+-+x,x))   enddef ; +vardef acos   primary x = angle((x,1+-+x))   enddef ; -def invsin (expr x) = ((asin(x))/radian) enddef ; -def invcos (expr x) = ((acos(x))/radian) enddef ; +vardef invsin primary x = ((asin(x))/radian) enddef ; +vardef invcos primary x = ((acos(x))/radian) enddef ; -def acosh  (expr x) = ln(x+(x+-+1))      enddef ;  -def asinh  (expr x) = ln(x+(x++1))       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 xx ; (xx-1/xx)/2 enddef ; +vardef cosh   primary x = save xx ; xx = exp xx ; (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 b3e10792d..ae7934699 100644 --- a/tex/context/base/colo-ini.tex +++ b/tex/context/base/colo-ini.tex @@ -568,17 +568,50 @@  \let\maintextcolor\empty -\def\starttextcolor[#1]% to be translated  -  {\bgroup -   \let\starttextcolor\relax -   \let\stoptextcolor \relax -   \startregistercolor[#1]% -   \def\maintextcolor{#1}} +\def\starttextcolor[#1]%  +  {\doifsomething{#1} +     {\bgroup +      \def\stoptextcolor          % also goes ok with \page after  +        {\let\maintextcolor\empty % this one because the top of  +         \stopregistercolor       % page sets the color right (side  +         \egroup}%                % effect)    +      \def\starttextcolor[##1]% +        {\bgroup +         \let\stoptextcolor\egroup}%  +      \startregistercolor[#1]% +      \def\maintextcolor{#1}}} + +\let\stoptextcolor\relax           + +%D The following hook permits proper support at the text  +%D level. This definition actually belongs in another  +%D module.  + +\ifx\initializemaintextcolor\undefined + +  % \let\initializemaintextcolor\relax + +  \def\initializemaintextcolor +    {\doifsomething{\@@cltekstkleur} +       {\appendtoks\starttextcolor[\@@cltekstkleur]\to\everystarttext  +        \appendtoks\stoptextcolor                  \to\everystoptext  +        \let\initializemaintextcolor\relax}} + +\fi  + +%D The next macro can be used to return to the (normal) +%D page color. This macro is used in the same way as  +%D \type {\color}.  + +\def\restoretextcolor +  {\ifx\maintextcolor\empty +     \expandafter\dorestoretextcolor +   \else +     % obey main text color  +   \fi} -\def\stoptextcolor          % also goes ok with \page after  -  {\let\maintextcolor\empty % this one because the top of  -   \stopregistercolor       % page sets the color right (side  -   \egroup}                 % effect)    +\def\dorestoretextcolor +  {\color[black]}  %D We use some reserved names for local color components.  %D Consistent use of these scratch variables saves us @@ -780,7 +813,8 @@                   \incolortrue\localcolorfalse                   \let\@@clstatus\v!globaal,          \v!stop=>\incolorfalse\localcolorfalse -                 \forcegrayMPcolorstrue]} +                 \forcegrayMPcolorstrue]% +  \initializemaintextcolor}  %D \macros  %D   {doifcolorelse} @@ -1700,7 +1734,8 @@     \c!reductie=\v!nee,     \c!rgb=\v!ja,     \c!cmyk=\v!ja, -   \c!mp\c!cmyk=\@@clcmyk] +   \c!mp\c!cmyk=\@@clcmyk, +   \c!tekstkleur=]  \setupcolor    [\v!rgb] diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex index 91a53f04d..578cbfda1 100644 --- a/tex/context/base/cont-new.tex +++ b/tex/context/base/cont-new.tex @@ -20,6 +20,61 @@  \writestatus{\m!systems}{beware: some patches loaded from cont-new.tex!} +% \layered[layer id][layer settings][framed setting]{data} +% \layered[layer id][combined settings]{data} + +\def\layered +  {\dotripleempty\dolayered} + +\def\dolayered +  {\ifthirdargument +     \expandafter\dolayeredT +   \else +     \expandafter\dolayeredS +   \fi}   + +\def\dolayeredT[#1][#2][#3]% +  {\dowithnextbox{\setlayer[#1][#2]{\box\nextbox}}% +   \hbox\framed[#3]}         + +\def\dolayeredS[#1][#2][#3]% +  {\dowithnextbox +     {\setlayer +        [#1] +        [\c!breedte=\wd\nextbox,\c!hoogte=\ht\nextbox, +         \c!offset=\!!zeropoint,#2] +        {\box\nextbox}}% +   \hbox\framed[\c!plaats=\v!normaal,#2]}         + +\def\@@themaintextcolor{themaintextcolor} + +\def\starttextcolor[#1]%  +  {\doifsomething{#1} +     {\bgroup +      \def\stoptextcolor          % also goes ok with \page after  +        {\let\maintextcolor\empty % this one because the top of  +         \stopregistercolor       % page sets the color right (side  +         \egroup}%                % effect)    +      \def\starttextcolor[##1]% +        {\bgroup +         \definecolor[\@@themaintextcolor][##1]% +         \let\stoptextcolor\relax\egroup}%  +      \startregistercolor[\@@themaintextcolor]% +      \definecolor[\@@themaintextcolor][#1]% +      \let\maintextcolor\@@themaintextcolor}} + +\def\initializemaintextcolor +  {\doifelsenothing\@@cltekstkleur +     {\let\maintextcolor\empty} +     {\let\maintextcolor\@@themaintextcolor +      \definecolor[\@@themaintextcolor][\@@cltekstkleur]% +      \doinitializemaintextcolor}} + +\def\doinitializemaintextcolor +  {\appendtoks\starttextcolor[\@@themaintextcolor]\to\everystarttext  +   \appendtoks\stoptextcolor                      \to\everystoptext +   \let\doinitializemaintextcolor\relax} +  % wrong names  \newif\ifpagechanged \let\lastchangedpage\empty @@ -124,102 +179,6 @@  %                     \global\divide#1 \!!ten\relax  %                     \global\multiply#1 #2#3#4\relax]} -\def\thinrule% -  {\strut -   \bgroup -   \chardef\ruletype=1 -   \processaction -     [\@@dlvariant] -     [ \v!a=>\chardef\ruletype=0,% no line -      %\v!b=>\chardef\ruletype=1,% height/depth -       \v!c=>\chardef\ruletype=2,% topheight/botdepth -      %  11=>\chardef\ruletype=1,% fallback for  backgrounds -          0=>\chardef\ruletype=0,% compatible with backgrounds -      %   1=>\chardef\ruletype=1,% compatible with backgrounds -          2=>\chardef\ruletype=2]% compatible with backgrounds -   \doifsomething{\@@dllijndikte} -     {\linewidth=\@@dllijndikte}% -   \ifdim\linewidth=\zeropoint -     \chardef\ruletype=0 -   \else -     \doifnot{\@@dlkader}{\v!aan}{\chardef\ruletype=0\relax}% -   \fi -   \ifnum\ruletype=1 -     \doif{\@@dlhoogte}{\v!max}{\def\@@dlhoogte{1}}% -     \doif{\@@dldiepte}{\v!max}{\def\@@dldiepte{1}}% -   \else -     \def\@@dlhoogte{1}% -     \def\@@dldiepte{1}% -   \fi -   \freezedimensionwithunit\@@dlhoogte{\ht\strutbox}% -   \freezedimensionwithunit\@@dldiepte{\dp\strutbox}% -   \divide\linewidth 2 -   \doifelse{\@@dlachtergrond}{\v!kleur} -     {\startcolor[\@@dlachtergrondkleur]% -      \dimen0=\@@dlhoogte -      \dimen2=\@@dldiepte -      \ifnum\ruletype=2 % prevent overshoot due to rounding -        \advance\dimen0 by -.5\linewidth -        \advance\dimen2 by -.5\linewidth -      \fi -      \leaders\hrule\!!height\dimen0\!!depth\dimen2\hfill -      \stopcolor -      \ifcase\ruletype -        % no rule -      \or -        \startcolor[\@@dlkleur]% -        \hfillneg -        \leaders\hrule\!!height\linewidth\!!depth\linewidth\hfill -        \stopcolor -      \or -        \startcolor[\@@dlkleur]% -        \dimen2=\@@dldiepte\dimen0=-\dimen2 \advance\dimen0 \linewidth -        \hfillneg\leaders\hrule\!!height\dimen0\!!depth\dimen2\hfill -        \dimen2=\@@dlhoogte\dimen0=-\dimen2 \advance\dimen0 \linewidth -        \hfillneg\leaders\hrule\!!height\dimen2\!!depth\dimen0\hfill -        \stopcolor -      \fi} -     {\ifcase\ruletype \else -        \startcolor[\@@dlkleur]% -        \leaders\hrule\!!height\@@dlhoogte\!!depth\@@dldiepte\hfill -        \stopcolor -      \fi}% -   \strut -   \carryoverpar\egroup} - -\setupthinrules -  [\c!kader=\v!aan, % compatible with textbackgrounds -   \c!variant=\v!b, -   \c!achtergrondkleur=, -   \c!achtergrond=, -   \c!lijndikte=] - -% \thinruled[n=3,alternative=a] -% \thinruled[n=3,alternative=b] -% \thinruled[n=3,alternative=c] -% \thinruled[n=3,alternative=a,background=color] -% \thinruled[n=3,alternative=b,background=color] -% \thinruled[n=3,alternative=c,background=color] - -\def\dothinrules[#1]% -  {\bgroup -   \dosetupthinrules[#1]% -   \@@dlvoor -   \assignvalue{\@@dlinterlinie}{\@@dlinterlinie}{1.0}{1.5}{2.0}% -   \spacing\@@dlinterlinie -   \dorecurse -     {\@@dln} -     {\ifnum\recurselevel=\@@dln \dothinrulesnobreak \else -      \ifnum\recurselevel=2      \dothinrulesnobreak \fi\fi -                                 \thinrule -     %\ifnum\recurselevel<\@@dln \endgraf \fi}% -      \ifnum\recurselevel<\@@dln \endgraf \geenwitruimte \@@dltussen \fi}% -%  \@@dlna -%  \egroup} -   \doifelsenothing{\@@dlna} -     {\carryoverpar\egroup} -     {\@@dlna\egroup}} -  \def\complexTableTB[#1]{\TABLEnoalign{\blanko[#1]}}  \def\simpleTableTB     {\TABLEnoalign{\blanko}} diff --git a/tex/context/base/cont-sys.tex b/tex/context/base/cont-sys.tex new file mode 100644 index 000000000..7eb75f86d --- /dev/null +++ b/tex/context/base/cont-sys.tex @@ -0,0 +1,123 @@ +%D \module +%D   [       file=cont-sys, +%D        version=1995.10.10, +%D          title=\CONTEXT\ Miscellaneous Macros, +%D       subtitle=System Specific Setups, +%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 + +% Here you can take care of overloading some (style)  +% defaults. What goes here, depends on your local system.  +% +% The following commands sets the default font encoding: +% +% \setupencoding [\s!default=ec]  +% +% You can let \CONTEXT\ load the map files for \PDFTEX.  +% +\autoloadmapfilestrue +% +% If you use the more verbose naming scheme, uncomment this:  +% +% \usetypescript [map] [default,\defaultencoding]  +% +% or :  +% +% \usetypescript [map] [all]  +% +% In case you have set psfonts.map already, you can comment  +% the following lines. Beware: pdftex uses the fontname  +% (second entry on map file lines) for (not so) clever  +% remapping, so in case of troubles, remove the names (is  +% safe)!    +% +% \preloadmapfile [original-ams-cmr] +% \preloadmapfile [original-ams-euler] +% \preloadmapfile [il2-ams-cmr] +% \preloadmapfile [pl0-ams-cmr] +% +% If you want the default berry names (ec and 8r only):  +% +% \usetypescript [berry] [\defaultencoding] +% +% Overload Lucida by Times cum suis: +% +% \definetypescriptsynonym [lbr] [pos]  +% +% Compensate for missing files: +% +% \definefontsynonym [gbhei]   [gbsong] +% \definefontsynonym [gbheisl] [gbsong] +% \definefontsynonym [gbheisl] [gbsong] +% +% The already loaded map file list can be reset with: +% +% \forgetmapfiles +% +% Setting up a global figure path:  +% +% \setupexternalfigures [\c!gebied={e:/fig/eps,t:/mine/figs}] +% +% Loading a specific special driver:  +% +% \setupoutput [dviwindo] +% +% Enabling \CONTEXT\ navigation symbols as well as \euro's.  + +\usesymbols [nav,mvs]   + +\setupsymbolset [navigation 1] % not that clever  + +\setupinteraction [\c!symboolset=navigation 1] + +% Changing language defaults:  +%  +% \setuplanguage +%   [nl] +%   [\c!leftquote=\upperleftsinglesixquote, +%    \c!leftquotation=\upperleftdoublesixquote] + +% Loading local preferences, for example +% +% \input prag-gen % company styles  +% \input prag-log % more company styles  +% +% Enabling run time \METAPOST\ (also enable \write18 in  +% texmf.cnf): + +\runMPgraphicstrue  +\runMPTEXgraphicstrue +\recycleMPslotstrue  + +% This saves some runtime, but needs a format, which you can +% make with 'texexec --make --alone metafun'. Make sure that  +% the mem files are moved to the used web2c path (locate with  +% 'kpsewhich plain.mem'). + +\useMETAFUNformattrue + +% Enabling nested pretty printing: + +\newprettytrue  + +% This can be a way to get things working on system with  +% name clashes. (Some \TeX's tend do search system wide.) + +\protectbufferstrue + +% You can enable a rigurous figure searching, but normally  +% this is not really needed and even annoying.  +% +% \runutilityfiletrue  + +% So far.  + +\protect \endinput + diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex index 356139e4e..cbf62363b 100644 --- a/tex/context/base/context.tex +++ b/tex/context/base/context.tex @@ -15,7 +15,7 @@  \catcode`\{=1 \catcode`\}=2  -\def\contextversion{2002.1.11} +\def\contextversion{2002.1.24}  %D Welcome to the main module. When this module is ran through  %D \type{initex} or \type{tex -i} or \type{whatevertex} using diff --git a/tex/context/base/core-des.tex b/tex/context/base/core-des.tex index 5e88257cf..1d4ef327a 100644 --- a/tex/context/base/core-des.tex +++ b/tex/context/base/core-des.tex @@ -420,7 +420,7 @@  %    \nummer[\getvalue{\??dd#1\??dd\c!nummer}]}  \def\showdnnummer#1% -  {\preparethenumber{\??dd#1}\voorafgaandenummer\preparednumber +  {%\preparethenumber{\??dd#1}\voorafgaandenummer\preparednumber     \preparednumber     \nummer[\getvalue{\??dd#1\??dd\c!nummer}]} @@ -473,6 +473,7 @@         \protectconversion        %\maakvoorafgaandenummer[#1]%         \maakvoorafgaandenummer[\getvalue{\??dd#1\??dd\c!nummer}]% +\preparethenumber{\??dd#1}\voorafgaandenummer\preparednumber         \ifcase\definitiekoppeling \or           \xdef\internaldoornummer{#3{#1}}%           \rawreference{\s!num}{#1:\internaldoornummer}{}% @@ -484,6 +485,7 @@       \fi      %\maakvoorafgaandenummer[#1]%       \maakvoorafgaandenummer[\getvalue{\??dd#1\??dd\c!nummer}]% +\preparethenumber{\??dd#1}\voorafgaandenummer\preparednumber       \hbox         {\let\normalkap\relax % sorry, uppercase causes troubles          \doattributes        % \nocase primitive needed diff --git a/tex/context/base/core-fig.tex b/tex/context/base/core-fig.tex index dd8e9772d..fa6db84d8 100644 --- a/tex/context/base/core-fig.tex +++ b/tex/context/base/core-fig.tex @@ -1242,13 +1242,14 @@     \egroup}  \def\externalfigurereplacement#1% -  {\localframed +  {\expanded{\localframed       [\??ef]       [\c!breedte=\figurewidth,        \c!hoogte=\figureheight,        \c!achtergrond=\v!raster,         \c!achtergrondraster=.5,  -      \c!kader=\ifincolor\v!uit\else\v!aan\fi] +     %\c!kader=\ifincolor\v!uit\else\v!aan\fi] +      \c!kader=\ifincolor\@@efkader\else\v!aan\fi]}%       {\ttx#1}}  \def\getexternalfigure#1% diff --git a/tex/context/base/core-rul.tex b/tex/context/base/core-rul.tex index 06642fe3f..d04f34c8d 100644 --- a/tex/context/base/core-rul.tex +++ b/tex/context/base/core-rul.tex @@ -1311,12 +1311,12 @@  %D On the next page we show some examples of how these macros  %D come into action. The examples show us how -%D \type{\v!passend}, \type{\v!ruim} dimensions influence the +%D \type {\v!passend}, \type {\v!ruim} dimensions influence the  %D formatting. Watch the visualized struts. \voetnoot {Here we -%D used \type{\toonstruts}.} +%D used \type {\toonstruts}.}  %D  %D \startuitstellen -%D \bgroup +%D \bgroup   %D \toonstruts  %D \mindermeldingen  %D \startregelcorrectie @@ -1474,7 +1474,7 @@  %D         \hsize=300pt  %D         \setupframed  %D           [\c!achtergrond=\v!kleur, -%D            \c!achtergrondkleur=DemoRed, +%D            \c!achtergrondkleur=donkerrood,  %D            \c!breedte=300pt,  %D            \c!hoogte=60pt,  %D            \c!kaderkleur=DemoBlue, @@ -1500,9 +1500,9 @@  %D     \egroup  %D \stopbuffer  %D -%D \haalbuffer +%D \haalbuffer \pagina   %D -%D {\setupframed[diepte=4pt]\haalbuffer} +%D {\setupframed[diepte=4pt]\haalbuffer} \pagina   %D  %D \protect  %D \egroup @@ -1633,32 +1633,32 @@  %D \steltypenin[marge=0pt]  %D \startregelcorrectie  %D \startbuffer -%D \omlijnd[offset=overlay,kader=aan]               {\DemoRed\blokje} +%D \omlijnd[offset=overlay,kader=aan]               {\donkerrood\blokje}  %D \stopbuffer  %D \hbox{\haalbuffer\vbox{\typebuffer}}  %D  %D \startbuffer -%D \omlijnd[offset=overlay,kader=aan,onderkader=uit]{\DemoRed\blokje} +%D \omlijnd[offset=overlay,kader=aan,onderkader=uit]{\donkerrood\blokje}  %D \stopbuffer  %D \hbox{\haalbuffer\vbox{\typebuffer}}  %D  %D \startbuffer -%D \omlijnd[offset=overlay,kader=aan,onderkader=aan]{\DemoRed\blokje} +%D \omlijnd[offset=overlay,kader=aan,onderkader=aan]{\donkerrood\blokje}  %D \stopbuffer  %D \hbox{\haalbuffer\vbox{\typebuffer}}  %D  %D \startbuffer -%D \omlijnd[offset=overlay,kader=uit]               {\DemoRed\blokje} +%D \omlijnd[offset=overlay,kader=uit]               {\donkerrood\blokje}  %D \stopbuffer  %D \hbox{\haalbuffer\vbox{\typebuffer}}  %D  %D \startbuffer -%D \omlijnd[offset=overlay,kader=uit,onderkader=uit]{\DemoRed\blokje} +%D \omlijnd[offset=overlay,kader=uit,onderkader=uit]{\donkerrood\blokje}  %D \stopbuffer  %D \hbox{\haalbuffer\vbox{\typebuffer}}  %D  %D \startbuffer -%D \omlijnd[offset=overlay,kader=uit,onderkader=aan]{\DemoRed\blokje} +%D \omlijnd[offset=overlay,kader=uit,onderkader=aan]{\donkerrood\blokje}  %D \stopbuffer  %D \hbox{\haalbuffer\vbox{\typebuffer}}  %D \stopregelcorrectie @@ -1977,33 +1977,96 @@  %      \hfill  %    \strut} +% \def\thinrule% +%   {\strut +%    \bgroup +%    \startcolor[\@@dlkleur]% +%    \doif{\@@dlhoogte}{\v!max}{\def\@@dlhoogte{1}}% +%    \doif{\@@dldiepte}{\v!max}{\def\@@dldiepte{1}}% +%    \freezedimensionwithunit\@@dlhoogte{\ht\strutbox}% +%    \freezedimensionwithunit\@@dldiepte{\dp\strutbox}% +%    \leaders +%      \hrule\!!height\@@dlhoogte\!!depth\@@dldiepte +%      \hfill +%    \stopcolor +%    \donefalse +%    \processaction +%      [\@@dlvariant] +%      [\v!a=>, +%       \v!b=>\dimen0=.5\linewidth\dimen2=\dimen0\donetrue, +%       \v!c=>\dimen2=\@@dldiepte\dimen0=-\dimen2\donetrue +%             \advance\dimen0\linewidth]% +%    \ifdone +%      \hfillneg +%      \leaders +%        \hrule\!!height\dimen0\!!depth\dimen2 +%        \hfill +%    \fi +%    \egroup +%    \strut} +  \def\thinrule%    {\strut     \bgroup -   \startcolor[\@@dlkleur]% -   \doif{\@@dlhoogte}{\v!max}{\def\@@dlhoogte{1}}% -   \doif{\@@dldiepte}{\v!max}{\def\@@dldiepte{1}}% -   \freezedimensionwithunit\@@dlhoogte{\ht\strutbox}% -   \freezedimensionwithunit\@@dldiepte{\dp\strutbox}% -   \leaders -     \hrule\!!height\@@dlhoogte\!!depth\@@dldiepte -     \hfill -   \stopcolor -   \donefalse +   \chardef\ruletype=1     \processaction       [\@@dlvariant] -     [\v!a=>, -      \v!b=>\dimen0=.5\linewidth\dimen2=\dimen0\donetrue, -      \v!c=>\dimen2=\@@dldiepte\dimen0=-\dimen2\donetrue -            \advance\dimen0\linewidth]% -   \ifdone -     \hfillneg -     \leaders -       \hrule\!!height\dimen0\!!depth\dimen2 -       \hfill +     [ \v!a=>\chardef\ruletype=0,% no line +      %\v!b=>\chardef\ruletype=1,% height/depth +       \v!c=>\chardef\ruletype=2,% topheight/botdepth +      %  11=>\chardef\ruletype=1,% fallback for  backgrounds +          0=>\chardef\ruletype=0,% compatible with backgrounds +      %   1=>\chardef\ruletype=1,% compatible with backgrounds +          2=>\chardef\ruletype=2]% compatible with backgrounds +   \doifsomething{\@@dllijndikte} +     {\linewidth=\@@dllijndikte}% +   \ifdim\linewidth=\zeropoint +     \chardef\ruletype=0 +   \else +     \doifnot{\@@dlkader}{\v!aan}{\chardef\ruletype=0\relax}%     \fi -   \egroup -   \strut} +   \ifnum\ruletype=1 +     \doif{\@@dlhoogte}{\v!max}{\def\@@dlhoogte{1}}% +     \doif{\@@dldiepte}{\v!max}{\def\@@dldiepte{1}}% +   \else +     \def\@@dlhoogte{1}% +     \def\@@dldiepte{1}% +   \fi +   \freezedimensionwithunit\@@dlhoogte{\ht\strutbox}% +   \freezedimensionwithunit\@@dldiepte{\dp\strutbox}% +   \divide\linewidth 2 +   \doifelse{\@@dlachtergrond}{\v!kleur} +     {\startcolor[\@@dlachtergrondkleur]% +      \dimen0=\@@dlhoogte +      \dimen2=\@@dldiepte +      \ifnum\ruletype=2 % prevent overshoot due to rounding +        \advance\dimen0 by -.5\linewidth +        \advance\dimen2 by -.5\linewidth +      \fi +      \leaders\hrule\!!height\dimen0\!!depth\dimen2\hfill +      \stopcolor +      \ifcase\ruletype +        % no rule +      \or +        \startcolor[\@@dlkleur]% +        \hfillneg +        \leaders\hrule\!!height\linewidth\!!depth\linewidth\hfill +        \stopcolor +      \or +        \startcolor[\@@dlkleur]% +        \dimen2=\@@dldiepte\dimen0=-\dimen2 \advance\dimen0 \linewidth +        \hfillneg\leaders\hrule\!!height\dimen0\!!depth\dimen2\hfill +        \dimen2=\@@dlhoogte\dimen0=-\dimen2 \advance\dimen0 \linewidth +        \hfillneg\leaders\hrule\!!height\dimen2\!!depth\dimen0\hfill +        \stopcolor +      \fi} +     {\ifcase\ruletype \else +        \startcolor[\@@dlkleur]% +        \leaders\hrule\!!height\@@dlhoogte\!!depth\@@dldiepte\hfill +        \stopcolor +      \fi}% +   \strut +   \carryoverpar\egroup}  \def\hairline%    {\endgraf @@ -2031,6 +2094,22 @@  %    \@@dlna  %    \egroup} +% \def\dothinrules[#1]% +%   {\bgroup +%    \dosetupthinrules[#1]% +%    \@@dlvoor +%    \assignvalue{\@@dlinterlinie}{\@@dlinterlinie}{1.0}{1.5}{2.0}% +%    \spacing\@@dlinterlinie +%    \dorecurse +%      {\@@dln} +%      {\ifnum\recurselevel=\@@dln \dothinrulesnobreak \else +%       \ifnum\recurselevel=2      \dothinrulesnobreak \fi\fi +%                                  \thinrule +%      %\ifnum\recurselevel<\@@dln \endgraf \fi}% +%       \ifnum\recurselevel<\@@dln \endgraf \geenwitruimte \@@dltussen \fi}% +%    \@@dlna +%    \egroup} +  \def\dothinrules[#1]%    {\bgroup     \dosetupthinrules[#1]% @@ -2044,8 +2123,11 @@                                   \thinrule       %\ifnum\recurselevel<\@@dln \endgraf \fi}%        \ifnum\recurselevel<\@@dln \endgraf \geenwitruimte \@@dltussen \fi}% -   \@@dlna -   \egroup} +%  \@@dlna +%  \egroup} +   \doifelsenothing{\@@dlna} +     {\carryoverpar\egroup} +     {\@@dlna\egroup}}  \def\thinrules%    {\dosingleempty\dothinrules} @@ -2068,6 +2150,48 @@  %D \stopbuffer  %D  %D \typebuffer {\haalbuffer} +%D  +%D There are a couple of alternative ways to visualize rules +%D using backgrounds. At first sight these may look strange, +%D but they make sense in educational settings. The +%D alternatives are more or less compatible with the more +%D advanced \METAPOST\ based implementation.  +%D  +%D \startbuffer[a] +%D \steldunnelijnenin +%D   [n=2, +%D    achtergrondkleur=grijs, +%D    lijndikte=1pt, +%D    kleur=donkerblauw,  +%D    na=\blanko, +%D    voor=\blanko]  +%D \stopbuffer +%D  +%D \typebuffer[a] +%D  +%D \startbuffer[b] +%D \dunnelijnen[variant=a]  +%D \dunnelijnen[variant=b]  +%D \dunnelijnen[variant=c]  +%D \stopbuffer +%D  +%D \typebuffer[b] \haalbuffer[a,b] +%D  +%D \startbuffer[b] +%D \dunnelijnen[variant=a,achtergrond=kleur] +%D \dunnelijnen[variant=b,achtergrond=kleur] +%D \dunnelijnen[variant=c,achtergrond=kleur] +%D \stopbuffer +%D  +%D \typebuffer[b] \haalbuffer[a,b] +%D  +%D \startbuffer[b] +%D \dunnelijnen[variant=a,hoogte=.8,diepte=.8,achtergrond=kleur]  +%D \dunnelijnen[variant=b,hoogte=.8,diepte=.8,achtergrond=kleur]  +%D \dunnelijnen[variant=c,hoogte=.8,diepte=.8,achtergrond=kleur]  +%D \stopbuffer +%D  +%D \typebuffer[b] \haalbuffer[a,b]  %D \macros  %D   {optimizethinrules} @@ -2874,7 +2998,11 @@     \c!kleur=,     \c!hoogte=.5\linewidth,     \c!diepte=.5\linewidth, -   \c!variant=\v!a] +   \c!kader=\v!aan, % compatible with textbackgrounds +   \c!variant=\v!b, +   \c!achtergrondkleur=, +   \c!achtergrond=, +   \c!lijndikte=]  \setuptextrules    [\c!plaats=\v!links, diff --git a/tex/context/base/core-sec.tex b/tex/context/base/core-sec.tex index d12c2ab02..e144f68db 100644 --- a/tex/context/base/core-sec.tex +++ b/tex/context/base/core-sec.tex @@ -1071,23 +1071,7 @@       \def\next{\dodododosomekop{#1}[#2]{\finalsectionnumber}{#3}}%     \fi     \next} - -% clearer  -\def\dodosomekop#1[#2]#3% [ref] {title} -  {\doifelsevalue{\??ko#1\c!eigennummer}{\v!ja} -     {\doquadruplegroupempty\dododosomekop{#1}[#2]{#3}} -    %{\fourthargumentfalse  \dododosomekop{#1}[#2]{#3}{}}} -     {\dodododosomekop{#1}[#2]{\finalsectionnumber}{#3}}} - -\def\dododosomekop#1[#2]#3#4% [ref] {own} {title} -  {\iffourthargument -     \def\next{\dodododosomekop{#1}[#2]{#3}{#4}}% -   \else % normal head or no own number given  -     \def\next{\dodododosomekop{#1}[#2]{\finalsectionnumber}{#3}}% -   \fi -   \next} -  % pas met \ExpandFirstAfter op bij twee||taligheid  \ifx\dohandleheadnumber\undefined diff --git a/tex/context/base/core-spa.tex b/tex/context/base/core-spa.tex index ad2bdc6b2..471fe1a17 100644 --- a/tex/context/base/core-spa.tex +++ b/tex/context/base/core-spa.tex @@ -454,14 +454,9 @@       \fi\fi     \fi} -\def\blanko % the \relax is definitely needed due to the many \if's +\unexpanded\def\blanko % the \relax is definitely needed due to the many \if's    {\relax\complexorsimple\doblanko} -\def\simpledoblanko % ...  -  {\doifelse\currentwitruimte\v!geen -     {\blanko[\currentblanko]} -     {\blanko[\s!default]}} -  \def\complexdoblanko    {\flushfootnotes     \ifopelkaar @@ -581,8 +576,8 @@  %D  %D But Berend de Boer wanted more control, so now we have:   -\def\simpledoblanko% -  {\doifelse{\currentwitruimte}{\v!geen} +\def\simpledoblanko % ...  +  {\doifelse\currentwitruimte\v!geen       {\blanko[\currentblanko]}       {\blanko[\s!default]}} @@ -594,9 +589,6 @@  %D   [\v!groot]  %D \stoptypen -\def\blanko% the \relax is definitely needed due to the many \if's -  {\relax\complexorsimple\doblanko} -  \def\dostelblankoin#1% amount are an plain inheritance    {\bigskipamount=#1\relax     \ifblankoflexibel \else  diff --git a/tex/context/base/core-ver.tex b/tex/context/base/core-ver.tex index 7833370b2..55eba3397 100644 --- a/tex/context/base/core-ver.tex +++ b/tex/context/base/core-ver.tex @@ -61,38 +61,6 @@  \def\prettyidentifier {TEX}  \def\prettypalet      {} -% \def\setupprettiesintype#1% -%   {\edef\prettyidentifier{#1}% -%    \doifinstringelse{\prettyidentifier}{tex,TEX} -%      {\def\prettyidentifier{TEX}} -%   {\doifinstringelse{\prettyidentifier}{perl,pl,pm,PERL,PL,PM} -%      {\def\prettyidentifier{PL}} -%   {\doifinstringelse{\prettyidentifier}{metapost,mp,metafont,mf,METAPOST,MP,METAFONT,MF} -%      {\def\prettyidentifier{MP}} -%   {\doifinstringelse{\prettyidentifier}{javascript,js,java,jv,JAVASCRIPT,JS,JAVA,JV} -%      {\def\prettyidentifier{JV}} -%   {\doifinstringelse{\prettyidentifier}{sql,SQL} -%      {\def\prettyidentifier{SQL}} -%   {\doifinstringelse{\prettyidentifier}{pascal,pas,PAS,modula,mod,MOD,delphi,DELPHI} -%      {\def\prettyidentifier{PAS}} -%   {\doifinstringelse{\prettyidentifier}{eiffel,e,E,EIFFEL} -%      {\def\prettyidentifier{EIF}} -%   {\doifinstringelse{\prettyidentifier}{xml,XML} -%      {\def\prettyidentifier{XML}} -%       {\def\prettyidentifier{TEX}}}}}}}}}% -%    \doifundefined{setuppretty\prettyidentifier type}% -%      {\bgroup -%       \setbox0=\hbox % get rid of spaces when in-line \newpretty loading -%         {\restorecatcodes % also needed when loading during \newpretty  -%          \startreadingfile % restore < and > if needed -%          \lowercasestring verb-\prettyidentifier.tex\to\filename -%          \readsysfile{\filename}{}{} -%          \stopreadingfile}% -%       \egroup}% -%    \doifdefinedelse{setuppretty\prettyidentifier type}% -%      {\def\setupprettytype{\getvalue{setuppretty\prettyidentifier type}}} -%      {\let\setupprettytype=\relax}} -  \def\installprettytype%    {\dodoubleargument\doinstallprettytype} @@ -116,9 +84,10 @@           \stopreadingfile}%        \egroup}%     \doifdefinedelse{setuppretty\prettyidentifier type}% -     {\def\setupprettytype{\getvalue{setuppretty\prettyidentifier type}}} -     {\let\setupprettytype=\relax}} - +     {\let\uncatcodecharacters\uncatcodeallcharacters % ugly, should be switch +      \def\setupprettytype{\getvalue{setuppretty\prettyidentifier type}}} +     {\let\setupprettytype\relax}} +    \installprettytype [RAW]        [RAW]  \installprettytype [TEX]        [TEX] diff --git a/tex/context/base/hand-ini.tex b/tex/context/base/hand-ini.tex index 74f3073b6..9a209bfe7 100644 --- a/tex/context/base/hand-ini.tex +++ b/tex/context/base/hand-ini.tex @@ -157,9 +157,9 @@      {\lpcode\prodfont#1\lpcode\prodfont#2\relax       \rpcode\prodfont#1\rpcode\prodfont#2\relax} -  \def\dodefinefonthandling[#1][#2][#3]% -    {\setvalue{\@fha@\@fha@#1}{#2}% -     \getparameters[\@fha@\@fha@#1][\c!links=1,\c!rechts=1,#3]} +%  \def\dodefinefonthandling[#1][#2][#3]% +%   {\setvalue{\@fha@\@fha@#1}{#2}% +%    \getparameters[\@fha@\@fha@#1][\c!links=1,\c!rechts=1,#3]}    \def\defineprotrudefactor#1 #2 #3 %      {\setfonttoks diff --git a/tex/context/base/m-newmat.tex b/tex/context/base/m-newmat.tex new file mode 100644 index 000000000..ce20e626b --- /dev/null +++ b/tex/context/base/m-newmat.tex @@ -0,0 +1,287 @@ +%D \module +%D   [       file=m-newmat, +%D        version=2000.11.16, +%D          title=\CONTEXT\ Math Module, +%D       subtitle=AMS-like math extensions, +%D         author={Taco Hoekwater \& Hans Hagen}, +%D           date=\currentdate, +%D      copyright={PRAGMA / Taco Hoekwater}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See licen-en.pdf for  +%C details.  + +%D This module collects macros that \TEX\ users kind of expect +%D to be available when typesetting math. Most of them +%D originate in the \AMS\ macro packages. We have taken the +%D freedom to adapt them to \CONTEXT. This module is derived +%D from the \type {m-math} module by Taco Hoekwater and +%D adapted|/|extended by Hans Hagen.  + +%D Here we will add code on demand. So, just let us know what +%D should go in here.  + +%M \usemodule[newmat] + +\unprotect  + +%D \macros  +%D   {qedsymbol} +%D  +%D [HH] The general Quod Erat Domonstrandum symbol is defined +%D in such a way that we can configure it. Because this symbol +%D is also used in text mode, we make it a normal text symbol +%D with special behavior.  + +\def\qedsymbol#1% +  {\ifhmode  +     \unskip~\hfill#1\par +   \else\ifmmode  +     \eqno#1\relax % Do we really need the \eqno here? +   \else +     \leavevmode\hbox{}\hfill#1\par +   \fi\fi} + +\definesymbol [qed] [\qedsymbol{\mathematics{\square}}]  + +%D \macros +%D   {QED} +%D  +%D [HH] For compatbility reasons we also provide the \type +%D {\QED} command. In case this command is overloaded, we still +%D have the symbol available. \symbol[qed]  + +\def\QED{\symbol[qed]} + +%D \macros +%D   {genfrac} +%D  +%D [TH] The definition of \type {\genfrac} \& co. is not +%D trivial, because it allows some flexibility. This is +%D supposed to be a user||level command, but will fail quite +%D desparately if called outside math mode (\CONTEXT\ redefines +%D \type {\over})  +%D  +%D [HH] We clean up this macro a bit and (try) to make it  +%D understandable. The expansion is needed for generating  +%D the second argument to \type {\dogenfrac}, which is to  +%D be a control sequence like \type {\over}.  + +\unexpanded\def\genfrac#1#2#3#4% +  {\def\!!stringa +     {#1#2}% +   \expanded +     {\dogenfrac{#4}%  +      \csname +        \ifx @#3@% +          \ifx\!!stringa\empty  +            \strippedcsname\normalover +          \else  +            \strippedcsname\normaloverwithdelims +          \fi +        \else  +          \ifx\!!stringa\empty  +            \strippedcsname\normalabove +          \else  +            \strippedcsname\normalabovewithdelims +          \fi +        \fi +      \endcsname}% +     {#1#2#3}} + +\def\dogenfrac#1#2#3#4#5% +  {{#1{\begingroup#4\endgroup#2#3\relax#5}}} + +%D \macros +%D   {dfrac, tfrac, frac, dbinom, tbinom, binom} +%D +%D [TH] No need to make these \type {\unexpanded} as well. + +\def\dfrac {\genfrac{}{}{}\displaystyle} +\def\tfrac {\genfrac{}{}{}\textstyle} +\def\frac  {\genfrac{}{}{}\donothing} + +\def\dbinom{\genfrac()\zeropoint\displaystyle} +\def\tbinom{\genfrac()\zeropoint\textstyle} +\def\binom {\genfrac()\zeropoint\donothing} + +%D [HH] This shows up as:  +%D +%D \startbuffer +%D $\dfrac {1}{2} \tfrac {1}{2} \frac {1}{2}$ +%D $\dbinom{1}{2} \tbinom{1}{2} \binom{1}{2}$ +%D \stopbuffer +%D  +%D \typebuffer +%D  +%D \getbuffer + +%D \macros +%D  {text} +%D  +%D [TH] \type {\text} is a command to typeset more or less +%D ordinary text inside of super- and sub|-|scripts. It has to +%D do a full font switch to get the sides right, so it will be +%D quite slow. \type {\text} kind of replaces \CONTEXT's \type +%D {\mathstyle} command.  + +\unexpanded\def\text +  {\ifmmode\@EA\dotext\else\@EA\hbox\fi} + +\def\dotext#1% +  {\mathchoice +     {\dodotext\displaystyle\textface        {#1}}% +     {\dodotext\textstyle   \textface        {#1}}% +     {\dodotext\textstyle   \scriptface      {#1}}% +     {\dodotext\textstyle   \scriptscriptface{#1}}} + +\def\dodotext#1#2#3% no \everymath ! + %{\hbox{\everymath{#1}\switchtobodyfont    [#2]#3}} % 15 sec + %{\hbox{\everymath{#1}\setcurrentfontbody  {#2}#3}} %  3 sec (no math) +  {\hbox{\everymath{#1}\fastswitchtobodyfont{#2}#3}} % 10 sec + +%D [HH] Actually, this switch is not that slow when typefaces  +%D are used. If needed this macro can be sped up.  +%D  +%D \startbuffer +%D ordinary text $x^{\text{extra ordinary text}}$ +%D \stopbuffer +%D +%D \typebuffer +%D  +%D \getbuffer + +%D \macros +%D  {mathhexbox} +%D  +%D [TH] \type {\mathhexbox} is also user||level (already +%D defined in Plain \TEX). It allows to get a math character +%D inserted as if it was a text character.  + +\gdef\mathhexbox#1#2#3{\text{$\m@th\mathchar"#1#2#3$}} + +%D \macros  +%D   {boxed} +%D +%D [HH] Another macro that users expect (slightly adapted):  + +\def\boxed% +  {\ifmmode\expandafter\mframed\else\expandafter\framed\fi} + +%D \macros  +%D   {cfrac} +%D +%D [HH] Now let us see what this one does: +%D +%D \startbuffer +%D $\cfrac{12}{3} \cfrac[l]{12}{3} \cfrac[c]{12}{3} \cfrac[r]{12}{3}$ +%D $\cfrac{1}{23} \cfrac[l]{1}{23} \cfrac[c]{1}{23} \cfrac[r]{1}{23}$ +%D \stopbuffer +%D  +%D \typebuffer  +%D  +%D \getbuffer + +\definecomplexorsimple\cfrac + +\def\simplecfrac +  {\complexcfrac[c]} + +\def\complexcfrac[#1]#2#3% +  {{\displaystyle +    \frac +      {\strut\ifx r#1\hfill\fi#2\ifx l#1\hfill\fi}% +      {#3}}% +    \kern-\nulldelimiterspace} + +%D [HH] The next alternative is nicer:  + +\def\simplecfrac     {\docfrac[cc]} +\def\complexcfrac[#1]{\docfrac[#1cc]} + +\def\docfrac[#1#2#3]#4#5% +  {{\displaystyle +    \frac +      {\strut +       \ifx r#1\hfill\fi#4\ifx l#1\hfill\fi}% +      {\ifx r#2\hfill\fi#5\ifx l#2\hfill\fi}% +    \kern-\nulldelimiterspace}} + +%D [HH] Now we can align every combination we want:  +%D +%D \startbuffer +%D $\cfrac{12}{3} \cfrac[l]{12}{3} \cfrac[c]{12}{3} \cfrac[r]{12}{3}$ +%D $\cfrac{1}{23} \cfrac[l]{1}{23} \cfrac[c]{1}{23} \cfrac[r]{1}{23}$ +%D $\cfrac[cl]{12}{3} \cfrac[cc]{12}{3} \cfrac[cr]{12}{3}$ +%D $\cfrac[lc]{1}{23} \cfrac[cc]{1}{23} \cfrac[rc]{1}{23}$ +%D \stopbuffer +%D  +%D \typebuffer  +%D  +%D \getbuffer + +%D \macros +%D   {fraktur, gothic, caligraphic} +%D +%D [TH] A redefinition that uses \type {\text} instead of  +%D \type {\hbox}, adding auto||scaling in super- and subscripts + +\def\fraktur    #1{\ifmmode\@EA\text\fi{{\frak#1}}} +\def\gothic     #1{\ifmmode\@EA\text\fi{{\goth#1}}} +\def\caligraphic#1{\ifmmode\@EA\text\fi{{\cal #1}}}  + +\protect \endinput  + +%D \macros +%D   {startsubarray,substack,startsmallmatrix} +%D +%D [HH] I wonder what these are supposed to do. An example  +%D will be inserted later. Contrary to the original we  +%D support an optional argument between either \type {{}} or  +%D \type {[]}. + +\def\startsubarray% +  {\doifnextcharelse\bgroup +     \simplestartsubarray{\dosingleempty\complexstartsubarray}} + +\def\complexstartsubarray[#1]% +  {\simplestartsubarray{#1}} + +\def\simplestartsubarray#1% +  {\vcenter\bgroup +   \baselineskip\fontdimen10 \scriptfont\tw@ +   \advance\baselineskip\fontdimen12 \scriptfont\tw@ +   \lineskip\thr@@\fontdimen8 \scriptfont\thr@@ +   \lineskiplimit\lineskip +   \ialign\bgroup\ifx c#1\hfil\fi$\m@th\scriptstyle##$\hfil\crcr} + +\def\stopsubarray% +  {\crcr\egroup +   \egroup} + +\def\startsubstack% +  {\doifnextcharelse\bgroup +     \simplestartsubstack{\dosingleempty\complexstartsubstack}} + +\def\complexstartsubstack[#1]% +  {\simplestartsubstack{#1}} + +\def\simplesubstack#1% +  {\startsubarray[c]#1\stopsubarray} + +\def\startsmallmatrix +  {\null +   \,% +   \vcenter\bgroup +   \baselineskip6\ex@  +   \lineskip1.5\ex@  +   \lineskiplimit\lineskip +   \ialign\bgroup\hfil$\m@th\scriptstyle##$\hfil&&\thickspace\hfil +     $\m@th\scriptstyle##$\hfil\crcr} + +\def\stopsmallmatrix +  {\crcr\egroup +   \egroup +   \,} + +\protect \endinput  diff --git a/tex/context/base/m-units.tex b/tex/context/base/m-units.tex index 8cd1d4794..f775ad7bc 100644 --- a/tex/context/base/m-units.tex +++ b/tex/context/base/m-units.tex @@ -183,7 +183,7 @@  \def\dodimension#1%    {\dontbreakdimension -   \ifdim\scratchdimen=\!!zeropoint\relax +   \ifdim\scratchdimen=\zeropoint\relax       \ifmmode         \dimensionhalfspace         \dimensionhalfspace @@ -199,20 +199,22 @@     \ifx\thedimensionpower\empty     \else\ifsmashdimensionpower       \setbox\scratchbox=\hbox{$\scriptstyle\thedimensionpower$}% -     \ht\scratchbox=\!!zeropoint +     \ht\scratchbox=\zeropoint       ^{\box\scratchbox}%     \else       ^{\thedimensionpower}%     \fi\fi     \stopmathmode -   \nobreak +   % otherwise nobreak before space in 2 \Milli \Meter\ blabla +   \doifnotmode{atpragma}{\nobreak}% this was always \nobreak    +   % only test this at pragma      \ifx\thedimensionpower\empty       \hskip\dimensionsignal     \else       \hskip\dimensionpowersignal     \fi -   \global\let\thedimensionprefix=\empty -   \global\let\thedimensionpower=\empty} +   \global\let\thedimensionprefix\empty +   \global\let\thedimensionpower\empty}  %D \macro  %D   {dontbreakdimension, diff --git a/tex/context/base/meta-pag.tex b/tex/context/base/meta-pag.tex index 90c8cc25b..ccc41a1cd 100644 --- a/tex/context/base/meta-pag.tex +++ b/tex/context/base/meta-pag.tex @@ -41,6 +41,7 @@      PrintPaperWidth     :=  \the\printpapierbreedte ;      TopSpace            :=  \the\kopwit ;      BackSpace           :=  \the\rugwit ; +    CutSpace            :=  \the\snijwit ;      MakeupHeight        :=  \the\zethoogte ;      MakeupWidth         :=  \the\zetbreedte ;      TopHeight           :=  \the\bovenhoogte ; diff --git a/tex/context/base/page-flt.tex b/tex/context/base/page-flt.tex index 2a43cc8a1..a768f972c 100644 --- a/tex/context/base/page-flt.tex +++ b/tex/context/base/page-flt.tex @@ -1243,7 +1243,7 @@  \newif\ifparfloat -\long\def\dosetfloatbox#1#2#3#4% +\long\def\dosetfloatbox#1#2#3#4% todo : \global\setbox    {\ifvisible       \par       \doifcommonelse @@ -1255,17 +1255,17 @@       \ifbinnenkolommen         \global\parfloatfalse       \fi -     \edef\@@kjkjbreedte  {\getvalue{\??kj#4\c!breedte}}% -     \def \@@kjkjtussen   {\getvalue{\??kj#4\c!tussen}}%  geen \edef -     \edef\@@kjkjplaats   {\getvalue{\??kj#4\c!plaats}}% +     \edef\@@kjkjbreedte  {\getvalue{\??kj#4\c!breedte  }}% +     \def \@@kjkjtussen   {\getvalue{\??kj#4\c!tussen   }}%  no \edef +     \edef\@@kjkjplaats   {\getvalue{\??kj#4\c!plaats   }}%       \edef\@@kjkjuitlijnen{\getvalue{\??kj#4\c!uitlijnen}}% -     \edef\@@flflplaats   {\getvalue{\??fl#4\c!plaats}}% +     \edef\@@flflplaats   {\getvalue{\??fl#4\c!plaats   }}%       \ifparfloat         \dosetparfloat{#1}{#2}{#3}{#4}%       \else         \dosetpagfloat{#1}{#2}{#3}{#4}%       \fi -     \setbox\floatbox=\hbox{\black\box\floatbox}% +     \setbox\floatbox=\hbox{\restoretextcolor{\box\floatbox}}%       \global\floatheight=\ht\floatbox       \global\advance\floatheight by \dp\floatbox       \global\floatwidth=\wd\floatbox diff --git a/tex/context/base/page-lay.tex b/tex/context/base/page-lay.tex index dd8b46690..e0b19cc8f 100644 --- a/tex/context/base/page-lay.tex +++ b/tex/context/base/page-lay.tex @@ -52,6 +52,7 @@  \newdimen\kopwit              \kopwit              = 2cm  \newdimen\rugwit              \rugwit              = \kopwit +\newdimen\snijwit             \snijwit             = 0pt  \newdimen\hoofdhoogte         \hoofdhoogte         = 2cm  \newdimen\voethoogte          \voethoogte          = \hoofdhoogte @@ -405,23 +406,20 @@     \fi     \simplestelwitruimtein     \simplestelblankoin -   \scratchdimen\layoutparameter\c!snijwit\relax -   \ifdim\scratchdimen=\zeropoint -     \scratchdimen\rugwit -   \fi +   \global\snijwit\layoutparameter\c!snijwit\relax     \doifelse{\layoutparameter\c!breedte}\v!midden -     {\global\zetbreedte\papierbreedte +     {\ifdim\snijwit=\zeropoint  +        \global\snijwit\rugwit  +      \fi  +      \global\zetbreedte\papierbreedte        \global\advance\zetbreedte -\rugwit -     %\scratchdimen\layoutparameter\c!snijwit\relax -     %\ifdim\scratchdimen=\zeropoint -     %  \scratchdimen\rugwit -     %\fi -      \global\advance\zetbreedte -\scratchdimen} +      \global\advance\zetbreedte -\snijwit}       {\doifelse{\layoutparameter\c!breedte}\v!passend -        {\global\zetbreedte\papierbreedte -        %\global\advance\zetbreedte -\rugwit -         \global\advance\zetbreedte -\scratchdimen -        % +        {\ifdim\snijwit=\zeropoint  +           \global\snijwit\rugwit  +         \fi  +         \global\zetbreedte\papierbreedte +         \global\advance\zetbreedte -\snijwit           \scratchdimen\rugwit           \advance\scratchdimen -\linkerrandbreedte           \advance\scratchdimen -\linkerrandafstand @@ -435,7 +433,14 @@           \global\advance\zetbreedte -\rechterrandafstand           \global\advance\zetbreedte -\rechterrandbreedte           \global\advance\zetbreedte -\scratchdimen} -        {\global\zetbreedte\layoutparameter\c!breedte}}% +        {\global\zetbreedte\layoutparameter\c!breedte +         \ifdim\snijwit=\zeropoint  +           \global\snijwit\papierbreedte +           \global\advance\snijwit-\zetbreedte +           \global\advance\snijwit-\rugwit +         \else  +           % inconsistent specification  +         \fi}}%     \scratchdimen\layoutparameter\c!bodemwit\relax     \ifdim\scratchdimen=\zeropoint       \scratchdimen\kopwit @@ -447,9 +452,7 @@           \global\advance\zethoogte -\scratchdimen}          {\doifelse{\layoutparameter\c!hoogte}\v!passend             {\global\zethoogte\papierhoogte -           %\global\advance\zethoogte -\kopwit              \global\advance\zethoogte -\scratchdimen -           %              \scratchdimen\kopwit              \advance\scratchdimen -\bovenhoogte              \advance\scratchdimen -\bovenafstand diff --git a/tex/context/base/page-mul.tex b/tex/context/base/page-mul.tex index eb01d4e67..b07f0358e 100644 --- a/tex/context/base/page-mul.tex +++ b/tex/context/base/page-mul.tex @@ -555,7 +555,7 @@     \setbox\columnpagebox=\hbox       {\box\columnpagebox        \hskip-\columntextwidth -      \color[black]{\box\scratchbox}}% +      \restoretextcolor{\box\scratchbox}}%     \postprocesscolumnpagebox % new, acts upon \box\columnpagebox     \ifvoid\precolumnbox \else       \ifgridsnapping % do you believe this junk? @@ -817,7 +817,7 @@       \global\setbox\lastcolumnbox=\vbox to \scratchdimen         {\box\lastcolumnbox          \vskip-\scratchdimen -        \color[black]{\box0}}% +        \restoretextcolor{\box0}}%       \egroup     \fi\fi} diff --git a/tex/context/base/page-num.tex b/tex/context/base/page-num.tex index b2eab250c..b14ffab1a 100644 --- a/tex/context/base/page-num.tex +++ b/tex/context/base/page-num.tex @@ -502,7 +502,7 @@    {\doif{\@@nmstatus\@@pnstatus}{\v!start\v!start}       {{\doif{\@@nmstrut}{\v!ja}{\strut}%         \@@nmcommando{\doattributes\??nm\c!letter\c!kleur -         {\volledigepaginanummer}}}}} +         {\completepagenumber}}}}}  \def\@@plaatspaginascheider% still used ?     {\doif{\@@nmstatus\@@pnstatus}{\v!start\v!start} @@ -525,7 +525,7 @@         \donexttracklevel{##1}}%      \donexttrackcommando{\firstsection}} -\unexpanded\def\volledigepaginanummer%   +\unexpanded\def\completepagenumber%      {\doif{\@@nmstatus\@@pnstatus}{\v!start\v!start}        {\@@nmlinks\labeltexts{\v!paginanummer}{\pageprefixes\pagenumber}\@@nmrechts}} diff --git a/tex/context/base/page-run.tex b/tex/context/base/page-run.tex index 469900b9f..a616f4a8e 100644 --- a/tex/context/base/page-run.tex +++ b/tex/context/base/page-run.tex @@ -196,6 +196,7 @@           \showsetupA{printpapierbreedte} \printpapierbreedte           \showsetupA{kopwit}             \kopwit           \showsetupA{rugwit}             \rugwit +         \showsetupA{snijwit}            \snijwit           \showsetupA{hoogte}             \zethoogte           \showsetupA{breedte}            \zetbreedte           \showsetupA{boven}              \bovenhoogte @@ -225,6 +226,8 @@  \stopinterface +% todo: \showsetupA{rugwit} \rugwit +  \startinterface german  \gdef\showsetups% diff --git a/tex/context/base/setupb.tex b/tex/context/base/setupb.tex index 7cf6de973..dc54da3c2 100644 --- a/tex/context/base/setupb.tex +++ b/tex/context/base/setupb.tex @@ -372,6 +372,10 @@      [\c!mp\c!cmyk]      [\v!ja,\v!nee]      [\v!ja] +  \variable +    [\c!tekstkleur] +    [\c!identifier!] +    []  \stopsetup  \startsetup @@ -1510,6 +1514,18 @@      [\c!lijndikte]      [\c!dimension!]      [] +  \variable +    [\c!kleur] +    [\c!identifier!] +    [] +  \variable +    [\c!achtergrond] +    [\v!kleur] +    [] +  \variable +    [\c!achtergrondkleur] +    [\c!identifier!] +    []  \stopsetup  \startsetup diff --git a/tex/context/base/syst-gen.tex b/tex/context/base/syst-gen.tex index 19381d91b..a2e80674a 100644 --- a/tex/context/base/syst-gen.tex +++ b/tex/context/base/syst-gen.tex @@ -2359,11 +2359,11 @@     \let#2\empty     \processcommalist[#1]\domakerawcommalist} -\def\rawprocesscommaitem#1,% +\def\rawprocesscommaitem#1,#2% #2 eats up preceding space     {\if]#1\else       \csname\s!next\the\commalevel\endcsname{#1}%       \expandafter\rawprocesscommaitem -   \fi} +   \fi#2}  \def\rawprocesscommalist[#1]#2% accepteert ook [\cs]     {\global\advance\commalevel \plusone @@ -2712,18 +2712,31 @@  \def\xdogetparameters#1]%    {\xprocesscommaitem#1,],\@relax@} +% \long\def\xprocesscommaitem#1,#2% #2 takes space before , +%   {\if]#1% +%      \expandafter\gobbleoneargument +%    \else +%      \p!dogetparameter\@relax@#1==\@relax@ +%      \expandafter\xprocesscommaitem +%    \fi#2} +  \long\def\xprocesscommaitem#1,#2% #2 takes space before , -  {\if]#1% -     \expandafter\gobbleoneargument +  {\if,#1,% dirty trick for testing #1=empty  +     \@EA\xprocesscommaitem +   \else\if]#1% +     \@EAEAEA\gobbleoneargument     \else -     \p!dogetparameter\@relax@#1==\@relax@ -     \expandafter\xprocesscommaitem -   \fi#2} +     \p!dogetparameter\@relax@#1==\empty\@relax@ +     \@EAEAEA\xprocesscommaitem +   \fi\fi#2}  %D Here we use a slightly different assignment macro: +% \def\p!doassign#1#2\@relax@#3=#4=#5\@relax@ +%   {\ifx\@relax@#5\@EA\xshowassignerror\else\@EA#1\fi{#2}{#3}{#4}} +  \def\p!doassign#1#2\@relax@#3=#4=#5\@relax@ -  {\ifx\@relax@#5\@EA\xshowassignerror\else\@EA#1\fi{#2}{#3}{#4}} +  {\ifx#5\empty\@EA\xshowassignerror\else\@EA#1\fi{#2}{#3}{#4}}  \def\xshowassignerror#1#2#3%    {\showassignerror{#2}{\the\inputlineno\space(#1)}} @@ -2731,9 +2744,13 @@  %D Now we also have to change the other macros that depend   %D on this low level one.  -\def\doassign  [#1][#2]{\p!doassign\dosetvalue  #1\@relax@#2==\@relax@} -\def\doeassign [#1][#2]{\p!doassign\dosetevalue #1\@relax@#2==\@relax@} -\def\undoassign[#1][#2]{\p!doassign\doresetvalue#1\@relax@#2==\@relax@} +% \def\doassign  [#1][#2]{\p!doassign\dosetvalue  #1\@relax@#2==\@relax@} +% \def\doeassign [#1][#2]{\p!doassign\dosetevalue #1\@relax@#2==\@relax@} +% \def\undoassign[#1][#2]{\p!doassign\doresetvalue#1\@relax@#2==\@relax@} + +\def\doassign  [#1][#2]{\p!doassign\dosetvalue  #1\@relax@#2==\empty\@relax@} +\def\doeassign [#1][#2]{\p!doassign\dosetevalue #1\@relax@#2==\empty\@relax@} +\def\undoassign[#1][#2]{\p!doassign\doresetvalue#1\@relax@#2==\empty\@relax@}  %D \macros  %D   {getemptyparameters} diff --git a/tex/context/base/type-buy.tex b/tex/context/base/type-buy.tex index ba16cee15..a7d98b056 100644 --- a/tex/context/base/type-buy.tex +++ b/tex/context/base/type-buy.tex @@ -33,7 +33,7 @@  % ITC Officina  \starttypescript [map] [ec,8r,texnansi] -  \loadmapfile [\typescriptencoding-itc-officina] +  \loadmapfile [\typefaceencoding-itc-officina]  \stoptypescript  \starttypescript [serif] [officina] [name] @@ -62,34 +62,34 @@  \starttypescript [serif] [officina] [texnansi,ec,8r] -  \definefontsynonym [OfficinaSerif-Book]       [\typescriptencoding-ovbk] [encoding=\typescriptencoding] -  \definefontsynonym [OfficinaSerif-BookItalic] [\typescriptencoding-ovwi] [encoding=\typescriptencoding] -  \definefontsynonym [OfficinaSerif-Bold]       [\typescriptencoding-ovb]  [encoding=\typescriptencoding] -  \definefontsynonym [OfficinaSerif-BoldItalic] [\typescriptencoding-ovbi] [encoding=\typescriptencoding] +  \definefontsynonym [OfficinaSerif-Book]       [\typefaceencoding-ovbk] [encoding=\typefaceencoding] +  \definefontsynonym [OfficinaSerif-BookItalic] [\typefaceencoding-ovwi] [encoding=\typefaceencoding] +  \definefontsynonym [OfficinaSerif-Bold]       [\typefaceencoding-ovb]  [encoding=\typefaceencoding] +  \definefontsynonym [OfficinaSerif-BoldItalic] [\typefaceencoding-ovbi] [encoding=\typefaceencoding] -  \definefontsynonym [OfficinaSerif-BookSlanted][\typescriptencoding-ovbk-slanted-167] [encoding=\typescriptencoding] -  \definefontsynonym [OfficinaSerif-BoldSlanted][\typescriptencoding-ovb-slanted-167] [encoding=\typescriptencoding] -  \definefontsynonym [OfficinaSerif-Caps]       [\typescriptencoding-ovbk-capitalized-800] [encoding=\typescriptencoding] +  \definefontsynonym [OfficinaSerif-BookSlanted][\typefaceencoding-ovbk-slanted-167] [encoding=\typefaceencoding] +  \definefontsynonym [OfficinaSerif-BoldSlanted][\typefaceencoding-ovb-slanted-167] [encoding=\typefaceencoding] +  \definefontsynonym [OfficinaSerif-Caps]       [\typefaceencoding-ovbk-capitalized-800] [encoding=\typefaceencoding]  \stoptypescript  \starttypescript [sans] [officina] [texnansi,ec,8r] -  \definefontsynonym [OfficinaSans-Book]       [\typescriptencoding-owbk] [encoding=\typescriptencoding] -  \definefontsynonym [OfficinaSans-BookItalic] [\typescriptencoding-owwi] [encoding=\typescriptencoding] -  \definefontsynonym [OfficinaSans-Bold]       [\typescriptencoding-owb]  [encoding=\typescriptencoding] -  \definefontsynonym [OfficinaSans-BoldItalic] [\typescriptencoding-owbi] [encoding=\typescriptencoding] +  \definefontsynonym [OfficinaSans-Book]       [\typefaceencoding-owbk] [encoding=\typefaceencoding] +  \definefontsynonym [OfficinaSans-BookItalic] [\typefaceencoding-owwi] [encoding=\typefaceencoding] +  \definefontsynonym [OfficinaSans-Bold]       [\typefaceencoding-owb]  [encoding=\typefaceencoding] +  \definefontsynonym [OfficinaSans-BoldItalic] [\typefaceencoding-owbi] [encoding=\typefaceencoding] -  \definefontsynonym [OfficinaSans-BookSlanted][\typescriptencoding-owbk-slanted-167] [encoding=\typescriptencoding] -  \definefontsynonym [OfficinaSans-BoldSlanted][\typescriptencoding-owb-slanted-167] [encoding=\typescriptencoding] -  \definefontsynonym [OfficinaSans-Caps]       [\typescriptencoding-owbk-capitalized-800] [encoding=\typescriptencoding] +  \definefontsynonym [OfficinaSans-BookSlanted][\typefaceencoding-owbk-slanted-167] [encoding=\typefaceencoding] +  \definefontsynonym [OfficinaSans-BoldSlanted][\typefaceencoding-owb-slanted-167] [encoding=\typefaceencoding] +  \definefontsynonym [OfficinaSans-Caps]       [\typefaceencoding-owbk-capitalized-800] [encoding=\typefaceencoding]  \stoptypescript  % FontFont Meta  \starttypescript [map] [ec,8r,texnansi] -  \loadmapfile [\typescriptencoding-ff-meta] +  \loadmapfile [\typefaceencoding-ff-meta]  \stoptypescript  \starttypescript [sans] [meta] [name] @@ -116,92 +116,137 @@  \starttypescript [sans] [meta,meta-book] [texnansi,ec,8r] -  \definefontsynonym [MetaBook-Roman]      [\typescriptencoding-mtbk]   [encoding=\typescriptencoding] -  \definefontsynonym [MetaBook-Italic]     [\typescriptencoding-mtbki]  [encoding=\typescriptencoding] -  \definefontsynonym [MetaBook-Caps]       [\typescriptencoding-mtbkc]  [encoding=\typescriptencoding] -  \definefontsynonym [MetaBook-ItalicCaps] [\typescriptencoding-mtbkic] [encoding=\typescriptencoding] +  \definefontsynonym [MetaBook-Roman]      [\typefaceencoding-mtbk]   [encoding=\typefaceencoding] +  \definefontsynonym [MetaBook-Italic]     [\typefaceencoding-mtbki]  [encoding=\typefaceencoding] +  \definefontsynonym [MetaBook-Caps]       [\typefaceencoding-mtbkc]  [encoding=\typefaceencoding] +  \definefontsynonym [MetaBook-ItalicCaps] [\typefaceencoding-mtbkic] [encoding=\typefaceencoding]  \stoptypescript  \starttypescript [sans] [meta-lf,meta-book-lf] [texnansi,ec,8r] -  \definefontsynonym [MetaBookLF-Roman]      [\typescriptencoding-mtbkf]   [encoding=\typescriptencoding] -  \definefontsynonym [MetaBookLF-Italic]     [\typescriptencoding-mtbkfi]  [encoding=\typescriptencoding] -  \definefontsynonym [MetaBookLF-Caps]       [\typescriptencoding-mtbkfc]  [encoding=\typescriptencoding] -  \definefontsynonym [MetaBookLF-ItalicCaps] [\typescriptencoding-mtbkfic] [encoding=\typescriptencoding] +  \definefontsynonym [MetaBookLF-Roman]      [\typefaceencoding-mtbkf]   [encoding=\typefaceencoding] +  \definefontsynonym [MetaBookLF-Italic]     [\typefaceencoding-mtbkfi]  [encoding=\typefaceencoding] +  \definefontsynonym [MetaBookLF-Caps]       [\typefaceencoding-mtbkfc]  [encoding=\typefaceencoding] +  \definefontsynonym [MetaBookLF-ItalicCaps] [\typefaceencoding-mtbkfic] [encoding=\typefaceencoding]  \stoptypescript  \starttypescript [sans] [meta,meta-bold] [texnansi,ec,8r] -  \definefontsynonym [MetaBold-Roman]      [\typescriptencoding-mtbd]   [encoding=\typescriptencoding] -  \definefontsynonym [MetaBold-Italic]     [\typescriptencoding-mtbdi]  [encoding=\typescriptencoding] -  \definefontsynonym [MetaBold-Caps]       [\typescriptencoding-mtbdc]  [encoding=\typescriptencoding] -  \definefontsynonym [MetaBold-ItalicCaps] [\typescriptencoding-mtbdic] [encoding=\typescriptencoding] +  \definefontsynonym [MetaBold-Roman]      [\typefaceencoding-mtbd]   [encoding=\typefaceencoding] +  \definefontsynonym [MetaBold-Italic]     [\typefaceencoding-mtbdi]  [encoding=\typefaceencoding] +  \definefontsynonym [MetaBold-Caps]       [\typefaceencoding-mtbdc]  [encoding=\typefaceencoding] +  \definefontsynonym [MetaBold-ItalicCaps] [\typefaceencoding-mtbdic] [encoding=\typefaceencoding]  \stoptypescript  \starttypescript [sans] [meta-lf,meta-bold-lf] [texnansi,ec,8r] -  \definefontsynonym [MetaBoldLF-Roman]      [\typescriptencoding-mtbdf]   [encoding=\typescriptencoding] -  \definefontsynonym [MetaBoldLF-Italic]     [\typescriptencoding-mtbdfi]  [encoding=\typescriptencoding] -  \definefontsynonym [MetaBoldLF-Caps]       [\typescriptencoding-mtbdfc]  [encoding=\typescriptencoding] -  \definefontsynonym [MetaBoldLF-ItalicCaps] [\typescriptencoding-mtbdfic] [encoding=\typescriptencoding] +  \definefontsynonym [MetaBoldLF-Roman]      [\typefaceencoding-mtbdf]   [encoding=\typefaceencoding] +  \definefontsynonym [MetaBoldLF-Italic]     [\typefaceencoding-mtbdfi]  [encoding=\typefaceencoding] +  \definefontsynonym [MetaBoldLF-Caps]       [\typefaceencoding-mtbdfc]  [encoding=\typefaceencoding] +  \definefontsynonym [MetaBoldLF-ItalicCaps] [\typefaceencoding-mtbdfic] [encoding=\typefaceencoding]  \stoptypescript  \starttypescript [sans] [meta-normal] [texnansi,ec,8r] -  \definefontsynonym [MetaNormal-Roman]      [\typescriptencoding-mtn]   [encoding=\typescriptencoding] -  \definefontsynonym [MetaNormal-Italic]     [\typescriptencoding-mtni]  [encoding=\typescriptencoding] -  \definefontsynonym [MetaNormal-Caps]       [\typescriptencoding-mtnc]  [encoding=\typescriptencoding] -  \definefontsynonym [MetaNormal-ItalicCaps] [\typescriptencoding-mtnic] [encoding=\typescriptencoding] +  \definefontsynonym [MetaNormal-Roman]      [\typefaceencoding-mtn]   [encoding=\typefaceencoding] +  \definefontsynonym [MetaNormal-Italic]     [\typefaceencoding-mtni]  [encoding=\typefaceencoding] +  \definefontsynonym [MetaNormal-Caps]       [\typefaceencoding-mtnc]  [encoding=\typefaceencoding] +  \definefontsynonym [MetaNormal-ItalicCaps] [\typefaceencoding-mtnic] [encoding=\typefaceencoding]  \stoptypescript  \starttypescript [sans] [meta-normal-lf] [texnansi,ec,8r] -  \definefontsynonym [MetaNormalLF-Roman]      [\typescriptencoding-mtnf]   [encoding=\typescriptencoding] -  \definefontsynonym [MetaNormalLF-Italic]     [\typescriptencoding-mtnfi]  [encoding=\typescriptencoding] -  \definefontsynonym [MetaNormalLF-Caps]       [\typescriptencoding-mtnfc]  [encoding=\typescriptencoding] -  \definefontsynonym [MetaNormalLF-ItalicCaps] [\typescriptencoding-mtnfic] [encoding=\typescriptencoding] +  \definefontsynonym [MetaNormalLF-Roman]      [\typefaceencoding-mtnf]   [encoding=\typefaceencoding] +  \definefontsynonym [MetaNormalLF-Italic]     [\typefaceencoding-mtnfi]  [encoding=\typefaceencoding] +  \definefontsynonym [MetaNormalLF-Caps]       [\typefaceencoding-mtnfc]  [encoding=\typefaceencoding] +  \definefontsynonym [MetaNormalLF-ItalicCaps] [\typefaceencoding-mtnfic] [encoding=\typefaceencoding]  \stoptypescript  \starttypescript [sans] [meta-medium] [texnansi,ec,8r] -  \definefontsynonym [MetaMedium-Roman]      [\typescriptencoding-mtm]   [encoding=\typescriptencoding] -  \definefontsynonym [MetaMedium-Italic]     [\typescriptencoding-mtmi]  [encoding=\typescriptencoding] -  \definefontsynonym [MetaMedium-Caps]       [\typescriptencoding-mtmc]  [encoding=\typescriptencoding] -  \definefontsynonym [MetaMedium-ItalicCaps] [\typescriptencoding-mtmic] [encoding=\typescriptencoding] +  \definefontsynonym [MetaMedium-Roman]      [\typefaceencoding-mtm]   [encoding=\typefaceencoding] +  \definefontsynonym [MetaMedium-Italic]     [\typefaceencoding-mtmi]  [encoding=\typefaceencoding] +  \definefontsynonym [MetaMedium-Caps]       [\typefaceencoding-mtmc]  [encoding=\typefaceencoding] +  \definefontsynonym [MetaMedium-ItalicCaps] [\typefaceencoding-mtmic] [encoding=\typefaceencoding]  \stoptypescript  \starttypescript [sans] [meta-medium-lf] [texnansi,ec,8r] -  \definefontsynonym [MetaMediumLF-Roman]      [\typescriptencoding-mtmf]   [encoding=\typescriptencoding] -  \definefontsynonym [MetaMediumLF-Italic]     [\typescriptencoding-mtmfi]  [encoding=\typescriptencoding] -  \definefontsynonym [MetaMediumLF-Caps]       [\typescriptencoding-mtmfc]  [encoding=\typescriptencoding] -  \definefontsynonym [MetaMediumLF-ItalicCaps] [\typescriptencoding-mtmfic] [encoding=\typescriptencoding] +  \definefontsynonym [MetaMediumLF-Roman]      [\typefaceencoding-mtmf]   [encoding=\typefaceencoding] +  \definefontsynonym [MetaMediumLF-Italic]     [\typefaceencoding-mtmfi]  [encoding=\typefaceencoding] +  \definefontsynonym [MetaMediumLF-Caps]       [\typefaceencoding-mtmfc]  [encoding=\typefaceencoding] +  \definefontsynonym [MetaMediumLF-ItalicCaps] [\typefaceencoding-mtmfic] [encoding=\typefaceencoding]  \stoptypescript -  \starttypescript [sans] [meta-black] [texnansi,ec,8r] -  \definefontsynonym [MetaBlack-Roman]      [\typescriptencoding-mtbl]   [encoding=\typescriptencoding] -  \definefontsynonym [MetaBlack-Italic]     [\typescriptencoding-mtbli]  [encoding=\typescriptencoding] -  \definefontsynonym [MetaBlack-Caps]       [\typescriptencoding-mtblc]  [encoding=\typescriptencoding] -  \definefontsynonym [MetaBlack-ItalicCaps] [\typescriptencoding-mtblic] [encoding=\typescriptencoding] +  \definefontsynonym [MetaBlack-Roman]      [\typefaceencoding-mtbl]   [encoding=\typefaceencoding] +  \definefontsynonym [MetaBlack-Italic]     [\typefaceencoding-mtbli]  [encoding=\typefaceencoding] +  \definefontsynonym [MetaBlack-Caps]       [\typefaceencoding-mtblc]  [encoding=\typefaceencoding] +  \definefontsynonym [MetaBlack-ItalicCaps] [\typefaceencoding-mtblic] [encoding=\typefaceencoding]  \stoptypescript  \starttypescript [sans] [meta-black-lf] [texnansi,ec,8r] -  \definefontsynonym [MetaBlackLF-Roman]      [\typescriptencoding-mtblf]   [encoding=\typescriptencoding] -  \definefontsynonym [MetaBlackLF-Italic]     [\typescriptencoding-mtblfi]  [encoding=\typescriptencoding] -  \definefontsynonym [MetaBlackLF-Caps]       [\typescriptencoding-mtblfc]  [encoding=\typescriptencoding] -  \definefontsynonym [MetaBlackLF-ItalicCaps] [\typescriptencoding-mtblfic] [encoding=\typescriptencoding] +  \definefontsynonym [MetaBlackLF-Roman]      [\typefaceencoding-mtblf]   [encoding=\typefaceencoding] +  \definefontsynonym [MetaBlackLF-Italic]     [\typefaceencoding-mtblfi]  [encoding=\typefaceencoding] +  \definefontsynonym [MetaBlackLF-Caps]       [\typefaceencoding-mtblfc]  [encoding=\typefaceencoding] +  \definefontsynonym [MetaBlackLF-ItalicCaps] [\typefaceencoding-mtblfic] [encoding=\typefaceencoding] + +\stoptypescript + +%D Linotype Univers  + +\starttypescript [map] [texnansi] +  \loadmapfile[texnansi-linotype-univers.map] +\stoptypescript + +\starttypescript [sans] [univers,univers-light,univers-black] [name] + +  \definefontsynonym [Sans]            [Univers] +  \definefontsynonym [SansBold]        [Univers-Bold] +  \definefontsynonym [SansSlanted]     [Univers-Oblique] +  \definefontsynonym [SansBoldSlanted] [Univers-BoldOblique] + +\stoptypescript + +\starttypescript [sans] [univers-light] [name] + +  \definefontsynonym [Sans]            [Univers-Light] +  \definefontsynonym [SansSlanted]     [Univers-LightOblique] + +\stoptypescript + +\starttypescript [sans] [univers-black] [name] + +  \definefontsynonym [Sans]            [Univers-Black] +  \definefontsynonym [SansSlanted]     [Univers-BlackOblique] +  \definefontsynonym [SansBold]        [Univers-Black] +  \definefontsynonym [SansBoldSlanted] [Univers-BlackOblique] + +\stoptypescript + +\starttypescript [sans] [univers,univers-black,univers-light] [texnansi,ec,8r] + +  \definefontsynonym [Univers]              [\typefaceencoding-LT50138] [encoding=\typefaceencoding] +  \definefontsynonym [Univers-Bold]         [\typefaceencoding-LT50140] [encoding=\typefaceencoding] +  \definefontsynonym [Univers-Oblique]      [\typefaceencoding-LT50139] [encoding=\typefaceencoding] +  \definefontsynonym [Univers-BoldOblique]  [\typefaceencoding-LT50141] [encoding=\typefaceencoding] + +  \definefontsynonym [Univers-Light]        [\typefaceencoding-LT50136] [encoding=\typefaceencoding] +  \definefontsynonym [Univers-LightOblique] [\typefaceencoding-LT50137] [encoding=\typefaceencoding] + +  \definefontsynonym [Univers-Black]        [\typefaceencoding-LT50142] [encoding=\typefaceencoding] +  \definefontsynonym [Univers-BlackOblique] [\typefaceencoding-LT50143] [encoding=\typefaceencoding]  \stoptypescript diff --git a/tex/context/base/verb-ini.tex b/tex/context/base/verb-ini.tex index f1ec48b90..29ad0ecde 100644 --- a/tex/context/base/verb-ini.tex +++ b/tex/context/base/verb-ini.tex @@ -12,7 +12,8 @@  %C details.   %D Today I would implement the pretty handler slightly  -%D different, using stack and intermediate flushing.  +%D different, using stack and intermediate flushing. Maybe  +%D even without active chars.    %D Because this module is quite independant of system macros,  %D it can be used as a stand||alone verbatim environment. @@ -491,7 +492,7 @@  %D it assigns all characters \CATCODE~11. Next we switch to  %D french spacing and call for obeyance. -\def\setupcopyverbatim% +\def\setupcopyverbatim    {\uncatcodecharacters     \frenchspacing     \obeyspaces @@ -526,14 +527,14 @@     \let\savecatcode\relax     \let\restorecatcodes\dorestorecatcodes} -\def\uncatcodespecials% +\def\uncatcodespecials    {\doprocesscatcodes       {\ifnum\catcode\scratchcounter=\@@letter\relax\else          \catcode\scratchcounter=\@@other        \fi}%     \uncatcodespacetokens} -\def\uncatcodespacetokens% +\def\uncatcodespacetokens    {\catcode`\   =\@@space     \catcode`\^^L=\@@ignore     \catcode`\^^M=\@@endofline @@ -542,17 +543,17 @@  \def\setcatcodes#1%    {\doprocesscatcodes{\catcode\scratchcounter=#1}} -% \def\uncatcodecharacters% -%   {\setcatcodes\@@letter} +\def\uncatcodeallcharacters % slow one, with restore  +  {\setcatcodes\@@letter} -\def\uncatcodecharacters% +\def\uncatcodecharacters % quick one     {\setnaturalcatcodes}  \newtoks\everycommoncatcodes  \newtoks\everynaturalcatcodes  \newtoks\everynormalcatcodes -\def\setcommoncatcodes% +\def\setcommoncatcodes    {\catcode`\!\@@other \catcode`\?\@@other \catcode`\@\@@other     \catcode`\=\@@other \catcode`\<\@@other \catcode`\>\@@other     \catcode`\*\@@other \catcode`\/\@@other  @@ -563,7 +564,7 @@     \catcode`\(\@@other \catcode`\)\@@other     \the\everycommoncatcodes} -\def\setnaturalcatcodes% see elsewhere, merge 'm  +\def\setnaturalcatcodes % see elsewhere, merge 'm     {\setcommoncatcodes     \uncatcodespacetokens     \catcode`\#\@@other  @@ -649,7 +650,7 @@  \let\restorecatcodes=\relax -%D or when we've saves things calls for: +%D or when we've saved things calls for:  \def\dorestorecatcodes%    {\iflocalcatcodes \else @@ -845,21 +846,34 @@  \chardef\spacespertab=7 -\def\doprocesstabskip% +%\def\doprocesstabskip% +%  {\obeyedspace % \hskip.5em  or  \hbox to .5em{} +%   \ifdone +%     \advance\scratchcounter 1 +%     \let\next\doprocesstabskip +%     \donefalse +%   \else\ifnum\scratchcounter>\spacespertab +%     \let\next\relax +%   \else +%     \advance\scratchcounter 1 +%     \let\next\doprocesstabskip +%   \fi\fi +%   \next} + +\def\doprocesstabskip    {\obeyedspace % \hskip.5em  or  \hbox to .5em{}     \ifdone -     \advance\scratchcounter by 1 -     \let\next=\doprocesstabskip       \donefalse +     \advance\scratchcounter 1 +     \@EA\doprocesstabskip     \else\ifnum\scratchcounter>\spacespertab -     \let\next=\relax +     % nothing      \else       \advance\scratchcounter 1 -     \let\next=\doprocesstabskip -   \fi\fi -   \next} +     \@EAEAEA\doprocesstabskip +   \fi\fi} -\def\dodoprocesstabskipline#1#2\endoftabskipping% +\def\dodoprocesstabskipline#1#2\endoftabskipping    {\ifnum\scratchcounter>\spacespertab       \scratchcounter=1       \donetrue @@ -868,7 +882,7 @@       \donefalse     \fi     \ifx#1\relax -     \let\next=\relax +     \let\next\relax     \else       \def\next{#1\dodoprocesstabskipline#2\endoftabskipping}%     \fi @@ -1025,15 +1039,15 @@  %D character code (a number) and the interpretation number. The  %D three step implementation uses the \TEX book \type{~} trick. -\def\dodosetpretty% +\def\dodosetpretty    {\!!countb=\uccode`~\relax     \catcode\!!countb=\@@active     \uppercase{\edef~{\noexpand\handleprettytoken{\the\!!counta}{\the\!!countb}}}} -\def\dosetpretty% +\def\dosetpretty    {\afterassignment\dodosetpretty\!!counta} -\def\setpretty% +\def\setpretty    {\afterassignment\dosetpretty\uccode`~=}  %D The macro \type{\handleprettytoken} is rather trivial and @@ -1069,13 +1083,15 @@  %D \type{\prettytype} to the interpreter code. The character  %D code is saved in \type{\prettychar}. +\def\setprettydata#1#2% +  {\global\chardef\prettytype#1% +   \global\chardef\prettychar#2\relax} +  \def\getprettydata#1% -  {\bgroup -   \global\chardef\prettytype=0 -   \global\chardef\prettychar=0 -   \def\handleprettytoken##1##2% -     {\global\chardef\prettytype=##1\relax -      \global\chardef\prettychar=##2\relax}% +  {\global\chardef\prettytype0 +   \global\chardef\prettychar0 +   \bgroup +   \let\handleprettytoken\setprettydata     \setbox0=\hbox{#1}% expands #1 and ignores space     \egroup} @@ -1234,10 +1250,10 @@  \beginETEX \scantokens -%\def\naturaltextext#1#2\relax% +%\def\naturaltextext#1#2\relax  %  {\bgroup\prettynaturalfont{\restorecatcodes\scantokens{\ignorespaces#2}}\egroup} -\def\naturaltextext#1\relax% +\def\naturaltextext#1\relax    {\bgroup     \prettynaturalfont{\restorecatcodes\scantokens{\ignorespaces#1}}%     \egroup} @@ -1246,10 +1262,7 @@  \beginTEX -%\def\naturaltextext#1% -%  {\disableprettynow} - -\def\naturaltextext% +\def\naturaltextext    {\disableprettynow}  \endTEX @@ -1276,7 +1289,7 @@  \def\newpretty#1%    {\getprettydata{#1}% -   \ifnum\prettytype=0 +   \ifcase\prettytype       \expandafter\nonewpretty     \else       \expandafter\donewpretty @@ -1292,7 +1305,7 @@     \def\handleprettytoken##1##2##3%       {\getprettydata{##3}%        \egroup -      \ifnum\prettytype>0 +      \ifcase\prettytype\else          \setpretty##2=\prettytype\relax        \fi}%     #1} @@ -1375,11 +1388,11 @@  %D their meanings and to enable nesting we permit this only  %D once. -\def\saveprettycontrols% -  {\global\let\oldobeyedspace = \obeyedspace -   \global\let\oldobeyedline  = \obeyedline -   \global\let\oldobeyedpage  = \obeyedpage -   \let\saveprettycontrols    = \relax} +\def\saveprettycontrols +  {\global\let\oldobeyedspace \obeyedspace +   \global\let\oldobeyedline  \obeyedline +   \global\let\oldobeyedpage  \obeyedpage +   \let\saveprettycontrols    \relax}  %D The \PERL\ and \METAPOST\ interpreters will also handle  %D reserved words. Sets of identifiers are defined like: @@ -1400,7 +1413,7 @@     \def\handleprettytoken##1##2{\char##2}%     #2\relax     \def\douseprettyidentifiers##1\par% -     {\xdef#1{\space#1\space ##1}% +     {\xdef#1{\space#1\space##1}%        \egroup}%     \douseprettyidentifiers} @@ -1443,13 +1456,13 @@  %D  %D Although for pretty printing \PERL\ and \JAVASCRIPT\ code  %D one has to implement a bit more clever mechanism, the next -%D switches can be used to turn off prety printing. The  +%D switches can be used to turn off pretty printing. The   %D boolean turns on this feature.   \newif\ifdisablepretty  \disableprettyfalse  \newif\ifprettydisabled \prettydisabledfalse -\def\disableprettynow% +\def\disableprettynow    {\ifdisablepretty\ifprettydisabled\else        \let\prettyidentifierfont\relax       \let\prettyvariablefont\relax @@ -1459,12 +1472,12 @@       \prettydisabledtrue     \fi\fi} -\def\disableprettyafterwards% +\def\disableprettyafterwards    {\ifdisablepretty\ifprettydisabled\else       \def\endofpretty{\normalendofpretty\disableprettynow}%     \fi\fi} -\def\enableprettynow% +\def\enableprettynow    {\prettydisabledfalse     \let\prettyidentifierfont\normalprettyidentifierfont     \let\prettyvariablefont  \normalprettyvariablefont   @@ -1475,7 +1488,7 @@  %D This feature is hooked into the verbatim line handling   %D routine with: -\def\beginverbatimline% +\def\beginverbatimline    {\prettydisabledfalse     \ifnewpretty\else\let\handlenewpretty\empty\fi % moved      \let\normalprettyidentifierfont\prettyidentifierfont @@ -1484,7 +1497,7 @@     \let\normalbeginofpretty       \beginofpretty     \let\normalendofpretty         \endofpretty} -\def\endverbatimline% +\def\endverbatimline    {\enableprettynow}  %D The rest of this module is dedicated to non \CONTEXT\ users @@ -1525,30 +1538,24 @@  \ifCONTEXT \else  -  \def\presettyping% -    {\ifcontrolspace -       \let\obeyspace=\setcontrolspace -     \fi -     \ifverbatimtabs -       \let\obeytabs=\settabskips -     \fi -     \ifprettyverbatim -       \let\obeycharacters=\setupprettytype -     \fi} +  \def\presettyping +    {\ifcontrolspace   \let\obeyspace     \setcontrolspace \fi +     \ifverbatimtabs   \let\obeytabs      \settabskips     \fi +     \ifprettyverbatim \let\obeycharacters\setupprettytype \fi} -  \def\type% +  \def\type      {\bgroup       \def\_{\string_}%       \def\^{\string^}%       \presettyping       \processinlineverbatim{\egroup}} -  \def\starttyping% +  \def\starttyping      {\bgroup       \presettyping       \processdisplayverbatim{\stoptyping}} -  \def\stoptyping% +  \def\stoptyping      {\egroup}    \def\typefile#1% @@ -1586,27 +1593,27 @@    \input verb-jv    \input verb-sql -  \def\startTEX% +  \def\startTEX      {\bgroup \everypar{}%       \let\obeycharacters=\setupprettyTEXtype       \processdisplayverbatim{\stopTEX}} -  \def\startMP% +  \def\startMP      {\bgroup \everypar{}%       \let\obeycharacters=\setupprettyMPtype       \processdisplayverbatim{\stopMP}} -  \def\startPL% +  \def\startPL      {\bgroup \everypar{}%       \let\obeycharacters=\setupprettyPLtype       \processdisplayverbatim{\stopPL}} -  \def\startJV% +  \def\startJV      {\bgroup \everypar{}%       \let\obeycharacters=\setupprettyJVtype       \processdisplayverbatim{\stopJV}} -  \def\startSQL% +  \def\startSQL      {\bgroup \everypar{}%       \let\obeycharacters=\setupprettySQLtype       \processdisplayverbatim{\stopSQL}} @@ -1626,7 +1633,7 @@  \ifCONTEXT \else -  \def\setcolorverbatim% +  \def\setcolorverbatim      {\def\prettyone   {.9 .0 .0 }       % red       \def\prettytwo   {.0 .8 .0 }       % green       \def\prettythree {.0 .0 .9 }       % blue @@ -1636,7 +1643,7 @@       \def\endofpretty%         {\special{ps:: 0 0 0 setrgbcolor}}} % black -  \def\setgrayverbatim% +  \def\setgrayverbatim      {\def\prettyone   {.30 }            % gray       \def\prettytwo   {.45 }            % gray       \def\prettythree {.60 }            % gray @@ -1919,6 +1926,4 @@  \fi -\protect - -\endinput +\protect \endinput  | 
