From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/108611 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jan Willem Flamma Newsgroups: gmane.comp.tex.context Subject: Re: \setupuserpagenumber not working as expected Date: Fri, 4 Sep 2020 09:21:00 +0200 Message-ID: <732A6FF8-31C6-456F-98AB-C8C70BDB7588@hxcore.ol> References: <4c941864-8f83-082c-7b10-29509bacebc5@gmail.com> <806CD640-CF48-4D9D-ABB9-43C563957990@hxcore.ol>, <718e9b25-c249-25d4-196b-9a0b801bdb3e@gmail.com> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7902960588719766384==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26880"; mail-complaints-to="usenet@ciao.gmane.io" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Sep 04 09:21:35 2020 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kE62R-0006u5-IR for gctc-ntg-context-518@m.gmane-mx.org; Fri, 04 Sep 2020 09:21:35 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A0AD71A8A3C; Fri, 4 Sep 2020 09:21:08 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bzPgg6F3h660; Fri, 4 Sep 2020 09:21:05 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id D92EB1A89F6; Fri, 4 Sep 2020 09:21:05 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E09DA1A89BB for ; Fri, 4 Sep 2020 09:21:03 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ElV5NuwFZ5nS for ; Fri, 4 Sep 2020 09:21:03 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.218.52; helo=mail-ej1-f52.google.com; envelope-from=register12c@gmail.com; receiver= Original-Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 0E2DF1A896B for ; Fri, 4 Sep 2020 09:21:02 +0200 (CEST) Original-Received: by mail-ej1-f52.google.com with SMTP id a26so7296499ejc.2 for ; Fri, 04 Sep 2020 00:21:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:date:from:subject:thread-topic:in-reply-to:message-id :references:to:content-transfer-encoding; bh=w2JCn4hDJ2wp7JGkgQXa5mS5p4eR7uhBM+GhD+0hrX4=; b=nIiKAfDODcojBIk6LDk9vCZ8Y7rgy0ZMp09lQo/vZVnGW41KsEqEjN+sGPR94x6kdY 8cZhBHd+HRQ3YzljOhgkl7dDQ9uznT23tJpOBaAgrw1E0rz3hXOyLwrkcIROOvsqKIdA NCtY3QH3jQ18H9FiaZiSriyV3xQDnIp5eoQWPYNvWCa3suZIAF8DNvaSBHd4BCEKoSbL 1oI3z/cb5a3IzVeQgt1O0w2Aj1AYXY8i2RptkihodYbjv3jTpjNjJhqsu2/1W1Ib+lcf i43e/6ardb+u2NwHALSJapN0lffrwluEvIbljzialIkFOXaaZ7lO4OYwnPSSacIotmuL cPuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:from:subject:thread-topic :in-reply-to:message-id:references:to:content-transfer-encoding; bh=w2JCn4hDJ2wp7JGkgQXa5mS5p4eR7uhBM+GhD+0hrX4=; b=RkG4kMvUPLxVVFr9eGpVJcvWtUwMRd6rDuJwXNJKBK2rlWaa2QPie0JORsa6IBIr22 kwOtLYjq7Q/4MIcmdfS4IQKr3YOIgWmm5WrUQxB073L/Qd2JkEgu2Qw9nHD/ICTqxs49 Rm56FrlU7IZxR77jGHzt/j7p7w3KiJII2trypGc/+VGCZLxBLXffFNQL7II0uLhHzJt3 VGkqV6w/0B+DUA+jVnzQ+61d0gf7EmCexwRa5/Qk95jIVinS70PFISrA9Acc2kCH6HB1 rIcggOoDofkXSanQ7keLS6jyZ5V2TQ02u6aRNNbi/9RvZ/PRIU4cTFvAHkECoDBduArZ 88DA== X-Gm-Message-State: AOAM532GVo7ksfhOqYK8p9M9kcUoJeFEDb0uor2WADlfxbXHOHeKgcfP hRlC6WIRNEiIO6GCsSnz6CBTEJsGm0Ab4A== X-Google-Smtp-Source: ABdhPJwV4xOzF/PYd31LrLKTRjsN4feXyO35nDNYf0ItRVApOLAyMMgLhJxKFIRABgRKyH73XejGdw== X-Received: by 2002:a17:906:5f8a:: with SMTP id a10mr5835121eju.502.1599204062298; Fri, 04 Sep 2020 00:21:02 -0700 (PDT) Original-Received: from smtp.gmail.com ([2001:984:3852:1:995e:a95:52c:836a]) by smtp.gmail.com with ESMTPSA id g20sm2363119ejx.12.2020.09.04.00.21.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Sep 2020 00:21:02 -0700 (PDT) Thread-Topic: RE: [NTG-context] \setupuserpagenumber not working as expected In-Reply-To: <718e9b25-c249-25d4-196b-9a0b801bdb3e@gmail.com> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:108611 Archived-At: --===============7902960588719766384== Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8"

Credits to Pragma who helped me to s= et this up a few years ago.

 

From: jbf
Sent: Friday, 4 Septe= mber 2020 00:20
To: Jan = Willem Flamma
Cc: ntg &= gt;> mailing list for ConTeXt users
Subject: Re: [NTG-cont= ext] \setupuserpagenumber not working as expected

 

Th= anks Jan, that is an extensive bit of work below! Might take me a while to = digest, but I'll explore it carefully.

Julian

On 3/9/20 6:29 pm, Jan Willem Flamma wrote:

= Dear Julian,

 

I use some= thing similar using a main product file, an environment file that contain t= he styling and several components that build up the frontmatter, the manual= and the appendices.

 

= Below my setup where I start the roman= numbering on the table of contents page (page 5 or v in roman)

Once t= he bodymatter starts the pagenumber is set  to the arabic 1 (see below= in the main product file)

 

You should be able to copy and ad= apt to your needs.

 

Kind regards,

Jan Willem Flamma

&= nbsp;

 

 

The main product file

=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

\environment env-WA=

 =

\s= tartproduct currentproduct

 

% Document definitions

\defin= e\MyManual{Course Manual}

\define\MyTitle{Title}

<= p class=3DMsoNormal>\define\MySubtitle= One{Subtitle 1}

\define\MySubtitleTwo{Subtitle 2}

=

\define\MyRevnumb= er{Revision number}

 

= % Load frontmatter files

\startfro= ntmatter

    \component fm-frontpage

  &nb= sp; \component fm-titlepage

    \component fm-tableofcon= tents

\stopfrontmatter

 

% Load bodymatter file

\start= bodymatter

\setupbackgrounds

=     [leftpage]

&nbs= p;   [setups=3Dpagenumber:left]

\setupbackgrounds=

 &= nbsp;  [rightpage]

    [setups=3Dpagenumber:right]<= /span>

\setuppagenumber[number=3D1]

=     \component co-01

    \component co-02

\stopbodymatter=

 =

% = Load backmatter files

\startbackmatter

\setupbackgrounds

 =   [leftpage]

   [setups=3Dpagenumber:left]

\setupbac= kgrounds

   [rightpage]

   [setups=3Dpagenumber= :right]

\startappendices

   \component co-ap-01

 = ;  \component co-ap-02

\stopappendices

\stopbackmatter<= o:p>

&nb= sp;

% Load external PDF documents

\setuppagenumber[state=3Dstop]

\copypages[External PDF/app1.pdf][n=3D4]

 

=

\stopproduct

= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

 

 

 

The env-WA.tex file (below is about pagenumbering only)

=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

% Start chapter on right (odd) page, = pagenumber =3D bottom right

\setuppagenumbering

    = [alternative=3Ddoublesided,        =             &nb= sp;            =             &nb= sp;          

 =     location=3Dright]     &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp; 

 

% Pagenumbering style

\definestructureconve= rsionset

    [frontpart:pagenumber][][romannumerals]

\definestructureconversionset

    [bodypart:pagenumber]= [][numbers]

\definestructureconversionset

    [appe= ndix:pagenumber] [][numbers]

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

 

 

 

= The fm-frontpage.tex file

= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

\startcomponent currentcomponent

 

\product product

 

% Front page layout

\star= tstandardmakeup

 

% Place logo centered on page

\framed[he= ight=3D5cm,width=3Dbroad,frame=3Doff]

{\externalfigure[frontpage-logo.p= ng][width=3D12cm]}

 

% Place course titles

\blank[6*big]

\color[Modu_Blue]{\midaligned{\bfc \MyManual}}

 

\blank[4*b= ig]

\color[Modu_Blue]{\midaligned{\tfc \MyTitle}}

=

 

\blank= [2*big]

\color[Modu_Blue]{\midaligned{\tfc \MySubtitleOne}}=

 <= /span>

\blank[2*big]

\color[Modu_Blue]{\midaligned{\tfc \MySubtitleTwo}}

 

\vfill

 

= \stopstandardmakeup<= /p>

 <= o:p>

\st= opcomponent

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

<= p class=3DMsoNormal> =

 <= /span>

 

The fm-titlepage.tex file

=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D

\startcomponent currentcomponent

<= p class=3DMsoNormal> =

\produc= t product

 

\startstandardmakeup

 =

  &= nbsp; \color[Modu_Blue]{\midaligned{\tfb \MyManual}}

<= p class=3DMsoNormal>   = \blank[2*big]

    \color[Modu_Blue]{\midaligned{\tfb \M= yTitle}}

    \blank[2*big]

    \color= [Modu_Blue]{\midaligned{\tfb \MySubtitleOne}}

    \blank= [2*big]

    \color[Modu_Blue]{\midaligned{\tfb \MySubtit= leTwo}}

 

    \blank[10*big]<= /p>

 <= o:p>

&nb= sp;   \color[Modu_Blue]{\midaligned{\tfb \MyRevnumber}}

 = ;   \blank

    \midaligned{\color[Modu_Blue]{= \tfb \currentdate[month,year]}}

<= span class=3DDefaultFontHxMailStyle> 

    \blank[10= *big]

 

    \midaligned{\color[Modu_Blue]{\tfb = Written by:}}

    \blank

    \midal= igned{\color[Modu_Blue]{\tfb Company name}}

    \blank=

    \midaligned{\color[Modu_Blue]{\tfb City, Country}}<= /span>

 

    \vfill

 

\stopstandardmakeup=

 

\stopcomponent

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

 

The fm-tableofcontents.tex file

=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D

\startcomponent currentcomponent

 

\pro= duct product

 

\setupbackgrounds

    &= nbsp;      [leftpage]

    =        [setups=3Dpagenumber:left]=

\setupb= ackgrounds

          = [rightpage]

         &nbs= p; [setups=3Dpagenumber:right]

 

% This is where I want the ro= man numbering to start

\setuppagenumber[number=3D5]

 

\sta= rttitle[title=3DTable of Contents]

\placec= ontent

\stoptitle

 

= \stopcomponent

=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D

 

 

From: jbf
Sent: Thursday, 3 September 2020 06:05
To:
mailing list for ConTeXt users
Subjec= t: [NTG-context] \setupuserpagenumber not working as expected

 =

Am seeking to have frontmatter pages in roman nume= rals and from Chapter 1 onwards in arabic numerals. I have achieved somethi= ng of the kind, but page 1 (arabic) is appearing on the last page of the fr= ontmatter and not the first page of Chapter 1. I do not know why this is ha= ppening. My setup for page numbering is as follows (something I found somew= here - wiki? elsewhere? Not sure. I didn't make it up!):

\definestruc= tureconversionset[frontpart:pagenumber][][romannumerals]
\definestructur= econversionset[bodypart:pagenumber] [][numbers]
\startsectionblockenviro= nment[frontpart]
\setupuserpagenumber[numberconversion=3Dromannumerals]<= br>\setuplist[chapter][pageconversionset=3Dpagenumber]
\setuppagenumber[= number=3D1]
\stopsectionblockenvironment

\startsectionblockenviro= nment[bodypart]
\setuppagenumber[number=3D1]
\stopsectionblockenviron= ment

The frontmatter is some 16 pages worth (ends on a verso page but= that verso carries the arabic number 1 instead of page xvi which it should= be, since the final paragraph on that page ends with \stopfrontmatter. Tha= t means Chapter 1 (immediately after \startbodymatter) is now page 2 instea= d of page 1!

I tried a slightly simpler version of the above which I = found on Stackexchange:

\define= structureconversionset <= /span>[frontpart:pagenumber= ] [] [romannumerals]\startsect= ionblockenvironment [bodypart]

  \setcounter [=
] [=
1]
\stopsectionblockenvironment

but = it gave me the same result. Any idea how I can get the correct result?

<= p>Julian

 = ;



___=
___________________________________________________________________________=
_____
If your question is of interest to others as well, please a=
dd an entry to the Wiki!
 
maillist : <=
a href=3D"mailto:ntg-context@ntg.nl">ntg-context@ntg.nl / http://www.ntg.nl/mailman/lis=
tinfo/ntg-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net
archive=C2=A0 : https://bitbucket.org/phg/co=
ntext-mirror/commits/
wiki=C2=A0=C2=A0=C2=A0=C2=A0 : http://contextgarden.net
___________________________________________________=
________________________________

 

= --===============7902960588719766384== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============7902960588719766384==--