diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/tikzorbital/tikzorbital.sty | 91 |
1 files changed, 85 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/latex/tikzorbital/tikzorbital.sty b/Master/texmf-dist/tex/latex/tikzorbital/tikzorbital.sty index e9bffcbe108..1794b184877 100644 --- a/Master/texmf-dist/tex/latex/tikzorbital/tikzorbital.sty +++ b/Master/texmf-dist/tex/latex/tikzorbital/tikzorbital.sty @@ -14,6 +14,11 @@ % % Feel free to contact me if you have any ideas, suggestions or bugs report ! % +% Change +% ------ +% 27/02/2013 : add -px, -py, -pz orbital type +% 05/03/2015 : add satom macro, with scaling options for each lobe +% % ----------------------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{tikzorbital}[2012/12/05 draw atomic orbitals and molecular diagrams with tikz] @@ -149,7 +154,7 @@ \begin{pgfonlayer}{background} \draw[draw = drawColor, outer color = #4, inner color = innerColor, opacity = #6, execute macro = \orbitalDrawing] - #1 .. controls ++ (#3 * 1, #3 * 1) and ++ (#3 * 1, - #3 * 1) .. #1; + #1 .. controls ++ (#3, #3) and ++ (#3, - #3) .. #1; \end{pgfonlayer} %Coordinates of the electrons @@ -240,16 +245,30 @@ \@alobe{\orbital@pos}{0}{\orbital@scale}{\orbital@pcolor}{0}{\orbital@opacity} \@alobe{\orbital@pos}{180}{\orbital@scale}{\orbital@ncolor}{0}{\orbital@opacity} }{ + \ifthenelse{\equal{\orbital@type}{-py}}{ + \@alobe{\orbital@pos}{180}{\orbital@scale}{\orbital@pcolor}{0}{\orbital@opacity} + \@alobe{\orbital@pos}{0}{\orbital@scale}{\orbital@ncolor}{0}{\orbital@opacity} + }{ \ifthenelse{\equal{\orbital@type}{pz}}{ \@alobe{\orbital@pos}{90}{\orbital@scale}{\orbital@pcolor}{0}{\orbital@opacity} \@alobe{\orbital@pos}{270}{\orbital@scale}{\orbital@ncolor}{0}{\orbital@opacity} }{ + \ifthenelse{\equal{\orbital@type}{-pz}}{ + \@alobe{\orbital@pos}{270}{\orbital@scale}{\orbital@pcolor}{0}{\orbital@opacity} + \@alobe{\orbital@pos}{90}{\orbital@scale}{\orbital@ncolor}{0}{\orbital@opacity} + }{ \ifthenelse{\equal{\orbital@type}{px}}{ \node[base, outer color = \orbital@ncolor, scale = \orbital@scale * 1.8, xshift = 2pt, yshift = 2pt] at \orbital@pos {}; \node[base, outer color = \orbital@pcolor, scale = \orbital@scale * 1.8] at \orbital@pos {}; }{ + \ifthenelse{\equal{\orbital@type}{-px}}{ + \node[base, outer color = \orbital@pcolor, scale = \orbital@scale * 1.8, + xshift = 2pt, yshift = 2pt] at \orbital@pos {}; + \node[base, outer color = \orbital@ncolor, scale = \orbital@scale * 1.8] + at \orbital@pos {}; + }{ \ifthenelse{\equal{\orbital@type}{dyz}}{ \@alobe{\orbital@pos}{45}{\orbital@scale}{\orbital@pcolor}{0}{\orbital@opacity} \@alobe{\orbital@pos}{135}{\orbital@scale}{\orbital@ncolor}{0}{\orbital@opacity} @@ -294,7 +313,7 @@ at \orbital@pos {}; }{ \node[red] at \orbital@pos {orbital type unknown}; - }}}}}}}}}} + }}}}}}}}}}}}} \endgroup } @@ -323,7 +342,8 @@ % ----------------------------------------------------------------------------- % commande \atom[options]{lobes} % ----------------------------------------------------------------------------- -% quickly draw an atom with several orbital lobes around it +% quickly draw an atom with several orbital lobes around it. +% DEPRECATED, use satom insteed. % % argument % lobes : A comma separated list lobe definition with @@ -334,6 +354,7 @@ % name : name of the atom, also used to label the node % color : color of the atom % opacity : opacity of the orbital +% scale : scaling factor % ----------------------------------------------------------------------------- % define options @@ -350,8 +371,11 @@ % opacity of the orbitals opacity/.store in = \atom@opacity, opacity/.default = .8, +% scaling factor + scale/.store in = \atom@scale, + scale/.default = 1., % execute options - pos, name, color, opacity + pos, name, color, opacity, scale } % atom definition @@ -360,10 +384,65 @@ \pgfkeys{/tikzorbital/atom/.cd, #1} \colorlet{atomColor}{\atom@color} \node[shape = circle, thick, inner sep = 0pt, minimum size = 1.5em, - draw = atomColor!40, color = atomColor!70!gray, fill = atomColor!20] + draw = atomColor!40, color = atomColor!70!gray, fill = atomColor!20, + scale = \atom@scale] at \atom@pos (\atom@name) {\atom@name}; + \def\s{1.} \foreach \acolor/\rot/\anchor/\Ne in {#2} { - \@alobe{(\atom@name.\anchor)}{\rot}{1.5}{\acolor}{\Ne}{\atom@opacity} + \@alobe{(\atom@name.\anchor)}{\rot}{1.5*\atom@scale}{\acolor}{\Ne}{\atom@opacity} + } + \endgroup +} + +% ----------------------------------------------------------------------------- +% commande \satom[options]{lobes} +% ----------------------------------------------------------------------------- +% quickly draw an atom with several orbital lobes around it +% +% argument +% lobes : A comma separated list lobe definition with +% color/rotation-angle/anchor/number of electrons/scale +% +% options +% pos : position of the atom +% name : name of the atom, also used to label the node +% color : color of the atom +% opacity : opacity of the orbital +% scale : global scaling factor +% ----------------------------------------------------------------------------- + +% define options +\pgfkeys{/tikzorbital/satom/.cd, +% position of the atom + pos/.store in = \satom@pos, + pos/.default = {(0,0)}, +% atom name + name/.store in = \satom@name, + name/.default = X, +% color of the atom + color/.store in = \satom@color, + color/.default = green, +% opacity of the orbitals + opacity/.store in = \satom@opacity, + opacity/.default = .8, +% scaling factor + scale/.store in = \satom@scale, + scale/.default = 1., +% execute options + pos, name, color, opacity, scale +} + +% atom definition +\newcommand{\satom}[2][]{ + \begingroup + \pgfkeys{/tikzorbital/satom/.cd, #1} + \colorlet{atomColor}{\satom@color} + \node[shape = circle, thick, inner sep = 0pt, minimum size = 1.5em, + draw = atomColor!40, color = atomColor!70!gray, fill = atomColor!20, + scale = \satom@scale] + at \satom@pos (\satom@name) {\satom@name}; + \foreach \acolor/\rot/\anchor/\Ne/\s in {#2} { + \@alobe{(\satom@name.\anchor)}{\rot}{1.5*\s*\atom@scale}{\acolor}{\Ne}{\satom@opacity} } \endgroup } |