待辦事項 #44626

\lstMakeShortInline fails with some characters when luatex-ja and microtype are involved

啟用日期: 2022-05-19 16:08 最後更新: 2022-05-23 04:43

回報者:
負責人:
類型:
狀態:
開啟 [Owner assigned]
元件:
(無)
里程碑:
(無)
優先權:
5 - 中
嚴重程度:
5 - 中
處理結果:
檔案:
1

細節

The following MCE example:

  1. \documentclass{article}
  2. \usepackage{listings}
  3. \usepackage{luatexja-fontspec}
  4. \usepackage{microtype}
  5. \lstMakeShortInline!
  6. \begin{document}
  7. Foo
  8. !\foo!
  9. \fontspec{Latin Modern Roman}\char"03A9
  10. \end{document}

compiled with lualatex, works like a charm. But, if the ! character is replaced by e.g. ÷, it doesn't work anymore. Depending where the instruction \lstMakeShortInline÷ is, either !\foo! or \fontspec{Latin Modern Roman}\char"03A9 causes the failure.

As advised at https://tex.stackexchange.com/q/644665/18401 by Ulrike Fischer, I report here.

Ticket History (3/6 Histories)

2022-05-19 16:08 Updated by: dbitouze
  • New Ticket "\lstMakeShortInline fails with some characters when luatex-ja and microtype are involved" created
2022-05-19 22:29 Updated by: h7k
  • 負責人 Update from (無) to h7k
2022-05-22 02:28 Updated by: schlcht
評語

This can be broken down into two separate issues: the one is that the current version of microtype isn't aware of \lstMakeShortInline, which will result in the infinite loop in connection with luatexja. This has now been fixed in the dev version: https://github.com/schlcht/microtype/commit/c0f401d5c206e352fb6b7d191b0728ad00275013

A second issue is with luatexja only, if \lstMakeShortInline is issued before loading the package:

  1. \documentclass{article}
  2. \usepackage{listings}
  3. \lstMakeShortInline÷
  4. \usepackage{luatexja-fontspec}
  5. \begin{document}
  6. Foo
  7. ÷\foo÷
  8. Foo
  9. \end{document}

which will result in a Runaway argument error.

2022-05-22 14:45 Updated by: h7k
評語

Thanks for the report, and sorry for the late reply.

I think that commit c2d8b32b will solve the issue. (The new version of lltjp-listings.sty is attached below.)

(Edited, 2022-05-22 14:45 Updated by: h7k)
2022-05-23 04:43 Updated by: dbitouze
評語

Répondre à h7k

Thanks for the report, and sorry for the late reply.

You're welcome, and no worry about the late reply!

I think that commit c2d8b32b will solve the issue.

Many thanks!

(The new version of lltjp-listings.sty is attached below.)

AFAICS, replacing the current /usr/local/texlive/2021/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings.sty by the one you attached still raises the same error.

Attachment File List

編輯

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