TransWikia.com

chemfig: bonds shifting downward after subscripts

TeX - LaTeX Asked on December 15, 2021

I am trying to use chemfig package, and some bonds seem to slip lower. I want all bonds to be the same height (of course?). There is a similar issue posted 2 years ago, and I have included the solution, but since I don’t want the extra atom in front of the bond, I don’t know what to do.

I want C_{italics{sp}^3}-H.

Here’s the code. Suggestions much appreciated.

documentclass[11pt, oneside]{article}
usepackage{geometry}
geometry{letterpaper}
usepackage{graphicx}
usepackage{chemfig}
usepackage{amssymb}


begin{document}

begin{enumerate}
    item chemfig{Ctextsubscript{textit{sp}textsuperscript{3}}-H} bond
    item chemfig{Ctextsubscript{textit{sp}textsuperscript{3}}{-}H} bond
    item chemfig{C_{textit{sp}^3}C(-H)}
    item chemfig{C_{textit{sp}^3}(-H)}
end{enumerate}

end{document}

enter image description here

Here is a hand-drawn image of what I’m trying to do, per request of js

2 Answers

Try this

documentclass[11pt, oneside]{article}
usepackage{geometry}
geometry{letterpaper}
usepackage{graphicx}
usepackage{chemfig}
usepackage{amssymb}


begin{document}
        setbondoffset{14pt}
    begin{enumerate}
        item chemfig{C(hspace{20pt}_{textit{sp}^3})-#(,0pt)H}
    end{enumerate}

    
end{document}

enter image description here

Answered by Edson Marcon on December 15, 2021

Taking into account the suggestion+1 given by @cgnieder -- from page 30 of the documentation -- http://mirrors.ctan.org/macros/generic/chemfig/chemfig-en.pdf#30

enter image description here

documentclass[11pt, oneside]{article}
usepackage{geometry}
geometry{letterpaper}
usepackage{graphicx}
usepackage{chemfig}
usepackage{amssymb}


begin{document}
    definesubmolI{vphantom{X}}
    begin{enumerate}
        item chemfig{Ctextsubscript{textit{sp}textsuperscript{3}}-H} bond
        item chemfig{Ctextsubscript{textit{sp}textsuperscript{3}}{-}H} bond
        item chemfig{C_{textit{sp}^3}C(-H)}
        item chemfig{C_{textit{sp}^3}|!I(-H)}
    end{enumerate}
    
end{document}

Answered by js bibra on December 15, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP