From e1cd565bd3872eb5665b95a0ca93e9ba6982c929 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Mon, 18 Jan 2010 22:43:00 +0100 Subject: beta 2010.01.18 22:43 --- tex/context/base/cont-new.tex | 2 +- tex/context/base/context.mkiv | 1 + tex/context/base/context.tex | 2 +- tex/context/base/core-two.lua | 6 +- tex/context/base/lpdf-xmp.lua | 2 + tex/context/base/lxml-mis.lua | 5 +- tex/context/base/lxml-tab.lua | 5 +- tex/context/base/lxml-tex.lua | 2 + tex/context/base/mult-de.tex | 7 ++ tex/context/base/mult-def.lua | 23 +++++ tex/context/base/mult-en.tex | 7 ++ tex/context/base/mult-fr.tex | 7 ++ tex/context/base/mult-it.tex | 7 ++ tex/context/base/mult-nl.tex | 7 ++ tex/context/base/mult-ro.tex | 7 ++ tex/context/base/strc-blk.mkiv | 14 +-- tex/context/base/strc-def.mkiv | 1 + tex/context/base/strc-des.mkiv | 3 + tex/context/base/strc-doc.lua | 59 +++++++++-- tex/context/base/strc-doc.mkiv | 3 +- tex/context/base/strc-flt.mkiv | 1 + tex/context/base/strc-itm.mkiv | 154 ++++++++++++++++++++++++---- tex/context/base/strc-lst.mkiv | 11 +- tex/context/base/strc-num.mkiv | 10 ++ tex/context/base/strc-pag.lua | 4 + tex/context/base/strc-pag.mkiv | 1 + tex/context/base/strc-reg.mkiv | 2 + tex/context/base/strc-sec.mkiv | 50 ++++++--- tex/context/base/syst-ini.tex | 2 +- tex/context/base/task-ini.lua | 2 + tex/context/base/typo-dig.lua | 103 +++++++++++++++++++ tex/context/base/typo-dig.mkiv | 50 +++++++++ tex/context/interface/keys-cs.xml | 7 ++ tex/context/interface/keys-de.xml | 7 ++ tex/context/interface/keys-en.xml | 7 ++ tex/context/interface/keys-fr.xml | 7 ++ tex/context/interface/keys-it.xml | 7 ++ tex/context/interface/keys-nl.xml | 7 ++ tex/context/interface/keys-pe.xml | 7 ++ tex/context/interface/keys-ro.xml | 7 ++ tex/generic/context/luatex-fonts-merged.lua | 2 +- 41 files changed, 557 insertions(+), 61 deletions(-) create mode 100644 tex/context/base/typo-dig.lua create mode 100644 tex/context/base/typo-dig.mkiv (limited to 'tex') diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex index 6dc37d037..c8abac829 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{2010.01.17 23:50} +\newcontextversion{2010.01.18 22:43} %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.mkiv b/tex/context/base/context.mkiv index f6c578db3..5d584cabd 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -251,6 +251,7 @@ \loadmarkfile{typo-mir} \loadmarkfile{typo-brk} \loadmarkfile{typo-cap} +\loadmarkfile{typo-dig} \loadmarkfile{type-ini} \loadmarkfile{type-set} diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex index ec74cc3c3..2500a5c57 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{2010.01.17 23:50} +\edef\contextversion{2010.01.18 22:43} %D For those who want to use this: diff --git a/tex/context/base/core-two.lua b/tex/context/base/core-two.lua index f81b578ad..24a3191a7 100644 --- a/tex/context/base/core-two.lua +++ b/tex/context/base/core-two.lua @@ -124,12 +124,14 @@ end function jobpasses.getdata(id,index,default) local jti = collected[id] - texprint((jit and jti[index]) or default) + local value = jit and jti[index] + texprint((value ~= "" and value) or default or "") end function jobpasses.getfield(id,index,tag,default) local jti = collected[id] jti = jti and jti[index] - texprint((jti and jti[tag]) or default) + local value = jti and jti[tag] + texprint((value ~= "" and value) or default or "") end diff --git a/tex/context/base/lpdf-xmp.lua b/tex/context/base/lpdf-xmp.lua index bd102cbf5..de826ee5b 100644 --- a/tex/context/base/lpdf-xmp.lua +++ b/tex/context/base/lpdf-xmp.lua @@ -42,6 +42,7 @@ local xmpmetadata = [[ + @@ -75,6 +76,7 @@ local mapping = { ["CreatorTool"] = "rdf:Description/xmp:CreatorTool", ["ModifyDate"] = "rdf:Description/xmp:ModifyDate", ["MetadataDate"] = "rdf:Description/xmp:MetadataDate", + ["Keywords"] = "rdf:Description/pdf:Keywords", ["Producer"] = "rdf:Description/pdf:Producer", ["Trapped"] = "rdf:Description/pdf:Trapped", ["DocumentID"] = "rdf:Description/xmpMM:DocumentID", diff --git a/tex/context/base/lxml-mis.lua b/tex/context/base/lxml-mis.lua index 480253205..2b4bc1155 100644 --- a/tex/context/base/lxml-mis.lua +++ b/tex/context/base/lxml-mis.lua @@ -19,8 +19,7 @@ this module. Since this module is also used in we've put them here instead of loading mode modules there then needed.

--ldx]]-- - -local function xmlgsub(t,old,new) +local function xmlgsub(t,old,new) -- will be replaced local dt = t.dt if dt then for k=1,#dt do @@ -34,7 +33,7 @@ local function xmlgsub(t,old,new) end end -xmlgsub = xmlgsub +--~ xml.gsub = xmlgsub function xml.strip_leading_spaces(dk,d,k) -- cosmetic, for manual if d and k then diff --git a/tex/context/base/lxml-tab.lua b/tex/context/base/lxml-tab.lua index 300b47126..2d4bca8e5 100644 --- a/tex/context/base/lxml-tab.lua +++ b/tex/context/base/lxml-tab.lua @@ -168,11 +168,14 @@ local function add_attribute(namespace,tag,value) if tag == "xmlns" then xmlns[#xmlns+1] = resolvens(value) at[tag] = value + elseif namespace == "" then + at[tag] = value elseif namespace == "xmlns" then xml.checkns(tag,value) at["xmlns:" .. tag] = value else - at[tag] = value + -- for the moment this way: + at[namespace .. ":" .. tag] = value end end diff --git a/tex/context/base/lxml-tex.lua b/tex/context/base/lxml-tex.lua index 6e16388dc..f27fd6d44 100644 --- a/tex/context/base/lxml-tex.lua +++ b/tex/context/base/lxml-tex.lua @@ -542,6 +542,8 @@ local xmltexhandler = xml.newhandlers { } } +lxml.xmltexhandler = xmltexhandler + function lxml.serialize(root) xmlserialize(root,xmltexhandler) end diff --git a/tex/context/base/mult-de.tex b/tex/context/base/mult-de.tex index cdd3db858..5a8091ad9 100644 --- a/tex/context/base/mult-de.tex +++ b/tex/context/base/mult-de.tex @@ -423,6 +423,7 @@ \setinterfacevariable{spot}{spot} \setinterfacevariable{standard}{standard} \setinterfacevariable{start}{start} +\setinterfacevariable{starter}{starter} \setinterfacevariable{sticker}{sticker} \setinterfacevariable{stop}{stop} \setinterfacevariable{stopper}{trenner} @@ -781,6 +782,7 @@ \setinterfaceconstant{numberseparator}{nummernseperator} \setinterfaceconstant{numberseparatorset}{numberseparatorset} \setinterfaceconstant{numberset}{numberset} +\setinterfaceconstant{numberstarter}{numberstarter} \setinterfaceconstant{numberstopper}{numberstopper} \setinterfaceconstant{numberstyle}{nummernstil} \setinterfaceconstant{numberwidth}{numberwidth} @@ -813,10 +815,12 @@ \setinterfaceconstant{pageprefixsegments}{pageprefixsegments} \setinterfaceconstant{pageprefixseparatorset}{pageprefixseparatorset} \setinterfaceconstant{pageprefixset}{pageprefixset} +\setinterfaceconstant{pageprefixstarter}{pageprefixstarter} \setinterfaceconstant{pageprefixstopper}{pageprefixstopper} \setinterfaceconstant{pagesegments}{pagesegments} \setinterfaceconstant{pageseparatorset}{pageseparatorset} \setinterfaceconstant{pageset}{pageset} +\setinterfaceconstant{pagestarter}{pagestarter} \setinterfaceconstant{pagestate}{pagestate} \setinterfaceconstant{pagestopper}{pagestopper} \setinterfaceconstant{pagestyle}{seitenstil} @@ -834,6 +838,7 @@ \setinterfaceconstant{prefixsegments}{prefixsegments} \setinterfaceconstant{prefixseparatorset}{prefixseparatorset} \setinterfaceconstant{prefixset}{prefixset} +\setinterfaceconstant{prefixstarter}{prefixstarter} \setinterfaceconstant{prefixstopper}{prefixstopper} \setinterfaceconstant{preset}{voreinstellung} \setinterfaceconstant{preview}{vorschau} @@ -892,6 +897,7 @@ \setinterfaceconstant{sectionsegments}{sectionsegments} \setinterfaceconstant{sectionseparatorset}{sectionseparatorset} \setinterfaceconstant{sectionset}{sectionset} +\setinterfaceconstant{sectionstarter}{sectionstarter} \setinterfaceconstant{sectionstopper}{sectionstopper} \setinterfaceconstant{separator}{seperator} \setinterfaceconstant{set}{set} @@ -919,6 +925,7 @@ \setinterfaceconstant{spot}{spot} \setinterfaceconstant{stack}{stack} \setinterfaceconstant{start}{start} +\setinterfaceconstant{starter}{starter} \setinterfaceconstant{state}{status} \setinterfaceconstant{step}{schritt} \setinterfaceconstant{stop}{stop} diff --git a/tex/context/base/mult-def.lua b/tex/context/base/mult-def.lua index 3514774d4..5df2ffc75 100644 --- a/tex/context/base/mult-def.lua +++ b/tex/context/base/mult-def.lua @@ -8980,6 +8980,9 @@ return { ["numberstopper"]={ ["en"]="numberstopper", }, + ["numberstarter"]={ + ["en"]="numberstarter", + }, ["numberstyle"]={ ["cs"]="stylcisla", ["de"]="nummernstil", @@ -9210,6 +9213,9 @@ return { ["pageprefixstopper"]={ ["en"]="pageprefixstopper", }, + ["pageprefixstarter"]={ + ["en"]="pageprefixstarter", + }, ["pagesegments"]={ ["en"]="pagesegments", }, @@ -9232,6 +9238,9 @@ return { ["pagestopper"]={ ["en"]="pagestopper", }, + ["pagestarter"]={ + ["en"]="pagestarter", + }, ["pagestyle"]={ ["cs"]="stylstranky", ["de"]="seitenstil", @@ -9343,6 +9352,9 @@ return { ["prefixstopper"]={ ["en"]="prefixstopper", }, + ["prefixstarter"]={ + ["en"]="prefixstarter", + }, ["preset"]={ ["cs"]="prednastaveni", ["de"]="voreinstellung", @@ -9830,6 +9842,9 @@ return { ["sectionstopper"]={ ["en"]="sectionstopper", }, + ["sectionstarter"]={ + ["en"]="sectionstarter", + }, ["separator"]={ ["cs"]="oddelovac", ["de"]="seperator", @@ -10123,6 +10138,10 @@ return { ["pe"]="ایست", ["ro"]="stopper", }, + ["starter"]={ + ["en"]="starter", + ["nl"]="opener", + }, ["stretch"]={ ["cs"]="natahnout", ["de"]="strecken", @@ -15305,6 +15324,10 @@ return { ["pe"]="ایست", ["ro"]="stopper", }, + ["starter"]={ + ["en"]="starter", + ["nl"]="opener", + }, ["stretch"]={ ["cs"]="natahnout", ["de"]="strecken", diff --git a/tex/context/base/mult-en.tex b/tex/context/base/mult-en.tex index 3d4362a79..4c5d3a58b 100644 --- a/tex/context/base/mult-en.tex +++ b/tex/context/base/mult-en.tex @@ -423,6 +423,7 @@ \setinterfacevariable{spot}{spot} \setinterfacevariable{standard}{standard} \setinterfacevariable{start}{start} +\setinterfacevariable{starter}{starter} \setinterfacevariable{sticker}{sticker} \setinterfacevariable{stop}{stop} \setinterfacevariable{stopper}{stopper} @@ -781,6 +782,7 @@ \setinterfaceconstant{numberseparator}{numberseparator} \setinterfaceconstant{numberseparatorset}{numberseparatorset} \setinterfaceconstant{numberset}{numberset} +\setinterfaceconstant{numberstarter}{numberstarter} \setinterfaceconstant{numberstopper}{numberstopper} \setinterfaceconstant{numberstyle}{numberstyle} \setinterfaceconstant{numberwidth}{numberwidth} @@ -813,10 +815,12 @@ \setinterfaceconstant{pageprefixsegments}{pageprefixsegments} \setinterfaceconstant{pageprefixseparatorset}{pageprefixseparatorset} \setinterfaceconstant{pageprefixset}{pageprefixset} +\setinterfaceconstant{pageprefixstarter}{pageprefixstarter} \setinterfaceconstant{pageprefixstopper}{pageprefixstopper} \setinterfaceconstant{pagesegments}{pagesegments} \setinterfaceconstant{pageseparatorset}{pageseparatorset} \setinterfaceconstant{pageset}{pageset} +\setinterfaceconstant{pagestarter}{pagestarter} \setinterfaceconstant{pagestate}{pagestate} \setinterfaceconstant{pagestopper}{pagestopper} \setinterfaceconstant{pagestyle}{pagestyle} @@ -834,6 +838,7 @@ \setinterfaceconstant{prefixsegments}{prefixsegments} \setinterfaceconstant{prefixseparatorset}{prefixseparatorset} \setinterfaceconstant{prefixset}{prefixset} +\setinterfaceconstant{prefixstarter}{prefixstarter} \setinterfaceconstant{prefixstopper}{prefixstopper} \setinterfaceconstant{preset}{preset} \setinterfaceconstant{preview}{preview} @@ -892,6 +897,7 @@ \setinterfaceconstant{sectionsegments}{sectionsegments} \setinterfaceconstant{sectionseparatorset}{sectionseparatorset} \setinterfaceconstant{sectionset}{sectionset} +\setinterfaceconstant{sectionstarter}{sectionstarter} \setinterfaceconstant{sectionstopper}{sectionstopper} \setinterfaceconstant{separator}{separator} \setinterfaceconstant{set}{set} @@ -919,6 +925,7 @@ \setinterfaceconstant{spot}{spot} \setinterfaceconstant{stack}{stack} \setinterfaceconstant{start}{start} +\setinterfaceconstant{starter}{starter} \setinterfaceconstant{state}{state} \setinterfaceconstant{step}{step} \setinterfaceconstant{stop}{stop} diff --git a/tex/context/base/mult-fr.tex b/tex/context/base/mult-fr.tex index ff8104e45..34ada7811 100644 --- a/tex/context/base/mult-fr.tex +++ b/tex/context/base/mult-fr.tex @@ -423,6 +423,7 @@ \setinterfacevariable{spot}{spot} \setinterfacevariable{standard}{standard} \setinterfacevariable{start}{demarre} +\setinterfacevariable{starter}{starter} \setinterfacevariable{sticker}{sticker} \setinterfacevariable{stop}{stoppe} \setinterfacevariable{stopper}{stopper} @@ -781,6 +782,7 @@ \setinterfaceconstant{numberseparator}{separateurnumbero} \setinterfaceconstant{numberseparatorset}{numberseparatorset} \setinterfaceconstant{numberset}{numberset} +\setinterfaceconstant{numberstarter}{numberstarter} \setinterfaceconstant{numberstopper}{numberstopper} \setinterfaceconstant{numberstyle}{stylenumero} \setinterfaceconstant{numberwidth}{numberwidth} @@ -813,10 +815,12 @@ \setinterfaceconstant{pageprefixsegments}{pageprefixsegments} \setinterfaceconstant{pageprefixseparatorset}{pageprefixseparatorset} \setinterfaceconstant{pageprefixset}{pageprefixset} +\setinterfaceconstant{pageprefixstarter}{pageprefixstarter} \setinterfaceconstant{pageprefixstopper}{pageprefixstopper} \setinterfaceconstant{pagesegments}{pagesegments} \setinterfaceconstant{pageseparatorset}{pageseparatorset} \setinterfaceconstant{pageset}{pageset} +\setinterfaceconstant{pagestarter}{pagestarter} \setinterfaceconstant{pagestate}{etatpage} \setinterfaceconstant{pagestopper}{pagestopper} \setinterfaceconstant{pagestyle}{stylepage} @@ -834,6 +838,7 @@ \setinterfaceconstant{prefixsegments}{prefixsegments} \setinterfaceconstant{prefixseparatorset}{prefixseparatorset} \setinterfaceconstant{prefixset}{prefixset} +\setinterfaceconstant{prefixstarter}{prefixstarter} \setinterfaceconstant{prefixstopper}{prefixstopper} \setinterfaceconstant{preset}{prereglage} \setinterfaceconstant{preview}{previsualisation} @@ -892,6 +897,7 @@ \setinterfaceconstant{sectionsegments}{sectionsegments} \setinterfaceconstant{sectionseparatorset}{sectionseparatorset} \setinterfaceconstant{sectionset}{sectionset} +\setinterfaceconstant{sectionstarter}{sectionstarter} \setinterfaceconstant{sectionstopper}{sectionstopper} \setinterfaceconstant{separator}{separateur} \setinterfaceconstant{set}{set} @@ -919,6 +925,7 @@ \setinterfaceconstant{spot}{spot} \setinterfaceconstant{stack}{stack} \setinterfaceconstant{start}{demarre} +\setinterfaceconstant{starter}{starter} \setinterfaceconstant{state}{etat} \setinterfaceconstant{step}{pas} \setinterfaceconstant{stop}{stoppe} diff --git a/tex/context/base/mult-it.tex b/tex/context/base/mult-it.tex index 67ec0d1f8..1a27ba976 100644 --- a/tex/context/base/mult-it.tex +++ b/tex/context/base/mult-it.tex @@ -423,6 +423,7 @@ \setinterfacevariable{spot}{spot} \setinterfacevariable{standard}{standard} \setinterfacevariable{start}{inizia} +\setinterfacevariable{starter}{starter} \setinterfacevariable{sticker}{sticker} \setinterfacevariable{stop}{termina} \setinterfacevariable{stopper}{stopper} @@ -781,6 +782,7 @@ \setinterfaceconstant{numberseparator}{separatorenumero} \setinterfaceconstant{numberseparatorset}{numberseparatorset} \setinterfaceconstant{numberset}{numberset} +\setinterfaceconstant{numberstarter}{numberstarter} \setinterfaceconstant{numberstopper}{numberstopper} \setinterfaceconstant{numberstyle}{stilenumero} \setinterfaceconstant{numberwidth}{numberwidth} @@ -813,10 +815,12 @@ \setinterfaceconstant{pageprefixsegments}{pageprefixsegments} \setinterfaceconstant{pageprefixseparatorset}{pageprefixseparatorset} \setinterfaceconstant{pageprefixset}{pageprefixset} +\setinterfaceconstant{pageprefixstarter}{pageprefixstarter} \setinterfaceconstant{pageprefixstopper}{pageprefixstopper} \setinterfaceconstant{pagesegments}{pagesegments} \setinterfaceconstant{pageseparatorset}{pageseparatorset} \setinterfaceconstant{pageset}{pageset} +\setinterfaceconstant{pagestarter}{pagestarter} \setinterfaceconstant{pagestate}{statopagina} \setinterfaceconstant{pagestopper}{pagestopper} \setinterfaceconstant{pagestyle}{stilepagina} @@ -834,6 +838,7 @@ \setinterfaceconstant{prefixsegments}{prefixsegments} \setinterfaceconstant{prefixseparatorset}{prefixseparatorset} \setinterfaceconstant{prefixset}{prefixset} +\setinterfaceconstant{prefixstarter}{prefixstarter} \setinterfaceconstant{prefixstopper}{prefixstopper} \setinterfaceconstant{preset}{preimpostato} \setinterfaceconstant{preview}{anteprima} @@ -892,6 +897,7 @@ \setinterfaceconstant{sectionsegments}{sectionsegments} \setinterfaceconstant{sectionseparatorset}{sectionseparatorset} \setinterfaceconstant{sectionset}{sectionset} +\setinterfaceconstant{sectionstarter}{sectionstarter} \setinterfaceconstant{sectionstopper}{sectionstopper} \setinterfaceconstant{separator}{separatore} \setinterfaceconstant{set}{set} @@ -919,6 +925,7 @@ \setinterfaceconstant{spot}{spot} \setinterfaceconstant{stack}{stack} \setinterfaceconstant{start}{inizia} +\setinterfaceconstant{starter}{starter} \setinterfaceconstant{state}{stato} \setinterfaceconstant{step}{passo} \setinterfaceconstant{stop}{termina} diff --git a/tex/context/base/mult-nl.tex b/tex/context/base/mult-nl.tex index 50cbf9055..e66395384 100644 --- a/tex/context/base/mult-nl.tex +++ b/tex/context/base/mult-nl.tex @@ -423,6 +423,7 @@ \setinterfacevariable{spot}{spot} \setinterfacevariable{standard}{standaard} \setinterfacevariable{start}{start} +\setinterfacevariable{starter}{opener} \setinterfacevariable{sticker}{sticker} \setinterfacevariable{stop}{stop} \setinterfacevariable{stopper}{afsluiter} @@ -781,6 +782,7 @@ \setinterfaceconstant{numberseparator}{nummerscheider} \setinterfaceconstant{numberseparatorset}{numberseparatorset} \setinterfaceconstant{numberset}{numberset} +\setinterfaceconstant{numberstarter}{numberstarter} \setinterfaceconstant{numberstopper}{numberstopper} \setinterfaceconstant{numberstyle}{nummerletter} \setinterfaceconstant{numberwidth}{nummerbreedte} @@ -813,10 +815,12 @@ \setinterfaceconstant{pageprefixsegments}{pageprefixsegments} \setinterfaceconstant{pageprefixseparatorset}{pageprefixseparatorset} \setinterfaceconstant{pageprefixset}{pageprefixset} +\setinterfaceconstant{pageprefixstarter}{pageprefixstarter} \setinterfaceconstant{pageprefixstopper}{pageprefixstopper} \setinterfaceconstant{pagesegments}{pagesegments} \setinterfaceconstant{pageseparatorset}{pageseparatorset} \setinterfaceconstant{pageset}{pageset} +\setinterfaceconstant{pagestarter}{pagestarter} \setinterfaceconstant{pagestate}{paginastatus} \setinterfaceconstant{pagestopper}{pagestopper} \setinterfaceconstant{pagestyle}{paginaletter} @@ -834,6 +838,7 @@ \setinterfaceconstant{prefixsegments}{prefixsegments} \setinterfaceconstant{prefixseparatorset}{prefixseparatorset} \setinterfaceconstant{prefixset}{prefixset} +\setinterfaceconstant{prefixstarter}{prefixstarter} \setinterfaceconstant{prefixstopper}{prefixstopper} \setinterfaceconstant{preset}{preset} \setinterfaceconstant{preview}{preview} @@ -892,6 +897,7 @@ \setinterfaceconstant{sectionsegments}{sectionsegments} \setinterfaceconstant{sectionseparatorset}{sectionseparatorset} \setinterfaceconstant{sectionset}{sectionset} +\setinterfaceconstant{sectionstarter}{sectionstarter} \setinterfaceconstant{sectionstopper}{sectionstopper} \setinterfaceconstant{separator}{scheider} \setinterfaceconstant{set}{set} @@ -919,6 +925,7 @@ \setinterfaceconstant{spot}{spot} \setinterfaceconstant{stack}{stapel} \setinterfaceconstant{start}{start} +\setinterfaceconstant{starter}{opener} \setinterfaceconstant{state}{status} \setinterfaceconstant{step}{stap} \setinterfaceconstant{stop}{stop} diff --git a/tex/context/base/mult-ro.tex b/tex/context/base/mult-ro.tex index 0ab78bc6c..c4896af8a 100644 --- a/tex/context/base/mult-ro.tex +++ b/tex/context/base/mult-ro.tex @@ -423,6 +423,7 @@ \setinterfacevariable{spot}{spot} \setinterfacevariable{standard}{standard} \setinterfacevariable{start}{start} +\setinterfacevariable{starter}{starter} \setinterfacevariable{sticker}{sticker} \setinterfacevariable{stop}{stop} \setinterfacevariable{stopper}{stopper} @@ -781,6 +782,7 @@ \setinterfaceconstant{numberseparator}{separatornumar} \setinterfaceconstant{numberseparatorset}{numberseparatorset} \setinterfaceconstant{numberset}{numberset} +\setinterfaceconstant{numberstarter}{numberstarter} \setinterfaceconstant{numberstopper}{numberstopper} \setinterfaceconstant{numberstyle}{stilnumar} \setinterfaceconstant{numberwidth}{numberwidth} @@ -813,10 +815,12 @@ \setinterfaceconstant{pageprefixsegments}{pageprefixsegments} \setinterfaceconstant{pageprefixseparatorset}{pageprefixseparatorset} \setinterfaceconstant{pageprefixset}{pageprefixset} +\setinterfaceconstant{pageprefixstarter}{pageprefixstarter} \setinterfaceconstant{pageprefixstopper}{pageprefixstopper} \setinterfaceconstant{pagesegments}{pagesegments} \setinterfaceconstant{pageseparatorset}{pageseparatorset} \setinterfaceconstant{pageset}{pageset} +\setinterfaceconstant{pagestarter}{pagestarter} \setinterfaceconstant{pagestate}{pagestate} \setinterfaceconstant{pagestopper}{pagestopper} \setinterfaceconstant{pagestyle}{stilpagina} @@ -834,6 +838,7 @@ \setinterfaceconstant{prefixsegments}{prefixsegments} \setinterfaceconstant{prefixseparatorset}{prefixseparatorset} \setinterfaceconstant{prefixset}{prefixset} +\setinterfaceconstant{prefixstarter}{prefixstarter} \setinterfaceconstant{prefixstopper}{prefixstopper} \setinterfaceconstant{preset}{preset} \setinterfaceconstant{preview}{previzualizare} @@ -892,6 +897,7 @@ \setinterfaceconstant{sectionsegments}{sectionsegments} \setinterfaceconstant{sectionseparatorset}{sectionseparatorset} \setinterfaceconstant{sectionset}{sectionset} +\setinterfaceconstant{sectionstarter}{sectionstarter} \setinterfaceconstant{sectionstopper}{sectionstopper} \setinterfaceconstant{separator}{separator} \setinterfaceconstant{set}{set} @@ -919,6 +925,7 @@ \setinterfaceconstant{spot}{spot} \setinterfaceconstant{stack}{stack} \setinterfaceconstant{start}{start} +\setinterfaceconstant{starter}{starter} \setinterfaceconstant{state}{stare} \setinterfaceconstant{step}{pas} \setinterfaceconstant{stop}{stop} diff --git a/tex/context/base/strc-blk.mkiv b/tex/context/base/strc-blk.mkiv index 90d2ff9ab..3d842b283 100644 --- a/tex/context/base/strc-blk.mkiv +++ b/tex/context/base/strc-blk.mkiv @@ -30,10 +30,10 @@ \def\dosetupblock[#1]{\getparameters[\??tb#1]} % [#1][#2]} -\def\defineblock - {\dosingleargument\dodefineblock} +\def\defineblock[#1]% + {\processcommalist[#1]\dodefineblock} -\def\dodefineblock[#1]% +\def\dodefineblock#1% {\getparameters [\??tb#1] [\c!before=\blank, @@ -59,11 +59,13 @@ % order matters: \c!before (think of: \c!before=\startitemize) +% no \endgroups + \let\doblocksetups\gobbleoneargument \def\dostartnormalblock#1% name {\bgroup -\visibletrue + \visibletrue \edef\currentblock{#1}% \doblocksetups\currentblock \let\doblocksetups\gobbleoneargument @@ -83,7 +85,7 @@ {\ctxlua{structure.blocks.setstate("#1","#2","#3")}} \def\doselectblocks[#1][#2][#3][#4]% state name tag setups - {\begingroup + {\bgroup \doifassignmentelse{#3} {\getparameters[\??tb\??tb][\c!criterium=\v!text,#3]% \def\doblocksetups##1{\getparameters[\??tb##1][#3]}% @@ -91,7 +93,7 @@ {\getparameters[\??tb\??tb][\c!criterium=\v!text,#4]% \def\doblocksetups##1{\getparameters[\??tb##1][#4]}% \ctxlua{structure.blocks.select("#1","#2","#3","\@@tb@@tbcriterium")}}% - \endgroup} + \egroup} % hide: save, if [+] also hidden execute % keep: save and normal execute diff --git a/tex/context/base/strc-def.mkiv b/tex/context/base/strc-def.mkiv index 01336b4d9..7f1db7065 100644 --- a/tex/context/base/strc-def.mkiv +++ b/tex/context/base/strc-def.mkiv @@ -90,6 +90,7 @@ \c!sectionseparatorset=\s!default, \c!sectionset=\v!all, %\c!sectionstopper=, + %\c!sectionstarter=, %\c!strut=, %\c!style=, %\c!text=, diff --git a/tex/context/base/strc-des.mkiv b/tex/context/base/strc-des.mkiv index 4c823514d..b36106f11 100644 --- a/tex/context/base/strc-des.mkiv +++ b/tex/context/base/strc-des.mkiv @@ -656,6 +656,7 @@ \def\doenumerationnumber {\descriptionparameter\c!left + \descriptionparameter\c!starter \dodescriptionnumber \descriptionparameter\c!stopper \descriptionparameter\c!right} @@ -861,6 +862,7 @@ separatorset = "\descriptionparameter\c!numberseparatorset", conversion = "\descriptionparameter\c!numberconversion", conversionset = "\descriptionparameter\c!numberconversionset", + starter = \!!bs\descriptionparameter\c!numberstarter\!!es, stopper = \!!bs\descriptionparameter\c!numberstopper\!!es, segments = "\descriptionparameter\c!numbersegments", }, @@ -1049,6 +1051,7 @@ \c!way=\v!by\v!text, \c!prefix=\v!no, \c!prefixconnector=., + \c!starter=, \c!stopper=, \c!number=\v!yes, % else description \c!start=0, diff --git a/tex/context/base/strc-doc.lua b/tex/context/base/strc-doc.lua index 74a5cc21a..45951cf06 100644 --- a/tex/context/base/strc-doc.lua +++ b/tex/context/base/strc-doc.lua @@ -345,8 +345,8 @@ function sections.matching_till_depth(depth,numbers,parentnumbers) return ok end -function sections.getnumber(depth) - return texwrite(data.numbers[depth] or 0) +function sections.getnumber(depth) -- redefined later ... + texwrite(data.numbers[depth] or 0) end function sections.set(key,value) @@ -453,6 +453,7 @@ function sections.typesetnumber(entry,kind,...) -- kind='section','number','pref local conversionset = "" local conversion = "" local stopper = "" + local starter = "" local connector = "" local set = "" local segments = "" @@ -463,6 +464,7 @@ function sections.typesetnumber(entry,kind,...) -- kind='section','number','pref if conversionset == "" then conversionset = data.conversionset or "" end if conversion == "" then conversion = data.conversion or "" end if stopper == "" then stopper = data.stopper or "" end + if starter == "" then starter = data.starter or "" end if connector == "" then connector = data.connector or "" end if set == "" then set = data.set or "" end if segments == "" then segments = data.segments or "" end @@ -473,6 +475,7 @@ function sections.typesetnumber(entry,kind,...) -- kind='section','number','pref if conversionset == "" then conversionset = "default" end -- not used if conversion == "" then conversion = nil end if stopper == "" then stopper = nil end + if starter == "" then starter = nil end if connector == "" then connector = nil end if set == "" then set = "default" end if segments == "" then segments = nil end @@ -539,6 +542,9 @@ function sections.typesetnumber(entry,kind,...) -- kind='section','number','pref end -- local prefixlist = set and sets.getall("structure:prefixes","",set) -- "" == block +if starter then + processors.sprint(ctxcatcodes,starter) +end if prefixlist and (kind == 'section' or kind == 'prefix') then -- find valid set (problem: for sectionnumber we should pass the level) -- if kind == "section" then @@ -614,19 +620,54 @@ function sections.typesetnumber(entry,kind,...) -- kind='section','number','pref end end -function sections.fullnumber(depth) +function sections.title() + local sc = sections.current() + if sc then + helpers.title(sc.titledata.title,sc.metadata) + end +end + +function sections.findnumber(depth,what) local data = data.status[depth or data.depth] if data then - local sectiondata = jobsections.collected[data.references.section] -- tobesaved? + local index = data.references.section + local collected = jobsections.collected + local sectiondata = collected[index] if sectiondata and sectiondata.hidenumber ~= true then -- can be nil - sections.typesetnumber(sectiondata,'section',sectiondata) + if what == variables.first then + for i=index,1,-1 do + local s = collected[i] + local n = s.numbers + if #n == depth and n[depth] and n[depth] ~= 0 then + sectiondata = s + elseif #n < depth then + break + end + end + elseif what == variables.last then + for i=index,#collected do + local s = collected[i] + local n = s.numbers + if #n == depth and n[depth] and n[depth] ~= 0 then + sectiondata = s + elseif #n < depth then + break + end + end + end + return sectiondata end end end -function sections.title() - local sc = sections.current() - if sc then - helpers.title(sc.titledata.title,sc.metadata) +function sections.fullnumber(depth,what,raw) + local sectiondata = sections.findnumber(depth,what) + if sectiondata then + sections.typesetnumber(sectiondata,'section',sectiondata) end end + +function sections.getnumber(depth,what) -- redefined here + local sectiondata = sections.findnumber(depth,what) + texwrite((sectiondata and sectiondata.numbers[depth]) or 0) +end diff --git a/tex/context/base/strc-doc.mkiv b/tex/context/base/strc-doc.mkiv index 2970fbc85..e10efb3f7 100644 --- a/tex/context/base/strc-doc.mkiv +++ b/tex/context/base/strc-doc.mkiv @@ -38,7 +38,7 @@ [\??ns] [\c!number=,\c!level=,\c!name=,\c!title=,\c!bookmark=,\c!marking=,\c!list=,\c!label=,\c!coupling=,\c!ownnumber=, \c!sectionseparatorset=\s!default,\c!sectionconversionset=\s!default, - \c!sectionstopper=,\c!sectionsegments=, + \c!sectionstopper=,\c!sectionstarter,\c!sectionsegments=, \c!sectionresetset=,\c!reference=, \c!expansion=\v!no, \c!xmlsetup=, @@ -153,6 +153,7 @@ separatorset = "\structureparameter\c!sectionseparatorset", conversion = "\structureparameter\c!sectionconversion", % for good old times sake conversionset = "\structureparameter\c!sectionconversionset", + starter = \!!bs\structureparameter\c!sectionstarter\!!es, stopper = \!!bs\structureparameter\c!sectionstopper\!!es, set = "\structureparameter\c!sectionset", segments = "\structureparameter\c!sectionsegments", diff --git a/tex/context/base/strc-flt.mkiv b/tex/context/base/strc-flt.mkiv index 046045355..3f1a9e86b 100644 --- a/tex/context/base/strc-flt.mkiv +++ b/tex/context/base/strc-flt.mkiv @@ -118,6 +118,7 @@ % \c!blockway=\@@nrblockway, % \c!sectionnumber=\@@nrsectionnumber, % \c!separator=\@@koseparator, +% \c!starter=\@@kostarter, % \c!stopper=\@@kostopper, % \c!suffix=\floatcaptionsuffix, % hook \c!distance=1em, diff --git a/tex/context/base/strc-itm.mkiv b/tex/context/base/strc-itm.mkiv index 35ed67d77..423508930 100644 --- a/tex/context/base/strc-itm.mkiv +++ b/tex/context/base/strc-itm.mkiv @@ -483,13 +483,26 @@ \let\@@opsymbol\empty}% {}}} -\def\calculatelistwidth#1% distance deals with 'broad' - {\itemgrouplistwidth\getitemparameter#1\c!distance\relax - \ifnum\getitemparameter#1\c!factor>\zerocount +% \def\calculatelistwidth#1% distance deals with 'broad' +% {\itemgrouplistwidth\getitemparameter#1\c!distance\relax +% \ifnum\getitemparameter#1\c!factor>\zerocount +% \ifdim\itemgrouplistwidth=\zeropoint \itemgrouplistwidth=.5em\fi +% \fi +% \multiply\itemgrouplistwidth \getitemparameter#1\c!factor +% \advance \itemgrouplistwidth \getitemparameter#1\c!width\relax} + +\def\calculatelistwidth#1% + {\ifdim\currentitemmaxwidth>\zeropoint + \itemgrouplistwidth\currentitemmaxwidth + \else\ifnum\getitemparameter#1\c!factor>\zerocount + \itemgrouplistwidth\getitemparameter#1\c!step\relax \ifdim\itemgrouplistwidth=\zeropoint \itemgrouplistwidth=.5em\fi - \fi - \multiply\itemgrouplistwidth \getitemparameter#1\c!factor - \advance \itemgrouplistwidth \getitemparameter#1\c!width\relax} + \multiply\itemgrouplistwidth \getitemparameter#1\c!factor + \advance\itemgrouplistwidth\getitemparameter#1\c!width\relax + \else + \itemgrouplistwidth\getitemparameter#1\c!width\relax + \fi\fi + \advance\itemgrouplistwidth\getitemparameter#1\c!distance\relax} % The next conditionals deal with \item \startitemgroup. It % looks like a hack to skip back, but that way we preserve @@ -972,6 +985,95 @@ \fi \fi\fi} +% \def\dodolapitem +% {% todo: align+marge binnen de hbox +% \llap{\hbox to \itemgrouplistwidth{\ifconditional\sublistitem\llap{+\enspace}\fi +% \symalignleft +% \box\itemgroupitembox\hfil +% \hskip\getitemparameter\currentitemlevel\c!distance% T h +% }}} + +% \def\dolistitem % evt aantal items opslaan per niveau, scheelt zoeken +% {\ifconditional\textlistitem +% % begin of item +% \else +% \par +% \fi +% \advance\noflistelements\plusone +% \optimizelistitemsbreak +% \noindent +% \setbox\itemgroupitembox\hbox +% {\ifconditional\headlistitem +% \ifconditional\symbollistitem +% \dosetitemattributes\currentitemlevel\c!symstyle\c!symcolor{\symsymbol}% +% \else +% \dosetitemattributes\currentitemlevel\c!headstyle\c!headcolor{\listitem}% +% \fi +% \else +% \ifconditional\symbollistitem +% \dosetitemattributes\currentitemlevel\c!symstyle\c!symcolor{\symsymbol}% +% \else +% \dosetitemattributes\currentitemlevel\c!style\c!color{\listitem}% +% \fi +% \fi}% +% \ifconditional\fittinglistitems +% \ifdim\wd\itemgroupitembox>\getitemparameter\currentitemlevel\c!maxwidth sp\relax +% \xsetitemparameter\currentitemlevel\c!maxwidth{\number\wd\itemgroupitembox}% +% \fi +% \ifdim\currentitemmaxwidth>\zeropoint +% \setbox\itemgroupitembox\simplealignedbox{\getitemparameter\currentitemlevel\c!itemalign}{\currentitemmaxwidth}{\box\itemgroupitembox}% +% \fi +% \fi +% \doifsomething\doitemdestination +% {\setbox\itemgroupitembox\hbox{\directgotobox{\box\itemgroupitembox}[\doitemdestination]}}% +% \globallet\doitemdestination\empty +% \itemgroupaskedwidth\getitemparameter\currentitemlevel\c!width\relax +% % new, prevents loops when symbol is (not yet found) graphic +% \ht\itemgroupitembox\strutheight +% \dp\itemgroupitembox\strutdepth +% % so that content differs per run (esp mp graphics afterwards) +% \checkforrepeatedlistitem +% \ifdim\itemgroupaskedwidth<\zeropoint\relax +% \llap{\ifconditional\sublistitem\llap{+\enspace}\fi\box\itemgroupitembox\hskip\leftmargindistance}% +% \else +% \ifdim\itemgroupaskedwidth=\zeropoint\relax +% \calculatelistwidth1% +% \else +% \calculatelistwidth\currentitemlevel +% \fi +% \ifconditional\textlistitem +% \hbox{\ifconditional\sublistitem+\enspace\fi\box\itemgroupitembox\hskip\interwordspace}\nobreak +% \else\ifconditional\inlinelistitem +% \hbox to \itemgrouplistwidth{\ifconditional\sublistitem\llap{+\enspace}\fi\box\itemgroupitembox\hss}% was: \hfill +% \else\ifconditional\txtlistitem +% \dodotxtitem +% \else +% \dodolapitem +% \fi\fi\fi +% \fi +% \forceunexpanded % needed for m conversion (\os) / i need to look into this +% \setevalue{\@@currentitemsymbol\currentitemlevel}% +% {\getvalue{\@@localitemsymbol\currentitemlevel}}% still problems with \uchar ? +% %{\noexpand\getvalue{\@@localitemsymbol\currentitemlevel}}% no, spoils subrefs +% \resetunexpanded +% \setfalse\headlistitem +% \setfalse\sublistitem +% \setfalse\symbollistitem +% \EveryPar{\ignorespaces}% needed ? +% \ignorespaces} + +\def\dodosubitem + {\ifconditional\sublistitem\llap{+\enspace}\fi} + +\def\dodolapitem + {\llap + {\hbox to \itemgrouplistwidth + {\dodosubitem + \symalignleft + \box\itemgroupitembox % can already have a forced widt, only factor handled here + \hfil + \hskip\getitemparameter\currentitemlevel\c!distance}}} + \def\dolistitem % evt aantal items opslaan per niveau, scheelt zoeken {\ifconditional\textlistitem % begin of item @@ -995,18 +1097,27 @@ \dosetitemattributes\currentitemlevel\c!style\c!color{\listitem}% \fi \fi}% - \ifconditional\fittinglistitems - \ifdim\wd\itemgroupitembox>\getitemparameter\currentitemlevel\c!maxwidth sp\relax - \xsetitemparameter\currentitemlevel\c!maxwidth{\number\wd\itemgroupitembox}% - \fi - \ifdim\currentitemmaxwidth>\zeropoint - \setbox\itemgroupitembox\simplealignedbox{\getitemparameter\currentitemlevel\c!itemalign}{\currentitemmaxwidth}{\box\itemgroupitembox}% - \fi - \fi \doifsomething\doitemdestination {\setbox\itemgroupitembox\hbox{\directgotobox{\box\itemgroupitembox}[\doitemdestination]}}% - \globallet\doitemdestination\empty \itemgroupaskedwidth\getitemparameter\currentitemlevel\c!width\relax + \ifconditional\fittinglistitems + \ifdim\wd\itemgroupitembox>\getitemparameter\currentitemlevel\c!maxwidth sp\relax + \xsetitemparameter\currentitemlevel\c!maxwidth{\number\wd\itemgroupitembox}% + \fi + \ifdim\currentitemmaxwidth>\zeropoint + \setbox\itemgroupitembox\simplealignedbox + {\getitemparameter\currentitemlevel\c!itemalign} + {\dimexpr\currentitemmaxwidth+\getitemparameter\currentitemlevel\c!distance\relax} + {\box\itemgroupitembox\hskip\getitemparameter\currentitemlevel\c!distance}% + \fi + \else\ifdim\itemgroupaskedwidth>\zeropoint + \doifsomething{\getitemparameter\currentitemlevel\c!itemalign} + {\setbox\itemgroupitembox\simplealignedbox + {\getitemparameter\currentitemlevel\c!itemalign} + {\dimexpr\itemgroupaskedwidth+\getitemparameter\currentitemlevel\c!distance\relax} + {\box\itemgroupitembox\hskip\getitemparameter\currentitemlevel\c!distance}}% + \fi\fi + \globallet\doitemdestination\empty % new, prevents loops when symbol is (not yet found) graphic \ht\itemgroupitembox\strutheight \dp\itemgroupitembox\strutdepth @@ -1027,12 +1138,7 @@ \else\ifconditional\txtlistitem \dodotxtitem \else - % todo: align+marge binnen de hbox - \llap{\hbox to \itemgrouplistwidth{\ifconditional\sublistitem\llap{+\enspace}\fi - \symalignleft - \box\itemgroupitembox\hfil - \hskip\getitemparameter\currentitemlevel\c!distance% T h - }}% + \dodolapitem \fi\fi\fi \fi \forceunexpanded % needed for m conversion (\os) / i need to look into this @@ -1266,6 +1372,12 @@ \c!command=\defaultitemcommand, \c!symbol=\currentitemlevel] +% new: + +\setupitemgroups + [\c!step=.5em, % deals with broad + \c!distance=\zeropoint] + \setupitemgroups [\c!prefix=\v!no, % \c!prefixstopper=., diff --git a/tex/context/base/strc-lst.mkiv b/tex/context/base/strc-lst.mkiv index fd9675190..79a9f2e8f 100644 --- a/tex/context/base/strc-lst.mkiv +++ b/tex/context/base/strc-lst.mkiv @@ -107,6 +107,7 @@ { prefix = "\listparameter\c!pageprefix", conversionset = "\listparameter\c!pageconversionset", + starter = \!!bs\listparameter\c!pagestarter\!!es, stopper = \!!bs\listparameter\c!pagestopper\!!es, } )}} @@ -272,17 +273,20 @@ \c!limittext=\@@kolimittext, %\c!sectionseparatorset=, %\c!sectionconversionset=, + %\c!sectionstarter=, %\c!sectionstopper=, %\c!sectionset=, %\c!sectionsegments=, %\c!prefix=\v!no, %\c!prefixseparatorset=, %\c!prefixconversionset=, + %\c!prefixstarter=., %\c!prefixstopper=., %\c!prefixset=, %\c!prefixsegments=, %\c!pageseparatorset=, %\c!pageconversionset=, + %\c!pagestarter=, %\c!pagestopper=, %\c!expansion=, % \c!prefixconnector=., % maybe inherit from setupheads @@ -439,6 +443,7 @@ {% prefix = no, none, yes \strut \doif{\listparameter\c!label}\v!yes{\leftlabeltext\currentlist}% we can use the new command that does left and right + \listparameter\c!starter \currentlistnumber \listparameter\c!stopper \doif{\listparameter\c!label}\v!yes{\rightlabeltext\currentlist}} @@ -450,10 +455,12 @@ \strut \doifelse{\listparameter\c!label}\v!yes {\leftlabeltext\currentlist + \listparameter\c!starter \currentlistnumber \listparameter\c!stopper \rightlabeltext\currentlist} - {\currentlistnumber + {\listparameter\c!starter + \currentlistnumber \listparameter\c!stopper}} \def\listsymbol@unknown @@ -878,6 +885,7 @@ prefix = "\listparameter\c!prefix", separatorset = "\listparameter\c!prefixseparatorset", conversionset = "\listparameter\c!prefixconversionset", + starter = \!!bs\listparameter\c!prefixstarter\!!es, stopper = \!!bs\listparameter\c!prefixstopper\!!es, set = "\listparameter\c!prefixset", segments = "\listparameter\c!prefixsegments", @@ -886,6 +894,7 @@ { separatorset = "\listparameter\c!numberseparatorset", conversionset = "\listparameter\c!numberconversionset", + starter = \!!bs\listparameter\c!numberstarter\!!es, stopper = \!!bs\listparameter\c!numberstopper\!!es, segments = "\listparameter\c!numbersegments", } )}} diff --git a/tex/context/base/strc-num.mkiv b/tex/context/base/strc-num.mkiv index 88b03a699..01e9d2177 100644 --- a/tex/context/base/strc-num.mkiv +++ b/tex/context/base/strc-num.mkiv @@ -44,6 +44,7 @@ \setupstructurecountering [\c!way=\v!by\v!chapter, % \c!blockway=, +% \c!prefixstarter=, % \c!prefixstopper=, \c!prefixconnector=., \c!prefixsegments=\thenamedstructurecounterlevel\currentstructurecounter, @@ -218,6 +219,7 @@ separatorset = "\structurecounterparameter{#1}\c!prefixseparatorset", conversion = "\structurecounterparameter{#1}\c!prefixconversion", conversionset = "\structurecounterparameter{#1}\c!prefixconversionset", + starter = \!!bs\structurecounterparameter{#1}\c!prefixstarter\!!es, stopper = \!!bs\structurecounterparameter{#1}\c!prefixstopper\!!es, set = "\structurecounterparameter{#1}\c!prefixset", segments = "\structurecounterparameter{#1}\c!prefixsegments", @@ -228,6 +230,7 @@ separatorset = "\structurecounterparameter{#1}\c!numberseparatorset", conversion = \!!bs\structurecounterparameter{#1}\c!numberconversion\!!es, conversionset = "\structurecounterparameter{#1}\c!numberconversionset", + starter = \!!bs\structurecounterparameter{#1}\c!numberstarter\!!es, stopper = \!!bs\structurecounterparameter{#1}\c!numberstopper\!!es, segments = "\structurecounterparameter{#1}\c!numbersegments", type = "\structurecounterparameter{#1}\c!type", @@ -245,6 +248,7 @@ separatorset = "\structurecounterparameter{#1}\c!prefixseparatorset", conversion = "\structurecounterparameter{#1}\c!prefixconversion", conversionset = "\structurecounterparameter{#1}\c!prefixconversionset", + % starter = \!!bs\structurecounterparameter{#1}\c!prefixstarter\!!es, % stopper = \!!bs\structurecounterparameter{#1}\c!prefixstopper\!!es, set = "\structurecounterparameter{#1}\c!prefixset", segments = "\structurecounterparameter{#1}\c!prefixsegments", @@ -255,6 +259,7 @@ separatorset = "\structurecounterparameter{#1}\c!numberseparatorset", conversion = \!!bs\structurecounterparameter{#1}\c!numberconversion\!!es, conversionset = "\structurecounterparameter{#1}\c!numberconversionset", + starter = \!!bs\structurecounterparameter{#1}\c!numberstarter\!!es, stopper = \!!bs\structurecounterparameter{#1}\c!numberstopper\!!es, segments = "\structurecounterparameter{#1}\c!numbersegments", type = "#2", @@ -438,6 +443,7 @@ separatorset = "#3\c!numberseparatorset", conversion = \!!bs#3\c!numberconversion\!!es, conversionset = "#3\c!numberconversionset", + starter = \!!bs#3\c!numberstarter\!!es, stopper = \!!bs#3\c!numberstopper\!!es, segments = "#3\c!numbersegments", }, @@ -469,6 +475,7 @@ \c!prefixseparatorset=#2\c!prefixseparatorset, \c!prefixconversion=#2\c!prefixconversion, \c!prefixconversionset=#2\c!prefixconversionset, + \c!prefixstarter=#2\c!prefixstarter, \c!prefixstopper=#2\c!prefixstopper, \c!prefixset=#2\c!prefixset, \c!prefixsegments=#2\c!prefixsegments, @@ -478,6 +485,7 @@ \c!numberseparatorset=#2\c!numberseparatorset, \c!numberconversion=#2\c!numberconversion, \c!numberconversionset=#2\c!numberconversionset, + \c!numberstarter=#2\c!numberstarter, \c!numberstopper=#2\c!numberstopper, \c!numbersegments=#2\c!numbersegments]} @@ -488,6 +496,7 @@ \c!prefixseparatorset =#2\c!prefixseparatorset, \c!prefixconversion =#2\c!prefixconversion, \c!prefixconversionset=#2\c!prefixconversionset, + \c!prefixstarter =#2\c!prefixstarter, \c!prefixstopper =#2\c!prefixstopper, \c!prefixsegments =#2\c!prefixsegments, \c!prefixset =#2\c!prefixset, @@ -495,6 +504,7 @@ \c!numberseparatorset =#2\c!numberseparatorset, \c!numberconversion =#2\c!numberconversion, \c!numberconversionset=#2\c!numberconversionset, + \c!numberstarter =#2\c!numberstarter, \c!numberstopper =#2\c!numberstopper, \c!numbersegments =#2\c!numbersegments]} diff --git a/tex/context/base/strc-pag.lua b/tex/context/base/strc-pag.lua index 7338888ff..a8f8af14f 100644 --- a/tex/context/base/strc-pag.lua +++ b/tex/context/base/strc-pag.lua @@ -99,7 +99,11 @@ function pages.number(realdata,pagespec) local numberspec = realdata.numberdata local conversionset = (pagespec and pagespec.conversionset ~= "" and pagespec.conversionset) or (numberspec and numberspec.conversionset ~= "" and numberspec.conversionset) or "" local conversion = (pagespec and pagespec.conversion ~= "" and pagespec.conversion ) or (numberspec and numberspec.conversion ~= "" and numberspec.conversion ) or "" + local starter = (pagespec and pagespec.starter ~= "" and pagespec.starter ) or (numberspec and numberspec.starter ~= "" and numberspec.starter ) or "" local stopper = (pagespec and pagespec.stopper ~= "" and pagespec.stopper ) or (numberspec and numberspec.stopper ~= "" and numberspec.stopper ) or "" + if starter ~= "" then + processors.sprint(ctxcatcodes,starter) + end if conversion ~= "" then texsprint(ctxcatcodes,format("\\convertnumber{%s}{%s}",conversion,userpage)) else diff --git a/tex/context/base/strc-pag.mkiv b/tex/context/base/strc-pag.mkiv index 63a8a1f76..0a55c50c8 100644 --- a/tex/context/base/strc-pag.mkiv +++ b/tex/context/base/strc-pag.mkiv @@ -118,6 +118,7 @@ },{ conversion = "\structurecounterparameter\s!userpage\c!numberconversion", conversionset = "\structurecounterparameter\s!userpage\c!numberconversionset", + starter = \!!bs\structurecounterparameter\s!userpage\c!numberstarter\!!es, stopper = \!!bs\structurecounterparameter\s!userpage\c!numberstopper\!!es, } )}} diff --git a/tex/context/base/strc-reg.mkiv b/tex/context/base/strc-reg.mkiv index 7cae98742..fe3803753 100644 --- a/tex/context/base/strc-reg.mkiv +++ b/tex/context/base/strc-reg.mkiv @@ -551,6 +551,7 @@ % prefix = "\registerparameter\c!pageprefix", separatorset = "\registerparameter\c!pageprefixseparatorset", conversionset = "\registerparameter\c!pageprefixconversionset", + starter = \!!bs\registerparameter\c!pageprefixstarter\!!es, stopper = \!!bs\registerparameter\c!pageprefixstopper\!!es, set = "\registerparameter\c!pageprefixset", segments = "\registerparameter\c!pageprefixsegments", @@ -560,6 +561,7 @@ prefix = "\registerparameter\c!pageprefix", separatorset = "\registerparameter\c!pageseparatorset", conversionset = "\registerparameter\c!pageconversionset", + starter = \!!bs\registerparameter\c!pagestarter\!!es, stopper = \!!bs\registerparameter\c!pagestopper\!!es, segments = "\registerparameter\c!pagesegments", } diff --git a/tex/context/base/strc-sec.mkiv b/tex/context/base/strc-sec.mkiv index d2e43138c..5ec9e071a 100644 --- a/tex/context/base/strc-sec.mkiv +++ b/tex/context/base/strc-sec.mkiv @@ -41,12 +41,14 @@ % lua interface / names and interface might change -\def\setstructurelevel #1#2{\ctxlua{structure.sections.setlevel("#1","#2")}} % name, level|parent -\def\getstructurelevel #1{\ctxlua{structure.sections.getcurrentlevel("#1")}}% name -\def\setstructurenumber #1#2{\ctxlua{structure.sections.setnumber(#1,"#2")}} % level, number (+/-) -\def\getstructurenumber #1{\ctxlua{structure.sections.getnumber(#1)}} % level -\def\getfullstructurenumber #1{\ctxlua{structure.sections.fullnumber(#1)}} % level -\def\getspecificstructuretitle#1{\ctxlua{structure.sections.structuredata(#1,"titledata.title",nil,"\structureheadparameter\s!catcodes")}}% +\def\setstructurelevel #1#2{\ctxlua{structure.sections.setlevel("#1","#2")}} % name, level|parent +\def\getstructurelevel #1{\ctxlua{structure.sections.getcurrentlevel("#1")}}% name +\def\setstructurenumber #1#2{\ctxlua{structure.sections.setnumber(#1,"#2")}} % level, number (+/-) +\def\getstructurenumber #1{\ctxlua{structure.sections.getnumber(#1)}} % level +\def\getsomestructurenumber #1#2{\ctxlua{structure.sections.getnumber(#1,"#2")}} % level, what +\def\getfullstructurenumber #1{\ctxlua{structure.sections.fullnumber(#1)}} % level +\def\getsomefullstructurenumber#1#2{\ctxlua{structure.sections.fullnumber(#1,"#2")}} +\def\getspecificstructuretitle #1{\ctxlua{structure.sections.structuredata(#1,"titledata.title",nil,"\structureheadparameter\s!catcodes")}}% % interface @@ -380,6 +382,7 @@ \c!sectionseparatorset=\structureheadparameter\c!sectionseparatorset, \c!sectionconversionset=\structureheadparameter\c!sectionconversionset, \c!sectionconversion=\structureheadparameter\c!conversion, % just for compatibility + \c!sectionstarter=\structureheadparameter\c!sectionstarter, \c!sectionstopper=\structureheadparameter\c!sectionstopper, \c!sectionset=\structureheadparameter\c!sectionset, \c!sectionsegments=\structureheadparameter\c!sectionsegments, @@ -698,19 +701,40 @@ \def\currentstructureheadnumber{0} % ==> \currentheadnumber -\def\determineheadnumber[#1]% +\unexpanded\def\determineheadnumber[#1]% {\xdef\currentstructureheadnumber{\getstructurenumber{\thenamedstructureheadlevel{#1}}}} % The previous macro is been replaced by the expandable: -\def\namedheadnumber#1{\getstructurenumber{\thenamedstructureheadlevel{#1}}} +\def\namedheadnumber #1{\getstructurenumber {\thenamedstructureheadlevel{#1}}} +\def\somenamedheadnumber#1#2{\getsomestructurenumber{\thenamedstructureheadlevel{#1}}{#2}} -\def\structureheadnumber - {\dosingleempty\dostructureheadnumber} +\unexpanded\def\structureheadnumber + {\dodoubleempty\dostructureheadnumber} -\def\dostructureheadnumber[#1]% simple case is just a number -% {\getfullstructurenumber{\iffirstargument\thecurrentstructureheadlevel{#1}\fi}} - {\getfullstructurenumber{\iffirstargument\thenamedstructureheadlevel{#1}\fi}} +% \def\dostructureheadnumber[#1][#2]% simple case is just a number +% {\iffirstargument +% \ifsecondargument +% \getsomefullstructurenumber{\thenamedstructureheadlevel{#1}}{#2}% +% \else +% \getfullstructurenumber{\thenamedstructureheadlevel{#1}}% +% \fi +% \else +% \getfullstructurenumber{\thenamedstructureheadlevel{#1}} +% \fi} + +\def\dostructureheadnumber[#1][#2]% simple case is just a number + {\getsomefullstructurenumber{\iffirstargument\thenamedstructureheadlevel{#1}\fi}{#2}} + +\def\somestructureheadnumber + {\dodoubleempty\dosomestructureheadnumber} + +\def\dosomestructureheadnumber[#1][#2]% + {\dontleavehmode + \begingroup + \edef\currentstructurehead{#1}% + \getsomefullstructurenumber{\thenamedstructureheadlevel{#1}}{#2}% + \endgroup} % compatibility code (after all, we might offer different structure handlers as well % but we might as well remove the 'structure' substring at some point (we needed it diff --git a/tex/context/base/syst-ini.tex b/tex/context/base/syst-ini.tex index 6d88d6b75..7c9d72127 100644 --- a/tex/context/base/syst-ini.tex +++ b/tex/context/base/syst-ini.tex @@ -311,7 +311,7 @@ \newdimen\onepoint \onepoint = 1pt \newdimen\maxdimen \maxdimen = 16383.99999pt \newdimen\onebasepoint \onebasepoint = 1bp -\chardef \scaledpoint = 1 +\newdimen\scaledpoint \scaledpoint = 1sp \newdimen\thousandpoint\thousandpoint= 1000pt \let\points\onepoint diff --git a/tex/context/base/task-ini.lua b/tex/context/base/task-ini.lua index 4737db9b5..f28a28df9 100644 --- a/tex/context/base/task-ini.lua +++ b/tex/context/base/task-ini.lua @@ -16,6 +16,7 @@ tasks.appendaction("processors", "normalizers", "fonts.checkers.missing") tasks.appendaction("processors", "characters", "chars.handle_mirroring") -- disabled tasks.appendaction("processors", "characters", "chars.handle_casing") -- disabled +tasks.appendaction("processors", "characters", "chars.handle_digits") -- disabled tasks.appendaction("processors", "characters", "chars.handle_breakpoints") -- disabled tasks.appendaction("processors", "characters", "scripts.preprocess") @@ -59,6 +60,7 @@ tasks.appendaction("finalizers", "lists", "nodes.repackage_graphicvadjust" tasks.disableaction("processors", "fonts.checkers.missing") tasks.disableaction("processors", "chars.handle_breakpoints") tasks.disableaction("processors", "chars.handle_casing") +tasks.disableaction("processors", "chars.handle_digits") tasks.disableaction("processors", "chars.handle_mirroring") tasks.disableaction("processors", "languages.words.check") tasks.disableaction("processors", "lists.handle_spacing") diff --git a/tex/context/base/typo-dig.lua b/tex/context/base/typo-dig.lua new file mode 100644 index 000000000..2f326300d --- /dev/null +++ b/tex/context/base/typo-dig.lua @@ -0,0 +1,103 @@ +if not modules then modules = { } end modules ['typo-dig'] = { + version = 1.001, + comment = "companion to typo-dig.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local next, type = next, type +local format, insert = string.format, table.insert + +local trace_digits = false trackers.register("nodes.digits", function(v) trace_digits = v end) + +local has_attribute = node.has_attribute +local unset_attribute = node.unset_attribute +local set_attribute = node.set_attribute +local hpack_node = node.hpack +local traverse_id = node.traverse_id +local insert_before = node.insert_before +local insert_after = node.insert_after + +local glyph = node.id("glyph") +local kern = node.id("kern") + +local new_glue = nodes.glue + +local fontdata = fonts.ids +local chardata = characters.data + +digits = digits or { } +digits.actions = { } +digits.attribute = attributes.private("digits") + +local actions = digits.actions + +-- at some point we can manipulate the glyph node so then i need +-- to rewrite this + +function nodes.aligned(start,stop,width,how) + local prv, nxt, head = start.prev, stop.next, nil + start.prev, stop.next = nil, nil + if how == "flushright" or how == "middle" then + head, start = insert_before(start,start,new_glue(0,65536,65536)) + end + if how == "flushleft" or how == "middle" then + head, stop = insert_after(start,stop,new_glue(0,65536,65536)) + end + local packed = hpack_node(start,width,"exactly") -- no directional mess here, just lr + if prv then + prv.next, packed.prev = packed, prv + end + if nxt then + nxt.prev, packed.next = packed, nxt + end + return packed, prv, nxt +end + +actions[1] = function(start,attribute) + local char = start.char + if chardata[char].category == "nd" then + local fdf = fontdata[start.font] + local oldwidth, newwidth = fdf.characters[char].width, fdf.parameters.quad/2 + if newwidth ~= oldwidth then + local start = nodes.aligned(start,start,newwidth,"middle") -- return three node pointers + return start, true + end + end + return start, false +end + +function digits.process(namespace,attribute,head) + local done, current, ok = false, head, false + while current do + if current.id == glyph then + local attr = has_attribute(current,attribute) + if attr and attr > 0 then + unset_attribute(current,attribute) + local action = actions[attr] + if action then + if current == head then + head, ok = action(current,attribute) + current = head + else + current, ok = action(current,attribute) + end + done = done and ok + end + end + end + current = current and current.next + end + return head, done +end + +chars.handle_digits = nodes.install_attribute_handler { + name = "digits", + namespace = digits, + processor = digits.process, +} + +function digits.enable() + tasks.enableaction("processors","chars.handle_digits") +end diff --git a/tex/context/base/typo-dig.mkiv b/tex/context/base/typo-dig.mkiv new file mode 100644 index 000000000..59de87cd3 --- /dev/null +++ b/tex/context/base/typo-dig.mkiv @@ -0,0 +1,50 @@ +%D \module +%D [ file=typo-dig, +%D version=2010.01.18, +%D title=\CONTEXT\ Typesetting Macros, +%D subtitle=Digits, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=\PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Typesetting Macros / Digits} + +\unprotect + +\registerctxluafile{typo-dig}{1.001} + +\definesystemattribute[digits] \chardef\digitsattribute \dogetattributeid{digits} + +%D This could as well be a dynamic font feature but why bother. +%D +%D \macros +%D {\equaldigits} +%D +%D \starttyping +%D test test \ruledhbox{123} test test\par +%D test test \ruledhbox{\equaldigits{123}} test test\par +%D test test \equaldigits{123} test test\par +%D \stoptyping +%D +%D \typebuffer +%D +%D This calls result in: +%D +%D \startvoorbeeld +%D \startlines +%D \getbuffer +%D \stoplines +%D \stopvoorbeeld + +\unexpanded\def\setdigitsmanipulation + {\ctxlua{digits.enable()}% + \gdef\setdigitsmanipulation[##1]{\attribute\digitsattribute##1\relax}% + \setdigitsmanipulation} + +\unexpanded\def\equaldigits{\groupedcommand{\setdigitsmanipulation[\plusone]}{}} + +\protect \endinput diff --git a/tex/context/interface/keys-cs.xml b/tex/context/interface/keys-cs.xml index 983aff19f..14de92929 100644 --- a/tex/context/interface/keys-cs.xml +++ b/tex/context/interface/keys-cs.xml @@ -426,6 +426,7 @@ + @@ -787,6 +788,7 @@ + @@ -819,10 +821,12 @@ + + @@ -840,6 +844,7 @@ + @@ -898,6 +903,7 @@ + @@ -925,6 +931,7 @@ + diff --git a/tex/context/interface/keys-de.xml b/tex/context/interface/keys-de.xml index b4047a7b9..da7b5252b 100644 --- a/tex/context/interface/keys-de.xml +++ b/tex/context/interface/keys-de.xml @@ -426,6 +426,7 @@ + @@ -787,6 +788,7 @@ + @@ -819,10 +821,12 @@ + + @@ -840,6 +844,7 @@ + @@ -898,6 +903,7 @@ + @@ -925,6 +931,7 @@ + diff --git a/tex/context/interface/keys-en.xml b/tex/context/interface/keys-en.xml index e6495fef8..cbb2a9ae6 100644 --- a/tex/context/interface/keys-en.xml +++ b/tex/context/interface/keys-en.xml @@ -426,6 +426,7 @@ + @@ -787,6 +788,7 @@ + @@ -819,10 +821,12 @@ + + @@ -840,6 +844,7 @@ + @@ -898,6 +903,7 @@ + @@ -925,6 +931,7 @@ + diff --git a/tex/context/interface/keys-fr.xml b/tex/context/interface/keys-fr.xml index 351d674f4..7a480438f 100644 --- a/tex/context/interface/keys-fr.xml +++ b/tex/context/interface/keys-fr.xml @@ -426,6 +426,7 @@ + @@ -787,6 +788,7 @@ + @@ -819,10 +821,12 @@ + + @@ -840,6 +844,7 @@ + @@ -898,6 +903,7 @@ + @@ -925,6 +931,7 @@ + diff --git a/tex/context/interface/keys-it.xml b/tex/context/interface/keys-it.xml index e7766a5d5..b9cb2aa0a 100644 --- a/tex/context/interface/keys-it.xml +++ b/tex/context/interface/keys-it.xml @@ -426,6 +426,7 @@ + @@ -787,6 +788,7 @@ + @@ -819,10 +821,12 @@ + + @@ -840,6 +844,7 @@ + @@ -898,6 +903,7 @@ + @@ -925,6 +931,7 @@ + diff --git a/tex/context/interface/keys-nl.xml b/tex/context/interface/keys-nl.xml index 57d02af27..c67b4a284 100644 --- a/tex/context/interface/keys-nl.xml +++ b/tex/context/interface/keys-nl.xml @@ -426,6 +426,7 @@ + @@ -787,6 +788,7 @@ + @@ -819,10 +821,12 @@ + + @@ -840,6 +844,7 @@ + @@ -898,6 +903,7 @@ + @@ -925,6 +931,7 @@ + diff --git a/tex/context/interface/keys-pe.xml b/tex/context/interface/keys-pe.xml index 308798af0..8f76c8ffc 100644 --- a/tex/context/interface/keys-pe.xml +++ b/tex/context/interface/keys-pe.xml @@ -426,6 +426,7 @@ + @@ -787,6 +788,7 @@ + @@ -819,10 +821,12 @@ + + @@ -840,6 +844,7 @@ + @@ -898,6 +903,7 @@ + @@ -925,6 +931,7 @@ + diff --git a/tex/context/interface/keys-ro.xml b/tex/context/interface/keys-ro.xml index 2f145b4ea..b72fd8dde 100644 --- a/tex/context/interface/keys-ro.xml +++ b/tex/context/interface/keys-ro.xml @@ -426,6 +426,7 @@ + @@ -787,6 +788,7 @@ + @@ -819,10 +821,12 @@ + + @@ -840,6 +844,7 @@ + @@ -898,6 +903,7 @@ + @@ -925,6 +931,7 @@ + diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua index 01927ba5a..2bea64449 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 : 01/15/10 15:53:50 +-- merge date : 01/18/10 22:47:16 do -- begin closure to overcome local limits and interference -- cgit v1.2.3