Considering the inline math mode, is there a conceptual or typographical reason, why TeX automatically puts a penalty after atoms of type Rel and Bin, but not after type Punct?
One reason that comes to my mind is that it might allow you to somehow conveniently control the allowed line breaks. So, maybe you should write rather Let $a$, $b$ be numbers
istead of Let $a,b$ be numbers
since there is no reason to avoid the line break between the variables. On the other hand, you might want to write Let $a,b\in Z
instead of Let $a$, $b\in Z$
since you might want to disallow line break between the variables here.
But in my opinion, even in the second case, the line break between $a$
and $b$
would be still better than breaking the line after \in
, so it would make more sense I guess to include some positive penalty lower than \relpenalty
after the comma.
Another example: I tend to define maps in mathematics as $f\colon A\to B$
(I think it is more appropriate to use the colon as a punctuation mark instead of relation in this context, that is, having a space only after the colon but not before). In this example, TeX allows line break after the \to
, but not after \colon
, where it is definitely more appropriate.
The easiest solution for both issues is probably to use the punctuation marks only outside the math mode and maybe to redefine the macro \colon
to include some penalty. (Additional possibilities were considered in another thread Allowing line break at ',' in inline math mode?) Nevertheless, I am quite interested to know the reason why TeX behaves like this since maybe I am overseeing something important.
EDIT: @egreg in the comments had an interesting point about ordered pairs, which, however, illustrates even better how nonsensical the behaviour is in my opinion.
So, if we have an ordered pair (a,b), we surely do not want to break it. This might be seen as an argument for disallowing breaks after the comma. But now consider having a pair (a+b,c). Here, TeX allows the break after the plus, but not after the comma. But breaking after plus makes even less sence than after comma. On the other hand, having more complicated tuple such as (a+b,a2+b2,a3+b3), I think it would not be bad at all to break it after comma, but definitely bad to break it after plus.
Finally, note that if punctuation allowed to break lines, then a neat way how to disallow the line break in the simple pair (a,b), would be to write it in a group ${(a,b)}$
, which somehow respects the inner logic of the formula.