4

I am trying to set the grayscale values of arrows in xypic. From a brief perusal of this document it seems like I need to do something like this:

\documentclass[10pt]{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[all]{xy}
\newxycolor{testgray}{.5}
\begin{document}

\begin{align*}
\xymatrix{\bullet \ar@[testgray][r] & \bullet}
\end{align*}
\end{document}

where the .5 is supposed to indicate something like halfway beetween black and white. But this just produces a black arrow,

enter image description here

and the error message "Current driver does not support colour." There is material about appropriate drivers in the linked document, but I don't understand it very well. Any help with this would be greatly appreciated!

2 Answers 2

4

You have to specify the color model. You find the syntax in section 13 of the Xy-pic reference guide (texdoc xyrefer).

\documentclass{article}
\usepackage{amsmath}
\usepackage[all,cmtip]{xy}

\newxycolor{testgray}{.5 gray}

\begin{document}

\begin{equation*}
\xymatrix{\bullet \ar@[testgray][r] & \bullet}
\end{equation*}

\end{document}

I added cmtip because my eyes bleed when I see the default arrow tips. Also align should never be used for simple equations not involving alignment (and \xymatrix alone doesn't count).

enter image description here

4

You can use xcolor package which provides the gray color.

enter image description here

\documentclass[10pt]{article}
%\usepackage{amsmath}
%\usepackage{graphicx}
\usepackage[all]{xy}
\usepackage{xcolor}

\begin{document}
\[\xymatrix{\bullet \ar@[gray][r] & \bullet}\]
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .