Putting
\usepackage[active,graphics,tightpage]{preview}
last in the preamble will produce a pdf containing only the graphics.
There are at least two packages
\usepackage{color} % documentation in color.pdf
or
\usepackage{xcolor} % documentation in grfguide.pdf
By the command line type:
texdoc grfguide
Example:
\documentclass[11pt]{article}
\usepackage{amsmath, amssymb, amscd}
\begin{document}
$$
\begin{CD}
S^{{\mathcal{W}}_{\Lambda}}\otimes T @>j>> T
@VVV @VV{\operatorname{End} P}V
(S\otimes T)/I @= (Z\otimes T)/J
\end{CD}
$$
\end{document}