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