4

When starting new chapters on right-hand side, it would better make the previous page empty (no footer and header). This can be done by defining a new pagebreak and setup head,

\setuppagenumbering[alternative=doublesided]
\definepagebreak[chapterpagebreak][yes,header,footer,right]
\setuphead[chapter][page=chapterpagebreak]

\starttext
\startfrontmatter
\title{Preface}
\completecontent
\stopfrontmatter
\startbodymatter
\chapter{First Chapter}
\stopbodymatter
\startbackmatter
\chapter{Backmatter}
\stopbackmatter
\stoptext

But the page just before chapter First Chapter in the bodymatter will not empty, according to the wiki, we should add some setups

\setupsectionblock[frontpart][page=]
\setupsectionblock[bodypart] [page=]
\setupsectionblock[backpart] [page=]

After this, a empty page will be produced just before chapter First Chapter in the bodymatter and chapter Backmatter in the backmatter area. This method will not a perfect one, since pages in frontmatter should be numbered in lower-case Roman numerals and Arabic numerals in bodymatter. That is to say

\definestructureconversionset[frontpart:pagenumber][][romannumerals]
\definestructureconversionset[bodypart:pagenumber][][numbers] 

For this requirment, the method won't work well. Maybe another method is that when the number of the last page located in the frontmatter is even, insert an empty page by using \page[yes,empty,odd]. Same with bodymatter and backmatter.

\def\emptyoddpage{%
  \ifodd\pagenumber
    \page[yes,empty,odd]
  \fi}

Anyone has other method to solve this problem? I think this method is from plain-TeX rather than ConTeXt, so I am expecting a ConTeXt method.


Edit: maybe what I said is unclear, let me write the codes

% the method from wiki
\setuppagenumbering[alternative=doublesided]
\definepagebreak[chapterpagebreak][yes,header,footer,right]
\setuphead[chapter][page=chapterpagebreak]

\definestructureconversionset[frontpart:pagenumber][][romannumerals]
\definestructureconversionset[bodypart:pagenumber][][numbers] 

\startsectionblockenvironment[bodypart]
\setcounter[userpage][1]
\stopsectionblockenvironment

\setupsectionblock[frontpart][page=]
\setupsectionblock[bodypart] [page=]
\setupsectionblock[backpart] [page=]

\starttext
\startfrontmatter
\title{Preface}
\completecontent
\stopfrontmatter
\startbodymatter
\chapter{First Chapter}
\stopbodymatter
\startbackmatter
\chapter{Backmatter}
\stopbackmatter
\stoptext

This code is not perfect because the page number of the Contents is Arabic numeral 1 rather that iii! So, I should deal with this problem by define a macro

% another method
\setuppagenumbering[alternative=doublesided]
\definepagebreak[chapterpagebreak][yes,header,footer,right]
\setuphead[chapter][page=chapterpagebreak]

\definestructureconversionset[frontpart:pagenumber][][romannumerals]
\definestructureconversionset[bodypart:pagenumber][][numbers] 

\startsectionblockenvironment[bodypart]
\setcounter[userpage][1]
\stopsectionblockenvironment

%\setupsectionblock[frontpart][page=]
%\setupsectionblock[bodypart] [page=]
%\setupsectionblock[backpart] [page=]

\def\emptyoddpage{%
  \ifodd\pagenumber
    \page[yes,empty,odd]
  \fi}

\starttext
\startfrontmatter
\title{Preface}
\completecontent
\emptyoddpage
\stopfrontmatter
\startbodymatter
\chapter{First Chapter}
\emptyoddpage
\stopbodymatter
\startbackmatter
\chapter{Backmatter}
\emptyoddpage
\stopbackmatter
\stoptext

What I want to ask is that if I don't define the \emptyoddpage(that's too plain-TeX), can have a ConTeXt way to solve this problem?

3
  • It's unclear to me what the actual problem is. I ran your code and I get roman page numbers in the front part, arabic ones for the body part and an empty page followed by a new chapter.
    – Marco
    Commented Apr 17, 2013 at 12:33
  • @Marco I have edited this question. Maybe it is clear now.
    – yanpengl
    Commented Apr 17, 2013 at 13:08
  • Can anyone explain how a mere definition of a pagebreak removes the headers/footers on the pages before chapters?
    – Silverspur
    Commented Dec 17, 2017 at 12:46

1 Answer 1

4

Set page=yes in the front part section block. Then the page number for the table of contents will be printed in roman numerals and continue the numbering so it becomes iii.

\setupsectionblock
  [frontpart]
  [page=yes]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .