diff options
author | Hans Hagen <pragma@wxs.nl> | 2009-06-03 11:48:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2009-06-03 11:48:00 +0200 |
commit | e9990ae7c22295e59c1d2c80c7e2717738b5c120 (patch) | |
tree | 3aa7906d97c3b7db13254f78c88c09cb926152ef | |
parent | 40e5e0f114c759b17af50cde80677a9612d4d41b (diff) | |
download | context-e9990ae7c22295e59c1d2c80c7e2717738b5c120.tar.gz |
beta 2009.06.03 11:48
38 files changed, 225 insertions, 124 deletions
diff --git a/metapost/context/base/mp-tool.mp b/metapost/context/base/mp-tool.mp index 3ba5923ea..31074911f 100644 --- a/metapost/context/base/mp-tool.mp +++ b/metapost/context/base/mp-tool.mp @@ -1286,6 +1286,10 @@ enddef ; extra_endfig := extra_endfig & " naturalizepaths ; " ; +%D Also handy: + +extra_beginfig := extra_beginfig & " truecorners := 0 ; " ; % restores + %D Normally, arrowheads don't scale well. So we provide a %D hack. diff --git a/scripts/context/lua/mtx-babel.lua b/scripts/context/lua/mtx-babel.lua index 8d7765643..e241e9334 100644 --- a/scripts/context/lua/mtx-babel.lua +++ b/scripts/context/lua/mtx-babel.lua @@ -225,7 +225,7 @@ do O = "Ὁ", U = "Ὑ", W = "Ὡ", - R = "Ῥ", + R = "Ῥ", } local replace_23 = { -- > * @@ -308,37 +308,39 @@ do W = "Ω", [";"] = "·", ["?"] = ";", -} + } - local skips_01 = lpeg.P("\\") * lpeg.R("az", "AZ")^1 - local skips_02 = lpeg.P("[") * (1- lpeg.S("[]"))^1 * lpeg.P("]") - - local greek_01 = (lpeg.P("<'") * lpeg.Cs(1) * lpeg.P('|')) / replace_01 - local greek_02 = (lpeg.P(">'") * lpeg.Cs(1) * lpeg.P('|')) / replace_02 - local greek_03 = (lpeg.P("<`") * lpeg.Cs(1) * lpeg.P('|')) / replace_03 - local greek_04 = (lpeg.P(">`") * lpeg.Cs(1) * lpeg.P('|')) / replace_04 - local greek_05 = (lpeg.P("<~") * lpeg.Cs(1) * lpeg.P('|')) / replace_05 - local greek_06 = (lpeg.P(">~") * lpeg.Cs(1) * lpeg.P('|')) / replace_06 - local greek_07 = (lpeg.P('"\'') * lpeg.Cs(1) ) / replace_07 - local greek_08 = (lpeg.P('"`') * lpeg.Cs(1) ) / replace_08 - local greek_09 = (lpeg.P('"~') * lpeg.Cs(1) ) / replace_09 - local greek_10 = (lpeg.P("<'") * lpeg.Cs(1) ) / replace_10 - local greek_11 = (lpeg.P(">'") * lpeg.Cs(1) ) / replace_11 - local greek_12 = (lpeg.P("<`") * lpeg.Cs(1) ) / replace_12 - local greek_13 = (lpeg.P(">`") * lpeg.Cs(1) ) / replace_13 - local greek_14 = (lpeg.P("<~") * lpeg.Cs(1) ) / replace_14 - local greek_15 = (lpeg.P(">~") * lpeg.Cs(1) ) / replace_15 - local greek_16 = (lpeg.P("'") * lpeg.Cs(1) * lpeg.P('|')) / replace_16 - local greek_17 = (lpeg.P("`") * lpeg.Cs(1) * lpeg.P('|')) / replace_17 - local greek_18 = (lpeg.P("~") * lpeg.Cs(1) * lpeg.P('|')) / replace_18 - local greek_19 = (lpeg.P("'") * lpeg.Cs(1) ) / replace_19 - local greek_20 = (lpeg.P("`") * lpeg.Cs(1) ) / replace_20 - local greek_21 = (lpeg.P("~") * lpeg.Cs(1) ) / replace_21 - local greek_22 = (lpeg.P("<") * lpeg.Cs(1) ) / replace_22 - local greek_23 = (lpeg.P(">") * lpeg.Cs(1) ) / replace_23 - local greek_24 = (lpeg.Cs(1) * lpeg.P('|') ) / replace_24 - local greek_25 = (lpeg.P('"') * lpeg.Cs(1) ) / replace_25 - local greek_26 = (lpeg.Cs(1) ) / replace_26 + local P, R, S, V, Cs = lpeg.P, lpeg.R, lpeg.S, lpeg.V, lpeg.Cs + + local skips_01 = P("\\") * R("az", "AZ")^1 + local skips_02 = P("[") * (1- S("[]"))^1 * P("]") + + local greek_01 = (P("<'") * Cs(1) * P('|')) / replace_01 + local greek_02 = (P(">'") * Cs(1) * P('|')) / replace_02 + local greek_03 = (P("<`") * Cs(1) * P('|')) / replace_03 + local greek_04 = (P(">`") * Cs(1) * P('|')) / replace_04 + local greek_05 = (P("<~") * Cs(1) * P('|')) / replace_05 + local greek_06 = (P(">~") * Cs(1) * P('|')) / replace_06 + local greek_07 = (P('"\'') * Cs(1) ) / replace_07 + local greek_08 = (P('"`') * Cs(1) ) / replace_08 + local greek_09 = (P('"~') * Cs(1) ) / replace_09 + local greek_10 = (P("<'") * Cs(1) ) / replace_10 + local greek_11 = (P(">'") * Cs(1) ) / replace_11 + local greek_12 = (P("<`") * Cs(1) ) / replace_12 + local greek_13 = (P(">`") * Cs(1) ) / replace_13 + local greek_14 = (P("<~") * Cs(1) ) / replace_14 + local greek_15 = (P(">~") * Cs(1) ) / replace_15 + local greek_16 = (P("'") * Cs(1) * P('|')) / replace_16 + local greek_17 = (P("`") * Cs(1) * P('|')) / replace_17 + local greek_18 = (P("~") * Cs(1) * P('|')) / replace_18 + local greek_19 = (P("'") * Cs(1) ) / replace_19 + local greek_20 = (P("`") * Cs(1) ) / replace_20 + local greek_21 = (P("~") * Cs(1) ) / replace_21 + local greek_22 = (P("<") * Cs(1) ) / replace_22 + local greek_23 = (P(">") * Cs(1) ) / replace_23 + local greek_24 = (Cs(1) * P('|') ) / replace_24 + local greek_25 = (P('"') * Cs(1) ) / replace_25 + local greek_26 = (Cs(1) ) / replace_26 local skips = skips_01 + skips_02 @@ -351,20 +353,20 @@ do greek_21 + greek_22 + greek_23 + greek_24 + greek_25 + greek_26 - local spacing = lpeg.S(" \n\r\t") - local startgreek = lpeg.P("\\startgreek") - local stopgreek = lpeg.P("\\stopgreek") - local localgreek = lpeg.P("\\localgreek") - local lbrace = lpeg.P("{") - local rbrace = lpeg.P("}") + local spacing = S(" \n\r\t") + local startgreek = P("\\startgreek") + local stopgreek = P("\\stopgreek") + local localgreek = P("\\localgreek") + local lbrace = P("{") + local rbrace = P("}") - local documentparser = lpeg.Cs((skips + greek + 1)^0) + local documentparser = Cs((skips + greek + 1)^0) - local contextgrammar = lpeg.Cs ( lpeg.P { "scan", - ["scan"] = (lpeg.V("global") + lpeg.V("local") + skips + 1)^0, + local contextgrammar = Cs ( P { "scan", + ["scan"] = (V("global") + V("local") + skips + 1)^0, ["global"] = startgreek * ((skips + greek + 1)-stopgreek )^0 , - ["local"] = localgreek * lpeg.V("grouped"), - ["grouped"] = spacing^0 * lbrace * (lpeg.V("grouped") + skips + (greek - rbrace))^0 * rbrace, + ["local"] = localgreek * V("grouped"), + ["grouped"] = spacing^0 * lbrace * (V("grouped") + skips + (greek - rbrace))^0 * rbrace, } ) converters['greek'] = { diff --git a/tex/context/base/back-pdf.lua b/tex/context/base/back-pdf.lua index 2488db7f7..dd0fb504b 100644 --- a/tex/context/base/back-pdf.lua +++ b/tex/context/base/back-pdf.lua @@ -140,7 +140,7 @@ end -- code function codeinjections.insertmovie(spec) -- width, height, factor, repeat, controls, preview, label, foundname - local width, height = spec.width, spec.height + local width, height, factor = spec.width, spec.height, spec.factor or number.dimenfactors.bp local options, actions = "", "" if spec["repeat"] then actions = actions .. "/Mode /Repeat " @@ -157,7 +157,7 @@ function codeinjections.insertmovie(spec) -- width, height, factor, repeat, cont actions= "/A <<" .. actions .. ">>" end return format( -- todo: doPDFannotation - "\\doPDFannotation{%ssp}{%ssp}{/Subtype /Movie /Border [0 0 0] /T (movie %s) /Movie << /F (%s) /Aspect [%s %s] %s>> %s}", + "\\insertpdfannotation{%ssp}{%ssp}{/Subtype /Movie /Border [0 0 0] /T (movie %s) /Movie << /F (%s) /Aspect [%s %s] %s>> %s}", width, height, spec.label, spec.foundname, factor * width, factor * height, options, actions ) end diff --git a/tex/context/base/buff-ver.mkiv b/tex/context/base/buff-ver.mkiv index 5998260f2..aed357de8 100644 --- a/tex/context/base/buff-ver.mkiv +++ b/tex/context/base/buff-ver.mkiv @@ -350,6 +350,7 @@ %\let\obeylines\ignorelines % probably not needed %\let\obeypages\ignorepages % probably not needed %\setupcopyverbatim % not needed + \setcatcodetable\vrbcatcodes } %D \macros diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex index 5886a1f27..b36a2e7e3 100644 --- a/tex/context/base/cont-new.tex +++ b/tex/context/base/cont-new.tex @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2009.06.02 09:30} +\newcontextversion{2009.06.03 11:48} %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 fa9866a71..4758af96b 100644 --- a/tex/context/base/context.tex +++ b/tex/context/base/context.tex @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2009.06.02 09:30} +\edef\contextversion{2009.06.03 11:48} %D For those who want to use this: diff --git a/tex/context/base/core-spa.mkiv b/tex/context/base/core-spa.mkiv index 8dba73ac1..b56d2306e 100644 --- a/tex/context/base/core-spa.mkiv +++ b/tex/context/base/core-spa.mkiv @@ -2867,14 +2867,14 @@ {\ctxlua{vspacing.analyse("\iffirstargument#1\else default\fi")}} \definevspacingamount[\v!big] [\bigskipamount] [\openlineheight] -\definevspacingamount[\v!medium] [\medskipamount] [.50\openlineheight] -\definevspacingamount[\v!small] [\smallskipamount][.25\openlineheight] +\definevspacingamount[\v!medium] [\medskipamount] [0.50\openlineheight] +\definevspacingamount[\v!small] [\smallskipamount][0.25\openlineheight] \definevspacingamount[\v!line] [\openlineheight] [\openlineheight] -\definevspacingamount[\v!formula][\medskipamount] [.50\openlineheight] +\definevspacingamount[\v!formula][\medskipamount] [0.50\openlineheight] \definevspacingamount[\v!white] [\parskip] [\openlineheight] \definevspacing[\s!default] [\v!big] -\definevspacing[\v!halfline][.5*\v!line] +\definevspacing[\v!halfline][0.5*\v!line] % fails \definevspacing[\v!samepage][penalty:10000] \definevspacing[\v!max] [category:1] \definevspacing[\v!force] [category:2] diff --git a/tex/context/base/font-def.lua b/tex/context/base/font-def.lua index 8c367e148..f91575a6f 100644 --- a/tex/context/base/font-def.lua +++ b/tex/context/base/font-def.lua @@ -162,7 +162,7 @@ function tfm.hash_features(specification) end end --~ if specification.mathsize then ---~ t[#t] = "mathsize=" .. specification.mathsize +--~ t[#t+1] = "mathsize=" .. specification.mathsize --~ end if #t > 0 then return concat(t,"+") diff --git a/tex/context/base/font-otb.lua b/tex/context/base/font-otb.lua index 2a14085d6..5ef44a011 100644 --- a/tex/context/base/font-otb.lua +++ b/tex/context/base/font-otb.lua @@ -334,13 +334,19 @@ function fonts.initializers.base.otf.features(tfmdata,value) local h = { } for f=1,#supported_gsub do local feature = supported_gsub[f] - prepare_base_substitutions(tfmdata,feature,features[feature]) - h[#h+1] = feature + local value = features[feature] + prepare_base_substitutions(tfmdata,feature,value) + if value then + h[#h+1] = feature .. "=" .. tostring(value) + end end for f=1,#supported_gpos do local feature = supported_gpos[f] + local value = features[feature] prepare_base_kerns(tfmdata,feature,features[feature]) - h[#h+1] = feature + if value then + h[#h+1] = feature .. "=" .. tostring(value) + end end local hash = concat(h," ") local base = basehash[hash] @@ -355,7 +361,8 @@ function fonts.initializers.base.otf.features(tfmdata,value) -- eventually (and subset later on). If needed we can use a more -- verbose name as long as we don't use <()<>[]{}/%> and the length -- is < 128. - tfmdata.fullname = tfmdata.fullname .. base + tfmdata.fullname = tfmdata.fullname .. "-" .. base +--~ logs.report("otf define","fullname base hash: '%s', featureset '%s'",tfmdata.fullname,hash) end if trace_preparing then logs.report("otf define","preparation time is %0.3f seconds for %s",os.clock()-t,tfmdata.fullname or "?") diff --git a/tex/context/base/font-tfm.lua b/tex/context/base/font-tfm.lua index 2ee633b77..9210fee92 100644 --- a/tex/context/base/font-tfm.lua +++ b/tex/context/base/font-tfm.lua @@ -536,10 +536,14 @@ function tfm.do_scale(tfmtable, scaledpoints) if not tp[22] then tp[22] = 0 end -- mathaxisheight if t.MathConstants then t.MathConstants.AccentBaseHeight = nil end -- safeguard t.tounicode = 1 + t.cidinfo = tfmtable.cidinfo -- we have t.name=metricfile and t.fullname=RealName and t.filename=diskfilename -- when collapsing fonts, luatex looks as both t.name and t.fullname as ttc files -- can have multiple subfonts --~ collectgarbage("collect") +--~ t.fontname = t.fontname or t.fullname +--~ t.name = t.name or t.fontname +--~ print(t.fullname,table.serialize(characters[string.byte('W')].kerns)) return t, delta end diff --git a/tex/context/base/grph-inc.lua b/tex/context/base/grph-inc.lua index 2729389eb..d132b8b16 100644 --- a/tex/context/base/grph-inc.lua +++ b/tex/context/base/grph-inc.lua @@ -676,7 +676,7 @@ function figures.checkers.mov(data) du.width = dr.width du.height = dr.height du.foundname = du.fullname - local code = backends.codeinjections { + local code = backends.codeinjections.insertmovie { width = du.width or dr.width, height = du.height or dr.height, factor = number.dimenfactors.bp, diff --git a/tex/context/base/m-units.tex b/tex/context/base/m-units.tex index f268bdd6e..d186c542b 100644 --- a/tex/context/base/m-units.tex +++ b/tex/context/base/m-units.tex @@ -241,9 +241,9 @@ \ifspaceddimensions \ifdim\scratchdimen=\dimensionsignal\relax \udimensionhalfspace -\else\ifdim\scratchdimen=\dimensionpowersignal\relax - \udimensionhalfspace -\fi + \else\ifdim\scratchdimen=\dimensionpowersignal\relax + \udimensionhalfspace + \fi \fi \fi \fi @@ -273,7 +273,6 @@ \global\let\thedimensionprefix\empty \global\let\thedimensionpower\empty} - %D \macros %D {dontbreakdimension, %D dimensionprefix, dimensionaddfix, diff --git a/tex/context/base/mult-de.tex b/tex/context/base/mult-de.tex index 8c47126fe..c73223658 100644 --- a/tex/context/base/mult-de.tex +++ b/tex/context/base/mult-de.tex @@ -891,6 +891,7 @@ \setinterfaceconstant{symstyle}{symstil} \setinterfaceconstant{synonym}{synonym} \setinterfaceconstant{synonymcolor}{synonymfarbe} +\setinterfaceconstant{synonymcommand}{synonymbefehl} \setinterfaceconstant{synonymstyle}{synonymstil} \setinterfaceconstant{tab}{tab} \setinterfaceconstant{text}{text} diff --git a/tex/context/base/mult-def.lua b/tex/context/base/mult-def.lua index b447f2467..dff747db1 100644 --- a/tex/context/base/mult-def.lua +++ b/tex/context/base/mult-def.lua @@ -10218,6 +10218,16 @@ return { ["pe"]="رنگمترادف", ["ro"]="culoaresinonim", }, + ["synonymcommand"]={ + ["cs"]="synonymcommand", + ["de"]="synonymbefehl", + ["en"]="synonymcommand", + ["fr"]="synonymcommand", + ["it"]="synonymcommand", + ["nl"]="synoniemcommando", + ["pe"]="synonymcommand", + ["ro"]="synonymcommand", + }, ["synonymstyle"]={ ["cs"]="stylsynonyma", ["de"]="synonymstil", diff --git a/tex/context/base/mult-en.tex b/tex/context/base/mult-en.tex index 16058f794..d9ece5dfd 100644 --- a/tex/context/base/mult-en.tex +++ b/tex/context/base/mult-en.tex @@ -891,6 +891,7 @@ \setinterfaceconstant{symstyle}{symstyle} \setinterfaceconstant{synonym}{synonym} \setinterfaceconstant{synonymcolor}{synonymcolor} +\setinterfaceconstant{synonymcommand}{synonymcommand} \setinterfaceconstant{synonymstyle}{synonymstyle} \setinterfaceconstant{tab}{tab} \setinterfaceconstant{text}{text} diff --git a/tex/context/base/mult-fr.tex b/tex/context/base/mult-fr.tex index 11a305ac8..cfc56cb5c 100644 --- a/tex/context/base/mult-fr.tex +++ b/tex/context/base/mult-fr.tex @@ -891,6 +891,7 @@ \setinterfaceconstant{symstyle}{stylesym} \setinterfaceconstant{synonym}{synonyme} \setinterfaceconstant{synonymcolor}{couleursynonyme} +\setinterfaceconstant{synonymcommand}{synonymcommand} \setinterfaceconstant{synonymstyle}{stylesynonyme} \setinterfaceconstant{tab}{tab} \setinterfaceconstant{text}{texte} diff --git a/tex/context/base/mult-it.tex b/tex/context/base/mult-it.tex index b62c5bdb3..f5d009b32 100644 --- a/tex/context/base/mult-it.tex +++ b/tex/context/base/mult-it.tex @@ -891,6 +891,7 @@ \setinterfaceconstant{symstyle}{stilesimbolo} \setinterfaceconstant{synonym}{sinonimo} \setinterfaceconstant{synonymcolor}{coloresinonimi} +\setinterfaceconstant{synonymcommand}{synonymcommand} \setinterfaceconstant{synonymstyle}{stilesinonimi} \setinterfaceconstant{tab}{tab} \setinterfaceconstant{text}{testo} diff --git a/tex/context/base/mult-nl.tex b/tex/context/base/mult-nl.tex index 30f0b36e6..d84512ae7 100644 --- a/tex/context/base/mult-nl.tex +++ b/tex/context/base/mult-nl.tex @@ -891,6 +891,7 @@ \setinterfaceconstant{symstyle}{symletter} \setinterfaceconstant{synonym}{synoniem} \setinterfaceconstant{synonymcolor}{synoniemkleur} +\setinterfaceconstant{synonymcommand}{synoniemcommando} \setinterfaceconstant{synonymstyle}{synoniemletter} \setinterfaceconstant{tab}{tab} \setinterfaceconstant{text}{tekst} diff --git a/tex/context/base/mult-ro.tex b/tex/context/base/mult-ro.tex index ed3cf7e22..bcb4d5256 100644 --- a/tex/context/base/mult-ro.tex +++ b/tex/context/base/mult-ro.tex @@ -891,6 +891,7 @@ \setinterfaceconstant{symstyle}{stilsimbol} \setinterfaceconstant{synonym}{sinonim} \setinterfaceconstant{synonymcolor}{culoaresinonim} +\setinterfaceconstant{synonymcommand}{synonymcommand} \setinterfaceconstant{synonymstyle}{stilsinonim} \setinterfaceconstant{tab}{tab} \setinterfaceconstant{text}{text} diff --git a/tex/context/base/s-abr-01.tex b/tex/context/base/s-abr-01.tex index 8c2f6ebab..5f15ecbe6 100644 --- a/tex/context/base/s-abr-01.tex +++ b/tex/context/base/s-abr-01.tex @@ -43,7 +43,7 @@ \logo [BLUESKY] {BlueSky} \logo [BMP] {bmp} \logo [BSD] {bsd} -\logo [CCODE] {c} +\logo [CCODE] {C} \logo [CALCMATH] {CalcMath} \logo [CD] {cd} \logo [CPU] {cpu} diff --git a/tex/context/base/strc-doc.lua b/tex/context/base/strc-doc.lua index cc8f46f6c..93cdb71e3 100644 --- a/tex/context/base/strc-doc.lua +++ b/tex/context/base/strc-doc.lua @@ -265,7 +265,8 @@ function sections.pluslevel(t) local numbers, ownnumbers, status, depth = data.numbers, data.ownnumbers, data.status, data.depth local directives = t.directives local resetter = sets.getall("structure:resets",data.block, (directives and directives.resetset) or "") - if not (directives and directives.hidenumber) then +--~ if not (directives and directives.hidenumber) then + if t.metadata.increment then if numbers[depth] then numbers[depth] = numbers[depth] + 1 else @@ -404,7 +405,7 @@ end -- } function sections.typesetnumber(entry,kind,...) -- kind='section','number','prefix' - if entry then + if entry and entry.hidenumber ~= true then -- can be nil local separatorset = "" local conversionset = "" local conversion = "" @@ -482,7 +483,6 @@ function sections.typesetnumber(entry,kind,...) -- kind='section','number','pref end -- local prefixlist = set and sets.getall("structure:prefixes","",set) -- "" == block - -- if prefixlist and (kind == 'section' or kind == 'prefix') then -- find valid set (problem: for sectionnumber we should pass the level) -- if kind == "section" then @@ -562,7 +562,7 @@ function sections.fullnumber(depth) local data = data.status[depth or data.depth] if data then local sectiondata = jobsections.collected[data.references.section] - if sectiondata then + if sectiondata and sectiondata.hidenumber ~= true then -- can be nil sections.typesetnumber(sectiondata,'section',sectiondata) end end diff --git a/tex/context/base/strc-doc.mkiv b/tex/context/base/strc-doc.mkiv index e76e015a9..9d0d7c01c 100644 --- a/tex/context/base/strc-doc.mkiv +++ b/tex/context/base/strc-doc.mkiv @@ -93,7 +93,6 @@ }, directives = { resetset = "\structureparameter\c!reset", - hidenumber = not toboolean("\currentstructureincrementnumber",true), % incremented but hidden }, metadata = { kind = "section", @@ -104,6 +103,9 @@ \ifx\currentstructuresaveinlist\v!no nolist = true, \fi + \ifx\currentstructureincrementnumber\v!yes + increment = "\currentstructureincrementnumber", + \fi }, titledata = { % we can add mark and reference label = \!!bs\detokenize\expandafter{\currentstructurelabel }\!!es, @@ -116,6 +118,8 @@ \fi \fi }, numberdata = { +block = "\currentstructureblock", +hidenumber = \ifx\currentstructureshownumber\v!no true\else nil\fi, % titles separatorset = "\structureparameter\c!sectionseparatorset", conversion = "\structureparameter\c!sectionconversion", % for good old times sake conversionset = "\structureparameter\c!sectionconversionset", @@ -123,7 +127,6 @@ set = "\structureparameter\c!sectionset", segments = "\structureparameter\c!sectionsegments", ownnumber = "\currentstructureownnumber", - hidenumber = \ifx\currentstructureshownumber\v!no true\else nil\fi, % titles }, userdata = structure.helpers.touserdata(\!!bs\detokenize{#2}\!!es) } diff --git a/tex/context/base/strc-flt.mkiv b/tex/context/base/strc-flt.mkiv index b0ff9893b..9a39b7f88 100644 --- a/tex/context/base/strc-flt.mkiv +++ b/tex/context/base/strc-flt.mkiv @@ -260,7 +260,7 @@ \setupcaption[#1][\s!parent=\??kj#3]% \definestructurecounter[#1][#3]% \definelist[#1][#3]% - \presetlabeltext[#1=\Word{#3}]% + \presetlabeltext[#1=\Word{#3}~]% \presetheadtext[#2=\Word{#2}]% \dodefinefloatcommands[#1][#2]} @@ -300,17 +300,17 @@ \def\thecurrentfloatnumber {\ifnofloatcaption \else \ifnofloatnumber \else -% \labeltexts\currentfloat{\convertedstructurecounter[\currentfloat]}% ! ! todo: use a lua call instead -\ifx\currentfloatnumber\relax\else - \labeltexts\currentfloat{\ctxlua{structure.lists.savednumber("\currentfloat",\currentfloatnumber)}}% -\fi + % \labeltexts\currentfloat{\convertedstructurecounter[\currentfloat]}% ! ! todo: use a lua call instead + \ifx\currentfloatnumber\relax\else + \labeltexts\currentfloat{\ctxlua{structure.lists.savednumber("\currentfloat",\currentfloatnumber)}}% + \fi \fi \fi} \def\thecurrentfloatcaption {\ifnofloatcaption \else -\ifx\currentfloatnumber\relax\else - \ctxlua{structure.lists.savedtitle("\currentfloat",\currentfloatnumber)}% -\fi + \ifx\currentfloatnumber\relax\else + \ctxlua{structure.lists.savedtitle("\currentfloat",\currentfloatnumber)}% + \fi \fi} %D Captions. @@ -752,7 +752,7 @@ \relax \relax \relax - [\c!name=\currentfloat,\s!counter=\currentfloat,% + [\c!name=\currentfloat,\s!counter=\@@thestructurecounter\currentfloat,% \s!hascaption=\ifnofloatcaption \v!no\else\v!yes\fi,% \s!hasnumber=\ifnofloatnumber \v!no\else\v!yes\fi,% \s!hastitle=\ifemptyfloatcaption\v!no\else\v!yes\fi,% diff --git a/tex/context/base/strc-ini.lua b/tex/context/base/strc-ini.lua index 552435e81..06f5ff82f 100644 --- a/tex/context/base/strc-ini.lua +++ b/tex/context/base/strc-ini.lua @@ -255,7 +255,7 @@ function sets.getall(namespace,block,name) end end -function sets.get(namespace,block,name,level,default) +function sets.get(namespace,block,name,level,default) -- check if name is passed local ds = setlist[namespace] if not ds then return default @@ -267,6 +267,12 @@ function sets.get(namespace,block,name,level,default) else dn = ds[name] or ds.default end + else + if block and block ~= "" then + dn = ds[block] or ds[block..":default"] or ds.default + else + dn = ds.default + end end if not dn then return default diff --git a/tex/context/base/strc-lst.lua b/tex/context/base/strc-lst.lua index 48e2bf07d..07f551764 100644 --- a/tex/context/base/strc-lst.lua +++ b/tex/context/base/strc-lst.lua @@ -100,8 +100,8 @@ function lists.enhance(n) -- todo: symbolic names for counters local l = cached[n] if l then - -- save space - l.directives = nil + -- + l.directives = nil -- might change -- save in the right order (happen sat shipout) lists.tobesaved[#lists.tobesaved+1] = l -- default enhancer (cross referencing) @@ -300,6 +300,7 @@ end function lists.sectionnumber(name,n,spec) local data = lists.result[n] local sectiondata = jobsections.collected[data.references.section] + -- hm, prefixnumber? sections.typesetnumber(sectiondata,"prefix",spec,sectiondata) -- data happens to contain the spec too end diff --git a/tex/context/base/strc-num.mkiv b/tex/context/base/strc-num.mkiv index 82558cd61..6498b4e55 100644 --- a/tex/context/base/strc-num.mkiv +++ b/tex/context/base/strc-num.mkiv @@ -102,7 +102,7 @@ )}% \docheckstructurecountersetup{#1}} -\def\donodefinestructurecounter[#1][#2]% +\def\donodefinestructurecounter[#1][#2]% inherit {\getparameters[\??nn#1][\c!number=#2]% \docheckstructurecountersetup{#1}} @@ -117,7 +117,6 @@ {\ctxlua{structure.sections.way("\structurecounterparameter{#1}\c!way","\v!by")}} \def\thenamedstructurecounterlevel#1% -% {\thenamedstructureheadlevel{\structurecounterway{\structurecounterparameter{#1}\c!way}}} {\thenamedstructureheadlevel{\structurecounterway{#1}}} \def\docheckstructurecountersetup#1% diff --git a/tex/context/base/strc-pag.mkiv b/tex/context/base/strc-pag.mkiv index 2b7c3fc21..1c4534ede 100644 --- a/tex/context/base/strc-pag.mkiv +++ b/tex/context/base/strc-pag.mkiv @@ -217,7 +217,7 @@ \appendtoks % \xdef\lastpage{\laststructurecounter[\s!realpage]}% \xdef\currentpage{\the\realpageno}% - \ifnum\realpageno>\lastpage \globallet\lastpage\lastrealpage\fi + \ifnum\realpageno>\lastpage \globallet\lastpage\lastrealpage \fi \to \everyinitializepagecounters % \def\savenofpages @@ -470,6 +470,13 @@ {\chardef\overallpagenumberstate\zerocount}% \to \everysetuppagenumbering +% \appendtoks % todo: set state: none, start, stop, reset +% % this makes starting at an even page possible +% \ifnum\realpageno=1 \ifodd\pageno \else +% \global\shiftedrealpagenotrue +% \fi \fi +% \to \everysetupuserpagenumber + % Done % \c!way=\v!by\v!part @@ -498,8 +505,33 @@ \edef\askeduserpagenumber{\structurecounterparameter\s!userpage\c!number}% \ifx\askeduserpagenumber\empty \else \normalexpanded{\noexpand\setuppagenumber[\c!start=\structurecounterparameter\s!userpage\c!number,\c!number=]}% + \userpageno\rawstructurecounter[\s!userpage]% \fi -\to\everysetupuserpagenumber % todo: set state: none, start, stop, reset +\to \everysetupuserpagenumber % todo: set state: none, start, stop, reset + +% \setuplayout[width=300pt,backspace=4cm] +% \setuppagenumbering [alternative=doublesided] +% \setupuserpagenumber[start=2] +% \starttext \dorecurse{20}{\input knuth \par} \stoptext + +\def\checkpagenumbershift + {\userpageno\rawstructurecounter[\s!userpage]\relax + \ifnum\realpageno=\plusone + \ifodd\userpageno + \else + \global\shiftedrealpagenotrue + \fi + \fi} + +\appendtoks % todo: set state: none, start, stop, reset + % this makes starting at an even page possible + \checkpagenumbershift +\to \everysetupuserpagenumber + +\appendtoks % todo: set state: none, start, stop, reset + % this makes starting at an even page possible + \checkpagenumbershift +\to \everysetuppagenumbering \initializepagecounters diff --git a/tex/context/base/strc-sec.mkiv b/tex/context/base/strc-sec.mkiv index a45564c43..fd5bee92d 100644 --- a/tex/context/base/strc-sec.mkiv +++ b/tex/context/base/strc-sec.mkiv @@ -338,8 +338,8 @@ \normalexpanded{\noexpand\setmarking[\currentstructureheadcoupling]{\currentstructurelistnumber}}% \currentstructuresynchronize} -\def\thestructureheadnumber{\labeltexts{\structureheadparameter\c!label}{\structurenumber}} -\def\thestructureheadtitle {\structurecctvalue{titledata.title}} +\def\thestructureheadnumber{\labeltexts{\structureheadparameter\c!label}{\structurenumber}} % todo +\def\thestructureheadtitle {\structurecctvalue{titledata.title}} % todo \let\currentstructurehead \empty \let\currentstructureheadcoupling\empty diff --git a/tex/context/base/strc-syn.mkiv b/tex/context/base/strc-syn.mkiv index a739be902..9865305c7 100644 --- a/tex/context/base/strc-syn.mkiv +++ b/tex/context/base/strc-syn.mkiv @@ -56,7 +56,7 @@ \def\dosynonymparentparameter #1#2{\ifx#1\relax\s!empty\else\dosynonymparameter #1#2\fi} \def\dosynonymparentparameterhash#1#2{\ifx#1\relax \else\dosynonymparameterhash#1#2\fi} -\def\dosetsynonymattributes#1#2% style color +\unexpanded\def\dosetsynonymattributes#1#2% style color {\edef\fontattributehash {\synonymparameterhash#1}% \edef\colorattributehash{\synonymparameterhash#2}% \ifx\fontattributehash \empty\else\dosetfontattribute \fontattributehash #1\fi @@ -104,12 +104,12 @@ \ifthirdargument \unexpanded\def#3##1{\doinsertsynonymmeaning{#1}{##1}}% \meaning \fi - \setvalue{#1}{\definesynonym[\v!no][#1]}% \name + \unexpanded\setvalue{#1}{\definesynonym[\v!no][#1]}% \name \else \ifthirdargument \unexpanded\def#3##1{\doinsertsynonymmeaning{#1}{##1}}% \meaning \fi - \setvalue{#1}{\definesynonym[\v!yes][#1]}% \name + \unexpanded\setvalue{#1}{\definesynonym[\v!yes][#1]}% \name \fi \getparameters[\??sm#1][\s!parent=\??sm]% \presetheadtext[#2=\Word{#2}]% changes the \if...argument @@ -151,39 +151,41 @@ \fi \endgroup} -\def\doinsertsynonym#1#2% name tag +\unexpanded\def\doinsertsynonymmeaning#1#2% name tag {\begingroup - % no kap currently, of .. we need to map cap onto WORD - \dosetsynonymattributes\c!synonymstyle\c!synonymcolor - \ctxlua{joblists.synonym("#1","#2")}% + \def\currentsynonym{#1}% + \dosetsynonymattributes\c!textstyle\c!textcolor + \synonymparameter\c!textcommand{\ctxlua{joblists.meaning("#1","#2")}}% \endgroup} -\def\doinsertsynonymmeaning#1#2% name tag +\unexpanded\def\doinsertsynonym#1#2% name tag {\begingroup - % no kap currently, of .. we need to map cap onto WORD - \dosetsynonymattributes\c!textstyle\c!textcolor - \ctxlua{joblists.meaning("#1","#2")}% + \def\currentsynonym{#1}% + \dosetsynonymattributes\c!synonymstyle\c!synonymcolor + \synonymparameter\c!synonymcommand{\ctxlua{joblists.synonym("#1","#2")}}% \endgroup} \def\doplacelistofsynonyms#1#2% {\begingroup \def\currentsynonym{#1}% -\definedescription % todo, per class - [syndef] - [\c!location=\synonymparameter\c!location, - \c!width=\synonymparameter\c!width, - \c!distance=\synonymparameter\c!distance, - \c!sample=\synonymparameter\c!sample, - \c!hang=\synonymparameter\c!hang, - \c!align=\synonymparameter\c!align, - \c!before=\synonymparameter\c!before, - \c!inbetween=\synonymparameter\c!inbetween, - \c!after=\synonymparameter\c!after, - \c!indentnext=\synonymparameter\c!indentnext, - \c!headstyle=\synonymparameter\c!headstyle, - \c!headcolor=\synonymparameter\c!headcolor, - \c!style=, - \c!color=]% + \definedescription % todo, per class + [syndef] + [\c!location=\synonymparameter\c!location, + \c!width=\synonymparameter\c!width, + \c!distance=\synonymparameter\c!distance, + \c!sample=\synonymparameter\c!sample, + \c!hang=\synonymparameter\c!hang, + \c!align=\synonymparameter\c!align, + \c!before=\synonymparameter\c!before, + \c!inbetween=\synonymparameter\c!inbetween, + \c!after=\synonymparameter\c!after, + \c!indentnext=\synonymparameter\c!indentnext, +% \c!headstyle=\synonymparameter\c!headstyle, +% \c!headcolor=\synonymparameter\c!headcolor, + \c!headstyle=\synonymparameter\c!textstyle, + \c!headcolor=\synonymparameter\c!textcolor, + \c!style=, + \c!color=]% \startpacked \ctxlua{joblists.process('#1',{ criterium = "\synonymparameter\c!criterium" })}% \stoppacked @@ -199,8 +201,10 @@ \let\startsynonymsection\gobbleoneargument \let\stopsynonymsection \relax -\def\synonymentry#1#2#3% - {\syndef{\dosetsynonymattributes\c!textstyle\c!textcolor#2}#3\par} +\unexpanded\def\synonymentry#1#2#3% +% {\syndef{\dosetsynonymattributes\c!textstyle\c!textcolor#2}#3\par} +% {\startsyndef{#2}#3\stopsyndef} + {\syndef{#2}#3\par} \let\currentsorting\empty @@ -253,11 +257,11 @@ {\ifthirdargument \doifnot{#3}\v!none {\ifx#3\relax \else - \def#3##1{\doinsertsort{#1}{##1}}% + \unexpanded\def#3##1{\doinsertsort{#1}{##1}}% \fi}% - \setvalue{#1}{\definesort[\v!no][#1]}% + \unexpanded\setvalue{#1}{\definesort[\v!no][#1]}% \else - \setvalue{#1}{\definesort[\v!yes][#1]}% + \unexpanded\setvalue{#1}{\definesort[\v!yes][#1]}% \fi \getparameters[\??so#1][\s!parent=\??so]% \presetheadtext[#2=\Word{#2}]% after \ifthirdargument -) @@ -385,8 +389,12 @@ [\v!units] [\unitmeaning] +% \setupsynonyms +% [\v!unit] +% [\c!textstyle=\dimension] + \setupsynonyms [\v!unit] - [\c!textstyle=\dimension] + [\c!synonymcommand=\dimension] \protect \endinput diff --git a/tex/context/interface/keys-cs.xml b/tex/context/interface/keys-cs.xml index bbbfdaf48..40d1aa60d 100644 --- a/tex/context/interface/keys-cs.xml +++ b/tex/context/interface/keys-cs.xml @@ -897,6 +897,7 @@ <cd:constant name='symstyle' value='stylsymboly'/> <cd:constant name='synonym' value='synonymum'/> <cd:constant name='synonymcolor' value='barvasynonyma'/> + <cd:constant name='synonymcommand' value='synonymcommand'/> <cd:constant name='synonymstyle' value='stylsynonyma'/> <cd:constant name='tab' value='tab'/> <cd:constant name='text' value='text'/> diff --git a/tex/context/interface/keys-de.xml b/tex/context/interface/keys-de.xml index 2c28adcb6..7bada6e26 100644 --- a/tex/context/interface/keys-de.xml +++ b/tex/context/interface/keys-de.xml @@ -897,6 +897,7 @@ <cd:constant name='symstyle' value='symstil'/> <cd:constant name='synonym' value='synonym'/> <cd:constant name='synonymcolor' value='synonymfarbe'/> + <cd:constant name='synonymcommand' value='synonymbefehl'/> <cd:constant name='synonymstyle' value='synonymstil'/> <cd:constant name='tab' value='tab'/> <cd:constant name='text' value='text'/> diff --git a/tex/context/interface/keys-en.xml b/tex/context/interface/keys-en.xml index db9181646..18a56ac76 100644 --- a/tex/context/interface/keys-en.xml +++ b/tex/context/interface/keys-en.xml @@ -897,6 +897,7 @@ <cd:constant name='symstyle' value='symstyle'/> <cd:constant name='synonym' value='synonym'/> <cd:constant name='synonymcolor' value='synonymcolor'/> + <cd:constant name='synonymcommand' value='synonymcommand'/> <cd:constant name='synonymstyle' value='synonymstyle'/> <cd:constant name='tab' value='tab'/> <cd:constant name='text' value='text'/> diff --git a/tex/context/interface/keys-fr.xml b/tex/context/interface/keys-fr.xml index faf884c38..aaba0e4cb 100644 --- a/tex/context/interface/keys-fr.xml +++ b/tex/context/interface/keys-fr.xml @@ -897,6 +897,7 @@ <cd:constant name='symstyle' value='stylesym'/> <cd:constant name='synonym' value='synonyme'/> <cd:constant name='synonymcolor' value='couleursynonyme'/> + <cd:constant name='synonymcommand' value='synonymcommand'/> <cd:constant name='synonymstyle' value='stylesynonyme'/> <cd:constant name='tab' value='tab'/> <cd:constant name='text' value='texte'/> diff --git a/tex/context/interface/keys-it.xml b/tex/context/interface/keys-it.xml index 69dcdfbe0..5f3ef93e4 100644 --- a/tex/context/interface/keys-it.xml +++ b/tex/context/interface/keys-it.xml @@ -897,6 +897,7 @@ <cd:constant name='symstyle' value='stilesimbolo'/> <cd:constant name='synonym' value='sinonimo'/> <cd:constant name='synonymcolor' value='coloresinonimi'/> + <cd:constant name='synonymcommand' value='synonymcommand'/> <cd:constant name='synonymstyle' value='stilesinonimi'/> <cd:constant name='tab' value='tab'/> <cd:constant name='text' value='testo'/> diff --git a/tex/context/interface/keys-nl.xml b/tex/context/interface/keys-nl.xml index 32e60c364..52e98c157 100644 --- a/tex/context/interface/keys-nl.xml +++ b/tex/context/interface/keys-nl.xml @@ -897,6 +897,7 @@ <cd:constant name='symstyle' value='symletter'/> <cd:constant name='synonym' value='synoniem'/> <cd:constant name='synonymcolor' value='synoniemkleur'/> + <cd:constant name='synonymcommand' value='synoniemcommando'/> <cd:constant name='synonymstyle' value='synoniemletter'/> <cd:constant name='tab' value='tab'/> <cd:constant name='text' value='tekst'/> diff --git a/tex/context/interface/keys-pe.xml b/tex/context/interface/keys-pe.xml index 34acdeecc..b0771b5b0 100644 --- a/tex/context/interface/keys-pe.xml +++ b/tex/context/interface/keys-pe.xml @@ -897,6 +897,7 @@ <cd:constant name='symstyle' value='سبکنماد'/> <cd:constant name='synonym' value='مترادف'/> <cd:constant name='synonymcolor' value='رنگمترادف'/> + <cd:constant name='synonymcommand' value='synonymcommand'/> <cd:constant name='synonymstyle' value='سبکمترادف'/> <cd:constant name='tab' value='تب'/> <cd:constant name='text' value='متن'/> diff --git a/tex/context/interface/keys-ro.xml b/tex/context/interface/keys-ro.xml index 77ed534ab..bc55773b4 100644 --- a/tex/context/interface/keys-ro.xml +++ b/tex/context/interface/keys-ro.xml @@ -897,6 +897,7 @@ <cd:constant name='symstyle' value='stilsimbol'/> <cd:constant name='synonym' value='sinonim'/> <cd:constant name='synonymcolor' value='culoaresinonim'/> + <cd:constant name='synonymcommand' value='synonymcommand'/> <cd:constant name='synonymstyle' value='stilsinonim'/> <cd:constant name='tab' value='tab'/> <cd:constant name='text' value='text'/> diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua index 4772646b9..898deb2f8 100644 --- a/tex/generic/context/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts.lua --- merge date : 06/02/09 09:32:43 +-- merge date : 06/03/09 11:50:28 do -- begin closure to overcome local limits and interference @@ -3752,10 +3752,14 @@ function tfm.do_scale(tfmtable, scaledpoints) if not tp[22] then tp[22] = 0 end -- mathaxisheight if t.MathConstants then t.MathConstants.AccentBaseHeight = nil end -- safeguard t.tounicode = 1 + t.cidinfo = tfmtable.cidinfo -- we have t.name=metricfile and t.fullname=RealName and t.filename=diskfilename -- when collapsing fonts, luatex looks as both t.name and t.fullname as ttc files -- can have multiple subfonts --~ collectgarbage("collect") +--~ t.fontname = t.fontname or t.fullname +--~ t.name = t.name or t.fontname +--~ print(t.fullname,table.serialize(characters[string.byte('W')].kerns)) return t, delta end @@ -7152,13 +7156,19 @@ function fonts.initializers.base.otf.features(tfmdata,value) local h = { } for f=1,#supported_gsub do local feature = supported_gsub[f] - prepare_base_substitutions(tfmdata,feature,features[feature]) - h[#h+1] = feature + local value = features[feature] + prepare_base_substitutions(tfmdata,feature,value) + if value then + h[#h+1] = feature .. "=" .. tostring(value) + end end for f=1,#supported_gpos do local feature = supported_gpos[f] + local value = features[feature] prepare_base_kerns(tfmdata,feature,features[feature]) - h[#h+1] = feature + if value then + h[#h+1] = feature .. "=" .. tostring(value) + end end local hash = concat(h," ") local base = basehash[hash] @@ -7173,7 +7183,8 @@ function fonts.initializers.base.otf.features(tfmdata,value) -- eventually (and subset later on). If needed we can use a more -- verbose name as long as we don't use <()<>[]{}/%> and the length -- is < 128. - tfmdata.fullname = tfmdata.fullname .. base + tfmdata.fullname = tfmdata.fullname .. "-" .. base +--~ logs.report("otf define","fullname base hash: '%s', featureset '%s'",tfmdata.fullname,hash) end if trace_preparing then logs.report("otf define","preparation time is %0.3f seconds for %s",os.clock()-t,tfmdata.fullname or "?") @@ -10418,7 +10429,7 @@ function tfm.hash_features(specification) end end --~ if specification.mathsize then ---~ t[#t] = "mathsize=" .. specification.mathsize +--~ t[#t+1] = "mathsize=" .. specification.mathsize --~ end if #t > 0 then return concat(t,"+") |