From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/7146 Path: main.gmane.org!not-for-mail From: Daniel Pittman Newsgroups: gmane.comp.tex.context Subject: Re: How to place an item between table rows, centered on the page. Date: Thu, 07 Mar 2002 18:00:05 +1100 Sender: owner-ntg-context@let.uu.nl Message-ID: <874rjs9822.fsf@inanna.rimspace.net> References: <5.1.0.14.1.20020306101103.034df6d0@server-1> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035397631 16849 80.91.224.250 (23 Oct 2002 18:27:11 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 18:27:11 +0000 (UTC) Original-To: ntg-context@ntg.nl In-Reply-To: <5.1.0.14.1.20020306101103.034df6d0@server-1> (Hans Hagen's message of "Wed, 06 Mar 2002 10:11:30 +0100") Xref: main.gmane.org gmane.comp.tex.context:7146 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:7146 On Wed, 06 Mar 2002, Hans Hagen wrote: > At 07:37 PM 3/6/2002 +1100, Daniel Pittman wrote: >>I would like to typeset one of two things[1] between each row of a >>table: * a partial width line * a graphic >> >>The effect I would like to achieve is to make a visual distinction >>between the rows of the table without a full width table line (as >>achieved by \HL &c.). [... trick for placing ...] > I guess that GB loves this trick -) I found a couple of issues with the code as you supplied it. The main problem was that a \blackrule of 1cm would reduce the width of the second column (p, in my case) by 1cm. Setting it to \hsize would force that second column to be as thin as possible. Both of these were reducing the width available from the right hand side of the page. The second problem was that I couldn't center the bar using the \midaligned{} operation in ConTeXt, which would blow up with errors dealing with \prevdepth.[1] So, to resolve both of these I did a bit of playing around with TeX primitives and came up with the following code: \newbox\StepDividerBox \def\StepDivider{ % called from the macro that writes \TABLEnoalign{ % table rows \nointerlineskip \vskip 4pt { \setbox\StepDividerBox=\hbox to \hsize{% \hfil \blackrule[width=.3\hsize,height=.5pt,depth=.3pt] \hfil } \wd\StepDividerBox=0pt \box\StepDividerBox } \vskip 6pt } } This gives me a centered rule of the size I want, using the spacing between table rows I desire, but doesn't interfere with the layout of the table rows before it. While I feel vaguely proud of managing to achieve this result[2], I can't help but feel that it's a bit of a hack, not a well polished use of the tool at hand. So, would anyone like to suggest what, if anything, I might do to make this a cleaner command? I am using: This is pdfeTeX, Version 3.14159-1.00a-pretest-20011114-ojmw-2.1 (Web2C 7.3.7) (format=cont-en 2002.3.4) 7 MAR 2002 17:34 entering extended mode **&cont-en cookbook.tex (./cookbook.tex{/usr/share/texmf/pdftex/config/pdftex.cfg} ConTeXt ver: 2002.2.25 fmt: 2002.3.4 int: english mes: english Daniel Footnotes: [1] I can cite these if needed. [2] It's the most complex layout I have ever done with TeX itself. -- There is eloquence in screaming. -- Patrick Jones