[Tex/LaTex] Radical ions with chemfig

chemfig

Is there a way to draw a radical cation like enter image description here using chemfig?


Edit #2

\chemfig{C(-[:-150]Y)(=[:90,,,2]\radcationleft O)-[:-30]\chemabove{C}{H}(-[:-90]R\rlap{'})-[:30]C(<[:-60]H)(<:[:-15]H)-[:90]C(<[:120]H)(<:[:165]H)-[:30]R}

with \radcationleft defined as (an adaptation of unbonpetit's code)

\newcommand*\radcationleft{\chemabove[0pt]{\lewis{4.,\rule[0pt]{0pt}{4.4pt}}}{\vspace{-.8pt} \scriptsize+ \hspace{5pt}}}

draws a pretty

enter image description here

Note that this only works with Helvetica (tgheros), as the alignment is made by eye.


Edit #1

I've tried both unbonpetit's and Steven's methods. Steven's code was easier to adapt to the molecule I'm trying to draw: chemfig treats the dot and + signs as an atom and I just needed to correct the arrival atom, so that the double bond links the carbon with the oxygen instead of the signs:

\chemfig{Y-[::30]C(=[::60,,,2]\stackon[0pt]{$\cdot$}{\scriptsize +}O)-[::-60]\chemabove{C}{H}(-[::-60]R\rlap{'})-[::60]C(<[::-90]H)(<:[::-50]H)-[::60]C(<[::30]H)(<:[::70]H)-[::-60]R}

yields to

enter image description here

While with

\chemfig{Y-[::30]C(=[::60]\chemabove[0pt]{\lewis{4.,\vphantom o}}{\scriptsize +}O)-[::-60]\chemabove{C}{H}(-[::-60]R\rlap{'})-[::60]C(<[::-90]H)(<:[::-50]H)-[::60]C(<[::30]H)(<:[::70]H)-[::-60]R}

I'm getting this

enter image description here

and I don't know how to correct it.

One last thing, how can I lower the symbols a bit to make them vertically centered with respect to the O?

Best Answer

No need the extra package since chembove can stack stuff.

\documentclass{article}
\usepackage{chemfig}
\begin{document}
\chemfig{A-\chemabove[0pt]{\Lewis{4.,\vphantom o}}{\scriptstyle+}O-B}
\end{document}

enter image description here

EDIT: Still no need of extra package like "stackengine" or extra complicated macro. Lewis and chemabove can do the job:

\documentclass{article}
\usepackage{chemfig}
\begin{document}
\chemfig{Y-[::30]C(=[::60,,,2]\chemabove[0pt]{\Lewis{4.,\vphantom{\scriptstyle +}}}{\scriptstyle +}|O)-[::-60]\chemabove{C}{H}(-[::-60]R\rlap{'})-[::60]C(<[::-90]H)(<:[::-50]H)-[::60]C(<[::30]H)(<:[::70]H)-[::-60]R}
\end{document}

enter image description here

Related Question