# Figures/Floats and Section Headings on New Pages in ConTeXt?

I'm still trying to implement a complex book layout in ConTeXt... and I'm beginning to wonder, why in so many cases the descriptions in the manual or on the website don't seem to match the actual implementation.

In a nutshell, here's what I would like to achieve:

• Set up a custom section heading that always starts on a right page.
• Set up a custom float (figure) that completely fills the left page next to the section heading.

And here's what I'm able to achieve:

Here's the MWE:

\mainlanguage[de]
\language[de]
\definecolor[lightbrown] [r=0.83, g=0.76, b=0.71]

\setuppapersize[A4][A4]
\setuplayout
[
backspace=11.67mm,        width=131.25mm,
topspace=21.21mm,         height=254.57mm,
headerdistance=13pt,      header=13pt,
footerdistance=13pt,      footer=13pt,
rightmargindistance=13pt, rightmargin=39.5mm,
]

\setuppagenumbering[alternative=doublesided, location=]

\definehead[PageSection][section]
\setuphead[PageSection][
page=right,
style=\ssb\bf,
]

\definefloat[pagefloat][pagefloats][figure]
\setupfloat[pagefloat][
location=inner,
]

\starttext

\chapter{Testing Full Page Figures}

\input{knuth}

\input{knuth}

\input{knuth}

\placepagefloat[rightpage]{Test}{\framed[width=\paperwidth, height=\paperheight, background=color, backgroundcolor=lightbrown]{Here's a figure}}

\PageSection{Here's a Section on a New Page}

\input{knuth}

\input{knuth}

\input{knuth}

\stoptext


As can be seen, the figure that is supposed to fill the page is positioned incorrectly. And for the life of me I can't seem to find a way to get that right. location=inner is the closest I got, so far.

Also, I wonder, why leftpage and rightpage (in \placepagefloat) have the exact opposite effect? (Note that I used rightpage to have the float appear on the left page.) By the way, opposite doesn't seem to work at all; instead, the float disappears from the document. What am I missing?

Note also that I tried to use page=right in \definehead to have my custom section appear on a right page, but that setting is completely ignored. It only works, if I replace \definehead[PageSection][section] by \definehead[PageSection][subsection].

I am confused. Any help would be much appreciated.

## Question about page break

This is an "old feature".

If the head parameter continue is set to yes (which is the default), there are no page breaks if a the current section head comes after a higher level section head (i.e., the value of page is ignored). To avoid this, set continue=no.

\setuppagenumbering[alternative=doublesided, location=]

\definehead[PageSection][section]
\setuphead[PageSection]
[
page=right,
continue=no,
style=\ssb\bf,
]

\starttext

\chapter{Testing Full Page Figures}

\dorecurse{3}{\input{knuth}}

\PageSection{Here's a Section on a New Page}

\dorecurse{3}{\input{knuth}}

\stoptext


I don't quite understand why continue=yes exists. My guess is that it allows you do to create an environment to be used with both books (where the chapter is the top level heading) and reports (where section is the top level heading). For example, if I create an environment file:

\startenvironment *

\setuphead[chapter][page=right]
\setuphead[section][page=yes,continue=yes]

\stopenvironment


and the use the same environment in both a book:

\environment env

\starttext
\chapter{Chap One}
\section{Sec One}
\input knuth
\chapter{Chap Two}
\section{Sec Two}
\input knuth
\stoptext


and a report

\environment env

\starttext
\section{Sec One}
\subsection{Subsec One}
\input knuth
\section{Sec Two}
\subsection{Subsec Two}
\input knuth
\stoptext


Note that there are no page breaks before the section in a book but there are page breaks before a section in a report.

## Question about leftpage and rightpage

Using context 2016.10.07, I get correct location of the float using the keys leftpage and rightpage. Which version of ConTeXt are you using (see the output of context --version)?

## Question about full page float

One possibility is to use the bleed mechanism (see the details manual).

\setuppagenumbering[alternative=doublesided, location=]
\useMPlibrary[dum]
\starttext
\placefigure[leftpage,none]{}
{\bleed[width=\paperwidth,height=\paperheight,location=lt]
{\externalfigure[dummy][bleed]}}
\dorecurse{10}{\input{knuth}}
\stoptext


which gives the following:

• Ah, thanks, yes, that solved part of the problem. :) – Marcus C. Oct 20 '16 at 23:46
• @MarcusC.: See updated solution with more explanation. – Aditya Oct 20 '16 at 23:52
• Thank you very much for your help. Indeed, I still had a version from mid-2015 installed. After updating my installation to a more current version, \leftpageand \rightpage do what they're supposed to do. Also, the \bleed mechanism solved my problem with the full page figure. (I have to say I'm still a bit unsure how to achieve correct bleeding... you know, those 3mm that get cut away after the page has been printed... but that's another question :)). In short: Your answer perfectly solved my problems. Thanks again. – Marcus C. Oct 26 '16 at 11:04