10

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?

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

1 Answer 1

19

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
  • 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
    Commented Dec 18, 2018 at 17:54

You must log in to answer this question.

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