# How can I draw a Lewis structure?

I am trying to draw a Lewis structure using chemfig package. I want something like this:

So far, I have this:

\documentclass{article}
\usepackage{chemfig}

\begin{document}
\centering
\scalebox{6.5}{
\chemfig{\lewis{0:4:6:,F}-[:30]B(-[:90]\lewis{0:2:4:,F})(-[:-30]\lewis{0:4:6:,F})}
}
\end{document}


The output is:

How can I get a shorter bond length, a bigger font size, and color?

• Do you want it colored? – CarLaTeX Mar 1 '18 at 20:41
• I need shorter bond length as well as Bigger font size and color@CarLaTeX – Biki Teron Mar 1 '18 at 20:43

The length of the arm is set by a number after the angle of the arm: :angle,length. I used 0.6 for you.

The style of the dots can be changed with the fourth argument of \setlewis.

I didn't find a "pretty" way of changing the font color, so I just used \textcolor :P

The font size can be changed by changing the \printatom macro, inserting the font size before the \ensuremath.

\documentclass{article}
\usepackage{chemfig}
\usepackage{bm}

\setlewis[]{}{}{fill=yellow,very thin}

%\renewcommand*\printatom[1]{\large\ensuremath{\mathrm{#1}}}
\renewcommand*\printatom[1]{\large\ensuremath{\bm{\mathsf{#1}}}}

\begin{document}

\centering
\scalebox{6.5}{%
\chemfig{%
\textcolor{green}{B}
( -[:  90,0.6]\lewis{0:2:4:,\textcolor{orange}{F}})
( -[: -40,0.65]\lewis{0:4:6:,\textcolor{orange}{F}})
( -[:-140,0.65]\lewis{0:4:6:,\textcolor{orange}{F}})
}%
}

\end{document}

• To make the figure look even more like the OP's, one can tweak \printatom to \renewcommand*\printatom[1]{\large\ensuremath{\bm{\mathsf{#1}}}} and connect bm package; this makes labels for chemical elements printed with bold sans-serif font. – andselisk Dec 18 '18 at 17:54
• @andselisk Good catch. Thanks :) – Phelype Oleinik Dec 18 '18 at 18:23