summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2014-05-21 22:15:14 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2014-05-21 22:15:14 +0200
commit2203b3638071de2b52e036ef5cfa400aeefd3b6e (patch)
treee8d90056673353ea3e1d97bd69c50a4732e55a6e
parenta4c1c6154bdbb9d36eaa9b14aeb228df64257816 (diff)
downloadcontext-2203b3638071de2b52e036ef5cfa400aeefd3b6e.tar.gz
2014-05-21 22:06:00
-rw-r--r--doc/context/manuals/allkind/mkiv-publications-graph.bib53
-rw-r--r--doc/context/manuals/allkind/mkiv-publications.bib4
-rw-r--r--doc/context/manuals/allkind/mkiv-publications.pdfbin0 -> 290580 bytes
-rw-r--r--doc/context/manuals/allkind/mkiv-publications.tex216
-rw-r--r--doc/context/manuals/allkind/publications-en.xml3
-rw-r--r--scripts/context/lua/mtxrun.lua15
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua15
-rw-r--r--scripts/context/stubs/unix/mtxrun15
-rw-r--r--scripts/context/stubs/win64/mtxrun.lua15
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4284 -> 4275 bytes
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/data-res.lua10
-rw-r--r--tex/context/base/file-mod.lua18
-rw-r--r--tex/context/base/font-sel.mkvi2
-rw-r--r--tex/context/base/lang-url.lua80
-rw-r--r--tex/context/base/lang-url.mkiv63
-rw-r--r--tex/context/base/mult-aux.mkiv2
-rw-r--r--tex/context/base/mult-mes.lua6
-rw-r--r--tex/context/base/publ-dat.lua6
-rw-r--r--tex/context/base/publ-fnd.lua43
-rw-r--r--tex/context/base/publ-imp-cite.mkiv38
-rw-r--r--tex/context/base/publ-ini.lua109
-rw-r--r--tex/context/base/publ-ini.mkiv76
-rw-r--r--tex/context/base/status-files.pdfbin24594 -> 24584 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin244074 -> 244257 bytes
-rw-r--r--tex/context/base/syst-ini.mkiv2
-rw-r--r--tex/context/base/type-imp-texgyre.mkiv2
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
-rw-r--r--web2c/contextcnf.lua8
30 files changed, 575 insertions, 232 deletions
diff --git a/doc/context/manuals/allkind/mkiv-publications-graph.bib b/doc/context/manuals/allkind/mkiv-publications-graph.bib
new file mode 100644
index 000000000..2e781179c
--- /dev/null
+++ b/doc/context/manuals/allkind/mkiv-publications-graph.bib
@@ -0,0 +1,53 @@
+% A few examples from the MetaPost graph manual that Alan was updating
+% at the time we wrote the new bib code. Watch how uppercase is used here
+% as well as curly braces instead of double quote characters,
+
+@INCOLLECTION{Bentley1990,
+ author = {Bentley, Jon L. and Kernighan, Brian W.},
+ year = {1990},
+ title = {Grap—A language for Typesetting Graphs},
+ booktitle = {Unix Research System Papers},
+ publisher = {{AT\&T} Bell Laboratories},
+ volume = {{II}},
+ pages = {109–146},
+ address = {Murray Hill, New Jersey},
+ edition = {Tenth},
+}
+
+@BOOK{Cleveland1985,
+ author = {Cleveland, William S.},
+ year = {1985, revised 1994},
+ title = {The Elements of Graphing Data},
+ publisher = {Hobart Press},
+ address = {Summit, New Jersey},
+}
+
+@BOOK{Cleveland1993,
+ author = {Cleveland, William S.},
+ year = {1993},
+ title = {Visualizing Data},
+ publisher = {Hobart Press},
+ address = {Summit, New Jersey},
+}
+
+@ARTICLE{Cleveland1993a,
+ author = {Cleveland, William S.},
+ year = {1993},
+ title = {A Model for Studying Display Methods of StatisticalGraphics (with
+ discussion)},
+ journal = {Journal of Computational and Statistical Graphics},
+ volume = {2},
+ pages = {323–343},
+ number = {4},
+ doi = {10.1080/10618600.1993.10474616},
+ eprint = {http://www.tandfonline.com/doi/pdf/10.1080/10618600.1993.10474616},
+ url = {http://www.tandfonline.com/doi/abs/10.1080/10618600.1993.10474616},
+}
+
+@BOOK{Tufte1983,
+ author = {Tufte, Edward R.},
+ year = {1983},
+ title = {Visual Display of Quantitative Information},
+ publisher = {Graphics Press},
+ address = {Box 430, Cheshire, Connecticut 06410},
+}
diff --git a/doc/context/manuals/allkind/mkiv-publications.bib b/doc/context/manuals/allkind/mkiv-publications.bib
index e94f43202..9e9984bfc 100644
--- a/doc/context/manuals/allkind/mkiv-publications.bib
+++ b/doc/context/manuals/allkind/mkiv-publications.bib
@@ -1,3 +1,5 @@
+% A few silly but simple examples.
+
@book{demo-001,
author = "Hans Hagen",
title = "\BIBTEX, the \CONTEXT\ way",
@@ -18,7 +20,7 @@
@book{demo-004,
author = "Luigi Scarso",
- title = "Designing high speed trains",
+ title = "Designing high speed trains properly!",
year = "2021",
comment = "still to be published",
}
diff --git a/doc/context/manuals/allkind/mkiv-publications.pdf b/doc/context/manuals/allkind/mkiv-publications.pdf
new file mode 100644
index 000000000..2aadba29d
--- /dev/null
+++ b/doc/context/manuals/allkind/mkiv-publications.pdf
Binary files differ
diff --git a/doc/context/manuals/allkind/mkiv-publications.tex b/doc/context/manuals/allkind/mkiv-publications.tex
index 0a81467fc..c5bdab14a 100644
--- a/doc/context/manuals/allkind/mkiv-publications.tex
+++ b/doc/context/manuals/allkind/mkiv-publications.tex
@@ -1,6 +1,9 @@
% language=uk
-% \setupbtxrendering[continue=yes]
+
+\setupbtxlistvariant [interaction=start]
+\setupbtxcitevariant [interaction=start]
+
% \btxfield{manipulator_a->manipulator_b->fieldname}
% engine=luajittex
@@ -8,16 +11,7 @@
% criterium: all + sorttype=cite => citex before rest
% criterium: all + sorttype=database => database order
% criterium: used
-%
% numbering: label, short, indexinlist, indexused
-%
-% maybeyear
-%
-% \cite[data][whatever]
-
-% \showframe
-
-% \usemodule[lua-checkheads]
\usemodule[abr-02]
\usemodule[set-11]
@@ -1282,6 +1276,208 @@ suffix, you can do this:
\stopchapter
+\startchapter[title=Searching]
+
+Finding the right key in a database can be a pain. On the other hand, asking for
+a wildcard also makes no sense. Nevertheless we provide a mechanism for matching
+a query. For this we load a small bibliographic database:
+
+\startbuffer
+\usebtxdataset[graph][mkiv-publications-graph.bib]
+\stopbuffer
+
+\typebuffer \getbuffer
+
+We could switch to this base using:
+
+\starttyping
+\setbtxdataset[graph]
+\stoptyping
+
+but instead we will use a prefix. For instance, if we have this in our source:
+
+\startbuffer
+searching give a few hits, so we get: \cite [ graph :: match ( author:cleveland and
+year:1993 ) ].
+\stopbuffer
+
+\typebuffer
+
+We will get: \quotation {\inlinebuffer}. Of course this assumes that we also
+typeset a list of referred to references, so let's do that:
+
+\startbuffer
+\definebtxrendering[graph][dataset=graph]
+\placebtxrendering[graph][criterium=chapter]
+\stopbuffer
+
+\typebuffer
+
+We get:
+
+\blank \getbuffer \blank
+
+Let's look in more detail at the \type {\cite} command. In order to distinguish
+efficiently between a normal reference and a more clever one, we use the \type
+{match} keyword:
+
+\startbuffer
+dataset::match(query)
+dataset :: match ( query )
+\stopbuffer
+
+The handler is rather tolerant for spaces:
+
+\startbuffer
+dataset :: match ( query )
+\stopbuffer
+
+Which is handy if you have long queries that wrap around in the source code. Of
+course the \type {dataset::} prefix is optional in which case the current dataset
+is taken.
+
+A query eventually becomes a \LUA\ expression so you can use helpers to achieve
+your goal. As a convenience there are some shortcuts to access fields. The
+following examples demonstrate this:
+
+\starttyping
+match(author:hagen)
+match(author:hagen and author:hoekwater and year:1990-2010)
+match(author:"Bogusław Jackowski")
+match(author:"Bogusław Jackowski" and (tonumber(field:year) or 0) > 2000)
+\stoptyping
+
+You can use quotes when spaces are involved. Of course you can use other
+characters that the basic alphabet. Ranges (of numbers) are recognized. String
+lookups are partial and case insensitive. \footnote {At the time of this
+writing, may 2014, this mechanism is still somewhat experimental.}
+
+\startbuffer
+Wildcards: \cite [graph::match(author:cleve)].
+\stopbuffer
+
+\typebuffer
+
+We get three entries: \quotation {\inlinebuffer}.
+
+% To be checked: are indeed three entries found?
+
+% Match : \cite [match(author:cleveland and year:1993)] \par
+
+\stopchapter
+
+\startchapter[title=Combining]
+
+It is possible to refer to two sources in one go. In that case the list will have one
+entry for two bibliographic entries.
+
+\startbuffer
+Let's save numbers and refer to Bentley and Tufte with one: \cite [graph ::
+Bentley1990 + Tufte1983]!
+\stopbuffer
+
+\typebuffer
+
+Indeed we get one number only: \quotation {\inlinebuffer}.
+
+\startbuffer
+\setupbtxrendering[graph][continue=yes,separator={; }]
+\placebtxrendering[graph][criterium=chapter]
+\stopbuffer
+
+We produce the (local) list with:
+
+\typebuffer
+
+which shows the two entries pasted together:
+
+\setupbtxrendering[separator=]
+
+\blank \getbuffer \blank
+
+As demonstration we also specified the separator although that one is already
+set up by default.
+
+You can combine citations with additional text before and|/|or after it. This can
+be done per citation. This feature is of course not that useful, as one can
+put text before and after a citation anyway.
+
+\startbuffer
+foo bar \citation [before=<<,after=>>] [graph::Cleveland1993] foo bar
+\stopbuffer
+
+\typebuffer
+
+Gives:
+
+\blank \getbuffer \blank
+
+\stopchapter
+
+\startchapter[title=Summary]
+
+\start
+\setbtxdataset[graph]
+
+There are a lot of combinations possible and not all of them make sense.
+Nevertheless we show most of them here. (There will be more.)
+
+\startbuffer[samples]
+Cleveland : \cite [Cleveland1993,Cleveland1985,Cleveland1993a] \par
+Tufte : \cite [Tufte1983] \par
+Bentley : \cite [Bentley1990] \par
+All : \cite [Tufte1983,Cleveland1993,Bentley1990,Cleveland1985,
+ Cleveland1993a] \par
+\stopbuffer
+
+\starttexdefinition BibSampleSet #1#2
+ \subsubsubject{alternative=#1 / compress=#2}
+ \startpacked
+ \setupbtxcitevariant[#1][compress=#2]
+ \setupbtxcitevariant[alternative=#1]
+ \getbuffer[samples]
+ \stoppacked
+\stoptexdefinition
+
+\BibSampleSet{author} {no}
+\BibSampleSet{authoryear} {no}
+\BibSampleSet{authoryear} {yes}
+\BibSampleSet{authoryears}{no}
+\BibSampleSet{authoryears}{yes}
+\BibSampleSet{authornum} {no}
+\BibSampleSet{authornum} {yes}
+\BibSampleSet{year} {no}
+\BibSampleSet{year} {yes}
+\BibSampleSet{short} {no}
+\BibSampleSet{serial} {no}
+\BibSampleSet{serial} {yes}
+\BibSampleSet{tag} {no}
+\BibSampleSet{key} {no}
+\BibSampleSet{doi} {no}
+\BibSampleSet{url} {no}
+\BibSampleSet{type} {no}
+\BibSampleSet{category} {no}
+\BibSampleSet{page} {no}
+\BibSampleSet{num} {no}
+\BibSampleSet{num} {yes}
+
+\startbuffer
+\setupbtxrendering[graph][continue=yes]
+\placebtxrendering[graph][criterium=chapter]
+\stopbuffer
+
+We produce a local list with:
+
+\typebuffer
+
+and get a list with (new) entries:
+
+\blank \getbuffer \blank
+
+\stop
+
+\stopchapter
+
\startchapter[title=Notes]
The move from external \BIBTEX\ processing to internal processing has the
diff --git a/doc/context/manuals/allkind/publications-en.xml b/doc/context/manuals/allkind/publications-en.xml
index ea577ccf4..002b425bb 100644
--- a/doc/context/manuals/allkind/publications-en.xml
+++ b/doc/context/manuals/allkind/publications-en.xml
@@ -139,6 +139,9 @@
<cd:constant type="cd:name"/>
</cd:keywords>
<cd:assignments n="2">
+ <cd:parameter name="separator">
+ <cd:constant type="cd:text"/>
+ </cd:parameter>
<cd:parameter name="namesep">
<cd:constant type="cd:text"/>
</cd:parameter>
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index c3d411162..5cb5c8d24 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -13695,7 +13695,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-res"] = package.loaded["data-res"] or true
--- original size: 61824, stripped down to: 42982
+-- original size: 62045, stripped down to: 43116
if not modules then modules={} end modules ['data-res']={
version=1.001,
@@ -13722,9 +13722,10 @@ local settings_to_array=utilities.parsers.settings_to_array
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")
local resolvers=resolvers
local expandedpathfromlist=resolvers.expandedpathfromlist
@@ -14804,7 +14805,7 @@ collect_instance_files=function(filename,askedformat,allresults)
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
method,result=find_otherwise(filename,filetype,wantedfiles)
end
end
@@ -16879,8 +16880,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 : 694959
--- stripped bytes : 246707
+-- original bytes : 695180
+-- stripped bytes : 246794
-- end library merge
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index c3d411162..5cb5c8d24 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -13695,7 +13695,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-res"] = package.loaded["data-res"] or true
--- original size: 61824, stripped down to: 42982
+-- original size: 62045, stripped down to: 43116
if not modules then modules={} end modules ['data-res']={
version=1.001,
@@ -13722,9 +13722,10 @@ local settings_to_array=utilities.parsers.settings_to_array
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")
local resolvers=resolvers
local expandedpathfromlist=resolvers.expandedpathfromlist
@@ -14804,7 +14805,7 @@ collect_instance_files=function(filename,askedformat,allresults)
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
method,result=find_otherwise(filename,filetype,wantedfiles)
end
end
@@ -16879,8 +16880,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 : 694959
--- stripped bytes : 246707
+-- original bytes : 695180
+-- stripped bytes : 246794
-- end library merge
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index c3d411162..5cb5c8d24 100644
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -13695,7 +13695,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-res"] = package.loaded["data-res"] or true
--- original size: 61824, stripped down to: 42982
+-- original size: 62045, stripped down to: 43116
if not modules then modules={} end modules ['data-res']={
version=1.001,
@@ -13722,9 +13722,10 @@ local settings_to_array=utilities.parsers.settings_to_array
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")
local resolvers=resolvers
local expandedpathfromlist=resolvers.expandedpathfromlist
@@ -14804,7 +14805,7 @@ collect_instance_files=function(filename,askedformat,allresults)
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
method,result=find_otherwise(filename,filetype,wantedfiles)
end
end
@@ -16879,8 +16880,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 : 694959
--- stripped bytes : 246707
+-- original bytes : 695180
+-- stripped bytes : 246794
-- end library merge
diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua
index c3d411162..5cb5c8d24 100644
--- a/scripts/context/stubs/win64/mtxrun.lua
+++ b/scripts/context/stubs/win64/mtxrun.lua
@@ -13695,7 +13695,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-res"] = package.loaded["data-res"] or true
--- original size: 61824, stripped down to: 42982
+-- original size: 62045, stripped down to: 43116
if not modules then modules={} end modules ['data-res']={
version=1.001,
@@ -13722,9 +13722,10 @@ local settings_to_array=utilities.parsers.settings_to_array
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")
local resolvers=resolvers
local expandedpathfromlist=resolvers.expandedpathfromlist
@@ -14804,7 +14805,7 @@ collect_instance_files=function(filename,askedformat,allresults)
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
method,result=find_otherwise(filename,filetype,wantedfiles)
end
end
@@ -16879,8 +16880,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 : 694959
--- stripped bytes : 246707
+-- original bytes : 695180
+-- stripped bytes : 246794
-- end library merge
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
index da217cd7b..cf428c00e 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
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
index e98aea887..24b732427 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf
index 6603d4b5a..f6ca96bc3 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
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
diff --git a/web2c/contextcnf.lua b/web2c/contextcnf.lua
index 366df01ac..b9541a88e 100644
--- a/web2c/contextcnf.lua
+++ b/web2c/contextcnf.lua
@@ -211,6 +211,14 @@ return {
-- ["fonts.usesystemfonts"] = false,
+ -- You can permit loading modules with no prefix:
+
+ -- ["modules.permitunprefixed"] = "no",
+
+ -- You can permit loading files from anywhere in the TDS tree:
+
+ -- ["resolvers.otherwise"] = "no",
+
},
experiments = {