summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-03-21 20:23:57 +0000
committerKarl Berry <karl@freefriends.org>2023-03-21 20:23:57 +0000
commit552c2f99479d2f8c84a188cc03d22adad630de0e (patch)
tree8c8085df36208f0801f2edccf6d1f445f3e547ef /Master/texmf-dist/tex
parentb0613f47e5f7554cb42acace793a45286d378a71 (diff)
linebreaker (21mar23)
git-svn-id: svn://tug.org/texlive/trunk@66639 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/lualatex/linebreaker/linebreaker.lua15
1 files changed, 11 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/lualatex/linebreaker/linebreaker.lua b/Master/texmf-dist/tex/lualatex/linebreaker/linebreaker.lua
index 99966ad302f..e5fa603dc8c 100644
--- a/Master/texmf-dist/tex/lualatex/linebreaker/linebreaker.lua
+++ b/Master/texmf-dist/tex/lualatex/linebreaker/linebreaker.lua
@@ -160,8 +160,14 @@ local function find_best(params)
end
end
linebreaker.debug_print "best solution"
+ local ignored_types = {userdata=true, table = true}
for k,v in pairs(n) do
- linebreaker.debug_print(k,v)
+ -- we must ignore some properties in the params table,
+ -- as they produce errors when used in debug_print,
+ -- and they are not interesting for debugging anyway
+ if not ignored_types[type(v)] then
+ linebreaker.debug_print(k,v)
+ end
end
return n
end
@@ -406,7 +412,7 @@ function linebreaker.best_solution(par, parameters, step)
local params = parameters[#parameters] -- newest parameters are last in the
-- table that will be used in recursive invocations of this function
-- it holds updated parameters
- local newparams = {}
+ local newparams = linebreaker.parameters()
-- this value is set by hpack_quality callback that is executed by
-- tex.linebreak when overflow or underflow happens
linebreaker.badness = 0
@@ -474,16 +480,17 @@ local function fix_nest(info)
tex.nest[tex.nest.ptr].prevgraf=info.prevgraf
end
+
-- test whether the current overfull box message occurs inside our linebreaker function
local is_inside_linebreaker = false
function linebreaker.linebreak(head,is_display)
+ local parameters = linebreaker.parameters()
-- we can disable linebreaker processing
if linebreaker.active == false then
- local newhead, info = linebreaker.breaker(head)
+ local newhead, info = linebreaker.breaker(head, parameters)
fix_nest(info)
return newhead
end
- local parameters = linebreaker.parameters()
is_inside_linebreaker = true
local newhead, info = linebreaker.best_solution(head, {parameters})
is_inside_linebreaker = false