Re: Colored square

"Sridhar M.A." <[email protected]>
Newsgroups gmane.comp.tex.tugindia
Message-ID <CABY_HYU2fZSaJMd7Axr2JZqmk+VA8D4mBsMWyToA2a6vMzSiCg@mail.gmail.com>
On Wed, Sep 19, 2012 at 4:35 PM, Asha G <[email protected]> wrote:
> 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.
>
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.
_______________________________________________
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.