Re: [NTG-context] Risposta: line correction

2017-09-29 Thread Rik Kabel

On 2017-09-29 05:53, MF wrote:

So for quotations and adjust the space around them are you suggesting
manual adjustment?

I was already more convinced of keeping snap-to-grid turned off. Now
the problem is how to adjust the spaces around quotations (and floats)
at the minimum cost.

Since the line heights of the main text and the ones of quotations do
not change, the adjustment depends only on the number of lines of
quotations. I could compile a table for more common cases:

# of lines | adjustment
1 line | ... pt
2 lines| ... pt
3 lines| ... pt
...
20 lines   | ... pt

I should teach users how to insert adjustments, but the task would be
eased because they should only copy a value from a table or insert a
name that corresponds the the number of lines (i.e. "adjust-3-lines",
"adjust-4-lines", etc.)

Greetings,
Massi
___


Be careful not to insert an adjustment after a block that is split over 
two pages.


A more useful (from a user perspective, I do not know about the coding) 
solution would be a command to snap to the nearest grid line (up or 
down, half or whole step).


But both your count and my \snapto suffer from a common problem. Both 
are likely to leave different amounts of space before and after the 
block. A more evenly balanced approach is to compute the height of the 
block plus the vertical space by which it should be set off plus the 
vertical space needed to reach a grid-line or half-grid and, if the 
block stays on the page, split the difference top and bottom. If the 
block does not stay on the page, some portion with the top offset must 
be calculated and placed on the page if it otherwise meets widow/orphan 
tests.


--
Rik

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Risposta: line correction

2017-09-29 Thread Hans Hagen

On 9/29/2017 11:30 AM, MF wrote:

Il giorno gio, 28/09/2017 alle 23.19 -0400, Rik Kabel ha scritto:

Massi and list,

There is one issue with \startlinecorrection  of which you should be
aware. The text is set in a vbox. If the block quotation it encloses
(or
whatever text it encloses) does not fit on the current page, a page
break will be generated. This makes it useless with quotes near the
bottom of a page.  Enclosed texts longer than a page run over the
bottom
margin of the new page.


you can play with widow penalties

\keeplinestogether{10}


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Risposta: line correction

2017-09-29 Thread MF

> > In general, I'm ok without grid snapping, because the default
> > typesetting of taller formulas inside text is good enough for my
> > goals.
> 
> for a bit more complex doc with many different unpredictable
> elements 
> snapping seldom works ... we never use it (in production it often
> leads 
> to more whitespace than one wants) ... the tex glue model is good
> enough
> 
> (the requirement often comes from cases where snapping is the only
> way 
> to get spacing right ... similar to the use of ragged right and no 
> hyphenation because the used system can't handle it well ... in the 
> worst case the limitations of a system then become undisputable
> 'good 
> practice' and 'it's the default' and 'it's better for reader' etc)
> 

So for quotations and adjust the space around them are you suggesting
manual adjustment?

I was already more convinced of keeping snap-to-grid turned off. Now
the problem is how to adjust the spaces around quotations (and floats)
at the minimum cost.

Since the line heights of the main text and the ones of quotations do
not change, the adjustment depends only on the number of lines of
quotations. I could compile a table for more common cases:

# of lines | adjustment
1 line | ... pt
2 lines| ... pt
3 lines| ... pt
...
20 lines   | ... pt

I should teach users how to insert adjustments, but the task would be
eased because they should only copy a value from a table or insert a
name that corresponds the the number of lines (i.e. "adjust-3-lines",
"adjust-4-lines", etc.)

Greetings,
Massi
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Risposta: line correction

2017-09-29 Thread MF
Il giorno gio, 28/09/2017 alle 23.19 -0400, Rik Kabel ha scritto:
> Massi and list,
> 
> There is one issue with \startlinecorrection  of which you should be 
> aware. The text is set in a vbox. If the block quotation it encloses
> (or 
> whatever text it encloses) does not fit on the current page, a page 
> break will be generated. This makes it useless with quotes near the 
> bottom of a page.  Enclosed texts longer than a page run over the
> bottom 
> margin of the new page.
> 
Thank you Rik, I overlooked that (and now I'm reading Hans' reply about
line correction being for framed material and not for quotations).

I need to decide whether to 
- turn off grid snapping and adjust every single quotation 
or
- turn grid snapping on, benefit from line correction most of the time
and manually adjust the cases where a quotation is across a page
boundary

It depends on the texts I'm working on.

This question reminds me the chapter about line profiling in the
"Still" manual. There's no general, fully automated solution.

> It would be nice to have an alternative that does not have that
> limitation.
> 

Hans talked about that at the last ConTeXt Meeting. If I understand
well, it's very hard to calculate how much of the vertical space of the
page TeX has used. And once it flushes the page, it frees the memory
and forgets about it.
Add inserts like footnotes to the problem and it gets really hard.

Best regards,
Massi
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___