Background on the 1st page only, page numbering from the 2nd page
Hello, how to specify the page background for the first page only and how to start page numbering from the second page? Here's my trial: ---- \defineoverlay[Bkg][{\externalfigure[cow]}] \setupbackgrounds[paper][background=Bkg] %\setuppagenumbering[state=2] \starttext \dorecurse{5}{\input knuth} \stoptext ---- - The background is on all pages, so is the page numbering. Any ideas? Best regards, Lukas -- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
On 2012-05-02 Procházka Lukáš Ing. - Pontex s. r. o.
how to specify the page background for the first page only and how to start
\definelayer [Bkg] \setlayer [Bkg] {\externalfigure [cow]} \setupbackgrounds [paper] [background=Bkg] \starttext \dorecurse{5}{\input knuth} \stoptext
page numbering from the second page?
It's \setuppagenumbering [state=stop|start], the state command doesn't accept a number. Marco
Am 02.05.2012 um 09:45 schrieb Procházka Lukáš Ing. - Pontex s. r. o.:
Hello,
how to specify the page background for the first page only and how to start page numbering from the second page?
Here's my trial:
---- \defineoverlay[Bkg][{\externalfigure[cow]}] \setupbackgrounds[paper][background=Bkg]
%\setuppagenumbering[state=2]
\starttext \dorecurse{5}{\input knuth} \stoptext ----
- The background is on all pages, so is the page numbering.
Any ideas?
\defineoverlay[Bkg][\doif{\pagenumber}{1}{\externalfigure[cow]}] \setupbackgrounds[paper][background=Bkg] \starttext \noheaderandfooterlines \dorecurse{5}{\input knuth\par} \stoptext Wolfgang
... Thanks to Marco and Wolfgang for the solution - both ideas work well. I also added a test to print the page number, so the whole code is: ---- \defineoverlay[Bkg][\doif{\pagenumber}{1}{\externalfigure[cow]}] \setupbackgrounds[paper][background=Bkg] \def\MyPageNumber#1{\doifelse{\pagenumber}{1}{}{\pagenumber}} \setuppagenumbering[location={footer,middle},command=\MyPageNumber] \starttext \noheaderandfooterlines \dorecurse{5}{\input knuth\par} \stoptext ---- Best regards, Lukas -- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
On Wed, 2 May 2012 14:24:24 +0200
Wolfgang Schuster
Am 02.05.2012 um 09:45 schrieb Procházka Lukáš Ing. - Pontex s. r. o.:
how to specify the page background for the first page only and how to start page numbering from the second page?
\defineoverlay[Bkg][\doif{\pagenumber}{1}{\externalfigure[cow]}]
\setupbackgrounds[paper][background=Bkg]
\starttext \noheaderandfooterlines \dorecurse{5}{\input knuth\par} \stoptext
If you want to create a title page (which may not be your intention), why not simply \definemakeup[titlepage][align=middle] \defineoverlay[COW][\externalfigure[cow]] \starttext \setupbackgrounds[page][background=COW] \starttitlepagemakeup A title \stoptitlepagemakeup \setupbackgrounds[page][background=] \setuppagenumbering[alternative=doublesided,way=bytext] \dorecurse{5}{\input knuth\par} \stoptext Question (for Wolfgang): Why did you use "paper" rather than "page" (what is the difference)? Alan
Thanks for the code -
- actually, I'm not trying to create a "typical book" title page but just a kind of "cover" page.
But I'll keep your suggestion in mind, I may use it in the future.
Thanks anyway.
Best regards,
Lukas
On Wed, 02 May 2012 15:22:01 +0200, Alan BRASLAU
On Wed, 2 May 2012 14:24:24 +0200 Wolfgang Schuster
wrote: Am 02.05.2012 um 09:45 schrieb Procházka Lukáš Ing. - Pontex s. r. o.:
how to specify the page background for the first page only and how to start page numbering from the second page?
\defineoverlay[Bkg][\doif{\pagenumber}{1}{\externalfigure[cow]}]
\setupbackgrounds[paper][background=Bkg]
\starttext \noheaderandfooterlines \dorecurse{5}{\input knuth\par} \stoptext
If you want to create a title page (which may not be your intention), why not simply
\definemakeup[titlepage][align=middle] \defineoverlay[COW][\externalfigure[cow]]
\starttext \setupbackgrounds[page][background=COW] \starttitlepagemakeup A title \stoptitlepagemakeup \setupbackgrounds[page][background=] \setuppagenumbering[alternative=doublesided,way=bytext] \dorecurse{5}{\input knuth\par} \stoptext
-- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
... One more question. Let's have three cases - some of them hide the page number on the first page, some of them don't. The question is - why: ---- 1 - OK, no page number on page 1 \def\MyPageNumber#1{\doifelse{\pagenumber}{1}{}{\pagenumber}} % Testing \pagenumber \setuppagenumbering[location={footer,middle},command=\MyPageNumber] \starttext %\noheaderandfooterlines % COMMAND NOT USED \dorecurse{5}{\input knuth\par} \stoptext ---- ---- 2 - BAD, page number IS on page 1 \def\MyPageNumber#1{\doifelse{#1}{1}{}{\pagenumber}} % Testing #1 instead of \pagenumber \setuppagenumbering[location={footer,middle},command=\MyPageNumber] \starttext %\noheaderandfooterlines % COMMAND NOT USED \dorecurse{5}{\input knuth\par} \stoptext ---- ---- 3 - OK, no page number on page 1 \def\MyPageNumber#1{\doifelse{#1}{1}{}{\pagenumber}} % Testing #1 instead of \pagenumber \setuppagenumbering[location={footer,middle},command=\MyPageNumber] \starttext \noheaderandfooterlines % COMMAND IN USE \dorecurse{5}{\input knuth\par} \stoptext ---- So - 1) What exactly does \noheaderandfooterlines do? 2) Why testing the #1 argument in the case 2 doesn't work? TIA. Lukas -- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
Am 02.05.2012 um 15:49 schrieb Procházka Lukáš Ing. - Pontex s. r. o.:
... One more question. Let's have three cases - some of them hide the page number on the first page, some of them don't.
The question is - why:
---- 1 - OK, no page number on page 1 \def\MyPageNumber#1{\doifelse{\pagenumber}{1}{}{\pagenumber}} % Testing \pagenumber
\setuppagenumbering[location={footer,middle},command=\MyPageNumber]
\starttext %\noheaderandfooterlines % COMMAND NOT USED \dorecurse{5}{\input knuth\par} \stoptext ----
---- 2 - BAD, page number IS on page 1 \def\MyPageNumber#1{\doifelse{#1}{1}{}{\pagenumber}} % Testing #1 instead of \pagenumber
\setuppagenumbering[location={footer,middle},command=\MyPageNumber]
\starttext %\noheaderandfooterlines % COMMAND NOT USED \dorecurse{5}{\input knuth\par} \stoptext ----
---- 3 - OK, no page number on page 1 \def\MyPageNumber#1{\doifelse{#1}{1}{}{\pagenumber}} % Testing #1 instead of \pagenumber
\setuppagenumbering[location={footer,middle},command=\MyPageNumber]
\starttext \noheaderandfooterlines % COMMAND IN USE \dorecurse{5}{\input knuth\par} \stoptext ----
So -
1) What exactly does \noheaderandfooterlines do?
It disables the header/footer on the page where \noheaderandfooterlines was inserted.
2) Why testing the #1 argument in the case 2 doesn't work?
When you use “\pagenumber” you check the numeric value of the counter but when you check against “#1” you check again a formatted version of the pagenumber which can be colored or or even be a roman numeral which you have set with the conversion key. Wolfgang
... OK, thanks for the explanation. Best regards, Lukas
1) What exactly does \noheaderandfooterlines do?
It disables the header/footer on the page where \noheaderandfooterlines was inserted.
2) Why testing the #1 argument in the case 2 doesn't work?
When you use “\pagenumber” you check the numeric value of the counter but when you check against “#1” you check again a formatted version of the pagenumber which can be colored or or even be a roman numeral which you have set with the conversion key.
Wolfgang
-- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
Am 02.05.2012 um 16:22 schrieb Procházka Lukáš Ing. - Pontex s. r. o.:
... OK, thanks for the explanation.
You can look if this is useful for you (there is a example at the end of t-title.mkvi): https://bitbucket.org/wolfs/title Wolfgang
On Wed, 2 May 2012, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
Hello,
how to specify the page background for the first page only
Also see my replies in http://archive.contextgarden.net/thread/20120419.180814.c604f461.en.html#201... on how to achieve this using layers. Aditya
participants (5)
-
Aditya Mahajan
-
Alan BRASLAU
-
Marco
-
Procházka Lukáš Ing. - Pontex s. r. o.
-
Wolfgang Schuster