5 ms·
The whole debate over one space vs. two is just stupid. TeX got it right 40 years ago, recognising that it's no longer necessary to constrain ourselves to a int
by peterkelly 6y ago
The whole debate over one space vs. two is just stupid. TeX got it right 40 years ago, recognising that it's no longer necessary to constrain ourselves to a integral number of space characters (a holdover from the typewriter era), but instead to use what it calls "glue" as separators between characters, words, and sentences.
Glue between words is given a higher weighting than that between characters. Glue between sentences is given a higher weighting than between words. So you end up with sentences being separated from each other by more whitespace than words. The exact amount will vary, as the Knuth-Plass line breaking algorithm [1] tries to find the most aesthetically pleasing set of places to break lines.
Arguing for one space or two spaces misses the point.
[1] http://www.eprg.org/G53DOC/pdfs/knuth-plass-breaking.pdf http://www.eprg.org/G53DOC/pdfs/knuth-plass-breaking.pdf
- brokensegue 6y agoSo I think it doesn't quite miss the point. the point is that you want one ASCII space after a period and then you want the layout algorithm to do something intelligent (like make it as wide as two spaces or 1.5 spaces). This is why "1 space" is correct and two spaces conflates different layers of document creation (the textual information to display and how it is laid out).
- jlokier 6y agoI think two spaces makes more sense as an input mechanism, although the ship has sailed so it's no longer possible. That way the document generator can tell the difference between periods that are inside sentences, and those which end sentences. When using one space everywhere in the input, the document generator has to guess, and will sometimes guess wrong. That's why HTML doesn't, and can't, do that kind of intelligent layout. End of sentence wide spaces in the middle of sentences looks awful.
- brokensegue 6y agoI mean arguably then we would want a totally different character for end of sentence and not two spaces in a row. I think modern tools are smart enough to properly space "Mr. Foo" v."I was sad. John was happy." and if not you can always manually fix the spacing edge cases yourself without modifying the text.
- kd5bjo 6y agoWhen I’m writing HTML or TeX, my practice is to use a carriage return after sentences. That makes it easier to reorder them when I do a revision pass.
- mezzode 6y agoSo it's basically the great tabs vs spaces debate again
- yellowapple 6y ago> This is why "1 space" is correct and two spaces conflates different layers of document creation (the textual information to display and how it is laid out) The problem is that I know of exactly zero programs other than TeX and the descendants thereof that are able to reliably distinguish between word-spaces and sentence-spaces without being explicitly told to do so (e.g. with double-spaces), and even then. There are indeed different space characters in Unicode, and if Word wanted to do this right it would autocorrect <space><space> to, say, <en-space> or <em-space> (the way it already does for quotes, much to the chagrin of people including code snippets in Word documents).
- svat 6y agoMinor quibble: having a non-integral “number” of spaces was not a TeX innovation; Knuth was just reproducing standard practice of fine typography. Using variable-width separators (TeX “glue”) is exactly how human typesetters did it for centuries. So it's not quite the right perspective to consider anything “a holdover from the typewriter era”, because that had never been typographical practice in the first place — in fact the typewriter practice approximated fine typography (rounding up the larger inter-sentence space to 2), rather than the other way around (see my top-level comment below/above). In fact, with TeX's standard settings, the inter-sentence space has the same natural width as the inter-word space; it's just that when justifying paragraphs it stretches more (3x) and shrinks less (0.33x) than the inter-word space — the net effect is that inter-sentence spaces are (usually) subtly larger.
- peterkelly 6y agoGood points, thanks for clarifying this. We had a really long period of time where printed material was produced by professional typesetters, followed by a much shorter period where people started producing documents using typewriters and computers with software that worked with fixed-width characters. Then with with TeX, proportionally spaced fonts, and the desktop publishing revolution we got that ability back. For some reason there are a lot of people thinking in terms of typewriters and 1980s-era word processors when talking about sentence spacing, which seems quite odd.
- jfk13 6y ago> with TeX's standard settings, the inter-sentence space has the same natural width as the inter-word space That's not quite accurate; the inter-sentence space does have a slightly larger natural width as well as more stretchability. It's right there in Chapter 12 of The TeXbook: > "Plain TeX puts extra space at the end of a sentence; furthermore, it automatically increases the stretchability (and decreases the shrinkability) after punctuation marks." Specifically, in the default cmr10 font, a normal inter-word space is 3.33333pt, and an end-of-sentence space has an additional 1.11111pt (before any stretch or shrink is applied).
- svat 6y ago
- jjgreen 6y agoQuite, typograpy does not have spaces it has space.
- alok-g 6y agoIs it able to determine the end of sentences correctly all the time? If not, there needs to be some means for humans to indicate the same, and typing two spaces is a reasonable one. I disable even autocapitalization wherever allowed as the systems just don't get it right. Instead of me trying to learn to correct when the system would get it wrong, I rather find it easier to just habitually do it correct by myself.