Hi, I have a new book to design, but I don't know how to do page/content conditional processing). Please help me:) - I want my chapter page (first page of each chapter) to be really distinctive. that is, I define a dark color background, and want all the text on the first page set in white. how can I do that? for example \chapter{hello} \dorecurse{10}{\input zapf } % all the characters in the first page should white, others should set in black. - I want to insert graphics and images. all the graphics are inserted using \placeexternalfigures. I want all the pages where the insertion happens to be quite distictive (that is, have a very narrow text layout, and leave the large margin for the figures. However, when a page starts, TeX does not know wheter or not an external figure will be placed on this page, so it really has no idea whether this page should be set narrower or not..... how can I do that? Thanks. Yue Wang
anyone can help? thanks.
On Thu, May 21, 2009 at 9:25 AM, Yue Wang
Hi,
I have a new book to design, but I don't know how to do page/content conditional processing). Please help me:)
- I want my chapter page (first page of each chapter) to be really distinctive. that is, I define a dark color background, and want all the text on the first page set in white. how can I do that? for example \chapter{hello} \dorecurse{10}{\input zapf } % all the characters in the first page should white, others should set in black.
- I want to insert graphics and images. all the graphics are inserted using \placeexternalfigures. I want all the pages where the insertion happens to be quite distictive (that is, have a very narrow text layout, and leave the large margin for the figures. However, when a page starts, TeX does not know wheter or not an external figure will be placed on this page, so it really has no idea whether this page should be set narrower or not..... how can I do that?
Thanks.
Yue Wang
On Thu, May 21, 2009 at 9:25 AM, Yue Wang
Hi,
I have a new book to design, but I don't know how to do page/content conditional processing). Please help me:)
- I want my chapter page (first page of each chapter) to be really distinctive. that is, I define a dark color background, and want all the text on the first page set in white. how can I do that? for example \chapter{hello} \dorecurse{10}{\input zapf } % all the characters in the first page should white, others should set in black. This must have something to do with the OTR, I'm really not good at that.
By \definecolor[black][r=1, g=1, b=1] you can get white texts which maybe useful for you.
- I want to insert graphics and images. all the graphics are inserted using \placeexternalfigures. I want all the pages where the insertion happens to be quite distictive (that is, have a very narrow text layout, and leave the large margin for the figures. However, when a page starts, TeX does not know wheter or not an external figure will be placed on this page, so it really has no idea whether this page should be set narrower or not..... how can I do that?
Sounds like an \insert like footnote. Good luck.
Thanks.
Yue Wang ___________________________________________________________________________________ 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 Regards Chen ---------------------------------------------------------------- Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn ----------------------------------------------------------------
On Sun, May 24, 2009 at 12:49 AM, Zhichu Chen
On Thu, May 21, 2009 at 9:25 AM, Yue Wang
wrote: Hi,
I have a new book to design, but I don't know how to do page/content conditional processing). Please help me:)
- I want my chapter page (first page of each chapter) to be really distinctive. that is, I define a dark color background, and want all the text on the first page set in white. how can I do that? for example \chapter{hello} \dorecurse{10}{\input zapf } % all the characters in the first page should white, others should set in black. This must have something to do with the OTR, I'm really not good at that.
By \definecolor[black][r=1, g=1, b=1] you can get white texts which maybe useful for you.
confused. can you give me an example?
- I want to insert graphics and images. all the graphics are inserted using \placeexternalfigures. I want all the pages where the insertion happens to be quite distictive (that is, have a very narrow text layout, and leave the large margin for the figures. However, when a page starts, TeX does not know wheter or not an external figure will be placed on this page, so it really has no idea whether this page should be set narrower or not..... how can I do that?
Sounds like an \insert like footnote. Good luck.
Yes. but a footnote on margin...
Thanks.
Yue Wang ___________________________________________________________________________________ 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 Regards Chen ----------------------------------------------------------------
Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn ---------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________
Am 21.05.2009 um 03:25 schrieb Yue Wang:
Hi,
I have a new book to design, but I don't know how to do page/content conditional processing). Please help me:)
- I want my chapter page (first page of each chapter) to be really distinctive. that is, I define a dark color background, and want all the text on the first page set in white. how can I do that? for example \chapter{hello} \dorecurse{10}{\input zapf } % all the characters in the first page should white, others should set in black.
Took me a while but with the help of the MkII/IV manual I was able to implement the chapter layout. \enableattributeinheritance \newif\ifchapterpage \installpagehandler{color}% {\dowithnextbox {\ifchapterpage \actualshipout {\framed[background=color,backgroundcolor=black,foregroundcolor=white] {\attributedbox\nextbox}} \else \actualshipout{\flushnextbox} \fi\global\chapterpagefalse} \normalhbox} \starttext \setuppaper[method=color] \subject{Tufte}\chapterpagetrue \dorecurse{10}{\input tufte\par} \page \setuppaper[method=color] \subject{Knuth}\chapterpagetrue \dorecurse{10}{\input knuth\par} \stoptext Wolfgang
As you said before, in my problem, this kind of handler could break something
like hyper-links, and I assume Yue wanted those kind of stuffs.
Maybe just a \start(stop)setups which changes the background back to normal
and \prependtoks it to some token list. So is there an \everypage or
\everyshipout
token? Then using \setuphead (I don't know if it's appropriate) or
\appendtoks to
every title page.
On Sun, May 24, 2009 at 1:34 AM, Wolfgang Schuster
Took me a while but with the help of the MkII/IV manual I was able to implement the chapter layout.
\enableattributeinheritance
\newif\ifchapterpage
\installpagehandler{color}% {\dowithnextbox {\ifchapterpage
\actualshipout{\framed[background=color,backgroundcolor=black,foregroundcolor=white]{\attributedbox\nextbox}} \else \actualshipout{\flushnextbox} \fi\global\chapterpagefalse} \normalhbox}
\starttext
\setuppaper[method=color]
\subject{Tufte}\chapterpagetrue
\dorecurse{10}{\input tufte\par}
\page
\setuppaper[method=color]
\subject{Knuth}\chapterpagetrue
\dorecurse{10}{\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 Regards Chen ---------------------------------------------------------------- Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn ----------------------------------------------------------------
Am 24.05.2009 um 06:12 schrieb Zhichu Chen:
As you said before, in my problem, this kind of handler could break something like hyper-links, and I assume Yue wanted those kind of stuffs.
I don't think this is a problem for this example because the page dimension are always the same while in the code for you the real and the calculated coordinates are different.
Maybe just a \start(stop)setups which changes the background back to normal and \prependtoks it to some token list. So is there an \everypage or \everyshipout token? Then using \setuphead (I don't know if it's appropriate) or \appendtoks to every title page.
I posted a code to enable/disable the backgroundcolor for certain pages not so long ago, take a look in the mail archive. Wolfgang
On Sun, May 24, 2009 at 4:00 PM, Wolfgang Schuster
Am 24.05.2009 um 06:12 schrieb Zhichu Chen:
As you said before, in my problem, this kind of handler could break something like hyper-links, and I assume Yue wanted those kind of stuffs.
I don't think this is a problem for this example because the page dimension are always the same while in the code for you the real and the calculated coordinates are different.
Maybe just a \start(stop)setups which changes the background back to normal and \prependtoks it to some token list. So is there an \everypage or \everyshipout token? Then using \setuphead (I don't know if it's appropriate) or \appendtoks to every title page.
I posted a code to enable/disable the backgroundcolor for certain pages not so long ago, take a look in the mail archive.
Found it. Well, then it's just as easy as it sounds: \unprotect \let\!!savedbackgroundcolor\empty \def\onbackground {\globallet\@@mapagebackgroundcolor\!!savedbackgroundcolor} \def\offbackground {\globallet\!!savedbackgroundcolor\@@mapagebackgroundcolor \globalletempty\@@mapagebackgroundcolor} \def\nobackground {\globallet\@@mapagebackgroundcolor\!!savedbackgroundcolor \globalletempty\@@mapagebackgroundcolor \appendtoks\globallet\@@mapagebackgroundcolor\!!savedbackgroundcolor\to\afterpage} \def\gobackground {\globallet\@@mapagebackgroundcolor\!!savedbackgroundcolor \appendtoks\globalletempty\@@mapagebackgroundcolor\to\afterpage} \protect \setuphead [chapter] [before=\gobackground] \setupcolors[state=start] \setupbackgrounds[page][background=color,backgroundcolor=lightgray]\offbackground \starttext \chapter{hello} \dorecurse{10}{\input zapf\par} \chapter{hello} \dorecurse{10}{\input zapf\par} \chapter{hello} \dorecurse{10}{\input zapf\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 Regards Chen ---------------------------------------------------------------- Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn ----------------------------------------------------------------
Am 24.05.2009 um 10:46 schrieb Zhichu Chen:
Maybe just a \start(stop)setups which changes the background back to normal and \prependtoks it to some token list. So is there an \everypage or \everyshipout token? Then using \setuphead (I don't know if it's appropriate) or \appendtoks to every title page.
I posted a code to enable/disable the backgroundcolor for certain pages not so long ago, take a look in the mail archive.
Found it. Well, then it's just as easy as it sounds:
This could be the better method for the background color (when the code is rewritten in a better style) but to change the textcolor you need my other code. Wolfgang
On Sun, May 24, 2009 at 4:57 PM, Wolfgang Schuster
Am 24.05.2009 um 10:46 schrieb Zhichu Chen:
Maybe just a \start(stop)setups which changes the background back to normal and \prependtoks it to some token list. So is there an \everypage or \everyshipout token? Then using \setuphead (I don't know if it's appropriate) or \appendtoks to every title page.
I posted a code to enable/disable the backgroundcolor for certain pages not so long ago, take a look in the mail archive.
Found it. Well, then it's just as easy as it sounds:
This could be the better method for the background color (when the code is rewritten in a better style) but to change the textcolor you need my other code.
Yes, I noticed that. I added the foregroundcolor part to your code but only pagenumbers are affected. And by appending \setuppapersize [A4][A4,negative] to \afterpage gives a really weird result....
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 Regards Chen ---------------------------------------------------------------- Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn ----------------------------------------------------------------
Zhichu Chen wrote:
As you said before, in my problem, this kind of handler could break something like hyper-links, and I assume Yue wanted those kind of stuffs.
Maybe just a \start(stop)setups which changes the background back to normal and \prependtoks it to some token list. So is there an \everypage or \everyshipout token? Then using \setuphead (I don't know if it's appropriate) or \appendtoks to every title page.
something like state=once would be handy but i'm not going to touch that code till i'm redoing some page-* code in mkiv Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Sun, May 24, 2009 at 6:36 PM, Hans Hagen
something like state=once would be handy but i'm not going to touch that code till i'm redoing some page-* code in mkiv
I don't get it, the "once" made me confused. Should that just be "affectedpage=current" or "range={1,2,15}" which will make more sense to me. I don't know the range for "once" Anyway, hi Yue, this small test file may be useful: % \tracingmacros=2 \def\Reverse {\global\negateprintboxtrue \appendtoks\global\negateprintboxfalse\to\afterpage} \setuphead [chapter] [before=\Reverse] \setupcolors[state=start] \starttext \dorecurse{10}{\input zapf\par} \chapter{hello} \dorecurse{10}{\input zapf\par} \chapter{hello} \dorecurse{10}{\input zapf\par} \chapter{hello} \dorecurse{10}{\input zapf\par} \stoptext
Hans
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ 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 Regards Chen ---------------------------------------------------------------- Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn ----------------------------------------------------------------
Zhichu Chen wrote:
On Sun, May 24, 2009 at 6:36 PM, Hans Hagen
wrote: something like state=once would be handy but i'm not going to touch that code till i'm redoing some page-* code in mkiv I don't get it, the "once" made me confused. Should that just be "affectedpage=current" or "range={1,2,15}" which will make more sense to me. I don't know the range for "once"
well, we have already state=repeat: same background each upcoming page state=start : enable background (calculate each time) state=stop : disable backgrond so we would have state=once : enable background and after this page disable it in this case 'once' is kind of "start" before and "stop" after \page a range makes not much sense as one seldom knows the page in advance so that would then be named pages; however, as we have 25 page areas it would involve more testing then i currently want to do (the otr is already not that fast) ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Am 25.05.2009 um 08:55 schrieb Zhichu Chen:
On Sun, May 24, 2009 at 6:36 PM, Hans Hagen
wrote: something like state=once would be handy but i'm not going to touch that code till i'm redoing some page-* code in mkiv
I don't get it, the "once" made me confused. Should that just be "affectedpage=current" or "range={1,2,15}" which will make more sense to me. I don't know the range for "once"
Anyway, hi Yue, this small test file may be useful:
Very nice but it shows only up in Adobe Reader and you can't select the color for the background. Wolfgang
On Mon, May 25, 2009 at 3:12 PM, Hans Hagen
well, we have already
state=repeat: same background each upcoming page state=start : enable background (calculate each time) state=stop : disable backgrond
so we would have
state=once : enable background and after this page disable it
in this case 'once' is kind of "start" before and "stop" after \page
Cool, I'm looking forward to that.
a range makes not much sense as one seldom knows the page in advance so that would then be named pages; however, as we have 25 page areas it would involve more testing then i currently want to do (the otr is already not that fast)
No we won't know the page numbers so forget mine. There's just one other thing: since we are changing background colors, we probably need the text colors to be changed as well. But by searching the sources, I only get the negative color scheme which is some sort of pdf specials or gs specials. I mean can we just customize such configurations ourselves? Like colorscheme={inverse+0.1} will inverse the color and reduce the RGB value to 10%. Then my little test file could make more useful.
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ 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 Regards Chen ---------------------------------------------------------------- Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn ----------------------------------------------------------------
On Mon, May 25, 2009 at 3:30 PM, Wolfgang Schuster
Am 25.05.2009 um 08:55 schrieb Zhichu Chen:
On Sun, May 24, 2009 at 6:36 PM, Hans Hagen
wrote: something like state=once would be handy but i'm not going to touch that code till i'm redoing some page-* code in mkiv
I don't get it, the "once" made me confused. Should that just be "affectedpage=current" or "range={1,2,15}" which will make more sense to me. I don't know the range for "once"
Anyway, hi Yue, this small test file may be useful:
Very nice
Thank you:)
but it shows only up in Adobe Reader I don't know what's that mean.
and you can't select the color for the background. No, I can't. I'm trying to figure out how to make a more interesting test file.
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 Regards Chen ---------------------------------------------------------------- Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn ----------------------------------------------------------------
Am 25.05.2009 um 09:42 schrieb Zhichu Chen:
but it shows only up in Adobe Reader I don't know what's that mean.
You have to view the PDF view Adobe Reader to see effect for the chapter page, when I open the file with Preview App the chapter page has black text on a white background. Wolfgang
Am 25.05.2009 um 09:12 schrieb Hans Hagen:
well, we have already
state=repeat: same background each upcoming page state=start : enable background (calculate each time) state=stop : disable backgrond
These settings have no effect on the background color, you can control with them only the background layer (overlays) :( Wolfgang
Wolfgang Schuster wrote:
Am 25.05.2009 um 09:12 schrieb Hans Hagen:
well, we have already
state=repeat: same background each upcoming page state=start : enable background (calculate each time) state=stop : disable backgrond
These settings have no effect on the background color, you can control with them only the background layer (overlays) :(
ok well, i mostly use overlays for background colors anyway -) ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (4)
-
Hans Hagen
-
Wolfgang Schuster
-
Yue Wang
-
Zhichu Chen