3

I have used the next code to get a commutative diagram:

\documentclass[10pt,a4paper]{article}

\usepackage[spanish]{babel}
\usepackage{amsmath}
\usepackage{tikz-cd}% diagramas

\begin{document}

%-----Diagrama-------
\deactivatequoting
\[
\begin{tikzpicture}
\matrix(m)[matrix of math nodes,
row sep=4em, column sep=3em,
text height=1.5ex, text depth=0.25ex]
{
M   &   TN \\
    &    N \\
};
\path[->]
(m-1-1) edge node[auto] {$\psi\circ Y$} (m-1-2);
\path[->]
(m-1-1) edge node[left] {$\psi$} (m-2-2);
\path[->]
(m-1-2) edge node[right] {$\pi$} (m-2-2);
\path[->]
(m-2-2) edge node[left] {$Y$} (m-1-2);
\end{tikzpicture}
\]
\activatequoting
%-------------------

\end{document}

However, I would like two vertical parallel arrows and not a "leftrightarrow".

What is the solution?

1 Answer 1

3

It's much easier if you use tikz-cd:

\documentclass[10pt,a4paper]{article}

\usepackage[spanish]{babel}
\usepackage{amsmath}
\usepackage{tikz-cd}% diagramas
\usetikzlibrary{babel}

\begin{document}

\[
\begin{tikzcd}[column sep=huge,row sep=huge]
M \arrow[r,"\psi\circ Y"] \arrow[dr,swap,"\psi"] &
  TN \arrow[d,shift left=.75ex,"\pi"] \\
& N \arrow[u,shift left=.75ex,"Y"]
\end{tikzcd}
\]

\end{document}

enter image description here

The order of composition seems reversed, but it depends on the conventions you're using.

1
  • Thanks. Yes, I use "f\circ g (x)=g(f(x))" (I don't know how write a formula in a comment). I like write first the the function that applies first.
    – Dog_69
    Commented Mar 4, 2017 at 18:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .