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=0.098039,g=0.223529,b=0.52549]
\definecolor[b][r=0.098039,g=0.654902,b=0.866667]

\startuniqueMPgraphic{LinearShade}
path p ;
p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
linear_shade(p,5,\MPcolor{a},\MPcolor{b}) ;
\stopuniqueMPgraphic

\defineoverlay[shaded][\useMPgraphic{LinearShade}]

\setupTABLE[row][1][background={shaded},backgroundcolor=blue,foregroundcolor=white]

\starttext
\framed[background={shaded}, width=\textwidth, frame=off]{}
\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=blue, aligntitle=float]

\definefloat[issueinfo][issueinfos] % Define our fancy boxout
\setupcaption[issueinfo][location=none] % Define our fancy boxout
\defineframedtext[issueinfo][]

\starttext

\section{My section header}
\placeissueinfo[right, y=-2cm]{}{
\startissueinfo[width=4cm]
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äse 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 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to