From c04128ed1939673afac90a58753048653c6faedd Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Fri, 30 May 2014 12:15:14 +0200 Subject: 2014-05-30 11:44:00 --- scripts/context/lua/mtxrun.lua | 12 +-- scripts/context/stubs/mswin/mtxrun.lua | 12 +-- scripts/context/stubs/unix/mtxrun | 12 +-- scripts/context/stubs/win64/mtxrun.lua | 12 +-- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4280 -> 4323 bytes tex/context/base/context.mkiv | 2 +- tex/context/base/lpdf-tag.lua | 2 +- tex/context/base/math-tag.lua | 2 +- tex/context/base/mult-mes.lua | 9 ++ tex/context/base/publ-imp-apa.mkvi | 4 +- tex/context/base/publ-imp-cite.mkiv | 109 +++++++++------------ tex/context/base/publ-ini.lua | 11 ++- tex/context/base/publ-ini.mkiv | 52 ++++++++-- tex/context/base/sort-ini.lua | 10 +- tex/context/base/status-files.pdf | Bin 24642 -> 24912 bytes tex/context/base/status-lua.pdf | Bin 244897 -> 246731 bytes tex/context/base/strc-tag.lua | 2 +- tex/context/base/util-str.lua | 15 ++- tex/generic/context/luatex/luatex-fonts-merged.lua | 8 +- 20 files changed, 156 insertions(+), 120 deletions(-) diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 7ce14a23c..c31468122 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -4871,7 +4871,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 33063, stripped down to: 18397 +-- original size: 33334, stripped down to: 18384 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -5184,12 +5184,12 @@ local format_f=function(f) n=n+1 return format("format('%%%sf',a%s)",f,n) end -local format_F=function(f) +local format_F=function() n=n+1 if not f or f=="" then - return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n) + return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or format((a%s %% 1 == 0) and '%%i' or '%%.9f',a%s))",n,n,n,n) else - return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n) + return format("format((a%s %% 1 == 0) and '%%i' or '%%%sf',a%s)",n,f,n) end end local format_g=function(f) @@ -16893,8 +16893,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 695739 --- stripped bytes : 247051 +-- original bytes : 696010 +-- stripped bytes : 247335 -- end library merge diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 7ce14a23c..c31468122 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -4871,7 +4871,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 33063, stripped down to: 18397 +-- original size: 33334, stripped down to: 18384 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -5184,12 +5184,12 @@ local format_f=function(f) n=n+1 return format("format('%%%sf',a%s)",f,n) end -local format_F=function(f) +local format_F=function() n=n+1 if not f or f=="" then - return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n) + return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or format((a%s %% 1 == 0) and '%%i' or '%%.9f',a%s))",n,n,n,n) else - return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n) + return format("format((a%s %% 1 == 0) and '%%i' or '%%%sf',a%s)",n,f,n) end end local format_g=function(f) @@ -16893,8 +16893,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 695739 --- stripped bytes : 247051 +-- original bytes : 696010 +-- stripped bytes : 247335 -- end library merge diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 7ce14a23c..c31468122 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -4871,7 +4871,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 33063, stripped down to: 18397 +-- original size: 33334, stripped down to: 18384 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -5184,12 +5184,12 @@ local format_f=function(f) n=n+1 return format("format('%%%sf',a%s)",f,n) end -local format_F=function(f) +local format_F=function() n=n+1 if not f or f=="" then - return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n) + return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or format((a%s %% 1 == 0) and '%%i' or '%%.9f',a%s))",n,n,n,n) else - return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n) + return format("format((a%s %% 1 == 0) and '%%i' or '%%%sf',a%s)",n,f,n) end end local format_g=function(f) @@ -16893,8 +16893,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 695739 --- stripped bytes : 247051 +-- original bytes : 696010 +-- stripped bytes : 247335 -- end library merge diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua index 7ce14a23c..c31468122 100644 --- a/scripts/context/stubs/win64/mtxrun.lua +++ b/scripts/context/stubs/win64/mtxrun.lua @@ -4871,7 +4871,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 33063, stripped down to: 18397 +-- original size: 33334, stripped down to: 18384 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -5184,12 +5184,12 @@ local format_f=function(f) n=n+1 return format("format('%%%sf',a%s)",f,n) end -local format_F=function(f) +local format_F=function() n=n+1 if not f or f=="" then - return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n) + return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or format((a%s %% 1 == 0) and '%%i' or '%%.9f',a%s))",n,n,n,n) else - return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n) + return format("format((a%s %% 1 == 0) and '%%i' or '%%%sf',a%s)",n,f,n) end end local format_g=function(f) @@ -16893,8 +16893,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 695739 --- stripped bytes : 247051 +-- original bytes : 696010 +-- stripped bytes : 247335 -- end library merge diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 323002aeb..c91371b68 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.29 23:35} +\newcontextversion{2014.05.30 11:42} %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 index bb2ed684d..a6d3cdd0a 100644 Binary files a/tex/context/base/context-version.pdf and b/tex/context/base/context-version.pdf differ diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 92ba1b9a7..456ad8145 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.29 23:35} +\edef\contextversion{2014.05.30 11:42} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/lpdf-tag.lua b/tex/context/base/lpdf-tag.lua index 276816e80..22d20784e 100644 --- a/tex/context/base/lpdf-tag.lua +++ b/tex/context/base/lpdf-tag.lua @@ -96,7 +96,7 @@ local function finishstructure() if #structure_kids > 0 then local nums, n = pdfarray(), 0 for i=1,#tree do - n = n + 1 ; nums[n] = i-1 + n = n + 1 ; nums[n] = i - 1 n = n + 1 ; nums[n] = pdfreference(pdfflushobject(tree[i])) end local parenttree = pdfdictionary { diff --git a/tex/context/base/math-tag.lua b/tex/context/base/math-tag.lua index 3cd4cae16..77c182942 100644 --- a/tex/context/base/math-tag.lua +++ b/tex/context/base/math-tag.lua @@ -304,7 +304,7 @@ process = function(start) -- we cannot use the processor as we have no finalizer local left = getfield(start,"left") local degree = getfield(start,"degree") if left then - start_tagged("") + start_tagged("ignore") process(left) -- root symbol, ignored stop_tagged() end diff --git a/tex/context/base/mult-mes.lua b/tex/context/base/mult-mes.lua index 0affb43d6..a1a990532 100644 --- a/tex/context/base/mult-mes.lua +++ b/tex/context/base/mult-mes.lua @@ -1002,6 +1002,15 @@ return { ["publications:11"] = { en = "unknown command %a", }, + ["publications:12"] = { + en = "missing setup: %s", + }, + ["publications:13"] = { + en = "no field %a for tag %a", + }, + ["publications:14"] = { + en = "unknown rendering alternative %a", + }, ["pushing level: %a"] = { nl = "niveau omhoog: %a", }, diff --git a/tex/context/base/publ-imp-apa.mkvi b/tex/context/base/publ-imp-apa.mkvi index aa7f6ce6b..4d4edfc52 100644 --- a/tex/context/base/publ-imp-apa.mkvi +++ b/tex/context/base/publ-imp-apa.mkvi @@ -19,6 +19,8 @@ %D Sometimes we have verbose injections in an entry and these can be language %D dependent, so we use labels. +\startbtxrenderingdefinitions[apa] + %D The variables control the shared code for which we use a tex definition with %D one argument, specifying the field name. @@ -675,4 +677,4 @@ \texdefinition{btx:apa:note} \stopsetups -\endinput +\stopbtxrenderingdefinitions diff --git a/tex/context/base/publ-imp-cite.mkiv b/tex/context/base/publ-imp-cite.mkiv index 1b3157b4b..d758675fa 100644 --- a/tex/context/base/publ-imp-cite.mkiv +++ b/tex/context/base/publ-imp-cite.mkiv @@ -21,24 +21,36 @@ % This saves keying: +\startsetups [\s!btx:\s!cite:\s!unknown] + \begingroup + \showmessage\m!publications{13}{\currentbtxcitevariant,\currentbtxtag} + \tttf + <\currentbtxcitevariant:\currentbtxtag> + \endgroup +\stopsetups + \startsetups \s!btx:\s!cite:common:normal - \ifx\currentbtxsecond\empty + \ifx\currentbtxfirst\empty + \directsetup{\s!btx:\s!cite:\s!unknown} + \else\ifx\currentbtxsecond\empty \currentbtxfirst \else \currentbtxfirst \btxcitevariantparameter\v!inbetween \currentbtxsecond - \fi + \fi\fi \stopsetups \startsetups \s!btx:\s!cite:common:range - \ifx\currentbtxsecond\empty + \ifx\currentbtxfirst\empty + \directsetup{\s!btx:\s!cite:\s!unknown} + \else\ifx\currentbtxsecond\empty \currentbtxfirst \else \currentbtxfirst \btxcitevariantparameter\c!range \currentbtxsecond - \fi + \fi\fi \stopsetups \startsetups \s!btx:\s!cite:concat @@ -51,31 +63,15 @@ \fi \stopsetups -% \startsetups \s!btx:\s!cite:render:normal -% \directsetup{\s!btx:\s!cite:concat} -% \ifconditional\btxinteractive -% \goto { -% \btxcitereference -% \directsetup{\s!btx:\s!cite:common:normal} -% } [ -% \s!internal(\currentbtxinternal) -% ] -% \else -% \directsetup{\s!btx:\s!cite:common:normal} -% \fi -% \stopsetups -% -% more efficient (less tokens, less expansion): - \startsetups \s!btx:\s!cite:render:normal \directsetup{\s!btx:\s!cite:concat} - \ifconditional\btxinteractive + \ifx\currentbtxfirst\empty + \directsetup{\s!btx:\s!cite:\s!unknown} + \else\ifconditional\btxinteractive \goto { \btxcitereference - \ifx\currentbtxsecond\empty - \currentbtxfirst - \else - \currentbtxfirst + \currentbtxfirst + \ifx\currentbtxsecond\empty \else \btxcitevariantparameter\v!inbetween \currentbtxsecond \fi @@ -83,41 +79,23 @@ \s!internal(\currentbtxinternal) ] \else - \ifx\currentbtxsecond\empty - \currentbtxfirst - \else - \currentbtxfirst + \currentbtxfirst + \ifx\currentbtxsecond\empty \else \btxcitevariantparameter\v!inbetween \currentbtxsecond \fi - \fi + \fi\fi \stopsetups -% \startsetups \s!btx:\s!cite:render:range -% \directsetup{\s!btx:\s!cite:concat} -% \ifconditional\btxinteractive -% \goto { -% \btxcitereference -% \directsetup{\s!btx:\s!cite:common:range} -% } [ -% \s!internal(\currentbtxinternal) -% ] -% \else -% \directsetup{\s!btx:\s!cite:common:range} -% \fi -% \stopsetups -% -% more efficient (less tokens, less expansion): - \startsetups \s!btx:\s!cite:render:range \directsetup{\s!btx:\s!cite:concat} - \ifconditional\btxinteractive + \ifx\currentbtxfirst\empty + \directsetup{\s!btx:\s!cite:missing} + \else\ifconditional\btxinteractive \goto { \btxcitereference - \ifx\currentbtxsecond\empty - \currentbtxfirst - \else - \currentbtxfirst + \currentbtxfirst + \ifx\currentbtxsecond\empty \else \btxcitevariantparameter\c!range \currentbtxsecond \fi @@ -125,14 +103,12 @@ \s!internal(\currentbtxinternal) ] \else - \ifx\currentbtxsecond\empty - \currentbtxfirst - \else - \currentbtxfirst + \currentbtxfirst + \ifx\currentbtxsecond\empty \else \btxcitevariantparameter\c!range \currentbtxsecond \fi - \fi + \fi\fi \stopsetups \startsetups \s!btx:\s!cite:render:variant @@ -152,11 +128,13 @@ % author lists: can be less \startsetups \s!btx:\s!cite:common:author - \ifx\currentbtxcitevariant\v!normal + \ifx\currentbtxfirst\empty + \directsetup{\s!btx:\s!cite:\s!unknown} + \else\ifx\currentbtxcitevariant\v!normal \currentbtxfirst \else \currentbtxciteauthor - \fi + \fi\fi \ifx\currentbtxsecond\empty \else \btxcitevariantparameter\v!inbetween \currentbtxsecond @@ -233,15 +211,18 @@ \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} + \ifx\currentbtxfirst\empty + \directsetup{\s!btx:\s!cite:\s!unknown} + \else + \hyphenatedurl{\currentbtxfirst} + \fi \stopsetups \startsetups \s!btx:\s!cite:url - \ifconditional\btxinteractive + \ifx\currentbtxfirst\empty + \directsetup{\s!btx:\s!cite:\s!unknown} + \else\ifconditional\btxinteractive \goto { \btxcitereference \hyphenatedurl{\currentbtxfirst} @@ -250,7 +231,7 @@ ] \else \hyphenatedurl{\currentbtxfirst} - \fi + \fi\fi \stopsetups \protect diff --git a/tex/context/base/publ-ini.lua b/tex/context/base/publ-ini.lua index 319d161ae..91ace76fa 100644 --- a/tex/context/base/publ-ini.lua +++ b/tex/context/base/publ-ini.lua @@ -384,7 +384,7 @@ local function findallused(dataset,reference,block,section) return okay, todo, tags end -local function flushcollected(flush,nofcollected) +local function flushcollected(reference,flush,nofcollected) if nofcollected > 0 then flush(1,1) if nofcollected > 2 then @@ -395,6 +395,9 @@ local function flushcollected(flush,nofcollected) elseif nofcollected > 1 then flush(nofcollected,4) end + else + ctx_btxsettag(reference) + ctx_btxcitesetup("unknown") end end @@ -1324,7 +1327,7 @@ local function processcite(dataset,reference,mark,compress,setup,getter,setter,c ctx_btxsetconcat(state) ctx_btxcitesetup(setup) end - flushcollected(flush,#target) + flushcollected(reference,flush,#target) else local function flush(i,state) local entry = source[i] @@ -1348,7 +1351,7 @@ local function processcite(dataset,reference,mark,compress,setup,getter,setter,c end ctx_btxcitesetup(setup) end - flushcollected(flush,#source) + flushcollected(reference,flush,#source) end end if mark then @@ -1667,7 +1670,7 @@ local function authorconcat(target,key,setup) ctx_btxcitesetup(setup) end ctx_btxstartsubcite(setup) - flushcollected(flush,#target) + flushcollected(setup,flush,#target) ctx_btxstopsubcite() end diff --git a/tex/context/base/publ-ini.mkiv b/tex/context/base/publ-ini.mkiv index af8be9fdc..2f25724a0 100644 --- a/tex/context/base/publ-ini.mkiv +++ b/tex/context/base/publ-ini.mkiv @@ -201,6 +201,8 @@ \installcorenamespace {btxrendering} \installcorenamespace {btxcommand} \installcorenamespace {btxnumbering} +\installcorenamespace {btxrenderingdefinition} + \installcommandhandler \??btxdataset {btxdataset} \??btxdataset \installcommandhandler \??btxlistvariant {btxlistvariant} \??btxlistvariant @@ -341,10 +343,12 @@ \dosingleempty\btx_start_rendering} \def\btx_start_rendering[#1]% - {\edef\currentbtxrendering{#1}} + {\edef\currentbtxrendering{#1}% + \btxrenderingparameter\v!before} \unexpanded\def\stopbtxrendering - {\endgroup} + {\btxrenderingparameter\v!after + \endgroup} \unexpanded\def\btxtodo#1% {[#1]} @@ -393,13 +397,22 @@ {\begingroup \edef\currentbtxcategory{\btxfield{category}}% \ignorespaces - \directsetup{\s!btx:\currentbtxalternative:\currentbtxcategory}% + \edef\currentbtxsetup{\s!btx:\currentbtxalternative:\currentbtxcategory}% + \doifsetupselse\currentbtxsetup + \btx_entry_inject_yes + \btx_entry_inject_nop + \endgroup} + +\def\btx_entry_inject_yes + {\directsetup\currentbtxsetup \removeunwantedspaces \ifx\currentbtxcombis\empty \else \btxrenderingparameter\c!separator \processcommacommand[\currentbtxcombis]\btx_entry_inject_combi - \fi - \endgroup} + \fi} + +\def\btx_entry_inject_nop + {\tttf \getmessage\m!publications{12}{\currentbtxsetup}} \def\btx_entry_inject_combi#1% {\begingroup @@ -464,9 +477,9 @@ \def\publ_place_list_indeed {\startbtxrendering[\currentbtxrendering]% - \directsetup{\btxrenderingparameter\c!setups}% + % \directsetup{\btxrenderingparameter\c!setups}% specific initializations % \determinelistcharacteristics[\currentbtxrendering]% - \edef\currentbtxalternative{\btxrenderingparameter\c!alternative}% + \btx_set_rendering_alternative \edef\currentbtxdataset{\btxrenderingparameter\c!dataset}% \let\currentlist\s!btx \let\currentbtxlist\currentbtxrendering @@ -968,6 +981,25 @@ %D Loading variants: +\let\currentbtxrenderingdefinition\empty +\let\currentbtxalternative \empty + +\unexpanded\def\startbtxrenderingdefinitions[#1]% + {\pushmacro\currentbtxrenderingdefinition + \edef\currentbtxrenderingdefinition{#1}% + \letvalue{\??btxrenderingdefinition\currentbtxrenderingdefinition}\currentbtxrenderingdefinition} + +\unexpanded\def\stopbtxrenderingdefinitions + {\popmacro\currentbtxrenderingdefinition} + +\def\btx_set_rendering_alternative + {\edef\currentbtxalternative{\btxrenderingparameter\c!alternative}% + \ifcsname\??btxrenderingdefinition\currentbtxalternative\endcsname + % maybe fall back on apa ? + \else + \showmessage\m!publications{14}{\currentbtxalternative}% + \fi} + \appendtoks \loadbtxdefinitionfile[\btxrenderingparameter\c!alternative] \to \everysetupbtxrendering @@ -996,13 +1028,13 @@ \c!repeat=\v!no, \c!continue=\v!no, \c!method=\v!global, - \c!setups=btx:rendering:\btxrenderingparameter\c!alternative, + % \c!setups=btx:\btxrenderingparameter\c!alternative:initialize, % not the same usage as cite ! \c!alternative=apa, \c!sorttype=, \c!criterium=, \c!refcommand=authoryears, % todo \c!numbering=\v!yes, -% \c!autohang=\v!no, + % \c!autohang=\v!no, % not used \c!width=\v!auto, \c!separator={; }, \c!distance=1.5\emwidth] @@ -1012,7 +1044,7 @@ \setupbtxcitevariant [\c!interaction=\v!start, - \c!setups=btx:cite:\btxcitevariantparameter\c!alternative, + % \c!setups=btx:cite:initialize, \c!alternative=num, \c!authorconversion=\v!normal, \c!andtext={ \btxlabeltext{and} }, diff --git a/tex/context/base/sort-ini.lua b/tex/context/base/sort-ini.lua index 47fe3da69..42d83188e 100644 --- a/tex/context/base/sort-ini.lua +++ b/tex/context/base/sort-ini.lua @@ -101,11 +101,11 @@ local predefinedmethods = { } sorters = { - comparers = comparers, - splitters = splitters, - definitions = definitions, - tracers = tracers, - constants = { + comparers = comparers, + splitters = splitters, + definitions = definitions, + tracers = tracers, + constants = { ignoredoffset = ignoredoffset, replacementoffset = replacementoffset, digitsoffset = digitsoffset, diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index 6e357a658..012ae98f6 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf index 198a3f81f..798448d9a 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/context/base/strc-tag.lua b/tex/context/base/strc-tag.lua index 7e5c6f993..e368eae37 100644 --- a/tex/context/base/strc-tag.lua +++ b/tex/context/base/strc-tag.lua @@ -58,7 +58,7 @@ local properties = allocate { sectioncontent = { pdf = "Div", nature = "display" }, itemgroup = { pdf = "L", nature = "display" }, - item = { pdf = "Li", nature = "display" }, + item = { pdf = "LI", nature = "display" }, itemtag = { pdf = "Lbl", nature = "mixed" }, itemcontent = { pdf = "LBody", nature = "mixed" }, diff --git a/tex/context/base/util-str.lua b/tex/context/base/util-str.lua index 5609cdf25..6f952545c 100644 --- a/tex/context/base/util-str.lua +++ b/tex/context/base/util-str.lua @@ -525,12 +525,21 @@ local format_f = function(f) return format("format('%%%sf',a%s)",f,n) end -local format_F = function(f) +-- The next one formats an integer as integer and very small values as zero. This is needed +-- for pdf backend code. +-- +-- 1.23 % 1 : 0.23 +-- - 1.23 % 1 : 0.77 +-- +-- We could probably use just %s with integers but who knows what Lua 5.3 will do? So let's +-- for the moment use %i. + +local format_F = function() n = n + 1 if not f or f == "" then - return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n) + return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or format((a%s %% 1 == 0) and '%%i' or '%%.9f',a%s))",n,n,n,n) else - return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n) + return format("format((a%s %% 1 == 0) and '%%i' or '%%%sf',a%s)",n,f,n) end end diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 17833eb74..ce84d7a58 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/29/14 23:35:24 +-- merge date : 05/30/14 11:42:37 do -- begin closure to overcome local limits and interference @@ -2851,12 +2851,12 @@ local format_f=function(f) n=n+1 return format("format('%%%sf',a%s)",f,n) end -local format_F=function(f) +local format_F=function() n=n+1 if not f or f=="" then - return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or (a%s == 1 and '1') or format('%%.9f',a%s))",n,n,n,n) + return format("(((a%s > -0.0000000005 and a%s < 0.0000000005) and '0') or format((a%s %% 1 == 0) and '%%i' or '%%.9f',a%s))",n,n,n,n) else - return format("((a%s == 0 and '0') or (a%s == 1 and '1') or format('%%%sf',a%s))",n,n,f,n) + return format("format((a%s %% 1 == 0) and '%%i' or '%%%sf',a%s)",n,f,n) end end local format_g=function(f) -- cgit v1.2.3