lout-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

proposal for inter-word spaces


From: Jeff Kingston
Subject: proposal for inter-word spaces
Date: Tue, 13 Feb 1996 10:45:06 +1000

Here is my proposal for new options to control the way that Lout handles
spaces in its input.  Please let me have your comments soon.

Lout already has a symbol called @Space which exerts some control over
inter-word spaces, so I propose to add new options to that symbol.  It
affects the so-called "style information" in the same way as (for example)
the @Font symbol does, so it can be applied to just a small part of the
document, like @Font can.  There would also be an @InitialSpace option
corresponding to @InitialFont, to allow the new options to be applied to
the whole document.


Spaces between sentences
========================

The first option would cause Lout to insert one extra space between two
objects that are separated by white space characters that include at least
one newline, provided that the first object is a word that ends in any one
of a certain set of characters which would depend on the current language.
To turn on this option you would write

    sentences @Space { ... }

and to turn it off, "nosentences".  The default value would depend on the
@InitialSpace option, which I propose would be "sentences" in the standard
setup files.  This default value represents a non-upward-compatible change.
I for one have wished for this option frequently; in fact I've had to get
into the habit of not ending sentences at the ends of lines, which I've
found very annoying; that's why I'm proposing a change in the default here.

Please note that extra space would never be inserted within an input line,
only at the end.  So you could write Dr. Kingston safely; but if you end a
sentence half-way along an input line, you would have to insert two spaces
yourself.

The langdefs file would be augmented like this:

    langdef English { english ".:?!" }
    langdef French  { -       ""     }

meaning `If "sentences" is on and the current language is English and there
are two objects separated by white space including at least one newline and
the first object is a word ending in one of .:?! then insert one extra
space', and so on for French and the other languages.  My understanding
is that the French don't do this two-space thing, which is why the set of
characters for French is empty.  Other languages which have sentences
ending in different characters will be able to say so.

Please note that under this proposal there is no option for changing the
set of characters which define the end of a sentence; you would have to
change the langdefs file to do that.  I would prefer not to have to include
an arbitrary-length character string in the style information.


Compression of multiple spaces into one
=======================================

The second option would cause Lout to replace two or more white space
characters between two objects by one space:

    compress @Space { ... }

There would also be "nocompress" for getting Lout's current behaviour,
which is to produce as many spaces in the output as there are in the
input.  The default would depend on the @InitialSpace option, which I
propose would be "nocompress" in the standard setup files.

When both "compress" and "sentences" are on, the effect in spots where
"sentences" would add an extra space would be to produce two spaces.

Please note that when "compress" is on there would be no easy way to end a
sentence in the middle of a line and get the two spaces.  Compress would
reduce any number of spaces to one, and "sentences" would not apply.  In
other words, Lout would not distinguish between the cases

    Dr. Kingston
    I came. I saw. I conquered.

and the spacing would be appropriate for the first case, not the second.
I believe that any attempt to distinguish these two cases automatically
is doomed to runaway complexity, and most of my correspondents seem to
agree.  In English practically speaking you would either have to use
"sentences" and end every sentence at end of line, or else type an
explicit "&2s" between sentences, most likely with the help of a macro like

    macro "~" { &2s }
    
that would go in your mydefs file.  In short, "compress" is problematic.

Jeff Kingston
address@hidden


reply via email to

[Prev in Thread] Current Thread [Next in Thread]