Forums: 公開討議/質問 (Thread #37118)

colorbox+lstinline (2015-09-07 22:08 by Nmyphium #76839)

xcolorパッケージの `\colorbox{}` コマンドの第2引数内で`\lstinline|hoge|` を使うと背景色がズレます。
XeLaTeXやpLaTeXでは問題ないのですが、LuaLaTeXでltj*クラスを使うと必ず再現します。

https://twitter.com/Nymphium/status/640871466318204928
Version beta-0.79.1 (TeX Live 2014/Arch Linux) (rev 4971)

Reply to #76839×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

Re: colorbox+lstinline (2015-09-07 22:48 by kmaeda #76841)

[メッセージ #76839 への返信]
こちらでも確認しました.
まだよくわかっていませんが,luatexja の lisitngs へのパッチである lltjp-listings.sty の不具合でしょうか.

\documentclass{article}
\usepackage{luatexja}
\usepackage{listings}
\usepackage{xcolor}
\begin{document}
\setbox0\hbox{\lstinline|hoge|}
\showthe\ht0 % => luatexja なし:6.94444pt. luatexjaあり:0.0pt.
\showthe\dp0 % => luatexja なし:1.94444pt. luatexjaあり:0.0pt.
\colorbox{red}{\lstinline|hoge|} % 報告通り
\colorbox{red}{\lstinline|あ|} % => ! Missing $ inserted.
\end{document}
Reply to #76839

Reply to #76841×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

Re: colorbox+lstinline (2015-09-07 22:57 by kmaeda #76842)

[メッセージ #76841 への返信]
> [メッセージ #76839 への返信]
> こちらでも確認しました.
> まだよくわかっていませんが,luatexja の lisitngs へのパッチである lltjp-listings.sty の不具合でしょうか.

listings で白筋が入る問題
https://osdn.jp/ticket/browse.php?group_id=5593&tid=27098
で入れたコードが今回は悪影響を出しているようです.
lltjp-listings.sty の268行目にある
\ht\@tempboxa=0pt\dp\@tempboxa=0pt
をコメントアウトすると OK になりますが,今度は白筋問題が再発するようです.

(……って書いているうちにチケットができていました.
https://osdn.jp/ticket/browse.php?group_id=5593&tid=35484
Reply to #76841

Reply to #76842×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

Re: colorbox+lstinline (2015-09-08 00:02 by Nmyphium #76843)

lltjp-listings.styの268行目を

\ht\@tempboxa=6.94444pt\dp\@tempboxa=1.94444pt

とするとズレはなくなりました、ありがとうございます。

しかし日本語のほうは原因がこちらではよくわかっていませがおそらく\lstinline@と\lst@InlineGの再定義のあたりでしょう。
Reply to #76841

Reply to #76843×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login