Disable groff hyphenation at the command line

489 Views Asked by At

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

2

There are 2 best solutions below

0
Kevin Burke On

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.

2
deivid On

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!