Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

Programs that do typesetting for you (Markdown, LaTeX), will ignore the number of spaces after the period in your "source" code and lay it out in the output with a single space.

I've gotten in the habit of single-space in variable-width fonts, and double-space in fixed-width fonts.



Not so for the default mode in LaTeX.

It tries to guess which periods indicate end-of-sentence (based on whether the next letter is capitalized) and will add additional horizontal space accordingly, unless you tell it not to by declaring your document uses “French Spacing”.

(Edit: and my memory may be serving me incorrectly here, but I recall 20 years ago having a support package that also detected double-space in the source as another indicator of end-of-sentence, but that was probably a non standard extension.)


Won’t that mess up titles like Dr. Livingstone and Mr. President?

Splitting text into sentences is actually really hard.


> Splitting text into sentences is actually really hard.

It would be a lot less hard if we were able to unambiguously tell the computer whether a period ends a sentence. I wonder how we could possibly do that...

(Less sarcastically: a lot of Unix programs - Emacs, vim, troff, etc. - solve this problem by defaulting to double-spaced sentences, thus resolving the ambiguity. Kinda odd that this ain't the Tex approach; there's already precedent by using doubled-up ``backquotes'' and ``single quotes'' to produce “smart double quotes”, and lone `backquotes' and `single quotes' similarly become ‘smart single quotes’.)


Yup:

  Prof.\@ Crumb
...is the behavior suppressor.


I usually force a narrow space after titles: Dr.\,Livingstone


I remember reading the TeXbook and learning that the space after a period is wider if there's a capital afterwards and the various ways of suppressing this behavior.

So it's a TeX thing, not LaTeX.


Thanks. I appreciate the attention to detail! FWIW, the distinction between the two is blurry given that most people I’ve known in academia never use TeX directly other then through LaTeX.


To be clear, it’s both.

https://stackoverflow.com/questions/2024338/latex-sometimes-...

LaTeX is based on TeX


This is doubly nonsense. TeX works very hard to make good looking spacing. Markdown emits HTML, which has a completely separate rendering engine for spacing. And the only reason HTML looks wrong is that the programmers of rendering engines weren’t as good as Knuth, and van Rossum’s anti-intellectualism lobbied against semantically rich markup for sentences.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: