9

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

enter image description here

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:

enter image description here

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
17

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.

enter image description here

\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}
  • 1
    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
  • 1
    @andselisk Good catch. Thanks :) – Phelype Oleinik Dec 18 '18 at 18:23

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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