OSDN Git Service

fix #37164
[luatex-ja/luatexja.git] / src / patches / lltjp-preview.sty
1 %
2 % lltjp-preview.sty
3 %
4
5 \NeedsTeXFormat{LaTeX2e}
6 \ProvidesPackage{lltjp-preview}[2018/01/20 Patch to preview for LuaTeX-ja]
7
8 \RequirePackage{etoolbox,preview,luatexja}
9 \newbox\ltj@preview@box
10
11 \patchcmd\pr@endbox{%
12    \pr@ship@end
13 }{%
14    \setbox\ltj@preview@box=\box\AtBeginShipoutBox
15    \setbox\AtBeginShipoutBox=\vbox{\yoko\box\pr@box}%
16    \directlua{luatexja.direction.finalize()}%
17    \setbox\pr@box=\box\AtBeginShipoutBox
18    \setbox\AtBeginShipoutBox=\box\ltj@preview@box
19    \pr@ship@end
20 }{}{}
21
22 \endinput