1

Is there any package for drawing valence electrons?

MWE

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{chemformula}

\begin{document}
\begin{frame}{Lewis structures}

Finally: \ch{O=C=O} %valence elec. needed. 

\end{frame}
\end{document}
  • 1
    Is using chemfig an option for you? chemfig has a \lewis command for drawing lewis structures – Troy Aug 29 '18 at 15:19
  • @Troy yes, if there is a sistematic way, as you say, it will work. I'll check. Thanks. – santimirandarp Aug 29 '18 at 15:22
  • \chemfig{\lewis{3:5:,O}=C=\lewis{1:7:,O}} for example. – Troy Aug 29 '18 at 15:23
3

The chemfig package has a \lewis command that allows to draw lewis structures. The chemformula package recommends this explicitly as well:

chemformula offers a command to typeset Lewis formulae. This does not mean Lewis structures! Those can be achieved using the chemfig package...

enter image description here

\documentclass{beamer}
\usetheme{Madrid} 
\usecolortheme{whale} 
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{chemformula}
\usepackage{chemfig}  % <---------------

\setchemfig{atom sep=2em}  % <---------------

\begin{document}
\begin{frame}{Lewis structures}

Draw atoms with valence electrons only (this is fine):

%\chlewis{0,90,180}{O} $+$ \chlewis{0,180}{C} $+$ \chlewis{0,90,180}{O}

\schemestart   % <---------------
\chemfig{\Lewis{0:2:4:, O}} 
\+
\chemfig{\Lewis{0:4:, C}}
\+
\chemfig{\Lewis{0:2:4:, O}}
\schemestop

Finally: \ch{O=C=O} %Here I need \ch{O=C=O} adding valence 
   %electrons also.

Each line show a pair of electrons shared.

\chemfig{\Lewis{3:5:,O}=C=\Lewis{1:7:,O}} % <---------------
\end{frame}
\end{document}

The syntax for \lewis{<pos_1>...<pos_n>, <atom>} is simple, with <pos_n> being the position of the electrons around the <atom> in multiples of 45deg (starting from right-side of the atom, increasing counterclockwise, as we usually do). You can also explicitly specify with : after the individual position numbers to change the drawing to two dots instead of a line. So 3: draws 2 electrons at the 135deg angle, for example.

\Lewis{...} is a variant that includes the electrons in the bounding box (read the manual if you don't know what that means).

You might also consider just drawing all the lewis formulae with \chemfig as well for consistency.

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.