ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Page headers & drop capitals not working but pagenumbering is
@ 2010-04-20 15:58 Tom
  0 siblings, 0 replies; only message in thread
From: Tom @ 2010-04-20 15:58 UTC (permalink / raw)
  To: ntg-context

The following code numbers the pages as I desired and the TOC lists those
page numbers. However, it is not doing two things as I desire and would
appreciate it if someone could indicate precisely which lines of code need
to be corrected.

In the front matter, page headers should be on the recto of the TOC (page
vi) and pages 2 and 3 of the introduction. Page headers seem to be operating
correctly in the body of the book.

\placeinitial is not creating drop capitals on the first page of each
chapter in the body of the text.

Example code follows:


%figure on left - chapter number and title on right
\def\MyChapterCommandM#1#2% #1 is number, #2 is text
   {\startfiguretext[left]{none}
     {\externalfigure[flowers][width=.2\textwidth]}
     {\framed[frame=off,align=middle,width=broad]
     {\switchtobodyfont[15pt] #1\\\blank[small] #2}}
    \stopfiguretext}

%no figure on left - chapter number and title on right
\def\MyFrontMatterCommand#1#2% #1 is number, #2 is text
     {\framed[frame=off,align=middle,width=broad]
     {\switchtobodyfont[15pt] #1\\\blank[small] #2}}

%eliminate headers on blank page at end of chapter
\definepagebreak[mychapterpagebreak][yes,header,right]

%put pagenumber on bottom of first page of chapter
\definetext[chapter][footer][pagenumber]
\setuphead[chapter][header=high,footer=chapter,page=mychapterpagebreak]
\setuphead[title][header=high,footer=chapter,page=mychapterpagebreak]

%turn off putting naked page numbers on pages
\setuppagenumbering[location=]

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

\startsectionblockenvironment[frontpart]

\setuphead[title]
 [command=\MyFrontMatterCommand,textstyle=\ss\bf,number=no,
  header=empty,footer=chapter,page=mychapterpagebreak,
  after=\vskip 0.5in]
 
\setuphead[chapter]
 [command=\MyFrontMatterCommand,textstyle=\ss\bf,number=no,
  header=empty,footer=chapter,page=mychapterpagebreak,
  numbercommand=\ss\bf\em\tfd,after=\vskip 0.5in,before=\vskip 1.0in
 \placeinitial  %comment out this line to eliminate drop capitals
] 

\setupheadertexts[chapter]
[chapter][pagenumber][pagenumber][chapter Example]

\setupheadertexts[title]
[title][pagenumber][pagenumber][title]

\setuppagenumbering[alternative=doublesided]

%\setupheader[state=stop]

\stopsectionblockenvironment

\startsectionblockenvironment[bodypart]
\setuppagenumbering[alternative=doublesided]
\setupheadertexts
[chapter][pagenumber][pagenumber][Content Example]

\setuphead[chapter]
 [command=\MyChapterCommandM,textstyle=\ss\bf,
  header=empty,footer=chapter,page=mychapterpagebreak,
  numbercommand=\ss\bf\em\tfd,after=\vskip 0.5in,before=\vskip
1.0in\placeinitial]  

%comment out this line to eliminate drop capitals
 

\stopsectionblockenvironment

\startsectionblockenvironment[appendix]

\setupsectionblock[appendix][page=appendicespagebreak] 

\stopsectionblockenvironment

\starttext 

\startfrontmatter

Some random text to occupy front matter pages.

\blank[medium]

\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\page[right]

\setuppagenumbering[state=start,alternative=doublesided,conversion=romannume
rals,location=]
\setupheader[state=start]

\title{Contents}

\placecontent[alternative=c,criterium=all]

\blank[medium]
Random text added to push TOC onto a second page to test page headers.
\blank[medium]

\input knuth
\input knuth
\input knuth
\input knuth

\chapter{Preface}
\input knuth
\page[right]

%switch from lower case Roman numerals to Arabic numbers
\setuppagenumbering[state=start,alternative=doublesided,conversion=numbers]
\setuppagenumber[state=start,number=1]

\setuphead[chapter]
 [command=\MyChapterCommandM,textstyle=\ss\bf,number=no,
  header=empty,footer=chapter,page=mychapterpagebreak,
  numbercommand=\ss\bf\em\tfd,after=\vskip 0.5in,before=\vskip 1.0in
 \placeinitial  %comment out this line to eliminate drop capitals
] 

\chapter{Introduction}
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth


\stopfrontmatter

\startbodymatter

\chapter{Chapter One}
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth

\chapter{Chapter Two}
\input knuth

\chapter{Chapter Three}
\input knuth

\page
\stopbodymatter

\startappendices

\stopappendices
\page[stop]

\stoptext







Tom Benjey
717-258-9733 voice
717-243-0074 fax
Twitter: @TomBenjey






___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-04-20 15:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-20 15:58 Page headers & drop capitals not working but pagenumbering is Tom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).