On Sun, 26 Jun 2011, Kip Warner wrote:

Hey folks,

I'm having difficulty getting an external image to display on its own
page, with the page in landscape mode, and the image uniformly scaled as
large as can fit on that page.

Relevant portions of my environment file include...

\setuplayout[....]
\definelayout[fullpage][....]

\definepapersize[main][A4][A4]
\definepapersize[diagram][A4,landscape][A4,landscape]

And the actual image in my component is here:


You don't switch layout to fullpage!

\page
\setuppapersize[diagram]
\placefigure
   [force][figure:MyImage]
   {My image caption.}
   {\externalfigure[MyImage][factor=max]}
\page
\setuppapersize[main]

Here is a complete working example:

\unprotect
\setuplayout
  [\c!location=\v!middle,
   \c!style=\ss,
   \c!backspace=2.5cm,
   \c!topspace=1.5cm,
   \c!width=16cm,
   \c!margindistance=.25cm,
   \c!margin=2.5cm,
   \c!height=\v!middle]

\definelayout
  [fullpage]
  [\c!backspace=0pt,
   \c!topspace=0pt,
   \c!width=\v!middle,
   \c!height=\v!middle,
   \c!header=0pt,
   \c!footer=0pt]
\protect

\definepapersize[main][A4][A4]
\definepapersize[diagram][A4,landscape][A4,landscape]

\starttext

And the actual image in my component is here:

\page \setuppapersize[diagram]
\setuplayout[fullpage]
\placefigure
    [force][figure:MyImage]
    {My image caption.}
    {\externalfigure[cow][factor=max]}

\page
\setuppapersize[main]
\setuplayout[reset]

The document is all in portrait mode, save the page with the figure
which is landscaped, as intended. But the image sits only occupying the
top left quarter of the page. I've tried changing factor from max to
broad and fit, and to no avail.

\stoptext

@Hans: Does it make sense to modify \adaptlayout so that it will also accept pre-defined layout. So that we could use:

    \page
    \adaptpapersize[diagram]
    \adaptlayout[fullpage]


Current, \adaptlayout only accepts key-values.

Aditya
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to