texjporg / platex

pLaTeX community edition
BSD 3-Clause "New" or "Revised" License
49 stars 8 forks source link

\inhibitglue の省略形 \< #50

Closed aminophen closed 6 years ago

aminophen commented 7 years ago

https://twitter.com/zr_tex8r/status/896321712664461312

https://twitter.com/zr_tex8r/status/896323051071037440

今の \< の定義(plfonts.dtx内)は

\def\<{\inhibitglue}

ですが,TeX Live 2014 での \inhibitglue の仕様変更により垂直モードで効かなくなったこと,および \< は「LaTeX 的な命令」であることから

\def\<{\leavevmode\inhibitglue}

がいいのでは?という話はこちらで。

zr-tex8r commented 7 years ago

チョット試してみたのですが

\def\<{\leavevmode\inhibitglue}

これだと\leavevmode\inhibitglueの前側の効力を妨げてしまうようです。

となると、

\def\<{\ifvmode\leavevmode\fi\inhibitglue}

ですが、これだと動く引数での挙動が心配です。結局

\DeclareRobustCommand*\<{\ifvmode\leavevmode\fi\inhibitglue}

でしょうか。

aminophen commented 7 years ago

どういうわけか

)\<\<(

と書いた場合,従来の \def\<{\inhibitglue} だと両方のカッコのグルーが消えますが,これを robust にした場合や ZR さんご提案の定義にした場合に片方消えなくなりますね。なぜでしょう?

abenori commented 7 years ago
)\relax\inhibitglue(

とおなじ?

h-kitagawa commented 7 years ago

もはや LaTeX フォーマット自体が e-TeX 拡張を要求していることを考えると,

\protected\def\<{\ifvmode\leavevmode\fi\inhibitglue}

ではどうでしょうか?

aminophen commented 7 years ago

)\relax\inhibitglue( とおなじ?

納得しました。それでは,e-TeX の \protected を使うことにしましょう。

aminophen commented 7 years ago

cb41066 でカーネルに移しました。ただ texjporg/tex-jp-build#28 という話もあるので,しばらく open のままにしておきます。