From f779927eb2f4fdee785601823e87b28595ad71db Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Sat, 24 May 2014 15:14:00 +0200 Subject: beta 2014.05.24 15:14 --- doc/context/manuals/allkind/mkiv-publications.bib | 22 ++++-- doc/context/manuals/allkind/mkiv-publications.pdf | Bin 58003 -> 300242 bytes doc/context/manuals/allkind/mkiv-publications.tex | 61 +++++++++++++---- doc/context/manuals/allkind/publications-en.xml | 17 ++++- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4281 -> 4280 bytes tex/context/base/context.mkiv | 2 +- tex/context/base/publ-aut.lua | 21 +++++- tex/context/base/publ-ini.lua | 76 ++++----------------- tex/context/base/publ-ini.mkiv | 37 ++++++++-- tex/context/base/status-files.pdf | Bin 24583 -> 24583 bytes tex/context/base/status-lua.pdf | Bin 244428 -> 244467 bytes tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 13 files changed, 146 insertions(+), 94 deletions(-) diff --git a/doc/context/manuals/allkind/mkiv-publications.bib b/doc/context/manuals/allkind/mkiv-publications.bib index 9e9984bfc..5445471f2 100644 --- a/doc/context/manuals/allkind/mkiv-publications.bib +++ b/doc/context/manuals/allkind/mkiv-publications.bib @@ -26,11 +26,19 @@ } @book{demo-005, - author = "author", - title = "title", - year = "year", - serial = "serial", - doi = "doi", - url = "url", - pages = "pages" + author = "author", + title = "title", + year = "year", + serial = "serial", + doi = "doi", + url = "url", + pages = "pages", + language = "en", +} + +@book{demo-006, + author = "Hans Hagen, Kees van Marle and Ton Otten", + title = "Why do we always have lack of time?", + year = "2014", + comment = "yet another non-existing document", } diff --git a/doc/context/manuals/allkind/mkiv-publications.pdf b/doc/context/manuals/allkind/mkiv-publications.pdf index 5ef0aa564..04a63f126 100644 Binary files a/doc/context/manuals/allkind/mkiv-publications.pdf and b/doc/context/manuals/allkind/mkiv-publications.pdf differ diff --git a/doc/context/manuals/allkind/mkiv-publications.tex b/doc/context/manuals/allkind/mkiv-publications.tex index 72cc22762..04ed62744 100644 --- a/doc/context/manuals/allkind/mkiv-publications.tex +++ b/doc/context/manuals/allkind/mkiv-publications.tex @@ -1,18 +1,8 @@ % language=uk - \setupbtxlistvariant [interaction=start] \setupbtxcitevariant [interaction=start] -% \btxfield{manipulator_a->manipulator_b->fieldname} - -% {\setupbtxcitevariant[author][authorconversion=normal] normal : \cite[author][match(author:tufte)]}\par -% {\setupbtxcitevariant[author][authorconversion=normalshort] normalshort : \cite[author][match(author:tufte)]}\par -% {\setupbtxcitevariant[author][authorconversion=inverted] inverted : \cite[author][match(author:tufte)]}\par -% {\setupbtxcitevariant[author][authorconversion=invertedshort] invertedshort : \cite[author][match(author:tufte)]}\par - -% engine=luajittex - % criterium: all + sorttype=cite => citex before rest % criterium: all + sorttype=database => database order % criterium: used @@ -112,11 +102,11 @@ \stopMPpage - \startfrontmatter \starttitle[title=Contents] - \placelist[chapter,section][color=black] + \setuplist[chapter][before=,after] + \placelist[chapter][color=black] \stoptitle \startchapter[title=Introduction] @@ -716,6 +706,21 @@ but if you want to control it yourself you say something: In most cases the defaults will work out fine. +Normally the references are numbered using one conunter for the whole +document. If you want each list to have its own number, then you can +set the \type {continue} parameter: + +\starttyping +\setupbtxrendering[continue=no] +\stoptyping + +In a simlar fashion you can influence if references are included only once +of in each list: + +\starttyping +\setupbtxrendering[repeat=yes] +\stoptyping + \stopchapter \startchapter[title=Citations] @@ -1392,6 +1397,38 @@ We get three entries: \quotation {\inlinebuffer}. \stopchapter +\startchapter[title=Authors] + +The most complicated part of the rendering is authors. The way names are made up +is quite different and depends on culture, history, country and personal taste. +For instance, in the Netherlands you seldom see junior or senior being used, but +in the Unites States this is quite common. Then there is the matter of several +authors cooperating. + +\starttexdefinition TestAuthor#1 + \starttabulate[|lT|p|] + \HL + \NC \ttx \rlap {\string\citation[alternative=author,authorconversion=...][#1]} \NC \NC \NR + \HL + \NC name \NC \citation[alternative=author,authorconversion=name] [#1] \NC \NR + \NC normal \NC \citation[alternative=author,authorconversion=normal] [#1] \NC \NR + \NC normalshort \NC \citation[alternative=author,authorconversion=normalshort] [#1] \NC \NR + \NC inverted \NC \citation[alternative=author,authorconversion=inverted] [#1] \NC \NR + \NC invertedshort \NC \citation[alternative=author,authorconversion=invertedshort][#1] \NC \NR + \HL + \stoptabulate +\stoptexdefinition + +Herw we give some examples of rendering. The authornames are taken from the +database, analyzed, split and depending on the demand, reconstructed. + +\TestAuthor{example::demo-001} +\TestAuthor{example::demo-003} +\TestAuthor{example::demo-003,demo-004} +\TestAuthor{example::demo-006} + +\stopchapter + \startchapter[title=Combining] It is possible to refer to two sources in one go. In that case the list will have one diff --git a/doc/context/manuals/allkind/publications-en.xml b/doc/context/manuals/allkind/publications-en.xml index 002b425bb..92a4ea31a 100644 --- a/doc/context/manuals/allkind/publications-en.xml +++ b/doc/context/manuals/allkind/publications-en.xml @@ -99,7 +99,11 @@ - + + + + + @@ -190,6 +194,7 @@ + @@ -257,6 +262,16 @@ + + + + + + + + + + diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 799d14cb6..d4be2d713 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.23 23:24} +\newcontextversion{2014.05.24 15:14} %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 e6179748e..d6a93c511 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 10228ee73..03ef02652 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.23 23:24} +\edef\contextversion{2014.05.24 15:14} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/publ-aut.lua b/tex/context/base/publ-aut.lua index c549b2d16..f30902ae6 100644 --- a/tex/context/base/publ-aut.lua +++ b/tex/context/base/publ-aut.lua @@ -321,8 +321,6 @@ function authors.normalshort(author,settings) return concat(result) end --- vons surnames juniors, firstnames - -- [vons] [vonsep] [surnames] [surnamejuniorsep] [juniors] [surnamefirstnamesep] [firstnames] (von Hoekwater jr, Taco) function authors.inverted(author,settings) @@ -373,7 +371,24 @@ function authors.invertedshort(author,settings) return concat(result) end -authors.short = authors.normalshort +-- [vons] [vonsep] [surnames] + +function authors.name(author,settings) + local vons, surnames = author.vons, author.surnames + local result, settings = { }, settings or defaultsettings + if vons and #vons > 0 then + result[#result+1] = concat(vons," ") + result[#result+1] = settings.vonsep or defaultsettings.vonsep + end + if surnames and #surnames > 0 then + result[#result+1] = concat(surnames," ") + if juniors and #juniors > 0 then + result[#result+1] = settings.surnamejuniorsep or defaultsettings.surnamejuniorsep + result[#result+1] = concat(juniors," ") + end + end + return concat(result) +end local lastconcatsize = 1 diff --git a/tex/context/base/publ-ini.lua b/tex/context/base/publ-ini.lua index a73450ab3..054ed94ea 100644 --- a/tex/context/base/publ-ini.lua +++ b/tex/context/base/publ-ini.lua @@ -65,8 +65,17 @@ local sortcomparer = sorters.comparers.basic -- (a,b) local sortstripper = sorters.strip local sortsplitter = sorters.splitters.utf -local splitmanipulation = typesetters.manipulators.splitspecification -local applymanipulation = typesetters.manipulators.applyspecification +local manipulators = typesetters.manipulators +local splitmanipulation = manipulators.splitspecification +local applymanipulation = manipulators.applyspecification +local manipulatormethods = manipulators.methods + +-- this might move elsewhere + +manipulatormethods.Word = converters.Word +manipulatormethods.WORD = converters.WORD +manipulatormethods.Words = converters.Words +manipulatormethods.WORDS = converters.WORDS local context = context @@ -946,10 +955,12 @@ function lists.flushentries(dataset,sortvariant) if type(sort) == "function" then list = sort(dataset,rendering,list) or list end + local luadata = datasets[dataset].luadata + -- local details = datasets[dataset].details for i=1,#list do -- we can pass i here too ... more efficient to avoid the setvalue local tag = list[i][1] - local entry = datasets[dataset].luadata[tag] + local entry = luadata[tag] if entry then ctx_setvalue("currentbtxindex",i) -- todo: helper local combined = entry.combined @@ -958,7 +969,7 @@ function lists.flushentries(dataset,sortvariant) else ctx_setvalue("currentbtxcombis","") end - ctx_btxhandlelistentry(tag) -- pas i instead + ctx_btxhandlelistentry(tag) -- pass i instead and also pass 'placed' end end end @@ -991,68 +1002,11 @@ function lists.doifalreadyplaced(dataset,tag) commands.doifelse(renderings[dataset].used[tag]) end --- we ask for :tag but when we can't find it we go back --- to look for previous definitions, and when not found again --- we look forward - local function compare(a,b) local aa, bb = a and a[3], b and b[3] return aa and bb and aa < bb end --- rendering ? - --- todo: nicer refs - --- 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: 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 f_citereference = formatters["btx:cite:%s"] local f_listreference = formatters["btx:list:%s"] diff --git a/tex/context/base/publ-ini.mkiv b/tex/context/base/publ-ini.mkiv index b175b614d..00eb445b1 100644 --- a/tex/context/base/publ-ini.mkiv +++ b/tex/context/base/publ-ini.mkiv @@ -478,7 +478,7 @@ \def\publ_place_list_entry_register {\ctxcommand{btxregisterlistentry("\currentbtxdataset","\currentbtxtag")}} -\unexpanded\def\btxhandlelistentry#1% called at the lua end +\unexpanded\def\btxhandlelistentry#1% called at the lua end / todo: pass check state {\begingroup \edef\currentbtxtag{#1}% \ifconditional\c_publ_place_all @@ -583,6 +583,7 @@ etaldisplay = \number\btxlistvariantparameter\c!etaldisplay, })}} +\unexpanded\def\btxflushauthorname {\btx_flush_author{name}} % #1 \unexpanded\def\btxflushauthornormal {\btx_flush_author{normal}} % #1 \unexpanded\def\btxflushauthornormalshort {\btx_flush_author{normalshort}} % #1 \unexpanded\def\btxflushauthorinverted {\btx_flush_author{inverted}} % #1 @@ -599,6 +600,7 @@ % \btxflushauthor{artauthor} % \btxflushauthor{editor} % +% \btxflushauthor[name]{author} % \btxflushauthor[normal]{author} % \btxflushauthor[normalshort]{author} % \btxflushauthor[inverted]{author} @@ -913,10 +915,27 @@ \stopcontextdefinitioncode +%D Special: + +\def\publ_check_repeat + {\doifelse{\btxrenderingparameter\c!repeat}\v!yes + {\setfalse\c_publ_place_check\setfalse\c_publ_place_register} + {\settrue \c_publ_place_check\settrue \c_publ_place_register}} + +\appendtoks + \publ_check_repeat +\to \everysetupbtxrendering + +\appendtoks + \globallet\publ_check_repeat\relax +\to \everystarttext + %D Defaults: \setupbtxrendering [\c!dataset=\v!standard, + \c!repeat=\v!no, + \c!continue=\v!no, \c!method=\v!global, \c!setups=btx:rendering:\btxrenderingparameter\c!alternative, \c!alternative=apa, @@ -984,14 +1003,18 @@ \definebtxcitevariant [author:year] [authoryear] - [\c!left={(}, - \c!right={)}] + [\c!left=, + \c!right=] + +% \definebtxcitevariant +% [author:years] +% [authoryears] +% [\c!left=, +% \c!right=] \definebtxcitevariant [author:years] - [authoryears] - [\c!left=, - \c!right=] + [author:year] \definebtxcitevariant [year] @@ -1092,7 +1115,7 @@ [author] \setupbtxcitevariant - [\c!authorconversion=\btxlistvariantparameter\c!authorconversion, + [\c!authorconversion=name, % \btxlistvariantparameter\c!authorconversion, \c!etallimit =\btxlistvariantparameter\c!etallimit, \c!etaldisplay =\btxlistvariantparameter\c!etaldisplay] diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index 2c166a863..8bb640e26 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 edb25cc89..48fa93f78 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 4c1063bbb..c72eb4439 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/23/14 23:24:48 +-- merge date : 05/24/14 15:14:04 do -- begin closure to overcome local limits and interference -- cgit v1.2.3