🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text
Article #5840

Re: \parbox dilemma in LaTeX

#5840
From: Greg McGary
Date: Sat, 11 Feb 1989 03:57
30 lines
1987 bytes
In article <50303@yale-celray.yale.UUCP> leichter@cs.yale.edu writes:
>There are two "better ways":

Here's a third "better way":

You can increase the "raggedness" by modifying the definition of \raggedright.

Here's the old definition:
\def\raggedright{\rightskip\z@ plus2em \spaceskip.3333em \xspaceskip.5em\relax}

Notice that 2em is hardwired as the amount of raggedness to the rightskip.

Here's a replacement definition that takes an argument.
(I've presented it here in TeXese, modify as required for LaTeXese)
\def\RaggedRight#1{\rightskip\z@ plus#1 \spaceskip.3333em \xspaceskip.5em\relax}

This allows you to specify the raggedness desired at invocation (e.g.
\RaggedRight{4em} will make TeX tolerate lines twice as ragged as normal
before hyphenating)  I've found that this works far better than fiddling
with the \hyphenpenalty.  If you penalize hyphens too severely, then
you'll end up with overfull or underfull \hboxes when problematic line
breaks occur.  With a stretchier glob of glue for the \rightskip, these
don't occur as readily, and when bad breaks arise, you can keep
\hyphenpenalty at a reasonable value so that hyphenation can occur when
it's really needed as a last-resort.

-- Greg McGary
-- 4201 University Drive #102, Durham, NC 27707       voice: (919) 490-6037
-- {decvax,hplabs,seismo,mcnc}!duke!gm                 data: (919) 493-5953
--                                  gm@cs.duke.edu
Technical Details
Message-ID: <13500@duke.cs.duke.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ukma!rutgers!mcnc!duke!romeo!gm
References: <50303@yale-celray.yale.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ukma!rutgers!mcnc!duke!romeo!gm
From: gm@romeo.cs.duke.edu (Greg McGary)
Newsgroups: comp.text
Subject: Re: \parbox dilemma in LaTeX
Summary: Don't turn off hyphenation, make the right margin more ragged.
Message-ID: <13500@duke.cs.duke.edu>
Date: 11 Feb 89 03:57:10 GMT
References: <50303@yale-celray.yale.UUCP>
Sender: news@duke.cs.duke.edu
Reply-To: gm@romeo.UUCP (Greg McGary)
Organization: Duke University CS Dept.; Durham, NC
Lines: 30