Consider the following code: If $x ∈ X$, then $y ∈ Y$.
. When it is rendered by TeX, the space between “X” and “,” and similary between “Y” and “.” seems to be too big. Is there any problem with kerning on the boundary between the mathmode and textmode? And if so, is there any (possibly standard and general) solution?
1 Answer
There is no automatic kerning, in fact TeX inserts a space with value \mathsurround
before and after each math expression, although this usually has its default value of 0pt.
You can of course add explicit negative space at the end of the math or just after it.
Alternatively if you make the characters adjacent TeX has a chance to adjust the space:
\documentclass{article}
\begin{document}
If $x\in X$, then $y\in Y$.
If $x\in X,$ then $y\in Y.$
\end{document}
-
1I wonder why there is no automatic kerning, since TeX was created to produce high quality typesetting of mathematical texts and this seems to be a typical example of a mathematical typesetting, or isn't it? Nov 7, 2014 at 15:21
-
1@user87690 TeX automatic kerns are always specified at the font level for adjacent characters in the same font. You don't get automatic kerning with
\textbf{A}V
orA\hbox{}V
either. This case is similar, typically the math font and text font are different, and even if they are the same in this case, there is a math-off node and a kern of \mathsurround in between. Nov 7, 2014 at 15:24 -
1I understand. I just wonder if it bothers anybody else and if there is any robust solution. Nov 7, 2014 at 15:32
-
-
1Well if mathmode and textmode use different fonts, wouldn't the punctation be potentially rendered differently? On the other hand, if it looks the same, why there isn't a font for both mathmode and textmode so the kerning-pair information can be applied? Nov 7, 2014 at 15:39