Graphics, Figures & TablesColorbox with HTML problem

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
exactos
Posts: 8
Joined: Sat Jul 24, 2010 10:47 pm

Colorbox with HTML problem

Post by exactos »

I am trying to setup a colorbox with HTML saying submit. I have tried

[HTML]\colorbox{red}{Submit}[/HTML] and

\colorbox[HTML]{00FF00}{Submit}

and their variations but nothing seems to work. I always get a control sequence error.

Any ideas guys? Thanks in advance.
Last edited by exactos on Sun Jul 25, 2010 7:10 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Colorbox with HTML problem

Post by frabjous »

First make sure you’ve loaded an appropriate package, like xcolor, in your preamble:

\usepackage{xcolor}

Next, it should work just to write:

\colorbox{red}{Submit}

I’m not sure what you’re doing with the “HTML” there. Do you mean to use the HTML color model for hexcodes? If so, the following works for me (assuming xcolor is loaded):

\colorbox[HTML]{FF0000}{Submit}
exactos
Posts: 8
Joined: Sat Jul 24, 2010 10:47 pm

Re: Colorbox with HTML problem

Post by exactos »

Thanks a lot! That was quick. And yes I was trying hexcodes.
Post Reply