summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2016-10-14 17:42:58 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-10-14 17:42:58 +0200
commitd273e996892fcf539d67c9548c90d96c2877507a (patch)
tree94cde76afdd112bd384f03a908ff0371ef27b5c9 /tex/context/base/mkiv
parent1964c078d21c5f1d19a84fa6ef5c038f8ee80652 (diff)
downloadcontext-d273e996892fcf539d67c9548c90d96c2877507a.tar.gz
2016-10-14 17:25:00
Diffstat (limited to 'tex/context/base/mkiv')
-rw-r--r--tex/context/base/mkiv/anch-bck.mkvi6
-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/lang-hyp.lua28
-rw-r--r--tex/context/base/mkiv/lang-lab.mkiv2
-rw-r--r--tex/context/base/mkiv/mlib-run.lua162
-rw-r--r--tex/context/base/mkiv/mult-def.lua49
-rw-r--r--tex/context/base/mkiv/mult-fun.lua3
-rw-r--r--tex/context/base/mkiv/mult-mps.lua4
-rw-r--r--tex/context/base/mkiv/page-mix.lua27
-rw-r--r--tex/context/base/mkiv/page-mix.mkiv3
-rw-r--r--tex/context/base/mkiv/publ-ini.mkiv2
-rw-r--r--tex/context/base/mkiv/spac-ver.lua111
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin21183 -> 21187 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin368310 -> 368311 bytes
-rw-r--r--tex/context/base/mkiv/strc-des.mkvi4
-rw-r--r--tex/context/base/mkiv/strc-enu.mkvi2
-rw-r--r--tex/context/base/mkiv/trac-deb.lua7
-rw-r--r--tex/context/base/mkiv/typo-fkr.lua48
19 files changed, 314 insertions, 148 deletions
diff --git a/tex/context/base/mkiv/anch-bck.mkvi b/tex/context/base/mkiv/anch-bck.mkvi
index cbdb90291..61f32eaa0 100644
--- a/tex/context/base/mkiv/anch-bck.mkvi
+++ b/tex/context/base/mkiv/anch-bck.mkvi
@@ -228,7 +228,8 @@
\ifgridsnapping
\spac_helpers_assign_skip\textbackgroundskip{\textbackgroundparameter\c!topoffset}%
\ifdim\textbackgroundskip>\zeropoint
- \struttedbox{\hpack{\raise\textbackgroundskip\hpack{\bpos\v_anch_backgrounds_text_current}}}%
+ \struttedbox % not always ok (e.g. setups)
+ {\hpack{\raise\textbackgroundskip\hpack{\bpos\v_anch_backgrounds_text_current}}}%
\else
\bpos\v_anch_backgrounds_text_current
\fi
@@ -281,7 +282,8 @@
\spac_helpers_assign_skip\textbackgroundskip{\textbackgroundparameter\c!bottomoffset}%
\ifgridsnapping % experimental, pascal (todo: topoffset in same way)
\ifdim\textbackgroundskip>\zeropoint
- \struttedbox\plusone{\hpack{\lower\textbackgroundskip\hpack{\epos\v_anch_backgrounds_text_current}}}%
+ \struttedbox % not always ok (e.g. setups)
+ {\hpack{\lower\textbackgroundskip\hpack{\epos\v_anch_backgrounds_text_current}}}%
\else
\epos\v_anch_backgrounds_text_current
\fi
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 33fbbcd9d..2d14d1b1f 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{2016.10.12 17:26}
+\newcontextversion{2016.10.14 17:19}
%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 4442f266c..7a959952f 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{2016.10.12 17:26}
+\edef\contextversion{2016.10.14 17:19}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/lang-hyp.lua b/tex/context/base/mkiv/lang-hyp.lua
index 3d166de40..b80bb003b 100644
--- a/tex/context/base/mkiv/lang-hyp.lua
+++ b/tex/context/base/mkiv/lang-hyp.lua
@@ -50,6 +50,34 @@ if not modules then modules = { } end modules ['lang-hyp'] = {
-- todo: hjcodes (<32 == length) if i really want it
+-- start:
+--
+-- boundary : yes when wordboundary
+-- hlist : when hyphenationbounds 1 or 3
+-- vlist : when hyphenationbounds 1 or 3
+-- rule : when hyphenationbounds 1 or 3
+-- dir : when hyphenationbounds 1 or 3
+-- whatsit : when hyphenationbounds 1 or 3
+-- glue : yes
+-- math : skipped
+-- glyph : exhyphenchar (one only) : yes (so no -- ---)
+-- otherwise : yes
+--
+-- end:
+--
+-- boundary : yes
+-- glyph : yes when different language
+-- glue : yes
+-- penalty : yes
+-- kern : yes when not italic (for some historic reason)
+-- hlist : when hyphenationbounds 2 or 3
+-- vlist : when hyphenationbounds 2 or 3
+-- rule : when hyphenationbounds 2 or 3
+-- dir : when hyphenationbounds 2 or 3
+-- whatsit : when hyphenationbounds 2 or 3
+-- ins : when hyphenationbounds 2 or 3
+-- adjust : when hyphenationbounds 2 or 3
+
local type, rawset, tonumber, next = type, rawset, tonumber, next
local P, R, S, Cg, Cf, Ct, Cc, C, Carg, Cs = lpeg.P, lpeg.R, lpeg.S, lpeg.Cg, lpeg.Cf, lpeg.Ct, lpeg.Cc, lpeg.C, lpeg.Carg, lpeg.Cs
diff --git a/tex/context/base/mkiv/lang-lab.mkiv b/tex/context/base/mkiv/lang-lab.mkiv
index 26c10086f..40845be4a 100644
--- a/tex/context/base/mkiv/lang-lab.mkiv
+++ b/tex/context/base/mkiv/lang-lab.mkiv
@@ -81,6 +81,8 @@
\expandafter\noexpand\csname #1texts\endcsname
\expandafter\noexpand\csname #1text\endcsname}}
+% hm, not interfaced
+
\unexpanded\def\lang_labels_define_class_indeed#1#2#3#4#5#6#7#8#9%
{\setuvalue{setup#1text}{\protecttextprefixes#2\def\currenttextprefixclass{#1}\dodoubleempty\lang_labels_text_prefix_setup}%
\setuvalue{preset#1text}{\protecttextprefixes1\def\currenttextprefixclass{#1}\dodoubleempty\lang_labels_text_prefix_setup}%
diff --git a/tex/context/base/mkiv/mlib-run.lua b/tex/context/base/mkiv/mlib-run.lua
index 871889bbb..10adb7709 100644
--- a/tex/context/base/mkiv/mlib-run.lua
+++ b/tex/context/base/mkiv/mlib-run.lua
@@ -30,7 +30,8 @@ nears zero.</p>
--ldx]]--
local type, tostring, tonumber = type, tostring, tonumber
-local format, gsub, match, find = string.format, string.gsub, string.match, string.find
+local gsub, match, find = string.gsub, string.match, string.find
+local striplines = utilities.strings.striplines
local concat, insert, remove = table.concat, table.insert, table.remove
local emptystring = string.is_empty
@@ -160,14 +161,15 @@ function metapost.reporterror(result)
report_metapost("error: no result object returned")
elseif result.status > 0 then
local t, e, l = result.term, result.error, result.log
+ local report = metapost.texerrors and texerrormessage or report_metapost
if t and t ~= "" then
- (metapost.texerrors and texerrormessage or report_metapost)("terminal: %s",t)
+ report("mp error: %s",striplines(t))
end
if e == "" or e == "no-error" then
e = nil
end
if e then
- (metapost.texerrors and texerrormessage or report_metapost)("error: %s",e)
+ report("mp error: %s",striplines(e))
end
if not t and not e and l then
metapost.lastlog = metapost.lastlog .. "\n" .. l
@@ -416,75 +418,115 @@ function metapost.process(mpx, data, trialrun, flusher, multipass, isextrapass,
end
-- end of hacks
end
- if type(data) == "table" then
- if trace_tracingall then
- mpx:execute("tracingall;")
- end
- -- table.insert(data,2,"")
- for i=1,#data do
- local d = data[i]
- -- d = string.gsub(d,"\r","")
- if d then
- if trace_graphics then
+
+ local function process(d,i)
+ -- d = string.gsub(d,"\r","")
+ if d then
+ if trace_graphics then
+ if i then
tra.inp:write(formatters["\n%% begin snippet %s\n"](i))
- tra.inp:write(d)
+ end
+ tra.inp:write(d)
+ if i then
tra.inp:write(formatters["\n%% end snippet %s\n"](i))
end
- starttiming(metapost.exectime)
- result = mpx:execute(d) -- some day we wil use a coroutine with textexts
- stoptiming(metapost.exectime)
- if trace_graphics and result then
- local str = result.log or result.error
- if str and str ~= "" then
- tra.log:write(str)
- end
+ end
+ starttiming(metapost.exectime)
+ result = mpx:execute(d) -- some day we wil use a coroutine with textexts
+ stoptiming(metapost.exectime)
+ if trace_graphics and result then
+ local str = result.log or result.error
+ if str and str ~= "" then
+ tra.log:write(str)
end
- if not metapost.reporterror(result) then
- if metapost.showlog then
- local str = result.term ~= "" and result.term or "no terminal output"
- if not emptystring(str) then
- metapost.lastlog = metapost.lastlog .. "\n" .. str
- report_metapost("log: %s",str)
- end
- end
- if result.fig then
- converted = metapost.convert(result, trialrun, flusher, multipass, askedfig)
+ end
+ if not metapost.reporterror(result) then
+ if metapost.showlog then
+ local str = result.term ~= "" and result.term or "no terminal output"
+ if not emptystring(str) then
+ metapost.lastlog = metapost.lastlog .. "\n" .. str
+ report_metapost("log: %s",str)
end
end
- else
- report_metapost("error: invalid graphic component %s",i)
+ if result.fig then
+ converted = metapost.convert(result, trialrun, flusher, multipass, askedfig)
+ end
end
+ elseif i then
+ report_metapost("error: invalid graphic component %s",i)
+ else
+ report_metapost("error: invalid graphic")
end
- else
+ end
+
+ if type(data) == "table" then
if trace_tracingall then
- data = "tracingall;" .. data
- end
- if trace_graphics then
- tra.inp:write(data)
+ mpx:execute("tracingall;")
end
- starttiming(metapost.exectime)
- result = mpx:execute(data)
- stoptiming(metapost.exectime)
- if trace_graphics and result then
- local str = result.log or result.error
- if str and str ~= "" then
- tra.log:write(str)
- end
+ -- table.insert(data,2,"")
+ for i=1,#data do
+ process(data[i],i)
+-- local d = data[i]
+-- -- d = string.gsub(d,"\r","")
+-- if d then
+-- if trace_graphics then
+-- tra.inp:write(formatters["\n%% begin snippet %s\n"](i))
+-- tra.inp:write(d)
+-- tra.inp:write(formatters["\n%% end snippet %s\n"](i))
+-- end
+-- starttiming(metapost.exectime)
+-- result = mpx:execute(d) -- some day we wil use a coroutine with textexts
+-- stoptiming(metapost.exectime)
+-- if trace_graphics and result then
+-- local str = result.log or result.error
+-- if str and str ~= "" then
+-- tra.log:write(str)
+-- end
+-- end
+-- if not metapost.reporterror(result) then
+-- if metapost.showlog then
+-- local str = result.term ~= "" and result.term or "no terminal output"
+-- if not emptystring(str) then
+-- metapost.lastlog = metapost.lastlog .. "\n" .. str
+-- report_metapost("log: %s",str)
+-- end
+-- end
+-- if result.fig then
+-- converted = metapost.convert(result, trialrun, flusher, multipass, askedfig)
+-- end
+-- end
+-- else
+-- report_metapost("error: invalid graphic component %s",i)
+-- end
end
- -- todo: error message
- if not result then
- report_metapost("error: no result object returned")
- elseif result.status > 0 then
- report_metapost("error: %s",(result.term or "no-term") .. "\n" .. (result.error or "no-error"))
- else
- if metapost.showlog then
- metapost.lastlog = metapost.lastlog .. "\n" .. result.term
- report_metapost("info: %s",result.term or "no-term")
- end
- if result.fig then
- converted = metapost.convert(result, trialrun, flusher, multipass, askedfig)
- end
+ else
+ if trace_tracingall then
+ data = "tracingall;" .. data
end
+ process(data)
+-- starttiming(metapost.exectime)
+-- result = mpx:execute(data)
+-- stoptiming(metapost.exectime)
+-- if trace_graphics and result then
+-- local str = result.log or result.error
+-- if str and str ~= "" then
+-- tra.log:write(str)
+-- end
+-- end
+-- -- todo: error message
+-- if not result then
+-- report_metapost("error: no result object returned")
+-- elseif result.status > 0 then
+-- report_metapost("error: %s",(result.term or "no-term") .. "\n" .. (result.error or "no-error"))
+-- else
+-- if metapost.showlog then
+-- metapost.lastlog = metapost.lastlog .. "\n" .. result.term
+-- report_metapost("info: %s",result.term or "no-term")
+-- end
+-- if result.fig then
+-- converted = metapost.convert(result, trialrun, flusher, multipass, askedfig)
+-- end
+-- end
end
if trace_graphics then
local banner = "\n% end graphic\n\n"
diff --git a/tex/context/base/mkiv/mult-def.lua b/tex/context/base/mkiv/mult-def.lua
index 7df4ec1ca..d1ed74b6e 100644
--- a/tex/context/base/mkiv/mult-def.lua
+++ b/tex/context/base/mkiv/mult-def.lua
@@ -3424,6 +3424,10 @@ return {
["pe"]="دوران",
["ro"]="roteste",
},
+ ["savebuffer"]={
+ ["en"]="savebuffer",
+ ["nl"]="bewaarbuffer",
+ },
["scale"]={
["cs"]="meritko",
["de"]="format",
@@ -3784,6 +3788,10 @@ return {
["pe"]="بارگذاری‌شرح",
["ro"]="seteazadescriere",
},
+ ["setupdescription"]={
+ ["en"]="setupdescription",
+ ["nl"]="steldoordefinierenin",
+ },
["setupenumerations"]={
["cs"]="nastavvycty",
["de"]="stellebeschreibungein",
@@ -3794,6 +3802,10 @@ return {
["pe"]="بارگذاری‌شماره‌گذاریها",
["ro"]="seteazaenumerare",
},
+ ["setupenumeration"]={
+ ["en"]="setupenumeration",
+ ["nl"]="steldoornummerenin",
+ },
["setupexternalfigures"]={
["cs"]="nastavexterniobrazy",
["de"]="stelleexterneabbildungenein",
@@ -3934,6 +3946,10 @@ return {
["pe"]="بارگذاری‌فرمولها",
["ro"]="seteazaformule",
},
+ ["setupformula"]={
+ ["en"]="setupformula",
+ ["nl"]="stelformulein",
+ },
["setupframed"]={
["cs"]="nastavoramovani",
["de"]="stelleumrahmtein",
@@ -3954,6 +3970,10 @@ return {
["pe"]="بارگذاری‌متن‌قالبی",
["ro"]="definestetexteinconjurate",
},
+ ["setupframedtext"]={
+ ["en"]="setupframedtext",
+ ["nl"]="stelkadertekstin",
+ },
["setuphead"]={
["cs"]="nastavnadpis",
["de"]="stelleueberschriftein",
@@ -4228,6 +4248,14 @@ return {
["pe"]="بارگذاری‌بلوکهای‌حاشیه",
["ro"]="seteazablocurimarginale",
},
+ ["setupmarginblock"]={
+ ["en"]="setupmarginblock",
+ ["nl"]="stelmargeblokkenin",
+ },
+ ["setupmargindata"]={
+ ["en"]="setupmargindata",
+ ["nl"]="stelinmargein",
+ },
["setupmarginrules"]={
["cs"]="nastavmarginalnilinky",
["de"]="stellemarginallinieein",
@@ -5032,6 +5060,10 @@ return {
["pe"]="شروع‌تنظیم",
["ro"]="startaliniere",
},
+ ["alignment"]={
+ ["en"]="alignment",
+ ["nl"]="uitlijnen",
+ },
["startbackground"]={
["cs"]="startpozadi",
["de"]="starthintergrund",
@@ -5176,6 +5208,10 @@ return {
["pe"]="شروع‌تصحیح‌خط",
["ro"]="startcorectielinie",
},
+ ["linecorrection"]={
+ ["en"]="linecorrection",
+ ["nl"]="regelcorrectie",
+ },
["startlinenumbering"]={
["cs"]="startcislovaniradku",
["de"]="startzeilennumerierung",
@@ -5216,6 +5252,10 @@ return {
["pe"]="شروع‌پانوشتهای‌موضعی",
["ro"]="startnotesubsollocale",
},
+ ["localfootnotes"]={
+ ["en"]="localfootnotes",
+ ["nl"]="lokalevoetnoten",
+ },
["startmakeup"]={
["cs"]="startuprava",
["de"]="startumbruch",
@@ -5236,6 +5276,10 @@ return {
["pe"]="شروع‌بلوک‌حاشیه",
["ro"]="startblocmarginal",
},
+ ["marginblock"]={
+ ["en"]="marginblock",
+ ["nl"]="margeblok",
+ },
["startmarginrule"]={
["cs"]="startmarginalnilinka",
["de"]="startmarginallinie",
@@ -5410,6 +5454,10 @@ return {
["en"]="starttextbackground",
["nl"]="starttekstachtergrond",
},
+ ["textbackground"]={
+ ["en"]="textbackground",
+ ["nl"]="tekstachtergrond",
+ },
["starttextrule"]={
["cs"]="starttextovalinka",
["de"]="starttextlinie",
@@ -12921,6 +12969,7 @@ return {
},
["combination"]={
["en"]="combination",
+ ["nl"]="combinatie",
},
["command"]={
["cs"]="prikaz",
diff --git a/tex/context/base/mkiv/mult-fun.lua b/tex/context/base/mkiv/mult-fun.lua
index 299bcc0dd..d6685527c 100644
--- a/tex/context/base/mkiv/mult-fun.lua
+++ b/tex/context/base/mkiv/mult-fun.lua
@@ -15,6 +15,7 @@ return {
"metapostversion",
"maxdimensions",
"drawoptionsfactor",
+ "dq", "sq",
},
commands = {
"transparency",
@@ -126,7 +127,7 @@ return {
--
"decorated", "redecorated", "undecorated",
--
- "passvariable", "passarrayvariable", "tostring", "format", "formatted",
+ "passvariable", "passarrayvariable", "tostring", "topair", "format", "formatted", "quotation", "quote",
"startpassingvariable", "stoppassingvariable",
--
"eofill", "eoclip", "nofill", "fillup", "eofillup",
diff --git a/tex/context/base/mkiv/mult-mps.lua b/tex/context/base/mkiv/mult-mps.lua
index a6bebc266..fb8ed3489 100644
--- a/tex/context/base/mkiv/mult-mps.lua
+++ b/tex/context/base/mkiv/mult-mps.lua
@@ -76,7 +76,7 @@ return {
"arrowhead",
"currentpen", "currentpicture", "cuttings",
"defaultfont", "extra_beginfig", "extra_endfig",
- "ditto", "EOF", "down",
+ "down",
"evenly", "fullcircle", "halfcircle", "identity", "in", "left",
"pensquare", "penrazor", "penspec",
"origin", "quartercircle", "right",
@@ -129,6 +129,8 @@ return {
"join_radius",
"charscale", -- actually a mult-fun one
--
+ "ditto", "EOF", -- maybe also down etc
+ --
"pen_lft", "pen_rt", "pen_top", "pen_bot", -- "pen_count_",
},
metafont = {
diff --git a/tex/context/base/mkiv/page-mix.lua b/tex/context/base/mkiv/page-mix.lua
index 2df762b5b..725073f55 100644
--- a/tex/context/base/mkiv/page-mix.lua
+++ b/tex/context/base/mkiv/page-mix.lua
@@ -294,15 +294,15 @@ local function preparesplit(specification) -- a rather large function
}
end
- local column = 1
- local line = 0
- local result = results[1]
- local lasthead = nil
- local rest = nil
- local lastlocked = nil
- local lastcurrent = nil
- local lastcontent = nil
- local backtracked = false
+ local column = 1
+ local line = 0
+ local result = results[1]
+ local lasthead = nil
+ local rest = nil
+ local lastlocked = nil
+ local lastcurrent = nil
+ local lastcontent = nil
+ local backtracked = false
if trace_state then
report_state("setting collector to column %s",column)
@@ -408,12 +408,12 @@ local function preparesplit(specification) -- a rather large function
result.height = height
result.depth = depth
end
- head = current
- height = 0
- depth = 0
+ head = current
+ height = 0
+ depth = 0
if column == nofcolumns then
column = 0 -- nicer in trace
- rest = head
+ rest = head
return false, 0
else
local skipped
@@ -434,7 +434,6 @@ local function preparesplit(specification) -- a rather large function
local function checked(advance,where,locked)
local total = skip + height + depth + advance
local delta = total - target
--- - 65536*3
local state = "same"
local okay = false
local skipped = 0
diff --git a/tex/context/base/mkiv/page-mix.mkiv b/tex/context/base/mkiv/page-mix.mkiv
index 5b3afc575..7bd30ceee 100644
--- a/tex/context/base/mkiv/page-mix.mkiv
+++ b/tex/context/base/mkiv/page-mix.mkiv
@@ -439,7 +439,8 @@
\begincsname\??mixedcolumnsbefore\currentmixedcolumnsmethod\endcsname\relax
\begingroup
\page_mix_initialize_columns
- \begincsname\??mixedcolumnsstart\currentmixedcolumnsmethod\endcsname}
+ \begincsname\??mixedcolumnsstart\currentmixedcolumnsmethod\endcsname
+ \let\stopmixedcolumns\page_mix_columns_stop_yes}
\def\page_mix_start_columns_c_nop
{\begingroup
diff --git a/tex/context/base/mkiv/publ-ini.mkiv b/tex/context/base/mkiv/publ-ini.mkiv
index f6500fdd7..5f9aaa692 100644
--- a/tex/context/base/mkiv/publ-ini.mkiv
+++ b/tex/context/base/mkiv/publ-ini.mkiv
@@ -79,6 +79,8 @@
\definelabelclass[btxlabel][2]
+\clf_definelabels{btxlabel}{btx}\s!false\relax
+
% It is not that trivial to come up with a proper organization of setup
% and control commands for publications. This is because we have complex
% inline as well as extensive list rendering. The rules are partially
diff --git a/tex/context/base/mkiv/spac-ver.lua b/tex/context/base/mkiv/spac-ver.lua
index 8b362f903..166bd0aa2 100644
--- a/tex/context/base/mkiv/spac-ver.lua
+++ b/tex/context/base/mkiv/spac-ver.lua
@@ -56,6 +56,33 @@ local texnest = tex.nest
local variables = interfaces.variables
local implement = interfaces.implement
+local v_local = variables["local"]
+local v_global = variables["global"]
+local v_box = variables.box
+local v_min = variables.min
+local v_max = variables.max
+local v_none = variables.none
+local v_line = variables.line
+local v_noheight = variables.noheight
+local v_nodepth = variables.nodepth
+local v_line = variables.line
+local v_first = variables.first
+local v_last = variables.last
+local v_top = variables.top
+local v_bottom = variables.bottom
+local v_minheight = variables.minheight
+local v_maxheight = variables.maxheight
+local v_mindepth = variables.mindepth
+local v_maxdepth = variables.maxdepth
+local v_offset = variables.offset
+local v_strut = variables.strut
+
+local v_hfraction = variables.hfraction
+local v_dfraction = variables.dfraction
+local v_bfraction = variables.bfraction
+local v_tlines = variables.tlines
+local v_blines = variables.blines
+
-- vertical space handler
local trace_vbox_vspacing = false trackers.register("vspacing.vbox", function(v) trace_vbox_vspacing = v end)
@@ -154,19 +181,19 @@ vspacingdata.snapmethods = snapmethods
storage.register("builders/vspacing/data/snapmethods", snapmethods, "builders.vspacing.data.snapmethods")
local default = {
- maxheight = true,
- maxdepth = true,
- strut = true,
- hfraction = 1,
- dfraction = 1,
- bfraction = 0.25,
+ [v_maxheight] = true,
+ [v_maxdepth] = true,
+ [v_strut] = true,
+ [v_hfraction] = 1,
+ [v_dfraction] = 1,
+ [v_bfraction] = 0.25,
}
local fractions = {
- minheight = "hfraction", maxheight = "hfraction",
- mindepth = "dfraction", maxdepth = "dfraction",
- box = "bfraction",
- top = "tlines", bottom = "blines",
+ [v_minheight] = v_hfraction, [v_maxheight] = v_hfraction,
+ [v_mindepth] = v_dfraction, [v_maxdepth] = v_dfraction,
+ [v_box] = v_bfraction,
+ [v_top] = v_tlines, [v_bottom] = v_blines,
}
local values = {
@@ -202,13 +229,14 @@ local function listtohash(str)
else
detail = tonumber("0" .. key)
if detail then
- t.hfraction, t.dfraction = detail, detail
+ t[v_hfraction] = detail
+ t[v_dfraction] = detail
end
end
end
if next(t) then
- t.hfraction = t.hfraction or 1
- t.dfraction = t.dfraction or 1
+ t[v_hfraction] = t[v_hfraction] or 1
+ t[v_dfraction] = t[v_dfraction] or 1
return t
else
return default
@@ -219,7 +247,8 @@ function vspacing.definesnapmethod(name,method)
local n = #snapmethods + 1
local t = listtohash(method)
snapmethods[n] = t
- t.name, t.specification = name, method
+ t.name = name -- not interfaced
+ t.specification = method -- not interfaced
context(n)
end
@@ -325,7 +354,7 @@ local function fixedprofile(current)
return profiling and profiling.fixedprofile(current)
end
-local function snap_hlist(where,current,method,height,depth) -- method.strut is default
+local function snap_hlist(where,current,method,height,depth) -- method[v_strut] is default
if fixedprofile(current) then
return
end
@@ -334,18 +363,18 @@ local function snap_hlist(where,current,method,height,depth) -- method.strut is
if t then
t[#t+1] = formatters["list content: %s"](listtoutf(list))
t[#t+1] = formatters["parent id: %s"](nodereference(current))
- t[#t+1] = formatters["snap method: %s"](method.name)
- t[#t+1] = formatters["specification: %s"](method.specification)
+ t[#t+1] = formatters["snap method: %s"](method.name) -- not interfaced
+ t[#t+1] = formatters["specification: %s"](method.specification) -- not interfaced
end
local snapht, snapdp
- if method["local"] then
+ if method[v_local] then
-- snapping is done immediately here
snapht = texgetdimen("bodyfontstrutheight")
snapdp = texgetdimen("bodyfontstrutdepth")
if t then
t[#t+1] = formatters["local: snapht %p snapdp %p"](snapht,snapdp)
end
- elseif method["global"] then
+ elseif method[v_global] then
snapht = texgetdimen("globalbodyfontstrutheight")
snapdp = texgetdimen("globalbodyfontstrutdepth")
if t then
@@ -366,15 +395,15 @@ local function snap_hlist(where,current,method,height,depth) -- method.strut is
end
end
- local h = (method.noheight and 0) or height or getfield(current,"height")
- local d = (method.nodepth and 0) or depth or getfield(current,"depth")
- local hr = method.hfraction or 1
- local dr = method.dfraction or 1
- local br = method.bfraction or 0
+ local h = (method[v_noheight] and 0) or height or getfield(current,"height")
+ local d = (method[v_nodepth] and 0) or depth or getfield(current,"depth")
+ local hr = method[v_hfraction] or 1
+ local dr = method[v_dfraction] or 1
+ local br = method[v_bfraction] or 0
local ch = h
local cd = d
- local tlines = method.tlines or 1
- local blines = method.blines or 1
+ local tlines = method[v_tlines] or 1
+ local blines = method[v_blines] or 1
local done = false
local plusht = snapht
local plusdp = snapdp
@@ -391,7 +420,7 @@ local function snap_hlist(where,current,method,height,depth) -- method.strut is
-- }
-- end
- if method.box then
+ if method[v_box] then
local br = 1 - br
if br < 0 then
br = 0
@@ -402,30 +431,30 @@ local function snap_hlist(where,current,method,height,depth) -- method.strut is
local x = n * snaphtdp - h - d
plusht = h + x / 2
plusdp = d + x / 2
- elseif method.max then
+ elseif method[v_max] then
local n = ceiled((h+d)/snaphtdp)
local x = n * snaphtdp - h - d
plusht = h + x / 2
plusdp = d + x / 2
- elseif method.min then
+ elseif method[v_min] then
local n = floored((h+d)/snaphtdp)
local x = n * snaphtdp - h - d
plusht = h + x / 2
plusdp = d + x / 2
- elseif method.none then
+ elseif method[v_none] then
plusht, plusdp = 0, 0
if t then
t[#t+1] = "none: plusht 0pt plusdp 0pt"
end
end
- if method.halfline then -- extra halfline
+ if method[v_halfline] then -- extra halfline
plusht = plusht + snaphtdp/2
plusdp = plusdp + snaphtdp/2
if t then
t[#t+1] = formatters["halfline: plusht %p plusdp %p"](plusht,plusdp)
end
end
- if method.line then -- extra line
+ if method[v_line] then -- extra line
plusht = plusht + snaphtdp
plusdp = plusdp + snaphtdp
if t then
@@ -433,7 +462,7 @@ local function snap_hlist(where,current,method,height,depth) -- method.strut is
end
end
- if method.first then
+ if method[v_first] then
local thebox = current
local id = getid(thebox)
if id == hlist_code then
@@ -471,7 +500,7 @@ local function snap_hlist(where,current,method,height,depth) -- method.strut is
elseif t then
t[#t+1] = "first: not done, no vbox"
end
- elseif method.last then
+ elseif method[v_last] then
local thebox = current
local id = getid(thebox)
if id == hlist_code then
@@ -509,12 +538,12 @@ local function snap_hlist(where,current,method,height,depth) -- method.strut is
t[#t+1] = "last: not done, no vbox"
end
end
- if method.minheight then
+ if method[v_minheight] then
ch = floored((h-hr*snapht)/snaphtdp)*snaphtdp + plusht
if t then
t[#t+1] = formatters["minheight: %p"](ch)
end
- elseif method.maxheight then
+ elseif method[v_maxheight] then
ch = ceiled((h-hr*snapht)/snaphtdp)*snaphtdp + plusht
if t then
t[#t+1] = formatters["maxheight: %p"](ch)
@@ -525,12 +554,12 @@ local function snap_hlist(where,current,method,height,depth) -- method.strut is
t[#t+1] = formatters["set height: %p"](ch)
end
end
- if method.mindepth then
+ if method[v_mindepth] then
cd = floored((d-dr*snapdp)/snaphtdp)*snaphtdp + plusdp
if t then
t[#t+1] = formatters["mindepth: %p"](cd)
end
- elseif method.maxdepth then
+ elseif method[v_maxdepth] then
cd = ceiled((d-dr*snapdp)/snaphtdp)*snaphtdp + plusdp
if t then
t[#t+1] = formatters["maxdepth: %p"](cd)
@@ -541,20 +570,20 @@ local function snap_hlist(where,current,method,height,depth) -- method.strut is
t[#t+1] = formatters["set depth: %p"](cd)
end
end
- if method.top then
+ if method[v_top] then
ch = ch + tlines * snaphtdp
if t then
t[#t+1] = formatters["top height: %p"](ch)
end
end
- if method.bottom then
+ if method[v_bottom] then
cd = cd + blines * snaphtdp
if t then
t[#t+1] = formatters["bottom depth: %p"](cd)
end
end
- local offset = method.offset
+ local offset = method[v_offset]
if offset then
-- we need to set the attr
if t then
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 258056fb2..c60014f10 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 b7c59e744..247757915 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/strc-des.mkvi b/tex/context/base/mkiv/strc-des.mkvi
index 4376d9cdc..76f878f5f 100644
--- a/tex/context/base/mkiv/strc-des.mkvi
+++ b/tex/context/base/mkiv/strc-des.mkvi
@@ -21,11 +21,11 @@
\let\setupdescriptions\setupdescription
-% \setupdescriptions % check with old
+% \setupdescription % check with old
% [\c!alternative=\descriptionparameter\c!location,
% \c!location=\v!left]
-\setupdescriptions % check with old
+\setupdescription % check with old
[\c!alternative=\v!left,
\c!headstyle=\v!bold,
\c!titlestyle=\v!bold,
diff --git a/tex/context/base/mkiv/strc-enu.mkvi b/tex/context/base/mkiv/strc-enu.mkvi
index 832bdaf82..aaf735918 100644
--- a/tex/context/base/mkiv/strc-enu.mkvi
+++ b/tex/context/base/mkiv/strc-enu.mkvi
@@ -79,7 +79,7 @@
\let\setupenumerations\setupenumeration
-\setupenumerations % check with old
+\setupenumeration % check with old
[\c!alternative=\v!top,
\c!headstyle=\v!bold,
\c!titlestyle=\v!bold,
diff --git a/tex/context/base/mkiv/trac-deb.lua b/tex/context/base/mkiv/trac-deb.lua
index 9a0108368..3770f4189 100644
--- a/tex/context/base/mkiv/trac-deb.lua
+++ b/tex/context/base/mkiv/trac-deb.lua
@@ -185,6 +185,7 @@ local function processerror(offset)
local lasttexerror = status.lasterrorstring or "?"
local lastluaerror = status.lastluaerrorstring or lasttexerror
local luaerrorline = match(lastluaerror,[[lua%]?:.-(%d+)]]) or (lastluaerror and find(lastluaerror,"?:0:",1,true) and 0)
+ local lastmpserror = match(lasttexerror,[[^.-mp%serror:%s*(.*)$]])
resetmessages()
lastluaerror = gsub(lastluaerror,"%[\\directlua%]","[ctxlua]")
tracers.printerror {
@@ -192,6 +193,7 @@ local function processerror(offset)
linenumber = linenumber,
offset = tonumber(offset) or 10,
lasttexerror = lasttexerror,
+ lastmpserror = lastmpserror,
lastluaerror = lastluaerror,
luaerrorline = luaerrorline,
lastcontext = lastcontext,
@@ -204,9 +206,11 @@ function tracers.printerror(specification)
local filename = specification.filename
local linenumber = specification.linenumber
local lasttexerror = specification.lasttexerror
+ local lastmpserror = specification.lastmpserror
local lastluaerror = specification.lastluaerror
local lastcontext = specification.lasterrorcontext
local luaerrorline = specification.luaerrorline
+ local errortype = specification.errortype
local offset = specification.offset
local report = errorreporter(luaerrorline)
if not filename then
@@ -217,7 +221,8 @@ function tracers.printerror(specification)
report_nl()
if luaerrorline then
report("lua error on line %s in file %s:\n\n%s",linenumber,filename,lastluaerror)
- -- report("error on line %s in file %s:\n\n%s",linenumber,filename,lasttexerror)
+ elseif lastmpserror then
+ report("mp error on line %s in file %s:\n\n%s",linenumber,filename,lastmpserror)
else
report("tex error on line %s in file %s: %s",linenumber,filename,lasttexerror)
if lastcontext then
diff --git a/tex/context/base/mkiv/typo-fkr.lua b/tex/context/base/mkiv/typo-fkr.lua
index 1de554b57..b235ff284 100644
--- a/tex/context/base/mkiv/typo-fkr.lua
+++ b/tex/context/base/mkiv/typo-fkr.lua
@@ -95,29 +95,33 @@ function typesetters.fontkerns.handler(head)
return kepthead, done
end
-local variables = interfaces.variables
-local unsetvalue = attributes.unsetvalue
-local enabled = false
-local setattribute = tex.setattribute
+if context then
-local values = {
- [variables.none ] = 0,
- [variables.min ] = 1,
- [variables.max ] = 2,
- [variables.mixed] = 3,
- [variables.reset] = unsetvalue,
-}
+ local variables = interfaces.variables
+ local unsetvalue = attributes.unsetvalue
+ local enabled = false
+ local setattribute = tex.setattribute
+
+ local values = {
+ [variables.none ] = 0,
+ [variables.min ] = 1,
+ [variables.max ] = 2,
+ [variables.mixed] = 3,
+ [variables.reset] = unsetvalue,
+ }
-local function setextrafontkerns(str)
- if not enabled then
- nodes.tasks.enableaction("processors","typesetters.fontkerns.handler")
- enabled = true
+ local function setextrafontkerns(str)
+ if not enabled then
+ nodes.tasks.enableaction("processors","typesetters.fontkerns.handler")
+ enabled = true
+ end
+ setattribute(a_extrakern,values[str] or unsetvalue)
end
- setattribute(a_extrakern,values[str] or unsetvalue)
-end
-interfaces.implement {
- name = "setextrafontkerns",
- arguments = "string",
- actions = setextrafontkerns,
-}
+ interfaces.implement {
+ name = "setextrafontkerns",
+ arguments = "string",
+ actions = setextrafontkerns,
+ }
+
+end