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] size of footnote numbers

2017-09-29 Thread Henning Hraban Ramm
Ahoi,

in my current book there are some quotations typeset in a smaller type (via 
\switchtobodyfont in a defined startstop).

Now the author insists that their footnote numbers should have the same size as 
in the body text.
Since the footnotes are mostly source annotations at the end, it makes some 
sense.

What would be the best way to achieve this?

Here’s my setup:

\setupbodyfont  [alegreya,rm,11pt] % usual font size

\startsetups[myQuotation]
  \setupwhitespace[none]
  \setupnarrower[left=2em,right=2em]
  \switchtobodyfont[rm,10pt]
% I guess I should change the footnote number font size here?
\stopsetups

\definestartstop[myQuotation][
setups=myQuotation,
before={
  \testpage[2]
  \startnarrower[left,right]
  \noindent},
after={\stopnarrower
  \indenting[next]}]



Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

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

Re: [NTG-context] line correction

2017-09-29 Thread Hans Hagen

On 9/29/2017 12:35 AM, mf wrote:

Thank you Henri,
a slightly modified version of your solution works!

This is what I wanted to achieve:

\setuplayout[grid=both]
\setupquotation[before={\switchtobodyfont[9pt]}]

\starttext
\showgrid

\input knuth

\startlinecorrection[halfline]
\startquotation
   \input sapolsky
\stopquotation
\stoplinecorrection

\input knuth
%\vadjust pre{\blank[line]}% not line, but halfline!
\vadjust pre{\blank[halfline]}%
$\displaystyle{\frac{1}{a + b}}$
%\vadjust{\blank[line]}% not line, but halfline!
\vadjust{\blank[halfline]}%
\input knuth

\stoptext

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)



But I have many quotations (and floats), whose spaces before and after
should be manually tuned not to push the main text out of the grid.
And here grid snapping does a very good (and automated) job.

But sometimes grid snapping is too strict, as in the tall formula
example. I'm still afraid it's too strict and it will hurt in other
places of the text, but now I have a solution, at least for that
problem.
So thank you again,
best regards,
Massi

Il giorno ven, 29/09/2017 alle 10.55 +1300, Henri ha scritto:

On Thu, 2017-09-28 at 23:30 +0200, mf wrote:

Thank you Henri.

Now consider this:
---
\setuplayout[grid=both]
\setupquotation[before={\switchtobodyfont[9pt]}]

\starttext
\showgrid

\input knuth

\startlinecorrection[halfline]
\startquotation
   \input sapolsky
\stopquotation
\stoplinecorrection

\input knuth
$\displaystyle{\frac{1}{a + b}}$


If you are really keen on screwing up your linespacing you can use

\vadjust pre{\blank[line]}%
$\displaystyle{\frac{1}{a + b}}$
\vadjust{\blank[line]}%

as a one-off solution.  But better make it a displayed formula or
tweak it such that it does not
disrupt spacing and blends in with the text.  In this example I'd
change $\displaystyle\frac{1}{a +
b}$ to $(a+b)^{-1}$.  Trust someone who does math typesetting every
day.


\input knuth

\stoptext
---

Now the text snaps to the grid after the quotation, but the tall
formula inside the text overlaps with the text lines.

The solution would be a grid configuration that gives the line
containing the formula two lines of height, putting that only line
in
the middle and then snapping the following lines again to the grid
(still solving the alignment of quotations as in the grid=both
case).
Is it possible?

Best regards,
Massi

Il giorno ven, 29/09/2017 alle 08.48 +1300, Henri ha scritto:


On Thu, 2017-09-28 at 16:21 +0200, MF wrote:


Hello list,
I would like ConTeXt to snap normal text to grid after a
quotation.
This example does not work:

--
\setupquotation[before={\switchtobodyfont[9pt]}]

\starttext
\showgrid

\input knuth

\startlinecorrection[halfline]
\startquotation
   \input sapolsky
\stopquotation
\stoplinecorrection

\input knuth

\stoptext
--

If I prepend a \setuplayout[grid=yes], it works, but grid
snapping
introduces also other side effects I don't want (i.e. tall
formulas
inside text taking too much vertical space).

I would like the halfline spaces before and after the quotation
to
shrink or stretch a bit to the nearest multiple of the main
text
line
height.

Is there an automatic way to get the normal text "return" on
the
grid
after a quotation without turning on a global grid snapping?


\setuplayout[grid=both] to round down both height and width when
snapping.




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



_
__
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/nt
g-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : 

Re: [NTG-context] line correction

2017-09-29 Thread Hans Hagen

On 9/28/2017 11:47 PM, luigi scarso wrote:

On Thu, Sep 28, 2017 at 11:30 PM, mf  wrote:

Thank you Henri.

Now consider this:
---
\setuplayout[grid=both]
\setupquotation[before={\switchtobodyfont[9pt]}]

\starttext
\showgrid

\input knuth

\startlinecorrection[halfline]
\startquotation
   \input sapolsky
\stopquotation
\stoplinecorrection

\input knuth
$\displaystyle{\frac{1}{a + b}}$
\input knuth

\stoptext
---

Now the text snaps to the grid after the quotation, but the tall
formula inside the text overlaps with the text lines.

The solution would be a grid configuration that gives the line
containing the formula two lines of height, putting that only line in
the middle and then snapping the following lines again to the grid
(still solving the alignment of quotations as in the grid=both case).
Is it possible?



I suppose that this is not what you want,
but perhaps it can give you some some idea



\setuplayout[grid=both]
\setupquotation[before={\switchtobodyfont[9pt]}]

\starttext
\showgrid

\input knuth

\startlinecorrection[halfline]
\startquotation
   \input sapolsky
\stopquotation
\stoplinecorrection


linecorrection is to be used only with boxed material (normally 
something framed)



\input knuth
\setbox0=\hbox{$\displaystyle{\frac{1}{a + b}}$}%
\ruledvbox to 1\lineheight{\hsize=\wd0\vrule width0pt height0pt
depth1\lineheight \vss\box0\vss}
\input knuth

\stoptext





--

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

Re: [NTG-context] ligature exceptions

2017-09-29 Thread Pablo Rodriguez
On 09/28/2017 03:54 PM, Hans Hagen wrote:
> On 9/28/2017 1:51 PM, Pablo Rodriguez wrote:
>> [...]
>> I overlooked that \blockligatures[u:fl:age, u:fl:eg] only works if there
>> is also a \blockligatures[fl].
>>
>> Hans, is this a bug or is it intended?
> do you indeed use the latest beta? anyway, the \replaceword mechanism is 
> a bit more flexible and efficient

Hans,

after updating to latest beta (from 2017.09.25 19:19 to 2017.09.28 10:07
[I didn’t realize that there was a newer beta yesterday]), it works.

Just in case it may be relevant, \blockligatures[u:fl:age] blocks
ligatures in auflegt and Aufl.

Minimal sample:

\starttext
\blockligatures[u:fl:age]

\definefontfeature[default:b][default][blockligatures=yes]

\setupbodyfont[times]\showfontkerns

\startTEXpage[offset=1em]
fl Auflage auflegt Aufl.

\definedfont[Serif*default:b]
fl Auflage auflegt Aufl.
\stopTEXpage
\stoptext

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

Re: [NTG-context] Troubleshooting pdf bookmarks

2017-09-29 Thread Pablo Rodriguez
On 09/28/2017 10:27 PM, Alan Braslau wrote:
> On Thu, 28 Sep 2017 13:55:29 +0200 Pablo Rodriguez wrote:
> 
>>> As most of my
>>> customers are likely to use Acrobat Reader, I'm not really worried
>>> about the bookmarks not showing up in other readers. Why SumatraPDF
>>> shows bookmarks in test environment, but not in the proper one is an
>>> enigma, but I'm no longer worried about it. Problem solved, at least
>>> close enough.  
>>
>> Does the latest version of MuPDF show the bookmarks?
> 
> mupdf shows bookmarks?

MuPDF-1.11 displays bookmarks (see attached image).

This is the GL version, I don’t know how to do that in the X11 version
(I don’t even know if the feature is available in the X11 version).

> P.S. If bookmarks are broken with SumatraPDF, then we have even less of
> a chance in getting Hans' support.

If we have a sample PDF document, we may know what is broken there: the
viewer reading the bookmarks or the PDF document containing them.

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

Re: [NTG-context] synctex, TeXShop and \input files

2017-09-29 Thread Otared Kavian
Hi Hans,

Thanks for the hint. Indeed every input file has got a reference in synctex 
file produced by ConTeXt. 
(I noticed also that during the typesetting ConTeXt creates another file with a 
suffix syncctx which is wiped out at the end of the processinng).

On the other hand after reading your hint I tried the same files with another 
application, TeXWorks, and there the syncing works perfectly. 
Therefore it seems that this is a problem with TeXShop and I am going to report 
a bug with Richard Koch.

Best regards: OK



> On 28 Sep 2017, at 22:44, Hans Hagen  wrote:
> 
> On 9/28/2017 9:30 PM, Otared Kavian wrote:
>>> On 28 Sep 2017, at 19:12, Hans Hagen > 
>>> wrote:
 […]
>>> files in the tex tree (styles and such) are not accessible (protected) as 
>>> you don't want them to get messed up
>> Sure, but my problem is that I have a document with five or six chapters. 
>> Each chapter is included in files which are named for instance
>> chapter-1.tex
>> chapter-2.tex
>> and so on.  Then my file main.tex contains the lines
>> \input chapter-1.tex
>> \input chapter-2.tex
>> and so on, in order to typeset the whole document. But now I don’t know how 
>> to sync the PDF file with the source files chapter-1.tex, chapter-2.tex, 
>> etc., in order to correct mistakes or mistypings when I discover them in the 
>> PDF file.
>> Clearly, the main file and these files are residing in the same directory.
>> Is there a way to tell context to look into the directory where the main 
>> file and my chapter files are?
> 
> it works here .. you can look in the synctex file to see if the files get 
> references
> 
> 
> -
>  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
> ___

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