ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Page number woes
@ 2019-09-02 11:07 Mari Voipio
  2019-09-03 16:03 ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Mari Voipio @ 2019-09-02 11:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1392 bytes --]

Hello!

I have a document where I want the page numbers to start from the
first page of chapter one. There's bunch of stuff before that,
including a table of contents. This has worked fine:

\startproduct prd-pr23

\startfrontmatter
\setuppagenumber[stop]
\component pr23-cover_front_web
\component blank.tex
\component c-contents
\stopfrontmatter

\startbodymatter
\setuppagenumber[start]
\component dtr_pg.tex
\stopbodymatter

\stopproduct


However, now I need to switch to using a full-page pdf as cover page
and changing that one line messes up with my page numbering, now TOC
appears as page 1 and chapter one starts from page 2 in my test file.


\startproduct prd-pr23


\startfrontmatter
\setuppagenumber[stop]
\startpagefigure[cover_vaisala_front_stripped]\stoppagefigure
\component blank.tex
\component c-contents
\stopfrontmatter

\startbodymatter
\setuppagenumber[start]
\component dtr_pg.tex         % third chapter (DTR)
\stopbodymatter

\stopproduct

What is it that I don't see? I tried moving the cover page before the
\startfrontmatter, but that didn't change anything, TOC still starts
on page 2 when it shouldn't have a page number at all. Why does
switching the cover page from .tex to \pagefigure have such an effect
and how can I counteract it?


Mari

(Obviously the real thing is a lot bigger, but the behaviour is the
same. These are as close to MWE as I can get.)

[-- Attachment #2: blank.tex --]
[-- Type: application/octet-stream, Size: 93 bytes --]

\startcomponent blank
\environment ../../env-layout-23


\page[empty]

\stopcomponent

[-- Attachment #3: c-contents.tex --]
[-- Type: application/octet-stream, Size: 1107 bytes --]

\startcomponent c-contents
\product prd-dd23
\project proj-dd23

% \setuppagenumber[state=stop]
% ------------------- Frontmatter ----------------------
% This part of the document is reserved for the table of contents
% This structure ensures that the TOC is not listed _in_ the TOC
% and that TOC doesn't get page numbers
% \startfrontmatter


% stops header texts from showing in toc, but leaves the
% the header space blank
\setupheader[state=stop]


% This inserts the TOC with the heading "Table of Contents"
% \myContents{Table of contents} doesn't seem to work
\title[toc]{Table of contents}
\placelist[chapter,section,subsection]%[criterium=text,extras={6.0=page}]
% \placecontent[extras={6=page}] % adds page break, i.e. forces section 6 to go to next page (so 6 and 6.1 end up on the same page...)

% \stopfrontmatter
% ---------------------------------------------------------------


% page numbering starts here from 1
% i.e. the TOC pages really are not numbered
% \setuppagenumber[state=start]

%Turns header on
\setupheader[state=start]


\stopcomponent

[-- Attachment #4: pr23_pagenumbers_1.tex --]
[-- Type: application/octet-stream, Size: 340 bytes --]

\startproduct prd-pr23


\startfrontmatter
\setuppagenumber[stop]
\component pr23-cover_front_web
\component blank.tex
\component c-contents                     % Table of Contents
\stopfrontmatter

\startbodymatter
\setuppagenumber[start]
\component dtr_pg.tex			        % third chapter (DTR)
\stopbodymatter

\stopproduct

[-- Attachment #5: dtr_pg.tex --]
[-- Type: application/octet-stream, Size: 11580 bytes --]

\startcomponent dtr

% This tells ConTeXt where it can locate
% the figures used in this chapter
\setupexternalfigures[directory={./dtr}]

% List of figures used in this chapter
\useexternalfigure[dtr][dtr_pic]
\useexternalfigure[linearized curve][linearized_curve]%[height=4cm] %was 2.51
\useexternalfigure[algorithm][algorithm][height=4cm] %was 2.52
\useexternalfigure[dtr mounting][dtr_mounting]%[width=\textwidth]
\useexternalfigure[sensor connections][sensor_connections][width=.8\textwidth] %pic originally drawn for Best Practices manuals
%		  [height=8cm] %new
\useexternalfigure[open front panel][open_front_panel]
		  [height=8cm] %new
\useexternalfigure[external power switch][external_power_switch]
		  [height=6cm] %new
\useexternalfigure[motherboard][motherboard][width=.8\textwidth]
\useexternalfigure[motherboard_24v][motherboard_24V][width=.8\textwidth]
\useexternalfigure[reset][reset_cropped]


%----------------------------------------------------------
% The document itself starts here
%----------------------------------------------------------
\starttext

% First level heading here
% Text in [brackets] is used for reference
% text in {curly brackets} is the visible heading
\chapter[dtr]{Indicating transmitter DTR}

% Second level heading here
% Text in [brackets] is used for reference
% text in {curly brackets} is the visible heading
\section[section:dtr description]{Indicating transmitter description}
\index{Indicating transmitter+description}


The Indicating transmitter DTR is a specialized computer designed to
process data received from one or two sensors. The Indicating
transmitter enclosure (\in{Figure}[fig:dtr]) contains a front panel
with a backlit \index{display}Liquid Crystal Display (LCD) and a
\index{keyboard}keyboard. The front panel swings open to give access
for connections and service. Knockout padlock provisions are included
in the enclosure's both cover latches for locks to prevent
unauthorized access.

\placefigure
    [here][fig:dtr]
    {The Indicating transmitter enclosure}
    {\externalfigure[dtr]}


The sensors send the values of the refractive index nD and the
\index{temperature+process}process temperature T to the DTR.  The
microprocessor system then linearizes the concentration reading
(example in \in{Figure}[fig:linearized curve]), and performs an
\index{temperature+compensation}automatic temperature compensation.


\placefigure
	[here,force][fig:linearized curve]
	{A linearized curve}
	{\externalfigure[linearized curve]}

\page

\section[section:dtr mounting]{Mounting Indicating transmitter}
\index{Indicating transmitter+mounting}

The Indicating transmitter is mounted indoors, it should preferably be located in an easily
accessible, well lit and dry area. Avoid vibration. Take interconnecting
cable length into consideration when choosing the mounting location.

The enclosure is mounted vertically on an upright surface (wall) using
four mounting feet, see \in{Figure}[fig:dtr mounting]. The LCD is best
viewed when approximately on the eye level of the user.

In sanitary installations, the recommendation is to use a DTR with stainless steel enclosure. If standard polycarbonate enclosure is used, it should be installed as remotely as practical from the product areas or connections.

\getbuffer[imp] Do not drill mounting holes in
the enclosure as that will affect the protection class of the
enclosure and damage the electronics.

\placefigure
    [here,force][fig:dtr mounting]
    {Indicating transmitter: dimensions (mm/in)\crlf and mounting feet measures}
    {\externalfigure[dtr mounting]}


\getbuffer[note] The \index{display+temperature range}LCD display has an
operating temperature range of 0--50~\textdegree C and a storage temperature
range of -20--60~\textdegree C.

\getbuffer[imp] The DTR does not have a built-in power
switch. The system is always powered on when connected to a power
source.  Mounting an external
\index{power+external power switch}power switch to control the DTR's power supply is recommended,
\in{Figure}[fig:external power switch].



\section[section:electrical connections]{Electrical connections}

\subsection[section:interconnecting]{Interconnecting cable}
\index{interconnecting cable}

The cable contains a pair of twisted signal wires (1,~2) and a cable
shield (3) (see \in{Section}[section:sensor connection] and
\in{Figure}[fig:motherboard]). Standard delivery is 10~meters (33~feet)
of cable. The maximum length of an interconnecting cable is 200~m
(660~ft). The signal wires (1,~2) are interchangeable
(non-polarized). The cable shield is connected to the protective earth
at the Indicating transmitter.

The junction box enables the use of customer's own cable as long as it
meets IEC~61158|M|2 type A standard requirements, see
\in{Section}[section:cable specs],
\about[section:cable specs].


%forced page break
%\page

\subsection[section:sensor connection]{Connecting sensor}\index{sensor+connecting+standard sensor}

\getbuffer[imp]  Sensor connector may not be connected or disconnected when the circuits are energized. Switch OFF the power from Indicating transmitter DTR external power switch before disconnecting the sensor cable from the sensor. After connecting sensor cable back to the sensor you can switch power back on.

\startitemize[n,packed]

\item Remove the four screws holding the
\index{sensor+nameplate}Sensor nameplate (\in{Figure}[fig:sensor
connections]). The terminal strip is under the nameplate.

\item Connect the signal wires to terminal (1) and (2), and the
cable shield to terminal (3).

\item Tighten up cable gland. Screw nameplate back on.

\stopitemize

\placefigure
	[here,force][fig:sensor connections]
	{\index{power+indicator light}Sensor electrical connections}
	{\externalfigure[sensor connections]}


\page


\subsection[section:connecting dtr]{Connecting the Indicating transmitter}\index{Indicating transmitter+connecting}


All the electrical terminals of the Indicating transmitter are behind the
Front panel. To access them, first open the enclosure cover. Then
loosen the front panel screw (\in{Figure}[fig:open front panel]) and
swing open the Front panel. All terminals are now accessible.


\placefigure
	[here,force][fig:open front panel]
	{Opening the Front panel of the Indicating transmitter}
	{\externalfigure[open front panel]}

\placefigure
	[here,force][fig:external power switch]
	{The recommended external \index{power+switch}power switch, spare part nr PR-10900. The ratings of the switch are 10A/230V.}
	{\externalfigure[external power switch]}

\getbuffer[warn] {\bf Check that the power is off before opening
the Front panel.} If the {\it green power indicator light}
(\in{Figure}[fig:open front panel]) is on, there is still power in the
system. To completely turn the power off, use the external power switch. The external power switch shall be installed in accordance with the local installation requirements.

%\page


\placefigure
	[here,force][fig:motherboard]
	{\index{Indicating transmitter+motherboard}Motherboard of
	the Indicating transmitter for AC power}
	{\externalfigure[motherboard]}

\placefigure
    [here,force][fig:motherboard 24V]
    {Motherboard of the Indicating transmitter for 24V DC power}
    {\externalfigure[motherboard_24v]}


\page

Description of the terminals on the H1 interface card PR-10701 and on
the Transmitter motherboard PR-10600 (\in{Figure}[fig:motherboard]):

%\blank[big]

\bTABLE
\setupTABLE[c][each][frame=off]
\setupTABLE[r][each][topframe=on,style=\ssx]
\setupTABLE[r][last][bottomframe=on]
\setupTABLE[c][2][rightframe=on]
\setupTABLE[r][1,4][rightframe=on]
\setupTABLE[c][1][style=\ssx\bf,leftframe=on]
%
\bTR
    \bTD[nc=2] On H1 \eTD
\eTR
%
\bTR
    \bTD A 1 2 3 \eTD
    \bTD Connection for Sensor A, signal wires~(1,~2), cable shield~(3). \eTD
\eTR
%
\bTR
    \bTD B 1 2 3 \eTD
    \bTD Connection for Sensor B, signal wires~(1,~2), cable shield~(3). \eTD
\eTR
%
\bTR
\bTD[nc=2] On Motherboard \eTD
\eTR
%
\bTR
    \bTD 11 12 \eTD
    \bTD \index{4--20 mA}4--20~mA output 1, positive~(11), negative~(12), max.~load 1000~Ohm, galvanically isolated. \eTD
\eTR
%
\bTR
    \bTD 13 14 \eTD
    \bTD 4--20~mA output 2, positive~(13), negative~(14), max.~load 1000~Ohm, galvanically isolated. \eTD
\eTR
%
\bTR
    \bTD 21 22 \eTD
    \bTD \index{relay+location}Relay 1, one contact output, max.~250~V~AC, max. 3~A. \eTD
\eTR
%
\bTR
    \bTD 23 24 \eTD
    \bTD Relay 2, one contact output, max.~250~V~AC, max. 3~A. \eTD
\eTR
%
\bTR
    \bTD 31 32 33 \eTD
    \bTD Power, L (31), N (32), protective earth (33), 100-240~V~AC, 50--60~Hz. An external
    \index{power+switch}power switch (\in{Figure}[fig:external power switch]) is recommended. \eTD
\eTR
%
\bTR
    \bTD 41 42 \eTD
    \bTD  24V terminal for DTR internal use only.\crlf
    \getbuffer[note] Connecting terminal to external 24V supply will void warranty.
    Connecting external devices to 24V terminal will void warranty. \eTD
\eTR
%
\bTR
    \bTD 51 52 53 54 55 \eTD
    \bTD \index{input switch}Switch inputs: switch~1~(51), switch~2~(52), switch~3~(53), switch~4~(54)
    and common 3 volts for all inputs (55). The switch terminals are galvanically isolated. \eTD
\eTR
%
\eTABLE

% \page

\subsection[section:power terminals]{Power terminals for AC power}
\index{power+terminals (AC power)}

The primary AC power is connected to a separate terminal strip
31/32/33 marked {\tt POWER} in the lower right-hand corner of the
Motherboard (\in{Figure}[fig:motherboard]). The three terminals are
marked 31/L, 32/N and 33/\low{\externalfigure[pe_3mm]} (protective earth). The
power terminal 33/\low{\externalfigure[pe_3mm]} is directly connected to the exposed metal parts
of the Indicating transmitter DTR. Wiring to the terminals shall be 1.5mm\high{2} minimum. The protective fuse in the building system shall comply with the local requirements.

\subsection[section:power terminals]{Power terminals for 24V DC power}
\index{power+terminals (24V DC power)}

The DC power is connected to a terminal stripe marked POWER in the lower right-hand corner of the Motherboard (\in{figure}[fig:motherboard 24V]). The three terminals are marked +, - and \low{\externalfigure[pe_3mm]} (protective earth). The power terminal \low{\externalfigure[pe_3mm]} is directly connected to the exposed metal parts of the Indicating transmitter DTR.

The 24V DC power to this terminal stripe shall be supplied from a secondary circuit which is double or reinforced insulated from the mains supply within the limits for a limited-energy circuit (maximum 200 VA/U) according to the IEC 61010-1.


\subsection[section:reset button]{Reset button}
\index{reset button}


It is possible to reset and restart both the Indicating transmitter
DTR and the sensor(s) by pushing the reset button. The button is
accessed through the cable hole in the front panel shield (see
\in{Figure}[fig:reset] below). You need a thin stick or similar utensil, preferably of
non-conducting material, to reach the reset button. After pressing the
reset button, the display will black out for a few seconds. The
instrument will be back to full operation within 30 seconds.


\placefigure
	[here,force][fig:reset]
	{Location of the reset button}
	{\externalfigure[reset]}





\stoptext
\stopcomponent

[-- Attachment #6: pr23_pagenumbers_1.pdf --]
[-- Type: application/pdf, Size: 74730 bytes --]

[-- Attachment #7: pr23-cover_front_web.tex --]
[-- Type: application/octet-stream, Size: 3410 bytes --]

\startcomponent pr23-cover_front_web
% \environment env-pr23
% \environment env-fonts-23
% \environment env-layout-23
\project proj-dd23


%make this the front cover in the future since it can be compiled without compiling the rest of the manual


\definelayer[etukansi]
    [x=0mm,y=0mm,width=\paperwidth,height=\paperheight]


%%% \setupexternalfigures[directory={./originals}]
% \useexternalfigure[kplogo][kplogo][width=4cm]
% \useexternalfigure[coverpicture][coverpicture_web]%[height=0.5\paperheight]

\setupmakeup[page][top=,bottom=]

\setupcolors[state=start]
\definecolor[kpltgray][c=0,m=0,y=0,k=0.16] % light gray for cover bg bar etc.
\definecolor[kpltblack][r=0,g=0,b=0] % light gray for bars, rgb color space
\definecolor[kpdkgray][c=0,m=0,y=0,k=.7] % dark gray for the texts
\definecolor[kpred][c=0,m=1,y=.65,k=.0] % red for website address (could be used also inside!)

\abbreviation[effdate]{June 11, 2019}{June 2019}
\abbreviation[revno]{1.96}{1.96}



% ------------------ START OF DOCUMENT -------------------------
% The document itself starts here
\starttext

% this enables the use of colors in the document
% only used in draft stages, turn off for final version
%\setupcolors[state=start]

% color usage
% \startcolor[colorname]
% \stopcolor

% This stops the cover page and toc from getting page numbers
% Result: Chapter 1 starts from page 1.
\setuppagenumber[state=stop]

% -----------------------MANUAL FRONT COVER IN CONTEXT --------------------------

\startpagemakeup[doublesided=no,textstyle={\switchtobodyfont[12pt]},style={\setupinterlinespace[line=3ex]}]

%\setmainfont[arial]
\definefontfamily [myfamily] [sans] [Arial]
\setupbodyfont [myfamily,12pt]


%\definebodyfontenvironment[12pt][d=28]
\definebodyfontenvironment[default][d=3.5]

% the individual layers

% The gray bar on the right
\setlayerframed[etukansi]
    [frame=off,
    width=0.228\paperheight,
    height=0.5\paperheight,
    preset=rightbottom,
    background=color,
    backgroundcolor=kpltgray]
    {}

%%% The cover photo
% \setlayerframed[etukansi]
%     [frame=off,
%     width=0.342\paperwidth,
%     height=0.5\paperheight,
%     preset=righttop]
%     {\externalfigure[coverpicture]}%}


%%% Logo
% \setlayerframed[etukansi]
%     [frame=off,
%     width=40mm,
%     preset=lefttop,
%     hoffset=21mm,
%     voffset=19mm]
%         {\externalfigure[kplogo]}


% Static text on left near spine and bottom
\setlayerframed[etukansi]
    [frame=off,
    preset=middleleft,
%     height=10cm,
%     width=15cm,
    hoffset=21mm,
%     voffset=50mm,
    align=right]
    {\bfd \cap{\startcolor[kpltblack]process\crlf refractometer\crlf pr-23\stopcolor}}


% Manual title (will be a variable later)
\setlayerframed[etukansi]
    [frame=off,
    preset=rightbottom,
%     width=6.5cm,
    hoffset=10mm,
    voffset=41mm,
    align=left]
        {\bfc \cap{\startcolor[kpdkgray]instruction\crlf manual\stopcolor}}

% Manual version
\setlayerframed[etukansi]
    [frame=off,
    preset=rightbottom,
%     width=6.5cm,
    hoffset=10mm,
    voffset=26mm,
    align=right]
        {\bfx {\startcolor[kpdkgray]IM-EN-PR23 Rev. \revno        \stopcolor}}


\placelayer[etukansi]

\stoppagemakeup

\stoptext

\stopcomponent




\installpagebreakhandler{last}{}\stopcomponent



[-- Attachment #8: pr23_pagenumbers_2.pdf --]
[-- Type: application/pdf, Size: 62512 bytes --]

[-- Attachment #9: pr23_pagenumbers_2.tex --]
[-- Type: application/octet-stream, Size: 404 bytes --]

\startproduct prd-pr23


\startfrontmatter
\setuppagenumber[stop]
\startpagefigure[cover_vaisala_front_stripped]\stoppagefigure % cover (exported from Corel)
\component blank.tex
\component c-contents                     % Table of Contents
\stopfrontmatter

\startbodymatter
\setuppagenumber[start]
\component dtr_pg.tex			        % third chapter (DTR)
\stopbodymatter



\stopproduct

[-- Attachment #10: cover_vaisala_front_stripped.pdf --]
[-- Type: application/pdf, Size: 13728 bytes --]

[-- Attachment #11: 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Page number woes
@ 2016-03-14 14:43 Mari Voipio
  2016-03-15 10:22 ` Wolfgang Schuster
  2016-03-15 12:08 ` Pablo Rodriguez
  0 siblings, 2 replies; 6+ messages in thread
From: Mari Voipio @ 2016-03-14 14:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1565 bytes --]

Greetings all!

I have a book setup that worked perfectly as long as the inside cover
was only one page long. But then we added information to the inside
cover and had to split the information on two pages. The so called
inside cover works fine, the TOC works fine, but the main text part
(starting with Intro) begins now on page 2 when it should be on page
1. And this happens even when the TOC is two pages long, which is a
bit weird (I would assume that if it counts TOC into page numbers,
two-page TOC would mean that Intro starts on page 3, but nope, it
still starts on page 2).

The minimal sample attached to this message is really ugly as it
doesn't contain any of the environment files, but the problem is
visible here just as well as in the real thing - if I make the second
page of the inside cover disappear, Intro starts on page 1 as it
should. If the so called inside cover is two pages long, Intro starts
on page 2. (The file to be compiled is prd-pr43-general_test.tex, the
others are component files.)

It is quite possible the TOC file is the culprit and it has been pure
luck that everything has worked until now... I don't understand the
page mechanism in ConTeXt well enough to see where the problem is.

I noticed that my ConTeXt version is pretty old: "ConTeXt  ver:
2015.02.03 23:55 MKIV beta" (hmm... I didn't update at ConTeXt meeting
as I usually do, stupid me.)
I'd rather not update just now (production in sensitive phase), but if
you think the problem will go away with an update, I'll do it.


All help is gratefully received,

Mari

[-- Attachment #2: c-insidecover-pr43-testing.tex --]
[-- Type: application/x-tex, Size: 3344 bytes --]

[-- Attachment #3: c-intro-pr43.tex --]
[-- Type: application/x-tex, Size: 1221 bytes --]

[-- Attachment #4: c-contents-pr43.tex --]
[-- Type: application/x-tex, Size: 1358 bytes --]

[-- Attachment #5: 4344_front.pdf --]
[-- Type: application/pdf, Size: 192822 bytes --]

[-- Attachment #6: prd-pr43-general_test.tex --]
[-- Type: application/x-tex, Size: 521 bytes --]

[-- Attachment #7: prd-pr43-general_test.pdf --]
[-- Type: application/pdf, Size: 223581 bytes --]

[-- Attachment #8: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-09-05  9:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-02 11:07 Page number woes Mari Voipio
2019-09-03 16:03 ` Wolfgang Schuster
2019-09-05  9:30   ` Mari Voipio
  -- strict thread matches above, loose matches on Subject: below --
2016-03-14 14:43 Mari Voipio
2016-03-15 10:22 ` Wolfgang Schuster
2016-03-15 12:08 ` Pablo Rodriguez

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).