ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	Jan Willem Flamma <register12c@gmail.com>
Subject: Re: \setupuserpagenumber not working as expected
Date: Fri, 4 Sep 2020 10:47:40 +0200	[thread overview]
Message-ID: <2164e6d8-ef6b-b6f5-f54b-f1d42a733030@gmail.com> (raw)
In-Reply-To: <806CD640-CF48-4D9D-ABB9-43C563957990@hxcore.ol>

Jan Willem Flamma schrieb am 03.09.2020 um 10:29:
> 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.

There are lot of things which can be improved in your example.

1. Pass the filename of the component/product 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 \setupdocument to set the document title, 
revision etc.

3. Use \startsectionblockenvironment to move setups from the document 
content into the environment file.

4. Use pagestate=start to increase the page counter with 
\startstandardmakeup.

5. Set search path for figures (\copypages use the figure mechanism) 
with \setupexternalfigure[location=...].

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

Wolfgang


%%%% begin product
\startproduct product

\environment env-WA

% \setvariables
%   [document]
%   [     manual={Course Manual},
%          title={Title},
%    subtitleone={Subtitle 1},
%    subtitletwo={Subtitle 2},
%      revnumber={Revision number}]

\setupdocument
   [     manual={Course Manual},
          title={Title},
    subtitleone={Subtitle 1},
    subtitletwo={Subtitle 2},
      revnumber={Revision number}]

\startfrontmatter

   \component fm-frontpage
   \component fm-titlepage
   \component fm-tableofcontents

\stopfrontmatter

\startbodymatter

   \component co-01
   \component co-02

\stopbodymatter

\startappendices

   \component co-ap-01
   \component co-ap-02

\stopappendices

\startbackmatter

   \copypages[app1.pdf][n=4]

\stopbackmatter

\stopproduct
%%%% end product

%%%% begin environment
\startenvironment env-WA

\setuppagenumbering
   [alternative=doublesided, 

    location=right] 


\defineconversionset
   [frontpart:pagenumber] [] [romannumerals]

\setupexternalfigures
   [directory={External PDF}]

\startsectionblockenvironment [frontpart]

   \setupbackgrounds
     [leftpage]
     [setups=pagenumber:left]

   \setupbackgrounds
     [rightpage]
     [setups=pagenumber:right]

\stopsectionblockenvironment

\startsectionblockenvironment [bodypart]

   \setupbackgrounds
     [leftpage]
     [setups=pagenumber:left]

   \setupbackgrounds
     [rightpage]
     [setups=pagenumber:right]

   \setuppagenumber
     [number=1]

\stopsectionblockenvironment

\startsectionblockenvironment [appendix]

   \setupbackgrounds
     [leftpage]
     [setups=pagenumber:left]

   \setupbackgrounds
     [rightpage]
     [setups=pagenumber:right]

\stopsectionblockenvironment

\startsectionblockenvironment [backpart]

   \setuppagenumber[state=stop]

\stopsectionblockenvironment

\stopenvironment
%%%% end environment

%%%% begin component
\startcomponent fm-frontpage

\product product

\startstandardmakeup [top=,pagestate=start,align=middle,color=Modu_Blue]

% \dontleavehmode\externalfigure[frontpage-logo.png][width=12cm]

\framed
   [height=5cm,width=broad,frame=off]
   {\externalfigure[frontpage-logo.png][width=12cm]}

\blank[6*big]

{\bfc \documentvariable{manual}}

\blank[4*big]

{\tfc \documentvariable{title}}

\blank[2*big]

{\tfc \documentvariable{subtitleone}}

\blank[2*big]

{\tfc \documentvariable{subtitletwo}}

\stopstandardmakeup

\stopcomponent
%%%% end component

%%%% begin component
\startcomponent fm-titlepage

\product product

\startstandardmakeup [top=,pagestate=start,align=middle,color=Modu_Blue]

{\tfb \documentvariable{manual}}

\blank[2*big]

{\tfb \documentvariable{title}}

\blank[2*big]

{\tfb \documentvariable{subtitleone}}

\blank[2*big]

{\tfb \documentvariable{subtitletwo}}

\blank[10*big]

{\tfb \documentvariable{revnumber}}

\blank

{\tfb \currentdate[month,year]}

\blank[10*big]

{\tfb Written by:}

\blank

{\tfb Company name}

\blank

{\tfb City, Country}

\stopstandardmakeup

\stopcomponent
%%%% end component

%%%% begin component
\startcomponent fm-tableofcontents

\product product

\starttitle [title=Table of Contents]

\placecontent

\stoptitle

\stopcomponent
%%%% end component
___________________________________________________________________________________
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
___________________________________________________________________________________

  parent reply	other threads:[~2020-09-04  8:47 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
2020-09-04  7:21     ` Jan Willem Flamma
2020-09-04  8:47   ` Wolfgang Schuster [this message]
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=2164e6d8-ef6b-b6f5-f54b-f1d42a733030@gmail.com \
    --to=wolfgang.schuster.lists@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).