ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* keeping headings with following texts
@ 2013-07-13 12:07 Pablo Rodríguez
  2013-07-13 12:23 ` Wolfgang Schuster
  0 siblings, 1 reply; 10+ messages in thread
From: Pablo Rodríguez @ 2013-07-13 12:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear list,

writing an article on ConTeXt, I have found what I think is a surprising
feature (at least, a surprising default): headings don’t always keep
with next paragraph, so they can end up in being widowed (heading + page
break + first paragraph on next page).

Sorry, but I’m afraid that I don’t understand this default. I have never
seen a printed book that displays this behavior (unless the heading was
alone on its page).

Don‘t get me wrong, I‘m more than happy with ConTeXt. But would anyone
be so kind to explain the reason of the described default? (I’m trying
to understand, so I can explain to others.)

I have found on the list
(http://www.ntg.nl/pipermail/ntg-context/2007/023357.html) the way to
avoid this:

    \setuphead[section][before={\page[bigpreference]}]

How can I know which is the exact default value in any given command? (I
need to know the before values for headings, at least.)

Is there a way to enable the “keep with next” option for all headings?

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: keeping headings with following texts
  2013-07-13 12:07 keeping headings with following texts Pablo Rodríguez
@ 2013-07-13 12:23 ` Wolfgang Schuster
  2013-07-13 13:09   ` Pablo Rodríguez
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2013-07-13 12:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 13.07.2013 um 14:07 schrieb Pablo Rodríguez <oinos@web.de>:

> Dear list,
> 
> writing an article on ConTeXt, I have found what I think is a surprising
> feature (at least, a surprising default): headings don’t always keep
> with next paragraph, so they can end up in being widowed (heading + page
> break + first paragraph on next page).
> 
> Sorry, but I’m afraid that I don’t understand this default. I have never
> seen a printed book that displays this behavior (unless the heading was
> alone on its page).
> 
> Don‘t get me wrong, I‘m more than happy with ConTeXt. But would anyone
> be so kind to explain the reason of the described default? (I’m trying
> to understand, so I can explain to others.)
> 
> I have found on the list
> (http://www.ntg.nl/pipermail/ntg-context/2007/023357.html) the way to
> avoid this:
> 
>    \setuphead[section][before={\page[bigpreference]}]
> 
> How can I know which is the exact default value in any given command? (I
> need to know the before values for headings, at least.)
> 
> Is there a way to enable the “keep with next” option for all headings?

Do you have a example where this happens because context tries to prevent
a page break after a heading which can fail when you put \placefigure etc.
between the heading and the following text.

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: keeping headings with following texts
  2013-07-13 12:23 ` Wolfgang Schuster
@ 2013-07-13 13:09   ` Pablo Rodríguez
  2013-07-13 13:19     ` Wolfgang Schuster
  0 siblings, 1 reply; 10+ messages in thread
From: Pablo Rodríguez @ 2013-07-13 13:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 13/07/13 14:23, Wolfgang Schuster wrote:
> Am 13.07.2013 um 14:07 schrieb Pablo Rodríguez <oinos@web.de>:
>> [...]
>> Is there a way to enable the “keep with next” option for all headings?
> 
> Do you have a example where this happens because context tries to prevent
> a page break after a heading which can fail when you put \placefigure etc.
> between the heading and the following text.

Thanks for your reply, Wolfgang.

I guess you refer to the case, not to the code:
http://www.ousia.tk/wrong-title-break.pdf (only the two involved pages
included).

Thanks again for your help,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: keeping headings with following texts
  2013-07-13 13:09   ` Pablo Rodríguez
@ 2013-07-13 13:19     ` Wolfgang Schuster
  2013-07-13 14:08       ` Pablo Rodríguez
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2013-07-13 13:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 13.07.2013 um 15:09 schrieb Pablo Rodríguez <oinos@web.de>:

> On 13/07/13 14:23, Wolfgang Schuster wrote:
>> Am 13.07.2013 um 14:07 schrieb Pablo Rodríguez <oinos@web.de>:
>>> [...]
>>> Is there a way to enable the “keep with next” option for all headings?
>> 
>> Do you have a example where this happens because context tries to prevent
>> a page break after a heading which can fail when you put \placefigure etc.
>> between the heading and the following text.
> 
> Thanks for your reply, Wolfgang.
> 
> I guess you refer to the case, not to the code:
> http://www.ousia.tk/wrong-title-break.pdf (only the two involved pages
> included).

Can you make a minimal tex document out of this. It would be also
interesting to see your definition for the problematic heading which
seems to use your own code.

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: keeping headings with following texts
  2013-07-13 13:19     ` Wolfgang Schuster
@ 2013-07-13 14:08       ` Pablo Rodríguez
  2013-07-13 14:23         ` Pablo Rodríguez
  2013-07-13 16:29         ` Wolfgang Schuster
  0 siblings, 2 replies; 10+ messages in thread
From: Pablo Rodríguez @ 2013-07-13 14:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 13/07/13 15:19, Wolfgang Schuster wrote:
> [...]
> Can you make a minimal tex document out of this. It would be also
> interesting to see your definition for the problematic heading which
> seems to use your own code.

Here you have it:

    \usemodule[simplefonts]
    \setmainfont[TeX Gyre Pagella]
    \setuplayout[setups=*lessstrict]
    \startsetups[*lessstrict]
        \setup[reset]
        \widowpenalty=10000
        \clubpenalty=10000
        \brokenpenalty=10000
    \stopsetups
    \setupinterlinespace[line=3.2ex]

    \setupnote[footnote][split=verystrict]

    \starttext

    \dorecurse{28}{line\\}

    \subsection{Subsection Heading}

    line one\\
    line two%
    \footnote{This should be on the same page.}.
    \stoptext

I need split set to verystrict in footnotes, otherwise footnotes can be
placed in the next page where their body text reference occurs (I have
never seen this on any printed book). This is exactly what happens when
\setupnote[footnote] is disabled.

But even removing the footnote itself and setting the recursion to 30
times, the subsection heading is also left alone on the first page.

What am I doing wrong here?


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: keeping headings with following texts
  2013-07-13 14:08       ` Pablo Rodríguez
@ 2013-07-13 14:23         ` Pablo Rodríguez
  2013-07-13 14:39           ` Peter Münster
  2013-07-13 16:29         ` Wolfgang Schuster
  1 sibling, 1 reply; 10+ messages in thread
From: Pablo Rodríguez @ 2013-07-13 14:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 13/07/13 16:08, Pablo Rodríguez wrote:
> On 13/07/13 15:19, Wolfgang Schuster wrote:
>> [...]
>> Can you make a minimal tex document out of this. It would be also
>> interesting to see your definition for the problematic heading which
>> seems to use your own code.
> 
> Here you have it:
> 
>     \usemodule[simplefonts]
>     \setmainfont[TeX Gyre Pagella]

Just in case it helps.

If I replace those lines with \setupbodyfont[pagella,12pt], nothing
changes, but if I remove the first two lines quoted above, everything works.

Recursion set to 27 times allows the whole contents on the first page.
And set to 28 times moves the heading to next page.

What does it make such a difference?


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: keeping headings with following texts
  2013-07-13 14:23         ` Pablo Rodríguez
@ 2013-07-13 14:39           ` Peter Münster
  2013-07-13 15:22             ` Wolfgang Schuster
  0 siblings, 1 reply; 10+ messages in thread
From: Peter Münster @ 2013-07-13 14:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, Jul 13 2013, Pablo Rodríguez wrote:

>>     \usemodule[simplefonts]
>>     \setmainfont[TeX Gyre Pagella]
>
> If I replace those lines with \setupbodyfont[pagella,12pt], nothing
> changes, but if I remove the first two lines quoted above, everything works.

No. You don't need those lines for a minimal example:

\setupinterlinespace[line=4ex]
\starttext
\dorecurse{560}{bla }
\section{section}
\dorecurse{30}{bla }
\stoptext

-- 
           Peter
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: keeping headings with following texts
  2013-07-13 14:39           ` Peter Münster
@ 2013-07-13 15:22             ` Wolfgang Schuster
  2013-07-13 15:37               ` Pablo Rodríguez
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2013-07-13 15:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 13.07.2013 um 16:39 schrieb Peter Münster <pmlists@free.fr>:

> On Sat, Jul 13 2013, Pablo Rodríguez wrote:
> 
>>>    \usemodule[simplefonts]
>>>    \setmainfont[TeX Gyre Pagella]
>> 
>> If I replace those lines with \setupbodyfont[pagella,12pt], nothing
>> changes, but if I remove the first two lines quoted above, everything works.
> 
> No. You don't need those lines for a minimal example:
> 
> \setupinterlinespace[line=4ex]
> \starttext
> \dorecurse{560}{bla }
> \section{section}
> \dorecurse{30}{bla }
> \stoptext

The penalty between the heading and the following text isn’t high enough
to prevent a page break. When you set a higher value through the after key
with the \blank command the break disappears.

\setuphead[section][after={\blank[samepage,big]}]

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: keeping headings with following texts
  2013-07-13 15:22             ` Wolfgang Schuster
@ 2013-07-13 15:37               ` Pablo Rodríguez
  0 siblings, 0 replies; 10+ messages in thread
From: Pablo Rodríguez @ 2013-07-13 15:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 13/07/13 17:22, Wolfgang Schuster wrote:
> Am 13.07.2013 um 16:39 schrieb Peter Münster <pmlists@free.fr>:
>> On Sat, Jul 13 2013, Pablo Rodríguez wrote:
>>>
>>> If I replace those lines with \setupbodyfont[pagella,12pt], nothing
>>> changes, but if I remove the first two lines quoted above, everything works.
>>
>> No. You don't need those lines for a minimal example:
>> [...]
> The penalty between the heading and the following text isn’t high enough
> to prevent a page break. When you set a higher value through the after key
> with the \blank command the break disappears.
> 
> \setuphead[section][after={\blank[samepage,big]}]

Many thanks for your help, Wolfgang.

It works perfectly now.

I’m still wondering why your setup isn’t the default in ConTeXt.



Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: keeping headings with following texts
  2013-07-13 14:08       ` Pablo Rodríguez
  2013-07-13 14:23         ` Pablo Rodríguez
@ 2013-07-13 16:29         ` Wolfgang Schuster
  1 sibling, 0 replies; 10+ messages in thread
From: Wolfgang Schuster @ 2013-07-13 16:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Pablo Rodríguez


Am 13.07.2013 um 16:08 schrieb Pablo Rodríguez <oinos@web.de>:

>    \setuplayout[setups=*lessstrict]
>    \startsetups[*lessstrict]
>        \setup[reset]
>        \widowpenalty=10000
>        \clubpenalty=10000
>        \brokenpenalty=10000
>    \stopsetups

\startsetups[lessstrict]
    \setups[*reset]
    \setpenalties\widowpenalties {2}{10000}
    \setpenalties\clubpenalties  {2}{10000}
    \setpenalties\brokenpenalties{2}{10000}
\stopsetups

\setuplayout[setups=lessstrict]

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2013-07-13 16:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-13 12:07 keeping headings with following texts Pablo Rodríguez
2013-07-13 12:23 ` Wolfgang Schuster
2013-07-13 13:09   ` Pablo Rodríguez
2013-07-13 13:19     ` Wolfgang Schuster
2013-07-13 14:08       ` Pablo Rodríguez
2013-07-13 14:23         ` Pablo Rodríguez
2013-07-13 14:39           ` Peter Münster
2013-07-13 15:22             ` Wolfgang Schuster
2013-07-13 15:37               ` Pablo Rodríguez
2013-07-13 16:29         ` Wolfgang Schuster

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