3

I'm trying to create coloured electron pairs similiar to the picture below.

Picture with red Lewis electrons

However, when I try to recreate this example, I get black dots surrounded by red for the electron pairs.

\documentclass[border=1pc]{standalone}
\usepackage{chemfig}
\begin{document}
    \chemfig{R-{\charge{90={\color{red}\:},-90=\textcolor{red}{\:}}{O}H}}
\end{document}

enter image description here

I've searched previous answers and they all use the \lewis macro. I don't want to take this approach since in the latest chemfig documentation, it states that both the \lewis and \Lewis macros are no longer supported and will be removed soon, and in their place, the \charge and \Charge macros should be used.

1 Answer 1

4

According to in the documentation (see section 8.3 Lewis formula, page 33-34), the color of electron pairs can be changed using .style=...:

enter image description here

\documentclass[border=1pc]{standalone}
\usepackage{chemfig}
\begin{document}  
     \chemfig{R-\charge{[{.style={draw=red,fill=red}}]90={\:},-90=\:}{O}H}
\end{document}

You must log in to answer this question.

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