Re: [NTG-context] Divider in grid environment

2014-02-13 Thread Jan Tosovsky
On 2014-02-08 Jan Tosovsky wrote:
 On 2014-02-08 Jan Tosovsky wrote:

 Additionally, I'd like to keep that divider with the previous content
 (paragraph).
 
 In this case AFAIK \testpage[n] cannot be used directly in the divider
 definition as it breaks the page at position of this command.
 
 I'd like to express rather: If there is no space for three lines, 
 break the page, but grab few previous lines (at least 2) together 
 with me (according to orphan/widow settings).
 
 The current behaviour can be demonstrated using this example:
 
 \startsetups[grid][mypenalties]
 \setdefaultpenalties
 \setpenalties\widowpenalties{2}{1}
 \setpenalties\clubpenalties {2}{1}
 \stopsetups
 
 \setuplayout[grid=yes, setups=mypenalties]
 \showgrid
 \showlayoutcomponents
 
 \starttext
 \blank[force, 30*line]
 \input{tufte}
 \blank[4mm]\middlealigned{\hl[4]}\blank[6mm]
 \stoptext
 

I found that \page[no] does exactly what I wanted. If needed, it breaks the
page not at the positon of a divider, but sooner, so that divider is
preceded at least with 2 lines of text.

\page[no]\blank[4mm]\middlealigned{\hl[4]}\blank[6mm]

Jan

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


[NTG-context] Divider in grid environment

2014-02-08 Thread Jan Tosovsky
Dear All,

I'd like to use a divider between certain paragraphs. As I want to keep all
the lines on the grid so it should have a height = N x line height.

As \hl renders the line on baseline, I have to tweek the space before/after
using the 'blank' command to keep the horizontal line in the +/- middle:

\setuplayout[grid=yes]
\showgrid
\showlayoutcomponents

\starttext
\input{ward}
\blank[4mm]\middlealigned{\hl[4]}\blank[6mm]
\input{ward}
\stoptext

But this solution requires adjustments for different fonts or font sizes...

Is there a more efficient way how to accomplish this?

Thanks, Jan

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


Re: [NTG-context] Divider in grid environment

2014-02-08 Thread Jan Tosovsky
On 2014-02-08 Jan Tosovsky wrote:
 I'd like to use a divider between certain paragraphs. As I want to keep
 all the lines on the grid so it should have a height = N x line height.
 
 As \hl renders the line on baseline, I have to tweak the space
 before/after using the 'blank' command to keep the horizontal line 
 in the +/- middle:
 
 \setuplayout[grid=yes]
 \showgrid
 \showlayoutcomponents
 
 \starttext
 \input{ward}
 \blank[4mm]\middlealigned{\hl[4]}\blank[6mm]
 \input{ward}
 \stoptext
 
 But this solution requires adjustments for different fonts or font
 sizes...
 
 Is there a more efficient way how to accomplish this?

Additionally, I'd like to keep that divider with the previous content
(paragraph).

In this case AFAIK \testpage[n] cannot be used directly in the divider
definition as it breaks the page at position of this command.

I'd like to express rather: If there is no space for three lines, break the
page, but grab few previous lines (at least 2) together with me (according
to orphan/widow settings).

The current behaviour can be demonstrated using this example:

\startsetups[grid][mypenalties]
\setdefaultpenalties
\setpenalties\widowpenalties{2}{1}
\setpenalties\clubpenalties {2}{1}
\stopsetups

\setuplayout[grid=yes, setups=mypenalties]
\showgrid
\showlayoutcomponents

\starttext
\blank[force, 30*line]
\input{tufte}
\blank[4mm]\middlealigned{\hl[4]}\blank[6mm]
\stoptext

In my case the divider is used also to emphasise Chapter ends - so it is
very often the last element one the page and there is no need to check also
the space which follows (whether next lines will fit or not). So
'keep-with-previous' is enough for me.

Jan

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