OSDN Git Service

stopped to load lltjp-atbegshi.sty in plain TeX
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Thu, 6 Aug 2020 23:49:16 +0000 (08:49 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Thu, 6 Aug 2020 23:49:16 +0000 (08:49 +0900)
src/ltj-direction.lua
src/ltj-latex.sty
src/luatexja-core.sty
src/patches/lltjp-atbegshi.sty

index 22285c4..9a28a9a 100644 (file)
@@ -1116,9 +1116,10 @@ do
    end
    local getbox, shipout = tex.getbox, tex.shipout
    local setbox, copy = node.direct.setbox, node.direct.copy
-   local lua_mem_kb = 0
+   local afbox
    function luatexja.direction.shipout()
       start_time_measure 'box_primitive_hook'
+      if (not afbox) and luatexja.afbox_number  then afbox = luatexja.afbox_number end
       local a = to_direct(getbox 'ltj@afbox')
       local a_dir = get_box_dir(a, dir_yoko)
       if a_dir~=dir_yoko then
@@ -1126,8 +1127,8 @@ do
          setfield(b, 'head', a); a = b
       end
       setfield(shipout_temp, 'head', a); finalize_inner(shipout_temp)
-      setbox('ltj@afbox', copy(getlist(shipout_temp))); setfield(shipout_temp, 'head',nil)
-      shipout(luatexja.afbox_number)
+      setbox(afbox, copy(getlist(shipout_temp))); setfield(shipout_temp, 'head',nil)
+      shipout(afbox)
       stop_time_measure 'box_primitive_hook'
    end
 end
index 7da60fd..db50c2b 100644 (file)
 \ltj@pkgpatch@im{unicode-math}
 \ltj@pkgpatch@im{siunitx}
 \ltj@pkgpatch@im{microtype}
-\ltj@pkgpatch@im{everyshi}
+
+\ifltj@ltshipout@avail\else\ltj@pkgpatch@im{everyshi}\fi
 
 \RequirePackage{lltjp-geometry}
 
index b5f13d5..82abd0c 100644 (file)
@@ -87,7 +87,6 @@
   \input ltxcmds.sty
   \input pdftexcmds.sty
   \input xkeyval
-  \input lltjp-atbegshi.sty
 \fi                             %</LaTeX>
 \endlinechar=-1 %
 
index 6666809..3b77c9b 100644 (file)
@@ -3,17 +3,13 @@
 %
 
 \newif\ifltj@ltshipout@avail
-\ifdefined\NeedsTeXFormat
-  \NeedsTeXFormat{LaTeX2e}
-  \ProvidesPackage{lltjp-atbegshi}[2020-08-04 Patching \string\shipout\space hooks for LuaTeX-ja]
-  \@ifl@t@r\fmtversion{2020-10-01}{%
-    \ifnum\patch@level<0\relax \ifnum\patch@level<-6 \ltj@ltshipout@availtrue\fi
-    \else\ltj@ltshipout@availtrue\fi
-  }{}
-  \ifltj@ltshipout@avail\else\RequirePackage{atbegshi}\fi
-\else
-  \input atbegshi.sty
-\fi
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{lltjp-atbegshi}[2020-08-04 Patching \string\shipout\space hooks for LuaTeX-ja]
+\@ifl@t@r\fmtversion{2020-10-01}{%
+  \ifnum\patch@level<0\relax \ifnum\patch@level<-6 \ltj@ltshipout@availtrue\fi
+  \else\ltj@ltshipout@availtrue\fi
+}{}
+\ifltj@ltshipout@avail\else\RequirePackage{atbegshi}\fi
 
 % concept: execute all hooks inside yoko direction \vbox