# [Tugindia] a query on usage of "\colorbox"

Manoj Kummini kummini at math.ukans.edu
Fri Nov 28 17:52:11 CET 2003

On Fri, Nov 28, 2003 at 21:37:39hrs +0530, Jagadeesh Bhaskar wrote:

> when i used the command
>         "\colorbox{color}{text}"
> i found that, the colored box covered only the length of the text.
>
> i actually wanted the whole of the line: from the left end of the page to
> the rightmost end to be filled with the color over the text.
>
> can i specify width and height for a \colorbox?
>
> otherwise how can i acheive that??

See whether the following example shows the solution.

\noindent\colorbox{red}{Hello} World.

\noindent\colorbox{red}{\hbox to \hsize {Hello}}\newline World

\noindent\colorbox{red}{\hbox to \hsize {\hfill Hello\hfill}}\newline World

With regards,
Manoj.

--
Manoj Kummini
Graduate Student, Dept. of Mathematics, The Univ. of Kansas,
Lawrence KS 66045 USA.  38 deg 55 min N, 95 deg 14 min W.
http://www.math.ukans.edu/~kummini/index.html


More information about the tugindia mailing list