任务单 #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 - Medium
严重性:
5 - Medium
处理结果:
文件:
1

Details

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.

任务单历史 (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. » 登录名