ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Michael Goerz <goerz@physik.fu-berlin.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: varying headers, footers, page numbers
Date: Tue, 24 Aug 2010 19:28:31 -0400	[thread overview]
Message-ID: <AANLkTimCueTNciGDuG07=RxwrqLSnJ1PUe7R5wvfqBBR@mail.gmail.com> (raw)
In-Reply-To: <AANLkTi=Zh4UyVqkswq7n_FiNZOCBbUudCSxKK5297YE9@mail.gmail.com>

On Tue, Aug 24, 2010 at 6:01 PM, Michael Goerz
<goerz@physik.fu-berlin.de> wrote:
> I'm trying to create a book where the front matter has no
> headers/footers, except roman numeral page numbers at the top outside of the
> page. The main matter should have Arabic numeral page numbers
> (restarting with '1') at the top outside of each page, plus the name of
> the book in the header of each even page and the name of the chapter in
> the header of each odd page, with no footer. However, on the pages
> where a new chapter starts (which is set to always be an odd page),
> there should be no header, and the page number should appear centered
> at the bottom of the page.
>
> I'm quite confused about how to achieve this in ConTeXt.
>
> An excerpt from the project structure is
>   ./env.tex
>   ./project.tex
>   ./book/book.tex
>   ./book/chapters/chapter1.tex
>
> The following is a shortened excerpt from book.tex:
>   \startfrontmatter
>   \setuppagenumbering[state=stop] % nothing for now, should be roman page
>                                   % numbers later
>   \component book/frontmatter
>   % ToC ...
>   \stopfrontmatter
>
>   \startbodymatter
>   \setuppagenumber[number=1]
>   \setupheadertexts
>       [{Name of Chapter}]           [{}]
>       [{}]                          [{Name of Book}]
>   \setuppagenumbering[
>   alternative=doublesided,   % mirrored even/odd pages
>   location={header,margin},
>   style=small]
>   \component vol04_1/articles/azimov
>   \stopbodymatter
> This leads to my first question: I generally try to keep all formatting
> definitions in env.tex. However, it seems to me that since I want to have
> different settings in the frontmatter compared to the mainmatter, I need to put
> the \setuppagenumbering and \setupheadertexts in book.tex, which slightly
> bothers me. The way I intuitively feel it should work is that I would define
> various headertexts and pagenumberings under some label in env.tex, and then
> activate the different configurations in book.tex via that label. Is there
> anything in ConTeXt that I may have overlooked that makes something like that
> (centrally defining several alternative header/footer/pagenumber
> configurations) possible?
>
> Next, the problem of having a different header/footer/pagenumber on pages where
> a new chapter starts. In env.tex, I have
>
>   \setuphead[chapter][
>       page=mychapterpagebreak,
>       number=no,
>       alternative=c,
>       align={center, nothyphenated, verytolerant},
>       style={\switchtobodyfont[16pt]},
>       header=high,
>       footer=none,
>   ]
>
> This causes the chapter pages to have no header/footer/pagenumber at all, which
> is halfway what I want. But actually, I don't really understands why that works
> either. My understanding is that "header=high" means there should be no header
> on the first page and the normal header on all subsequent pages. The way I've
> set it up though, the page number is not really part of the header (it's
> separately set up through \setuppagenumbering). So why does the page number
> disappear as well? And, of course, the main question: How do I get the page
> number centered in the bottom of that page? Again, I feel if there was some way
> to define different configurations for the header/footer/pagenumbers under
> different labels, e.g. a label 'chapterfooter', it would then make sense to do
> something like 'footer=chapterfooter', instead of 'footer=none'. But I guess
> that's not the way it works -- so how *does* it work?
Digging deeper in the reference manual, it seems that
    \definetext[chapter][footer][pagenumber]
together with
    \setuphead[chapter][
        page=mychapterpagebreak,
        number=no,
        alternative=c,
        align={center, nothyphenated, verytolerant},
        style={\switchtobodyfont[16pt]},
        header=high,
        footer=chapter,
    ]
is the answer.

Do I understand it correctly that
    \definetext[chapter][footer]...
is exactly the same as
    \setupfootertext...
but with the extra label "chapter"? So that would be exactly what my
intuition said should exist.

Can I only use the "chapter" label inside of \setuphead, like in the
above example, or could I also somehow use \definetext to setup
different headers/footers for the frontmatter/mainmatter, for example?

Thanks,
Michael
___________________________________________________________________________________
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:[~2010-08-24 23:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-24 22:01 Michael Goerz
2010-08-24 23:28 ` Michael Goerz [this message]

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='AANLkTimCueTNciGDuG07=RxwrqLSnJ1PUe7R5wvfqBBR@mail.gmail.com' \
    --to=goerz@physik.fu-berlin.de \
    --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).