[NTG-context] \setupuserpagenumber not working as expected

jbf roma83537 at gmail.com
Fri Sep 4 00:20:50 CEST 2020


Thanks 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 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 pagenumber is set  to the arabic 1 (see 
> below in the main product file)
>
> You should be able to copy and adapt to your needs.
>
> Kind regards,
>
> Jan Willem Flamma
>
> *The main product file*
>
> ==============
>
> \environment env-WA
>
> \startproduct currentproduct
>
> % Document definitions
>
> \define\MyManual{Course Manual}
>
> \define\MyTitle{Title}
>
> \define\MySubtitleOne{Subtitle 1}
>
> \define\MySubtitleTwo{Subtitle 2}
>
> \define\MyRevnumber{Revision number}
>
> % Load frontmatter files
>
> \startfrontmatter
>
> \component fm-frontpage
>
> \component fm-titlepage
>
> \component fm-tableofcontents
>
> \stopfrontmatter
>
> % Load bodymatter file
>
> \startbodymatter
>
> \setupbackgrounds
>
> [leftpage]
>
> [setups=pagenumber:left]
>
> \setupbackgrounds
>
> [rightpage]
>
> [setups=pagenumber:right]
>
> \setuppagenumber[number=1]
>
> \component co-01
>
> \component co-02
>
> \stopbodymatter
>
> % Load backmatter files
>
> \startbackmatter
>
> \setupbackgrounds
>
> [leftpage]
>
> [setups=pagenumber:left]
>
> \setupbackgrounds
>
> [rightpage]
>
> [setups=pagenumber:right]
>
> \startappendices
>
> \component co-ap-01
>
> \component co-ap-02
>
> \stopappendices
>
> \stopbackmatter
>
> % Load external PDF documents
>
> \setuppagenumber[state=stop]
>
> \copypages[External PDF/app1.pdf][n=4]
>
> \stopproduct
>
> =============
>
> *The env-WA.tex file (below is about pagenumbering only)*
>
> =============
>
> % Start chapter on right (odd) page, pagenumber = bottom right
>
> \setuppagenumbering
>
> [alternative=doublesided,
>
>      location=right]
>
> % Pagenumbering style
>
> \definestructureconversionset
>
> [frontpart:pagenumber][][romannumerals]
>
> \definestructureconversionset
>
> [bodypart:pagenumber] [][numbers]
>
> \definestructureconversionset
>
> [appendix:pagenumber] [][numbers]
>
> =============
>
> *The fm-frontpage.tex file*
>
> ============
>
> \startcomponent currentcomponent
>
> \product product
>
> % Front page layout
>
> \startstandardmakeup
>
> % Place logo centered on page
>
> \framed[height=5cm,width=broad,frame=off]
>
> {\externalfigure[frontpage-logo.png][width=12cm]}
>
> % Place course titles
>
> \blank[6*big]
>
> \color[Modu_Blue]{\midaligned{\bfc \MyManual}}
>
> \blank[4*big]
>
> \color[Modu_Blue]{\midaligned{\tfc \MyTitle}}
>
> \blank[2*big]
>
> \color[Modu_Blue]{\midaligned{\tfc \MySubtitleOne}}
>
> \blank[2*big]
>
> \color[Modu_Blue]{\midaligned{\tfc \MySubtitleTwo}}
>
> \vfill
>
> \stopstandardmakeup
>
> \stopcomponent
>
> ============
>
> *The fm-titlepage.tex file*
>
> ============
>
> \startcomponent currentcomponent
>
> \product product
>
> \startstandardmakeup
>
> \color[Modu_Blue]{\midaligned{\tfb \MyManual}}
>
> \blank[2*big]
>
> \color[Modu_Blue]{\midaligned{\tfb \MyTitle}}
>
> \blank[2*big]
>
> \color[Modu_Blue]{\midaligned{\tfb \MySubtitleOne}}
>
> \blank[2*big]
>
> \color[Modu_Blue]{\midaligned{\tfb \MySubtitleTwo}}
>
> \blank[10*big]
>
> \color[Modu_Blue]{\midaligned{\tfb \MyRevnumber}}
>
> \blank
>
> \midaligned{\color[Modu_Blue]{\tfb \currentdate[month,year]}}
>
> \blank[10*big]
>
> \midaligned{\color[Modu_Blue]{\tfb Written by:}}
>
> \blank
>
> \midaligned{\color[Modu_Blue]{\tfb Company name}}
>
> \blank
>
> \midaligned{\color[Modu_Blue]{\tfb City, Country}}
>
> \vfill
>
> \stopstandardmakeup
>
> \stopcomponent
>
> ============
>
> *The fm-tableofcontents.tex file*
>
> ============
>
> \startcomponent currentcomponent
>
> \product product
>
> \setupbackgrounds
>
> [leftpage]
>
> [setups=pagenumber:left]
>
> \setupbackgrounds
>
> [rightpage]
>
> [setups=pagenumber:right]
>
> % This is where I want the roman numbering to start
>
> \setuppagenumber[number=5]
>
> \starttitle[title=Table of Contents]
>
> \placecontent
>
> \stoptitle
>
> \stopcomponent
>
> ============
>
> *From: *jbf <mailto:roma83537 at gmail.com>
> *Sent: *Thursday, 3 September 2020 06:05
> *To: *mailing list for ConTeXt users <mailto:ntg-context at ntg.nl>
> *Subject: *[NTG-context] \setupuserpagenumber not working as expected
>
> Am seeking to have frontmatter pages in roman numerals and from 
> Chapter 1 onwards in arabic numerals. I have achieved something of the 
> kind, but page 1 (arabic) is appearing on the last page of the 
> frontmatter and not the first page of Chapter 1. I do not know why 
> this is happening. My setup for page numbering is as follows 
> (something I found somewhere - wiki? elsewhere? Not sure. I didn't 
> make it up!):
>
> \definestructureconversionset[frontpart:pagenumber][][romannumerals]
> \definestructureconversionset[bodypart:pagenumber] [][numbers]
> \startsectionblockenvironment[frontpart]
> \setupuserpagenumber[numberconversion=romannumerals]
> \setuplist[chapter][pageconversionset=pagenumber]
> \setuppagenumber[number=1]
> \stopsectionblockenvironment
>
> \startsectionblockenvironment[bodypart]
> \setuppagenumber[number=1]
> \stopsectionblockenvironment
>
> 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. 
> That means Chapter 1 (immediately after \startbodymatter) is now page 
> 2 instead of page 1!
>
> I tried a slightly simpler version of the above which I found on 
> Stackexchange:
>
> \definestructureconversionset[frontpart:pagenumber][][romannumerals]
>
> \startsectionblockenvironment[bodypart]
>
> \setcounter[userpage][1]
> \stopsectionblockenvironment
>
> but it gave me the same result. Any idea how I can get the correct result?
>
> Julian
>
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context at ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20200904/d6cb56ff/attachment-0001.htm>


More information about the ntg-context mailing list