3

I'm trying to draw a McLafferty rearrangement with chemfig (great tool btw). With

MWE:

\documentclass[a4paper,landscape]{article}
\usepackage[utf8]{inputenc}
\usepackage{chemfig}
\renewcommand*\printatom[1]{\sffamily{#1}}
\newcommand*\radcationvert{\raisebox{4.7pt}{\hspace{.5pt}\lewis{6.,\scriptsize +}}}
\setcrambond{5pt}{1pt}{2pt}
\setlewis[]{2.5pt}{}{}
\usetikzlibrary{arrows}% per right to e left to
\usepackage{tgheros}
\renewcommand*\familydefault{\sfdefault}
\usepackage{sansmath}
\sansmath
\usepackage[T1]{fontenc}

\begin{document}
\chemfig{C*6((-[:-150]Y)(=[@{b6}:90]@{O}{\lewis{4:,O}\rlap{\radcationvert}})-[@{b1}]@{C2}C(<[:-110]H)(<:[:-70]R\rlap{'})-[@{b2}]C(<[:-50]H)(<:[:-10]H)-[@{b3}]C(<[:10]H)(<:[:50]R)-[@{b4}]H-[@{b5},,,,draw=none]\phantom{O})}
\chemmove[->]{\draw[-right to,shorten <=2pt,shorten >=2pt](b2).. controls +(120:5mm) and +(90:5mm).. (C2);}
\chemmove[->]{\draw[-left to,shorten <=2pt,shorten >=2pt](b2).. controls +(120:5mm) and +(180:5mm).. (b3);}
\chemmove[->]{\draw[-right to,shorten <=2pt,shorten >=2pt](b4).. controls +(-120:5mm) and +(180:5mm).. (b3);}
\chemmove[->]{\draw[-left to,shorten <=2pt,shorten >=2pt](b4).. controls +(-120:4mm) and +(-60:4mm).. (b5);}
\chemmove[->]{\draw[-right to,shorten <=5pt,shorten >=2pt](O).. controls +(-15:6mm) and +(-60:5mm).. (b5);}
\end{document}

I get this nice odd scheme, which is clearly useless:

enter image description here

A possible workaround is to redraw the arrows kind of like this

\chemmove[->]{\draw[-right to,shorten <=3pt,shorten >=3pt](b2).. controls +(140:3mm) and +(70:3mm).. (C2);}
\chemmove[->]{\draw[-right to,shorten <=3pt,shorten >=3pt](b2).. controls +(100:4mm) and +(190:4mm).. (b3);}
\chemmove[->]{\draw[-left to,shorten <=3pt,shorten >=3pt](b4).. controls +(-100:4mm) and +(170:4mm).. (b3);}
\chemmove[->]{\draw[-right to,shorten <=3pt,shorten >=3pt](b4).. controls +(-140:4mm) and +(-50:4mm).. (b5);}
\chemmove[->]{\draw[-left to,shorten <=5pt,shorten >=3pt](O).. controls +(-15:6mm) and +(-70:4mm).. (b5);}

which throws out a pretty good

enter image description here

Note that usually the fishook arrows have the barb on their convex side, and that's how they're drawn in the first example. In the second one that would mess up the newly formed bonds zone.


My question is: is there a way to shift the start/end points of the arrows in the first example so that I get something nice and uncluttered kind of like this?

I've tried designating the same bond two times, one with @{b,0.4} and the other one with @{b,0.6} but that doesn't seem to work.


Please allow me to ask two more questions which I believe are quick for the knowledgeables but not for me:

1) I use a macro to write the radical cations (it comes from a previous question)

\newcommand*\radcationvert{\raisebox{4.7pt}{\hspace{.5pt}\lewis{6.,\scriptsize +}}}

The problem with this is that when I draw the bond between the oxygen and the hydrogen north-east from it, the + sign of the charge is in the way. How can I lower the "+" a bit?
I've tried putting \raiseboxes everywhere (the heuristic way to LaTeX, notoriously the best) but that always moves the dot too, while I need them to just get closer.

2) Can I place a third control point for the arrows? Sometimes they don't come out as nice and as rounded as I wanted them and I feel like another control point is just what I need. Again, my heuristic attempts didn't do the job, but TikZ doc freakes me out more than my pathological finickiness wants to get it done.

4

You can use the Tikz library calc to manually add shift to the tip of the arrows. Note that arrows is deprecated so I replaced it with arrows.meta. For the new arrow tips, see the Tikz Manual, 16.5 Reference: Arrow Tips, page 203.

Output

figure 1

Code

\documentclass[a4paper,landscape]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{sansmath}
\usepackage{chemfig}
\usepackage{tgheros}

\renewcommand*\printatom[1]{\sffamily{#1}}
\newcommand*\radcationvert{\raisebox{4.7pt}{\hspace{.5pt}\lewis{6.,\scriptsize +}}}

\setcrambond{5pt}{1pt}{2pt}
\setlewis[]{2.5pt}{}{}

\usetikzlibrary{calc,arrows.meta}% per right to e left to
\tikzset{
    myedge/.style={->, -{Latex[#1]}}
}

\renewcommand*\familydefault{\sfdefault}
\sansmath

\begin{document}
\chemfig{C*6((-[:-150]Y)(=[@{b6}:90]@{O}{\lewis{4:,O}\rlap{\radcationvert}})-[@{b1}]@{C2}C(<[:-110]H)(<:[:-70]R\rlap{'})-[@{b2}]C(<[:-50]H)(<:[:-10]H)-[@{b3}]C(<[:10]H)(<:[:50]R)-[@{b4}]H-[@{b5},,,,draw=none]\phantom{O})}
\chemmove{\draw[myedge={right},shorten <=2pt,shorten >=2pt]($(b2)+(30:-1mm)$).. controls +(120:5mm) and +(90:5mm).. (C2);}
\chemmove{\draw[myedge={left},shorten <=2pt,shorten >=2pt]($(b2)+(30:1mm)$).. controls +(120:5mm) and +(180:5mm).. ($(b3)+(0,-1mm)$);}
\chemmove{\draw[myedge={right},shorten <=2pt,shorten >=2pt]($(b4)+(-30:1mm)$).. controls +(-120:5mm) and +(180:5mm).. ($(b3)+(0,1mm)$);}
\chemmove{\draw[myedge={left},shorten <=2pt,shorten >=2pt]($(b4)+(-30:-1mm)$).. controls +(-120:4mm) and +(-60:4mm).. ($(b5)+(30:1mm)$);}
\chemmove{\draw[myedge={right},shorten <=5pt,shorten >=2pt](O).. controls +(-15:3mm) and +(-60:5mm).. ($(b5)+(30:-1mm)$);}
\end{document}
  • Thanks, but how do I use it? Seems to me like it's meant to be used as ...[myedge={left,<length>}... but I get an error when I try. – Arch Stanton Jun 4 '15 at 0:35
  • @Arch Actually that's an option for the tip. See above in the Tikzset, myedge style takes one argument, left or right. This will change the arrow tip, but the shifting happens at the end on the arrow, where you see ($(b3)+(.5mm, .5mm)$). I can explain it better tomorrow if you have trouble understanding the code, but it's late over here and I'm writing on the phone. – Alenanno Jun 4 '15 at 0:44
  • Daaaamn! Didn't see it. Sorry but it's 3 o'clock in the morning for me too ;) The code's clear, I've edited your answer so the arrows are properly oriented and distanced. – Arch Stanton Jun 4 '15 at 0:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.