From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/71139 Path: news.gmane.org!not-for-mail From: Felix Ingram Newsgroups: gmane.comp.tex.context Subject: Table headers and section titles Date: Tue, 13 Sep 2011 15:30:19 +0100 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1315924238 32040 80.91.229.12 (13 Sep 2011 14:30:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 13 Sep 2011 14:30:38 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Sep 13 16:30:34 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R3U0P-0006Hu-Ly for gctc-ntg-context-518@m.gmane.org; Tue, 13 Sep 2011 16:30:33 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0D554CAF86; Tue, 13 Sep 2011 16:30:32 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id AZZxmLwJu0rt; Tue, 13 Sep 2011 16:30:24 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A54D8CAF82; Tue, 13 Sep 2011 16:30:24 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D3D65CAF82 for ; Tue, 13 Sep 2011 16:30:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7EHHbTxlVxuK for ; Tue, 13 Sep 2011 16:30:21 +0200 (CEST) Original-Received: from filter5-til.mf.surf.net (filter5-til.mf.surf.net [194.171.167.221]) by balder.ntg.nl (Postfix) with ESMTP id C4536CAF81 for ; Tue, 13 Sep 2011 16:30:21 +0200 (CEST) Original-Received: from mail-ew0-f42.google.com (mail-ew0-f42.google.com [209.85.215.42]) by filter5-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p8DEUKAS023168 for ; Tue, 13 Sep 2011 16:30:21 +0200 Original-Received: by ewy2 with SMTP id 2so350773ewy.15 for ; Tue, 13 Sep 2011 07:30:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=yvTGLIOMQ8xDTVoq1SQonwWFA3wwbARLAO2rMrmh7q4=; b=mEdd6UGNh8xZ9D4KL4iLUnWm7ZKuCQK2qqXnx0EoGbLadVvbnWqDz4uahmXbOGWV5v AUeq1i9Ip7FnZjSDklw/rueWDOLeHjwNGDp4+8ffR+RcLgvdImwmpMrPV7BV+cQ4EbEr 46A+zrwGDxJ9e2TP+nBvkw546dt6A99gLgjqY= Original-Received: by 10.52.177.135 with SMTP id cq7mr3126205vdc.14.1315924219871; Tue, 13 Sep 2011 07:30:19 -0700 (PDT) Original-Received: by 10.220.200.140 with HTTP; Tue, 13 Sep 2011 07:30:19 -0700 (PDT) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.215.42; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0xFweukKg - a34335806eac - 20110913 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.221 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:71139 Archived-At: Hello all, I've had another stab at converting our Word template to Context. I've managed to draw some pretty shapes using MetaPost (and I'd like to add my +1 for getting some alpha channel support for linear_shade) and I got really close to getting my table headings working. I would like to have a gradient fill that runs the width of the table header. The following shows where I've got to: %% GRADIENT SETUP \definecolor[a][r=3D0.098039,g=3D0.223529,b=3D0.52549] \definecolor[b][r=3D0.098039,g=3D0.654902,b=3D0.866667] \startuniqueMPgraphic{LinearShade} path p ; p :=3D unitsquare xscaled \overlaywidth yscaled \overlayheight ; linear_shade(p,5,\MPcolor{a},\MPcolor{b}) ; \stopuniqueMPgraphic \defineoverlay[shaded][\useMPgraphic{LinearShade}] \setupTABLE[row][1][background=3D{shaded},backgroundcolor=3Dblue,foreground= color=3Dwhite] \starttext \framed[background=3D{shaded}, width=3D\textwidth, frame=3Doff]{} \bTABLE \bTABLEhead \bTR \bTH 1 \eTH \bTH 1 \eTH \bTH 1 \eTH \bTH 1 \eTH \bTH Page \eTH \eTR \eTABLEhead \bTABLEbody \bTR \bTD 1 \eTD \bTD 1 \eTD \bTD 1 \eTD \bTD 1 \eTD \bTD 1 \eTD \eTR \eTABLEbody \eTABLE \stoptext The output shows a framed element which is similar to what I want to achieve and the table shows where I've got to. I believe that there are only really two options as to how I can get what I want: 1. Recalculate the gradient fill for each cell. This will require knowing the column width and the ability to change the cell's background as appropriate. I have no idea how to do either. 2. Draw the framed fill to the width of the table and then position it behind the table header (which is actually how it gets done in Word). However, I don't know how to determine the table width, or how to accurately position the frame. The next problem I have is with section headings. For each section heading we are required to include a box that contains some meta information. This is what I have at the moment: \setuphead[section][color=3Dblue, aligntitle=3Dfloat] \definefloat[issueinfo][issueinfos] % Define our fancy boxout \setupcaption[issueinfo][location=3Dnone] % Define our fancy boxout \defineframedtext[issueinfo][] \starttext \section{My section header} \placeissueinfo[right, y=3D-2cm]{}{ \startissueinfo[width=3D4cm] Ref: ref-1 \par a: Medium \par b: low \par c: 9.0 \stopissueinfo } Short loin shank rump pork belly ball tip pig. Spare ribs shank tri-tip capicola strip steak. Frankfurter leberk=E4se filet mignon boudin pork belly. Capicola shankle ribeye, hamburger brisket jerky rump short ribs turkey ham hock andouille pork chop chicken tongue pork belly. Ball tip tongue corned beef shoulder bresaola. Tri-tip turducken salami ground round pork. Rump tenderloin pork loin ham hock boudin, meatball venison pastrami prosciutto. \stoptext I'd like to be able to accurately place the box alongside the title itself. Ideally I'd like to draw a line under the section header that meets the left side of the box as well, though I'll take what I can get at this point. I hope the examples make sense. Thanks in advance for any help you can give. Felix ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________