Sentence Spacing — 1 Space or 2? 814
An anonymous reader noted an epic battle is waging, the likes of which has not been seen since we all agreed that tab indenting for code was properly two spaces. He writes "Do you hit the space bar two times between sentences, or only one? I admit, I'm from the typewriter age that hits it twice, but the article has pretty much convinced me to change. My final concern: how will my word processor know the difference between an abbr. and the end of a sentence (so it can stretch the sentence for me)? I don't use a capital letter for certain technical words (even when they start a sentence), making it both harder to programmatically detect a new sentence and more important to do so. What does the Slashdot community think?"
Re:False assumption (Score:3, Informative)
Re:False assumption (Score:5, Informative)
I think this is the joke.
One space (Score:5, Informative)
I've been an editor (copy editor, proofreader, senior editor, etc.) for 10 years now. One space.
Monospaced or proportional (Score:5, Informative)
Two spaces are appropriate for typewriters and similar monospaced fonts (Courier, Monaco, Andale Mono, Consolas, Vera, Deja Vu mono)
One space for proportional fonts (Times, Helvetica, almost everything.)
Sentence stretching? (Score:1, Informative)
Sentences are not stretched, paragraphs are.
(and they have their own invisible sign(s))
Depends on the font (Score:5, Informative)
It depends on the font. If it is monospaced (such as on a typewriter) it should be two spaces. If you are using a proportional font, use one space.
OLD NEWS (1989) (Score:5, Informative)
The Mac is not a typewriter not only lays down guidelines, but explains the logic behind them, such as why punctuation should be hung, why there should not be two spaces after periods, why text set in all caps should be avoided.
Early 20's, two spaces. (Score:1, Informative)
I'm in my early 20's, so I'm relatively young. I was taught to put two spaces between sentences when learning how to type. I think it's still taught that way, so may people are just getting lazy.
One space between sentences (Score:2, Informative)
Re:a suggestion (Score:2, Informative)
Actually, there are multiple types of spaces in typesetting, with multiple widths. A properly typeset book will use a single em-space (a widened space approximately the width of the letter "m") between sentences and a narrower space between words. FWIW.
Re:Twice (Score:3, Informative)
As an interesting note, the iPhone auto-enters a period when you double space, so the tradition is still partially alive, at least.
True, but it inserts a single space with that period.
Re:One space (Score:3, Informative)
No, he's not loco. He's correct, at least if he's going by the AP style guide or, indeed, many other such materials. It's one space for any proportionally-spaced font. (Fixed-spaced fonts (Courier, American Typewriter, Lucida Console, Bitstream Vera Mono, etc.) aren't used in most professionally-published work, except for stuff like code in a technical publication.)
Re:2. Duh. But... (Score:1, Informative)
We're talking text, not code (Score:5, Informative)
If you read the question, we're talking about text, not code. I couldn't care less what you do with your code; however, as a professional writer, the new standard is one space.
If you really want to get into the the theory behind it, it's actually quite simple. We now use one space to avoid "rivers of white" in text. In short, if you look at a sample of documents that have been double spaced after the punctuation, you'll start to notice lines of white that run throughout the document. This distracts the reader and lowers the readability of the document. In typewriter days, two spaces made a lot of sense. Due to the large variation of widths in characters, it helped keep a more uniform space between sentences. With modern word processors and fonts, the need for the double space as been eliminated.
Now, when you get into typography and design, you're dealing with aesthetic and this will vary on a case by case basis. Letter spacing, kerning, and leading all come into play and it's less about the number of spaces you use and more about how you're using your spaces. In coding, I could see the use for even more than two spaces.
*NOTE* - It might seem contradictory that I'm advocating single spacing, yet I've double spaced between all my sentences. I'm an old school typewriter guy and old habits die hard. This is why modern technology is so great. I have all of my software set to only allow single spacing between sentences. I always do document searches for double spaces. All of my professional writing goes out single spaced. All of my personal writing goes out double spaced, completely out of laziness.
Re:Use LaTeX. (Score:5, Informative)
Not really fringe cases, and requires a bit of effort, unless one uses \frenchspacing (which is not the default) so one _will_ need to think about it, since TeX by default adds more space after a period, so one must indicate which periods do not require additional spacing, e.g.:
Dr.\ Knuth was very concerned with the typography of his published articles and books. This resulted in his development of \TeX\ when early systems for page composition were unable to match the old styles. While it handles many things automatically, it does require a certain attention in the preparation of the text, i.e.\ indicating normal width spaces by preceding them with a backslash.
\vfill\eject\bye
William
The bible says One (Score:3, Informative)
Re:False assumption (Score:4, Informative)
The best jokes are never understood on first telling.
Back to the subject at hand, however, why not consult the Chicago Manual of Style [chicagomanualofstyle.org]? To cut to the chase:
Seems pretty reasonable to me, and it's from quite a credible source. Read the full page for justification (no pun intended).
When in doubt, Search your Chicago Manual of Style (Score:3, Informative)
Re:Two spaces, bitches. (Score:5, Informative)
Notice when you read shit on the internet it is single spaced after punctuation, and not double spaced?
That's only because HTML decided that consecutive whitespace should be compressed to a single character. I may put two spaces after full stops followed by new sentences, but I'm not going to make one of them to (try to) force it.
HTML, also by not employing indentation at the start of paragraphs by, has steered people toward double-spacing between paragraphs. Print media prefers not to waste the line between paragraphs and sticks with indentation of the first line of paragraphs. Books tend to reserve double spacing between paragraphs for a change of scene within a chapter, and if it occurs at a page break, a line with one to five asterisks, spaced, is employed, on whichever page it will fit.
From the Chicago Manual of Style, 15th ed. (Score:3, Informative)
The answer (though it's not very satisfying) (Score:2, Informative)
I've given this a lot of thought over the years and I believe you can break it down into three circumstances
1) If you're using a monosaced typeface or a typewriter, use two spaces. It's the convention and I personally think it makes reading the text much easier. Of course how often does this situation arise these days? Not very.
2) With a typesetter or typesetting software a "space" has no specific length as it varies depending on the needs of the typesetter. That said some typesetters pad the space after a period and some don't. Either way it will look good and consistent. Trust your typesetter. Though if you use TeX you have your choice of which style to go with. It doesn't matter which you choose, it'll look fine.
3) If you're using a word processor it doesn't matter. Word processors produce crap for output. By using one you are stating up front that you don't care how the final product looks. By definition you are producing an informal text and as such you can use as many spaces as you want since it's not going to affect the aesthetic value or readability of the text any more than the decision to use a word processor in the first place. If you do care about how it looks and reads use typesetting software.
Re:False assumption (Score:3, Informative)
ASCII back when there was 'just' ASCII, was an 8 space tab. MS adopted that where it was needed, and in my world, 8 spaces for a tab is standard.
If you're just indenting, whatever you like. If your envirenment or prefers a different standard, either adopt it or be prepared to cause problems.
I tend to indent 1 or 2 spaces, because I can make sense of it. But some editing software has its own ideas.
And this is not the most important topic for us to consider.
Re:TAB is the one true indentation (Score:3, Informative)
But I think this discussion is about putting spaces after the period that ends a sentence, not whether to use one or two spaces for indention. Applying the above here, you should represent sentences in a way that your typesetting program can apply its stylesheet to sentences, rather than individual characters.
Re:Two spaces, bitches. (Score:3, Informative)
Re:False assumption (Score:5, Informative)
ASCII when there was just ASCII had a tab character which was commonly interpreted as "tab to the next multiple of 8 column". If you were in column 4, a tab would not look like 8 spaces, it would look like 4 spaces.
On the keypunch I used, TAB meant "advance to the next tab column as indicated on your drum card." For FORTRAN, that meant the first tab skipped to column 2 (line number), the next tab to column 6 (continuation), the next to 7, a few every four spaces, and then off to column 72 (card number).
Every reasonable typewriter I used had tab stop settings so you could define what columns a tab took you to.
If your envirenment or prefers a different standard, either adopt it or be prepared to cause problems.
Thus was created "indent", which converts code from all those other people's atrocious formatting styles into your preferred on and back.
Re:Two spaces, bitches. (Score:4, Informative)
Slashdot doesn't strip the spaces, your browser's HTML parser does. <-- There's two spaces there, look at the source.
Re:Two spaces, bitches. (Score:2, Informative)
HTML, also by not employing indentation at the start of paragraphs by, has steered people toward double-spacing between paragraphs. Print media prefers not to waste the line between paragraphs and sticks with indentation of the first line of paragraphs. Books tend to reserve double spacing between paragraphs for a change of scene within a chapter, and if it occurs at a page break, a line with one to five asterisks, spaced, is employed, on whichever page it will fit.
For the last decade we've had a thing called CSS and you can indent your first lines to your heart's desire. Typesetting software for books doesn't do it unless the designer asks for it either.
Re:One space (Score:4, Informative)
It's one space for any proportionally-spaced font.
I use a lot of proportionally spaced fonts, including Times New Roman and Arial from Microsoft's True Type Fonts as well as whatever open-source fonts come with Linux. I can tell you that not only is a space narrower than an 'n', but it's also the same width regardless of if it comes after a period or not. Spaces are wider when using justified alignment, but across a whole line rather than just at periods. Further, periods themselves are extremely narrow: the spacing after a period is non-existent, and kerning will make the situation even worse by placing the period inside a 'W' or 'Y'.
As a result, single-space provides more of a problem for today's proportional fonts than fixed-width fonts, since spaces are extra-wide with fixed width fonts anyway (as in, not more narrow than an 'n'). It's hard to read either Courier New or Arial, in any case, with single spacing: my eyes wander while my brain processes a chunk of text, so I grab 3 or 4 words at a time and then have to identify where I am. Without the geographical landmarks of extra white space scattered about a paragraph, I have a lot of difficulty returning instantly to wherever I was every few milliseconds; it can take several seconds to reorient my vision sometimes if a bug or some other piece of movement distracts me for the briefest fraction of a second.
Re:Two spaces, bitches. (Score:2, Informative)
Re:Monospaced or proportional (Score:3, Informative)
Oh, p.s. if, considering my argument below, you really prefer standards bodies above the consensus route, "The Chicago Manual of Style (1), the AP Stylebook (2), and the Modern Language Association (3) all recommend using one space after a period at the end of a sentence. ", as noted by "Grammar Girl" at:
http://grammar.quickanddirtytips.com/spaces-period-end-of-sentence.aspx [quickanddirtytips.com]
(she provides references to back up that assertion).
I should note that I'm more of a "rough consensus" guy myself and that this is a matter where I don't think there's a right answer between one and two -- I think reasonable people may disagree and that it comes down to style.
Re:False assumption (Score:3, Informative)
With tabs each person can set their tabstop however they want.
And if they want it to look right, they need to set it to exactly what the original author did. Every time you decide to break up a line of code, you're making a decision that locks the reader into a particular spacing in order to have legible code.
Do you want to have legible code? Yes? Use spaces then. And if you can't handle reading code that doesn't use your "preferred" spacing, then it is you, not the code author, who has the puppy-killing control issues.
Re:TAB is the one true indentation (Score:4, Informative)
The original question was: how do I tell it to use tabs for indentation instead of spaces? Best solution I know is to go into each mode (c++-mode, java-mode, etc.) and tweak the indentation setting to match the tab width, which looks like:
(defun my-mode-hook ()
(setq tab-width 2)
(setq truncate-lines t)
(setq c-basic-offset 2))
(add-hook 'c-mode-hook 'my-mode-hook)
(add-hook 'c++-mode-hook 'my-mode-hook)
(ugh, why do I need to 'program' my editor to configure a setting... sigh.)
Re:Monospaced or proportional (Score:3, Informative)
What about forestalled sentence termination due to interrup-- Hey, I'm talking here!
I believe the correct way to format that last bit is: due to interrup—Hey, I'm talking here!
Unlike the question of how many spaces should be used after a period, the n-dash and m-dash are punctiation marks. As such, they have rules for use that are much more hard and fast. One of those is that there should be no space between the letters on either side of the dash and the dash itself. This rule applies to all dashes (hyphen: twin-engine, n-dash: 9–5, m-dash: Shatner—is speaking).
Re:TAB is the one true indentation (Score:2, Informative)
Re:False assumption (Score:5, Informative)
That was the reason in the days of typewriters. And it continues to be the reason if you are writing in a text editor using a monospaced font. But a word processor will space a document properly, such that the space between sentences IS wider than a space between words.
Abbreviations, such as Dr., Ms., etc. (Score:3, Informative)
Two spaces after a period that ends a sentence.
Otherwise, Dr. Ms. Mrs. Mme. Mr. Mlle. etc. eng. fr. and all those other abbreviations look like they end a sentence.
Tab, of course, is ASCII 9, not "n * 0x20", where n==some value between 1 and whatever. Look at python code, where leading white space counts - mixing tabs with spaces is dumb.
Re:False assumption (Score:5, Informative)
because HTML is broken. There is two spaces after the preceding period but you can not see them.Now you can because I used tags. (no you can't because /. is broken and does not render the tag properly...)
Re:False assumption (Score:2, Informative)
Thank you. People who indent with spaces should be shot. Indent with tabs all you want and I can view it the way I want (2 space, 4 space, etc.).
If you use spaces instead of tabs, I'm going to have to take two seconds to run some elisp to fix it ;-)
Problem with tabs is when you're lining up code on multiple lines (e.g., variables, where many people use whitespace between the type definition and the name to line up the names), a different tab size breaks the alignment. You either have to force everyone to use the same tab size, or suffer ugly code.
If you're aiming to keep line length down (back in the days of 80 character displays), switching between tab sizes could cause code to become an unreadable wrapped mess if it'd been written using 2 space tabs (and fitted nicely into the editor window) and you viewed it with 8 space tabs (at which point it no longer did).
These days it's almost irrelevant. Most IDEs allow you to reformat the whole file with a single keypress to whatever style you want. Then reformat back to project standard before submitting to source control.
Re:False assumption (Score:3, Informative)
Re:False assumption (Score:3, Informative)
No. You indent by tabs to the correct level, and add spaces for effect afterwards where necessary. Even if you end up adding more spaces than a tab width. That way it looks right no matter the tab width.
And then they set their tab width to something less than you did, and then the next level of indentation is indented less than your split line. It no longer looks right, it now looks the opposite of right, as in wrong.
Tabs break things. If you use any tab stop other than exactly 8 spaces, and mandate that everyone else does to, you will break code formatting for someone, somewhere (terminals and line printers use 8-space tabs). And mandating 8 space-tabs breaks the alleged "advantage" of tabs in the first places.
Tabs are broken. Spaces are the only way to ensure anyone viewing your code will see it correctly formatted. This is vastly more important than being able to tailor other peoples' code to your preference.
Re:False assumption (Score:3, Informative)
Please explain why you used one space between all sentences in your post.
He actually used two spaces. Unfortunately for him, browsers collapse multiple spaces into one. [w3.org] He lacks commitment; a true Double-Spacer would have used two non-breaking spaces.
Re:One space (Score:5, Informative)
Wikipedia's featured article [wikipedia.org] on the subject (happens to be today's, actually).
Re:False assumption (Score:5, Informative)
The way around this is to _indent_ with tabs and _align_ with spaces.
Re:One space (Score:4, Informative)
In this case, 4 periods are actually used....
Re:False assumption (Score:5, Informative)
God forbid I line up some stuff to make it more readable.
You can do both: use tabs for indentation, and spaces to line things up.
So, if you have a statement like this:
printf("testing 1 2 3 %d %s",
var1, var2);
the printf would have a tab, and that's it. On the second line, there would be one tab (to match the line above it), and then the rest would be filled in with spaces, like this: (underscore indicates a space)
printf("testing 1 2 3 %3 %s",
________var1, var2);
That way, you can set your tab stop to whatever you want (2, 4, 8, 3, 5, 16, whatever), and it will look correct.
Re:False assumption (Score:2, Informative)
You are almost correct. The reason that two spaces *used* to be added after a sentence instead of a single space was that typewriters were monospaced. If you use a monospaced font and only use a single space after a period to indicate a sentence it *is* visually ambiguous due to the large amount of extraneous white space between the edges of adjacent characters. So much white space, in fact, that you can often insert a character between two others (I've done this in manuscripts rather than retype a page).
If you are producing a document using a monospaced font then you *should* use two spaces to help the readability of the text. On the other hand if, like most people, you are producing a document with a proportional font then only use one.
In summary: the "rule" about using two spaces after the period ending a sentence was for typewriters and arose because typewriters had a (wide) monospacing.
Re:False assumption (Score:3, Informative)
Incorrect.
if (foo) { a = x; } else { a = 5; }
is trivially converted to GNU format by "indent -gnu a.c", and becomes:
if (foo)
{
a = x;
}
else
{
a = 5;
}
Looks like some newlines have been inserted. And running that through K&R indent:
if (foo) {
a = x;
} else {
a = 5;
}
Newlines deleted.
Re:One space (Score:1, Informative)
point of fact: an ellipsis is not a collection of periods, but a single, distinct character in its own right.
Re:False assumption (Score:3, Informative)
Whoops, I just noticed that my "tabs" disappeared. It should look like this:
[tab]printf("testing 1 2 3 %3 %s",
[tab]________var1, var2);
Re:False assumption (Score:1, Informative)
Sorry, you're seeing an artifact of the font you are using + the enlargement + kerning.
ie.
1) you are using a font designed for 12pt.
2) the '.' glyph has spacing built in it. (pull it up in fontforge or equivalent to verify)
3) kerning is moving the period closer to the previous letter, but there is no kerning between characters & spaces.
4) you enlarged the font 3x so the space built into the glyph was magnified 3x.
The difference you noticed of 5 pixels at 36pt (77 - 72) is insignificant compared to the spacing difference spoken about here. Using your numbers a double-space should be 144px vs the 77 you're seeing.
rho