Remove double space between sentences

Is there a way to prevent double spaces after periods? I certainly am not typing those in, they’re being auto-generated in the output. I know it’s old school and I appreciate that but I really prefer a single space if possible.

Any help is appreciated.


I have this problem accentuated by my exploitation to the hilt of the adaptive prose, and my diagnosis is that is an issue in the TADS3 itself, as described here, in a sparse order, if I’m right:

the handling of NL and spaces inside strings forces me to sacrifice readability for correct spacing, a sacrifice whose has already lead to a very serious bug, as dsherwood already know.

in a nut, I can’t write (edited example for spoilerish reasons; the actual text is much longer…) in a proper readable manner:
(the example is not one of the most advanced exploiting of T3’s adprose)

"<<if pc.var < 1>>
blah,  blah...
<<first time>>
first time blabla...
<b>important passage !</b>\n
<<first time>>another passage
concluding blabla"

instead of the plainly unreadable and hence, bug-prone:

"<<if pc.var < 1>>blah, blah...<<else>> <<first time>>first time blabla <<only>>\n important passage !\n<<first time>>another passage <<only>>concluding blabla"

because the former ends with a rather ugly spacing, in most, if not all, cases resulting from the NL’s needed in a rationally organised adprose coding.

so, i concur and second with dsherwood’s question, a solution whose don’t involve forking TADS3’s codebase will be rather welcome for me.

Best regards from Italy,
dott. Piergiorgio.

1 Like

I don’t think I know what you mean by automatic double spaces… I think there are compiler options regarding automatically condensing white space.

I’m equally puzzled, since this is not something I’ve seen. Could you provide an example of what you mean and the circumstances under which it occurs?


They show up in Prince Quisborne, though? Note the difference in size between the space after the comma, and the space after the period a couple lines down.



I’ve found the code that does this; it’s actually not a double space but an n-space. This occurs in the typographicalOutputFilter object in output.t at line 1877. As things stand you’d have to edit this line - or modify typographicalOutputFilter and override the entire filterText() method to change this.

For the next release I’ve added a new sentenceSpacer property to typographicalOutputFilter which can be overridden by game code to something other than the default n-space (so you could, if you wished, change it to a single space).

In the meantime I’ve uploaded this change to GitHub.


Thanks, Eric ! As you have read above, the stress test is easy to set, all I need is edit some of the unusual adprose into much more readable layout, modify the active a3lite library with the change from github, then t3make -f isekai.t3m…

Tomorrow for the actual test and its results :slight_smile:

Best regards from Italy,
dott. Piergiorgio


Yeah, it is with Prince Quisborne as Eric said. The source code is all written with single spaces after periods.
The default setting of both the adv3 and the adv3Lite libraries is to find sentence-ending punctuation and then automatically add \u2002 after it before outputting. This can be trivially overridden if desired, to leave the text exactly as is.


Thank you so much! For ADV3, found the code in en_us.t source line 3672. Just commented the line out. Works like a charm. Makes the entire text look instantly better, and not leftover from 2008…

         *   Look for sentence-ending punctuation, and put an 'en' space
         *   after each occurrence.  Recognize ends of sentences even if we
         *   have closing quotes, parentheses, or other grouping characters
         *   following the punctuation.  Do this before the hyphen
         *   substitutions so that we can look for ordinary hyphens rather
         *   than all of the expanded versions.

//        val = rexReplace(eosPattern, val, '%1\u2002', ReplaceAll);

done the test. After editing output.t with the changes from your post and the current github revision, with this simple modify:

modify typographicalOutputFilter
   sentenceSpacer = ' ' //getting rid of double spc 

all look perfectly fine, at least for the initial room, whose now has a rational adprose layout :slight_smile:

Thanks again, Eric ! and

Best regards from Italy,


Showing off a bit the improved layout given by Eric’s solution to the doublespacing issue, I give this (non-spoilering) snippet from Isekai:

<<if mirror.examined>>
<<one of>>
inhumane... no, more correctly, an <i>elvish</i>
beautifulness to these hands;

whose is definitively advanced, if not extreme, adprose: basically, the PC’s hand is initially defined as “inhumane”, then after an obvious action, the PC first self-correct is definition, then use the corrected definition.

Even I can’t have easily debugged this adprose in the former format, whose was:

<<if mirror.examined>><<one of>>inhumane... no, more correctly, an <i>elvish</i><<or>>elvish<<stopping>><<else>>inhumane<<end>> beautifulness to these hands [...]

(indeed there was a bug, noticed and removed during the reformatting of the now script-language like adprose…)

Best regards from Italy,
dott. Piergiorgio.

1 Like

Um, when did double spaces after periods become outdated and quaint? HOW DID I MISS THAT MEMO???


Ever since word processors with proportional font come into existence. That was a long time ago.


Y’know what? No. I reject this new-fangled attention-deficit-driven shortcut in its entirety. Single-space is the new ‘fetch,’ stop trying to make it happen.

FUNK AND WAGNALLS IS SPINNING IN THEIR GRAVE, and I for one will not be party to their rotational afterlife!

DUAL SPACE 4EVA!!!1!1!1! :stuck_out_tongue_closed_eyes:


Heh. Yeah, the modern single-space crowd is pretty obnoxious about it, but it’s as arbitrary as any other standard, AFAICT. I kinda like this article, which is a repost of an older one and goes into a bunch of the history… tl;dr my impression is that we used bigger spaces after periods for a pretty good chunk of history, and then typewriters/computers being monospaced, they had to pick between one (too narrow for the fashions at the time) or two (too wide). And then sometime after proportional fonts on computers it was the fashion to take part in a big shouty backlash against two spaces. And we’ve never gotten back to a slightly-wider space after periods now that we have different-sized spaces?

(Although as this thread says, TADS is using an en-space, not a double space. Interesting)