2

I am trying to draw a large molecule using the chemfig package. In this case I made a figure for cobalamin variants. I somehow managed to write this code spending hours over it, but find that subsequent management to be a nightmare.

Dear chemists using TeX, please have a look at my code and tell me how to try writing it better. I have tried certain indentation styles, but nothing suitable seems to emerge.

\documentclass{standalone}
% More defined colors
\usepackage{chemfig}
\begin{document}

\chemname{
\chemfig{
*6(N-[,0.1,,,-latex] Co^{2+}(-[:90]\textbf{X})-[,0.1,,,latex-]
    N*5(=(-[:-60,,,,shorten >=14.25pt])-(<:[:20]-[:50]-[:-10](=[:-70]O)-[:50]N)-
        (<:[:90])(-[:45]-[:90](=[:-210]O)-[:35]N)
    -)
-=(-)-*5(-(<:-[:160]-[:110](=[:50]O)-[:160]N)
    -(<:[:210])(-[:120]-[:170](=[:-120]O)-[:140]N)-
    (<:[:220])*5(-*5(-(-[::-45]-[::30](=[:-210]O)-[::35]N)-
    (<:[:180])(-[:260]-[::-60]-[::60](=[::70]O)-[::-60]N-[::60]-[::60](<[::45])-[:-90]O-[:-45]P(-[::-110]O^{-})(=[::-45]O)-[:-30]O-[::60]
            *5(-(<:-[::30]OH)-O-(-\textbf{Y}(-[:94,,,,shorten >=-145pt]))-(<HO)-))
    -*6(=(-)-*5(-(<:[::-40]-[::50]-[::-50](=[::-70]O)-[::50]N)-(-[:30])(-[:-30])-(=[:70,,,,shorten >=11.5pt])-)
        =
            (N-[:130]))-)-N-[,0.1,,,-latex])
        -[,,,,shorten >=5pt])
=)}}{Basic structure}
\end{document}

The corresponding output looks like this where again, the bonds seem to spill into the N atom. I wish there was a way where we could convert SMILES or other such formats into chemfig formulae.

Test_image

1 Answer 1

3

start with the central cobalt atom and add the pentagonal rings. use the \charge command to add the 2+ charge to the cobalt.

enter image description here

enter image description here

Add the links between the pentagonal rings using long distance links (?[a], etc)

enter image description here

enter image description here

Add branches around this center ring

enter image description here

enter image description here

Add the big branch at the bottom of the molecule

enter image description here

Add X and the Co---Y bond (?[z]---?[z])

enter image description here

\documentclass[border=2mm]{standalone}
\usepackage{chemfig}

\begin{document}
    \chemfig{\charge{30=${\scriptstyle 2+}$}{Co}?[z](-[2]X)(-[:135,,,,,dashed]N*5(-(=^[,.65]?[a](-[2]))-(<:[:90]-[:150]-[:90](=[:150]O)-[:30]NH_2)-(<[:150]-[:210](=[6]O)-[:150]H_2N)(<:[:210])-(?[d](<:[:210]))-))(-[:45,,,,,dashed,shorten <=4pt]N*5(-(=^[,.65]?[b](-[:350]))-(<:[:30]-[:330]-[:30](=[2]O)-[:330]NH_2)-(<[:30]-[2](=[:150]O)-[:30]NH_2)(<:[:120])-(?[a])=))(-[:315,,,,,dashed]N*5(-(=^[,.65]?[c](-[6]))-(<:[6]-[:330]-[:30](-[:60]NH_2)=[:330]O)-(<[:330])(<:[:30])-(?[b])=))(-[:225,,,,,dashed]N*5(-(?[d](<[4]H))-(<[:210]-[:150](=[2]O)-[:210]H_2N)-(<:[:240]-[6]-[:210](=[:150]O)-[6]NH-[:210,,1]-[6](<:[:210])-[:330]O-[6]P(<:[:150]\charge{150:2pt=$-$}{O})(=[:240]O)-[:330]O-[:30]*5((<:[6]H)-(<:[6]-[:330]OH)(<[:330]H)-O-(<:[:30]H)(<[:120]Y?[z,,,,,dashed])-(<:[2]H)(<[:150]HO)))(<[:300])-(?[c])=))}
\end{document}

enter image description here

This site is temporarily in read-only mode and not accepting new answers.

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