# Lewis structures in chemfig [duplicate]

I want to do something like this using chemfig. I watched the chemfig guide but I can't find a solution.

Can you help me?

(Sorry, my english is not very good)

## marked as duplicate by clemens, Svend Tveskæg, Mensch, Zarko, barbara beetonMay 13 '16 at 18:26

My comment provided the measn to find a number of links on the subject of Lewis Structures in LaTeX.

But here, without chemfig:

\documentclass{article}
\usepackage{stackengine}
\usepackage{graphicx,ifthen}
\newcommand\lewis[7]{\,%
\ifthenelse{\equal{#3}{}}%
{\def\RHS{}\def\RRHS{\hspace{.5ex}}}%
{\def\RHS{\,\rotatebox{90}{\makebox[1.5ex]{#3}}\,}\def\RRHS{}}%
\stackengine{2ex}{%
\rotatebox{90}{\makebox[1.5ex]{#5}}\,%
\stackengine{0.6ex}{%
\stackengine{1.9ex}{#1}{#2}{O}{c}{F}{F}{L}%
}{#4}{U}{c}{F}{F}{L}%
\RHS$^{#6}$\RRHS%
}{$#7$}{U}{c}{F}{F}{L}%
}
\savestack\Bond{\rule{1.2ex}{.5pt}}
\savestack{\PBond}{\rotatebox{90}{\Bond}}
\begin{document}
\sffamily
\stackunder{%

• This doesn't use chemfig so I don't think its an answer to the question – especially since the task is rather easy with chemfig. – clemens May 13 '16 at 17:43
• @clemens I guess things were slow on a Friday afternoon. No one jumped in with a chemfig solution, so I threw this one out, having to figure out the bond-bars (if I understand the notation right). But I'm not holding my breath for votes. – Steven B. Segletes May 13 '16 at 17:46
• Yes, but it's not that hard to look in the manual and to search for \lewis once its clear that the command is there: \setatomsep{1.7em} H\Lewis{0:2:4:6:,S}H \quad \chemfig{H-\lewis{26,S}-H} – clemens May 13 '16 at 20:54