Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape spaces following mid-sentence periods. #2557

Closed
wants to merge 1 commit into from

Conversation

Eelis
Copy link
Contributor

@Eelis Eelis commented Dec 4, 2018

Fixes #2555.

@tkoeppe
Copy link
Contributor

tkoeppe commented Dec 4, 2018

Could you attach a diffshot, or at least a representative subset?

@Eelis
Copy link
Contributor Author

Eelis commented Dec 4, 2018

Hmm, strangely, only the space after "E.g." is affected visually (in the expected way):
image
Escaping the other spaces, like the one between "P.J." and "Plauger" seems to have had no effect. I'm not sure why...

@tkoeppe
Copy link
Contributor

tkoeppe commented Dec 4, 2018

That is odd! I imagine there may be built-in heuristics that detect things like initials and common abbreviations.

Could you please reduce the change to the minimal effective set? (And do feel free to also remove existing, ineffective backslashes.) Thanks!

@Eelis
Copy link
Contributor Author

Eelis commented Dec 4, 2018

For names with initials, how would you feel about using "~", as in "P.J.~Plauger"? We currently don't happen to have a line break there, but if preceding content is changed one day, that could change without us noticing, and might look bad.

@tkoeppe
Copy link
Contributor

tkoeppe commented Dec 4, 2018

I feel pretty much entirely indifferent. It's not currently a problem, we don't have a ton of names with initials, nor do we expect to gain more, and the existing occurrences aren't likely to be touched. So I'd just keep it as is, and simple.

Is there a visual diff if you use ~?

@godbyk
Copy link
Contributor

godbyk commented Dec 4, 2018

There is no visual difference between using ~ and \ aside from ~ inserting a non-breaking space.

The basic algorithm is that if the character preceding a period is uppercase, then interword spacing is used. Otherwise, end-of-sentence spacing it used.

So P.J. Plauger would result in an interword spacing while E.g. list would result in end-of-sentence spacing.

@godbyk
Copy link
Contributor

godbyk commented Dec 4, 2018

Oh, and if you use a comma after e.g. and i.e. then an interword space will be used there as well.

@tkoeppe
Copy link
Contributor

tkoeppe commented Dec 4, 2018

Ah yes, makes sense, thanks.

I would retain the status quo in that case.

@Eelis
Copy link
Contributor Author

Eelis commented Dec 4, 2018

Ah great, thanks for the explanation! I'll implement that "character preceding period is uppercase" heuristic for sentence splitting in cxxdraft-htmlgen as well.

That will resolve my real issue (because my ulterior motive was to use the "\ " or "~" to have cxxdraft-htmlgen not split the sentences there), and given that LaTeX apparently already handles almost all of this just fine by itself after all, I agree it's not worth caring about. :)

Closing, cheers!

@tkoeppe
Copy link
Contributor

tkoeppe commented Dec 4, 2018

I mean, do feel free to fix that one "E.g." case if you like. Or better yet, say "For example,". Or don't.

@godbyk
Copy link
Contributor

godbyk commented Dec 4, 2018

Personally, I'd prefer For example, as I don't like using E.g. or I.e. to start a sentence.

@Eelis
Copy link
Contributor Author

Eelis commented Dec 4, 2018

Ok you convinced me... but then I discovered that if you force push to a branch used in a pull request that is currently closed, then you cannot reopen that pull request anymore (the "Reopen and comment" button is greyed out now). :)

@tkoeppe
Copy link
Contributor

tkoeppe commented Dec 4, 2018

Hah, how weird. Have you tried editing the markup to ungrey it? :-)

@JohelEGP
Copy link
Contributor

JohelEGP commented Dec 7, 2018

Ok you convinced me... but then I discovered that if you force push to a branch used in a pull request that is currently closed, then you cannot reopen that pull request anymore (the "Reopen and comment" button is greyed out now). :)

That's solved by force-pushing back to the HEAD commit of the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants