groff
[Top][All Lists]
Advanced

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

[Groff] Prevent hyphenation of individual words?


From: Michael Smith
Subject: [Groff] Prevent hyphenation of individual words?
Date: Thu, 30 Jun 2005 16:05:35 +0900
User-agent: Mutt/1.5.9i

Greetings from Tokyo.

Question: What's the correct inline groff markup for preventing an
individual word from being hyphenated?

I notice that the groff info page says this:

  To tell `gtroff' how to hyphenate words on the fly, use the `\%'
  escape, also known as the "hyphenation character".  Preceding a
  word with this character prevents it from being hyphenated [...]

But that does not seem to actually work -- at least not in testing
with groff 1.18.1 (latest version packaged for Debian).

And I came across the following posting from last year:

  http://lists.gnu.org/archive/html/groff/2004-02/msg00047.html

That recommends using the .nh request on a line before the word,
then the .hy request on the line after. I assume that if preceding
a word with the \% escape actually had the hyphenation-preventing
behavior that the groff info page describes, then that posting
would have recommended it instead.

So is there are other escapes or other inline markup that have the
effect of preventing hyphenation? Perhaps putting something inline
both before and after a word? Or is using the .nh and .hy requests
the only way to make it work?

FWIW, the context is that I am maintaining XSLT stylesheets for
converting DocBook documents to man pages. DocBook contains a
number of elements for marking up "computer lines" (variable
names, options, userinput, constants, types, commands, parameters,
and function names), which shouldn't be hyphenated.  So I would
like to be able to have the stylesheets output the right groff
"prevent hyphenation" for those in the generated man pages.

  --Mike

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

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