6

I need a diagram like this one:

enter image description here

This is what I've got so far:

    \documentclass{article}
    \usepackage{amsmath}
    \usepackage{tikz}
    
    \begin{document}
    
    \begin{tikzpicture}[node distance=2cm, auto]
    \node (Lambda1) {$\Lambda$};
    \node(Sigma1) [right of=Lambda1] {$\Sigma_2$};
    \node (Lambda2) [below of=Lambda1] {$\Lambda$};
    \node (Sigma2) [below of=Sigma1] {$\Sigma_2$};
    \draw[->](Lambda1) to node {$S$}(Sigma1);
    \draw[->](Lambda2) to node [left] {$f_\mu$}(Lambda1);
    \draw[->](Sigma2) to node [right] {$\tau$}(Sigma1);
    \draw[->](Lambda2) to node [below] {$S$}(Sigma2);
    \end{tikzpicture}
    
    \end{document}

Result:

enter image description here

I don't know how to insert those curved arrows with the compositions:

$ S \circ f_\mu$ and $\tau \circ S$.

1
  • looks like a tikz-cd
    – user202729
    May 19 at 16:55

2 Answers 2

9

With a bit enlarged distance between nodes and the same text for better observing the behaviour:

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[node distance=3cm, auto]
\node (Lambda1) {$\Lambda$};
\node(Sigma1) [right of=Lambda1] {$\Sigma_2$};
\node (Lambda2) [below of=Lambda1] {$\Lambda$};
\node (Sigma2) [below of=Sigma1] {$\Sigma_2$};
\draw[->](Lambda1) to node {$S$}(Sigma1);
\draw[->](Lambda2) to node [left] {$f_\mu$}(Lambda1);
\draw[->](Sigma2) to node [right] {$\tau$}(Sigma1);
\draw[->](Lambda2) to node [below] {$S$}(Sigma2);

\draw[->](Lambda2) to  [bend left=30] node [right,xshift=2pt] {$S\circ f_\mu$} (Sigma1);
\draw[->](Lambda2) to  [bend right=30] node [ left, xshift=-2pt] {$S\circ f_\mu$} (Sigma1);


\end{tikzpicture}

enter image description here

9

Direct method with tikz-cd.

enter image description here

\documentclass{article}

\usepackage{tikz-cd}

\begin{document}

\[
  \begin{tikzcd}
    \Lambda & {\Sigma_2} \\
    \Lambda & {\Sigma_2}
    \arrow["S", from=1-1, to=1-2]
    \arrow["S"', from=2-1, to=2-2]
    \arrow["{f_\mu}", from=2-1, to=1-1]
    \arrow["\tau"', from=2-2, to=1-2]
    \arrow["{\scriptstyle S \circ f_\mu}"{marking}, bend left = 30pt, from=2-1, to=1-2]
    \arrow["{\scriptstyle \tau \circ S}"{marking}, bend right = 30pt, from=2-1, to=1-2]
  \end{tikzcd}
\]

\end{document}

Better visual effect if you have quiver.sty:

enter image description here

\documentclass{article}

\usepackage{quiver}

\begin{document}

\[
  \begin{tikzcd}
    \Lambda & {\Sigma_2} \\
    \Lambda & {\Sigma_2}
    \arrow["S", from=1-1, to=1-2]
    \arrow["S"', from=2-1, to=2-2]
    \arrow["{f_\mu}", from=2-1, to=1-1]
    \arrow["\tau"', from=2-2, to=1-2]
    \arrow["{\scriptstyle S \circ f_\mu}"{marking}, shift right=1, curve={height=-12pt}, from=2-1, to=1-2]
    \arrow["{\scriptstyle \tau \circ S}"{marking}, shift left=1, curve={height=12pt}, from=2-1, to=1-2]
  \end{tikzcd}
\]

\end{document}

If you prefer the labels off the arrow, you may shift the labels along the y-axis (notice the yshift):

\begin{tikzcd}
    \Lambda & {\Sigma_2} \\
    \Lambda & {\Sigma_2}
    \arrow["S", from=1-1, to=1-2]
    \arrow["S"', from=2-1, to=2-2]
    \arrow["{f_\mu}", from=2-1, to=1-1]
    \arrow["\tau"', from=2-2, to=1-2]
    \arrow["{\scriptstyle S \circ f_\mu}"{marking, yshift=-5pt}, shift right=1, curve={height=-12pt}, from=2-1, to=1-2]
    \arrow["{\scriptstyle \tau \circ S}"{marking, yshift=5pt}, shift left=1, curve={height=12pt}, from=2-1, to=1-2]
\end{tikzcd}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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