From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/108644 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: Sun, 6 Sep 2020 14:43:36 +0200 Message-ID: <07F2D4A2-C208-40C0-B574-2458C9970584@hxcore.ol> References: <4c941864-8f83-082c-7b10-29509bacebc5@gmail.com> <806CD640-CF48-4D9D-ABB9-43C563957990@hxcore.ol>, <2164e6d8-ef6b-b6f5-f54b-f1d42a733030@gmail.com> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5570001546783139607==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29373"; mail-complaints-to="usenet@ciao.gmane.io" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Sep 06 14:44:04 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 1kEu1c-0007YG-BK for gctc-ntg-context-518@m.gmane-mx.org; Sun, 06 Sep 2020 14:44:04 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id C85C8160EEE; Sun, 6 Sep 2020 14:43:35 +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 xKP7Xc42hSR4; Sun, 6 Sep 2020 14:43:34 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 5F05A164835; Sun, 6 Sep 2020 14:43:34 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id BD49F164835 for ; Sun, 6 Sep 2020 14:43:33 +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 RA9rYaWUWiP9 for ; Sun, 6 Sep 2020 14:43:33 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.208.43; helo=mail-ed1-f43.google.com; envelope-from=register12c@gmail.com; receiver= Original-Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (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 03C87160EEE for ; Sun, 6 Sep 2020 14:43:32 +0200 (CEST) Original-Received: by mail-ed1-f43.google.com with SMTP id n13so10043496edo.10 for ; Sun, 06 Sep 2020 05:43:32 -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=wWxmKX0zCr/fogMrwRyO4tsq2VuTmUo/THFqWd7aoGc=; b=ncYy9EgZ8PobmVFTNw6I3fedbc1O4fxSfkUI0HwofXZYqBglFcTbEXWtOTzXCcubA4 +W1hfBB0jBYIBlFwl6KKZDzk6Pl6fp6JAXX5wJMWqXxvm+AQ53Lt6TZABOauiMDrCFvl yHEnYQhkGpV9ilS1WBzS+axzVdek56wM2VsXvjvg0k893Xmkt3hzv14qUk7AbJi9bApQ FZMbk93uIKblasgKJgoCzXZ43aYmpCxIOLlEWOlufizgWIyTlOEAqOfwytMHCMkLe/eh dgrz2/Z7i3+EvNgbeIEOheEhdJ2eUr3JY5sMED0U2zKtIqi9I1AIguWmlRyywF+J7b2w weBQ== 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=wWxmKX0zCr/fogMrwRyO4tsq2VuTmUo/THFqWd7aoGc=; b=pLnxSjYorkqL21WVDoDJ8RwOBMmWnZBpFCL3KphLaxlcFfEgCP/M40Hlyy6SUNpvOz 3qs/WvpIdx4eu9EbKDqrTdCFUJpi94r9QEx32gY2EDv2d1U9SBk0O8sWqbnBCmL+MofC uyGtYMaZtivwK7jUWwMJQEwpOTCh6mRfJZDxXo4nyf8Sn1jDiIYNrZZPUrQeFHnXKLoX YZqdzltod0WR8G6c3SoLcsTh1nbXVtgeyXgnGDFw6VqxUrDY4EHVadEjcHy8MX1T7iJh t3Z0qEHVONiNLg4N4OsnYZ6Yyjxl7Mfo+D4oSWhhAZz+W5e53vCS6j3OhPAvjM+Rr7lN oFfg== X-Gm-Message-State: AOAM531/N6OyHHNOVWNXA01ctbyl/eXWACpSpHuTR7z/PeYCNAFLLvsX XqR+9aDpBp5/DEYoE55ny/N3d4BBbmJ2KQ== X-Google-Smtp-Source: ABdhPJya158vt4Gz3eE/Xvky7zBrmcbM2L904NC9jxPO/uHdGh4RcLibj/2izOBXcsOXiixoQTEIcQ== X-Received: by 2002:a50:84e8:: with SMTP id 95mr16784775edq.99.1599396212386; Sun, 06 Sep 2020 05:43:32 -0700 (PDT) Original-Received: from smtp.gmail.com ([2001:984:3852:1:41c5:719d:88ff:b554]) by smtp.gmail.com with ESMTPSA id t10sm4922399edw.86.2020.09.06.05.43.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 06 Sep 2020 05:43:32 -0700 (PDT) Thread-Topic: RE: [NTG-context] \setupuserpagenumber not working as expected In-Reply-To: <2164e6d8-ef6b-b6f5-f54b-f1d42a733030@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:108644 Archived-At: --===============5570001546783139607== Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8"

Dear Wolfgang,

 

Thank = you for taking the time to go through the example and indicating these impr= ovements.

 

I will definitely evaluate and start applying this to my own code.

 

Kind regards,

Jan Willem

 <= /p>

 

&nbs= p;

=  

From: Wolfgang Schuster
Sent: Friday= , 4 September 2020 10:47
To: mailing list for ConTeXt users; Jan Willem Flamma
Subject: Re: [NTG-context] \setupuserpa= genumber not working as expected

 

= Jan Willem Flamma schrieb am 03.09.2020 um 10:29:

&= gt; Dear Julian,

>

>= I use something similar using a main product file, an environment file

> that contain the 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 the bodymatter starts the pa= genumber is set  to the arabic 1 (see

> be= low in the main product file)

>

> You should be able to copy and adapt to your needs.

 

There are lot of t= hings which can be improved in your example.

&= nbsp;

1. Pass the filename of the component/p= roduct to \startcomponent and not

some dummy name = (or just use *), this allows you to print the filename

with \currentcomponent or \currentproduct

 

2. Use \setvariables or \setupdocumen= t to set the document title,

revision etc.

 

3. Use \startsec= tionblockenvironment to move setups from the document

content into the environment file.

 <= /o:p>

4. Use pagestate=3Dstart to increase the page= counter with

\startstandardmakeup.

 

5. Set search path for = figures (\copypages use the figure mechanism)

with= \setupexternalfigure[location=3D...].

 <= /o:p>

Below is a modified (but untested) version of= your sample document.

 

Wolfgang

 

 

%%%% begin product<= /p>

\startproduct product

=  

\environment env-WA

 

% \setvariables

%=C2=A0=C2=A0 [document]

%=C2=A0=C2=A0= [=C2=A0=C2=A0=C2=A0=C2=A0 manual=3D{Course Manual},

%=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 title=3D{Title},<= /p>

%=C2=A0=C2=A0=C2=A0 subtitleone=3D{Subtitle 1},

=

%=C2=A0=C2=A0=C2=A0 subtitletwo=3D{Subtitle 2},

%=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 revnumber=3D{Revision num= ber}]

 

\se= tupdocument

=C2=A0=C2=A0 [=C2=A0=C2=A0=C2=A0=C2=A0 = manual=3D{Course Manual},

=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 title=3D{Title},

=C2= =A0=C2=A0=C2=A0 subtitleone=3D{Subtitle 1},

=C2=A0= =C2=A0=C2=A0 subtitletwo=3D{Subtitle 2},

=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 revnumber=3D{Revision number}]

 

\startfrontmatter

 

=C2=A0=C2=A0 \compon= ent fm-frontpage

=C2=A0=C2=A0 \component fm-titlepa= ge

=C2=A0=C2=A0 \component fm-tableofcontents

 

\stopfrontmatt= er

 

\start= bodymatter

 

=C2=A0=C2=A0 \component co-01

=C2=A0=C2=A0 \compo= nent co-02

 

\stopbodymatter

 

\startappendices

 

=C2=A0=C2=A0 \component co-ap-01

= =C2=A0=C2=A0 \component co-ap-02

 <= /p>

\stopappendices

 =

\startbackmatter

 

=C2=A0=C2=A0 \copypages[app1.pdf][n= =3D4]

 

\st= opbackmatter

 

\stopproduct

%%%% end product

 

%%%% begin environment

=

\startenvironment env-WA

=  

\setuppagenumbering

=C2=A0=C2=A0 [alternative=3Ddoublesided,

 

=C2=A0=C2=A0=C2=A0 location=3Dright]=

 

&n= bsp;

\defineconversionset

=C2=A0=C2=A0 [frontpart:pagenumber] [] [romannumerals]

 

\setupexternalfigures

=C2=A0=C2=A0 [directory=3D{External PDF}]

 

\startsectionblocken= vironment [frontpart]

 

=C2=A0=C2=A0 \setupbackgrounds

=C2=A0= =C2=A0=C2=A0=C2=A0 [leftpage]

=C2=A0=C2=A0=C2=A0=C2= =A0 [setups=3Dpagenumber:left]

 

=C2=A0=C2=A0 \setupbackgrounds

=C2=A0=C2=A0=C2=A0=C2=A0 [rightpage]

=C2=A0=C2=A0= =C2=A0=C2=A0 [setups=3Dpagenumber:right]

 = ;

\stopsectionblockenvironment

 

\startsectionblockenvir= onment [bodypart]

 

=C2=A0=C2=A0 \setupbackgrounds

=C2=A0=C2= =A0=C2=A0=C2=A0 [leftpage]

=C2=A0=C2=A0=C2=A0=C2=A0= [setups=3Dpagenumber:left]

 

=C2=A0=C2=A0 \setupbackgrounds

= =C2=A0=C2=A0=C2=A0=C2=A0 [rightpage]

=C2=A0=C2=A0= =C2=A0=C2=A0 [setups=3Dpagenumber:right]

 = ;

=C2=A0=C2=A0 \setuppagenumber

=C2=A0=C2=A0=C2=A0=C2=A0 [number=3D1]

=  

\stopsectionblockenvironment

<= p class=3DMsoNormal> 

\startsection= blockenvironment [appendix]

 

=C2=A0=C2=A0 \setupbackgrounds

= =C2=A0=C2=A0=C2=A0=C2=A0 [leftpage]

=C2=A0=C2=A0=C2= =A0=C2=A0 [setups=3Dpagenumber:left]

 

=C2=A0=C2=A0 \setupbackgrounds

=C2=A0=C2=A0=C2=A0=C2=A0 [rightpage]

=C2=A0= =C2=A0=C2=A0=C2=A0 [setups=3Dpagenumber:right]

 

\stopsectionblockenvironment

 

\startsectionbloc= kenvironment [backpart]

 

=C2=A0=C2=A0 \setuppagenumber[state=3Dstop]

 

\stopsectionblockenvironm= ent

 

\stop= environment

%%%% end environment

 

%%%% begin component

\startcomponent fm-frontpage

 

\product product

 

\startstandardmakeup [top=3D,= pagestate=3Dstart,align=3Dmiddle,color=3DModu_Blue]

 

% \dontleavehmode\externalfigure= [frontpage-logo.png][width=3D12cm]

 

\framed

=C2=A0=C2=A0 [hei= ght=3D5cm,width=3Dbroad,frame=3Doff]

=C2=A0=C2=A0 {= \externalfigure[frontpage-logo.png][width=3D12cm]}

=  

\blank[6*big]

 

{\bfc \documentvariable{manu= al}}

 

\bla= nk[4*big]

 

{\tfc \documentvariable{title}}

 <= /p>

\blank[2*big]

 

{\tfc \documentvariable{subtitleone}}

 

\blank[2*big]

=

 

{\tfc \docum= entvariable{subtitletwo}}

 

\stopstandardmakeup

 

\stopcomponent

%%%% end= component

 

%%%% begin component

\startcomponent fm-titlepage=

 

\product= product

 

= \startstandardmakeup [top=3D,pagestate=3Dstart,align=3Dmiddle,color=3DModu_= Blue]

 

{\t= fb \documentvariable{manual}}

 

=

\blank[2*big]

 

{\tfb \documentvariable{title}}

 

\blank[2*big]

 

{\tfb \documentvaria= ble{subtitleone}}

 

\blank[2*big]

 

{\tfb \documentvariable{subtitletwo}}

 

\blank[10*big]

 

{\tfb \documentvariable{re= vnumber}}

 

\blank

 

{= \tfb \currentdate[month,year]}

 

\blank[10*big]

 

{\tfb Written by:}

 

\blank

&= nbsp;

{\tfb Company name}

 

\blank

 

{\tfb City, Country}

 

\stopstandardmakeu= p

 

\stopco= mponent

%%%% end component

=  

%%%% begin component

\startcomponent fm-tableofcontents

 

\product product

 

\starttitle [title=3DTable o= f Contents]

 

\placecontent

 

\stoptitle

 

\stopcomponent

%%%% end component

 

= --===============5570001546783139607== 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== --===============5570001546783139607==--