2

Background

Looking to create a three-column document with images that fill entire pages, while the text has a different page layout. Both the images and the text pages should have the same total dimensions.

Output

Problem

The issue is that the image doesn't fill the entire page, even though the ratio of the page size (4:1) is the same as the image size (4:1), as shown here:

Cat columns

Code

A fairly minimal snippet to reproduce the problem:

\definepapersize[ImpactsPageSize][
  width=400mm,
  height=100mm,
]

\definelayout[ImpactsPageLayout][
  backspace=5mm,
  cutspace=5mm,
  width=390mm,
  height=85mm,
  topspace=5mm,
  header=0mm,
  footer=0mm,
]

\setuppapersize[ImpactsPageSize]
\setuplayout[ImpactsPageLayout]

\setuphead[chapter][
  header=empty,
  footer=empty,
  number=no,
  page=yes,
]

\setupexternalfigures[
  location={local,default,global},
  maxwidth=\makeupwidth,
  width=\makeupwidth,
]

\let\oldexternalfigure\externalfigure
\def\externalfigure[#1]{%
  \startTEXpage[width=\paperwidth,height=\paperheight,align=middle]
    \oldexternalfigure[#1][width=\paperwidth,height=\paperheight]%
  \stopTEXpage
}

\starttext
    \chapter[title={One}]

    \startcolumns[n=3]
        \input knuth
        \input knuth
        \input knuth
    \stopcolumns

    {\externalfigure[https://i.imgur.com/q1S0abK.jpg]}
\stoptext

Constraints

The externalfigure snippet is generated by pandoc and therefore must not be changed or altered in any way:

{\externalfigure[https://i.imgur.com/q1S0abK.jpg]}

Question

What do I need to change to make the image fill the full page independently of the page layout of the text pages? (That is, how do I eliminate the white borders shown in the example images while maintaining the image aspect ratio?)

4

Your document contains a maxwidth setting for all included graphic. When you have a image which is wider than this value it is scaled down to the maximum value.

The example below shows a case where this setup is useful to keep the width of the images limited.

\useMPlibrary [dum]

\setuppapersize [A6] [A5,landscape]

\setuparranging[2SIDE]

\showframe [text] [text]

\starttext

\externalfigure [a] [width=1.1\makeupwidth]

\page

\setupexternalfigures [maxwidth=\makeupwidth]

\externalfigure [b] [width=1.1\makeupwidth]

\stoptext

Example maxwidth limit

The wiki's layout page shows various ways that the makeupwidth can be calculated. Specifically:

\makeupwidth is normally same as \textwidth, but it can be different, for example in columns.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.