From c0f7956c718fa1dbeeeb337cd5439164060698d1 Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Fri, 31 Oct 2014 13:15:03 +0100 Subject: 2014-10-31 12:49:00 --- metapost/context/base/mp-bare.mpiv | 93 +++++++++++++++++++++ metapost/context/base/mp-mlib.mpiv | 68 +-------------- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4382 -> 4383 bytes tex/context/base/context.mkiv | 2 +- tex/context/base/meta-ini.mkiv | 13 +++ tex/context/base/mlib-pps.lua | 10 ++- tex/context/base/publ-aut.lua | 11 ++- tex/context/base/publ-ini.mkiv | 90 ++++++++++---------- tex/context/base/status-files.pdf | Bin 24706 -> 24697 bytes tex/context/base/status-lua.pdf | Bin 333908 -> 333912 bytes tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 12 files changed, 168 insertions(+), 123 deletions(-) create mode 100644 metapost/context/base/mp-bare.mpiv diff --git a/metapost/context/base/mp-bare.mpiv b/metapost/context/base/mp-bare.mpiv new file mode 100644 index 000000000..c6194b1ee --- /dev/null +++ b/metapost/context/base/mp-bare.mpiv @@ -0,0 +1,93 @@ +%D \module +%D [ file=mp-bare.mpiv, +%D version=2014.10.31, +%D title=\CONTEXT\ \METAPOST\ graphics, +%D subtitle=plain plugins, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See licen-en.pdf for +%C details. + +if known context_bare : endinput ; fi ; +boolean context_bare ; context_bare := true ; + +numeric mfun_tt_w[], mfun_tt_h[], mfun_tt_d[] ; +numeric mfun_tt_n ; mfun_tt_n := 0 ; +picture mfun_tt_p ; mfun_tt_p := nullpicture ; +picture mfun_tt_o ; mfun_tt_o := nullpicture ; +picture mfun_tt_c ; mfun_tt_c := nullpicture ; + +if unknown mfun_trial_run : + boolean mfun_trial_run ; + mfun_trial_run := false ; +fi ; + +if unknown mfun_first_run : + boolean mfun_first_run ; + mfun_first_run := true ; +fi ; + +def mfun_reset_tex_texts = + mfun_tt_n := 0 ; + mfun_tt_p := nullpicture ; + mfun_tt_o := nullpicture ; % redundant + mfun_tt_c := nullpicture ; % redundant +enddef ; + +def mfun_flush_tex_texts = + addto currentpicture also mfun_tt_p +enddef ; + +extra_beginfig := extra_beginfig & "mfun_reset_tex_texts ;" ; +extra_endfig := "mfun_flush_tex_texts ; mfun_reset_tex_texts ; " & extra_endfig ; + +vardef colordecimals primary c = + if cmykcolor c : + decimal cyanpart c & ":" & decimal magentapart c & ":" & decimal yellowpart c & ":" & decimal blackpart c + elseif rgbcolor c : + decimal redpart c & ":" & decimal greenpart c & ":" & decimal bluepart c + else : + decimal c + fi +enddef ; + +vardef rawtextext(expr str) = % todo: avoid currentpicture + if str = "" : + nullpicture + else : + mfun_tt_n := mfun_tt_n + 1 ; + mfun_tt_c := nullpicture ; + if mfun_trial_run : + mfun_tt_o := nullpicture ; + addto mfun_tt_o doublepath origin _op_ ; % save drawoptions + addto mfun_tt_c doublepath unitsquare + withprescript "tx_number=" & decimal mfun_tt_n + withprescript "tx_stage=trial" + withprescript "tx_color=" & colordecimals colorpart mfun_tt_o + withpostscript str ; + addto mfun_tt_p also mfun_tt_c ; + elseif known mfun_tt_d[mfun_tt_n] : + addto mfun_tt_c doublepath unitsquare + xscaled mfun_tt_w[mfun_tt_n] + yscaled (mfun_tt_h[mfun_tt_n] + mfun_tt_d[mfun_tt_n]) + shifted (0,-mfun_tt_d[mfun_tt_n]) + withprescript "tx_number=" & decimal mfun_tt_n + withprescript "tx_stage=final" ; + else : + addto mfun_tt_c doublepath unitsquare ; % unitpicture + fi ; + mfun_tt_c + fi +enddef ; + +primarydef str infont name = % nasty hack + if name = "" : + rawtextext(str) + else : + rawtextext("\definedfont[" & name & "]" & str) + fi +enddef ; + diff --git a/metapost/context/base/mp-mlib.mpiv b/metapost/context/base/mp-mlib.mpiv index 11bf9b8d0..5e7a15395 100644 --- a/metapost/context/base/mp-mlib.mpiv +++ b/metapost/context/base/mp-mlib.mpiv @@ -142,73 +142,7 @@ extra_beginfig := extra_beginfig & "mfun_reset_tex_texts ;" ; % flush twice: once in location in order to pick up e.g. color properties, % and once at the end because we need to flush missing ones. -% vardef rawtextext(expr str) = -% if str = "" : -% nullpicture -% elseif mfun_trial_run : -% mfun_tt_n := mfun_tt_n + 1 ; -% mfun_tt_o := image(draw origin) ; % save drawoptions -% addto mfun_tt_p doublepath unitsquare -% withprescript "tx_number=" & decimal mfun_tt_n -% withprescript "tx_stage=extra" -% withpostscript str ; -% image ( -% addto currentpicture doublepath unitsquare -% withprescript "tx_number=" & decimal mfun_tt_n -% withprescript "tx_stage=trial" -% withprescript "tx_color=" & colordecimals colorpart mfun_tt_o -% withpostscript str -% ; ) -% else : -% mfun_tt_n := mfun_tt_n + 1 ; -% if known mfun_tt_d[mfun_tt_n] : -% image ( -% addto currentpicture doublepath unitsquare -% xscaled mfun_tt_w[mfun_tt_n] -% yscaled (mfun_tt_h[mfun_tt_n] + mfun_tt_d[mfun_tt_n]) -% withprescript "tx_number=" & decimal mfun_tt_n -% withprescript "tx_stage=final" -% % withpostscript str ; % for tracing -% ; ) shifted (0,-mfun_tt_d[mfun_tt_n]) -% else : -% image ( -% addto currentpicture doublepath unitsquare -% ; ) -% fi -% fi -% enddef ; - -% vardef rawtextext(expr str) = % todo: avoid currentpicture -% if str = "" : -% nullpicture -% else : -% mfun_tt_n := mfun_tt_n + 1 ; -% mfun_tt_c := nullpicture ; -% if mfun_trial_run : -% mfun_tt_o := nullpicture ; -% addto mfun_tt_o doublepath origin _op_ ; % save drawoptions -% addto mfun_tt_p doublepath unitsquare -% withprescript "tx_number=" & decimal mfun_tt_n -% withprescript "tx_stage=extra" -% withpostscript str ; -% addto mfun_tt_c doublepath unitsquare -% withprescript "tx_number=" & decimal mfun_tt_n -% withprescript "tx_stage=trial" -% withprescript "tx_color=" & colordecimals colorpart mfun_tt_o -% withpostscript str ; -% elseif known mfun_tt_d[mfun_tt_n] : -% addto mfun_tt_c doublepath unitsquare -% xscaled mfun_tt_w[mfun_tt_n] -% yscaled (mfun_tt_h[mfun_tt_n] + mfun_tt_d[mfun_tt_n]) -% shifted (0,-mfun_tt_d[mfun_tt_n]) -% withprescript "tx_number=" & decimal mfun_tt_n -% withprescript "tx_stage=final" ; -% else : -% addto mfun_tt_c doublepath unitsquare ; % unitpicture -% fi ; -% mfun_tt_c -% fi -% enddef ; +% see mp-keep.mpiv for older code vardef rawtextext(expr str) = % todo: avoid currentpicture if str = "" : diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 642a38063..d44a00ccd 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.10.31 00:11} +\newcontextversion{2014.10.31 12:47} %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 0d9ec2303..8575e21a7 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 6557a4e11..5831b21b4 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.10.31 00:11} +\edef\contextversion{2014.10.31 12:47} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/meta-ini.mkiv b/tex/context/base/meta-ini.mkiv index aa8ae24f8..dc8ccd7d6 100644 --- a/tex/context/base/meta-ini.mkiv +++ b/tex/context/base/meta-ini.mkiv @@ -224,6 +224,7 @@ \defineMPinstance[decimalfun][\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes,\c!method=\s!decimal] \defineMPinstance[mprun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes] \defineMPinstance[metapost] [\s!format=mpost] +\defineMPinstance[megapost] [\s!format=mpost,\c!method=\s!double] \defineMPinstance[nofun] [\s!format=mpost] \newconditional\c_meta_include_initializations @@ -1222,6 +1223,18 @@ PageFraction := if \lastpage>1: (\realfolio-1)/(\lastpage-1) else: 1 fi ; \stopMPinitializations +\startMPdefinitions {metapost} + if unknown context_bare : input mp-bare.mpiv ; fi ; +\stopMPdefinitions + +\startMPdefinitions {megapost} + if unknown context_bare : input mp-bare.mpiv ; fi ; +\stopMPdefinitions + +% \startMPdefinitions {nofun} +% if unknown context_bare : input mp-bare.mpiv ; fi ; +% \stopMPdefinitions + %D And some more. These are not really needed since we %D don't use the normal figure inclusion macros any longer. diff --git a/tex/context/base/mlib-pps.lua b/tex/context/base/mlib-pps.lua index 3f41b1bc9..e580e4dcc 100644 --- a/tex/context/base/mlib-pps.lua +++ b/tex/context/base/mlib-pps.lua @@ -505,10 +505,12 @@ local function sxsy(wd,ht,dp) -- helper for text return (wd ~= 0 and factor/wd) or 0, (hd ~= 0 and factor/hd) or 0 end -local no_first_run = "mfun_first_run := false ;" -local do_first_run = "mfun_first_run := true ;" -local no_trial_run = "mfun_trial_run := false ;" -local do_trial_run = "mfun_trial_run := true ;" +-- for stock mp we need to declare the booleans first + +local no_first_run = "boolean mfun_first_run ; mfun_first_run := false ;" +local do_first_run = "boolean mfun_first_run ; mfun_first_run := true ;" +local no_trial_run = "boolean mfun_trial_run ; mfun_trial_run := false ;" +local do_trial_run = "boolean mfun_trial_run ; mfun_trial_run := true ;" local do_begin_fig = "; beginfig(1) ; " local do_end_fig = "; endfig ;" local do_safeguard = ";" diff --git a/tex/context/base/publ-aut.lua b/tex/context/base/publ-aut.lua index f483075a1..53f270d08 100644 --- a/tex/context/base/publ-aut.lua +++ b/tex/context/base/publ-aut.lua @@ -226,13 +226,15 @@ local function the_initials(initials,symbol,connector) for i=1,#initials do local initial = initials[i] if type(initial) == "table" then + local set, s = { }, 0 for i=1,#initial do if i > 1 then - r = r + 1 ; result[r] = connector + s = s + 1 ; set[s] = connector end - r = r + 1 ; result[r] = initial[i] - r = r + 1 ; result[r] = symbol + s = s + 1 ; set[s] = initial[i] + s = s + 1 ; set[s] = symbol end + r = r + 1 ; result[r] = concat(set) else r = r + 1 ; result[r] = initial r = r + 1 ; result[r] = symbol @@ -412,10 +414,11 @@ local function components(snippet,short) local initials = snippet.initials local firstnames = not short and snippet.firstnames local juniors = snippet.juniors +-- inspect(initials) return vons and #vons > 0 and concat(vons, " ") or "", surnames and #surnames > 0 and concat(surnames, " ") or "", - initials and #initials > 0 and concat(the_initials(initials)) or "", + initials and #initials > 0 and concat(the_initials(initials)," ") or "", firstnames and #firstnames > 0 and concat(firstnames," ") or "", juniors and #juniors > 0 and concat(juniors, " ") or "" end diff --git a/tex/context/base/publ-ini.mkiv b/tex/context/base/publ-ini.mkiv index f2210bac4..8114b4a56 100644 --- a/tex/context/base/publ-ini.mkiv +++ b/tex/context/base/publ-ini.mkiv @@ -1346,16 +1346,47 @@ \definebtxrendering [\v!standard] +\setupbtxlistvariant + [\c!namesep={, }, + \c!lastnamesep={ \btxlabeltext{\currentbtxalternative:and} }, + \c!finalnamesep={ \btxlabeltext{\currentbtxalternative:and} }, + \c!firstnamesep={ }, + % \c!andtext={ \btxlabeltext{\currentbtxalternative:and} }, + \c!otherstext={ \btxlabeltext{\currentbtxalternative:others}}, + \c!juniorsep={ }, + \c!vonsep={ }, + \c!initialsep={ }, + \c!surnamesep={, }, + \c!surnameinitialsep={, }, + \c!surnamefirstnamesep={, }, + \c!etallimit=5, + \c!etaldisplay=\btxlistvariantparameter\c!etallimit, + %c!journalconversion=\v!normal, + \c!monthconversion=\v!number, + \c!authorconversion=\v!normal] + +\definebtxlistvariant + [author] + +\definebtxlistvariant + [editor] + [author] + +\definebtxlistvariant + [artauthor] + [author] + +\definebtxlistvariant + [invertedshort] + \setupbtxcitevariant [\c!interaction=\v!start, % \c!setups=btx:cite:initialize, \c!alternative=num, - \c!authorconversion=\v!normal, - % \c!andtext={ \btxlabeltext{\currentbtxalternative:and} }, - \c!otherstext={ \btxlabeltext{\currentbtxalternative:others}}, - \c!pubsep={, }, - \c!lastpubsep={ \btxlabeltext{\currentbtxalternative:and} }, - \c!finalpubsep={ \btxlabeltext{\currentbtxalternative:and} }, + % APA 2013 section 6.16 (p. 177) + \c!pubsep={; }, % {, }, + \c!lastpubsep={; }, % { \btxlabeltext{\currentbtxalternative:and} }, + \c!finalpubsep={; }, % { \btxlabeltext{\currentbtxalternative:and} }, \c!compress=\v!no, \c!inbetween={ }, \c!range=\endash, @@ -1415,6 +1446,9 @@ [year] [\c!left={(}, \c!middle={, }, % is middle used? + \c!pubsep={, }, + \c!lastpubsep={, }, + \c!finalpubsep={, }, \c!right={)}] \definebtxcitevariant @@ -1491,10 +1525,10 @@ \c!middle={, }, \c!right={]}] -\setupbtxlistvariant +\setupbtxcitevariant [\c!namesep={, }, - \c!lastnamesep={ \btxlabeltext{\currentbtxalternative:and} }, - \c!finalnamesep={ \btxlabeltext{\currentbtxalternative:and} }, + \c!lastnamesep={\nobreakspace\textampersand\space}, + \c!finalnamesep={\nobreakspace\textampersand\space}, \c!firstnamesep={ }, % \c!andtext={ \btxlabeltext{\currentbtxalternative:and} }, \c!otherstext={ \btxlabeltext{\currentbtxalternative:others}}, @@ -1504,43 +1538,9 @@ \c!surnamesep={, }, \c!surnameinitialsep={, }, \c!surnamefirstnamesep={, }, - \c!etallimit=5, - \c!etaldisplay=\btxlistvariantparameter\c!etallimit, - %c!journalconversion=\v!normal, + \c!etallimit=5, % when 2-4, show all first time, etaldisplay subsequently... + \c!etaldisplay=1, \c!monthconversion=\v!number, - \c!authorconversion=\v!normal] - -\definebtxlistvariant - [author] - -\definebtxlistvariant - [editor] - [author] - -\definebtxlistvariant - [artauthor] - [author] - -\definebtxlistvariant - [invertedshort] - -% Not that efficient but ... - -\setupbtxcitevariant - [\c!namesep=\btxlistvariantparameter\c!namesep, - \c!lastnamesep=\btxlistvariantparameter\c!lastnamesep, - \c!finalnamesep=\btxlistvariantparameter\c!finalnamesep, - \c!firstnamesep=\btxlistvariantparameter\c!firstnamesep, - \c!juniorsep=\btxlistvariantparameter\c!juniorsep, - \c!vonsep=\btxlistvariantparameter\c!vonsep, - \c!initialsep=\btxlistvariantparameter\c!initialsep, - \c!surnamesep=\btxlistvariantparameter\c!surnamesep, - \c!surnameinitialsep=\btxlistvariantparameter\c!surnameinitialsep, - \c!surnamefirstnamesep=\btxlistvariantparameter\c!surnamefirstnamesep, - \c!etallimit=\btxlistvariantparameter\c!etallimit, - \c!etaldisplay=\btxlistvariantparameter\c!etaldisplay, - \c!otherstext=\btxlistvariantparameter\c!otherstext, - \c!monthconversion=\btxlistvariantparameter\c!monthconversion, \c!authorconversion=\v!name] % Do we want these in the format? Loading them delayed is somewhat messy. diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index 9826aa676..e8db291f4 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 c6983a8ee..ba262cf4a 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 b2cf24d9e..51064940a 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 : 10/31/14 00:11:07 +-- merge date : 10/31/14 12:47:47 do -- begin closure to overcome local limits and interference -- cgit v1.2.3