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

CarLaTeX
  • 62,716
  • 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. – Jasper Habicht Dec 10 '23 at 08: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 '23 at 09: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 ... =) – Jasper Habicht Dec 10 '23 at 09:12

4 Answers4

6

(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}

Mico
  • 506,678
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']} 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

CarLaTeX
  • 62,716
3

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

Zarko
  • 296,517
0

Here is an option using chains.

enter image description here

\documentclass{article}

\usepackage{tikz} \usetikzlibrary {chains}

\newcommand{\radius}{3}

\begin{document}

[\begin{tikzpicture}[>=latex, start chain=herbrand placed {at=(180-60*\tikzchaincount:\radius)}] \foreach \H in {{H^0(G,A)},{H^0(G,B)},{H^1(G,C)},{H^1(G,A)},{H^1(G,B)},{H^0(G,C)}} {\node [on chain] {$\H$};} \foreach \L[count=\n, evaluate=\n as \m using {int(mod(\n,6)+1)}] in {f_0,g_0,\delta_0,f_1,g_1,\delta_1} {\draw[->] (herbrand-\n) to[edge label=$\L$] (herbrand-\m);} \draw[->] (270:.5)arc(270:-45:.5); \end{tikzpicture}]

\end{document}

Sandy G
  • 42,558