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