ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: Why does \struct affect line breaking?
Date: Fri, 08 Nov 2002 17:07:05 +0100	[thread overview]
Message-ID: <5.1.0.14.1.20021108170158.00ae5950@server-1> (raw)
In-Reply-To: <20021108093545.440bf9e4.wmcclain@salamander.com>

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
-------------------------------------------------------------------------

      reply	other threads:[~2002-11-08 16:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-08 15:35 Bill McClain
2002-11-08 16:07 ` Hans Hagen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5.1.0.14.1.20021108170158.00ae5950@server-1 \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ref.ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).