Hi, What's the way to test whether a page is a (start of a new) chapter page ? Didn't find it on&offline. -- Best, Alan
On Sat, Feb 14, 2009 at 11:57 AM, Wolfgang Schuster < schuster.wolfgang@googlemail.com> wrote:
Am 14.02.2009 um 11:46 schrieb Alan Stone:
What's the way to test whether a page is a (start of a new) chapter page ?
Didn't find it on&offline.
Why and for what do you need this information?
To put different text in the margin/edge top/header/... whether a page is a chapter page or not.
Wolfgang
Am 14.02.2009 um 12:57 schrieb Alan Stone:
What's the way to test whether a page is a (start of a new) chapter page ? Didn't find it on&offline.
Why and for what do you need this information?
To put different text in the margin/edge top/header/... whether a page is a chapter page or not.
\setupheadertexts[\doifoddpageelse{right page}{left page}] \definetext[chapter][header][chapter page] % The \definetext command works like \setup(header/footer/...)texts and % has 3–7 arguments, the first argument is a keyword (you can use whatever % you want, the second is the location of the text and all other arguments % are reseved for the content. \setuphead [chapter] [header=chapter] \starttext \dorecurse{2}{\chapter{Chapter #1}\dorecurse{20}{\input knuth\par}} \stoptext Wolfgang
On Sat, Feb 14, 2009 at 1:23 PM, Wolfgang Schuster < schuster.wolfgang@googlemail.com> wrote:
Am 14.02.2009 um 12:57 schrieb Alan Stone:
What's the way to test whether a page is a (start of a new) chapter page
? Didn't find it on&offline.
Why and for what do you need this information?
To put different text in the margin/edge top/header/... whether a page is a chapter page or not.
\setupheadertexts[\doifoddpageelse{right page}{left page}]
\definetext[chapter][header][chapter page]
% The \definetext command works like \setup(header/footer/...)texts and % has 3–7 arguments, the first argument is a keyword (you can use whatever % you want, the second is the location of the text and all other arguments % are reseved for the content.
from what I understand... - the location is limited to the text header/footer => what about margin/edge top/header/footer/bottom ? - all other arguments are reserved for content => for which content and where ? if i put \definetext[chapter][header][chapter page][x1][x2][x3][x4] the "chapter page" header is replaced by "right page" !?
\setuphead [chapter] [header=chapter]
\starttext \dorecurse{2}{\chapter{Chapter #1}\dorecurse{20}{\input knuth\par}} \stoptext
Wolfgang
___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net
___________________________________________________________________________________
-- Best, Alan * TeX engine = LuaTeX * ConTeXt minimals ver: 2009.01.18 14:39 MKIV fmt: 2009.1.22 int: english/english * Ubuntu 8.04 Hardy Heron, Windows XP SP3 Home
Am 14.02.2009 um 14:14 schrieb Alan Stone:
\setupheadertexts[\doifoddpageelse{right page}{left page}]
\definetext[chapter][header][chapter page]
% The \definetext command works like \setup(header/footer/...)texts and % has 3–7 arguments, the first argument is a keyword (you can use whatever % you want, the second is the location of the text and all other arguments % are reseved for the content.
from what I understand...
- the location is limited to the text header/footer => what about margin/edge top/header/footer/bottom ?
You can place text in the header, footer and text area: \definetext[text for header area][header][...] \definetext[text for text area] [text] [...] \definetext[text for footer area][footer][...] \setuphead [...] [header=text for header area, text=text for text area, fotter=text for header area] You can also control where the text in this area should appear: \definetext[text for header area][header][...] % centered text in the text column \definetext[text for header area][header][...][...] % left and right text in the text column \definetext[text for header area][header][text] [...][...] % left and right text in the text column \definetext[text for header area][header][margin][...][...] % left and right margin in the text column \definetext[text for header area][header][edge] [...][...] % left and right edge in the text column
- all other arguments are reserved for content => for which content and where ? if i put \definetext[chapter][header][chapter page][x1][x2][x3][x4] the "chapter page" header is replaced by "right page" !?
Your setting is ignored because with all seven argument the third one has to be either text, margin or edge. Wolfgang
Ahaaa... thanks for clearing up the mist. So that makes... \definetext[text for header/text/footer area][header/text/footer][edge/margin/text][left][right] What are arguments 6 and 7 for ? Alan On Sat, Feb 14, 2009 at 2:40 PM, Wolfgang Schuster < schuster.wolfgang@googlemail.com> wrote:
Am 14.02.2009 um 14:14 schrieb Alan Stone:
\setupheadertexts[\doifoddpageelse{right page}{left page}]
\definetext[chapter][header][chapter page]
% The \definetext command works like \setup(header/footer/...)texts and % has 3–7 arguments, the first argument is a keyword (you can use whatever % you want, the second is the location of the text and all other arguments % are reseved for the content.
from what I understand...
- the location is limited to the text header/footer => what about margin/edge top/header/footer/bottom ?
You can place text in the header, footer and text area:
\definetext[text for header area][header][...] \definetext[text for text area] [text] [...] \definetext[text for footer area][footer][...]
\setuphead [...] [header=text for header area, text=text for text area, fotter=text for header area]
You can also control where the text in this area should appear:
\definetext[text for header area][header][...] % centered text in the text column \definetext[text for header area][header][...][...] % left and right text in the text column \definetext[text for header area][header][text] [...][...] % left and right text in the text column \definetext[text for header area][header][margin][...][...] % left and right margin in the text column \definetext[text for header area][header][edge] [...][...] % left and right edge in the text column
- all other arguments are reserved for content => for which content and
where ? if i put \definetext[chapter][header][chapter page][x1][x2][x3][x4] the "chapter page" header is replaced by "right page" !?
Your setting is ignored because with all seven argument the third one has to be either text, margin or edge.
Wolfgang
Am 14.02.2009 um 15:33 schrieb Alan Stone:
Ahaaa... thanks for clearing up the mist. So that makes...
\definetext[text for header/text/footer area][header/text/footer][edge/margin/text][left][right]
What are arguments 6 and 7 for ?
To set different texts for left pages. Seldom needed because in a doublesided document a chapter start normally at a right page. Wolfgang
So it seems, although there's also \setuptop and \setupbottom, that definetext doesn't accept top and bottom. Any idea why that's so (samewise for setuphead which doesn't accept top and bottom arguments either, according to the manual) ? Alan On Sat, Feb 14, 2009 at 3:47 PM, Wolfgang Schuster < schuster.wolfgang@googlemail.com> wrote:
Am 14.02.2009 um 15:33 schrieb Alan Stone:
Ahaaa... thanks for clearing up the mist. So that makes...
\definetext[text for header/text/footer area][header/text/footer][edge/margin/text][left][right]
What are arguments 6 and 7 for ?
To set different texts for left pages. Seldom needed because in a doublesided document a chapter start normally at a right page.
Wolfgang
The underneath example works with \def\myHeader{\iftuut chapter\else high\fi} How do you make it work with\def\myHeader{\doifmodelse{a}{chapter}{high}} ? ( without resorting to \doifmodeelse{a}{\tuuttrue}{\tuutfalse} ) \showframe \newif\iftuut %\tuuttrue \tuutfalse \setuppagenumbering[location=footer] \setupheadertexts[\doifoddpageelse{right page}{left page}] \definetext[chapter][header][chapter page] \def\myHeader{\doifmodelse{a}{chapter}{high}} %\def\myHeader{\iftuut chapter\else high\fi} \setuphead [chapter] % [header=chapter] % [header=high] [header=\myHeader] \starttext \dorecurse{2}{\chapter{Chapter #1}\dorecurse{20}{\input knuth\par}} \stoptext --- ! Undefined control sequence. \myHeader ->\doifmodelse {a}{chapter}{high} \doifvaluesomething ...inga {\csname #1\endcsname }\ifx \!!stringa \empty \e... <argument> ...ething {\??ko \v!chapter \c!header } {\setuplayouttext [\v!hea... \firstoftwoarguments #1#2->#1 <argument> ...BB {\v!chapter }\v!header \c!header \dohandlepagebreakBB {\v!c... \firstofoneargument #1->#1 ... l.23 ...apter #1}\dorecurse{20}{\input knuth\par}} --- Alan
Am 14.02.2009 um 19:17 schrieb Alan Stone:
The underneath example works with \def\myHeader{\iftuut chapter\else high\fi}
How do you make it work with\def\myHeader{\doifmodelse{a}{chapter} {high}} ? ( without resorting to \doifmodeelse{a}{\tuuttrue}{\tuutfalse} )
[...]
! Undefined control sequence. \myHeader ->\doifmodelse
\doifmodeelse (a 'e' is missing in the command) Wolfgang
Unfortunately, it doesn't resolve the problem... ! Undefined control sequence. \cleanuplabel #1->\begingroup \let : \lettercolon \xdef \cleanlabel {#1}\endg... \docheckformode #1#2#3->\cleanuplabel {#3} \protect \checkedmodefalse \rawpro... \myHeader ->\doifmodeelse {a} {chapter}{high} \doifvaluesomething ...inga {\csname #1\endcsname }\ifx \!!stringa \empty \e... <argument> ...ething {\??ko \v!chapter \c!header } {\setuplayouttext [\v!hea... \firstoftwoarguments #1#2->#1 ... l.23 ...apter #1}\dorecurse{20}{\input knuth\par}} ? context.cmd --modes=a test Alan On Sat, Feb 14, 2009 at 7:28 PM, Wolfgang Schuster < schuster.wolfgang@googlemail.com> wrote:
Am 14.02.2009 um 19:17 schrieb Alan Stone:
The underneath example works with \def\myHeader{\iftuut chapter\else
high\fi}
How do you make it work with\def\myHeader{\doifmodelse{a}{chapter}{high}} ? ( without resorting to \doifmodeelse{a}{\tuuttrue}{\tuutfalse} )
[...]
! Undefined control sequence.
\myHeader ->\doifmodelse
\doifmodeelse (a 'e' is missing in the command)
Wolfgang
Am 14.02.2009 um 20:17 schrieb Alan Stone:
Unfortunately, it doesn't resolve the problem...
! Undefined control sequence. \cleanuplabel #1->\begingroup \let : \lettercolon \xdef \cleanlabel {#1}\endg... \docheckformode #1#2#3->\cleanuplabel {#3} \protect \checkedmodefalse \rawpro... \myHeader ->\doifmodeelse {a} {chapter}{high} \doifvaluesomething ...inga {\csname #1\endcsname }\ifx \!!stringa \empty \e... <argument> ...ething {\??ko \v!chapter \c!header } {\setuplayouttext [\v!hea... \firstoftwoarguments #1#2->#1
... l.23 ...apter #1}\dorecurse{20}{\input knuth\par}}
I had only looked at the error message and not at your example. Passing tests to values is often a problem because you don't know what happens in the internals and only only low level commands like \iftrue, \ifdim ... works without problems. The best you can do is to write: \startmode[a] \setuphead[chapter][header=chapter] \stopmode \startnotmode[a] \setuphead[chapter][header=high] \stopnotmode Wolfgang
I also would like to be able to choose a different font and/or fontsize (\switchtobodyfont[...]), style and/or color (\color[...]) for chapter pages' header area (margin/edge/text) and non-chapter pages. Hence, I guess... back to my initial question. Alan On Sat, Feb 14, 2009 at 1:23 PM, Wolfgang Schuster < schuster.wolfgang@googlemail.com> wrote:
Am 14.02.2009 um 12:57 schrieb Alan Stone:
What's the way to test whether a page is a (start of a new) chapter page
? Didn't find it on&offline.
Why and for what do you need this information?
To put different text in the margin/edge top/header/... whether a page is a chapter page or not.
\setupheadertexts[\doifoddpageelse{right page}{left page}]
\definetext[chapter][header][chapter page]
% The \definetext command works like \setup(header/footer/...)texts and % has 3–7 arguments, the first argument is a keyword (you can use whatever % you want, the second is the location of the text and all other arguments % are reseved for the content.
\setuphead [chapter] [header=chapter]
\starttext \dorecurse{2}{\chapter{Chapter #1}\dorecurse{20}{\input knuth\par}} \stoptext
Wolfgang
Am 14.02.2009 um 20:26 schrieb Alan Stone:
I also would like to be able to choose a different font and/or fontsize (\switchtobodyfont[...]), style and/or color (\color[...]) for chapter pages' header area (margin/edge/text) and non-chapter pages.
You can format the text in \definetext. \startsetups header:chapter:middle \startcolor[red] \it Chapter page \stopcolor \stopsetups \definetext[chapter][header][\setups{chapter:header:middle}] Wolfgang
On Sun, Feb 15, 2009 at 11:04 AM, Wolfgang Schuster < schuster.wolfgang@googlemail.com> wrote:
You can format the text in \definetext.
\startsetups header:chapter:middle \startcolor[red] \it Chapter page \stopcolor \stopsetups
\definetext[chapter][header][\setups{chapter:header:middle}]
Das ist ubersupercool ! :O) Thanks, Alan
Wolfgang
participants (2)
-
Alan Stone
-
Wolfgang Schuster