I'm trying to create a diagram like this with Latex. (I'm trying to learn to write in Latex by myself.)

The best code I can do is this:

\overset{\supset ker(f)}{ker(w)\subset E} \ar[d]_f \ar[dr]_{\pi_f} \ar[r]^w &\mathbb{K} \\
F & E/ker(f) \simeq Im(f) \ar[u]_{w'} }

That produces:

But it isn't the same, because the arrows must start at "E" and not in the middle of ker(w) \subset E and its obvious that \overset{} isn't the appropiate command to write \subset ker(f) as I want.

Thank you for your attention, and sorry for my english.

  • Welcome to TrX.SE! Off-topic: packages used in document had to be loaded in preamble, i.e. before \begin{document}.
    – Zarko
    Nov 12, 2016 at 1:40
  • Don't use $$ ... $$ in LaTeX - it is 20+ years obsolete. Try \[ ... \] instead.
    – cfr
    Nov 12, 2016 at 3:18

4 Answers 4


A somewhat more concise tikz alternative:

\documentclass[tikz, border=3mm]{standalone}
\usepackage{amsmath, amssymb}

\begin{tikzpicture}[inner sep=5pt, >=latex, 
   label/.style={auto, inner sep=1pt, circle}
\path (0,0) node (E) {$E$}
  (120:1.5) node (kerf) {$\ker(f)$}
  (180:1.5) node (kerw) {$\ker(w)$}
  (4,0) node (K) {$\mathbb{K}$}
  (0,-3) node (F) {$F$}
  (2,-2) node (EE) {\phantom{$E$}}
  (EE.west) node[anchor=west] {$E/\ker(f) \simeq Im(f)$};

\path (E) -- node[sloped] {$\subset$} (kerf);
\path (kerw) -- node[sloped] {$\supset$} (kerf);
\path (kerw) -- node {$\subset$} (E);
\draw[->] (E) -- node[label] {$w$} (K);
\draw[->] (E) -- node[label] {$f$} (F);
\draw[->] (E) -- node[label] {$\pi_f$} (EE);
\draw[->, dashed] (EE) -- node[label] {$w'$} (K);

enter image description here


Since it seems a commutative diagram, what about using tikz-cd?

\usepackage{amsmath, amssymb}
        &[-30pt] \ker(f) \arrow[dl, phantom, sloped, "\supset"] \arrow[dr, phantom, sloped, "\subset"]&[-30pt] & &[-75pt] \\[-4pt]
        \ker(w) \arrow[rr, phantom, "\subset"]& & E \arrow[rr, "w"] \arrow[rd, end anchor={[xshift=.5em]north west}, "\pi_f"] \arrow[dd, swap, "f"] & & \mathbb{K}\\
        & & & E/\ker(f) \simeq Im(f) \arrow[ru, dashrightarrow, start anchor={[xshift=1.1em]north west}, swap, "w'"]& \\
        & & F & & 

enter image description here


A TikZ alternative (it is not so concise as it is pstricks:

\documentclass[tikz, border=3mm]{standalone}
\usetikzlibrary{arrows.meta, positioning, quotes, shapes.multipart}
\usepackage{amsmath, amssymb}

     node distance = 22mm and 24mm,
every label/.style = {label distance=0mm, inner sep=0mm, 
                      xshift=1em, align=center},
RS/.style = {%Rectangle Split 
    rectangle split, rectangle split horizontal, rectangle split parts=2,
    inner ysep=1mm, inner xsep=0mm}
\node (n1) [RS,label={$\ker(f)$\\ 
    {\nodepart{one} $\ker(w)\quad\subset\quad$
     \nodepart{two} $E$
\node (n2) [right=of n1] {$\mathbb{K}$};
\node (n3) [below=of n1.two south] {$F$};
\node (n4) [RS,right=of n3] 
    {\nodepart{one} $E/$
     \nodepart{two} $\ker(f) \simeq Im(f) \ar[u]_{w'}$
\draw[-Latex]   (n1) edge ["$w$"] (n2)
                (n1.two south) edge ["$f$"] (n3)
                (n1.south east) edge ["$\pi_f$"] (n4.north west)
                (n4.one north) to ["$w'$"] (n2);

enter image description here


Here is a simple way to do it with pstricks:

\usepackage{lmodern, amssymb}
\usepackage{pst-node, auto-pst-pdf}

\newpsobject{ncemptyline}{ncline}{linestyle=none, arrows=-}


\psset{shortput=tab,  arrows=->, linewidth=0.6pt,  nodesep=3pt}
$ \begin{psmatrix}[rowsep=0.6, colsep=0.4]
& [name = Kf] \ker f \\
[name = Kom] \kerω& & [name = E] E & & [name =K] K\\
& & & [name = Cok] E/\ker f\mathrlap{\,  ≃  \Img f} \\
& & [name = F] F%
%\nput{0}{Cok}{\!\!\!{}  ≃  {}\Img f}
\ncline{E}{K}^{ω}     \ncline{E}{F}_{f}%
\end{psmatrix}  $


enter image description here

You must log in to answer this question.

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