ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: jbf <roma83537@gmail.com>
To: Jan Willem Flamma <register12c@gmail.com>
Cc: "ntg >> mailing list for ConTeXt users" <ntg-context@ntg.nl>
Subject: Re: \setupuserpagenumber not working as expected
Date: Fri, 4 Sep 2020 08:20:50 +1000	[thread overview]
Message-ID: <718e9b25-c249-25d4-196b-9a0b801bdb3e@gmail.com> (raw)
In-Reply-To: <806CD640-CF48-4D9D-ABB9-43C563957990@hxcore.ol>


[-- Attachment #1.1: Type: text/plain, Size: 6607 bytes --]

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@gmail.com>
> *Sent: *Thursday, 3 September 2020 06:05
> *To: *mailing list for ConTeXt users <mailto:ntg-context@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@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
> ___________________________________________________________________________________

[-- Attachment #1.2: Type: text/html, Size: 32782 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2020-09-03 22:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-03  4:04 jbf
2020-09-03  4:19 ` Wolfgang Schuster
     [not found]   ` <d2d01391-cb35-1090-a28c-046b8a0ad0e8@gmail.com>
2020-09-03 14:17     ` Wolfgang Schuster
2020-09-03  8:29 ` Jan Willem Flamma
2020-09-03 22:20   ` jbf [this message]
2020-09-04  7:21     ` Jan Willem Flamma
2020-09-04  8:47   ` Wolfgang Schuster
2020-09-06 12:43     ` Jan Willem Flamma

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=718e9b25-c249-25d4-196b-9a0b801bdb3e@gmail.com \
    --to=roma83537@gmail.com \
    --cc=ntg-context@ntg.nl \
    --cc=register12c@gmail.com \
    /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).