Drawing chemical reactions

I am trying to draw reactions like this

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?

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

You want this result, right?

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}


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.

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}

• 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 – aftershock Jun 25 '15 at 10:34
• @aftershock like this? – Alenanno Jun 25 '15 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 – aftershock Jun 25 '15 at 11:35
• @aftershock See answer – Alenanno Jun 25 '15 at 11:58
• 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 Jun 25 '15 at 12:47

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}


• 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 :) – aftershock Jun 25 '15 at 12:24
• but isn't it abit odd to use old versions ? – aftershock Jun 25 '15 at 12:26
• @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 Jun 25 '15 at 12:35