OSDN Git Service

luatexja-core.sty: Redefined \un{h,v}copy.
[luatex-ja/luatexja.git] / src / luatexja-core.sty
index ab446c2..76b5fe5 100644 (file)
 \def\ltj@@getjfontnumber#1{% result in \ltj@tempcntc 
   \ltj@reset@globaldefs
   \begingroup\ltj@curjfnt=-1 \ltj@curtfnt=-1\relax
-  #1\directlua{luatexja.__temp = -\the\ltj@curjfnt*\the\ltj@curtfnt}\endgroup
+  #1\directlua{luatexja.__temp = -(\the\ltj@curjfnt)*(\the\ltj@curtfnt)}\endgroup
   \ltj@tempcntc=\directlua{tex.sprint(luatexja.__temp)}\relax
   \ifnum\ltj@tempcntc=-1
     \@PackageError{luatexja-core}%
 \protected\def\ltj@@unvbox{%
   \directlua{luatexja.direction.check_dir(\the\ltj@tempcnta)}%
   \ltj@@orig@unvbox\ltj@tempcnta}
+\let\ltj@@orig@unhcopy=\unhcopy
+\let\ltj@@orig@unvcopy=\unvcopy
+\protected\def\unhcopy{\ltj@reset@globaldefs\afterassignment\ltj@@unhcopy\ltj@tempcnta}
+\protected\def\unvcopy{\ltj@reset@globaldefs\afterassignment\ltj@@unvcopy\ltj@tempcnta}
+\protected\def\ltj@@unhcopy{%
+  \directlua{luatexja.direction.check_dir(\the\ltj@tempcnta)}%
+  \ltj@@orig@unhcopy\ltj@tempcnta}
+\protected\def\ltj@@unvcopy{%
+  \directlua{luatexja.direction.check_dir(\the\ltj@tempcnta)}%
+  \ltj@@orig@unvcopy\ltj@tempcnta}
 
 
 %%%% lastbox