ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Why does \struct affect line breaking?
@ 2002-11-08 15:35 Bill McClain
  2002-11-08 16:07 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Bill McClain @ 2002-11-08 15:35 UTC (permalink / raw)


This is perhaps more of a TeX question, and I'll take it to
comp.text.tex next. But I encountered a problem when using \index in
ConTeXt.

I had my doc formatted exactly the way I wanted. But after I added
\index entries throughout, I found that the line-breaking of some
paragraphs had changed. The text became "looser", not packing quite as
densely. Small changes, but significant to my layout.

Experimentation showed that substituting "\strut" for "\index{...}" had
the same effect. These should be invisible, and I don't see anything
added, but the line-breaking is changed.

I'm reading Eijkhout's chapter on "Line Breaking" in "TeX by Topic" but
am not sure how to interpret it. Have I introduced "glue preceded by a
nondiscardable item"? Would that be less breakable than the simple space
that was there before?

-Bill
-- 
Sattre Press                                The King in Yellow
http://sattre-press.com/                 by Robert W. Chambers
info@sattre-press.com             http://kiy.sattre-press.com/ 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Why does \struct affect line breaking?
  2002-11-08 15:35 Why does \struct affect line breaking? Bill McClain
@ 2002-11-08 16:07 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2002-11-08 16:07 UTC (permalink / raw)


At 09:35 AM 11/8/2002 -0600, you wrote:
>This is perhaps more of a TeX question, and I'll take it to
>comp.text.tex next. But I encountered a problem when using \index in
>ConTeXt.
>
>I had my doc formatted exactly the way I wanted. But after I added
>\index entries throughout, I found that the line-breaking of some
>paragraphs had changed. The text became "looser", not packing quite as
>densely. Small changes, but significant to my layout.
>
>Experimentation showed that substituting "\strut" for "\index{...}" had
>the same effect. These should be invisible, and I don't see anything
>added, but the line-breaking is changed.
>
>I'm reading Eijkhout's chapter on "Line Breaking" in "TeX by Topic" but
>am not sure how to interpret it. Have I introduced "glue preceded by a
>nondiscardable item"? Would that be less breakable than the simple space
>that was there before?

list enties, index entries, color changes, marks, etc all introduce nodes 
in the MVL. Since tex cannot look back when such a node is encountered, it 
will badly interfere with spacing.

Some macros (like the heads) take care of this.

Also, since you want an index on the page where you are, by default a 
nobreak is added, which also interferes with spacing.

The solution is simple: attach the index entry to the word that it belongs 
to, so:

\index{bla}this word

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-11-08 16:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-08 15:35 Why does \struct affect line breaking? Bill McClain
2002-11-08 16:07 ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).