manpagez: man pages & more
info groff
Home | html | info | man

File: groff.info,  Node: Sentences,  Next: Hyphenation,  Prev: Filling,  Up: Text

5.1.2 Sentences
---------------

A passionate debate has raged for decades among writers of the English
language over whether more space should appear between adjacent
sentences than between words within a sentence, and if so, how much, and
what other circumstances should influence this spacing.(1)  (*note
Sentences-Footnote-1::) GNU 'troff' follows the example of AT&T 'troff';
it attempts to detect the boundaries between sentences, and supplies
additional inter-sentence space between them.

     Hello, world!
     Welcome to groff.
         => Hello, world!  Welcome to groff.

   GNU 'troff' flags certain characters (normally '!', '?', and '.') as
potentially ending a sentence.  When GNU 'troff' encounters one of these
"end-of-sentence characters" at the end of an input line, or one of them
is followed by two (unescaped) spaces on the same input line, it appends
an inter-word space followed by an inter-sentence space in the output.

     R. Harper subscribes to a maxim of P. T. Barnum.
         => R. Harper subscribes to a maxim of P. T. Barnum.

   In the above example, inter-sentence space is not added after 'P.' or
'T.' because the periods do not occur at the end of an input line, nor
are they followed by two or more spaces.  Let's imagine that we've heard
something about defamation from Mr. Harper's attorney, recast the
sentence, and reflowed it in our text editor.

     I submit that R. Harper subscribes to a maxim of P. T.
     Barnum.
         => I submit that R. Harper subscribes to a maxim of
         => P. T.  Barnum.

   "Barnum" doesn't begin a sentence!  What to do?  Let us meet our
first "escape sequence", a series of input characters that give
instructions to GNU 'troff' instead of being used to construct output
device glyphs.(2)  (*note Sentences-Footnote-2::) An escape sequence
begins with the backslash character '\' by default, an uncommon
character in natural language text, and is _always_ followed by at least
one other character, hence the term "sequence".

   The dummy character escape sequence '\&' can be used after an
end-of-sentence character to defeat end-of-sentence detection on a
per-instance basis.  We can therefore rewrite our input more
defensively.

     I submit that R.\& Harper subscribes to a maxim of P.\&
     T.\& Barnum.
         => I submit that R. Harper subscribes to a maxim of
         => P. T. Barnum.

   Adding text caused our input to wrap; now, we don't need '\&' after
'T.' but we do after 'P.'.  Consistent use of the escape sequence
ensures that potential sentence boundaries are robust to editing
activities.  Further advice along these lines will follow in *note Input
Conventions::.

   Normally, the occurrence of a visible non-end-of-sentence character
(as opposed to a space or tab) immediately after an end-of-sentence
character cancels detection of the end of a sentence.  For example, it
would be incorrect for GNU 'troff' to infer the end of a sentence after
the dot in '3.14159'.  However, several characters are treated
_transparently_ after the occurrence of an end-of-sentence character.
That is, GNU 'troff' does not cancel end-of-sentence detection when it
processes them.  This is because such characters are often used as
footnote markers or to close quotations and parentheticals.  The default
set is '"', ''', ')', ']', '*', '\[dg]', '\[dd]', '\[rq]', and '\[cq]'.
The last four are examples of "special characters", escape sequences
whose purpose is to obtain glyphs that are not easily typed at the
keyboard, or which have special meaning to GNU 'troff' (like '\'
itself).(3)  (*note Sentences-Footnote-3::)

     \[lq]The idea that the poor should have leisure has always
     been shocking to the rich.\[rq]
     (Bertrand Russell, 1935)
         => "The idea that the poor should have
         => leisure has always been shocking to
         => the rich."  (Bertrand Russell, 1935)

   The sets of characters that potentially end sentences or are
transparent to sentence endings are configurable.  See the 'cflags'
request in *note Using Symbols::.  To change the additional
inter-sentence space amount--even to remove it entirely--see *note
Manipulating Filling and Adjustment::.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.