Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

please consider the following

\documentclass{minimal}
\usepackage{chemfig, xstring}
\begin{document}
\definesubmol{allicin}{%
           % 1
     =[::90]S% 2
              (
        -[::60]% 3
        -[::60]% 4
        =[::-60]O% 5
              )
     -[::-60]S% 6
    -[::-60]% 7
     -[::60]% 8
     =[::-60]% 9
}% allicin end
\chemfig{[:180]!{allicin}}{allicin}
\end{document}

The molecule is written in a certain way (SMILES and then mol2chemfig!!) and then it is rotated and drawn.

Also the label appear somehow rotated, in fact it is not below, as expected but above the molecule.

I've been reading the manual, but it only reports \cheminitname which regulate the alignment of labels among different molecules.

Any idea, (beside rewriting the molecule, of course) on how to write the label under the molecule ?

In this case is not that difficult to rewrite the molecule, but in more complex cases, especially when mol2chemfig is involved, the task of rewrite a molecule may be hard and time consuming.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You used two parameters for \chemfig, but according to page 64 of the chemfig manual, only one parameter can be used. So the second parameter was just a group of text placed next to the molecule. Therefore I used \chembelow. I tried to modify it to get the picture of Allicin at Wikipedia, but it still requires some polishing.

\documentclass{minimal}
\usepackage{chemfig, xstring}
\begin{document}
\definesubmol{Allicin}{%
           O^{-}% 1
     >[::90]S^{+}% 2
              (
        -[::60]% 3
        -[::60]% 4
        =[::-60]% 5
              )
     -[::-60]S% 6
    -[::-60]% 7
     -[::60]% 8
     =[::-60]% 9
}% allicin end
\chembelow[9pt]{\chemfig{[:180]!{Allicin}}}{Allicin}
\end{document}

mwe

share|improve this answer
    
You're right !! I must stop working late at night ... I completely miss the \chemname part. I should wrote \chemname{\chemfig[][scale=1]{[:180]!{allicin}}}{allicin}. –  Ottorino Apr 9 at 19:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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