ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* image across 2 page spread
@ 2020-04-30  0:05 jbf
  2020-04-30  1:45 ` Thangalin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jbf @ 2020-04-30  0:05 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 1874 bytes --]

Hi list,

With 99% of work complete on a book, including single page images, I now 
find myself confronted with a final problem: how to run one image across 
facing pages or in other words, one image (plus its caption) across a 
two-page spread, such that there is no gap.

I have tried a number of fairly crass attempts (obviously too simple) to 
see if I could get somewhere near what I want, e.g.

\externalfigure[plate12.jpg][width=\paperwidth, height=.7\paperheight, 
frame=none] {\tfx \sc Plates 12, 13. \tfx Twenty trucks from the 
Netherlands setting off}

\externalfigure[plate13.jpg][width=\paperwidth, height=.7\paperheight, 
frame=none] {\tfx for their first mission amongst the German diaspora.}

My thinking here was that \paperwidth might help extend the image to the 
inner edge on the left-hand page, but it doesn't work that way for the 
right-hand page, since there it extends to the outer edge, not the inner 
edge! The .7\paperheight was to provide room for the caption. But all in 
all, this is no solution!

If it is any help, the setup dimensions for the book are US Digest:

\definepapersize
   [ACN][width=5.5in,height=8.5in] %  w140mm x h216mm

I then looked up how one might do it in LaTeX, and found the following 
link: 
https://tex.stackexchange.com/questions/23860/how-to-include-a-picture-over-two-pages-left-part-on-left-side-right-on-right

How much of that would be transferable to ConTeXt? (I am thinking 
particularly of the |\newcommand*{\twopagepicture}[4]| bit.

There are explanations for how to do this in InDesign, and since it is 
something someone might often want to do (e.g. in magazines), I also 
thought it might be easier to find reference to it on Contextgarden, yet 
haven't found anything there. But I am sure ConTeXt has a way to do this.

Could someone point me in the right direction with this please?

Julian

||


[-- Attachment #1.2: Type: text/html, Size: 7475 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: image across 2 page spread
  2020-04-30  0:05 image across 2 page spread jbf
@ 2020-04-30  1:45 ` Thangalin
  2020-04-30  9:11 ` Henning Hraban Ramm
  2020-04-30 10:02 ` Hans Hagen
  2 siblings, 0 replies; 4+ messages in thread
From: Thangalin @ 2020-04-30  1:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Would something like this work?

\setupbackgrounds[page][
  background={BookIllustrationLayer},
]

\definelayer[BookIllustrationLayer][
  width=\paperwidth,
  height=.5\paperheight,
  y=.5\paperheight,
  position=no,
  repeat=no,
]

  \setlayer[BookIllustrationLayer]{%
    \clip[x=\doifelseoddpage{2}{1}]{%
      \externalfigure[filename][
        width=2\paperwidth,
        height=.5\paperheight]%
    }%
  }%

On Wed, Apr 29, 2020 at 5:05 PM jbf <roma83537@gmail.com> wrote:
>
> Hi list,
>
> With 99% of work complete on a book, including single page images, I now find myself confronted with a final problem: how to run one image across facing pages or in other words, one image (plus its caption) across a two-page spread, such that there is no gap.
>
> I have tried a number of fairly crass attempts (obviously too simple) to see if I could get somewhere near what I want, e.g.
>
> \externalfigure[plate12.jpg][width=\paperwidth, height=.7\paperheight, frame=none] {\tfx \sc Plates 12, 13. \tfx Twenty trucks from the Netherlands setting off}
>
> \externalfigure[plate13.jpg][width=\paperwidth, height=.7\paperheight, frame=none] {\tfx for their first mission amongst the German diaspora.}
>
> My thinking here was that \paperwidth might help extend the image to the inner edge on the left-hand page, but it doesn't work that way for the right-hand page, since there it extends to the outer edge, not the inner edge! The .7\paperheight was to provide room for the caption. But all in all, this is no solution!
>
> If it is any help, the setup dimensions for the book are US Digest:
>
> \definepapersize
>   [ACN][width=5.5in,height=8.5in] %  w140mm x h216mm
>
> I then looked up how one might do it in LaTeX, and found the following link: https://tex.stackexchange.com/questions/23860/how-to-include-a-picture-over-two-pages-left-part-on-left-side-right-on-right
>
> How much of that would be transferable to ConTeXt? (I am thinking particularly of the \newcommand*{\twopagepicture}[4] bit.
>
> There are explanations for how to do this in InDesign, and since it is something someone might often want to do (e.g. in magazines), I also thought it might be easier to find reference to it on Contextgarden, yet haven't found anything there. But I am sure ConTeXt has a way to do this.
>
> Could someone point me in the right direction with this please?
>
> Julian
>
> ___________________________________________________________________________________
> 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: image across 2 page spread
  2020-04-30  0:05 image across 2 page spread jbf
  2020-04-30  1:45 ` Thangalin
@ 2020-04-30  9:11 ` Henning Hraban Ramm
  2020-04-30 10:02 ` Hans Hagen
  2 siblings, 0 replies; 4+ messages in thread
From: Henning Hraban Ramm @ 2020-04-30  9:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users



> Am 30.04.2020 um 02:05 schrieb jbf <roma83537@gmail.com>:
> 
> Hi list,
> 
> With 99% of work complete on a book, including single page images, I now find myself confronted with a final problem: how to run one image across facing pages or in other words, one image (plus its caption) across a two-page spread, such that there is no gap.

You need to use \clip and calculate the sections.
Thangalin already gave you an example. Here’s a convoluted one that I use:

% full double page image
% usage:
% \startpostponing[pagenumber]
% \doublepagefig[reference][left/right/width/height*]{caption}{filename}
% \stoppostponing
% * lw,lh,rw,rh - place as left/right page, adapt image to width/height
% default is lw
% postponing is important, otherwise the page numbering gets wrong

\newdimen\Bleed
\newdimen\maxWidth
\newdimen\maxHeight
\newdimen\doubleWidth
\newdimen\topOffset
\newdimen\bottomOffset

\Bleed=3mm
\setupbleeding[offset=\Bleed]
\maxWidth=\dimexpr\paperwidth + \Bleed\relax
\maxHeight=\dimexpr\paperheight + 2\Bleed\relax
\doubleWidth=\dimexpr2\maxWidth\relax
\topOffset=\dimexpr\topspace + \headerheight + \Bleed\relax
\bottomOffset=\dimexpr\bottomheight + \footerheight + \Bleed\relax

\definelayer[bgpicleft][x=-\Bleed,y=-\Bleed,width=\maxWidth,height=\maxHeight] % inkl. Beschnitt
\definelayer[bgpicright][x=0mm,y=-\Bleed,width=\maxWidth,height=\maxHeight] % inkl. Beschnitt

\definemakeup[fullpage][
  page=no,
  doublesided=no,
  headerstate=empty,
  footerstate=empty,
  pagestate=start,
]

\def\doublepagefig{\dodoubleempty\doDoublePagefig}
\def\doDoublePagefig[#1][#2]#3#4{
\startfullpagemakeup
	\setlayer[bgpicleft]{\textreference[#1]{}%
		\clip[
			hoffset=0mm, voffset=0mm,
			width=\maxWidth,
			height=\maxHeight,
		]{%
			\doifinstringelse{h}{#2}{%
				\externalfigure[#4][height=\maxHeight]%
			}{%
				\externalfigure[#4][width=\doubleWidth]%
			}%
		}%
	}
	% set caption into footer (left page)
  \doiftext{#3}{\doifinstring{l}{#2}{%
  	\setlayer[bgpicleft][
      x=\backspace,
      y=\dimexpr\makeupheight + \footerheight\relax,
    ]{%
      \doifmodeelse{blackcaption}{%
        \tfx\vbox{#3}%
      }{%
        \inframed[
        frame=off,background=shadow,
        foregroundcolor=captioncolor,]{%
          \bfx{#3}%\vbox{#3}%
        }%
      }%
    }%
	}}
	% debugging information
	\setlayer[bgpicleft][x=0mm,y=-\Bleed]{%
		\color[debugcolor]{~\tt\bfx #1 / #2 / #4}
	}
\stopfullpagemakeup
\startfullpagemakeup
	\setlayer[bgpicright]{%
		\clip[
			hoffset=\maxWidth,
			voffset=0mm,
			width=\maxWidth,
			height=\maxHeight,
		]{%
			\doifinstringelse{h}{#2}{%
				\externalfigure[#4][height=\maxHeight]%
			}{%
				\externalfigure[#4][width=\doubleWidth]%
			}%
		}%
	}
	% set caption into footer (right page)
  \doiftext{#3}{\doifinstring{r}{#2}{%
  	\setlayer[bgpicright][
      x=\backspace,
      y=\dimexpr\makeupheight + \footerheight\relax,
    ]{%
      \doifmodeelse{blackcaption}{%
        \tfx\vbox{#3}%
      }{%
        \inframed[
          frame=off,background=shadow,foregroundcolor=captioncolor]{%
          \bfx{#3}%\vbox{#3}%
        }%
      }%
    }%
	}}%
	% debugging information
	\setlayer[bgpicright][x=0mm,y=-\Bleed]{%
		\color[captioncolor]{~\tt\bfx #1 / #2 / #4}
	}
\stopfullpagemakeup
} % doublepagefig


You can see the outcome here:
https://www.dreiviertelhaus.de/architekturfuehrer/hicog/


Have fun,
Hraban

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: image across 2 page spread
  2020-04-30  0:05 image across 2 page spread jbf
  2020-04-30  1:45 ` Thangalin
  2020-04-30  9:11 ` Henning Hraban Ramm
@ 2020-04-30 10:02 ` Hans Hagen
  2 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2020-04-30 10:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users, jbf

On 4/30/2020 2:05 AM, jbf wrote:
> Hi list,
> 
> With 99% of work complete on a book, including single page images, I now 
> find myself confronted with a final problem: how to run one image across 
> facing pages or in other words, one image (plus its caption) across a 
> two-page spread, such that there is no gap.
> 
> I have tried a number of fairly crass attempts (obviously too simple) to 
> see if I could get somewhere near what I want, e.g.
> 
> \externalfigure[plate12.jpg][width=\paperwidth, height=.7\paperheight, 
> frame=none] {\tfx \sc Plates 12, 13. \tfx Twenty trucks from the 
> Netherlands setting off}
> 
> \externalfigure[plate13.jpg][width=\paperwidth, height=.7\paperheight, 
> frame=none] {\tfx for their first mission amongst the German diaspora.}
> 
> My thinking here was that \paperwidth might help extend the image to the 
> inner edge on the left-hand page, but it doesn't work that way for the 
> right-hand page, since there it extends to the outer edge, not the inner 
> edge! The .7\paperheight was to provide room for the caption. But all in 
> all, this is no solution!
> 
> If it is any help, the setup dimensions for the book are US Digest:
> 
> \definepapersize
>    [ACN][width=5.5in,height=8.5in] %  w140mm x h216mm
> 
> I then looked up how one might do it in LaTeX, and found the following 
> link: 
> https://tex.stackexchange.com/questions/23860/how-to-include-a-picture-over-two-pages-left-part-on-left-side-right-on-right
> 
> How much of that would be transferable to ConTeXt? (I am thinking 
> particularly of the |\newcommand*{\twopagepicture}[4]| bit.
> 
> There are explanations for how to do this in InDesign, and since it is 
> something someone might often want to do (e.g. in magazines), I also 
> thought it might be easier to find reference to it on Contextgarden, yet 
> haven't found anything there. But I am sure ConTeXt has a way to do this.
> 
> Could someone point me in the right direction with this please?
\setuppagenumbering
   [alternative=doublesided]

\starttext

\dorecurse{3}{\input tufte \par}

\startpostponing
     \setuppagenumbering[state=stop]
     \startspread
         \startplacefigure[location=here,title={This is a cow!}]
         \externalfigure[cow.pdf][height=\textheight]%
         \stopplacefigure
     \stopspread
     \setuppagenumbering[state=start]
\stoppostponing

\dorecurse{10}{\input tufte \par}

\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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-30 10:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30  0:05 image across 2 page spread jbf
2020-04-30  1:45 ` Thangalin
2020-04-30  9:11 ` Henning Hraban Ramm
2020-04-30 10:02 ` Hans Hagen

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).