# How can I float molecules in \chemfig around an element? (without the lines)

For example:

I just want to show that the H2O molecules are attracted to the Carbon atom. I can't find a way to remove the lines connecting the Oxygens to the Carbons or how to extend the Hydrogens out from the Oxygens.

Here is a minimal working example.

\documentclass{article}
\usepackage{chemfig}
\begin{document}
\chemfig{C^+(-[:0]O)(-[:90]O)(-[:180]O)(-[:270]O)}
\end{document}

-
Welcome to TeX.sx! Can you show us a minimal code of your attempts to this figure? For starters, strip out the parts of your code that is not important to drawing this figure and post the resulting minimal working or non-working example (MWE) here. –  hpesoj626 Mar 22 '13 at 2:40
I wasn't sure which parts of the code are vital as I just started using LaTeX for the first time today. I just downloaded this template off the internet and it seems to work fine for my math document, but I'm having trouble with this chemistry stuff. –  latexuser Mar 22 '13 at 2:47
I have modified your code into an MWE as the template seems to load a lot of stuff that you will not need for now in drawing the figure. I hope the edit was okay. :) –  hpesoj626 Mar 22 '13 at 3:03

Here is a pure chemfig solution :

\documentclass{article}
\usepackage{chemfig}
\begin{document}
\definesubmol{eau}{O(-[::-45]H)-[::45]H}
\def\dist{.75}% set the distance between C+ and water
\chemfig{C^{+}(-[:180,\dist,,,draw=none]!{eau})(-[:60,\dist,,,draw=none]!{eau})-[:-60,\dist,,,draw=none]!{eau}}
\end{document}


-

Perhaps there's a "pure" chemfig solution, but you could use TikZ to place the molecules at the desired positions:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage{chemfig}

\newcommand\Water{\chemfig{O(-[1]H)-[7]H}}

\begin{document}

\begin{tikzpicture}[inner sep=0pt]
\node (cp) {\chemfig{C^+}};
\node[above right=-20pt and 10pt of cp,rotate around={40:(cp)}] {\Water};
\node[below right=-20pt and 10pt of cp,rotate around={-40:(cp)}] {\Water};
\node[left=40pt of cp,xscale=-1] {\Water};
\end{tikzpicture}

\end{document}


And another option (this time a TikZ-free one):

\documentclass{article}
\usepackage{chemfig}
\usepackage{graphicx}

\newcommand\Water{\chemfig{O(-[1]H)-[7]H}}

\begin{document}

\begin{picture}(100,200)
\put (0,0){\chemfig{C^+}}
\put (10,10) {\rotatebox{40}{\Water}}
\put (10,-10) {\rotatebox{-40}{\Water}}
\put (-45,5) {\scalebox{-1}{\Water}}
\end{picture}

\end{document}


-
Yes! Is there a way to move the Oxygens closer to the Carbon? I'm playing around with the numbers but I can't seem to make them go closer to the Carbon. –  latexuser Mar 22 '13 at 2:52
@latexuser please see my updated answer –  Gonzalo Medina Mar 22 '13 at 2:55
@latexuser You can upvote and accept this answer if it solves your problem. –  hpesoj626 Mar 22 '13 at 3:05