ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster via ntg-context <ntg-context@ntg.nl>
To: jbf <roma83537@gmail.com>
Cc: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>,
	mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: help with facing page image
Date: Fri, 11 Mar 2022 13:36:16 +0100	[thread overview]
Message-ID: <8a45a609-3c86-0e89-5a67-98d70773a949@gmail.com> (raw)
In-Reply-To: <fdccb785-2c71-1ff2-0af8-6c3a4bbfa295@gmail.com>

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
___________________________________________________________________________________

  parent reply	other threads:[~2022-03-11 12:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-07  3:49 jbf via ntg-context
2022-03-07  5:38 ` śrīrāma via ntg-context
2022-03-07  5:41   ` śrīrāma via ntg-context
2022-03-07  6:20   ` jbf via ntg-context
2022-03-07  7:01     ` śrīrāma via ntg-context
2022-03-07  8:27       ` jbf via ntg-context
2022-03-07 18:35         ` Wolfgang Schuster via ntg-context
2022-03-08  2:51           ` śrīrāma via ntg-context
2022-03-08  3:46             ` śrīrāma via ntg-context
2022-03-09 22:02           ` jbf via ntg-context
2022-03-10  5:35             ` Aditya Mahajan via ntg-context
2022-03-10  5:48               ` jbf via ntg-context
2022-03-10  6:51             ` śrīrāma via ntg-context
2022-03-10  8:49               ` jbf via ntg-context
2022-03-11 12:36             ` Wolfgang Schuster via ntg-context [this message]
2022-03-11 23:50               ` jbf via ntg-context
2022-03-08  0:52       ` jbf via ntg-context
2022-03-07 20:08 ` Bruce Horrocks via ntg-context
2022-03-07 20:23   ` Henning Hraban Ramm via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8a45a609-3c86-0e89-5a67-98d70773a949@gmail.com \
    --to=ntg-context@ntg.nl \
    --cc=roma83537@gmail.com \
    --cc=wolfgang.schuster.lists@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).