Dear syndicate, For a book cover I want a green-colored rectangular band, centered, at the very top of the page, with text in some other color (to be determined) overlapping the band. The band is small, just, say, 2cm high and 12 cm wide. Since it's at the top it is surrounded by white on only three sides. I'm not even sure where to get started here (I don't think the LaTeX Graphics Companion will be much help:->) Here is part of my present layout. I'll have to put this band in the topspace and increase it, I presume: \definepapersize[journal][width=5.5in, height=8.5in] \setuppapersize[journal][letter] \setuplayout[width=middle, | height=19cm, | footer=0cm, | header=0cm, | topspace=28pt, | location={middle,doublesided}, | marking=on] I hope the solution is Plain-compatible since I may have to use Gamma for some Arabic insertions. Otherwise I'll have to eps those insertions. Thnx in advance Idris
Idris S Hamid wrote:
Dear syndicate,
For a book cover I want a green-colored rectangular band, centered, at the very top of the page, with text in some other color (to be determined) overlapping the band. The band is small, just, say, 2cm high and 12 cm wide. Since it's at the top it is surrounded by white on only three sides. I'm not even sure where to get started here
How about using layers and a grid for your cover page. You might try: \setuplayout[grid=yes,columns=Some-Value, columndistance=Some-Value] \definelayer[page] \setupbackgrounds[pagegraphics] [background=pagegraphics] % I'm not %100 sure here-- see details.pdf regarding overlays and ornaments \setlayer[page][location=grid, column=Your-Column-Choice, line=The-base-line-for-your-color-band] % line= 4? {\framed[height=2cm,width=12cm,frame=off,background=color,backgroundcolor=green, foregroundcolor=Your-Color] {Your-Text}} I had some luck this way making handouts for classes. I don't know if it will work with your Omega/Gamma setup though. You'll also need to make sure that layers are supported in your version of ConTeXt. I had to upgrade mine before it would work. You should check out details.pdf if you haven't done so already. Hans has given some good examples there. Best Wishes, Matt
Idris S Hamid
Dear syndicate,
For a book cover I want a green-colored rectangular band, centered, at the very top of the page, with text in some other color (to be determined) overlapping the band. The band is small, just, say, 2cm high and 12 cm wide. Since it's at the top it is surrounded by white on only three sides. I'm not even sure where to get started here (I don't think the LaTeX Graphics Companion will be much help:->)
The LaTeX Graphics Companion always helps; in this case chapter 3. In chapter 3, you'll find an excellent package called mfpic (I've been meaning to trial it with ConTeXt, but have just put it off). The package mfpic is plain-compatible and is a much better solution to the one I'm posting. Note: this is a plain-TeX file and should be run with command the pdfTeX. If this file doesn't work on your system, it's because to get the kind of access privileges to run it, you may have to sleep with your computer technician. ----- %output=pdf \input supp-pdf \immediate\openout0=\jobname.mp \toks0={beginfig(1) verbatimtex \font\titlefont=cmr7 scaled \magstep 5 etex ; fill unitsquare xscaled 12cm yscaled 2cm withcolor 0.5green ; label.top(btex \titlefont My label etex,(6cm,0.5cm)) withcolor white; endfig; end .} \immediate\write0{\the\toks0} \immediate\closeout0 \immediate\write18{mpost \jobname.mp} \centerline{\convertMPtoPDF{\jobname.1}{1}{1}} \vskip 3cm \noindent MY ABSTRACT \bye ----- Although the metapost graphic looks imposing, it is fairly self-contained, with the title font switch (\titlefont) declared in the verbatimtex block, and the position of the title text inside the green rectangular band being positioned manually at (6cm,0.5cm). Similary, I've chosen the color of the rectangle by eye (0.5green) and the color of the text (white).
[snipped]
If you're having trouble with the \shipout routine, best follow up to comp.text.tex (even though Hans Hagen's handle on plain-TeX is second only to DEK's).
Guy Worthington wrote:
If you're having trouble with the \shipout routine, best follow up to comp.text.tex (even though Hans Hagen's handle on plain-TeX is second only to DEK's).
This may be politically incorrect, but after watching Hans sometimes I think its DEK who is in second place! Idris
Hello Idris, I don't know where exactly you want the green-colored rectangular band. Perhaps this one will do what you need: \defineoverlay[helloidris][{\red Hello Idris}] \setupcolors[state=start] \showframe \starttext \setuplayout[top=3cm] \setupbackgrounds[top][text] [background={color,helloidris},backgroundcolor=green] \input tufte \stoptext Patrick
Dear gang, Thanks for all the responses; I'll look at them closely. Still no internet at home so I worked out a couple of things earlier before getting to my email. Some problems are solved, others remain. In particular, the key, backgroundcolor=<color>, appears to be broken. Here is the relevant code for my cover: ========================= %\setupoutput[pdftex] % \definepapersize[journal][width=5.5in, height=8.5in] \setuppapersize[journal][letter] \setuplayout[top=2cm,marking=on] % \setuppagenumber[state=stop] \def\ALAVIband{\midaligned{ | \vbox{\hsize=7cm | \setupcolors[state=start] | \setupbackground[ | foregroundcolor=darkgreen, | backgroundcolor=darkyellow | ] | \startbackground | \hbox{}\vskip14pt | \midaligned{\tfa THE ALAVI FOUNDATION} | \stopbackground | } | } | } \setuptoptexts[\ALAVIband] \defineoverlay[backgr][{\externalfigure[mbor-026.eps]}] \setupbackgrounds[page][leftedge][background=backgr,backgroundcolor=darkgreen] \starttext \input tufte \stoptext ========================= Problems: 1. For the def. of \ALAVIband, the key, backgroundcolor=darkyellow, does not work; I still get grey. 2. For overlay I want to something different for the front and back cover; in the above example they are combined. Overlaying an eps appears to work as expected. But overlaying the entire page in some color does not work at all. Again, the key, backgroundcolor=darkyellow, does not work; 3. Is there a way to precisely make the top of the \ALAVIband flush with the top edge of the paper? If you change \hsize in the \vbox to 15cm, you will see that the grey band is just higher than the crop marks. Thanks to all for their kind help. Best Idris
Sunday, March 23, 2003 Idris S Hamid wrote: ISH> 1. For the def. of \ALAVIband, the key, ISH> backgroundcolor=darkyellow, does not work; I still get grey. You need to specify both background=color and backgroundcolor=darkyellow, AFAIK. -- Giuseppe "Oblomov" Bilotta
You need to specify both background=color and backgroundcolor=darkyellow, AFAIK.
I just tried this, now I lose the (formerly grey) background band completey; and there is no effect in the overlay: ============== \def\ALAVIband{\midaligned{ | \vbox{\hsize=15cm | \setupcolors[state=start] | \setupbackground[background=color, %%% your change | foregroundcolor=darkgreen, | backgroundcolor=darkblue | ] | \startbackground | \hbox{}\vskip14pt | \midaligned{\tfa THE ALAVI FOUNDATION} | \stopbackground | } | } | } ------- \setupbackgrounds[page][leftedge][background=color, %%% your change | background=backgr, | backgroundcolor=darkgreen] ============== Any ideas? Best Idris
Sunday, March 23, 2003 Idris S Hamid wrote:
You need to specify both background=color and backgroundcolor=darkyellow, AFAIK.
ISH> I just tried this, now I lose the (formerly grey) background band ISH> completey; and there is no effect in the overlay: ISH> ============== ISH> \def\ALAVIband{\midaligned{ ISH> | \vbox{\hsize=15cm ISH> | \setupcolors[state=start] ISH> | \setupbackground[background=color, %%% your change ISH> | foregroundcolor=darkgreen, ISH> | backgroundcolor=darkblue ISH> | ] ISH> | \startbackground ISH> | \hbox{}\vskip14pt ISH> | \midaligned{\tfa THE ALAVI FOUNDATION} ISH> | \stopbackground ISH> | } ISH> | } ISH> | } Looks like a bug in the backgrounds system. In the mean time, what about this? \defineframed[alaviframe][ frame=off, background=color, backgroundcolor=yellow, foregroundcolor=darkgreen, align=middle, foregroundstyle=\tfa, width=15cm, ] \def\ALAVIband{% \alaviframe{\noindent\vskip14pt THE ALAVI FOUNDATION} }
Monday, March 24, 2003 Giuseppe Bilotta wrote: GB> Sunday, March 23, 2003 Idris S Hamid wrote:
You need to specify both background=color and backgroundcolor=darkyellow, AFAIK.
ISH>> I just tried this, now I lose the (formerly grey) background band ISH>> completey; and there is no effect in the overlay: GB> Looks like a bug in the backgrounds system. I think I spotted the error: Hans, it seems that localframed stuff doesn't look for the achtergrondkleur anywhere ... -- Giuseppe "Oblomov" Bilotta
At 12:07 AM 3/24/2003 +0100, you wrote:
Sunday, March 23, 2003 Idris S Hamid wrote:
You need to specify both background=color and backgroundcolor=darkyellow, AFAIK.
ISH> I just tried this, now I lose the (formerly grey) background band ISH> completey; and there is no effect in the overlay:
ISH> ============== ISH> \def\ALAVIband{\midaligned{ ISH> | \vbox{\hsize=15cm ISH> | \setupcolors[state=start] ISH> | \setupbackground[background=color, %%% your change ISH> | foregroundcolor=darkgreen, ISH> | backgroundcolor=darkblue ^ put the, or ] here
otherwise the color is "darkblue " which is not defined Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------
Hans Hagen wrote:
ISH> ============== ISH> \def\ALAVIband{\midaligned{ ISH> | \vbox{\hsize=15cm ISH> | \setupcolors[state=start] ISH> | \setupbackground[background=color, %%% your change ISH> | foregroundcolor=darkgreen, ISH> | backgroundcolor=darkblue ^ put the, or ] here
This is interesting. So there cannot be any space between the last key of an option set and the <]> that ends that option set. But what about overlays over color. They still don't work: ================ %\setupoutput[pdftex] % \definepapersize[journal][width=5.5in, height=8.5in] \setuppapersize[journal][letter] \setuplayout[top=2cm,marking=on,width=middle,location=middle] % \setuppagenumber[state=stop] \defineoverlay[backgr][{\externalfigure[elements2.eps]}] \setupbackgrounds[page][leftedge][background=color, background=backgr, backgroundcolor=green] \starttext \input tufte \stoptext =============== I get the backgr image but not the color. Best Idris
At 08:31 AM 3/25/2003 -0700, you wrote:
\defineoverlay[backgr][{\externalfigure[elements2.eps]}] \setupbackgrounds[page][leftedge][background=color, background=backgr, backgroundcolor=green]
....,background={color,backgr},.... ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------
Idris S Hamid
But what about overlays over color. They still don't work:
There are two problems here. First, say background={color,backgr} with setupbackgrounds. But this won't help ;-) since the setupbackground is sometimes a bit strange (see below). I bet the leftedge is 0pt (test with showmakeup or my t-layout module, say \ShowModule[showmore=1]) so you won't be able to see anything colored. \setupbackgrounds[text][leftmargin][background={color,backgr}, backgroundcolor=green] When you use \setupbackgrounds[page]... you access the whole page (!). Not just any margin or textarea. So there you probably need some metapost hacking (easy) in order to get your green side. See the metafun manual or my page.pdf. Patrick
Patrick Gundlach wrote:
Idris S Hamid
writes: Hello Idris,
But what about overlays over color. They still don't work:
There are two problems here. First, say background={color,backgr} with setupbackgrounds. But this won't help ;-) since the setupbackground is sometimes a bit strange (see below).
I bet the leftedge is 0pt (test with showmakeup or my t-layout module, say \ShowModule[showmore=1]) so you won't be able to see anything colored.
I don't get this. My background image comes out at the center of the page; why doesn't the color follow suit? Anyway, \defineoverlay[backgr][{\externalfigure[elements2.eps]}] \setupbackgrounds[text][leftmargin][background={color,backgr}, backgroundcolor=green] still gives me no overlayed color.
When you use \setupbackgrounds[page]... you access the whole page (!). Not just any margin or textarea. So there you probably need some metapost hacking (easy) in order to get your green side. See the metafun manual or my page.pdf.
I don't know metapost (yet, its on my to-learn list); is there something I can do to get this solved in the meantime? Sincere Thnx to all for their help Idris
On Tue, 25 Mar 2003 15:25:10 -0700
Idris S Hamid
I don't get this. My background image comes out at the center of the page; why doesn't the color follow suit?
Sorry, I haven't been following this thread, but I have an example of backgrounds, layers, and x-y positioning on my page: http://home.salamander.com/~wmcclain/context-help.html The general method I use is something like: \useexternalfigure[mars-graphic][marsphoto][type=png, width=1.6049in, height=1.6049in] \definelayer[mars-layer] \defineoverlay[mars-overlay][\composedlayer{mars-layer}] \setupbackgrounds[page][background={...,mars-overlay,...}] \setlayer[mars-layer][x=0.8333in,y=6.395in]{\externalfigure[mars-graphi c]} where "..." indicates other overlays. For the actual background I use an image that simply contains the color I need. -Bill -- Sattre Press Pagan Papers http://sattre-press.com/ by Kenneth Grahame info@sattre-press.com http://pp.sattre-press.com/
Idris S Hamid
I don't get this. My background image comes out at the center of the page; why doesn't the color follow suit?
\setupbackgrounds[page][ignored][background={color,backgr},backgroundcolor=blue] should give you a blue page with the backgr overlay. The following code should give you a white page with some text and a left green margin with "Picture" text. ================================================== \setupcolors[state=start] \defineoverlay[backgr][Picture] \setupbackgrounds[text][leftmargin][background={color,backgr}, backgroundcolor=green] \starttext Hello, Idris. \stoptext ==================================================
still gives me no overlayed color. you have set \setupcolors[state=start] ?
I don't know metapost (yet, its on my to-learn list); is there something I can do to get this solved in the meantime?
Yes: write exactly where you want which color (margin, edge, top.... ) and we provide you a simple metapost code :) Patrick
Patrick Gundlach wrote:
still gives me no overlayed color. you have set \setupcolors[state=start] ?
That was the culprit, apparently. I defined it in my definition for the color band but since it was grouped in that def it did not transfer. Now the original [page] option works as expected; [text] [leftmargin] places color in the left margin. This is the working file, if any wants to play with it: Best wishes Idris ================== %\setupoutput[pdftex] % \definepapersize[journal][width=5.5in, height=8.5in] \setuppapersize[journal][letter] \setuplayout[top=2cm,marking=on,width=middle,location=middle] % \setuppagenumber[state=stop] \def\ALAVIband{\midaligned{ \vbox{\hsize=7cm \setupcolors[state=start] \setupbackground[background=color, foregroundcolor=white, backgroundcolor=blue, ] \startbackground \hbox{}\vskip14pt \midaligned{\tfa THE ALAVI FOUNDATION} \stopbackground } } } \setuptoptexts[\ALAVIband] \defineoverlay[backgr][{\externalfigure[elements2.eps]}] \setupcolors[state=start] \setupbackgrounds[page][leftmargin][background={color,backgr}, backgroundcolor=green] \starttext \input tufte \stoptext ==================
Idris S Hamid
That was the culprit, apparently.
nice to hear its working. [...]
Now the original [page] option works as expected; [text] [leftmargin] places color in the left margin. This is the working file, if any wants to play with it:
It gets spread on the whole page when I run your ConTeXt file. Strange. Patrick
Patrick Gundlach wrote:
Now the original [page] option works as expected; [text] [leftmargin] places color in the left margin. This is the working file, if any wants to play with it:
It gets spread on the whole page when I run your ConTeXt file. Strange.
Here is my version from log: This is pdfeTeX, Version 3.14159-pre-1.0-unofficial-20010704-2.1 (Web2c 7.3.3.1) (format=cont-en 2003.2.13) 27 MAR 2003 14:19 : ConTeXt ver: 2003.2.11 fmt: 2003.2.13 int: english mes: english Maybe one of us has a bug... Best wishes, and thnx again 4 your help. Idris
At 08:42 AM 3/27/2003 -0700, you wrote: \startsetups[Aband]
\midaligned{ ^ in your current version this will lead to a funny space
\vbox{\hsize=7cm \setupcolors[state=start] \setupbackground[background=color, foregroundcolor=white, backgroundcolor=blue, ]
\startbackground \hbox{}\vskip14pt \midaligned{\tfa THE ALAVI FOUNDATION}
\stopbackground } }
\stopsetups
\setuptoptexts[\ALAVIband]
\setuptoptexts[\setups{Aband}] looks more readable and is also not sensible for spaces and empty lines Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------
Thnx once again to everyone who helped. Your suggestions will all help me improve things immensely beyond the initial ideas I submitted. Thnx again Idris
At 06:14 PM 3/25/2003 +0100, you wrote:
Idris S Hamid
writes: Hello Idris,
But what about overlays over color. They still don't work:
There are two problems here. First, say background={color,backgr} with setupbackgrounds. But this won't help ;-) since the setupbackground is sometimes a bit strange (see below).
I bet the leftedge is 0pt (test with showmakeup or my t-layout module, say \ShowModule[showmore=1]) so you won't be able to see anything colored.
\setupbackgrounds[text][leftmargin][background={color,backgr}, backgroundcolor=green]
When you use \setupbackgrounds[page]... you access the whole page (!). Not just any margin or textarea. So there you probably need some metapost hacking (easy) in order to get your green side. See the metafun manual or my page.pdf.
it may help to know that there is a predefined path OverlayBox: \startuniqueMPgraphic{myback} fill OverlayBox withcolor red ; \stopuniqueMPgraphic or fill OverlayBox enlarged 2pt withcolor red (for a bleed) or fill OverlayBox leftenlarged 3pt ... setbounds currentpicture to OverlayBox or StartPage ; ... StopPage ; if needed : setbounds currentpicture to Page ; also, you can say: \setuplayout[clipoffset=3pt] to get nicely clipped pages Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------
Idris S Hamid
ISH> | foregroundcolor=darkgreen, ISH> | backgroundcolor=darkblue ^ put the, or ] here
This is interesting. So there cannot be any space between the last key of an option set and the <]> that ends that option set.
you can say \something[a=b, c=d, ] Patrick
participants (7)
-
Bill McClain
-
Giuseppe Bilotta
-
Guy Worthington
-
Hans Hagen
-
Idris S Hamid
-
Matthew Huggett
-
Patrick Gundlach