From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/8920 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: please keep message small (>40K is rejected) Date: Mon, 05 Aug 2002 00:01:07 +0200 Sender: owner-ntg-context@let.uu.nl Message-ID: <5.1.0.14.1.20020805000045.02dd4ec8@remote-1> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Trace: main.gmane.org 1035399284 31457 80.91.224.250 (23 Oct 2002 18:54:44 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 18:54:44 +0000 (UTC) Original-To: ntg-context@ntg.nl Xref: main.gmane.org gmane.comp.tex.context:8920 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:8920 To: ntg-context-approval@let.uu.nl Subject: BOUNCE ntg-context@let.uu.nl: Message too long (>40000 chars) > Hello again, > > after editing a few simple documents with ConTeXt. I want to imitate some > house style that my company uses for courses. I was able to imitate the >style quite well: headers, footers, fonts, colors ... great!! But ... >(there's always a but ;-)) ... > >Every chapter of the style occupies a page and its some sort of drawing. The >chapter number and the chapter text go in a specific location within this >drawing (the ligth gray box). While I could try to recreate the drawing in >MetaFun (which I want to do some day in the future), I took the drawing and >include it in my ConText document. > >Here is what I've tried. In attachment I have the a low res image and a >simple source file if somebody is interested. > >============================================================================ >====================== >\setuphead[section][page=yes,continue=no,after=\blank] >\defineoverlay[jnalogo][{\externalfigure[images/chapter-front][type=png,widt >h=\overlaywidth,height=\overlayheight]}] >\def\JNAChapter#1#2% >{{\framed[height=24cm,width=11.1cm,background=jnalogo]{#1 : #2%this should >go in the grey box >}}} > >\setuphead[chapter][before=\noheaderandfooterlines, > command=\JNAChapter > ] >============================================================================ >======================= better: \setuphead [chapter] [headerstate=none, footerstate=none, command=\JNAChapter] \starttext \chapter{Text} \stoptext >Now my only problem is: >- position the entire chapter figure in the middle of the page you could define a special layout, or use layers >- position the number and the text in the middle of the gray box of the >image > >I read about layers and stuff, but I don't have a clue how I could position >a piece of text at a specific location of a frame so that it appears at the >right spot on top of the drawing (if you look at the image, it should go >into the middle of the light gray box). > >any ideas? > >thanks, > >Kris Hermans. untested: \defineoverlay [jnalogo] [\overlayfigure{images/chapter-front}] \definelayer [jnatext] \def\JNAChapter#1#2% {\setlayerframed [jnatext] [x=2cm, y=4cm] [width=10cm, height=5cm] {#1 : #2}% \framed [height=24cm, width=11.1cm, background={jnalogo,jnatext}]} an option is to add background=color,backgroundcolor=gray to the layerframed concerning the middle of the page: \definelayer [page] \setuplayer [page] [width=\paperwidth, height=\paperheight] \setupbackgrounds [page] [background=page] \def\JNAchapter#1#2% {\setlayer [x=.5\paperwidth, y=.5\paperheight, location=c] {\externalfigure....} \setlayer [....] {#1 #2} % force new page \page[empty]} >PS: before I actually investigate time in it: is it possible to re-draw the >attached image using metafun? dunno since there is no attachment -) ------------------------------------------------------------------------- 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 -------------------------------------------------------------------------