Ticket #39590

\widetilde positioned to high after luatexja is loaded

Open Date: 2019-09-18 15:15 Last Update: 2019-09-27 15:01

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

Details

Hello,

With TeXLive 2019 the following LaTeX code

  1. \documentclass{article}
  2. \usepackage{amsmath}
  3. % \usepackage{mathptmx}
  4. % \usepackage{mathabx}
  5. \usepackage{luatexja}
  6. \begin{document}
  7. $\widetilde{\psi}$ $\widehat{\psi}$ % $\widebar{\psi}$
  8. $\tilde{\psi}$ $\hat{\psi}$ $\bar{\psi}$
  9. $\widetilde{a}$ $\widehat{a}$ % $\widebar{a}$
  10. $\tilde{a}$ $\hat{a}$ $\bar{a}$
  11. \end{document}
outputs \widetilde and \widehat symbols positioned to high
(see how it looks https://drive.google.com/file/d/1f3HrONkaPAkld_yEl8cRRiBUt3gy2uQZ/view?usp=sharing).
If I load mathabx style for \widebar command sequence, all \wide... symbols go to low with the greek letter.
In my real document I have used mathptmx + luatexja-fontspec, when I saw the problem.

I use luatex.exe v1.10.0 and luaotfload 2019/08/11 v2.991.
I also have TeXLive 2018 with luaotfload 2017/01/29 v2.8 at my disposal.
The problem in this older system is not present.
I have searched for the cause of the problem, if You are interested please read below what I have found.

The reported behaviour is caused by a new set_xheight function (from luaotfload/luaotfload-auxiliary.lua)
which is assigned to patch_font callback (from luaotfload/luaotfload-loaders.lua).
There is the following comment in luaotfload/luaotfload-loaders.lua:

  1. if type (fontdata) == "table" and fontdata.encodingbytes == 2 then
  2. --- We need to test for `encodingbytes` to avoid passing
  3. --- tfm fonts to `patch_font`. These fonts are fragile
  4. --- because they use traditional TeX font handling.
  5. luatexbase.call_callback ("luaotfload.patch_font", fontdata, specification, id)
  6. else
  7. luatexbase.call_callback ("luaotfload.patch_font_unsafe", fontdata, specification, id)
  8. end
If I replace the following conditional in "font_callback" function (from luatexja/ltj-rmlgbm.lua):
  1. if type (tfmdata) == "table" and tfmdata.shared then
  2. luatexbase.call_callback("luaotfload.patch_font", tfmdata, name)
  3. end
with the code from above, the mentioned symbols will be positioned at the right height again.
This is because patch_font_unsafe callback is used instead of patch_font,
which has assigned different set functions to it and set_xheight is not one of them.
I do not know if this change would damage the intended luatexja behaviour though.

I have found out that from the amsmath package only the following code is necessary in order to produce the incorrect output:

  1. \@ifundefined{cmex@opt}{\def\cmex@opt{7}}{}
  2. \ifnum\cmex@opt=7 \relax
  3. \DeclareFontShape{OMX}{cmex}{m}{n}{%
  4. <-8>cmex7<8>cmex8<9>cmex9%
  5. <10><10.95><12><14.4><17.28><20.74><24.88>cmex10%
  6. }{}%
  7. \expandafter\let\csname OMX/cmex/m/n/10\endcsname\relax
  8. % \else ...
  9. \fi

I hope this information will be of some help.
And I would very much appreciate a fix of this problem.

Thanks in advance,
Lolita Tolenė

Ticket History (3/4 Histories)

2019-09-18 15:15 Updated by: lolitazt
  • New Ticket "\widetilde positioned to high after luatexja is loaded" created
2019-09-18 21:57 Updated by: h7k
Comment

Thanks for the report and detailed investigation! This commit fixes the bug.

2019-09-26 19:35 Updated by: h7k
  • Status Update from Open to Closed
Comment

I uploaded the new version 20190926.0 to CTAN, so I close this ticket.

2019-09-27 15:01 Updated by: lolitazt
Comment

Thank You very much and good luck :)

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