\def\luatexjalatexLoaded{\endinput}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{luatexja-latex}[2011/08/01 v0.1]
+\ProvidesPackage{luatexja-latex}[2011/11/22 LuaLaTeX-ja]
-\endlinechar=13
+\def\ltj@pkgpatchlist{}
+\def\ltj@pkgpatch#1{
+ \@ifpackageloaded{#1}{\usepackage{lltjp-#1}}{
+ \@ifpackageloaded{filehook}{\AtEndOfPackageFile*{#1}{\usepackage{lltjp-#1}}}{}
+ }
+ \ifx\ltj@pkgpatchlist\@empty
+ \gdef\ltj@pkgpatchlist{#1}
+ \else
+ \xdef\ltj@pkgpatchlist{\ltj@pkgpatchlist, #1}
+ \fi
+}
+% similar to \ltj@pkgpatch, but this is used .sty which
+% can be reloaded inside the document by \input.
+\def\ltj@pkgpatchA#1{
+ \@ifpackageloaded{#1}{\input{lltjp-#1.sty}}{
+ \@ifpackageloaded{filehook}{\AtEndOfFile{#1.sty}{\input{lltjp-#1.sty}}}{}
+ }
+ \ifx\ltj@pkgpatchlist\@empty
+ \gdef\ltj@pkgpatchlist{#1}
+ \else
+ \xdef\ltj@pkgpatchlist{\ltj@pkgpatchlist, #1}
+ \fi
+}
-%%% patch for LaTeX (similar to plfonts.dtx)
-\input{lltjfont.sty}
-\input{lltjdefs.sty}
-\input{lltjcore.sty}
+\endlinechar=13
-%%% parameter
+%%% patch for LaTeX
+\usepackage{lltjfont}
+\usepackage{lltjdefs}
+\usepackage{lltjcore}
-\expandafter\csname JY3/mc/m/n/10\endcsname\relax
-\ltjsetparameter{kanjiskip=0pt plus 0.4pt minus 0.4pt,
+%%% default parameters
+\ltjsetparameter{kanjiskip=0pt plus 0.4pt minus 0.4pt,
xkanjiskip=.25\zw plus 1pt minus 1pt,
- autospacing, autoxspacing, jacharrange={-1},
+ autospacing, autoxspacing, jacharrange={-1},
yalbaselineshift=0pt, yjabaselineshift=0pt,
jcharwidowpenalty=500, differentjfm=average
}
\input luatexja-kinsoku.tex
+\expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
+
+%%% patch for packages
+\IfFileExists{filehook.sty}{\usepackage{filehook}}{}
+\ltj@pkgpatch{listings}
+\ltj@pkgpatchA{lstmisc}
+\ltj@pkgpatch{unicode-math}
+\ltj@pkgpatch{xunicode}
+\@ifpackageloaded{filehook}{}{%
+ \@PackageWarningNoLine{luatexja-latex}{
+ LuaTeX-ja uses filehook package to apply patches to the following packages:\MessageBreak
+ \ltj@pkgpatchlist.\MessageBreak
+ But your TeX system does not have the filehook package.\MessageBreak
+ Therefore problems may occur if you load the above packages after this message}%
+}
%%------------------ all done
\ltj@latex@AtEnd