19

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).

3
  • 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, 2014 at 10:27
  • 1
    @Manuel Sorry, I edited the question.
    – pisoir
    Jan 29, 2014 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. Jan 29, 2014 at 10:33

3 Answers 3

21

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

5
  • That's exactly what I wanted. But I could not find it in the tikz manual. Great!
    – pisoir
    Jan 29, 2014 at 13:41
  • 2
    @pisoir: arccenter is not a tikz property of arc, but a node name set by the internals of chemfig. Jan 29, 2014 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, 2014 at 14:57
  • @Manuel: I agree with you and have changed the angle from -150 to -144 = -(360/5)*2. Jan 29, 2014 at 15:06
  • As of chemfig 1.56, the interface has been changed. See modified version: tex.stackexchange.com/questions/553989/…
    – pisoir
    Jul 20, 2020 at 20:19
8

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

5

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

You must log in to answer this question.

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