OSDN Git Service

Fix #37164
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Mon, 8 May 2017 12:22:47 +0000 (21:22 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Mon, 8 May 2017 12:22:47 +0000 (21:22 +0900)
src/ltj-direction.lua
src/ltj-latex.sty
src/luatexja-core.sty
src/patches/lltjp-preview.sty [new file with mode: 0644]

index 5228662..9d650f2 100644 (file)
@@ -530,7 +530,7 @@ do
       start_time_measure('box_primitive_hook')
       local list_dir = get_dir_count()%dir_math_mod
       local b = getbox(tex_getcount('ltj@tempcnta'))
-      if b then
+      if b and getlist(to_direct(b)) then
         local box_dir = get_box_dir(to_direct(b), dir_yoko)
         if box_dir%dir_math_mod ~= list_dir then
            ltjb.package_error(
@@ -1159,7 +1159,6 @@ do
       finalize_inner(shipout_temp)
       setbox('global', "AtBeginShipoutBox", copy(getlist(shipout_temp)))
       setfield(shipout_temp, 'head',nil)
-
       -- garbage collect
       --local m = collectgarbage('count')
       --if m>lua_mem_kb+20480 then
index 16b5c2b..7401aa4 100644 (file)
@@ -78,6 +78,7 @@
   \ltj@asc@temp\let\ltj@asc@temp=\relax
 }{}}% ascmac
 \ltj@pkgpatch{stfloats}
+\ltj@pkgpatch{preview}
 
 \RequirePackage{lltjp-geometry}
 \RequirePackage{filehook}
index ce109e4..91544dd 100644 (file)
@@ -79,6 +79,7 @@
   \RequirePackage{pdftexcmds} [2011/11/29] % v0.20
   \RequirePackage{xkeyval}    [2012/10/14] % v2.6b
   \RequirePackage{atbegshi}
+  \AtBeginShipoutInit
   \IfFileExists{everyhook.sty}{\RequirePackage{everyhook}\ltj@everyhook@availtrue}{}
 \else                           %<*!LaTeX>
   \input luatexbase.sty
diff --git a/src/patches/lltjp-preview.sty b/src/patches/lltjp-preview.sty
new file mode 100644 (file)
index 0000000..f8a90ef
--- /dev/null
@@ -0,0 +1,16 @@
+%
+% lltjp-preview.sty
+%
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{lltjp-preview}[2017/05/08 Patch to preview for LuaTeX-ja]
+
+\RequirePackage{etoolbox,preview,luatexja}
+
+\patchcmd\pr@endbox{%
+   \pr@ship@end
+}{%
+   \setbox\pr@box\hbox{\yoko\box\pr@box}\pr@ship@end
+}{}{}
+
+\endinput