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
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
\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}
\input ltxcmds.sty
\input pdftexcmds.sty
\input xkeyval
- \input lltjp-atbegshi.sty
\fi %</LaTeX>
\endlinechar=-1 %
%
\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