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 : 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 ___________________________________________________________________________________
-- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------