# [Tugindia] still problem with \colorbox.......

Sun Nov 30 04:42:51 CET 2003

>>>>> "Manoj" == Manoj Kummini <kummini at math.ukans.edu> writes:

Manoj> On Sat, Nov 29, 2003 at 08:32:39hrs +0530, Jagadeesh

Jagdeesh> i was actually trying to get section headings enveloped
Jagdeesh> in gray box.  when i filled like that, though i got
Jagdeesh> color box of the whole width of the page as i required,
Jagdeesh> it broke the section numbering to another line.  now
Jagdeesh> what i need is how to include the section numbering also
Jagdeesh> in the same \colorbox of page-width.

Manoj> I don't know any answer, but you might have to redefine
Manoj> \@startsection for this. I tried using \colorbox in
Manoj> \@seccntformat and \@svsec, but neither worked. Does
Manoj> someone have an answer, or know whether there is a package
Manoj> or class like memoir that can do this? A quick glance
Manoj> through memoir documentation did not suggest anything.

Jagdeesh> i also need to provide a thick horizontal line, \hline
Jagdeesh> didn't work, under section headings; which extends in
Jagdeesh> width more than the actual width of text like below

It is a non-trivial task to create boxed or ruled section headings
owing to the horrendous design of the section macros.  Probably,
titlesec package provides easier user interface.  However, E
Krishnan's solution has the handicap of typesetting multi-lined
section headings in a single line.  The problem is that \colorbox is
nothing but a \hbox which means you need to enclose your section
argument in a minipage or parbox of textwidth to avoid surprises.

To make things easier, I have uploaded a crude and silly package that
I wrote for one of my friends at:

http://tug.org/~cvr/boxsection.sty
http://tug.org/~cvr/boxtest.tex
http://tug.org/~cvr/boxtest.pdf

You might try this and get back to me, if you need any further
addition to this. I know, the package needs further refinement and if
you people like it, we would release for public consumption.

Best