From 552aceb88e5e5e77a9263144180139a6ac95646c Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Fri, 25 Jul 2014 12:57:00 +0200 Subject: beta 2014.07.25 12:57 --- doc/context/manuals/allkind/mkiv-publications.pdf | Bin 410959 -> 340683 bytes scripts/context/lua/mtx-context.lua | 12 +- scripts/context/lua/mtxrun.lua | 51 +++-- scripts/context/stubs/mswin/mtxrun.lua | 51 +++-- scripts/context/stubs/unix/mtxrun | 51 +++-- scripts/context/stubs/win64/mtxrun.lua | 51 +++-- tex/context/base/anch-pos.lua | 3 + tex/context/base/back-exp.lua | 2 +- tex/context/base/cldf-prs.lua | 4 +- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4444 -> 4434 bytes tex/context/base/context.mkiv | 6 +- tex/context/base/core-sys.mkiv | 2 + tex/context/base/font-mis.lua | 2 +- tex/context/base/font-otf.lua | 6 +- tex/context/base/font-otp.lua | 43 +++-- tex/context/base/grph-inc.lua | 168 ++++++++++++---- tex/context/base/grph-inc.mkiv | 5 + tex/context/base/l-dir.lua | 9 +- tex/context/base/l-file.lua | 17 ++ tex/context/base/l-table.lua | 25 ++- tex/context/base/lang-txt.lua | 12 ++ tex/context/base/mult-de.mkii | 2 + tex/context/base/mult-def.lua | 8 + tex/context/base/mult-en.mkii | 2 + tex/context/base/mult-fr.mkii | 2 + tex/context/base/mult-it.mkii | 2 + tex/context/base/mult-nl.mkii | 2 + tex/context/base/mult-pe.mkii | 2 + tex/context/base/mult-ro.mkii | 2 + tex/context/base/node-tra.lua | 1 + tex/context/base/pack-rul.mkiv | 7 +- tex/context/base/page-txt.mkvi | 4 +- tex/context/base/publ-ini.lua | 32 ++-- tex/context/base/publ-ini.mkiv | 24 ++- tex/context/base/s-figures-names.mkiv | 96 ++++++++++ tex/context/base/s-math-repertoire.mkiv | 11 +- tex/context/base/status-files.pdf | Bin 24971 -> 24921 bytes tex/context/base/status-lua.pdf | Bin 326426 -> 326542 bytes tex/context/base/strc-lst.lua | 4 +- tex/context/base/strc-ref.lua | 125 ++++++++++-- tex/context/base/strc-ref.mkvi | 211 ++++++++++++++++++--- tex/context/base/x-mathml.mkiv | 18 +- tex/context/interface/keys-cs.xml | 2 + tex/context/interface/keys-de.xml | 2 + tex/context/interface/keys-en.xml | 2 + tex/context/interface/keys-fr.xml | 2 + tex/context/interface/keys-it.xml | 2 + tex/context/interface/keys-nl.xml | 2 + tex/context/interface/keys-pe.xml | 2 + tex/context/interface/keys-ro.xml | 2 + tex/generic/context/luatex/luatex-fonts-merged.lua | 62 +++--- 52 files changed, 925 insertions(+), 230 deletions(-) create mode 100644 tex/context/base/s-figures-names.mkiv diff --git a/doc/context/manuals/allkind/mkiv-publications.pdf b/doc/context/manuals/allkind/mkiv-publications.pdf index bcb5af97f..49290c549 100644 Binary files a/doc/context/manuals/allkind/mkiv-publications.pdf and b/doc/context/manuals/allkind/mkiv-publications.pdf differ diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua index 83030e2e7..caf7e2f2a 100644 --- a/scripts/context/lua/mtx-context.lua +++ b/scripts/context/lua/mtx-context.lua @@ -285,11 +285,13 @@ local function multipass_copyluafile(jobname,run) local tuaname, tucname = jobname..".tua", jobname..".tuc" if validfile(tuaname) then if run then - for i=1,10 do - local tmpname = format("%s-tuc-%02d.tmp",jobname,i) - if validfile(tmpname) then - removefile(tmpname) - report("removing %a",tmpname) + if run == 1 then + for i=1,10 do + local tmpname = format("%s-tuc-%02d.tmp",jobname,i) + if validfile(tmpname) then + removefile(tmpname) + report("removing %a",tmpname) + end end end if validfile(tucname) then diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 9d94379d2..a9e563117 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -1212,7 +1212,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-table"] = package.loaded["l-table"] or true --- original size: 33243, stripped down to: 21578 +-- original size: 33477, stripped down to: 21843 if not modules then modules={} end modules ['l-table']={ version=1.001, @@ -1967,14 +1967,25 @@ local function identical(a,b) end table.identical=identical table.are_equal=are_equal -function table.compact(t) - if t then - for k,v in next,t do - if not next(v) then - t[k]=nil +local function sparse(old,nest,keeptables) + local new={} + for k,v in next,old do + if not (v=="" or v==false) then + if nest and type(v)=="table" then + v=sparse(v,nest) + if keeptables or next(v) then + new[k]=v + end + else + new[k]=v end end end + return new +end +table.sparse=sparse +function table.compact(t) + return sparse(t,true,true) end function table.contains(t,v) if t then @@ -3092,7 +3103,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-file"] = package.loaded["l-file"] or true --- original size: 18308, stripped down to: 9948 +-- original size: 18672, stripped down to: 10256 if not modules then modules={} end modules ['l-file']={ version=1.001, @@ -3425,6 +3436,18 @@ function file.collapsepath(str,anchor) end end end +local tricky=S("/\\")*P(-1) +local attributes=lfs.attributes +function lfs.isdir(name) + if lpegmatch(tricky,name) then + return attributes(name,"mode")=="directory" + else + return attributes(name.."/.","mode")=="directory" + end +end +function lfs.isfile(name) + return attributes(name,"mode")=="file" +end local validchars=R("az","09","AZ","--","..") local pattern_a=lpeg.replacer(1-validchars) local pattern_a=Cs((validchars+P(1)/"-")^1) @@ -3830,7 +3853,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-dir"] = package.loaded["l-dir"] or true --- original size: 16056, stripped down to: 10707 +-- original size: 16182, stripped down to: 10810 if not modules then modules={} end modules ['l-dir']={ version=1.001, @@ -3856,9 +3879,13 @@ local chdir=lfs.chdir local mkdir=lfs.mkdir local onwindows=os.type=="windows" or find(os.getenv("PATH"),";",1,true) if onwindows then + local tricky=S("/\\")*P(-1) isdir=function(name) - name=gsub(name,"([/\\]+)$","/.") - return attributes(name,"mode")=="directory" + if lpegmatch(tricky,name) then + return attributes(name,"mode")=="directory" + else + return attributes(name.."/.","mode")=="directory" + end end isfile=function(name) return attributes(name,"mode")=="file" @@ -17276,8 +17303,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 712066 --- stripped bytes : 253417 +-- original bytes : 712790 +-- stripped bytes : 253465 -- end library merge diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 9d94379d2..a9e563117 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -1212,7 +1212,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-table"] = package.loaded["l-table"] or true --- original size: 33243, stripped down to: 21578 +-- original size: 33477, stripped down to: 21843 if not modules then modules={} end modules ['l-table']={ version=1.001, @@ -1967,14 +1967,25 @@ local function identical(a,b) end table.identical=identical table.are_equal=are_equal -function table.compact(t) - if t then - for k,v in next,t do - if not next(v) then - t[k]=nil +local function sparse(old,nest,keeptables) + local new={} + for k,v in next,old do + if not (v=="" or v==false) then + if nest and type(v)=="table" then + v=sparse(v,nest) + if keeptables or next(v) then + new[k]=v + end + else + new[k]=v end end end + return new +end +table.sparse=sparse +function table.compact(t) + return sparse(t,true,true) end function table.contains(t,v) if t then @@ -3092,7 +3103,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-file"] = package.loaded["l-file"] or true --- original size: 18308, stripped down to: 9948 +-- original size: 18672, stripped down to: 10256 if not modules then modules={} end modules ['l-file']={ version=1.001, @@ -3425,6 +3436,18 @@ function file.collapsepath(str,anchor) end end end +local tricky=S("/\\")*P(-1) +local attributes=lfs.attributes +function lfs.isdir(name) + if lpegmatch(tricky,name) then + return attributes(name,"mode")=="directory" + else + return attributes(name.."/.","mode")=="directory" + end +end +function lfs.isfile(name) + return attributes(name,"mode")=="file" +end local validchars=R("az","09","AZ","--","..") local pattern_a=lpeg.replacer(1-validchars) local pattern_a=Cs((validchars+P(1)/"-")^1) @@ -3830,7 +3853,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-dir"] = package.loaded["l-dir"] or true --- original size: 16056, stripped down to: 10707 +-- original size: 16182, stripped down to: 10810 if not modules then modules={} end modules ['l-dir']={ version=1.001, @@ -3856,9 +3879,13 @@ local chdir=lfs.chdir local mkdir=lfs.mkdir local onwindows=os.type=="windows" or find(os.getenv("PATH"),";",1,true) if onwindows then + local tricky=S("/\\")*P(-1) isdir=function(name) - name=gsub(name,"([/\\]+)$","/.") - return attributes(name,"mode")=="directory" + if lpegmatch(tricky,name) then + return attributes(name,"mode")=="directory" + else + return attributes(name.."/.","mode")=="directory" + end end isfile=function(name) return attributes(name,"mode")=="file" @@ -17276,8 +17303,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 712066 --- stripped bytes : 253417 +-- original bytes : 712790 +-- stripped bytes : 253465 -- end library merge diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 9d94379d2..a9e563117 100755 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -1212,7 +1212,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-table"] = package.loaded["l-table"] or true --- original size: 33243, stripped down to: 21578 +-- original size: 33477, stripped down to: 21843 if not modules then modules={} end modules ['l-table']={ version=1.001, @@ -1967,14 +1967,25 @@ local function identical(a,b) end table.identical=identical table.are_equal=are_equal -function table.compact(t) - if t then - for k,v in next,t do - if not next(v) then - t[k]=nil +local function sparse(old,nest,keeptables) + local new={} + for k,v in next,old do + if not (v=="" or v==false) then + if nest and type(v)=="table" then + v=sparse(v,nest) + if keeptables or next(v) then + new[k]=v + end + else + new[k]=v end end end + return new +end +table.sparse=sparse +function table.compact(t) + return sparse(t,true,true) end function table.contains(t,v) if t then @@ -3092,7 +3103,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-file"] = package.loaded["l-file"] or true --- original size: 18308, stripped down to: 9948 +-- original size: 18672, stripped down to: 10256 if not modules then modules={} end modules ['l-file']={ version=1.001, @@ -3425,6 +3436,18 @@ function file.collapsepath(str,anchor) end end end +local tricky=S("/\\")*P(-1) +local attributes=lfs.attributes +function lfs.isdir(name) + if lpegmatch(tricky,name) then + return attributes(name,"mode")=="directory" + else + return attributes(name.."/.","mode")=="directory" + end +end +function lfs.isfile(name) + return attributes(name,"mode")=="file" +end local validchars=R("az","09","AZ","--","..") local pattern_a=lpeg.replacer(1-validchars) local pattern_a=Cs((validchars+P(1)/"-")^1) @@ -3830,7 +3853,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-dir"] = package.loaded["l-dir"] or true --- original size: 16056, stripped down to: 10707 +-- original size: 16182, stripped down to: 10810 if not modules then modules={} end modules ['l-dir']={ version=1.001, @@ -3856,9 +3879,13 @@ local chdir=lfs.chdir local mkdir=lfs.mkdir local onwindows=os.type=="windows" or find(os.getenv("PATH"),";",1,true) if onwindows then + local tricky=S("/\\")*P(-1) isdir=function(name) - name=gsub(name,"([/\\]+)$","/.") - return attributes(name,"mode")=="directory" + if lpegmatch(tricky,name) then + return attributes(name,"mode")=="directory" + else + return attributes(name.."/.","mode")=="directory" + end end isfile=function(name) return attributes(name,"mode")=="file" @@ -17276,8 +17303,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 712066 --- stripped bytes : 253417 +-- original bytes : 712790 +-- stripped bytes : 253465 -- end library merge diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua index 9d94379d2..a9e563117 100644 --- a/scripts/context/stubs/win64/mtxrun.lua +++ b/scripts/context/stubs/win64/mtxrun.lua @@ -1212,7 +1212,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-table"] = package.loaded["l-table"] or true --- original size: 33243, stripped down to: 21578 +-- original size: 33477, stripped down to: 21843 if not modules then modules={} end modules ['l-table']={ version=1.001, @@ -1967,14 +1967,25 @@ local function identical(a,b) end table.identical=identical table.are_equal=are_equal -function table.compact(t) - if t then - for k,v in next,t do - if not next(v) then - t[k]=nil +local function sparse(old,nest,keeptables) + local new={} + for k,v in next,old do + if not (v=="" or v==false) then + if nest and type(v)=="table" then + v=sparse(v,nest) + if keeptables or next(v) then + new[k]=v + end + else + new[k]=v end end end + return new +end +table.sparse=sparse +function table.compact(t) + return sparse(t,true,true) end function table.contains(t,v) if t then @@ -3092,7 +3103,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-file"] = package.loaded["l-file"] or true --- original size: 18308, stripped down to: 9948 +-- original size: 18672, stripped down to: 10256 if not modules then modules={} end modules ['l-file']={ version=1.001, @@ -3425,6 +3436,18 @@ function file.collapsepath(str,anchor) end end end +local tricky=S("/\\")*P(-1) +local attributes=lfs.attributes +function lfs.isdir(name) + if lpegmatch(tricky,name) then + return attributes(name,"mode")=="directory" + else + return attributes(name.."/.","mode")=="directory" + end +end +function lfs.isfile(name) + return attributes(name,"mode")=="file" +end local validchars=R("az","09","AZ","--","..") local pattern_a=lpeg.replacer(1-validchars) local pattern_a=Cs((validchars+P(1)/"-")^1) @@ -3830,7 +3853,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-dir"] = package.loaded["l-dir"] or true --- original size: 16056, stripped down to: 10707 +-- original size: 16182, stripped down to: 10810 if not modules then modules={} end modules ['l-dir']={ version=1.001, @@ -3856,9 +3879,13 @@ local chdir=lfs.chdir local mkdir=lfs.mkdir local onwindows=os.type=="windows" or find(os.getenv("PATH"),";",1,true) if onwindows then + local tricky=S("/\\")*P(-1) isdir=function(name) - name=gsub(name,"([/\\]+)$","/.") - return attributes(name,"mode")=="directory" + if lpegmatch(tricky,name) then + return attributes(name,"mode")=="directory" + else + return attributes(name.."/.","mode")=="directory" + end end isfile=function(name) return attributes(name,"mode")=="file" @@ -17276,8 +17303,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 712066 --- stripped bytes : 253417 +-- original bytes : 712790 +-- stripped bytes : 253465 -- end library merge diff --git a/tex/context/base/anch-pos.lua b/tex/context/base/anch-pos.lua index 4230d1d16..fc7e24b96 100644 --- a/tex/context/base/anch-pos.lua +++ b/tex/context/base/anch-pos.lua @@ -118,6 +118,8 @@ local nofusedregions = 0 local nofmissingregions = 0 local nofregular = 0 +jobpositions.used = false + -- todo: register subsets and count them indepently local function initializer() @@ -162,6 +164,7 @@ local function initializer() end -- so, we can be sparse and don't need 'or 0' code end + jobpositions.used = next(collected) end job.register('job.positions.collected', tobesaved, initializer) diff --git a/tex/context/base/back-exp.lua b/tex/context/base/back-exp.lua index b82ba78c4..54a42085d 100644 --- a/tex/context/base/back-exp.lua +++ b/tex/context/base/back-exp.lua @@ -1569,7 +1569,7 @@ do if metadata then result[#result+1] = f_metadata_begin(depth) for k, v in table.sortedpairs(metadata) do - result[#result+1] = f_medatadata(depth+1,k,lpegmatch(p_entity,v)) + result[#result+1] = f_metadata(depth+1,k,lpegmatch(p_entity,v)) end result[#result+1] = f_metadata_end(depth) end diff --git a/tex/context/base/cldf-prs.lua b/tex/context/base/cldf-prs.lua index f9fccd832..3c3836a3e 100644 --- a/tex/context/base/cldf-prs.lua +++ b/tex/context/base/cldf-prs.lua @@ -51,8 +51,8 @@ local scripted = Cs { "start", character = utf8character, -- nested = leftbrace * (V("rest") + (V("character")-rightbrace))^0 * rightbrace, nested = leftbrace * (V("start") -rightbrace)^0 * rightbrace, - content = Cs(V("nested") + sign^-1 * (cardinal + V("character"))), - content = V("nested") + sign^-1 * (cardinal + V("character")), + -- content = Cs(V("nested") + sign^-1 * (cardinal + V("character"))), + content = V("nested") + sign^-1 * (cardinal + V("character")) + sign, lowfirst = (subscript /"") * ( Cc("\\lohi{") * V("content") * Cc("}{") * (superscript/"") + Cc("\\low{" ) ) * V("content") * Cc("}"), highfirst = (superscript/"") * ( Cc("\\hilo{") * V("content") * Cc("}{") * (subscript /"") + Cc("\\high{") ) * V("content") * Cc("}"), } diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 5bd79250a..0845e92fd 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2014.07.17 13:24} +\newcontextversion{2014.07.25 12:57} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf index fe0a62735..a7b446132 100644 Binary files a/tex/context/base/context-version.pdf and b/tex/context/base/context-version.pdf differ diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 6ce975ae7..831a76c7f 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -28,7 +28,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2014.07.17 13:24} +\edef\contextversion{2014.07.25 12:57} \edef\contextkind {beta} %D For those who want to use this: @@ -221,6 +221,8 @@ \loadmkvifile{typo-prc} +\loadmarkfile{anch-pos} + \loadmkvifile{strc-ini} \loadmarkfile{strc-tag} \loadmarkfile{strc-doc} @@ -248,7 +250,7 @@ \loadmarkfile{spac-def} \loadmarkfile{spac-grd} -\loadmarkfile{anch-pos} +%loadmarkfile{anch-pos} \loadmkvifile{scrn-ini} \loadmkvifile{scrn-ref} diff --git a/tex/context/base/core-sys.mkiv b/tex/context/base/core-sys.mkiv index c07722f56..b5c630be1 100644 --- a/tex/context/base/core-sys.mkiv +++ b/tex/context/base/core-sys.mkiv @@ -230,6 +230,8 @@ \dostoptagged \startstopparameter\c!inbetween}} +% \definestartstop[tracing][\c!style=\tt] + % \unexpanded\def\ignorestartstop[#1]% % {\unexpanded\expandafter\def\csname\e!start#1\expandafter\endcsname\expandafter % {\expandafter\gobbleuntil\csname\e!stop#1\endcsname}} diff --git a/tex/context/base/font-mis.lua b/tex/context/base/font-mis.lua index 077baeaba..ea7fe803a 100644 --- a/tex/context/base/font-mis.lua +++ b/tex/context/base/font-mis.lua @@ -22,7 +22,7 @@ local handlers = fonts.handlers handlers.otf = handlers.otf or { } local otf = handlers.otf -otf.version = otf.version or 2.758 +otf.version = otf.version or 2.759 otf.cache = otf.cache or containers.define("fonts", "otf", otf.version, true) function otf.loadcached(filename,format,sub) diff --git a/tex/context/base/font-otf.lua b/tex/context/base/font-otf.lua index 8e9a43929..688989596 100644 --- a/tex/context/base/font-otf.lua +++ b/tex/context/base/font-otf.lua @@ -48,7 +48,7 @@ local otf = fonts.handlers.otf otf.glists = { "gsub", "gpos" } -otf.version = 2.758 -- beware: also sync font-mis.lua +otf.version = 2.759 -- beware: also sync font-mis.lua otf.cache = containers.define("fonts", "otf", otf.version, true) local fontdata = fonts.hashes.identifiers @@ -1499,12 +1499,12 @@ actions["reorganize lookups"] = function(data,filename,raw) -- we could check fo local fore = glyphs.fore if fore and fore ~= "" then fore = s_uncover(splitter,s_u_cache,fore) - rule.before = s_hashed(fore,s_h_cache) + rule.after = s_hashed(fore,s_h_cache) end local back = glyphs.back if back then back = s_uncover(splitter,s_u_cache,back) - rule.after = s_hashed(back,s_h_cache) + rule.before = s_hashed(back,s_h_cache) end local names = glyphs.names if names then diff --git a/tex/context/base/font-otp.lua b/tex/context/base/font-otp.lua index c80ee86ae..60eee0738 100644 --- a/tex/context/base/font-otp.lua +++ b/tex/context/base/font-otp.lua @@ -750,27 +750,28 @@ local function unpackdata(data) rule.replacements = tv end end - local fore = rule.fore - if fore then - local tv = tables[fore] - if tv then - rule.fore = tv - end - end - local back = rule.back - if back then - local tv = tables[back] - if tv then - rule.back = tv - end - end - local names = rule.names - if names then - local tv = tables[names] - if tv then - rule.names = tv - end - end + -- local fore = rule.fore + -- if fore then + -- local tv = tables[fore] + -- if tv then + -- rule.fore = tv + -- end + -- end + -- local back = rule.back + -- if back then + -- local tv = tables[back] + -- if tv then + -- rule.back = tv + -- end + -- end + -- local names = rule.names + -- if names then + -- local tv = tables[names] + -- if tv then + -- rule.names = tv + -- end + -- end + -- local lookups = rule.lookups if lookups then local tv = tables[lookups] diff --git a/tex/context/base/grph-inc.lua b/tex/context/base/grph-inc.lua index a32773ecb..9ee5c6199 100644 --- a/tex/context/base/grph-inc.lua +++ b/tex/context/base/grph-inc.lua @@ -47,7 +47,7 @@ local formatters = string.formatters local longtostring = string.longtostring local expandfilename = dir.expandname -local P, lpegmatch = lpeg.P, lpeg.match +local P, R, S, Cc, lpegmatch = lpeg.P, lpeg.R, lpeg.S, lpeg.Cc, lpeg.match local settings_to_array = utilities.parsers.settings_to_array local settings_to_hash = utilities.parsers.settings_to_hash @@ -57,6 +57,9 @@ local replacetemplate = utilities.templates.replace local images = img +local hasscheme = url.hasscheme +local urlhashed = url.hashed + local texgetbox = tex.getbox local texsetbox = tex.setbox @@ -75,6 +78,8 @@ local trace_conversion = false trackers.register("graphics.conversion", functi local trace_inclusion = false trackers.register("graphics.inclusion", function(v) trace_inclusion = v end) local report_inclusion = logs.reporter("graphics","inclusion") +local report_figures = logs.reporter("system","graphics") +local report_figure = logs.reporter("used graphic") local f_hash_part = formatters["%s->%s->%s"] local f_hash_full = formatters["%s->%s->%s->%s->%s->%s->%s"] @@ -86,6 +91,7 @@ local v_high = variables.high local v_global = variables["global"] local v_local = variables["local"] local v_default = variables.default +local v_auto = variables.auto local maxdimen = 2^30-1 @@ -233,6 +239,61 @@ figures.formats = figures_formats -- frozen figures.magics = figures_magics -- frozen figures.order = figures_order -- frozen +-- name checker + +local pattern = (R("az","AZ") * P(":"))^-1 * ( -- a-z : | A-Z : + (R("az","09") + S("_/") - P("_")^2)^1 * P(".") * R("az")^1 + -- a-z | single _ | / + (R("az","09") + S("-/") - P("-")^2)^1 * P(".") * R("az")^1 + -- a-z | single - | / + (R("AZ","09") + S("_/") - P("_")^2)^1 * P(".") * R("AZ")^1 + -- A-Z | single _ | / + (R("AZ","09") + S("-/") - P("-")^2)^1 * P(".") * R("AZ")^1 -- A-Z | single - | / +) * P(-1) * Cc(false) + Cc(true) + +function figures.badname(name) + if not name then + -- bad anyway + elseif not hasscheme(name) then + return lpegmatch(pattern,name) + else + return lpegmatch(pattern,file.basename(name)) + end +end + +local trace_names = false + +trackers.register("graphics.lognames", function(v) + if v and not trace_names then + luatex.registerstopactions(function() + if figures.nofprocessed > 0 then + local report_newline = logs.newline + logs.pushtarget("logfile") + report_newline() + report_figures("start names") + for _, data in table.sortedhash(figures_found) do + report_newline() + report_figure("asked : %s",data.askedname) + if data.found then + report_figure("format : %s",data.format) + report_figure("found : %s",data.foundname) + report_figure("used : %s",data.fullname) + if data.badname then + report_figure("comment : %s","bad name") + elseif data.comment then + report_figure("comment : %s",data.comment) + end + else + report_figure("comment : %s","not found") + end + end + report_newline() + report_figures("stop names") + report_newline() + logs.poptarget() + end + end) + trace_names = true + end +end) + -- We can set the order but only indirectly so that we can check for support. function figures.setorder(list) -- can be table or string @@ -453,7 +514,7 @@ end function figures.push(request) statistics.starttiming(figures) - local figuredata = figures.initialize(request) + local figuredata = figures.initialize(request) -- we could use table.sparse but we set them later anyway insert(callstack,figuredata) lastfiguredata = figuredata return figuredata @@ -513,9 +574,9 @@ end local function register(askedname,specification) if not specification then - specification = { } + specification = { askedname = askedname, comment = "invalid specification" } elseif forbiddenname(specification.fullname) then - specification = { } + specification = { askedname = askedname, comment = "forbidden name" } else local format = specification.format if format then @@ -630,7 +691,7 @@ local function register(askedname,specification) format = newformat if not figures_suffixes[format] then -- maybe the new format is lowres.png (saves entry in suffixes) - -- so let's do thsi extra check + -- so let's do this extra check local suffix = file.suffix(newformat) if figures_suffixes[suffix] then if trace_figures then @@ -640,8 +701,12 @@ local function register(askedname,specification) end end elseif io.exists(oldname) then - specification.fullname = oldname -- was newname + report_inclusion("file %a is bugged",oldname) + if format and validtypes[format] then + specification.fullname = oldname + end specification.converted = false + specification.bugged = true end end end @@ -652,19 +717,24 @@ local function register(askedname,specification) if trace_figures then report_inclusion("format %a is not supported",format) end - else + elseif validtypes[format] then specification.found = true if trace_figures then - if validtypes[format] then -- format? - report_inclusion("format %a natively supported by backend",format) - else - report_inclusion("format %a supported by output file format",format) - end + report_inclusion("format %a natively supported by backend",format) + end + else + specification.found = false + if trace_figures then + report_inclusion("format %a supported by output file format",format) end end + else + specification.askedname = askedname + specification.found = false end end specification.foundname = specification.foundname or specification.fullname + specification.badname = figures.badname(askedname) local askedhash = f_hash_part(askedname,specification.conversion or "default",specification.resolution or "default") figures_found[askedhash] = specification return specification @@ -673,7 +743,10 @@ end local resolve_too = false -- true local internalschemes = { - file = true, + file = true, + tree = true, + dirfile = true, + dirtree = true, } local function locate(request) -- name, format, cache @@ -690,11 +763,18 @@ local function locate(request) -- name, format, cache local askedconversion = request.conversion local askedresolution = request.resolution -- - if request.format == "" or request.format == "unknown" then - request.format = nil + local askedformat = request.format + if not askedformat or askedformat == "" or askedformat == "unknown" then + askedformat = file.suffix(askedname) or "" + elseif askedformat == v_auto then + if trace_figures then + report_inclusion("ignoring suffix of %a",askedname) + end + askedformat = "" + askedname = file.removesuffix(askedname) end -- protocol check - local hashed = url.hashed(askedname) + local hashed = urlhashed(askedname) if not hashed then -- go on elseif internalschemes[hashed.scheme] then @@ -703,7 +783,7 @@ local function locate(request) -- name, format, cache askedname = path end else --- local fname = methodhandler('finders',pathname .. "/" .. wantedfiles[k]) + -- local fname = methodhandler('finders',pathname .. "/" .. wantedfiles[k]) local foundname = resolvers.findbinfile(askedname) if not foundname or not lfs.isfile(foundname) then -- foundname can be dummy if trace_figures then @@ -712,7 +792,6 @@ local function locate(request) -- name, format, cache -- url not found return register(askedname) end - local askedformat = request.format or file.suffix(askedname) or "" local guessedformat = figures.guess(foundname) if askedformat ~= guessedformat then if trace_figures then @@ -737,7 +816,6 @@ local function locate(request) -- name, format, cache -- we could use the hashed data instead local askedpath= file.is_rootbased_path(askedname) local askedbase = file.basename(askedname) - local askedformat = request.format or file.suffix(askedname) or "" if askedformat ~= "" then askedformat = lower(askedformat) if trace_figures then @@ -799,7 +877,7 @@ local function locate(request) -- name, format, cache if foundname then return register(check, { askedname = askedname, - fullname = check, + fullname = foundname, -- check, format = askedformat, cache = askedcache, conversion = askedconversion, @@ -859,7 +937,7 @@ local function locate(request) -- name, format, cache for i=1,#figure_paths do local path = figure_paths[i] local check = path .. "/" .. name - local isfile = url.hashed(check).scheme == "file" + local isfile = internalschemes[urlhashed(check).scheme] if not isfile then if trace_figures then report_inclusion("warning: skipping path %a",path) @@ -1018,7 +1096,7 @@ end function existers.generic(askedname,resolve) -- not findbinfile local result - if url.hasscheme(askedname) then + if hasscheme(askedname) then result = resolvers.findbinfile(askedname) elseif lfs.isfile(askedname) then result = askedname @@ -1281,16 +1359,30 @@ end -- programs.makeoptions = makeoptions local function runprogram(binary,argument,variables) - local binary = match(binary,"[%S]+") -- to be sure + -- os.which remembers found programs + local found = nil + if type(binary) == "table" then + for i=1,#binary do + found = os.which(binary[i]) + if found then + break + end + end + if not found then + binary = concat(binary, " | ") + end + elseif binary then + found = os.which(match(binary,"[%S]+")) + end if type(argument) == "table" then argument = concat(argument," ") -- for old times sake end - if not os.which(binary) then - report_inclusion("program %a is not installed, not running command: %s",binary,command) + if not found then + report_inclusion("program %a is not installed",binary or "?") elseif not argument or argument == "" then - report_inclusion("nothing to run, unknown program %a",binary) + report_inclusion("nothing to run, no arguments for program %a",binary) else - local command = format([["%s" %s]],binary,replacetemplate(longtostring(argument),variables)) + local command = format([["%s" %s]],found,replacetemplate(longtostring(argument),variables)) if trace_conversion or trace_programs then report_inclusion("running command: %s",command) end @@ -1315,7 +1407,7 @@ local epstopdf = { [v_medium] = "ebook", [v_high] = "prepress", }, - command = os.type == "windows" and "gswin32c" or "gs", + command = os.type == "windows" and { "gswin64c", "gswin32c" } or "gs", -- -dProcessDSCComments=false argument = [[ -q @@ -1326,8 +1418,8 @@ local epstopdf = { -dAutoRotatePages=/None -dPDFSETTINGS=/%presets% -dEPSCrop - -sOutputFile=%newname% - %oldname% + -sOutputFile="%newname%" + "%oldname%" -c quit ]], } @@ -1447,9 +1539,9 @@ bmpconverter.default = converter local bases = allocate() figures.bases = bases -local bases_list = nil -- index => { basename, fullname, xmlroot } -local bases_used = nil -- [basename] => { basename, fullname, xmlroot } -- pointer to list -local bases_found = nil +local bases_list = nil -- index => { basename, fullname, xmlroot } +local bases_used = nil -- [basename] => { basename, fullname, xmlroot } -- pointer to list +local bases_found = nil local bases_enabled = false local function reset() @@ -1577,7 +1669,15 @@ identifiers.list = { statistics.register("graphics processing time", function() local nofprocessed = figures.nofprocessed if nofprocessed > 0 then - return format("%s seconds including tex, %s processed images", statistics.elapsedtime(figures),nofprocessed) + local nofnames, nofbadnames = 0, 0 + for hash, data in next, figures_found do + nofnames = nofnames + 1 + if data.badname then + nofbadnames = nofbadnames + 1 + end + end + return format("%s seconds including tex, %s processed images, %s unique asked, %s bad names", + statistics.elapsedtime(figures),nofprocessed,nofnames,nofbadnames) else return nil end diff --git a/tex/context/base/grph-inc.mkiv b/tex/context/base/grph-inc.mkiv index e8b63cc4b..fd6004427 100644 --- a/tex/context/base/grph-inc.mkiv +++ b/tex/context/base/grph-inc.mkiv @@ -147,6 +147,11 @@ %D the already set parameters need to be set again or otherwise %D the old values will be used. +%D New: \type {method=auto}: strips suffix and uses \quote {order} which is handy in +%D some of four workflows where sources are used for web and print and where +%D the web tools need a suffix (like gif) which we don't want as we want a high +%D quality format. + \newconditional\c_grph_include_trace_inheritance \installtextracker diff --git a/tex/context/base/l-dir.lua b/tex/context/base/l-dir.lua index 660529baf..bcf28d011 100644 --- a/tex/context/base/l-dir.lua +++ b/tex/context/base/l-dir.lua @@ -36,9 +36,14 @@ if onwindows then -- lfs.isdir does not like trailing / -- lfs.dir accepts trailing / + local tricky = S("/\\") * P(-1) + isdir = function(name) - name = gsub(name,"([/\\]+)$","/.") - return attributes(name,"mode") == "directory" + if lpegmatch(tricky,name) then + return attributes(name,"mode") == "directory" + else + return attributes(name.."/.","mode") == "directory" + end end isfile = function(name) diff --git a/tex/context/base/l-file.lua b/tex/context/base/l-file.lua index ebb2b39f4..c05372a05 100644 --- a/tex/context/base/l-file.lua +++ b/tex/context/base/l-file.lua @@ -495,6 +495,23 @@ function file.collapsepath(str,anchor) -- anchor: false|nil, true, "." end end +-- better this way: + +local tricky = S("/\\") * P(-1) +local attributes = lfs.attributes + +function lfs.isdir(name) + if lpegmatch(tricky,name) then + return attributes(name,"mode") == "directory" + else + return attributes(name.."/.","mode") == "directory" + end +end + +function lfs.isfile(name) + return attributes(name,"mode") == "file" +end + -- local function test(str,...) -- print(string.format("%-20s %-15s %-30s %-20s",str,file.collapsepath(str),file.collapsepath(str,true),file.collapsepath(str,"."))) -- end diff --git a/tex/context/base/l-table.lua b/tex/context/base/l-table.lua index ca067fb1e..e642106cc 100644 --- a/tex/context/base/l-table.lua +++ b/tex/context/base/l-table.lua @@ -922,16 +922,27 @@ end table.identical = identical table.are_equal = are_equal --- maybe also make a combined one - -function table.compact(t) -- remove empty tables, assumes subtables - if t then - for k, v in next, t do - if not next(v) then -- no type checking - t[k] = nil +local function sparse(old,nest,keeptables) + local new = { } + for k, v in next, old do + if not (v == "" or v == false) then + if nest and type(v) == "table" then + v = sparse(v,nest) + if keeptables or next(v) then + new[k] = v + end + else + new[k] = v end end end + return new +end + +table.sparse = sparse + +function table.compact(t) + return sparse(t,true,true) end function table.contains(t, v) diff --git a/tex/context/base/lang-txt.lua b/tex/context/base/lang-txt.lua index f96ee52a1..4f9f242e6 100644 --- a/tex/context/base/lang-txt.lua +++ b/tex/context/base/lang-txt.lua @@ -990,6 +990,18 @@ data.labels={ vi="Đồ thị", }, }, + precedingpage={ + labels={ + en="on a preceding page", + nl="op een voorgaande bladzijde", + }, + }, + followingpage={ + labels={ + en="on a following page", + nl="op een volgende bladzijde", + }, + }, hencefore={ labels={ af="", diff --git a/tex/context/base/mult-de.mkii b/tex/context/base/mult-de.mkii index 6c5633010..1751f4780 100644 --- a/tex/context/base/mult-de.mkii +++ b/tex/context/base/mult-de.mkii @@ -180,6 +180,7 @@ \setinterfacevariable{flushleft}{flushleft} \setinterfacevariable{flushouter}{flushouter} \setinterfacevariable{flushright}{flushright} +\setinterfacevariable{followingpage}{followingpage} \setinterfacevariable{footer}{fusszeile} \setinterfacevariable{footnote}{fussnote} \setinterfacevariable{force}{zwinge} @@ -360,6 +361,7 @@ \setinterfacevariable{positive}{positiv} \setinterfacevariable{postponing}{verschieben} \setinterfacevariable{postscript}{postscript} +\setinterfacevariable{precedingpage}{followingpage} \setinterfacevariable{preference}{einstellung} \setinterfacevariable{preview}{vorschau} \setinterfacevariable{previous}{vorig} diff --git a/tex/context/base/mult-def.lua b/tex/context/base/mult-def.lua index 4d923f5c1..ffb95f76b 100644 --- a/tex/context/base/mult-def.lua +++ b/tex/context/base/mult-def.lua @@ -11405,6 +11405,14 @@ return { }, }, ["variables"]={ + ["followingpage"]={ + ["en"]="followingpage", + ["nl"]="opvolgendepagina", + }, + ["precedingpage"]={ + ["en"]="followingpage", + ["nl"]="voorafgaandepagina", + }, ["math"]={ ["en"]="math", }, diff --git a/tex/context/base/mult-en.mkii b/tex/context/base/mult-en.mkii index 188c85ab4..72185f3ab 100644 --- a/tex/context/base/mult-en.mkii +++ b/tex/context/base/mult-en.mkii @@ -180,6 +180,7 @@ \setinterfacevariable{flushleft}{flushleft} \setinterfacevariable{flushouter}{flushouter} \setinterfacevariable{flushright}{flushright} +\setinterfacevariable{followingpage}{followingpage} \setinterfacevariable{footer}{footer} \setinterfacevariable{footnote}{footnote} \setinterfacevariable{force}{force} @@ -360,6 +361,7 @@ \setinterfacevariable{positive}{positive} \setinterfacevariable{postponing}{postponing} \setinterfacevariable{postscript}{postscript} +\setinterfacevariable{precedingpage}{followingpage} \setinterfacevariable{preference}{preference} \setinterfacevariable{preview}{preview} \setinterfacevariable{previous}{previous} diff --git a/tex/context/base/mult-fr.mkii b/tex/context/base/mult-fr.mkii index 735682a60..2a6d85c91 100644 --- a/tex/context/base/mult-fr.mkii +++ b/tex/context/base/mult-fr.mkii @@ -180,6 +180,7 @@ \setinterfacevariable{flushleft}{flushleft} \setinterfacevariable{flushouter}{flushouter} \setinterfacevariable{flushright}{flushright} +\setinterfacevariable{followingpage}{followingpage} \setinterfacevariable{footer}{pdp} \setinterfacevariable{footnote}{notepdp} \setinterfacevariable{force}{force} @@ -360,6 +361,7 @@ \setinterfacevariable{positive}{positif} \setinterfacevariable{postponing}{postponing} \setinterfacevariable{postscript}{postscript} +\setinterfacevariable{precedingpage}{followingpage} \setinterfacevariable{preference}{preference} \setinterfacevariable{preview}{previsualisation} \setinterfacevariable{previous}{precedent} diff --git a/tex/context/base/mult-it.mkii b/tex/context/base/mult-it.mkii index a96b1b180..9eb0139a1 100644 --- a/tex/context/base/mult-it.mkii +++ b/tex/context/base/mult-it.mkii @@ -180,6 +180,7 @@ \setinterfacevariable{flushleft}{flushleft} \setinterfacevariable{flushouter}{flushouter} \setinterfacevariable{flushright}{flushright} +\setinterfacevariable{followingpage}{followingpage} \setinterfacevariable{footer}{piedipagina} \setinterfacevariable{footnote}{notapdp} \setinterfacevariable{force}{forza} @@ -360,6 +361,7 @@ \setinterfacevariable{positive}{positivo} \setinterfacevariable{postponing}{posporre} \setinterfacevariable{postscript}{postscript} +\setinterfacevariable{precedingpage}{followingpage} \setinterfacevariable{preference}{preferenza} \setinterfacevariable{preview}{anteprima} \setinterfacevariable{previous}{precedente} diff --git a/tex/context/base/mult-nl.mkii b/tex/context/base/mult-nl.mkii index 66cfbc83a..881b4f467 100644 --- a/tex/context/base/mult-nl.mkii +++ b/tex/context/base/mult-nl.mkii @@ -180,6 +180,7 @@ \setinterfacevariable{flushleft}{lijnlinks} \setinterfacevariable{flushouter}{lijnbuiten} \setinterfacevariable{flushright}{lijnrechts} +\setinterfacevariable{followingpage}{opvolgendepagina} \setinterfacevariable{footer}{voet} \setinterfacevariable{footnote}{voetnoot} \setinterfacevariable{force}{forceer} @@ -360,6 +361,7 @@ \setinterfacevariable{positive}{positief} \setinterfacevariable{postponing}{uitstellen} \setinterfacevariable{postscript}{postscript} +\setinterfacevariable{precedingpage}{voorafgaandepagina} \setinterfacevariable{preference}{voorkeur} \setinterfacevariable{preview}{preview} \setinterfacevariable{previous}{vorige} diff --git a/tex/context/base/mult-pe.mkii b/tex/context/base/mult-pe.mkii index a81d9d024..076342282 100644 --- a/tex/context/base/mult-pe.mkii +++ b/tex/context/base/mult-pe.mkii @@ -180,6 +180,7 @@ \setinterfacevariable{flushleft}{پمپ‌چپ} \setinterfacevariable{flushouter}{پمپ‌خارجی} \setinterfacevariable{flushright}{پمپ‌راست} +\setinterfacevariable{followingpage}{followingpage} \setinterfacevariable{footer}{ته‌برگ} \setinterfacevariable{footnote}{پانوشت} \setinterfacevariable{force}{اجبار} @@ -360,6 +361,7 @@ \setinterfacevariable{positive}{مثبت} \setinterfacevariable{postponing}{تاخیر} \setinterfacevariable{postscript}{پست‌اسکریپت} +\setinterfacevariable{precedingpage}{followingpage} \setinterfacevariable{preference}{ترجیح} \setinterfacevariable{preview}{پیش‌دید} \setinterfacevariable{previous}{قبلی} diff --git a/tex/context/base/mult-ro.mkii b/tex/context/base/mult-ro.mkii index b6a070c59..ec372c6ba 100644 --- a/tex/context/base/mult-ro.mkii +++ b/tex/context/base/mult-ro.mkii @@ -180,6 +180,7 @@ \setinterfacevariable{flushleft}{flushleft} \setinterfacevariable{flushouter}{flushouter} \setinterfacevariable{flushright}{flushright} +\setinterfacevariable{followingpage}{followingpage} \setinterfacevariable{footer}{subsol} \setinterfacevariable{footnote}{notasubsol} \setinterfacevariable{force}{fortat} @@ -360,6 +361,7 @@ \setinterfacevariable{positive}{positiv} \setinterfacevariable{postponing}{postponing} \setinterfacevariable{postscript}{postscript} +\setinterfacevariable{precedingpage}{followingpage} \setinterfacevariable{preference}{preferinta} \setinterfacevariable{preview}{previzualizare} \setinterfacevariable{previous}{precedent} diff --git a/tex/context/base/node-tra.lua b/tex/context/base/node-tra.lua index 081107277..ea17c5738 100644 --- a/tex/context/base/node-tra.lua +++ b/tex/context/base/node-tra.lua @@ -171,6 +171,7 @@ local function tosequence(start,stop,compact) end nodes.tosequence = tosequence +nuts .tosequence = tosequence function nodes.report(t,done) report_nodes("output %a, %changed %a, %s nodes",status.output_active,done,count_nodes(tonut(t))) diff --git a/tex/context/base/pack-rul.mkiv b/tex/context/base/pack-rul.mkiv index 5aa633207..4bc606d9a 100644 --- a/tex/context/base/pack-rul.mkiv +++ b/tex/context/base/pack-rul.mkiv @@ -831,11 +831,14 @@ \edef\currentframed{>\the\c_pack_framed_nesting}% \pack_framed_initialize \pack_framed_process_framed[#1]% can be inlined - \bgroup} + \bgroup + \ignorespaces} % till here -\let\stopframed\egroup +\unexpanded\def\stopframed + {\removeunwantedspaces + \egroup} \unexpanded\def\normalframedwithsettings[#1]% {\bgroup diff --git a/tex/context/base/page-txt.mkvi b/tex/context/base/page-txt.mkvi index c38b2fd4c..93e893eef 100644 --- a/tex/context/base/page-txt.mkvi +++ b/tex/context/base/page-txt.mkvi @@ -756,10 +756,12 @@ \page_layouts_reset_page_number_location \ifx\p_strc_pagenumbers_location\empty % set otherwise + \else\ifx\p_strc_pagenumbers_location\v!none + % set otherwise \else \page_layouts_identify_page_number_location \page_layouts_set_page_number_location - \fi + \fi\fi \fi} \def\page_layouts_place_page_number_left % historic diff --git a/tex/context/base/publ-ini.lua b/tex/context/base/publ-ini.lua index 191e11db8..7a7912fed 100644 --- a/tex/context/base/publ-ini.lua +++ b/tex/context/base/publ-ini.lua @@ -503,7 +503,7 @@ function commands.flushmarked() nofcitations = nofcitations + 1 marknocite(marked_dataset,tag,nofcitations) if trace_cite then - report_cite("mark, dataset: %s, tag: %s, number: %s, state: %s",dataset,tag,nofcitations,"unset") + report_cite("mark, dataset: %s, tag: %s, number: %s, state: %s",marked_dataset,tag,nofcitations,"unset") end else end @@ -686,9 +686,10 @@ function commands.setbtxdataset(name,default) if dataset then context(name) elseif default and default ~= "" then - context(name) + context(default) else - report("unknown dataset %a",name) + context(v_standard) + report("unknown dataset %a, forcing %a",name,standard) end end @@ -899,6 +900,7 @@ setmetatableindex(renderings,function(t,k) ordered = { }, shorts = { }, method = v_none, + texts = setmetatableindex("table"), currentindex = 0, } t[k] = v @@ -1016,13 +1018,16 @@ end -- global : if tag and not alldone[tag] and done[tag] ~= section then ... methods[v_local] = function(dataset,rendering,keyword) - local result = structures.lists.filter(rendering.specification) or { } - local section = sections.currentid() - local list = rendering.list - local done = rendering.done - local alldone = rendering.alldone - local doglobal = rendering.method == v_global - local traced = { } -- todo: only if interactive (backlinks) or when tracing + local result = structures.lists.filter(rendering.specification) or { } + local section = sections.currentid() + local list = rendering.list + local repeated = rendering.repeated == v_yes + local r_done = rendering.done + local r_alldone = rendering.alldone + local done = repeated and { } or r_done + local alldone = repeated and { } or r_alldone + local doglobal = rendering.method == v_global + local traced = { } -- todo: only if interactive (backlinks) or when tracing for listindex=1,#result do local r = result[listindex] local u = r.userdata @@ -1030,7 +1035,7 @@ methods[v_local] = function(dataset,rendering,keyword) local tag = u.btxref if not tag then -- problem - elseif done[tag] == section then + elseif done[tag] == section then -- a bit messy for global and all and so -- skip elseif doglobal and alldone[tag] then -- skip @@ -1101,7 +1106,7 @@ local splitter = sorters.splitters.utf local strip = sorters.strip local function newsplitter(splitter) - return table.setmetatableindex({},function(t,k) -- could be done in the sorter but seldom that many shared + return setmetatableindex({},function(t,k) -- could be done in the sorter but seldom that many shared local v = splitter(k,true) -- in other cases t[k] = v return v @@ -1274,7 +1279,7 @@ function lists.flushentries(dataset,sorttype) local used = rendering.used local forceall = rendering.criterium == v_all local repeated = rendering.repeated == v_yes - local luadata = datasets[dataset].luadata + local luadata = datasets[dataset].luadata if type(sorter) == "function" then list = sorter(dataset,rendering,list,sorttype) or list end @@ -1585,6 +1590,7 @@ local function processcite(dataset,reference,mark,compress,setup,internal,getter end if tobemarked then flushmarked(dataset,list) + commands.flushmarked() -- here (could also be done in caller) end end diff --git a/tex/context/base/publ-ini.mkiv b/tex/context/base/publ-ini.mkiv index 7f89e306e..96b5eb422 100644 --- a/tex/context/base/publ-ini.mkiv +++ b/tex/context/base/publ-ini.mkiv @@ -313,9 +313,6 @@ \unexpanded\def\setbtxentry[#1]% {\edef\currentbtxtag{\ctxcommand{setbtxentry("\currentbtxdataset","#1")}}} -\setbtxdataset - [\v!standard] - % \let\btxsetdataset\setbtxdataset % \let\btxsetentry \setbtxentry @@ -536,8 +533,13 @@ \def\publ_place_list_complete[#1][#2]% title might become obsolete, just headtext {\begingroup - \edef\currentbtxrendering{#1}% - \setupcurrentbtxrendering[#2]% + \ifsecondargument + \edef\currentbtxrendering{#1}% + \setupcurrentbtxrendering[#2]% + \else\iffirstargument + \let\currentbtxrendering\currentbtxdataset + \setupcurrentbtxrendering[#1]% + \fi\fi \the\everybtxlistrendering \edef\currentbtxrenderingtitle{\btxrenderingparameter\c!title}% \ifx\currentbtxrenderingtitle\empty @@ -551,8 +553,13 @@ \def\publ_place_list_standard[#1][#2]% {\begingroup - \edef\currentbtxrendering{#1}% - \setupcurrentbtxrendering[#2]% + \ifsecondargument + \edef\currentbtxrendering{#1}% + \setupcurrentbtxrendering[#2]% + \else\iffirstargument + \let\currentbtxrendering\currentbtxdataset + \setupcurrentbtxrendering[#1]% + \fi\fi \the\everybtxlistrendering \publ_place_list_indeed \endgroup} @@ -1052,6 +1059,9 @@ %D Defaults: +\setbtxdataset + [\v!standard] + \setupbtxrendering [\c!dataset=\v!standard, \c!repeat=\v!no, diff --git a/tex/context/base/s-figures-names.mkiv b/tex/context/base/s-figures-names.mkiv new file mode 100644 index 000000000..913fcafdb --- /dev/null +++ b/tex/context/base/s-figures-names.mkiv @@ -0,0 +1,96 @@ +%D \module +%D [ file=s-figures-names.mkiv, +%D version=2017.07.17, +%D title=\CONTEXT\ Style File, +%D subtitle=Show Figure Names, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Normally this module will be run someplace at the end of a document in some kind of tracing +%D mode. We could hook it into \type {\stoptext} but better leave it up to the user. Loading +%D this module upfront will not show anything useful. The main reason for making this module +%D was that we wanted to report weird figurenames: spaces, multiple hyphens in a row, mixed +%D hyphens and underscores, inconsistently mixed upper and lowercase, etc. +%D +%D If you only want info in the logfile, you can use: +%D +%D \starttyping +%D \enabletrackers[graphics.lognames] +%D \stoptyping +%D +%D This directive is persistent and can be issued any time before the end of the run. + +\startmodule[figures-names] + +\startluacode + +local context = context +local ctx_NC = context.NC +local ctx_NR = context.NR +local ctx_red = context.red +local ctx_starttabulate = context.starttabulate +local ctx_stoptabulate = context.stoptabulate + +trackers.enable("graphics.lognames") + +context.start() + + context.switchtobodyfont { "tt,small" } + + local template = { "|Bl|l|" } + + for _, data in table.sortedhash(figures.found) do + ctx_starttabulate(template) + local badname = data.badname + local found = data.found + ctx_NC() + context("asked name") + ctx_NC() + if badname then + ctx_red() + end + context(data.askedname) + ctx_NC() ctx_NR() + if found then + ctx_NC() + context("format") + ctx_NC() + context(data.format) + ctx_NC() ctx_NR() + ctx_NC() + context("found file") + ctx_NC() + context(data.foundname) + ctx_NC() ctx_NR() + ctx_NC() + context("used file") + ctx_NC() + context(data.fullname) + ctx_NC() ctx_NR() + if badname then + ctx_NC() + context("comment") + ctx_NC() + context("bad name") + ctx_NC() ctx_NR() + end + else + ctx_NC() + context("comment") + ctx_NC() + context(data.comment or "not found") + ctx_NC() ctx_NR() + end + ctx_stoptabulate() + end + +context.stop() + +\stopluacode + +\stopmodule diff --git a/tex/context/base/s-math-repertoire.mkiv b/tex/context/base/s-math-repertoire.mkiv index 314d23868..eeda5f66c 100644 --- a/tex/context/base/s-math-repertoire.mkiv +++ b/tex/context/base/s-math-repertoire.mkiv @@ -169,7 +169,10 @@ \startgot [U+02200] operators \stopgot \quad \startgot [U+02701] symbols a \stopgot \quad \startgot [U+02901] symbols b \stopgot \quad - \startgot [U+02A00] supplemental \stopgot + \startgot [U+02A00] supplemental \stopgot \quad + \startgot [U+027F0] arrows a \stopgot \quad + \startgot [U+02900] arrows b \stopgot \quad + \startgot [U+1F800] arrows c \stopgot \stopinteractionmenu \defineframed @@ -418,7 +421,7 @@ \continueifinputfile{s-math-repertoire.mkiv} -\showmathcharacterssetbodyfonts{lucidanova,cambria,xits,modern,pagella,termes,bonum,schola} +\showmathcharacterssetbodyfonts{lucidaot,cambria,xits,modern,pagella,termes,bonum,schola} \starttext @@ -434,10 +437,10 @@ % \setupbodyfont[stix, 12pt] % \setupbodyfont[xits, 12pt] % \setupbodyfont[lucida, 12pt] - % \setupbodyfont[lucidanova,12pt] + \setupbodyfont[lucidaot, 12pt] % \setupbodyfont[pagella, 12pt] % \setupbodyfont[bonum, 12pt] - \setupbodyfont[schola, 12pt] + % \setupbodyfont[schola, 12pt] } { diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index 4cd7076d1..0241ba073 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf index 0b0f756c7..e54405486 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/context/base/strc-lst.lua b/tex/context/base/strc-lst.lua index 16160e273..6a2c07249 100644 --- a/tex/context/base/strc-lst.lua +++ b/tex/context/base/strc-lst.lua @@ -221,6 +221,8 @@ end local enhanced = { } +local synchronizepage = function(r) synchronizepage = references.synchronizepage return synchronizepage(r) end -- bah ... will move + function lists.enhance(n) local l = cached[n] if not l then @@ -237,7 +239,7 @@ function lists.enhance(n) -- save in the right order (happens at shipout) lists.tobesaved[#lists.tobesaved+1] = l -- default enhancer (cross referencing) - references.realpage = texgetcount("realpageno") + synchronizepage(references) -- tags local kind = metadata.kind local name = metadata.name diff --git a/tex/context/base/strc-ref.lua b/tex/context/base/strc-ref.lua index 3f2c0608d..8a2a668c0 100644 --- a/tex/context/base/strc-ref.lua +++ b/tex/context/base/strc-ref.lua @@ -76,6 +76,8 @@ local references = structures.references local lists = structures.lists local counters = structures.counters +local jobpositions = job.positions + -- some might become local references.defined = references.defined or allocate() @@ -387,10 +389,28 @@ function references.set(kind,prefix,tag,data) return n > 0 end +-- function references.enhance(prefix,tag) +-- local l = tobesaved[prefix][tag] +-- if l then +-- l.references.realpage = texgetcount("realpageno") +-- end +-- end + +local getpos = function() getpos = backends.codeinjections.getpos return getpos () end + +local function synchronizepage(reference) -- non public helper + reference.realpage = texgetcount("realpageno") + if jobpositions.used then + reference.x, reference.y = getpos() + end +end + +references.synchronizepage = synchronizepage + function references.enhance(prefix,tag) local l = tobesaved[prefix][tag] if l then - l.references.realpage = texgetcount("realpageno") + synchronizepage(l.references) end end @@ -2056,12 +2076,71 @@ local specials = references.testspecials -- pretty slow (progressively). In the pagebody one can best check the reference -- real page to determine if we need contrastlocation as that is more lightweight. -local function checkedpagestate(n,page) - local r = referredpage(n) +local function checkedpagestate(n,page,actions,position,spread) local p = tonumber(page) if not p then return 0 - elseif p > r then + end + if position and #actions > 0 then + local i = actions[1].i -- brrr + if i then + local a = i.references + if a then + local x = a.x + local y = a.y + if x and y then + local jp = jobpositions.collected[position] + if jp then + local px = jp.x + local py = jp.y + local pp = jp.p + if p == pp then + -- same page + if py > y then + return 5 -- above + elseif py < y then + return 4 -- below + elseif px > x then + return 4 -- below + elseif px < x then + return 5 -- above + else + return 1 -- same + end + elseif spread then + if pp % 2 == 0 then + -- left page + if pp > p then + return 2 -- before + elseif pp + 1 == p then +-- return 4 -- below (on right page) + return 5 -- above (on left page) + else + return 3 -- after + end + else + -- right page + if pp < p then + return 3 -- after + elseif pp - 1 == p then +-- return 5 -- above (on left page) + return 4 -- below (on right page) + else + return 2 -- before + end + end + elseif pp > p then + return 2 -- before + else + return 3 -- after + end + end + end + end + end + end + local r = referredpage(n) -- sort of obsolete + if p > r then return 3 -- after elseif p < r then return 2 -- before @@ -2104,7 +2183,7 @@ end -- at this moment only the real reference page is analyzed -- normally such an analysis happens in the backend code -function references.analyze(actions) +function references.analyze(actions,position,spread) if not actions then actions = references.currentset end @@ -2119,24 +2198,44 @@ function references.analyze(actions) elseif actions.external then actions.pagestate = 0 else - actions.pagestate = checkedpagestate(actions.n,realpage) + actions.pagestate = checkedpagestate(actions.n,realpage,actions,position,spread) end end return actions end -function commands.referencepagestate(actions) - if not actions then - actions = references.currentset - end +-- function commands.referencepagestate(actions) +-- if not actions then +-- actions = references.currentset +-- end +-- if not actions then +-- context(0) +-- else +-- if not actions.pagestate then +-- references.analyze(actions) -- delayed unless explicitly asked for +-- end +-- context(actions.pagestate) +-- end +-- end + +function commands.referencepagestate(position,detail,spread) + local actions = references.currentset if not actions then context(0) else if not actions.pagestate then - references.analyze(actions) -- delayed unless explicitly asked for --- print("NO STATE",actions.reference,actions.pagestate) + references.analyze(actions,position,spread) -- delayed unless explicitly asked for + end + local pagestate = actions.pagestate + if detail then + context(pagestate) + elseif pagestate == 4 then + context(2) -- compatible + elseif pagestate == 5 then + context(3) -- compatible + else + context(pagestate) end - context(actions.pagestate) end end diff --git a/tex/context/base/strc-ref.mkvi b/tex/context/base/strc-ref.mkvi index 87a3ee478..715459172 100644 --- a/tex/context/base/strc-ref.mkvi +++ b/tex/context/base/strc-ref.mkvi @@ -984,41 +984,198 @@ %D ... \atpage[someref] ... %D \stoptyping -% 0 = unknown -% 1 = same -% 2 = before -% 3 = after +% % 0 = unknown +% % 1 = same +% % 2 = before +% % 3 = after +% +% \def\strc_references_by_reference_page_state#unknown#before#current#after% +% {\ifcase\referencepagestate\space#unknown\or#current\or#before\or#after\fi} +% +% % \unexpanded\def\somewhere#backward#foreward#dummy[#label]% #dummy gobbles space around #foreward +% % {\doifreferencefoundelse{#label}% usage needs checking (useless) +% % {\goto{\strc_references_by_reference_page_state{#label}{#backward}{}{#foreward}}[#label]} +% % {[#label]}} +% % +% % better: +% +% \unexpanded\def\somewhere#backward#foreward#dummy[#label]% #dummy gobbles space around #foreward +% {\doifreferencefoundelse{#label}% +% {\strc_references_by_reference_page_state{#label}{\goto{#backward}[#label]}{}{\goto{#foreward}[#label]}} +% {[#label]}} +% +% \unexpanded\def\atpage[#label]% todo +% {\doifreferencefoundelse{#label}% kind of inefficient as \goto also analyzes +% {\goto +% {\strc_references_by_reference_page_state +% {\labeltexts\v!page\dummyreference}% +% {\labeltext\v!hencefore}% +% {\labeltexts\v!atpage\currentreferencepage}% +% {\labeltext\v!hereafter}}% +% [#label]} +% {[#label]}} +% +% \unexpanded\def\referencesymbol +% {\hbox{\strut\high +% {\setupsymbolset[\interactionparameter\c!symbolset]% +% \symbol[\strc_references_by_reference_page_state\v!somewhere\v!nowhere\v!previous\v!next]}}} + +% standard detail +% +% 0 = unknown unknown +% 1 = same on same page +% 2 = before preceding page +% 3 = after following page +% +% 4 = above above on same page +% 5 = below below on same page + +% todo: optimize for use in pagebody +% todo: maybe make it optional + +% \setuppagenumbering[alternative=doublesided] +% \setupreferencing [doublesided=no] % yes is default +% +% \somewhere{backward}{foreward}[label] +% \someplace{preceding}{backward}{current}{foreward}{following}[label] +% \atpage[#label] +% \doifcheckedpagestate{label}{preceding}{backward}{current}{foreward}{following}{otherwise} +% +% \dorecurse {20} { +% \placefigure[here][fig:#1]{}{\externalfigure[dummy]} +% \dorecurse {20} { +% ##1: \atpage[fig:##1] / +% \doifcheckedpagestate +% {fig:##1} +% {preceding}{backward}{current}{foreward}{following} +% {otherwise} +% } +% } + +\newcount \nofreferencestates +\newconditional\pagestatespread + +\appendtoks + \doifelse{\referencingparameter\c!doublesided}\v!yes\settrue\setfalse\pagestatespread +\to \everysetupreferencing + +\setupreferencing + [\c!doublesided=\v!yes] -\def\strc_references_by_reference_page_state#unknown#before#current#after% - {\ifcase\referencepagestate\space#unknown\or#current\or#before\or#after\fi} +\def\referencepagestate {\numexpr\ctxcommand{referencepagestate("rst::\number\nofreferencestates")}\relax} +\def\referencepagedetail{\numexpr\ctxcommand{referencepagestate("rst::\number\nofreferencestates",true\ifconditional\pagestatespread\ifdoublesided,\s!true\fi\fi)}\relax} + +\unexpanded\def\tracedpagestate + {{\blue\tttf(\ifcase\referencepagedetail unknown\or same\or previous\or next\or above\or below\else unknown\fi)}} + +\unexpanded\def\markreferencepage + {\dontleavehmode\begingroup + \iftrialtypesetting + % issue warning that not stable + \else + % needs checking ... but probably never in trialmode + \global\advance\nofreferencestates\plusone + \xypos{rst::\number\nofreferencestates}% + % \tracedpagestate + \fi + \endgroup} + +% \def\strc_references_by_reference_page_state#unknown#before#current#after% obsolete +% {\ifcase\referencepagestate#unknown\or#current\or#before\or#after\or#before\or#after\else#unknown\fi} +% +% \def\strc_references_by_reference_page_state#unknown#same#previous#next#above#below% not needed +% {\ifcase\referencepagestate#unknown\or#same\or#previous\or#next\or#above\or#below\else#unknown\fi} + +\unexpanded\def\doifcheckedpagestate#label% #preceding#backward#current#foreward#following#otherwise% + {\doifreferencefoundelse{#label}\strc_references_handle_page_state_yes\strc_references_handle_page_state_nop} + +\let\strc_references_handle_page_state_nop\sixthofsixarguments + +\def\strc_references_handle_page_state_yes + {\markreferencepage + \ifcase\referencepagedetail + \expandafter\sixthofsixarguments \or + \expandafter\thirdofsixarguments \or + \expandafter\firstofsixarguments \or + \expandafter\fifthofsixarguments \or + \expandafter\secondofsixarguments\or + \expandafter\fourthofsixarguments\else + \expandafter\sixthofsixarguments \fi} + +\unexpanded\def\referencesymbol + {\hbox\bgroup + \strut + \markreferencepage + \high + {\setupsymbolset[\interactionparameter\c!symbolset]% + \symbol[\ifcase\referencepagedetail\v!somewhere\or\v!nowhere\or\v!previous\or\v!next\or\v!previous\or\v!next\else\v!somewhere\fi]}% + \egroup} % \unexpanded\def\somewhere#backward#foreward#dummy[#label]% #dummy gobbles space around #foreward -% {\doifreferencefoundelse{#label}% usage needs checking (useless) -% {\goto{\strc_references_by_reference_page_state{#label}{#backward}{}{#foreward}}[#label]} +% {\doifreferencefoundelse{#label}% +% {\markreferencepage +% \ifcase\referencepagedetail +% #label\or % unknown +% \or % same +% \goto{#backward}[#label]\or % previous +% \goto{#foreward}[#label]\or % next +% \goto{#backward}[#label]\or % above +% \goto{#foreward}[#label]\else % below +% #label\fi}% % {[#label]}} -% -% better: \unexpanded\def\somewhere#backward#foreward#dummy[#label]% #dummy gobbles space around #foreward - {\doifreferencefoundelse{#label}% - {\strc_references_by_reference_page_state{#label}{\goto{#backward}[#label]}{}{\goto{#foreward}[#label]}} - {[#label]}} + {\doifcheckedpagestate{#label}% + {\goto{#backward}[#label]}% + {\goto{#backward}[#label]}% + {}% + {\goto{#foreward}[#label]}% + {\goto{#foreward}[#label]}% + {#label}}% + +% \unexpanded\def\someplace#preceding#backward#current#foreward#following#dummy[#label]% #dummy gobbles space around #foreward +% {\doifreferencefoundelse{#label}% +% {\markreferencepage +% \ifcase\referencepagedetail +% #label\or % unknown +% \doifsomething {#current}{\goto {#current}[#label]}\or % same +% \doifsomething{#preceding}{\goto{#preceding}[#label]}\or % previous +% \doifsomething{#following}{\goto{#following}[#label]}\or % next +% \doifsomething {#backward}{\goto {#backward}[#label]}\or % above +% \doifsomething {#foreward}{\goto {#foreward}[#label]}\else % below +% #label\fi}% +% {[#label]}} -\unexpanded\def\atpage[#label]% todo - {\doifreferencefoundelse{#label}% kind of inefficient as \goto also analyzes - {\goto - {\strc_references_by_reference_page_state - {\labeltexts\v!page\dummyreference}% - {\labeltext\v!hencefore}% - {\labeltexts\v!atpage\currentreferencepage}% - {\labeltext\v!hereafter}}% - [#label]} - {[#label]}} +\unexpanded\def\someplace#preceding#backward#current#foreward#following#dummy[#label]% #dummy gobbles space around #foreward + {\doifcheckedpagestate{#label}% + {\doifsomething{#preceding}{\goto{#preceding}[#label]}}% + {\doifsomething {#backward}{\goto {#backward}[#label]}}% + {\doifsomething {#current}{\goto {#current}[#label]}}% + {\doifsomething {#foreward}{\goto {#foreward}[#label]}}% + {\doifsomething{#following}{\goto{#following}[#label]}}% + {#label}} + +% \unexpanded\def\atpage[#label]% todo +% {\doifreferencefoundelse{#label}% kind of inefficient as \goto also analyzes +% {\markreferencepage +% \ifcase\referencepagedetail +% \goto{\labeltexts\v!page\dummyreference}[#label]\or % unknown +% \or % same +% \goto{\labeltext \v!precedingpage }[#label]\or % previous +% \goto{\labeltext \v!followingpage }[#label]\or % next +% \goto{\labeltext \v!hencefore }[#label]\or % above +% \goto{\labeltext \v!hereafter }[#label]\else % below +% \goto{\labeltexts\v!page\dummyreference}[#label]\fi}% +% {[#label]}} -\unexpanded\def\referencesymbol - {\hbox{\strut\high - {\setupsymbolset[\interactionparameter\c!symbolset]% - \symbol[\strc_references_by_reference_page_state\v!somewhere\v!nowhere\v!previous\v!next]}}} +\unexpanded\def\atpage[#label]% todo + {\doifcheckedpagestate{#label}% + {\goto{\labeltext \v!precedingpage }[#label]}% + {\goto{\labeltext \v!hencefore }[#label]}% + {}% + {\goto{\labeltext \v!hereafter }[#label]}% + {\goto{\labeltext \v!followingpage }[#label]}% + {\goto{\labeltexts\v!page\dummyreference}[#label]}} %D The other alternatives just conform their names: only the %D label, only the text, or the label and the text. diff --git a/tex/context/base/x-mathml.mkiv b/tex/context/base/x-mathml.mkiv index 5335e5ca0..14cf583d1 100644 --- a/tex/context/base/x-mathml.mkiv +++ b/tex/context/base/x-mathml.mkiv @@ -2326,11 +2326,19 @@ \def\mmlextensible#1{\ctxmodulemathml{extensible(\!!bs#1\!!es)}} -\unexpanded\def\mmlunderuf#1{\mmlexecuteifdefined\mmlundercommand\relax {\mmlunexpandedfirst {#1}}\relax} -\unexpanded\def\mmlunderus#1{\mmlexecuteifdefined\mmlundercommand {\mmlunexpandedsecond{#1}}\relax} -\unexpanded\def\mmlunderbf#1{\mmlexecuteifdefined\mmlbasecommand {\mmlunexpandedfirst {#1}}\relax} -%unexpanded\def\mmlunderbs#1{\mmlexecuteifdefined\mmlbasecommand \relax{}{\mmlunexpandedsecond{#1}}\relax} -\unexpanded\def\mmlunderbs#1{\mmlexecuteifdefined\mmlbasecommand \relax {\mmlunexpandedsecond{#1}}\relax} +% \unexpanded\def\mmlunderuf#1{\mmlexecuteifdefined\mmlundercommand\relax {\mmlunexpandedfirst {#1}}\relax} +% \unexpanded\def\mmlunderus#1{\mmlexecuteifdefined\mmlundercommand {\mmlunexpandedsecond{#1}}\relax} +% \unexpanded\def\mmlunderbf#1{\mmlexecuteifdefined\mmlbasecommand {\mmlunexpandedfirst {#1}}\relax} +% %unexpanded\def\mmlunderbs#1{\mmlexecuteifdefined\mmlbasecommand \relax{}{\mmlunexpandedsecond{#1}}\relax} +% \unexpanded\def\mmlunderbs#1{\mmlexecuteifdefined\mmlbasecommand \relax {\mmlunexpandedsecond{#1}}\relax} + +% \MMLhack + +\unexpanded\def\mmlunderuf#1{\mmlexecuteifdefined\mmlundercommand\relax {\math_fences_checked_start\mmlunexpandedfirst {#1}\math_fences_checked_stop}\relax} +\unexpanded\def\mmlunderus#1{\mmlexecuteifdefined\mmlundercommand {\math_fences_checked_start\mmlunexpandedsecond{#1}\math_fences_checked_stop}\relax} +\unexpanded\def\mmlunderbf#1{\mmlexecuteifdefined\mmlbasecommand {\math_fences_checked_start\mmlunexpandedfirst {#1}\math_fences_checked_stop}\relax} +%unexpanded\def\mmlunderbs#1{\mmlexecuteifdefined\mmlbasecommand \relax{}{\math_fences_checked_start\mmlunexpandedsecond{#1}\math_fences_checked_stop}\relax} +\unexpanded\def\mmlunderbs#1{\mmlexecuteifdefined\mmlbasecommand \relax {\math_fences_checked_start\mmlunexpandedsecond{#1}\math_fences_checked_stop}\relax} \startxmlsetups mml:munder \edef\mmlundertoken{\mmlextensible{\xmlraw{#1}{/mml:*[2]}}}% /text() diff --git a/tex/context/interface/keys-cs.xml b/tex/context/interface/keys-cs.xml index cdfdf016f..e32918566 100644 --- a/tex/context/interface/keys-cs.xml +++ b/tex/context/interface/keys-cs.xml @@ -183,6 +183,7 @@ + @@ -363,6 +364,7 @@ + diff --git a/tex/context/interface/keys-de.xml b/tex/context/interface/keys-de.xml index ea4067288..48329fabf 100644 --- a/tex/context/interface/keys-de.xml +++ b/tex/context/interface/keys-de.xml @@ -183,6 +183,7 @@ + @@ -363,6 +364,7 @@ + diff --git a/tex/context/interface/keys-en.xml b/tex/context/interface/keys-en.xml index 736198166..dd8de7312 100644 --- a/tex/context/interface/keys-en.xml +++ b/tex/context/interface/keys-en.xml @@ -183,6 +183,7 @@ + @@ -363,6 +364,7 @@ + diff --git a/tex/context/interface/keys-fr.xml b/tex/context/interface/keys-fr.xml index 314e1b87f..4a9f2b78b 100644 --- a/tex/context/interface/keys-fr.xml +++ b/tex/context/interface/keys-fr.xml @@ -183,6 +183,7 @@ + @@ -363,6 +364,7 @@ + diff --git a/tex/context/interface/keys-it.xml b/tex/context/interface/keys-it.xml index 9af423467..ce1be9a61 100644 --- a/tex/context/interface/keys-it.xml +++ b/tex/context/interface/keys-it.xml @@ -183,6 +183,7 @@ + @@ -363,6 +364,7 @@ + diff --git a/tex/context/interface/keys-nl.xml b/tex/context/interface/keys-nl.xml index efe7814ed..bdcf2a96a 100644 --- a/tex/context/interface/keys-nl.xml +++ b/tex/context/interface/keys-nl.xml @@ -183,6 +183,7 @@ + @@ -363,6 +364,7 @@ + diff --git a/tex/context/interface/keys-pe.xml b/tex/context/interface/keys-pe.xml index 5eeaedcfe..77b137293 100644 --- a/tex/context/interface/keys-pe.xml +++ b/tex/context/interface/keys-pe.xml @@ -183,6 +183,7 @@ + @@ -363,6 +364,7 @@ + diff --git a/tex/context/interface/keys-ro.xml b/tex/context/interface/keys-ro.xml index 5f707884f..ad07ea880 100644 --- a/tex/context/interface/keys-ro.xml +++ b/tex/context/interface/keys-ro.xml @@ -183,6 +183,7 @@ + @@ -363,6 +364,7 @@ + diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 87e016321..9eab657a1 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 07/17/14 13:24:59 +-- merge date : 07/25/14 12:57:26 do -- begin closure to overcome local limits and interference @@ -1603,14 +1603,25 @@ local function identical(a,b) end table.identical=identical table.are_equal=are_equal -function table.compact(t) - if t then - for k,v in next,t do - if not next(v) then - t[k]=nil +local function sparse(old,nest,keeptables) + local new={} + for k,v in next,old do + if not (v=="" or v==false) then + if nest and type(v)=="table" then + v=sparse(v,nest) + if keeptables or next(v) then + new[k]=v + end + else + new[k]=v end end end + return new +end +table.sparse=sparse +function table.compact(t) + return sparse(t,true,true) end function table.contains(t,v) if t then @@ -2449,6 +2460,18 @@ function file.collapsepath(str,anchor) end end end +local tricky=S("/\\")*P(-1) +local attributes=lfs.attributes +function lfs.isdir(name) + if lpegmatch(tricky,name) then + return attributes(name,"mode")=="directory" + else + return attributes(name.."/.","mode")=="directory" + end +end +function lfs.isfile(name) + return attributes(name,"mode")=="file" +end local validchars=R("az","09","AZ","--","..") local pattern_a=lpeg.replacer(1-validchars) local pattern_a=Cs((validchars+P(1)/"-")^1) @@ -6681,7 +6704,7 @@ local report_otf=logs.reporter("fonts","otf loading") local fonts=fonts local otf=fonts.handlers.otf otf.glists={ "gsub","gpos" } -otf.version=2.758 +otf.version=2.759 otf.cache=containers.define("fonts","otf",otf.version,true) local fontdata=fonts.hashes.identifiers local chardata=characters and characters.data @@ -7891,12 +7914,12 @@ actions["reorganize lookups"]=function(data,filename,raw) local fore=glyphs.fore if fore and fore~="" then fore=s_uncover(splitter,s_u_cache,fore) - rule.before=s_hashed(fore,s_h_cache) + rule.after=s_hashed(fore,s_h_cache) end local back=glyphs.back if back then back=s_uncover(splitter,s_u_cache,back) - rule.after=s_hashed(back,s_h_cache) + rule.before=s_hashed(back,s_h_cache) end local names=glyphs.names if names then @@ -13054,27 +13077,6 @@ local function unpackdata(data) rule.replacements=tv end end - local fore=rule.fore - if fore then - local tv=tables[fore] - if tv then - rule.fore=tv - end - end - local back=rule.back - if back then - local tv=tables[back] - if tv then - rule.back=tv - end - end - local names=rule.names - if names then - local tv=tables[names] - if tv then - rule.names=tv - end - end local lookups=rule.lookups if lookups then local tv=tables[lookups] -- cgit v1.2.3