colored square

Asha G <[email protected]>
Newsgroups gmane.comp.tex.tugindia
Message-ID <CADwK_pPu+aV8UgMbRoU4+9NXme+-0XDrTPJ4qUhVCpfseprViA@mail.gmail.com>
>
> I would like to create colored squares :
>
> \blacksquare creates a filled black square
>
> but using the same logic
>
> \redsquare does not give  a filled red square but an error message.
>
> Please help.
>
> Thanks
>
> Asha Gopinathan
>
>
> ------------------------------
>
> May be it is possible if you use xcolor package. See the documentation of
> xcolor.
>
>
>
> >
> You can use tikz to do that. Here is a MWE :
>
>
> \documentclass[11pt]{article}
> %
> \usepackage{tikz}
>
> \newcommand{\redsquare}{\tikz \path [fill=red,draw=black]  (0,0)
> rectangle (10pt,10pt) ;}
>
> \begin{document}
>
> This is a red square~\redsquare
>
> \end{document}
>
> HTH,
>
> Regards,
>
> --
> Sridhar M.A.
>

 I am sending snippets of code which work for me in captions.

>
> \usepackage{amssymb}
>
   \usepackage{color}



{
\color{red}$\blacksquare$}:compact;{\color{green}$\blacksquare$}:analytical;{\color{blue}$\blacksquare$}:central}

Asha
_______________________________________________
Home:        http://www.tug.org.in/
TeX FAQ:     http://www.tex.ac.uk/faq
unsubscribe: http://tug.org/mailman/listinfo/tugindia
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.