I've got a simple but tough problem : Texmaker does not recognize \lewis !

When I compile, it says : Undefined control sequence. \lewis... I use chemfig of course. I've restarted my computer, a PC with Windows 10. I've tried \Lewis.

Can you help ?

\documentclass[a4paper, 10pt]{article} 

  • Are you using it this way? \chemfig{... \lewis ...}? Or just within the plain text?
    – Werner
    Commented Mar 10, 2021 at 16:54
  • Hi Werner, I tried both.
    – Nic22
    Commented Mar 10, 2021 at 17:18
  • 3
    Then you should show a complete minimal example that replicates your problematic behaviour. Can you do that?
    – Werner
    Commented Mar 10, 2021 at 17:23
  • \documentclass[a4paper, 10pt]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[french]{babel} \usepackage{graphicx} \usepackage{array} \usepackage{chemfig} \usepackage[version=4]{mhchem} \begin{document} \lewis{2.,0} \end{document}
    – Nic22
    Commented Mar 10, 2021 at 19:17
  • This does not work.
    – Nic22
    Commented Mar 10, 2021 at 19:17

2 Answers 2


Have a look at the manual. The macros \lewis does not belong to chemfig anymore since version 1.6a.

If you want to use \lewis instead of \charge (which is not recommended), you have to load the file named chemfig-lewis.tex with \input.

  • 1
    Hi nino,Where can I find this file ?
    – Nic22
    Commented Mar 10, 2021 at 19:18
  • @Nic22 CTAN or texdoc chemfig if you are on TeX Live.
    – andselisk
    Commented Mar 11, 2021 at 5:57
  • I've used the \input{chemfig-file.tex} command, but the file is 'not found'. As I understand it, Texmaker needs to find it on my computer. The file is not loaded. (But maybe there is something I don't understand. I'm not a native english speaker.) The problem remains...
    – Nic22
    Commented Mar 11, 2021 at 16:48

you should download chemfig-lewis.tex at link below. After that, you move to any folder, then you can text: \input{../extra/chemfig-lewis} Because I put chemfig-lewis.tex in extra folder Goodluck!


You must log in to answer this question.

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