OSDN Git Service

typo
[luatex-ja/luatexja.git] / src / ltj-latex.sty
1 %
2 % ltj-latex.sty
3 %
4
5 %! これは外から読まれない
6 %% Avoid multiple loading.
7 \csname luatexjalatexLoaded\endcsname
8 \edef\ltj@latex@AtEnd{%
9 \endlinechar=\the\endlinechar
10 \relax}
11 \endlinechar\m@ne%
12 \def\luatexjalatexLoaded{\endinput}
13
14 \NeedsTeXFormat{LaTeX2e}
15 \ProvidesPackage{ltj-latex}[2017/06/18 LaTeX support of LuaTeX-ja]
16
17 % LaTeX2e 2017/05/01 で行われる対策
18 % 本 sty からは 2018/05/01 削除予定
19 \ifx\document@default@language \@undefined
20   \let\document@default@language\m@ne
21 \fi
22 \ifx\l@nohyphenation \@undefined
23   \newlanguage\l@nohyphenation
24 \fi
25
26 % cleanup at end of the document
27 %\let\ltj@@orig@end=\@@end
28 %\protected\def\@@end{%
29 %  \directlua{luatexja.ext_cleanup()}\ltj@@orig@end}
30
31 % Globally add to the head of a macro (cf. LaTeX2e's \g@addto@macro)
32 \long\def\ltj@g@addto@macro#1#2{%
33   \begingroup
34     \def\ltj@tmpa{#2}
35     \toks@\expandafter\expandafter\expandafter{\expandafter\ltj@tmpa#1}
36     \xdef#1{\the\toks@}
37   \endgroup}
38
39 \def\ltj@AtBeginDocument{\ltj@g@addto@macro\@begindocumenthook}
40
41 \def\ltj@pkgpatch#1{\ltj@AtBeginDocument{\@ifpackageloaded{#1}{\usepackage{lltjp-#1}}{}}}
42
43 % similar to \ltj@pkgpatch, but this is used .sty which
44 % can be reloaded inside the document by \input.
45 \def\ltj@pkgpatchA#1{\ltj@AtBeginDocument{\@ifpackageloaded{#1}{\input{lltjp-#1.sty}}{}}}
46
47 \endlinechar=13
48
49 %%% patch for LaTeX
50 \usepackage{lltjfont}
51 \usepackage{lltjdefs}
52 \usepackage{lltjcore}
53
54 %%% default parameters
55 \directlua{
56   local s = kpse.find_file('ltj-kinsoku.lua', 'tex')
57   luatexja.stack.charprop_stack_table[0] = s and dofile(s) or {}
58 }
59
60 \ltjsetparameter{kanjiskip=\z@ plus .4pt minus .5pt,
61   xkanjiskip=.25\zw plus 1pt minus 1pt,
62   autospacing, autoxspacing, jacharrange={-1},
63   yalbaselineshift=\z@, yjabaselineshift=\z@,
64   jcharwidowpenalty=500, differentjfm=paverage
65 }
66
67 \expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
68
69 %%% patch for packages
70 \ltj@pkgpatch{listings}
71 \ltj@pkgpatch{unicode-math}
72 \ltj@pkgpatch{xunicode}
73 \ltj@pkgpatch{fontspec}
74 \ltj@pkgpatch{footmisc}
75 \ltj@pkgpatch{tascmac}
76 \ltj@AtBeginDocument{\@ifpackageloaded{ascmac}{%
77   \edef\ltj@asc@temp{\noexpand\catcode`\noexpand\@=\the\catcode`\@}%
78   \makeatletter\input{lltjp-tascmac.sty}%
79   \ltj@asc@temp\let\ltj@asc@temp=\relax
80 }{}}% ascmac
81 \ltj@pkgpatch{stfloats}
82 \ltj@pkgpatch{preview}
83 \ltj@pkgpatch{array}
84
85 \RequirePackage{lltjp-geometry}
86 \RequirePackage{filehook}
87 \AtEndOfPackageFile*{fontspec}{%
88   \input{lltjp-fontspec-immediate.sty}
89   % \RequirePackage だと fontspec にオプション指定したときにエラー出る
90 }
91
92
93 %%------------------ all done
94 \ltj@latex@AtEnd
95 \endinput
96 %% EOF