1

I am using the program groff to format text. groff is hyphenating words and breaking them onto multiple lines. I would not like it to do that.

The manual outlines methods for disabling hyphenation. However, I can't figure out how to invoke .hn at the command line. Is there a way to pass command line flags to groff to disable hyphenation?

Thanks, Kevin

Kevin Burke
  • 61,194
  • 76
  • 188
  • 305

2 Answers2

4

Taken from the awesome Run aspell on manpage.

You should pass the HY register with the value 0 with the -rHY=0 command line flag.

Command line flags to groff are documented via man groff_man. This manual page is available in Ubuntu/Debian through the groff package (not included with the groff-base package, which does include the groff binary).

The value 0 of HY is actually not explicitly documented as a way to disable indentation, but it seems to work!

deivid
  • 4,808
  • 2
  • 33
  • 38
  • 1
    Additionally, passing -rHY=14 gets back the less agressive hyphenation of version 1.22.3. – notautogenerated Sep 04 '20 at 22:14
  • Thanks for this. For some reason putting `.HY 0` in the document itself seems to have no effect, at least using the `.ms` macroset, but this works. – twhitney Dec 04 '21 at 21:15
1

For what it's worth, the hyphenation difference was appearing because my colleague was using groff version 1.22.3 and I was using groff 1.22.4. 1.22.3 does not use as aggressive hyphenation.

I suspect that there is no way to control hyphenation at the command line.

Kevin Burke
  • 61,194
  • 76
  • 188
  • 305