Ticket #31276

unicode-math 使用時の align で位置が揃わなくなる

Open Date: 2013-05-03 11:59 Last Update: 2013-05-14 07:01

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

Details

以下のようなコードで,luatexja が読み込まれていると \le, \ge, \simeq などの位置が意図通りに揃いません(少し左にずれます). 右側の文字とのアキもおかしいみたいです.

\documentclass{article}

\usepackage{amsmath,unicode-math}
\setmathfont{XITSMath}

\usepackage{luatexja}

\begin{document}
\begin{align*}
  a&=b\\
  &\le d\\
  &\ge e\\
  &\simeq f\\
  &<g
\end{align*}
\end{document}
なお,
\documentclass{article}

\usepackage{amsmath,unicode-math}
\setmathfont{XITSMath}

\usepackage{luatexja}

\begin{document}
\begin{align*}
  a&=b\\
  &{}\le d\\
  &{}\ge e\\
  &{}\simeq f\\
  &<g
\end{align*}
\end{document}
だと意図通りになっているように見えます.

Ticket History (3/5 Histories)

2013-05-03 11:59 Updated by: kmaeda
  • New Ticket "unicode-math 使用時の align で位置が揃わなくなる" created
2013-05-03 13:14 Updated by: kmaeda
Comment

lltjp-unicode-math.sty により,

> \leq=macro:
->\ifmmode ≤\else {\directlua {tex.globaldefs=0}\ltj@allalchar ≤}\fi .
なんですが,align 環境の & の直後は数式モードと判定されないみたいで,それがこの挙動の原因でしょうか.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
  a&=b\\
  &\ifmmode m\else n\fi\\  % => n
  &{}\ifmmode m\else n\fi  % => m
\end{align*}
\end{document}
2013-05-03 13:19 Updated by: kmaeda
Comment

ググってみたら関連の QA を見つけました: Re: 行頭での \ifmmode

lltjp-unicode-math.sty の \ifmmode の前に \relax を入れれば解決でしょうか.手元で試した限りではうまくいっているみたいです.

2013-05-03 13:27 Updated by: kmaeda
  • Resolution Update from None to Fixed
  • Owner Update from (None) to kmaeda
Comment

commit daafe93 で上記修正を入れてみました.何か不具合があればお願いします.

2013-05-14 07:01 Updated by: h7k
  • Status Update from Open to Closed
  • Ticket Close date is changed to 2013-05-14 07:01
Comment

治っているので完了とします.

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