Re: [NTG-context] standardmakeup, frontmatter, bodymatter & page numbering

2007-12-08 Thread Wolfgang Schuster
On Fri, 7 Dec 2007 17:29:36 +0100
"Mojca Miklavec" <[EMAIL PROTECTED]> wrote:

> On 11/29/07, Wolfgang Schuster <[EMAIL PROTECTED]> wrote:
> > On Wed, 3 Oct 2007 01:36:54 +0200
> > "Mojca Miklavec" <[EMAIL PROTECTED]> wrote:
> >
> > > 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 ...
> > >
> > > Thanks a lot,
> > > Mojca
> >
> > Hi Mojca,
> >
> > maybe I'm a little bit late with my answer
> 
> Hello Wolfgang,
> 
> I hardcoded the number when I needed it, but you proposal is very
> useful for the next time when I will need it again. I only need to
> figure out where to store it on the wiki/texshow, so that it will be
> possible to find it agin. (This still cannot handle the problem  if I
> wanted to number "last page of frontmatter", but I don't need it at
> the moment.)

I run into similiar problems for my letter module to reset the page
number for every letter in one document without reseting the global
pagenumber, I extend my example to use subpagenumber instead of global
numbers but I have a problem to get the right number in the table of
content because ConTeXt writes the gobal page number in the galley
files and ignores the subpagenumber.

\startcomponent structure

% setups

\setupsubpagenumber[way=bytext,state=start]
\setuppagenumbering[location=]

\startsectionblockenvironment[frontpart]
  %\setupfootertexts[\convertnumber{r}{\subpagenumber}]
  \setupfootertexts[pagenumber]
  \setuppagenumbering[conversion=romannumerals]
\stopsectionblockenvironment

\startsectionblockenvironment[bodypart]
  \setuppagenumber[number=1] % else global pagenumbers in the toc
  \resetsubpagenumber
  \setupfootertexts[page \subpagenumber{} of \numberofsubpages]
\stopsectionblockenvironment

\startsectionblockenvironment[backpart]
  \resetsubpagenumber
\stopsectionblockenvironment

% the real document

\startfrontmatter
\completecontent
\stopfrontmatter

\startbodymatter
\dorecurse{12}{\section{Knuth}\input knuth\par}
\stopbodymatter

\startbackmatter
I'm the last page, really?

This is true in latest the \CONTEXT\ for \LUATEX\ but not for \XETEX\
and \PDFTEX. \stopbackmatter

\stopcomponent

Wolfgang
___
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
___


Re: [NTG-context] standardmakeup, frontmatter, bodymatter & page numbering

2007-12-07 Thread Mojca Miklavec
On 11/29/07, Wolfgang Schuster <[EMAIL PROTECTED]> wrote:
> On Wed, 3 Oct 2007 01:36:54 +0200
> "Mojca Miklavec" <[EMAIL PROTECTED]> wrote:
>
> > 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 ...
> >
> > Thanks a lot,
> > Mojca
>
> Hi Mojca,
>
> maybe I'm a little bit late with my answer

Hello Wolfgang,

I hardcoded the number when I needed it, but you proposal is very
useful for the next time when I will need it again. I only need to
figure out where to store it on the wiki/texshow, so that it will be
possible to find it agin. (This still cannot handle the problem  if I
wanted to number "last page of frontmatter", but I don't need it at
the moment.)

> but I stumpled across this
> question after I was searching for something in the archive and I found
> the following solution.
>
> [...]
> \startbodymatter
> \page[odd] % only \page give a empty before the \section
> \setuppagenumber[number=1]
> \setupfootertexts[page \pagenumber{} of \lastpagenumber] % no \totalnumber...

Thanks a lot :)

> \dorecurse{10}{\subject{real content} \dorecurse{\recurselevel}{\input knuth} 
> }
> \stopbodymatter
> [...]

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
___


Re: [NTG-context] standardmakeup, frontmatter, bodymatter & page numbering

2007-12-01 Thread Wolfgang Schuster
On Wed, 3 Oct 2007 01:36:54 +0200
"Mojca Miklavec" <[EMAIL PROTECTED]> wrote:

> 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 ...
> 
> Thanks a lot,
> Mojca

Hi Mojca,

maybe I'm a little bit late with my answer but I stumpled across this
question after I was searching for something in the archive and I found
the following solution.

[...]
\startbodymatter
\page[odd] % only \page give a empty before the \section
\setuppagenumber[number=1]
\setupfootertexts[page \pagenumber{} of \lastpagenumber] % no \totalnumber...
\dorecurse{10}{\subject{real content} \dorecurse{\recurselevel}{\input knuth} }
\stopbodymatter
[...]

Wolfgang
___
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
___


Re: [NTG-context] standardmakeup, frontmatter, bodymatter & page numbering

2007-10-03 Thread Peter Rolf
Mojca Miklavec schrieb:
> On 10/3/07, Peter Rolf <[EMAIL PROTECTED]> 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.
> 
>{
>  page \subpageno {
> } of \nofsubpages {}{}{}
> \firstoftwoarguments #1#2->#1
> 
> \doattributes ...sname [EMAIL PROTECTED] \endcsname \fi {#4
>   }\dostopattributes
> \dosingletexts ...atetexts {#1#2#5}{#6{}{}{}}}
>   \egroup
>  ...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
___


Re: [NTG-context] standardmakeup, frontmatter, bodymatter & page numbering

2007-10-03 Thread Mojca Miklavec
On 10/3/07, Peter Rolf <[EMAIL PROTECTED]> 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.

   {
 page \subpageno {
} of \nofsubpages {}{}{}
\firstoftwoarguments #1#2->#1

\doattributes ...sname [EMAIL PROTECTED] \endcsname \fi {#4
  }\dostopattributes
\dosingletexts ...atetexts {#1#2#5}{#6{}{}{}}}
  \egroup
 ...tk \v!footer \v!text \c!middletext }
  \hss }\hskip -\makeupwidth...
...
l.11 \stoptext

Plus, I don't know how to instruct "way=by..." to reset the counter at
the boundary of frontmatter/bodymatter

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
___


Re: [NTG-context] standardmakeup, frontmatter, bodymatter & page numbering

2007-10-03 Thread Peter Rolf
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.


Greetings, 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
___


[NTG-context] standardmakeup, frontmatter, bodymatter & page numbering

2007-10-02 Thread Mojca Miklavec
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 ...

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
___