2

The following code

\[
\begin{tikzpicture}[>=latex]
    \def\radius{3cm} % change to an appropriate value
    \node (h0A) at (60:\radius)   {$H^0(G,A)$};
    \node (h0C) at (0:\radius)    {$H^0(G,C)$};
    \node (h1B) at (-60:\radius)  {$H^1(G,B)$};
    \node (h1A) at (-120:\radius) {$H^1(G,A)$};
    \node (h1C) at (180:\radius)  {$H^1(G,C)$};
    \node (h0B) at (120:\radius)  {$H^0(G,B)$};

    \path[->,font=\small]
        (h0A) edge node[auto] {$g_0$} (h0C)
        (h0C) edge node[auto] {$\delta_0$} (h1B)
        (h1B) edge node[auto] {$f_1$} (h1A)
        (h1A) edge node[auto] {$g_1$} (h1C)
        (h1C) edge node[auto] {$\delta_1$} (h0B)
        (h0B) edge node[auto] {$f_0$} (h0A);
\end{tikzpicture}\]

enter image description here

But I want to exchange $A$ and $B$ and write the following diagram.
But when I exchange $A$ and $B$ in the above diagram, diagram is destroyed.
How can I write the diagram below in LaTeX?

enter image description here

3
  • Provided that you load the amssym package (you should always post complete MWEs including \documentclass and all relevant packages), you can put \node[rotate=180] at (0,0) {$\circlearrowright$}; to your document in order to typset the clockwise arrow in the center of your diagram. Dec 10, 2023 at 8:37
  • 1
    @JasperHabicht - Great suggestion for the additional node; in fact, I've updated my answer to include [borrow?, steal??] your suggestion. (You're familiar with Picasso's saying in this regard, right?)
    – Mico
    Dec 10, 2023 at 9:02
  • 1
    @Mico Oh, sure! It should be considered implemeting an inspiration, I guess. I'd say that coding is almost always largely based on copying ... =) Dec 10, 2023 at 9:12

3 Answers 3

6

This is a job for tikz-cd.

I didn't use \circlearrowright because its tip is different from -latex one.
I drew a circle arrow, this way you can customize it as you wish (arrow tip, position, dimension).

\documentclass{article}
\usepackage{tikz-cd}
\usetikzlibrary{arrows.meta, bending}
\tikzcdset{
    arrow style=tikz,
    arrows={>={latex}},
}

\begin{document}
% code for centering the circle arrow taken from https://tex.stackexchange.com/a/66219/101651
\[
\begin{tikzcd}[
  every matrix/.append style={name=mycd},
  execute at end picture={\draw[-{latex[flex']}]([shift=(230:6mm)]mycd.center) arc (230:-45:6mm);}
  ]
    &[-33pt] H^0(G,A)\ar[r,"f_0"] &[13pt] H^0(G,B)\ar[rd,"g_0"]&[-33pt]\\[40pt]
    H^1(G,C)\ar[ur,"\delta_1"] &&& H^0(G,C)\ar[ld,"\delta_0"]\\[40pt]
    & H^1(G,B)\ar[ul,"g_1"] & H^1(G,A)\ar[l,"f_1"]
\end{tikzcd}
\]
\end{document}

enter image description here

4
  • I cannot compile it in my overleaf. Circle arrow should occurred error. How can I manage it ? Dec 10, 2023 at 9:51
  • @BrauerManinobstruction Did you add \usetikzlibrary{arrows.meta, bending} in your preamble?
    – CarLaTeX
    Dec 10, 2023 at 10:02
  • @BrauerManinobstruction Also the other definitions I put in my preamble.
    – CarLaTeX
    Dec 10, 2023 at 10:04
  • @BrauerManinobstruction In Overleaf my code works, see here overleaf.com/read/thgbgpxxzkkx#025537
    – CarLaTeX
    Dec 10, 2023 at 10:06
5

(too long for a comment, hence posted as an answer; updated to include @JasperHabicht's suggestion)

I do not find that the "diagram is destroyed" when I replace the letter sequence A-C-B-A-C-B in the node list with B-C-A-B-C-A.

Note that it's not necessary to update the six node names in a similar fashion. In fact, it might be good idea to label the nodes without reference to their contents. E.g., one might choose u, v, w, x, y, and z as the six node names.

enter image description here

\documentclass{article}
\usepackage{tikz,amssymb}

\begin{document}

\[
\begin{tikzpicture}[>=latex]
    \def\radius{3.3cm} % choose an appropriate value
    \node (u) at ( 60:\radius) {$H^0(G,B)$};
    \node (v) at (  0:\radius) {$H^0(G,C)$};
    \node (w) at (300:\radius) {$H^1(G,A)$};
    \node (x) at (240:\radius) {$H^1(G,B)$};
    \node (y) at (180:\radius) {$H^1(G,C)$};
    \node (z) at (120:\radius) {$H^0(G,A)$};

    \path[->]
          (u) edge node[auto] {$g_0$}      (v)
          (v) edge node[auto] {$\delta_0$} (w)
          (w) edge node[auto] {$f_1$}      (x)
          (x) edge node[auto] {$g_1$}      (y)
          (y) edge node[auto] {$\delta_1$} (z)
          (z) edge node[auto] {$f_0$}      (u);

    \node[rotate=180] at (0,0) {\Huge$\circlearrowright$};
\end{tikzpicture}
\]

\end{document}
2

Variation of nice @Mico answer (+1) with use of quotes library and drawn circle arrow in the middle of hexagon:

\documentclass{article}
\usepackage{tikz,amssymb}
\usetikzlibrary{quotes}

\begin{document}
    \[
\begin{tikzpicture}[
        >=latex,
everyy edge quotes/.style = {auto, font=\fontsize}
                    ]
\def\radius{3.3cm} % choose an appropriate value
\node (n1) at (120:\radius) {$H^0(G,A)$};
\node (n2) at ( 60:\radius) {$H^0(G,B)$};
\node (n3) at (  0:\radius) {$H^0(G,C)$};
\node (n4) at (300:\radius) {$H^1(G,A)$};
\node (n5) at (240:\radius) {$H^1(G,B)$};
\node (n6) at (180:\radius) {$H^1(G,C)$};

\path[->]
      (n1) edge["$f_0$"]      (n2)
      (n2) edge["$g_0$"]      (n3)
      (n3) edge["$\delta_0$"] (n4)
      (n4) edge["$f_1$"]      (n5)
      (n5) edge["$g_1$"]      (n6)
      (n6) edge["$\delta_1$"] (n1);

\draw[->] (240:1.2) arc (240:-60:1.2);
\end{tikzpicture}
    \]
\end{document}

enter image description here

You must log in to answer this question.

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