Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
    
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
1  
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
add comment

2 Answers 2

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}

enter image description here

share|improve this answer
add comment

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}

enter image description here

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}

enter image description here

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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