From 87d07213621eaff3e533fd67d574d3fdeba4104d Mon Sep 17 00:00:00 2001 From: Hironori Kitagawa Date: Sun, 27 Aug 2017 06:31:13 +0900 Subject: [PATCH] lltjcore.sty, ltj-jfmglue.lua: \linebreak (#37465) --- src/ltj-jfmglue.lua | 27 ++++++++++++++++----------- src/patches/lltjcore.sty | 15 +-------------- 2 files changed, 17 insertions(+), 25 deletions(-) diff --git a/src/ltj-jfmglue.lua b/src/ltj-jfmglue.lua index 531a5c7..d33f032 100644 --- a/src/ltj-jfmglue.lua +++ b/src/ltj-jfmglue.lua @@ -127,19 +127,24 @@ end -- penalty 値の計算 -local function add_penalty(p,e) - local pp = getfield(p, 'penalty') - if pp>=10000 then - if e<=-10000 then setfield(p, 'penalty', 0) end - elseif pp<=-10000 then - if e>=10000 then setfield(p, 'penalty', 0) end - else - pp = pp + e - if pp>=10000 then setfield(p, 'penalty', 10000) - elseif pp<=-10000 then setfield(p, 'penalty', -10000) - else setfield(p, 'penalty', pp) end +local add_penalty +do +local setpenalty = node.direct.setpenalty or function(n, a) setfield(n,'penalty',a) end +local getpenalty = node.direct.getpenalty or function(n) return getfield(n,'penalty') end +function add_penalty(p,e) + local pp = getpenalty(p) + if (pp>-10000) and (pp<10000) then + if e>=10000 then setpenalty(p, 10000) + elseif e<=-10000 then setpenalty(p, -10000) + else + pp = pp + e + if pp>=10000 then setpenalty(p, 10000) + elseif pp<=-10000 then setpenalty(p, -10000) + else setpenalty(p, pp) end + end end end +end -- 「異なる JFM」の間の調整方法 diffmet_rule = math.two_paverage diff --git a/src/patches/lltjcore.sty b/src/patches/lltjcore.sty index 43abab1..e56aef4 100644 --- a/src/patches/lltjcore.sty +++ b/src/patches/lltjcore.sty @@ -3,7 +3,7 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{lltjcore}[2017/08/07 Patch to LaTeX2e Kernel for LuaTeX-ja] +\ProvidesPackage{lltjcore}[2017/08/27 Patch to LaTeX2e Kernel for LuaTeX-ja] \RequirePackage{etoolbox} \def\cleardoublepage{\clearpage\if@twoside @@ -288,19 +288,6 @@ \ignorespaces \fi} -\def\@no@lnbk #1[#2]{% - \ifvmode - \@nolnerr - \else - \@tempskipa\lastskip - \unskip - \penalty #1\@getpen{#2}% - \hskip\z@\relax %% added (2017/05/03) - \ifdim\@tempskipa>\z@ - \hskip\@tempskipa - \ignorespaces - \fi - \fi} %%%%%% \@tabclassz \def\ltj@sharp{\ltjfakeboxbdd\ignorespaces\@sharp\unskip\ltjfakeboxbdd} -- 2.11.0