local dn_h = getfield(db, 'height')
local dn_d = getfield(db, 'depth')
local db_head, db_tail
- for _,v in ipairs(dir_node_aux
- [get_box_dir(b, dir_yoko)%dir_math_mod][new_dir][getid(b)]) do
+ local t = dir_node_aux[get_box_dir(b, dir_yoko)%dir_math_mod][new_dir]
+ t = t and t[getid(b)]; if not t then return end
+ for _,v in ipairs(t) do
local cmd, arg, nn = v[1], v[2]
if cmd=='kern' then
nn = node_new(id_kern, 1)
%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lltjp-preview}[2017/05/08 Patch to preview for LuaTeX-ja]
+\ProvidesPackage{lltjp-preview}[2017/11/12 Patch to preview for LuaTeX-ja]
\RequirePackage{etoolbox,preview,luatexja}
+\newbox\ltj@preview@box
\patchcmd\pr@endbox{%
\pr@ship@end
}{%
- \setbox\pr@box\hbox{\yoko\box\pr@box}\pr@ship@end
+ \setbox\ltj@preview@box=\box\AtBeginShipoutBox
+ \setbox\AtBeginShipoutBox=\hbox{\yoko\box\pr@box}%
+ \directlua{luatexja.direction.finalize()}%
+ \setbox\pr@box=\box\AtBeginShipoutBox
+ \setbox\AtBeginShipoutBox=\box\ltj@preview@box
+ \pr@ship@end
}{}{}
\endinput