1

I have to include organic molecules into a report and for that reason I wanted to use chemfig. After having installed the package I tested it with one of the first lines of code in the documentation: \chemfig{A-B-[1]C-[3]-D-[7]E-[6]F}

This was compiled without any problems. So, now I switched over to mol2chemfig and entered my SMILES code from ChemDraw. The interface converted it to a \chemfig-command which I copied and pasted into my LaTeX document.

After compiling I receive the following Error message:

! Package pgfkeys Error: I do not know the key '/tikz/dlh' and I am going to ignore it. Perhaps you misspelled it.

For testing reasons, I then went back to mol2chemfig and searched for an other molecule – in my case caffeine – in the database and copied the code of that one.

It gives an Error too:

! Undefined control sequence.\atom@1 ->\mcfcringle {1.03}

So, it definitely seems, that something is going wrong here. Unfortunately I'm pretty new to LaTeX, and so I have no idea why I'm getting tese eroor messages.

Thanks in advance for your help.

2
  • Can you please post what you tried. I created a caffeine molecule using the mol2chemfig code and nothing more than documentclass[border=10pt]{standalone} usepackage{chemfig} begin{document} \chemfig{-[:138]N-[:84]=^[:156]N-[:228]=[:300](-[:240](-[:180]N(-[:240]% )-[:120](-[:60]N(-[:120])-)=[:180]O)=[:300]O)-[:12]\phantom{N}} \end{document} There is something likely wrong in your preamble.
    – Ross
    Jun 10, 2016 at 2:55
  • I used the following code: \chemfig{-[:288]N-[:234](-[:0,0.85,,,draw=none]\mcfcringle{1.03})-[:306]N-[:18]-[:90](-[:162]\phantom{N})-[:30](=[:90]O)-[:330]N(-[:30])-[:270](=[:330]O)-[:210]N(-[:150])-[:270]}I rotated the molecule by 150 degrees and used the "fancy bonds" as well as the "aromatic" options.
    – Sam
    Jun 10, 2016 at 6:01

1 Answer 1

3

The undefined control sequence error pointing to \mcfcringle indicates that the mol2chemfig.sty file is not being found. Because mol2chemfig is not packaged with either TexLive or MikTeX you will need to install it manually. See the TexLive or MikTex manual for details on how to do this. After downloading mol2chemfig.sty from here: http://chimpsky.uwaterloo.ca/mol2chemfig/download and installing it as a local file, the following code runs to produce the caffeine molecule.

\documentclass[border=10pt]{standalone}
\usepackage{mol2chemfig}        
\begin{document}
\chemfig{CH_3-[:108,,1]N-[:54](-[:180,0.85,,,draw=none]\mcfcringle{1.03})-[:126]N-[:198]-[:270](-[:342]\phantom{N})-[:210](=[:270]O)-[:150]N(-[:210,,,2]H_3C)-[:90](=[:150]O)-[:30]N(-[:330])-[:90,,,1]CH_3}
\end{document}

enter image description here

3
  • Well... I already did exactly what you described here. I have downloaded mol2chemfig-1.4 and I put it into my packages folder. In the preamble \usepackage{mol2chemfig} as well as \usepackage{chemfig} is included. So there shouldn't be any problems?!
    – Sam
    Jun 10, 2016 at 18:36
  • Are you saying you are still getting the same error as you first reported? What exactly is happening? Are you using TexLive or MikTeX? Did you refresh the packages database after the install?
    – Ross
    Jun 11, 2016 at 0:00
  • I already had installed the mol2chemfig package... I'm using TexLive on a Mac with texmaker as code editor.
    – Sam
    Jun 11, 2016 at 0:02

You must log in to answer this question.

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