chemfig: molecule vibration

There is a way to represent the molecule vibration (asymmetric stretching, scissoring ecc.) due to IR radiation? I mean something like the blue arrow

I add the blue arrow with Inkscape. The best I do with TeX is this:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[italian]{babel}
\usepackage[
a4paper,
margin=15mm,
bindingoffset=2mm,
heightrounded,
]{geometry}

\usepackage{amsmath}
\usepackage{chemfig}
\usepackage[version=3]{mhchem}

\begin{document}

\schemestart
\chemfig{H-[:30]O-[:-30]H}
\arrow[30,1]
\schemestop

\end{document}


Is it possible draw bond parallel arrows ? If yes, how?

Thank you in advance

1 Answer

See section 11.1 of the chemfig manual: you can always remember nodes with the @{...} syntax and annotate them later.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[italian]{babel}
\usepackage[
a4paper,
margin=15mm,
bindingoffset=2mm,
heightrounded,
]{geometry}

\usepackage{amsmath}
\usepackage{chemfig}
\usepackage[version=3]{mhchem}

\begin{document}

\schemestart
\chemfig{@{H1}H-[:30]@{O1}O-[:-30]H}
\schemestop
\chemmove{\draw[blue,-latex]([yshift=2mm]H1.north)--([yshift=1.2mm,xshift=-1mm]O1.north west);}

\end{document}


ADDENDUM: And it is also possible to make the arrows really parallel to the original connections. To this end, first notice that these are simply being drawn by \draw (node1) -- (node2); commands. So all one has to do is to determine the start and end points of these paths and shift them.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[italian]{babel}
\usepackage[
a4paper,
margin=15mm,
bindingoffset=2mm,
heightrounded,
]{geometry}

\usepackage{amsmath}
\usepackage{chemfig}
\usepackage[version=3]{mhchem}
% motivated by section 15.6 of the pgfmanual, @percusses comment https://tex.stackexchange.com/questions/423941/making-the-determination-of-extrema-more-elegant-in-tikz-not-pgfplots#comment1060557_423941
% as well as Henri Menkes's answer https://tex.stackexchange.com/a/423952/121799
\tikzset{mark path bounding box/.style = {
path picture={
\coordinate (#1-bl) at (path picture bounding box.south west);
\coordinate (#1-tr) at (path picture bounding box.north east);
\coordinate (#1-br) at (path picture bounding box.south east);
\coordinate (#1-tl) at (path picture bounding box.north west);
}
}
}

\begin{document}

\schemestart
\chemfig{@{H1}H-[:30]@{O1}O-[:-30]@{H2}H}
\schemestop
\chemmove{\path[mark path bounding box=HO](H1)--(O1);
\draw[blue,-latex]([yshift=2mm,xshift=-1mm]HO-bl)--([yshift=2mm,xshift=-1mm]HO-tr);
\path[mark path bounding box=OH](H2)--(O1);
\draw[blue,-latex]([yshift=2mm,xshift=1mm]OH-br)--([yshift=2mm,xshift=1mm]OH-tl);
}
\end{document}


• Wonderful! How to set the vibration arrow at the same lenght? paste.org/92255 – user3204810 Apr 1 '18 at 17:00
• @user3204810 Hmmh, according to the (implicit) rules of this site I am not supposed to follow external links because this may make it hard for others having a similar problem to figure out what's going on. Could you please have a look at my update and tell me if this is what you want? The addendum has truly parallel arrows of the same length. – user121799 Apr 1 '18 at 17:04