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.

chemfig is really great chemical picture editor, but just one problem doesn't allow me to continue the work.

In the picture below, you see the chemical picture from the book with numbered links and framed CH_3 radicals. Is these feature available in the chemfig package?

Chemical image example

share|improve this question
    
You may want to have a look at How to number atoms using chemfig? and How to modify just some nodes' styles in chemfig –  cgnieder Jun 28 '13 at 18:30

1 Answer 1

up vote 3 down vote accepted

This may not be the best way... The code below sets marks in the molecule using chemfig's @{<nodename>} syntax and then uses these marks with \chemmove (which basically is a {tikzpicture} with options remember picture, overlay) to add dashed rectangles. The main chain is numbered using a submol, similar to unbonpetit's answer to How to number atoms using chemfig?

\documentclass{article}
\usepackage{chemfig}
\definesubmol{\nr}{-[:120,.3,,,draw=none]\scriptstyle}
\begin{document}
\chemfig{
  CH_3-[@{me3,.1}]CH(-[2]C_2H_5(!\nr{7, 8}))(!\nr6)
  -CH([6]-[@{iPr}]CH(-[0]CH_3)-CH_3)(!\nr5)
  -CH([2]-[@{tBu}]C(-[:30]CH_3)(-[:150]H_3C)-CH_3)(!\nr4)
  -CH_2(!\nr3)-C(-[@{me2,.9}2]CH_3)(-[@{me1,.9}6]CH_3)(!\nr2)
  -CH_3!\nr1
}
\chemmove{
  \draw[dashed]
    ([xshift=-8pt,yshift=-8pt]iPr) rectangle ++(2.3,-1.6)
    ([xshift=-1.6cm]tBu) rectangle ++(3.2cm,2cm)
    ([xshift=-5pt]me1) rectangle ++(.75,-.5)
    ([xshift=-5pt]me2) rectangle ++(.75,.5)
    ([xshift=-3pt,yshift=-7pt]me3) rectangle ++(-.75,.5) ;
}
\end{document}

enter image description here

share|improve this answer

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.