OSDN Git Service

ltj-inputbuf.lua: add a close paren.
[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}[2015/09/21 LaTeX support of LuaTeX-ja]
16
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}
21
22 % Globally add to the head of a macro (cf. LaTeX2e's \g@addto@macro)
23 \long\def\ltj@g@addto@macro#1#2{%
24   \begingroup
25     \def\ltj@tmpa{#2}
26     \toks@\expandafter\expandafter\expandafter{\expandafter\ltj@tmpa#1}
27     \xdef#1{\the\toks@}
28   \endgroup}
29
30 \def\ltj@AtBeginDocument{\ltj@g@addto@macro\@begindocumenthook}
31
32 \def\ltj@pkgpatch#1{\ltj@AtBeginDocument{\@ifpackageloaded{#1}{\usepackage{lltjp-#1}}{}}}
33
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}}{}}}
37
38 \endlinechar=13
39
40 %%% patch for LaTeX
41 \usepackage{lltjfont}
42 \usepackage{lltjdefs}
43 \usepackage{lltjcore}
44
45 %%% default parameters
46 \directlua{
47   local s = kpse.find_file('ltj-kinsoku.lua', 'tex')
48   luatexja.stack.charprop_stack_table[0] = s and dofile(s) or {}
49 }
50
51 \ltjsetparameter{kanjiskip=\z@ plus .4pt minus .4pt,
52   xkanjiskip=.25\zw plus 1pt minus 1pt,
53   autospacing, autoxspacing, jacharrange={-1},
54   yalbaselineshift=\z@, yjabaselineshift=\z@,
55   jcharwidowpenalty=500, differentjfm=paverage
56 }
57
58 \expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
59
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}{\input{lltjp-tascmac.sty}}{}}% ascmac
69
70 \RequirePackage{lltjp-geometry}
71
72
73 %%------------------ all done
74 \ltj@latex@AtEnd
75 \endinput
76 %% EOF