5

I am trying to draw reactions like this enter image description here

I tried it like this

\documentclass[11pt]{article}

\usepackage[version=4]{mhchem}
\usepackage{chemfig}

\begin{document}
  \ce{ \chemfig{CH_3-CH (-[2]OH)-CH_3}  + HI -> \chemfig{CH_3-CH(-[:90]I)-CH_3} + H2O}

\end{document}

the result looks very messy .So how do i accomplish making such structures by showing only one bond between OH and Carbon at reactant and one bond at iodine and Carbon at product? enter image description here

2
  • With \usepackage[version=3]{mhchem} you will obtain result aw hand wroted in your question.
    – Zarko
    Commented Jun 25, 2015 at 10:00
  • @Zarko Can you please give the code ?
    – Shirshak55
    Commented Jun 25, 2015 at 10:33

3 Answers 3

4

You want this result, right?

enter image description here

Then CH3CHCH3 must be considered as one group of 6 atoms (C, H, C, H, C and H) where the bond is leaving from the third atom. You need to tell this to chemfig using the bond's optional argument <departure>:

<bond>[<angle>,<length factor>,<departure>,<arrival>,<tikz>]

The code then is \chemfig{CH_3CHCH_3-[2,,3]OH}

\documentclass{article}
\usepackage{chemfig}
\usepackage[version=4]{mhchem}

\begin{document}

\ce{ \chemfig{CH_3CHCH_3-[2,,3]OH} + HI -> \chemfig{CH_3CHCH_3-[2,,3]I} + H2O}

\end{document}
0
3

Remove the \ce command, that will fix the links. The arrow is done with the command \arrow.

Also remember to enclose it between \schemestart and \schemestop.

Output

figure 1

Code

\documentclass[11pt]{article}
\usepackage[version=4]{mhchem}
\usepackage{chemfig}

\begin{document}
\schemestart
\chemfig{CH_3}\chemfig{CH(-[2]OH)}\chemfig{CH_3} + HI \arrow(.mid east--.mid west)\chemfig{CH_3(-[2]I)}\chemfig{CH CH_3} + \chemfig{H_2O}
\schemestop
\end{document}
9
  • Hey i don't want to show the bonds between CH3-CH-CH3 please ? I want to show single covalent bond between CH and OH only
    – Shirshak55
    Commented Jun 25, 2015 at 10:34
  • @aftershock like this?
    – Alenanno
    Commented Jun 25, 2015 at 10:55
  • Yes but OH bond should be in second carbon as i have shown in post picture . it is nearly same :) but that bond should be in second carbon
    – Shirshak55
    Commented Jun 25, 2015 at 11:35
  • @aftershock See answer
    – Alenanno
    Commented Jun 25, 2015 at 11:58
  • 1
    The mid east and mid west are needed for the arrow to be properly placed. If you only use \arrow, it will appear above.
    – Alenanno
    Commented Jun 25, 2015 at 12:47
1

I thing that your code work well with [version=3]{mhchem}:

\documentclass[11pt]{article}

\usepackage[version=3]{mhchem}% <---
\usepackage{chemfig}

\begin{document}
  \ce{ \chemfig{CH_3-CH (-[2]OH)-CH_3}  + HI -> \chemfig{CH_3-CH(-[:90]I)-CH_3} + H2O}
\end{document}

enter image description here

3
  • Thanks but i want to make it abit easier but removed single bonds between ch3-ch-ch3 i want to show only bonds between OH and CH :)
    – Shirshak55
    Commented Jun 25, 2015 at 12:24
  • but isn't it abit odd to use old versions ?
    – Shirshak55
    Commented Jun 25, 2015 at 12:26
  • 1
    @afterschock, yes, it is. But my experiences show, that sometimes new versions has new bugs or at least glitches and not completely compatible with old files. To renew them to new syntax is far more odd, I'm afraid. Probably some one, who is more experienced with chem packages, should wrote to author of packages about this problem.
    – Zarko
    Commented Jun 25, 2015 at 12:35

You must log in to answer this question.

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