summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lewis/lewis.sty
blob: 16e651587621dafad5f2d570d7fc5b04ad12d87f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
% lewis.sty  version  0.1  22-May-2006.
% Kent Horvath         kenthorvath@gmail.com
% I contribute this software to the public domain.  No rights reserved.
%
% Commands:
% ~~~~~~~~~
% \lewis {X}{.}{.}{.}{.}{.}{.}{.}{.}{.}{.}      -   Draws rudimentary lewis structures around
%                                                            -   desired symbol X. Each {.} may be replaced
%                                                            -   by the desired symbol to be placed at the 
%                                                            -   corresponding position. Note that the dots
%                                                            -   are drawn clockwise starting in the lower 
%                                                            -   left hand side of the symbol X. 
% Examples:
% ~~~~~~~~
% The Lewis Structure for XeF_2 is 
% \lewis{\ce{F}}{.}{.}{.}{.}{}{}{.}{.}--\lewis{Xe}{}{.}{.}{.}{.}{}{.}{.}--\lewis{F}{}{}{.}{.}{.}{.}{.}{.}
%
% Caution:
% ~~~~~~~
% This package is provided without guarantees or support.  I don't recommend
% that you use this package at all.

\ProvidesPackage{lewis}[2006/05/22 v0.1 Draw Lewis Structures]

\providecommand{\lewis}[9]{ \mbox{\ensuremath{ \begin{array}{c} _{#4 \,\, #5}\\ \raisebox{0.25em}{\ensuremath{^{#3}_{#2}}}\,\mbox{#1}\, \raisebox{0.25em}{\ensuremath{^{#6}_{#7}}}\\ \raisebox{0.3em}{\ensuremath{^{#9 \,\, #8}}}\\ \end{array}}}}