diff options
author | Hans Hagen <pragma@wxs.nl> | 2007-01-12 15:56:00 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2007-01-12 15:56:00 +0100 |
commit | ef711d047d8d3e8d2cfb53e4c42b170365c06b84 (patch) | |
tree | 852e27402e9cfe63c8edf45f54cc0273abf54368 | |
parent | 4b886e1937606a539d02dafab04a2f5e399d7ca3 (diff) | |
download | context-ef711d047d8d3e8d2cfb53e4c42b170365c06b84.tar.gz |
stable 2007.01.12 15:56
27 files changed, 307 insertions, 213 deletions
diff --git a/scripts/context/ruby/base/ctx.rb b/scripts/context/ruby/base/ctx.rb index 4ee2715b8..f86e92d18 100644 --- a/scripts/context/ruby/base/ctx.rb +++ b/scripts/context/ruby/base/ctx.rb @@ -43,6 +43,7 @@ class CtxRunner @modules = Array.new @filters = Array.new @flags = Array.new + @local = false end def manipulate(ctxname=nil,defaultname=nil) @@ -117,18 +118,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 + 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 @@ -154,9 +155,9 @@ end 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 + 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 @@ -172,6 +173,11 @@ end else if suffix && suffix.empty? then suffix = @@suffix end end + if (REXML::XPath.first(root,"/ctx:job//ctx:preprocess/ctx:processors/@local").to_s =~ /(yes|true)/io rescue false) then + @local = true + else + @local = false + end REXML::XPath.each(root,"/ctx:job//ctx:preprocess/ctx:files") do |files| REXML::XPath.each(files,"ctx:file") do |pattern| preprocessor = pattern.attributes['processor'] @@ -189,9 +195,14 @@ end return end pattern = justtext(pattern) - Dir.glob(pattern).each do |oldfile| + oldfiles = Dir.glob(pattern) + if oldfiles.length == 0 then + report("no files match #{pattern}") + end + oldfiles.each do |oldfile| newfile = "#{oldfile}.#{suffix}" - if File.needsupdate(oldfile,newfile) then + newfile = File.basename(newfile) if @local + if File.expand_path(oldfile) != File.expand_path(newfile) && File.needsupdate(oldfile,newfile) then report("#{oldfile} needs preprocessing") begin File.delete(newfile) @@ -205,14 +216,16 @@ end command = REXML::Document.new(command.to_s) # don't infect original command = command.elements["ctx:processor"] begin - if suf = command.attributes['suffix'] then - newfile = "#{oldfile}.#{suf}" - end + newfile = "#{oldfile}.#{suf}" if suf = command.attributes['suffix'] + rescue + end + begin + newfile = File.basename(newfile) if @local rescue end - report("preprocessing #{oldfile} into #{newfile} using #{pp}") REXML::XPath.each(command,"ctx:old") do |value| replace(value,oldfile) end REXML::XPath.each(command,"ctx:new") do |value| replace(value,newfile) end + report("preprocessing #{oldfile} into #{newfile} using #{pp}") variables['old'] = oldfile variables['new'] = newfile REXML::XPath.each(command,"ctx:value") do |value| @@ -225,15 +238,19 @@ end unless ok = System.run(command) then report("error in preprocessing file #{oldfile}") end + begin + oldfile = File.basename(oldfile) if @local + rescue + end end end if FileTest.file?(newfile) then File.syncmtimes(oldfile,newfile) else - report("preprocessing #{oldfile} gave no #{newfile}") + report("check target location of #{newfile}") end else - report("#{oldfile} needs no preprocessing") + report("#{oldfile} needs no preprocessing (same file)") end @prepfiles[oldfile] = FileTest.file?(newfile) end @@ -258,7 +275,11 @@ end if @prepfiles.length > 0 then if log = File.open(ctlname,'w') then log << "<?xml version='1.0' standalone='yes'?>\n\n" - log << "<ctx:preplist>\n" + if @local then + log << "<ctx:preplist local='yes'>\n" + else + log << "<ctx:preplist local='no'>\n" + end @prepfiles.keys.sort.each do |prep| # log << "\t<ctx:prepfile done='#{yes_or_no(@prepfiles[prep])}'>#{File.basename(prep)}</ctx:prepfile>\n" log << "\t<ctx:prepfile done='#{yes_or_no(@prepfiles[prep])}'>#{prep}</ctx:prepfile>\n" diff --git a/scripts/context/ruby/base/kpse.rb b/scripts/context/ruby/base/kpse.rb index bff3cc1fa..a4babae55 100644 --- a/scripts/context/ruby/base/kpse.rb +++ b/scripts/context/ruby/base/kpse.rb @@ -197,7 +197,7 @@ module Kpse [progname,format,filename].join('-') end - def Kpse.formatpath(engine='pdfetex',enginepath=true) + def Kpse.formatpath(engine='pdftex',enginepath=true) # because engine support in distributions is not always # as we expect, we need to check for it; diff --git a/scripts/context/ruby/base/kpsefast.rb b/scripts/context/ruby/base/kpsefast.rb index 24ff1a0fa..8a9f89593 100644 --- a/scripts/context/ruby/base/kpsefast.rb +++ b/scripts/context/ruby/base/kpsefast.rb @@ -260,7 +260,7 @@ class KpseFast @rootpath = '' @treepath = '' @progname = 'kpsewhich' - @engine = 'pdfetex' + @engine = 'pdftex' @variables = Hash.new @expansions = Hash.new @files = Hash.new @@ -910,7 +910,7 @@ end # puts k.expansion("$TEXMF") # puts k.expanded_path("TEXINPUTS","context") - # k.progname, k.engine, k.format = 'context', 'pdfetex', 'tfm' + # k.progname, k.engine, k.format = 'context', 'pdftex', 'tfm' # k.scandisk = false # == must_exist # k.expand_variables diff --git a/scripts/context/ruby/base/tex.rb b/scripts/context/ruby/base/tex.rb index 5674157b5..ca73754f4 100644 --- a/scripts/context/ruby/base/tex.rb +++ b/scripts/context/ruby/base/tex.rb @@ -89,25 +89,27 @@ class TEX @@luafiles = "luafiles.tmp" @@luatarget = "lua/context" - ENV['PATH'].split(File::PATH_SEPARATOR).each do |p| - if System.unix? then - pp, pe = "#{p}/pdftex" , "#{p}/pdfetex" - else - pp, pe = "#{p}/pdftex.exe", "#{p}/pdfetex.exe" - end - if FileTest.file?(pe) then - # we assume no update - @@pdftex = 'pdfetex' - break - elsif FileTest.file?(pp) then - # we assume an update - @@pdftex = 'pdftex' - break - end - end + # we now drop pdfetex definitely + + # ENV['PATH'].split(File::PATH_SEPARATOR).each do |p| + # if System.unix? then + # pp, pe = "#{p}/pdftex" , "#{p}/pdfetex" + # else + # pp, pe = "#{p}/pdftex.exe", "#{p}/pdfetex.exe" + # end + # if FileTest.file?(pe) then # we assume no update + # @@pdftex = 'pdfetex' + # break + # elsif FileTest.file?(pp) then # we assume an update + # @@pdftex = 'pdftex' + # break + # end + # end + + # ['etex','pdfetex','standard'] .each do |e| @@texengines[e] = @@pdftex end + # ['tex','pdftex'] .each do |e| @@texengines[e] = 'pdftex' end - ['etex','pdfetex','standard'] .each do |e| @@texengines[e] = @@pdftex end - ['tex','pdftex'] .each do |e| @@texengines[e] = 'pdftex' end + ['tex','etex','pdftex','pdfetex','standard'] .each do |e| @@texengines[e] = 'pdftex' end ['aleph','omega'] .each do |e| @@texengines[e] = 'aleph' end ['xetex'] .each do |e| @@texengines[e] = 'xetex' end ['luatex'] .each do |e| @@texengines[e] = 'luatex' end @@ -166,10 +168,11 @@ class TEX ['cont-en','cont-nl','cont-de','cont-it', 'cont-fr','cont-cz','cont-ro','cont-uk'] .each do |f| @@texprocstr[f] = "\\emergencyend" end - # @@runoptions['xetex'] = ['--output-driver \\\"-d 4 -V 5\\\"'] # we need the pos pass - @@runoptions['xetex'] = ['--8bit,-no-pdf'] # from now on we assume (x)dvipdfmx to be used - @@runoptions['pdfetex'] = ['--8bit'] - @@runoptions['pdftex'] = ['--8bit'] # pdftex is now pdfetex + # @@runoptions['xetex'] = ['--output-driver \\\"-d 4 -V 5\\\"'] # we need the pos pass + # @@runoptions['xetex'] = ['--8bit','-no-pdf'] # from now on we assume (x)dvipdfmx to be used + @@runoptions['xetex'] = ['--8bit','-output-driver=\"xdvipdfmx -q -E -d 4 -V 5\"'] + @@runoptions['pdfetex'] = ['--8bit'] # obsolete + @@runoptions['pdftex'] = ['--8bit'] # pdftex is now pdfetex @@runoptions['luatex'] = ['--file-line-error'] @@runoptions['aleph'] = ['--8bit'] @@runoptions['mpost'] = ['--8bit'] @@ -188,7 +191,8 @@ class TEX 'forcetexutil', 'texutil', 'globalfile', 'autopath', 'purge', 'purgeall', 'keep', 'autopdf', 'xpdf', 'simplerun', 'verbose', - 'nooptionfile', 'nobackend', 'noctx', 'utfbom' + 'nooptionfile', 'nobackend', 'noctx', 'utfbom', + 'mkii', ] @@stringvars = [ 'modefile', 'result', 'suffix', 'response', 'path', @@ -326,6 +330,7 @@ class TEX str = '' # allocate [name].flatten.each do |n| if str = getvariable(n) then + str = str.join(" ") if str.class == Array unless (str.class == String) && str.empty? then report("option '#{n}' is set to '#{str}'") end @@ -435,10 +440,10 @@ class TEX if str.class == String then str.split(',') else str.flatten end end - def validtexformat(str) validsomething(str,@@texformats,'tex') end - def validmpsformat(str) validsomething(str,@@mpsformats,'mp' ) end - def validtexengine(str) validsomething(str,@@texengines,'pdfetex') end - def validmpsengine(str) validsomething(str,@@mpsengines,'mpost' ) end + def validtexformat(str) validsomething(str,@@texformats,'tex') end + def validmpsformat(str) validsomething(str,@@mpsformats,'mp' ) end + def validtexengine(str) validsomething(str,@@texengines,'pdftex') end + def validmpsengine(str) validsomething(str,@@mpsengines,'mpost' ) end def validtexmethod(str) [validsomething(str,@@texmethods)].flatten.first end def validmpsmethod(str) [validsomething(str,@@mpsmethods)].flatten.first end @@ -612,10 +617,10 @@ class TEX begin luatools = `texmfstart luatools --format=texmfscripts luatools.lua`.chomp.strip unless luatools.empty? then - runcommand(["luatex","--luaonly=#{luatools}","--generate","--verbose"]) + runcommand(["luatex","--luaonly #{luatools}","--generate","--verbose"]) end rescue - report("run 'luatex --luaonly=....../luatools.lua --generate' manually") + report("run 'luatex --luaonly pathto/luatools.lua --generate' manually") exit end end @@ -651,7 +656,10 @@ class TEX cleanupluafiles texformats.each do |texformat| report("generating tex format #{texformat}") - run_luatools("--ini --compile #{texformat}") + flags = ['--ini','--compile'] + flags << '--verbose' if getvariable('verbose') + flags << '--mkii' if getvariable('mkii') + run_luatools("#{flags.join(" ")} #{texformat}") end compileluafiles else @@ -1152,7 +1160,7 @@ class TEX if path then script = "#{path}/../lua/luatools.lua" if FileTest.file?(script) then - return runcommand("lua #{script} #{args}") + return runcommand("luatex --luaonly #{script} #{args}") end end end @@ -1528,12 +1536,16 @@ class TEX report("tex format: #{texformat}") if texengine && texformat then fixbackendvars(@@mappaths[texengine]) -if texengine == "luatex" then - run_luatools("--fmt=#{texformat} #{filename}") -else - progname = validprogname([getvariable('progname'),texformat,texengine]) - runcommand([quoted(texengine),prognameflag(progname),formatflag(texengine,texformat),tcxflag,runoptions(texengine),filename,texprocextras(texformat)]) -end + if texengine == "luatex" then + # currently we use luatools to start luatex but some day we should + # find a clever way to directly call luatex (problem is that we need + # to feed the explicit location of the format and lua initialization + # file) + run_luatools("--fmt=#{texformat} #{filename}") + else + progname = validprogname([getvariable('progname'),texformat,texengine]) + runcommand([quoted(texengine),prognameflag(progname),formatflag(texengine,texformat),tcxflag,runoptions(texengine),filename,texprocextras(texformat)]) + end # true else false @@ -1683,7 +1695,7 @@ end xdvfile = File.suffixed(rawname,'xdv') if FileTest.file?(xdvfile) then fixbackendvars('dvipdfm') - runcommand("xdvipdfmx -d 4 -V 5 #{xdvfile}") + runcommand("xdvipdfmx -q -d 4 -V 5 -E #{xdvfile}") end when 'xdv2pdf' then xdvfile = File.suffixed(rawname,'xdv') diff --git a/scripts/context/ruby/texexec.rb b/scripts/context/ruby/texexec.rb index 992766c05..f37cfd8c2 100644 --- a/scripts/context/ruby/texexec.rb +++ b/scripts/context/ruby/texexec.rb @@ -573,7 +573,7 @@ class Commands if (str = @commandline.option('engine')) && ! str.standard? && ! str.empty? then job.setvariable('texengine',str) elsif @commandline.oneof('pdfetex','pdftex','pdf') then - job.setvariable('texengine','pdfetex') + job.setvariable('texengine','pdftex') elsif @commandline.oneof('xetex','xtx') then job.setvariable('texengine','xetex') elsif @commandline.oneof('aleph') then @@ -601,6 +601,7 @@ class Commands else case job.getvariable('texengine') when 'pdfetex' then job.setvariable('backend','pdftex') + when 'pdftex' then job.setvariable('backend','pdftex') when 'luatex' then job.setvariable('backend','pdftex') when 'xetex' then job.setvariable('backend','xetex') when 'aleph' then job.setvariable('backend','dvipdfmx') diff --git a/scripts/context/ruby/texmfstart.rb b/scripts/context/ruby/texmfstart.rb index 9a19995a1..4d1e29761 100644 --- a/scripts/context/ruby/texmfstart.rb +++ b/scripts/context/ruby/texmfstart.rb @@ -425,7 +425,7 @@ class KpseFast @rootpath = '' @treepath = '' @progname = 'kpsewhich' - @engine = 'pdfetex' + @engine = 'pdftex' @variables = Hash.new @expansions = Hash.new @files = Hash.new @@ -1074,7 +1074,7 @@ end # puts k.expansion("$TEXMF") # puts k.expanded_path("TEXINPUTS","context") - # k.progname, k.engine, k.format = 'context', 'pdfetex', 'tfm' + # k.progname, k.engine, k.format = 'context', 'pdftex', 'tfm' # k.scandisk = false # == must_exist # k.expand_variables @@ -2571,10 +2571,10 @@ end if execute(ARGV) then report("\nexecution was successful") if $verbose - exit(1) + exit(0) else report("\nexecution failed") if $verbose - exit(0) + exit(1) end # exit (if ($?.to_i rescue 0) > 0 then 1 else 0 end) diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex index 407d56daf..13790edd9 100644 --- a/tex/context/base/cont-new.tex +++ b/tex/context/base/cont-new.tex @@ -13,7 +13,7 @@ % it's about time to clean up this file ... -\newcontextversion{2007.01.10 11:18} +\newcontextversion{2007.01.12 15:56} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex index 051b0f72d..00a2cb83d 100644 --- a/tex/context/base/context.tex +++ b/tex/context/base/context.tex @@ -42,7 +42,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2007.01.10 11:18} +\edef\contextversion{2007.01.12 15:56} %D For those who want to use this: @@ -66,23 +66,44 @@ \ifx\normalinput\undefined \let\normalinput\input \fi -\edef\mksuffix {mk\ifx\directlua\undefined ii\else iv\fi} +% trick: + +\ifx\directlua\undefined + \chardef\contextmarkmode = 2 +\else + \chardef\contextmarkmode = \directlua 0 { do + if arg then + local mkii = 4 + for k,v in pairs(arg) do + if v == "--mkii" then mkii = 2 break end + end + tex.sprint(mkii) + else + tex.sprint(2) + end + end } + % \ifnum\contextmarkmode=2 + % \immediate\write16{} + % \immediate\write16{>> Quitting LuaTeX, test mode only! <<} + % \immediate\write16{} + % \def\next{\errorstopmode \dump \endinput} + % \expandafter \expandafter \expandafter \next + % \fi +\fi \def\loadcorefile#1{\normalinput#1\relax} \def\loadmarkfile#1{\normalinput#1.\mksuffix\relax} -\ifx\directlua\undefined - \def\loadmarkivfile#1{} \let\loadmarkiifile\loadcorefile +\ifnum\contextmarkmode=4 + \def\loadmarkiifile#1{} \let\loadmarkivfile\loadcorefile \edef\mksuffix {mkiv} \edef\contextmark{MKIV} \else - \def\loadmarkiifile#1{} \let\loadmarkivfile\loadcorefile + \def\loadmarkivfile#1{} \let\loadmarkiifile\loadcorefile \edef\mksuffix {mkii} \edef\contextmark{MKII} \fi \let\loadmkiifile\loadmarkiifile \let\loadmkivfile\loadmarkivfile \let\loadmkfile \loadmarkfile -\edef\contextmark{MK \ifx\directlua\undefined II\else IV\fi} - %D Welcome to the main module. When this module is ran through %D \type{initex} or \type {tex -i} or \type {whatevertex} using %D \type{whatever switch}, the \CONTEXT\ format file is diff --git a/tex/context/base/core-ctx.tex b/tex/context/base/core-ctx.tex index 88659122f..9cd3de2b9 100644 --- a/tex/context/base/core-ctx.tex +++ b/tex/context/base/core-ctx.tex @@ -21,6 +21,7 @@ \chardef\preprocessmethod 2 % 0=no check 1=present_check 2=log_check \chardef\preprocessstate 0 % 1=found 2=not_present (skip) +\chardef\preprocesslocal 0 % 0=no 1=yes \def \preprocesssuffix {.prep} \def\loadctxpreplist @@ -33,13 +34,21 @@ \or \doiffileexistselse{./\jobname.ctl} {\bgroup - \defineXMLenvironment[ctx:preplist] - {\writestatus\m!systems{loading ctx log file}} - {}% + \defineXMLenvironment[ctx:preplist][local=no] + {\doifelse{\XMLop{local}}{yes} + {\global\chardef\preprocesslocal\plusone + \writestatus\m!systems{loading ctx log file (local)}}% + {\writestatus\m!systems{loading ctx log file (specified)}}} + \donothing \defineXMLenvironmentsave[ctx:prepfile][done=no] - {} - {\writestatus\m!systems{registering \XMLflush{ctx:prepfile} -> \XMLop{done}}% - \setxvalue{fp..\XMLflush{ctx:prepfile}}{\XMLop{done}}}% + \donothing + {\edef\readfilename{\XMLflush{ctx:prepfile}}% + \ifcase\preprocesslocal\else + \splitfilename\readfilename + \let\readfilename\splitoffbase + \fi + \writestatus\m!systems{registering \readfilename\space -> \XMLop{done}}% + \setxvalue{fp..\readfilename}{\XMLop{done}}}% \processXMLfile{./\jobname.ctl}% \egroup}% {\global\chardef\preprocessmode\plusone}% @@ -67,21 +76,29 @@ % saveguard and speed up \iftracefiles\writestatus\m!systems{preprocessing - no suffix}\fi \egroup - \else + \else\ifcase\preprocesslocal \iftracefiles\writestatus\m!systems{preprocessing - check presence of \readfilename\preprocesssuffix}\fi \doifdefinedelse{fp..\readfilename} {\egroup \doiffileexistselse{\readfilename\preprocesssuffix} {\chardef\preprocessstate\plusone} {\chardef\preprocessstate\plustwo}}% - {\doifdefinedelse{fp..\splitoffname.\splitofftype} + {\doifdefinedelse{fp..\splitoffbase}% {\egroup \doiffileexistselse{\readfilename\preprocesssuffix} {\chardef\preprocessstate\plusone} {\chardef\preprocessstate\plustwo}}% {\egroup}}% + \else + \iftracefiles\writestatus\m!systems{preprocessing - check local presence of \readfilename\preprocesssuffix}\fi + \doifdefinedelse{fp..\readfilename} + {\egroup + \doiffileexistselse{\readfilename\preprocesssuffix} + {\chardef\preprocessstate\plusone} + {\chardef\preprocessstate\plustwo}}% + {\egroup}% \fi - \fi} + \fi\fi} % beware, \readfilename keeps the original one, but we load and store the % suffixed with .prep file (if present) @@ -125,7 +142,7 @@ \fi \fi \else - \edef\readfilename{\getvalue{fn..\readfilename}}% + \edef\readfilename{\getvalue{fn..\readfilename}}% ??? is done ! \iftracefiles\writestatus\m!systems{already located \readfilename}\fi \def\next{#3\dodoreadfile}% \fi @@ -148,7 +165,11 @@ \def\next{#3}% \fi}% \or - \edef\readfilename{#1}% + \ifcase\preprocesslocal + \edef\readfilename{#1}% nor found + \else + % no path prepending + \fi \iftracefiles\writestatus\m!systems{#1\preprocesssuffix\space located}\fi \def\next{#2\dodoreadfile}% \or diff --git a/tex/context/base/enco-xtx.tex b/tex/context/base/enco-utf.tex index 26fd97dfb..b41490beb 100644 --- a/tex/context/base/enco-xtx.tex +++ b/tex/context/base/enco-utf.tex @@ -1,4 +1,4 @@ -% filename : enco-xtx.tex +% filename : enco-utf.tex % comment : poor man's alternative for a proper enco file % author : Hans Hagen, PRAGMA-ADE, Hasselt NL % copyright: PRAGMA ADE / ConTeXt Development Team @@ -7,8 +7,8 @@ \ifx\setcclcuc\undefined \def\setcclcuc #1 #2 #3 % - {\global\catcode"#1=11 - \global\lccode "#1="#2 + {\global\catcode"#1=11 + \global\lccode "#1="#2 \global\uccode "#1="#3 } \fi diff --git a/tex/context/base/lang-ini.tex b/tex/context/base/lang-ini.tex index d9f79b6fc..85243f3de 100644 --- a/tex/context/base/lang-ini.tex +++ b/tex/context/base/lang-ini.tex @@ -350,6 +350,10 @@ \def\setuphyppatencoding{\pathypsettings} \endXETEX +\beginMETATEX + \def\setuphyppatencoding{\pathypsettings} +\endMETATEX + \def\dodoloadpatterns#1#2#3#4% beware, loaded language also incr {\normallanguage\loadedlanguage % when not really needed \bgroup diff --git a/tex/context/base/regi-utf.tex b/tex/context/base/regi-utf.tex index 85bdbf32f..90e018684 100644 --- a/tex/context/base/regi-utf.tex +++ b/tex/context/base/regi-utf.tex @@ -38,7 +38,7 @@ \endXETEX \beginMETATEX - \expandafter \endinput + \expandafter \endinput \endMETATEX \unprotect diff --git a/tex/context/base/spec-def.tex b/tex/context/base/spec-def.tex index fa48700e6..933d42197 100644 --- a/tex/context/base/spec-def.tex +++ b/tex/context/base/spec-def.tex @@ -903,10 +903,19 @@ %D This is one of the few specials where when using \PDFTEX\ %D the driver directly deals with the utility file. -\installspecial [\dosetposition] [or] [1] -\installspecial [\dosetpositionwhd] [or] [4] -\installspecial [\dosetpositionplus] [or] [5] -\installspecial [\dosetpositionpapersize] [or] [2] +%D Support is moved to spec-mis.tex. The whole idea originates +%D and was implemented first in \PDFTEX. Later \DVIPDFMX\ +%D supported the \CONTEXT\ specific specials and nowadays +%D \PDFTEX\ supports this feature in \DVI\ mode and \XETEX\ +%D implements it as well. This means that only \ALEPH\ is +%D still dependent on specials, but that variant of \TEX\ has +%D become obsolete anyway. + +% \installspecial [\dosetposition] [or] [1] +% \installspecial [\dosetpositionwhd] [or] [4] +% \installspecial [\dosetpositionplus] [or] [5] + +% \installspecial [\dosetpositionpapersize] [or] [2] %D \macros %D {dostarttransparency,dostoptransparency} diff --git a/tex/context/base/spec-dpx.tex b/tex/context/base/spec-dpx.tex index 1522304e7..44bbe10b6 100644 --- a/tex/context/base/spec-dpx.tex +++ b/tex/context/base/spec-dpx.tex @@ -798,41 +798,6 @@ \box\scratchbox \elabelgroup} -%D 7. Copied codes from \type{spec-dvi} - -% coming pdftex versions will provide pos support in dvi mode (untested) - -% \ifnum\pdftexversion>140 .. \fi - -\definespecial\dosetposition#1% - {\special{pos:pxy "#1"}} - -\definespecial\dosetpositionwhd#1#2#3#4% - {\special{pos:pxywhd "#1" #2 #3 #4}} - -\definespecial\dosetpositionplus#1#2#3#4#5% - {\special{pos:pxyplus "#1" #2 #3 #4 #5}} - -\let\flushDVIpositionpapersize\relax - -\definespecial\dosetpositionpapersize#1#2% - {\xdef\flushDVIpositionpapersize - {\special{pos:papersize \number#1 \number#2}% - \noexpand\installprogram{dvipos -o \jobname.tuo \jobname.dvi }% - \global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}} - -\beginXETEX - - \definespecial\dosetpositionpapersize#1#2% - {\xdef\flushDVIpositionpapersize - {\special{pos:papersize \number#1 \number#2}% - \noexpand\installprogram{dvipos -o \jobname.tuo \jobname.xdv }% - \global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}} - -\endXETEX - -\prependtoksonce \flushDVIpositionpapersize \to \everyshipout - \stopspecials \protect \endinput diff --git a/tex/context/base/spec-dvi.tex b/tex/context/base/spec-dvi.tex index 42fd8b259..1a8f653f0 100644 --- a/tex/context/base/spec-dvi.tex +++ b/tex/context/base/spec-dvi.tex @@ -87,27 +87,31 @@ %D The postprocessor should, of course, provide the \type %D {page}, \type {x}, and \type {y} values. -\definespecial\dosetposition#1% - {\special{pos:pxy "#1"}} +%D Now in spec-mis.tex: -\definespecial\dosetpositionwhd#1#2#3#4% - {\special{pos:pxywhd "#1" #2 #3 #4}} - -\definespecial\dosetpositionplus#1#2#3#4#5% - {\special{pos:pxyplus "#1" #2 #3 #4 #5}} +% \definespecial\dosetposition#1% +% {\special{pos:pxy "#1"}} +% +% \definespecial\dosetpositionwhd#1#2#3#4% +% {\special{pos:pxywhd "#1" #2 #3 #4}} +% +% \definespecial\dosetpositionplus#1#2#3#4#5% +% {\special{pos:pxyplus "#1" #2 #3 #4 #5}} %D The next special tells the position postprocessor what %D page dimensions were used. -\let\flushDVIpositionpapersize\relax - -\definespecial\dosetpositionpapersize#1#2% - {\xdef\flushDVIpositionpapersize% - {\special{pos:papersize \number#1 \number#2}% - \noexpand\installprogram{dvipos -o \jobname.tuo \jobname.dvi }% - \global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}} - -\prependtoksonce \flushDVIpositionpapersize \to \everyshipout +%D Also in spec-mis.tex: + +% \let\flushDVIpositionpapersize\relax +% +% \definespecial\dosetpositionpapersize#1#2% +% {\xdef\flushDVIpositionpapersize% +% {\special{pos:papersize \number#1 \number#2}% +% \noexpand\installprogram{dvipos -o \jobname.tuo \jobname.dvi }% +% \global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}} +% +% \prependtoksonce \flushDVIpositionpapersize \to \everyshipout \stopspecials diff --git a/tex/context/base/spec-mis.tex b/tex/context/base/spec-mis.tex index 06afb65c2..fce364038 100644 --- a/tex/context/base/spec-mis.tex +++ b/tex/context/base/spec-mis.tex @@ -207,4 +207,73 @@ \let\handleMPfshow\dohandleMPfshow \to \everyresetspecials +%D + +%D \macros +%D {dosetposition, dosetpositionwdh, dosetpositionplus} +%D +%D Opposite to its \DVI\ counterpart, the \PDFTEX\ backend +%D can provide positional information directly. Since +%D \CONTEXT\ only uses relative positions, the origin is of +%D less importance. Nowadays \XETEX\ also supports this +%D feature. + +\ifx\pdfsavepos\undefined + + % only for ancient pdftex, less old xetex and current aleph + + \def\dosetposition #1{\special{pos:pxy "#1"}} + \def\dosetpositionwhd #1#2#3#4{\special{pos:pxywhd "#1" #2 #3 #4}} + \def\dosetpositionplus#1#2#3#4#5{\special{pos:pxyplus "#1" #2 #3 #4 #5}} + + \let\flushDVIpositionpapersize\relax + + \def\dosetpositionpapersize#1#2% + {\xdef\flushDVIpositionpapersize + {\special{pos:papersize \number#1 \number#2}% + \noexpand\installprogram{dvipos -o \jobname.tuo \jobname.dvi }% + \global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}} + + \beginXETEX + \def\dosetpositionpapersize#1#2% + {\xdef\flushDVIpositionpapersize + {\special{pos:papersize \number#1 \number#2}% + \noexpand\installprogram{dvipos -o \jobname.tuo \jobname.xdv }% + \global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}} + \endXETEX + + \prependtoksonce \flushDVIpositionpapersize \to \everyshipout + +\else + + \def\dosetposition#1% + {\pdfsavepos + \dolazysaveposition + {#1}% + {\noexpand\realfolio}% + {\noexpand\the\dimexpr\pdflastxpos\scaledpoint\relax}% + {\noexpand\the\dimexpr\pdflastypos\scaledpoint\relax}}% + + \def\dosetpositionwhd#1#2#3#4% + {\pdfsavepos + \dolazysavepositionwhd + {#1}% + {\noexpand\realfolio}% + {\noexpand\the\dimexpr\pdflastxpos\scaledpoint\relax}% + {\noexpand\the\dimexpr\pdflastypos\scaledpoint\relax}% + {#2}{#3}{#4}} + + \def\dosetpositionplus#1#2#3#4#5% + {\pdfsavepos + \dolazysavepositionplus + {#1}% + {\noexpand\realfolio}% + {\noexpand\the\dimexpr\pdflastxpos\scaledpoint\relax}% + {\noexpand\the\dimexpr\pdflastypos\scaledpoint\relax}% + {#2}{#3}{#4}{#5}} + + \let\dosetpositionpapersize\gobbletwoarguments + +\fi + \protect \endinput diff --git a/tex/context/base/spec-tpd.tex b/tex/context/base/spec-tpd.tex index 29d5c7a15..8d6d93d38 100644 --- a/tex/context/base/spec-tpd.tex +++ b/tex/context/base/spec-tpd.tex @@ -1022,40 +1022,6 @@ \definespecial\doregistercalculationset{\doFDFregistercalculationset} %D \macros -%D {dosetposition, dosetpositionwdh, dosetpositionplus} -%D -%D Opposite to its \DVI\ counterpart, the \PDFTEX\ backend -%D can provide positional information directly. Since -%D \CONTEXT\ only uses relative positions, the origin is of -%D less importance. - -\definespecial\dosetposition#1% - {\pdfsavepos - \dolazysaveposition - {#1}% - {\noexpand\realfolio}% - {\noexpand\the\dimexpr\pdflastxpos\scaledpoint\relax}% - {\noexpand\the\dimexpr\pdflastypos\scaledpoint\relax}}% - -\definespecial\dosetpositionwhd#1#2#3#4% - {\pdfsavepos - \dolazysavepositionwhd - {#1}% - {\noexpand\realfolio}% - {\noexpand\the\dimexpr\pdflastxpos\scaledpoint\relax}% - {\noexpand\the\dimexpr\pdflastypos\scaledpoint\relax}% - {#2}{#3}{#4}} - -\definespecial\dosetpositionplus#1#2#3#4#5% - {\pdfsavepos - \dolazysavepositionplus - {#1}% - {\noexpand\realfolio}% - {\noexpand\the\dimexpr\pdflastxpos\scaledpoint\relax}% - {\noexpand\the\dimexpr\pdflastypos\scaledpoint\relax}% - {#2}{#3}{#4}{#5}} - -%D \macros %D {doPDFdestination} %D %D Finally we implement some low level macros to deal with diff --git a/tex/context/base/spec-xtx.tex b/tex/context/base/spec-xtx.tex index b9c491e75..0cd9baadd 100644 --- a/tex/context/base/spec-xtx.tex +++ b/tex/context/base/spec-xtx.tex @@ -130,6 +130,14 @@ \setupexternalfigures[\c!object=\v!no] +%D + +\ifx\pdfpagewidth\undefined \else + \definespecial\dosetuppaper#1#2#3% + {\global\pdfpagewidth #2\relax + \global\pdfpageheight#3\relax} +\fi + \stopspecials \protect \endinput diff --git a/tex/context/base/syst-mtx.tex b/tex/context/base/syst-mtx.tex index c865560b8..4e5e2ef26 100644 --- a/tex/context/base/syst-mtx.tex +++ b/tex/context/base/syst-mtx.tex @@ -15,6 +15,18 @@ \unprotect +\ifnum\contextmarkmode=2 + + \input enco-utf.tex + + % patch needed for turkish + + \setcclcuc 201C 201C 201C + \setcclcuc 201D 201D 201D + +\fi + + %D Since the number of chars exceed 256 now, we can use \type %D {\chardef} instead of the more limited \type {\mathchardef}. diff --git a/tex/context/base/syst-xtx.tex b/tex/context/base/syst-xtx.tex index 3cf5aa29b..83a28d36d 100644 --- a/tex/context/base/syst-xtx.tex +++ b/tex/context/base/syst-xtx.tex @@ -18,34 +18,15 @@ %D For the moment, the only thing needed is to load are the %D mappings from lower to uppercase characters. -\ifx\scratchread\undefined \newread\scratchread \fi - -\def\setcclcuc #1 #2 #3 % - {\global\catcode"#1=11 - \global\lccode "#1="#2 - \global\uccode "#1="#3 } - -\immediate\openin\scratchread=enco-xtx.tex \ifeof\scratchread - \immediate\openin\scratchread=unicode-letters.tex \ifeof\scratchread - \immediate\openin\scratchread=xplain.tex \ifeof\scratchread - % no initialization file - \else - \input xplain.tex - \fi - \else - \input unicode-letters.tex - \fi -\else - \input enco-xtx.tex -\fi - -\ifx\XeTeXuseglyphmetrics\undefined \else - \XeTeXuseglyphmetrics=1 -\fi +\input enco-utf.tex % patch needed for turkish \setcclcuc 201C 201C 201C \setcclcuc 201D 201D 201D +\ifx\XeTeXuseglyphmetrics\undefined \else + \XeTeXuseglyphmetrics=1 +\fi + \protect \endinput diff --git a/tex/context/interface/keys-cz.xml b/tex/context/interface/keys-cz.xml index da831a1ea..67e04f4b1 100644 --- a/tex/context/interface/keys-cz.xml +++ b/tex/context/interface/keys-cz.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> -<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="cz" version="2007.01.10 11:18"> +<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="cz" version="2007.01.12 15:56"> <cd:variables> <cd:variable name="one" value="jedna"/> diff --git a/tex/context/interface/keys-de.xml b/tex/context/interface/keys-de.xml index bfe5e3947..627ac93b8 100644 --- a/tex/context/interface/keys-de.xml +++ b/tex/context/interface/keys-de.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> -<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="de" version="2007.01.10 11:18"> +<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="de" version="2007.01.12 15:56"> <cd:variables> <cd:variable name="one" value="eins"/> diff --git a/tex/context/interface/keys-en.xml b/tex/context/interface/keys-en.xml index 7ae1d3075..ac45d6c98 100644 --- a/tex/context/interface/keys-en.xml +++ b/tex/context/interface/keys-en.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> -<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="en" version="2007.01.10 11:18"> +<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="en" version="2007.01.12 15:56"> <cd:variables> <cd:variable name="one" value="one"/> diff --git a/tex/context/interface/keys-fr.xml b/tex/context/interface/keys-fr.xml index 0035f57dd..0540b0cf2 100644 --- a/tex/context/interface/keys-fr.xml +++ b/tex/context/interface/keys-fr.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> -<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="fr" version="2007.01.10 11:18"> +<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="fr" version="2007.01.12 15:56"> <cd:variables> <cd:variable name="one" value="un"/> diff --git a/tex/context/interface/keys-it.xml b/tex/context/interface/keys-it.xml index e0856211c..9ef205c23 100644 --- a/tex/context/interface/keys-it.xml +++ b/tex/context/interface/keys-it.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> -<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="it" version="2007.01.10 11:18"> +<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="it" version="2007.01.12 15:56"> <cd:variables> <cd:variable name="one" value="uno"/> diff --git a/tex/context/interface/keys-nl.xml b/tex/context/interface/keys-nl.xml index dcc3e7b06..d69119e3c 100644 --- a/tex/context/interface/keys-nl.xml +++ b/tex/context/interface/keys-nl.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> -<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="nl" version="2007.01.10 11:18"> +<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="nl" version="2007.01.12 15:56"> <cd:variables> <cd:variable name="one" value="een"/> diff --git a/tex/context/interface/keys-ro.xml b/tex/context/interface/keys-ro.xml index b0a437768..b65986ab5 100644 --- a/tex/context/interface/keys-ro.xml +++ b/tex/context/interface/keys-ro.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> -<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="ro" version="2007.01.10 11:18"> +<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="ro" version="2007.01.12 15:56"> <cd:variables> <cd:variable name="one" value="unu"/> |