diff options
Diffstat (limited to 'tex')
-rw-r--r-- | tex/context/base/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/context-version.pdf | bin | 4284 -> 4275 bytes | |||
-rw-r--r-- | tex/context/base/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/data-res.lua | 10 | ||||
-rw-r--r-- | tex/context/base/file-mod.lua | 18 | ||||
-rw-r--r-- | tex/context/base/font-sel.mkvi | 2 | ||||
-rw-r--r-- | tex/context/base/lang-url.lua | 80 | ||||
-rw-r--r-- | tex/context/base/lang-url.mkiv | 63 | ||||
-rw-r--r-- | tex/context/base/mult-aux.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mult-mes.lua | 6 | ||||
-rw-r--r-- | tex/context/base/publ-dat.lua | 6 | ||||
-rw-r--r-- | tex/context/base/publ-fnd.lua | 43 | ||||
-rw-r--r-- | tex/context/base/publ-imp-cite.mkiv | 38 | ||||
-rw-r--r-- | tex/context/base/publ-ini.lua | 109 | ||||
-rw-r--r-- | tex/context/base/publ-ini.mkiv | 76 | ||||
-rw-r--r-- | tex/context/base/status-files.pdf | bin | 24594 -> 24584 bytes | |||
-rw-r--r-- | tex/context/base/status-lua.pdf | bin | 244074 -> 244257 bytes | |||
-rw-r--r-- | tex/context/base/syst-ini.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/type-imp-texgyre.mkiv | 2 | ||||
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-merged.lua | 2 |
20 files changed, 270 insertions, 193 deletions
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index e47436dde..af32e8f35 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2014.05.20 09:53} +\newcontextversion{2014.05.21 22:04} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex da217cd7b..cf428c00e 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 40f7c56cb..9774f645f 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -28,7 +28,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2014.05.20 09:53} +\edef\contextversion{2014.05.21 22:04} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/data-res.lua b/tex/context/base/data-res.lua index 8e2a4978a..d79d78a72 100644 --- a/tex/context/base/data-res.lua +++ b/tex/context/base/data-res.lua @@ -38,9 +38,10 @@ local setmetatableindex = table.setmetatableindex local luasuffixes = utilities.lua.suffixes local getcurrentdir = lfs.currentdir -local trace_locating = false trackers.register("resolvers.locating", function(v) trace_locating = v end) -local trace_detail = false trackers.register("resolvers.details", function(v) trace_detail = v end) -local trace_expansions = false trackers.register("resolvers.expansions", function(v) trace_expansions = v end) +local trace_locating = false trackers .register("resolvers.locating", function(v) trace_locating = v end) +local trace_detail = false trackers .register("resolvers.details", function(v) trace_detail = v end) +local trace_expansions = false trackers .register("resolvers.expansions", function(v) trace_expansions = v end) +local resolve_otherwise = true directives.register("resolvers.otherwise", function(v) resolve_otherwise = v end) local report_resolving = logs.reporter("resolvers","resolving") @@ -1362,7 +1363,8 @@ collect_instance_files = function(filename,askedformat,allresults) -- uses neste method, result = find_intree(filename,filetype,wantedfiles) if not result then method, result = find_onpath(filename,filetype,wantedfiles) - if not result then + if resolve_otherwise and not result then + -- this will search everywhere in the tree method, result = find_otherwise(filename,filetype,wantedfiles) end end diff --git a/tex/context/base/file-mod.lua b/tex/context/base/file-mod.lua index 822f37c86..2f34d9dd2 100644 --- a/tex/context/base/file-mod.lua +++ b/tex/context/base/file-mod.lua @@ -20,17 +20,18 @@ at the <l n='tex'/> side.</p> local format, concat, tonumber = string.format, table.concat, tonumber -local trace_modules = false trackers.register("modules.loading", function(v) trace_modules = v end) +local trace_modules = false trackers .register("modules.loading", function(v) trace_modules = v end) +local permit_unprefixed = false directives.register("modules.permitunprefixed", function(v) permit_unprefixed = v end) -local report_modules = logs.reporter("resolvers","modules") +local report_modules = logs.reporter("resolvers","modules") -commands = commands or { } -local commands = commands +commands = commands or { } +local commands = commands -local context = context +local context = context -local findbyscheme = resolvers.finders.byscheme -- use different one -local iterator = utilities.parsers.iterator +local findbyscheme = resolvers.finders.byscheme -- use different one +local iterator = utilities.parsers.iterator -- modules can have a specific suffix or can specify one @@ -117,7 +118,10 @@ function commands.usemodules(prefix,askedname,truename) end if status then -- ok, don't change + elseif not permit_unprefixed then + -- forget about it elseif usemodule(truename) then + report_modules("using unprefixed file %a",truename) status = 1 else status = 0 diff --git a/tex/context/base/font-sel.mkvi b/tex/context/base/font-sel.mkvi index 0b1d10c51..0b9a4bda9 100644 --- a/tex/context/base/font-sel.mkvi +++ b/tex/context/base/font-sel.mkvi @@ -371,4 +371,4 @@ \c!smallcapsfeatures=\s!smallcaps, \c!style=\s!rm] -\protect
\ No newline at end of file +\protect diff --git a/tex/context/base/lang-url.lua b/tex/context/base/lang-url.lua index 4ed5cdea1..fb4147580 100644 --- a/tex/context/base/lang-url.lua +++ b/tex/context/base/lang-url.lua @@ -8,10 +8,12 @@ if not modules then modules = { } end modules ['lang-url'] = { local utfcharacters, utfvalues, utfbyte, utfchar = utf.characters, utf.values, utf.byte, utf.char -commands = commands or { } -local commands = commands +commands = commands or { } +local commands = commands -context = context +context = context + +local is_letter = characters.is_letter --[[ <p>Hyphenating <l n='url'/>'s is somewhat tricky and a matter of taste. I did @@ -72,27 +74,81 @@ hyphenatedurl.discretionary = nil -- more fun is to write nodes .. maybe it's nicer to do this -- in an attribute handler anyway +-- local ctx_a = context.a +-- local ctx_b = context.b +-- local ctx_d = context.d +-- local ctx_n = context.n +-- local ctx_s = context.s + +-- local function action(hyphenatedurl,str,left,right,disc) +-- local n = 0 +-- local b = math.max( left or hyphenatedurl.lefthyphenmin, 2) +-- local e = math.min(#str-(right or hyphenatedurl.righthyphenmin)+2,#str) +-- local d = disc or hyphenatedurl.discretionary +-- local p = nil +-- for s in utfcharacters(str) do +-- n = n + 1 +-- s = mapping[s] or s +-- if n > 1 then +-- ctx_s() -- can be option +-- end +-- if s == d then +-- ctx_d(utfbyte(s)) +-- else +-- local c = characters[s] +-- if not c or n <= b or n >= e then +-- ctx_n(utfbyte(s)) +-- elseif c == 1 then +-- ctx_b(utfbyte(s)) +-- elseif c == 2 then +-- ctx_a(utfbyte(s)) +-- end +-- end +-- p = s +-- end +-- end + +local ctx_a = context.a +local ctx_b = context.b +local ctx_d = context.d +local ctx_c = context.c +local ctx_l = context.l +local ctx_C = context.C +local ctx_L = context.L + local function action(hyphenatedurl,str,left,right,disc) local n = 0 local b = math.max( left or hyphenatedurl.lefthyphenmin, 2) local e = math.min(#str-(right or hyphenatedurl.righthyphenmin)+2,#str) local d = disc or hyphenatedurl.discretionary + local p = nil for s in utfcharacters(str) do n = n + 1 s = mapping[s] or s - if n > 1 then - context.s() -- can be option - end if s == d then - context.d(utfbyte(s)) + ctx_d(utfbyte(s)) else local c = characters[s] - if not c or n<=b or n>=e then - context.n(utfbyte(s)) - elseif c == 1 then - context.b(utfbyte(s)) + if c == 1 then + p = false + ctx_b(utfbyte(s)) elseif c == 2 then - context.a(utfbyte(s)) + p = false + ctx_a(utfbyte(s)) + else + local l = is_letter[s] + if n <= b or n >= e then + if p and l then + ctx_L(utfbyte(s)) + else + ctx_C(utfbyte(s)) + end + elseif p and l then + ctx_l(utfbyte(s)) + else + ctx_c(utfbyte(s)) + end + p = l end end end diff --git a/tex/context/base/lang-url.mkiv b/tex/context/base/lang-url.mkiv index 1bbe16838..8990dccd8 100644 --- a/tex/context/base/lang-url.mkiv +++ b/tex/context/base/lang-url.mkiv @@ -64,41 +64,48 @@ \setnewconstant\hyphenatedurllefthyphenmin \plusthree \setnewconstant\hyphenatedurlrighthyphenmin\plusthree -\def\lang_url_space {\nobreak\hskip\zeropoint plus\onepoint\nobreak} -\def\lang_url_after #1{\char#1\discretionary{}{\hyphenatedurlseparator}{}} -\def\lang_url_before #1{\discretionary{\hyphenatedurlseparator}{}{}\char#1\relax} -\def\lang_url_normal #1{\char#1\relax} -\def\lang_url_disc #1{\discretionary{}{}{}} - -\def\lang_url_space_trace {\nobreak\begingroup\darkyellow\ruledhskip\zeropoint plus\onepoint\endgroup\nobreak} -\def\lang_url_after_trace #1{\char#1\hsmash{\darkblue\vl}\discretionary{}{\hyphenatedurlseparator}{}} -\def\lang_url_before_trace#1{\discretionary{\hyphenatedurlseparator}{}{}\hsmash{\darkred\vl}\char#1\relax} -\def\lang_url_normal_trace#1{\char#1\relax} -\def\lang_url_disc_trace #1{\discretionary{\hsmash{\darkgreen\vl}}{\hsmash{\darkgreen\vl}}{\hsmash{\darkgreen\vl}}} - -\def\showhyphenatedurlbreaks - {\let\lang_url_space \lang_url_space_trace - \let\lang_url_after \lang_url_after_trace - \let\lang_url_before\lang_url_before_trace - \let\lang_url_normal\lang_url_normal_trace - \let\lang_url_disc \lang_url_disc_trace} - -\def\sethyphenatedurlnormal#1{\ctxcommand{hyphenatedurl.setcharacters(\!!bs#1\!!es,0)}} % Lua names will change -\def\sethyphenatedurlbefore#1{\ctxcommand{hyphenatedurl.setcharacters(\!!bs#1\!!es,1)}} % Lua names will change -\def\sethyphenatedurlafter #1{\ctxcommand{hyphenatedurl.setcharacters(\!!bs#1\!!es,2)}} % Lua names will change +\def\lang_url_more{\penalty\plustenthousand\hskip\scratchskipone\penalty\plustenthousand} +\def\lang_url_less{\penalty\plustenthousand\hskip\scratchskiptwo\penalty\plustenthousand} +\def\lang_url_trac{\penalty\plustenthousand\hsmash{\darkred\vl}\penalty\plustenthousand} + +\def\lang_url_a#1{\lang_url_more\char#1\lang_url_show\discretionary{}{\hyphenatedurlseparator}{}} +\def\lang_url_b#1{\lang_url_more\discretionary{\hyphenatedurlseparator}{}{}\lang_url_show\char#1\relax} +\def\lang_url_d#1{\lang_url_more\discretionary{\lang_url_show}{\lang_url_show}{\lang_url_show}} +\def\lang_url_l#1{\lang_url_less\char#1\relax} +\def\lang_url_c#1{\lang_url_more\char#1\relax} +\def\lang_url_L#1{\lang_url_less\char#1\relax} +\def\lang_url_C#1{\lang_url_more\char#1\relax} + +\unexpanded\def\showhyphenatedurlbreaks % for old times sake + {\let\lang_url_show\lang_url_trac} + +\installtextracker + {languages.url} + {\let\lang_url_show\lang_url_trac} + {\let\lang_url_show\relax} + +\let\lang_url_show\relax + +\unexpanded\def\sethyphenatedurlnormal#1{\ctxcommand{hyphenatedurl.setcharacters(\!!bs#1\!!es,0)}} % Lua names will change +\unexpanded\def\sethyphenatedurlbefore#1{\ctxcommand{hyphenatedurl.setcharacters(\!!bs#1\!!es,1)}} % Lua names will change +\unexpanded\def\sethyphenatedurlafter #1{\ctxcommand{hyphenatedurl.setcharacters(\!!bs#1\!!es,2)}} % Lua names will change % \sethyphenatedurlafter{ABCDEF} -\unexpanded \def\hyphenatedurl#1% +\unexpanded\def\hyphenatedurl#1% {\dontleavehmode \begingroup \the\everyhyphenatedurl \normallanguage\zerocount - \let\s\lang_url_space - \let\a\lang_url_after - \let\b\lang_url_before - \let\n\lang_url_normal - \let\d\lang_url_disc + \let\a\lang_url_a % after + \let\b\lang_url_b % before + \let\d\lang_url_d % disc + \let\l\lang_url_l % letter + \let\c\lang_url_c % character + \let\L\lang_url_L % letter_nobreak + \let\C\lang_url_C % character_nobreak + \scratchskipone\zeropoint\s!plus\dimexpr\emwidth/12\s!minus\dimexpr\emwidth/24\relax % 1.00pt @ 12pt + \scratchskiptwo\zeropoint\s!plus\dimexpr\emwidth/48\s!minus\dimexpr\emwidth/96\relax % 0.25pt @ 12pt \normalexpanded{\noexpand\ctxcommand{hyphenatedurl( \!!bs\noexpand\detokenize{#1}\!!es, \number\hyphenatedurllefthyphenmin, diff --git a/tex/context/base/mult-aux.mkiv b/tex/context/base/mult-aux.mkiv index 1811f9592..bfac58261 100644 --- a/tex/context/base/mult-aux.mkiv +++ b/tex/context/base/mult-aux.mkiv @@ -1102,7 +1102,7 @@ \expandafter\noexpand\csname saved_setup_current#2\endcsname \expandafter\noexpand\csname nested_setup_current#2\endcsname}} -% okay, we can also get rid of the #9, but thsi code looks pretty bad, while the previous is +% okay, we can also get rid of the #9, but thiS code looks pretty bad, while the previous is % still okay given that we can also use #6 as setup1 (so in fact we can save some cs again and % only use one extra) % diff --git a/tex/context/base/mult-mes.lua b/tex/context/base/mult-mes.lua index d9ee151a8..0affb43d6 100644 --- a/tex/context/base/mult-mes.lua +++ b/tex/context/base/mult-mes.lua @@ -996,6 +996,12 @@ return { ["publications:7"] = { en = "placing all entries, use 'text' to be more selective", }, + ["publications:10"] = { + en = "unknown command %a, using built-in context variant %a", + }, + ["publications:11"] = { + en = "unknown command %a", + }, ["pushing level: %a"] = { nl = "niveau omhoog: %a", }, diff --git a/tex/context/base/publ-dat.lua b/tex/context/base/publ-dat.lua index 5ad4829e0..6062d0d4c 100644 --- a/tex/context/base/publ-dat.lua +++ b/tex/context/base/publ-dat.lua @@ -74,8 +74,10 @@ local defaultshortcuts = { dec = "12", } -local l_splitter = lpeg.tsplitat("+") -local d_splitter = lpeg.splitat ("+") +local space = lpeg.patterns.whitespace^0 +local separator = space * "+" * space +local l_splitter = lpeg.tsplitat(separator) +local d_splitter = lpeg.splitat (separator) function publications.parenttag(dataset,tag) if find(tag,"%+") then diff --git a/tex/context/base/publ-fnd.lua b/tex/context/base/publ-fnd.lua index 77d1d4dab..383bcac73 100644 --- a/tex/context/base/publ-fnd.lua +++ b/tex/context/base/publ-fnd.lua @@ -7,24 +7,23 @@ if not modules then modules = { } end modules ['publ-fnd'] = { } local tonumber, next = tonumber, next -local P, R, C, Cs, Carg = lpeg.P, lpeg.R, lpeg.C, lpeg.Cs, lpeg.Carg +local P, R, C, Cs, Cp, Carg = lpeg.P, lpeg.R, lpeg.C, lpeg.Cs, lpeg.Cp, lpeg.Carg local lpegmatch = lpeg.match local concat = table.concat -local find = string.find local formatters = string.formatters local lowercase = characters.lower -local colon = P(":") -local dash = P("-") -local lparent = P("(") -local rparent = P(")") -local space = lpeg.patterns.whitespace -local valid = 1 - colon - space - lparent - rparent -local key = C(valid^1) -local key = C(R("az","AZ")^1) -local word = Cs(lpeg.patterns.unquoted + valid^1) -local number = C(valid^1) +local colon = P(":") +local dash = P("-") +local lparent = P("(") +local rparent = P(")") +local space = lpeg.patterns.whitespace +local valid = 1 - colon - space - lparent - rparent +----- key = C(valid^1) +local key = C(R("az","AZ")^1) +local word = Cs(lpeg.patterns.unquoted + valid^1) +local number = C(valid^1) ----- f_string_key = formatters[" local s_%s = entry[%q]"] local f_string_key = formatters[" local s_%s = entry[%q] if s_%s then s_%s = lower(s_%s) end "] @@ -55,8 +54,8 @@ end ----- pattern = Cs((field + range + match + P(1))^1) ----- b_match = P("match")/"" * lparent local b_match = lparent -local e_match = rparent * P(-1) -local pattern = Cs(b_match * ((field + range + match + P(1))-e_match)^1 * e_match) +local e_match = rparent * space^0 * P(-1) +local pattern = Cs(b_match * ((field + range + match + space + P(1))-e_match)^1 * e_match) -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- @@ -106,16 +105,16 @@ end local cache = { } -- todo: make weak, or just remember the last one (trial typesetting) +local check = P("match") * space^0 * Cp() + local function finder(expression) - local b, e = find(expression,"^match") - if e then - local found = cache[expression] - if found == nil then - found = compile(expression,e+1) or false - cache[expression] = found - end - return found + local found = cache[expression] + if found == nil then + local e = lpegmatch(check,expression) + found = e and compile(expression,e) or false + cache[expression] = found end + return found end publications.finder = finder diff --git a/tex/context/base/publ-imp-cite.mkiv b/tex/context/base/publ-imp-cite.mkiv index 17a93aa82..1b3157b4b 100644 --- a/tex/context/base/publ-imp-cite.mkiv +++ b/tex/context/base/publ-imp-cite.mkiv @@ -55,6 +55,7 @@ % \directsetup{\s!btx:\s!cite:concat} % \ifconditional\btxinteractive % \goto { +% \btxcitereference % \directsetup{\s!btx:\s!cite:common:normal} % } [ % \s!internal(\currentbtxinternal) @@ -64,7 +65,7 @@ % \fi % \stopsetups % -% more efficient: +% more efficient (less tokens, less expansion): \startsetups \s!btx:\s!cite:render:normal \directsetup{\s!btx:\s!cite:concat} @@ -96,6 +97,7 @@ % \directsetup{\s!btx:\s!cite:concat} % \ifconditional\btxinteractive % \goto { +% \btxcitereference % \directsetup{\s!btx:\s!cite:common:range} % } [ % \s!internal(\currentbtxinternal) @@ -105,7 +107,7 @@ % \fi % \stopsetups % -% more efficient: +% more efficient (less tokens, less expansion): \startsetups \s!btx:\s!cite:render:range \directsetup{\s!btx:\s!cite:concat} @@ -212,12 +214,12 @@ \startsetups \s!btx:\s!cite:key \directsetup{\s!btx:\s!cite:render:normal} \stopsetups -\startsetups \s!btx:\s!cite:doi - \directsetup{\s!btx:\s!cite:render:normal} -\stopsetups -\startsetups \s!btx:\s!cite:url - \directsetup{\s!btx:\s!cite:render:normal} -\stopsetups +%startsetups \s!btx:\s!cite:doi +% \directsetup{\s!btx:\s!cite:render:normal} +%stopsetups +%startsetups \s!btx:\s!cite:url +% \directsetup{\s!btx:\s!cite:render:normal} +%stopsetups \startsetups \s!btx:\s!cite:category \directsetup{\s!btx:\s!cite:render:normal} \stopsetups @@ -231,4 +233,24 @@ \directsetup{\s!btx:\s!cite:render:normal} \stopsetups +\startsetups \s!btx:\s!cite:doi + \directsetup{\s!btx:\s!cite:render:variant} +\stopsetups +\startsetups \s!btx:\s!cite:render:doi + \hyphenatedurl{\currentbtxfirst} +\stopsetups + +\startsetups \s!btx:\s!cite:url + \ifconditional\btxinteractive + \goto { + \btxcitereference + \hyphenatedurl{\currentbtxfirst} + } [ + url(\currentbtxfirst) + ] + \else + \hyphenatedurl{\currentbtxfirst} + \fi +\stopsetups + \protect diff --git a/tex/context/base/publ-ini.lua b/tex/context/base/publ-ini.lua index baac989cc..102b22104 100644 --- a/tex/context/base/publ-ini.lua +++ b/tex/context/base/publ-ini.lua @@ -412,8 +412,8 @@ local finder = publications.finder entry = entry[1] -- for now end okay[#okay+1] = entry - todo[tag] = true end + todo[tag] = true end if find then tags = { } @@ -441,7 +441,7 @@ local finder = publications.finder for tag, entry in next, valid do local found = find(entry) if found then - register(tag) + todo[tag] = true tags[#tags+1] = tag end end @@ -1074,9 +1074,7 @@ function lists.flushentries(dataset,sortvariant) list = sort(dataset,rendering,list) or list end for i=1,#list do --- ctx_setvalue("currentbtxindex",i) -- todo: helper --- -- todo: also flush combinations --- ctx_btxhandlelistentry(list[i][1]) -- we can pass i here too ... more efficient to avoid the setvalue + -- we can pass i here too ... more efficient to avoid the setvalue local tag = list[i][1] local entry = datasets[dataset].luadata[tag] if entry then @@ -1133,50 +1131,80 @@ end -- todo: nicer refs -local f_citereference = formatters["btx:%s"] -- dataset, instance (block), tag -local f_listreference = formatters["btx:%s:%s:%s"] -- dataset, instance (block), tag +-- local f_citereference = formatters["btx:%s:%s"] -- dataset, instance (block), tag, order +-- local f_listreference = formatters["btx:%s:%s:%s:%s"] -- dataset, instance (block), tag, order +-- +-- -- local done = { } +-- local last = 0 +-- +-- function commands.btxcitereference(internal) +-- last = last + 1 +-- local ref = f_citereference(internal,last) -- we just need a unique key +-- -- local don = done[ref] +-- -- if don == nil then +-- if trace_references then +-- report_reference("cite: %s",ref) +-- end +-- -- done[ref] = true +-- ctx_btxsetcitereference(ref,internal) +-- -- elseif don then +-- -- report_reference("duplicate cite: %s, skipped",ref) +-- -- done[ref] = false +-- -- -- else +-- -- -- no more messages +-- -- end +-- end +-- +-- -- we just need a unique key, so we could also use btx:<number> but this +-- -- way we have a bit of a check for duplicates +-- +-- -- local done = { } +-- local last = 0 +-- +-- function commands.btxlistreference(dataset,block,tag,data) +-- last = last + 1 +-- local ref = f_listreference(dataset,block,tag,last) +-- -- local don = done[ref] +-- -- if don == nil then +-- if trace_references then +-- report_reference("list: %s",ref) +-- end +-- -- done[ref] = true +-- ctx_btxsetlistreference(dataset,tag,ref,data) +-- -- elseif don then +-- -- report_reference("duplicate link: %s, skipped",ref) +-- -- done[ref] = false +-- -- -- else +-- -- -- no more messages +-- -- end +-- end + -local done = { } +local f_citereference = formatters["btx:cite:%s"] +local f_listreference = formatters["btx:list:%s"] + +local nofcite = 0 +local noflist = 0 function commands.btxcitereference(internal) - local ref = f_citereference(internal) -- we just need a unique key - local don = done[ref] - if don == nil then - if trace_references then - report_reference("cite: %s",ref) - end - done[ref] = true - ctx_btxsetcitereference(ref,internal) - elseif don then - report_reference("duplicate cite: %s, skipped",ref) - done[ref] = false - -- else - -- no more messages + nofcite = nofcite + 1 + local ref = f_citereference(nofcite) + if trace_references then + report_reference("cite: %s",ref) end + ctx_btxsetcitereference(ref,internal) end --- we just need a unique key, so we could also use btx:<number> but this --- way we have a bit of a check for duplicates - -local done = { } - function commands.btxlistreference(dataset,block,tag,data) - local ref = f_listreference(dataset,block,tag) - local don = done[ref] - if don == nil then - if trace_references then - report_reference("list: %s",ref) - end - done[ref] = true - ctx_btxsetlistreference(dataset,tag,ref,data) - elseif don then - report_reference("duplicate link: %s, skipped",ref) - done[ref] = false - -- else - -- no more messages + noflist = noflist + 1 + local ref = f_listreference(noflist) + if trace_references then + report_reference("list: %s",ref) end + ctx_btxsetlistreference(dataset,tag,ref,data) end + commands.btxsetlistmethod = lists.setmethod commands.btxresolvelistreference = lists.resolve commands.btxregisterlistentry = lists.registerplaced @@ -1223,7 +1251,8 @@ end -- tags = sortedtags(dataset,tags,sorttype) -- end -local prefixsplitter = lpeg.splitat("::") +local optionalspace = lpeg.patterns.whitespace^0 +local prefixsplitter = optionalspace * lpeg.splitat(optionalspace * P("::") * optionalspace) function commands.btxhandlecite(specification) local tag = specification.reference diff --git a/tex/context/base/publ-ini.mkiv b/tex/context/base/publ-ini.mkiv index 898f286f6..fb0d00d03 100644 --- a/tex/context/base/publ-ini.mkiv +++ b/tex/context/base/publ-ini.mkiv @@ -53,6 +53,8 @@ \def\s!btx {btx} \def\s!cite {cite} +\def\s!list {list} +\def\v!btxcite{btxcite} \def\v!btxlist{btxlist} % a dedicated construction mechanism @@ -93,23 +95,14 @@ \unexpanded\def\stopbtxlistentry {\csname\??constructionstophandler\currentconstructionhandler\endcsname} -% \unexpanded\setvalue{\??constructiontexthandler\v!btxlist}% -% {\begingroup -% \useconstructionstyleandcolor\c!headstyle\c!headcolor % move to \currentconstructiontext -% \the\everyconstruction -% \constructionparameter\c!headcommand -% {\strut -% \constructionparameter\c!text -% \btx_list_reference_inject}% -% \endgroup} - \unexpanded\setvalue{\??constructiontexthandler\v!btxlist}% {\begingroup \useconstructionstyleandcolor\c!headstyle\c!headcolor % move to \currentconstructiontext \the\everyconstruction \goto {\strut\constructionparameter\c!text\btx_list_reference_inject}% - [\s!btx:\the\numexpr\locationcount+\plusone]% \nextinternalreference +% [\s!btx:list:\the\numexpr\locationcount+\plusone]% \nextinternalreference + [internal(\the\numexpr\locationcount+\plusone)]% \nextinternalreference \endgroup} \unexpanded\def\strc_constructions_initialize#1% class instance @@ -250,15 +243,15 @@ \def\publ_command_nop#1% {\ifcsname#1\endcsname - \writestatus\m!publications{unknown command: #1, using built-in context variant #1}% + \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 - \writestatus\m!publications{unknown command: #1, using built-in context variant \utfupper{#1}}% + \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 - \writestatus\m!publications{unknown command: #1}% + \showmessage\m!publications{11}{#1}% \setugvalue{\??btxcommand#1}{\underbar{\tttf#1}}% \fi\fi \publ_command_yes{#1}} @@ -364,14 +357,6 @@ \fi \to \everydefinebtxrendering -% \unexpanded\def\btx_entry_inject -% {\begingroup -% \edef\currentbtxcategory{\btxfield{category}}% -% \ignorespaces -% \directsetup{\s!btx:\currentbtxalternative:\currentbtxcategory}% -% \removeunwantedspaces -% \endgroup} - \let\currentbtxcombis\empty % goes into the setups \unexpanded\def\btx_entry_inject @@ -381,7 +366,7 @@ \directsetup{\s!btx:\currentbtxalternative:\currentbtxcategory}% \removeunwantedspaces \ifx\currentbtxcombis\empty \else - \btxlistvariantparameter\c!separator + \btxrenderingparameter\c!separator \processcommacommand[\currentbtxcombis]\btx_entry_inject_combi \fi \endgroup} @@ -525,13 +510,6 @@ \fi \endgroup} -% \unexpanded\def\btxchecklistcombi#1% called at the lua end -% {\begingroup -% \edef\currentbtxtag{#1}% -% ; % todo -% \publ_check_list_entry -% \endgroup} - \unexpanded\def\publ_check_list_entry {\global\advance\btxlistcounter\plusone % todo, switch to font @@ -554,10 +532,10 @@ \unexpanded\def\btx_cite_reference_inject % todo: wrap whole content? {\dontleavehmode\begingroup % no box \iftrialtypesetting\else - \ifx\currentbtxinternal\empty\else +% \ifx\currentbtxinternal\empty\else % \global\advance\btxcitecounter\plusone \ctxcommand{btxcitereference(\number\currentbtxinternal)}% - \fi +% \fi \fi % \btx_list_reference_inject_indeed \endgroup} @@ -686,9 +664,6 @@ \btxcitevariantparameter\v!right \endgroup} -% \def\btxnumberedplaceholder[#1]% \nobibtexnumref -% {[#1]} - \appendtoks % for old times sake, for a while at least \let\maybeyear\gobbleoneargument @@ -712,23 +687,6 @@ \newconditional\c_publ_cite_write -% for reference, but split now done at the lua end -% -% \def\publ_cite_write#1% not used -% {\splitstring#1\at::\to\askedbtxrendering\and\askedbtxtag -% \ifx\askedbtxtag\empty -% \let\currentbtxtag \askedbtxrendering -% \else -% \let\currentbtxtag \askedbtxtag -% \let\currentbtxrendering\askedbtxrendering -% \fi -% \iftrialtypesetting \else -% \processcommacommand[\currentbtxtag]{\publ_cite_indeed\currentbtxrendering}% -% \fi} -% -% \def\publ_cite_indeed#1#2% -% {\expanded{\writedatatolist[btx][btxset=#1,btxref=#2]}} - \unexpanded\def\btxdomarkcitation % called from lua end {\iftrialtypesetting \expandafter\gobbletwoarguments @@ -776,12 +734,6 @@ \unexpanded\def\publ_cite_tags_options[#1]% {\strictdoifnextoptionalelse{\publ_cite_tags_options_indeed{#1}}{\publ_cite_tags_indeed{#1}}} -% \unexpanded\def\publ_cite_tags_options_indeed#1[#2]% -% {\edef\currentbtxcitetag{#2}% -% \doifassignmentelse{#1} -% {\publ_cite_tags_settings_indeed{#1}} -% {\publ_cite_tags_variants_indeed{#1}}} - \unexpanded\def\publ_cite_tags_options_indeed#1[#2]% {\edef\currentbtxcitetag{#2}% \doifassignmentelse{#1}\publ_cite_tags_settings_indeed\publ_cite_tags_variants_indeed{#1}} @@ -810,6 +762,7 @@ \fi \edef\p_before{\dummyparameter\c!before}% \edef\p_after {\dummyparameter\c!after}% + \the\everysetupbtxciteplacement \ifx\p_before\empty \else \p_before \space @@ -896,9 +849,6 @@ \newconstant\currentbtxconcat -% \unexpanded\def\btxcitevariant#1% -% {\ctxcommand{btxcitevariant("\currentbtxdataset","\currentbtxblock","\currentbtxtag","#1")}} - \unexpanded\def\btxcitereset {\let\currentbtxfirst \empty \let\currentbtxsecond \empty @@ -976,6 +926,7 @@ \c!numbering=\v!yes, % \c!autohang=\v!no, \c!width=\v!auto, + \c!separator={; }, \c!distance=1.5\emwidth] \definebtxrendering @@ -1109,8 +1060,7 @@ \c!right={]}] \setupbtxlistvariant - [\c!separator={; }, - \c!namesep={, }, + [\c!namesep={, }, \c!lastnamesep={ and }, \c!finalnamesep={ and }, \c!firstnamesep={ }, diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex e98aea887..24b732427 100644 --- a/tex/context/base/status-files.pdf +++ b/tex/context/base/status-files.pdf diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf Binary files differindex 6603d4b5a..f6ca96bc3 100644 --- a/tex/context/base/status-lua.pdf +++ b/tex/context/base/status-lua.pdf diff --git a/tex/context/base/syst-ini.mkiv b/tex/context/base/syst-ini.mkiv index fda873d3c..a533f8a6a 100644 --- a/tex/context/base/syst-ini.mkiv +++ b/tex/context/base/syst-ini.mkiv @@ -327,7 +327,7 @@ \newcount\scratchcounterone \newcount\scratchcountertwo \newcount\scratchcounterthree \newdimen \scratchdimenone \newdimen \scratchdimentwo \newdimen \scratchdimenthree -\newdimen \scratchskipone \newdimen \scratchskiptwo \newdimen \scratchskipthree +\newskip \scratchskipone \newskip \scratchskiptwo \newskip \scratchskipthree \newbox \scratchmuskipone \newbox \scratchmuskiptwo \newbox \scratchmuskipthree \newtoks \scratchtoksone \newtoks \scratchtokstwo \newtoks \scratchtoksthree \newbox \scratchboxone \newbox \scratchboxtwo \newbox \scratchboxthree diff --git a/tex/context/base/type-imp-texgyre.mkiv b/tex/context/base/type-imp-texgyre.mkiv index b2aaa3629..247b4ef21 100644 --- a/tex/context/base/type-imp-texgyre.mkiv +++ b/tex/context/base/type-imp-texgyre.mkiv @@ -169,7 +169,7 @@ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] \definetypeface [\typescriptone] [\s!ss] [\s!sans] [modern] [\s!default] [\s!rscale=1.1] \definetypeface [\typescriptone] [\s!tt] [\s!mono] [modern] [\s!default] [\s!rscale=1.1] - \definetypeface [\typescriptone] [\s!mm] [\s!math] [schola] [\s!default] [\s!rscale=1.1] + \definetypeface [\typescriptone] [\s!mm] [\s!math] [schola] [\s!default] \quittypescriptscanning \stoptypescript diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 8f8a4bb1d..a0122fbe9 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 05/20/14 09:53:13 +-- merge date : 05/21/14 22:04:03 do -- begin closure to overcome local limits and interference |