From 9b19d5d37bf6d786a5db84882eae4ddbf5caf96a Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Wed, 30 Jul 2014 01:15:04 +0200 Subject: 2014-07-30 00:53:00 --- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4430 -> 4434 bytes tex/context/base/context.mkiv | 2 +- tex/context/base/mult-aux.mkiv | 4 +- tex/context/base/mult-def.mkiv | 2 + tex/context/base/publ-imp-apa.mkvi | 46 ++++++++++++++------ tex/context/base/publ-ini.lua | 2 +- tex/context/base/publ-ini.mkiv | 18 +++++++- tex/context/base/publ-jrn.lua | 47 +++++++++++++++------ tex/context/base/status-files.pdf | Bin 24949 -> 24938 bytes tex/context/base/status-lua.pdf | Bin 327044 -> 327044 bytes tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 12 files changed, 92 insertions(+), 33 deletions(-) (limited to 'tex') diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 63779bef9..4557e411d 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.07.29 22:25} +\newcontextversion{2014.07.30 00:50} %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 127780121..4cdce3989 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 1ff7413d8..5168dbb71 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.07.29 22:25} +\edef\contextversion{2014.07.30 00:50} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/mult-aux.mkiv b/tex/context/base/mult-aux.mkiv index d4f9d3b7b..748a552ee 100644 --- a/tex/context/base/mult-aux.mkiv +++ b/tex/context/base/mult-aux.mkiv @@ -891,10 +891,10 @@ % another set of (fast) helpers (grep for usage): -\def\expandnamespaceparameter#1#2#3% \??xx \getp \c!xx \c!yy +\def\expandnamespaceparameter#1#2#3% \??xx \getp \c!xx \v!yy {\csname#1\ifcsname#1\expandafter\expandafter\expandafter\mult_aux_expand_namespace_parameter#2#3} -\def\mult_aux_expand_namespace_parameter#1#2% \cs \c!yy +\def\mult_aux_expand_namespace_parameter#1#2% \cs \v!yy {#1\endcsname#1\else#2\fi\endcsname} \def\expandnamespacemacro#1#2#3% \??xx \some_edefed_cs \c!yy diff --git a/tex/context/base/mult-def.mkiv b/tex/context/base/mult-def.mkiv index ce8da3278..a45f4e440 100644 --- a/tex/context/base/mult-def.mkiv +++ b/tex/context/base/mult-def.mkiv @@ -69,6 +69,7 @@ \def\c!group {group} \def\c!groupsuffix {groupsuffix} \def\c!properties {properties} +\def\c!journalconversion {journalconversion} \def\c!referencemethod {referencemethod} % forward both @@ -90,6 +91,7 @@ \def\v!norepeat {norepeat} \def\v!mixed {mixed} \def\v!centerlast {centerlast} +\def\v!long {long} \def\s!lcgreek {lcgreek} \def\s!ucgreek {ucgreek} diff --git a/tex/context/base/publ-imp-apa.mkvi b/tex/context/base/publ-imp-apa.mkvi index 1a758a87d..38ea0c74f 100644 --- a/tex/context/base/publ-imp-apa.mkvi +++ b/tex/context/base/publ-imp-apa.mkvi @@ -21,6 +21,13 @@ \startbtxrenderingdefinitions[apa] +%D In order to get journals expanded (or normalized or abbreviated) you need to load +%D a list: +%D +%D \starttyping +%D \btxloadjournallist[journals.txt] % the jabref list +%D \stoptyping + %D Because we want to mix rendering (in the manual) we need a namespace in label %D texts: @@ -165,7 +172,8 @@ \starttexdefinition btx:apa:title-and-series \btxdoif {title} { - \btxflush{converters.Word -> title} + %btxflush{converters.Word -> title} + \btxflush{Word -> title} \btxdoif {series} { \btxlparent \btxflush{series} @@ -177,7 +185,8 @@ \starttexdefinition btx:apa:title-it-and-series \btxdoif {title} { - \texdefinition{btx:apa:italic}{converters.Word -> title} + %texdefinition{btx:apa:italic}{converters.Word -> title} + \texdefinition{btx:apa:italic}{Word -> title} \btxdoif {series} { \btxlparent \btxflush{series} @@ -363,11 +372,13 @@ \startsetups btx:apa:article \texdefinition{btx:apa:author-or-key-and-year} \btxdoif {title} { - \btxflush{converters.Word -> title} + %btxflush{converters.Word -> title} + \btxflush{Word -> title} \btxperiod } \btxdoifelse {journal} { - \texdefinition{btx:apa:italic}{journal} + % expandedjournal abbreviatedjournal + \texdefinition{btx:apa:italic}{expandedjournal -> journal} } { \btxdoif {crossref} { \btxlabeltext{apa:In} @@ -398,7 +409,8 @@ \startsetups btx:apa:book \texdefinition{btx:apa:author-editors-crossref-year} \btxdoif {title} { - \texdefinition{btx:apa:italic}{converters.Word -> title} + %texdefinition{btx:apa:italic}{converters.Word -> title} + \texdefinition{btx:apa:italic}{Word -> title} \doifmodeelse {btx:apa:edited-book} { \btxdoifelse {volume} { \btxspace @@ -476,7 +488,8 @@ \startsetups btx:apa:inbook \texdefinition{btx:apa:author-editors-crossref-year} \btxdoifelse {title} { - \texdefinition{btx:apa:italic}{converters.Word -> title} + %texdefinition{btx:apa:italic}{converters.Word -> title} + \texdefinition{btx:apa:italic}{Word -> title} } { \doifmodeelse {btx:apa:edited-book} { \btxdoifelse {volume} { @@ -577,11 +590,13 @@ \startsetups btx:apa:incollection \texdefinition{btx:apa:author-and-year} \btxdoifelse {arttitle} { - \btxflush{converters.Word -> arttitle} + %btxflush{converters.Word -> arttitle} + \btxflush{Word -> arttitle} \btxperiod } { \btxdoif {title} { - \btxflush{converters.Word -> title} + %btxflush{converters.Word -> title} + \btxflush{Word -> title} \btxperiod } } @@ -592,7 +607,8 @@ \btxflushauthor{editor} \btxcomma } - \texdefinition{btx:apa:italic}{converters.Word -> booktitle} + %texdefinition{btx:apa:italic}{converters.Word -> booktitle} + \texdefinition{btx:apa:italic}{Word -> booktitle} \btxdoif {series} { \btxdoif {volume} { \btxspace @@ -639,7 +655,8 @@ \startsetups btx:apa:inproceedings \texdefinition{btx:apa:author-and-year} \btxdoif {arttitle} { - \btxflush{converters.Word -> arttitle} + %btxflush{converters.Word -> arttitle} + \btxflush{Word -> arttitle} \btxperiod } \btxlabeltext{apa:In} @@ -655,7 +672,8 @@ } \btxcomma } - \texdefinition{btx:apa:italic}{converters.Word -> title} + %texdefinition{btx:apa:italic}{converters.Word -> title} + \texdefinition{btx:apa:italic}{Word -> title} \btxdoif {series} { \btxdoif {volume} { \btxcomma @@ -697,7 +715,8 @@ \startsetups btx:apa:proceedings \texdefinition{btx:apa:editor-or-key-and-year} \btxdoif {title} { - \texdefinition{btx:apa:italic}{converters.Word -> title} + %texdefinition{btx:apa:italic}{converters.Word -> title} + \texdefinition{btx:apa:italic}{Word -> title} \btxdoif {volume} { \btxcomma \btxlabeltext{apa:number} @@ -763,7 +782,8 @@ \texdefinition{btx:apa:author-and-year} \btxdoif {title} { \btxspace - \texdefinition{btx:apa:italic}{converters.Word -> title} + %texdefinition{btx:apa:italic}{converters.Word -> title} + \texdefinition{btx:apa:italic}{Word -> title} } \btxdoif {nationality} { \btxspace diff --git a/tex/context/base/publ-ini.lua b/tex/context/base/publ-ini.lua index 1052c37e2..35988cc58 100644 --- a/tex/context/base/publ-ini.lua +++ b/tex/context/base/publ-ini.lua @@ -1377,7 +1377,7 @@ function lists.fetchentries(dataset) for i=1,#list do local li = list[i] ctx_btxsettag(li[1]) - ctx_btxsetnumber(li[4]) + ctx_btxsetnumber(li[3]) ctx_btxchecklistentry() end end diff --git a/tex/context/base/publ-ini.mkiv b/tex/context/base/publ-ini.mkiv index c2823d45b..6e680e790 100644 --- a/tex/context/base/publ-ini.mkiv +++ b/tex/context/base/publ-ini.mkiv @@ -498,14 +498,18 @@ \endgroup} \def\btx_entry_inject_yes - {\fastsetup{\s!btx:\currentbtxalternative:lefttext}% + {\ifx\currentbtxlefttext\empty\else + \fastsetup{\s!btx:\currentbtxalternative:lefttext}% + \fi \fastsetup\currentbtxsetup \removeunwantedspaces \ifx\currentbtxcombis\empty \else \btxrenderingparameter\c!separator \processcommacommand[\currentbtxcombis]\btx_entry_inject_combi \fi - \fastsetup{\s!btx:\currentbtxalternative:righttext}}% + \ifx\currentbtxrighttext\empty\else + \fastsetup{\s!btx:\currentbtxalternative:righttext}% + \fi}% \def\btx_entry_inject_nop {\tttf \getmessage\m!publications{12}{\currentbtxsetup}} @@ -1078,6 +1082,15 @@ \def\btxexpandedjournal #1{\ctxcommand{btxexpandedjournal("#1")}} % \unexpanded ? \def\btxabbreviatedjournal#1{\ctxcommand{btxabbreviatedjournal("#1")}} % \unexpanded ? +% \installcorenamespace{btxjournal} +% +% \letvalue{\s!btxjournal\v!long }\btxexpandedjournal +% \letvalue{\s!btxjournal\v!short }\btxabbreviatedjournal +% \letvalue{\s!btxjournal\v!normal}\firstofoneargument +% +% \unexpanded\def\btxcheckedjournal +% {\expandnamespaceparameter\s!btxjournal\btxrenderingparameter\c!journalconversion} + % \btxloadjournallist[list.txt] % Foo Journal of Bars = FBJ \n .... % % \btxexpandedjournal[fbj] @@ -1255,6 +1268,7 @@ \c!etallimit=5, \c!etaldisplay=5, \c!etaltext={ \btxlabeltext{others}}, + %c!journalconversion=\v!normal, \c!monthconversion=\v!number, \c!authorconversion=\v!normal] diff --git a/tex/context/base/publ-jrn.lua b/tex/context/base/publ-jrn.lua index 31d618dd6..de98608c7 100644 --- a/tex/context/base/publ-jrn.lua +++ b/tex/context/base/publ-jrn.lua @@ -6,19 +6,26 @@ if not modules then modules = { } end modules ['publ-jrn'] = { license = "see context related readme files" } +-- http://jabref.sourceforge.net/journals/journal_abbreviations_general.txt +-- +-- = [;shortest unique abbreviation[;frequency]]. + -- require("char-utf") -- Abhandlungen aus dem Westfälischen Museum für Naturkunde = Abh. Westfäl. Mus. Nat.kd. -- Abhandlungen der Naturforschenden Gesellschaft in Zürich = Abh. Nat.forsch. Ges. Zür. -- Abhandlungen des Naturwissenschaftlichen Vereins zu Bremen = Abh. Nat.wiss. Ver. Bremen +if not characters then require("char-utf") end + local find = string.find local P, C, S, Cs, lpegmatch, lpegpatterns = lpeg.P, lpeg.C, lpeg.S, lpeg.Cs, lpeg.match, lpeg.patterns -local lower = characters.lower +local lower = characters.lower local report_journals = logs.reporter("publications","journals") +publications = publications or { } local journals = { } publications.journals = journals @@ -50,11 +57,18 @@ local function add(expansion,abbreviation) end end +-- [#%-] comment +-- meaning = abbreviations [;.....] + local whitespace = lpegpatterns.whitespace^0 -local separator = whitespace * lpeg.P("=") * whitespace -local endofline = lpegpatterns.space^0 * (lpegpatterns.newline + P(-1)) -local splitter = whitespace * C((1-separator)^1) * separator * C((1-endofline)^1) -local pattern = (splitter / add)^0 +local assignment = whitespace * P("=") * whitespace +local separator = P(";") +local newline = lpegpatterns.newline +local endofline = lpegpatterns.space^0 * (newline + P(-1) + separator) +local restofline = (1-newline)^0 +local splitter = whitespace * C((1-assignment)^1) * assignment * C((1-endofline)^1) * restofline +local comment = S("#-%") * restofline +local pattern = (comment + splitter / add)^0 function journals.load(filename) if not filename then @@ -122,11 +136,15 @@ function journals.abbreviated(name) return abbreviations[s] or abbreviations[simplify(expansions[s])] or name end -commands.btxloadjournallist = journals.load -commands.btxsavejournallist = journals.save -commands.btxaddjournal = function(...) context(journals.add(...)) end -commands.btxexpandedjournal = function(name) context(journals.expanded(name)) end -commands.btxabbreviatedjournal = function(name) context(journals.abbreviated(name)) end +local commands, context = commands, context + +if commands then + commands.btxloadjournallist = journals.load + commands.btxsavejournallist = journals.save + commands.btxaddjournal = function(...) context(journals.add(...)) end + commands.btxexpandedjournal = function(name) context(journals.expanded(name)) end + commands.btxabbreviatedjournal = function(name) context(journals.abbreviated(name)) end +end -- journals.load("e:/tmp/journals.txt") -- journals.save("e:/tmp/journals.lua") @@ -134,5 +152,10 @@ commands.btxabbreviatedjournal = function(name) context(journals.abbreviated(nam -- inspect(journals.expanded ("Z. Ökol. Nat.schutz")) -- inspect(journals.abbreviated("Z. Ökol. Nat. schutz")) -typesetters.manipulators.methods.expandedjournal = journals.expanded -typesetters.manipulators.methods.abbreviatedjournal = journals.abbreviated +if typesetters then + typesetters.manipulators.methods.expandedjournal = journals.expanded + typesetters.manipulators.methods.abbreviatedjournal = journals.abbreviated +end + +-- journals.load("t:/manuals/publications-mkiv/journals.txt") +-- journals.save("t:/manuals/publications-mkiv/journals.lua") diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index 0955b4832..61089c95a 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 ab7d11449..d93d7a686 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 5e6456394..200615246 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 : 07/29/14 22:25:18 +-- merge date : 07/30/14 00:50:57 do -- begin closure to overcome local limits and interference -- cgit v1.2.3