2

I'm trying to draw heparin using chemfig. Unfortunately, when I wrote :

\chemfig[cram width=2pt]{HO-[2,0.5,2]?<[7,0.7](-[2,0.4]OH)-[,,,,line width=2pt](-[6,0.5]OSO_3|{}^\ominus)>[1,0.7](-[2,1]O-[:10]?<[:-50](-[:170,0.5]HO)-[:10,,,,line width=2pt](-[:-55,0.5]OH)>[:-10](-[6,0.5]OH)-[:130]O-[:190]?(-[:150,0.5]-[2,0.5]OH))-[3,0.7]O-[4]?(-[6,0.3]COO|{}^\ominus)}

I didn't get what I was expected as both cycles are bounding at the same carbon atom which is not what I wanted to :

enter image description here

Do you have any idea to solve this issue ? I was wondering about using \definesubmol but I'm not used to this option. Many thanks

1 Answer 1

2

Your formula uses hooks, symbolized by ?. At the moment, all occurrences of ? refer to the same hook, therefore you see the lines all connecting to the first occurrence of ?.

You need (at least) two hooks. To distinguish them, add a name in square brackets. (See section 11 of the Chemfig manual.) In your case, add [a] after the first and last question mark, and [b] after the other two occurrences.

enter image description here

\documentclass{article}
\usepackage{chemfig}
\begin{document}

\chemfig[cram width=2pt]{
  HO-[2,0.5,2]?[a]<[7,0.7]( % <<< First hook a
     -[2,0.4]OH
  )-[,,,,line width=2pt](
     -[6,0.5]OSO_3|{}^\ominus
  )>[1,0.7](
     -[2,1]O-[:10]?[b]<[:-50]( % <<< Second hook b
        -[:170,0.5]HO
     )-[:10,,,,line width=2pt](
        -[:-55,0.5]OH
     )>[:-10](
        -[6,0.5]OH
     )-[:130]O-[:190]?[b]( % <<< Second hook b
        -[:150,0.5]-[2,0.5]OH
     )
  )-[3,0.7]O-[4]?[a]( % <<< First hook a
     -[6,0.3]COO|{}^\ominus
  )
}

\end{document}
1
  • Thank you ! It sounds so obvious when I read your answer ! ;-)
    – AS1991
    Nov 11, 2020 at 18:30

You must log in to answer this question.

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