On 5/10/2021 5:15 PM, [email protected] wrote:
Hi everyone,
I know it is possible to make local changes by enclosing text in \start
\stop pairs to make local changes. Then, there are also commands that
only affect the next/current paragraph, such as \looseness.
But is there a similar mechanism for page-layout changes? For example
your penalty settings allow widows and orphans, but on one particular
page you want to change the penalties. Or, you use \setupalign[height],
but on one page you want to use \setupalign[bottom] instead. Is there a
way to do thisĀ ?
it works per paragraph so then you need to adapt it for a specific
paragraph
when the par starts, the properties are stored (in lmtx it's configured
that way); you can change properties in the middle of a paragraph but
then you need to explicitly freeze them, as demonstrated in the examples
below; tracing will show you all stored properties
(default tex behaviour is that the last setting counts which can be
somewhat unexpected)
\starttext
\tracingoutput1 \tracingonline1
\pretolerance9000 test \pretolerance8000 test \par
\pretolerance9000 test \pretolerance7000 \updateparagraphproperties
test \par
\pretolerance9000 test \pretolerance6000
\snapshotpar\frozentolerancecode test \par
\stoptext
the log shows ...
\par[newgraf][16=1,17=1], .... pretolerance 9000, ....
\par[newgraf][16=1,17=1], .... pretolerance 7000, ....
\par[newgraf][16=1,17=1], .... pretolerance 6000, ....
now, as you probably don't want to be persistent you can group:
\def\MyHack
{\bgroup
\pretolerance5000
\snapshotpar\frozentolerancecode
\egroup}
test \MyHack test
works ok because the snapshotting applies to the current paragraph (it's
actually described in some manual)
so, basically, you have a lot of control, all together some 36
parameters (pablo probably loves the somewhat secret on the fly
adjustspacing step, stretch and shrink tweakability)
Hans
-----------------------------------------------------------------
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 : [email protected] / 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
___________________________________________________________________________________