ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Peter Rolf <indiego@gmx.net>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: standardmakeup, frontmatter, bodymatter & page numbering
Date: Wed, 03 Oct 2007 20:51:24 +0200	[thread overview]
Message-ID: <4703E4AC.8000006@gmx.net> (raw)
In-Reply-To: <6faad9f00710031033j555b7609pb9ff2caa08ddf26f@mail.gmail.com>

Mojca Miklavec schrieb:
> On 10/3/07, Peter Rolf <indiego@gmx.net> wrote:
>> Mojca Miklavec schrieb:
>>> Hello,
>>>
>>> I have a document consisting of title page, some introduction which
>>> should have pages numbered with roman numerals, and finally the real
>>> content
>>>
>>> \setuphead[subject][page=odd,style=\ss\bfb]
>>> \setuppagenumbering[location=]
>>>
>>> \starttext
>>> \startstandardmakeup
>>> title page
>>> \stopstandardmakeup
>>>
>>> \startfrontmatter
>>> \setuppagenumbering[conversion=romannumerals]
>>> \setupfootertexts[page \pagenumber{}]
>>> \subject{some intro pages}
>>> \input tufte
>>> \stopfrontmatter
>>>
>>> \startbodymatter
>>> \setupfootertexts[page \pagenumber{} of \totalnumberofpages]
>>> \dorecurse{10}{\subject{real content} \dorecurse{\recurselevel}{\input knuth} }
>>> \stopbodymatter
>>>
>>> \stoptext
>>>
>>> Now the problems:
>>> 1.) The second page starts counting at 1, while counting should start
>>> at page 3. This can be solved by using another
>>> \startstandardmakeup\strut\stopstandardmakeup.
>>>
>>> 2.) The last page says "page 26 of 27" - the total page number is
>>> indeed 27, but counting started on the second page, so it never
>>> reaches the last number.
>>>
>>> 3.) I would like the page number on the first page of bodymatter to be
>>> "page 1 of 23" instead of "page 4 of 27", and the last one to ge "page
>>> 23 of 23" instead of "page 26 of 27"
>>>
>>> There is some way=bychapter setting for page numering, but in that
>>> case there are no suitable chapters/sections available.
>>>
>>> Any hints appreciated ...
>>>
>> Hi Mojca,
>>
>> see
>> http://www.pragma-ade.com/general/magazines/mag-0002.pdf
>>
>> (Page ranges) for the details.
> 
> Thanks a lot for the pointer. But the following example fails:
> 
> \setuppagenumbering
> 	[location=]
> \setupsubpagenumber
> 	[state=start]
> \setupfootertexts
> 	[page \subpageno{} of \nofsubpages]
> 
> \starttext
> 	abc
> \stoptext
> 
> ! Missing number, treated as zero.
> <to be read again>
>                    {
> <argument> page \subpageno {
>                             } of \nofsubpages {}{}{}
> \firstoftwoarguments #1#2->#1
> 
> \doattributes ...sname #1#2\@EA \endcsname \fi {#4
>                                                   }\dostopattributes
> \dosingletexts ...atetexts {#1#2#5}{#6{}{}{}}}}}}}
>                                                   \egroup
> <argument> ...tk \v!footer \v!text \c!middletext }
>                                                   \hss }\hskip -\makeupwidth...
> ...
> l.11 \stoptext
>
I guess the standard activation of that mechanism is 'bychapter', so
there is no initialisation (withount a \chapter). If you use
"way=bytext" it should (hopefully) work.


This is taken from my letter environment. It's from 2003 and I don't
remember any details...


\def\MySubpagerange#1{%
  \ifnum\nofsubpages>1
    \ifnum\numexpr\subpageno+1\relax<\nofsubpages
     {\ss\tfx\the\numexpr\subpageno+1\relax\,-\,\nofsubpages}
    \else
      \ifnum\numexpr\subpageno+1\relax=\nofsubpages\relax
        {\ss\tfx\nofsubpages}\fi
    \fi
  \fi
}

% show subpagenumber in the right footer margin, if more than one page
is used
\setuppagenumbering[
   location={footer,margin},
   command=\MySubpagerange,
  ]

\setupsubpagenumber[way=bytext]

% show (sub)pagenumber in header ( no pagenumber at page 1)
\setupheadertexts[{\ifnum\subpageno>1 \the\subpageno\fi}]
\setupheader[style=small, state=high]


> Plus, I don't know how to instruct "way=by..." to reset the counter at
> the boundary of frontmatter/bodymatter
>
It's only a counter, so (if there is no parameter support for your
environment) you are free to reset it whenever you want.
Just add some code to the 'before|after' parameter of front|bodymatter.

HTH, Peter


> Thanks a lot,
>     Mojca
> ___________________________________________________________________________________
> 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  : https://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
> 

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2007-10-03 18:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-02 23:36 Mojca Miklavec
2007-10-03 10:54 ` Peter Rolf
2007-10-03 17:33   ` Mojca Miklavec
2007-10-03 18:51     ` Peter Rolf [this message]
2007-11-29 19:14 ` Wolfgang Schuster
2007-12-07 16:29   ` Mojca Miklavec
2007-12-08 12:09     ` Wolfgang Schuster
2008-06-01 18:25   ` Specifying last page when using imposition John Devereux
2008-06-02  6:06     ` Wolfgang Schuster
2008-06-02  8:11       ` John Devereux
2008-06-02  8:22         ` Wolfgang Schuster
2008-06-02  8:44           ` Wolfgang Schuster
2008-06-02  9:33             ` John Devereux
2008-06-02  9:59               ` Wolfgang Schuster

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=4703E4AC.8000006@gmx.net \
    --to=indiego@gmx.net \
    --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).