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}[2017/05/05 LaTeX support of LuaTeX-ja]
17 % LaTeX2e 2017/05/01 で行われる対策
18 \ifx\document@default@language \@undefined
19 \let\document@default@language\m@ne
21 \ifx\l@nohyphenation \@undefined
22 \newlanguage\l@nohyphenation
25 % cleanup at end of the document
26 %\let\ltj@@orig@end=\@@end
27 %\protected\def\@@end{%
28 % \directlua{luatexja.ext_cleanup()}\ltj@@orig@end}
30 % Globally add to the head of a macro (cf. LaTeX2e's \g@addto@macro)
31 \long\def\ltj@g@addto@macro#1#2{%
34 \toks@\expandafter\expandafter\expandafter{\expandafter\ltj@tmpa#1}
38 \def\ltj@AtBeginDocument{\ltj@g@addto@macro\@begindocumenthook}
40 \def\ltj@pkgpatch#1{\ltj@AtBeginDocument{\@ifpackageloaded{#1}{\usepackage{lltjp-#1}}{}}}
42 % similar to \ltj@pkgpatch, but this is used .sty which
43 % can be reloaded inside the document by \input.
44 \def\ltj@pkgpatchA#1{\ltj@AtBeginDocument{\@ifpackageloaded{#1}{\input{lltjp-#1.sty}}{}}}
53 %%% default parameters
55 local s = kpse.find_file('ltj-kinsoku.lua', 'tex')
56 luatexja.stack.charprop_stack_table[0] = s and dofile(s) or {}
59 \ltjsetparameter{kanjiskip=\z@ plus .4pt minus .5pt,
60 xkanjiskip=.25\zw plus 1pt minus 1pt,
61 autospacing, autoxspacing, jacharrange={-1},
62 yalbaselineshift=\z@, yjabaselineshift=\z@,
63 jcharwidowpenalty=500, differentjfm=paverage
66 \expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
68 %%% patch for packages
69 \ltj@pkgpatch{listings}
70 \ltj@pkgpatch{unicode-math}
71 \ltj@pkgpatch{xunicode}
72 \ltj@pkgpatch{fontspec}
73 \ltj@pkgpatch{footmisc}
74 \ltj@pkgpatch{tascmac}
75 \ltj@AtBeginDocument{\@ifpackageloaded{ascmac}{%
76 \edef\ltj@asc@temp{\noexpand\catcode`\noexpand\@=\the\catcode`\@}%
77 \makeatletter\input{lltjp-tascmac.sty}%
78 \ltj@asc@temp\let\ltj@asc@temp=\relax
80 \ltj@pkgpatch{stfloats}
81 \ltj@pkgpatch{preview}
83 \RequirePackage{lltjp-geometry}
84 \RequirePackage{filehook}
85 \AtEndOfPackageFile*{fontspec}{%
86 \input{lltjp-fontspec-immediate.sty}
87 % \RequirePackage だと fontspec にオプション指定したときにエラー出る
91 %%------------------ all done