# [NTG-context] Frontmatter page numbers and using ifodd / pageno

Scott Steele scottlsteele at gmail.com
Tue Jun 1 00:32:31 CEST 2010

With the page layout setups I'm using, the first table of contents entry on
each page (except for the first page) is formatted as if it were on the
preceding page. I assume that the page number is not advancing until some
number of objects are placed on the page. When I compiled the example
included below, it was the first three entries on each page (after the first
page) that were formatted as if they were on the previous page.

pages to enable different formatting by odd/even page number (which I
accomplish now by using \phantom as a style command for page numbering), but
I'd like for the page numbering of the body matter to start at 1.

Also, how can I number the front matter backward? Like: xi, x, ix, viii,
vii, vi, v, iv, iii, ii, i.

\def\SectionListEntry#1#2#3%
{
\noindent
\noexpand{\ifodd\pageno
\simplealignedbox{left}{.63667\textwidth}{#2}
\simplealignedbox{middle}{.06\textwidth}{·}
\simplealignedbox{right}{.30333\textwidth}{#3}
\else
\simplealignedbox{left}{.30333\textwidth}{#3}
\simplealignedbox{middle}{.06\textwidth}{·}
\simplealignedbox{right}{.63667\textwidth}{#2}
\fi}
\par\blank
}

\setuplist[section]
[alternative=command,
command=\SectionListEntry]

\def\TableOfContents%
{
\page[empty]
\page[odd]
\setuppagenumbering[style=command,
command=\phantom]
\setuppagenumber[state=start]
\placelist[section]
\setuppagenumber[state=stop]
\page[empty]
\page[odd]
}
\startfrontmatter
\TableOfContents
\stopfrontmatter

\startbodymatter
\setuppagenumber[state=start]
\dorecurse{45}{\section{Section title}\input tufte}
\stopbodymatter

Thanks,
Scott

-----
This is a work of ﬁction.  Names, characters, places, and incidents either
are the product of the writer's imagination or are used ﬁctitiously, and any