1

I'm reading actually the xyrefer.pdf guide to give a color to the arrow and to the label. Starting from this MWE, there is not any color for the arrow (for example).

enter image description here

\documentclass[a4paper,12pt]{article}
\usepackage[color,cmtip,all]{xy}
%\xyoption{color}
%\UseCrayolaColors
\begin{document}
\xymatrix
{
A \ar@[red][r]^a&  B\\
}
\end{document}

How can I obtain a colour to the vector and to the label?

3
  • Did you already try with \usepackage{xcolor} in the preamble?
    – leandriis
    Oct 15 '19 at 20:03
  • @leandriis Yes, of course. I have an error: Xy-pic error: No 'xcolor' option. [\ProcessOptions\relax].
    – Sebastiano
    Oct 15 '19 at 20:05
  • 1
    Interesting. For me, the following MWEgives the following output: \documentclass[a4paper,12pt]{article} \usepackage{xcolor} \usepackage[color,cmtip,all]{xy} \begin{document} \xymatrix { A \ar@[red][r]^{\color{blue}a}& B\\ } \end{document}Output: i.stack.imgur.com/NRenG.png
    – leandriis
    Oct 15 '19 at 20:07
1

Please use the option dvips, if you using LaTeX -> dvips -> PS2PDF and if you didn't given any option, then it will assume PDFLaTeX is the default driver:

MWE

   \documentclass[a4paper,12pt]{article}
\usepackage{color}
\usepackage[dvips,color,matrix,arrow]{xy} 
\begin{document} 

\xymatrix { A
\ar@[red][r]^{\color{blue}a}& B\\
} 

\end{document}  

enter image description here

3
  • Thank you very much...for your answer...."Grazie assai".
    – Sebastiano
    Oct 16 '19 at 9:29
  • 1
    @Sebastiano It's my pleasure to give suggestion like you! (I know you are one of a LaTeX great)...and thank you so much for your complimentary comment...
    – MadyYuvi
    Oct 16 '19 at 9:35
  • Thank you very much again: "(I know you are one of a LaTeX great)"--> It is not true.
    – Sebastiano
    Oct 16 '19 at 14:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.