• groff: how to completely disable hyphenation?

    From kalevi@kalevi@kolttonen.fi (Kalevi Kolttonen) to comp.unix.programmer on Thu Mar 26 14:08:23 2026
    From Newsgroup: comp.unix.programmer

    Hello!

    I am very sorry for posting this off-topic question,
    but there seems to be no active groff-related group.

    My question is simple: How do I completely disable
    groff's hyphenation? I am writing a document in Finnish
    using this command:

    groff -me -Kutf8 -Tpdf proto > proto.pdf

    Everything works fine, but the hyphenation is making
    mistakes and I want it. ChatGPT told me to insert
    these at the top of the document:

    .nh
    .hy 0

    It seems to work for a while, but then hyphenation
    is suddenly active again! Can anyone here help me?

    br,
    KK
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Lew Pitcher@lew.pitcher@digitalfreehold.ca to comp.unix.programmer on Thu Mar 26 14:38:11 2026
    From Newsgroup: comp.unix.programmer

    On Thu, 26 Mar 2026 14:08:23 +0000, Kalevi Kolttonen wrote:

    Hello!

    I am very sorry for posting this off-topic question,
    but there seems to be no active groff-related group.

    My question is simple: How do I completely disable
    groff's hyphenation? I am writing a document in Finnish
    using this command:

    groff -me -Kutf8 -Tpdf proto > proto.pdf

    Everything works fine, but the hyphenation is making
    mistakes and I want it. ChatGPT told me

    Remember, ChatGPT is a text-prediction program, and has no
    experience or intrinsic knowledge of groff. If you use it,
    you have to audit it's advice, which usually means that you
    have to have experience or intrinsic knowledge of the subject
    matter.

    to insert these at the top of the document:

    .nh
    .hy 0

    According to the Nroff/Troff User's Manual by Ossanna & Kernighan,
    both of these macros do the same thing; turn off hyphenation (the
    .nh
    macro explicitly turns off hyphenation, while the
    .hy 0
    macro selects a hyphenation mode, with "0" representing "OFF").

    Using both seems to me to be overkill; you only need one.

    It seems to work for a while, but then hyphenation
    is suddenly active again! Can anyone here help me?

    With hyphenation explicitly turned off, it's likely that your
    document uses a macro that turns it back on, either explicitly,
    or as a side effect.

    I don't often use groff, so I can't tell you which macros might
    do that. Take a look at your document, comparing the pdf with
    the input, to see /where/ in the input the hyphenation turns back
    on. That way, you can see what macros/commands/etc that you've used
    before that point that might turn hyphenation back on.

    br,
    KK

    Sorry I couldn't be of more help
    --
    Lew Pitcher
    "In Skills We Trust"
    Not LLM output - I'm just like this.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Lew Pitcher@lew.pitcher@digitalfreehold.ca to comp.unix.programmer on Thu Mar 26 14:45:25 2026
    From Newsgroup: comp.unix.programmer

    On Thu, 26 Mar 2026 14:38:11 +0000, Lew Pitcher wrote:

    On Thu, 26 Mar 2026 14:08:23 +0000, Kalevi Kolttonen wrote:

    Hello!

    I am very sorry for posting this off-topic question,
    but there seems to be no active groff-related group.

    My question is simple: How do I completely disable
    groff's hyphenation? I am writing a document in Finnish
    using this command:

    groff -me -Kutf8 -Tpdf proto > proto.pdf

    Everything works fine, but the hyphenation is making
    mistakes and I want it. ChatGPT told me

    Remember, ChatGPT is a text-prediction program, and has no
    experience or intrinsic knowledge of groff. If you use it,
    you have to audit it's advice, which usually means that you
    have to have experience or intrinsic knowledge of the subject
    matter.

    to insert these at the top of the document:

    .nh
    .hy 0

    According to the Nroff/Troff User's Manual by Ossanna & Kernighan,
    both of these macros do the same thing; turn off hyphenation (the
    .nh
    macro explicitly turns off hyphenation, while the
    .hy 0
    macro selects a hyphenation mode, with "0" representing "OFF").

    Using both seems to me to be overkill; you only need one.

    It seems to work for a while, but then hyphenation
    is suddenly active again! Can anyone here help me?

    With hyphenation explicitly turned off, it's likely that your
    document uses a macro that turns it back on, either explicitly,
    or as a side effect.

    I don't often use groff, so I can't tell you which macros might
    do that. Take a look at your document, comparing the pdf with
    the input, to see /where/ in the input the hyphenation turns back
    on. That way, you can see what macros/commands/etc that you've used
    before that point that might turn hyphenation back on.

    br,
    KK

    Sorry I couldn't be of more help

    This passage from the Nroff/Troff user's manual might help you
    identify the element that re-enables hyphenation:
    "Automatic hyphenation may be switched off and on. When switched on
    with hy, several variants may be set. A hyphenation indicator
    character may be embedded in a word to specify desired hyphenation
    points, or may be prepended to suppress hyphenation. In addition,
    the user may specify a small list of exception words.
    Only words that consist of a central alphabetic string surrounded
    by (usually null) non-alphabetic strings are candidates for automatic
    hyphenation. Words that contain hyphens (minus), em-dashes (\(em),
    or hyphenation indicator characters are always subject to splitting
    after those characters, whether automatic hyphenation is on or off.

    .nh hyphenate - E
    Automatic hyphenation is turned off.

    .hy N on, N = 1 on, N = 1 E
    Automatic hyphenation is turned on for N reN 1, or off for N = 0.
    If N = 2, last lines (ones that will cause a trap) are not hyphenated.
    For N = 4 and 8, the last and first two characters respectively of a
    word are not split off. These values are additive; i.e., N = 14 will
    invoke all three restrictions.

    .hc c \% \% E
    Hyphenation indicator character is set to c or to the default \%.
    The indicator does not appear in the output.

    .hw word ... ignored -
    Specify hyphenation points in words with embedded minus signs.
    Versions of a word with terminal s are implied; i.e., dig-it implies
    dig-its. This list is examined initially and after each suffix stripping.
    The space available is smallrCoabout 128 characters."


    HTH
    --
    Lew Pitcher
    "In Skills We Trust"
    Not LLM output - I'm just like this.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From kalevi@kalevi@kolttonen.fi (Kalevi Kolttonen) to comp.unix.programmer on Thu Mar 26 14:59:27 2026
    From Newsgroup: comp.unix.programmer

    Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
    Sorry I couldn't be of more help

    Thanks, it did help somewhat. I just went through the document.
    The culprit was a missing terminating command. I had this:

    .(l
    \(bu \fIThe Flying Saucers Are Real\fP (1950)
    .br
    \(bu \fIFlying Saucers from Outer Space\fP (1953)
    .br
    \(bu \fIThe Flying Saucer Conspiracy\fP (1955)
    .br
    \(bu \fIFlying Saucers: Top Secret\fP (1960)
    .br
    \(bu \fIAliens from Space: The Real Story of Unidentified Flying Objects\fP (1973)


    And it was missing the terminating:

    .)l

    Adding .)l fixed the problem.

    br,
    KK
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From boltar@boltar@caprica.universe to comp.unix.programmer on Thu Mar 26 15:07:26 2026
    From Newsgroup: comp.unix.programmer

    On Thu, 26 Mar 2026 14:38:11 -0000 (UTC)
    Lew Pitcher <lew.pitcher@digitalfreehold.ca> gabbled:
    On Thu, 26 Mar 2026 14:08:23 +0000, Kalevi Kolttonen wrote:

    Hello!

    I am very sorry for posting this off-topic question,
    but there seems to be no active groff-related group.

    My question is simple: How do I completely disable
    groff's hyphenation? I am writing a document in Finnish
    using this command:

    groff -me -Kutf8 -Tpdf proto > proto.pdf

    Everything works fine, but the hyphenation is making
    mistakes and I want it. ChatGPT told me

    Remember, ChatGPT is a text-prediction program, and has no

    Its a lot more complicated than that. If you want to see the output of
    a text prediction program download some markov chain code, it'll just output grammatically correct (mostly) junk.

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to comp.unix.programmer on Thu Mar 26 19:48:46 2026
    From Newsgroup: comp.unix.programmer

    On Thu, 26 Mar 2026 14:38:11 -0000 (UTC), Lew Pitcher wrote:

    I don't often use groff ...

    Maybe not directly, but remember it is part of the toolchain every
    time you run the man(1) command on a GNU-based system.
    --- Synchronet 3.21f-Linux NewsLink 1.2