ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Index entries messing up page breaks
@ 2005-12-13 16:30 Duncan Hothersall
  2005-12-13 16:47 ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Duncan Hothersall @ 2005-12-13 16:30 UTC (permalink / raw)


I said:
> Is there any workaround/fix?

I find that the addition of \dontleavehmode fixes it. Is this safe to
use in general?

\starttext
\section{Tufte}
\dorecurse{4}{\input tufte \par}
\section{Knuth}
\dontleavehmode\index{knuth}
\input knuth \par
\stoptext

Thanks,

Duncan

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

* Re: Index entries messing up page breaks
  2005-12-13 16:30 Index entries messing up page breaks Duncan Hothersall
@ 2005-12-13 16:47 ` Hans Hagen
  2005-12-13 17:21   ` Taco Hoekwater
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2005-12-13 16:47 UTC (permalink / raw)


Duncan Hothersall wrote:

>I said:
>  
>
>>Is there any workaround/fix?
>>    
>>
>
>I find that the addition of \dontleavehmode fixes it. Is this safe to
>use in general?
>
>\starttext
>\section{Tufte}
>\dorecurse{4}{\input tufte \par}
>\section{Knuth}
>\dontleavehmode\index{knuth}
>\input knuth \par
>\stoptext
>  
>

no, use \dontleavehmode instead

if you see a tex file on the web and wonder why the spacing is messed up 
... it's probably because of abundant use of \leavemode

(recent versions of pdftex provide \quitvmode which is equivalent to 
\dontleavehmode; taco wrote that patch a while ago)

Hans

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

* Re: Index entries messing up page breaks
  2005-12-13 16:47 ` Hans Hagen
@ 2005-12-13 17:21   ` Taco Hoekwater
  0 siblings, 0 replies; 6+ messages in thread
From: Taco Hoekwater @ 2005-12-13 17:21 UTC (permalink / raw)




Hans Hagen wrote:
> Duncan Hothersall wrote:

>> I find that the addition of \dontleavehmode fixes it. Is this safe to
>> use in general?
> 
> no, use \dontleavehmode instead

;-)

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

* Re: Index entries messing up page breaks
       [not found] <20051213220414.AAFF112850@ronja.ntg.nl>
@ 2005-12-14 10:25 ` Duncan Hothersall
  0 siblings, 0 replies; 6+ messages in thread
From: Duncan Hothersall @ 2005-12-14 10:25 UTC (permalink / raw)


Hans wrote:

> can you try (test extensively):
> 
> \def\dodoregister[#1]#2#3%
>   {\dogotopar{\dontleavehmode\doprocesspageregister[#1]{#2}{#3}}}

Well, it has some problems, introducing vertical space in certain
circumstances. Will try to work up a minimal, but two observations:

1. The extra vertical space tends to happen immediately before headings,
which is probably immediately after a \par, suggesting that if we're
already in vertical mode there is something creating a horizontal mode
object here.

2. If I use \dontleavehmode\index{blah} in material that immediately
follows a heading, and just \index{blah} everywhere else, everything
appears to work well with no white-space issues and no headings at the
bottom of the page.

(I can only do 2. easily because I'm generating my code from XML, not
writing directly in ConTeXt, so it's easy to put in a rule that makes
the <index> tag behave differently in different contexts. It's probably
not a solution for anyone else.)

Duncan

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

* Re: Index entries messing up page breaks
  2005-12-13 16:13 Duncan Hothersall
@ 2005-12-13 22:03 ` Hans Hagen
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2005-12-13 22:03 UTC (permalink / raw)


Duncan Hothersall wrote:

>The manual suggests that you can put index calls between a \section
>heading and its first paragraph without worry, but for me it breaks the
>page-breaking mechanism, allowing the section title to end up at the
>bottom of a page like this:
>
>\starttext
>\section{Tufte}
>\dorecurse{4}{\input tufte \par}
>\section{Knuth}
>\index{Knuth}
>\input knuth \par
>\stoptext
>
>Is there any workaround/fix?
>  
>
can you try (test extensively):

\def\dodoregister[#1]#2#3%
  {\dogotopar{\dontleavehmode\doprocesspageregister[#1]{#2}{#3}}}

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

* Index entries messing up page breaks
@ 2005-12-13 16:13 Duncan Hothersall
  2005-12-13 22:03 ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Duncan Hothersall @ 2005-12-13 16:13 UTC (permalink / raw)


The manual suggests that you can put index calls between a \section
heading and its first paragraph without worry, but for me it breaks the
page-breaking mechanism, allowing the section title to end up at the
bottom of a page like this:

\starttext
\section{Tufte}
\dorecurse{4}{\input tufte \par}
\section{Knuth}
\index{Knuth}
\input knuth \par
\stoptext

Is there any workaround/fix?

Thanks very much,

Duncan

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

end of thread, other threads:[~2005-12-14 10:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-13 16:30 Index entries messing up page breaks Duncan Hothersall
2005-12-13 16:47 ` Hans Hagen
2005-12-13 17:21   ` Taco Hoekwater
     [not found] <20051213220414.AAFF112850@ronja.ntg.nl>
2005-12-14 10:25 ` Duncan Hothersall
  -- strict thread matches above, loose matches on Subject: below --
2005-12-13 16:13 Duncan Hothersall
2005-12-13 22:03 ` 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).