2

So I am trying to draw the following reaction with chemfig, but for the triglyceride part, I can't get the H's to the left of the C. It just switches to bonding with the H. Please and thank you.

enter image description here

\documentclass[tikz,border=3mm]{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,calc,positioning,decorations,decorations.pathreplacing,calligraphy}
\usepackage{chemfig,chemmacros}
\chemsetup{modules=all}
\begin{document}
\definesubmol{x}{-[:+30,.6]-[:-30,.6]} 
\definesubmol{y}{-O-[:30,.7](=[2,.6]O)-[:-30,.7]R} 
\chemfig{[2]H_2C([0]!y)-[,1.5]HC([0]!y)-[,1.5]([0]!y)}
\end{document}

1 Answer 1

3

From the chapter 7 "Departure and arrival atoms" of the chemfig manual:

One may sometimes want the bond partners to be atoms other than those determined by chemfig. The departure and arrival atoms can be set with the optional bond argument by writing:

[,,〈integer 1〉,〈integer 2〉] 

where 〈integer 1〉and 〈integer 2〉 are the numbers of the desired departure and arrival atoms. These atoms must exist, otherwise an error message will be given

Applying this to your example, you can use -[,1.5,2,2] instead of -[,1.5] as shown in the following example:

enter image description here

\documentclass{article}
\usepackage{chemfig}
\begin{document}
\definesubmol{x}{-[:+30,.6]-[:-30,.6]} 
\definesubmol{y}{-O-[:30,.7](=[2,.6]O)-[:-30,.7]R} 
\chemfig{[2]H_2C([0]!y)-[,1.5,2,2]HC([0]!y)-[,1.5,2,2]H_2C([0]!y)}
\end{document}
2
  • My sincere congratulations for your 30k. Sebastiano
    – Sebastiano
    Apr 3, 2020 at 9:26
  • 1
    @Sebastiano: Thank you. You always seem to spot thouse numbers.
    – leandriis
    Apr 3, 2020 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.