OSDN Git Service

Update date
[luatex-ja/luatexja.git] / src / luatexja-core.sty
index d55c375..5784b1b 100644 (file)
@@ -65,7 +65,7 @@
   \expandafter\let\csname ifltj@in@latex\expandafter\endcsname
     \csname iftrue\endcsname
   \NeedsTeXFormat{LaTeX2e}
-  \ProvidesPackage{luatexja-core}[2015/10/12 Core of LuaTeX-ja]
+  \ProvidesPackage{luatexja-core}[2016/03/31 Core of LuaTeX-ja]
 \fi                             %</LaTeX>
 
 %% Load prerequisite packages.
@@ -73,6 +73,7 @@
 \newif\ifltj@everyhook@avail\ltj@everyhook@availfalse
 %! 外部パッケージは普通の \endlinechar で読まないと危険.
 \ifltj@in@latex                 %<*LaTeX>
+  \RequirePackage{luatexbase}
   \RequirePackage{luaotfload} [2013/12/31] % v2.3
   \RequirePackage{ltxcmds}    [2011/11/09] % v1.22
   \RequirePackage{pdftexcmds} [2011/11/29] % v0.20
@@ -80,6 +81,7 @@
   \RequirePackage{atbegshi}
   \IfFileExists{everyhook.sty}{\RequirePackage{everyhook}\ltj@everyhook@availtrue}{}
 \else                           %<*!LaTeX>
+  \input luatexbase.sty
   \input luaotfload.sty
   \input ltxcmds.sty
   \input pdftexcmds.sty
 %! ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
 % LuaTeX-ja core TeX source
 
-\catcode"FFFFF=14 %"
+\newcount\ltjlineendcomment
+\ltjlineendcomment="FFFFF
+\catcode\ltjlineendcomment=14 %"
 
 \def\ltj@loaded{hoge}
 
 \def\ltj@defdimen{0}
 
 %%%%%%%% Attributes for Japanese typesetting.
-\newluatexattribute\ltj@icflag    % attribute for italic correction
-\newluatexattribute\ltj@curjfnt   % index for ``current horizontal Japanese font''
-\newluatexattribute\ltj@curtfnt   % index for ``current vertical Japanese font''
-\newluatexattribute\ltj@origchar  %
-\newluatexattribute\ltj@charclass %
-\newluatexattribute\ltj@charcode %
-\newluatexattribute\ltj@autospc   % attribute for autospacing
-\newluatexattribute\ltj@autoxspc  % attribute for autoxspacing
-\newluatexattribute\ltj@yablshift % attribute for yalbaselineshift
-\newluatexattribute\ltj@ykblshift % attribute for yjabaselineshift
-\newluatexattribute\ltj@tablshift % attribute for talbaselineshift
-\newluatexattribute\ltj@tkblshift % attribute for tjabaselineshift
-\newluatexattribute\jfam          % index for current jfam
-
-\newluatexattribute\ltj@dir
+\newattribute\ltj@icflag    % attribute for italic correction
+\newattribute\ltj@curjfnt   % index for ``current horizontal Japanese font''
+\newattribute\ltj@curtfnt   % index for ``current vertical Japanese font''
+\newattribute\ltj@origchar  %
+\newattribute\ltj@charclass %
+\newattribute\ltj@charcode %
+\newattribute\ltj@autospc   % attribute for autospacing
+\newattribute\ltj@autoxspc  % attribute for autoxspacing
+\newattribute\ltj@yablshift % attribute for yalbaselineshift
+\newattribute\ltj@ykblshift % attribute for yjabaselineshift
+\newattribute\ltj@tablshift % attribute for talbaselineshift
+\newattribute\ltj@tkblshift % attribute for tjabaselineshift
+\newattribute\jfam          % index for current jfam
+
+\newattribute\ltj@dir
 \newlanguage\ltj@@japanese
 \ltj@dir\z@
 \ltj@icflag\z@
 \newcount\ltj@tempcnta
 \ltj@tempcnta\z@
 \loop\ifnum\ltj@tempcnta<7
-  \expandafter\newluatexattribute%
+  \expandafter\newattribute%
     \csname ltj@kcat\the\ltj@tempcnta\endcsname
   \csname ltj@kcat\the\ltj@tempcnta\endcsname=0
   \advance\ltj@tempcnta\@ne
     t[\the\ltj@zh@inner] = function() setdimen('ltj@zh', ltjf.get_zh()) end
   }
   \protected\def\zw{\luafunction\ltj@zw@inner\ltj@zw}
-  \protected\def\zh{\luafuntcion\ltj@zh@inner\ltj@zh}
+  \protected\def\zh{\luafunction\ltj@zh@inner\ltj@zh}
 \else
   \protected\def\zw{\directlua{tex.setdimen('ltj@zw', luatexja.jfont.get_zw())}\ltj@zw}
   \protected\def\zh{\directlua{tex.setdimen('ltj@zh', luatexja.jfont.get_zh())}\ltj@zh}
 
 %%%% \hbox, \vbox, \vtop
 \setbox\z@\hbox{%
+  \primitive\everymath{}
   $\directlua{% This value depends on the version of LuaTeX.
-    luatexja.stack.mmode = -tex.nest[tex.nest.ptr].mode
+     luatexja.stack.mmode = -tex.nest[tex.nest.ptr].mode
   }$%
 }
 \setbox\z@\box\voidb@x
   \input ltj-plain.sty %
 \fi\fi                          %</LaTeX|plain>
 
-\newluatexcatcodetable\ltj@temp@cctb
+\newcatcodetable\ltj@temp@cctb
 \def\ltj@overwrite@catcodetable#1{%
   \setluatexcatcodetable\ltj@temp@cctb{\luatexcatcodetable#1}%
-  \setluatexcatcodetable#1{\luatexcatcodetable\ltj@temp@cctb\catcode"FFFFF=14}%"
+  \setluatexcatcodetable#1{\luatexcatcodetable\ltj@temp@cctb\catcode\ltjlineendcomment=14}%"
 }
 \ltj@overwrite@catcodetable\CatcodeTableLaTeX
 \ltj@overwrite@catcodetable\CatcodeTableLaTeXAtLetter