ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Tom" <Tom@tuxedo-press.com>
To: <ntg-context@ntg.nl>
Subject: Chapter Command causes ToC to not display correctly
Date: Mon, 14 Feb 2011 09:40:25 -0500	[thread overview]
Message-ID: <00a901cbcc55$1e662c10$5b328430$@com> (raw)

The code below seems to work fine when the first MyChapterCommand is
commented out and the second one is active. However, when the first one is
active and the second one is commented out, the ToC does not display
properly. What could be causing this to happen?

I know that the first MyChapterCommand is not appropriate and use an
appropriate on in the front matter environment for the actual book.

\definetypeface [mainface] [rm] [serif] [palatino]    [default]
\definetypeface [mainface] [ss] [sans]  [iwona-heavy] [default]
\definetypeface [mainface] [tt] [mono]  [modern]      [default]
\definetypeface [mainface] [mm] [math]  [palatino]    [default]

\definetypeface [pagenumber] [ss] [sans] [iwona-light] [default]

\definetypeface [dedication] [rm] [serif] [chancery] [default]

\setupbodyfont[mainface]

%\starthiding
%Chapter number only - not appropriate for frontmatter
\def\MyChapterCommand#1#2% #1 is number, #2 is text
  {\framed[frame=off,bottomframe=on,topframe=on]
     {\vbox{\centerline{ #1}}}} 
%\stophiding

\starthiding
%lines above and below chapter number and title
\def\MyChapterCommand#1#2% #1 is number, #2 is text
  {\framed[frame=off,bottomframe=on,topframe=on]
     {\vbox{\headtext{chapter} #1\blank#2}}} 
\stophiding

% headings

\definestartstop[dedication][style={\switchtobodyfont[dedication,20pt]},befo
re=\page]
\definehead [intro]     [chapter]

\setuphead[chapter][style=\ss\bfd,alternative=middle,
  command=\MyChapterCommand,
  header=empty,footer=chapter,
  after={\blank[0.5in]},before={\blank[force,1.0in]}
  \placeinitial]

\setuphead[intro][number=no]
\setuphead[dedication][incrementnumber=no]

\definecombinedlist [content][intro,chapter,section]

% pagenumbers

\setuppagenumbering
    [state=start,alternative=doublesided,conversion=numbers,location=]
\setupheadertexts
 [chapter][pagenumber][pagenumber][My Book Title]
\setupheader[style={\switchtobodyfont[pagenumber,20pt]\sl}]

%turn on indentation 
\setupindenting[yes,medium,next]

\starttext
\dedication{}
\startdedication
\startalignment[middle]
To someone who inspired or supported me. Let's see how this works for
dedications that span multiple lines.
\stopalignment
\stopdedication
\completecontent
\intro{Introduction - Ag}
\input knuth
\chapter{First chapter - Ag}
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\chapter{Second Chapter - Ag}
\input knuth
\stoptext



Tom Benjey
717-258-9733 voice
717-243-0074 fax
blog: www.TomBenjey.com





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


                 reply	other threads:[~2011-02-14 14:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='00a901cbcc55$1e662c10$5b328430$@com' \
    --to=tom@tuxedo-press.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).