OSDN Git Service

39e2992709db9208772442e5c7b19ca8b16813f8
[luatex-ja/luatexja.git] / src / luatexja-latex.sty
1 %
2 % luatexja-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{luatexja-latex}[2011/11/22 LuaLaTeX-ja]
16
17 \def\ltj@pkgpatchlist{}
18 \def\ltj@pkgpatch#1{
19   \@ifpackageloaded{#1}{\usepackage{lltjp-#1}}{
20     \@ifpackageloaded{filehook}{\AtEndOfPackageFile*{#1}{\usepackage{lltjp-#1}}}{}
21   }
22   \ifx\ltj@pkgpatchlist\@empty
23     \gdef\ltj@pkgpatchlist{#1}
24   \else
25     \xdef\ltj@pkgpatchlist{\ltj@pkgpatchlist, #1}
26   \fi
27 }
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{
32   \@ifpackageloaded{#1}{\input{lltjp-#1.sty}}{
33     \@ifpackageloaded{filehook}{\AtEndOfFile{#1.sty}{\input{lltjp-#1.sty}}}{}
34   }
35   \ifx\ltj@pkgpatchlist\@empty
36     \gdef\ltj@pkgpatchlist{#1}
37   \else
38     \xdef\ltj@pkgpatchlist{\ltj@pkgpatchlist, #1}
39   \fi
40 }
41
42 \endlinechar=13
43
44 %%% patch for LaTeX
45 \usepackage{lltjfont}
46 \usepackage{lltjdefs}
47 \usepackage{lltjcore}
48
49 %%% default parameters
50 \ltjsetparameter{kanjiskip=0pt plus 0.4pt minus 0.4pt,
51   xkanjiskip=.25\zw plus 1pt minus 1pt,
52   autospacing, autoxspacing, jacharrange={-1},
53   yalbaselineshift=0pt, yjabaselineshift=0pt,
54   jcharwidowpenalty=500, differentjfm=average
55 }
56
57 \input luatexja-kinsoku.tex
58 \expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
59
60 %%% patch for packages
61 \IfFileExists{filehook.sty}{\usepackage{filehook}}{}
62 \ltj@pkgpatch{listings}
63 \ltj@pkgpatchA{lstmisc}
64 \ltj@pkgpatch{unicode-math}
65 \ltj@pkgpatch{xunicode}
66 \@ifpackageloaded{filehook}{}{%
67   \@PackageWarningNoLine{luatexja-latex}{
68     LuaTeX-ja uses filehook package to apply patches to the following packages:\MessageBreak
69     \ltj@pkgpatchlist.\MessageBreak
70     But your TeX system does not have the filehook package.\MessageBreak
71     Therefore problems may occur if you load the above packages after this message}%
72 }
73
74 %%------------------ all done
75 \ltj@latex@AtEnd
76 \endinput
77 %% EOF