1

I am trying to draw a 3D model of cyclohexane with some substituents. I am using the following code to draw my molecule.

\documentclass{article}

\usepackage{chemfig}

\begin{document}
\chemfig[bond join=true]{-[:50]-[:-10]-[:10]-[:-130,,,,line width=1pt]-[:170,,,,line width=1pt](-[:230,0.55,,3]CH_3CHCH_3)-[:190,,,,line width=1pt](-[:-90,0.75,,,blue]CH_2CH_3)}

\end{document}

The ouput is this:

enter image description here

I need to overlay the isoproyl group (CH3CHCH3) over the blue line and the ethyl group (CH2CH3). I know I can reorder the bonds to get tikz to draw the isopropyl bond first, but I was wondering if there's a more general way to bring a given atom to the front of the picture by, for example, giving a tikz command like

(-[:230,0.55,,3,"bring to font"]CH_3CHCH_3). 

Thanks!

2
  • Entirely unrelated to the alignment issue itself, but in its current form, the carbon atom of the isopropyl group that attaches to the cyclohexane ring essentially has 5 bonds (one to the ring, 2 to the methyl groups and 2 to the hydrogen atoms) instead of the expected 4 bonds. A correct formula would only contain one hydrogen atom at this carbon, instead of two. As an alternative, you could also use -CH(CH3)2 instead of CH3CHCH3 for the isopropy substituent and entirely avoid the overlap, as shown in this image: i.sstatic.net/mbPTs.png
    – leandriis
    Commented Jul 4, 2021 at 8:39
  • @leandriis Thanks, fixed it. I will consider using shorthand notation in the future where possible, though I suspect there will be many cases where a more general solution will be necessary.
    – Harry
    Commented Jul 15, 2021 at 0:13

2 Answers 2

3

with a trick

\documentclass{article}

\usepackage{chemfig}

\begin{document}

\chemfig[bond join=true]{-[:50]-[:-10]-[:10]-[:-130,,,,line width=1pt]-[:170,,,,line width=1pt](-[:230,0.55,,3]CH_3CH_2CH_3)-[:190,,,,line width=1pt](-[:-90,0.75,,,blue,blend mode=overlay]CH_2CH_3)}

\end{document}

enter image description here

1
  • Yes. This is exactly what I was looking for. Thanks so much for the suggestion!
    – Harry
    Commented Jul 15, 2021 at 0:15
1

Like this? Maybe not the most elegant solution. I added a dummy atom and shortened the boding lenght.

\documentclass{article}
\usepackage{chemfig}
\begin{document}
\chemfig[bond join=true]{-[:50]-[:-10]-[:10]-[:-130,,,,line width=1pt]-[:170,,,,line width=1pt](-[:230,0.55,,3,]CH_3CH_2CH_3)-[:190,,,,line width=1pt](-#(0pt)[:-90,0.1,,,blue]{}-#(9pt)[:-90,0.75,,,blue]CH_2CH_3)}
\end{document}

enter image description here

1
  • Thanks for the suggestion, but I'm going to be typesetting a lot of these, so I'll need a more efficient approach like the one suggested by polyn.
    – Harry
    Commented Jul 15, 2021 at 0:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .