X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=src%2Fltj-latex.sty;h=fe0e69bf318cab32ff9065e1022cc315ede857c7;hb=847312c712d721a0198c00563075948541ced2b7;hp=2582dd59cc0721cda7c1fc13fcd5f0972bbbdefd;hpb=76539ff45d00c128d529d6c350973954c128b7cb;p=luatex-ja%2Fluatexja.git diff --git a/src/ltj-latex.sty b/src/ltj-latex.sty index 2582dd5..fe0e69b 100644 --- a/src/ltj-latex.sty +++ b/src/ltj-latex.sty @@ -12,13 +12,23 @@ \def\luatexjalatexLoaded{\endinput} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ltj-latex}[2012/04/21 LuaLaTeX-ja] +\ProvidesPackage{ltj-latex}[2013/05/14 LaTeX support of LuaTeX-ja] -\def\ltj@pkgpatch#1{\AtBeginDocument{\@ifpackageloaded{#1}{\usepackage{lltjp-#1}}{}}} +% Globally add to the head of a macro (cf. LaTeX2e's \g@addto@macro) +\long\def\ltj@g@addto@macro#1#2{ + \begingroup + \def\ltj@tmpa{#2} + \toks@\expandafter\expandafter\expandafter{\expandafter\ltj@tmpa#1} + \xdef#1{\the\toks@} + \endgroup} + +\def\ltj@AtBeginDocument{\ltj@g@addto@macro\@begindocumenthook} + +\def\ltj@pkgpatch#1{\ltj@AtBeginDocument{\@ifpackageloaded{#1}{\usepackage{lltjp-#1}}{}}} % similar to \ltj@pkgpatch, but this is used .sty which % can be reloaded inside the document by \input. -\def\ltj@pkgpatchA#1{\AtBeginDocument{\@ifpackageloaded{#1}{\input{lltjp-#1.sty}}{}}} +\def\ltj@pkgpatchA#1{\ltj@AtBeginDocument{\@ifpackageloaded{#1}{\input{lltjp-#1.sty}}{}}} \endlinechar=13 @@ -28,20 +38,25 @@ \usepackage{lltjcore} %%% default parameters +\directlua{ + local s = kpse.find_file('ltj-kinsoku.lua', 'tex') + luatexja.stack.charprop_stack_table[0] = s and dofile(s) or {} +} + \ltjsetparameter{kanjiskip=0pt plus 0.4pt minus 0.4pt, xkanjiskip=.25\zw plus 1pt minus 1pt, autospacing, autoxspacing, jacharrange={-1}, yalbaselineshift=0pt, yjabaselineshift=0pt, - jcharwidowpenalty=500, differentjfm=average + jcharwidowpenalty=500, differentjfm=paverage } -\input luatexja-kinsoku.tex \expandafter\let\csname JY3/mc/m/n/10\endcsname\relax %%% patch for packages \ltj@pkgpatch{listings} \ltj@pkgpatch{unicode-math} \ltj@pkgpatch{xunicode} +\ltj@pkgpatch{fontspec} %%------------------ all done