OSDN Git Service

Improve \ltj@pkgpatch in luatexja-latex.sty.
[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 \endlinechar=13
30
31 %%% patch for LaTeX
32 \usepackage{lltjfont}
33 \usepackage{lltjdefs}
34 \usepackage{lltjcore}
35
36 %%% default parameters
37 \ltjsetparameter{kanjiskip=0pt plus 0.4pt minus 0.4pt, 
38   xkanjiskip=.25\zw plus 1pt minus 1pt,
39   autospacing, autoxspacing, jacharrange={-1}, 
40   yalbaselineshift=0pt, yjabaselineshift=0pt,
41   jcharwidowpenalty=500, differentjfm=average
42 }
43
44 \input luatexja-kinsoku.tex
45 \expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
46
47 %%% patch for packages
48 \IfFileExists{filehook.sty}{\usepackage{filehook}}{}
49 \ltj@pkgpatch{listings}
50 \ltj@pkgpatch{unicode-math}
51 \ltj@pkgpatch{xunicode}
52 \@ifpackageloaded{filehook}{}{%
53   \@PackageWarningNoLine{luatexja-latex}{
54     LuaTeX-ja uses filehook package to apply patches to the following packages:\MessageBreak
55     \ltj@pkgpatchlist.\MessageBreak
56     But your TeX system does not have the filehook package.\MessageBreak
57     Therefore problems may occur if you load the above packages after this message}%
58 }
59
60 %%------------------ all done
61 \ltj@latex@AtEnd
62 \endinput
63 %% EOF