OSDN Git Service

Excluded ltj-kinsoku.lua (from the archive for CTAN)
[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=-1 %
12 \def\luatexjalatexLoaded{\endinput}
13
14 \NeedsTeXFormat{LaTeX2e}
15 \ProvidesPackage{ltj-latex}[2013/05/14 LaTeX support of LuaTeX-ja]
16
17 % Globally add to the head of a macro (cf. LaTeX2e's \g@addto@macro)
18 \long\def\ltj@g@addto@macro#1#2{
19   \begingroup
20     \def\ltj@tmpa{#2}
21     \toks@\expandafter\expandafter\expandafter{\expandafter\ltj@tmpa#1}
22     \xdef#1{\the\toks@}
23   \endgroup}
24
25 \def\ltj@AtBeginDocument{\ltj@g@addto@macro\@begindocumenthook}
26
27 \def\ltj@pkgpatch#1{\ltj@AtBeginDocument{\@ifpackageloaded{#1}{\usepackage{lltjp-#1}}{}}}
28
29 % similar to \ltj@pkgpatch, but this is used .sty which
30 % can be reloaded inside the document by \input.
31 \def\ltj@pkgpatchA#1{\ltj@AtBeginDocument{\@ifpackageloaded{#1}{\input{lltjp-#1.sty}}{}}}
32
33 \endlinechar=13
34
35 %%% patch for LaTeX
36 \usepackage{lltjfont}
37 \usepackage{lltjdefs}
38 \usepackage{lltjcore}
39
40 %%% default parameters
41 \directlua{
42   local s = kpse.find_file('ltj-kinsoku.lua', 'tex')
43   luatexja.stack.charprop_stack_table[0] = s and dofile(s) or {}
44 }
45
46 \ltjsetparameter{kanjiskip=0pt plus 0.4pt minus 0.4pt,
47   xkanjiskip=.25\zw plus 1pt minus 1pt,
48   autospacing, autoxspacing, jacharrange={-1},
49   yalbaselineshift=0pt, yjabaselineshift=0pt,
50   jcharwidowpenalty=500, differentjfm=paverage
51 }
52
53 \expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
54
55 %%% patch for packages
56 \ltj@pkgpatch{listings}
57 \ltj@pkgpatch{unicode-math}
58 \ltj@pkgpatch{xunicode}
59 \ltj@pkgpatch{fontspec}
60
61
62 %%------------------ all done
63 \ltj@latex@AtEnd
64 \endinput
65 %% EOF