I want to make a diagram that looks like the following:
[Tex/LaTex] Commutative Diagram with Elements
diagrams
Related Solutions
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}
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}
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}
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}
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}
One way is to add a node relative to the tree.
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{trees,positioning}
\begin{document}
\begin{tikzpicture}[edge from parent/.style={draw,-latex}]
\node (Lin) {Lindel\"of} [sibling distance=6cm]
child {node {Casi Lindel\"of}
child {node {D\'ebilmente Lindel\"of} [sibling distance=1.5cm]
}
}
;
\node[left=of Lin-1-1] (text) {text};
\draw[-latex] (Lin) -- (text);
\draw[-latex] (text) -- (Lin-1-1);
\end{tikzpicture}
\end{document}
Or with \draw[-latex] (Lin.south west) -- (text);
I would also like to draw your attention to the forest package.
\documentclass{article}
\usepackage[edges]{forest}
\begin{document}
\begin{forest}
for tree={edge={-latex},calign=last,l+=5mm,s+=5mm}
[Lindel\"of
[text,tier=murmel,alias=l]
[Casi Lindel\"of
[D\'ebilmente Lindel\"of,tier=murmel,alias=b]
]
]
\draw[-latex] (l) -- (b);
\end{forest}
\end{document}
Best Answer
There is a not so complicated answer using the packages
graphicx
andxypic
. Before explaining I will straight away give my solution. It is the following:NOTE that diagram should of course be enclosed in
\begin{document}
and\end{document}
. Of course it is not important thatalign*
is used, any display-style math envisonment will do. The packageamsmath
is also just included to makealign*
available, since it is my favorite.Now for the explanation. I will assume that you already know a little about the
xypic
. This package is really easy to use on a basic level. Here it has been used in a little more advanced way. The option@R=10pt
between\xymatrix
and the following{
is an option the specifies the 'row spacing', and in this case we want it to be small so that the picture does not look silly. The top arrow is a standart arrow inxypic
drawn with\ar[r]
but the lower arrow has the extra symbols@{|->}
which just specifies that we want this arrow to have that special look. In genneral it you want to rotate a symbol in LaTeX thegraphicx
package includes the command\rotatebox
which allows for rotating element, e.g. the symbol\in
. These symbols are placed like arrows with the commandNow
\rotatebox{90}{$\in$}
is jost a 90 degrees rotation of the symbol\in
. The symbols@{}
specifies that we want an 'empty' arrow, i.e. an arrow with no lines, and the symbols|{\rotatebox{90}{$\in$}}
specify that we want\rotatebox{90}{$\in$}
places as a lable on top of the given arrow.