summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-03-23 18:35:01 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-03-23 18:35:01 +0100
commit576286d4c1349c644bea833c99ec5364668ffc8a (patch)
treeddaa0e3880a084eb52cf0cc9658d5e2d59377392 /tex
parent1987348696a38821137cc579a986d37086b87404 (diff)
downloadcontext-576286d4c1349c644bea833c99ec5364668ffc8a.tar.gz
2017-03-23 17:26:00
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/mkii/cont-new.mkii2
-rw-r--r--tex/context/base/mkii/context.mkii2
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/math-fen.mkiv123
-rw-r--r--tex/context/base/mkiv/math-noa.lua17
-rw-r--r--tex/context/base/mkiv/mult-ini.mkiv1
-rw-r--r--tex/context/base/mkiv/publ-dat.lua7
-rw-r--r--tex/context/base/mkiv/publ-imp-apa.lua8
-rw-r--r--tex/context/base/mkiv/publ-imp-apa.mkvi129
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin25656 -> 25647 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin422634 -> 422616 bytes
-rw-r--r--tex/context/base/mkiv/tabl-xtb.mkvi25
-rw-r--r--tex/context/base/mkiv/util-lib.lua16
-rw-r--r--tex/context/interface/mkiv/i-context.pdfbin804232 -> 804366 bytes
-rw-r--r--tex/context/interface/mkiv/i-mathfence.xml3
-rw-r--r--tex/context/interface/mkiv/i-readme.pdfbin60773 -> 60772 bytes
-rw-r--r--tex/context/modules/mkiv/x-asciimath.lua12
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
19 files changed, 260 insertions, 91 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index f480ab318..74e8c6681 100644
--- a/tex/context/base/mkii/cont-new.mkii
+++ b/tex/context/base/mkii/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2017.03.22 11:57}
+\newcontextversion{2017.03.23 17:20}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii
index d29fb8fd4..e4c100754 100644
--- a/tex/context/base/mkii/context.mkii
+++ b/tex/context/base/mkii/context.mkii
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2017.03.22 11:57}
+\edef\contextversion{2017.03.23 17:20}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 86d4d8ca4..ae8d8b1f0 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2017.03.22 11:57}
+\newcontextversion{2017.03.23 17:20}
%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/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index 51f13612a..940c5de76 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -39,7 +39,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2017.03.22 11:57}
+\edef\contextversion{2017.03.23 17:20}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/math-fen.mkiv b/tex/context/base/mkiv/math-fen.mkiv
index 2d2a9eb46..9c856904e 100644
--- a/tex/context/base/mkiv/math-fen.mkiv
+++ b/tex/context/base/mkiv/math-fen.mkiv
@@ -43,7 +43,8 @@
\c!middle=,
\c!mathstyle=,
\c!color=,
- \c!command=]
+ \c!command=,
+ \c!factor=] % == auto == none
\appendtoks
\edef\p_command{\mathfenceparameter\c!command}%
@@ -56,40 +57,65 @@
\newconditional\c_math_fenced_mirror \settrue\c_math_fenced_mirror
-\def\math_fenced_left {\edef\p_left
- {\ifconditional\c_math_fenced_mirror
- \ifconditional\c_math_right_to_left
- \mathfenceparameter\c!right
- \else
- \mathfenceparameter\c!left
- \fi
- \else
- \mathfenceparameter\c!left
- \fi}%
- \math_fenced_color_push
- \normalleft\ifx\p_left\empty.\else\Udelimiter\plusfour\fam\p_left\relax\fi
- \math_fenced_color_pop}
-
-\def\math_fenced_middle{\edef\p_middle{\mathfenceparameter\c!middle}%
- \mskip\thinmuskip
- \math_fenced_color_push
- \normalmiddle\ifx\p_middle\empty.\else\Udelimiter\plusfour\fam\p_middle\relax\fi
- \math_fenced_color_pop
- \mskip\thinmuskip}
-
-\def\math_fenced_right {\edef\p_right
- {\ifconditional\c_math_fenced_mirror
- \ifconditional\c_math_right_to_left
- \mathfenceparameter\c!left
- \else
- \mathfenceparameter\c!right
- \fi
- \else
- \mathfenceparameter\c!right
- \fi}%
- \math_fenced_color_push
- \normalright\ifx\p_right\empty.\else\Udelimiter\plusfive\fam\p_right\relax\fi
- \math_fenced_color_pop}
+\unexpanded\def\math_fenced_inject#1#2#3#4%
+ {\ifx#1\empty
+ #2.%
+ \else
+ \edef\p_factor{\mathfenceparameter\c!factor}%
+ \ifx\p_factor\empty
+ #2%
+ \else\ifx\p_factor\v!none
+ #2%
+ \else\ifx\p_factor\v!auto
+ #2%
+ \else
+ \scratchdimen\dimexpr\p_factor\bodyfontsize/2\relax
+ #3\s!height\scratchdimen\s!depth\scratchdimen\s!axis
+ \fi\fi\fi
+ \Udelimiter#4\fam#1\relax
+ \fi}
+
+\def\math_fenced_left
+ {\edef\p_left
+ {\ifconditional\c_math_fenced_mirror
+ \ifconditional\c_math_right_to_left
+ \mathfenceparameter\c!right
+ \else
+ \mathfenceparameter\c!left
+ \fi
+ \else
+ \mathfenceparameter\c!left
+ \fi}%
+ \math_fenced_color_push
+ % \normalleft\ifx\p_left\empty.\else\Udelimiter\plusfour\fam\p_left\relax\fi
+ \math_fenced_inject\p_left\normalleft\Uleft\plusfour
+ \math_fenced_color_pop}
+
+\def\math_fenced_middle
+ {\edef\p_middle
+ {\mathfenceparameter\c!middle}%
+ \mskip\thinmuskip
+ \math_fenced_color_push
+ % \normalmiddle\ifx\p_middle\empty.\else\Udelimiter\plusfour\fam\p_middle\relax\fi
+ \math_fenced_inject\p_middle\normalmiddle\Umiddle\plusfour
+ \math_fenced_color_pop
+ \mskip\thinmuskip}
+
+\def\math_fenced_right
+ {\edef\p_right
+ {\ifconditional\c_math_fenced_mirror
+ \ifconditional\c_math_right_to_left
+ \mathfenceparameter\c!left
+ \else
+ \mathfenceparameter\c!right
+ \fi
+ \else
+ \mathfenceparameter\c!right
+ \fi}%
+ \math_fenced_color_push
+ % \normalright \ifx\p_right\empty.\else\Udelimiter\plusfive\fam\p_right\relax\fi
+ \math_fenced_inject\p_right\normalright\Uright\plusfive
+ \math_fenced_color_pop}
\def\math_fenced_color_do_push{\pushcolor[\p_math_fenced_color]}
\let\math_fenced_color_do_pop \popcolor
@@ -102,11 +128,8 @@
\newcount\c_math_fenced_nesting
-\unexpanded\def\math_fenced_fenced_start#1%
- {\advance\c_math_fenced_nesting\plusone
- \begingroup
- \edef\currentmathfence{#1}%
- \startusemathstyleparameter\mathfenceparameter
+\unexpanded\def\math_fenced_fenced_common
+ {\startusemathstyleparameter\mathfenceparameter
\let\fence\math_fenced_middle
\edef\p_math_fenced_color{\mathfenceparameter\c!color}%
\ifx\p_math_fenced_color\empty
@@ -115,7 +138,13 @@
\else
\let\math_fenced_color_push\math_fenced_color_do_push
\let\math_fenced_color_pop \math_fenced_color_do_pop
- \fi
+ \fi}
+
+\unexpanded\def\math_fenced_fenced_start#1%
+ {\advance\c_math_fenced_nesting\plusone
+ \begingroup
+ \edef\currentmathfence{#1}%
+ \math_fenced_fenced_common
\math_fenced_left}
\unexpanded\def\math_fenced_fenced_stop#1%
@@ -125,8 +154,16 @@
\endgroup
\advance\c_math_fenced_nesting\minusone}
-\unexpanded\def\math_fenced_fenced[#1]#2%
- {\math_fenced_fenced_start{#1}%
+\unexpanded\def\math_fenced_fenced[#1]%
+ {\advance\c_math_fenced_nesting\plusone
+ \begingroup
+ \edef\currentmathfence{#1}%
+ \dosingleempty\math_fenced_fenced_indeed}
+
+\unexpanded\def\math_fenced_fenced_indeed[#1]#2%
+ {\iffirstargument\setupcurrentmathfence[#1]\fi
+ \math_fenced_fenced_common
+ \math_fenced_left
#2%
\math_fenced_right
\stopusemathstyleparameter
diff --git a/tex/context/base/mkiv/math-noa.lua b/tex/context/base/mkiv/math-noa.lua
index e8918a978..3a45bb30d 100644
--- a/tex/context/base/mkiv/math-noa.lua
+++ b/tex/context/base/mkiv/math-noa.lua
@@ -186,6 +186,13 @@ local left_fence_code = fencecodes.left
local middle_fence_code = fencecodes.middle
local right_fence_code = fencecodes.right
+-- local mathclasses = mathematics.classes
+-- local fenceclasses = {
+-- [left_fence_code] = mathclasses.open,
+-- [middle_fence_code] = mathclasses.middle,
+-- [right_fence_code] = mathclasses.close,
+-- }
+
-- this initial stuff is tricky as we can have removed and new nodes with the same address
-- the only way out is a free-per-page list of nodes (not bad anyway)
@@ -711,6 +718,8 @@ function handlers.resize(head,style,penalties)
return true
end
+-- still not perfect:
+
local a_autofence = privateattribute("mathautofence")
local autofences = { }
processors.autofences = autofences
@@ -732,6 +741,7 @@ local function makefence(what,char)
end
setsubtype(f,what)
setfield(f,"delim",d)
+ setfield(f,"class",-1) -- tex itself does this, so not fenceclasses[what]
return f
end
@@ -831,20 +841,23 @@ local function processfences(pointer,n,parent)
local open = remove(stack)
if open then
if trace_fences then
- report_fences("%2i: handling %s, stack depth %i",n,"both",#stack)
+ report_fences("%2i: handling %s, stack depth %i",n,"both",#stack+1)
end
current = convert_both(open,current,middle)
elseif current == start then
-- skip
else
if trace_fences then
- report_fences("%2i: handling %s, stack depth %i",n,"close",#stack)
+ report_fences("%2i: handling %s, stack depth %i",n,"close",#stack+1)
end
current = convert_close(current,initial,middle)
if not parent then
initial = current
end
end
+ if trace_fences then
+ report_fences("%2i: popping close from stack",n)
+ end
elseif a == 3 then
if trace_fences then
report_fences("%2i: registering middle",n)
diff --git a/tex/context/base/mkiv/mult-ini.mkiv b/tex/context/base/mkiv/mult-ini.mkiv
index 6fbbd981d..8fd0d9472 100644
--- a/tex/context/base/mkiv/mult-ini.mkiv
+++ b/tex/context/base/mkiv/mult-ini.mkiv
@@ -122,6 +122,7 @@
\def\s!filll {filll}
\def\s!to {to} \let\!!to \s!to % obsolete
\def\s!attr {attr}
+\def\s!axis {axis}
\def\s!bottom{bottom}
\def\s!top {top}
diff --git a/tex/context/base/mkiv/publ-dat.lua b/tex/context/base/mkiv/publ-dat.lua
index f57efa9a1..8eb923407 100644
--- a/tex/context/base/mkiv/publ-dat.lua
+++ b/tex/context/base/mkiv/publ-dat.lua
@@ -1217,7 +1217,12 @@ do
end
end
- local pagessplitter = lpeg.splitat(P("-")^1)
+ local pagessplitter = lpeg.splitat((
+ P("-") + -- hyphen
+ P("—") + -- U+2014
+ P("–") + -- U+2013
+ P("‒") -- U+2012
+ )^1)
casters.range = function(str)
local first, last = lpegmatch(pagessplitter,str)
diff --git a/tex/context/base/mkiv/publ-imp-apa.lua b/tex/context/base/mkiv/publ-imp-apa.lua
index ec46b7f7e..a725bf22f 100644
--- a/tex/context/base/mkiv/publ-imp-apa.lua
+++ b/tex/context/base/mkiv/publ-imp-apa.lua
@@ -162,11 +162,13 @@ categories.standard = {
categories.book = {
sets = {
author = { "author", "editor", "publisher", "title" },
+ ineditor = { "editor" },
editionset = generic.editionset,
doi = generic.doi,
},
required = { "author" },
optional = {
+ "ineditor",
"withauthor", "translator",
"year", "month", "day",
"subtitle", "type", "file",
@@ -181,6 +183,7 @@ categories.book = {
categories.inbook = {
sets = {
author = { "author", "editor", "publisher", "title", },
+ ineditor = { "editor" },
editionset = generic.editionset,
doi = generic.doi,
},
@@ -189,6 +192,7 @@ categories.inbook = {
"year" ,
},
optional = {
+ "ineditor",
"withauthor", "translator",
"subtitle", "type", "file",
"booktitle", "subbooktitle",
@@ -206,6 +210,7 @@ categories.inbook = {
categories.incollection = {
sets = {
author = { "author", "editor", "publisher", "title", },
+ ineditor = { "editor" },
editionset = generic.editionset,
doi = generic.doi,
},
@@ -215,6 +220,7 @@ categories.incollection = {
"year",
},
optional = {
+ "ineditor",
"withauthor", "translator",
"subtitle", "type", "file",
"subbooktitle",
@@ -450,7 +456,7 @@ categories.electronic = {
categories.film = {
sets = {
doi = generic.doi,
- author = { "producer", "director", },
+ author = { "author", "producer", "director", },
},
required = {
"author",
diff --git a/tex/context/base/mkiv/publ-imp-apa.mkvi b/tex/context/base/mkiv/publ-imp-apa.mkvi
index 06651ea63..182802331 100644
--- a/tex/context/base/mkiv/publ-imp-apa.mkvi
+++ b/tex/context/base/mkiv/publ-imp-apa.mkvi
@@ -83,6 +83,11 @@
[apa:\s!list:author]
\definebtx
+ [apa:\s!list:ineditor]
+ [apa:\s!list:editor]
+ [\c!authorconversion=normalshort]
+
+\definebtx
[apa:\s!list:translator]
[apa:\s!list:author]
[\c!authorconversion=normalshort]
@@ -196,8 +201,17 @@
[apa:\s!list:title]
\definebtx
+ [apa:\s!list:booktitle:inbook]
+ [apa:\s!list:title]
+
+\definebtx
[apa:\s!list:title:inbook]
[apa:\s!list:title]
+ [\c!style=] % booktitle is set in italics
+
+\definebtx
+ [apa:\s!list:booktitle:incollection]
+ [apa:\s!list:title]
\definebtx
[apa:\s!list:title:incollection]
@@ -209,11 +223,19 @@
[apa:\s!list:title]
\definebtx
+ [apa:\s!list:booktitle:inproceedings]
+ [apa:\s!list:title]
+
+\definebtx
[apa:\s!list:title:inproceedings]
[apa:\s!list:title]
[\c!style=] % booktitle is set in italics
\definebtx
+ [apa:\s!list:booktitle:conference]
+ [apa:\s!list:title]
+
+\definebtx
[apa:\s!list:title:conference]
[apa:\s!list:title]
[\c!style=] % booktitle is set in italics
@@ -488,7 +510,7 @@
\setupbtxlabeltext
[en]
- [apa:number={no.},
+ [apa:number={No.},
apa:edition={ed.},
apa:Editor={Ed.},
apa:Editors={Eds.},
@@ -497,6 +519,8 @@
apa:nd={n.d.}, % no date
apa:supplement={Suppl.}, % Supplement (not used?)
apa:MotionPicture={Motion picture},
+ apa:Writer=Writer,
+ apa:Writers=Writers,
apa:Producer=Producer,
apa:Producers=Producers,
apa:Director=Director,
@@ -505,11 +529,11 @@
apa:Author=Author,
apa:Translator={Trans.}, % Translator(s)
apa:Advanced={Advanced online publication},
- apa:Retrieved={Available from}] % {Retrieved from},
+ apa:Retrieved={Retrieved from}] % {Available from}]
\setupbtxlabeltext
[nl]
- [apa:number={nr.},
+ [apa:number={Nr.},
apa:edition={ed.}, % editie
apa:Editor=Editor, % Ed./Eds.
apa:Editors=Editors,
@@ -518,6 +542,8 @@
apa:nd={g.d.} % geen datum
apa:supplement=Supplement,
apa:MotionPicture=Film, % ?
+ apa:Writer=Scenarioschrijver, % ?
+ apa:Writers=Schrijvers, % ?
apa:Producer=Producent, % ?
apa:Producers=Producents, % ?
apa:Director=Directeur,
@@ -526,11 +552,11 @@
apa:Author=Auteur,
apa:Translator=Vertaler,
apa:Advanced={Geavanceerde online publicatie},
- apa:Retrieved={Beschikbaar vanaf}] % {Ontvangen van},
+ apa:Retrieved={Ontvangen van}] % {Beschikbaar vanaf}]
\setupbtxlabeltext
[fr]
- [apa:number={n\high{o}},
+ [apa:number={N\high{o}},
apa:edition={édition},
apa:Editor=Éditeur,
apa:Editors=Éditeurs,
@@ -539,6 +565,8 @@
apa:nd={s.d.} % sans date
apa:supplement=Supplément,
apa:MotionPicture={Film cinématographique},
+ apa:Writer=Scénariste,
+ apa:Writers=Scénaristes,
apa:Producer=Producteur,
apa:Producers=Producteurs,
apa:Director=Réalisateur,
@@ -547,11 +575,11 @@
apa:Author=Auteur,
apa:Translator=Traducteur,
apa:Advanced={Publication en ligne anticipée},
- apa:Retrieved={Disponible à}] % {Téléchargé de},
+ apa:Retrieved={Téléchargé de}] % {Disponible à}]
\setupbtxlabeltext
[de]
- [apa:number={nr.},
+ [apa:number={Nr.},
apa:edition=Auf\/lage,
apa:Editor=Herausgeber, % Hrsg./Hg.
apa:Editors=Herausgeber,
@@ -560,6 +588,8 @@
apa:nd={o.D.}, % ohne Datum (mostly: o.J. / ohne Jahr)
apa:supplement={Beilage}, % Supplement
apa:MotionPicture=Kinofilm, % ?
+ apa:Writer=Drehbuchautor, % ?
+ apa:Writers=Schriftsteller, % ?
apa:Producer=Producer, % ?
apa:Producers=Produzenten, % ?
apa:Director=Director, % ?
@@ -574,7 +604,7 @@
\setupbtxlabeltext
[it]
- [apa:number={nº},
+ [apa:number={Nº},
apa:edition={ed.}, % edizione
apa:Editor={A cura di},
apa:Editors={A cura di},
@@ -583,6 +613,8 @@
apa:nd={s.d.}, % senza data
apa:supplement={Supplemento},
apa:MotionPicture=Film, % ?
+ apa:Writer=Sceneggiatore, % ?
+ apa:Writers=Scrittori, % ?
apa:Producer=Produttore,
apa:Producers=Produttori,
apa:Director=Direttore,
@@ -595,7 +627,7 @@
\setupbtxlabeltext
[es]
- [apa:number={nº},
+ [apa:number={Nº},
apa:edition={ed.}, % edición
apa:Editor=Editor, % Ed./Eds.
apa:Editors=Editores,
@@ -604,6 +636,8 @@
apa:nd={s.f.}, % sin fecha
apa:supplement=Suplemento,
apa:MotionPicture=Cinematográfica,
+ apa:Writer=Guionista, % ?
+ apa:Writers=Escritores, % ?
apa:Producer=Productor,
apa:Producers=Productores,
apa:Director=Director,
@@ -612,7 +646,7 @@
apa:Author=Autor,
apa:Translator=Traductor,
apa:Advanced={Publicación en línea avanzada},
- apa:Retrieved={Disponible desde}] % {Obtenido de},
+ apa:Retrieved={Obtenido de}] % {Disponible desde}]
% cite setups
@@ -706,7 +740,7 @@
\begingroup
\language[\mainbtxlanguage]
\btxleftbracket
- \btxusecommand [apa:\s!list:title:\currentbtxcategory] {
+ \btxusecommand [apa:\s!list:#title:\currentbtxcategory] {
\btxflush{#title:\mainbtxlanguage}
}
\btxrightbracket
@@ -716,10 +750,10 @@
\stoptexdefinition
\starttexdefinition unexpanded btx:apa:composed-title #title
- \btxstartstyleandcolor[apa:\s!list:title:\currentbtxcategory]
+ \btxstartstyleandcolor[apa:\s!list:#title:\currentbtxcategory]
\begingroup
\language[\currentbtxlanguage]
- \btxusecommand [apa:\s!list:title:\currentbtxcategory] {
+ \btxusecommand [apa:\s!list:#title:\currentbtxcategory] {
\btxflush{#title}
\btxdoif {sub#title} {
\btxcolon
@@ -747,6 +781,22 @@
\texdefinition{btx:apa:composed-title}{title}
}
\btxdoif {title} {
+ % A book might have an editor AND an author
+ \doif {\currentbtxcategory} {book} {
+ \doifnot {\btxfoundname{author}} {editor} {
+ \btxdoif {ineditor} { % ineditor authorconversion
+ \btxleftparenthesis
+ \btxflush{ineditor}
+ \btxcomma
+ \btxsingularorplural {ineditor} {
+ \btxlabeltext{apa:Editor}
+ } {
+ \btxlabeltext{apa:Editors}
+ }
+ \btxrightparenthesis
+ }
+ }
+ }
\btxdoif {translator} {
\btxleftparenthesis
\btxflush{translator}
@@ -794,6 +844,7 @@
\starttexdefinition unexpanded btx:apa:author-or-editor #author
\btxdoifelse {#author} {
\btxflush{#author}
+ % use \processaction [] [] here?
\doifelse {\btxfoundname{#author}} {editor} {
\btxleftparenthesis
\btxsingularorplural {editor} {
@@ -802,16 +853,40 @@
\btxlabeltext{apa:Editors}
}
\btxrightparenthesis
- } {
- \doifelse {\btxfoundname{#author}} {producer} {
- \btxleftparenthesis
- \btxsingularorplural {producer} {
- \btxlabeltext{apa:Producer}
+ } {\doif {\btxfoundname{#author}} {ineditor} {
+ \btxleftparenthesis
+ \btxsingularorplural {ineditor} {
+ \btxlabeltext{apa:Editor}
+ } {
+ \btxlabeltext{apa:Editors}
+ }
+ \btxrightparenthesis
+ } }
+ \doif {\currentbtxcategory} {film} {
+ \btxleftparenthesis
+ \doifelse {\btxfoundname{#author}} {director} {
+ \btxsingularorplural {director} {
+ \btxlabeltext{apa:Director}
} {
- \btxlabeltext{apa:Producers}
+ \btxlabeltext{apa:Directors}
+ }
+ } {
+ \doif {\btxfoundname{#author}} {author} {
+ \btxsingularorplural {author} {
+ \btxlabeltext{apa:Writer}
+ } {
+ \btxlabeltext{apa:Writers}
+ }
+ }
+ \doif {\btxfoundname{#author}} {producer} {
+ \btxsingularorplural {producer} {
+ \btxlabeltext{apa:Producer}
+ } {
+ \btxlabeltext{apa:Producers}
+ }
}
- \btxrightparenthesis
\btxdoif {director} {
+ \btxrightparenthesis
\removeunwantedspaces
\btxparameter{\c!separator:names:3}
\btxflush{director}
@@ -821,19 +896,9 @@
} {
\btxlabeltext{apa:Directors}
}
- \btxrightparenthesis
- }
- } {
- \doif {\btxfoundname{#author}} {director} {
- \btxleftparenthesis
- \btxsingularorplural {director} {
- \btxlabeltext{apa:Director}
- } {
- \btxlabeltext{apa:Directors}
- }
- \btxrightparenthesis
}
}
+ \btxrightparenthesis
}
\btxdoif {withauthor} {
\btxleftparenthesis
@@ -877,7 +942,7 @@
\btxlabeltext{In}
\doifnot {\btxfoundname{author}} {editor} {
\btxspace
- \texdefinition{btx:apa:author-or-editor} {editor}
+ \texdefinition{btx:apa:author-or-editor} {ineditor}
}
\btxspace
\texdefinition{btx:apa:composed-title}{booktitle}
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index f8d27c500..0490d86ec 100644
--- a/tex/context/base/mkiv/status-files.pdf
+++ b/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index a4f723e61..61a645e8a 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/tabl-xtb.mkvi b/tex/context/base/mkiv/tabl-xtb.mkvi
index 851b6e80f..f7d682631 100644
--- a/tex/context/base/mkiv/tabl-xtb.mkvi
+++ b/tex/context/base/mkiv/tabl-xtb.mkvi
@@ -245,6 +245,8 @@
\d_tabl_x_textwidth\p_textwidth
\fi}
+\newtoks\everypreparextable
+
\unexpanded\def\tabl_x_prepare#settings% assumes \iffirstargument to be set
{\advance\c_tabl_x_nesting\plusone
\dostarttaggedchained\t!table\empty\??xtable
@@ -252,6 +254,7 @@
\tabl_x_set_checked{#settings}%
\fi
\tabl_x_check_textwidth
+ \the\everypreparextable
}% else whitespace mess
\def\tabl_x_get_buffer
@@ -807,4 +810,26 @@
{\tabl_x_stop_row
\endgroup}
+%D A bonus, not advertised but some like it this way:
+
+\unexpanded\def\tabl_x_nc
+ {\startxrow
+ \let\NC\tabl_x_nc_next
+ \let\NR\tabl_x_nr
+ \startxcell}
+
+\unexpanded\def\tabl_x_nc_next
+ {\stopxcell
+ \startxcell}
+
+\unexpanded\def\tabl_x_nr
+ {\stopxcell
+ \stopxrow
+ \let\NC\tabl_x_nc}
+
+\appendtoks
+ \let\NC\tabl_x_nc
+ \let\NR\tabl_x_nr
+\to \everypreparextable
+
\protect \endinput
diff --git a/tex/context/base/mkiv/util-lib.lua b/tex/context/base/mkiv/util-lib.lua
index 98c417b8e..90a06f109 100644
--- a/tex/context/base/mkiv/util-lib.lua
+++ b/tex/context/base/mkiv/util-lib.lua
@@ -100,15 +100,15 @@ local function locate(required,version,trace,report,action)
report("requiring library %a with version %a",required,version or "any")
end
local found_library = nil
+ local required_full = gsub(required,"%.","/") -- package.helpers.lualibfile
+ local required_path = pathpart(required_full)
+ local required_base = nameonly(required_full)
if qualifiedpath(required) then
if isfile(required) then
found_library = required
end
else
-- initialize a few variables
- local required_full = gsub(required,"%.","/") -- package.helpers.lualibfile
- local required_path = pathpart(required_full)
- local required_base = nameonly(required_full)
local required_name = required_base .. "." .. os.libsuffix
local version = type(version) == "string" and version ~= "" and version or false
local engine = environment.ownmain or false
@@ -233,6 +233,10 @@ do
local trace_swiglib = false
local savedrequire = require
local loadedlibs = { }
+ local loadlib = package.loadlib
+
+ local pushdir = dir.push
+ local popdir = dir.pop
trackers.register("resolvers.swiglib", function(v) trace_swiglib = v end)
@@ -241,9 +245,9 @@ do
if library == nil then
local trace_swiglib = trace_swiglib or package.helpers.trace
library = locate(required,version,trace_swiglib,report_swiglib,function(name,base)
- dir.push(pathpart(name))
+ pushdir(pathpart(name))
local opener = "luaopen_" .. base
- local library, message = package.loadlib(name,opener)
+ local library, message = loadlib(name,opener)
local libtype = type(library)
if libtype == "function" then
library = library()
@@ -252,7 +256,7 @@ do
report_swiglib("load error: %a returns %a, message %a, library %a",opener,libtype,(string.gsub(message or "no message","[%s]+$","")),found_library or "no library")
library = false
end
- dir.pop()
+ popdir()
return message, library
end)
loadedlibs[required] = library or false
diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf
index 53fbd8f72..f52cf52d3 100644
--- a/tex/context/interface/mkiv/i-context.pdf
+++ b/tex/context/interface/mkiv/i-context.pdf
Binary files differ
diff --git a/tex/context/interface/mkiv/i-mathfence.xml b/tex/context/interface/mkiv/i-mathfence.xml
index a6fa72b23..f20f57057 100644
--- a/tex/context/interface/mkiv/i-mathfence.xml
+++ b/tex/context/interface/mkiv/i-mathfence.xml
@@ -40,6 +40,9 @@
<cd:parameter name="state">
<cd:constant type="auto"/>
</cd:parameter>
+ <cd:parameter name="factor">
+ <cd:constant type="number"/>
+ </cd:parameter>
</cd:assignments>
</cd:arguments>
</cd:command>
diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf
index 05309faec..e224afca9 100644
--- a/tex/context/interface/mkiv/i-readme.pdf
+++ b/tex/context/interface/mkiv/i-readme.pdf
Binary files differ
diff --git a/tex/context/modules/mkiv/x-asciimath.lua b/tex/context/modules/mkiv/x-asciimath.lua
index 927e1cd97..677d3519b 100644
--- a/tex/context/modules/mkiv/x-asciimath.lua
+++ b/tex/context/modules/mkiv/x-asciimath.lua
@@ -1274,6 +1274,15 @@ local function collapse_bars(t)
i = i + 1
end
if l then
+ -- problem: we can have a proper nesting
+local d = false
+for i=1,m do
+ if find(t[i],"\\left") then
+ d = true
+ break
+ end
+end
+if not d then
local tt = { s_lnothing } -- space fools final checker
local tm = 1
for i=1,m do
@@ -1290,6 +1299,7 @@ local function collapse_bars(t)
tt[tm] = s_rnothing -- space fools final checker
m = tm
t = tt
+end
elseif m < n then
for i=n,m+1,-1 do
t[i] = nil
@@ -1739,7 +1749,7 @@ collapse = function(t,level)
-- steps
t = collapse_matrices (t) if trace_detail then show_state(t,level,"matrices") end
t = collapse_bars (t) if trace_detail then show_state(t,level,"bars") end
-t = collapse_stupids (t) if trace_detail then show_state(t,level,"stupids") end
+ t = collapse_stupids (t) if trace_detail then show_state(t,level,"stupids") end
t = collapse_pairs (t) if trace_detail then show_state(t,level,"pairs") end
t = collapse_parentheses(t) if trace_detail then show_state(t,level,"parentheses") end
t = collapse_signs (t) if trace_detail then show_state(t,level,"signs") end
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 93167c68b..5443b4e42 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 : c:/data/develop/context/sources/luatex-fonts-merged.lua
-- parent file : c:/data/develop/context/sources/luatex-fonts.lua
--- merge date : 03/22/17 11:57:55
+-- merge date : 03/23/17 17:20:25
do -- begin closure to overcome local limits and interference