6 %% Avoid multiple loading.
7 \csname luatexjalatexLoaded\endcsname
8 \edef\ltj@latex@AtEnd{%
9 \endlinechar=\the\endlinechar
12 \def\luatexjalatexLoaded{\endinput}
14 \NeedsTeXFormat{LaTeX2e}
15 \ProvidesPackage{ltj-latex}[2018/08/24 LaTeX support of LuaTeX-ja]
17 % cleanup at end of the document
18 %\let\ltj@@orig@end=\@@end
19 %\protected\def\@@end{%
20 % \directlua{luatexja.ext_cleanup()}\ltj@@orig@end}
30 \RequirePackage{filehook}
32 \def\ltj@pkgpatch@im#1{%
33 \@ifnextchar[{\ltj@pkgpatch@im@{#1}}{\ltj@pkgpatch@im@{#1}[lltjp-#1]}}%]
34 \def\ltj@pkgpatch@im@#1[#2]{%
35 \AtEndOfPackageFile*{#1}{%
36 \@ifpackageloaded{#2}{}{%
37 \@namedef{ver@#2.\@pkgextension}{0000/00/00}%dummy
38 \if\catcode`@=11\let\ltj@temp\relax\else
39 \edef\ltj@temp{\noexpand\catcode`@=\the\catcode`@\relax}\makeatletter
41 \@@input{#2.\@pkgextension}\ltj@temp
47 \@ifnextchar[{\ltj@pkgpatch@@{#1}}{\ltj@pkgpatch@@{#1}[lltjp-#1]}}%]
48 \def\ltj@pkgpatch@@#1[#2]{%
49 \gpreto\@begindocumenthook{%
50 \@ifpackageloaded{#1}{%
51 \@ifpackageloaded{#2}{}{\RequirePackage{#2}}%
56 %%% default parameters
58 local s = kpse.find_file('ltj-kinsoku.lua', 'tex')
59 luatexja.stack.charprop_stack_table[0] = s and dofile(s) or {}
62 \ltjsetparameter{kanjiskip=\z@ plus .4pt minus .5pt,
63 xkanjiskip=.25\zw plus 1pt minus 1pt,
64 autospacing, autoxspacing, jacharrange={-1},
65 yalbaselineshift=\z@, yjabaselineshift=\z@,
66 jcharwidowpenalty=500, differentjfm=paverage
69 \expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
71 %%% patch for packages
72 \ltj@pkgpatch@im{listings}
73 \ltj@pkgpatch{xunicode} %% at \begin{document}
74 \ltj@pkgpatch@im{fontspec}
75 \ltj@pkgpatch{footmisc} %% at \begin{document}
76 \ltj@pkgpatch{tascmac}
77 \ltj@pkgpatch{ascmac}[lltjp-tascmac]
78 \ltj@pkgpatch@im{stfloats}
79 \ltj@pkgpatch{preview} %% at \begin{document}
80 % (preview package has delayed option)
81 \ltj@pkgpatch{array} %% at \begin{document}
82 \ltj@pkgpatch@im{unicode-math}
83 \ltj@pkgpatch@im{siunitx}
85 \RequirePackage{lltjp-geometry}
87 %%------------------ all done