[NTG-context] widow/orphan control in columns?
Hello, We have a document with a 2-column layout where we have section headers that keep ending up at the bottom of columns. E.g. \startsectionheading{2. Foo bar baz}\stopsectionheading where \startsectionheading is defined by: \definestartstop [sectionheading] [before={ \startalignment[middle]}, after={\stopalignment \bigskip}, style={\switchtobodyfont[...,...]}] In order to make sure this section heading gets followed by a line or two of actual text, I saw on web pages [1] and [2] that you can use \testpage[n] to check whether there is room for n more lines, and if not, to produce a page break. I checked the manual [3] and command reference [4] but couldn't find information about \testpage. Is there a corresponding command to conditionally produce a column break? Thanks, Lars [1] http://getfo.org/context_xml/page4.html [2] http://wiki.contextgarden.net/Layout [3] http://www.pragma-ade.com/general/manuals/cont-eni.pdf [4] http://texshow.contextgarden.net/ ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] widow/orphan control in columns?
On 12/2/2008 1:45 PM, Lars Huttar wrote: > Hello, > > We have a document with a 2-column layout where we have section headers > that keep ending up at the bottom of columns. ... > I checked the manual [3] and command > reference [4] but couldn't find information about \testpage. > Is there a corresponding command to conditionally produce a column break? > > Thanks, > Lars I just looked at the implementation of \testpage in base/page-ini.tex and found \testcolumn. I imagine that should be analogous to \testpage, but hesitate to rely on an undocumented feature, as it might be unused or obsolete code. I can't find any examples of anyone using \testcolumn. Yet it seems that keeping a section header with the following text in a column would be a common layout requirement; even Microsoft Word does it. Am I missing something? Does anybody know if \testcolumn is intended for public use? Thanks again, Lars ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] widow/orphan control in columns?
Lars Huttar wrote: > On 12/2/2008 1:45 PM, Lars Huttar wrote: >> Hello, >> >> We have a document with a 2-column layout where we have section headers >> that keep ending up at the bottom of columns. > >> I checked the manual [3] and command >> reference [4] but couldn't find information about \testpage. >> Is there a corresponding command to conditionally produce a column break? >> >> Thanks, >> Lars > > I just looked at the implementation of \testpage in base/page-ini.tex > and found \testcolumn. > I imagine that should be analogous to \testpage, but hesitate to rely on > an undocumented feature, as it might be unused or obsolete code. I can't > find any examples of anyone using \testcolumn. > > Yet it seems that keeping a section header with the following text in a > column would be a common layout requirement; even Microsoft Word does > it. Am I missing something? tex does not know about columns, so any implementation is kind of a hack; some time next year in mkiv we will have a more advanced skip/penalty model that might handle such cases > Does anybody know if \testcolumn is intended for public use? if it works for you ... Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] widow/orphan control in columns?
Lars Huttar wrote: > Hello, > > We have a document with a 2-column layout where we have section headers > that keep ending up at the bottom of columns. > E.g. > > \startsectionheading{2. Foo bar baz}\stopsectionheading > > where \startsectionheading is defined by: > > \definestartstop > [sectionheading] > [before={ \startalignment[middle]}, >after={\stopalignment \bigskip}, >style={\switchtobodyfont[...,...]}] > > In order to make sure this section heading gets followed by a line or > two of actual text, I saw on web pages [1] and [2] that you can use > \testpage[n] to check whether there is room for n more lines, and if > not, to produce a page break. I checked the manual [3] and command > reference [4] but couldn't find information about \testpage. > Is there a corresponding command to conditionally produce a column break? using \testpage in one column mode is ok; i use it often (if you look in the source you will notice that there are several strategies related to it) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___