0

I'm trying to draw a Lewis structure with a lone pair, but when I typeset, the lone pair is not centered. How do I freely move it slightly up or move it horizontally? Please let me know.

\documentclass[tikz,border=3mm]{standalone}

\usepackage{chemfig,chemmacros}
\chemsetup{modules=all}


\begin{document}

\chemfig{M
    ( -[:90]  A)
    ( -[:270] C)
    ( -[:0] \lewis{0:,})
    ( <[:210] D)
    (>:[:160] E)}

\end{document}
1
  • This is not related to chemmacros (which isn't used in your example at all apart from being loaded)
    – cgnieder
    Mar 6 '20 at 9:35
1

It would be interesting to use the \charge macro as suggested in the documentation (page 4): https://osl.ugr.es/CTAN/macros/generic/chemfig/chemfig-en.pdf. But if you use \lewis, it's better to use it refering an element of your \chemfig and not \lewis{0:,<empty space>} to avoid what you seen. You can put an X referred as an arbitrary element. Even so, I hope this code works as you want!

\documentclass[tikz,border=3mm]{standalone}

\usepackage{chemfig,chemmacros}
\chemsetup{modules=all}    

\begin{document}

\chemfig{M
    ( -[:90]  A)
    ( -[:270] C)
    ( -[:0]\Lewis{0:,\phantom{i}\hspace{-2mm}})
    ( <[:210] D)
    (>:[:160] E)}

\end{document}

Example

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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