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 am trying to figure out how to make several arrows point to a particular object. For example if I am wanting to have an arrow $A_i \rightarrow A A_j \rightarrow A$ and $A_k \rightarrow A$ and $A_i \rightarrow A_j$ in a diagram. I have worked out how to do:

\begin{equation*}
  \xymatrix@C+2em@R+2em{
   A_i  \ar[d]_{f^{i}} & B_i \ar[d]^{h^{i}} \\
  A \ar[r]_{\phi} & B
  }
 \end{equation*}

But I don't know how to modify this to get what I want (and I can't seem to find examples using the equation* or other workable examples.

Thanks,

Brian

share|improve this question
    
It would be useful to have a MWE. I have no idea what \ar or \xymatrix@C+2em@R+2em are about. It looks like you're trying to use \xymatrix@C as a macro, but that's generally not a valid macro naming convention in the body of a document. –  A.Ellett Mar 1 at 16:23
    
Can you please add to your question an image of the desired output? It's not clear from the code snippet you posted the desired position for the objects and arrows. –  Gonzalo Medina Mar 1 at 16:30

2 Answers 2

up vote 4 down vote accepted

Using the more modern tikz-cd package, you can do:

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}

\begin{document}

\begin{tikzcd}
A_i  
  \ar{dr}[swap]{f^{i}} 
  \ar{r}{h} 
& 
A_j
  \ar{d}[swap]{f^{j}} 
& 
A_k  
  \ar{dl}{f^{k}} \\
& A
\end{tikzcd}

\begin{tikzcd}
A_i  
  \ar{dr}{f^{i}} 
  \ar{d}[swap]{h}  \\ 
A_j\ar{r}[swap]{f^{j}} & A
  \\
A_k  
  \ar{ur}[swap]{f^{k}} \\
\end{tikzcd}

\end{document}

enter image description here

share|improve this answer
    
Thank you Gonzalo. Is it using the the tikz-cd package that makes this more of a modern approach? I have seen it around, thanks for the example using it! What are the benefits of using this package as opposed to the {all}[xy]? –  user1922184 Mar 8 at 2:22
    
@user1922184 tikz-cd allows you to use all the power of TikZ, so yes, tikz-cd it's a more modern and versatile package for commutative diagrams. –  Gonzalo Medina Mar 8 at 2:24
    
I put this as the answer because it uses tikz-cd and the [all]{xy} wasn't working so well. –  user1922184 May 7 at 1:31
    
Also, after some amounts of messing around with the tikz pdf examples here: jmilne.org/not/Mtikz.pdf I am wondering.. what if I want to change the right arrow i.e. \arrow{r} to an implies $\Leftrightarrow$? Now your example works great and I am trying to not have to use the examples in the article using \path as it seems to be a whole different format which is quite more complicated. So is there a abbreviation for the iff? Even better, could I somehow use your example and just include latex directly in ie. such as the $\Leftrightarrow$ mentioned? –  user1922184 May 7 at 1:49
    
@user1922184 Refer to the tikz-cd package documentation to see the different type of arrows already available. You can use \Leftrightarrow directly, as in \begin{tikzcd} A\ar[r,Leftrightarrow] & B \end{tikzcd} –  Gonzalo Medina May 7 at 1:56

Do you mean something like this?

enter image description here

Code:

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

\begin{document}

\begin{equation*}
  \xymatrix@C+2em@R+2em{
   A_i \ar[r]^{\phi} \ar[dr]_{f^{i}} & A_j \ar[d]^{f^{j}} & A_k \ar[dl]^{f^{k}} \\
   & A 
  }
 \end{equation*}

\end{document} 

or

enter image description here

Code:

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

\begin{document}

\begin{equation*}
  \xymatrix@C+2em@R+2em{
   A_i \ar[d]_{\phi} \ar[dr]^{f^{i}} \\
   A_j \ar[r]^{f^{j}} & A \\
   A_k \ar[ur]_{f^{k}}
  }
 \end{equation*}

\end{document} 
share|improve this answer
    
I'm completely unfamiliar with this package xy. And texdoc xy doesn't really pull up much useful about things like \xymatrix..... Where do I go to find documentation? –  A.Ellett Mar 1 at 16:36
    
@A.Ellett xy-pic.sourceforge.net and go to the documenation section. –  Gonzalo Medina Mar 1 at 16:49
    
@A.Ellett texdoc xypic –  karlkoeller Mar 1 at 16:57

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.