summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-preview.sty
blob: cfd8e527e6fa86cad4736347adbe80fa3b1dfe44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
%
% lltjp-preview.sty
%

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{lltjp-preview}[2018/01/20 Patch to preview for LuaTeX-ja]

\RequirePackage{etoolbox,preview,luatexja}
\newbox\ltj@preview@box

\patchcmd\pr@endbox{%
   \pr@ship@end
}{%
   \setbox\ltj@preview@box=\box\AtBeginShipoutBox
   \setbox\AtBeginShipoutBox=\vbox{\yoko\box\pr@box}%
   \directlua{luatexja.direction.finalize()}%
   \setbox\pr@box=\box\AtBeginShipoutBox
   \setbox\AtBeginShipoutBox=\box\ltj@preview@box
   \pr@ship@end
}{}{}

\endinput