Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have tried to create some diagrams using xymatrix. However, the problem I have encountered is that diagonal arrows do not look very well - they are not smooth and resemble raster graphics rather than vector graphics. I have the same problem using pdfLaTeX as well as LaTeX + dvips.

Here is my code:

\documentclass{article}
\usepackage[utf8]{inputenc}                                    
\usepackage[T1]{fontenc}
\usepackage[all,cmtip]{xy}
\begin{document}
\begin{displaymath}
\xymatrixcolsep{5pc}\xymatrix{& & A & \\ B \ar[r] \ar[urr] & C \ar[r] & D \ar[r] \ar[u] & E 
}
\end{displaymath}
\end{document}

The urr-arrow is the one that does not look well. I wonder if this problem can be solved, since, e.g., in this document demonstrating the use of xymatrix, there is no sign of a similar problem. Thank you in advance.

share|improve this question
1  
do you have the type 1 fonts for the xy arrows? if you have only the bitmap versions, they will indeed look very rough, but the type 1 versions produce good looking output. –  barbara beeton Mar 29 '13 at 12:33
1  
I get good arrows compiling with pdflatex and also with latex+dvips+ps2pdf. What TeX distribution are you using? –  egreg Mar 29 '13 at 14:56

2 Answers 2

up vote 3 down vote accepted

With a recent TeX distribution there's no need to do anything for getting driver support for drawing oblique arrows. So I suspect you have an older version of xy.

You can also try tikz-cd. I show both outputs.

\documentclass{article}
\usepackage[utf8]{inputenc}                                    
\usepackage[T1]{fontenc}
\usepackage[all,cmtip]{xy}
\usepackage{tikz-cd}
\begin{document}
\begin{displaymath}
\xymatrixcolsep{5pc}
\xymatrix{
  & & A & \\ 
  B \ar[r] \ar[urr] & C \ar[r] & D \ar[r] \ar[u] & E 
}
\end{displaymath}

\[
\begin{tikzcd}[column sep=5pc]
  {} & {} & A \\
  B \arrow{rru}{} \arrow{r}{} &
  C \arrow{r}{} &
  D \arrow{r}{} \arrow{u}{} & E
\end{tikzcd}
\]
\end{document}

enter image description here

share|improve this answer

If you would consider using tikz instead you might have better results without installing separate fonts.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
   \begin{tikzpicture}
      \matrix[matrix of math nodes,column sep=5pc,row sep=3em]
      {
                 &         & |(A)| A &            \\
         |(B)| B & |(C)| C & |(D)| D & |(E)| E    \\
      };
      \begin{scope}[->]
         \draw (B) -- (C);
         \draw (B) -- (A);
         \draw (C) -- (D);
         \draw (D) -- (E);
         \draw (D) -- (A);
      \end{scope}
   \end{tikzpicture}
\end{document}

sample output

For matrices the tikz syntax can be as dense as that of xymatrix. However, in the long run I found tikz to be much easier to learn.

share|improve this answer
1  
What about using tikz-cd? –  egreg Mar 29 '13 at 14:57
    
@egreg: probably a good idea; I don't use the package so my instinct was a pure tikz solution. –  Matthew Leingang Mar 29 '13 at 14:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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