Re: [NTG-context] help with facing page image

2022-03-11 Thread jbf via ntg-context
Thanks Wolfgang. This version is the 'icing on the cake' I think, a 
further refined version of the suggestion put forward by Sreeram.


Grateful as always,

Julian

On 11/3/22 23:36, Wolfgang Schuster wrote:

\definepageinjectionalternative
  [chapter:image]
  [renderingsetup=pageinjection:chapter:image]

\startsetups [pageinjection:chapter:image]
  \centerbox{\externalfigure[\dummyparameter{name}]}
\stopsetups

\definepageinjection
  [chapter:start]
  [empty]
  [page=left]

\definepageinjection
  [chapter:insert]
  [previouspage]
  [alternative=chapter:image,
   offset=1cm,
   pagestate=stop]

\setuphead
  [chapter]
  [beforesection={\pageinjection[chapter:start]},
insidesection={\pageinjection[chapter:insert][name={chapter-\namedheadnumber{chapter}}]}] 



\setuppagenumbering
  [alternative=doublesided]

\setupexternalfigures
  [location=default]

\useexternalfigure [chapter-1] [mill]   [factor=max]
\useexternalfigure [chapter-2] [hacker] [orientation=90,scale=2000]
\useexternalfigure [chapter-3] [cow] [orientation=90,height=\framedwidth]

\starttext

\startchapter [title={Mill}]
\dorecurse{7}{\samplefile{lorem}}
\stopchapter

\startchapter [title={Hacker}]
\dorecurse{11}{\samplefile{lorem}}
\stopchapter

\startchapter [title={cow}]
\dorecurse{7}{\samplefile{lorem}}
\stopchapter

\stoptext 

___
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] new upload

2022-03-11 Thread Hans Hagen via ntg-context

Hi,

It has been a while since there was an updaste but there it is. The most 
significant 'changes' are:


- more automatic adaption to double sided page properties in metafun 
(lmtx) ... blame sreeram and me for messing up


- more extensibve support for indic fonts which sreeram has documented 
on the wiki (fonts, translutaration etc)


and

- improved math rendering to be documented by by mikael in an upcoming 
manual ... it tooks a couple of months so it is supposed to have some 
impact.


before we move on the the structural compoments and see what can be done 
beter there, we decided to release the first stage that deals with:


= fixing font properties; we don't expect fonts to be improved so that's 
the route we follow


= extensive inter atom spacing (we have many more math classes, some in 
the engine, some in context) and everything can be controlled (the old 
pairwise spacing primitives have been replaced by a more general 
mechanism, including support for fast setup of categories and inhertance 
from other classes)


= idem for inter class penalties, including granular control over line 
breaks using a system of (in/de)creasing penalties


= auto-fenced inline material across lines and linebreaks in molecules 
(read: complex atoms)


= taking stretch and shrink in encapsulated atoms into account in 
linbreaks (using some new box related mechanism that is also available 
in text and will be explained later)


= spacing at the edges that should not be there but always was there as 
side effect of the engine is now removed; as with other new features 
this can be controlled (we have rulesets for atoms to which we can add 
more in the future)


= more detailed control over (skewed) fractions, (flattened) accents, 
(sized) fences, radicals ... there was already a lot there but it now 
combines with mentioned spacing (when relevant the context macros have 
been adapted to control this which is a bit cleaner)


= we have a new built in muskip (tiny) but as we have an inheritance 
system as well as binding to variables one can set up extensive spacing 
models register and constant binding; the currently set values are based 
on math typesetting references; in the future we might have additional ones


= although we did handle primes already rather transparent in mkiv / 
lmtx, inconsistency in fonts made us decide to make primes first class 
properties of atoms and molecules which means that we now have: pre 
super/subscripts, post super/subscripts and primes; this permits nicer 
anchoring under parameter control


= there are more font parameters to control matters (they are not in 
open type but we sort of assume they are); the options that we had to 
control how the engine deals with fonts are now driving the process 
(without them being set not much is applied) and we basically assume 
open type fonts (where one can enable engine options for those kind of 
fonts but also for traditional); some experimental options for testing 
are gone


= in the process tracing for what is done in math by the engine has been 
extended (mostly for ourselves)


= instead of auto patching math fonts most is now under control of the 
goodie files; user can (as usual) make their own, but also ask Mikael to 
add missing bits and pieces (wrt dimensions)


= most known math fonts are dealt with but there are a few exceptions: 
we no longer consider asana to be useful (it doesn't pass our qa and 
needs too much patching); erewhon is also troublesome (dimensions, 
missing shaped) as is concrete (idem) so we decided not to waste too 
much time on them now


= we probably need to freeze math fonts in the distribution and only 
update when we know what has been changed


= we got rid of quite some artifacts that normally go unnoticed (like 
tiny added spaces that result from always applied spacing even if not 
needed and/or to compensate for glyph features like too much or little 
side bearing): by fixing inconsistencies in fonts we could get rid of 
all and therefore inter atom spacing is what does the job; once you know 
it, you see it and there is no going back


= because we zoom in we notice these things but much went unnoticed (or 
was just accepted) for years; it means that we think some of the things 
we did qualify as math micro typography (like it or not) and it does 
mean that documents can render differently (unlikely for display, 
propably also for inline unless you have plenty of math in a paragraph)


== our objective has been to make it easier for users and to get rid of 
explicit spacing; for that we also introduced commands for differentials 
(that have their own class), imaginary numbers (also have their class) 
and we added exponential as class; fwiw, digits and factorial are 
classes too so again spacing has been optimized for them


= whatever i forgot in the meantime mikael will add to this list

There is a rough description in the 'ontarget' document. We hope you 
enjoy it, at least we did (and so, 

Re: [NTG-context] help with facing page image

2022-03-11 Thread Wolfgang Schuster via ntg-context

jbf schrieb am 09.03.2022 um 23:02:
Am endeavouring to explore Wolfgang's very 'elegant' solution to this 
facing page challenge. The exploration has included a look at 
base/mkxl/page-inj.mklx (thanks Sreeram for reminding me of this) 
where I see immediately that the approach is experimental and where it 
says also that 'probably more alternatives will be added'. I wonder if 
that last phrase also includes the ability to manipulate the image(s) 
either generally or in individual cases?


Keep your expectations low. I wrote the code (with some changes from 
Hans) to include full page images in novels and the code hasn't changed 
much since 2013.


So, for example., say I need (and in fact I do!) to change some aspect 
of individual images, e.g. I might want to scale=500, or fiddle with 
width/height of a particular image. At the moment I cannot see a way 
of doing this for each image. I wondered if the commented out setups 
in the response to this question might be a clue, but so far haven't 
been able to get that to have any effect.


You have to use a custom alternative (see below) to place the image on 
the page because the default alternative scales the image to fit on the 
available space. The best solution to change orientation, size etc. of 
the included images is to use the \useexternalfigure command and make 
all changes in the style file.



\definepageinjectionalternative
  [chapter:image]
  [renderingsetup=pageinjection:chapter:image]

\startsetups [pageinjection:chapter:image]
  \centerbox{\externalfigure[\dummyparameter{name}]}
\stopsetups

\definepageinjection
  [chapter:start]
  [empty]
  [page=left]

\definepageinjection
  [chapter:insert]
  [previouspage]
  [alternative=chapter:image,
   offset=1cm,
   pagestate=stop]

\setuphead
  [chapter]
  [beforesection={\pageinjection[chapter:start]},
insidesection={\pageinjection[chapter:insert][name={chapter-\namedheadnumber{chapter}}]}]

\setuppagenumbering
  [alternative=doublesided]

\setupexternalfigures
  [location=default]

\useexternalfigure [chapter-1] [mill]   [factor=max]
\useexternalfigure [chapter-2] [hacker] [orientation=90,scale=2000]
\useexternalfigure [chapter-3] [cow] [orientation=90,height=\framedwidth]

\starttext

\startchapter [title={Mill}]
\dorecurse{7}{\samplefile{lorem}}
\stopchapter

\startchapter [title={Hacker}]
\dorecurse{11}{\samplefile{lorem}}
\stopchapter

\startchapter [title={cow}]
\dorecurse{7}{\samplefile{lorem}}
\stopchapter

\stoptext

Wolfgang

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