bug-groff
[Top][All Lists]
Advanced

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

[bug #53196] .hy values 4 and 8 ignored for some words


From: Dave
Subject: [bug #53196] .hy values 4 and 8 ignored for some words
Date: Tue, 20 Feb 2018 23:55:58 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Firefox/45.0

URL:
  <http://savannah.gnu.org/bugs/?53196>

                 Summary: .hy values 4 and 8 ignored for some words
                 Project: GNU troff
            Submitted by: barx
            Submitted on: Tue 20 Feb 2018 10:55:57 PM CST
                Category: None
                Severity: 3 - Normal
              Item Group: Incorrect behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

For some words, groff ignores .hy settings 4 ("Do not hyphenate the last two
characters of a word") and 8 ("Do not hyphenate the first two characters of a
word").  This bug occurs in at least versions 1.22.2 and 1.22.3 of groff.

This example, which can be pasted directly into the shell, illustrates the bug
with with ".hy 8" set:

groff -a << EOF
.ll 1i \" short enough to break the third word on each line
Visit yonder arboretum.
.br
Visit yonder archipelago.
.br
.hy 8 \"should prevent breaking after only two characters
Visit yonder arboretum.
.br
Visit yonder archipelago.
EOF

The output is:

<beginning of page>
Visit yonder ar<hy>
boretum.
Visit yonder ar<hy>
chipelago.
Visit yonder
arboretum.
Visit yonder ar<hy>
chipelago.

That is, groff follows the ".hy 8" setting for the word "arboretum" (carrying
the whole word to the next line rather than breaking it) but not for
"archipelago."

The bug seems to be triggered when the hyphenation for the word is explicitly
provided (either by the system, in groff's hyphenation exception file, or by
the user, via the .hw request) rather than inferred from a hyphenation
pattern.  To verify that the exception file contains "archipelago" but not
"arboretum":

egrep `echo 'arboretum|archipelago' | sed 's/./&-?/g'`
/usr/share/groff/current/tmac/hyphenex.us

The user should not have to know or care whether groff hyphenates a word using
a pattern or an exception-file entry; groff should follow the restrictions
specified in .hy regardless.




Additionally, a user asking groff not to split words by leaving only two
characters on a line might reasonably expect this to include words already
containing hyphens. However, groff does not honor this restriction, either:

groff -a << EOF
.\" don't hyphenate the first and last two characters of a word
.hy 12
.
.ll 1i
He's been my go-to guy for math questions.
EOF




[Bug history: this problem was originally reported in bug #42503.  However,
that bug's description was unclear and the title was misleading, and this bug
tracker seems to lack the ability to update a bug's title.  So this current
bug report is hopefully clearer.]




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53196>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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