1

I'm fairly new to Latex and I've been using chemfig to draw a couple of diagrams so far, but for this one I'm trying to do I've not found a way. I haven't used tikz before, but it seems to me that it would be the better option here. Nevertheless I can't find any example of what I'm looking for anywhere so I thought I would just ask.

Basically what I want to do is this:

enter image description here

But I haven't been able to come even close and don't have a single line of code to show for it. Can anyone help?

EDIT: I've very clumsily thrown together this following code, which is kind of what I wanted, but I'm hoping there's a neater way to do it. Also I would very much like the arrows to touch/merge in some way.

\documentclass{scrartcl}
\usepackage{tikz-cd}
\begin{document}

\begin{tikzpicture}
\node (a) at (0,0) {A};
\node (b) at (2,0) {B};
\draw[-latex,bend right]  (a) edge (b);
\end{tikzpicture}\\
\begin{tikzpicture}
\node (c) at (0,0) {C};
\node (d) at (2,0) {D};
\draw[-latex,bend left]  (c) edge (d);
\draw[-latex,bend left]  (d) edge (c);
\end{tikzpicture}\\
\begin{tikzpicture}
\node (e) at (0,0) {E};
\node (f) at (2,0) {F};
\draw[-latex,bend right]  (f) edge (e);
\draw[-latex,bend right]  (e) edge (f);
\end{tikzpicture}\\
\begin{tikzpicture}
\node (g) at (0,0) {G};
\node (h) at (2,0) {H};
\draw[-latex,bend left]  (g) edge (h);
\end{tikzpicture}


\end{document}

enter image description here

2
  • 1
    Hi and welcome to TeX.SX. To get a faster and better-suited answer to your question, it would be best if you gave us something to work with. Show us what you got so far. A minimal working example starting with /documentclass{ and ending with \end{document} would let us run things on our side and find the solution you see.
    – Elad Den
    Apr 22, 2021 at 12:25
  • 1
    Edited the post to include an example!
    – Lilo
    Apr 22, 2021 at 12:46

1 Answer 1

2

You only need to draw the \nodes (A,B,C,...) and the arcs. To draw an arc you need to write

\draw (1,2) arc (0:90:3);

which means that you are drawing an arc starting at point (1,2) with inital angle 0, ending angle 90 and radius 3.

Something like this:

\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{babel} % just in case
\begin{document}
\begin{tikzpicture}[y={(0,-1cm)}, shorten >= 2mm, shorten <= 2mm,]
  \def\s{1} % separation between nodes
  \node (A) at ( 0,   0) {$A$};
  \node (B) at (\s,   0) {$B$};
  \node (C) at ( 0,  \s) {$C$};
  \node (D) at (\s,  \s) {$D$};
  \node (E) at ( 0,2*\s) {$E$};
  \node (F) at (\s,2*\s) {$F$};
  \node (G) at ( 0,3*\s) {$G$};
  \node (H) at (\s,3*\s) {$H$};
  \draw[->] (A) arc (180:  0:0.5*\s);
  \draw[->] (C) arc (180:360:0.5*\s);
  \draw[->] (D) arc (  0:180:0.5*\s);
  \draw[->] (E) arc (180:  0:0.5*\s);
  \draw[->] (F) arc (360:180:0.5*\s);
  \draw[->] (H) arc (360:180:0.5*\s);
\end{tikzpicture}
\end{document}

will draw:

enter image description here

3
  • This is great, thank you so much! I have two follow-up questions, I'm not sure if this is the place to pose them but here they are: (1) How can I control the distance between the nodes and arcs (vertically in this case)? (2) And what if I wanted to label the pairs of arrows on the right hand side of this flowchart? Is there a way to do this so the label is centered on the arrow-pair?
    – Lilo
    Apr 23, 2021 at 9:19
  • @Lilo, the vertical and horizontal distance can be modified with the parameter \s. You can define two variables for horizontal and vertical distance, but in this case you need to change the center of the arcs if you still want the arrows touching one another. For the second question, you need to add a \node in the desired position. Here 1.5*\s gives the middle point height between D and F, for example. Apr 23, 2021 at 10:30
  • Perfect, thank you!
    – Lilo
    Apr 23, 2021 at 12:38

You must log in to answer this question.

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