4

I want to draw a short exact sequence using the tikz-cd package. But I want the labels on some of the arrows to be matrices. I can´t seem to make it look good. The arrows are not approtiatly sized and my colum and row matrices do not look the same (clearly this is because I use two different commands, but I am not able to do row vectors with comma in a different way). The following picture shows what I want to archive. The minimal working example is what I tried.

This is the lemma I am trying to reproduce, I would prefer to swap out the brackets to round bracktets

\documentclass[a4paper,11pt]{amsart}
\usepackage{amsmath,amscd,amssymb,amsfonts,mathrsfs}
\usepackage{mathtools}
\usepackage{tikz-cd}
\DeclarePairedDelimiter{\Vector}{\lparen}{\rparen}
\begin{document}
\begin{equation*}
\begin{tikzcd}
\Sigma_1 \colon \quad 0 \arrow{r} & M_1 
\arrow{r}{\begin{pmatrix} u_1 \\ f_1  \end{pmatrix}} &
E \arrow[column sep = large]{r}{\Vector{f_2,u_2}}
& F \arrow{r} & 0
\end{tikzcd}
\end{equation*}
\end{document}
6

Are you looking for somrthing like this?

enter image description here

The length of arrow was changed by passing an optional argument to the cell separation character &[5ex] and smallmatrix was used instead of pmatrix.

\documentclass[a4paper,11pt]{amsart}
%\usepackage{amsmath,amscd,amssymb,amsfonts,mathrsfs}
%\usepackage{mathtools}
\usepackage{tikz-cd}
\begin{document}
\begin{equation*}
\begin{tikzcd}
\Sigma_1 \colon \quad 0 \arrow{r} & M_1 
\arrow{r}{\left[\begin{smallmatrix} u_1 \\ f_1  \end{smallmatrix}\right]} &
E \arrow[column sep = large]{r}{[f_2,u_2]}
&[5ex] F \arrow{r} & 0
\end{tikzcd}
\end{equation*}
\end{document}
  • 1
    I was using smallmatrix too...so I'm going to eliminate the one I was almost done with :-). My positive vote. – Sebastiano Aug 6 '19 at 16:08
  • This is what I was looking for. – Bobior Aug 7 '19 at 9:13
2

Another ưay is using library positioning with realtive coordinates, so we can easily control length of arrows. (using absolute coordinates is not convenient in this case). Also note the order of options: node distance=5mm must be before right= of N2.

enter image description here

\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{equation*}
\begin{tikzpicture}[node distance=1cm]
\path node (M21) {$M_2\oplus N_1$}
node[left= of M21]  (M1)  {$M_1$}
node[node distance=5mm,left= of M1] (L) {$\Sigma_1 : 0$}
node[right= of M21] (N2)  {$N_2$}
node[node distance=5mm,right= of N2] (R) {$0$};

\draw[->] (L)--(M1);
\draw[->] (M1)--(M21) node[midway,above,scale=.8]
{$\begin{bmatrix}u_1\\f_1\end{bmatrix}$};
\draw[->] (M21)--(N2) node[midway,above,scale=.8]
{$\begin{bmatrix}f_2,u_2\end{bmatrix}$};
\draw[->] (N2)--(R);
\end{tikzpicture}
\end{equation*}
\end{document}
2

Do you need tikz-cd to begin with?

\documentclass[a4paper,11pt]{amsart}

\newcommand{\mapname}[1]{%
  \left[\begin{smallmatrix}#1\end{smallmatrix}\right]%
}
\newcommand{\map}[1]{\xrightarrow{\mapname{#1}}}
\newcommand{\fmod}[1]{{\operatorname{mod-}}#1}

\begin{document}

Let
\begin{alignat*}{2}
\Sigma_1 &\colon &\quad& 0 \to M_1 \map{u_1 \\ f_1} M_2\oplus N_1 \map{f_2,u_2} N_2 \to 0 \\
\Sigma_2 &\colon &\quad& 0 \to M_2 \map{v_1 \\ f_2} M_3\oplus N_2 \map{f_3,v_2} N_3 \to 0
\end{alignat*}
be short exact sequences in $\fmod{A}$. Then the sequence
\begin{equation*}
\Sigma_3 \colon \quad 0 \to M_1 \map{v_1u_1 \\ f_1} M_3\oplus N_1 \map{f_3,-v_2u_2} N_3 \to 0
\end{equation*}
is exact. Moreover we have $\delta_{\Sigma_3}=\delta_{\Sigma_1}+\delta_{\Sigma_2}$.

\end{document}

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.