From aebfda3e4d62174d4102d4252e843e17943fa1d9 Mon Sep 17 00:00:00 2001 From: Taco Hoekwater Date: Thu, 21 Dec 2006 10:20:09 +0000 Subject: context release 2006.12.20 git-svn-id: svn://tug.org/texlive/trunk@2835 c570f23f-e606-0410-a88d-b1316a301751 --- .../scripts/context/perl/pdftrimwhite.pl | 24 +- Master/texmf-dist/scripts/context/perl/texfont.pl | 2 +- Master/texmf-dist/scripts/context/ruby/base/ctx.rb | 18 +- .../scripts/context/ruby/base/kpsetrees.rb | 65 ++++ Master/texmf-dist/scripts/context/ruby/base/tex.rb | 16 +- .../texmf-dist/scripts/context/ruby/kpseclient.rb | 42 ++ .../texmf-dist/scripts/context/ruby/kpseserver.rb | 7 + Master/texmf-dist/scripts/context/ruby/mtxtools.rb | 426 +++++++++++++++++++++ Master/texmf-dist/scripts/context/ruby/pdftools.rb | 22 +- Master/texmf-dist/scripts/context/ruby/pstopdf.rb | 8 +- .../texmf-dist/scripts/context/ruby/texmfstart.rb | 21 +- Master/texmf-dist/scripts/context/ruby/xmltools.rb | 120 +++++- Master/texmf-dist/tex/context/base/cont-log.tex | 14 +- Master/texmf-dist/tex/context/base/cont-new.tex | 12 +- Master/texmf-dist/tex/context/base/context.tex | 2 +- Master/texmf-dist/tex/context/base/core-ctx.tex | 7 +- Master/texmf-dist/tex/context/base/core-itm.tex | 114 ++++-- Master/texmf-dist/tex/context/base/core-mat.tex | 7 +- Master/texmf-dist/tex/context/base/core-mis.tex | 115 +++++- Master/texmf-dist/tex/context/base/core-ntb.tex | 25 +- Master/texmf-dist/tex/context/base/core-trf.tex | 4 +- Master/texmf-dist/tex/context/base/core-var.tex | 5 + Master/texmf-dist/tex/context/base/enco-pfr.tex | 1 + Master/texmf-dist/tex/context/base/enco-uc.tex | 21 + Master/texmf-dist/tex/context/base/lang-mis.tex | 22 +- Master/texmf-dist/tex/context/base/math-pln.tex | 34 +- Master/texmf-dist/tex/context/base/regi-8859-1.tex | 9 +- .../texmf-dist/tex/context/base/regi-8859-10.tex | 6 +- .../texmf-dist/tex/context/base/regi-8859-13.tex | 7 +- .../texmf-dist/tex/context/base/regi-8859-15.tex | 15 +- .../texmf-dist/tex/context/base/regi-8859-16.tex | 9 +- Master/texmf-dist/tex/context/base/regi-8859-2.tex | 13 +- Master/texmf-dist/tex/context/base/regi-8859-3.tex | 13 +- Master/texmf-dist/tex/context/base/regi-8859-4.tex | 13 +- Master/texmf-dist/tex/context/base/regi-8859-5.tex | 7 +- Master/texmf-dist/tex/context/base/regi-8859-7.tex | 8 +- Master/texmf-dist/tex/context/base/regi-8859-9.tex | 9 +- Master/texmf-dist/tex/context/base/regi-syn.tex | 11 + Master/texmf-dist/tex/context/base/rlxtools.rlx | 42 ++ Master/texmf-dist/tex/context/base/s-abr-01.tex | 3 +- Master/texmf-dist/tex/context/base/s-abr-02.tex | 8 +- Master/texmf-dist/tex/context/base/syst-cat.tex | 5 +- Master/texmf-dist/tex/context/base/syst-pln.tex | 3 +- Master/texmf-dist/tex/context/base/type-ghz.tex | 16 +- Master/texmf-dist/tex/context/base/unic-ini.tex | 2 +- Master/texmf-dist/tex/context/base/xtag-ini.tex | 6 + .../texmf-dist/tex/context/interface/cont-cz.xml | 3 + .../texmf-dist/tex/context/interface/cont-de.xml | 3 + .../texmf-dist/tex/context/interface/cont-en.xml | 3 + .../texmf-dist/tex/context/interface/cont-fr.xml | 3 + .../texmf-dist/tex/context/interface/cont-it.xml | 3 + .../texmf-dist/tex/context/interface/cont-nl.xml | 3 + .../texmf-dist/tex/context/interface/cont-ro.xml | 3 + .../texmf-dist/tex/context/interface/keys-cz.xml | 2 +- .../texmf-dist/tex/context/interface/keys-de.xml | 2 +- .../texmf-dist/tex/context/interface/keys-en.xml | 2 +- .../texmf-dist/tex/context/interface/keys-fr.xml | 2 +- .../texmf-dist/tex/context/interface/keys-it.xml | 2 +- .../texmf-dist/tex/context/interface/keys-nl.xml | 2 +- .../texmf-dist/tex/context/interface/keys-ro.xml | 2 +- 60 files changed, 1222 insertions(+), 172 deletions(-) create mode 100644 Master/texmf-dist/scripts/context/ruby/base/kpsetrees.rb create mode 100755 Master/texmf-dist/scripts/context/ruby/kpseclient.rb create mode 100755 Master/texmf-dist/scripts/context/ruby/kpseserver.rb create mode 100644 Master/texmf-dist/scripts/context/ruby/mtxtools.rb (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/scripts/context/perl/pdftrimwhite.pl b/Master/texmf-dist/scripts/context/perl/pdftrimwhite.pl index 08c1de5d778..6ac4f70c51e 100644 --- a/Master/texmf-dist/scripts/context/perl/pdftrimwhite.pl +++ b/Master/texmf-dist/scripts/context/perl/pdftrimwhite.pl @@ -61,7 +61,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $ #D \stopuseMPgraphic #D #D \placefigure -#D [here][fig:cropcrap] +#D [here][fig:pdftrimwhite] #D {Crops and offsets.} #D {\useMPgraphic{original}} #D @@ -72,40 +72,40 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $ #D The script is executed as follows: #D #D \starttyping -#D cropcrap [] [] +#D pdftrimwhite [] [] #D \stoptyping #D #D The next call crops \type {test.pdf} to its natural #D boundingbox. #D #D \starttyping -#D cropcrap test +#D pdftrimwhite test #D \stoptyping #D #D If the file has some crap at the bottom, you can say: #D #D \starttyping -#D cropcrap test --bottomcrop=2cm +#D pdftrimwhite test --bottomcrop=2cm #D \stoptyping #D #D This clips 2cm from the bottom. You can clip on all sides #D individually, in combination or at once, like in: #D #D \starttyping -#D cropcrap test --bottomcrop=2cm --crop=1cm +#D pdftrimwhite test --bottomcrop=2cm --crop=1cm #D \stoptyping #D #D The final result is a tightly cropped image. In order to get #D a 5mm margin around this image, you can say: #D #D \starttyping -#D cropcrap test --bottomcrop=2cm --offset=5mm +#D pdftrimwhite test --bottomcrop=2cm --offset=5mm #D \stoptyping #D #D By default, the script intercepts logging messages and #D writes them to a logfile with the same name as the #D resulting image and the prefix \type {log}. If no name is -#D given, the name \type {cropcrap} is used for all resulting +#D given, the name \type {pdftrimwhite} is used for all resulting #D files. #D #D By default, \CONTEXT\ is used. When installed properly, you @@ -114,14 +114,14 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $ #D is valid: #D #D \starttyping -#D cropcrap test result --bot=2cm --off=5mm --plain +#D pdftrimwhite test result --bot=2cm --off=5mm --plain #D \stoptyping #D #D The current implementation uses an intermediate \POSTSCRIPT\ #D file. This may change as \GHOSTSCRIPT\ gets more clever with #D \PDF\ files. #D -#D In \in {figure} [fig:cropcrap] the green rectangle is the +#D In \in {figure} [fig:pdftrimwhite] the green rectangle is the #D picture we want to keep. Around this picture, we want a #D margin, represented by the black rectangle, and specified by #D \type {--offset}. The white rectangle is the cropbox @@ -175,14 +175,14 @@ my $gs = "gs" ; my $thisisunix = $Config{'osname'} !~ /dos|mswin/i ; -#D When no resulting file is given, we use \type {cropcrap} +#D When no resulting file is given, we use \type {pdftrimwhite} #D as name (checked later). my $figurefile = "" ; my $resultfile = "" ; my $tempfile = "" ; -my $programname = "cropcrap" ; +my $programname = "pdftrimwhite" ; #D Messages are temporarily saved and written to a log file #D afterwards. @@ -227,7 +227,7 @@ my $width = my $height = my $llx = my $lly = my $urx = my $ury = 0 ; sub PrintHelp { print "This is PdfTrimWhite\n\n" . "usage:\n\n" . - "cropcrap [switches] filename result\n\n" . + "pdftrimwhite [switches] filename result\n\n" . "switches:\n\n" . "--crop=\n" . "--offset=\n" . diff --git a/Master/texmf-dist/scripts/context/perl/texfont.pl b/Master/texmf-dist/scripts/context/perl/texfont.pl index e6ebf7029da..5b3c1f1d766 100644 --- a/Master/texmf-dist/scripts/context/perl/texfont.pl +++ b/Master/texmf-dist/scripts/context/perl/texfont.pl @@ -562,7 +562,7 @@ if ($sourcepath eq "auto") # todo uppercase root { report ("removing : $nam") ; unlink "$nam" } my $mapfile = "$encoding$varlabel-$vendor-$collection" ; - foreach my $map ("pdftex","dvips", "dvipdfm") + foreach my $map ("pdftex","dvips", "dvipdfm") { my $maproot = "$fontroot/fonts/map/$map/context/"; if (-e "$maproot$mapfile.map") { report ("renaming : $mapfile.map -> $mapfile.bak") ; diff --git a/Master/texmf-dist/scripts/context/ruby/base/ctx.rb b/Master/texmf-dist/scripts/context/ruby/base/ctx.rb index dff9570d837..4ee2715b88a 100644 --- a/Master/texmf-dist/scripts/context/ruby/base/ctx.rb +++ b/Master/texmf-dist/scripts/context/ruby/base/ctx.rb @@ -21,7 +21,7 @@ require 'rexml/document' class CtxRunner - attr_reader :environments, :modules, :filters + attr_reader :environments, :modules, :filters, :flags @@suffix = 'prep' @@ -42,6 +42,7 @@ class CtxRunner @environments = Array.new @modules = Array.new @filters = Array.new + @flags = Array.new end def manipulate(ctxname=nil,defaultname=nil) @@ -116,6 +117,18 @@ class CtxRunner variables['job'] = @jobname end root = @xmldata.root +REXML::XPath.each(root,"/ctx:job//ctx:flags/ctx:flag") do |flg| + @flags << justtext(flg) +end +REXML::XPath.each(root,"/ctx:job//ctx:resources/ctx:environment") do |sty| + @environments << justtext(sty) +end +REXML::XPath.each(root,"/ctx:job//ctx:resources/ctx:module") do |mod| + @modules << justtext(mod) +end +REXML::XPath.each(root,"/ctx:job//ctx:resources/ctx:filter") do |fil| + @filters << justtext(fil) +end begin REXML::XPath.each(root,"//ctx:block") do |blk| if @jobname && blk.attributes['pattern'] then @@ -141,6 +154,9 @@ class CtxRunner REXML::XPath.each(root,"/ctx:job//ctx:process/ctx:resources/ctx:filter") do |fil| @filters << justtext(fil) end +REXML::XPath.each(root,"/ctx:job//ctx:process/ctx:flags/ctx:flag") do |flg| + @flags << justtext(flg) +end commands = Hash.new REXML::XPath.each(root,"/ctx:job//ctx:preprocess/ctx:processors/ctx:processor") do |pre| begin diff --git a/Master/texmf-dist/scripts/context/ruby/base/kpsetrees.rb b/Master/texmf-dist/scripts/context/ruby/base/kpsetrees.rb new file mode 100644 index 00000000000..8e3fb20f854 --- /dev/null +++ b/Master/texmf-dist/scripts/context/ruby/base/kpsetrees.rb @@ -0,0 +1,65 @@ +require 'monitor' +require 'base/kpsefast' + +class KpseTrees < Monitor + + def initialize + @trees = Hash.new + @monitor = Monitor.new + end + + def choose(filenames,environment) + current = filenames.join('|') + # @monitor do + unless @trees[current] then + puts "loading tree #{current}" + @trees[current] = KpseFast.new + @trees[current].push_environment(environment) + @trees[current].load_cnf(filenames) + @trees[current].expand_variables + @trees[current].load_lsr + end + puts "enabling tree #{current}" + # end + current + end + + def set(tree,key,value) + case key + when 'progname' then @trees[tree].progname = value + when 'engine' then @trees[tree].engine = value + when 'format' then @trees[tree].format = value + end + end + def load_cnf(tree) + @trees[tree].load_cnf + end + def load_lsr(tree) + @trees[tree].load_lsr + end + def expand_variables(tree) + @trees[tree].expand_variables + end + def expand_braces(tree,str) + @trees[tree].expand_braces(str) + end + def expand_path(tree,str) + @trees[tree].expand_path(str) + end + def expand_var(tree,str) + @trees[tree].expand_var(str) + end + def show_path(tree,str) + @trees[tree].show_path(str) + end + def var_value(tree,str) + @trees[tree].var_value(str) + end + def find_file(tree,filename) + @trees[tree].find_file(filename) + end + def find_files(tree,filename,first) + @trees[tree].find_files(filename,first) + end + +end diff --git a/Master/texmf-dist/scripts/context/ruby/base/tex.rb b/Master/texmf-dist/scripts/context/ruby/base/tex.rb index 7b5bba55a25..1b526f6e56c 100644 --- a/Master/texmf-dist/scripts/context/ruby/base/tex.rb +++ b/Master/texmf-dist/scripts/context/ruby/base/tex.rb @@ -1777,8 +1777,20 @@ end end ctx.savelog(File.suffixed(rawbase,'ctl')) - envs = ctx.environments - mods = ctx.modules + envs = ctx.environments + mods = ctx.modules + flags = ctx.flags + + flags.each do |f| + f.sub!(/^\-+/,'') + if f =~ /^(.*?)=(.*)$/ then + setvariable($1,$2) + else + setvariable(f,true) + end + end + + report("using flags #{flags.join(' ')}") if flags.size > 0 # merge environment and module specs diff --git a/Master/texmf-dist/scripts/context/ruby/kpseclient.rb b/Master/texmf-dist/scripts/context/ruby/kpseclient.rb new file mode 100755 index 00000000000..547cd9feed8 --- /dev/null +++ b/Master/texmf-dist/scripts/context/ruby/kpseclient.rb @@ -0,0 +1,42 @@ +#!/usr/bin/env ruby + +# require 'profile' + +n, t = 100, Time.now + +$: << File.dirname(File.expand_path($0)) + +require 'base/kpseremote' + +kpse = KpseRemote.new # fast start (.25 sec) +# kpse = KpseRemote::fetch # slow start (1-2 sec) + +# puts kpse.inspect + +exit unless kpse + +if true then + + n = 1 + loop do + str = kpse.find_file('texnansi.enc') + puts("#{n}: #{str}") + n += 1 + sleep(1) + end + +else + + print((Time.now-t).to_s + ' ') + n.times do |i| + str = kpse.find_file('texnansi.enc') + if i == 0 then + print(Time.now-t).to_s + ' ' + print str + else + print ' .' + end + end + puts ' ' + ((Time.now-t)/n).to_s + +end diff --git a/Master/texmf-dist/scripts/context/ruby/kpseserver.rb b/Master/texmf-dist/scripts/context/ruby/kpseserver.rb new file mode 100755 index 00000000000..b9fe2d8a6b8 --- /dev/null +++ b/Master/texmf-dist/scripts/context/ruby/kpseserver.rb @@ -0,0 +1,7 @@ +#!/usr/bin/env ruby + +$: << File.dirname(File.expand_path($0)) + +require 'base/kpseremote' + +KpseRemote::start_server diff --git a/Master/texmf-dist/scripts/context/ruby/mtxtools.rb b/Master/texmf-dist/scripts/context/ruby/mtxtools.rb new file mode 100644 index 00000000000..7cbe68c0d4c --- /dev/null +++ b/Master/texmf-dist/scripts/context/ruby/mtxtools.rb @@ -0,0 +1,426 @@ +#!/usr/bin/env ruby + +# program : mtxtools +# copyright : PRAGMA Advanced Document Engineering +# version : 2004-2005 +# author : Hans Hagen +# +# info : j.hagen@xs4all.nl +# www : www.pragma-ade.com + +# This script hosts MetaTeX related features. + +banner = ['MtxTools', 'version 1.0.0', '2006', 'PRAGMA ADE/POD'] + +$: << File.expand_path(File.dirname($0)) ; $: << File.join($:.last,'lib') ; $:.uniq! + +require 'base/switch' +require 'base/logger' +require 'base/system' +require 'base/kpse' + +class Reporter + def report(str) + puts(str) + end +end + +module ConTeXt + + def ConTeXt::banner(filename,companionname,compact=false) + "-- filename : #{File.basename(filename)}\n" + + "-- comment : companion to #{File.basename(companionname)} (in ConTeXt)\n" + + "-- author : Hans Hagen, PRAGMA-ADE, Hasselt NL\n" + + "-- copyright: PRAGMA ADE / ConTeXt Development Team\n" + + "-- license : see context related readme files\n" + + if compact then "\n-- remark : compact version\n" else "" end + end + +end + +class UnicodeTables + + @@version = "1.001" + + @@shape_a = /^((GREEK|LATIN|HEBREW)\s*(SMALL|CAPITAL|)\s*LETTER\s*[A-Z]+)$/ + @@shape_b = /^((GREEK|LATIN|HEBREW)\s*(SMALL|CAPITAL|)\s*LETTER\s*[A-Z]+)\s*(.+)$/ + + @@shape_a = /^(.*\s*LETTER\s*[A-Z]+)$/ + @@shape_b = /^(.*\s*LETTER\s*[A-Z]+)\s+WITH\s+(.+)$/ + + attr_accessor :context, :comment + + def initialize(logger=Reporter.new) + @data = Array.new + @logger = logger + @error = false + @context = true + @comment = true + @shapes = Hash.new + end + + def load_unicode_data(filename='unicodedata.txt') + # beware, the unicodedata table is bugged, sometimes ending + @logger.report("reading base data from #{filename}") if @logger + begin + IO.readlines(filename).each do |line| + if line =~ /^[0-9A-F]{4,4}/ then + d = line.chomp.sub(/\;$/, '').split(';') + if d then + while d.size < 15 do d << '' end + n = d[0].hex + @data[n] = d + if d[1] =~ @@shape_a then + @shapes[$1] = d[0] + end + end + end + end + rescue + @error = true + @logger.report("error while reading base data from #{filename}") if @logger + end + end + + def load_context_data(filename='contextnames.txt') + @logger.report("reading data from #{filename}") if @logger + begin + IO.readlines(filename).each do |line| + if line =~ /^[0-9A-F]{4,4}/ then + d = line.chomp.split(';') + if d then + n = d[0].hex + if @data[n] then + @data[d[0].hex] << d[1] # adobename == 15 + @data[d[0].hex] << d[2] # contextname == 16 + else + @logger.report("missing information about #{d} in #{filename}") if @logger + end + end + end + end + rescue + @error = true + @logger.report("error while reading context data from #{filename}") if @logger + end + end + + def save_metatex_data(filename='char-def.lua',compact=false) + if not @error then + begin + File.open(filename,'w') do |f| + @logger.report("saving data in #{filename}") if @logger + f << ConTeXt::banner(filename,'char-def.tex',compact) + f << "\n" + f << "\nif not versions then versions = { } end versions['#{filename.gsub(/\..*?$/,'')}'] = #{@@version}\n" + f << "\n" + f << "if not characters then characters = { } end\n" + f << "if not characters.data then characters.data = { } end\n" + f << "\n" + f << "characters.data = {\n" if compact + @data.each do |d| + if d then + r = metatex_data(d) + if compact then + f << "\t" << "[0x#{d[0]}]".rjust(8,' ') << " = { #{r.join(", ").gsub(/\t/,'')} }, \n" + else + f << "characters.define { -- #{d[0].hex}" << "\n" + f << r.join(",\n") << "\n" + f << "}" << "\n" + end + end + end + f << "}\n" if compact + end + rescue + @logger.report("error while saving data in #{filename}") if @logger + else + @logger.report("#{@data.size} (#{sprintf('%X',@data.size)}) entries saved in #{filename}") if @logger + end + else + @logger.report("not saving data in #{filename} due to previous error") if @logger + end + end + + def metatex_data(d) + r = Array.new + r << "\tunicodeslot=0x#{d[0]}" + if d[2] && ! d[2].empty? then + r << "\tcategory='#{d[2].downcase}'" + end + if @context then + if d[15] && ! d[15].empty? then + r << "\tadobename='#{d[15]}'" + end + if d[16] && ! d[16].empty? then + r << "\tcontextname='#{d[16]}'" + end + end + if @comment then + if d[1] == "" then + r << "\tdescription='#{d[10]}'" unless d[10].empty? + else + r << "\tdescription='#{d[1]}'" unless d[1].empty? + end + end + if d[1] =~ @@shape_b then + r << "\tshcode=0x#{@shapes[$1]}" if @shapes[$1] + end + if d[12] && ! d[12].empty? then + r << "\tuccode=0x#{d[12]}" + elsif d[14] && ! d[14].empty? then + r << "\tuccode=0x#{d[14]}" + end + if d[13] && ! d[13].empty? then + r << "\tlccode=0x#{d[13]}" + end + if d[5] && ! d[5].empty? then + special, specials = '', Array.new + c = d[5].split(/\s+/).collect do |cc| + if cc =~ /^\<(.*)\>$/io then + special = $1.downcase + else + specials << "0x#{cc}" + end + end + if specials.size > 0 then + special = 'char' if special.empty? + r << "\tspecials={'#{special}',#{specials.join(',')}}" + end + end + return r + end + + def save_xetex_data(filename='enco-xtx.tex') + if not @error then + begin + minnumber, maxnumber, n = 0x001F, 0xFFFF, 0 + File.open(filename,'w') do |f| + @logger.report("saving data in #{filename}") if @logger + f << "% filename : #{filename}\n" + f << "% comment : poor man's alternative for a proper enco file\n" + f << "% author : Hans Hagen, PRAGMA-ADE, Hasselt NL\n" + f << "% copyright: PRAGMA ADE / ConTeXt Development Team\n" + f << "% license : see context related readme files\n" + f << "\n" + f << "\\ifx\\setcclcuc\\undefined\n" + f << "\n" + f << " \\def\\setcclcuc #1 #2 #3 %\n" + f << " {\\global\\catcode\"#1=11 \n" + f << " \\global\\lccode \"#1=\"#2 \n" + f << " \\global\\uccode \"#1=\"#3 }\n" + f << "\n" + f << "\\fi\n" + f << "\n" + @data.each do |d| + if d then + number, type = d[0], d[2].downcase + if number.hex >= minnumber && number.hex <= maxnumber && type =~ /^l(l|u|t)$/o then + if d[13] && ! d[13].empty? then + lc = d[13] + else + lc = number + end + if d[12] && ! d[12].empty? then + uc = d[12] + elsif d[14] && ! d[14].empty? then + uc = d[14] + else + uc = number + end + if @comment then + f << "\\setcclcuc #{number} #{lc} #{uc} % #{d[1]}\n" + else + f << "\\setcclcuc #{number} #{lc} #{uc} \n" + end + n += 1 + end + end + end + f << "\n" + f << "\\endinput\n" + end + rescue + @logger.report("error while saving data in #{filename}") if @logger + else + @logger.report("#{n} entries saved in #{filename}") if @logger + end + else + @logger.report("not saving data in #{filename} due to previous error") if @logger + end + end + +end + +class RegimeTables + + @@version = "1.001" + + def initialize(logger=Reporter.new) + @logger = logger + reset + end + + def reset + @code, @regime, @filename, @loaded = Array.new(256), '', '', false + (32..127).each do |i| + @code[i] = [sprintf('%04X',i), i.chr] + end + end + + def load(filename) + begin + reset + if filename =~ /regi\-(ini|run|uni|utf|syn)/ then + report("skipping #{filename}") + else + report("loading file #{filename}") + @regime, unicodeset = File.basename(filename).sub(/\..*?$/,''), false + IO.readlines(filename).each do |line| + case line + when /^\#/ then + # skip + when /^(0x[0-9A-F]+)\s+(0x[0-9A-F]+)\s+\#\s+(.*)$/ then + @code[$1.hex], unicodeset = [$2, $3], true + when /^(0x[0-9A-F]+)\s+(0x[0-9A-F]+)\s+/ then + @code[$1.hex], unicodeset = [$2, ''], true + end + end + reset if not unicodeset + end + rescue + report("problem in loading file #{filename}") + reset + else + if ! @regime.empty? then + @loaded = true + else + reset + end + end + end + + def save(filename,compact=false) + begin + if @loaded && ! @regime.empty? then + if File.expand_path(filename) == File.expand_path(@filename) then + report("saving in #{filename} is blocked") + else + report("saving file #{filename}") + File.open(filename,'w') do |f| + f << ConTeXt::banner(filename,'regi-ini.tex',compact) + f << "\n" + f << "\nif not versions then versions = { } end versions['#{filename.gsub(/\..*?$/,'')}'] = #{@@version}\n" + f << "\n" + f << "if not regimes then regimes = { } end\n" + f << "if not regimes.data then regimes.data = { } end\n" + f << "\n" + if compact then + f << "regimes.data[\"#{@regime}\"] = { [0] = \n\t" + i = 17 + @code.each_index do |c| + if (i-=1) == 0 then + i = 16 + f << "\n\t" + end + if @code[c] then + f << @code[c][0].rjust(6,' ') + else + f << "0x0000".rjust(6,' ') + end + f << ', ' if c<@code.length-1 + end + f << "\n}\n" + else + @code.each_index do |c| + if @code[c] then + f << someregimeslot(@regime,c,@code[c][0],@code[c][1]) + else + f << someregimeslot(@regime,c,'','') + end + end + end + end + end + end + rescue + report("problem in saving file #{filename} #{$!}") + end + end + + def report(str) + @logger.report(str) + end + + private + + def someregimeslot(regime,slot,unicodeslot,comment) + "regimes.define { #{if comment.empty? then '' else '-- ' end} #{comment}\n" + + "\tregime='#{regime}',\n" + + "\tslot='#{sprintf('0x%02X',slot)}',\n" + + "\tunicodeslot='#{if unicodeslot.empty? then '0x0000' else unicodeslot end}'\n" + + "}\n" + end + + public + + def RegimeTables::convert(filenames,compact=false) + filenames.each do |filename| + txtfile = File.expand_path(filename) + luafile = File.join(File.dirname(txtfile),'regi-'+File.basename(txtfile.sub(/\..*?$/, '.lua'))) + unless txtfile == luafile then + regime = RegimeTables.new + regime.load(txtfile) + regime.save(luafile,compact) + end + end + end + +end + +class Commands + + include CommandBase + + def unicodetable + unicode = UnicodeTables.new(logger) + unicode.load_unicode_data + unicode.load_context_data + unicode.save_metatex_data('char-def.lua',@commandline.option('compact')) + end + + def xetextable + unicode = UnicodeTables.new(logger) + unicode.load_unicode_data + unicode.load_context_data + # unicode.comment = false + unicode.save_xetex_data + end + + def regimetable + if @commandline.arguments.length > 0 then + RegimeTables::convert(@commandline.arguments, @commandline.option('compact')) + else + RegimeTables::convert(Dir.glob("cp*.txt") , @commandline.option('compact')) + RegimeTables::convert(Dir.glob("8859*.txt") , @commandline.option('compact')) + end + end + +end + +logger = Logger.new(banner.shift) +commandline = CommandLine.new + +commandline.registeraction('unicodetable', 'create unicode table for metatex/luatex') +commandline.registeraction('regimetable', 'create regime table(s) for metatex/luatex [--compact]') +commandline.registeraction('xetextable' , 'create unicode table for xetex') + +# general + +commandline.registeraction('help') +commandline.registeraction('version') +commandline.registerflag('compact') + +commandline.expand + +Commands.new(commandline,logger,banner).send(commandline.action || 'help') diff --git a/Master/texmf-dist/scripts/context/ruby/pdftools.rb b/Master/texmf-dist/scripts/context/ruby/pdftools.rb index d40e2d85281..6dfa47374d4 100644 --- a/Master/texmf-dist/scripts/context/ruby/pdftools.rb +++ b/Master/texmf-dist/scripts/context/ruby/pdftools.rb @@ -739,13 +739,23 @@ class Commands end def countpages - filenames, n = findfiles('pdf'), 0 + if @commandline.option('pattern') then + filenames, n = globfiles(@commandline.option('pattern'),'pdf'), 0 + else + filenames, n = findfiles('pdf'), 0 + end + threshold = @commandline.option('threshold').to_i rescue 0 filenames.each do |filename| if `pdfinfo #{filename}`.chomp =~ /^pages\s*\:\s*(\d+)/mois then - report("#{$1.rjust(4)} pages found in #{filename}") - n += $1.to_i - end + p = $1 + m = p.to_i rescue 0 + if threshold == 0 or m > threshold then + report("#{p.rjust(4)} pages found in #{filename}") + n += m + end + end end + report("") report("#{n.to_s.rjust(4)} pages in total") end @@ -791,7 +801,7 @@ commandline.registeraction('colorimage', 'filename --colorspec= [--retain - commandline.registeraction('convertimage', 'filename [--retain --subpath]') commandline.registeraction('downsampleimage', 'filename [--retain --subpath --lowres --normal]') commandline.registeraction('info', 'filename') -commandline.registeraction('countpages', 'pattern') +commandline.registeraction('countpages', '[--pattern --threshold]') commandline.registeraction('analyzefile' , 'filename') @@ -801,6 +811,8 @@ commandline.registeraction('version') commandline.registervalue('colorname') commandline.registervalue('colorspec') commandline.registervalue('subpath') +commandline.registervalue('pattern') +commandline.registervalue('threshold',0) commandline.registerflag('lowres') commandline.registerflag('medres') diff --git a/Master/texmf-dist/scripts/context/ruby/pstopdf.rb b/Master/texmf-dist/scripts/context/ruby/pstopdf.rb index a677cb61788..3625f4d83dc 100644 --- a/Master/texmf-dist/scripts/context/ruby/pstopdf.rb +++ b/Master/texmf-dist/scripts/context/ruby/pstopdf.rb @@ -42,7 +42,10 @@ class Commands def main filename = @commandline.argument('first') pattern = @commandline.option('pattern') - globfiles(pattern) if filename.empty? && ! pattern.empty? + if filename.empty? && ! pattern.empty? then + pattern = "**/#{pattern}" if @commandline.option('recurse') + globfiles(pattern) + end filename = @commandline.argument('first') if filename.empty? then help @@ -343,6 +346,8 @@ class Commands elsif magick.supported?(filename) then # report("processing non ps/pdf file #{filename}") handle_magick(magick,filename) + else + report("option not supported for #{filename}") end end @@ -507,6 +512,7 @@ commandline.registervalue('outputpath') commandline.registerflag('watch') commandline.registerflag('force') +commandline.registerflag('recurse') commandline.registervalue('delay',2) diff --git a/Master/texmf-dist/scripts/context/ruby/texmfstart.rb b/Master/texmf-dist/scripts/context/ruby/texmfstart.rb index a886b2aa142..de4a18d2eb5 100644 --- a/Master/texmf-dist/scripts/context/ruby/texmfstart.rb +++ b/Master/texmf-dist/scripts/context/ruby/texmfstart.rb @@ -1429,7 +1429,7 @@ end $mswindows = Config::CONFIG['host_os'] =~ /mswin/ $separator = File::PATH_SEPARATOR -$version = "2.0.2" +$version = "2.0.3" $ownpath = File.dirname($0) if $mswindows then @@ -1804,14 +1804,16 @@ def changeddir?(path) if path.empty? then return true else + oldpath = File.expand_path(path) begin - Dir.chdir(path) if ! path.empty? + Dir.chdir(path) if not path.empty? rescue report("unable to change to directory: #{path}") else report("changed to directory: #{path}") end - return File.expand_path(Dir.getwd) == File.expand_path(path) + newpath = File.expand_path(Dir.getwd) + return oldpath == newpath end end @@ -1971,10 +1973,15 @@ def find(filename,program) end filename.sub!(/^.*[\\\/]/, '') # next we look at the current path and the callerpath - [ ['.','current'], - [$ownpath,'caller'], ["#{$ownpath}/../#{suffixlist[0]}",'caller'], - [registered("THREAD"),'thread'], ["#{registered("THREAD")}/../#{suffixlist[0]}",'thread'], - ].each do |p| + pathlist = [ ] + progpath = $applications[suffixlist[0]] + threadok = registered("THREAD") !~ /unknown/ + pathlist << ['.','current'] + pathlist << [$ownpath,'caller'] if $ownpath != '.' + pathlist << ["#{$ownpath}/../#{progpath}",'caller'] if progpath + pathlist << [registered("THREAD"),'thread'] if threadok + pathlist << ["#{registered("THREAD")}/../#{progpath}",'thread'] if progpath && threadok + pathlist.each do |p| if p && ! p.empty? && ! (p[0] == 'unknown') then suffixlist.each do |suffix| fname = "#{filename}.#{suffix}" diff --git a/Master/texmf-dist/scripts/context/ruby/xmltools.rb b/Master/texmf-dist/scripts/context/ruby/xmltools.rb index fe4fbde22ec..5b4a112b8b5 100644 --- a/Master/texmf-dist/scripts/context/ruby/xmltools.rb +++ b/Master/texmf-dist/scripts/context/ruby/xmltools.rb @@ -15,7 +15,7 @@ # This script will harbor some handy manipulations on tex # related files. -banner = ['XMLTools', 'version 1.2.0', '2002/2006', 'PRAGMA ADE/POD'] +banner = ['XMLTools', 'version 1.2.1', '2002/2006', 'PRAGMA ADE/POD'] $: << File.expand_path(File.dirname($0)) ; $: << File.join($:.last,'lib') ; $:.uniq! @@ -400,6 +400,119 @@ class Commands end end + def filter + + require "rexml/document" + + element = @commandline.option('element') + files = @commandline.arguments + result = "xmltools.xlg" + + if element.empty? then + report("provide element using --element") + elsif files.length == 0 then + report("provide filename(s)") + else + begin + File.open(result,'w') do |f| + f << "\n\n" + f << "\n\n" + total = 0 + files.sort.each do |file| + begin + report("loading: #{file}") + data = REXML::Document.new(IO.read(file)) + rescue + report("error: invalid xml") + else + found = 0 + report("filtering: #{element}") + REXML::XPath.each(data,"//#{element}") do |table| + str = table.to_s + if str.length > 0 then + total += 1 + found += 1 + report("found: #{total} / #{found} / #{str.length} bytes") + f << "\n\n" unless found > 1 + f << "" + f << "#{str.gsub(/^\s*/m,'').gsub(/\s*$/m,'')}" + f << "\n\n" + end + end + f << "\n\n" if found > 0 + end + end + f << "\n" + end + report("result: #{result}") + rescue + report("error in opening #{result}") + end + end + + end + + def enhance + oldname = @commandline.argument('first') + newname = @commandline.argument('second') + verbose = @commandline.option('verbose') + # todo: options, maybe a config file + if ! newname || newname.empty? then + newname = oldname + ".prep" + end + if FileTest.file?(oldname) then + report("") if verbose + data = IO.read(oldname) + elements = Array.new + preamble = "" + done = false + data.sub!(/^(.*?)\s*(<[a-z])/mois) do + preamble = $1 + $2 + end + # hide elements + data.gsub!(/<(.*?)>/mois) do + elements << $1 + "<#{elements.length}>" + end + # abc[-/]def + data.gsub!(/([a-z]{3,})([\/\-])([a-z]{3,})/mois) do + done = true + report("compound: #{$1}#{$2}#{$3}") if verbose + "#{$1}#{$3}" + end + # (abcd + data.gsub!(/(\()([a-z]{4,})/mois) do + done = true + report("compound: #{$1}#{$2}") if verbose + "#{$2}" + end + # abcd) + data.gsub!(/(\()([a-z]{4,})/mois) do + done = true + report("compound: #{$1}#{$2}") if verbose + "#{$2}" + end + # roll back elements + data.gsub!(/<(\d+)>/mois) do + "<#{elements.shift}>" + end + File.open(newname,'wb') do |f| + f << preamble + f << "\n" + f << data + end + if verbose then + if done then + report("") + report(oldname," converted to ",newname) + else + report(oldname," copied to ",newname) + end + end + end + end + def cleanup # todo, share loading/saving with previous file = @commandline.argument('first') @@ -508,6 +621,8 @@ commandline.registeraction('dir', 'generate directory listing') commandline.registeraction('mmlpages','generate graphic from mathml') commandline.registeraction('analyze', 'report entities and elements [--utf --process]') commandline.registeraction('cleanup', 'cleanup xml file [--force]') +commandline.registeraction('enhance', 'enhance xml file (partial)') +commandline.registeraction('filter', 'filter elements from xml file [element=]') # commandline.registeraction('dir', 'filename --pattern= --output= [--recurse --stripname --longname --url --root]') # commandline.registeraction('mmlpages','filename [--eps --jpg --png --style= --mode=]') @@ -520,8 +635,10 @@ commandline.registeraction('version') commandline.registerflag('stripname') commandline.registerflag('longname') commandline.registerflag('recurse') +commandline.registerflag('verbose') commandline.registervalue('pattern') +commandline.registervalue('element') commandline.registervalue('url') commandline.registervalue('output') commandline.registervalue('root') @@ -533,7 +650,6 @@ commandline.registerflag('utf') commandline.registerflag('process') commandline.registervalue('style') commandline.registervalue('modes') -commandline.registervalue('verbose') commandline.expand diff --git a/Master/texmf-dist/tex/context/base/cont-log.tex b/Master/texmf-dist/tex/context/base/cont-log.tex index 4f9bf2d5e3e..37aabbbb619 100644 --- a/Master/texmf-dist/tex/context/base/cont-log.tex +++ b/Master/texmf-dist/tex/context/base/cont-log.tex @@ -224,11 +224,11 @@ %D Some placeholders: -\def\eTeX {\mathematics{\varepsilon}-\TeX} -\def\pdfTeX {pdf\TeX} -\def\pdfeTeX {pdfe-\TeX} -\def\luaTeX {lua\TeX} -\def\XeTeX {X\lower.5ex\hbox{\kern-.15em\mirror{E}}\kern-.1667em\TeX} +\def\eTeX {\mathematics{\varepsilon}-\TeX} +\def\pdfTeX {pdf\TeX} +\def\pdfeTeX {pdfe-\TeX} +\def\luaTeX {lua\TeX} +\unexpanded\def\XeTeX {X\lower.5ex\hbox{\kern-.15em\mirror{E}}\kern-.1667em\TeX} \let\ETEX \eTeX \let\PDFTEX \pdfTeX @@ -243,8 +243,8 @@ \let\NormalTeXLogo\TeX - \def\TeX {T\smash[d]{\kern-.1667em\lower.5ex\hbox{E}}\kern-.125emX} - \def\XeTeX{X\smash[d]{\lower.5ex\hbox{\kern-.15em\mirror{E}}}\kern-.1667em\TeX} + \unexpanded\def\TeX {T\smash[d]{\kern-.1667em\lower.5ex\hbox{E}}\kern-.125emX} + \unexpanded\def\XeTeX{X\smash[d]{\lower.5ex\hbox{\kern-.15em\mirror{E}}}\kern-.1667em\TeX} \endXETEX diff --git a/Master/texmf-dist/tex/context/base/cont-new.tex b/Master/texmf-dist/tex/context/base/cont-new.tex index 24126438d71..a730ab92806 100644 --- a/Master/texmf-dist/tex/context/base/cont-new.tex +++ b/Master/texmf-dist/tex/context/base/cont-new.tex @@ -13,7 +13,7 @@ % it's about time to clean up this file ... -\newcontextversion{2006.12.07 18:22} +\newcontextversion{2006.12.20 23:52} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new @@ -29,6 +29,16 @@ \let\then\relax % \ifnum1>2\then -) +\def\defXMLexpanded#1#2% + {\begingroup + \let\getXMLentity\expandedXMLentity + \expanded{\endgroup\edef\noexpand#1{#2}}} + +\def\gdefXMLexpanded#1#2% + {\begingroup + \let\getXMLentity\expandedXMLentity + \expanded{\endgroup\xdef\noexpand#1{#2}}} + \def\dividedsize#1#2#3% size gap n {\dimexpr \ifnum\dimexpr#1\relax>\plusone diff --git a/Master/texmf-dist/tex/context/base/context.tex b/Master/texmf-dist/tex/context/base/context.tex index f9356f14a29..70c21e5bdfa 100644 --- a/Master/texmf-dist/tex/context/base/context.tex +++ b/Master/texmf-dist/tex/context/base/context.tex @@ -42,7 +42,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2006.12.07 18:22} +\edef\contextversion{2006.12.20 23:52} %D For those who want to use this: diff --git a/Master/texmf-dist/tex/context/base/core-ctx.tex b/Master/texmf-dist/tex/context/base/core-ctx.tex index ba47f07fd1a..88659122f7b 100644 --- a/Master/texmf-dist/tex/context/base/core-ctx.tex +++ b/Master/texmf-dist/tex/context/base/core-ctx.tex @@ -24,7 +24,9 @@ \def \preprocesssuffix {.prep} \def\loadctxpreplist - {\ifcase\preprocessmethod + {\begingroup + \chardef\XMLtokensreduction\plusone + \ifcase\preprocessmethod % no checking \or % simple checking @@ -42,7 +44,8 @@ \egroup}% {\global\chardef\preprocessmode\plusone}% \fi - \global\let\loadctxpreplist\relax} + \global\let\loadctxpreplist\relax + \endgroup} \appendtoks\loadctxpreplist\to\everystarttext % will become: \prependtoks\loadctxpreplist\to\everyjob diff --git a/Master/texmf-dist/tex/context/base/core-itm.tex b/Master/texmf-dist/tex/context/base/core-itm.tex index 9f132a96ab2..9642b0f945d 100644 --- a/Master/texmf-dist/tex/context/base/core-itm.tex +++ b/Master/texmf-dist/tex/context/base/core-itm.tex @@ -65,6 +65,10 @@ \newconditional\paragraphlistitem \setfalse\paragraphlistitem \newconditional\textlistitem \setfalse\textlistitem \newconditional\firstlistitem \setfalse\firstlistitem +\newconditional\beforelistitem \setfalse\beforelistitem +\newconditional\afterlistitem \setfalse\afterlistitem +\newconditional\nowhitelistitem \setfalse\nowhitelistitem +\newconditional\joinedlistitem \setfalse\joinedwhitelistitem \newcounter\noflists \newcounter\itemlevel @@ -178,9 +182,12 @@ #2*\v!broad*=>\setitemparameter{#1}\c!factor{#2}, \v!text*=>\settrue\textlistitem \settrue\inlinelistitem - \dosetuppackeditemgroup{#1}% + \settrue\joinedlistitem % \dosetuppackeditemgroup{#1}% \packitems, \v!columns*=>\packitems, + \v!before*=>\settrue\beforelistitem, + \v!after*=>\settrue\afterlistitem, + \v!nowhite*=>\settrue\nowhitelistitem, % \def\packeditemspacing{\nowhitespace}, \v!margin*=>\setitemparameter{#1}\c!width{-2em}, % signal \v!inmargin*=>\setitemparameter{#1}\c!width{-2em}, % signal \v!atmargin*=>\doifnot{#1}{1}{\setitemparameter{#1}\c!width{0em}}, % signal @@ -188,7 +195,7 @@ \v!loose*=>\setfalse\optimizelistitem, \v!paragraph*=>\settrue\paragraphlistitem \packitems, - \v!joinedup*=>\dosetuppackeditemgroup{#1}% + \v!joinedup*=>\settrue\joinedlistitem % \dosetuppackeditemgroup{#1}% \packitems, \v!serried*=>\setitemparameter{#1}\c!factor{-1}, #2#3*\v!serried*=>\setitemparameter{#1}\c!factor{-#2#3}, @@ -211,12 +218,75 @@ \c!after=\blank, \c!inner=]} -\def\dosetuppackeditemgroup#1% - {\letitemparameter{#1}\c!beforehead\empty - \letitemparameter{#1}\c!afterhead \empty - \letitemparameter{#1}\c!before \empty - \letitemparameter{#1}\c!after \empty - \letitemparameter{#1}\c!inbetween \empty} +% \def\packeditemspacing{\empty} + +% \setupwhitespace[big] +% \starttext +% test \startitemize[joinedup] \item test \item test \stopitemize test \par +% test \startitemize[joinedup,nowhite] \item test \item test \stopitemize test \par +% test \startitemize[joinedup,nowhite,before] \item test \item test \stopitemize test \par +% test \startitemize[joinedup,nowhite,after] \item test \item test \stopitemize test \par +% \stoptext + +\def\itembeforecommand + {\ifconditional\nowhitelistitem + \ifconditional\beforelistitem + \ifcase\itemlevel\or\getitemparameter\itemlevel\c!before\fi + \else + \nowhitespace + \fi + \else\ifconditional\joinedlistitem + % \empty + \else + \getitemparameter\itemlevel\c!before + \fi\fi} + +\def\itemaftercommand + {\ifconditional\nowhitelistitem + \ifconditional\afterlistitem + \ifcase\itemlevel\or\getitemparameter\itemlevel\c!after\fi + \else + \nowhitespace + \fi + \else\ifconditional\joinedlistitem + % \empty + \else + \getitemparameter\itemlevel\c!after + \fi\fi} + +\def\iteminbetweencommand + {\ifconditional\nowhitelistitem + \nowhitespace + \else\ifconditional\joinedlistitem + % \empty + \else + \getitemparameter\itemlevel\c!inbetween + \fi\fi} + +\def\itembeforeheadcommand + {\ifconditional\nowhitelistitem + \nowhitespace + \else\ifconditional\joinedlistitem + % \empty + \else + \getitemparameter\itemlevel\c!beforehead + \fi\fi} + +\def\itemafterheadcommand + {\ifconditional\nowhitelistitem + \nowhitespace + \else\ifconditional\joinedlistitem + % \empty + \else + \getitemparameter\itemlevel\c!afterhead + \fi\fi} + +% \def\dosetuppackeditemgroup#1% +% {\setitemparameter{#1}\c!beforehead{\packeditemspacing}% +% \setitemparameter{#1}\c!afterhead {\packeditemspacing}% +% \setitemparameter{#1}\c!before {\packeditemspacing}% +% \setitemparameter{#1}\c!after {\packeditemspacing}% +% \setitemparameter{#1}\c!inbetween {\packeditemspacing}} \def\dosetupitemgroupconstant[#1][#2]% {\def\dodosetupitemgroupconstant##1% catches empty in [a,b,] handy for xml @@ -501,7 +571,7 @@ \doifinset\v!columns{#1}% {\ifinsidecolumns\else\ifnum\itemcolumndepth=\zerocount \globallet\itemcolumndepth\itemlevel - \getitemparameter\itemlevel\c!before + \itembeforecommand \processfirstactioninset [#1] [ \v!one=>\!!counta1\relax, @@ -551,20 +621,20 @@ \ifnum\itemcolumndepth=\itemlevel\relax \stopcolumns \doglobal\newcounter\itemcolumndepth - \getitemparameter\itemlevel\c!after + \itemaftercommand \dontrechecknextindentation \else \ifnum\itemlevel=\plusone \doitembreak\allowbreak % toegevoegd - \getitemparameter1\c!after + \itemaftercommand % \getitemparameter\itemlevel\c!after % was: \dochecknextindentation\??oo, is now: \dochecknextindentation{\??op\currentitemgroup\itemlevel}% \else % nieuw, not yet nobreak handling \ifcase\autoitemgroupspacing - \getitemparameter\itemlevel\c!after + \itemaftercommand \or - \getitemparameter\itemlevel\c!after + \itemaftercommand \fi \dontrechecknextindentation \fi @@ -863,7 +933,7 @@ \or % 1 \ifnum\itemcolumndepth=0\relax \ifconditional\introlistitem\doitembreak\nobreak\fi - \getitemparameter1\c!before + \itembeforecommand % \getitemparameter\itemlevel\c!before \ifconditional\introlistitem\doitembreak\nobreak\fi \fi \else % 2 en hoger @@ -871,10 +941,10 @@ \let\previtemlevel\itemlevel \decrement\previtemlevel \ifcase\autoitemgroupspacing\relax % nieuw - \getitemparameter\itemlevel\c!before + \itembeforecommand \or - \doifelsenothing{\getitemparameter\itemlevel\c!before} - {\getitemparameter\itemlevel\c!before} + \doifelsenothing{\itembeforecommand} + {\itembeforecommand} {\getitemparameter\previtemlevel\c!inbetween}% \else \getitemparameter\previtemlevel\c!inbetween % == itemlevel-1 @@ -886,7 +956,7 @@ % \removeunwantedspaces\hskip\interwordspace\!!plus\emwidth\relax % new per 2006/10/20 \removeunwantedspaces\hskip\emwidth\!!plus\interwordstretch\!!minus\interwordshrink\relax % new per 2006/10/20 \else - \getitemparameter\itemlevel\c!inbetween + \iteminbetweencommand \fi \fi \ifconditional\concatnextitem % new, concat @@ -946,7 +1016,7 @@ % \def\complexdoitemgrouphead[#1]#2\par% % beter in \complexdosom hangen met een if % {\ifconditional\firstlistitem\else\doitembreak\allowbreak\fi -% \ifconditional\packlistitem\else\getitemparameter\itemlevel\c!beforehead\fi +% \ifconditional\packlistitem\else\itembeforeheadcommand\fi % \ifconditional\firstlistitem\ifconditional\introlistitem\else\ifcase\itemlevel % incr in \complexdosom % \doitembreak\allowbreak % \fi\fi\fi @@ -958,7 +1028,7 @@ % \par % \fi % \doitembreak\nobreak -% \ifconditional\packlistitem\else\getitemparameter\itemlevel\c!afterhead\fi +% \ifconditional\packlistitem\else\itemafterheadcommand\fi % \doitembreak\nobreak % \noindentation} % @@ -969,7 +1039,7 @@ \def\complexdoitemgrouphead[#1]% beter in \complexdosom hangen met een if {\ifconditional\firstlistitem\else\doitembreak\allowbreak\fi - \ifconditional\packlistitem\else\getitemparameter\itemlevel\c!beforehead\fi + \ifconditional\packlistitem\else\itembeforeheadcommand\fi \ifconditional\firstlistitem\ifconditional\introlistitem\else\ifcase\itemlevel % incr in \complexdosom \doitembreak\allowbreak \fi\fi\fi @@ -989,7 +1059,7 @@ \par \fi \doitembreak\nobreak - \ifconditional\packlistitem\else\getitemparameter\itemlevel\c!afterhead\fi + \ifconditional\packlistitem\else\itemafterheadcommand\fi \doitembreak\nobreak \noindentation} diff --git a/Master/texmf-dist/tex/context/base/core-mat.tex b/Master/texmf-dist/tex/context/base/core-mat.tex index 0a75bfcf617..b4ee9173033 100644 --- a/Master/texmf-dist/tex/context/base/core-mat.tex +++ b/Master/texmf-dist/tex/context/base/core-mat.tex @@ -648,7 +648,8 @@ \ifx\next\bgroup \egroup \@EA\moreplaceformula % [ref]{} \else - \def\nextnext{$}% +% \def\nextnext{$}% + \let\nextnext$% \ifx\next\nextnext \egroup \@EAEAEA\dispplaceformula % [ref]$$ \else @@ -660,7 +661,8 @@ \long\def\moreplaceformula[#1]#2#3#4% #2 dummy #4 gobbles spaces {\def\redoplaceformula {\bgroup - \def\nextnext{$}% +% \def\nextnext{$}% + \let\nextnext$% \ifx\next\nextnext \egroup \@EA\dispplaceformula % [ref]$$ \else @@ -1141,6 +1143,7 @@ \catcode`\_=\@@active \def_{\ifmmode\expandafter\suber\else\expandafter\normalsuber\fi}} \egroup + %D \macros %D {enableautomath} %D diff --git a/Master/texmf-dist/tex/context/base/core-mis.tex b/Master/texmf-dist/tex/context/base/core-mis.tex index 2547e9afae3..5cec47f647b 100644 --- a/Master/texmf-dist/tex/context/base/core-mis.tex +++ b/Master/texmf-dist/tex/context/base/core-mis.tex @@ -1060,7 +1060,7 @@ \def\dorepeatdelimitedtext {\relax\ifcase\delimitedtextparameter\c!level\else - \dohandledelimitedtext\c!middle + \dohandledelimitedtext\c!middle % maybe better \dohandleleftdelimitedtext \fi} \let\dohandlerepeatdelimitedtext\relax @@ -1109,15 +1109,26 @@ \doifsomething{\delimitedtextparameter\c!spaceafter} {\blank[\delimitedtextparameter\c!spaceafter]}} +% \def\dostartdelimitedtexttxt +% {\let\dostopdelimitedtext\dostopdelimitedtexttxt +% \dostartattributes{\??ci\currentdelimitedtext}\c!style\c!color\empty +% \dohandledelimitedtext\c!left +% \ignorespaces} + \def\dostartdelimitedtexttxt {\let\dostopdelimitedtext\dostopdelimitedtexttxt \dostartattributes{\??ci\currentdelimitedtext}\c!style\c!color\empty - \dohandledelimitedtext\c!left + \dohandleleftdelimitedtext\c!left \ignorespaces} +% \def\dostopdelimitedtexttxt +% {\removeunwantedspaces +% \dohandledelimitedtext\c!right +% \dostopattributes} + \def\dostopdelimitedtexttxt {\removeunwantedspaces - \dohandledelimitedtext\c!right + \dohandlerightdelimitedtext\c!right \dostopattributes} \def\stopdelimitedtext @@ -1156,12 +1167,28 @@ \def\rightdelimitedtextmark {\hsmash{\delimitedtextparameter\c!right}} +% \starttext +% \hyphenatedword{groepsvrijstellingsverordeningen}\par +% \hyphenatedword{\quote{groepsvrijstellingsverordeningen}}\par +% \dorecurse{100}{\hskip300pt\hskip\recurselevel pt test \quote{xxx xxxx}.\par} +% \page \setuppapersize[A5][A4] +% \quotation {overly beautiful pusillanimous sesquipedalian +% longwinded} test test test test test test test test test test test +% test test test test test test test test test test test test test +% test test test test test test test test test test test test test +% test test test test test test test test test test test test test +% test test test +% \stoptext + \def\dohandledelimitedtext#1#2% {\begingroup \setbox\scratchbox\hbox{\delimitedtextparameter#1}% \ifdim\wd\scratchbox>\zeropoint - \ifdim\lastskip=\delimitedtextsignal - \unskip\hskip\hspaceamount\currentlanguage{interquotation}% +% \ifdim\lastskip=\delimitedtextsignal +% \unskip + \ifdim\lastkern=\delimitedtextsignal + \unkern + \hskip\hspaceamount\currentlanguage{interquotation}% \else #2% \fi @@ -1171,33 +1198,101 @@ \fi \strut % new, needed below \delimitedtextparameter#1% unhbox\scratchbox - % \penalty\!!tenthousand % else overfull boxes +% \penalty\!!tenthousand % else overfull boxes, but that's better than dangling periods + \kern\delimitedtextsignal % +- \prewordbreak + \fi + \endgroup} + +\def\dohandleleftdelimitedtext#1#2% + {\begingroup + \setbox\scratchbox\hbox{\delimitedtextparameter#1}% + \ifdim\wd\scratchbox>\zeropoint + \ifdim\lastkern=\delimitedtextsignal + \unkern + \hskip\hspaceamount\currentlanguage{interquotation}% + \else\ifdim\lastskip=\delimitedtextsignal + \unskip + \hskip\hspaceamount\currentlanguage{interquotation}% + \else + #2% + \fi\fi + \strut % new, needed below + \ifhmode % else funny pagebeaks + \penalty\!!tenthousand + \hskip\zeropoint % == \prewordbreak + \fi + \strut % new, needed below + \delimitedtextparameter#1% unhbox\scratchbox \hskip\delimitedtextsignal % +- \prewordbreak \fi \endgroup} +\def\dohandlerightdelimitedtext#1#2% + {\begingroup + \setbox\scratchbox\hbox{\delimitedtextparameter#1}% + \ifdim\wd\scratchbox>\zeropoint + \ifdim\lastkern=\delimitedtextsignal + \unkern + \hskip\hspaceamount\currentlanguage{interquotation}% + \else\ifdim\lastskip=\delimitedtextsignal + \unskip + \hskip\hspaceamount\currentlanguage{interquotation}% + \else + #2% + \fi\fi + \ifhmode % else funny pagebeaks + \penalty\!!tenthousand + \hskip\zeropoint % == \prewordbreak + \fi + \strut % new, needed below + \delimitedtextparameter#1% unhbox\scratchbox + \kern\delimitedtextsignal % +- \prewordbreak + \fi + \endgroup} + \def\ignoredelimitedtext#1% {\delimitedtextparameter#1} \def\handledelimitedtext#1% {\dohandledelimitedtext{#1}\relax} +\def\handleleftdelimitedtext#1% + {\dohandleleftdelimitedtext{#1}\relax} + +\def\handlerightdelimitedtext#1% + {\dohandlerightdelimitedtext{#1}\relax} + +% \unexpanded\def\dodelimitedtextpar +% {\dohandledelimitedtext\c!left\relax +% \groupedcommand +% \donothing +% {\dohandledelimitedtext\c!right\removelastskip +% \popdelimitedtext}} + \unexpanded\def\dodelimitedtextpar - {\dohandledelimitedtext\c!left\relax + {\dohandleleftdelimitedtext\c!left\relax \groupedcommand \donothing - {\dohandledelimitedtext\c!right\removelastskip + {\dohandlerightdelimitedtext\c!right\removelastskip \popdelimitedtext}} \unexpanded\def\dodelimitedtexttxt {\doifelse{\delimitedtextparameter\c!style}\v!normal \doquoteddelimited\doattributeddelimited} +% \def\doquoteddelimited +% {\dohandledelimitedtext\c!left\relax +% \groupedcommand +% \donothing +% {\dohandledelimitedtext\c!right +% \removelastskip +% \popdelimitedtext}} + \def\doquoteddelimited - {\dohandledelimitedtext\c!left\relax + {\dohandleleftdelimitedtext\c!left\relax \groupedcommand \donothing - {\dohandledelimitedtext\c!right + {\dohandlerightdelimitedtext\c!right \removelastskip \popdelimitedtext}} diff --git a/Master/texmf-dist/tex/context/base/core-ntb.tex b/Master/texmf-dist/tex/context/base/core-ntb.tex index 75c3b55405e..9e6eadb9af7 100644 --- a/Master/texmf-dist/tex/context/base/core-ntb.tex +++ b/Master/texmf-dist/tex/context/base/core-ntb.tex @@ -255,16 +255,16 @@ \let\setupTBLsection\relax -% \setupTABLE [y] [first][background=color,backgroundcolor=blue,frame=off,bottomframe=on,topframe=on,framecolor=white] +% % \setupTABLE [y] [first][background=color,backgroundcolor=blue,frame=off,bottomframe=on,topframe=on,framecolor=white] % \setupTABLE [first][first][backgroundcorner=2,corner=10,frame=on] % \setupTABLE [last] [first][backgroundcorner=4,corner=12,frame=on] - +% % \setupTABLE [row] [each] [background=color,backgroundcolor=blue,frame=on,framecolor=white] % \setupTABLE [first][2] [corner=8] % \setupTABLE [last] [2] [corner=5] % \setupTABLE [first][last] [corner=7] % \setupTABLE [last] [last] [corner=6] - +% % \startTEXpage % \bTABLE[frame=off,align=middle] % \bTR \bTD one \eTD \bTD two \eTD \bTD three \eTD \eTR @@ -272,6 +272,16 @@ % \bTR \bTD alpha \eTD \bTD beta \eTD \bTD gamma \eTD \eTR % \eTABLE % \stopTEXpage +% +% \setupTABLE [first] [two][corner=2] % special case +% \setupTABLE [last] [two][corner=4] % special case +% +% \startTEXpage +% \bTABLE[frame=off,align=middle] +% \bTR \bTD one \eTD \bTD two \eTD \bTD three \eTD \eTR +% \bTR \bTD first \eTD \bTD second \eTD \bTD third \eTD \eTR +% \eTABLE +% \stopTEXpage \def\setupTBLcell#1#2% cell over col over row {\setupTBLsection % already forgotten @@ -325,6 +335,15 @@ \ifnum\positiverow=\maximumrow\relax \ifnum\positivecol=\plusone \csname\@@tblprefix\c!x\v!first\c!y\v!last\endcsname \fi\fi + % special case: two rows and last row : two&first and two&last (round corners) + \ifnum\maximumrow=\plustwo\relax + \ifnum\positiverow=\maximumrow\relax \ifnum\positivecol=\plusone + \csname\@@tblprefix\c!x\v!first\c!y\v!two\endcsname + \fi\fi + \ifnum\positiverow=\maximumrow\relax \ifnum\positivecol=\maximumcol\relax + \csname\@@tblprefix\c!x\v!last\c!y\v!two\endcsname + \fi\fi + \fi % header things \ifnum#1>\noftblhdnxlines\else \executeifdefined{\@@tblprefix\v!header\v!each }\donothing diff --git a/Master/texmf-dist/tex/context/base/core-trf.tex b/Master/texmf-dist/tex/context/base/core-trf.tex index cabafb30305..7a62d5392f1 100644 --- a/Master/texmf-dist/tex/context/base/core-trf.tex +++ b/Master/texmf-dist/tex/context/base/core-trf.tex @@ -20,7 +20,7 @@ %D Scaling: -\def\scale{\dodoubleempty\doscalenextbox[\??xy]} +\unexpanded\def\scale{\dodoubleempty\doscalenextbox[\??xy]} % probably too many dimens / the width calculations can go % since we may assume scaling is available (was not true @@ -533,7 +533,7 @@ \flushnextbox \egroup}} -\def\mirror +\unexpanded\def\mirror {\domirrorbox\hbox} % \setbox0=\hbox{gans} diff --git a/Master/texmf-dist/tex/context/base/core-var.tex b/Master/texmf-dist/tex/context/base/core-var.tex index 4db5cb6e55e..6b019d65803 100644 --- a/Master/texmf-dist/tex/context/base/core-var.tex +++ b/Master/texmf-dist/tex/context/base/core-var.tex @@ -451,6 +451,11 @@ \getvariable{#2}\s!set \errorisfatalfalse} +\long\def\setvariable #1#2#3{\long\setvalue {\??vars:#1:#2}{#3}} +\long\def\setevariable#1#2#3{\long\setevalue{\??vars:#1:#2}{#3}} +\long\def\setgvariable#1#2#3{\long\setgvalue{\??vars:#1:#2}{#3}} +\long\def\setxvariable#1#2#3{\long\setxvalue{\??vars:#1:#2}{#3}} + \beginTEX \def\getvariable#1#2% to be sped up diff --git a/Master/texmf-dist/tex/context/base/enco-pfr.tex b/Master/texmf-dist/tex/context/base/enco-pfr.tex index 52069bfe981..199d48fd3a8 100644 --- a/Master/texmf-dist/tex/context/base/enco-pfr.tex +++ b/Master/texmf-dist/tex/context/base/enco-pfr.tex @@ -212,6 +212,7 @@ \edef\currentencoding{#1}% \doifvaluesomething\pdffontfileresource {\startreadingfile + \ignorelines % just in case \par is redefined; this thing can get called anywhere \readsysfile{pdfr-\getvalue\pdffontfileresource}\donothing\donothing \stopreadingfile \letgvalue\pdffontfileresource\empty}% diff --git a/Master/texmf-dist/tex/context/base/enco-uc.tex b/Master/texmf-dist/tex/context/base/enco-uc.tex index fb709c82d17..981eb6ae455 100644 --- a/Master/texmf-dist/tex/context/base/enco-uc.tex +++ b/Master/texmf-dist/tex/context/base/enco-uc.tex @@ -303,6 +303,27 @@ \stopencoding +%D Mojca's and Taco's additions: + +\startencoding[uc] + +\definecharacter textasciicircum {\uchar{0}{94}} % 5e +\definecharacter textgrave {\uchar{0}{96}} % 60 +\definecharacter textdiaeresis {\uchar{0}{168}} % a8 +%definecharacter textmacron {\uchar{0}{175}} % af +%definecharacter textacute {\uchar{0}{180}} % b4 +%definecharacter textcedilla {\uchar{0}{184}} % b8 +\definecharacter textcircumflex {\uchar{2}{198}} % c6 +\definecharacter textcaron {\uchar{2}{199}} % c7 +\definecharacter textbreve {\uchar{2}{216}} % d8 +\definecharacter textdotaccent {\uchar{2}{217}} % d9 +\definecharacter textring {\uchar{2}{218}} % da +\definecharacter textogonek {\uchar{2}{219}} % db +\definecharacter texttilde {\uchar{2}{220}} % dc +\definecharacter texthungarumlaut {\uchar{2}{221}} % dd + +\stopencoding + %D Vietnamese: \startencoding[uc] diff --git a/Master/texmf-dist/tex/context/base/lang-mis.tex b/Master/texmf-dist/tex/context/base/lang-mis.tex index de926b41782..aa763a71918 100644 --- a/Master/texmf-dist/tex/context/base/lang-mis.tex +++ b/Master/texmf-dist/tex/context/base/lang-mis.tex @@ -329,12 +329,30 @@ %D In those situations where the nature of characters is %D less predictable, we can use the more direct approach: -\unexpanded\def\directdiscretionary#1% +\def\directdiscretionary + {\csname + \ifcase\discretionarymode + \strippedcsname\dononemodediscretionary + \else + \strippedcsname\dodirectdiscretionary + \fi + \endcsname} + +\def\indirectdiscretionary + {\csname + \ifcase\discretionarymode + \strippedcsname\dononemodediscretionary + \else + \strippedcsname\doindirectdiscretionary + \fi + \endcsname} + +\unexpanded\def\dodirectdiscretionary#1% {\edef\discretionarytoken{\detokenize{#1}}% \let\textmodediscretionary\compoundhyphen \executeifdefined{\@tmd@action@\discretionarytoken}{\indirectdiscretionary{#1}}} -\unexpanded\def\indirectdiscretionary#1% +\unexpanded\def\doindirectdiscretionary#1% {\prewordbreak\discretionary{\hbox{#1}}{}{\hbox{#1}}\allowbreak\postwordbreak} \def\definetextmodediscretionary #1 diff --git a/Master/texmf-dist/tex/context/base/math-pln.tex b/Master/texmf-dist/tex/context/base/math-pln.tex index 386b67d9bcf..5ea7bc6fed1 100644 --- a/Master/texmf-dist/tex/context/base/math-pln.tex +++ b/Master/texmf-dist/tex/context/base/math-pln.tex @@ -103,7 +103,9 @@ \def\!{\mskip-\thinmuskip} \def\*{\discretionary{\thinspace\the\textfont2\char2}{}{}} -{\catcode`\'=\active \gdef'{^\bgroup\prim@s}} +% {\catcode`\'=\active \gdef'{^\bgroup\prim@s}} + +\def\activemathquote{^\bgroup\prim@s} \def\prim@s {\prime\futurelet\next\pr@m@s} @@ -135,7 +137,9 @@ \def\pr@@@t#1#2% {#2\egroup} -{\catcode`\_=\active \global\let_=\_} % _ in math is either subscript or \_ +% {\catcode`\_=\active \global\let_=\_} % _ in math is either subscript or \_ + +\let\activemathunderscore\_ \def\relbar {\mathrel{\smash-}} % - has the same height as + \def\Relbar {\mathrel=} @@ -354,4 +358,30 @@ &\kern-\displaywidth\rlap{$\@lign##$}\tabskip\displaywidth\crcr #1\crcr}} +% temporary here + +% \startcatcodetable \mthcatcodes +% \setcatcodetable\ctxcatcodes +% \catcode`\_ = 13 +% \catcode`\' = 13 +% \stopcatcodetable +% +% \letcatcodecommand \mthcatcodes `\_ \activemathunderscore +% \letcatcodecommand \mthcatcodes `\' \activemathquote +% +% \appendtoks \setcatcodetable\mthcatcodes \to \everymath + +% tricky, but some day we will reimplement math + +\bgroup + \catcode`\_ = 13 + \catcode`\' = 13 + \doglobal\appendtoks + \let_\activemathunderscore + \let'\activemathquote + \to \everymath +\egroup + +% so far + \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/regi-8859-1.tex b/Master/texmf-dist/tex/context/base/regi-8859-1.tex index 268d41b6872..6f515251882 100644 --- a/Master/texmf-dist/tex/context/base/regi-8859-1.tex +++ b/Master/texmf-dist/tex/context/base/regi-8859-1.tex @@ -16,13 +16,10 @@ %D %D (Contributors to the original file: Daniel Flipo, Hans Hagen & Denis Roegel.) %D -%D Usage: -%D \type{\enableregime[iso-8859-1]} or -%D \type{\enableregime[latin1]} or -%D \type{\enableregime[il1]} +%D Usage: \type{\enableregime[8859-1]} (see \type {regi-syn} for +%D alternatives calls). - -\startregime[iso-8859-1] +\startregime[8859-1] \defineactivetoken 128 {\unknownchar} % 0080 \defineactivetoken 129 {\unknownchar} % 0081 diff --git a/Master/texmf-dist/tex/context/base/regi-8859-10.tex b/Master/texmf-dist/tex/context/base/regi-8859-10.tex index 53d80b6d702..79d74d952ac 100644 --- a/Master/texmf-dist/tex/context/base/regi-8859-10.tex +++ b/Master/texmf-dist/tex/context/base/regi-8859-10.tex @@ -13,10 +13,8 @@ %D Support for iso-8859-10/Latin6 input encoding (regime) for Nordic languages. %D -%D Usage: -%D \type{\enableregime[iso-8859-10]} or -%D \type{\enableregime[latin6]} or -%D \type{\enableregime[il6]} +%D Usage: \type{\enableregime[8859-10]} (see \type {regi-syn} for +%D alternatives calls). \startregime[iso-8859-10] diff --git a/Master/texmf-dist/tex/context/base/regi-8859-13.tex b/Master/texmf-dist/tex/context/base/regi-8859-13.tex index e17907e3efb..a6dbe376f01 100644 --- a/Master/texmf-dist/tex/context/base/regi-8859-13.tex +++ b/Master/texmf-dist/tex/context/base/regi-8859-13.tex @@ -14,11 +14,8 @@ %D Support for iso-8859-13/Latin7 input encoding (regime) for Baltic languages, %D see also iso-8859-4 and cp1257. %D -%D Usage: -%D \type{\enableregime[iso-8859-13]} or -%D \type{\enableregime[latin7]} or -%D \type{\enableregime[il7]} - +%D Usage: \type{\enableregime[8859-13]} (see \type {regi-syn} for +%D alternatives calls). \startregime[iso-8859-13] diff --git a/Master/texmf-dist/tex/context/base/regi-8859-15.tex b/Master/texmf-dist/tex/context/base/regi-8859-15.tex index 1b643df1520..cf788d3f3b3 100644 --- a/Master/texmf-dist/tex/context/base/regi-8859-15.tex +++ b/Master/texmf-dist/tex/context/base/regi-8859-15.tex @@ -11,16 +11,15 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -%D Support for iso-8859-15/Latin9 input encoding (regime) for West European languages, -%D almost the same as iso-8859-1 with rarely used symbols (currency symbol,%D fractions, accents) replaced by Euro and some additional letters,%D see also cp1252. +%D Support for iso-8859-15/Latin9 input encoding (regime) for +%D West European languages, almost the same as iso-8859-1 with rarely +%D used symbols (currency symbol,%D fractions, accents) replaced by +%D Euro and some additional letters,%D see also cp1252. %D -%D Usage: -%D \type{\enableregime[iso-8859-9]} or -%D \type{\enableregime[latin9]} or -%D \type{\enableregime[il9]} +%D Usage: \type{\enableregime[8859-15]} (see \type {regi-syn} for +%D alternatives calls). - -\startregime[iso-8859-15] +\startregime[8859-15] \defineactivetoken 128 {\unknownchar} % 0080 \defineactivetoken 129 {\unknownchar} % 0081 diff --git a/Master/texmf-dist/tex/context/base/regi-8859-16.tex b/Master/texmf-dist/tex/context/base/regi-8859-16.tex index 453472a4090..96f0a15d462 100644 --- a/Master/texmf-dist/tex/context/base/regi-8859-16.tex +++ b/Master/texmf-dist/tex/context/base/regi-8859-16.tex @@ -13,13 +13,10 @@ %D Support for iso-8859-16/Latin10 input encoding (regime) for Romanian. %D -%D Usage: -%D \type{\enableregime[iso-8859-16]} or -%D \type{\enableregime[latin10]} or -%D \type{\enableregime[il10]} +%D Usage: \type{\enableregime[8859-16]} (see \type {regi-syn} for +%D alternatives calls). - -\startregime[iso-8859-16] +\startregime[8859-16] \defineactivetoken 128 {\unknownchar} % 0080 \defineactivetoken 129 {\unknownchar} % 0081 diff --git a/Master/texmf-dist/tex/context/base/regi-8859-2.tex b/Master/texmf-dist/tex/context/base/regi-8859-2.tex index b6a83e0e726..81fe8419ed5 100644 --- a/Master/texmf-dist/tex/context/base/regi-8859-2.tex +++ b/Master/texmf-dist/tex/context/base/regi-8859-2.tex @@ -11,16 +11,13 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -%D Support for iso-8859-2/Latin2 input encoding (regime) for Central European languages, -%D see also cp1250. +%D Support for iso-8859-2/Latin2 input encoding (regime) for +%D Central European languages, see also cp1250. %D -%D Usage: -%D \type{\enableregime[iso-8859-2]} or -%D \type{\enableregime[latin2]} or -%D \type{\enableregime[il2]} +%D Usage: \type{\enableregime[8859-2]} (see \type {regi-syn} for +%D alternatives calls). - -\startregime[iso-8859-2] +\startregime[8859-2] \defineactivetoken 128 {\unknownchar} % 0080 \defineactivetoken 129 {\unknownchar} % 0081 diff --git a/Master/texmf-dist/tex/context/base/regi-8859-3.tex b/Master/texmf-dist/tex/context/base/regi-8859-3.tex index 5ae115cc78f..dcb8be67f24 100644 --- a/Master/texmf-dist/tex/context/base/regi-8859-3.tex +++ b/Master/texmf-dist/tex/context/base/regi-8859-3.tex @@ -11,16 +11,13 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -%D Support for iso-8859-3/Latin3 input encoding (regime) for South European languages, -%D esp. for Esperanto and Maltese. +%D Support for iso-8859-3/Latin3 input encoding (regime) for South +%D European languages, esp. for Esperanto and Maltese. %D -%D Usage: -%D \type{\enableregime[iso-8859-3]} or -%D \type{\enableregime[latin3]} or -%D \type{\enableregime[il3]} +%D Usage: \type{\enableregime[8859-3]} (see \type {regi-syn} for +%D alternatives calls). - -\startregime[iso-8859-3] +\startregime[8859-3] \defineactivetoken 128 {\unknownchar} % 0080 \defineactivetoken 129 {\unknownchar} % 0081 diff --git a/Master/texmf-dist/tex/context/base/regi-8859-4.tex b/Master/texmf-dist/tex/context/base/regi-8859-4.tex index eaaf9321689..3ebe66a137e 100644 --- a/Master/texmf-dist/tex/context/base/regi-8859-4.tex +++ b/Master/texmf-dist/tex/context/base/regi-8859-4.tex @@ -11,16 +11,13 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -%D Support for iso-8859-4/Latin4 input encoding (regime) for West European languages, -%D see also cp1257 and iso-8859-13. +%D Support for iso-8859-4/Latin4 input encoding (regime) for West +%D European languages, see also cp1257 and iso-8859-13. %D -%D Usage: -%D \type{\enableregime[iso-8859-4]} or -%D \type{\enableregime[latin4]} or -%D \type{\enableregime[il4]} +%D Usage: \type{\enableregime[8859-4]} (see \type {regi-syn} for +%D alternatives calls). - -\startregime[iso-8859-4] +\startregime[8859-4] \defineactivetoken 128 {\unknownchar} % 0080 \defineactivetoken 129 {\unknownchar} % 0081 diff --git a/Master/texmf-dist/tex/context/base/regi-8859-5.tex b/Master/texmf-dist/tex/context/base/regi-8859-5.tex index fe9fc0cc076..531226433c1 100644 --- a/Master/texmf-dist/tex/context/base/regi-8859-5.tex +++ b/Master/texmf-dist/tex/context/base/regi-8859-5.tex @@ -14,11 +14,10 @@ %D Support for iso-8859-5 input encoding (regime) for Cyrillic, %D see also regi-cyr and regi-cyp. %D -%D Usage: -%D \type{\enableregime[iso-8859-5]} +%D Usage: \type{\enableregime[8859-5]} (see \type {regi-syn} for +%D alternatives calls). - -\startregime[iso-8859-5] +\startregime[8859-5] \defineactivetoken 128 {\unknownchar} % 0080 \defineactivetoken 129 {\unknownchar} % 0081 diff --git a/Master/texmf-dist/tex/context/base/regi-8859-7.tex b/Master/texmf-dist/tex/context/base/regi-8859-7.tex index c858d45e6fe..80259be6508 100644 --- a/Master/texmf-dist/tex/context/base/regi-8859-7.tex +++ b/Master/texmf-dist/tex/context/base/regi-8859-7.tex @@ -16,12 +16,10 @@ %D %D (Contributor to the original file: Apostolos Syropoulos.) %D -%D Usage: -%D \type{\enableregime[iso-8859-7]} or -%D \type{\enableregime[grk]} +%D Usage: \type{\enableregime[8859-7]} (see \type {regi-syn} for +%D alternatives calls). - -\startregime[iso-8859-7] +\startregime[8859-7] \defineactivetoken 128 {\unknownchar} % 0080 \defineactivetoken 129 {\unknownchar} % 0081 diff --git a/Master/texmf-dist/tex/context/base/regi-8859-9.tex b/Master/texmf-dist/tex/context/base/regi-8859-9.tex index 302bcc9c65a..8460d739b1c 100644 --- a/Master/texmf-dist/tex/context/base/regi-8859-9.tex +++ b/Master/texmf-dist/tex/context/base/regi-8859-9.tex @@ -14,13 +14,10 @@ %D Support for iso-8859-9/Latin5 input encoding (regime) for Turkish, %D see also cp1254. %D -%D Usage: -%D \type{\enableregime[iso-8859-9]} or -%D \type{\enableregime[latin5]} or -%D \type{\enableregime[il5]} +%D Usage: \type{\enableregime[8859-9]} (see \type {regi-syn} for +%D alternatives calls). - -\startregime[iso-8859-9] +\startregime[8859-9] \defineactivetoken 128 {\unknownchar} % 0080 \defineactivetoken 129 {\unknownchar} % 0081 diff --git a/Master/texmf-dist/tex/context/base/regi-syn.tex b/Master/texmf-dist/tex/context/base/regi-syn.tex index e57446ad801..b29c0677526 100644 --- a/Master/texmf-dist/tex/context/base/regi-syn.tex +++ b/Master/texmf-dist/tex/context/base/regi-syn.tex @@ -36,6 +36,17 @@ \defineregimesynonym [il9] [8859-15] \defineregimesynonym [il10] [8859-16] +\defineregimesynonym [iso-8859-1] [8859-1] +\defineregimesynonym [iso-8859-2] [8859-2] +\defineregimesynonym [iso-8859-3] [8859-3] +\defineregimesynonym [iso-8859-4] [8859-4] +\defineregimesynonym [iso-8859-9] [8859-9] +\defineregimesynonym [iso-8859-10] [8859-10] +\defineregimesynonym [iso-8859-13] [8859-13] +%defineregimesynonym [iso-8859-14] [8859-14] +\defineregimesynonym [iso-8859-15] [8859-15] +\defineregimesynonym [iso-8859-16] [8859-16] + \defineregimesynonym [latin1] [8859-1] \defineregimesynonym [latin2] [8859-2] \defineregimesynonym [latin3] [8859-3] diff --git a/Master/texmf-dist/tex/context/base/rlxtools.rlx b/Master/texmf-dist/tex/context/base/rlxtools.rlx index 3d45798049f..da605f6ee16 100644 --- a/Master/texmf-dist/tex/context/base/rlxtools.rlx +++ b/Master/texmf-dist/tex/context/base/rlxtools.rlx @@ -38,6 +38,15 @@ + + /.eps + /.pdf + + texmfstart pstopdf --convert + + + + /.svg /.pdf @@ -91,4 +100,37 @@ + + /.tif + /.pdf + + texmfstart pstopdf --convert + --inputpath= + --outputpath= + .gif + + + + + /.tiff + /.pdf + + texmfstart pstopdf --convert + --inputpath= + --outputpath= + .gif + + + + + / + / + + texmfstart pstopdf --convert --method=3 + --inputpath= + --outputpath=/ + + + + diff --git a/Master/texmf-dist/tex/context/base/s-abr-01.tex b/Master/texmf-dist/tex/context/base/s-abr-01.tex index 648780320ff..3be27702396 100644 --- a/Master/texmf-dist/tex/context/base/s-abr-01.tex +++ b/Master/texmf-dist/tex/context/base/s-abr-01.tex @@ -209,7 +209,8 @@ \logo [URI] {uri} \logo [URL] {url} \logo [USA] {usa} -\logo [UTF] {utf8} +\logo [UTF] {utf} +\logo [UCS] {ucs} \logo [USENET] {usenet} \logo [UTF] {utf} \logo [WDT] {wdt} diff --git a/Master/texmf-dist/tex/context/base/s-abr-02.tex b/Master/texmf-dist/tex/context/base/s-abr-02.tex index e2cdbfb72da..005559ef366 100644 --- a/Master/texmf-dist/tex/context/base/s-abr-02.tex +++ b/Master/texmf-dist/tex/context/base/s-abr-02.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. \usemodule[abr-01] @@ -19,6 +19,4 @@ \setupcapitals[\c!title=\v!no] -\protect - -\endinput +\protect \endinput diff --git a/Master/texmf-dist/tex/context/base/syst-cat.tex b/Master/texmf-dist/tex/context/base/syst-cat.tex index c4f6711ed6c..fb672c327d8 100644 --- a/Master/texmf-dist/tex/context/base/syst-cat.tex +++ b/Master/texmf-dist/tex/context/base/syst-cat.tex @@ -69,8 +69,8 @@ \def\defcatcodecommandc % only first time {\expandafter\gdef\csname CCD:\number\cctcountera:\number\cctcounterb\expandafter\endcsname - \expandafter##\expandafter1\expandafter - {\expandafter\def\csname CCC:\number\cctcountera:\number\cctcounterb\endcsname{##1}}% + \expandafter##\expandafter1\expandafter + {\expandafter\def\csname CCC:\number\cctcountera:\number\cctcounterb\endcsname{##1}}% \reinstatecatcodecommanda \csname CCD:\number\cctcountera:\number\cctcounterb\endcsname} @@ -118,6 +118,7 @@ \ifx\ctxcatcodes \undefined \newcatcodetable \ctxcatcodes \fi \ifx\vrbcatcodes \undefined \newcatcodetable \vrbcatcodes \fi \ifx\prtcatcodes \undefined \newcatcodetable \prtcatcodes \fi +\ifx\mthcatcodes \undefined \newcatcodetable \mthcatcodes \fi % math \ifx\xmlcatcodesn\undefined \newcatcodetable \xmlcatcodesn \fi % normal \ifx\xmlcatcodese\undefined \newcatcodetable \xmlcatcodese \fi % entitle \ifx\xmlcatcodesr\undefined \newcatcodetable \xmlcatcodesr \fi % reduce diff --git a/Master/texmf-dist/tex/context/base/syst-pln.tex b/Master/texmf-dist/tex/context/base/syst-pln.tex index 0b74d6d0fe6..9582c650890 100644 --- a/Master/texmf-dist/tex/context/base/syst-pln.tex +++ b/Master/texmf-dist/tex/context/base/syst-pln.tex @@ -604,7 +604,8 @@ \chardef\#=`\# \chardef\$=`\$ -\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em}} +%def\_{\leavevmode \kern.06em \vbox{\hrule width.3em}} +\def\_{\dontleavehmode \kern.06em \vbox{\hrule width.3em}} %D Replaced later on: diff --git a/Master/texmf-dist/tex/context/base/type-ghz.tex b/Master/texmf-dist/tex/context/base/type-ghz.tex index 318e6d596ed..afb637818f9 100644 --- a/Master/texmf-dist/tex/context/base/type-ghz.tex +++ b/Master/texmf-dist/tex/context/base/type-ghz.tex @@ -90,8 +90,20 @@ \starttypescript[optima-nova][texnansi,ec] % will change to more narrow tt \definetypeface[optima][ss][sans][optima-nova] [default][encoding=\typescripttwo] \definetypeface[optima][rm][sans][optima-nova] [default][encoding=\typescripttwo] - \definetypeface[optima][tt][mono][latin-modern][default][encoding=\typescripttwo,rscale=1.125] - \definetypeface[optima][mm][mono][latin-modern][default][encoding=\typescripttwo,rscale=1.125] +% \definetypeface[optima][tt][mono][latin-modern][default][encoding=\typescripttwo,rscale=1.125] +% \definetypeface[optima][mm][mono][latin-modern][default][encoding=\typescripttwo,rscale=1.125] + \definetypeface[optima][tt][mono][latin-modern][default][encoding=\typescripttwo,rscale=1.1] + \definetypeface[optima][mm][mono][latin-modern][default][encoding=\typescripttwo,rscale=1.1] + \quittypescriptscanning +\stoptypescript + +\starttypescript[optima-nova-os][texnansi,ec] % will change to more narrow tt + \definetypeface[optima-os][ss][sans][optima-nova-os] [default][encoding=\typescripttwo] + \definetypeface[optima-os][rm][sans][optima-nova-os] [default][encoding=\typescripttwo] +% \definetypeface[optima-os][tt][mono][latin-modern] [default][encoding=\typescripttwo,rscale=1.125] +% \definetypeface[optima-os][mm][mono][latin-modern] [default][encoding=\typescripttwo,rscale=1.125] + \definetypeface[optima-os][tt][mono][latin-modern] [default][encoding=\typescripttwo,rscale=1.1] + \definetypeface[optima-os][mm][mono][latin-modern] [default][encoding=\typescripttwo,rscale=1.1] \quittypescriptscanning \stoptypescript diff --git a/Master/texmf-dist/tex/context/base/unic-ini.tex b/Master/texmf-dist/tex/context/base/unic-ini.tex index ec85c3c9eb9..587edd308ed 100644 --- a/Master/texmf-dist/tex/context/base/unic-ini.tex +++ b/Master/texmf-dist/tex/context/base/unic-ini.tex @@ -50,7 +50,7 @@ %D In \UTF-8 the characters in the range 128---191 are illegal %D as first characters. The characters 254 and 255 are %D completely illegal and should not appear at all (they are -%D related to UTF16). +%D related to UTF-16). %D %D The unicode number for an \UTF-8 sequence can be calculated %D as follows: diff --git a/Master/texmf-dist/tex/context/base/xtag-ini.tex b/Master/texmf-dist/tex/context/base/xtag-ini.tex index b6845a90ccb..155034145f7 100644 --- a/Master/texmf-dist/tex/context/base/xtag-ini.tex +++ b/Master/texmf-dist/tex/context/base/xtag-ini.tex @@ -2310,6 +2310,12 @@ \egroup \convertcommand\@@XML@@string\to#1} +% this has to expand nicely: +% +% ]> +% +% so keep the following as is! + \def\defXMLclean#1#2% {\bgroup \enableXMLexpansion diff --git a/Master/texmf-dist/tex/context/interface/cont-cz.xml b/Master/texmf-dist/tex/context/interface/cont-cz.xml index 62d96637364..7ac5c0c4dba 100644 --- a/Master/texmf-dist/tex/context/interface/cont-cz.xml +++ b/Master/texmf-dist/tex/context/interface/cont-cz.xml @@ -5955,6 +5955,9 @@ + + + diff --git a/Master/texmf-dist/tex/context/interface/cont-de.xml b/Master/texmf-dist/tex/context/interface/cont-de.xml index 65040942f4f..b9a968c7b2a 100644 --- a/Master/texmf-dist/tex/context/interface/cont-de.xml +++ b/Master/texmf-dist/tex/context/interface/cont-de.xml @@ -5955,6 +5955,9 @@ + + + diff --git a/Master/texmf-dist/tex/context/interface/cont-en.xml b/Master/texmf-dist/tex/context/interface/cont-en.xml index 6a730113a50..e87f461957d 100644 --- a/Master/texmf-dist/tex/context/interface/cont-en.xml +++ b/Master/texmf-dist/tex/context/interface/cont-en.xml @@ -5955,6 +5955,9 @@ + + + diff --git a/Master/texmf-dist/tex/context/interface/cont-fr.xml b/Master/texmf-dist/tex/context/interface/cont-fr.xml index e78ea512688..3ac1b70ac65 100644 --- a/Master/texmf-dist/tex/context/interface/cont-fr.xml +++ b/Master/texmf-dist/tex/context/interface/cont-fr.xml @@ -5955,6 +5955,9 @@ + + + diff --git a/Master/texmf-dist/tex/context/interface/cont-it.xml b/Master/texmf-dist/tex/context/interface/cont-it.xml index 04fdcdb5932..b1a75e38bf6 100644 --- a/Master/texmf-dist/tex/context/interface/cont-it.xml +++ b/Master/texmf-dist/tex/context/interface/cont-it.xml @@ -5955,6 +5955,9 @@ + + + diff --git a/Master/texmf-dist/tex/context/interface/cont-nl.xml b/Master/texmf-dist/tex/context/interface/cont-nl.xml index 8f7fc581644..a3f20ef5d8b 100644 --- a/Master/texmf-dist/tex/context/interface/cont-nl.xml +++ b/Master/texmf-dist/tex/context/interface/cont-nl.xml @@ -5955,6 +5955,9 @@ + + + diff --git a/Master/texmf-dist/tex/context/interface/cont-ro.xml b/Master/texmf-dist/tex/context/interface/cont-ro.xml index bab6f0fbfad..930d549f924 100644 --- a/Master/texmf-dist/tex/context/interface/cont-ro.xml +++ b/Master/texmf-dist/tex/context/interface/cont-ro.xml @@ -5955,6 +5955,9 @@ + + + diff --git a/Master/texmf-dist/tex/context/interface/keys-cz.xml b/Master/texmf-dist/tex/context/interface/keys-cz.xml index d9f23f15045..8d8e2d89113 100644 --- a/Master/texmf-dist/tex/context/interface/keys-cz.xml +++ b/Master/texmf-dist/tex/context/interface/keys-cz.xml @@ -1,6 +1,6 @@ - + diff --git a/Master/texmf-dist/tex/context/interface/keys-de.xml b/Master/texmf-dist/tex/context/interface/keys-de.xml index 436912021a0..150127d8684 100644 --- a/Master/texmf-dist/tex/context/interface/keys-de.xml +++ b/Master/texmf-dist/tex/context/interface/keys-de.xml @@ -1,6 +1,6 @@ - + diff --git a/Master/texmf-dist/tex/context/interface/keys-en.xml b/Master/texmf-dist/tex/context/interface/keys-en.xml index ab36c37c5ee..124fcfac0f5 100644 --- a/Master/texmf-dist/tex/context/interface/keys-en.xml +++ b/Master/texmf-dist/tex/context/interface/keys-en.xml @@ -1,6 +1,6 @@ - + diff --git a/Master/texmf-dist/tex/context/interface/keys-fr.xml b/Master/texmf-dist/tex/context/interface/keys-fr.xml index 2ff014839b0..056b2481eb7 100644 --- a/Master/texmf-dist/tex/context/interface/keys-fr.xml +++ b/Master/texmf-dist/tex/context/interface/keys-fr.xml @@ -1,6 +1,6 @@ - + diff --git a/Master/texmf-dist/tex/context/interface/keys-it.xml b/Master/texmf-dist/tex/context/interface/keys-it.xml index 452cb2302ed..f7f399d46ad 100644 --- a/Master/texmf-dist/tex/context/interface/keys-it.xml +++ b/Master/texmf-dist/tex/context/interface/keys-it.xml @@ -1,6 +1,6 @@ - + diff --git a/Master/texmf-dist/tex/context/interface/keys-nl.xml b/Master/texmf-dist/tex/context/interface/keys-nl.xml index 41fbbe47f6b..7bbd6244b4c 100644 --- a/Master/texmf-dist/tex/context/interface/keys-nl.xml +++ b/Master/texmf-dist/tex/context/interface/keys-nl.xml @@ -1,6 +1,6 @@ - + diff --git a/Master/texmf-dist/tex/context/interface/keys-ro.xml b/Master/texmf-dist/tex/context/interface/keys-ro.xml index b5b913c2122..4f0be325289 100644 --- a/Master/texmf-dist/tex/context/interface/keys-ro.xml +++ b/Master/texmf-dist/tex/context/interface/keys-ro.xml @@ -1,6 +1,6 @@ - + -- cgit v1.2.3