Ticket #37919

Different behavior about kanjiskip and unicode-math

Open Date: 2018-01-27 19:51 Last Update: 2018-01-27 23:23

Reporter:
Owner:
(None)
Type:
Status:
Closed
Component:
(None)
MileStone:
(None)
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Invalid
File:
None

Details

I provide the following example to illustrate this issue.

  1. \documentclass{article}
  2. \usepackage{luatexja}[2018/01/21]
  3. \usepackage{unicode-math}[2018/01/13]
  4. \begin{document}
  5. 漢漢\typeout{\ltjgetparameter{kanjiskip}}%
  6. {\ltjsetkanjiskip 10pt \relax 漢漢}\typeout{\ltjgetparameter{kanjiskip}}%
  7. 漢漢
  8. \end{document}

I get the result as follow.

0.0pt plus 0.4pt minus 0.5pt
10.0pt
If I delete the unicode-math package, I get a different result. The values of kanjiskip are unified as expected.
0.0pt plus 0.4pt minus 0.5pt
0.0pt plus 0.4pt minus 0.5pt

Ticket History (3/7 Histories)

2018-01-27 19:51 Updated by: qinglee
  • New Ticket "Different behavior about kanjiskip and unicode-math" created
2018-01-27 19:55 Updated by: qinglee
  • Details Updated
2018-01-27 20:45 Updated by: h7k
Comment

In this case, simply using \ltjsetparameter would be fine:

{\ltjsetparameter{kanjiskip=10pt}漢漢\typeout{\ltjgetparameter{kanjiskip}}}%

\ltjsetkanjiskip and \ltjsetkxanjiskip are internal macros. The call of \ltj@setpar@global is needed before using these two commands:

 {\makeatletter\ltj@setpar@global\makeatother
  \ltjsetkanjiskip 10pt \relax 漢漢}\typeout{\ltjgetparameter{kanjiskip}}%


\ltj@setpar@global\ltjsetkanjiskip 10pt\relax and \ltjsetparameter{kanjiskip=10pt} has same effect. The latter is more general form, but the former is faster (since the former does not need to parse a key-value list).

2018-01-27 21:17 Updated by: qinglee
Comment

Thank you for your information. As you said, \ltjsetkanjiskip and \ltjsetkxanjiskip are used for performance. Since I need to set kanjiskip and xkanjiskip in \EverySelectfont. I am really sorry for my inattention.

2018-01-27 21:25 Updated by: qinglee
  • Status Update from Open to Closed
2018-01-27 21:26 Updated by: qinglee
  • Resolution Update from None to Invalid
2018-01-27 23:23 Updated by: qinglee
Comment

There might be an oversight in the definition of \ltj@setpar@global and \ltjglobalsetparameter.

  1. \protected\def\ltj@setpar@global{%
  2. \relax\ifnum\globaldefs>0\directlua{luatexja.isglobal='global'}%
  3. \else\directlua{luatexja.isglobal=''}\fi
  4. }

Please note that 0 is followed by \directlua{luatexja.isglobal='global'} which will be fully expanded by TeX for a complete number. It means that \directlua{luatexja.isglobal='global'} is always executed. It would be better to append a space or \relax to 0 to terminate the expansion.

Attachment File List

No attachments

Edit

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login