[pdftex] [Slightly OT] Width of ragged text

Magnus Lie Hetland magnus at hetland.org
Mon Dec 22 14:44:32 CET 2003

Ross Moore <ross at ics.mq.edu.au>:
>
>
> Hello Magnus,
>
> On Mon, 22 Dec 2003, Magnus Lie Hetland wrote:
>
> > I guess this is more of a general LaTeX/TeX question, but I hope it's
> > not too far OT here...
>
> Yes, it is rather.

Oh... Well, thanks for helping me anyway :]

> > The question is simply: How do I find the width of a piece of
> > ragged(right) text? I put the text in a parbox of a given width to
> > break it, but then, of course, it doesn't fill the width of the box,
> > and I no longer know how wide it is. Is it possible to find out?
>
>    \setbox0=\hbox{<the text>}

Hm. Maybe I don't quite understand -- or maybe I didn't make myself
clear. I'm trying to find the width of a paragraph. By using an \hbox
I'll just get a single (unbroken) line. If I put the \parbox inside
the \hbox, I'll just get the width of the \parbox (which I already
(which isn't what I'm looking for) through \settowidth (which is what
I've been using so far)?

[snip]
> I'd suggest you read the chapter on Boxes & Glue in The TeXBook, by
> DEK.

Thanks -- I've read the chapters cursorily, but haven't been able to
find anything of use.

> Hope this helps

It may just be that I don't understand how it would help, but... I
still can't see how I can find the width of a (broken, ragged-right)
paragraph... I guess I'll have to look through the "breaking lines
into paragraphs" chapter too.

> 	Ross Moore

--
Magnus Lie Hetland           "The mind is not a vessel to be filled,
http://hetland.org            but a fire to be lighted."  [Plutarch]