🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #361

Re: Hyphenation before punctuation in LaTeX

#361
From: leichter
Date: Thu, 23 Jul 1992 13:08
45 lines
2885 bytes
In article <1992Jul23.032744.8313@news.columbia.edu>,
jml12@cunixa.cc.columbia.edu (Jonathan M Lennox) writes:
| 
|   I am typesetting a document in LaTeX, and I am getting a lot of
| overfull hbox errors resulting, apparenltly, from [La]TeX's inability
| to hyphenate a word followed by an em-dash or \dots, even though it
| can hyphenate the base word perfectly well.  For instance:
| 
| Overfull \hbox (3.95303pt too wide) in paragraph at lines 90--97
| []\twlrm Over breakfast---my arms were out of the slings and I could feed mysel
| f---
| 
| The word `myself' is normally broken by TeX as `my-self', which would
| cause the line to break perfectly well; however, this doesn't work
| with the trailing dash.  I can, of course, insert a discretionary
| hyphen in the text, but this seems less than ideal, as TeX ought to
| know how to break the word already.  \hyphenation also seems to get
| confused by punctuation in its argument---I don't know if `---' caused
| a problem, but \dots definitely did.
| 
You've got at least two questions here:

Some authorities - including those consulted by Don Knuth when he designed
the TeX hyphenation algorithm - do not allow the constituent words of a
hyphenated compound to be hyphenated.  TeX DELIBERATELY enforces this; it
will break at the embedded hyphens, but will not insert any discretionary
breakpoints itself.  The same goes for "connected" m-dashes and such.

\hyphenation expects words to consist only of letters (category code 11); you
can't give it stuff with punctuation.

The easiest solution is, as you not, to insert a \- yourself, in essense
telling TeX to ignore its built-in rules.  Think about how the result is
going to look and, more important, "read", before you go in for this in a big
way.  An exception every once in a while is no big deal, either for the
writer or the reader, but I'd be leary of a general violation.  The rule is
there for good reason.

(BTW, there is a "dirty trick" technique for getting the appropriate effect -
if I remember right, you insert a \kern0 after the hyphen, and as far as TeX
is concerned, you how have two words, one ending in a hyphen, either of which
is subject to hyphenation.  The kern can be inserted automatically by an
appropriately-defined active character.  Details left to the reader....)

							-- Jerry
Technical Details
Message-ID: <1992Jul23.090804.1@zodiac.rutgers.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!zaphod.mps.ohio-state.edu!uwm.edu!rutgers!dziuxsolim.rutgers.edu!zodiac.rutgers.edu!leichter
References: <1992Jul23.032744.8313@news.columbia.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!zaphod.mps.ohio-state.edu!uwm.edu!rutgers!dziuxsolim.rutgers.edu!zodiac.rutgers.edu!leichter
From: leichter@zodiac.rutgers.edu
Newsgroups: comp.text.tex
Subject: Re: Hyphenation before punctuation in LaTeX
Message-ID: <1992Jul23.090804.1@zodiac.rutgers.edu>
Date: 23 Jul 92 13:08:04 GMT
References: <1992Jul23.032744.8313@news.columbia.edu>
Sender: news@dziuxsolim.rutgers.edu
Organization: Rutgers University Computing Services
Lines: 45
Nntp-Posting-Host: cancer.rutgers.edu