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.

I would like to draw in chemfig the following picture:

enter image description here

But I am struggling with the "+" sign in the middle of the circle. Is there a way to draw it? Thank you!

What I have so far is this:

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

\chemfig{
  N**[0,-150,dash pattern=on 2pt off 2pt]5(
    (-R)-(-R^1)-[,,1,2]{+\hspace{0.3cm}}|{O}-[,,2,1]--
  )
}

\end{document}

which does the work, but I really don't like the way it is done (e.g. it does not scale).

share|improve this question
1  
You should post your code, so that we could easily have a starting point. A minimal working example would be great (starting from \documentclas… and ending with \end{document}). –  Manuel Jan 29 at 10:27
1  
@Manuel Sorry, I edited the question. –  pisoir Jan 29 at 10:32
1  
BTW: Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. –  karlkoeller Jan 29 at 10:33
add comment

3 Answers 3

up vote 17 down vote accepted

The following examples uses that the tikz code for the arc uses a center node named arccenter. The tikz option argument for the \draw command of the arc can be used with option late options to put a label in the center:

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

\chemfig{
  N**[0,-144,dash pattern=on 2pt off 2pt,
       late options={name=arccenter,label=center:+}]
  5( (-R)-(-R^1)-O--- )
}

\end{document}

Result

share|improve this answer
    
That's exactly what I wanted. But I could not find it in the tikz manual. Great! –  pisoir Jan 29 at 13:41
2  
@pisoir: arccenter is not a tikz property of arc, but a node name set by the internals of chemfig. –  Heiko Oberdiek Jan 29 at 13:51
1  
Just for the sake of correctness… shouldn't it be …[0,-144,… instead of …[0,-150,…? I know nothing about chemistry. –  Manuel Jan 29 at 14:57
    
@Manuel: I agree with you and have changed the angle from -150 to -144 = -(360/5)*2. –  Heiko Oberdiek Jan 29 at 15:06
add comment

I'd use an invisible bond pointing to the center of the ring (with a relative angle) to place the plus. Something like (-[::126,,,,draw=none]\oplus), possibly scaled a bit. On the other hand I do like Heiko's answer better than mine :)

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

\chemfig{
  R-[:36]N
  **[216,360,dash pattern=on 2pt off 2pt]5(
    -(-[::126,.6,,,draw=none]\oplus)
     (-R|_1)
    -O(-[,,,,draw=none]X^{-})
    ---
  )
}

\end{document}

enter image description here

share|improve this answer
add comment

In a bind, you can slap it on after the fact with a \stackinset. The syntax here means that the inset item (a bold +) is placed 10pt to the right of center, and 15pt above center on the underlying \chemfig.

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

\stackinset{c}{10pt}{c}{15pt}{\textbf{+}}{%
\chemfig{
  N**[0,-150,dash pattern=on 2pt off 2pt]5(
    (-R)-(-R^1)-[,,1,2]{}|{O}-[,,2,1]--
  )
}%
}
\end{document}

enter image description here

share|improve this answer
add comment

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.