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/23 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}
22 % Globally add to the head of a macro (cf. LaTeX2e's \g@addto@macro)
23 \long\def\ltj@g@addto@macro#1#2{%
26 \toks@\expandafter\expandafter\expandafter{\expandafter\ltj@tmpa#1}
30 \def\ltj@AtBeginDocument{\ltj@g@addto@macro\@begindocumenthook}
32 \def\ltj@pkgpatch#1{\ltj@AtBeginDocument{\@ifpackageloaded{#1}{\usepackage{lltjp-#1}}{}}}
41 \RequirePackage{filehook}
42 \def\ltj@pkgpatch@im#1{%
43 \@ifnextchar[{\ltj@pkgpatch@im@{#1}}{\ltj@pkgpatch@im@{#1}[lltjp-#1]}}%]
44 \def\ltj@pkgpatch@im@#1[#2]{\AtEndOfPackageFile*{#1}{\input{#2.sty}}}
46 %%% default parameters
48 local s = kpse.find_file('ltj-kinsoku.lua', 'tex')
49 luatexja.stack.charprop_stack_table[0] = s and dofile(s) or {}
52 \ltjsetparameter{kanjiskip=\z@ plus .4pt minus .5pt,
53 xkanjiskip=.25\zw plus 1pt minus 1pt,
54 autospacing, autoxspacing, jacharrange={-1},
55 yalbaselineshift=\z@, yjabaselineshift=\z@,
56 jcharwidowpenalty=500, differentjfm=paverage
59 \expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
61 %%% patch for packages
62 \ltj@pkgpatch@im{listings}
63 \ltj@pkgpatch{xunicode} %% at \begin{document}
64 \ltj@pkgpatch@im{fontspec}
65 \ltj@pkgpatch{footmisc} %% at \begin{document}
66 \ltj@pkgpatch{tascmac}
67 \ltj@AtBeginDocument{\@ifpackageloaded{ascmac}{%
68 \edef\ltj@asc@temp{\noexpand\catcode`\noexpand\@=\the\catcode`\@}%
69 \makeatletter\input{lltjp-tascmac.sty}%
70 \ltj@asc@temp\let\ltj@asc@temp=\relax
72 \ltj@pkgpatch@im{stfloats}
73 \ltj@pkgpatch{preview} %% at \begin{document}
74 % (preview package has delayed option)
75 \ltj@pkgpatch{array} %% at \begin{document}
76 \ltj@pkgpatch@im{unicode-math}
77 \ltj@pkgpatch@im{siunitx}
79 \RequirePackage{lltjp-geometry}
81 %%------------------ all done