[Tex/LaTex] Can’t draw a commutative diagram

diagramsxy-pic

I'm trying to draw a commutative diagram using xymatrix:

$\xymatrix{
S \ar@[ld]^{\pi_{i}} \ar@[rd]^{\pi_{j}}\\
R_{i} \ar[r]_{\mu_{ji}} & R_{j} }$

without any luck. Any idea?

EDIT: I'm trying to draw the following commutative diagram:

enter image description here

Best Answer

Here's one possible solution for the lower part using both xy and tikz-cd:

\documentclass{article}
\usepackage[all]{xy}
\usepackage{tikz-cd}

\begin{document}

$\xymatrix{
& S \ar[ld]^{\pi_{i}} \ar[rd]_{\pi_{j}} &\\
R_{i} \ar[rr]_{\mu_{ji}} & & R_{j} }$

\begin{tikzcd}[column sep=normal]
& S \arrow{dl}{\pi_{i}}\arrow{dr}[swap]{\pi_{j}} & \\
R_{i} \arrow{rr}[swap]{\mu_{ji}} & & R_{j}
\end{tikzcd}

\end{document}

enter image description here

Here's the complete diagram using tikz-cd:

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

\begin{document}

\begin{tikzcd}[column sep=normal,row sep=large]
& Y\arrow{ddl}[swap]{\psi_{i}}\arrow{ddr}{\psi_{j}}\arrow{d}{h} & \\
& S \arrow{dl}{\pi_{i}}\arrow{dr}[swap]{\pi_{j}} & \\
R_{i} \arrow{rr}[swap]{\mu_{ji}} & & R_{j}
\end{tikzcd}

\end{document}

enter image description here

And now using xy:

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

\begin{document}

$\xymatrix{
& Y\ar[ldd]_{\psi_{i}}\ar[rdd]^{\psi_{j}}\ar[d]^{h} & \\
& S \ar[ld]^{\pi_{i}} \ar[rd]_{\pi_{j}} & \\
R_{i} \ar[rr]_{\mu_{ji}} & & R_{j} }$

\end{document}

enter image description here

And now, as requested in a comment, with some arrows curved:

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

\begin{document}

\begin{tikzcd}[column sep=normal,row sep=large]
& Y\arrow[bend right]{ddl}[swap]{\psi_{i}}\arrow[bend left]{ddr}{\psi_{j}}\arrow{d}{h} & \\
& S \arrow{dl}{\pi_{i}}\arrow{dr}[swap]{\pi_{j}} & \\
R_{i} \arrow{rr}[swap]{\mu_{ji}} & & R_{j}
\end{tikzcd}

\end{document}

enter image description here

And with xy:

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

\begin{document}

$\xymatrix{
& Y\ar@/_/[ldd]_{\psi_{i}}\ar@/^/[rdd]^{\psi_{j}}\ar[d]^{h} & \\
& S \ar[ld]^{\pi_{i}} \ar[rd]_{\pi_{j}} & \\
R_{i} \ar[rr]_{\mu_{ji}} & & R_{j} }$

\end{document}

enter image description here

Related Question