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}[2016/08/21 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}}{}}}
34 % similar to \ltj@pkgpatch, but this is used .sty which
35 % can be reloaded inside the document by \input.
36 \def\ltj@pkgpatchA#1{\ltj@AtBeginDocument{\@ifpackageloaded{#1}{\input{lltjp-#1.sty}}{}}}
45 %%% default parameters
47 local s = kpse.find_file('ltj-kinsoku.lua', 'tex')
48 luatexja.stack.charprop_stack_table[0] = s and dofile(s) or {}
51 \ltjsetparameter{kanjiskip=\z@ plus .4pt minus .5pt,
52 xkanjiskip=.25\zw plus 1pt minus 1pt,
53 autospacing, autoxspacing, jacharrange={-1},
54 yalbaselineshift=\z@, yjabaselineshift=\z@,
55 jcharwidowpenalty=500, differentjfm=paverage
58 \expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
60 %%% patch for packages
61 \ltj@pkgpatch{listings}
62 \ltj@pkgpatch{unicode-math}
63 \ltj@pkgpatch{xunicode}
64 \ltj@pkgpatch{fontspec}
65 \ltj@pkgpatch{stfloats}
66 \ltj@pkgpatch{footmisc}
67 \ltj@pkgpatch{tascmac}
68 \ltj@AtBeginDocument{\@ifpackageloaded{ascmac}{%
69 \edef\ltj@asc@temp{\noexpand\catcode`\noexpand\@=\the\catcode`\@}%
70 \makeatletter\input{lltjp-tascmac.sty}%
71 \ltj@asc@temp\let\ltj@asc@temp=\relax
74 \RequirePackage{lltjp-geometry}
77 %%------------------ all done