Simple U-Arrow above Arrow in tikz

image

Since I´m having to write down a lot of biochemical reactions, I´d love to find an easier way for drawing curved arrows above other arrows in TikZ. I know that there´s an option in the chemfig package but it´s not working for any larger textsizes or if you´d like to include some figures or anything.

I´m curious if there´s any simpler solution for the U-arrow. So here´s my quite laborious way of doing the U-arrow so far:

Which gives me the following result:



My desired way of doing that would be something like this:

But I´m happy to here any other suggestions. Thanks in advance! :)

This is asking for a pic (but not with the syntax you proposed).

I define the two values radius as well as (half) the arc's angle and two styles for the two nodes that will be used by the pic chem U = {}{} which needs two arguments for the two nodes. (The key pic text and the quotes library would allow setting the text via keys or the "…" syntax but using it with two nodes makes this a small task.)

For simple horizontal lines, the default styles for node 1 and node 2 would be enough. For other connections, an automatic placement of the nodes will be interesting but I want to see your use-cases first.



Here's a try with the decorations.pathreplacing TikZ library. Use the show path construction to set the lineto code:

Here the two coordinates of the segment are available with \tikzinputsegmentfirst and \tikzinputsegmentlast. Use let to compute its length:

Now we can draw the U-arrow, and scale it with respect to the path length, which is stored in \n1:

Then define a dedicated style to handle this, taken two arguments to set the arrow labels

Example:



Ask AI
#1 #2 #3 #4 #5 #6 #7 #8 #9 #10 #11 #12 #13 #14 #15 #16 #17 #18 #19 #20 #21 #22 #23 #24 #25 #26 #27 #28 #29 #30 #31 #32 #33 #34 #35 #36 #37 #38 #39 #40 #41 #42 #43 #44 #45 #46 #47 #48 #49 #50 #51 #52 #53 #54 #55 #56 #57 #58 #59 #60 #61 #62 #63 #64 #65 #66 #67 #68 #69 #70