[texhax] raiseboxing \hrulefill in multicolumn{}

Morten Høgholm moho01ab at student.cbs.dk
Mon Aug 23 15:45:23 CEST 2004

On Mon, 23 Aug 2004 22:13:02 +1000, Lincoln Turner  
<l.turner at physics.unimelb.edu.au> wrote:

> I've got a large table with a lot of column-spanning (\multicolumn)
> entries. I want to make it clear when a short-ish entry spans several
> columns by ruling a centred horizontal line either side of the centred
> entry.
> The code:
> ... & \multicolumn{4}{c}{\hrulefill Something \hrulefill} & ...
> does this quite well, the only problem is that the rule is sitting on
> the baseline. I'd like the rule to be centred, say at half the
> x-height. The problem is that no amount of \raisebox{}ing seems to help
> here as all the box commands want a definite width, not a rubber one! On
> the other hand, the basic TeX commands don't seem to play nicely with
> rubber lengths.

Try something like

   \leavevmode\leaders\hrule depth-2pt height 2.4pt\hfill\kern0pt

TeX then draws a rule which upper border is 2.4pt above the baseline and  
lower border 2pt above the baseline.
Morten Høgholm

More information about the texhax mailing list