diff options
author | Karl Berry <karl@freefriends.org> | 2015-05-08 22:36:52 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-05-08 22:36:52 +0000 |
commit | 5dc3418fd91c83782dce77f0b65549e14f118f51 (patch) | |
tree | 9b4ec94c1bb0be9831fd3b887de69df098d46211 /Master/texmf-dist/tex/context | |
parent | b810c0301dd20283addb956384210b7926eef35d (diff) |
context
git-svn-id: svn://tug.org/texlive/trunk@37284 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context')
97 files changed, 3076 insertions, 1619 deletions
diff --git a/Master/texmf-dist/tex/context/base/attr-col.lua b/Master/texmf-dist/tex/context/base/attr-col.lua index 28eda5ca91f..b5fac9c2d1b 100644 --- a/Master/texmf-dist/tex/context/base/attr-col.lua +++ b/Master/texmf-dist/tex/context/base/attr-col.lua @@ -127,15 +127,25 @@ local models = { } local function rgbtocmyk(r,g,b) -- we could reduce - return 1-r, 1-g, 1-b, 0 + if not r then + return 0, 0, 0 + else + return 1-r, 1-g, 1-b, 0 + end end local function cmyktorgb(c,m,y,k) - return 1.0 - min(1.0,c+k), 1.0 - min(1.0,m+k), 1.0 - min(1.0,y+k) + if not c then + return 0, 0, 0, 1 + else + return 1.0 - min(1.0,c+k), 1.0 - min(1.0,m+k), 1.0 - min(1.0,y+k) + end end local function rgbtogray(r,g,b) - if colors.weightgray then + if not r then + return 0 + elseif colors.weightgray then return .30*r + .59*g + .11*b else return r/3 + g/3 + b/3 diff --git a/Master/texmf-dist/tex/context/base/back-exp.lua b/Master/texmf-dist/tex/context/base/back-exp.lua index a4127e6be67..9e127cb095c 100644 --- a/Master/texmf-dist/tex/context/base/back-exp.lua +++ b/Master/texmf-dist/tex/context/base/back-exp.lua @@ -68,10 +68,6 @@ local attributes = attributes local variables = interfaces.variables local v_yes = variables.yes local v_no = variables.no -local v_normal = variables.normal -local v_flushright = variables.flushright -local v_middle = variables.middle -local v_flushleft = variables.flushleft local implement = interfaces.implement @@ -153,6 +149,11 @@ local overloads = fonts.mappings.overloads local exportversion = "0.34" local mathmlns = "http://www.w3.org/1998/Math/MathML" local contextns = "http://www.contextgarden.net/context/export" -- whatever suits +local cssnamespaceurl = "@namespace context url('%namespace%') ;" +local cssnamespace = "context|" +----- cssnamespacenop = "/* no namespace */" + +local usecssnamespace = false local nofcurrentcontent = 0 -- so we don't free (less garbage collection) local currentcontent = { } @@ -201,13 +202,11 @@ local p_attribute = lpeg.replacer(attribentities) local p_stripper = lpeg.patterns.stripper local p_escaped = lpeg.patterns.xml.escaped -local f_id = formatters["%s-%s"] - -local alignmapping = { - flushright = "right", - middle = "center", - flushleft = "left", -} +-- local alignmapping = { +-- flushright = "right", +-- middle = "center", +-- flushleft = "left", +-- } local defaultnature = "mixed" -- "inline" @@ -329,7 +328,7 @@ local usedstyles = { } local namespacetemplate = [[ /* %what% for file %filename% */ -@namespace context url('%namespace%') ; +%cssnamespaceurl% ]] do @@ -340,9 +339,10 @@ do -- /* padding : ; */ -- /* text-justify : inter-word ; */ + -- /* text-align : justify ; */ local documenttemplate = [[ -document { +document, %namespace%div.document { font-size : %size% !important ; max-width : %width% !important ; text-width : %align% !important ; @@ -351,7 +351,7 @@ document { ]] local styletemplate = [[ -%element%[detail="%detail%"], context|div.%element%.%detail% { +%element%[detail="%detail%"], %namespace%div.%element%.%detail% { display : inline ; font-style : %style% ; font-variant : %variant% ; @@ -361,17 +361,19 @@ local styletemplate = [[ }]] local numbertoallign = { - [0] = "justify", ["0"] = "justify", [v_normal ] = "justify", - [1] = "right", ["1"] = "right", [v_flushright] = "right", - [2] = "center", ["2"] = "center", [v_middle ] = "center", - [3] = "left", ["3"] = "left", [v_flushleft ] = "left", + [0] = "justify", ["0"] = "justify", [variables.normal ] = "justify", + [1] = "right", ["1"] = "right", [variables.flushright] = "right", + [2] = "center", ["2"] = "center", [variables.middle ] = "center", + [3] = "left", ["3"] = "left", [variables.flushleft ] = "left", } function wrapups.allusedstyles(basename) local result = { replacetemplate(namespacetemplate, { - what = "styles", - filename = basename, - namespace = contextns, + what = "styles", + filename = basename, + namespace = contextns, + -- cssnamespaceurl = usecssnamespace and cssnamespaceurl or cssnamespacenop, + cssnamespaceurl = cssnamespaceurl, }) } -- local bodyfont = finetuning.bodyfont @@ -398,7 +400,7 @@ local styletemplate = [[ align = numbertoallign[align] end if not align then - align = hyphens and "justify" or "inherited" + align = hyphen and "justify" or "inherited" end -- result[#result+1] = replacetemplate(documenttemplate,{ @@ -416,13 +418,14 @@ local styletemplate = [[ local c = colorspecification(data.color) detail = gsub(detail,"[^A-Za-z0-9]+","-") result[#result+1] = replacetemplate(styletemplate,{ - element = element, - detail = detail, - style = s.style or "inherit", - variant = s.variant or "inherit", - weight = s.weight or "inherit", - family = s.family or "inherit", - color = c or "inherit", + namespace = usecssnamespace and cssnamespace or "", + element = element, + detail = detail, + style = s.style or "inherit", + variant = s.variant or "inherit", + weight = s.weight or "inherit", + family = s.family or "inherit", + color = c or "inherit", }) end end @@ -436,7 +439,7 @@ local usedimages = { } do local imagetemplate = [[ -%element%[id="%id%"], context|div.%element%[id="%id%"] { +%element%[id="%id%"], %namespace%div.%element%[id="%id%"] { display : block ; background-image : url('%url%') ; background-size : 100%% auto ; @@ -469,23 +472,26 @@ local imagetemplate = [[ function wrapups.allusedimages(basename) local result = { replacetemplate(namespacetemplate, { - what = "images", - filename = basename, - namespace = contextns, + what = "images", + filename = basename, + namespace = contextns, + -- cssnamespaceurl = usecssnamespace and cssnamespaceurl or "", + cssnamespaceurl = cssnamespaceurl, }) } for element, details in sortedhash(usedimages) do for detail, data in sortedhash(details) do local name = data.name local page = tonumber(data.page) or 1 local spec = { - element = element, - id = data.id, - name = name, - page = page, - url = usedname(name,page), - width = data.width, - height = data.height, - used = data.used, + element = element, + id = data.id, + name = name, + page = page, + url = usedname(name,page), + width = data.width, + height = data.height, + used = data.used, + namespace = usecssnamespace and cssnamespace or "", } result[#result+1] = replacetemplate(imagetemplate,spec) collected[detail] = spec @@ -765,6 +771,8 @@ do local image = { } usedimages.image = image + local f_id = formatters["%s-%s"] + function structurestags.setfigure(name,used,page,width,height) local fulltag = locatedtag("image") local spec = specifications[fulltag] @@ -2836,6 +2844,7 @@ local xmlpreamble = [[ exporter version : %exportversion% --> + ]] local flushtree = wrapups.flushtree @@ -2884,14 +2893,14 @@ local cssheadlink = [[ local elementtemplate = [[ /* element="%element%" detail="%detail%" chain="%chain%" */ -%element%, context|div.%element% { +%element%, %namespace%div.%element% { display: %display% ; }]] local detailtemplate = [[ /* element="%element%" detail="%detail%" chain="%chain%" */ -%element%[detail=%detail%], context|div.%element%.%detail% { +%element%[detail=%detail%], %namespace%div.%element%.%detail% { display: %display% ; }]] @@ -2931,9 +2940,11 @@ local htmltemplate = [[ local function allusedelements(basename) local result = { replacetemplate(namespacetemplate, { - what = "template", - filename = basename, - namespace = contextns, + what = "template", + filename = basename, + namespace = contextns, + -- cssnamespaceurl = usecssnamespace and cssnamespaceurl or "", + cssnamespaceurl = cssnamespaceurl, }) } for element, details in sortedhash(used) do if namespaces[element] then @@ -2945,16 +2956,18 @@ local htmltemplate = [[ local display = displaymapping[nature] or "block" if detail == "" then result[#result+1] = replacetemplate(elementtemplate, { - element = element, - display = display, - chain = chain, + element = element, + display = display, + chain = chain, + namespace = usecssnamespace and namespace or "", }) else result[#result+1] = replacetemplate(detailtemplate, { - element = element, - display = display, - detail = detail, - chain = chain, + element = element, + display = display, + detail = detail, + chain = chain, + namespace = usecssnamespace and cssnamespace or "", }) end end @@ -3306,7 +3319,13 @@ local htmltemplate = [[ local examplefilename = resolvers.find_file("export-example.css") if examplefilename then - file.copy(examplefilename,defaultfilename) + local data = io.loaddata(examplefilename) + if not data or data == "" then + data = "/* missing css file */" + elseif not usecssnamespace then + data = gsub(data,cssnamespace,"") + end + io.savedata(defaultfilename,data) end if cssfile then @@ -3332,6 +3351,14 @@ local htmltemplate = [[ -- representation that uses verbose element names and carries information in -- attributes + + local data = tree.data + for i=1,#data do + if data[i].tg ~= "document" then + data[i] = { } + end + end + local result = allcontent(tree) local results = concat { @@ -3402,11 +3429,17 @@ local htmltemplate = [[ remap(specification,xmltree) + local title = specification.title + + if not title or title == "" then + title = "no title" -- believe it or not, but a <title/> can prevent viewing in browsers + end + local variables = { style = h_styles, body = xml.tostring(xml.first(xmltree,"/div")), preamble = wholepreamble(false), - title = specification.title, + title = title, } io.savedata(htmlfilename,replacetemplate(htmltemplate,variables,"xml")) diff --git a/Master/texmf-dist/tex/context/base/buff-ini.lua b/Master/texmf-dist/tex/context/base/buff-ini.lua index 1ad3c905ade..dafe2ad0e75 100644 --- a/Master/texmf-dist/tex/context/base/buff-ini.lua +++ b/Master/texmf-dist/tex/context/base/buff-ini.lua @@ -9,7 +9,7 @@ if not modules then modules = { } end modules ['buff-ini'] = { local concat = table.concat local type, next, load = type, next, load local sub, format = string.sub, string.format -local splitlines, validstring = string.splitlines, string.valid +local splitlines, validstring, replacenewlines = string.splitlines, string.valid, string.replacenewlines local P, Cs, patterns, lpegmatch = lpeg.P, lpeg.Cs, lpeg.patterns, lpeg.match local utfchar = utf.char local totable = string.totable @@ -157,12 +157,14 @@ local function collectcontent(name,separator) -- no print t[n] = c end end - return concat(t,separator or "\n") -- was \r + -- the default separator was \r, then \n and is now os.newline because buffers + -- can be loaded in other applications + return concat(t,separator or os.newline) end end local function loadcontent(name) -- no print - local content = collectcontent(name,"\n") + local content = collectcontent(name,"\n") -- tex likes \n local ok, err = load(content) if ok then return ok() @@ -454,7 +456,7 @@ local function savebuffer(list,name,prefix) -- name is optional if prefix == v_yes then name = addsuffix(tex.jobname .. "-" .. name,"tmp") end - io.savedata(name,content) + io.savedata(name,replacenewlines(content)) end implement { diff --git a/Master/texmf-dist/tex/context/base/buff-ini.mkiv b/Master/texmf-dist/tex/context/base/buff-ini.mkiv index 24bb729e1a4..c1068008546 100644 --- a/Master/texmf-dist/tex/context/base/buff-ini.mkiv +++ b/Master/texmf-dist/tex/context/base/buff-ini.mkiv @@ -197,6 +197,9 @@ \unexpanded\def\buff_get_stored_inline_indeed#1% {\ignorespaces\clf_getbuffer{#1}\removeunwantedspaces} +\def\rawbuffer#1% expandable + {\clf_getbuffer{#1}} + \definebuffer [\v!hiding] diff --git a/Master/texmf-dist/tex/context/base/char-cjk.lua b/Master/texmf-dist/tex/context/base/char-cjk.lua index 3d7de142333..30f61889620 100644 --- a/Master/texmf-dist/tex/context/base/char-cjk.lua +++ b/Master/texmf-dist/tex/context/base/char-cjk.lua @@ -9,7 +9,7 @@ if not modules then modules = { } end modules ['char-cjk'] = { local setmetatable = setmetatable local insert = table.insert local floor = math.floor -local format = string.format +local formatters = string.formatters local utfchar = utf.char local ranges = characters.ranges @@ -85,8 +85,7 @@ local tail_consonants = { [0] = -- local lead_consonant = floor( index / NCount) -- local medial_vowel = floor((index % NCount) / TCount) -- local tail_consonant = index % TCount --- return format( --- "HANGUL SYLLABLE %s%s%s", +-- return formatters["HANGUL SYLLABLE %s%s%s"]( -- lead_consonants[lead_consonant], -- medial_vowels [medial_vowel ], -- tail_consonants[tail_consonant] @@ -100,8 +99,7 @@ local function description(unicode) local lead_consonant = floor( index / (21 * 28)) local medial_vowel = floor((index % (21 * 28)) / 28) local tail_consonant = index % 28 - return format( - "HANGUL SYLLABLE %s%s%s", + return formatters["HANGUL SYLLABLE %s%s%s"]( lead_consonants[lead_consonant], medial_vowels [medial_vowel ], tail_consonants[tail_consonant] @@ -363,3 +361,5 @@ insert(ranges, hangul_syllable_range) insert(ranges, cjk_ideograph_range) insert(ranges, cjk_ideograph_extension_a_range) insert(ranges, cjk_ideograph_extension_b_range) + +-- Japanese diff --git a/Master/texmf-dist/tex/context/base/char-def.lua b/Master/texmf-dist/tex/context/base/char-def.lua index f6986e76d66..90ac4609d2c 100644 --- a/Master/texmf-dist/tex/context/base/char-def.lua +++ b/Master/texmf-dist/tex/context/base/char-def.lua @@ -2399,8 +2399,8 @@ characters.data={ description="LATIN SMALL LETTER SHARP S", direction="l", linebreak="al", - uccode={ 0x53, 0x53 }, shcode={ 0x73, 0x73 }, + uccode={ 0x53, 0x53 }, unicodeslot=0xDF, }, { @@ -66888,9 +66888,9 @@ characters.data={ direction="on", linebreak="al", mathclass="topaccent", - mathname="overbracket", mathextensible="h", mathfiller="overbracketfill", + mathname="overbracket", unicodeslot=0x23B4, }, [0x23B5]={ @@ -66899,9 +66899,9 @@ characters.data={ direction="on", linebreak="al", mathclass="botaccent", - mathname="underbracket", mathextensible="h", mathfiller="underbracketfill", + mathname="underbracket", unicodeslot=0x23B5, }, [0x23B6]={ @@ -67176,9 +67176,9 @@ characters.data={ direction="on", linebreak="al", mathclass="topaccent", - mathname="overparent", mathextensible="h", mathfiller="overparentfill", + mathname="overparent", unicodeslot=0x23DC, }, [0x23DD]={ @@ -67187,9 +67187,9 @@ characters.data={ direction="on", linebreak="al", mathclass="botaccent", - mathname="underparent", mathextensible="h", mathfiller="underparentfill", + mathname="underparent", unicodeslot=0x23DD, }, [0x23DE]={ @@ -67198,9 +67198,9 @@ characters.data={ direction="on", linebreak="al", mathclass="topaccent", - mathname="overbrace", mathextensible="h", mathfiller="overbracefill", + mathname="overbrace", unicodeslot=0x23DE, }, [0x23DF]={ @@ -67209,9 +67209,9 @@ characters.data={ direction="on", linebreak="al", mathclass="botaccent", - mathname="underbrace", mathextensible="h", mathfiller="underbracefill", + mathname="underbrace", unicodeslot=0x23DF, }, [0x23E0]={ @@ -90281,8 +90281,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER SMALL A", + detail="sl", direction="l", linebreak="cj", + shcode=0x3042, + sound="unvoiced", unicodeslot=0x3041, }, [0x3042]={ @@ -90290,8 +90293,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER A", + detail="bl", direction="l", linebreak="id", + shcode=0x3042, + sound="unvoiced", unicodeslot=0x3042, }, [0x3043]={ @@ -90299,8 +90305,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER SMALL I", + detail="sl", direction="l", linebreak="cj", + shcode=0x3044, + sound="unvoiced", unicodeslot=0x3043, }, [0x3044]={ @@ -90308,8 +90317,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER I", + detail="bl", direction="l", linebreak="id", + shcode=0x3044, + sound="unvoiced", unicodeslot=0x3044, }, [0x3045]={ @@ -90317,8 +90329,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER SMALL U", + detail="sl", direction="l", linebreak="cj", + shcode=0x3046, + sound="unvoiced", unicodeslot=0x3045, }, [0x3046]={ @@ -90326,8 +90341,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER U", + detail="bl", direction="l", linebreak="id", + shcode=0x3046, + sound="unvoiced", unicodeslot=0x3046, }, [0x3047]={ @@ -90335,8 +90353,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER SMALL E", + detail="sl", direction="l", linebreak="cj", + shcode=0x3048, + sound="unvoiced", unicodeslot=0x3047, }, [0x3048]={ @@ -90344,8 +90365,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER E", + detail="bl", direction="l", linebreak="id", + shcode=0x3048, + sound="unvoiced", unicodeslot=0x3048, }, [0x3049]={ @@ -90353,8 +90377,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER SMALL O", + detail="sl", direction="l", linebreak="cj", + shcode=0x304A, + sound="unvoiced", unicodeslot=0x3049, }, [0x304A]={ @@ -90362,8 +90389,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER O", + detail="bl", direction="l", linebreak="id", + shcode=0x304A, + sound="unvoiced", unicodeslot=0x304A, }, [0x304B]={ @@ -90371,8 +90401,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER KA", + detail="bl", direction="l", linebreak="id", + shcode=0x304B, + sound="unvoiced", unicodeslot=0x304B, }, [0x304C]={ @@ -90380,8 +90413,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER GA", + detail="bl", direction="l", linebreak="id", + shcode=0x304B, + sound="voiced", specials={ "char", 0x304B, 0x3099 }, unicodeslot=0x304C, }, @@ -90390,8 +90426,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER KI", + detail="bl", direction="l", linebreak="id", + shcode=0x304D, + sound="unvoiced", unicodeslot=0x304D, }, [0x304E]={ @@ -90399,8 +90438,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER GI", + detail="bl", direction="l", linebreak="id", + shcode=0x304D, + sound="voiced", specials={ "char", 0x304D, 0x3099 }, unicodeslot=0x304E, }, @@ -90409,8 +90451,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER KU", + detail="bl", direction="l", linebreak="id", + shcode=0x304F, + sound="unvoiced", unicodeslot=0x304F, }, [0x3050]={ @@ -90418,8 +90463,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER GU", + detail="bl", direction="l", linebreak="id", + shcode=0x304F, + sound="voiced", specials={ "char", 0x304F, 0x3099 }, unicodeslot=0x3050, }, @@ -90428,8 +90476,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER KE", + detail="bl", direction="l", linebreak="id", + shcode=0x3051, + sound="unvoiced", unicodeslot=0x3051, }, [0x3052]={ @@ -90437,8 +90488,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER GE", + detail="bl", direction="l", linebreak="id", + shcode=0x3051, + sound="voiced", specials={ "char", 0x3051, 0x3099 }, unicodeslot=0x3052, }, @@ -90447,8 +90501,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER KO", + detail="bl", direction="l", linebreak="id", + shcode=0x3053, + sound="unvoiced", unicodeslot=0x3053, }, [0x3054]={ @@ -90456,8 +90513,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER GO", + detail="bl", direction="l", linebreak="id", + shcode=0x3053, + sound="voiced", specials={ "char", 0x3053, 0x3099 }, unicodeslot=0x3054, }, @@ -90466,8 +90526,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER SA", + detail="bl", direction="l", linebreak="id", + shcode=0x3055, + sound="unvoiced", unicodeslot=0x3055, }, [0x3056]={ @@ -90475,8 +90538,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER ZA", + detail="bl", direction="l", linebreak="id", + shcode=0x3055, + sound="voiced", specials={ "char", 0x3055, 0x3099 }, unicodeslot=0x3056, }, @@ -90485,8 +90551,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER SI", + detail="bl", direction="l", linebreak="id", + shcode=0x3057, + sound="unvoiced", unicodeslot=0x3057, }, [0x3058]={ @@ -90494,8 +90563,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER ZI", + detail="bl", direction="l", linebreak="id", + shcode=0x3057, + sound="voiced", specials={ "char", 0x3057, 0x3099 }, unicodeslot=0x3058, }, @@ -90504,8 +90576,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER SU", + detail="bl", direction="l", linebreak="id", + shcode=0x3059, + sound="unvoiced", unicodeslot=0x3059, }, [0x305A]={ @@ -90513,8 +90588,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER ZU", + detail="bl", direction="l", linebreak="id", + shcode=0x3059, + sound="voiced", specials={ "char", 0x3059, 0x3099 }, unicodeslot=0x305A, }, @@ -90523,8 +90601,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER SE", + detail="bl", direction="l", linebreak="id", + shcode=0x305B, + sound="unvoiced", unicodeslot=0x305B, }, [0x305C]={ @@ -90532,8 +90613,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER ZE", + detail="bl", direction="l", linebreak="id", + shcode=0x305B, + sound="voiced", specials={ "char", 0x305B, 0x3099 }, unicodeslot=0x305C, }, @@ -90542,8 +90626,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER SO", + detail="bl", direction="l", linebreak="id", + shcode=0x305D, + sound="unvoiced", unicodeslot=0x305D, }, [0x305E]={ @@ -90551,8 +90638,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER ZO", + detail="bl", direction="l", linebreak="id", + shcode=0x305D, + sound="voiced", specials={ "char", 0x305D, 0x3099 }, unicodeslot=0x305E, }, @@ -90561,8 +90651,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER TA", + detail="bl", direction="l", linebreak="id", + shcode=0x305F, + sound="unvoiced", unicodeslot=0x305F, }, [0x3060]={ @@ -90570,8 +90663,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER DA", + detail="bl", direction="l", linebreak="id", + shcode=0x305F, + sound="voiced", specials={ "char", 0x305F, 0x3099 }, unicodeslot=0x3060, }, @@ -90580,8 +90676,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER TI", + detail="bl", direction="l", linebreak="id", + shcode=0x3061, + sound="unvoiced", unicodeslot=0x3061, }, [0x3062]={ @@ -90589,8 +90688,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER DI", + detail="bl", direction="l", linebreak="id", + shcode=0x3061, + sound="voiced", specials={ "char", 0x3061, 0x3099 }, unicodeslot=0x3062, }, @@ -90599,8 +90701,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER SMALL TU", + detail="sl", direction="l", linebreak="cj", + shcode=0x3064, + sound="unvoiced", unicodeslot=0x3063, }, [0x3064]={ @@ -90608,8 +90713,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER TU", + detail="bl", direction="l", linebreak="id", + shcode=0x3064, + sound="unvoiced", unicodeslot=0x3064, }, [0x3065]={ @@ -90617,8 +90725,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER DU", + detail="bl", direction="l", linebreak="id", + shcode=0x3064, + sound="voiced", specials={ "char", 0x3064, 0x3099 }, unicodeslot=0x3065, }, @@ -90627,8 +90738,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER TE", + detail="bl", direction="l", linebreak="id", + shcode=0x3066, + sound="unvoiced", unicodeslot=0x3066, }, [0x3067]={ @@ -90636,8 +90750,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER DE", + detail="bl", direction="l", linebreak="id", + shcode=0x3066, + sound="voiced", specials={ "char", 0x3066, 0x3099 }, unicodeslot=0x3067, }, @@ -90646,8 +90763,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER TO", + detail="bl", direction="l", linebreak="id", + shcode=0x3068, + sound="unvoiced", unicodeslot=0x3068, }, [0x3069]={ @@ -90655,8 +90775,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER DO", + detail="bl", direction="l", linebreak="id", + shcode=0x3068, + sound="voiced", specials={ "char", 0x3068, 0x3099 }, unicodeslot=0x3069, }, @@ -90665,8 +90788,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER NA", + detail="bl", direction="l", linebreak="id", + shcode=0x306A, + sound="unvoiced", unicodeslot=0x306A, }, [0x306B]={ @@ -90674,8 +90800,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER NI", + detail="bl", direction="l", linebreak="id", + shcode=0x306B, + sound="unvoiced", unicodeslot=0x306B, }, [0x306C]={ @@ -90683,8 +90812,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER NU", + detail="bl", direction="l", linebreak="id", + shcode=0x306C, + sound="unvoiced", unicodeslot=0x306C, }, [0x306D]={ @@ -90692,8 +90824,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER NE", + detail="bl", direction="l", linebreak="id", + shcode=0x306D, + sound="unvoiced", unicodeslot=0x306D, }, [0x306E]={ @@ -90701,8 +90836,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER NO", + detail="bl", direction="l", linebreak="id", + shcode=0x306E, + sound="unvoiced", unicodeslot=0x306E, }, [0x306F]={ @@ -90710,8 +90848,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER HA", + detail="bl", direction="l", linebreak="id", + shcode=0x306F, + sound="unvoiced", unicodeslot=0x306F, }, [0x3070]={ @@ -90719,8 +90860,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER BA", + detail="bl", direction="l", linebreak="id", + shcode=0x306F, + sound="voiced", specials={ "char", 0x306F, 0x3099 }, unicodeslot=0x3070, }, @@ -90729,8 +90873,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER PA", + detail="bl", direction="l", linebreak="id", + shcode=0x306F, + sound="semivoiced", specials={ "char", 0x306F, 0x309A }, unicodeslot=0x3071, }, @@ -90739,8 +90886,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER HI", + detail="bl", direction="l", linebreak="id", + shcode=0x3072, + sound="unvoiced", unicodeslot=0x3072, }, [0x3073]={ @@ -90748,8 +90898,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER BI", + detail="bl", direction="l", linebreak="id", + shcode=0x3072, + sound="voiced", specials={ "char", 0x3072, 0x3099 }, unicodeslot=0x3073, }, @@ -90758,8 +90911,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER PI", + detail="bl", direction="l", linebreak="id", + shcode=0x3072, + sound="semivoiced", specials={ "char", 0x3072, 0x309A }, unicodeslot=0x3074, }, @@ -90768,8 +90924,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER HU", + detail="bl", direction="l", linebreak="id", + shcode=0x3075, + sound="unvoiced", unicodeslot=0x3075, }, [0x3076]={ @@ -90777,8 +90936,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER BU", + detail="bl", direction="l", linebreak="id", + shcode=0x3075, + sound="voiced", specials={ "char", 0x3075, 0x3099 }, unicodeslot=0x3076, }, @@ -90787,8 +90949,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER PU", + detail="bl", direction="l", linebreak="id", + shcode=0x3075, + sound="semivoiced", specials={ "char", 0x3075, 0x309A }, unicodeslot=0x3077, }, @@ -90797,8 +90962,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER HE", + detail="bl", direction="l", linebreak="id", + shcode=0x3078, + sound="unvoiced", unicodeslot=0x3078, }, [0x3079]={ @@ -90806,8 +90974,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER BE", + detail="bl", direction="l", linebreak="id", + shcode=0x3078, + sound="voiced", specials={ "char", 0x3078, 0x3099 }, unicodeslot=0x3079, }, @@ -90816,8 +90987,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER PE", + detail="bl", direction="l", linebreak="id", + shcode=0x3078, + sound="semivoiced", specials={ "char", 0x3078, 0x309A }, unicodeslot=0x307A, }, @@ -90826,8 +91000,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER HO", + detail="bl", direction="l", linebreak="id", + shcode=0x307B, + sound="unvoiced", unicodeslot=0x307B, }, [0x307C]={ @@ -90835,8 +91012,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER BO", + detail="bl", direction="l", linebreak="id", + shcode=0x307B, + sound="voiced", specials={ "char", 0x307B, 0x3099 }, unicodeslot=0x307C, }, @@ -90845,8 +91025,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER PO", + detail="bl", direction="l", linebreak="id", + shcode=0x307B, + sound="semivoiced", specials={ "char", 0x307B, 0x309A }, unicodeslot=0x307D, }, @@ -90855,8 +91038,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER MA", + detail="bl", direction="l", linebreak="id", + shcode=0x307E, + sound="unvoiced", unicodeslot=0x307E, }, [0x307F]={ @@ -90864,8 +91050,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER MI", + detail="bl", direction="l", linebreak="id", + shcode=0x307F, + sound="unvoiced", unicodeslot=0x307F, }, [0x3080]={ @@ -90873,8 +91062,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER MU", + detail="bl", direction="l", linebreak="id", + shcode=0x3080, + sound="unvoiced", unicodeslot=0x3080, }, [0x3081]={ @@ -90882,8 +91074,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER ME", + detail="bl", direction="l", linebreak="id", + shcode=0x3081, + sound="unvoiced", unicodeslot=0x3081, }, [0x3082]={ @@ -90891,8 +91086,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER MO", + detail="bl", direction="l", linebreak="id", + shcode=0x3082, + sound="unvoiced", unicodeslot=0x3082, }, [0x3083]={ @@ -90900,8 +91098,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER SMALL YA", + detail="sl", direction="l", linebreak="cj", + shcode=0x3084, + sound="unvoiced", unicodeslot=0x3083, }, [0x3084]={ @@ -90909,8 +91110,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER YA", + detail="bl", direction="l", linebreak="id", + shcode=0x3084, + sound="unvoiced", unicodeslot=0x3084, }, [0x3085]={ @@ -90918,8 +91122,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER SMALL YU", + detail="sl", direction="l", linebreak="cj", + shcode=0x3086, + sound="unvoiced", unicodeslot=0x3085, }, [0x3086]={ @@ -90927,8 +91134,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER YU", + detail="bl", direction="l", linebreak="id", + shcode=0x3086, + sound="unvoiced", unicodeslot=0x3086, }, [0x3087]={ @@ -90936,8 +91146,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER SMALL YO", + detail="sl", direction="l", linebreak="cj", + shcode=0x3088, + sound="unvoiced", unicodeslot=0x3087, }, [0x3088]={ @@ -90945,8 +91158,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER YO", + detail="bl", direction="l", linebreak="id", + shcode=0x3088, + sound="unvoiced", unicodeslot=0x3088, }, [0x3089]={ @@ -90954,8 +91170,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER RA", + detail="bl", direction="l", linebreak="id", + shcode=0x3089, + sound="unvoiced", unicodeslot=0x3089, }, [0x308A]={ @@ -90963,8 +91182,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER RI", + detail="bl", direction="l", linebreak="id", + shcode=0x308A, + sound="unvoiced", unicodeslot=0x308A, }, [0x308B]={ @@ -90972,8 +91194,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER RU", + detail="bl", direction="l", linebreak="id", + shcode=0x308B, + sound="unvoiced", unicodeslot=0x308B, }, [0x308C]={ @@ -90981,8 +91206,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER RE", + detail="bl", direction="l", linebreak="id", + shcode=0x308C, + sound="unvoiced", unicodeslot=0x308C, }, [0x308D]={ @@ -90990,8 +91218,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER RO", + detail="bl", direction="l", linebreak="id", + shcode=0x308D, + sound="unvoiced", unicodeslot=0x308D, }, [0x308E]={ @@ -90999,8 +91230,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER SMALL WA", + detail="sl", direction="l", linebreak="cj", + shcode=0x308F, + sound="unvoiced", unicodeslot=0x308E, }, [0x308F]={ @@ -91008,8 +91242,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER WA", + detail="bl", direction="l", linebreak="id", + shcode=0x308F, + sound="unvoiced", unicodeslot=0x308F, }, [0x3090]={ @@ -91017,8 +91254,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER WI", + detail="bl", direction="l", linebreak="id", + shcode=0x3090, + sound="unvoiced", unicodeslot=0x3090, }, [0x3091]={ @@ -91026,8 +91266,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER WE", + detail="bl", direction="l", linebreak="id", + shcode=0x3091, + sound="unvoiced", unicodeslot=0x3091, }, [0x3092]={ @@ -91035,8 +91278,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER WO", + detail="bl", direction="l", linebreak="id", + shcode=0x3092, + sound="unvoiced", unicodeslot=0x3092, }, [0x3093]={ @@ -91044,8 +91290,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER N", + detail="bl", direction="l", linebreak="id", + shcode=0x3093, + sound="unvoiced", unicodeslot=0x3093, }, [0x3094]={ @@ -91053,8 +91302,11 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER VU", + detail="bl", direction="l", linebreak="id", + shcode=0x3046, + sound="voiced", specials={ "char", 0x3046, 0x3099 }, unicodeslot=0x3094, }, @@ -91062,16 +91314,22 @@ characters.data={ category="lo", cjkwd="w", description="HIRAGANA LETTER SMALL KA", + detail="sl", direction="l", linebreak="cj", + shcode=0x304B, + sound="unvoiced", unicodeslot=0x3095, }, [0x3096]={ category="lo", cjkwd="w", description="HIRAGANA LETTER SMALL KE", + detail="sl", direction="l", linebreak="cj", + shcode=0x3051, + sound="unvoiced", unicodeslot=0x3096, }, [0x3099]={ @@ -91081,6 +91339,7 @@ characters.data={ description="COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK", direction="nsm", linebreak="cm", + sound="voiced", unicodeslot=0x3099, }, [0x309A]={ @@ -91090,6 +91349,7 @@ characters.data={ description="COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK", direction="nsm", linebreak="cm", + sound="semivoiced", unicodeslot=0x309A, }, [0x309B]={ @@ -91099,6 +91359,7 @@ characters.data={ description="KATAKANA-HIRAGANA VOICED SOUND MARK", direction="on", linebreak="ns", + sound="voiced", specials={ "compat", 0x20, 0x3099 }, unicodeslot=0x309B, }, @@ -91109,6 +91370,7 @@ characters.data={ description="KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK", direction="on", linebreak="ns", + sound="semivoiced", specials={ "compat", 0x20, 0x309A }, unicodeslot=0x309C, }, @@ -91117,8 +91379,11 @@ characters.data={ category="lm", cjkwd="w", description="HIRAGANA ITERATION MARK", + detail="im", direction="l", linebreak="ns", + shcode=0x309D, + sound="unvoiced", unicodeslot=0x309D, }, [0x309E]={ @@ -91126,8 +91391,11 @@ characters.data={ category="lm", cjkwd="w", description="HIRAGANA VOICED ITERATION MARK", + detail="im", direction="l", linebreak="ns", + shcode=0x309D, + sound="voiced", specials={ "char", 0x309D, 0x3099 }, unicodeslot=0x309E, }, @@ -91153,8 +91421,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER SMALL A", + detail="sl", direction="l", linebreak="cj", + shcode=0x3042, + sound="unvoiced", unicodeslot=0x30A1, }, [0x30A2]={ @@ -91162,8 +91433,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER A", + detail="bl", direction="l", linebreak="id", + shcode=0x3042, + sound="unvoiced", unicodeslot=0x30A2, }, [0x30A3]={ @@ -91171,8 +91445,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER SMALL I", + detail="sl", direction="l", linebreak="cj", + shcode=0x3044, + sound="unvoiced", unicodeslot=0x30A3, }, [0x30A4]={ @@ -91180,8 +91457,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER I", + detail="bl", direction="l", linebreak="id", + shcode=0x3044, + sound="unvoiced", unicodeslot=0x30A4, }, [0x30A5]={ @@ -91189,8 +91469,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER SMALL U", + detail="sl", direction="l", linebreak="cj", + shcode=0x3046, + sound="unvoiced", unicodeslot=0x30A5, }, [0x30A6]={ @@ -91198,8 +91481,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER U", + detail="bl", direction="l", linebreak="id", + shcode=0x3046, + sound="unvoiced", unicodeslot=0x30A6, }, [0x30A7]={ @@ -91207,8 +91493,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER SMALL E", + detail="sl", direction="l", linebreak="cj", + shcode=0x3048, + sound="unvoiced", unicodeslot=0x30A7, }, [0x30A8]={ @@ -91216,8 +91505,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER E", + detail="bl", direction="l", linebreak="id", + shcode=0x3048, + sound="unvoiced", unicodeslot=0x30A8, }, [0x30A9]={ @@ -91225,8 +91517,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER SMALL O", + detail="sl", direction="l", linebreak="cj", + shcode=0x304A, + sound="unvoiced", unicodeslot=0x30A9, }, [0x30AA]={ @@ -91234,8 +91529,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER O", + detail="bl", direction="l", linebreak="id", + shcode=0x304A, + sound="unvoiced", unicodeslot=0x30AA, }, [0x30AB]={ @@ -91243,8 +91541,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER KA", + detail="bl", direction="l", linebreak="id", + shcode=0x304B, + sound="unvoiced", unicodeslot=0x30AB, }, [0x30AC]={ @@ -91252,8 +91553,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER GA", + detail="bl", direction="l", linebreak="id", + shcode=0x304B, + sound="voiced", specials={ "char", 0x30AB, 0x3099 }, unicodeslot=0x30AC, }, @@ -91262,8 +91566,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER KI", + detail="bl", direction="l", linebreak="id", + shcode=0x304D, + sound="unvoiced", unicodeslot=0x30AD, }, [0x30AE]={ @@ -91271,8 +91578,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER GI", + detail="bl", direction="l", linebreak="id", + shcode=0x304D, + sound="voiced", specials={ "char", 0x30AD, 0x3099 }, unicodeslot=0x30AE, }, @@ -91281,8 +91591,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER KU", + detail="bl", direction="l", linebreak="id", + shcode=0x304F, + sound="unvoiced", unicodeslot=0x30AF, }, [0x30B0]={ @@ -91290,8 +91603,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER GU", + detail="bl", direction="l", linebreak="id", + shcode=0x304F, + sound="voiced", specials={ "char", 0x30AF, 0x3099 }, unicodeslot=0x30B0, }, @@ -91300,8 +91616,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER KE", + detail="bl", direction="l", linebreak="id", + shcode=0x3051, + sound="unvoiced", unicodeslot=0x30B1, }, [0x30B2]={ @@ -91309,8 +91628,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER GE", + detail="bl", direction="l", linebreak="id", + shcode=0x3051, + sound="voiced", specials={ "char", 0x30B1, 0x3099 }, unicodeslot=0x30B2, }, @@ -91319,8 +91641,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER KO", + detail="bl", direction="l", linebreak="id", + shcode=0x3053, + sound="unvoiced", unicodeslot=0x30B3, }, [0x30B4]={ @@ -91328,8 +91653,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER GO", + detail="bl", direction="l", linebreak="id", + shcode=0x3053, + sound="voiced", specials={ "char", 0x30B3, 0x3099 }, unicodeslot=0x30B4, }, @@ -91338,8 +91666,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER SA", + detail="bl", direction="l", linebreak="id", + shcode=0x3055, + sound="unvoiced", unicodeslot=0x30B5, }, [0x30B6]={ @@ -91347,8 +91678,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER ZA", + detail="bl", direction="l", linebreak="id", + shcode=0x3055, + sound="voiced", specials={ "char", 0x30B5, 0x3099 }, unicodeslot=0x30B6, }, @@ -91357,8 +91691,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER SI", + detail="bl", direction="l", linebreak="id", + shcode=0x3057, + sound="unvoiced", unicodeslot=0x30B7, }, [0x30B8]={ @@ -91366,8 +91703,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER ZI", + detail="bl", direction="l", linebreak="id", + shcode=0x3057, + sound="voiced", specials={ "char", 0x30B7, 0x3099 }, unicodeslot=0x30B8, }, @@ -91376,8 +91716,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER SU", + detail="bl", direction="l", linebreak="id", + shcode=0x3059, + sound="unvoiced", unicodeslot=0x30B9, }, [0x30BA]={ @@ -91385,8 +91728,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER ZU", + detail="bl", direction="l", linebreak="id", + shcode=0x3059, + sound="voiced", specials={ "char", 0x30B9, 0x3099 }, unicodeslot=0x30BA, }, @@ -91395,8 +91741,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER SE", + detail="bl", direction="l", linebreak="id", + shcode=0x305B, + sound="unvoiced", unicodeslot=0x30BB, }, [0x30BC]={ @@ -91404,8 +91753,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER ZE", + detail="bl", direction="l", linebreak="id", + shcode=0x305B, + sound="voiced", specials={ "char", 0x30BB, 0x3099 }, unicodeslot=0x30BC, }, @@ -91414,8 +91766,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER SO", + detail="bl", direction="l", linebreak="id", + shcode=0x305D, + sound="unvoiced", unicodeslot=0x30BD, }, [0x30BE]={ @@ -91423,8 +91778,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER ZO", + detail="bl", direction="l", linebreak="id", + shcode=0x305D, + sound="voiced", specials={ "char", 0x30BD, 0x3099 }, unicodeslot=0x30BE, }, @@ -91433,8 +91791,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER TA", + detail="bl", direction="l", linebreak="id", + shcode=0x305F, + sound="unvoiced", unicodeslot=0x30BF, }, [0x30C0]={ @@ -91442,8 +91803,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER DA", + detail="bl", direction="l", linebreak="id", + shcode=0x305F, + sound="voiced", specials={ "char", 0x30BF, 0x3099 }, unicodeslot=0x30C0, }, @@ -91452,8 +91816,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER TI", + detail="bl", direction="l", linebreak="id", + shcode=0x3061, + sound="unvoiced", unicodeslot=0x30C1, }, [0x30C2]={ @@ -91461,8 +91828,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER DI", + detail="bl", direction="l", linebreak="id", + shcode=0x3061, + sound="voiced", specials={ "char", 0x30C1, 0x3099 }, unicodeslot=0x30C2, }, @@ -91471,8 +91841,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER SMALL TU", + detail="sl", direction="l", linebreak="cj", + shcode=0x3064, + sound="unvoiced", unicodeslot=0x30C3, }, [0x30C4]={ @@ -91480,8 +91853,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER TU", + detail="bl", direction="l", linebreak="id", + shcode=0x3064, + sound="unvoiced", unicodeslot=0x30C4, }, [0x30C5]={ @@ -91489,8 +91865,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER DU", + detail="bl", direction="l", linebreak="id", + shcode=0x3064, + sound="voiced", specials={ "char", 0x30C4, 0x3099 }, unicodeslot=0x30C5, }, @@ -91499,8 +91878,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER TE", + detail="bl", direction="l", linebreak="id", + shcode=0x3066, + sound="unvoiced", unicodeslot=0x30C6, }, [0x30C7]={ @@ -91508,8 +91890,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER DE", + detail="bl", direction="l", linebreak="id", + shcode=0x3066, + sound="voiced", specials={ "char", 0x30C6, 0x3099 }, unicodeslot=0x30C7, }, @@ -91518,8 +91903,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER TO", + detail="bl", direction="l", linebreak="id", + shcode=0x3068, + sound="unvoiced", unicodeslot=0x30C8, }, [0x30C9]={ @@ -91527,8 +91915,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER DO", + detail="bl", direction="l", linebreak="id", + shcode=0x3068, + sound="voiced", specials={ "char", 0x30C8, 0x3099 }, unicodeslot=0x30C9, }, @@ -91537,8 +91928,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER NA", + detail="bl", direction="l", linebreak="id", + shcode=0x306A, + sound="unvoiced", unicodeslot=0x30CA, }, [0x30CB]={ @@ -91546,8 +91940,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER NI", + detail="bl", direction="l", linebreak="id", + shcode=0x306B, + sound="unvoiced", unicodeslot=0x30CB, }, [0x30CC]={ @@ -91555,8 +91952,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER NU", + detail="bl", direction="l", linebreak="id", + shcode=0x306C, + sound="unvoiced", unicodeslot=0x30CC, }, [0x30CD]={ @@ -91564,8 +91964,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER NE", + detail="bl", direction="l", linebreak="id", + shcode=0x306D, + sound="unvoiced", unicodeslot=0x30CD, }, [0x30CE]={ @@ -91573,8 +91976,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER NO", + detail="bl", direction="l", linebreak="id", + shcode=0x306E, + sound="unvoiced", unicodeslot=0x30CE, }, [0x30CF]={ @@ -91582,8 +91988,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER HA", + detail="bl", direction="l", linebreak="id", + shcode=0x306F, + sound="unvoiced", unicodeslot=0x30CF, }, [0x30D0]={ @@ -91591,8 +92000,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER BA", + detail="bl", direction="l", linebreak="id", + shcode=0x306F, + sound="voiced", specials={ "char", 0x30CF, 0x3099 }, unicodeslot=0x30D0, }, @@ -91601,8 +92013,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER PA", + detail="bl", direction="l", linebreak="id", + shcode=0x306F, + sound="semivoiced", specials={ "char", 0x30CF, 0x309A }, unicodeslot=0x30D1, }, @@ -91611,8 +92026,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER HI", + detail="bl", direction="l", linebreak="id", + shcode=0x3072, + sound="unvoiced", unicodeslot=0x30D2, }, [0x30D3]={ @@ -91620,8 +92038,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER BI", + detail="bl", direction="l", linebreak="id", + shcode=0x3072, + sound="voiced", specials={ "char", 0x30D2, 0x3099 }, unicodeslot=0x30D3, }, @@ -91630,8 +92051,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER PI", + detail="bl", direction="l", linebreak="id", + shcode=0x3072, + sound="semivoiced", specials={ "char", 0x30D2, 0x309A }, unicodeslot=0x30D4, }, @@ -91640,8 +92064,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER HU", + detail="bl", direction="l", linebreak="id", + shcode=0x3075, + sound="unvoiced", unicodeslot=0x30D5, }, [0x30D6]={ @@ -91649,8 +92076,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER BU", + detail="bl", direction="l", linebreak="id", + shcode=0x3075, + sound="voiced", specials={ "char", 0x30D5, 0x3099 }, unicodeslot=0x30D6, }, @@ -91659,8 +92089,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER PU", + detail="bl", direction="l", linebreak="id", + shcode=0x3075, + sound="semivoiced", specials={ "char", 0x30D5, 0x309A }, unicodeslot=0x30D7, }, @@ -91669,8 +92102,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER HE", + detail="bl", direction="l", linebreak="id", + shcode=0x3078, + sound="unvoiced", unicodeslot=0x30D8, }, [0x30D9]={ @@ -91678,8 +92114,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER BE", + detail="bl", direction="l", linebreak="id", + shcode=0x3078, + sound="voiced", specials={ "char", 0x30D8, 0x3099 }, unicodeslot=0x30D9, }, @@ -91688,8 +92127,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER PE", + detail="bl", direction="l", linebreak="id", + shcode=0x3078, + sound="semivoiced", specials={ "char", 0x30D8, 0x309A }, unicodeslot=0x30DA, }, @@ -91698,8 +92140,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER HO", + detail="bl", direction="l", linebreak="id", + shcode=0x307B, + sound="unvoiced", unicodeslot=0x30DB, }, [0x30DC]={ @@ -91707,8 +92152,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER BO", + detail="bl", direction="l", linebreak="id", + shcode=0x307B, + sound="voiced", specials={ "char", 0x30DB, 0x3099 }, unicodeslot=0x30DC, }, @@ -91717,8 +92165,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER PO", + detail="bl", direction="l", linebreak="id", + shcode=0x307B, + sound="semivoiced", specials={ "char", 0x30DB, 0x309A }, unicodeslot=0x30DD, }, @@ -91727,8 +92178,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER MA", + detail="bl", direction="l", linebreak="id", + shcode=0x307E, + sound="unvoiced", unicodeslot=0x30DE, }, [0x30DF]={ @@ -91736,8 +92190,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER MI", + detail="bl", direction="l", linebreak="id", + shcode=0x307F, + sound="unvoiced", unicodeslot=0x30DF, }, [0x30E0]={ @@ -91745,8 +92202,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER MU", + detail="bl", direction="l", linebreak="id", + shcode=0x3080, + sound="unvoiced", unicodeslot=0x30E0, }, [0x30E1]={ @@ -91754,8 +92214,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER ME", + detail="bl", direction="l", linebreak="id", + shcode=0x3081, + sound="unvoiced", unicodeslot=0x30E1, }, [0x30E2]={ @@ -91763,8 +92226,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER MO", + detail="bl", direction="l", linebreak="id", + shcode=0x3082, + sound="unvoiced", unicodeslot=0x30E2, }, [0x30E3]={ @@ -91772,8 +92238,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER SMALL YA", + detail="sl", direction="l", linebreak="cj", + shcode=0x3084, + sound="unvoiced", unicodeslot=0x30E3, }, [0x30E4]={ @@ -91781,8 +92250,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER YA", + detail="bl", direction="l", linebreak="id", + shcode=0x3084, + sound="unvoiced", unicodeslot=0x30E4, }, [0x30E5]={ @@ -91790,8 +92262,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER SMALL YU", + detail="sl", direction="l", linebreak="cj", + shcode=0x3086, + sound="unvoiced", unicodeslot=0x30E5, }, [0x30E6]={ @@ -91799,8 +92274,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER YU", + detail="bl", direction="l", linebreak="id", + shcode=0x3086, + sound="unvoiced", unicodeslot=0x30E6, }, [0x30E7]={ @@ -91808,8 +92286,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER SMALL YO", + detail="sl", direction="l", linebreak="cj", + shcode=0x3088, + sound="unvoiced", unicodeslot=0x30E7, }, [0x30E8]={ @@ -91817,8 +92298,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER YO", + detail="bl", direction="l", linebreak="id", + shcode=0x3088, + sound="unvoiced", unicodeslot=0x30E8, }, [0x30E9]={ @@ -91826,8 +92310,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER RA", + detail="bl", direction="l", linebreak="id", + shcode=0x3089, + sound="unvoiced", unicodeslot=0x30E9, }, [0x30EA]={ @@ -91835,8 +92322,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER RI", + detail="bl", direction="l", linebreak="id", + shcode=0x308A, + sound="unvoiced", unicodeslot=0x30EA, }, [0x30EB]={ @@ -91844,8 +92334,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER RU", + detail="bl", direction="l", linebreak="id", + shcode=0x308B, + sound="unvoiced", unicodeslot=0x30EB, }, [0x30EC]={ @@ -91853,8 +92346,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER RE", + detail="bl", direction="l", linebreak="id", + shcode=0x308C, + sound="unvoiced", unicodeslot=0x30EC, }, [0x30ED]={ @@ -91862,8 +92358,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER RO", + detail="bl", direction="l", linebreak="id", + shcode=0x308D, + sound="unvoiced", unicodeslot=0x30ED, }, [0x30EE]={ @@ -91871,8 +92370,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER SMALL WA", + detail="sl", direction="l", linebreak="cj", + shcode=0x308F, + sound="unvoiced", unicodeslot=0x30EE, }, [0x30EF]={ @@ -91880,8 +92382,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER WA", + detail="bl", direction="l", linebreak="id", + shcode=0x308F, + sound="unvoiced", unicodeslot=0x30EF, }, [0x30F0]={ @@ -91889,8 +92394,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER WI", + detail="bl", direction="l", linebreak="id", + shcode=0x3090, + sound="unvoiced", unicodeslot=0x30F0, }, [0x30F1]={ @@ -91898,8 +92406,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER WE", + detail="bl", direction="l", linebreak="id", + shcode=0x3091, + sound="unvoiced", unicodeslot=0x30F1, }, [0x30F2]={ @@ -91907,8 +92418,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER WO", + detail="bl", direction="l", linebreak="id", + shcode=0x3092, + sound="unvoiced", unicodeslot=0x30F2, }, [0x30F3]={ @@ -91916,8 +92430,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER N", + detail="bl", direction="l", linebreak="id", + shcode=0x3093, + sound="unvoiced", unicodeslot=0x30F3, }, [0x30F4]={ @@ -91925,8 +92442,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER VU", + detail="bl", direction="l", linebreak="id", + shcode=0x3046, + sound="voiced", specials={ "char", 0x30A6, 0x3099 }, unicodeslot=0x30F4, }, @@ -91935,8 +92455,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER SMALL KA", + detail="sl", direction="l", linebreak="cj", + shcode=0x304B, + sound="unvoiced", unicodeslot=0x30F5, }, [0x30F6]={ @@ -91944,8 +92467,11 @@ characters.data={ category="lo", cjkwd="w", description="KATAKANA LETTER SMALL KE", + detail="sl", direction="l", linebreak="cj", + shcode=0x3051, + sound="unvoiced", unicodeslot=0x30F6, }, [0x30F7]={ @@ -91955,6 +92481,8 @@ characters.data={ description="KATAKANA LETTER VA", direction="l", linebreak="id", + shcode=0x308F, + sound="voiced", specials={ "char", 0x30EF, 0x3099 }, unicodeslot=0x30F7, }, @@ -91965,6 +92493,8 @@ characters.data={ description="KATAKANA LETTER VI", direction="l", linebreak="id", + shcode=0x3090, + sound="voiced", specials={ "char", 0x30F0, 0x3099 }, unicodeslot=0x30F8, }, @@ -91975,6 +92505,8 @@ characters.data={ description="KATAKANA LETTER VE", direction="l", linebreak="id", + shcode=0x3091, + sound="voiced", specials={ "char", 0x30F1, 0x3099 }, unicodeslot=0x30F9, }, @@ -91985,6 +92517,8 @@ characters.data={ description="KATAKANA LETTER VO", direction="l", linebreak="id", + shcode=0x3092, + sound="voiced", specials={ "char", 0x30F2, 0x3099 }, unicodeslot=0x30FA, }, @@ -92002,8 +92536,11 @@ characters.data={ category="lm", cjkwd="w", description="KATAKANA-HIRAGANA PROLONGED SOUND MARK", + detail="pm", direction="l", linebreak="cj", + shcode=0x30FC, + sound="unvoiced", unicodeslot=0x30FC, }, [0x30FD]={ @@ -92011,8 +92548,11 @@ characters.data={ category="lm", cjkwd="w", description="KATAKANA ITERATION MARK", + detail="im", direction="l", linebreak="ns", + shcode=0x309D, + sound="unvoiced", unicodeslot=0x30FD, }, [0x30FE]={ @@ -92020,8 +92560,11 @@ characters.data={ category="lm", cjkwd="w", description="KATAKANA VOICED ITERATION MARK", + detail="im", direction="l", linebreak="ns", + shcode=0x309D, + sound="voiced", specials={ "char", 0x30FD, 0x3099 }, unicodeslot=0x30FE, }, @@ -93991,6 +94534,8 @@ characters.data={ description="KATAKANA LETTER SMALL KU", direction="l", linebreak="cj", + shcode=0x304F, + sound="unvoiced", unicodeslot=0x31F0, }, [0x31F1]={ @@ -93999,6 +94544,8 @@ characters.data={ description="KATAKANA LETTER SMALL SI", direction="l", linebreak="cj", + shcode=0x3057, + sound="unvoiced", unicodeslot=0x31F1, }, [0x31F2]={ @@ -94007,6 +94554,8 @@ characters.data={ description="KATAKANA LETTER SMALL SU", direction="l", linebreak="cj", + shcode=0x3059, + sound="unvoiced", unicodeslot=0x31F2, }, [0x31F3]={ @@ -94015,6 +94564,8 @@ characters.data={ description="KATAKANA LETTER SMALL TO", direction="l", linebreak="cj", + shcode=0x3068, + sound="unvoiced", unicodeslot=0x31F3, }, [0x31F4]={ @@ -94023,6 +94574,8 @@ characters.data={ description="KATAKANA LETTER SMALL NU", direction="l", linebreak="cj", + shcode=0x306C, + sound="unvoiced", unicodeslot=0x31F4, }, [0x31F5]={ @@ -94031,6 +94584,8 @@ characters.data={ description="KATAKANA LETTER SMALL HA", direction="l", linebreak="cj", + shcode=0x306F, + sound="unvoiced", unicodeslot=0x31F5, }, [0x31F6]={ @@ -94039,6 +94594,8 @@ characters.data={ description="KATAKANA LETTER SMALL HI", direction="l", linebreak="cj", + shcode=0x3072, + sound="unvoiced", unicodeslot=0x31F6, }, [0x31F7]={ @@ -94047,6 +94604,8 @@ characters.data={ description="KATAKANA LETTER SMALL HU", direction="l", linebreak="cj", + shcode=0x3075, + sound="unvoiced", unicodeslot=0x31F7, }, [0x31F8]={ @@ -94055,6 +94614,8 @@ characters.data={ description="KATAKANA LETTER SMALL HE", direction="l", linebreak="cj", + shcode=0x3078, + sound="unvoiced", unicodeslot=0x31F8, }, [0x31F9]={ @@ -94063,6 +94624,8 @@ characters.data={ description="KATAKANA LETTER SMALL HO", direction="l", linebreak="cj", + shcode=0x307B, + sound="unvoiced", unicodeslot=0x31F9, }, [0x31FA]={ @@ -94071,6 +94634,8 @@ characters.data={ description="KATAKANA LETTER SMALL MU", direction="l", linebreak="cj", + shcode=0x3080, + sound="unvoiced", unicodeslot=0x31FA, }, [0x31FB]={ @@ -94079,6 +94644,8 @@ characters.data={ description="KATAKANA LETTER SMALL RA", direction="l", linebreak="cj", + shcode=0x3089, + sound="unvoiced", unicodeslot=0x31FB, }, [0x31FC]={ @@ -94087,6 +94654,7 @@ characters.data={ description="KATAKANA LETTER SMALL RI", direction="l", linebreak="cj", + sound="unvoiced", unicodeslot=0x31FC, }, [0x31FD]={ @@ -94095,6 +94663,8 @@ characters.data={ description="KATAKANA LETTER SMALL RU", direction="l", linebreak="cj", + shcode=0x308B, + sound="unvoiced", unicodeslot=0x31FD, }, [0x31FE]={ @@ -94103,6 +94673,8 @@ characters.data={ description="KATAKANA LETTER SMALL RE", direction="l", linebreak="cj", + shcode=0x308C, + sound="unvoiced", unicodeslot=0x31FE, }, [0x31FF]={ @@ -94111,6 +94683,8 @@ characters.data={ description="KATAKANA LETTER SMALL RO", direction="l", linebreak="cj", + shcode=0x308D, + sound="unvoiced", unicodeslot=0x31FF, }, [0x3200]={ @@ -133444,6 +134018,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER WO", direction="l", linebreak="al", + shcode=0x3092, specials={ "narrow", 0x30F2 }, unicodeslot=0xFF66, }, @@ -133504,6 +134079,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER SMALL YA", direction="l", linebreak="cj", + shcode=0x3084, specials={ "narrow", 0x30E3 }, unicodeslot=0xFF6C, }, @@ -133514,6 +134090,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER SMALL YU", direction="l", linebreak="cj", + shcode=0x3086, specials={ "narrow", 0x30E5 }, unicodeslot=0xFF6D, }, @@ -133524,6 +134101,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER SMALL YO", direction="l", linebreak="cj", + shcode=0x3088, specials={ "narrow", 0x30E7 }, unicodeslot=0xFF6E, }, @@ -133534,6 +134112,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER SMALL TU", direction="l", linebreak="cj", + shcode=0x3064, specials={ "narrow", 0x30C3 }, unicodeslot=0xFF6F, }, @@ -133554,6 +134133,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER A", direction="l", linebreak="al", + shcode=0x3042, specials={ "narrow", 0x30A2 }, unicodeslot=0xFF71, }, @@ -133564,6 +134144,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER I", direction="l", linebreak="al", + shcode=0x3044, specials={ "narrow", 0x30A4 }, unicodeslot=0xFF72, }, @@ -133574,6 +134155,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER U", direction="l", linebreak="al", + shcode=0x3046, specials={ "narrow", 0x30A6 }, unicodeslot=0xFF73, }, @@ -133584,6 +134166,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER E", direction="l", linebreak="al", + shcode=0x3048, specials={ "narrow", 0x30A8 }, unicodeslot=0xFF74, }, @@ -133594,6 +134177,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER O", direction="l", linebreak="al", + shcode=0x304A, specials={ "narrow", 0x30AA }, unicodeslot=0xFF75, }, @@ -133604,6 +134188,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER KA", direction="l", linebreak="al", + shcode=0x304B, specials={ "narrow", 0x30AB }, unicodeslot=0xFF76, }, @@ -133614,6 +134199,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER KI", direction="l", linebreak="al", + shcode=0x304D, specials={ "narrow", 0x30AD }, unicodeslot=0xFF77, }, @@ -133624,6 +134210,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER KU", direction="l", linebreak="al", + shcode=0x304F, specials={ "narrow", 0x30AF }, unicodeslot=0xFF78, }, @@ -133634,6 +134221,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER KE", direction="l", linebreak="al", + shcode=0x3051, specials={ "narrow", 0x30B1 }, unicodeslot=0xFF79, }, @@ -133644,6 +134232,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER KO", direction="l", linebreak="al", + shcode=0x3053, specials={ "narrow", 0x30B3 }, unicodeslot=0xFF7A, }, @@ -133654,6 +134243,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER SA", direction="l", linebreak="al", + shcode=0x3055, specials={ "narrow", 0x30B5 }, unicodeslot=0xFF7B, }, @@ -133664,6 +134254,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER SI", direction="l", linebreak="al", + shcode=0x3057, specials={ "narrow", 0x30B7 }, unicodeslot=0xFF7C, }, @@ -133674,6 +134265,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER SU", direction="l", linebreak="al", + shcode=0x3059, specials={ "narrow", 0x30B9 }, unicodeslot=0xFF7D, }, @@ -133684,6 +134276,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER SE", direction="l", linebreak="al", + shcode=0x305B, specials={ "narrow", 0x30BB }, unicodeslot=0xFF7E, }, @@ -133694,6 +134287,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER SO", direction="l", linebreak="al", + shcode=0x305D, specials={ "narrow", 0x30BD }, unicodeslot=0xFF7F, }, @@ -133704,6 +134298,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER TA", direction="l", linebreak="al", + shcode=0x305F, specials={ "narrow", 0x30BF }, unicodeslot=0xFF80, }, @@ -133714,6 +134309,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER TI", direction="l", linebreak="al", + shcode=0x3061, specials={ "narrow", 0x30C1 }, unicodeslot=0xFF81, }, @@ -133724,6 +134320,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER TU", direction="l", linebreak="al", + shcode=0x3064, specials={ "narrow", 0x30C4 }, unicodeslot=0xFF82, }, @@ -133734,6 +134331,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER TE", direction="l", linebreak="al", + shcode=0x3066, specials={ "narrow", 0x30C6 }, unicodeslot=0xFF83, }, @@ -133744,6 +134342,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER TO", direction="l", linebreak="al", + shcode=0x3068, specials={ "narrow", 0x30C8 }, unicodeslot=0xFF84, }, @@ -133754,6 +134353,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER NA", direction="l", linebreak="al", + shcode=0x306A, specials={ "narrow", 0x30CA }, unicodeslot=0xFF85, }, @@ -133764,6 +134364,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER NI", direction="l", linebreak="al", + shcode=0x306B, specials={ "narrow", 0x30CB }, unicodeslot=0xFF86, }, @@ -133774,6 +134375,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER NU", direction="l", linebreak="al", + shcode=0x306C, specials={ "narrow", 0x30CC }, unicodeslot=0xFF87, }, @@ -133784,6 +134386,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER NE", direction="l", linebreak="al", + shcode=0x306D, specials={ "narrow", 0x30CD }, unicodeslot=0xFF88, }, @@ -133794,6 +134397,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER NO", direction="l", linebreak="al", + shcode=0x306E, specials={ "narrow", 0x30CE }, unicodeslot=0xFF89, }, @@ -133804,6 +134408,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER HA", direction="l", linebreak="al", + shcode=0x306F, specials={ "narrow", 0x30CF }, unicodeslot=0xFF8A, }, @@ -133814,6 +134419,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER HI", direction="l", linebreak="al", + shcode=0x3072, specials={ "narrow", 0x30D2 }, unicodeslot=0xFF8B, }, @@ -133824,6 +134430,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER HU", direction="l", linebreak="al", + shcode=0x3075, specials={ "narrow", 0x30D5 }, unicodeslot=0xFF8C, }, @@ -133834,6 +134441,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER HE", direction="l", linebreak="al", + shcode=0x3078, specials={ "narrow", 0x30D8 }, unicodeslot=0xFF8D, }, @@ -133844,6 +134452,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER HO", direction="l", linebreak="al", + shcode=0x307B, specials={ "narrow", 0x30DB }, unicodeslot=0xFF8E, }, @@ -133854,6 +134463,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER MA", direction="l", linebreak="al", + shcode=0x307E, specials={ "narrow", 0x30DE }, unicodeslot=0xFF8F, }, @@ -133864,6 +134474,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER MI", direction="l", linebreak="al", + shcode=0x307F, specials={ "narrow", 0x30DF }, unicodeslot=0xFF90, }, @@ -133874,6 +134485,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER MU", direction="l", linebreak="al", + shcode=0x3080, specials={ "narrow", 0x30E0 }, unicodeslot=0xFF91, }, @@ -133884,6 +134496,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER ME", direction="l", linebreak="al", + shcode=0x3081, specials={ "narrow", 0x30E1 }, unicodeslot=0xFF92, }, @@ -133894,6 +134507,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER MO", direction="l", linebreak="al", + shcode=0x3082, specials={ "narrow", 0x30E2 }, unicodeslot=0xFF93, }, @@ -133904,6 +134518,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER YA", direction="l", linebreak="al", + shcode=0x3084, specials={ "narrow", 0x30E4 }, unicodeslot=0xFF94, }, @@ -133914,6 +134529,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER YU", direction="l", linebreak="al", + shcode=0x3086, specials={ "narrow", 0x30E6 }, unicodeslot=0xFF95, }, @@ -133924,6 +134540,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER YO", direction="l", linebreak="al", + shcode=0x3088, specials={ "narrow", 0x30E8 }, unicodeslot=0xFF96, }, @@ -133934,6 +134551,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER RA", direction="l", linebreak="al", + shcode=0x3089, specials={ "narrow", 0x30E9 }, unicodeslot=0xFF97, }, @@ -133944,6 +134562,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER RI", direction="l", linebreak="al", + shcode=0x308A, specials={ "narrow", 0x30EA }, unicodeslot=0xFF98, }, @@ -133954,6 +134573,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER RU", direction="l", linebreak="al", + shcode=0x308B, specials={ "narrow", 0x30EB }, unicodeslot=0xFF99, }, @@ -133964,6 +134584,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER RE", direction="l", linebreak="al", + shcode=0x308C, specials={ "narrow", 0x30EC }, unicodeslot=0xFF9A, }, @@ -133974,6 +134595,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER RO", direction="l", linebreak="al", + shcode=0x308D, specials={ "narrow", 0x30ED }, unicodeslot=0xFF9B, }, @@ -133984,6 +134606,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER WA", direction="l", linebreak="al", + shcode=0x308F, specials={ "narrow", 0x30EF }, unicodeslot=0xFF9C, }, @@ -133994,6 +134617,7 @@ characters.data={ description="HALFWIDTH KATAKANA LETTER N", direction="l", linebreak="al", + shcode=0x3093, specials={ "narrow", 0x30F3 }, unicodeslot=0xFF9D, }, diff --git a/Master/texmf-dist/tex/context/base/char-ini.lua b/Master/texmf-dist/tex/context/base/char-ini.lua index a1dd911f214..c6192cc9bc1 100644 --- a/Master/texmf-dist/tex/context/base/char-ini.lua +++ b/Master/texmf-dist/tex/context/base/char-ini.lua @@ -546,7 +546,17 @@ local categorytags = allocate { cn = "Other Not Assigned", } +local detailtags = allocate { + sl = "small letter", + bl = "big letter", + im = "iteration mark", + pm = "prolonged sound mark" +} + characters.categorytags = categorytags +characters.detailtags = detailtags + +-- sounds : voiced unvoiced semivoiced --~ special : cf (softhyphen) zs (emspace) --~ characters: ll lm lo lt lu mn nl no pc pd pe pf pi po ps sc sk sm so diff --git a/Master/texmf-dist/tex/context/base/char-ini.mkiv b/Master/texmf-dist/tex/context/base/char-ini.mkiv index bb4483b7527..95ff7af5a43 100644 --- a/Master/texmf-dist/tex/context/base/char-ini.mkiv +++ b/Master/texmf-dist/tex/context/base/char-ini.mkiv @@ -47,7 +47,10 @@ \def\checkedchar {\relax\ifmmode\expandafter\checkedmathchar\else\expandafter\checkedtextchar\fi} % #1#2 \def\checkedmathchar#1#2{#2} -\def\checkedtextchar #1{\iffontchar\font#1 \expandafter\firstoftwoarguments\else\expandafter\secondoftwoarguments\fi{\char#1}} +%def\checkedtextchar #1{\iffontchar\font#1 \expandafter\firstoftwoarguments\else\expandafter\secondoftwoarguments\fi{\char#1}} + +\unexpanded\def\checkedtextchar#1% #2% + {\clf_doifelsecharinfont\numexpr#1\relax{\char#1}} % {#2} \unexpanded\def\textormathchar#1% {\relax\ifmmode diff --git a/Master/texmf-dist/tex/context/base/char-tex.lua b/Master/texmf-dist/tex/context/base/char-tex.lua index 48dccfe7915..62bb6a04107 100644 --- a/Master/texmf-dist/tex/context/base/char-tex.lua +++ b/Master/texmf-dist/tex/context/base/char-tex.lua @@ -281,7 +281,7 @@ local commandmapping = allocate { ["l"] = "ł", ["L"] = "Ł", ["o"] = "ø", ["O"] = "Ø", ["oe"] = "œ", ["OE"] = "Œ", - ["sz"] = "ß", ["SZ"] = "SZ", ["SS"] = "ß", + ["sz"] = "ß", ["SZ"] = "SZ", ["ss"] = "ß", ["SS"] = "ß", } texcharacters.commandmapping = commandmapping diff --git a/Master/texmf-dist/tex/context/base/colo-imp-rgb.mkiv b/Master/texmf-dist/tex/context/base/colo-imp-rgb.mkiv index dd14cc7d21d..d7b691fccb2 100644 --- a/Master/texmf-dist/tex/context/base/colo-imp-rgb.mkiv +++ b/Master/texmf-dist/tex/context/base/colo-imp-rgb.mkiv @@ -268,6 +268,8 @@ %D Bonus (needed for FO test): -\definecolor [orange] [r=1,g=.5] +\definecolor [orange] [r=1, g=.5] +\definecolor [middleorange] [r=.6,g=.3] +\definecolor [darkorange] [r=.4,g=.2] \endinput diff --git a/Master/texmf-dist/tex/context/base/colo-ini.lua b/Master/texmf-dist/tex/context/base/colo-ini.lua index 1065aadc064..81adfa68091 100644 --- a/Master/texmf-dist/tex/context/base/colo-ini.lua +++ b/Master/texmf-dist/tex/context/base/colo-ini.lua @@ -997,7 +997,10 @@ do if model and model ~= 0 then model = model else - model = forcedmodel(cv[1]) + model = forcedmodel(texgetattribute(a_colorspace)) + if model == 1 then + model = cv[1] + end end if model == 3 then str = formatters["{rgb}{%1.3f,%1.3f,%1.3f}"](cv[3],cv[4],cv[5]) @@ -1021,26 +1024,6 @@ do arguments = { "integer", "integer" } } - -- function commands.pgfregistercolor(name,attribute) - -- local cv = colorvalues[ca] - -- context.pushcatcodes('prt') - -- if cv then - -- local model = forcedmodel(cv[1]) - -- if model == 2 then - -- context["pgfutil@definecolor"]("{%s}{gray}{%1.3f}",name,cv[2]) - -- elseif model == 3 then - -- context["pgfutil@definecolor"]("{%s}{rgb}{%1.3f,%1.3f,%1.3f}",name,cv[3],cv[4],cv[5]) - -- elseif model == 4 then - -- context["pgfutil@definecolor"]("{%s}{cmyk}{%1.3f,%1.3f,%1.3f,%1.3f}",name,cv[6],cv[7],cv[8],cv[9]) - -- else - -- context["pgfutil@definecolor"]("{%s}{gray}{0}",name) - -- end - -- else - -- context["pgfutil@definecolor"]("{%s}{gray}{0}",name) - -- end - -- context.popcatcodes() - -- end - end -- handy diff --git a/Master/texmf-dist/tex/context/base/cont-new.mkiv b/Master/texmf-dist/tex/context/base/cont-new.mkiv index 2b7028e336b..fc87c486305 100644 --- a/Master/texmf-dist/tex/context/base/cont-new.mkiv +++ b/Master/texmf-dist/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2015.04.18 14:41} +\newcontextversion{2015.05.04 19:00} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/Master/texmf-dist/tex/context/base/context-version.pdf b/Master/texmf-dist/tex/context/base/context-version.pdf Binary files differindex 9aee6f9bfda..298f490b5d0 100644 --- a/Master/texmf-dist/tex/context/base/context-version.pdf +++ b/Master/texmf-dist/tex/context/base/context-version.pdf diff --git a/Master/texmf-dist/tex/context/base/context.mkiv b/Master/texmf-dist/tex/context/base/context.mkiv index 034b403c409..9a2ae1bde83 100644 --- a/Master/texmf-dist/tex/context/base/context.mkiv +++ b/Master/texmf-dist/tex/context/base/context.mkiv @@ -39,7 +39,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2015.04.18 14:41} +\edef\contextversion{2015.05.04 19:00} \edef\contextkind {beta} %D For those who want to use this: @@ -271,6 +271,11 @@ \loadmarkfile{spac-par} %loadmarkfile{spac-adj} % no longer needed \loadmarkfile{spac-def} + +\doiffileelse{spac-prf.mkvi} + {\loadmkvifile{spac-prf}} + {\loadmkivfile{spac-prf}} + \loadmarkfile{spac-grd} %loadmarkfile{anch-pos} diff --git a/Master/texmf-dist/tex/context/base/export-example.css b/Master/texmf-dist/tex/context/base/export-example.css index af99d95dbe4..f4475589211 100644 --- a/Master/texmf-dist/tex/context/base/export-example.css +++ b/Master/texmf-dist/tex/context/base/export-example.css @@ -774,7 +774,7 @@ context|div.math-display { /* number : inline */ quantity, context|div.quantity { - display : inline ; + display : inline-block ; } quantity>unit, context|div.quantity>context|div.unit { diff --git a/Master/texmf-dist/tex/context/base/font-col.lua b/Master/texmf-dist/tex/context/base/font-col.lua index 997c57c9f92..cbc1953f45f 100644 --- a/Master/texmf-dist/tex/context/base/font-col.lua +++ b/Master/texmf-dist/tex/context/base/font-col.lua @@ -40,6 +40,7 @@ local vectors = collections.vectors or { } collections.vectors = vectors local fontdata = fonts.hashes.identifiers +local chardata = fonts.hashes.characters local glyph_code = nodes.nodecodes.glyph local currentfont = font.current @@ -275,6 +276,18 @@ function collections.process(head) -- this way we keep feature processing return head, done end +function collections.found(font,char) -- this way we keep feature processing + if not char then + font, char = currentfont(), font + end + if chardata[font][char] then + return true -- in normal font + else + local v = vectors[font] + return v and v[char] and true or false + end +end + -- interface implement { @@ -312,3 +325,9 @@ implement { actions = collections.clonevector, arguments = "string" } + +implement { + name = "doifelsecharinfont", + actions = { collections.found, commands.doifelse }, + arguments = { "integer" } +} diff --git a/Master/texmf-dist/tex/context/base/font-ctx.lua b/Master/texmf-dist/tex/context/base/font-ctx.lua index 2c96e9ac2be..81db3165254 100644 --- a/Master/texmf-dist/tex/context/base/font-ctx.lua +++ b/Master/texmf-dist/tex/context/base/font-ctx.lua @@ -2003,15 +2003,15 @@ end do - local scanners = tokens.scanners - local scanstring = scanners.string - local scaninteger = scanners.integer - local scandimen = scanners.dimen - local scanboolean = scanners.boolean + -- local scanners = tokens.scanners + -- local scanstring = scanners.string + -- local scaninteger = scanners.integer + -- local scandimen = scanners.dimen + -- local scanboolean = scanners.boolean - local setmacro = tokens.setters.macro + -- local scanners = interfaces.scanners - local scanners = interfaces.scanners + local setmacro = tokens.setters.macro function constructors.currentfonthasfeature(n) local f = fontdata[currentfont()] @@ -2040,25 +2040,64 @@ do -- context(lpegmatch(stripper,f(amount/65536))) -- end - local f = formatters["%0.2fpt"] -- normally this value is changed only once - + local f_strip = formatters["%0.2fpt"] -- normally this value is changed only once local stripper = lpeg.patterns.stripzeros - scanners.nbfs = function() - context(lpegmatch(stripper,f(scandimen()/65536))) - end + -- scanners.nbfs = function() + -- context(lpegmatch(stripper,f_strip(scandimen()/65536))) + -- end + + implement { + name = "nbfs", + arguments = "dimen", + actions = function(d) + context(lpegmatch(stripper,f_strip(d/65536))) + end + } + + -- commands.featureattribute = function(tag) context(contextnumber(tag)) end + -- commands.setfontfeature = function(tag) texsetattribute(0,contextnumber(tag)) end + -- commands.resetfontfeature = function() texsetattribute(0,0) end + -- commands.setfontofid = function(id) context_getvalue(csnames[id]) end + -- commands.definefontfeature = presetcontext - commands.featureattribute = function(tag) context(contextnumber(tag)) end - commands.setfontfeature = function(tag) texsetattribute(0,contextnumber(tag)) end - commands.resetfontfeature = function() texsetattribute(0,0) end - commands.setfontofid = function(id) context_getvalue(csnames[id]) end - commands.definefontfeature = presetcontext + -- scanners.featureattribute = function() context(contextnumber(scanstring())) end + -- scanners.setfontfeature = function() texsetattribute(0,contextnumber(scanstring())) end + -- scanners.resetfontfeature = function() texsetattribute(0,0) end + -- scanners.setfontofid = function() context_getvalue(csnames[scaninteger()]) end + -- scanners.definefontfeature = function() presetcontext(scanstring(),scanstring(),scanstring()) end - scanners.featureattribute = function() context(contextnumber(scanstring())) end - scanners.setfontfeature = function() texsetattribute(0,contextnumber(scanstring())) end - scanners.resetfontfeature = function() texsetattribute(0,0) end - scanners.setfontofid = function() context_getvalue(csnames[scaninteger()]) end - scanners.definefontfeature = function() presetcontext(scanstring(),scanstring(),scanstring()) end + implement { + name = "featureattribute", + arguments = "string", + actions = { contextnumber, context } + } + + implement { + name = "setfontfeature", + arguments = "string", + actions = function(tag) texsetattribute(0,contextnumber(tag)) end + } + + implement { + name = "resetfontfeature", + arguments = { 0, 0 }, + actions = texsetattribute, + } + + implement { + name = "setfontofid", + arguments = "integer", + actions = function(id) + context_getvalue(csnames[id]) + end + } + + implement { + name = "definefontfeature", + arguments = { "string", "string", "string" }, + actions = presetcontext + } local cache = { } diff --git a/Master/texmf-dist/tex/context/base/font-inj.lua b/Master/texmf-dist/tex/context/base/font-inj.lua index cb9ed891cfc..332e92033fd 100644 --- a/Master/texmf-dist/tex/context/base/font-inj.lua +++ b/Master/texmf-dist/tex/context/base/font-inj.lua @@ -647,10 +647,10 @@ local function inject_cursives(glyphs,nofglyphs) end end -local function inject_kerns(head,glyphs,nofglyphs) +local function inject_kerns(head,list,length) -- todo: pre/post/replace - for i=1,#glyphs do - local n = glyphs[i] + for i=1,length do + local n = list[i] local pn = rawget(properties,n) if pn then local i = rawget(pn,"injections") @@ -688,6 +688,9 @@ local function inject_everything(head,where) end inject_kerns(head,glyphs,nofglyphs) end + if nofmarks > 0 then + inject_kerns(head,marks,nofmarks) + end if keepregisteredcounts then keepregisteredcounts = false else @@ -998,7 +1001,7 @@ local function inject_pairs_only(head,where) if getsubtype(n) < 256 then local p = rawget(properties,n) if p then - local i = rawget(pn,"replaceinjections") + local i = rawget(p,"replaceinjections") if i then local yoffset = i.yoffset if yoffset and yoffset ~= 0 then diff --git a/Master/texmf-dist/tex/context/base/font-lib.mkvi b/Master/texmf-dist/tex/context/base/font-lib.mkvi index 59074b07df2..9cc14e02f23 100644 --- a/Master/texmf-dist/tex/context/base/font-lib.mkvi +++ b/Master/texmf-dist/tex/context/base/font-lib.mkvi @@ -93,14 +93,12 @@ % we can also move the lookups to the fonts.namespace (of commands) % one can also directly use the clf calls when speed is needed -\def\dolookupfontbyspec #1{\clf_fontlookupinitialize{#1}} -\def\dolookupnoffound {\clf_fontlookupnoffound} -\def\dolookupgetkeyofindex#1#2{\clf_fontlookupgetkeyofindex{#1}\numexpr#2\relax} -\def\dolookupgetkey #1{\clf_fontlookupgetkey{#1}} -\def\cleanfontname #1{\clf_cleanfontname{#1}} + \def\dolookupfontbyspec #1{\clf_fontlookupinitialize{#1}} + \def\dolookupnoffound {\clf_fontlookupnoffound} + \def\dolookupgetkeyofindex#1#2{\clf_fontlookupgetkeyofindex{#1}\numexpr#2\relax} + \def\dolookupgetkey #1{\clf_fontlookupgetkey{#1}} + \def\cleanfontname #1{\clf_cleanfontname{#1}} +\unexpanded\def\setfontofid #1{\clf_setfontofid\numexpr#1\relax} -% new: - -\unexpanded\def\setfontofid#1{\ctf_setfontofid#1\relax} \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/font-nod.lua b/Master/texmf-dist/tex/context/base/font-nod.lua index 26c736582b1..e2000be7ebd 100644 --- a/Master/texmf-dist/tex/context/base/font-nod.lua +++ b/Master/texmf-dist/tex/context/base/font-nod.lua @@ -376,8 +376,13 @@ function step_tracers.codes(i,command,space) if w then context.startcolor(colors[what]) context("%s:",what) - for c in traverse_id(glyph_code,w) do - showchar(c) + for c in traverse_nodes(w) do + local id = getid(c) + if id == glyph_code then + showchar(c) + else + context("[%s]",nodecodes[id]) + end end context[space]() context.stopcolor() diff --git a/Master/texmf-dist/tex/context/base/font-odv.lua b/Master/texmf-dist/tex/context/base/font-odv.lua index 40b1efbb4a9..ca1b9ddf0c8 100644 --- a/Master/texmf-dist/tex/context/base/font-odv.lua +++ b/Master/texmf-dist/tex/context/base/font-odv.lua @@ -127,6 +127,8 @@ local free_node = nuts.free local remove_node = nuts.remove local flush_list = nuts.flush_list +local copyinjection = nodes.injections.copy -- KE: is this necessary? HH: probably not as positioning comes later and we rawget/set + local unsetvalue = attributes.unsetvalue local fontdata = fonts.hashes.identifiers @@ -157,7 +159,7 @@ local fontprocesses = fonts.hashes.processes local xprocesscharacters = nil xprocesscharacters = function(head,font) - xprocesscharacters = nodes.handlers.characters + xprocesscharacters = nodes.handlers.nodepass return xprocesscharacters(head,font) end @@ -469,6 +471,7 @@ local sequence_reorder_matras = { features = { dv01 = dev2_defaults }, flags = false_flags, name = "dv01_reorder_matras", + order = { "dv01" }, subtables = { "dv01_reorder_matras" }, type = "devanagari_reorder_matras", } @@ -478,6 +481,7 @@ local sequence_reorder_reph = { features = { dv02 = dev2_defaults }, flags = false_flags, name = "dv02_reorder_reph", + order = { "dv02" }, subtables = { "dv02_reorder_reph" }, type = "devanagari_reorder_reph", } @@ -487,6 +491,7 @@ local sequence_reorder_pre_base_reordering_consonants = { features = { dv03 = dev2_defaults }, flags = false_flags, name = "dv03_reorder_pre_base_reordering_consonants", + order = { "dv03" }, subtables = { "dv03_reorder_pre_base_reordering_consonants" }, type = "devanagari_reorder_pre_base_reordering_consonants", } @@ -496,6 +501,7 @@ local sequence_remove_joiners = { features = { dv04 = deva_defaults }, flags = false_flags, name = "dv04_remove_joiners", + order = { "dv04" }, subtables = { "dv04_remove_joiners" }, type = "devanagari_remove_joiners", } @@ -698,7 +704,9 @@ local function deva_reorder(head,start,stop,font,attr,nbspaces) local tmp = next and getnext(next) or nil -- needs checking local changestop = next == stop local tempcurrent = copy_node(next) + copyinjection(tempcurrent,next) local nextcurrent = copy_node(current) + copyinjection(nextcurrent,current) -- KE: necessary? HH: probably not as positioning comes later and we rawget/set setfield(tempcurrent,"next",nextcurrent) setfield(nextcurrent,"prev",tempcurrent) setprop(tempcurrent,a_state,s_blwf) @@ -707,10 +715,11 @@ local function deva_reorder(head,start,stop,font,attr,nbspaces) if getchar(next) == getchar(tempcurrent) then flush_list(tempcurrent) local n = copy_node(current) + copyinjection(n,current) -- KE: necessary? HH: probably not as positioning comes later and we rawget/set setfield(current,"char",dotted_circle) head = insert_node_after(head, current, n) else - setfield(current,"char",getchar(tempcurrent)) -- (assumes that result of blwf consists of one node) + setfield(current,"char",getchar(tempcurrent)) -- we assumes that the result of blwf consists of one node local freenode = getnext(current) setfield(current,"next",tmp) if tmp then @@ -1525,16 +1534,15 @@ local function dev2_reorder(head,start,stop,font,attr,nbspaces) -- maybe do a pa current = getnext(getnext(start)) end - local function stand_alone(is_nbsp) + if current ~= getnext(stop) and getchar(current) == c_nbsp then + -- Stand Alone cluster if current == stop then stop = getprev(stop) head = remove_node(head,current) free_node(current) return head, stop, nbspaces else - if is_nbsp then - nbspaces = nbspaces + 1 - end + nbspaces = nbspaces + 1 base = current current = getnext(current) if current ~= stop then @@ -1561,6 +1569,7 @@ local function dev2_reorder(head,start,stop,font,attr,nbspaces) -- maybe do a pa if halant[getchar(current)] then setfield(getnext(current),"next",tmp) local nc = copy_node(current) + copyinjection(nc,current) setfield(current,"char",dotted_circle) head = insert_node_after(head,current,nc) else @@ -1573,14 +1582,6 @@ local function dev2_reorder(head,start,stop,font,attr,nbspaces) -- maybe do a pa end end end - end - - if current ~= getnext(stop) then - -- Stand Alone cluster - stand_alone() - elseif getchar(current) == c_nbsp then - -- Stand Alone cluster - stand_alone(true) else -- not Stand Alone cluster local last = getnext(stop) while current ~= last do -- find base consonant @@ -1636,6 +1637,7 @@ local function dev2_reorder(head,start,stop,font,attr,nbspaces) -- maybe do a pa local tpm = twopart_mark[char] if tpm then local extra = copy_node(current) + copyinjection(extra,current) char = tpm[1] setfield(current,"char",char) setfield(extra,"char",tpm[2]) @@ -2070,6 +2072,7 @@ end local function inject_syntax_error(head,current,mark) local signal = copy_node(current) + copyinjection(signal,current) if mark == pre_mark then setfield(signal,"char",dotted_circle) else diff --git a/Master/texmf-dist/tex/context/base/font-otn.lua b/Master/texmf-dist/tex/context/base/font-otn.lua index 52fcbcbd6cd..440eb34ec8e 100644 --- a/Master/texmf-dist/tex/context/base/font-otn.lua +++ b/Master/texmf-dist/tex/context/base/font-otn.lua @@ -2732,7 +2732,7 @@ local function discrun(disc,drun,krun) setfield(pre,"prev",nest) setfield(prev,"next",disc) else - run(pre,"preinjections") + krun(pre,"preinjections") end return next end diff --git a/Master/texmf-dist/tex/context/base/font-pre.mkiv b/Master/texmf-dist/tex/context/base/font-pre.mkiv index c184a2118db..0bf0f6f791e 100644 --- a/Master/texmf-dist/tex/context/base/font-pre.mkiv +++ b/Master/texmf-dist/tex/context/base/font-pre.mkiv @@ -193,6 +193,32 @@ tjmo=yes, vjmo=yes] +% cjk + +% \definefontfeature +% [japanese] +% [default] +% [language=jan] + +% \definefontfeature +% [simplified-chinese] +% [default] +% [language=zhs] + +% \definefontfeature +% [traditional-chinese] +% [default] +% [language=zht] + +% \definefontfeature +% [chinese] +% [simplified-chinese] + +% \definefontfeature +% [korean] +% [default] +% [language=kor] + % symbols: \definefontfeature @@ -324,6 +350,23 @@ \definecolor[font:8] [g=.75] \definecolor[font:9] [b=.75] +\definecolor[f:r:t][a=1,t=.25,r=1] +\definecolor[f:g:t][a=1,t=.25,g=1] +\definecolor[f:b:t][a=1,t=.25,b=1] +\definecolor[f:c:t][a=1,t=.25,c=1] +\definecolor[f:m:t][a=1,t=.25,m=1] +\definecolor[f:y:t][a=1,t=.25,y=1] +\definecolor[f:k:t][a=1,t=.25,s=0] +\definecolor[f:s:t][a=1,t=.25,s=0] + +\definepalet % weird place + [layout] + [grid=trace:dr, + page=trace:dg, + profile=f:s:t, + one=f:y:t, + mix=f:b:t] + %D Now we're up to some definitions. \definebodyfontenvironment diff --git a/Master/texmf-dist/tex/context/base/font-sol.lua b/Master/texmf-dist/tex/context/base/font-sol.lua index bbb2997f42b..0761724f1f2 100644 --- a/Master/texmf-dist/tex/context/base/font-sol.lua +++ b/Master/texmf-dist/tex/context/base/font-sol.lua @@ -507,7 +507,7 @@ local function collect_words(list) -- can be made faster for attributes words[w] = { index, first, last } index = nil first = nil - if id == disc_node then + if id == disc_code then if trace_split then report_splitters("skipped: disc node") end diff --git a/Master/texmf-dist/tex/context/base/font-tra.mkiv b/Master/texmf-dist/tex/context/base/font-tra.mkiv index b0c3ae55b5a..3d6811a6428 100644 --- a/Master/texmf-dist/tex/context/base/font-tra.mkiv +++ b/Master/texmf-dist/tex/context/base/font-tra.mkiv @@ -280,6 +280,7 @@ % \setupcolors[\c!state=\v!start]% \setupalign[\v!verytolerant,\v!flushleft]% \startotfsample + \nohyphens \global\setbox\otfcompositionbox\hbox{\definedfont[#1]\relax\getvalue{\??otfcompositiondir#2}\relax#3}% \stopotfsample \endgroup} diff --git a/Master/texmf-dist/tex/context/base/l-lpeg.lua b/Master/texmf-dist/tex/context/base/l-lpeg.lua index 4aadadb727c..55a0d892988 100644 --- a/Master/texmf-dist/tex/context/base/l-lpeg.lua +++ b/Master/texmf-dist/tex/context/base/l-lpeg.lua @@ -10,6 +10,8 @@ if not modules then modules = { } end modules ['l-lpeg'] = { -- if i can use new features like capture / 2 and .B (at first sight the xml -- parser is some 5% slower) +-- lpeg.P("abc") is faster than lpeg.P("a") * lpeg.P("b") * lpeg.P("c") + -- a new lpeg fails on a #(1-P(":")) test and really needs a + P(-1) -- move utf -> l-unicode @@ -19,7 +21,7 @@ lpeg = require("lpeg") -- The latest lpeg doesn't have print any more, and even the new ones are not -- available by default (only when debug mode is enabled), which is a pitty as --- as it helps nailign down bottlenecks. Performance seems comparable: some 10% +-- as it helps nailing down bottlenecks. Performance seems comparable: some 10% -- slower pattern compilation, same parsing speed, although, -- -- local p = lpeg.C(lpeg.P(1)^0 * lpeg.P(-1)) @@ -841,7 +843,6 @@ local function make(t) local function making(t) local p = p_false local keys = sortedkeys(t) --- local okay = t[""] for i=1,#keys do local k = keys[i] if k ~= "" then @@ -850,8 +851,6 @@ local function make(t) p = p + P(k) * p_true elseif v == false then -- can't happen --- elseif okay then --- p = p + P(k) * (making(v) + p_true) else p = p + P(k) * making(v) end @@ -872,8 +871,6 @@ local function make(t) p = p + P(k) * p_true elseif v == false then -- can't happen --- elseif v[""] then --- p = p + P(k) * (making(v) + p_true) else p = p + P(k) * making(v) end @@ -882,6 +879,33 @@ local function make(t) return p end +local function collapse(t,x) + if type(t) ~= "table" then + return t, x + else + local n = next(t) + if n == nil then + return t, x + elseif next(t,n) == nil then + -- one entry + local k = n + local v = t[k] + if type(v) == "table" then + return collapse(v,x..k) + else + return v, x .. k + end + else + local tt = { } + for k, v in next, t do + local vv, kk = collapse(v,k) + tt[kk] = vv + end + return tt, x + end + end +end + function lpeg.utfchartabletopattern(list) -- goes to util-lpg local tree = { } local n = #list @@ -955,10 +979,14 @@ function lpeg.utfchartabletopattern(list) -- goes to util-lpg end end end +-- collapse(tree,"") -- needs testing, maybe optional, slightly faster because P("x")*P("X") seems slower than P"(xX") (why) -- inspect(tree) return make(tree) end +-- local t = { "start", "stoep", "staart", "paard" } +-- local p = lpeg.Cs((lpeg.utfchartabletopattern(t)/string.upper + 1)^1) + -- local t = { "a", "abc", "ac", "abe", "abxyz", "xy", "bef","aa" } -- local p = lpeg.Cs((lpeg.utfchartabletopattern(t)/string.upper + 1)^1) diff --git a/Master/texmf-dist/tex/context/base/l-os.lua b/Master/texmf-dist/tex/context/base/l-os.lua index f44b31662aa..0a86ea6d697 100644 --- a/Master/texmf-dist/tex/context/base/l-os.lua +++ b/Master/texmf-dist/tex/context/base/l-os.lua @@ -349,6 +349,8 @@ else end +os.newline = name == "windows" and "\013\010" or "\010" -- crlf or lf + function resolvers.bits(t,k) local bits = find(os.platform,"64",1,true) and 64 or 32 os.bits = bits diff --git a/Master/texmf-dist/tex/context/base/l-unicode.lua b/Master/texmf-dist/tex/context/base/l-unicode.lua index 02dd1a00304..70b60324ac2 100644 --- a/Master/texmf-dist/tex/context/base/l-unicode.lua +++ b/Master/texmf-dist/tex/context/base/l-unicode.lua @@ -418,9 +418,11 @@ if not utf.sub then end end - local pattern_zero = Cmt(p_utf8char,slide_zero)^0 - local pattern_one = Cmt(p_utf8char,slide_one )^0 - local pattern_two = Cmt(p_utf8char,slide_two )^0 + local pattern_zero = Cmt(p_utf8char,slide_zero)^0 + local pattern_one = Cmt(p_utf8char,slide_one )^0 + local pattern_two = Cmt(p_utf8char,slide_two )^0 + + local pattern_first = C(patterns.utf8character) function utf.sub(str,start,stop) if not start then @@ -463,7 +465,9 @@ if not utf.sub then end end end - if start > stop then + if start == 1 and stop == 1 then + return lpegmatch(pattern_first,str) or "" + elseif start > stop then return "" elseif start > 1 then b, e, n, first, last = 0, 0, 0, start - 1, stop diff --git a/Master/texmf-dist/tex/context/base/lpdf-xmp.lua b/Master/texmf-dist/tex/context/base/lpdf-xmp.lua index b44c57b42aa..b1a795c4b77 100644 --- a/Master/texmf-dist/tex/context/base/lpdf-xmp.lua +++ b/Master/texmf-dist/tex/context/base/lpdf-xmp.lua @@ -152,7 +152,8 @@ end local t = { } for i=1,24 do t[i] = random() end local function flushxmpinfo() - commands.freezerandomseed(os.clock()) -- hack + commands.pushrandomseed() + commands.setrandomseed(os.time()) local t = { } for i=1,24 do t[i] = char(96 + random(26)) end local packetid = concat(t) @@ -201,7 +202,7 @@ local function flushxmpinfo() local r = pdfflushstreamobject(blob,md,false) -- uncompressed lpdf.addtocatalog("Metadata",pdfreference(r)) - commands.defrostrandomseed() -- hack + commands.poprandomseed() -- hack end -- his will be enabled when we can inhibit compression for a stream at the lua end diff --git a/Master/texmf-dist/tex/context/base/lxml-aux.lua b/Master/texmf-dist/tex/context/base/lxml-aux.lua index f6816ccb6b0..8eedade392c 100644 --- a/Master/texmf-dist/tex/context/base/lxml-aux.lua +++ b/Master/texmf-dist/tex/context/base/lxml-aux.lua @@ -427,6 +427,14 @@ local function include(xmldata,pattern,attribute,recursive,loaddata,level) else xmldata.settings.inclusions = { name } end + if child.er then + local badinclusions = xmldata.settings.badinclusions + if badinclusions then + badinclusions[#badinclusions+1] = name + else + xmldata.settings.badinclusions = { name } + end + end end end end @@ -447,11 +455,11 @@ function xml.inclusion(e,default) return default end -function xml.inclusions(e,sorted) +local function getinclusions(key,e,sorted) while e do local settings = e.settings if settings then - local inclusions = settings.inclusions + local inclusions = settings[key] if inclusions then inclusions = table.unique(inclusions) -- a copy if sorted then @@ -467,6 +475,14 @@ function xml.inclusions(e,sorted) end end +function xml.inclusions(e,sorted) + return getinclusions("inclusions",e,sorted) +end + +function xml.badinclusions(e,sorted) + return getinclusions("badinclusions",e,sorted) +end + local b_collapser = lpeg.patterns.b_collapser local m_collapser = lpeg.patterns.m_collapser local e_collapser = lpeg.patterns.e_collapser diff --git a/Master/texmf-dist/tex/context/base/lxml-ini.lua b/Master/texmf-dist/tex/context/base/lxml-ini.lua index 64e78eb42c8..2f63c857f70 100644 --- a/Master/texmf-dist/tex/context/base/lxml-ini.lua +++ b/Master/texmf-dist/tex/context/base/lxml-ini.lua @@ -71,6 +71,7 @@ implement { name = "xmlinclude", actions = lxml.include, implement { name = "xmlincludeoptions", actions = lxml.include, arguments = { "string", "string", "string", "string" } } implement { name = "xmlinclusion", actions = lxml.inclusion, arguments = "string" } implement { name = "xmlinclusions", actions = lxml.inclusions, arguments = "string" } +implement { name = "xmlbadinclusions", actions = lxml.badinclusions, arguments = "string" } implement { name = "xmlindex", actions = lxml.index, arguments = { "string", "string", "string" } } -- can be integer but now we can alias implement { name = "xmlinfo", actions = lxml.info, arguments = "string" } implement { name = "xmlinlineverbatim", actions = lxml.inlineverbatim, arguments = "string" } diff --git a/Master/texmf-dist/tex/context/base/lxml-ini.mkiv b/Master/texmf-dist/tex/context/base/lxml-ini.mkiv index 1141288992e..5ef4245a236 100644 --- a/Master/texmf-dist/tex/context/base/lxml-ini.mkiv +++ b/Master/texmf-dist/tex/context/base/lxml-ini.mkiv @@ -65,6 +65,7 @@ %def\xmlincludeoptions#1#2#3#4{\clf_xmlincludeoptions {#1}{#2}{#3}{#4}} %def\xmlinclusion #1{\clf_xmlinclusion {#1}} %def\xmlinclusions #1{\clf_xmlinclusions {#1}} +%def\xmlbadinclusions #1{\clf_xmlbadinclusions {#1}} %def\xmlindex #1#2#3{\clf_xmlindex {#1}{#2}{#3}} %let\xmlposition \xmlindex %def\xmlinlineverbatim #1{\clf_xmlinlineverbatim {#1}} @@ -134,6 +135,7 @@ \let\xmlincludeoptions \clf_xmlincludeoptions \let\xmlinclusion \clf_xmlinclusion \let\xmlinclusions \clf_xmlinclusions +\let\xmlbadinclusions \clf_xmlbadinclusions \let\xmlindex \clf_xmlindex \let\xmlposition \clf_xmlindex \let\xmlinlineverbatim \clf_xmlinlineverbatim diff --git a/Master/texmf-dist/tex/context/base/lxml-tab.lua b/Master/texmf-dist/tex/context/base/lxml-tab.lua index 0a72640d086..47e2cac6196 100644 --- a/Master/texmf-dist/tex/context/base/lxml-tab.lua +++ b/Master/texmf-dist/tex/context/base/lxml-tab.lua @@ -243,8 +243,10 @@ local function add_end(spacing, namespace, tag) top = stack[#stack] if #stack < 1 then errorstr = formatters["unable to close %s %s"](tag,xml.checkerror(top,toclose) or "") + report_xml(errorstr) elseif toclose.tg ~= tag then -- no namespace check errorstr = formatters["unable to close %s with %s %s"](toclose.tg,tag,xml.checkerror(top,toclose) or "") + report_xml(errorstr) end dt = top.dt dt[#dt+1] = toclose @@ -254,11 +256,38 @@ local function add_end(spacing, namespace, tag) end end +-- local function add_text(text) +-- if cleanup and #text > 0 then +-- dt[#dt+1] = cleanup(text) +-- else +-- dt[#dt+1] = text +-- end +-- end + local function add_text(text) + local n = #dt if cleanup and #text > 0 then - dt[#dt+1] = cleanup(text) + if n > 0 then + local s = dt[n] + if type(s) == "string" then + dt[n] = s .. cleanup(text) + else + dt[n+1] = cleanup(text) + end + else + dt[1] = cleanup(text) + end else - dt[#dt+1] = text + if n > 0 then + local s = dt[n] + if type(s) == "string" then + dt[n] = s .. text + else + dt[n+1] = text + end + else + dt[1] = text + end end end @@ -297,8 +326,11 @@ local function attribute_specification_error(str) return str end +local badentity = "&error;" +local badentity = "&" + xml.placeholders = { - unknown_dec_entity = function(str) return str == "" and "&error;" or formatters["&%s;"](str) end, + unknown_dec_entity = function(str) return str == "" and badentity or formatters["&%s;"](str) end, unknown_hex_entity = function(str) return formatters["&#x%s;"](str) end, unknown_any_entity = function(str) return formatters["&#x%s;"](str) end, } @@ -516,7 +548,7 @@ local function handle_any_entity(str) report_xml("keeping entity &%s;",str) end if str == "" then - a = "&error;" + a = badentity else a = "&" .. str .. ";" end @@ -545,7 +577,7 @@ local function handle_any_entity(str) if trace_entities then report_xml("invalid entity &%s;",str) end - a = "&error;" + a = badentity acache[str] = a else if trace_entities then @@ -560,8 +592,19 @@ local function handle_any_entity(str) end end -local function handle_end_entity(chr) - report_xml("error in entity, %a found instead of %a",chr,";") +-- local function handle_end_entity(chr) +-- report_xml("error in entity, %a found instead of %a",chr,";") +-- end + +local function handle_end_entity(str) + report_xml("error in entity, %a found without ending %a",str,";") + return str +end + +local function handle_crap_error(chr) + report_xml("error in parsing, unexpected %a found ",chr) + add_text(chr) + return chr end local space = S(' \r\n\t') @@ -582,14 +625,16 @@ local utfbom = lpegpatterns.utfbom -- no capture local spacing = C(space^0) ----- entitycontent = (1-open-semicolon)^0 -local anyentitycontent = (1-open-semicolon-space-close)^0 +local anyentitycontent = (1-open-semicolon-space-close-ampersand)^0 local hexentitycontent = R("AF","af","09")^0 local decentitycontent = R("09")^0 local parsedentity = P("#")/"" * ( P("x")/"" * (hexentitycontent/handle_hex_entity) + (decentitycontent/handle_dec_entity) ) + (anyentitycontent/handle_any_entity) -local entity = ampersand/"" * parsedentity * ( (semicolon/"") + #(P(1)/handle_end_entity)) +----- entity = ampersand/"" * parsedentity * ( (semicolon/"") + #(P(1)/handle_end_entity)) +local entity = (ampersand/"") * parsedentity * (semicolon/"") + + ampersand * (anyentitycontent / handle_end_entity) local text_unparsed = C((1-open)^1) local text_parsed = Cs(((1-open-ampersand)^1 + entity)^1) @@ -622,6 +667,8 @@ local emptyelement = (spacing * open * name * attributes * optionals local beginelement = (spacing * open * name * attributes * optionalspace * close) / add_begin local endelement = (spacing * open * slash * name * optionalspace * close) / add_end +-- todo: combine the opens in: + local begincomment = open * P("!--") local endcomment = P("--") * close local begininstruction = open * P("?") @@ -667,6 +714,14 @@ local comment = (spacing * begincomment * somecomment * endcomm local cdata = (spacing * begincdata * somecdata * endcdata ) / function(...) add_special("@cd@",...) end local doctype = (spacing * begindoctype * somedoctype * enddoctype ) / function(...) add_special("@dt@",...) end +-- local text_unparsed = C((1-open)^1) +-- local text_parsed = Cs(((1-open-ampersand)^1 + entity)^1) + +local crap_parsed = 1 - beginelement - endelement - emptyelement - begininstruction - begincomment - begincdata - ampersand +local crap_unparsed = 1 - beginelement - endelement - emptyelement - begininstruction - begincomment - begincdata +local parsedcrap = Cs((crap_parsed^1 + entity)^1) / handle_crap_error +local unparsedcrap = Cs((crap_unparsed )^1) / handle_crap_error + -- nicer but slower: -- -- local instruction = (Cc("@pi@") * spacing * begininstruction * someinstruction * endinstruction) / add_special @@ -683,13 +738,13 @@ local trailer = space^0 * (text_unparsed/set_message)^0 local grammar_parsed_text = P { "preamble", preamble = utfbom^0 * instruction^0 * (doctype + comment + instruction)^0 * V("parent") * trailer, parent = beginelement * V("children")^0 * endelement, - children = parsedtext + V("parent") + emptyelement + comment + cdata + instruction, + children = parsedtext + V("parent") + emptyelement + comment + cdata + instruction + parsedcrap, } local grammar_unparsed_text = P { "preamble", preamble = utfbom^0 * instruction^0 * (doctype + comment + instruction)^0 * V("parent") * trailer, parent = beginelement * V("children")^0 * endelement, - children = unparsedtext + V("parent") + emptyelement + comment + cdata + instruction, + children = unparsedtext + V("parent") + emptyelement + comment + cdata + instruction + unparsedcrap, } -- maybe we will add settings to result as well @@ -729,7 +784,7 @@ local function _xmlconvert_(data, settings) errorstr = "empty xml file" elseif utfize or resolve then if lpegmatch(grammar_parsed_text,data) then - errorstr = "" + -- errorstr = "" can be set! else errorstr = "invalid xml file - parsed text" end @@ -745,6 +800,8 @@ local function _xmlconvert_(data, settings) local result if errorstr and errorstr ~= "" then result = { dt = { { ns = "", tg = "error", dt = { errorstr }, at={ }, er = true } } } +setmetatable(result, mt) +setmetatable(result.dt[1], mt) setmetatable(stack, mt) local errorhandler = settings.error_handler if errorhandler == false then diff --git a/Master/texmf-dist/tex/context/base/lxml-tex.lua b/Master/texmf-dist/tex/context/base/lxml-tex.lua index adb849347e1..9e540fe7c69 100644 --- a/Master/texmf-dist/tex/context/base/lxml-tex.lua +++ b/Master/texmf-dist/tex/context/base/lxml-tex.lua @@ -49,6 +49,7 @@ local xmlprivatecodes = xml.privatecodes local xmlstripelement = xml.stripelement local xmlinclusion = xml.inclusion local xmlinclusions = xml.inclusions +local xmlbadinclusions = xml.badinclusions local xmlcontent = xml.content local variables = interfaces and interfaces.variables or { } @@ -519,7 +520,14 @@ end function lxml.inclusions(id,sorted) local inclusions = xmlinclusions(getid(id),sorted) if inclusions then - context(table.concat(inclusions,",")) + context(concat(inclusions,",")) + end +end + +function lxml.badinclusions(id,sorted) + local badinclusions = xmlbadinclusions(getid(id),sorted) + if badinclusions then + context(concat(badinclusions,",")) end end @@ -1205,12 +1213,12 @@ local function command(collected,cmd,otherwise) local e = collected[c] local ix = e.ix local name = e.name - if not ix then + if name and not ix then lxml.addindex(name,false,true) ix = e.ix end - if not ix then - report_lxml("no valid node index for element %a in command %s",name,cmd) + if not ix or not name then + report_lxml("no valid node index for element %a using command %s",name or "?",cmd) elseif wildcard then contextsprint(ctxcatcodes,"\\xmlw{",(gsub(cmd,"%*",e.tg)),"}{",name,"::",ix,"}") else diff --git a/Master/texmf-dist/tex/context/base/m-punk.mkiv b/Master/texmf-dist/tex/context/base/m-punk.mkiv index 6bf92e4c0f3..c8021a92f4e 100644 --- a/Master/texmf-dist/tex/context/base/m-punk.mkiv +++ b/Master/texmf-dist/tex/context/base/m-punk.mkiv @@ -162,6 +162,7 @@ function fonts.handlers.vf.combiner.commands.metafont(g,v) end g.properties.virtualized = true g.variants = list + print(g) end fonts.definers.methods.install( "punk", { @@ -177,14 +178,29 @@ fonts.definers.methods.install( "punkboldslanted", { { "metafont", "mfplain", "punkfont-boldslanted.mp", 10 }, } ) -typesetters.cases.register("RandomPunk", function(current) - local used = fontdata[current.font].variants +-- typesetters.cases.register("RandomPunk", function(current) +-- local used = fontdata[current].variants +-- if used then +-- local f = math.random(1,#used) +-- current.font = used[f] +-- return current, true +-- else +-- return current, false +-- end +-- end) + +local getfont = nodes.nuts.getfont +local setfield = nodes.nuts.setfield +local random = math.random + +typesetters.cases.register("RandomPunk", function(start) + local used = fontdata[getfont(start)].variants if used then - local f = math.random(1,#used) - current.font = used[f] - return current, true + local f = random(1,#used) + setfield(start,"font",used[f]) + return start, true else - return current, false + return start, false end end) @@ -214,7 +230,7 @@ end) \unexpanded\def\StartRandomPunk {\begingroup\EnableRandomPunk} \unexpanded\def\StopRandomPunk {\endgroup} -\starttypescript [serif] [punk] [default] +\starttypescript [serif] [punk] \definefontsynonym [Serif] [demo@punk] \definefontsynonym [SerifBold] [demobold@punkbold] \definefontsynonym [SerifSlanted] [demoslanted@punkslanted] diff --git a/Master/texmf-dist/tex/context/base/math-noa.lua b/Master/texmf-dist/tex/context/base/math-noa.lua index 893ee6f48d3..cdbbe36c377 100644 --- a/Master/texmf-dist/tex/context/base/math-noa.lua +++ b/Master/texmf-dist/tex/context/base/math-noa.lua @@ -231,6 +231,48 @@ end noads.process = processnoads +-- + +local unknowns = { } +local checked = { } -- simple case +local tracked = false trackers.register("fonts.missing", function(v) tracked = v end) +local cached = table.setmetatableindex("table") -- complex case + +local function errorchar(font,char) + local done = unknowns[char] + if done then + unknowns[char] = done + 1 + else + unknowns[char] = 1 + end + if tracked then + -- slower as we check each font too and we always replace as math has + -- more demands than text + local fake = cached[font][char] + if fake then + return fake + else + local kind, fake = fonts.checkers.placeholder(font,char) + if not fake or kind ~= "char" then + fake = 0x3F + end + cached[font][char] = fake + return fake + end + else + -- only simple checking, report at the end so one should take + -- action anyway ... we can miss a few checks but that is ok + -- as there is at least one reported + if not checked[char] then + if trace_normalizing then + report_normalizing("character %C is not available",char) + end + checked[char] = true + end + return 0x3F + end +end + -- experiment (when not present fall back to fam 0) -- needs documentation -- 0-2 regular @@ -377,8 +419,12 @@ local function checked(pointer) end processors.relocate[math_char] = function(pointer) - local g = getattr(pointer,a_mathgreek) or 0 - local a = getattr(pointer,a_mathalphabet) or 0 + local g = getattr(pointer,a_mathgreek) or 0 + local a = getattr(pointer,a_mathalphabet) or 0 + local char = getchar(pointer) + local fam = getfield(pointer,"fam") + local font = font_of_family(fam) + local characters = fontcharacters[font] if a > 0 or g > 0 then if a > 0 then setattr(pointer,a_mathgreek,0) @@ -386,15 +432,11 @@ processors.relocate[math_char] = function(pointer) if g > 0 then setattr(pointer,a_mathalphabet,0) end - local char = getchar(pointer) local newchar = remapalphabets(char,a,g) if newchar then - local fam = getfield(pointer,"fam") - local id = font_of_family(fam) - local characters = fontcharacters[id] if characters[newchar] then if trace_remapping then - report_remap("char",id,char,newchar) + report_remap("char",font,char,newchar) end if trace_analyzing then setnodecolor(pointer,"font:isol") @@ -408,7 +450,7 @@ processors.relocate[math_char] = function(pointer) if newchar then if characters[newchar] then if trace_remapping then - report_remap("char",id,char,newchar," (fallback remapping used)") + report_remap("char",font,char,newchar," (fallback remapping used)") end if trace_analyzing then setnodecolor(pointer,"font:isol") @@ -416,17 +458,20 @@ processors.relocate[math_char] = function(pointer) setfield(pointer,"char",newchar) return true elseif trace_remapping then - report_remap("char",id,char,newchar," fails (no fallback character)") + report_remap("char",font,char,newchar," fails (no fallback character)") end elseif trace_remapping then - report_remap("char",id,char,newchar," fails (no fallback remap character)") + report_remap("char",font,char,newchar," fails (no fallback remap character)") end elseif trace_remapping then - report_remap("char",id,char,newchar," fails (no fallback style)") + report_remap("char",font,char,newchar," fails (no fallback style)") end end end end + if not characters[char] then + setfield(pointer,"char",errorchar(font,char)) + end if trace_analyzing then setnodecolor(pointer,"font:medi") end @@ -466,9 +511,9 @@ processors.render[math_char] = function(pointer) if renderset then local newchar = renderset[char] if newchar then - local fam = getfield(pointer,"fam") - local id = font_of_family(fam) - local characters = fontcharacters[id] + local fam = getfield(pointer,"fam") + local font = font_of_family(fam) + local characters = fontcharacters[font] if characters and characters[newchar] then setfield(pointer,"char",newchar) setattr(pointer,a_exportstatus,char) @@ -524,15 +569,11 @@ end -- normalize scripts -local unscript = { } noads.processors.unscript = unscript -local checkers = { } noads.processors.checkers = checkers - +local unscript = { } noads.processors.unscript = unscript local superscripts = characters.superscripts local subscripts = characters.subscripts local fractions = characters.fractions - -local replaced = { } -local unknowns = { } +local replaced = { } local function replace(pointer,what,n,parent) pointer = parent -- we're following the parent list (chars trigger this) @@ -611,63 +652,11 @@ local function replace(pointer,what,n,parent) -- we could return stop end -local tracked = false trackers.register("fonts.missing", function(v) tracked = v end) -local checked = { } -- simple case -local cached = table.setmetatableindex("table") -- complex case - -local function check(pointer,what,n,parent) - if tracked then - -- slower as we check each font too and we always replace as math has - -- more demands than text - local char = getchar(pointer) - local font = font_of_family(getfield(pointer,"fam")) - local fake = cached[font][char] - if fake then - unknowns[char] = unknowns[char] + 1 - setfield(pointer,"char",fake) - else - local chars = fontcharacters[font] - if not chars[char] then - unknowns[char] = 1 - local kind, fake = fonts.checkers.placeholder(font,char) - if kind == "char" then - cached[font][char] = fake - setfield(pointer,"char",fake) - else - cached[font][char] = 0x3F - end - end - end - else - -- only simple checking, report at the end so one should take - -- action anyway ... we can miss a few checks but that is ok - -- as there is at least one reported - local char = getchar(pointer) - local done = unknowns[char] - if done then - unknowns[char] = done + 1 - setfield(pointer,"char",0x3F) - elseif not checked[char] then - local font = font_of_family(getfield(pointer,"fam")) - local chars = fontcharacters[font] - if not chars[char] then - unknowns[char] = 1 - setfield(pointer,"char",0x3F) - if trace_normalizing then - report_normalizing("character %C is not available",char) - end - end - end - checked[char] = true - end -end - unscript[math_char] = replace -- not noads as we need to recurse -checkers[math_char] = check -- not noads as we need to recurse function handlers.unscript(head,style,penalties) processnoads(head,unscript,"unscript") - processnoads(head,checkers,"checkers") +-- processnoads(head,checkers,"checkers") return true end diff --git a/Master/texmf-dist/tex/context/base/math-tag.lua b/Master/texmf-dist/tex/context/base/math-tag.lua index 61d28edde61..0d900b3a1a3 100644 --- a/Master/texmf-dist/tex/context/base/math-tag.lua +++ b/Master/texmf-dist/tex/context/base/math-tag.lua @@ -315,7 +315,7 @@ process = function(start) -- we cannot use the processor as we have no finalizer runner(getlist(n),depth+1) elseif id == glyph_code then runner(getfield(n,"components"),depth+1) -- this should not be needed - elseif id == disc_node then + elseif id == disc_code then runner(getfield(n,"pre"),depth+1) -- idem runner(getfield(n,"post"),depth+1) -- idem runner(getfield(n,"replace"),depth+1) -- idem diff --git a/Master/texmf-dist/tex/context/base/meta-ini.mkiv b/Master/texmf-dist/tex/context/base/meta-ini.mkiv index c3b94f899cd..299f37cef04 100644 --- a/Master/texmf-dist/tex/context/base/meta-ini.mkiv +++ b/Master/texmf-dist/tex/context/base/meta-ini.mkiv @@ -336,12 +336,14 @@ \newif\ifsetMPrandomseed \setMPrandomseedtrue % false by default +\let\theMPrandomseed\empty + \def\setMPrandomseed - {\let\theMPrandomseed\empty - \ifsetMPrandomseed \ifx\getrandomnumber\undefined \else - \getrandomnumber\localMPseed\zerocount{4095}% - \def\theMPrandomseed{randomseed:=\localMPseed}% - \fi\fi} + {\ifsetMPrandomseed + \def\theMPrandomseed{randomseed:=\mprandomnumber;}% + \else + \let\theMPrandomseed\empty + \fi} %D Calling up previously defined graphics. diff --git a/Master/texmf-dist/tex/context/base/mlib-int.lua b/Master/texmf-dist/tex/context/base/mlib-int.lua index 43bf14d3831..6d219fe0490 100644 --- a/Master/texmf-dist/tex/context/base/mlib-int.lua +++ b/Master/texmf-dist/tex/context/base/mlib-int.lua @@ -101,9 +101,13 @@ end -- locals -mp.OnRightPage = function() mpprint(structures.pages.on_right()) end -- needs checking -mp.OnOddPage = function() mpprint(structures.pages.is_odd ()) end -- needs checking -mp.InPageBody = function() mpprint(structures.pages.in_body ()) end -- needs checking +local on_right = structures.pages.on_right +local is_odd = structures.pages.is_odd +local in_body = structures.pages.in_body + +mp.OnRightPage = function() mpprint(on_right()) end -- needs checking +mp.OnOddPage = function() mpprint(is_odd ()) end -- needs checking +mp.InPageBody = function() mpprint(in_body ()) end -- needs checking -- mp.CurrentLayout : \currentlayout diff --git a/Master/texmf-dist/tex/context/base/mtx-context-listing.tex b/Master/texmf-dist/tex/context/base/mtx-context-listing.tex index a38fc60a9df..583aa2b8f95 100644 --- a/Master/texmf-dist/tex/context/base/mtx-context-listing.tex +++ b/Master/texmf-dist/tex/context/base/mtx-context-listing.tex @@ -92,7 +92,8 @@ if document.arguments.sort then table.sort(document.files) end - for _, filename in ipairs(document.files) do + for i=1,#document.files do + local filename = document.files[i] if not string.find(filename,"^mtx%-context%-") then local pretty = document.arguments.pretty if pretty == true then diff --git a/Master/texmf-dist/tex/context/base/mult-def.mkiv b/Master/texmf-dist/tex/context/base/mult-def.mkiv index 6efeb30694c..607f76a167a 100644 --- a/Master/texmf-dist/tex/context/base/mult-def.mkiv +++ b/Master/texmf-dist/tex/context/base/mult-def.mkiv @@ -46,6 +46,8 @@ \def\c!nextleftquotation {nextleftquotation} \def\c!nextrightquotation{nextrightquotation} +\def\c!profile {profile} + \def\c!fences {fences} \def\c!words {words} \def\c!characters {characters} diff --git a/Master/texmf-dist/tex/context/base/mult-sys.mkiv b/Master/texmf-dist/tex/context/base/mult-sys.mkiv index 63a89492a7f..b1475f2dcfc 100644 --- a/Master/texmf-dist/tex/context/base/mult-sys.mkiv +++ b/Master/texmf-dist/tex/context/base/mult-sys.mkiv @@ -274,6 +274,7 @@ \definesystemconstant {list} \definesystemconstant {register} \definesystemconstant {author} +\definesystemconstant {numbering} % \def\s!parent{->} % 1% faster / => does not work in assignments % \def\s!child {<-} % 1% faster / <= does not work in assignments diff --git a/Master/texmf-dist/tex/context/base/node-ltp.lua b/Master/texmf-dist/tex/context/base/node-ltp.lua index 9529213fc37..e4956f7df8e 100644 --- a/Master/texmf-dist/tex/context/base/node-ltp.lua +++ b/Master/texmf-dist/tex/context/base/node-ltp.lua @@ -406,24 +406,8 @@ end -- resolvers -- -local whatsitters = { - get_width = { }, - get_dimensions = { }, -} - -local get_whatsit_width = whatsitters.get_width -local get_whatsit_dimensions = whatsitters.get_dimensions - -local function get_width (n,dir) return getfield(n,"width") end -local function get_dimensions(n,dir) return getfield(n,"width"), getfield(n,"height"), getfield(n,"depth") end - -get_whatsit_width[pdfrefximage_code] = get_width -get_whatsit_width[pdfrefxform_code ] = get_width - -get_whatsit_dimensions[pdfrefximage_code] = get_dimensions -get_whatsit_dimensions[pdfrefxform_code ] = get_dimensions - -nodes.whatsitters = whatsitters +local get_whatsit_width = nodes.whatsitters.getters.width +local get_whatsit_dimensions = nodes.whatsitters.getters.dimensions -- expansion etc -- diff --git a/Master/texmf-dist/tex/context/base/node-nut.lua b/Master/texmf-dist/tex/context/base/node-nut.lua index 32f2d57ec32..b133c4e7484 100644 --- a/Master/texmf-dist/tex/context/base/node-nut.lua +++ b/Master/texmf-dist/tex/context/base/node-nut.lua @@ -752,3 +752,39 @@ function nuts.copy_properties(source,target,what) end return newprops -- for checking end + +-- a bit special + +local getwidth = { } +local setwidth = { } +local getdimensions = { } +local setdimensions = { } + +nodes.whatsitters = { + getters = { width = getwidth, dimensions = getdimensions }, + setters = { width = setwidth, dimensions = setdimensions }, +} + +-- this might move (in fact forms and images will become nodes) + +local function get_width(n,dir) + n = tonut(n) + return getfield(n,"width") +end + +local function get_dimensions(n,dir) + n = tonut(n) + return getfield(n,"width"), getfield(n,"height"), getfield(n,"depth") +end + +local whatcodes = nodes.whatcodes +local pdfrefximage_code = whatcodes.pdfrefximage +local pdfrefxform_code = whatcodes.pdfrefxform + +getwidth [pdfrefximage_code] = get_width +getwidth [pdfrefxform_code ] = get_width + +getdimensions[pdfrefximage_code] = get_dimensions +getdimensions[pdfrefxform_code ] = get_dimensions + + diff --git a/Master/texmf-dist/tex/context/base/node-ppt.lua b/Master/texmf-dist/tex/context/base/node-ppt.lua index c8cba8566b3..5e7abeaae79 100644 --- a/Master/texmf-dist/tex/context/base/node-ppt.lua +++ b/Master/texmf-dist/tex/context/base/node-ppt.lua @@ -58,7 +58,7 @@ local cache = { } local nofslots = 0 local property_id = nodepool.userids["property"] -local properties = nodes.properties if not properties then return end -- temp +local properties = nodes.properties local propertydata = properties.data local starttiming = statistics.starttiming diff --git a/Master/texmf-dist/tex/context/base/node-ref.lua b/Master/texmf-dist/tex/context/base/node-ref.lua index 9703cc184a9..97c37c74e40 100644 --- a/Master/texmf-dist/tex/context/base/node-ref.lua +++ b/Master/texmf-dist/tex/context/base/node-ref.lua @@ -451,7 +451,6 @@ local function addstring(what,str,shift) --todo make a pluggable helper (in font end local text = typesetters.fast_hpack(str,infofont) local rule = new_rule(emwidth/5,4*exheight,3*exheight) - local list = getlist(text) setfield(text,"shift",shift) return nuts.fasthpack(nuts.linked(text,rule)) -- local text = typesetters.fast_hpack(str,fonts.infofont()) diff --git a/Master/texmf-dist/tex/context/base/pack-rul.mkiv b/Master/texmf-dist/tex/context/base/pack-rul.mkiv index 141d741cf8d..5f72a1113fa 100644 --- a/Master/texmf-dist/tex/context/base/pack-rul.mkiv +++ b/Master/texmf-dist/tex/context/base/pack-rul.mkiv @@ -1498,10 +1498,20 @@ \pack_framed_reshape_reset \fi} +\def\pack_framed_profile_box + {\profilegivenbox\p_profile\b_framed_normal + \setbox\b_framed_normal\vbox{\unvbox\b_framed_normal}} + \unexpanded\def\pack_framed_finish {%\pack_framed_stop_orientation % hm, wrong place ! should rotate the result (after reshape) .. moved down \pack_framed_locator_before\p_framed_location \ifconditional\c_framed_has_format + \ifconditional\c_framed_has_height \else + \edef\p_profile{\framedparameter\c!profile}% + \ifx\p_profile\empty\else + \pack_framed_profile_box + \fi + \fi \ifx\p_framed_autowidth\v!force \pack_framed_finish_a \else\ifx\localwidth\v!fit @@ -2115,7 +2125,8 @@ \def\pack_framed_do_setups {\ifx\p_framed_setups\empty \else - \setups[\p_framed_setups]% \texsetup + \setups[\p_framed_setups]% \texsetup (or only one!) + % \fastsetup\p_framed_setup % singular would have been better \fi} \def\pack_framed_format_format_yes diff --git a/Master/texmf-dist/tex/context/base/page-grd.mkiv b/Master/texmf-dist/tex/context/base/page-grd.mkiv index 281d0bfbe3c..e70414b666c 100644 --- a/Master/texmf-dist/tex/context/base/page-grd.mkiv +++ b/Master/texmf-dist/tex/context/base/page-grd.mkiv @@ -15,22 +15,19 @@ \unprotect -\definepalet - [layout] - [grid=red, - page=green] - \newconstant\c_page_grids_location \newconstant\c_page_grids_line_mode \newconstant\c_page_grids_lineno_mode +\newconstant\c_page_grids_columns_mode \unexpanded\def\showgrid {\dosingleempty\page_grids_show} \def\page_grids_show[#1]% - {\c_page_grids_location \plusone % downward compatible default - \c_page_grids_line_mode \plusone - \c_page_grids_lineno_mode\plusone + {\c_page_grids_location \plusone % downward compatible default + \c_page_grids_line_mode \plusone + \c_page_grids_lineno_mode \plusone + \c_page_grids_columns_mode\plusone \processallactionsinset [#1]% [ \v!reset=>\c_page_grids_location \zerocount, @@ -48,14 +45,24 @@ \let\page_grids_add_to_box\gobbleoneargument \else % 1=bottom 2=top \let\page_grids_add_to_box\page_grids_add_to_box_indeed + \fi + \ifcase\c_page_grids_columns_mode + \let\page_grids_add_to_one\gobbleoneargument + \let\page_grids_add_to_mix\gobbleoneargument + \else + \let\page_grids_add_to_one\page_grids_add_to_one_indeed + \let\page_grids_add_to_mix\page_grids_add_to_mix_indeed \fi} % if really needed for speed we can cache the grid \let\page_grids_add_to_box\gobbleoneargument +\let\page_grids_add_to_one\gobbleoneargument +\let\page_grids_add_to_mix\gobbleoneargument \def\page_grids_add_to_box_indeed#1% to be checked for color and layer ..... use mp {\startcolor[layout:grid]% + \resetvisualizers \gridboxlinemode \c_page_grids_line_mode \gridboxlinenomode\c_page_grids_lineno_mode \setgridbox\scratchbox\makeupwidth\textheight % todo: check color @@ -82,4 +89,16 @@ \ifcase\c_page_grids_location\or\hskip-\makeupwidth\box#1\fi}% \stopcolor} +\def\page_grids_add_to_one_indeed#1% + {\begingroup + \resetvisualizers + \global\setbox#1\vbox{\backgroundline[layout:one]{\box#1}}% + \endgroup} + +\def\page_grids_add_to_mix_indeed#1% + {\begingroup + \resetvisualizers + \global\setbox#1\vbox{\backgroundline[layout:mix]{\box#1}}% + \endgroup} + \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/page-mix.lua b/Master/texmf-dist/tex/context/base/page-mix.lua index 2bf89f73778..61a4f944d9e 100644 --- a/Master/texmf-dist/tex/context/base/page-mix.lua +++ b/Master/texmf-dist/tex/context/base/page-mix.lua @@ -258,22 +258,22 @@ local function preparesplit(specification) -- a rather large function if splitmethod == v_none then splitmethod = false end - local options = settings_to_hash(specification.option or "") + local options = settings_to_hash(specification.option or "") local stripbottom = specification.alternative == v_local - local cycle = specification.cycle or 1 - local nofcolumns = specification.nofcolumns or 1 + local cycle = specification.cycle or 1 + local nofcolumns = specification.nofcolumns or 1 if nofcolumns == 0 then nofcolumns = 1 end local preheight = specification.preheight or 0 - local extra = specification.extra or 0 + local extra = specification.extra or 0 local maxheight = specification.maxheight - local optimal = originalheight/nofcolumns + local optimal = originalheight/nofcolumns if specification.balance ~= v_yes then optimal = maxheight end - local target = optimal + extra - local overflow = target > maxheight - preheight + local target = optimal + extra + local overflow = target > maxheight - preheight local threshold = specification.threshold or 0 if overflow then target = maxheight - preheight @@ -484,7 +484,15 @@ local function preparesplit(specification) -- a rather large function end height = height + depth + skip depth = 0 +if advance < 0 then + height = height + advance + skip = 0 + if height < 0 then + height = 0 + end +else skip = height > 0 and advance or 0 +end if trace_state then report_state("%-7s > column %s, height %p, depth %p, skip %p","glue",column,height,depth,skip) end @@ -602,7 +610,8 @@ local function preparesplit(specification) -- a rather large function local nxtid = nxt and getid(nxt) line = line + 1 local inserts, currentskips, nextskips, inserttotal = nil, 0, 0, 0 - local advance = getfield(current,"height") -- + getfield(current,"depth") + local advance = getfield(current,"height") +-- + getfield(current,"depth") -- when > strutdp if trace_state then report_state("%-7s > column %s, content: %s","line",column,listtoutf(getlist(current),true,true)) end diff --git a/Master/texmf-dist/tex/context/base/page-mix.mkiv b/Master/texmf-dist/tex/context/base/page-mix.mkiv index b545e8f4c97..6d7f144a662 100644 --- a/Master/texmf-dist/tex/context/base/page-mix.mkiv +++ b/Master/texmf-dist/tex/context/base/page-mix.mkiv @@ -172,6 +172,14 @@ \c!internalgrid=\v!halfline, % new, we may still revert to \v!line \c!balance=\v!yes] +% better + +\setupmixedcolumns + [\s!itemgroupcolumns] + [\c!splitmethod=\v!fixed, + \c!grid=\v!yes, + \c!internalgrid=\v!line] + \unexpanded\def\strc_itemgroups_start_columns {\startmixedcolumns[\s!itemgroupcolumns]} % we could have a fast one @@ -199,11 +207,6 @@ %D The interceptor is quite simple, at least for the moment. -% \def\page_mix_routine_intercept -% {\global\setbox\b_page_mix_preceding\vbox -% {\page_otr_command_flush_top_insertions -% \unvbox\normalpagebox}} - \def\page_mix_routine_intercept {\ifdim\pagetotal>\pagegoal % testcase: preceding-001 ... if we don't do this, text can disappear as @@ -443,8 +446,7 @@ [\s!itemgroupcolumns] [\c!grid=\itemgroupparameter\c!grid] -\setupitemgroups - [\c!grid=\v!tolerant] +% better %D The common initialization: @@ -471,6 +473,8 @@ % \insidecolumnstrue % new % + \useprofileparameter\mixedcolumnsparameter % new + % \nofcolumns\c_page_mix_n_of_columns} % public %D The otr method related hooks are defined next: @@ -484,23 +488,44 @@ \newcount\c_page_mix_otr_nesting +% \setvalue{\??mixedcolumnsbefore\s!otr}% +% {\par +% \global\advance\c_page_mix_otr_nesting\plusone +% \ifcase\c_page_mix_otr_nesting\or +% \ifdim\pagetotal=\zeropoint \else +% \obeydepth % we could handle this in pre material +% \fi +% \fi} + \setvalue{\??mixedcolumnsbefore\s!otr}% {\par \global\advance\c_page_mix_otr_nesting\plusone \ifcase\c_page_mix_otr_nesting\or \ifdim\pagetotal=\zeropoint \else - \obeydepth % we could handle this in pre material + % make sure that whitespace an dblanks are done + \strut + \vskip-\lineheight + % no, bad spacing: \obeydepth % we could handle this in pre material \fi \fi} \setvalue{\??mixedcolumnsstart\s!otr}% {\ifcase\c_page_mix_otr_nesting\or + \scratchwidth\textwidth \setupoutputroutine[\s!mixedcolumn]% \c_page_mix_routine\c_page_mix_routine_intercept \page_otr_trigger_output_routine % \holdinginserts\maxdimen % + \ifvoid\b_page_mix_preceding \else + % moved here, before the packaging + \page_postprocessors_linenumbers_deepbox\b_page_mix_preceding + % we need to avoid unvboxing with successive balanced on one page + \global\setbox\b_page_mix_preceding\vbox{\box\b_page_mix_preceding}% + \wd\b_page_mix_preceding\scratchwidth % \makeupwidth + \page_grids_add_to_one\b_page_mix_preceding + \fi \global\d_page_mix_preceding_height\ht\b_page_mix_preceding \c_page_mix_routine\c_page_mix_routine_continue % @@ -574,7 +599,7 @@ % backgrounds \anch_mark_column_box\scratchbox % for the moment a quick and dirty patch .. we need to go into the box (hence the \plusone) .. a slowdowner - \page_lines_add_numbers_to_box\scratchbox\recurselevel\c_page_mix_n_of_columns\plusone + % moved to start: \page_lines_add_numbers_to_box\scratchbox\recurselevel\c_page_mix_n_of_columns\plusone % the framed needs a reset of strut, align, setups etc \mixedcolumnseparatorheight\ht\scratchbox \mixedcolumnseparatordepth \dp\scratchbox @@ -593,9 +618,13 @@ \setbox\b_page_mix_collected\vbox \bgroup \ifvoid\b_page_mix_preceding \else \page_postprocessors_linenumbers_deepbox\b_page_mix_preceding - \box\b_page_mix_preceding + \vbox\bgroup + \box\b_page_mix_preceding + \egroup \global\d_page_mix_preceding_height\zeropoint \nointerlineskip + % no no: + % \prevdepth\strutdepth \fi \hskip\d_page_mix_leftskip \page_mix_hbox to \d_page_mix_max_width \bgroup @@ -648,6 +677,7 @@ \page_otr_command_set_hsize \par %writestatus\m!columns{flush balance}% + \page_grids_add_to_mix\b_page_mix_collected % no linenumbers here \box\b_page_mix_collected \vskip\zeropoint % triggers recalculation of page stuff (weird that this is needed but it *is* needed, see mixed-001.tex) \par @@ -730,11 +760,32 @@ \letvalue{\??mixedcolumnsbefore\s!box}\donothing \letvalue{\??mixedcolumnsafter \s!box}\donothing +% \setvalue{\??mixedcolumnsstart\s!box}% +% {\edef\p_page_mix_strut{\mixedcolumnsparameter\c!strut}% +% \setbox\b_page_mix_collected\vbox\bgroup +% \let\currentoutputroutine\s!mixedcolumn % makes \column work +% \forgetall +% \page_mix_command_set_hsize +% \ifx\p_page_mix_strut\v!yes +% \begstrut +% \ignorespaces +% \fi} +% +% \setvalue{\??mixedcolumnsstop\s!box}% +% {\ifx\p_page_mix_strut\v!yes +% \removeunwantedspaces +% \endstrut +% \fi +% \egroup +% \page_mix_box_balance} + \setvalue{\??mixedcolumnsstart\s!box}% {\edef\p_page_mix_strut{\mixedcolumnsparameter\c!strut}% - \setbox\b_page_mix_collected\vbox\bgroup + \setbox\b_page_mix_collected\vbox \bgroup \let\currentoutputroutine\s!mixedcolumn % makes \column work \forgetall + \usegridparameter\mixedcolumnsparameter + % \useprofileparameter\mixedcolumnsparameter \page_mix_command_set_hsize \ifx\p_page_mix_strut\v!yes \begstrut @@ -747,6 +798,16 @@ \endstrut \fi \egroup + \edef\p_profile{\mixedcolumnsparameter\c!profile}% + \ifx\p_profile\empty \else + % this can never be ok because we cheat with depth and height + % and glue in between and when we're too large we run into issues + % so mayb best limit correction to one line + \profilegivenbox\p_profile\b_page_mix_collected + \setbox\b_page_mix_collected\vbox{\unvbox\b_page_mix_collected}% + % tracing + % \addprofiletobox\b_page_mix_collected + \fi \page_mix_box_balance} %D The related balancer is only a few lines: diff --git a/Master/texmf-dist/tex/context/base/page-set.mkiv b/Master/texmf-dist/tex/context/base/page-set.mkiv index 8f63dd74e22..a5afb92e951 100644 --- a/Master/texmf-dist/tex/context/base/page-set.mkiv +++ b/Master/texmf-dist/tex/context/base/page-set.mkiv @@ -2645,8 +2645,6 @@ % \chapter{thuan} \dorecurse{25}{\input thuan \endgraf\placefigure{}{}} % \stopcolumnset -\unprotect - % only in columnsets % \def\cornerfigure diff --git a/Master/texmf-dist/tex/context/base/page-sid.mkiv b/Master/texmf-dist/tex/context/base/page-sid.mkiv index cbdb95fc371..42c676be5c9 100644 --- a/Master/texmf-dist/tex/context/base/page-sid.mkiv +++ b/Master/texmf-dist/tex/context/base/page-sid.mkiv @@ -363,10 +363,10 @@ \page_otr_sides_pop_penalties} \def\page_sides_output_routine_yes % we need to rework this ... add pagediscards and such - {\unvbox\normalpagebox + {\unvbox\normalpagebox % bah, and the discards? \setbox\b_page_sides_bottom\lastbox \ifdim\wd\b_page_sides_bottom>\d_page_sides_hsize - \penalty-201 + \penalty-201 % hm, i really need to write this from scatch \box\b_page_sides_bottom \else\ifvoid\b_page_sides_bottom \else @@ -663,7 +663,7 @@ \def\page_sides_prepare_space {\par - \whitespace + % no longer needed \whitespace \begingroup \forgetall \reseteverypar @@ -771,13 +771,15 @@ \fi} \def\page_sides_inject_dummy_lines - {\scratchcounter\pageshrink + {\begingroup + \scratchcounter\pageshrink \divide\scratchcounter \baselineskip \advance\scratchcounter \plusone \parskip\zeropoint \dorecurse\scratchcounter{\hbox to \hsize{}}% \kern-\scratchcounter\baselineskip - \penalty\zerocount} + \penalty\zerocount + \endgroup} % Display math % diff --git a/Master/texmf-dist/tex/context/base/publ-aut.lua b/Master/texmf-dist/tex/context/base/publ-aut.lua index 820ac78ff3b..4ab8dd4bc93 100644 --- a/Master/texmf-dist/tex/context/base/publ-aut.lua +++ b/Master/texmf-dist/tex/context/base/publ-aut.lua @@ -16,9 +16,10 @@ local lpeg = lpeg local type, next, tostring = type, next, tostring local concat = table.concat local utfchar = utf.char +local utfsub = utf.sub local formatters = string.formatters -local P, C, V, Cs, Ct, Cg, Cf, Cc = lpeg.P, lpeg.C, lpeg.V, lpeg.Cs, lpeg.Ct, lpeg.Cg, lpeg.Cf, lpeg.Cc +local P, S, C, V, Cs, Ct, Cg, Cf, Cc = lpeg.P, lpeg.S, lpeg.C, lpeg.V, lpeg.Cs, lpeg.Ct, lpeg.Cg, lpeg.Cf, lpeg.Cc local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns local context = context @@ -36,7 +37,10 @@ local allocate = utilities.storage.allocate local chardata = characters.data +local trace_hashing = false trackers.register("publications.authorhash", function(v) trace_hashing = v end) + local report = logs.reporter("publications","authors") +local report_cite = logs.reporter("publications","cite") -- local function makesplitter(separator) -- return Ct { "start", @@ -99,7 +103,7 @@ end -- local cleaner = Cs( ( P("{}")/"" + P(1) )^1 ) -local cache = { } -- 33% reuse on tugboat.bib +local cache = allocate() -- 33% reuse on tugboat.bib local nofhits = 0 local nofused = 0 @@ -115,6 +119,144 @@ local function makeinitials(firstnames) end end +local authormap = allocate() +publications.authormap = authormap + +local function splitauthor(author) + local detail = cache[author] + if detail then + return detail + end + local remapped = authormap[author] + if remapped then + report("remapping %a to %a",author,remapped) + local detail = cache[remapped] + if detail then + cache[author] = detail + return detail + end + end + local author = remapped or author + local firstnames, vons, surnames, initials, juniors, options + local split = lpegmatch(commasplitter,author) + local n = #split + detail = { + original = author, + snippets = n, + } + if n == 1 then + -- {First Middle von Last} + local words = lpegmatch(spacesplitter,author) + firstnames, vons, surnames = { }, { }, { } + local i, n = 1, #words + while i <= n do + local w = words[i] + if is_upper(w) then + firstnames[#firstnames+1], i = w, i + 1 + else + break + end + end + while i <= n do + local w = words[i] + if is_upper(w) then + break + else + vons[#vons+1], i = w, i + 1 + end + end + if i <= n then + while i <= n do + surnames[#surnames+1], i = words[i], i + 1 + end + elseif #vons == 0 then + surnames[1] = firstnames[#firstnames] + firstnames[#firstnames] = nil + else + -- mess + end + if #surnames == 0 then + -- safeguard + firstnames = { } + vons = { } + surnames = { author } + else + initials = makeinitials(firstnames) + end + elseif n == 2 then + -- {Last, First} + -- {von Last, First} + firstnames, vons, surnames = { }, { }, { } + local words = lpegmatch(spacesplitter,split[1]) + local i, n = 1, #words + while i <= n do + local w = words[i] + if is_upper(w) then + break + else + vons[#vons+1], i = w, i + 1 + end + end + while i <= n do + surnames[#surnames+1], i = words[i], i + 1 + end + -- + local words = lpegmatch(spacesplitter,split[2]) + local i, n = 1, #words + while i <= n do + local w = words[i] + if is_upper(w) then + firstnames[#firstnames+1], i = w, i + 1 + else + break + end + end + while i <= n do + vons[#vons+1], i = words[i], i + 1 + end + if surnames and firstnames and #surnames == 0 then + -- safeguard + surnames[1] = firstnames[#firstnames] + firstnames[#firstnames] = nil + end + initials = makeinitials(firstnames) + elseif n == 3 then + -- {von Last, First, Jr} + surnames = lpegmatch(spacesplitter,split[1]) + juniors = lpegmatch(spacesplitter,split[2]) + firstnames = lpegmatch(spacesplitter,split[3]) + initials = makeinitials(firstnames) + elseif n == 4 then + -- {Von, Last, First, Jr} + vons = lpegmatch(spacesplitter,split[1]) + surnames = lpegmatch(spacesplitter,split[2]) + juniors = lpegmatch(spacesplitter,split[3]) + firstnames = lpegmatch(spacesplitter,split[4]) + initials = makeinitials(firstnames) + elseif n >= 5 then + -- {Von, Last, First, Jr, F.} + -- {Von, Last, First, Jr, Fr., options} + vons = lpegmatch(spacesplitter,split[1]) + surnames = lpegmatch(spacesplitter,split[2]) + juniors = lpegmatch(spacesplitter,split[3]) + firstnames = lpegmatch(spacesplitter,split[4]) + initials = lpegmatch(spacesplitter,split[5]) + options = split[6] + if options then + options = lpegmatch(optionsplitter,options) + end + end + if firstnames and #firstnames > 0 then detail.firstnames = firstnames end + if vons and #vons > 0 then detail.vons = vons end + if surnames and #surnames > 0 then detail.surnames = surnames end + if initials and #initials > 0 then detail.initials = initials end + if juniors and #juniors > 0 then detail.juniors = juniors end + if options and next(options) then detail.options = options end + cache[author] = detail + nofhits = nofhits + 1 + return detail +end + local function splitauthorstring(str) if str then -- str = lpegmatch(cleaner,str) @@ -122,144 +264,32 @@ local function splitauthorstring(str) return end nofused = nofused + 1 + + local remapped = authormap[str] + if remapped then + local detail = cache[remapped] + if detail then + cache[str] = detail + return { detail } + end + end + local authors = cache[str] if authors then - -- hit 1 - -- print("hit 1",author,nofhits,nofused,math.round(100*nofhits/nofused)) return { authors } -- we assume one author end + + local authors = lpegmatch(andsplitter,str) for i=1,#authors do - local author = authors[i] - local detail = cache[author] - if detail then - -- hit 2 - -- print("hit 2",author,nofhits,nofused,math.round(100*nofhits/nofused)) - end - if not detail then - local firstnames, vons, surnames, initials, juniors, options - local split = lpegmatch(commasplitter,author) - local n = #split - detail = { - original = author, - snippets = n, - } - if n == 1 then - -- {First Middle von Last} - local words = lpegmatch(spacesplitter,author) - firstnames, vons, surnames = { }, { }, { } - local i, n = 1, #words - while i <= n do - local w = words[i] - if is_upper(w) then - firstnames[#firstnames+1], i = w, i + 1 - else - break - end - end - while i <= n do - local w = words[i] - if is_upper(w) then - break - else - vons[#vons+1], i = w, i + 1 - end - end - if i <= n then - while i <= n do - surnames[#surnames+1], i = words[i], i + 1 - end - elseif #vons == 0 then - surnames[1] = firstnames[#firstnames] - firstnames[#firstnames] = nil - else - -- mess - end - if #surnames == 0 then - -- safeguard - firstnames = { } - vons = { } - surnames = { author } - else - initials = makeinitials(firstnames) - end - elseif n == 2 then - -- {Last, First} - -- {von Last, First} - firstnames, vons, surnames = { }, { }, { } - local words = lpegmatch(spacesplitter,split[1]) - local i, n = 1, #words - while i <= n do - local w = words[i] - if is_upper(w) then - break - else - vons[#vons+1], i = w, i + 1 - end - end - while i <= n do - surnames[#surnames+1], i = words[i], i + 1 - end - -- - local words = lpegmatch(spacesplitter,split[2]) - local i, n = 1, #words - while i <= n do - local w = words[i] - if is_upper(w) then - firstnames[#firstnames+1], i = w, i + 1 - else - break - end - end - while i <= n do - vons[#vons+1], i = words[i], i + 1 - end - if surnames and firstnames and #surnames == 0 then - -- safeguard - surnames[1] = firstnames[#firstnames] - firstnames[#firstnames] = nil - end - initials = makeinitials(firstnames) - elseif n == 3 then - -- {von Last, First, Jr} - surnames = lpegmatch(spacesplitter,split[1]) - juniors = lpegmatch(spacesplitter,split[2]) - firstnames = lpegmatch(spacesplitter,split[3]) - initials = makeinitials(firstnames) - elseif n == 4 then - -- {Von, Last, First, Jr} - vons = lpegmatch(spacesplitter,split[1]) - surnames = lpegmatch(spacesplitter,split[2]) - juniors = lpegmatch(spacesplitter,split[3]) - firstnames = lpegmatch(spacesplitter,split[4]) - initials = makeinitials(firstnames) - elseif n >= 5 then - -- {Von, Last, First, Jr, F.} - -- {Von, Last, First, Jr, Fr., options} - vons = lpegmatch(spacesplitter,split[1]) - surnames = lpegmatch(spacesplitter,split[2]) - juniors = lpegmatch(spacesplitter,split[3]) - firstnames = lpegmatch(spacesplitter,split[4]) - initials = lpegmatch(spacesplitter,split[5]) - options = split[6] - if options then - options = lpegmatch(optionsplitter,options) - end - end - if firstnames and #firstnames > 0 then detail.firstnames = firstnames end - if vons and #vons > 0 then detail.vons = vons end - if surnames and #surnames > 0 then detail.surnames = surnames end - if initials and #initials > 0 then detail.initials = initials end - if juniors and #juniors > 0 then detail.juniors = juniors end - if options and next(options) then detail.options = options end - cache[author] = detail - nofhits = nofhits + 1 - end - authors[i] = detail + authors[i] = splitauthor(authors[i]) end return authors end +publications.splitoneauthor = splitauthor +publications.splitauthor = splitauthorstring + local function the_initials(initials,symbol,connector) if not symbol then symbol = "." @@ -323,8 +353,8 @@ local function value(i,field) end end -implement { name = "btxcurrentfirstnames", arguments = "integer", actions = function(i) local v = value(i,"initials") if v then context(concat(the_initials(v,currentauthorsymbol))) end end } -implement { name = "btxcurrentinitials", arguments = "integer", actions = function(i) local v = value(i,"firstnames") if v then context(concat(v," ")) end end } +implement { name = "btxcurrentfirstnames", arguments = "integer", actions = function(i) local v = value(i,"firstnames") if v then context(concat(v," ")) end end } +implement { name = "btxcurrentinitials", arguments = "integer", actions = function(i) local v = value(i,"initials") if v then context(concat(the_initials(v,currentauthorsymbol))) end end } implement { name = "btxcurrentjuniors", arguments = "integer", actions = function(i) local v = value(i,"juniors") if v then context(concat(v," ")) end end } implement { name = "btxcurrentsurnames", arguments = "integer", actions = function(i) local v = value(i,"surnames") if v then context(concat(v," ")) end end } implement { name = "btxcurrentvons", arguments = "integer", actions = function(i) local v = value(i,"vons") if v then context(concat(v," ")) end end } @@ -476,7 +506,12 @@ local collapsers = allocate { } publications.authorcollapsers = collapsers -local function default(author) +local function default(author) -- one author + local hash = author.hash + if hash then + return hash + end + local original = author.original local vons = author.vons local surnames = author.surnames local initials = author.initials @@ -485,26 +520,211 @@ local function default(author) local result = { } local nofresult = 0 if vons and #vons > 0 then - nofresult = nofresult + 1 ; result[nofresult] = concat(vons," ") + for j=1,#vons do + nofresult = nofresult + 1 + result[nofresult] = vons[j] + end end if surnames and #surnames > 0 then - nofresult = nofresult + 1 ; result[nofresult] = concat(surnames," ") + for j=1,#surnames do + nofresult = nofresult + 1 + result[nofresult] = surnames[j] + end end if initials and #initials > 0 then - nofresult = nofresult + 1 ; result[nofresult] = concat(the_initials(initials)," ") + initials = the_initials(initials) + for j=1,#initials do + nofresult = nofresult + 1 + result[nofresult] = initials[j] + end end if firstnames and #firstnames > 0 then - nofresult = nofresult + 1 ; result[nofresult] = concat(firstnames," ") + for j=1,#firstnames do + nofresult = nofresult + 1 + result[nofresult] = firstnames[j] + end end if juniors and #juniors > 0 then - nofresult = nofresult + 1 ; result[nofresult] = concat(juniors," ") + for j=1,#juniors do + nofresult = nofresult + 1 + result[nofresult] = juniors[j] + end + end + local hash = concat(result," ") + if trace_hashing then + report("hash: %s -> %s",original,hash) + end + author.hash = hash + return hash +end + +local authorhashers = { } +publications.authorhashers = authorhashers + +-- todo: some hashing + +local function name(authors) + local n = #authors + if n == 0 then + return "" + end + local result = { } + local nofresult = 0 + for i=1,n do + local author = authors[i] + local surnames = author.surnames + if surnames and #surnames > 0 then + for j=1,#surnames do + nofresult = nofresult + 1 + result[nofresult] = surnames[j] + end + end + end + return concat(result," ") +end + +table.setmetatableindex(authorhashers,function(t,k) + t[k] = name + return name +end) + +authorhashers.normal = function(authors) + local n = #authors + if n == 0 then + return "" + end + local result = { } + local nofresult = 0 + for i=1,n do + local author = authors[i] + local vons = author.vons + local surnames = author.surnames + local firstnames = author.firstnames + local juniors = author.juniors + if vons and #vons > 0 then + for j=1,#vons do + nofresult = nofresult + 1 + result[nofresult] = vons[j] + end + end + if surnames and #surnames > 0 then + for j=1,#surnames do + nofresult = nofresult + 1 + result[nofresult] = surnames[j] + end + end + if firstnames and #firstnames > 0 then + for j=1,#firstnames do + nofresult = nofresult + 1 + result[nofresult] = firstnames[j] + end + end + if juniors and #juniors > 0 then + for j=1,#juniors do + nofresult = nofresult + 1 + result[nofresult] = juniors[j] + end + end + end + return concat(result," ") +end + +authorhashers.normalshort = function(authors) + local n = #authors + if n == 0 then + return "" + end + local result = { } + local nofresult = 0 + for i=1,n do + local author = authors[i] + local vons = author.vons + local surnames = author.surnames + local initials = author.initials + local juniors = author.juniors + if vons and #vons > 0 then + for j=1,#vons do + nofresult = nofresult + 1 + result[nofresult] = vons[j] + end + end + if surnames and #surnames > 0 then + for j=1,#surnames do + nofresult = nofresult + 1 + result[nofresult] = surnames[j] + end + end + if initials and #initials > 0 then + initials = the_initials(initials) + for j=1,#initials do + nofresult = nofresult + 1 + result[nofresult] = initials[j] + end + end + if juniors and #juniors > 0 then + for j=1,#juniors do + nofresult = nofresult + 1 + result[nofresult] = juniors[j] + end + end end return concat(result," ") end +authorhashers.normalinverted = authorhashers.normal +authorhashers.invertedshort = authorhashers.normalshort + +local p_clean = Cs ( ( + P("\\btxcmd") / "" -- better keep the argument + + S("`~!@#$%^&*()_-+={}[]:;\"\'<>,.?/|\\") / "" + + lpeg.patterns.utf8character + )^1) + +authorhashers.short = function(authors) + -- a short is a real dumb hardcodes kind of tag and we only support + -- this one because some users might expect it, not because it makes + -- sense + local n = #authors + if n == 0 then + return "unk" + elseif n == 1 then + local surnames = authors[1].surnames + if not surnames or #surnames == 0 then + return "err" + else + local s = surnames[1] + local c = lpegmatch(p_clean,s) + if s ~= c then + report_cite("name %a cleaned to %a for short construction",s,c) + end + return utfsub(c,1,3) + end + else + local t = { } + for i=1,n do + if i > 3 then + t[#t+1] = "+" -- indeed + break + end + local surnames = authors[i].surnames + if not surnames or #surnames == 0 then + t[#t+1] = "?" + else + local s = surnames[1] + local c = lpegmatch(p_clean,s) + if s ~= c then + report_cite("name %a cleaned to %a for short construction",s,c) + end + t[#t+1] = utfsub(c,1,1) + end + end + return concat(t) + end +end + collapsers.default = default -local function writer(key,snippets) +local function authorwriter(key,index) if not key then return "" end @@ -514,8 +734,16 @@ local function writer(key,snippets) local n = #key if n == 0 then return "" + end + if index then + if not key[index] then + return "" + end elseif n == 1 then - local author = key[1] + index = 1 + end + if index then + local author = key[index] local options = author.options if options then for option in next, options do @@ -525,32 +753,43 @@ local function writer(key,snippets) end end end - return default(author) - else - local t = { } - local s = 0 - for i=1,n do - local author = key[i] - local options = author.options - s = s + 1 - if options then - local done = false - for option in next, options do - local collapse = collapsers[option] - if collapse then - t[s] = collapse(author) - done = true - end - end - if not done then - t[s] = default(author) + local hash = default(author) + -- if trace_hashing then + -- report("hash: %s",hash) + -- end + return hash + end + local t = { } + local s = 0 + for i=1,n do + local author = key[i] + local options = author.options + s = s + 1 + if options then + local done = false + for option in next, options do + local collapse = collapsers[option] + if collapse then + t[s] = collapse(author) + done = true end - else + end + if not done then t[s] = default(author) end + else + t[s] = default(author) end - return concat(t," & ") end + local hash = concat(t," & ") + -- if trace_hashing then + -- report("hash: %s",hash) + -- end + return hash +end + +local function writer(key) + return authorwriter(key) -- discard extra arguments in the caller end publications.writers .author = writer @@ -573,13 +812,22 @@ publications.sortmethods.authoryear = { { field = "key", default = "", unknown = "" }, { field = "author", default = "", unknown = "" }, { field = "year", default = "9998", unknown = "9999" }, - { field = "suffix", default = " ", unknown = " " }, + -- { field = "suffix", default = " ", unknown = " " }, { field = "month", default = "13", unknown = "14" }, { field = "day", default = "32", unknown = "33" }, { field = "journal", default = "", unknown = "" }, { field = "volume", default = "", unknown = "" }, - { field = "number", default = "", unknown = "" }, - { field = "title", default = "", unknown = "" }, + -- { field = "number", default = "", unknown = "" }, { field = "pages", default = "", unknown = "" }, + { field = "title", default = "", unknown = "" }, + { field = "index", default = "", unknown = "" }, }, } + +implement { + name = "btxremapauthor", + arguments = { "string", "string" }, + actions = function(k,v) + publications.authormap[k] = v + end +} diff --git a/Master/texmf-dist/tex/context/base/publ-dat.lua b/Master/texmf-dist/tex/context/base/publ-dat.lua index 957322f7c2c..494a13d3c35 100644 --- a/Master/texmf-dist/tex/context/base/publ-dat.lua +++ b/Master/texmf-dist/tex/context/base/publ-dat.lua @@ -381,6 +381,7 @@ function publications.new(name) specifications = { -- used specifications }, + suffixed = false, } -- we delay details till we need it (maybe we just delay the -- individual fields but that is tricky as there can be some @@ -401,10 +402,13 @@ end) local function getindex(dataset,luadata,tag) local found = luadata[tag] if found then - return found.index or 0 + local index = found.index or 0 + dataset.ordered[tag] = index + return index else local index = dataset.nofentries + 1 dataset.nofentries = index + dataset.ordered[index] = tag return index end end @@ -676,7 +680,7 @@ do r = r + 1 ; result[r] = "<?xml version='1.0' standalone='yes'?>" r = r + 1 ; result[r] = "<bibtex>" -- - if nice then + if nice then -- will be default local f_entry_start = formatters[" <entry tag='%s' category='%s' index='%s'>"] local s_entry_stop = " </entry>" local f_field = formatters[" <field name='%s'>%s</field>"] @@ -836,7 +840,8 @@ do end if data then local luadata = current.luadata - for tag, entry in next, data do + -- we want the same index each run + for tag, entry in sortedhash(data) do if type(entry) == "table" then entry.index = getindex(current,luadata,tag) entry.tag = tag @@ -935,12 +940,13 @@ do function enhancers.order(dataset) local luadata = dataset.luadata - local ordered = sortedkeys(luadata) - local total = #ordered - for i=1,total do - ordered[i] = luadata[ordered[i]] + local ordered = dataset.ordered + for i=1,#ordered do + local tag = ordered[i] + if type(tag) == "string" then + ordered[i] = luadata[tag] + end end - dataset.ordered = ordered end function enhancers.details(dataset) diff --git a/Master/texmf-dist/tex/context/base/publ-fnd.lua b/Master/texmf-dist/tex/context/base/publ-fnd.lua index 909b102dba2..32d0c11beed 100644 --- a/Master/texmf-dist/tex/context/base/publ-fnd.lua +++ b/Master/texmf-dist/tex/context/base/publ-fnd.lua @@ -45,93 +45,6 @@ local word = Cs(lpegpatterns.unquoted + lpegpatterns.argument + valid^1) local simple = C(valid^1) local number = C(valid^1) ------ f_string_key = formatters[" local s_%s = entry[%q] if s_%s then s_%s = lower(s_%s) end "] ------ f_number_key = formatters[" local n_%s = tonumber(entry[%q]) or 0"] ------ f_field_key = formatters[" local f_%s = entry[%q] or ''"] - --- getfuzzy(entry,%q,categories) - --- local f_string_key = formatters[" local s_%s = get(entry,%q)\n if s_%s then s_%s = lower(s_%s) end"] --- local f_field_key = formatters[" local f_%s = get(entry,%q) or ''"] --- local f_field_key_c = formatters[" local c_%s = get(entry,%q,categories) or ''"] --- local f_number_key = formatters[" local n_%s = tonumber(get(entry,%q)) or 0"] --- --- local f_string_match = formatters["(s_%s and find(s_%s,%q))"] --- local f_number_match = formatters["(n_%s and n_%s >= %s and n_%s <= %s)"] --- local f_field_match = formatters["f_%s"] --- local f_field_match_c = formatters["c_%s"] --- --- local f_all_match = formatters["anywhere(entry,%q)"] - --- topattern(lowercase(word)) : utflowercase + only *? - --- local match = ( (key + wildcard) * (colon/"") ) * word * Carg(1) / function(key,_,word,keys) --- if key == "*" or key == "any" then --- keys.anywhere = true --- if word == "" or word == "*" then --- return "true" --- else --- return f_all_match(topattern(lowercase(word))) --- end --- else --- keys[key] = f_string_key(key,key,key,key,key) --- return f_string_match(key,key,topattern(lowercase(word))) --- end --- end --- --- local default = simple * Carg(1) / function(word,keys) --- keys.anywhere = true --- if word == "" or word == "*" then --- return "true" --- else --- return f_all_match(topattern(lowercase(word))) --- end --- end --- --- local range = key * (colon/"") * number * (dash/"") * number * Carg(1) / function(key,_,first,_,last,keys) --- keys[key] = f_number_key(key,key) --- return f_number_match(key,key,tonumber(first) or 0,key,tonumber(last) or 0) --- end --- --- local field = (P("field:")/"") * key * Carg(1) / function(_,key,keys) --- keys[key] = f_field_key(key,key) --- return f_field_match(key) --- end --- --- local cast = (P("cast:")/"") * key * Carg(1) / function(_,key,keys) --- keys[key] = f_field_key_c(key,key) --- return f_field_match_c(key) --- end --- --- local compare = C("==") + P("=")/"==" + P("!=")/"~=" + P("<>")/"~=" --- --- local b_match = lparent --- local e_match = rparent * space^0 * (#P(-1) + P(",")/" or ") -- maybe also + -> and --- local f_match = ((field + cast + range + match + space + compare + P(1))-e_match)^1 --- local p_match = b_match * default * e_match --- + b_match * f_match * e_match --- --- local pattern = Cs(Cc("(") * (P("match")/"" * space^0 * p_match)^1 * Cc(")")) - --- field contains fieldname:nonspaces|"whatever"|'whatever'|{whatever} --- field exact fieldname=nonspaces|"whatever"|'whatever'|{whatever} --- set contains [fieldname]:nonspaces|"whatever"|'whatever'|{whatever} --- set exact [fieldname]=nonspaces|"whatever"|'whatever'|{whatever} --- --- with * : any sequence --- ? : one character --- --- and match(),match() ... equivalent to () and () --- --- <123 444> : range --- --- unquoted = field --- [..] = set --- --- () and or not --- --- spaces are mandate (at least for now) - local key = C(R("az","AZ")^1) local contains = S(":~") local exact = P("=") diff --git a/Master/texmf-dist/tex/context/base/publ-imp-apa.lua b/Master/texmf-dist/tex/context/base/publ-imp-apa.lua index c5d2512fd50..1d894f261e1 100644 --- a/Master/texmf-dist/tex/context/base/publ-imp-apa.lua +++ b/Master/texmf-dist/tex/context/base/publ-imp-apa.lua @@ -432,10 +432,12 @@ categories.electronic = { categories.film = { sets = { doi = generic.doi, + author = { "producer", "director", }, }, required = { - "producer", "director", - "title", "year", + "author", + "title", + "year", "address", "publisher", -- aka studio }, optional = { diff --git a/Master/texmf-dist/tex/context/base/publ-imp-apa.mkvi b/Master/texmf-dist/tex/context/base/publ-imp-apa.mkvi index a1814b0a48b..7cab4a131ac 100644 --- a/Master/texmf-dist/tex/context/base/publ-imp-apa.mkvi +++ b/Master/texmf-dist/tex/context/base/publ-imp-apa.mkvi @@ -22,7 +22,7 @@ %D edition ={Sixth}, %D address ={Washington, DC}, %D publisher={American Psychological Association}, -%D pages ={291}, +%D Xpages ={291}, %D url ={http://www.apa.org/books/}, %D } %D \stopTEX @@ -50,9 +50,9 @@ \setupbtxlist [apa] [\c!alternative=\v!paragraph, - \c!width=\v!fit, - \c!distance=.5\emwidth, - \c!margin=3\emwidth] + %\c!width=\v!fit, + %\c!distance=.5\emwidth, + \c!margin=3.5\emwidth] \definebtx [apa:list] @@ -88,12 +88,24 @@ [apa:list] \definebtx - [apa:list:invertedshort] + [apa:list:numbering] [apa:list] \definebtx - [apa:list:short] - [apa:list] + [apa:list:numbering:num] + [apa:list:numbering] + +\definebtx + [apa:list:numbering:yes] + [apa:list:numbering:num] + +\definebtx + [apa:list:numbering:short] + [apa:list:numbering:num] + +\definebtx + [apa:list:numbering:bib] + [apa:list:numbering:num] % Next, we define a namespace for each category @@ -229,13 +241,13 @@ % root. \definebtx - [apa:page] + [apa:\s!page] [\s!page] \definebtx - [apa:page:list] - [apa:page] - [\c!command={\wordright}] + [apa:\s!page:list] + [apa:\s!page] + [\c!pagecommand={\wordright}] % Then define and set cite parameters. @@ -247,7 +259,8 @@ \c!etallimit=5, \c!etaldisplay=1, % TODO: when 2-4, show all first time, etaldisplay subsequently... \c!authorconversion=\v!name, - \c!sorttype=authoryear, + \c!sorttype=normal, + \c!compress=\v!yes, % note that cite sorts only work with compress=yes. \c!separator:names:2={,\space}, \c!separator:names:3={,\space\btxlabeltext{apa:and}\space}, % not \textampersand \c!separator:names:4={\space\btxlabeltext{apa:and}\space}] % not \textampersand @@ -259,10 +272,9 @@ \definebtx [apa:cite:authoryear] [apa:cite:author] - [\c!left={\removeunwantedspaces\pushpunctuation\btxspace(}, - \c!right={)\poppunctuation}, - \c!inbetween={,\space}, - \c!compress=\v!yes] + [\c!left={(}, + \c!right={)}, + \c!inbetween={,\space}] \definebtx [apa:cite:default] @@ -278,9 +290,8 @@ \definebtx [apa:cite:authornum] [apa:cite:author] - [\c!left={\removeunwantedspaces\pushpunctuation\btxspace(}, - \c!right={)\poppunctuation}, - \c!sorttype=authornum] + [\c!left={(}, + \c!right={)}] \definebtx [apa:cite:authorref] @@ -289,28 +300,26 @@ \definebtx [apa:cite:author:num] % todo [apa:cite:authornum] - [\c!left={\removeunwantedspaces\pushpunctuation\btxspace[}, - \c!right={]\poppunctuation}] + [\c!left={[}, + \c!right={]}] \definebtx - [apa:cite:author:year] % todo + [apa:cite:author:year] % todo [apa:cite] \definebtx [apa:cite:author:years] % todo [apa:cite:authoryears] [\c!inbetween=, - \c!left=(, - \c!right=)] + \c!left={\space(}, + \c!right={)}] \definebtx [apa:cite:year] [apa:cite] [\c!separator:2={,\space}, % :0 and :1 - between items of a list \c!separator:3={,\space\btxlabeltext{apa:and}\space}, % not \textampersand - \c!separator:4={\space\btxlabeltext{apa:and}\space}, % not \textampersand - \c!compress=\v!yes, - \c!sorttype=\v!default] + \c!separator:4={\space\btxlabeltext{apa:and}\space}] % not \textampersand \definebtx [apa:cite:title] @@ -328,15 +337,12 @@ \definebtx [apa:cite:tag] [apa:cite] - [\c!left={\removeunwantedspaces\pushpunctuation\btxspace[}, - \c!right={]\poppunctuation}] + [\c!left={[}, + \c!right={]}] -\definebtx - [apa:cite:key] - [apa:cite:tag] \definebtx - [apa:cite:serial] + [apa:cite:index] [apa:cite] [\c!left={[}, \c!right={]}] @@ -346,7 +352,7 @@ [apa:cite] [\c!left=, \c!right=, - [\c!separator:2={,\space}, % :0 and :1 - between items of a list + \c!separator:2={,\space}, % :0 and :1 - between items of a list \c!separator:3={,\space\btxlabeltext{apa:and}\space}, % not \textampersand \c!separator:4={\space\btxlabeltext{apa:and}\space}] % not \textampersand @@ -357,12 +363,6 @@ \definebtx [apa:cite:keywords] [apa:cite] - [\c!left={(}, - \c!right={)}] - -\definebtx - [apa:cite:invertedshort] - [apa:cite] \definebtx [apa:cite:short] @@ -373,12 +373,6 @@ \definebtx [apa:cite:category] [apa:cite] - [\c!left={[}, - \c!right={]}] - -\definebtx - [apa:cite:type] - [apa:cite:category] \definebtx [apa:cite:url] @@ -393,8 +387,7 @@ \definebtx [apa:cite:num] [apa:cite] - [\c!compress=\v!yes, - \c!left={[}, + [\c!left={[}, \c!right={]}, \c!separator:2={,}, % no space \c!separator:3=\btxparameter{\c!separator:2}, @@ -616,7 +609,7 @@ \startsetups btx:apa:cite:author:year \texdefinition{\s!btx:\s!cite:concat} - \btxparameter\c!left + %\btxparameter\c!left \ifx\currentbtxfirst\empty \btxlabeltext{apa:nd} \else @@ -625,18 +618,14 @@ \currentbtxfirst } \ifx\currentbtxsecond\empty \else - \btxparameter\v!inbetween + \btxparameter\c!range \texdefinition {\s!btx:\s!cite:inject} { \currentbtxsecond } \fi - \ifx\currentbtxthird\empty \else - \texdefinition {\s!btx:\s!cite:inject} { - \currentbtxthird - } - \fi + \btxflushsuffix \fi - \btxparameter\c!right + %\btxparameter\c!right \stopsetups \startsetups btx:apa:cite:author:years @@ -645,7 +634,7 @@ % The following differs from the default by including the labels p. and pp. -\startsetups btx:apa:page:list +\startsetups btx:apa:list:page \fastsetup{\s!btx:\s!page:concat} \ifx\currentbtxlastpage\empty \btxlabeltext{apa:page} @@ -740,7 +729,7 @@ \begingroup \language[\mainbtxlanguage] \btxleftbracket - \btxusecommand[apa:list:title:\currentbtxcategory] { + \btxusecommand [apa:list:title:\currentbtxcategory] { \btxflush{#title:\mainbtxlanguage} } \btxrightbracket @@ -752,7 +741,7 @@ \starttexdefinition btx:apa:composed-title #title \begingroup \language[\currentbtxlanguage] - \btxusecommand[apa:list:title:\currentbtxcategory] { + \btxusecommand [apa:list:title:\currentbtxcategory] { \btxflush{#title} \btxdoif {sub#title} { \btxcolon @@ -801,8 +790,7 @@ \starttexdefinition btx:apa:suffixedyear \btxdoifelse {year} { \btxflush{year} - \btxflush{suffix} - %or \btxflush{suffixedyear} + \btxflushsuffix } { \btxlabeltext{apa:nd} } @@ -813,7 +801,7 @@ \starttexdefinition btx:apa:author-or-editor #author \btxdoif {#author} { \btxflush{#author} - \doif {\btxfoundname{#author}} {editor} { + \doifelse {\btxfoundname{#author}} {editor} { \btxleftparenthesis \btxsingularorplural {editor} { \btxlabeltext{apa:Editor} @@ -821,6 +809,40 @@ \btxlabeltext{apa:Editors} } \btxrightparenthesisperiod + } { + \doifelse {\btxfoundname{#author}} {producer} { + \btxleftparenthesis + \btxsingularorplural {producer} { + \btxlabeltext{apa:Producer} + } { + \btxlabeltext{apa:Producers} + } + \btxrightparenthesis + \btxdoifelse {director} { + \removeunwantedspaces + \btxparameter{\c!separator:names:3} + \btxflush{director} + \btxleftparenthesis + \btxsingularorplural {director} { + \btxlabeltext{apa:Director} + } { + \btxlabeltext{apa:Directors} + } + \btxrightparenthesisperiod + } { + \btxperiod + } + } { + \doif {\btxfoundname{#author}} {director} { + \btxleftparenthesis + \btxsingularorplural {director} { + \btxlabeltext{apa:Director} + } { + \btxlabeltext{apa:Directors} + } + \btxrightparenthesisperiod + } + } } } \stoptexdefinition @@ -882,7 +904,7 @@ \doif {\currentbtxcategory} {techreport} { \texdefinition{btx:apa:leftparenthesis-or-comma} \btxdoifelse {type} { - \btxusecommand[apa:list:type] { + \btxusecommand [apa:list:type] { \btxflush{type} } } { @@ -932,7 +954,7 @@ \btxdoif {journal} { \btxspace \btxstartstyleandcolor[apa:list:journal] - \btxusecommand[apa:list:journal] { + \btxusecommand [apa:list:journal] { \btxflush{journal} } \btxdoifelse {volume} { @@ -1081,6 +1103,11 @@ \startsetups btx:apa:list:article \texdefinition{btx:apa:authoryear} \texdefinition{btx:apa:title-if-not-placed} + \btxdoif {type} { + \btxleftbracket + \btxflush{type} + \btxrightbracketperiod + } \texdefinition{btx:apa:journal-volume-number-pages} \texdefinition{btx:apa:url-doi-note} \stopsetups @@ -1203,7 +1230,7 @@ \texdefinition{btx:apa:title-if-not-placed} \btxleftparenthesis \btxdoifelse {type} { - \btxusecommand[apa:list:type] { + \btxusecommand [apa:list:type] { \btxflush{type} } } { @@ -1330,35 +1357,7 @@ % Optional fields: subtitle, type, note, url, doi \startsetups btx:apa:list:film - \btxdoif {producer} { - \btxflush{producer} - \btxleftparenthesis - \btxsingularorplural {producer} { - \btxlabeltext{apa:Producer} - } { - \btxlabeltext{apa:Producers} - } - \btxrightparenthesis - \btxdoifelse {director} { - \removeunwantedspaces - \btxparameter{\c!separator:names:3} - } { - \btxperiod - } - } - \btxdoif {director} { - \btxflush{director} - \btxleftparenthesis - \btxsingularorplural {director} { - \btxlabeltext{apa:Director} - } { - \btxlabeltext{apa:Directors} - } - \btxrightparenthesisperiod - } - \btxleftparenthesis - \texdefinition{btx:apa:suffixedyear} - \btxrightparenthesisperiod + \texdefinition{btx:apa:authoryear} \texdefinition {btx:apa:title} \btxleftbracket \btxdoifelse {type} { @@ -1432,7 +1431,7 @@ \startsetups btx:apa:list:literal %\btxleftparenthesis \removeunwantedspaces( - \btxflush{key} + \btxflush{tag} \btxrightparenthesis \btxdoif {text} { \btxflush{text} diff --git a/Master/texmf-dist/tex/context/base/publ-imp-aps.lua b/Master/texmf-dist/tex/context/base/publ-imp-aps.lua index 1ec75d7d1df..c15ffe918e9 100644 --- a/Master/texmf-dist/tex/context/base/publ-imp-aps.lua +++ b/Master/texmf-dist/tex/context/base/publ-imp-aps.lua @@ -462,7 +462,7 @@ categories.other = { categories.literal = { sets = { - author = { "key" }, -- need to check this! + author = { "tag" }, -- need to check this! }, required = { "text" diff --git a/Master/texmf-dist/tex/context/base/publ-imp-aps.mkvi b/Master/texmf-dist/tex/context/base/publ-imp-aps.mkvi index 3bc2a1d2184..cd05fce7fad 100644 --- a/Master/texmf-dist/tex/context/base/publ-imp-aps.mkvi +++ b/Master/texmf-dist/tex/context/base/publ-imp-aps.mkvi @@ -22,7 +22,7 @@ %D editor ={Waldron, A and Judd, P. and Miller, V.}, %D address ={Ridge, NY}, %D publisher={American Physical Society}, -%D pages ={26}, +%D Xpages ={26}, %D url ={http://journals.aps.org/files/styleguide-pr.pdf} %D } %D \stopTEX @@ -38,7 +38,7 @@ \c!etaldisplay=\btxparameter\c!etallimit, %c!journalconversion=\v!normal, \c!monthconversion=\v!month, - optionaltitle=\v!yes, + \c!title=\v!yes, \c!separator:names:2={,\space}, \c!separator:names:3={,\space\btxlabeltext{aps:and}\space}, % not \textampersand \c!separator:names:4= {\space\btxlabeltext{aps:and}\space}] % not \textampersand @@ -49,6 +49,10 @@ [aps] [\c!specification=aps] +\setupbtxlist + [aps] + [\c!alternative=b] % spaces + \definebtx [aps:list] [aps] @@ -75,34 +79,26 @@ [aps:list] \definebtx - [aps:list:invertedshort] + [aps:list:numbering] [aps:list] -% This is for numbering=num - \definebtx - [aps:list:num] - [aps:list] + [aps:list:numbering:num] + [aps:list:numbering] [left={[}, right={]}] -% This is for numbering=yes - \definebtx - [aps:list:yes] - [aps:list:num] - -% This is for numbering=short + [aps:list:numbering:yes] + [aps:list:numbering:num] \definebtx - [aps:list:short] - [aps:list:num] - -% This is for numbering=bib + [aps:list:numbering:short] + [aps:list:numbering:num] \definebtx - [aps:list:bib] - [aps:list:num] + [aps:list:numbering:bib] + [aps:list:numbering:num] %D In order to be able to get journals expanded (or normalized or abbreviated) you need %D to load a list: @@ -232,20 +228,22 @@ % root. \definebtx - [aps:page] + [aps:\s!page] [\s!page] \definebtx - [aps:page:list] - [aps:page] - [\c!command={\wordright}] + [aps:\s!page:list] + [aps:\s!page] + %[\c!pagecommand={\wordright}] % Then define and set all cite parameters \definebtx [aps:cite] [aps] - [\c!authorconversion=\v!name] + [\c!authorconversion=\v!name, + \c!compress=\v!yes, + \c!sorttype=normal] \definebtx [aps:cite:author] @@ -269,8 +267,7 @@ [aps:cite:authornum] [aps:cite:author] [\c!left={(}, - \c!right={)}, - \c!sorttype=authornum] + \c!right={)}] \definebtx [aps:cite:authorref] @@ -292,14 +289,12 @@ [aps:cite:author:years] % todo [aps:cite:authoryears] [\c!inbetween=, - \c!left=(, - \c!right=)] + \c!left={\space(}, + \c!right={)}] \definebtx [aps:cite:year] [aps:cite] - [\c!compress=\v!yes, - \c!sorttype=year] \definebtx [aps:cite:title] @@ -318,11 +313,7 @@ \c!right={]}] \definebtx - [aps:cite:key] - [aps:cite:tag] - -\definebtx - [aps:cite:serial] + [aps:cite:index] [aps:cite] [\c!left={[}, \c!right={]}] @@ -332,7 +323,7 @@ [aps:cite] [\c!left=, \c!right=, - [\c!separator:2={,\space}, % :0 and :1 - between items of a list + \c!separator:2={,\space}, % :0 and :1 - between items of a list \c!separator:3={,\space\btxlabeltext{aps:and}\space}, % not \textampersand \c!separator:4= {\space\btxlabeltext{aps:and}\space}] % not \textampersand @@ -347,10 +338,6 @@ \c!right={)}] \definebtx - [aps:cite:invertedshort] - [aps:cite] - -\definebtx [aps:cite:short] [aps:cite] [\c!left={[}, @@ -359,12 +346,6 @@ \definebtx [aps:cite:category] [aps:cite] - [\c!left={[}, - \c!right={]}] - -\definebtx - [aps:cite:type] - [aps:cite:category] \definebtx [aps:cite:url] @@ -379,13 +360,12 @@ \definebtx [aps:cite:num] [aps:cite] - [\c!compress=\v!yes, - \c!left={[}, + [\c!left={[}, \c!right={]}, %\c!left=, % TODO: PRB uses superscript references... %\c!right=, % and after punctuation, PRA, C, D, E, and L are before! %\c!command={\high}, - \c!separator:2={,}, % no space + \c!separator:2={\btxcommabreak}, \c!separator:3=\btxparameter{\c!separator:2}, \c!separator:4=\btxparameter{\c!separator:2}] @@ -579,16 +559,12 @@ \currentbtxfirst } \ifx\currentbtxsecond\empty \else - \btxparameter\v!inbetween + \btxparameter\c!inbetween \texdefinition {\s!btx:\s!cite:inject} { \currentbtxsecond } \fi - \ifx\currentbtxthird\empty \else - \texdefinition {\s!btx:\s!cite:inject} { - \currentbtxthird - } - \fi + \btxflushsuffix \fi \stopsetups @@ -596,7 +572,7 @@ \fastsetup{btx:aps:cite:author:year} \stopsetups -\startsetups [btx:aps:page:list] +\startsetups [btx:aps:list:page] \fastsetup{\s!btx:\s!page:concat} \ifx\currentbtxlastpage\empty \btxlabeltext{aps:page} @@ -650,7 +626,7 @@ \starttexdefinition btx:aps:composed-title #title \begingroup \language[\currentbtxlanguage] - \btxusecommand[aps:list:title:\currentbtxcategory] { + \btxusecommand [aps:list:title:\currentbtxcategory] { \btxflush{#title} \btxdoif {sub#title} { \btxcolon @@ -681,7 +657,7 @@ \stoptexdefinition \starttexdefinition btx:aps:optional-title - \doif{\btxparameter{optionaltitle}}\v!yes { + \doif{\btxparameter{\c!title}}\v!yes { \texdefinition {btx:aps:title} } \stoptexdefinition @@ -740,7 +716,7 @@ \starttexdefinition btx:aps:editionset \doif {\currentbtxcategory} {techreport} { \btxdoifelse {type} { - \btxusecommand[\currentbtx:type] { + \btxusecommand [\currentbtx:type] { \btxflush{type} } } { @@ -996,7 +972,7 @@ \texdefinition{btx:aps:title} \btxleftparenthesis \btxdoifelse {type} { - \btxusecommand[aps:list:type] { + \btxusecommand [aps:list:type] { \btxflush{type} } } { @@ -1146,7 +1122,7 @@ \startsetups btx:aps:list:literal %\btxleftparenthesis \removeunwantedspaces( - \btxflush{key} + \btxflush{tag} \btxrightparenthesis \btxdoif {text} { \btxflush{text} diff --git a/Master/texmf-dist/tex/context/base/publ-imp-cite.mkvi b/Master/texmf-dist/tex/context/base/publ-imp-cite.mkvi index dfc16c795ee..6b09eaf01b1 100644 --- a/Master/texmf-dist/tex/context/base/publ-imp-cite.mkvi +++ b/Master/texmf-dist/tex/context/base/publ-imp-cite.mkvi @@ -50,8 +50,9 @@ \startsetups btx:cite:unknown \begingroup + \tttf \btxcitereference - unknown: \currentbtxfirst + \currentbtxfirst \endgroup \stopsetups @@ -65,109 +66,84 @@ {\tt <\currentbtxreference>} \stopsetups +\starttexdefinition btx:cite:concat + \btxparameter{\c!separator:\number\currentbtxconcat} +\stoptexdefinition + +% when we have an author-year combination, the first and seconds is not +% fields data but something more complex (that itself calls for a setup) + % \startsetups btx:cite:normal +% \texdefinition{\s!btx:\s!cite:concat} +% \currentbtxlefttext % \ifx\currentbtxfirst\empty % \fastsetup{\s!btx:\s!cite:\s!empty} -% \else\ifx\currentbtxsecond\empty -% \btxcitereference -% \currentbtxfirst -% \ifx\currentbtxthird\empty \else -% \currentbtxthird -% \fi % \else -% \btxcitereference -% \currentbtxfirst -% \btxparameter\v!inbetween -% \currentbtxsecond -% \ifx\currentbtxthird\empty \else -% \currentbtxthird +% \texdefinition {\s!btx:\s!cite:inject} { +% \btxcitereference +% \btxusecommand [\currentbtxspecification:cite:\currentbtxcitealternative] { +% \currentbtxfirst +% } +% } +% \ifx\currentbtxsecond\empty +% \btxflushsuffix +% \else +% \btxparameter\c!inbetween +% \texdefinition {\s!btx:\s!cite:inject} { +% \btxusecommand [\currentbtxspecification:cite:\currentbtxcitealternative] { +% \currentbtxsecond +% } +% } +% % quite likely an error +% \btxflushsuffix % \fi -% \fi\fi +% \fi +% \currentbtxrighttext % \stopsetups -%\startsetups btx:cite:range -% \ifx\currentbtxfirst\empty -% \fastsetup{\s!btx:\s!cite:\s!empty} -% \else\ifx\currentbtxsecond\empty -% \btxcitereference -% \currentbtxfirst -% \ifx\currentbtxthird\empty \else -% \currentbtxthird -% \fi -% \else -% \btxcitereference -% \currentbtxfirst -% \btxparameter\c!range -% \currentbtxsecond -% \ifx\currentbtxthird\empty \else -% \currentbtxthird -% \fi -% \fi\fi -%\stopsetups - -\starttexdefinition btx:cite:concat - \btxparameter{\c!separator:\number\currentbtxconcat} -\stoptexdefinition - \startsetups btx:cite:normal \texdefinition{\s!btx:\s!cite:concat} \currentbtxlefttext \ifx\currentbtxfirst\empty \fastsetup{\s!btx:\s!cite:\s!empty} - \else + \else\ifx\currentbtxsecond\empty \texdefinition {\s!btx:\s!cite:inject} { \btxcitereference - \btxusecommand[\currentbtxspecification:cite:\currentbtxcitealternative] { + \btxusecommand [\currentbtxspecification:cite:\currentbtxcitealternative] { \currentbtxfirst + \btxflushsuffix } } - \ifx\currentbtxsecond\empty \else - \btxparameter\v!inbetween - \texdefinition {\s!btx:\s!cite:inject} { - \btxusecommand[\currentbtxspecification:cite:\currentbtxcitealternative] { - \currentbtxsecond - } - } - \fi - \ifx\currentbtxthird\empty \else - \texdefinition {\s!btx:\s!cite:inject} { - \btxusecommand[\currentbtxspecification:cite:\currentbtxcitealternative] { - \currentbtxthird - } - } - \fi - \fi - \currentbtxrighttext -\stopsetups - -\startsetups btx:cite:author - \texdefinition{\s!btx:\s!cite:concat} - \btxparameter\c!left - \currentbtxlefttext - \ifx\currentbtxfirst\empty - \fastsetup{\s!btx:\s!cite:\s!empty} \else + % \texdefinition {\s!btx:\s!cite:inject} { + % \btxcitereference + % \btxusecommand [\currentbtxspecification:cite:\currentbtxcitealternative] { + % \currentbtxfirst + % } + % } + % \btxparameter\c!inbetween + % \texdefinition {\s!btx:\s!cite:inject} { + % \btxusecommand [\currentbtxspecification:cite:\currentbtxcitealternative] { + % \currentbtxsecond + % } + % } + % \btxflushsuffix + % + % probably better: \texdefinition {\s!btx:\s!cite:inject} { \btxcitereference - \currentbtxfirst - } - \fi - \ifx\currentbtxsecond\empty \else - \relax % keeps a following space - \btxparameter\v!inbetween - \texdefinition {\s!btx:\s!cite:inject} { - \currentbtxsecond - } - \fi - \ifx\currentbtxthird\empty \else - \texdefinition {\s!btx:\s!cite:inject} { - \currentbtxthird + \btxusecommand [\currentbtxspecification:cite:\currentbtxcitealternative] { + \currentbtxfirst + \btxparameter\c!inbetween + \currentbtxsecond + \btxflushsuffix + } } - \fi + \fi\fi \currentbtxrighttext - \btxparameter\c!right \stopsetups + \startsetups btx:cite:range \texdefinition{\s!btx:\s!cite:concat} \currentbtxlefttext @@ -176,21 +152,21 @@ \else \texdefinition {\s!btx:\s!cite:inject} { \btxcitereference - \btxusecommand[\currentbtxspecification:cite:\currentbtxcitealternative] { + \btxusecommand [\currentbtxspecification:cite:\currentbtxcitealternative] { \currentbtxfirst \ifx\currentbtxsecond\empty \else \btxparameter\c!range \currentbtxsecond \fi - \ifx\currentbtxthird\empty \else - \currentbtxthird - \fi + \btxflushsuffix } } \fi \currentbtxrighttext \stopsetups +% somehow related to keywords: + \startsetups btx:cite:listelement \texdefinition{\s!btx:\s!cite:concat} \currentbtxlefttext @@ -218,23 +194,30 @@ % AB: not so sure about that. Why define them in default rather than here? +\startsetups \s!btx:\s!cite:author + \fastsetup{\s!btx:\s!cite:normal} +\stopsetups \startsetups \s!btx:\s!cite:authoryear - \fastsetup{\s!btx:\s!cite:author} + \fastsetup{\s!btx:\s!cite:normal} \stopsetups \startsetups \s!btx:\s!cite:authoryears - \fastsetup{\s!btx:\s!cite:authoryear} + \fastsetup{\s!btx:\s!cite:normal} \stopsetups \startsetups \s!btx:\s!cite:authornum - \fastsetup{\s!btx:\s!cite:authoryear} + \fastsetup{\s!btx:\s!cite:normal} \stopsetups \startsetups \s!btx:\s!cite:authorref - \ifx{\\s!btxparameter\c!alternative}{authoryear} + % what a crap ... no one will ever understand this module .. it makes no + % sense to have these tests, just let users set the right variant .. + \doifelse{\btxparameter\c!alternative} {authoryear} { \fastsetup{\s!btx:\s!cite:authoryears} - \else\ifx{\btxparameter\c!alternative}{num} - \fastsetup{\s!btx:\s!cite:authornum} - \else - \fastsetup{\s!btx:\s!cite:author} - \fi\fi + } { + \doifelse {\btxparameter\c!alternative} {num} { + \fastsetup{\s!btx:\s!cite:authornum} + } { + \fastsetup{\s!btx:\s!cite:author} + } + } \stopsetups \startsetups \s!btx:\s!cite:num \fastsetup{\s!btx:\s!cite:range} @@ -248,9 +231,6 @@ \startsetups \s!btx:\s!cite:year \fastsetup{\s!btx:\s!cite:range} \stopsetups -\startsetups \s!btx:\s!cite:short - \fastsetup{\s!btx:\s!cite:range} -\stopsetups \startsetups \s!btx:\s!cite:author:num \fastsetup{\s!btx:\s!cite:range} \stopsetups @@ -258,20 +238,19 @@ \fastsetup{\s!btx:\s!cite:range} \stopsetups \startsetups \s!btx:\s!cite:author:years - \fastsetup{\s!btx:\s!cite:concat}%?? in range already? \fastsetup{\s!btx:\s!cite:range} \stopsetups -\startsetups \s!btx:\s!cite:serial +\startsetups \s!btx:\s!cite:index \fastsetup{\s!btx:\s!cite:range} \stopsetups -\startsetups \s!btx:\s!cite:tag +\startsetups \s!btx:\s!cite:category \fastsetup{\s!btx:\s!cite:normal} \stopsetups -\startsetups \s!btx:\s!cite:key +\startsetups \s!btx:\s!cite:short \fastsetup{\s!btx:\s!cite:normal} \stopsetups -\startsetups \s!btx:\s!cite:category +\startsetups \s!btx:\s!cite:tag \fastsetup{\s!btx:\s!cite:normal} \stopsetups @@ -280,15 +259,16 @@ \startsetups \s!btx:\s!cite:keywords \fastsetup{\s!btx:\s!cite:list} \stopsetups -\startsetups \s!btx:\s!cite:type - \fastsetup{\s!btx:\s!cite:normal} -\stopsetups \startsetups \s!btx:\s!cite:title \fastsetup{\s!btx:\s!cite:normal} \stopsetups \startsetups \s!btx:\s!cite:pages \fastsetup{\s!btx:\s!cite:range} \stopsetups + +% is the next one used? +% Yes, bibtex is a mess and one can have pages or sometimes page + \startsetups \s!btx:\s!cite:page \fastsetup{\s!btx:\s!cite:normal} \stopsetups diff --git a/Master/texmf-dist/tex/context/base/publ-imp-default.mkvi b/Master/texmf-dist/tex/context/base/publ-imp-default.mkvi index 49a0b9eae85..e51955c704b 100644 --- a/Master/texmf-dist/tex/context/base/publ-imp-default.mkvi +++ b/Master/texmf-dist/tex/context/base/publ-imp-default.mkvi @@ -24,7 +24,8 @@ \definebtxrendering [\s!default] - [\c!specification=\s!default] + [\c!specification=\s!default, + \c!sorttype=\v!default] \definebtx [\s!default] @@ -45,6 +46,8 @@ [\s!default:\s!cite] [\s!default] [\c!alternative=num, + [\c!compress=\v!yes, + \c!sorttype=normal, \c!authorconversion=\v!name] % We define [page] settings in the default namespace, inheriting the root @@ -78,12 +81,6 @@ [\s!default:\s!list] \definebtx - [\s!default:\s!list:invertedshort] - [\s!default:\s!list] - -% normalshort? - -\definebtx [\s!default:\s!list:short] [\s!default:\s!list] @@ -128,17 +125,13 @@ \c!inbetween={,\space}] \definebtx - [\s!default:\s!cite:authorref] - [\s!default:\s!cite:authornum] - -\definebtx [\s!default:\s!cite:authoryears] [\s!default:\s!cite:author] \definebtx [\s!default:\s!cite:author:num] % todo [\s!default:\s!cite:authornum] - [\c!left={[}, + [\c!left={\space[}, \c!right={]}] \definebtx @@ -151,19 +144,17 @@ [\s!default:\s!cite:author:years] % todo [\s!default:\s!cite:authoryears] [\c!inbetween=, - \c!left=(, - \c!right=)] + \c!left={\space(}, + \c!right={)}] \definebtx [\s!default:\s!cite:year] [\s!default:\s!cite] - [\c!compress=\v!yes, - \c!sorttype=year] \definebtx [\s!default:\s!cite:title] [\s!default:\s!cite] - [command={\language[\currentbtxlanguage]}, % BAH + [\c!command={\language[\currentbtxlanguage]}, % BAH \c!style=\v!italic] \definebtx @@ -173,11 +164,7 @@ \c!right={]}] \definebtx - [\s!default:\s!cite:key] - [\s!default:\s!cite:tag] - -\definebtx - [\s!default:\s!cite:serial] + [\s!default:\s!cite:index] [\s!default:\s!cite] [\c!left={[}, \c!right={]}] @@ -199,10 +186,6 @@ \c!right={)}] \definebtx - [\s!default:\s!cite:invertedshort] - [\s!default:\s!cite] - -\definebtx [\s!default:\s!cite:short] [\s!default:\s!cite] [\c!left={[}, @@ -211,12 +194,6 @@ \definebtx [\s!default:\s!cite:category] [\s!default:\s!cite] - [\c!left={[}, - \c!right={]}] - -\definebtx - [\s!default:\s!cite:type] - [\s!default:\s!cite:category] \definebtx [\s!default:\s!cite:url] @@ -231,10 +208,9 @@ \definebtx [\s!default:\s!cite:num] [\s!default:\s!cite] - [\c!compress=\v!yes, - \c!left={[}, + [\c!left={[}, \c!right={]}, - \c!separator:2={,}, % no space + \c!separator:2=\btxcommabreak, \c!separator:3=\btxparameter{\c!separator:2}, \c!separator:4=\btxparameter{\c!separator:2}] @@ -343,7 +319,7 @@ \btxdoif {title} { \btxspace \btxstartstyleandcolor [default:list:title:\currentbtxcategory] - \btxusecommand[default:list:title:\currentbtxcategory] { + \btxusecommand [default:list:title:\currentbtxcategory] { \texdefinition{btx:default:composed-title} } \btxstopstyleandcolor @@ -368,14 +344,14 @@ \starttexdefinition btx:default:year \btxflush{year} - \btxflush{suffix} + \btxflushsuffix \stoptexdefinition \starttexdefinition btx:default:journal \btxdoif {journal} { \btxspace \btxstartstyleandcolor [default:list:journal] - \btxusecommand[default:list:journal] { + \btxusecommand [default:list:journal] { \btxflush{journal} } \btxstopstyleandcolor @@ -486,109 +462,4 @@ \currentbtxrighttext \stopsetups -%D Citations: - -% \startsetups \s!btx:\s!default:\s!cite:author -% \fastsetup{\s!btx:\s!cite:author} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:authoryear -% \fastsetup{\s!btx:\s!cite:author} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:authoryears -% \fastsetup{\s!btx:\s!cite:author} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:authornum -% \fastsetup{\s!btx:\s!cite:author} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:authorref -% \fastsetup{\s!btx:\s!cite:authorref} -% \stopsetups -% -% \startsetups \s!btx:\s!default:\s!cite:author:num -% \fastsetup{\s!btx:\s!cite:range} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:author:year -% \fastsetup{\s!btx:\s!cite:range} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:author:years -% \fastsetup{\s!btx:\s!cite:concat} -% \fastsetup{\s!btx:\s!cite:range} -% \stopsetups -% -% \startsetups \s!btx:\s!default:\s!cite:keywords -% \fastsetup{\s!btx:\s!cite:list} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:year -% \fastsetup{\s!btx:\s!cite:range} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:short -% \fastsetup{\s!btx:\s!cite:normal} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:serial -% \fastsetup{\s!btx:\s!cite:range} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:tag -% \fastsetup{\s!btx:\s!cite:normal} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:key -% \fastsetup{\s!btx:\s!cite:normal} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:category -% \fastsetup{\s!btx:\s!cite:normal} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:type -% \fastsetup{\s!btx:\s!cite:normal} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:num -% \fastsetup{\s!btx:\s!cite:range} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:default -% \fastsetup{\s!btx:\s!default:\s!cite:num} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:textnum -% \fastsetup{\s!btx:\s!default:\s!cite:num} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:title -% \fastsetup{\s!btx:\s!cite:normal} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:pages -% \fastsetup{\s!btx:\s!cite:range} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:page -% \fastsetup{\s!btx:\s!cite:normal} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:doi -% \fastsetup{\s!btx:\s!cite:url} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:url -% \fastsetup{\s!btx:\s!cite:url} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:nocite -% \fastsetup{\s!btx:\s!cite:nocite}% defined nowhere : -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:entry -% \fastsetup{\s!btx:\s!cite:entry} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!cite:none -% \fastsetup{\s!btx:\s!cite:none} -% \stopsetups - -% List - -% \startsetups \s!btx:\s!default:\s!list:page -% \fastsetup{\s!btx:\s!list:page} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!list:yes -% \fastsetup{\s!btx:\s!list:yes} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!list:num -% \fastsetup{\s!btx:\s!list:num} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!list:bib -% \fastsetup{\s!btx:\s!list:bib} -% \stopsetups -% \startsetups \s!btx:\s!default:\s!list:short -% \fastsetup{\s!btx:\s!list:short} -% \stopsetups - \stopbtxrenderingdefinitions diff --git a/Master/texmf-dist/tex/context/base/publ-imp-list.mkvi b/Master/texmf-dist/tex/context/base/publ-imp-list.mkvi index e13294f6f5b..61432486b9b 100644 --- a/Master/texmf-dist/tex/context/base/publ-imp-list.mkvi +++ b/Master/texmf-dist/tex/context/base/publ-imp-list.mkvi @@ -30,17 +30,10 @@ \stoptexdefinition \starttexdefinition btx:list:helpers:concat - % \ifcase\currentbtxconcat \or \or - % \btxparameter\c!pubsep - % \or - % \btxparameter\c!finalpubsep - % \or - % \btxparameter\c!lastpubsep - % \fi \space \stoptexdefinition -\startsetups \s!btx:\s!list:page +\startsetups[\s!btx:\s!list:\s!page] \texdefinition{\s!btx:\s!list:concat} \texdefinition{\s!btx:\s!list:inject} { % real pagenumber: todo, userpage @@ -50,39 +43,38 @@ } \stopsetups -\startsetups \s!btx:\s!list:numbering - \btxparameter\c!left +\startsetups[\s!btx:\s!list:\s!numbering] \texdefinition {\s!btx:\s!list:inject} { \currentbtxfirst \btxparameter\c!stopper } - \btxparameter\c!right \stopsetups -\startsetups \s!btx:\s!list:num - \btxstartstyleandcolor [\currentbtxspecification:list:num] - \btxusecommand[\currentbtxspecification:list:num] { - \fastsetup{\s!btx:\s!list:numbering} +\startsetups[\s!btx:\s!list:\s!numbering:num] + \btxstartstyleandcolor [\currentbtxspecification:\s!list:\s!numbering:num] + \btxusecommand[\currentbtxspecification:\s!list:\s!numbering:num] { + \fastsetup{\s!btx:\s!list:\s!numbering} } \btxstopstyleandcolor \stopsetups -\startsetups \s!btx:\s!list:yes - \fastsetup{\s!btx:\s!list:num} +\startsetups[\s!btx:\s!list:\s!numbering:\v!yes] + \fastsetup{\s!btx:\s!list:\s!numbering:num} \stopsetups -\startsetups \s!btx:\s!list:short - \btxstartstyleandcolor [\currentbtxspecification:list:short] - \btxusecommand[\currentbtxspecification:list:short] { - \fastsetup{\s!btx:\s!list:numbering} +\startsetups[\s!btx:\s!list:\s!numbering:short] + \btxstartstyleandcolor [\currentbtxspecification:\s!list:\s!numbering:short] + \btxusecommand [\currentbtxspecification:\s!list:\s!numbering:short] { + \fastsetup{\s!btx:\s!list:\s!numbering} + \btxflushsuffix } \btxstopstyleandcolor \stopsetups -\startsetups \s!btx:\s!list:bib - \btxstartstyleandcolor [\currentbtxspecification:list:bib] - \btxusecommand[\currentbtxspecification:list:bib] { - \fastsetup{\s!btx:\s!list:numbering} +\startsetups[\s!btx:\s!list:\s!numbering:bib] + \btxstartstyleandcolor [\currentbtxspecification:\s!list:\s!numbering:bib] + \btxusecommand [\currentbtxspecification:\s!list:\s!numbering:bib] { + \fastsetup{\s!btx:\s!list:\s!numbering} } \btxstopstyleandcolor \stopsetups diff --git a/Master/texmf-dist/tex/context/base/publ-imp-page.mkvi b/Master/texmf-dist/tex/context/base/publ-imp-page.mkvi index 19673c829d8..f0b92c88cc5 100644 --- a/Master/texmf-dist/tex/context/base/publ-imp-page.mkvi +++ b/Master/texmf-dist/tex/context/base/publ-imp-page.mkvi @@ -26,7 +26,7 @@ \definebtx [\s!page:\s!list] [\s!page] - [\c!command={\wordright}] + [\c!pagecommand={\wordright}] \startsetups \s!btx:\s!page:concat \ifcase\currentbtxoverflow @@ -44,7 +44,7 @@ % for the moment we have only one variant -\startsetups [\s!btx:\s!page:\s!list] +\startsetups [\s!btx:\s!list:\s!page] \fastsetup{\s!btx:\s!page:concat} % \ifx\currentbtxlastpage\empty % p. diff --git a/Master/texmf-dist/tex/context/base/publ-ini.lua b/Master/texmf-dist/tex/context/base/publ-ini.lua index 25397727bff..30d0c890882 100644 --- a/Master/texmf-dist/tex/context/base/publ-ini.lua +++ b/Master/texmf-dist/tex/context/base/publ-ini.lua @@ -22,7 +22,7 @@ if not modules then modules = { } end modules ['publ-ini'] = { -- gain is not that large anyway because not much publication stuff is flushed. local next, rawget, type, tostring, tonumber = next, rawget, type, tostring, tonumber -local match, find = string.match, string.find +local match, find, gsub = string.match, string.find, string.gsub local concat, sort, tohash = table.concat, table.sort, table.tohash local utfsub = utf.sub local mod = math.mod @@ -32,21 +32,21 @@ local settings_to_array, settings_to_set = utilities.parsers.settings_to_array, local sortedkeys, sortedhash = table.sortedkeys, table.sortedhash local setmetatableindex = table.setmetatableindex local lpegmatch = lpeg.match -local P, S, C, Ct, R, Carg = lpeg.P, lpeg.S, lpeg.C, lpeg.Ct, lpeg.R, lpeg.Carg +local P, S, C, Ct, Cs, R, Carg = lpeg.P, lpeg.S, lpeg.C, lpeg.Ct, lpeg.Cs, lpeg.R, lpeg.Carg local upper = utf.upper local report = logs.reporter("publications") local report_cite = logs.reporter("publications","cite") local report_list = logs.reporter("publications","list") local report_reference = logs.reporter("publications","reference") -local report_shorts = logs.reporter("publications","shorts") +local report_suffix = logs.reporter("publications","suffix") local trace = false trackers.register("publications", function(v) trace = v end) local trace_cite = false trackers.register("publications.cite", function(v) trace_cite = v end) local trace_missing = false trackers.register("publications.cite.missing", function(v) trace_missing = v end) local trace_references = false trackers.register("publications.cite.references", function(v) trace_references = v end) local trace_detail = false trackers.register("publications.detail", function(v) trace_detail = v end) -local trace_shorts = false trackers.register("publications.shorts", function(v) trace_shorts = v end) +local trace_suffixes = false trackers.register("publications.suffixes", function(v) trace_suffixes = v end) publications = publications or { } local datasets = publications.datasets @@ -65,8 +65,11 @@ local v_local = variables["local"] local v_global = variables["global"] local v_force = variables.force +local v_normal = variables.normal +local v_reverse = variables.reverse local v_none = variables.none local v_yes = variables.yes +local v_no = variables.no local v_all = variables.all local v_always = variables.always local v_doublesided = variables.doublesided @@ -123,10 +126,12 @@ local ctx_btxsetcombis = context.btxsetcombis local ctx_btxsetcategory = context.btxsetcategory local ctx_btxcitesetup = context.btxcitesetup local ctx_btxsubcitesetup = context.btxsubcitesetup +local ctx_btxnumberingsetup = context.btxnumberingsetup local ctx_btxpagesetup = context.btxpagesetup local ctx_btxsetfirst = context.btxsetfirst local ctx_btxsetsecond = context.btxsetsecond -local ctx_btxsetthird = context.btxsetthird +----- ctx_btxsetthird = context.btxsetthird +local ctx_btxsetsuffix = context.btxsetsuffix local ctx_btxsetinternal = context.btxsetinternal local ctx_btxsetlefttext = context.btxsetlefttext local ctx_btxsetrighttext = context.btxsetrighttext @@ -295,7 +300,7 @@ do local function initializer() statistics.starttiming(publications) - for name, state in next, collected do + for name, state in sortedhash(collected) do local dataset = datasets[name] local datasources = state.datasources local usersource = state.usersource @@ -422,7 +427,7 @@ do -- weird end end - for k, v in next, names do + for k, v in sortedhash(names) do local n = #v if n > 1 then local original = v[1].original @@ -992,11 +997,11 @@ do -- maybe not redo when already done local function shortsorter(a,b) - local ay, by = a[2], b[2] + local ay, by = a[2], b[2] -- year if ay ~= by then return ay < by end - local ay, by = a[3], b[3] + local ay, by = a[3], b[3] -- suffix if ay ~= by then -- bah, bah, bah local an, bn = tonumber(ay), tonumber(by) @@ -1014,7 +1019,7 @@ do -- seconds are irrelevant (there is for sure more to gain by proper coding -- of the source and or style). - local f_short = formatters["%t%02i"] + local f_short = formatters["%s%02i"] function publications.enhancers.suffixes(dataset) if not dataset then @@ -1022,6 +1027,8 @@ do else report("analyzing previous publication run for %a",dataset.name) end + dataset.suffixed = true + -- local used = usedentries[dataset.name] if not used then return -- probably a first run @@ -1033,13 +1040,18 @@ do report("nothing to be analyzed in %a",dataset.name) return -- also bad news end - local field = "author" -- currently only author - local shorts = { } + -- we have two suffixes: author (dependent of type) and short + local kind = dataset.authorconversion or "name" + local field = "author" -- currently only author + local shorts = { } + local authors = { } + local hasher = publications.authorhashers[kind] + local shorter = publications.authorhashers.short for i=1,#ordered do local entry = ordered[i] if entry then local tag = entry.tag - if tag then + if tag then local use = used[tag] if use then -- use is a table of used list entries (so there can be more) and we just look at @@ -1051,33 +1063,31 @@ do -- this will become a specification entry local author = getcasted(dataset,tag,field,specifications[btxspc]) if type(author) == "table" then - -- number depends on sort order - local t = { } - if #author > 0 then - local n = #author == 1 and 3 or 1 - for i=1,#author do - local surnames = author[i].surnames - if not surnames or #surnames == 0 then - -- error - else - t[#t+1] = utfsub(surnames[1],1,n) - end - end - end - local year = tonumber(entry.year) or 0 - local short = f_short(t,mod(year,100)) - local s = shorts[short] - -- we could also sort on reference i.e. entries.text if u then u = listentry.entries.text -- hm else u = "0" end - if not s then - shorts[short] = { { tag, year, u, i } } + local year = tonumber(entry.year) or 9999 + local data = { tag, year, u, i } + -- authors + local hash = hasher(author) + local found = authors[hash] + if not found then + authors[hash] = { data } else - s[#s+1] = { tag, year, u, i } + found[#found+1] = data end + -- shorts + local hash = shorter(author) + local short = f_short(hash,mod(year,100)) + local found = shorts[short] + if not found then + shorts[short] = { data } + else + found[#found+1] = data + end + -- else report("author typecast expected for field %a",field) end @@ -1088,47 +1098,62 @@ do end end end - -- for short, tags in next, shorts do -- ordered ? - for short, tags in sortedhash(shorts) do -- ordered ? - local n = #tags - if n == 0 then - -- skip - elseif n == 1 then - local tagdata = tags[1] - local tag = tagdata[1] - local detail = details[tag] - local entry = luadata[tag] - local year = entry.year - detail.short = short - if year then - detail.suffixedyear = year - end - if trace_shorts then - report_shorts("year %a, suffix %a, short %a, tag %a",year or "-","-",short,tag) - end - elseif n > 1 then - sort(tags,shortsorter) - for i=1,n do - local tagdata = tags[i] + local function addsuffix(hashed,key,suffixkey) + for hash, tags in sortedhash(hashed) do -- ordered ? + local n = #tags + if n == 0 then + -- skip + elseif n == 1 then + local tagdata = tags[1] local tag = tagdata[1] local detail = details[tag] - local suffix = numbertochar(i) local entry = luadata[tag] local year = entry.year - detail.short = short - detail.suffix = suffix - if year then - detail.suffixedyear = year .. suffix + detail[key] = hash + elseif n > 1 then + sort(tags,shortsorter) -- or take first -- todo: proper utf sorter + local lastyear = nil + local suffix = nil + local previous = nil + for i=1,n do + local tagdata = tags[i] + local tag = tagdata[1] + local detail = details[tag] + local entry = luadata[tag] + local year = entry.year + detail[key] = hash + if year ~= lastyear then + lastyear = year + suffix = 1 + else + if previous and suffix == 1 then + previous[suffixkey] = suffix + end + suffix = suffix + 1 + detail[suffixkey] = suffix + end + previous = detail end - if trace_shorts then - report_shorts("year %a, suffix %a, short %a, tag %a",year or "-",suffix or "-",short,tag) + end + if trace_suffixes then + for i=1,n do + local tag = tags[i][1] + local year = luadata[tag].year + local suffix = details[tag].suffix + if suffix then + report_suffix("%s: tag %a, hash %a, year %a, suffix %a",key,tag,hash,year or '',suffix or '') + else + report_suffix("%s: tag %a, hash %a, year %a",key,tag,hash,year or '') + end end end end end + addsuffix(shorts, "shorthash", "shortsuffix") -- todo: shorthash + addsuffix(authors,"authorhash","authorsuffix") end - utilities.sequencers.appendaction(enhancer,"system","publications.enhancers.suffixes") + -- utilities.sequencers.appendaction(enhancer,"system","publications.enhancers.suffixes") end @@ -1744,6 +1769,7 @@ do report_list("invalid method %a",method or "") return end + report_list("collecting entries using method %a and sort order %a",method,rendering.sorttype) lists.result = { } -- kind of reset local keyword = specification.keyword if keyword and keyword ~= "" then @@ -1785,31 +1811,39 @@ do if not repeated then used[tag] = true -- beware we keep the old state (one can always use criterium=all) end - local detail = details[tag] - if detail then - local referencenumber = detail.referencenumber - if not referencenumber then - lastreferencenumber = lastreferencenumber + 1 - referencenumber = lastreferencenumber - detail.referencenumber = lastreferencenumber - end - li[3] = referencenumber - else - report("missing details for tag %a in dataset %a (enhanced: %s)",tag,dataset,current.enhanced and "yes" or "no") - -- weird, this shouldn't happen .. all have a detail - lastreferencenumber = lastreferencenumber + 1 - details[tag] = { referencenumber = lastreferencenumber } - li[3] = lastreferencenumber - end end end end - groups[group] = lastreferencenumber if type(sorter) == "function" then - rendering.list = sorter(dataset,rendering,newlist,sorttype) or newlist + list = sorter(dataset,rendering,newlist,sorttype) or newlist else - rendering.list = newlist + list = newlist + end + for i=1,#list do + local li = list[i] + local tag = li[1] + local entry = luadata[tag] + if entry then + local detail = details[tag] + if detail then + local referencenumber = detail.referencenumber + if not referencenumber then + lastreferencenumber = lastreferencenumber + 1 + referencenumber = lastreferencenumber + detail.referencenumber = lastreferencenumber + end + li[3] = referencenumber + else + report("missing details for tag %a in dataset %a (enhanced: %s)",tag,dataset,current.enhanced and "yes" or "no") + -- weird, this shouldn't happen .. all have a detail + lastreferencenumber = lastreferencenumber + 1 + details[tag] = { referencenumber = lastreferencenumber } + li[3] = lastreferencenumber + end + end end + groups[group] = lastreferencenumber + rendering.list = list end function lists.fetchentries(dataset) @@ -1891,7 +1925,7 @@ do if trace_detail then report("expanding page setup") end - ctx_btxpagesetup() + ctx_btxpagesetup("") -- nothing yet end end @@ -1907,8 +1941,13 @@ do local n = tonumber(i) if n and n > 1 and n <= #list then local luadata = datasets[dataset].luadata - local current = getdirect(dataset,luadata[list[n ][1]],name) - local previous = getdirect(dataset,luadata[list[n-1][1]],name) + local p_index = list[n-1][1] + local c_index = list[n ][1] + local previous = getdirect(dataset,luadata[p_index],name) + local current = getdirect(dataset,luadata[c_index],name) + + -- authors are a special case + -- if not order then -- order = gettexcounter("c_btx_list_reference") -- end @@ -1933,7 +1972,18 @@ do end end end - local sameentry = current and current == previous + local sameentry = false + if current and current == previous then + sameentry = true + else + local p_casted = getcasted(dataset,p_index,name) + local c_casted = getcasted(dataset,c_index,name) + if c_casted and c_casted == p_casted then + sameentry = true + elseif type(c_casted) == "table" and type(p_casted) == "table" then + sameentry = table.identical(c_casted,p_casted) + end + end if trace_detail then if sameentry then report("previous %a, current %a, same entry",previous,current) @@ -1950,13 +2000,16 @@ do function lists.flushentry(dataset,i,textmode) local rendering = renderings[dataset] local list = rendering.list - local luadata = datasets[dataset].luadata + local data = datasets[dataset] + local luadata = data.luadata + local details = data.details local li = list[i] if li then local tag = li[1] local listindex = li[2] local n = li[3] local entry = luadata[tag] + local detail = details[tag] -- ctx_btxstartlistentry() ctx_btxsetcurrentlistentry(i) -- redundant @@ -1975,14 +2028,14 @@ do local bl = li[5] if bl and bl ~= "" then ctx_btxsetbacklink(bl) - ctx_btxsetbacktrace(concat(li," ",5)) - local uc = citetolist[tonumber(bl)] - if uc then - ctx_btxsetinternal(uc.references.internal or "") - end + -- ctx_btxsetbacktrace(concat(li," ",5)) -- two numbers else -- nothing end + local authorsuffix = detail.authorsuffix + if authorsuffix then + ctx_btxsetsuffix(authorsuffix) + end local userdata = li[4] if userdata then local b = userdata.btxbtx @@ -2112,10 +2165,20 @@ do return end -- + local data = datasets[dataset] + if not data.suffixed then + data.authorconversion = specification.authorconversion + publications.enhancers.suffixes(data) + end + -- specification.variant = variant - specification.compress = specification.compress == v_yes + specification.compress = specification.compress specification.markentry = specification.markentry ~= false -- + if specification.sorttype == v_yes then + specification.sorttype = v_normal + end + -- local prefix, rest = lpegmatch(prefixsplitter,reference) if prefix and rest then dataset = prefix @@ -2178,6 +2241,7 @@ do { "variant" }, { "sorttype" }, { "compress" }, + { "authorconversion" }, { "author" }, { "lefttext" }, { "righttext" }, @@ -2205,10 +2269,10 @@ do local ak = a.sortkey local bk = b.sortkey if ak == bk then - local as = a.suffix -- alphabetic - local bs = b.suffix -- alphabetic + local as = a.suffix -- numeric + local bs = b.suffix -- numeric if as and bs then - return (as or "") < (bs or "") + return (as or 0) < (bs or 0) else return false end @@ -2217,56 +2281,75 @@ do end end - local function compresslist(source) - for i=1,#source do - local t = type(source[i].sortkey) - if t == "number" then - -- okay - -- elseif t == "string" then - -- -- okay - else - return source - end + local revsorter = function(a,b) + return keysorter(b,a) + end + + local function compresslist(source,specification) + if specification.sorttype == v_normal then + sort(source,keysorter) + elseif specification.sorttype == v_reverse then + sort(source,revsorter) end - local first, last, firstr, lastr - local target, noftarget, tags = { }, 0, { } - sort(source,keysorter) - local oldvalue = nil - local function flushrange() - noftarget = noftarget + 1 - if last > first + 1 then - target[noftarget] = { - first = firstr, - last = lastr, - tags = tags, - } - else - target[noftarget] = firstr - if last > first then - noftarget = noftarget + 1 - target[noftarget] = lastr + if specification and specification.compress == v_yes and specification.numeric then + local first, last, firstr, lastr + local target, noftarget, tags = { }, 0, { } + local oldvalue = nil + local function flushrange() + noftarget = noftarget + 1 + if last > first + 1 then + target[noftarget] = { + first = firstr, + last = lastr, + tags = tags, + } + else + target[noftarget] = firstr + if last > first then + noftarget = noftarget + 1 + target[noftarget] = lastr + end end + tags = { } end - tags = { } - end - for i=1,#source do - local entry = source[i] - local current = entry.sortkey - local suffix = entry.suffix -- todo but what - if not first then - first, last, firstr, lastr = current, current, entry, entry - elseif current == last + 1 then - last, lastr = current, entry - else + for i=1,#source do + local entry = source[i] + local current = entry.sortkey -- so we need a sortkey ! + if entry.suffix then + if not first then + first, last, firstr, lastr = current, current, entry, entry + else + flushrange() + first, last, firstr, lastr = current, current, entry, entry + end + else + if not first then + first, last, firstr, lastr = current, current, entry, entry + elseif current == last + 1 then + last, lastr = current, entry + else + flushrange() + first, last, firstr, lastr = current, current, entry, entry + end + end + tags[#tags+1] = entry.tag + end + if first and last then flushrange() - first, last, firstr, lastr = current, current, entry, entry end - tags[#tags+1] = entry.tag - end - if first and last then - flushrange() + return target + else + local target, noftarget = { }, 0 + for i=1,#source do + local entry = source[i] + noftarget = noftarget + 1 + target[noftarget] = { + first = entry, + tags = { entry.tag }, + } + end + return target end - return target end -- local source = { @@ -2297,6 +2380,7 @@ do local internal = specification.internal local setup = specification.variant local compress = specification.compress + local sorttype = specification.sorttype local getter = specification.getter local setter = specification.setter local compressor = specification.compressor @@ -2315,7 +2399,6 @@ do report("processing reference %a",reference) end local source = { } - local badkey = false local luadata = datasets[dataset].luadata for i=1,#found do local entry = found[i] @@ -2329,19 +2412,6 @@ do -- luadata = ldata, } setter(data,dataset,tag,entry) - if compress and not compressor then - local sortkey = data.sortkey - if sortkey then - local key = lpegmatch(numberonly,sortkey) - if key then - data.sortkey = key - else - badkey = true - end - else - badkey = true - end - end if type(data) == "table" then source[#source+1] = data else @@ -2359,13 +2429,6 @@ do if before and before ~= "" then before = settings_to_array(before) end if after and after ~= "" then after = settings_to_array(after) end - -- local oneleft = lefttext and #lefttext == 1 and lefttext [1] - -- local oneright = righttext and #righttext == 1 and righttext[1] - -- - -- if not oneleft or not oneright then - -- compress = false -- very hard coded, or should we have compreess == auto? - -- end - local function flush(i,n,entry,last) local tag = entry.tag local currentcitation = markcite(dataset,tag) @@ -2374,27 +2437,6 @@ do ctx_btxsettag(tag) ctx_btxsetcategory(entry.category or "unknown") -- - -- if oneleft then - -- if i == 1 then - -- ctx_btxsetlefttext(oneleft) - -- end - -- elseif lefttext then - -- ctx_btxsetlefttext(lefttext[i] or "") - -- end - -- if oneright then - -- if i == n then - -- ctx_btxsetrighttext(oneright) - -- end - -- elseif righttext then - -- ctx_btxsetrighttext(righttext[i] or "") - -- end - -- if before then - -- ctx_btxsetbefore(before[i] or (#before == 1 and before[1]) or "") - -- end - -- if after then - -- ctx_btxsetafter(after[i] or (#after == 1 and after[1]) or "") - -- end - -- if lefttext then local text = lefttext [i] ; if text and text ~= "" then ctx_btxsetlefttext (text) end end if righttext then local text = righttext[i] ; if text and text ~= "" then ctx_btxsetrighttext(text) end end if before then local text = before [i] ; if text and text ~= "" then ctx_btxsetbefore (text) end end @@ -2413,7 +2455,7 @@ do if language then ctx_btxsetlanguage(language) end - if not getter(entry,last) then + if not getter(entry,last,nil,specification) then ctx_btxsetfirst("") -- (f_missing(tag)) end ctx_btxsetconcat(concatstate(i,n)) @@ -2423,13 +2465,18 @@ do ctx_btxcitesetup(setup) ctx_btxstopcite() end - - if compress and not badkey then - local target = (compressor or compresslist)(source) + if sorttype == v_normal or sorttype == v_reverse then + local target = (compressor or compresslist)(source,specification) local nofcollected = #target if nofcollected == 0 then - report("nothing found for %a",reference) - unknowncite(reference) + local nofcollected = #source + if nofcollected == 0 then + unknowncite(reference) + else + for i=1,nofcollected do + flush(i,nofcollected,source[i]) + end + end else for i=1,nofcollected do local entry = target[i] @@ -2460,7 +2507,7 @@ do -- - local function simplegetter(first,last,field) + local function simplegetter(first,last,field,specification) local value = first[field] if value then ctx_btxsetfirst(value) @@ -2473,7 +2520,7 @@ do local setters = setmetatableindex({},function(t,k) local v = function(data,dataset,tag,entry) - local value = getcasted(dataset,tag,k) + local value = getcasted(dataset,tag,k) data.value = value -- not really needed data[k] = value data.sortkey = value @@ -2484,8 +2531,8 @@ do end) local getters = setmetatableindex({},function(t,k) - local v = function(first,last) - return simplegetter(first,last,k) + local v = function(first,last,_,specification) + return simplegetter(first,last,k,specification) -- maybe _ or k end t[k] = v return v @@ -2508,7 +2555,7 @@ do }) end - -- category | type + -- category do @@ -2516,21 +2563,12 @@ do data.category = getfield(dataset,tag,"category") end - local function getter(first,last) - return simplegetter(first,last,"category") + local function getter(first,last,_,specification) + return simplegetter(first,last,"category",specification) end function citevariants.category(presets) processcite(presets,{ - -- variant = presets.variant or "serial", - setter = setter, - getter = getter, - }) - end - - function citevariants.type(presets) - processcite(presets,{ - -- variant = presets.variant or "type", setter = setter, getter = getter, }) @@ -2547,14 +2585,13 @@ do -- nothing end - local function getter(first,last) -- last not used + local function getter(first,last,_,specification) -- last not used ctx_btxsetfirst(first.tag) end function citevariants.entry(presets) processcite(presets,{ compress = false, - -- variant = presets.variant or "entry", setter = setter, getter = getter, }) @@ -2567,18 +2604,20 @@ do do local function setter(data,dataset,tag,entry) - data.short = getdetail(dataset,tag,"short") - data.suffix = getdetail(dataset,tag,"suffix") + local short = getdetail(dataset,tag,"shorthash") + local suffix = getdetail(dataset,tag,"shortsuffix") + data.short = short + data.sortkey = short + data.suffix = suffix end - local function getter(first,last) -- last not used + local function getter(first,last,_,specification) -- last not used local short = first.short if short then local suffix = first.suffix + ctx_btxsetfirst(short) if suffix then - ctx_btxsetfirst(short .. suffix) - else - ctx_btxsetfirst(short) + ctx_btxsetsuffix(suffix) -- watch out: third end return true end @@ -2586,10 +2625,8 @@ do function citevariants.short(presets) processcite(presets,{ - compress = false, - -- variant = presets.variant or "short", - setter = setter, - getter = getter, + setter = setter, + getter = getter, }) end @@ -2603,7 +2640,7 @@ do data.pages = getcasted(dataset,tag,"pages") end - local function getter(first,last) + local function getter(first,last,_,specification) local pages = first.pages if pages then if type(pages) == "table" then @@ -2618,9 +2655,8 @@ do function citevariants.page(presets) processcite(presets,{ - -- variant = presets.variant or "page", - setter = setter, - getter = getter, + setter = setter, + getter = getter, }) end @@ -2634,21 +2670,23 @@ do local entries = entry.entries local text = entries and entries.text or "?" data.num = text - data.sortkey = text + data.sortkey = tonumber(text) or text end - local function getter(first,last) - return simplegetter(first,last,"num") + local function getter(first,last,tag,specification) + return simplegetter(first,last,"num",specification) end function citevariants.num(presets) processcite(presets,{ - -- variant = presets.variant or "num", + numeric = true, setter = setter, getter = getter, }) end + citevariants.textnum = citevariants.num -- should not be needed + end -- year @@ -2657,19 +2695,19 @@ do local function setter(data,dataset,tag,entry) local year = getfield (dataset,tag,"year") - local suffix = getdetail(dataset,tag,"suffix") + local suffix = getdetail(dataset,tag,"authorsuffix") data.year = year data.suffix = suffix data.sortkey = tonumber(year) or 9999 end - local function getter(first,last) - return simplegetter(first,last,"year") + local function getter(first,last,_,specification) + return simplegetter(first,last,"year",specification) end function citevariants.year(presets) processcite(presets,{ - -- variant = presets.variant or "year", + numeric = true, setter = setter, getter = getter, }) @@ -2677,64 +2715,47 @@ do end - -- index | serial + -- index do local function setter(data,dataset,tag,entry) - local index = getfield(dataset,tag,"index") + local index = getfield(dataset,tag,"index") data.index = index data.sortkey = index end - local function getter(first,last) - return simplegetter(first,last,"index") + local function getter(first,last,_,specification) + return simplegetter(first,last,"index",specification) end function citevariants.index(presets) processcite(presets,{ - -- variant = presets.variant or "index", - setter = setter, - getter = getter, - }) - end - - function citevariants.serial(presets) - processcite(presets,{ - -- variant = presets.variant or "serial", setter = setter, getter = getter, + numeric = true, }) end end - -- key | tag + -- tag do local function setter(data,dataset,tag,entry) - -- nothing - end - - local function getter(first,last) - ctx_btxsetfirst(first.tag) - return true + data.tag = tag + data.sortkey = tag end - function citevariants.key(presets) - return processcite(presets,{ - variant = "key", - setter = setter, - getter = getter, - }) + local function getter(first,last,_,specification) + return simplegetter(first,last,"tag",specification) end function citevariants.tag(presets) return processcite(presets,{ - variant = "tag", - setter = setter, - getter = getter, + setter = setter, + getter = getter, }) end @@ -2764,7 +2785,7 @@ do data.keywords = getcasted(dataset,tag,"keywords") end - local function getter(first,last) + local function getter(first,last,_,specification) context(listof(first.keywords)) end @@ -2782,17 +2803,45 @@ do do + -- is this good enough? + + local keysorter = function(a,b) + local ak = a.authorhash + local bk = b.authorhash + if ak == bk then + local as = a.authorsuffix -- numeric + local bs = b.authorsuffix -- numeric + if as and bs then + return (as or 0) < (bs or 0) + else + return false + end + else + return ak < bk + end + end + + local revsorter = function(a,b) + return keysorter(b,a) + end + local currentbtxciteauthor = function() context.currentbtxciteauthor() return true -- needed? end - local function authorcompressor(found) + local function authorcompressor(found,specification) + -- HERE + if specification.sorttype == v_normal then + sort(found,keysorter) + elseif specification.sorttype == v_reverse then + sort(found,revsorter) + end local result = { } local entries = { } for i=1,#found do local entry = found[i] - local author = entry.author + local author = entry.authorhash if author then local aentries = entries[author] if aentries then @@ -2802,11 +2851,11 @@ do end end end - -- beware: we usetables as hash so we get a cycle when inspecting (unless we start + -- beware: we use tables as hash so we get a cycle when inspecting (unless we start -- hashing with strings) for i=1,#found do local entry = found[i] - local author = entry.author + local author = entry.authorhash if author then local aentries = entries[author] if not aentries then @@ -2820,7 +2869,6 @@ do end end end - -- todo: add letters (should we then tag all?) return result end @@ -2843,19 +2891,20 @@ do if first then ctx_btxsetfirst(first[key] or "") -- f_missing(first.tag)) local suffix = entry.suffix - local value = entry.last[key] + local last = entry.last + local value = last and last[key] if value then ctx_btxsetsecond(value) end if suffix then - ctx_btxsetthird(suffix) + ctx_btxsetsuffix(suffix) end else local suffix = entry.suffix local value = entry[key] or "" -- f_missing(tag) ctx_btxsetfirst(value) if suffix then - ctx_btxsetthird(suffix) + ctx_btxsetsuffix(suffix) end end ctx_btxsetconcat(concatstate(i,nofcollected)) @@ -2880,7 +2929,7 @@ do -- ctx_btxsetinternal(bl and bl.references.internal or "") ctx_btxsetfirst(entry[key] or "") -- f_missing(tag) if suffix then - ctx_btxsetthird(entry.suffix) + ctx_btxsetsuffix(entry.suffix) end if trace_detail then report("expanding %a cite setup %a","single author",setup) @@ -2892,7 +2941,7 @@ do local partialinteractive = false - local function authorgetter(first,last,key,setup) -- only first + local function authorgetter(first,last,key,specification) -- only first -- ctx_btxsetfirst(first.author) -- unformatted -- ctx_btxsetfirst(currentbtxciteauthor) -- formatter (much slower) if first.type == "author" then @@ -2908,13 +2957,13 @@ do end if entries then -- happens with year - local c = compresslist(entries) - local f = function() authorconcat(c,key,setup) return true end -- indeed return true? + local c = compresslist(entries,specification) + local f = function() authorconcat(c,key,specification.setup or "author") return true end -- indeed return true? ctx_btxsetcount(#c) ctx_btxsetsecond(f) elseif first then -- happens with num - local f = function() authorsingle(first,key,setup) return true end -- indeed return true? + local f = function() authorsingle(first,key,specification.setup or "author") return true end -- indeed return true? ctx_btxsetcount(0) ctx_btxsetsecond(f) end @@ -2925,9 +2974,11 @@ do local function setter(data,dataset,tag,entry) data.author, data.field, data.type = getcasted(dataset,tag,"author") + data.sortkey = text and lpegmatch(numberonly,text) + data.authorhash = getdetail(dataset,tag,"authorhash") -- todo let getcasted return end - local function getter(first,last,_,setup) + local function getter(first,last,_,specification) if first.type == "author" then ctx_btxsetfirst(currentbtxciteauthor) -- formatter (much slower) else @@ -2938,10 +2989,11 @@ do function citevariants.author(presets) processcite(presets,{ - compress = false, - variant = "author", - setter = setter, - getter = getter, + variant = "author", + setup = "author", + setter = setter, + getter = getter, + compressor = authorcompressor, }) end @@ -2951,18 +3003,21 @@ do local entries = entry.entries local text = entries and entries.text or "?" data.author, data.field, data.type = getcasted(dataset,tag,"author") + data.authorhash = getdetail(dataset,tag,"authorhash") -- todo let getcasted return data.num = text data.sortkey = text and lpegmatch(numberonly,text) end - local function getter(first,last) - authorgetter(first,last,"num","author:num") + local function getter(first,last,_,specification) + authorgetter(first,last,"num",specification) return true end function citevariants.authornum(presets) processcite(presets,{ variant = "authornum", + setup = "author:num", + numeric = true, setter = setter, getter = getter, compressor = authorcompressor, @@ -2973,35 +3028,40 @@ do local function setter(data,dataset,tag,entry) data.author, data.field, data.type = getcasted(dataset,tag,"author") + data.authorhash = getdetail(dataset,tag,"authorhash") -- todo let getcasted return local year = getfield (dataset,tag,"year") - local suffix = getdetail(dataset,tag,"suffix") + local suffix = getdetail(dataset,tag,"authorsuffix") data.year = year data.suffix = suffix data.sortkey = tonumber(year) or 9999 end - local function getter(first,last) - authorgetter(first,last,"year","author:year") + local function getter(first,last,_,specification) + authorgetter(first,last,"year",specification) return true end function citevariants.authoryear(presets) processcite(presets,{ variant = "authoryear", + setup = "author:year", + numeric = true, setter = setter, getter = getter, compressor = authorcompressor, }) end - local function getter(first,last) - authorgetter(first,last,"year","author:years") + local function getter(first,last,_,specification) + authorgetter(first,last,"year",specification) return true end function citevariants.authoryears(presets) processcite(presets,{ variant = "authoryears", + setup = "author:years", + numeric = true, setter = setter, getter = getter, compressor = authorcompressor, @@ -3037,7 +3097,7 @@ do if trace_detail then report("expanding %a list setup %a","default",variant) end - ctx_btxlistsetup("default") + ctx_btxnumberingsetup("default") end function listvariants.num(dataset,block,tag,variant,listindex) @@ -3045,25 +3105,25 @@ do if trace_detail then report("expanding %a list setup %a","num",variant) end - ctx_btxlistsetup(variant) + ctx_btxnumberingsetup(variant or "num") end listvariants[v_yes] = listvariants.num listvariants.bib = listvariants.num function listvariants.short(dataset,block,tag,variant,listindex) - local short = getdetail(dataset,tag,"short","short") - local suffix = getdetail(dataset,tag,"suffix","suffix") + local short = getdetail(dataset,tag,"shorthash") + local suffix = getdetail(dataset,tag,"shortsuffix") if short then ctx_btxsetfirst(short) end if suffix then - ctx_btxsetthird(suffix) + ctx_btxsetsuffix(suffix) end if trace_detail then report("expanding %a list setup %a","short",variant) end - ctx_btxlistsetup(variant) + ctx_btxnumberingsetup(variant or "short") end function listvariants.page(dataset,block,tag,variant,listindex) diff --git a/Master/texmf-dist/tex/context/base/publ-ini.mkiv b/Master/texmf-dist/tex/context/base/publ-ini.mkiv index a4452e45193..7270b5f4d18 100644 --- a/Master/texmf-dist/tex/context/base/publ-ini.mkiv +++ b/Master/texmf-dist/tex/context/base/publ-ini.mkiv @@ -11,7 +11,6 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. - % TODO: s! vs v! for default and neutral key/values % todo: too many refs in list @@ -307,11 +306,9 @@ \def\publ_command_nop#1% {\ifcsname#1\endcsname \showmessage\m!publications{10}{#1,#1}% - %\setuxvalue{\??btxcommand#1}{\expandafter\noexpand\csname#1\endcsname}% \global\expandafter\let\csname\??btxcommand#1\expandafter\endcsname\csname#1\endcsname \else\ifcsname\utfupper{#1}\endcsname \showmessage\m!publications{10}{#1}{\utfupper{#1}}% - %\setuxvalue{\??btxcommand#1}{\expandafter\noexpand\csname\utfupper{#1}\endcsname}% \global\expandafter\let\csname\??btxcommand#1\expandafter\endcsname\csname\utfupper{#1}\endcsname \else \showmessage\m!publications{11}{#1}% @@ -373,6 +370,7 @@ \unexpanded\def\btxnbsp {\removeunwantedspaces\nbsp} % the same anyway \unexpanded\def\btxperiod {\removeunwantedspaces.\space} \unexpanded\def\btxcomma {\removeunwantedspaces,\space} +\unexpanded\def\btxcommabreak {\removeunwantedspaces,\hskip\zeropoint plus .5\emwidth\relax} \unexpanded\def\btxcolon {\removeunwantedspaces:\space} \unexpanded\def\btxsemicolon {\removeunwantedspaces;\space} \unexpanded\def\btxlparent {\removeunwantedspaces\space(} % obsolete @@ -395,7 +393,8 @@ \let\currentbtxdataset \empty \unexpanded\def\btxsetdataset {\def\currentbtxdataset} \let\currentbtxfirst \empty \unexpanded\def\btxsetfirst {\def\currentbtxfirst} \let\currentbtxsecond \empty \unexpanded\def\btxsetsecond {\def\currentbtxsecond} -\let\currentbtxthird \empty \unexpanded\def\btxsetthird {\def\currentbtxthird} +%let\currentbtxthird \empty \unexpanded\def\btxsetthird {\def\currentbtxthird} +\let\currentbtxsuffix \empty \unexpanded\def\btxsetsuffix {\def\currentbtxsuffix} \let\currentbtxinternal \empty \unexpanded\def\btxsetinternal {\def\currentbtxinternal} \let\currentbtxlefttext \empty \unexpanded\def\btxsetlefttext {\def\currentbtxlefttext} \let\currentbtxrighttext \empty \unexpanded\def\btxsetrighttext {\def\currentbtxrighttext} @@ -425,9 +424,14 @@ \unexpanded\def\currentbtxsurnames_indeed {\clf_btxcurrentsurnames \numexpr\currentbtxauthorindex\relax} \unexpanded\def\currentbtxvons_indeed {\clf_btxcurrentvons \numexpr\currentbtxauthorindex\relax} +\let\currentbtxfirstpage \empty \unexpanded\def\btxsetfirstpage #1{\def\currentbtxfirstpage{\btx_page_number{#1}}} +\let\currentbtxlastpage \empty \unexpanded\def\btxsetlastpage #1{\def\currentbtxlastpage {\btx_page_number{#1}}} +\let\currentbtxfirstinternal\empty \unexpanded\def\btxsetfirstinternal {\def\currentbtxfirstinternal} +\let\currentbtxlastinternal \empty \unexpanded\def\btxsetlastinternal {\def\currentbtxlastinternal} + \def\currentbtxauthorvariant{normal} -\unexpanded\def\btxlistreset +\unexpanded\def\btx_reset_list % not needed as we're grouped {\let\currentbtxcombis \empty \let\currentbtxcategory \empty \let\currentbtxinternal \empty @@ -439,12 +443,14 @@ \let\currentbtxbacktrace\empty \let\currentbtxlanguage \empty \let\currentbtxtag \empty + \let\currentbtxsuffix \empty \let\currentbtxnumber \empty \let\currentbtxdataset \empty} -\unexpanded\def\btxcitereset % check for less .. not all resets needed +\unexpanded\def\btx_reset_cite % check for less .. not all resets needed when we're grouped (only subcites) {\let \currentbtxfirst \empty \let \currentbtxsecond \empty + \let \currentbtxsuffix \empty \let \currentbtxinternal \empty \let \currentbtxlefttext \empty \let \currentbtxrighttext \empty @@ -460,6 +466,27 @@ \setconstant\currentbtxconcat \zerocount \setconstant\currentbtxcount \zerocount} +\unexpanded\def\btx_reset_page % probably not needed + {\let \currentbtxfirstpage \empty + \let \currentbtxlastpage \empty + \let \currentbtxfirstinternal\empty + \let \currentbtxlastinternal \empty + \setconstant\currentbtxoverflow \zerocount + \setconstant\currentbtxconcat \zerocount + \setconstant\currentbtxcount \zerocount} + +\unexpanded\def\btx_reset_numbering % probably not needed + {\let \currentbtxfirst \empty + \let \currentbtxsecond\empty + \let \currentbtxsuffix\empty + \setconstant\currentbtxconcat\zerocount} + +%D Pages: + +\unexpanded\def\btx_page_number#1% + {\def\currentlistindex{#1}% + \structurelistpagenumber} + %D Language: \def\mainbtxlanguage{\currentmainlanguage} @@ -497,7 +524,6 @@ %D Lists: \newdimen\d_publ_number_width -%newdimen\d_publ_number_distance \ifdefined\btxblock \else \newcount\btxblock \fi \btxblock\plusone \ifdefined\btxcitecounter \else \newcount\btxcitecounter \fi % maybe pass this to lua @@ -512,11 +538,12 @@ [\s!btx] [\c!prefixstopper=:, \c!state=\v!start, - \c!alternative=\v!paragraph, + \c!alternative=a, + %\c!alternative=\v!paragraph, + %\c!width=\v!auto, + %\c!distance=\emwidth, \c!before=\blank, - \c!after=\blank, - \c!width=\v!auto, - \c!distance=\emwidth] + \c!after=\blank] \unexpanded\def\setupbtxlist {\dodoubleempty\publ_setup_list} @@ -551,26 +578,6 @@ \settrue\setfalse\c_btx_list_texts \to \everysetupbtxlistplacement -% page stuff (for thomas) - -\let\currentbtxfirstpage \empty \unexpanded\def\btxsetfirstpage #1{\def\currentbtxfirstpage{\btx_page_number{#1}}} -\let\currentbtxlastpage \empty \unexpanded\def\btxsetlastpage #1{\def\currentbtxlastpage {\btx_page_number{#1}}} -\let\currentbtxfirstinternal\empty \unexpanded\def\btxsetfirstinternal {\def\currentbtxfirstinternal} -\let\currentbtxlastinternal \empty \unexpanded\def\btxsetlastinternal {\def\currentbtxlastinternal} - -\unexpanded\def\btx_page_number#1% - {\def\currentlistindex{#1}% - \structurelistpagenumber} - -\unexpanded\def\btxpagereset - {\let \currentbtxfirstpage \empty - \let \currentbtxlastpage \empty - \let \currentbtxfirstinternal\empty - \let \currentbtxlastinternal \empty - \setconstant\currentbtxoverflow \zerocount - \setconstant\currentbtxconcat \zerocount - \setconstant\currentbtxcount \zerocount} - \newconditional\c_btx_list_pages \appendtoks @@ -582,19 +589,34 @@ {\dontleavehmode \begingroup \setbtxlist % probably already set - \btxpagereset + \btx_reset_page \setbtxparameterset\s!page\s!list - \btxparameter\c!command + \btxparameter\c!pagecommand {\usebtxstyleandcolor\c!style\c!color \btxparameter\c!pageleft \clf_btxflushpages{\currentbtxdataset}{\currentbtxtag}% \btxparameter\c!pageright}% \endgroup} -\unexpanded\def\btxpagesetup - {\btxsetuptype\plusfour - \fastbtxsetup\s!page\s!list - \btxpagereset} +\unexpanded\def\btxpagesetup#1% nothing yet + {\begingroup + %\setbtxparameterset{\c!page:\s!default}\currentbtxnumbering + \btxparameter\c!left + % \btxparameter\c!command{\publ_fast_setup\plusfive\s!list\s!page}% + \publ_fast_setup\plusfive\s!list\s!page + \btxparameter\c!right + \endgroup + \btx_reset_page} % probably not needed + +\unexpanded\def\btxnumberingsetup#1% + {\begingroup + \setbtxparameterset{\c!list:\s!numbering}\currentbtxnumbering % brrrr \setbtxlist + \btxparameter\c!left + % \btxparameter\c!command{\publ_fast_setup\plusthree{\s!list:\s!numbering}{#1}}% + \publ_fast_setup\plusthree{\s!list:\s!numbering}{#1}% + \btxparameter\c!right + \endgroup + \btx_reset_numbering} % probably not needed % end of page stuff @@ -608,8 +630,7 @@ \begingroup \usebtxstyleandcolor\c!style\c!color \ignorespaces - \btxsetuptype\plusthree - \fastbtxsetup\s!list\currentbtxcategory + \publ_fast_setup\plusfour\s!list\currentbtxcategory \removeunwantedspaces \endgroup \ifconditional\c_btx_list_pages @@ -640,8 +661,7 @@ {\begingroup \def\currentbtxtag{#1}% \ignorespaces - \btxsetuptype\plusthree - \fastbtxsetup\s!list\currentbtxcategory + \publ_fast_setup\plusfour\s!list\currentbtxcategory \removeunwantedspaces \endgroup} @@ -834,8 +854,7 @@ \unexpanded\def\btxlistsetup#1% used for the reference in the list {\the\everybtxlistentry \everybtxlistentry\emptytoks % so only once per entry to be sure - \btxsetuptype\plusthree - \fastbtxsetup\s!list{#1}} + \publ_fast_setup\plusfour\s!list{#1}} \appendtoks \btx_check_language @@ -843,15 +862,15 @@ \unexpanded\def\btx_reference_indeed {\begingroup - %let\currentbtxlistvariant\currentbtxnumbering - \setbtxparameterset\c!list\currentbtxnumbering + % redundantm will go away: + \setbtxparameterset{\c!list:\s!numbering}\currentbtxnumbering + % \ifx\currentbtxnumbering\empty % nothing \else\ifx\currentbtxnumbering\v!no % nothing \else \usebtxstyleandcolor\c!style\c!color % new, needed? - % \btxparameter\c!left \ifconditional\c_publ_prefixed\btxlistprefixednumber\fi \clf_btxlistvariant % some can go {\currentbtxdataset}% @@ -860,7 +879,6 @@ {\currentbtxnumbering}% {\currentbtxnumber}% \relax - % \btxparameter\c!right \fi\fi \endgroup} @@ -926,18 +944,6 @@ \newtoks\t_btx_reference_inject -% \def\btx_cite_reference_inject_indeed -% {\btx_trace_list_cross\currentbtxbacklink\empty -% \the\t_btx_reference_inject -% \normalexpanded{\writedatatolist % can be done faster .. just merge code here (not much) / also type btx -% [\s!btx]% -% [\ifx\currentbtxdataset\v!default\else\s!btxset=\currentbtxdataset,\fi% -% \s!btxref=\currentbtxtag,% -% \ifx\currentbtxbefore\empty\else\s!btxbtx=\!!bs\currentbtxbefore\!!es,\fi% -% \ifx\currentbtxafter \empty\else\s!btxatx=\!!bs\currentbtxafter \!!es,\fi% -% \s!btxint=\number\currentbtxbacklink -% \ifx\currentbtxciteuservariables\empty\else,\currentbtxciteuservariables\fi]}} - \def\btx_cite_reference_inject_indeed {\btx_trace_list_cross\currentbtxbacklink\empty \the\t_btx_reference_inject @@ -946,8 +952,8 @@ [\c!type=\s!btx]% \c!location=\v!none [\ifx\currentbtxdataset\v!default\else\s!btxset=\currentbtxdataset,\fi% \s!btxref=\currentbtxtag,% - \ifx\currentbtxbefore\empty\else\s!btxbtx=\!!bs\currentbtxbefore\!!es,\fi% - \ifx\currentbtxafter \empty\else\s!btxatx=\!!bs\currentbtxafter \!!es,\fi% + \ifx\currentbtxbefore\empty\else\s!btxbtx={\currentbtxbefore},\fi% + \ifx\currentbtxafter \empty\else\s!btxatx={\currentbtxafter },\fi% \s!btxint=\number\currentbtxbacklink \ifx\currentbtxciteuservariables\empty\else,\currentbtxciteuservariables\fi]} @@ -976,13 +982,22 @@ \let\currentlistmethod\s!btx \to \everysetupbtxlistplacement -% \appendtoks -% \edef\currentbtxcriterium{\btxrenderingparameter\c!criterium}% -% \to \everysetupbtxlistplacement +\unexpanded\def\btxremapauthor + {\dodoubleargument\btx_remap_author} + +\def\btx_remap_author[#1][#2]% + {\clf_btxremapauthor{#1}{#2}} \unexpanded\def\btxflushauthor {\doifelsenextoptionalcs\btx_flush_author_yes\btx_flush_author_nop} +\unexpanded\def\btxflushsuffix + {\ifx\currentbtxsuffix\empty + % nothing + \else + \characters{\currentbtxsuffix}% todo : rendering specific converter + \fi} + \def\btx_flush_author_yes[#1]{\btx_flush_author{#1}} \def\btx_flush_author_nop {\btx_flush_author{\btxparameter\c!authorconversion}} @@ -990,7 +1005,7 @@ {\begingroup \edef\currentbtxfield{#2}% \setbtxparameterset\s!list\currentbtxfield - %let\currentbtxlistvariant\currentbtxfield +% \let\currentbtxlistvariant\currentbtxfield \clf_btxauthor {\currentbtxdataset}% {\currentbtxtag}% @@ -1099,17 +1114,6 @@ \fi \to \everysetupbtxciteplacement -% till here - -% \unexpanded\def\btxnumberedreference[#1]% \bibtexnumref (replaced by \cite[num]) -% {\dontleavehmode -% \begingroup -% \btxparameter\v!left -% \penalty\plustenthousand % todo -% \clf_btxresolvelistreference{\currentbtxdataset}{#1}% todo: split dataset from #1, so another call -% \btxparameter\v!right -% \endgroup} - %D When a publication is cited, we need to signal that somehow. This is done with the %D following (not user) command. We could tag without injecting a node but this way %D we also store the location, which makes it possible to ask local lists. @@ -1223,29 +1227,32 @@ \dosingleargument\publ_cite_handle_variant_indeed} \unexpanded\def\publ_cite_handle_variant_blob - {%\btxparameter\v!left\relax - \clf_btxhandlecite - dataset {\currentbtxdataset}% - reference {\currentbtxreference}% - markentry \iftrialtypesetting\s!false\else\s!true\fi\space - variant {\currentbtxcitealternative}% - sorttype {\btxparameter\c!sorttype}% - compress {\btxparameter\c!compress}% - author {\btxparameter\c!author}% - lefttext {\p_publ_cite_lefttext}% - righttext {\p_publ_cite_righttext}% - before {\p_publ_cite_before}% - after {\p_publ_cite_after}% + {\clf_btxhandlecite + dataset {\currentbtxdataset}% + reference {\currentbtxreference}% + markentry \iftrialtypesetting\s!false\else\s!true\fi\space + variant {\currentbtxcitealternative}% + sorttype {\btxparameter\c!sorttype}% + compress {\btxparameter\c!compress}% + author {\btxparameter\c!author}% + authorconversion {\c!authorconversion}% + lefttext {\p_publ_cite_lefttext}% + righttext {\p_publ_cite_righttext}% + before {\p_publ_cite_before}% + after {\p_publ_cite_after}% \relax - \clf_btxflushmarked % maybe: \iftrialtypesetting\else ... \fi - }%\btxparameter\v!right\relax} + \clf_btxflushmarked} % maybe: \iftrialtypesetting\else ... \fi + +\let\dobtxcitevariantblob\publ_cite_handle_variant_blob % command can use it via lua \def\publ_cite_handle_variant_indeed[#1]% {\letbtxparameter\c!alternative\currentbtxcitealternative \edef\currentbtxreference{#1}% \usebtxstyleandcolor\c!style\c!color \uselanguageparameter\btxdatasetparameter % new - \btxparameter\c!command{\publ_cite_handle_variant_blob}% + \btxparameter\c!left + \btxparameter\c!command{\dobtxcitevariantblob}% {\publ_cite_handle_variant_blob}% + \btxparameter\c!right \endgroup} \unexpanded\def\btxcitation @@ -1281,18 +1288,17 @@ %D Compatibility: -\let\cite \btxcitation -\let\citation \btxcitation -\let\nocite \btxnocitation -\let\nocitation \btxnocitation -%let\usepublication\btxnocitation +\let\cite \btxcitation +\let\citation \btxcitation +\let\nocite \btxnocitation +\let\nocitation\btxnocitation %D Setup helpers, beware, we need to wrap this .. now we need to know %D how setups are implemented. \setvalue{\??setup:\s!btx:\s!unknown}#1{\inframed{\tttf#1}} -\def\fastbtxsetup_yes#1#2% +\def\publ_fast_setup_yes#1#2% {\csname\??setup:\s!btx:% \ifcsname\??setup:\s!btx:\currentbtxspecification:#1:#2\endcsname \currentbtxspecification:#1:#2% @@ -1309,7 +1315,7 @@ \fi\fi\fi\fi\fi \endcsname{#2}} -\def\fastbtxsetup_nop#1#2% +\def\publ_fast_setup_nop#1#2% {\csname\??setup:\s!btx:% \ifcsname\??setup:\s!btx:\currentbtxspecification:#1:#2\endcsname \currentbtxspecification:#1:#2% @@ -1322,76 +1328,84 @@ \fi\fi\fi \endcsname{#2}} -\def\fastbtxsetup - {\ifx\currentbtxspecificationfallback\empty - \expandafter\fastbtxsetup_nop - \else - \expandafter\fastbtxsetup_yes - \fi} - -\let\publ_fastbtxsetup_normal\fastbtxsetup - \newconstant\btxsetuptype % 0 = unknown darkred % 1 = cite darkblue % 2 = subcite darkgreen -% 3 = list darkcyan -% 4 = page darkmagenta -% 5 = unknown darkred +% 3 = numbering darkorange +% 4 = list darkcyan +% 5 = page darkmagenta +% 6 = unknown darkred -\unexpanded\def\publ_fastbtxsetup_chain_inbetween +\unexpanded\def\publ_fast_btx_setup_chain_inbetween {\allowbreak->\allowbreak} -\unexpanded\def\publ_fastbtxsetup_chain_yes#1#2% +\unexpanded\def\publ_fast_btx_setup_chain_yes#1#2% {\dontleavehmode\begingroup \infofont \ifcase\btxsetuptype\darkred\or\darkblue\or\darkgreen\or\darkcyan\or\darkmagenta\else\darkred\fi [% \currentbtxspecification :#1:#2\ifcsname\??setup:\s!btx:\currentbtxspecification :#1:#2\endcsname\else - \publ_fastbtxsetup_chain_inbetween + \publ_fast_btx_setup_chain_inbetween \currentbtxspecificationfallback:#1:#2\ifcsname\??setup:\s!btx:\currentbtxspecificationfallback :#1:#2\endcsname\else - \publ_fastbtxsetup_chain_inbetween + \publ_fast_btx_setup_chain_inbetween #1:#2\ifcsname\??setup:\s!btx :#1:#2\endcsname\else - \publ_fastbtxsetup_chain_inbetween + \publ_fast_btx_setup_chain_inbetween \currentbtxspecification :#1:\s!unknown\ifcsname\??setup:\s!btx:\currentbtxspecification :#1:\s!unknown\endcsname\else - \publ_fastbtxsetup_chain_inbetween + \publ_fast_btx_setup_chain_inbetween \currentbtxspecificationfallback:#1:\s!unknown\ifcsname\??setup:\s!btx:\currentbtxspecificationfallback:#1:\s!unknown\endcsname\else - \publ_fastbtxsetup_chain_inbetween + \publ_fast_btx_setup_chain_inbetween unset\fi\fi\fi\fi\fi + \space @\space + \currentbtx ]% \endgroup} -\unexpanded\def\publ_fastbtxsetup_chain_nop#1#2% +\unexpanded\def\publ_fast_btx_setup_chain_nop#1#2% {\dontleavehmode\begingroup \infofont \darkred [% \currentbtxspecification :#1:#2\ifcsname\??setup:\s!btx:\currentbtxspecification :#1:#2\endcsname\else - \publ_fastbtxsetup_chain_inbetween + \publ_fast_btx_setup_chain_inbetween #1:#2\ifcsname\??setup:\s!btx :#1:#2\endcsname\else - \publ_fastbtxsetup_chain_inbetween + \publ_fast_btx_setup_chain_inbetween \currentbtxspecification :#1:\s!unknown\ifcsname\??setup:\s!btx:\currentbtxspecification :#1:\s!unknown\endcsname\else - \publ_fastbtxsetup_chain_inbetween + \publ_fast_btx_setup_chain_inbetween unset\fi\fi\fi + \space @\space + \currentbtx ]% \endgroup} -\unexpanded\def\publ_fastbtxsetup_chain - {\ifx\currentbtxspecificationfallback\empty - \expandafter\publ_fastbtxsetup_chain_nop +\unexpanded\def\publ_fast_btx_setup_normal#1% + {\btxsetuptype#1\relax + \ifx\currentbtxspecificationfallback\empty + \expandafter\publ_fast_setup_nop \else - \expandafter\publ_fastbtxsetup_chain_yes + \expandafter\publ_fast_setup_yes \fi} -\unexpanded\def\publ_fastbtxsetup_visual#1#2% - {\publ_fastbtxsetup_chain{#1}{#2}% - \publ_fastbtxsetup_normal{#1}{#2}} +\unexpanded\def\publ_fast_btx_setup_visual#1#2#3% + {\btxsetuptype#1\relax + \ifx\currentbtxspecificationfallback\empty + \expandafter\publ_fast_btx_setup_chain_nop + \else + \expandafter\publ_fast_btx_setup_chain_yes + \fi{#2}{#3}% + \ifx\currentbtxspecificationfallback\empty + \expandafter\publ_fast_setup_nop + \else + \expandafter\publ_fast_setup_yes + \fi{#2}{#3}} \installtextracker {publications.setups} - {\let\fastbtxsetup\publ_fastbtxsetup_visual} - {\let\fastbtxsetup\publ_fastbtxsetup_normal} + {\let\publ_fast_setup\publ_fast_btx_setup_visual} + {\let\publ_fast_setup\publ_fast_btx_setup_normal} + +\let\publ_fast_setup\publ_fast_btx_setup_normal %D Cite helpers: @@ -1403,15 +1417,13 @@ \unexpanded\def\btxcitesetup#1% {\the\everybtxciteentry - \btxsetuptype\plusone \everybtxciteentry\emptytoks % tricky maybe not when subcites - \fastbtxsetup\s!cite{#1}} % no \btxcitereset as we loose dataset and such + \publ_fast_setup\plusone\s!cite{#1}} % no \btxcitereset as we loose dataset and such \unexpanded\def\btxsubcitesetup#1% {\the\everybtxciteentry - \btxsetuptype\plustwo \everybtxciteentry\emptytoks % tricky maybe not when subcites - \fastbtxsetup\s!cite{#1}} % no \btxcitereset as we loose dataset and such + \publ_fast_setup\plustwo\s!cite{#1}} % no \btxcitereset as we loose dataset and such \appendtoks \btx_check_language @@ -1419,16 +1431,16 @@ \unexpanded\def\btxstartsubcite#1% {\begingroup - \btxcitereset % todo: limited set + \btx_reset_cite % todo: limited set \def\currentbtxcitealternative{#1}% \setbtxparameterset\s!cite\currentbtxcitealternative \usebtxstyleandcolor\c!style\c!color - % \btxparameter\c!left + \btxparameter\c!left \relax} \unexpanded\def\btxstopsubcite - {%\relax - % \btxparameter\c!right + {\relax + \btxparameter\c!right \endgroup} \unexpanded\def\btxstartciterendering[#1]% @@ -1436,12 +1448,12 @@ \edef\currentbtxcitealternative{#1}% \setbtxparameterset\s!cite\currentbtxcitealternative \usebtxstyleandcolor\c!style\c!color - % \btxparameter\c!left - }%\relax} + \btxparameter\c!left + \relax} \unexpanded\def\btxstopciterendering {\relax - % \btxparameter\c!right + \btxparameter\c!right \endgroup} \let\btxstartcite \begingroup @@ -1638,8 +1650,8 @@ \let\btxstopcolor \endgroup \let\btxstopstyleandcolor\endgroup -\unexpanded\def\btxusecommand[#1]% - {\namedbtxparameter{#1}\c!command} +\unexpanded\def\btxusecommand[#1]#2% using #2 permits space after [] + {\namedbtxparameter{#1}\c!command{#2}} %D Defaults: @@ -1651,7 +1663,7 @@ \c!continue=\v!no, \c!method=\v!global, % \c!setups=btx:\btxrenderingparameter\c!alternative:initialize, % not the same usage as cite ! - % \c!sorttype=authoryear, + \c!sorttype=\v!default, \c!criterium=\v!text, \c!refcommand=authoryears, % todo \c!numbering=\v!yes, @@ -1672,7 +1684,9 @@ \c!alternative=num, % default cite form \c!inbetween=\space, \c!range=\endash, % separator:range? - \c!compress=\v!no, + \c!compress=\v!yes, % was no? + \c!authorconversion=normal, + \c!sorttype=normal, % normal, reverse or none \c!etallimit=3, \c!etaldisplay=\btxparameter\c!etallimit, \c!otherstext={\space et al.}, diff --git a/Master/texmf-dist/tex/context/base/publ-jrn.lua b/Master/texmf-dist/tex/context/base/publ-jrn.lua index 2e040841798..0cc41862f53 100644 --- a/Master/texmf-dist/tex/context/base/publ-jrn.lua +++ b/Master/texmf-dist/tex/context/base/publ-jrn.lua @@ -19,6 +19,7 @@ if not modules then modules = { } end modules ['publ-jrn'] = { local context = context local commands = commands +local type = type local find = string.find local P, C, S, Cs, lpegmatch, lpegpatterns = lpeg.P, lpeg.C, lpeg.S, lpeg.Cs, lpeg.match, lpeg.patterns diff --git a/Master/texmf-dist/tex/context/base/publ-sor.lua b/Master/texmf-dist/tex/context/base/publ-sor.lua index c3fcdb0eed1..c442e395395 100644 --- a/Master/texmf-dist/tex/context/base/publ-sor.lua +++ b/Master/texmf-dist/tex/context/base/publ-sor.lua @@ -126,6 +126,7 @@ local function sortsequence(dataset,list,sorttype) if not sequence and type(sorttype) == "string" then local list = toarray(sorttype) if #list > 0 then + local indexdone = false sequence = { } for i=1,#list do local entry = toarray(list[i]) @@ -137,6 +138,16 @@ local function sortsequence(dataset,list,sorttype) default = default == s_default and c_default or default or c_default, unknown = unknown == s_unknown and c_unknown or unknown or c_unknown, } + if field == "index" then + indexdone = true + end + end + if not indexdone then + sequence[#sequence+1] = { + field = "index", + default = 0, + unknown = 0, + } end end if trace_sorters then @@ -155,12 +166,13 @@ local function sortsequence(dataset,list,sorttype) end for i=1,#sequence do - local step = sequence[i] - local field = step.field or "?" - local default = step.default or c_default - local unknown = step.unknown or c_unknown - local fldtype = types[field] - local writer = fldtype and writers[fldtype] + local step = sequence[i] + local field = step.field or "?" + local default = step.default or c_default + local unknown = step.unknown or c_unknown + local fldtype = types[field] + local fldwriter = step.writer or fldtype + local writer = fldwriter and writers[fldwriter] if trace_sorters then report("% 3i : field %a, type %a, default %a, unknown %a",i,field,fldtype, @@ -172,7 +184,7 @@ local function sortsequence(dataset,list,sorttype) if writer then local h = #helpers + 1 getters[i] = f_writer(h,field,default,field) - helpers[h] = f_helper(h,fldtype,field,fldtype) + helpers[h] = f_helper(h,fldwriter,field,fldtype) else getters[i] = f_getter(field,default,field) end @@ -213,54 +225,60 @@ local function sortsequence(dataset,list,sorttype) end +-- index : order in dataset +-- order : order of citations +-- short : alphabetic + suffix +-- reference : order in list +-- default : automatic sorter +-- authoryear : sort order list + +-- tag | listindex | 0 | u | u.btxint | data.index + local sorters = { - [v_short] = function(dataset,rendering,list) + [v_short] = function(dataset,rendering,list) -- should we store it local shorts = rendering.shorts local function compare(a,b) - local aa, bb = a and a[1], b and b[1] + local aa = a and a[1] + local bb = b and b[1] if aa and bb then aa, bb = shorts[aa], shorts[bb] return aa and bb and aa < bb + else + return a[1] < b[1] end - return false end sort(list,compare) end, - [v_reference] = function(dataset,rendering,list) + [v_reference] = function(dataset,rendering,list) -- tag local function compare(a,b) - local aa, bb = a and a[1], b and b[1] - if aa and bb then - return aa and bb and aa < bb - end - return false + return a[1] < b[1] end sort(list,compare) end, - [v_dataset] = function(dataset,rendering,list) + [v_dataset] = function(dataset,rendering,list) -- dataset index local function compare(a,b) --- inspect(a,b) - local aa, bb = a and a[6], b and b[6] + local aa = a and a[6] + local bb = b and b[6] if aa and bb then - -- aa, bb = list[aa].index or 0, list[bb].index or 0 - return aa and bb and aa < bb + return aa < bb + else + return a[1] < b[1] end - return false end sort(list,compare) end, - [v_default] = function(dataset,rendering,list,sorttype) -- experimental - if sorttype == "" or sorttype == v_default then + [v_default] = function(dataset,rendering,list,sorttype) + if sorttype == "" or sorttype == v_default then -- listorder local function compare(a,b) - local aa, bb = a and a[3], b and b[3] - if aa and bb then - return aa and bb and aa < bb - end - return false + return a[2] < b[2] end sort(list,compare) else - local valid = sortsequence(dataset,list,sorttype) + local valid = sortsequence(dataset,list,sorttype) -- field order if valid and #valid > 0 then + -- hm, we have a complication here because a sortsequence doesn't know if there's a field + -- so there is no real catch possible here .., anyway, we add a index as last entry when no + -- one is set so that should be good enough (needs testing) for i=1,#valid do local v = valid[i] valid[i] = list[v.index] diff --git a/Master/texmf-dist/tex/context/base/publ-tra.lua b/Master/texmf-dist/tex/context/base/publ-tra.lua index 65e9b7ff486..b90455aed02 100644 --- a/Master/texmf-dist/tex/context/base/publ-tra.lua +++ b/Master/texmf-dist/tex/context/base/publ-tra.lua @@ -107,8 +107,8 @@ function tracers.showdatasetcompleteness(settings) local preamble = { "|lTBw(5em)|lBTp(10em)|plT|" } - local function identified(tag,category,crossref) - ctx_NC() + local function identified(tag,category,crossref,index) + ctx_NC() ctx_monobold(index) ctx_NC() ctx_monobold(category) ctx_NC() if crossref then ctx_monobold("%s\\hfill\\darkblue => %s",tag,crossref) @@ -179,7 +179,7 @@ function tracers.showdatasetcompleteness(settings) foundfields[k] = true end ctx_starttabulate(preamble) - identified(tag,category,entry.crossref) + identified(tag,category,entry.crossref,entry.index) ctx_FL() if fields then local requiredfields = fields.required diff --git a/Master/texmf-dist/tex/context/base/publ-tra.mkiv b/Master/texmf-dist/tex/context/base/publ-tra.mkiv index 41550519851..2f86a5624fc 100644 --- a/Master/texmf-dist/tex/context/base/publ-tra.mkiv +++ b/Master/texmf-dist/tex/context/base/publ-tra.mkiv @@ -38,13 +38,11 @@ \else \getdummyparameters[#2]% \fi - % \publ_specification_push{"\dummyparameter\c!specification}% \ctxcommand{#1{ dataset = "\dummyparameter\c!dataset", specification = "\dummyparameter\c!specification", field = "\dummyparameter\c!field", }}% - % \publ_specification_pop \endgroup} \def\publ_show_dataset_fields {\publ_show_dataset_whatever{showbtxdatasetfields}} @@ -60,12 +58,10 @@ {\doifelsenothing{#1}% {\letdummyparameter\c!specification\currentbtxspecification}% {\setdummyparameter\c!specification{#1}}}% - % \publ_specification_push{"\dummyparameter\c!specification}% \ctxcommand{showbtxfields{ rotation = "\dummyparameter\c!rotation", specification = "\dummyparameter\c!specification" }}% - % \publ_specification_pop \endgroup} \def\publ_show_tables[#1]% diff --git a/Master/texmf-dist/tex/context/base/publ-usr.lua b/Master/texmf-dist/tex/context/base/publ-usr.lua index f0111227916..901f116296c 100644 --- a/Master/texmf-dist/tex/context/base/publ-usr.lua +++ b/Master/texmf-dist/tex/context/base/publ-usr.lua @@ -89,10 +89,12 @@ local function addtexentry(dataset,settings,content) category = settings.category or settings.t or "article", } lpegmatch(pattern,content,1,data) -- can set tag too - local tag = data.tag - current.userdata[tag] = data - current.luadata[tag] = data - current.details[tag] = nil + local tag = data.tag + local index = publications.getindex(dataset,current.luadata,tag) + current.ordered[index] = data + current.luadata[tag] = data + current.userdata[tag] = data + current.details[tag] = nil return data end diff --git a/Master/texmf-dist/tex/context/base/s-fnt-24.mkiv b/Master/texmf-dist/tex/context/base/s-fnt-24.mkiv index 2c0022e5c46..2e6b9a59187 100644 --- a/Master/texmf-dist/tex/context/base/s-fnt-24.mkiv +++ b/Master/texmf-dist/tex/context/base/s-fnt-24.mkiv @@ -56,7 +56,7 @@ function fonts.analyzers.cjktest(first,second) end \stopluacode -\def\ShowCombinationsKorean +\unexpanded\def\ShowCombinationsKorean {\dodoubleempty\doShowCombinationsKorean} \def\doShowCombinationsKorean[#1][#2]% @@ -68,7 +68,7 @@ end \disabletrackers[cjk.analyzing] \stoppacked} -\def\ShowCombinationsChinese +\unexpanded\def\ShowCombinationsChinese {\dodoubleempty\doShowCombinationsChinese} \def\doShowCombinationsChinese[#1][#2]% diff --git a/Master/texmf-dist/tex/context/base/sort-ini.lua b/Master/texmf-dist/tex/context/base/sort-ini.lua index 99597761311..9c4d5acee78 100644 --- a/Master/texmf-dist/tex/context/base/sort-ini.lua +++ b/Master/texmf-dist/tex/context/base/sort-ini.lua @@ -702,7 +702,14 @@ local function packch(entry) local tt, li = { }, split[i].ch for j=1,#li do local lij = li[j] - tt[j] = utfbyte(lij) > ignoredoffset and "[]" or lij + local byt = utfbyte(lij) + if byt > ignoredoffset then + tt[j] = "[]" + elseif byt == 0 then + tt[j] = " " + else + tt[j] = lij + end end t[i] = concat(tt) end @@ -711,7 +718,14 @@ local function packch(entry) local t, li = { }, split.ch for j=1,#li do local lij = li[j] - t[j] = utfbyte(lij) > ignoredoffset and "[]" or lij + local byt = utfbyte(lij) + if byt > ignoredoffset then + t[j] = "[]" + elseif byt == 0 then + t[j] = " " + else + t[j] = lij + end end return concat(t) end @@ -731,7 +745,7 @@ local function packuc(entry) end function sorters.sort(entries,cmp) - if trace_tests or trace_methods then + if trace_methods then local nofentries = #entries report_sorters("entries: %s, language: %s, method: %s, digits: %s",nofentries,language,method,tostring(digits)) for i=1,nofentries do diff --git a/Master/texmf-dist/tex/context/base/spac-ali.mkiv b/Master/texmf-dist/tex/context/base/spac-ali.mkiv index fbcce89c46d..6686bce53a4 100644 --- a/Master/texmf-dist/tex/context/base/spac-ali.mkiv +++ b/Master/texmf-dist/tex/context/base/spac-ali.mkiv @@ -1066,12 +1066,26 @@ \letvalue{\??alignsimplereverse\v!middle }\spac_align_simple_middle \unexpanded\def\simplealignedbox#1#2% - {\hbox to #1\csname\??alignsimple\ifcsname\??alignsimple#2\endcsname#2\else\v!right\fi\endcsname} + {\hbox \ifdim#1>\zeropoint to #1 + \csname\??alignsimple\ifcsname\??alignsimple#2\endcsname#2\else\v!right\fi\expandafter\endcsname + \fi} + +\unexpanded\def\simplealignedboxplus#1#2#3% + {\hbox #3 \ifdim#1>\zeropoint to #1 + \csname\??alignsimple\ifcsname\??alignsimple#2\endcsname#2\else\v!right\fi\expandafter\endcsname + \fi} \newconditional\alignsimplelefttoright \settrue\alignsimplelefttoright \unexpanded\def\simplereversealignedbox#1#2% - {\hbox to #1\csname\??alignsimplereverse\ifcsname\??alignsimplereverse#2\endcsname#2\else\v!left\fi\endcsname} + {\hbox \ifdim#1>\zeropoint to #1 + \csname\??alignsimplereverse\ifcsname\??alignsimplereverse#2\endcsname#2\else\v!left\fi\expandafter\endcsname + \fi} + +\unexpanded\def\simplereversealignedboxplus#1#2#3% + {\hbox #3 \ifdim#1>\zeropoint to #1 + \csname\??alignsimplereverse\ifcsname\??alignsimplereverse#2\endcsname#2\else\v!left\fi\expandafter\endcsname + \fi} % \installnamespace{alignsets} % diff --git a/Master/texmf-dist/tex/context/base/spac-def.mkiv b/Master/texmf-dist/tex/context/base/spac-def.mkiv index 312483cfabf..7ead3c63e21 100644 --- a/Master/texmf-dist/tex/context/base/spac-def.mkiv +++ b/Master/texmf-dist/tex/context/base/spac-def.mkiv @@ -60,7 +60,7 @@ \c!depth=.28, \c!top=1.0, \c!bottom=0.4, - \c!distance=\onepoint, + \c!distance=\onepoint, % \dimexpr\openlineheight/10\relax \c!line=2.8\exheight, \c!stretch=\zerocount, \c!shrink=\zerocount] diff --git a/Master/texmf-dist/tex/context/base/spac-prf.mkiv b/Master/texmf-dist/tex/context/base/spac-prf.mkiv new file mode 100644 index 00000000000..5f1553ede11 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/spac-prf.mkiv @@ -0,0 +1,31 @@ +%D \module +%D [ file=spac-prf, +%D version=2015.11.16, % moved from test module mathplus +%D title=\CONTEXT\ Spacing Macros, +%D subtitle=Profiling, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Spacing Macros / Profiling} + +%D This is a placeholder for something to come. But as I don't want to +%D be harrassed by 'why does it work different than a week before' this +%D cool new feature will only end up here when stable enough. Alas. + +\unprotect + +\definesystemattribute[profilemethod][public] + +\unexpanded\def\setprofile [#1]{} +\unexpanded\def\resetprofile {} +\unexpanded\def\useprofileparameter#1{} +\unexpanded\def\addprofiletobox #1{} +\unexpanded\def\profilegivenbox #1#2{} +\unexpanded\def\profiledbox {\vbox} + +\protect \endinput diff --git a/Master/texmf-dist/tex/context/base/spac-ver.lua b/Master/texmf-dist/tex/context/base/spac-ver.lua index fc6fba0eb43..d1cf09e17a9 100644 --- a/Master/texmf-dist/tex/context/base/spac-ver.lua +++ b/Master/texmf-dist/tex/context/base/spac-ver.lua @@ -61,7 +61,6 @@ local trace_page_builder = false trackers.register("builders.page", fun local trace_collect_vspacing = false trackers.register("vspacing.collect", function(v) trace_collect_vspacing = v end) local trace_vspacing = false trackers.register("vspacing.spacing", function(v) trace_vspacing = v end) local trace_vsnapping = false trackers.register("vspacing.snapping", function(v) trace_vsnapping = v end) -local trace_vpacking = false trackers.register("vspacing.packing", function(v) trace_vpacking = v end) local trace_specials = false trackers.register("vspacing.specials", function(v) trace_specials = v end) local report_vspacing = logs.reporter("vspacing","spacing") @@ -999,7 +998,11 @@ specialmethods[1] = function(pagehead,pagetail,start,penalty) end -- none found, so no reson to be special if trace_specials then - report_specials(" context penalty, discarding") + if pagetail then + report_specials(" context penalty, discarding, nothing special") + else + report_specials(" context penalty, discarding, nothing preceding") + end end return special_penalty_xxx end @@ -1124,19 +1127,17 @@ local function collapser(head,where,what,trace,snap,a_snapmethod) -- maybe also -- -- todo: keep_together: between headers -- + local pagehead = nil + local pagetail = nil + local function getpagelist() if not pagehead then pagehead = texlists.page_head if pagehead then pagehead = tonut(texlists.page_head) pagetail = find_node_tail(pagehead) -- no texlists.page_tail yet-- no texlists.page_tail yet - else - pagetail = nil end - else - pagetail = nil end - return pagehead, pagetail end -- local function flush(why) @@ -1290,7 +1291,7 @@ local function collapser(head,where,what,trace,snap,a_snapmethod) -- maybe also local sp = getattr(current,a_skippenalty) -- has no default, no unset (yet) if sp and sc == penalty then if where == "page" then - local pagehead, pagetail = getpagelist() + getpagelist() local p = specialmethods[specialmethod](pagehead,pagetail,current,sp) if p then if trace then @@ -1706,7 +1707,7 @@ local ignore = table.tohash { function vspacing.vboxhandler(head,where) if head and not ignore[where] then local h = tonut(head) - if getnext(h) then + if getnext(h) then -- what if a one liner and snapping? h = collapser(h,"vbox",where,trace_vbox_vspacing,true,a_snapvbox) -- todo: local snapper return tonode(h) end @@ -1714,13 +1715,17 @@ function vspacing.vboxhandler(head,where) return head end -function vspacing.collapsevbox(n) -- for boxes but using global a_snapmethod +function vspacing.collapsevbox(n,aslist) -- for boxes but using global a_snapmethod local box = getbox(n) if box then local list = getlist(box) if list then list = collapser(list,"snapper","vbox",trace_vbox_vspacing,true,a_snapmethod) - setfield(box,"list",vpack_node(list)) + if aslist then + setfield(box,"list",list) -- beware, dimensions of box are wrong now + else + setfield(box,"list",vpack_node(list)) + end end end end @@ -1773,6 +1778,13 @@ implement { } implement { + name = "vspacingcollapseonly", + actions = vspacing.collapsevbox, + scope = "private", + arguments = { "integer", true } +} + +implement { name = "vspacingsnap", actions = vspacing.snapbox, scope = "private", diff --git a/Master/texmf-dist/tex/context/base/spac-ver.mkiv b/Master/texmf-dist/tex/context/base/spac-ver.mkiv index e44056954ad..86a731d3c78 100644 --- a/Master/texmf-dist/tex/context/base/spac-ver.mkiv +++ b/Master/texmf-dist/tex/context/base/spac-ver.mkiv @@ -881,11 +881,11 @@ \strutheightfactor\dimexpr\normallineheight \fi \strutdp\spacingfactor\dimexpr - \ifdim\minimumstrutdepth>\zeropoint - \minimumstrutdepth - \else - \strutdepthfactor\dimexpr\normallineheight - \fi + \ifdim\minimumstrutdepth>\zeropoint + \minimumstrutdepth + \else + \strutdepthfactor\dimexpr\normallineheight + \fi \dosetstrut} \unexpanded\def\setcharstrut#1% @@ -924,7 +924,9 @@ \ifabsnum\dimexpr\strutht+\strutdp-\lineheight\relax<\plustwo % compensate rounding error /- 1sp to avoid too many % 1sp baselineskips in for instance verbatim - \strutht\dimexpr\lineheight-\strutdp\relax + % \strutht\dimexpr\lineheight-\strutdp\relax + % better: + \strutdp\dimexpr\lineheight-\strutht\relax \struttotal\lineheight \else \struttotal\dimexpr\strutht+\strutdp\relax @@ -944,15 +946,47 @@ \s!height\strutht \s!depth \strutdp}} +\newconstant\c_strut_visual_mode + \def\spac_struts_set_vide {\setbox\strutbox\hbox % at some time this extra wrapping was needed {\spac_struts_vide_hbox to \zeropoint - {% \hss % new, will be option - \vrule - \s!width \strutwidth - \s!height\strutht - \s!depth \strutdp - \hss}}} + {\ifcase\c_strut_visual_mode + \spac_struts_black + \or + \spac_struts_color + \else + \spac_struts_black + \fi}}} + +\def\spac_struts_black + {\vrule + \s!width \strutwidth + \s!height\strutht + \s!depth \strutdp + \hss} + +\def\spac_struts_color + {\hss % new, will be option + \scratchwidth.1\struthtdp + \begingroup + \directcolor[f:b:t]% + \vrule + \s!width \scratchwidth + \s!height\strutht + \s!depth \strutdp + \kern-\scratchwidth + \vrule + \s!width \scratchwidth + \s!height\zeropoint + \s!depth \strutdp + \endgroup + \kern-.625\scratchwidth + \vrule + \s!width .25\scratchwidth + \s!height\strutht + \s!depth \strutdp + \hss} \let\spac_struts_vide_hbox\hbox % overloaded in trac-vis.mkiv @@ -1046,7 +1080,13 @@ \fi} \unexpanded\def\showstruts % adapts .. is wrong - {\setteststrut + {\c_strut_visual_mode\zerocount + \setteststrut + \settestcrlf} + +\unexpanded\def\showcolorstruts % adapts .. is wrong + {\c_strut_visual_mode\plusone + \setteststrut \settestcrlf} \unexpanded\def\setteststrut @@ -1395,6 +1435,16 @@ \fi \setevalue{\??gridsnappers#1}{\attribute\snapmethodattribute\csname\??gridsnapperattributes\currentsnapper\endcsname\space}} +\unexpanded\def\usegridparameter#1% no checking here + {\edef\m_spac_grid_asked{#1\c!grid}% + \ifx\m_spac_grid_asked\empty + \attribute \snapvboxattribute\attributeunsetvalue + \else + \spac_grids_snap_value_set\m_spac_grid_asked + \attribute \snapvboxattribute\attribute\snapmethodattribute + \fi} + + \unexpanded\def\definegridsnapping {\dodoubleargument\spac_grids_define} @@ -1471,13 +1521,13 @@ \unexpanded\def\synchronizelocallinespecs {\bodyfontlineheight \normallineheight - \bodyfontstrutheight\strutheight - \bodyfontstrutdepth \strutdepth} + \bodyfontstrutheight\strutht + \bodyfontstrutdepth \strutdp} \unexpanded\def\synchronizegloballinespecs {\global\globalbodyfontlineheight \normallineheight - \global\globalbodyfontstrutheight\strutheight - \global\globalbodyfontstrutdepth \strutdepth} + \global\globalbodyfontstrutheight\strutht + \global\globalbodyfontstrutdepth \strutdp} \appendtoks \synchronizegloballinespecs @@ -1898,7 +1948,7 @@ % category:4 is default -% this interface might change (into an \install, buw we will then keep this one hidden) +% this interface might change (into an \install, but we will then keep this one hidden) \definevspacingamount[\v!none] [\zeropoint] [\zeropoint] \definevspacingamount[\v!big] [\bigskipamount] [\bodyfontlineheight] @@ -1909,8 +1959,8 @@ \definevspacingamount[\v!quarterline] [.25\openlineheight] [.25\bodyfontlineheight] \definevspacingamount[\v!formula] [\medskipamount] [.5\bodyfontlineheight] \definevspacingamount[\v!white] [\parskip] [\bodyfontwhitespace] -\definevspacingamount[\v!height] [\strutheight] [\bodyfontstrutheight] -\definevspacingamount[\v!depth] [\strutdepth] [\bodyfontstrutdepth] +\definevspacingamount[\v!height] [\strutht] [\bodyfontstrutheight] +\definevspacingamount[\v!depth] [\strutdp] [\bodyfontstrutdepth] \definevspacingamount[-\v!line] [-\openlineheight] [-\bodyfontlineheight] \definevspacingamount[-\v!halfline] [-.5\openlineheight] [-.5\bodyfontlineheight] diff --git a/Master/texmf-dist/tex/context/base/status-files.pdf b/Master/texmf-dist/tex/context/base/status-files.pdf Binary files differindex dc228ad8ae4..b5850036794 100644 --- a/Master/texmf-dist/tex/context/base/status-files.pdf +++ b/Master/texmf-dist/tex/context/base/status-files.pdf diff --git a/Master/texmf-dist/tex/context/base/status-lua.pdf b/Master/texmf-dist/tex/context/base/status-lua.pdf Binary files differindex 02c9447e819..2046da47ab4 100644 --- a/Master/texmf-dist/tex/context/base/status-lua.pdf +++ b/Master/texmf-dist/tex/context/base/status-lua.pdf diff --git a/Master/texmf-dist/tex/context/base/strc-bkm.lua b/Master/texmf-dist/tex/context/base/strc-bkm.lua index 1ff75aa5f72..96b68b23697 100644 --- a/Master/texmf-dist/tex/context/base/strc-bkm.lua +++ b/Master/texmf-dist/tex/context/base/strc-bkm.lua @@ -144,8 +144,10 @@ function bookmarks.place() else titledata = { title = first } end - else + elseif second then titledata = { title = second } + else + -- ignoring (command and so) end end end diff --git a/Master/texmf-dist/tex/context/base/strc-flt.mkvi b/Master/texmf-dist/tex/context/base/strc-flt.mkvi index 9a7fc56f6da..76b587f09f2 100644 --- a/Master/texmf-dist/tex/context/base/strc-flt.mkvi +++ b/Master/texmf-dist/tex/context/base/strc-flt.mkvi @@ -11,6 +11,8 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +%D This module will be redone with conditionals and everythings + \writestatus{loading}{ConTeXt Structure Macros / Float Numbering} \registerctxluafile{strc-flt}{1.001} @@ -478,6 +480,10 @@ \ifx\currentfloat\empty \let\currentfloat\v!figure % a bit of a hack \fi + \doifelsecommandhandler\??float\currentfloat + \donothing + {\writestatus\m!floatblocks{unknown float type '\currentfloat'}% + \let\currentfloat\v!figure}% also a hack \global\let\lastplacedfloat\currentfloat \let\m_strc_floats_saved_userdata\empty \let\currentfloatcaption\currentfloat} @@ -1774,7 +1780,7 @@ {\dp\b_strc_floats_caption\strutdepth \setbox\scratchbox\vbox {\strc_floats_align_caption{\copy\b_strc_floats_caption}% - \strc_floats_align_content {\copy\b_strc_floats_content }}% + \strc_floats_align_content{\copy\b_strc_floats_content}}% \getnoflines{\dimexpr\htdp\scratchbox-10\scaledpoint\relax}% get rid of inaccuracy \vbox to \noflines\lineheight {\d_strc_float_temp_width\wd\b_strc_floats_content @@ -2304,6 +2310,7 @@ \installfloatmethod \s!singlecolumn \v!local \somelocalfloat \installfloatmethod \s!multicolumn \v!local \somelocalfloat +\installfloatmethod \s!mixedcolumn \v!local \somelocalfloat \installfloatmethod \s!columnset \v!local \somelocalfloat \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/strc-lst.mkvi b/Master/texmf-dist/tex/context/base/strc-lst.mkvi index 556d2ab4895..803e6b813fb 100644 --- a/Master/texmf-dist/tex/context/base/strc-lst.mkvi +++ b/Master/texmf-dist/tex/context/base/strc-lst.mkvi @@ -953,11 +953,19 @@ \scratchhsize\hsize \ifconditional\c_lists_has_number \ifconditional\c_lists_show_number - \setbox\b_strc_lists_number\hbox \strc_lists_get_reference_attribute\v!number \ifdim\scratchwidth>\zeropoint to \scratchwidth \fi { - \strc_lists_set_style_color\c!numberstyle\c!numbercolor\v!number - \listparameter\c!numbercommand\currentlistsymbol - \hfill - } + \setbox\b_strc_lists_number +% \hbox +% \strc_lists_get_reference_attribute\v!number +% \ifdim\scratchwidth>\zeropoint to \scratchwidth \fi + \simplealignedboxplus + \scratchwidth + {\listparameter\c!numberalign} + {\strc_lists_get_reference_attribute\v!number} + { + \strc_lists_set_style_color\c!numberstyle\c!numbercolor\v!number + \listparameter\c!numbercommand\currentlistsymbol +% \hfill + } \else \setbox\b_strc_lists_number\emptyhbox \fi @@ -1268,11 +1276,7 @@ \ifconditional\c_lists_has_number \ifconditional\c_lists_show_number \setbox\scratchbox - \ifzeropt\scratchwidth - \hbox - \else - \simplealignedbox\scratchwidth{\listparameter\c!numberalign} - \fi + \simplealignedbox\scratchwidth{\listparameter\c!numberalign} \bgroup \useliststyleandcolor\c!numberstyle\c!numbercolor \currentlistsymbol diff --git a/Master/texmf-dist/tex/context/base/strc-ref.lua b/Master/texmf-dist/tex/context/base/strc-ref.lua index b6f2e9a3778..2a1d0dd59e0 100644 --- a/Master/texmf-dist/tex/context/base/strc-ref.lua +++ b/Master/texmf-dist/tex/context/base/strc-ref.lua @@ -378,13 +378,13 @@ implement { function references.set(data) local references = data.references - local prefix = references.prefix or "" local reference = references.reference if not reference or reference == "" then - report_references("invalid reference") + -- report_references("invalid reference") -- harmless return 0 end - local pd = tobesaved[prefix] -- nicer is a metatable + local prefix = references.prefix or "" + local pd = tobesaved[prefix] -- nicer is a metatable if not pd then pd = { } tobesaved[prefix] = pd diff --git a/Master/texmf-dist/tex/context/base/strc-sec.mkiv b/Master/texmf-dist/tex/context/base/strc-sec.mkiv index f2a183601cb..b5a1a5ba011 100644 --- a/Master/texmf-dist/tex/context/base/strc-sec.mkiv +++ b/Master/texmf-dist/tex/context/base/strc-sec.mkiv @@ -301,13 +301,13 @@ \newconditional\c_strc_rendering_continuous % not used (mkii ?) -\def\setstructurelevel #1#2{\clf_setstructurelevel {#1}{#2}} % name, level|parent -\def\getstructurelevel #1{\clf_getstructurelevel {#1}} % name -\def\setstructurenumber #1#2{\clf_setstructurenumber #1{#2}} % level, number (+/-) -\def\getstructurenumber #1{\clf_getstructurenumber #1 } % level -\def\getsomestructurenumber #1#2{\clf_getsomestructurenumber #1{#2}} % level, what -\def\getfullstructurenumber #1{\clf_getfullstructurenumber #1 } % level -\def\getsomefullstructurenumber#1#2{\clf_getsomefullstructurenumber #1{#2}} % level, what +\def\setstructurelevel #1#2{\clf_setstructurelevel {#1}{#2}} % name, level|parent +\def\getstructurelevel #1{\clf_getstructurelevel {#1}} % name +\def\setstructurenumber #1#2{\clf_setstructurenumber #1{#2}} % level, number (+/-) +\def\getstructurenumber #1{\clf_getstructurenumber \numexpr#1\relax} % level +\def\getsomestructurenumber #1#2{\clf_getsomestructurenumber #1{#2}} % level, what +\def\getfullstructurenumber #1{\clf_getfullstructurenumber \numexpr#1\relax} % level +\def\getsomefullstructurenumber#1#2{\clf_getsomefullstructurenumber #1{#2}} % level, what \def\getspecificstructuretitle #1{\clf_getspecificstructuretitle {#1}{\headparameter\s!catcodes}} % structure heads (like \startchapter) diff --git a/Master/texmf-dist/tex/context/base/strc-syn.mkiv b/Master/texmf-dist/tex/context/base/strc-syn.mkiv index 0c132a602f0..b206f8069ba 100644 --- a/Master/texmf-dist/tex/context/base/strc-syn.mkiv +++ b/Master/texmf-dist/tex/context/base/strc-syn.mkiv @@ -332,7 +332,8 @@ \unexpanded\def\strc_synonyms_insert_meaning#1#2% name tag {\begingroup \def\currentsimplelist{#1}% - \fastsetup{\??simplelistrenderings:\v!text}% + \def\currentsynonymtag{#2}% + \fastsetup{\??simplelistrenderings::\v!text}% \endgroup} \unexpanded\def\strc_synonyms_insert#1#2% name tag diff --git a/Master/texmf-dist/tex/context/base/supp-ran.lua b/Master/texmf-dist/tex/context/base/supp-ran.lua index 1d34393fa64..4968e8cfc1d 100644 --- a/Master/texmf-dist/tex/context/base/supp-ran.lua +++ b/Master/texmf-dist/tex/context/base/supp-ran.lua @@ -10,6 +10,11 @@ if not modules then modules = { } end modules ['supp-ran'] = { local report_system = logs.reporter("system","randomizer") +local trace_random = false trackers.register("system.randomizer", function(v) trace_random = v end) +local trace_random_mp = false trackers.register("system.randomizer.mp",function(v) trace_random_mp = v end) + +local insert, remove = table.insert, table.remove + local math = math local context = context local implement = interfaces.implement @@ -17,20 +22,19 @@ local implement = interfaces.implement local random = math.random local randomseed = math.randomseed local round = math.round -local seed = false +local stack = { } local last = 1 local maxcount = 2^30-1 -- 1073741823 -local function setrandomseedi(n,comment) - if not n then - -- n = 0.5 -- hack - end +local function setrandomseedi(n) if n <= 1 then n = n * maxcount + elseif n < 1000 then + n = n * 1000 end n = round(n) - if false then - report_system("setting seed to %s (%s)",n,comment or "normal") + if trace_random then + report_system("setting seed to %s",n) end randomseed(n) last = random(0,maxcount) -- we need an initial value @@ -52,30 +56,52 @@ local function getrandomseed() return last end +local function getmprandomnumber() + last = random(0,4095) + if trace_random_mp then + report_system("using mp seed %s",last) + end + return last +end + -- maybe stack -local function freezerandomseed(n) - if seed == false or seed == nil then - seed = last - setrandomseedi(seed,"freeze",seed) +local function pushrandomseed() + insert(stack,last) + if trace_random then + report_system("pushing seed %s",last) end - if n then - randomseed(n) +end + +local function reuserandomseed(n) + local seed = stack[#stack] + if seed then + if trace_random then + report_system("reusing seed %s",last) + end + randomseed(seed) end end -local function defrostrandomseed() - if seed ~= false then - setrandomseedi(seed,"defrost",seed) -- was last (bug) - seed = false +local function poprandomseed() + local seed = remove(stack) + if seed then + if trace_random then + report_system("popping seed %s",seed) + end + randomseed(seed) end end +-- todo: also open up in utilities.randomizer.* + implement { name = "getrandomnumber", actions = { getrandomnumber, context }, arguments = { "integer", "integer" } } implement { name = "getrandomdimen", actions = { getrandomnumber, context }, arguments = { "dimen", "dimen" } } implement { name = "getrandomfloat", actions = { getrandomnumber, context }, arguments = { "number", "number" } } +implement { name = "getmprandomnumber", actions = { getmprandomnumber, context } } implement { name = "setrandomseed", actions = { setrandomseed }, arguments = { "integer" } } implement { name = "getrandomseed", actions = { getrandomseed, context } } -implement { name = "freezerandomseed", actions = { freezerandomseed } } -implement { name = "defrostrandomseed", actions = { defrostrandomseed } } +implement { name = "pushrandomseed", actions = { pushrandomseed } } +implement { name = "poprandomseed", actions = { poprandomseed } } +implement { name = "reuserandomseed", actions = { reuserandomseed } } diff --git a/Master/texmf-dist/tex/context/base/supp-ran.mkiv b/Master/texmf-dist/tex/context/base/supp-ran.mkiv index e491737170c..f7cfd6e7334 100644 --- a/Master/texmf-dist/tex/context/base/supp-ran.mkiv +++ b/Master/texmf-dist/tex/context/base/supp-ran.mkiv @@ -26,7 +26,14 @@ \unexpanded\def\getrandomfloat #1#2#3{\edef#1{\clf_getrandomfloat#2 #3}} \unexpanded\def\setrandomseed #1{\clf_setrandomseed#1\relax} \unexpanded\def\getrandomseed #1{\edef#1{\clf_getrandomseed}} -\unexpanded\def\freezerandomseed {\clf_freezerandomseed} -\unexpanded\def\defrostrandomseed {\clf_defrostrandomseed} +\unexpanded\def\pushrandomseed {\clf_pushrandomseed} +\unexpanded\def\poprandomseed {\clf_poprandomseed} +\unexpanded\def\reuserandomseed {\clf_reuserandomseed} % within push/pop + +\let\freezerandomseed \pushrandomseed +\let\defrostrandomseed\poprandomseed + +\def\randomnumber #1#2{\clf_getrandomnumber\numexpr#1\relax\numexpr#2\relax} +\let\mprandomnumber \clf_getmprandomnumber \protect \endinput diff --git a/Master/texmf-dist/tex/context/base/syst-aux.lua b/Master/texmf-dist/tex/context/base/syst-aux.lua index a880bace3b0..fff9bbb4c16 100644 --- a/Master/texmf-dist/tex/context/base/syst-aux.lua +++ b/Master/texmf-dist/tex/context/base/syst-aux.lua @@ -184,13 +184,13 @@ implement { name = "upper", arguments = "string", actions = { utf.upper, cont implement { name = "lower", arguments = "string", actions = { utf.lower, context } } implement { name = "strip", arguments = "string", actions = { string.strip, context } } -- or utf.strip --- implement { --- name = "converteddimen", --- arguments = { "dimen", "string" }, --- actions = function(dimen,unit) --- context(todimen(dimen,unit or "pt","%0.5f")) -- no unit appended (%F) --- end --- } +implement { + name = "converteddimen", + arguments = { "dimen", "string" }, + actions = function(dimen,unit) + context(number.todimen(dimen,unit or "pt","%0.5f")) -- no unit appended (%F) + end +} -- where, not really the best spot for this: diff --git a/Master/texmf-dist/tex/context/base/syst-aux.mkiv b/Master/texmf-dist/tex/context/base/syst-aux.mkiv index 308ed5a3ba4..bd9b1630e70 100644 --- a/Master/texmf-dist/tex/context/base/syst-aux.mkiv +++ b/Master/texmf-dist/tex/context/base/syst-aux.mkiv @@ -7123,9 +7123,9 @@ \def\getsubstring#1#2#3{\clf_getsubstring{#3}{#1}{#2}} -%D Other dimensions than pt: +%D Other dimensions than pt (used in mb-mp) -% \def\converteddimen#1#2{\clf_converteddimen\dimexpr#1\relax{#2}} +\def\converteddimen#1#2{\clf_converteddimen\dimexpr#1\relax{#2}} %D Maybe (looks ugly): %D diff --git a/Master/texmf-dist/tex/context/base/tabl-xtb.lua b/Master/texmf-dist/tex/context/base/tabl-xtb.lua index bddd627adce..4bf8e3107ec 100644 --- a/Master/texmf-dist/tex/context/base/tabl-xtb.lua +++ b/Master/texmf-dist/tex/context/base/tabl-xtb.lua @@ -707,8 +707,9 @@ function xtables.reflow_height() local delta = htdp - total if delta > 0 then delta = delta / ny - for y=1,ny do - heights[y] = heights[y] + delta + for y=0,ny-1 do + local nxt = r + y + heights[nxt] = heights[nxt] + delta end end end diff --git a/Master/texmf-dist/tex/context/base/task-ini.lua b/Master/texmf-dist/tex/context/base/task-ini.lua index ed9989a81cc..062f0208f18 100644 --- a/Master/texmf-dist/tex/context/base/task-ini.lua +++ b/Master/texmf-dist/tex/context/base/task-ini.lua @@ -115,10 +115,13 @@ appendaction("finalizers", "lists", "builders.paragraphs.tag") -- still experimental -appendaction("mvlbuilders", "normalizers", "nodes.handlers.migrate") -- +appendaction("mvlbuilders", "normalizers", "nodes.handlers.migrate") + appendaction("mvlbuilders", "normalizers", "builders.vspacing.pagehandler") -- last ! +appendaction("mvlbuilders", "normalizers", "builders.profiling.pagehandler") -- here ! -appendaction("vboxbuilders", "normalizers", "builders.vspacing.vboxhandler") -- +appendaction("vboxbuilders", "normalizers", "builders.vspacing.vboxhandler") +appendaction("vboxbuilders", "normalizers", "builders.profiling.vboxhandler") -- here ! -- experimental too @@ -192,7 +195,10 @@ disableaction("math", "noads.handlers.classes") disableaction("math", "typesetters.directions.processmath") disableaction("mvlbuilders", "typesetters.checkers.handler") +disableaction("mvlbuilders", "builders.profiling.pagehandler") + disableaction("vboxbuilders","typesetters.checkers.handler") +disableaction("vboxbuilders","builders.profiling.vboxhandler") freezecallbacks("find_.*_file", "find file using resolver") freezecallbacks("read_.*_file", "read file at once") diff --git a/Master/texmf-dist/tex/context/base/trac-vis.lua b/Master/texmf-dist/tex/context/base/trac-vis.lua index 86af6da0bdc..a20e42d1a1e 100644 --- a/Master/texmf-dist/tex/context/base/trac-vis.lua +++ b/Master/texmf-dist/tex/context/base/trac-vis.lua @@ -288,10 +288,13 @@ for mode, value in next, modes do trackers.register(formatters["visualizers.%s"](mode), function(v) set(mode,v) end) end -trackers.register("visualizers.reset", function(v) set("reset", v) end) -trackers.register("visualizers.all", function(v) set("all", v) end) -trackers.register("visualizers.makeup",function(v) set("makeup",v) end) -trackers.register("visualizers.boxes", function(v) set("boxes", v) end) +local fraction = 10 + +trackers .register("visualizers.reset", function(v) set("reset", v) end) +trackers .register("visualizers.all", function(v) set("all", v) end) +trackers .register("visualizers.makeup", function(v) set("makeup",v) end) +trackers .register("visualizers.boxes", function(v) set("boxes", v) end) +directives.register("visualizers.fraction", function(v) fraction = tonumber(v) or fraction end) local c_positive = "trace:b" local c_negative = "trace:r" @@ -301,6 +304,7 @@ local c_space = "trace:y" local c_skip_a = "trace:c" local c_skip_b = "trace:m" local c_glyph = "trace:o" +local c_ligature = "trace:s" local c_white = "trace:w" local c_math = "trace:r" @@ -312,6 +316,7 @@ local c_space_d = "trace:dy" local c_skip_a_d = "trace:dc" local c_skip_b_d = "trace:dm" local c_glyph_d = "trace:do" +local c_ligature_d = "trace:ds" local c_white_d = "trace:dw" local c_math_d = "trace:dr" @@ -351,7 +356,7 @@ local function fontkern(head,current) -- print("hit fontkern") else local text = fast_hpack_string(formatters[" %0.3f"](kern*pt_factor),usedfont) - local rule = new_rule(emwidth/10,6*exheight,2*exheight) + local rule = new_rule(emwidth/fraction,6*exheight,2*exheight) local list = getlist(text) if kern > 0 then setlistcolor(list,c_positive_d) @@ -470,7 +475,7 @@ local function ruledbox(head,current,vertical,layer,what,simple,previous) local prev = previous -- getprev(current) ... prev can be wrong in math mode < 0.78.3 setfield(current,"next",nil) setfield(current,"prev",nil) - local linewidth = emwidth/10 + local linewidth = emwidth/fraction local baseline, baseskip if dp ~= 0 and ht ~= 0 then if wd > 20*linewidth then @@ -574,7 +579,7 @@ local function ruledglyph(head,current,previous) local prev = previous setfield(current,"next",nil) setfield(current,"prev",nil) - local linewidth = emwidth/20 + local linewidth = emwidth/(2*fraction) local baseline -- if dp ~= 0 and ht ~= 0 then if (dp >= 0 and ht >= 0) or (dp <= 0 and ht <= 0) then @@ -591,8 +596,14 @@ local function ruledglyph(head,current,previous) new_kern(-wd+doublelinewidth), baseline ) +local char = chardata[getfield(current,"font")][getfield(current,"char")] +if char and char.tounicode and #char.tounicode > 4 then -- hack test + setlistcolor(info,c_ligature) + setlisttransparency(info,c_ligature_d) +else setlistcolor(info,c_glyph) setlisttransparency(info,c_glyph_d) +end info = fast_hpack(info) setfield(info,"width",0) setfield(info,"height",0) diff --git a/Master/texmf-dist/tex/context/base/trac-vis.mkiv b/Master/texmf-dist/tex/context/base/trac-vis.mkiv index a227e83544e..6ee8a6b8d07 100644 --- a/Master/texmf-dist/tex/context/base/trac-vis.mkiv +++ b/Master/texmf-dist/tex/context/base/trac-vis.mkiv @@ -120,15 +120,18 @@ \clf_setvisualfont\fontid\font \endgroup} +\unexpanded\def\resetvisualizers + {\attribute\visualattribute\attributeunsetvalue} + %D New (these might also be a visualizers): -\definecolor[f:r:t][a=1,t=.25,r=1] -\definecolor[f:g:t][a=1,t=.25,g=1] -\definecolor[f:b:t][a=1,t=.25,b=1] -\definecolor[f:c:t][a=1,t=.25,c=1] -\definecolor[f:m:t][a=1,t=.25,m=1] -\definecolor[f:y:t][a=1,t=.25,y=1] -\definecolor[f:k:t][a=1,t=.25,s=0] +% \definecolor[f:r:t][a=1,t=.25,r=1] +% \definecolor[f:g:t][a=1,t=.25,g=1] +% \definecolor[f:b:t][a=1,t=.25,b=1] +% \definecolor[f:c:t][a=1,t=.25,c=1] +% \definecolor[f:m:t][a=1,t=.25,m=1] +% \definecolor[f:y:t][a=1,t=.25,y=1] +% \definecolor[f:k:t][a=1,t=.25,s=0] % \def\node_backgrounds_boxes_add#1[#2]% % {\node_backgrounds_boxes_initialize diff --git a/Master/texmf-dist/tex/context/base/type-imp-ipaex.mkiv b/Master/texmf-dist/tex/context/base/type-imp-ipaex.mkiv new file mode 100644 index 00000000000..b11f9687857 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/type-imp-ipaex.mkiv @@ -0,0 +1,137 @@ +%D \module +%D [ file=type-imp-ipaex, +%D version=2015.05.01, +%D title=\CONTEXT\ Typescript Macros, +%D subtitle=IPAex, +%D author=Yusuke KUROKI \& Hans HAGEN, +%D date=\currentdate, +%D copyright=Yusuke KUROKI \& Hans HAGEN] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% usage: \setupbodyfont[ipaex,10pt] + +\loadtypescriptfile[texgyre] +\loadtypescriptfile[xits] + +\definefontfeature + [jp-default] + [script=default,lang=japanese] + +\definefontfeature + [jp-latin-default] + [jp-default] + +\definefontfeature + [jp-latin-slanted] + [jp-latin-default] + [slant=.2] + +\definefontfeature + [jp-latin-slanted-mono] + [slant=.2] + +\definefontfeature + [jp-latin-smallcaps] + [jp-latin-default] + [smcp=yes] + +\definefontfeature + [jp-latin-smallcaps-mono] + [cmcp=yes] + +\definefontfallback[jp-serif] [texgyrepagella-regular*jp-latin-default] [0x0000-0x0400][force=yes,rscale=1.0406] +\definefontfallback[jp-serifbold] [texgyrepagella-bold*jp-latin-default] [0x0000-0x0400][force=yes,rscale=1.0406] +\definefontfallback[jp-serifitalic] [texgyrepagella-italic*jp-latin-default] [0x0000-0x0400][force=yes,rscale=1.0406] +\definefontfallback[jp-serifbolditalic] [texgyrepagella-bolditalic*jp-latin-default] [0x0000-0x0400][force=yes,rscale=1.0406] +\definefontfallback[jp-serifslanted] [texgyrepagella-regular*jp-latin-slanted] [0x0000-0x0400][force=yes,rscale=1.0406] +\definefontfallback[jp-serifboldslanted][texgyrepagella-bold*jp-latin-slanted] [0x0000-0x0400][force=yes,rscale=1.0406] +\definefontfallback[jp-serifcaps] [texgyrepagella-regular*jp-latin-smallcaps] [0x0000-0x0400][force=yes,rscale=1.0406] +\definefontfallback[jp-sans] [texgyreheros-regular*jp-latin-default] [0x0000-0x0400][force=yes,rscale=1.0406] +\definefontfallback[jp-sansbold] [texgyreheros-bold*jp-latin-default] [0x0000-0x0400][force=yes,rscale=1.0406] +\definefontfallback[jp-sansitalic] [texgyreheros-italic*jp-latin-default] [0x0000-0x0400][force=yes,rscale=1.0406] +\definefontfallback[jp-sansbolditalic] [texgyreheros-bolditalic*jp-latin-default] [0x0000-0x0400][force=yes,rscale=1.0406] +\definefontfallback[jp-sansslanted] [texgyreheros-regular*jp-latin-slanted] [0x0000-0x0400][force=yes,rscale=1.0406] +\definefontfallback[jp-sansboldslanted] [texgyreheros-bold*jp-latin-slanted] [0x0000-0x0400][force=yes,rscale=1.0406] +\definefontfallback[jp-sanscaps] [texgyreheros-regular*jp-latin-smallcaps] [0x0000-0x0400][force=yes,rscale=1.0406] +\definefontfallback[jp-mono] [texgyrecursor-regular] [0x0000-0x0400][force=yes,rscale=1.0406] +\definefontfallback[jp-monobold] [texgyrecursor-bold] [0x0000-0x0400][force=yes,rscale=1.0406] +\definefontfallback[jp-monoitalic] [texgyrecursor-italic] [0x0000-0x0400][force=yes,rscale=1.0406] +\definefontfallback[jp-monobolditalic] [texgyrecursor-bolditalic] [0x0000-0x0400][force=yes,rscale=1.0406] +\definefontfallback[jp-monoslanted] [texgyrecursor-regular*jp-latin-slanted-mono] [0x0000-0x0400][force=yes,rscale=1.0406] +\definefontfallback[jp-monoboldslanted] [texgyrecursor-bold*jp-latin-slanted-mono] [0x0000-0x0400][force=yes,rscale=1.0406] +\definefontfallback[jp-monocaps] [texgyrecursor-regular*jp-latin-smallcaps-mono][0x0000-0x0400][force=yes,rscale=1.0406] + +\starttypescriptcollection[ipaex] + \starttypescript [\s!serif] [ipaexm] + \definefontsynonym [ipaexm] [\s!file:ipaexm][\s!features=jp-default,\s!fallbacks=jp-serif] + \definefontsynonym [ipaexmbold] [\s!file:ipaexg][\s!features=jp-default,\s!fallbacks=jp-serifbold] + \definefontsynonym [ipaexmitalic] [\s!file:ipaexg][\s!features=jp-default,\s!fallbacks=jp-serifitalic] + \definefontsynonym [ipaexmbolditalic] [\s!file:ipaexg][\s!features=jp-default,\s!fallbacks=jp-serifbolditalic] + \definefontsynonym [ipaexmslanted] [\s!file:ipaexg][\s!features=jp-default,\s!fallbacks=jp-serifslanted] + \definefontsynonym [ipaexmboldslanted][\s!file:ipaexg][\s!features=jp-default,\s!fallbacks=jp-serifboldslanted] + \definefontsynonym [ipaexmcaps] [\s!file:ipaexm][\s!features=jp-default,\s!fallbacks=jp-serifcaps] + \stoptypescript + + \starttypescript [\s!sans] [ipaexg] + \definefontsynonym[ipaexg] [\s!file:ipaexg][\s!features=jp-default,\s!fallbacks=jp-sans] + \definefontsynonym[ipaexgbold] [\s!file:ipaexg][\s!features=jp-default,\s!fallbacks=jp-sansbold] + \definefontsynonym[ipaexgitalic] [\s!file:ipaexg][\s!features=jp-default,\s!fallbacks=jp-sansitalic] + \definefontsynonym[ipaexgbolditalic] [\s!file:ipaexg][\s!features=jp-default,\s!fallbacks=jp-sansbolditalic] + \definefontsynonym[ipaexgslanted] [\s!file:ipaexg][\s!features=jp-default,\s!fallbacks=jp-sansslanted] + \definefontsynonym[ipaexgboldslanted] [\s!file:ipaexg][\s!features=jp-default,\s!fallbacks=jp-sansboldslanted] + \definefontsynonym[ipaexgcaps] [\s!file:ipaexg][\s!features=jp-default,\s!fallbacks=jp-sanscaps] + \stoptypescript + + \starttypescript [\s!mono] [ipaexgmono] + \definefontsynonym[ipaexgmono] [\s!file:ipaexg][\s!features=jp-default,\s!fallbacks=jp-mono] + \definefontsynonym[ipaexgmonobold] [\s!file:ipaexg][\s!features=jp-default,\s!fallbacks=jp-monobold] + \definefontsynonym[ipaexgmonoitalic] [\s!file:ipaexg][\s!features=jp-slanted,\s!fallbacks=jp-monoitalic] + \definefontsynonym[ipaexgmonobolditalic] [\s!file:ipaexg][\s!features=jp-slanted,\s!fallbacks=jp-monobolditalic] + \definefontsynonym[ipaexgmonoslanted] [\s!file:ipaexg][\s!features=jp-slanted,\s!fallbacks=jp-monoslanted] + \definefontsynonym[ipaexgmonoboldslanted] [\s!file:ipaexg][\s!features=jp-slanted,\s!fallbacks=jp-monoboldslanted] + \definefontsynonym[ipaexgmonocaps] [\s!file:ipaexg][\s!features=jp-default,\s!fallbacks=jp-monocaps] + \stoptypescript + + \starttypescript [\s!serif] [ipaexm] [\s!name] + \definefontsynonym[\s!Serif] [ipaexm] + \definefontsynonym[\s!SerifBold] [ipaexmbold] + \definefontsynonym[\s!SerifItalic] [ipaexmitalic] + \definefontsynonym[\s!SerifBoldItalic] [ipaexmbolditalic] + \definefontsynonym[\s!SerifSlanted] [ipaexmslanted] + \definefontsynonym[\s!SerifBoldSlanted][ipaexmboldslanted] + \definefontsynonym[\s!SerifCaps] [ipaexmcaps] + \stoptypescript + + \starttypescript [\s!sans] [ipaexg] [\s!name] + \definefontsynonym[\s!Sans] [ipaexg] + \definefontsynonym[\s!SansBold] [ipaexgbold] + \definefontsynonym[\s!SansItalic] [ipaexgitalic] + \definefontsynonym[\s!SansBoldItalic] [ipaexgbolditalic] + \definefontsynonym[\s!SansSlanted] [ipaexgslanted] + \definefontsynonym[\s!SansBoldSlanted] [ipaexgboldslanted] + \definefontsynonym[\s!SansCaps] [ipaexgcaps] + \stoptypescript + + \starttypescript [\s!mono] [ipaexgmono] [\s!name] + \definefontsynonym[\s!Mono] [ipaexgmono] + \definefontsynonym[\s!MonoBold] [ipaexgmonobold] + \definefontsynonym[\s!MonoItalic] [ipaexgmonoitalic] + \definefontsynonym[\s!MonoBoldItalic] [ipaexgmonobolditalic] + \definefontsynonym[\s!MonoSlanted] [ipaexgmonoslanted] + \definefontsynonym[\s!MonoBoldSlanted] [ipaexgmonoboldslanted] + \definefontsynonym[\s!MonoCaps] [ipaexgmonocaps] + \stoptypescript + + % xits might get replaced with a pagella once we have it + + \starttypescript[ipaex] + \definetypeface [ipaex] [\s!rm] [\s!serif] [ipaexm] + \definetypeface [ipaex] [\s!ss] [\s!sans] [ipaexg] + \definetypeface [ipaex] [\s!tt] [\s!mono] [ipaexgmono] + \definetypeface [ipaex] [\s!mm] [\s!math] [xits] + \stoptypescript + +\stoptypescriptcollection diff --git a/Master/texmf-dist/tex/context/base/util-str.lua b/Master/texmf-dist/tex/context/base/util-str.lua index a677a82ed5c..de4a87e9f12 100644 --- a/Master/texmf-dist/tex/context/base/util-str.lua +++ b/Master/texmf-dist/tex/context/base/util-str.lua @@ -44,7 +44,12 @@ end if not number then number = { } end -- temp hack for luatex-fonts -local stripper = patterns.stripzeros +local stripper = patterns.stripzeros +local newline = patterns.newline +local endofstring = patterns.endofstring +local whitespace = patterns.whitespace +local spacer = patterns.spacer +local spaceortab = patterns.spaceortab local function points(n) n = tonumber(n) @@ -62,12 +67,12 @@ number.basepoints = basepoints -- str = " \n \ntest \n test\ntest " -- print("["..string.gsub(string.collapsecrlf(str),"\n","+").."]") -local rubish = patterns.spaceortab^0 * patterns.newline -local anyrubish = patterns.spaceortab + patterns.newline +local rubish = spaceortab^0 * newline +local anyrubish = spaceortab + newline local anything = patterns.anything -local stripped = (patterns.spaceortab^1 / "") * patterns.newline +local stripped = (spaceortab^1 / "") * newline local leading = rubish^0 / "" -local trailing = (anyrubish^1 * patterns.endofstring) / "" +local trailing = (anyrubish^1 * endofstring) / "" local redundant = rubish^3 / "\n" local pattern = Cs(leading * (trailing + redundant + stripped + anything)^0) @@ -129,7 +134,7 @@ local pattern = return "" end end - + patterns.newline * Cp() / function(position) + + newline * Cp() / function(position) extra, start = 0, position end + patterns.anything @@ -162,11 +167,6 @@ end -- return str -- end -local newline = patterns.newline -local endofstring = patterns.endofstring -local whitespace = patterns.whitespace -local spacer = patterns.spacer - local space = spacer^0 local nospace = space/"" local endofline = nospace * newline @@ -1117,3 +1117,9 @@ local pattern = function string.optionalquoted(str) return lpegmatch(pattern,str) or str end + +local pattern = Cs((newline / os.newline + 1)^0) + +function string.replacenewlines(str) + return lpegmatch(pattern,str) +end diff --git a/Master/texmf-dist/tex/context/base/x-asciimath.lua b/Master/texmf-dist/tex/context/base/x-asciimath.lua index 7ddf5a6379a..6030be86c8f 100644 --- a/Master/texmf-dist/tex/context/base/x-asciimath.lua +++ b/Master/texmf-dist/tex/context/base/x-asciimath.lua @@ -123,6 +123,7 @@ local reserved = { ["bar"] = { false, "\\overbar", "unary" }, ["overbar"] = { false, "\\overbar", "unary" }, ["underline"] = { false, "\\underline", "unary" }, + ["ul"] = { false, "\\underline", "unary" }, ["vec"] = { false, "\\overrightarrow", "unary" }, ["dot"] = { false, "\\dot", "unary" }, -- 0x2D9 ["ddot"] = { false, "\\ddot", "unary" }, -- 0xA8 diff --git a/Master/texmf-dist/tex/context/base/x-math-svg.lua b/Master/texmf-dist/tex/context/base/x-math-svg.lua index 263827f92f5..8a628816773 100644 --- a/Master/texmf-dist/tex/context/base/x-math-svg.lua +++ b/Master/texmf-dist/tex/context/base/x-math-svg.lua @@ -40,8 +40,10 @@ local pdftosvg = os.which("mudraw") local f_make_tex = formatters[ [[context --global kpse:x-math-svg.mkvi --inputfile="%s" --svgstyle="%s" --batch --noconsole --once --purgeall]] ] local f_make_svg = formatters[ [[mudraw -o "math-%%d.svg" "%s" 1-9999]] ] -local f_inline = formatters[ [[<div class='math-inline' style='vertical-align:%p'></div>]] ] +----- f_inline = formatters[ [[<div class='math-inline' style='vertical-align:%p'></div>]] ] +local f_inline = formatters[ [[<div class='math-inline'></div>]] ] local f_display = formatters[ [[<div class='math-display'></div>]] ] +local f_style = formatters[ [[vertical-align:%p]] ] local f_math_tmp = formatters[ [[math-%i]] ] @@ -140,7 +142,8 @@ function svgmath.convert(filename,svgstyle) local mode = info.mode local svgname = addsuffix(f_math_tmp(page),"svg") local action = mode == "inline" and f_inline or f_display - local x_div = xmlfirst(xmlconvert(action(-depth)),"/div") + -- local x_div = xmlfirst(xmlconvert(action(-depth)),"/div") + local x_div = xmlfirst(xmlconvert(action()),"/div") local svgdata = io.loaddata(svgname) if not svgdata or svgdata == "" then print("error in:",svgname,tostring(mth)) @@ -149,6 +152,10 @@ function svgmath.convert(filename,svgstyle) svgdata = lpegmatch(strip,svgdata) local x_svg = xmlfirst(xmlconvert(svgdata),"/svg") -- xmldelete(x_svg,"text") +if mode == "inline" then + x_svg.at.style = f_style(-depth) +end + x_div.dt = { x_svg } mth.__p__.dt[mth.ni] = x_div -- use helper end |