diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2015-04-18 15:15:04 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2015-04-18 15:15:04 +0200 |
commit | d60cd418153b3ea6909c8b4691a160f54c41a670 (patch) | |
tree | 1c30539e5e290da11a9fc79cf44fd8b62b407bc5 /tex | |
parent | c3a4b56ae20890538fedd2d4f119b8db501544cf (diff) | |
download | context-d60cd418153b3ea6909c8b4691a160f54c41a670.tar.gz |
2015-04-18 14:44:00
Diffstat (limited to 'tex')
22 files changed, 472 insertions, 275 deletions
diff --git a/tex/context/base/char-ini.lua b/tex/context/base/char-ini.lua index 56b038cee..a1dd911f2 100644 --- a/tex/context/base/char-ini.lua +++ b/tex/context/base/char-ini.lua @@ -1236,6 +1236,7 @@ if not characters.superscripts then local superscripts = allocate() characters.superscripts = superscripts local subscripts = allocate() characters.subscripts = subscripts + local fractions = allocate() characters.fractions = fractions -- skipping U+02120 (service mark) U+02122 (trademark) @@ -1255,16 +1256,24 @@ if not characters.superscripts then elseif trace_defining then report_defining("ignoring %s %a, char %c, description %a","subscript",ustring(k),k,v.description) end + elseif what == "fraction" then + if #specials > 1 then + fractions[k] = { unpack(specials,2) } + elseif trace_defining then + report_defining("ignoring %s %a, char %c, description %a","fraction",ustring(k),k,v.description) + end end end end -- print(table.serialize(superscripts, "superscripts", { hexify = true })) -- print(table.serialize(subscripts, "subscripts", { hexify = true })) + -- print(table.serialize(fractions, "fractions", { hexify = true })) if storage then storage.register("characters/superscripts", superscripts, "characters.superscripts") storage.register("characters/subscripts", subscripts, "characters.subscripts") + storage.register("characters/fractions", fractions, "characters.fractions") end end diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 93f95a7df..2b7028e33 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{2015.04.17 02:03} +\newcontextversion{2015.04.18 14:41} %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 fb33b3fd5..9aee6f9bf 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 5f3187eee..034b403c4 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -39,7 +39,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2015.04.17 02:03} +\edef\contextversion{2015.04.18 14:41} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/font-chk.lua b/tex/context/base/font-chk.lua index a3ac8f20e..41205ce5e 100644 --- a/tex/context/base/font-chk.lua +++ b/tex/context/base/font-chk.lua @@ -226,6 +226,28 @@ function commands.getplaceholderchar(name) context(helpers.getprivatenode(fontdata[id],name)) end +local function placeholder(font,char) + local tfmdata = fontdata[font] + local properties = tfmdata.properties + local privates = properties.privates + local category = chardata[char].category + local fakechar = mapping[category] + local p = privates and privates[fakechar] + if not p then + addmissingsymbols(tfmdata) + p = properties.privates[fakechar] + end + if properties.lateprivates then + -- frozen already + return "node", getprivatenode(tfmdata,fakechar) + else + -- good, we have \definefontfeature[default][default][missing=yes] + return "char", p + end +end + +checkers.placeholder = placeholder + function checkers.missing(head) local lastfont, characters, found = nil, nil, nil head = tonut(head) @@ -259,27 +281,15 @@ function checkers.missing(head) end elseif action == "replace" then for i=1,#found do - local n = found[i] - local font = getfont(n) - local char = getchar(n) - local tfmdata = fontdata[font] - local properties = tfmdata.properties - local privates = properties.privates - local category = chardata[char].category - local fakechar = mapping[category] - local p = privates and privates[fakechar] - if not p then - addmissingsymbols(tfmdata) - p = properties.privates[fakechar] - end - if properties.lateprivates then -- .frozen - -- bad, we don't have them at the tex end - local fake = getprivatenode(tfmdata,fakechar) - insert_node_after(head,n,fake) - head = remove_node(head,n,true) + local node = found[i] + local kind, char = placeholder(getfont(node),getchar(node)) + if kind == "node" then + insert_node_after(head,node,tonut(char)) + head = remove_node(head,node,true) + elseif kind == "char" then + setfield(node,"char",char) else - -- good, we have \definefontfeature[default][default][missing=yes] - setfield(n,"char",p) + -- error end end else @@ -288,13 +298,17 @@ function checkers.missing(head) return tonode(head), false end -local relevant = { "missing (will be deleted)", "missing (will be flagged)", "missing" } +local relevant = { + "missing (will be deleted)", + "missing (will be flagged)", + "missing" +} -function checkers.getmissing(id) +local function getmissing(id) if id then - local list = checkers.getmissing(font.current()) + local list = getmissing(font.current()) if list then - local _, list = next(checkers.getmissing(font.current())) + local _, list = next(getmissing(font.current())) return list else return { } @@ -324,6 +338,8 @@ function checkers.getmissing(id) end end +checkers.getmissing = getmissing + local tracked = false trackers.register("fonts.missing", function(v) diff --git a/tex/context/base/font-ext.lua b/tex/context/base/font-ext.lua index 2ef79f8c2..b7817c140 100644 --- a/tex/context/base/font-ext.lua +++ b/tex/context/base/font-ext.lua @@ -904,8 +904,11 @@ registerotffeature { -- a handy helper (might change or be moved to another namespace) -local new_special = nodes.pool.special -local new_glyph = nodes.pool.glyph +local nodepool = nodes.pool + +local new_special = nodepool.special +local new_glyph = nodepool.glyph +local new_rule = nodepool.rule local hpack_node = node.hpack local helpers = fonts.helpers @@ -941,13 +944,13 @@ local function getprivatenode(tfmdata,name) if privates then local p = privates[name] if p then - local char = tfmdata.characters[p] + local char = tfmdata.characters[p] local commands = char.commands if commands then - local fake = hpack_node(new_special(commands[1][2])) - fake.width = char.width + local fake = hpack_node(new_special(commands[1][2])) + fake.width = char.width fake.height = char.height - fake.depth = char.depth + fake.depth = char.depth return fake else -- todo: set current attribibutes diff --git a/tex/context/base/luat-ini.mkiv b/tex/context/base/luat-ini.mkiv index 22f96cd7c..b455a4158 100644 --- a/tex/context/base/luat-ini.mkiv +++ b/tex/context/base/luat-ini.mkiv @@ -125,7 +125,7 @@ \def\setdocumentargument #1#2{\clf_setdocumentargument{#1}{#2}} \def\setdocumentargumentdefault#1#2{\clf_setdocumentdefaultargument{#1}{#2}} \def\getdocumentfilename #1{\clf_getdocumentfilename\numexpr#1\relax} -\def\getdocumentargument #1{\clf_getdocumentargument{#1}} +\def\getdocumentargument #1{\clf_getdocumentargument{#1}{}} \def\setdocumentargument #1#2{\clf_setdocumentargument{#1}{#2}} \def\getdocumentargumentdefault#1#2{\clf_getdocumentargument{#1}{#2}} diff --git a/tex/context/base/math-noa.lua b/tex/context/base/math-noa.lua index 0670b3529..893ee6f48 100644 --- a/tex/context/base/math-noa.lua +++ b/tex/context/base/math-noa.lua @@ -525,11 +525,14 @@ end -- normalize scripts local unscript = { } noads.processors.unscript = unscript +local checkers = { } noads.processors.checkers = checkers local superscripts = characters.superscripts local subscripts = characters.subscripts +local fractions = characters.fractions local replaced = { } +local unknowns = { } local function replace(pointer,what,n,parent) pointer = parent -- we're following the parent list (chars trigger this) @@ -608,22 +611,83 @@ 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") return true end -statistics.register("math script replacements", function() - if next(replaced) then +local function collected(list) + if list and next(list) then local n, t = 0, { } - for k, v in table.sortedpairs(replaced) do + for k, v in table.sortedpairs(list) do n = n + v t[#t+1] = formatters["%C"](k) end return formatters["% t (n=%s)"](t,n) end +end + +statistics.register("math script replacements", function() + return collected(replaced) +end) + +statistics.register("unknown math characters", function() + return collected(unknowns) end) -- math alternates: (in xits lgf: $ABC$ $\cal ABC$ $\mathalternate{cal}\cal ABC$) diff --git a/tex/context/base/mtx-context-arrange.tex b/tex/context/base/mtx-context-arrange.tex index 39373f0e2..fb53406d8 100644 --- a/tex/context/base/mtx-context-arrange.tex +++ b/tex/context/base/mtx-context-arrange.tex @@ -31,6 +31,7 @@ % % end help + \input mtx-context-common.tex \doifdocumentargument {paperoffset} { @@ -46,6 +47,7 @@ \setdocumentargument{sided}{singlesided} } + \setuppapersize [\getdocumentargument{paperformat_paper}] [\getdocumentargument{paperformat_print}] @@ -95,16 +97,17 @@ \starttext \startluacode - local format = string.format - local fprint = function(...) tex.sprint(tex.ctxcatcodes,format(...)) end - - if #document.files > 0 then - if document.arguments.sort then - table.sort(document.files) + local arguments = document.arguments + local files = document.files + local noffiles = #files + if noffiles > 0 then + if arguments.sort then + table.sort(files) end - local emptypages = document.arguments.addempty or "" - local textwidth = document.arguments.textwidth or "0cm" - for _, filename in ipairs(document.files) do + local emptypages = arguments.addempty or "" + local textwidth = arguments.textwidth or "0cm" + for i=1,noffiles do + local filename = files[i] if not string.find(filename,"^mtx%-context%-") then context.insertpages ( { filename }, @@ -114,7 +117,7 @@ end end else - fprint("no files given") + context("no files given") end \stopluacode diff --git a/tex/context/base/page-mix.lua b/tex/context/base/page-mix.lua index 474d010bf..2bf89f737 100644 --- a/tex/context/base/page-mix.lua +++ b/tex/context/base/page-mix.lua @@ -245,16 +245,16 @@ local function preparesplit(specification) -- a rather large function return end slidenodes(head) -- we can have set prev's to nil to prevent backtracking - local discarded = { } - local originalhead = head - local originalwidth = specification.originalwidth or getfield(list,"width") + local discarded = { } + local originalhead = head + local originalwidth = specification.originalwidth or getfield(list,"width") local originalheight = specification.originalheight or getfield(list,"height") - local current = head - local skipped = 0 - local height = 0 - local depth = 0 - local skip = 0 - local splitmethod = specification.splitmethod or false + local current = head + local skipped = 0 + local height = 0 + local depth = 0 + local skip = 0 + local splitmethod = specification.splitmethod or false if splitmethod == v_none then splitmethod = false end @@ -434,6 +434,7 @@ local function preparesplit(specification) -- a rather large function local function checked(advance,where,locked) local total = skip + height + depth + advance local delta = total - target +-- - 65536*3 local state = "same" local okay = false local skipped = 0 diff --git a/tex/context/base/page-one.mkiv b/tex/context/base/page-one.mkiv index 196f6e5a2..4cf59da2d 100644 --- a/tex/context/base/page-one.mkiv +++ b/tex/context/base/page-one.mkiv @@ -454,10 +454,13 @@ \fi\fi \fi} + \def\page_one_place_float_here_indeed - {%\ifgridsnapping \else - \baselinecorrection - %\fi + {\ifgridsnapping + % otherwise real bad outcome + \else + \baselinecorrection % this has to be done better (and definitely not in column mode) + \fi \doplacefloatbox \page_floats_report_total \dohandlenextfloatindent} diff --git a/tex/context/base/publ-imp-apa.mkvi b/tex/context/base/publ-imp-apa.mkvi index a6b9ffa70..a1814b0a4 100644 --- a/tex/context/base/publ-imp-apa.mkvi +++ b/tex/context/base/publ-imp-apa.mkvi @@ -65,6 +65,8 @@ \c!separator:names:3={,\nobreakspace\textampersand\space}, % comma separated list \c!separator:names:4={\nobreakspace\textampersand\space}] % last of two, no comma! +% First, we define a namespace for a few special fields + \definebtx [apa:list:author] [apa:list] @@ -93,6 +95,8 @@ [apa:list:short] [apa:list] +% Next, we define a namespace for each category + %D In order to be able to get journals expanded (or normalized or abbreviated) you need %D to load a list: %D @@ -100,7 +104,6 @@ %D \btxloadjournallist[journals.txt] % the jabref list %D \stoptyping -% TODO \definebtx [apa:list:journal] @@ -198,6 +201,14 @@ [apa:list:title] \definebtx + [apa:list:title:music] + [apa:list:title] + +\definebtx + [apa:list:title:film] + [apa:list:title] + +\definebtx [apa:list:title:other] [apa:list:title] @@ -282,10 +293,8 @@ \c!right={]\poppunctuation}] \definebtx - [apa:cite:author:year] % todo - [apa:cite:authoryear] - [\c!left=(, - \c!right=)] + [apa:cite:author:year] % todo + [apa:cite] \definebtx [apa:cite:author:years] % todo @@ -410,6 +419,8 @@ \c!separator:3=\btxparameter{\c!separator:2}, \c!separator:4=\btxparameter{\c!separator:2}] +% Now we setup for the details of the renderings + %D Sometimes we have verbose injections in an entry and these can be language %D dependent, so we use labels. %D @@ -601,6 +612,8 @@ % cite setups +% The following differs from the default returning n.d. if year is empty + \startsetups btx:apa:cite:author:year \texdefinition{\s!btx:\s!cite:concat} \btxparameter\c!left @@ -630,6 +643,8 @@ \fastsetup{btx:apa:cite:author:year} \stopsetups +% The following differs from the default by including the labels p. and pp. + \startsetups btx:apa:page:list \fastsetup{\s!btx:\s!page:concat} \ifx\currentbtxlastpage\empty @@ -666,7 +681,7 @@ % It can be removed using the command: % \resetsetups [apa:list:sameauthor] -% Or texdefinition? +% :rule, :empty or :ditto ... \startsetups apa:list:sameauthor \fastsetup{apa:list:sameauthor:rule} @@ -678,6 +693,7 @@ \c!height=1.5\linewidth]% \linewidth is just too thin with respect to font strokes... \stopsetups + \startsetups [apa:list:sameauthor:\v!empty] \kern\dimexpr\listparameter\c!margin-\interwordspace\relax \stopsetups diff --git a/tex/context/base/publ-imp-aps.mkvi b/tex/context/base/publ-imp-aps.mkvi index 2b3da954e..3bc2a1d21 100644 --- a/tex/context/base/publ-imp-aps.mkvi +++ b/tex/context/base/publ-imp-aps.mkvi @@ -78,16 +78,31 @@ [aps:list:invertedshort] [aps:list] +% This is for numbering=num + \definebtx - [aps:list:short] + [aps:list:num] [aps:list] + [left={[}, + right={]}] % This is for numbering=yes + \definebtx [aps:list:yes] - [aps:list] - [left={[}, - right={]}] + [aps:list:num] + +% This is for numbering=short + +\definebtx + [aps:list:short] + [aps:list:num] + +% This is for numbering=bib + +\definebtx + [aps:list:bib] + [aps:list:num] %D In order to be able to get journals expanded (or normalized or abbreviated) you need %D to load a list: diff --git a/tex/context/base/publ-imp-cite.mkvi b/tex/context/base/publ-imp-cite.mkvi index d763c2d4f..dfc16c795 100644 --- a/tex/context/base/publ-imp-cite.mkvi +++ b/tex/context/base/publ-imp-cite.mkvi @@ -140,8 +140,9 @@ \currentbtxrighttext \stopsetups -\startsetups btx:cite:range +\startsetups btx:cite:author \texdefinition{\s!btx:\s!cite:concat} + \btxparameter\c!left \currentbtxlefttext \ifx\currentbtxfirst\empty \fastsetup{\s!btx:\s!cite:\s!empty} @@ -149,54 +150,57 @@ \texdefinition {\s!btx:\s!cite:inject} { \btxcitereference \currentbtxfirst - \ifx\currentbtxsecond\empty \else - \btxparameter\c!range - \currentbtxsecond - \fi - \ifx\currentbtxthird\empty \else - \currentbtxthird - \fi + } + \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 } \fi \currentbtxrighttext + \btxparameter\c!right \stopsetups -\startsetups btx:cite:listelement +\startsetups btx:cite:range \texdefinition{\s!btx:\s!cite:concat} \currentbtxlefttext \ifx\currentbtxfirst\empty \fastsetup{\s!btx:\s!cite:\s!empty} \else - \texdefinition {\s!btx:\s!cite:inject} { - \btxcitereference - \currentbtxfirst - } + \texdefinition {\s!btx:\s!cite:inject} { + \btxcitereference + \btxusecommand[\currentbtxspecification:cite:\currentbtxcitealternative] { + \currentbtxfirst + \ifx\currentbtxsecond\empty \else + \btxparameter\c!range + \currentbtxsecond + \fi + \ifx\currentbtxthird\empty \else + \currentbtxthird + \fi + } + } \fi \currentbtxrighttext \stopsetups -\startsetups btx:cite:author +\startsetups btx:cite:listelement \texdefinition{\s!btx:\s!cite:concat} \currentbtxlefttext \ifx\currentbtxfirst\empty \fastsetup{\s!btx:\s!cite:\s!empty} \else - \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 - } + \texdefinition {\s!btx:\s!cite:inject} { + \btxcitereference + \currentbtxfirst + } \fi \currentbtxrighttext \stopsetups @@ -208,39 +212,85 @@ \currentbtxrighttext \stopsetups -% these three are goodies to get something bit are not set up as it makes no +% these three are goodies to get something but are not set up as it makes no % sense to have something root for combinations like this (esp not because one % gets default anyway -\startsetups btx:cite:authoryear - \fastsetup{btx:cite:author} +% AB: not so sure about that. Why define them in default rather than here? + +\startsetups \s!btx:\s!cite:authoryear + \fastsetup{\s!btx:\s!cite:author} \stopsetups -\startsetups btx:cite:authoryears - \fastsetup{btx:cite:author} +\startsetups \s!btx:\s!cite:authoryears + \fastsetup{\s!btx:\s!cite:authoryear} \stopsetups -\startsetups btx:cite:authornum - \fastsetup{btx:cite:author} +\startsetups \s!btx:\s!cite:authornum + \fastsetup{\s!btx:\s!cite:authoryear} \stopsetups -\startsetups btx:cite:authorref - \ifx{\btxparameter\c!alternative}{authoryear} - \fastsetup{btx:cite:authoryears} +\startsetups \s!btx:\s!cite:authorref + \ifx{\\s!btxparameter\c!alternative}{authoryear} + \fastsetup{\s!btx:\s!cite:authoryears} \else\ifx{\btxparameter\c!alternative}{num} - \fastsetup{btx:cite:authornum} + \fastsetup{\s!btx:\s!cite:authornum} \else - \fastsetup{btx:cite:author} + \fastsetup{\s!btx:\s!cite:author} \fi\fi \stopsetups -\startsetups btx:cite:num - \fastsetup{btx:cite:range} +\startsetups \s!btx:\s!cite:num + \fastsetup{\s!btx:\s!cite:range} +\stopsetups +\startsetups \s!btx:\s!cite:default + \fastsetup{\s!btx:\s!cite:num} +\stopsetups +\startsetups \s!btx:\s!cite:textnum + \fastsetup{\s!btx:\s!cite:num} +\stopsetups +\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 +\startsetups \s!btx:\s!cite:author:year + \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 + \fastsetup{\s!btx:\s!cite:range} +\stopsetups +\startsetups \s!btx:\s!cite:tag + \fastsetup{\s!btx:\s!cite:normal} +\stopsetups +\startsetups \s!btx:\s!cite:key + \fastsetup{\s!btx:\s!cite:normal} +\stopsetups +\startsetups \s!btx:\s!cite:category + \fastsetup{\s!btx:\s!cite:normal} +\stopsetups + +% the following correspond to fields, but can be used in many renderings + +\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 btx:cite:default - \fastsetup{btx:cite:num} +\startsetups \s!btx:\s!cite:title + \fastsetup{\s!btx:\s!cite:normal} \stopsetups -\startsetups btx:cite:textnum - \fastsetup{btx:cite:num} +\startsetups \s!btx:\s!cite:pages + \fastsetup{\s!btx:\s!cite:range} \stopsetups -\startsetups btx:cite:year - \fastsetup{btx:cite:range} +\startsetups \s!btx:\s!cite:page + \fastsetup{\s!btx:\s!cite:normal} \stopsetups % the following is kind of specific, but can be used in many renderings diff --git a/tex/context/base/publ-imp-default.mkvi b/tex/context/base/publ-imp-default.mkvi index a78769849..49a0b9eae 100644 --- a/tex/context/base/publ-imp-default.mkvi +++ b/tex/context/base/publ-imp-default.mkvi @@ -488,106 +488,107 @@ %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 - -\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 +% \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/tex/context/base/publ-imp-list.mkvi b/tex/context/base/publ-imp-list.mkvi index 4c238aa95..e13294f6f 100644 --- a/tex/context/base/publ-imp-list.mkvi +++ b/tex/context/base/publ-imp-list.mkvi @@ -50,36 +50,41 @@ } \stopsetups -\startsetups \s!btx:\s!list:yes - \btxstartstyleandcolor [\currentbtxspecification:list:yes] - \btxusecommand[\currentbtxspecification:list:yes] { - \btxparameter\c!left - \texdefinition {\s!btx:\s!list:inject} { - \currentbtxfirst - \btxparameter\c!stopper - } - \btxparameter\c!right - } - \btxstopstyleandcolor -\stopsetups - -\startsetups \s!btx:\s!list:num +\startsetups \s!btx:\s!list:numbering + \btxparameter\c!left \texdefinition {\s!btx:\s!list:inject} { \currentbtxfirst + \btxparameter\c!stopper } + \btxparameter\c!right \stopsetups -\startsetups \s!btx:\s!list:bib - \texdefinition {\s!btx:\s!list:inject} { - \currentbtxfirst - } +\startsetups \s!btx:\s!list:num + \btxstartstyleandcolor [\currentbtxspecification:list:num] + \btxusecommand[\currentbtxspecification:list:num] { + \fastsetup{\s!btx:\s!list:numbering} + } + \btxstopstyleandcolor +\stopsetups + +\startsetups \s!btx:\s!list:yes + \fastsetup{\s!btx:\s!list:num} \stopsetups \startsetups \s!btx:\s!list:short - \texdefinition {\s!btx:\s!list:inject} { - \currentbtxfirst - \currentbtxsecond - } + \btxstartstyleandcolor [\currentbtxspecification:list:short] + \btxusecommand[\currentbtxspecification:list:short] { + \fastsetup{\s!btx:\s!list:numbering} + } + \btxstopstyleandcolor +\stopsetups + +\startsetups \s!btx:\s!list:bib + \btxstartstyleandcolor [\currentbtxspecification:list:bib] + \btxusecommand[\currentbtxspecification:list:bib] { + \fastsetup{\s!btx:\s!list:numbering} + } + \btxstopstyleandcolor \stopsetups \protect diff --git a/tex/context/base/publ-ini.lua b/tex/context/base/publ-ini.lua index 2855399db..25397727b 100644 --- a/tex/context/base/publ-ini.lua +++ b/tex/context/base/publ-ini.lua @@ -122,6 +122,7 @@ local ctx_btxsetlanguage = context.btxsetlanguage local ctx_btxsetcombis = context.btxsetcombis local ctx_btxsetcategory = context.btxsetcategory local ctx_btxcitesetup = context.btxcitesetup +local ctx_btxsubcitesetup = context.btxsubcitesetup local ctx_btxpagesetup = context.btxpagesetup local ctx_btxsetfirst = context.btxsetfirst local ctx_btxsetsecond = context.btxsetsecond @@ -2861,7 +2862,7 @@ do if trace_detail then report("expanding %a cite setup %a","multiple author",setup) end - ctx_btxcitesetup(setup) + ctx_btxsubcitesetup(setup) ctx_btxstopciteauthor() end end @@ -3036,7 +3037,7 @@ do if trace_detail then report("expanding %a list setup %a","default",variant) end - ctx_btxlistsetup(variant) + ctx_btxlistsetup("default") end function listvariants.num(dataset,block,tag,variant,listindex) diff --git a/tex/context/base/publ-ini.mkiv b/tex/context/base/publ-ini.mkiv index c63fa7ed9..a4452e451 100644 --- a/tex/context/base/publ-ini.mkiv +++ b/tex/context/base/publ-ini.mkiv @@ -482,7 +482,7 @@ %D Tracing -\newconditional\c_btx_trace +\newconditional\c_btx_trace % not used yet \installtextracker {btxrendering} @@ -592,7 +592,8 @@ \endgroup} \unexpanded\def\btxpagesetup - {\fastbtxsetup\s!page\s!list + {\btxsetuptype\plusfour + \fastbtxsetup\s!page\s!list \btxpagereset} % end of page stuff @@ -607,6 +608,7 @@ \begingroup \usebtxstyleandcolor\c!style\c!color \ignorespaces + \btxsetuptype\plusthree \fastbtxsetup\s!list\currentbtxcategory \removeunwantedspaces \endgroup @@ -638,6 +640,7 @@ {\begingroup \def\currentbtxtag{#1}% \ignorespaces + \btxsetuptype\plusthree \fastbtxsetup\s!list\currentbtxcategory \removeunwantedspaces \endgroup} @@ -831,6 +834,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}} \appendtoks @@ -991,7 +995,7 @@ {\currentbtxdataset}% {\currentbtxtag}% {\currentbtxfield}% - { + {% combiner {#1}% kind {list}% etallimit {\btxparameter\c!etallimit}% @@ -1016,7 +1020,7 @@ {\currentbtxdataset}% {\currentbtxtag}% {\s!author}% - { + {% combiner {\btxparameter\c!authorconversion}% kind {cite}% etallimit {\btxparameter\c!etallimit}% @@ -1327,27 +1331,23 @@ \let\publ_fastbtxsetup_normal\fastbtxsetup -% \unexpanded\def\publ_fastbtxsetup_chain_yes#1#2% -% {\inframed[\c!foregroundstyle=\infofont]{% -% \currentbtxspecification :#1:#2\ifcsname\??setup:\s!btx:\currentbtxspecification :#1:#2\endcsname\else->% -% \currentbtxspecificationfallback:#1:#2\ifcsname\??setup:\s!btx:\currentbtxspecificationfallback :#1:#2\endcsname\else->% -% #1:#2\ifcsname\??setup:\s!btx :#1:#2\endcsname\else->% -% \currentbtxspecification :#1:\s!unknown\ifcsname\??setup:\s!btx:\currentbtxspecification :#1:\s!unknown\endcsname\else->% -% \currentbtxspecificationfallback:#1:\s!unknown\ifcsname\??setup:\s!btx:\currentbtxspecificationfallback:#1:\s!unknown\endcsname\else->% -% ?\fi\fi\fi\fi\fi}} - -% \unexpanded\def\publ_fastbtxsetup_chain_nop#1#2% -% {\inframed[\c!foregroundstyle=\infofont]{% -% \currentbtxspecification :#1:#2\ifcsname\??setup:\s!btx:\currentbtxspecification :#1:#2\endcsname\else->% -% #1:#2\ifcsname\??setup:\s!btx :#1:#2\endcsname\else->% -% \currentbtxspecification :#1:\s!unknown\ifcsname\??setup:\s!btx:\currentbtxspecification :#1:\s!unknown\endcsname\else->% -% ?\fi\fi\fi}} +\newconstant\btxsetuptype + +% 0 = unknown darkred +% 1 = cite darkblue +% 2 = subcite darkgreen +% 3 = list darkcyan +% 4 = page darkmagenta +% 5 = unknown darkred \unexpanded\def\publ_fastbtxsetup_chain_inbetween {\allowbreak->\allowbreak} \unexpanded\def\publ_fastbtxsetup_chain_yes#1#2% - {\dontleavehmode\begingroup\infofont\darkblue[% + {\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 \currentbtxspecificationfallback:#1:#2\ifcsname\??setup:\s!btx:\currentbtxspecificationfallback :#1:#2\endcsname\else @@ -1359,10 +1359,14 @@ \currentbtxspecificationfallback:#1:\s!unknown\ifcsname\??setup:\s!btx:\currentbtxspecificationfallback:#1:\s!unknown\endcsname\else \publ_fastbtxsetup_chain_inbetween unset\fi\fi\fi\fi\fi - ]\endgroup} + ]% + \endgroup} \unexpanded\def\publ_fastbtxsetup_chain_nop#1#2% - {\dontleavehmode\begingroup\infofont\darkred[% + {\dontleavehmode\begingroup + \infofont + \darkred + [% \currentbtxspecification :#1:#2\ifcsname\??setup:\s!btx:\currentbtxspecification :#1:#2\endcsname\else \publ_fastbtxsetup_chain_inbetween #1:#2\ifcsname\??setup:\s!btx :#1:#2\endcsname\else @@ -1370,7 +1374,8 @@ \currentbtxspecification :#1:\s!unknown\ifcsname\??setup:\s!btx:\currentbtxspecification :#1:\s!unknown\endcsname\else \publ_fastbtxsetup_chain_inbetween unset\fi\fi\fi - ]\endgroup} + ]% + \endgroup} \unexpanded\def\publ_fastbtxsetup_chain {\ifx\currentbtxspecificationfallback\empty @@ -1396,15 +1401,15 @@ \setfalse\c_btx_cite_reference_injected \to \everybtxciteentry -% \unexpanded\def\btxcitesetup#1% -% {\the\everybtxciteentry -% \everybtxciteentry\emptytoks % tricky maybe not when subcites -% \currentbtxlefttext -% \fastbtxsetup\s!cite{#1}% -% \currentbtxrighttext} % no \btxcitereset as we loose dataset and such - \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 + +\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 diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex aca61ed08..dc228ad8a 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 cbd2c0acb..02c9447e8 100644 --- a/tex/context/base/status-lua.pdf +++ b/tex/context/base/status-lua.pdf diff --git a/tex/context/base/strc-lst.mkvi b/tex/context/base/strc-lst.mkvi index afbfdab31..556d2ab48 100644 --- a/tex/context/base/strc-lst.mkvi +++ b/tex/context/base/strc-lst.mkvi @@ -1267,7 +1267,12 @@ \hskip-\leftskip \ifconditional\c_lists_has_number \ifconditional\c_lists_show_number - \setbox\scratchbox\simplealignedbox\scratchwidth{\usealignparameter\c!numberalign} + \setbox\scratchbox + \ifzeropt\scratchwidth + \hbox + \else + \simplealignedbox\scratchwidth{\listparameter\c!numberalign} + \fi \bgroup \useliststyleandcolor\c!numberstyle\c!numbercolor \currentlistsymbol diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 9c644c813..1d6509ae4 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 : 04/17/15 02:03:30 +-- merge date : 04/18/15 14:41:50 do -- begin closure to overcome local limits and interference |