4

I know how to create rectangular commutative diagrams for e.g

\begin{tikzcd}
A \arrow[r, "\phi"] \arrow[d, red]
& B \arrow[d, "\psi" red] \\
C \arrow[r, red, "\eta" blue]
& D
\end{tikzcd}

will create

enter image description here

But I want to draw the following

enter image description here

Please suggest how to do this.

2 Answers 2

11

Same principle really. See the diagram as a 4×3 matrix. In the first row you have KF' in the second column, nothing in the first and third col. In the second row you have K and F' in the first and third column, respectively. In rows three and four, you have K\cup F' and F in the second column, and nothing in the first and third column.

There will be several possible ways of making the || on top of the lines. One way is to simply place a label with || on the lines, with , "||"{anchor=center,sloped}. Here anchor=center means the label is placed on top of the line, not next to the line (as is default), and sloped means the node is rotated to match the angle of the line.

enter image description here

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
        & KF' 
          \arrow[dl, dash]
          \arrow[dr, dash, "||"{anchor=center,sloped}] \\
 K \arrow[dr, dash, "||"{anchor=center,sloped}] & & 
 F' \arrow[dl, dash] \\
        & K\cap F' \arrow[d, dash] \\
        & F
\end{tikzcd}
\end{document}
3

enter image description here

\documentclass[a4paper,12pt]{article}
\usepackage{tikz-cd}
\usetikzlibrary{decorations.markings}
\tikzset{
  doubleline/.style = {decoration = {markings, mark = at position 0.5 with { \node[transform shape, xscale = .9, yscale=.5] {//}; } }, postaction = {decorate} },
}
\begin{document}
\begin{tikzcd}
 &  & KF' \arrow[lld,no head] \arrow[rrd, doubleline, no head] &  &  \\
K \arrow[rrd,  doubleline, no head] &  &  &  & F' \arrow[lld,  no head] \\
 &  & K\cap F' \arrow[d, no head] &  &  \\
 &  & F &  & 
\end{tikzcd}
\end{document}

You must log in to answer this question.

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