From 7383bb0ef0eef7e54a01838d0e5100ac8f13f91b Mon Sep 17 00:00:00 2001 From: Hironori Kitagawa Date: Tue, 2 Sep 2014 14:15:22 +0900 Subject: [PATCH] ltj-jfmglue.lua: Fix handle_penalty_always() to always insert non-zero penalty. --- doc/luatexja.dtx | 4 ++-- src/ltj-jfmglue.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/luatexja.dtx b/doc/luatexja.dtx index ba21034..abf7977 100644 --- a/doc/luatexja.dtx +++ b/doc/luatexja.dtx @@ -7753,11 +7753,11 @@ If this attempt fails, \LuaTeX-ja use the method ``\textsf{\Param{kanjiskip}~[K] (a)部分にペナルティが存在していない場合, \LuaTeX-ja は\textit{Nq}と\textit{Np}の間の行分割を可能にしようとする. -そのために,以下の場合に$a$をもつ\textit{penalty\_node}を作って +そのために,以下のいずれかの場合に$a$をもつ\textit{penalty\_node}を作って 「右空白」の(もし未定義なら\textit{Np}の)直前に挿入する: \begin{itemize} \item 「右空白」がグルーでない(カーンか未定義)であるとき. -%\item 「左空白」がカーンとしてきっちり定義されている時. +\item $a\neq 0$のときは,「右空白」がグルーであっても\textit{penalty\_node}を作る. \end{itemize} \item[P-suppress~{[PS]}] diff --git a/src/ltj-jfmglue.lua b/src/ltj-jfmglue.lua index b67fcdd..963c251 100644 --- a/src/ltj-jfmglue.lua +++ b/src/ltj-jfmglue.lua @@ -567,7 +567,7 @@ end local function handle_penalty_always(post, pre, g) local a = (pre or 0) + (post or 0) if #Bp == 0 then - if not (g and getid(g)==id_glue) then + if not (g and getid(g)==id_glue) or a~=0 then local p = node_new(id_penalty) if a<-10000 then a = -10000 elseif a>10000 then a = 10000 end setfield(p, 'penalty', a) -- 2.11.0