Ticket #44626

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

Open Date: 2022-05-19 16:08 Last Update: 2022-05-23 04:43

Reporter:
Owner:
Type:
Status:
Open [Owner assigned]
Component:
(None)
MileStone:
(None)
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
None
File:
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.

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
  • Owner Update from (None) to h7k
2022-05-22 02:28 Updated by: schlcht
Comment

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
Comment

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
Comment

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

Edit

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