W(数学模式)和逗号之间的空格

W(数学模式)和逗号之间的空格

我有这个简单的 LaTeX 文档:

\documentclass{article}

\begin{document}
There is quite a lot of space after a math-mode $W$, if it is followed by a comma.
\end{document}

渲染

对我来说,W 后面的空间似乎太大了。有什么解决办法吗?我更喜欢全局修复。

答案1

您可以(1)保留它或(2)添加一些任意负空间或(3)在数学中设置逗号以允许应用字体指定的校正,但依赖于字体设置,使得数学逗号在视觉上足够接近文本逗号或(4)使用文本逗号,但插入一个等于如果逗号处于数学模式则会应用的间距校正的字距。

我可能会做(1):-)

在此处输入图片描述

\documentclass[a4paper]{article}
\showoutput
\parindent0pt

\newcommand\mykern[2]{%
\sbox0{$#1#2$}\sbox2{$#1\hbox{}#2$}%
\kern\dimexpr\wd0-\wd2\relax
#2}

\begin{document}



There is quite a lot of space after a math-mode $W$, if it is followed by a comma.

There is quite a lot of space after a math-mode $W\!$, if it is followed by a comma.

There is quite a lot of space after a math-mode $W,$ if it is followed by a comma.

There is quite a lot of space after a math-mode $W$\mykern{W}{,} if it is followed by a comma.

\end{document}

相关内容