summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-10-28 23:41:55 +0000
committerKarl Berry <karl@freefriends.org>2011-10-28 23:41:55 +0000
commit626107c053e66c6ddd3d791fcffe417013a387a9 (patch)
treed4d6cc2110ee6f4a971d63eb75a250e861576ac4 /Master
parent08521dabedd78b6b28f56c0fc227f17acfbd5daa (diff)
modigram (28oct11)
git-svn-id: svn://tug.org/texlive/trunk@24427 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/modiagram/README22
-rw-r--r--Master/texmf-dist/doc/latex/modiagram/modiagram_doc_de.pdfbin332067 -> 576213 bytes
-rw-r--r--Master/texmf-dist/doc/latex/modiagram/modiagram_doc_de.tex882
-rw-r--r--Master/texmf-dist/doc/latex/modiagram/modiagram_doc_en.pdfbin329253 -> 570164 bytes
-rw-r--r--Master/texmf-dist/doc/latex/modiagram/modiagram_doc_en.tex928
-rw-r--r--Master/texmf-dist/tex/latex/modiagram/modiagram.sty1083
6 files changed, 2141 insertions, 774 deletions
diff --git a/Master/texmf-dist/doc/latex/modiagram/README b/Master/texmf-dist/doc/latex/modiagram/README
index f7fbed93708..8ca17886a2e 100644
--- a/Master/texmf-dist/doc/latex/modiagram/README
+++ b/Master/texmf-dist/doc/latex/modiagram/README
@@ -1,23 +1,23 @@
-MOdiagram - easy creation of molecular orbital diagrams
+MOdiagram v0.2 - easy creation of molecular orbital diagrams
-The environment 'MOdiagram' and some commands are provided to create
+The environment `MOdiagram' and some commands are provided to create
molecular orbital (MO) diagrams using TikZ.
The MO diagram of H2 would be set like:
\begin{MOdiagram}
- \atom{left}{ 1s = {0;up} }
- \atom{right}{ 1s = {0;up} }
- \molecule{ 1sMO = {1;pair, } }
+ \atom{left}{ 1s = {;up} }
+ \atom{right}{ 1s = {;up} }
+ \molecule{ 1sMO = {;pair} }
\end{MOdiagram}
-MOdiagram loads the packages 'expl3', 'xparse' and 'l3keys2e' and therefore
-needs LaTeX3 support as provided by the package bundles 'l3kernel' and
-'l3packages'.
-MOdiagram also needs the packages 'tikz', 'amsmath' and 'textgreek' as well as
-the tikzlibraries 'arrows' and 'calc' to be fully functioning.
+MOdiagram loads the packages `expl3', `xparse' and `l3keys2e' and therefore
+needs LaTeX3 support as provided by the package bundles `l3kernel' and
+`l3packages'.
+MOdiagram also needs the packages `tikz' and `textgreek' as well as
+the tikzlibraries `arrows' and `calc' to be fully functioning.
Clemens NIEDERBERGER
-2011/09/25
+2011/10/27
http://www.mychemistry.eu/
contact@mychemistry.eu
diff --git a/Master/texmf-dist/doc/latex/modiagram/modiagram_doc_de.pdf b/Master/texmf-dist/doc/latex/modiagram/modiagram_doc_de.pdf
index d84e405de3b..26a2c26ff8e 100644
--- a/Master/texmf-dist/doc/latex/modiagram/modiagram_doc_de.pdf
+++ b/Master/texmf-dist/doc/latex/modiagram/modiagram_doc_de.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/modiagram/modiagram_doc_de.tex b/Master/texmf-dist/doc/latex/modiagram/modiagram_doc_de.tex
index 385d9d1f3aa..24f3ca9cf7e 100644
--- a/Master/texmf-dist/doc/latex/modiagram/modiagram_doc_de.tex
+++ b/Master/texmf-dist/doc/latex/modiagram/modiagram_doc_de.tex
@@ -4,7 +4,7 @@
% - easy creation of molecular orbital diagrams - %
% --------------------------------------------------------------------------- %
% - Clemens NIEDERBERGER - %
-% - 2011/09/25 - %
+% - 2011/10/27 - %
% --------------------------------------------------------------------------- %
% - http://www.mychemistry.eu/ - %
% - contact@mychemistry.eu - %
@@ -32,16 +32,17 @@
\documentclass{scrartcl}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenx}
+\usepackage{lmodern,emerald,microtype}
\usepackage[dvipsnames]{xcolor}
\colorlet{code}{RawSienna}
-\usepackage{modiagram,xspace,siunitx,framed,chemfig}
-\usepackage{showexpl}
+\usepackage{modiagram,xspace,siunitx,framed,chemfig,booktabs}
\usepackage[version=3]{mhchem}
\usepackage{showexpl}
\lstset{
+ explpreset={
language = [LaTeX]TeX,
- basicstyle = {\ttfamily\small\color{code!80}},
+ basicstyle = {\ttfamily\small},
breaklines = true,
commentstyle = {\color[named]{Gray}},
backgroundcolor = \color{yellow!20},
@@ -50,7 +51,49 @@
numberblanklines = true,
numbersep = .3em,
xleftmargin = 1em,
- gobble = 1
+ gobble = 1,
+ keywordstyle = \color{code},
+ morekeywords =
+ {
+ AO,
+ atom,
+ ce,
+ connect,
+ draw,
+ EnergyAxis,
+ lewis,
+ Lewis,
+ molecule,
+ MOsetup,
+ node,
+ textcolor,
+ textSigma
+ }
+ },
+ language = [LaTeX]TeX,
+ basicstyle = {\ttfamily},
+ breaklines = true,
+ commentstyle = {\color[named]{Gray}},
+ backgroundcolor = \color{yellow!20},
+ numbers = left,
+ numberstyle = \tiny,
+ numberblanklines = true,
+ numbersep = .3em,
+ xleftmargin = 1em,
+ gobble = 1,
+ moredelim = [is][\color{black}]{|}{|},
+ keywordstyle = \color{code},
+ morekeywords =
+ {
+ AO,
+ atom,
+ connect,
+ draw,
+ EnergyAxis,
+ molecule,
+ MOsetup,
+ usepackage
+ }
}
\usepackage{hyperref}
@@ -71,8 +114,8 @@
}
\newcommand*\MOname{\textsf{MOdiagram}\xspace}
-\newcommand*\MOversion{0.1\xspace}
-\newcommand*\MOdate{2011/09/25}
+\newcommand*\MOversion{0.2\xspace}
+\newcommand*\MOdate{2011/10/27}
\newcommand*\paket[1]{\textsf{#1}\footnote{\url{http://www.ctan.org/pkg/#1}}}
@@ -81,10 +124,32 @@
\DeclareDocumentEnvironment{myquote}{o}
{\quote\small\changefont{cmss}{m}{sl}}
{\IfNoValueF{#1}{\par\noindent\parbox{\linewidth}{\raggedleft\normalfont\itshape#1}}\endquote}
-\NewDocumentCommand\cmd{v}{{\color{code!80}\ttfamily#1}}
\newcommand*\TikZ{\mbox{Ti\textbf{\textit{k}}Z}\xspace}
\newcommand*\bzw{\mbox{bzw.}\xspace}
+\newcommand*\usw{\mbox{usw.}\xspace}
+\renewcommand*\dh{\mbox{d.\,h.}\xspace}
+\newcommand*\zB{\mbox{z.\,B.}\xspace}
+
+\newlength\marginnotewidth
+\NewDocumentCommand\marginnote { s O{TeenSpirit} m } {%
+ \settowidth\marginnotewidth{\small\csname ECF#2\endcsname\color{red}#3}
+ \addtolength\marginnotewidth{20pt}
+ \noindent\makebox[0cm]{\hskip-\marginnotewidth\small\csname ECF#2\endcsname\color{red}#3}%
+ \IfBooleanF{#1}{\hspace{\parindent}}%
+}
+
+\NewDocumentCommand \AOinline { o m }
+ {
+ \begingroup
+ \IfNoValueTF{#1}
+ {\MOsetup{ style=square,AO-width=8pt }}%
+ {\MOsetup{ style=square,AO-width=8pt , #1 }}%
+ \begin{MOdiagram}
+ \AO{s}{0;#2}
+ \end{MOdiagram}%
+ \endgroup
+ }
\begin{document}
@@ -110,7 +175,7 @@
2p = {2;pair,up,up}
}
\molecule[NO]{
- 2pMO = {1.8,.4;pair,pair,pair,up,,},
+ 2pMO = {1.8,.4;pair,pair,pair,up},
color = { 2piy*=red }
}
\end{MOdiagram}
@@ -118,10 +183,11 @@
\tableofcontents
+\newpage
\section{Lizenz, Voraussetzungen}
\MOname v\MOversion steht unter der \LaTeX\ Project Public License Version 1.3 oder später.\newline(\url{http://www.latex-project.org/lppl.txt})
-\MOname benötigt die Pakete \paket{expl3}, \paket{xparse}, \paket{l3keys2e}, \textsf{tikz}\footnote{\url{http://www.ctan.org/pkg/pgf}}, \paket{amsmath} und \paket{textgreek}. Außerdem werden die \TikZ-Libraries \textsf{calc} und \textsf{arrows} geladen.
+\MOname benötigt die Pakete \paket{expl3}, \paket{xparse}, \paket{l3keys2e}, \textsf{tikz}\footnote{\url{http://www.ctan.org/pkg/pgf}} und \paket{textgreek}. Außerdem werden die \TikZ-Libraries \textsf{calc} und \textsf{arrows} geladen.
Kenntnisse des \textsf{pgf}- \bzw des \textsf{tikz}-Paketes sind von Vorteil.
@@ -132,18 +198,18 @@ Dieses Paket ist enstanden wegen einer Frage auf \url{http://tex.stackexchange.c
Otherwise, I think I'll have a go at it in \TikZ.
\end{myquote}
-Dort wird das Problem mit \TikZ gelöst, da es bis dato noch kein Paket für diese Aufgabe gab. \MOname soll diese Lücke nun füllen.
+Dort wird das Problem mit \TikZ gelöst, da es bis dato noch kein Paket für diese Aufgabe gab. Zum einen soll \MOname diese Lücke nun füllen. Zum anderen fand ich es persönlich immer mühsam, aus vorherigem Code mit Copy \&\ Paste ein zweites, drittes, \ldots\ zu erstellen. Das hat sich mit \MOname erledigt.
-\section{Basisbefehle}
-Alle MO-Diagramme werden mit der Umgebung \cmd=MOdiagram= erzeugt. Innerhalb dieser Umgebung sind zunächst zwei Befehle wichtig.
+\section{Befehle}
+Alle MO-Diagramme werden mit der Umgebung \lstinline=MOdiagram= erzeugt. Bei den in den folgenden Abschnitten beschriebenen Befehlen werden verschiedene Argumente mit (o) oder mit (m) markiert. Das steht for \emph{optional} \bzw for \emph{mandatory} (also \emph{obligatorisch}).
\subsection{Der \texttt{\textbackslash atom} Befehl}
\begin{framed}
- \cmd=\atom[<name>]{<pos>}{<AO-spec>}=
+ \lstinline=\atom[<name>]{<pos>}{<|AO|-spec>}=
\begin{itemize}\small
- \item\cmd=<name>= (o) Beschriftung des Atoms
- \item\cmd=<pos>= (m) links oder rechts im MO-Diagramm
- \item\cmd=<AO-spec>= (m) Spezifizierung der Atom-Orbitale (AO)
+ \item\lstinline=<name>= (o) Beschriftung des Atoms
+ \item\lstinline=<pos>= (m) links oder rechts im MO-Diagramm
+ \item\lstinline=<|AO|-spec>= (m) Spezifizierung der Atom-Orbitale (AO)
\end{itemize}
\end{framed}
Sehen wir uns den Befehl einmal an:
@@ -152,105 +218,140 @@ Sehen wir uns den Befehl einmal an:
\atom{right}{
1s = { 0; pair} ,
2s = { 1; pair} ,
- 2p = {1.5; up, down, }
+ 2p = {1.5; up, down }
}
\end{MOdiagram}
\end{LTXexample}
-Wie Sie sehen können, ist die Angabe von \cmd=<AO-spec>= wesentlich für die Ausgabe der Orbital-Niveaus und den enthaltenen Elektronen. Folgende Schüssel-Wert-Paare können durch Kommata getrennt eingegeben werden:
+Wie Sie sehen können, ist die Angabe von \lstinline=<|AO|-spec>= wesentlich für die Ausgabe der Orbital-Niveaus und den enthaltenen Elektronen. Folgende Schüssel-Wert-Paare können durch Kommata getrennt eingegeben werden:
\begin{framed}
\begin{itemize}
- \item\cmd+1s={<rel. energy>; <el-spec>}+
- \item\cmd+2s={<rel. energy>; <el-spec>}+
- \item\cmd+2p={<rel. energy>; <x el-spec>, <y el-spec>, <z el-spec>}+
+ \item\lstinline+1s={<rel. energy>; <el-spec>}+
+ \item\lstinline+2s={<rel. energy>; <el-spec>}+
+ \item\lstinline+2p={<rel. energy>; <x el-spec>, <y el-spec>, <z el-spec>}+
\end{itemize}
\end{framed}
-Die \cmd=<el-spec>= können die Werte \cmd=pair=, \cmd=up= und \cmd=down= annehmen oder leer gelassen werden. \cmd=<rel. energy>= ist in etwa mit der $y$-Koordinate gleichzusetzen und verschiebt das AO in vertikaler Richtung um \cmd=<rel. energy>= \si{\centi\metre} auf- (positiv) oder abwärts (negativ).
+Die \lstinline=<el-spec>= können die Werte \lstinline=pair=, \lstinline=up= und \lstinline=down= annehmen oder leer gelassen werden. \lstinline=<rel. energy>= ist in etwa mit der $y$-Koordinate gleichzusetzen und verschiebt das AO in vertikaler Richtung um \lstinline=<rel. energy>= \si{\centi\metre} auf- (positiv) oder abwärts (negativ).
-Das Argument \cmd=<pos>= wird wichtig, wenn die p-Orbitale verwendet werden. Vergleichen Sie folgendes Beispiel mit dem vorhergehenden:
+Das Argument \lstinline=<pos>= wird wichtig, wenn die p-Orbitale verwendet werden. Vergleichen Sie folgendes Beispiel mit dem vorhergehenden:
\begin{LTXexample}
\begin{MOdiagram}
\atom{left}{
1s = { 0; pair} ,
2s = { 1; pair} ,
- 2p = {1.5; up, down, }
+ 2p = {1.5; up, down }
}
\end{MOdiagram}
\end{LTXexample}
Verwendet man beide Varianten auf einmal, so sieht man außerdem, dass das rechte Atom gegenüber dem linken nach rechts verschoben ist. Der Betrag, um den das rechte verschoben ist, beträgt per Default \SI{4}{\centi\metre} und kann individuell angepasst werden (siehe Seite \pageref{option:distance}).
-\begin{LTXexample}
+\begin{LTXexample}[pos=b]
\begin{MOdiagram}
\atom{left}{
1s = { 0; pair} ,
2s = { 1; pair} ,
- 2p = {1.5; up, down, }
+ 2p = {1.5; up, down }
}
\atom{right}{
1s = { 0; pair} ,
2s = { 1; pair} ,
- 2p = {1.5; up, down, }
+ 2p = {1.5; up, down }
}
\end{MOdiagram}
\end{LTXexample}
-Der Sinn der Verschiebung wird klar, wenn wir den nächsten Befehl dazu nehmen.
+Der Sinn der Verschiebung wird klar, wenn wir den Befehl \lstinline=\molecule= (Abschnitt \ref{ssec:molecule}) dazu nehmen.
-\subsection{Der \texttt{\textbackslash molecule} Befehl}
+\marginnote{NEU}Jedes der Argumente für die AO kann leer bleiben oder weggelassen werden.
+\begin{LTXexample}[pos=b]
+ Ohne Argument: Default-H\"ohe, gef\"ullt:
+ \begin{MOdiagram}
+ \atom{left}{1s, 2s, 2p}
+ \end{MOdiagram}
+\end{LTXexample}
+\begin{LTXexample}[pos=b]
+ Leeres Argument: Default H\"ohe, leer:
+ \begin{MOdiagram}
+ \atom{left}{1s=, 2s=, 2p=}
+ \end{MOdiagram}
+\end{LTXexample}
+\begin{LTXexample}[pos=b]
+ Einzelne Werte verwendet:\\
+ \begin{MOdiagram}
+ \atom{left}{1s, 2s=1, 2p={;,up} }
+ \end{MOdiagram}
+\end{LTXexample}
+
+\subsection{Der \texttt{\textbackslash molecule} Befehl}\label{ssec:molecule}
\begin{framed}
- \cmd=\molecule[<name>]{<MO-spec>}=
+ \lstinline=\molecule[<name>]{<MO-spec>}=
\begin{itemize}\small
- \item\cmd=<name>= (o) Beschriftung des Moleküls
- \item\cmd=<MO-spec>= (m) Spezifizierung der Molekül-Orbitale (MO)
+ \item\lstinline=<name>= (o) Beschriftung des Moleküls
+ \item\lstinline=<MO-spec>= (m) Spezifizierung der Molekül-Orbitale (MO)
\end{itemize}
\end{framed}
Zunächst einmal ein Beispiel:
\begin{LTXexample}
\begin{MOdiagram}
- \atom{left} { 1s = { 0; up} }
- \atom{right}{ 1s = { 0; up} }
- \molecule { 1sMO = {.75; pair, } }
+ \atom{left} { 1s = { 0; up } }
+ \atom{right}{ 1s = { 0; up } }
+ \molecule { 1sMO = {.75; pair } }
\end{MOdiagram}
\end{LTXexample}
-Durch den Befehl \cmd=\molecule= werden die Atom-Orbitale (AO) verbunden und die entsprechenden bindenden und antibindenden Orbitale des Moleküls (MO) gezeichnet. \cmd=\molecule= kann nur verwendet werden, \emph{nachdem} man bereits \emph{beide} Atome gesetzt hat, da die zu verbindenden Orbitale bekannt sein müssen.
+Durch den Befehl \lstinline=\molecule= werden die Atom-Orbitale (AO) verbunden und die entsprechenden bindenden und antibindenden Orbitale des Moleküls (MO) gezeichnet. \lstinline=\molecule= kann nur verwendet werden, \emph{nachdem} man bereits \emph{beide} Atome gesetzt hat, da die zu verbindenden Orbitale bekannt sein müssen.
-Das Argument \cmd=<MO-spec>= erwartet dabei durch Kommata getrennt folgende Key-Value-Paare:
+Das Argument \lstinline=<MO-spec>= erwartet dabei durch Kommata getrennt folgende Key-Value-Paare:
\begin{framed}
\begin{itemize}
- \item\cmd+1sMO={<energy gain>; <s el-spec>, <s* el-spec>}+ (verbindet die durch \cmd=1s= spezifizierten AO.)
- \item\cmd+2sMO={<energy gain>; <s el-spec>, <s* el-spec>}+ (verbindet die durch \cmd=2s= spezifizierten AO.)
- \item\cmd+2pMO={<s energy gain>, <p energy gain>; <s el-spec>, <py el-spec>, <pz el- spec>, <py* el-spec>, <pz* el-spec>, <s* el-spec>}+ (verbindet die durch \cmd=2p= spezifizierten AO.)
+ \item\lstinline+1sMO={<energy gain>/<energy loss>; <s el-spec>, <s* el-spec>}+ (verbindet die durch \lstinline=1s= spezifizierten AO.)
+ \item\lstinline+2sMO={<energy gain>/<energy loss>; <s el-spec>, <s* el-spec>}+ (verbindet die durch \lstinline=2s= spezifizierten AO.)
+ \item\lstinline+2pMO={<s energy gain>/<s energy loss>, <p energy gain>/<p energy loss>; <s el-spec>, <py el-spec>, <pz el- spec>, <py* el-spec>, <pz* el-spec>, <s* el-spec>}+ (verbindet die durch \lstinline=2p= spezifizierten AO.)
\end{itemize}
\end{framed}
Es ist dabei zu beachten, dass die entsprechenden AO gesetzt sein müssen, um sie verbinden zu können. Folgendes wird nicht funktionieren:
-\begin{lstlisting}
+\begin{lstlisting}[basicstyle = {\ttfamily\small}]
\begin{MOdiagram}
- \atom{left} { 1s = { 0; } }
- \atom{right}{ 1s = { 0; } }
- \molecule { 2sMO = {.75; , } }
+ \atom{left} { 1s = 0 }
+ \atom{right}{ 1s = 0 }
+ \molecule { 2sMO = .75 }
\end{MOdiagram}
\end{lstlisting}
-Der Wert, der für \cmd=<energy gain>= angegeben wird, gibt an, wieviele \si{\centi\metre} das bindende MO unter dem niedrigeren AO \bzw wieviel das antibindende MO über dem höheren AO gesetzt wird.
+Der Wert, der für \lstinline=<energy gain>= angegeben wird, gibt an, wieviele \si{\centi\metre} das bindende MO unter dem niedrigeren AO \bzw wieviel das antibindende MO über dem höheren AO gesetzt wird.
\begin{LTXexample}[pos=b]
Gleiche Level:
\begin{MOdiagram}
- \atom{left} { 1s = { 0; up} }
- \atom{right}{ 1s = { 0; up} }
- \molecule { 1sMO = {.75; pair, } }
+ \atom{left} { 1s = { 0; up } }
+ \atom{right}{ 1s = { 0; up } }
+ \molecule { 1sMO = {.75; pair } }
\end{MOdiagram}
Unterschiedliche Level:
\begin{MOdiagram}
- \atom{left} { 1s = { 0; up} }
- \atom{right}{ 1s = { 1; up} }
- \molecule { 1sMO = {.25; pair, } }
+ \atom{left} { 1s = { 0; up } }
+ \atom{right}{ 1s = { 1; up } }
+ \molecule { 1sMO = {.25; pair } }
+ \end{MOdiagram}
+\end{LTXexample}
+\marginnote{NEU}Wird für \lstinline=<energy loss>= ein eigener Wert angegeben, können auch unsymmetrische Aufspaltungen erzeugt werden. Dann gilt der erste, \lstinline=<energy gain>=, für das bindende und der zweite, \lstinline=<energy loss>=, für das antibindende MO.
+\begin{LTXexample}[pos=b]
+ \begin{MOdiagram}
+ \atom{left} { 1s = { 0; up } }
+ \atom{right}{ 1s = { 0; up } }
+ \molecule { 1sMO = {.75/.25; pair } }
+ \end{MOdiagram}
+
+ \begin{MOdiagram}
+ \atom{left} { 1s = { 0; up } }
+ \atom{right}{ 1s = { 1; up } }
+ \molecule { 1sMO = {.25/.75; pair } }
\end{MOdiagram}
\end{LTXexample}
-Beachten Sie, dass Sie bei \cmd=2pMO= \emph{zwei} solche Werte angeben müssen: die Aufspaltung der \textsigma-Orbitale und die Aufspaltung der \textpi-Orbitale.
+
+Beachten Sie, dass Sie bei \lstinline=2pMO= \emph{zwei} solche Werte (oder Paare) angeben müssen: die Aufspaltung der \textsigma-Orbitale und die Aufspaltung der \textpi-Orbitale.
\begin{LTXexample}
\begin{MOdiagram}
- \atom{left} { 2p = { 0; up, up , } }
- \atom{right}{ 2p = { 1; up, up , } }
- \molecule { 2pMO = { 1.5, .75; pair, up, up , , , } }
+ \atom{left} { 2p = { 0; up, up } }
+ \atom{right}{ 2p = { 1; up, up } }
+ \molecule { 2pMO = { 1.5, .75; pair, up, up } }
\end{MOdiagram}
\end{LTXexample}
@@ -258,106 +359,100 @@ Das komplette MO-Diagramm für Triplett-Disauerstoff könnte nun etwa folgenderm
\begin{LTXexample}
\begin{MOdiagram}
\atom{left}{
- 1s = {0;pair},
- 2s = {2;pair},
- 2p = {5;pair,up,up}
+ 1s, 2s, 2p = {;pair,up,up}
}
\atom{right}{
- 1s = {0;pair},
- 2s = {2;pair},
- 2p = {5;pair,up,up}
+ 1s, 2s, 2p = {;pair,up,up}
}
\molecule{
- 1sMO = {.5;pair,pair},
- 2sMO = {.5;pair,pair},
- 2pMO = {1.5,.5;pair,pair,pair,up,up,}
+ 1sMO, 2sMO, 2pMO = {;pair,pair,pair,up,up}
}
\end{MOdiagram}
\end{LTXexample}
+\newpage
\subsection{Die Namensgebung}\label{Namensgebung}
-Da man üblicherweise die AO und MO auch beschriften (können) möchte und sie in der \cmd=MOdiagram=-Umgebung \TikZ-Nodes entsprechen, ist die interne Benennung wichtig. Diese folgt eng der tatsächlichen Funktion:
+Da man üblicherweise die AO und MO auch beschriften (können) möchte und sie in der \lstinline=MOdiagram=-Umgebung \TikZ-Nodes entsprechen, ist die interne Benennung wichtig. Diese folgt eng der tatsächlichen Funktion:
\begin{center}
-\begin{MOdiagram}[distance=6cm,AO-width=20pt,labels-fs=\tt\footnotesize]
+\begin{MOdiagram}[distance=6cm,AO-width=20pt,labels-fs=\tt\footnotesize,labels-style={yshift=10pt}]
\atom{left}{
- 1s={0;},
- 2s={2;},
- 2p={5;,,},
+ 1s=0,
+ 2s=2,
+ 2p=5,
label={ 1sleft={1sleft}, 2sleft={2sleft}, 2pxleft={2pxleft}, 2pyleft={2pyleft}, 2pzleft={2pzleft} }
}
\atom{right}{
- 1s={0;},
- 2s={2;},
- 2p={5;,,},
+ 1s=0,
+ 2s=2,
+ 2p=5,
label={ 1sright={1sright}, 2sright={2sright}, 2pxright={2pxright}, 2pyright={2pyright}, 2pzright={2pzright} }
}
\molecule{
- 1sMO={.5;,},
- 2sMO={.5;,},
- 2pMO={1.5,.5;,,,,,},
+ 1sMO=.5,
+ 2sMO=.5,
+ 2pMO={1.5,.5},
label={ 1sigma={1sigma}, 1sigma*={1sigma*}, 2sigma={2sigma}, 2sigma*={2sigma*}, 2psigma={2psigma}, 2psigma*={2psigma*}, 2piy={2piy}, 2piy*={2piy*}, 2piz={2piz}, 2piz*={2piz*} }
}
\end{MOdiagram}
\end{center}
-Mit diesen Bezeichnungen ist es möglich, sie mit den üblich \TikZ-Befehlen zu referenzieren:
+Mit diesen Bezeichnungen ist es möglich, sie mit den üblichen \TikZ-Befehlen zu referenzieren:
\begin{LTXexample}
\begin{MOdiagram}
- \atom{left} { 1s = {0; } }
- \atom{right}{ 1s = {0; } }
- \molecule { 1sMO = {.75; , } }
- \draw[<->,red,semithick] (1sigma) -- (1sigma*) ;
+ \atom{left} { 1s = 0 }
+ \atom{right}{ 1s = 0 }
+ \molecule { 1sMO = .75 }
+ \draw[<->,red,semithick] (1sigma.center) -- (1sigma*.center) ;
\draw[red] (1sigma*) ++ (2cm,.5cm) node {Aufspaltung} ;
\end{MOdiagram}
\end{LTXexample}
\begin{LTXexample}
\begin{MOdiagram}
- \atom{left} { 1s = {0; } }
- \atom{right}{ 1s = {0; } }
- \molecule { 1sMO = {.75; , } }
- \draw[draw=blue,fill=blue!20,opacity=.5] (1sigma*) circle (8pt);
+ \atom{left} { 1s = 0 }
+ \atom{right}{ 1s = 0 }
+ \molecule { 1sMO = .75 }
+ \draw[draw=blue,very thick,fill=blue!40,opacity=.5] (1sigma*) circle (8pt);
+ \draw[<-,shorten <=8pt,shorten >=15pt,blue] (1sigma*) --++(2,1) node {antibindendes MO};
\end{MOdiagram}
\end{LTXexample}
-\subsection{AOs und MOs irgendwo}
+\subsection{AOs und MOs irgendwo}\label{ssec:AO_MO_irgendwo}
Nicht immer reichen die Standardorbitale aus, um ein sinnvolles MO-Diagramm zu zeichen. Beispielsweise würde man im MO-Diagramm von \ce{XeF2} wohl folgenden Ausschnitt für die 3Z/2E-Bindung benötigen, der die Wechselwirkung eines Xe-p-Orbitals mit der antibindenden Kombination zweier F-p-Orbitale zeigt:
\begin{center}
\begin{MOdiagram}[names]
- \atom[\lewis{0.,F}\hspace*{5mm}\lewis{4.,F}]{left}{}
- \atom[Xe]{right}{}
- \molecule[\ce{XeF2}]{}
- \AO[a](1cm){s}{0;up}
- \AO[b](1cm){s}{.25;up}
- \AO[c](3cm){s}{-1;pair}
- \AO[d](3cm){s}{0;pair}
- \AO[e](3cm){s}{1.5;}
- \AO[f](5cm){s}{1.25;pair}
- \connect{ a & d , b & c , b & e , c & f , e & f }
- \node[right,xshift=4mm] at (c) {\footnotesize bindend};
- \node[above] at (d.90) {\footnotesize nicht bindend};
- \node[above] at (e.90) {\footnotesize antibindend};
-\end{MOdiagram}
+ \atom[\lewis{0.,F}\hspace*{5mm}\lewis{4.,F}]{left}{1s=.2;up,up-el-pos={1sleft=.5}}
+ \atom[Xe]{right}{1s=1.25;pair}
+ \molecule[\ce{XeF2}]{1sMO={1/.25;pair}}
+ \AO(1cm){s}{0;up}
+ \AO(3cm){s}{0;pair}
+ \connect{ AO1 & AO2 }
+ \node[right,xshift=4mm] at (1sigma) {\footnotesize bindend};
+ \node[above] at (AO2.90) {\footnotesize nicht bindend};
+ \node[above] at (1sigma*.90) {\footnotesize antibindend};
+ \end{MOdiagram}
\end{center}
Um solche MO-Diagramme erstellen zu können, gibt es folgenden Befehl:
\begin{framed}
- \cmd=\AO[<name>](<xshift>){<type>}{<energy>;<el-spec>}=
+ \lstinline+\AO[<name>](<xshift>){<type>}[<key = val>]{<energy>;<el-spec>}+
\begin{itemize}\small
- \item\cmd=<name>= (o) Name der Node
- \item\cmd=<xshift>= (o) Vertikale Position des Orbitals, eine \TeX-Länge mit Einheit
- \item\cmd=<type>= (m) \cmd=s= oder \cmd=p=
- \item\cmd=<AO-spec>= (m) Spezifizierung des Atom-Orbitals
+ \item\lstinline=<name>= (o) Name der Node, wenn nicht angegeben, dann wird \lstinline=|AO|#= verwendet, wobei \lstinline=#= eine fortlaufende Nummer ist.
+ \item\lstinline=<xshift>= (o) Vertikale Position des Orbitals, eine \TeX-Länge mit Einheit
+ \item\lstinline=<type>= (m) \lstinline=s= oder \lstinline=p=
+ \item\lstinline+<key = val>+ (o) Key-Value Paare, mit denen das Layout angepasst werden kann, siehe Abschnitt \ref{ssec:AO_anpassen}.
+ \item\lstinline=<|AO|-spec>= (m) Spezifizierung des Atom-Orbitals
\end{itemize}
\end{framed}
-Je nach \cmd=<type>= werden damit ein s- oder drei p-Orbitale erzeugt.
+
+\newpage
+Je nach \lstinline=<type>= werden damit ein s- oder drei p-Orbitale erzeugt.
\begin{LTXexample}
\begin{MOdiagram}
\AO{s}{0;}
\AO(-20pt){p}{1;pair,up,down}
\end{MOdiagram}
\end{LTXexample}
-Beachten Sie, dass als \cmd=<el-spec>= beim Typ \cmd=s= nur eine Spezifikation erwartet wird, beim Typ \cmd=p= aber drei durch Komma getrennte.
-Möchte man ein AO genau an die Position eines Atoms setzen, so muss man deren \cmd=<xshift>= kennen. Die haben per Default folgende Werte (siehe auch Abschnitt \ref{orbital-positionen}):\label{xshift}
+Möchte man ein AO genau an die Position eines Atoms setzen, so muss man deren \lstinline=<xshift>= kennen. Die haben per Default folgende Werte (siehe auch Abschnitt \ref{orbital-positionen}):\label{xshift}
\begin{itemize}
\item atom left: \SI{1}{\centi\metre}
\item molecule: \SI{3}{\centi\metre}
@@ -365,54 +460,75 @@ Möchte man ein AO genau an die Position eines Atoms setzen, so muss man deren \
\end{itemize}
\begin{LTXexample}
\begin{MOdiagram}
- \atom{left} {1s={0;}}
- \atom{right}{1s={0;}}
- \molecule {1sMO={1;,}}
- \AO(1cm){s}{2;pair}
- \AO(3cm){s}{2;pair}
- \AO(5cm){s}{2;pair}
+ \atom{left} {1s=0}
+ \atom{right}{1s=0}
+ \molecule {1sMO=1}
+ \AO(1cm){s}{2}
+ \AO(3cm){s}{2}
+ \AO(5cm){s}{2}
\end{MOdiagram}
\end{LTXexample}
-In p-Orbitalen findet pro Orbital per Default eine Verschiebung um \SI{20}{pt} statt, was einer zweifachen Verschiebung um die noch zu besprechende Länge \cmd=AO-width= (siehe Abschnitt \ref{option:AO-width}) entspricht:
+In p-Orbitalen findet pro Orbital per Default eine Verschiebung um \SI{20}{pt} statt, was einer zweifachen Verschiebung um die noch zu besprechende Länge \lstinline=|AO|-width= (siehe Abschnitt \ref{option:AO-width}) entspricht:
\begin{LTXexample}
\begin{MOdiagram}
- \atom{left} {2p={0;,,}}
- \atom{right}{2p={0;,,}}
+ \atom{left} {2p=0}
+ \atom{right}{2p=0}
% ueber dem linken:
- \AO(1cm) {s}{ .5;pair}
+ \AO(1cm) {s}{ .5}
\AO(1cm-20pt){s}{ 1;up}
\AO(1cm-40pt){s}{1,5;down}
% ueber dem rechten:
- \AO(5cm) {s}{ .5;pair}
+ \AO(5cm) {s}{ .5}
\AO(5cm+20pt){s}{ 1;up}
\AO(5cm+40pt){s}{1.5;down}
\end{MOdiagram}
\end{LTXexample}
-Auch die mit \cmd=\AO= gesetzten Orbitale können mit Linien verbunden werden. Das kann man natürlich mit dem \cmd=\draw=-Befehl machen:
+Auch die mit \lstinline=\AO= gesetzten Orbitale können mit Linien verbunden werden. Das kann man natürlich mit dem \lstinline=\draw=-Befehl machen. Dafür können Sie entweder die voreingestellten Node-Namen verwenden \ldots
\begin{LTXexample}
\begin{MOdiagram}
- \AO[a]{s}{0;} \AO[b](2cm){s}{1;}
- \AO[c]{s}{2;} \AO[d](2cm){s}{1.5;}
- \draw (a) -- (b) (c) -- (d);
+ \AO{s}{0} \AO(2cm){s}{1}
+ \AO{s}{2} \AO(2cm){s}{1.5}
+ \draw[red] (AO1.0) -- (AO2.180) (AO3.0) -- (AO4.180);
\end{MOdiagram}
\end{LTXexample}
-Soll die Verbindungslinie aber zu dem Stil der durch \cmd=\molecule= erzeugten Linien\footnote{Dieser Stil kann angepasst werden, siehe Seite \pageref{option:lines}.} passen, dann sollte man den Befehl \cmd=\connect= verwenden.
+\ldots\ oder eigene Node-Namen setzen.
+\begin{LTXexample}
+ \begin{MOdiagram}
+ \AO[a]{s}{0} \AO[b](2cm){s}{1}
+ \AO[c]{s}{2} \AO[d](2cm){s}{1.5}
+ \draw[red] (a.0) -- (b.180) (c.0) -- (d.180);
+ \end{MOdiagram}
+\end{LTXexample}
+Die voreingestellten Namen lauten \lstinline=AO1=, \lstinline=AO2= \usw beim Typ \lstinline=s= und \lstinline=AO1x=, \lstinline=AO1y=, \lstinline=AO1z=, \lstinline=AO2x= \usw beim Typ \lstinline=p=. Beim Typ \lstinline=p= bekommt auch der selbstgewählte Name ein \lstinline=x=, \lstinline=y= \bzw ein \lstinline=z= angehängt.
+\begin{LTXexample}[pos=b]
+ \begin{MOdiagram}
+ \AO{p}{0}
+ \draw[<-,shorten >=5pt] (AO1y.-90) -- ++ (.5,-1) node {y};
+ \end{MOdiagram}
+ und
+ \begin{MOdiagram}
+ \AO[A]{p}{0}
+ \draw[<-,shorten >=5pt] (Ay.-90) -- ++ (.5,-1) node {y};
+ \end{MOdiagram}
+\end{LTXexample}
+
+Soll die Verbindungslinie automatisch zu dem Stil der durch \lstinline=\molecule= erzeugten Linien\footnote{Dieser Stil kann angepasst werden, siehe Seite \pageref{option:lines}.} passen, dann sollte man den Befehl \lstinline=\connect= verwenden.
\begin{framed}
- \cmd=\connect{<AO-connect>}=
+ \lstinline=\connect{<|AO-connect|>}=
\begin{itemize}\small
- \item\cmd=<AO-connect>= (m) durch Kommata getrennte Liste von durch \cmd=&= verbundenen Node-Paaren, die verbunden werden sollen.
+ \item\lstinline=<|AO-connect|>= (m) durch Kommata getrennte Liste von durch \lstinline=&= verbundenen Node-Paaren, die verbunden werden sollen.
\end{itemize}
\end{framed}
-Dieser Befehl erwartet eine durch Kommata getrennte Liste von durch \cmd=&= verbundenen Paaren von Node-Namen derer Nodes, die verbunden werden sollen:
+Dieser Befehl erwartet eine durch Kommata getrennte Liste von durch \lstinline=&= verbundenen Paaren von Node-Namen derer Nodes, die verbunden werden sollen:
\begin{LTXexample}
\begin{MOdiagram}
- \AO[a]{s}{0;} \AO[b](2cm){s}{1;}
- \AO[c]{s}{2;} \AO[d](2cm){s}{1.5;}
- \connect{ a & b, c & d }
+ \AO{s}{0;} \AO(2cm){s}{1;}
+ \AO{s}{2;} \AO(2cm){s}{1.5;}
+ \connect{ AO1 & AO2, AO3 & AO4 }
\end{MOdiagram}
\end{LTXexample}
-Einige Punkte müssen dabei noch erwähnt werden: \cmd=\connect= fügt der ersten Node den Anker \cmd=east= und der zweiten den Anker \cmd=west= hinzu. Damit funktioniert eine vernünftige Verbindung nur von links nach rechts. Allerdings können nach dem üblichen \TikZ-Schema auch eigene Anker gesetzt werden:
+Einige Punkte müssen dabei noch erwähnt werden: \lstinline=\connect= fügt der ersten Node den Anker \lstinline=east= und der zweiten den Anker \lstinline=west= hinzu. Damit funktioniert eine vernünftige Verbindung nur von links nach rechts. Allerdings können nach dem üblichen \TikZ-Schema auch eigene Anker gesetzt werden:
\begin{LTXexample}
\begin{tikzpicture}
\draw (0,0) node (a) {a} ++ (1,0) node (b) {b}
@@ -422,212 +538,364 @@ Einige Punkte müssen dabei noch erwähnt werden: \cmd=\connect= fügt der erste
\end{LTXexample}
\subsection{Die Positionen}\label{orbital-positionen}
-In folgender Darstellung sehen Sie die Werte, die die $x$-Positionen der Orbitale annehmen in Abhängigkeit von \cmd=<distance>= (\cmd=<dist>=) und \cmd=<AO-width>= (\cmd=<AO>=). Diese Längen und wie man sie ändert werden in den Abschnitten \ref{option:distance} und \ref{option:AO-width} besprochen.
+In folgender Darstellung sehen Sie die Werte, die die $x$-Positionen der Orbitale annehmen in Abhängigkeit von \lstinline=<distance>= (\lstinline=<dist>=) und \lstinline=<|AO|-width>= (\lstinline=<|AO|>=). Diese Längen -- und wie man sie ändert -- werden in den Abschnitten \ref{option:distance} und \ref{option:AO-width} besprochen.
\begin{center}
-\begin{MOdiagram}[distance=6cm,AO-width=25pt,labels-fs=\tt\footnotesize,labels-style={text width=40pt,align=center}]
+\begin{MOdiagram}[AO-width=22pt,labels-fs=\tt\scriptsize,labels-style={text width=40pt,align=center,yshift=11pt}]
\atom{left}{
- 1s={0;},
- 2s={3;},
- 2p={8;,,},
- label={ 1sleft={1cm}, 2sleft={1cm}, 2pxleft={1cm}, 2pyleft={1cm - 2*<AO>}, 2pzleft={1cm - 4*<AO>} } }
+ 1s=0,
+ 2s=2,
+ 2p=5.5,
+ label={ 1sleft={1cm}, 2sleft={1cm}, 2pxleft={1cm - 4*<AO>}, 2pyleft={1cm - 2*<AO>}, 2pzleft={1cm} } }
\atom{right}{
- 1s={0;},
- 2s={3;},
- 2p={8;,,},
+ 1s=0,
+ 2s=2,
+ 2p=5.5,
label={ 1sright={1cm + <dist>}, 2sright={1cm + <dist>}, 2pxright={1cm+ <dist>}, 2pyright={1cm + <dist> + 2*<AO>}, 2pzright={1cm + <dist> + 4*<AO>} } }
\molecule{
- 1sMO={.75;,},
- 2sMO={.75;,},
- 2pMO={3,1;,,,,,},
+ 1sMO=.5,
+ 2sMO=.5,
+ 2pMO={2,.75},
label={ 1sigma={.5*<dist> + 1cm}, 1sigma*={.5*<dist> + 1cm}, 2sigma={.5*<dist> + 1cm}, 2sigma*={.5*<dist> + 1cm}, 2psigma={.5*<dist> + 1cm}, 2psigma*={.5*<dist> + 1cm}, 2piy={.5*<dist> + 1cm - <AO>}, 2piy*={.5*<dist> + 1cm - <AO>}, 2piz={.5*<dist> + 1cm + <AO>}, 2piz*={.5*<dist> + 1cm + <AO>} }
}
\end{MOdiagram}
\end{center}
+\newpage
+\subsection{Default-Werte}
+\marginnote*{NEU}Wenn Sie die Argumente (oder besser: Werte) für die Spezifikation der AO \bzw MO weg- oder leerlassen, werden spezielle Default-Werte verwendet. In der folgenden Tabelle finden Sie eine Übersicht.
+\begin{center}\small
+\begin{tabular}{l>{\ttfamily}l>{\ttfamily}l>{\ttfamily}l}
+ \toprule & \normalfont\bfseries AO / MO & \normalfont\bfseries ohne & \normalfont\bfseries leer \\\midrule
+ Syntax: & & 1s & 1s= \\\midrule
+ & 1s & \{0;pair\} & \{0;\} \\
+ & 2s & \{2;pair\} & \{2;\} \\
+ & 2p & \{5;pair,pair,pair\} & \{5;,,\} \\\midrule
+ & 1sMO & \{.5;pair,pair\} & \{.5;,\} \\
+ & 2sMO & \{.5;pair,pair\} & \{.5;,\} \\
+ & 2pMO & \{1.5,.5;pair,pair,pair,pair,pair,pair\} & \{1.5,.5;,,,,,\} \\\bottomrule
+\end{tabular}
+\end{center}
+Ganz ähnlich verhält es sich mit dem \lstinline=\AO=-Befehl (Seite \pageref{ssec:AO_MO_irgendwo}), mit dem Unterschied, dass er eine Angabe für \lstinline=<energy>= benötigt.
+\begin{center}\small
+\begin{tabular}{>{\ttfamily}l>{\ttfamily}l>{\ttfamily}l}
+ \toprule\bfseries <type> & \bfseries <el-spec> \\\midrule
+ s & pair \\
+ p & pair,pair,pair \\\bottomrule
+\end{tabular}
+\end{center}
+Vergleichen Sie folgende Beispiele:
+\begin{LTXexample}
+ \begin{MOdiagram}
+ \atom{left} { 1s={0;pair} }
+ \atom{right}{ 1s }
+ \end{MOdiagram}
+
+ \hrulefill
+
+ \begin{MOdiagram}
+ \atom{left}{ 1s=1 }
+ \atom{right}{ 1s= }
+ \end{MOdiagram}
+\end{LTXexample}
+
\section{Anpassen des Layouts}
-\subsection{Umgebungs-Optionen}
-Es gibt folgende Optionen, mit denen das Aussehen der MO-Diagramme verändert werden kann.
+Die Optionen des Abschnitts \ref{ssec:umgebungs_optionen} können auch global als Paketoptionen, \dh mit \lstinline+\usepackage[<key = val>]{modiagram}+, oder über den Setup-Befehl \lstinline+\MOsetup{<key = val>}+ eingesetzt werden.
+
+\subsection{Umgebungs-Optionen}\label{ssec:umgebungs_optionen}
+Mit folgenden Optionen kann das Aussehen der MO-Diagramme verändert werden.
\begin{itemize}
- \item\cmd+style=<type>+ Verändern des Stils der Orbitale und Verbindungslinien, Abschnitt \ref{option:style}.
- \item\cmd+distance=<dim>+ Der Abstand zwischen linkem und rechtem Atom, Abschnitt \ref{option:distance}.
- \item\cmd+AO-width=<dim>+ Die Größe der Orbitale ändern, Abschnitt \ref{option:AO-width}.
- \item\cmd+lines=<tikz>+ \TikZ-Stil der Verbindungslinien anpassen, Abschnitt \ref{option:lines}.
- \item\cmd+names=<bool>+ Atome und Molekül beschriften, Abschnitt \ref{option:names}.
- \item\cmd+labels=<bool>+ Orbitale mit Default Beschriftung versehen, Abschnitt \ref{option:labels}.
- \item\cmd+labels-fs=<cs>+ Schriftgröße der Label-Beschriftung verändern, Abschnitt \ref{option:labels-fs}.
- \item\cmd+labels-style=<tikz>+ \TikZ-Stil der Label-Beschriftung verändern, Abschnitt \ref{option:labels-style}.
+ \item\lstinline+style=<type>+ Verändern des Stils der Orbitale und Verbindungslinien, Abschnitt \ref{option:style}.
+ \item\lstinline+distance=<dim>+ Der Abstand zwischen linkem und rechtem Atom, Abschnitt \ref{option:distance}.
+ \item\lstinline+|AO|-width=<dim>+ Die Größe der Orbitale ändern, Abschnitt \ref{option:AO-width}.
+ \item\lstinline+el-sep=<num>+ Abstand der Pfeile eines Elektronenpaars, Abschnitt \ref{option:electrons}.
+ \item\lstinline+up-el-pos=<num>+ Position des Spin-Up Pfeils, Abschnitt \ref{option:electrons}.
+ \item\lstinline+down-el-pos=<num>+ Position des Spin-Down Pfeils, Abschnitt \ref{option:electrons}.
+ \item\lstinline+lines=<tikz>+ \TikZ-Stil der Verbindungslinien anpassen, Abschnitt \ref{option:lines}.
+ \item\lstinline+names=<bool>+ Atome und Molekül beschriften, Abschnitt \ref{option:names}.
+ \item\lstinline+names-style=<tikz>+ \TikZ-Stil der Beschriftungen, Abschnitt \ref{option:names_style}.
+ \item\lstinline+names-style-add=<tikz>+ \TikZ-Stil der Beschriftungen, Abschnitt \ref{option:names_style}.
+ \item\lstinline+labels=<bool>+ Orbitale mit Default Beschriftung versehen, Abschnitt \ref{option:labels}.
+ \item\lstinline+labels-fs=<cs>+ Schriftgröße der Label-Beschriftung verändern, Abschnitt \ref{option:labels-fs}.
+ \item\lstinline+labels-style=<tikz>+ \TikZ-Stil der Label-Beschriftung verändern, Abschnitt \ref{option:labels-style}.
\end{itemize}
-Sie alle werden nachfolgend besprochen. Aufgerufen werden sie entweder als Option der Umgebung
+Sie alle werden nachfolgend besprochen. Wenn sie lokal als Option der Umgebung aufgerufen werden, haben sie nur für diese Auswirkungen.
\begin{lstlisting}
\begin{MOdiagram}[<key = value>]
...
\end{MOdiagram}
\end{lstlisting}
-oder über den Setup-Befehl
-\begin{framed}
- \cmd+\MOsetup{<key = value>}+
- \begin{itemize}\small
- \item\cmd+<key = val>+ (m) komma-separierte Schlüssel-Wert-Liste
- \end{itemize}
-\end{framed}
\subsubsection{Option \texttt{style}}\label{option:style}
-Es gibt vier verschiedene Stile, aus denen ausgewählt werden kann:
+Es gibt fünf verschiedene Stile, aus denen ausgewählt werden kann:
\begin{itemize}
- \item\cmd+style=plain+ \AOinline[style=plain]{pair} (Default)
- \item\cmd+style=square+ \AOinline[style=square]{pair}
- \item\cmd+style=round+ \AOinline[style=round]{pair}
- \item\cmd+style=fancy+ \AOinline[style=fancy]{pair}
+ \item\lstinline+style=plain+ \AOinline[style=plain]{pair} (Default)
+ \item\lstinline+style=square+ \AOinline[style=square]{pair}
+ \item\lstinline+style=circle+ \AOinline[style=circle]{pair}
+ \item\lstinline+style=round+ \AOinline[style=round]{pair}
+ \item\lstinline+style=fancy+ \AOinline[style=fancy]{pair}
\end{itemize}
Sehen wir uns das MO-Diagramm für \ce{H2} in den verschiedenen Stilen an:
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[style=plain]% Default
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[style=square]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
+\marginnote*{NEU}\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[style=circle]
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[style=round]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[style=fancy]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
\subsubsection{Option \texttt{distance}}\label{option:distance}
-Je nach Label und Beschriftungen können die \SI{4}{\centi\metre}, durch die das linke und das rechte Atom getrennt sind, zu wenig sein. Mit der Option \cmd+distance=<dim>+ lässt sie sich verändern. Damit wird die Position des rechten Atoms auf \cmd=1cm + <dim>= gesetzt und die Position des Moleküls auf \cmd=0.5*(1cm + <dim>)=, siehe auch Seite \pageref{xshift} und Abschnitt \ref{orbital-positionen}.
+Je nach Label und Beschriftungen können die \SI{4}{\centi\metre}, durch die das linke und das rechte Atom getrennt sind, zu wenig sein. Mit der Option \lstinline+distance=<dim>+ lässt sie sich verändern. Damit wird die Position des rechten Atoms auf \lstinline=1cm + <dim>= gesetzt und die Position des Moleküls auf \lstinline=0.5*(1cm + <dim>)=, siehe auch Seite \pageref{xshift} und Abschnitt \ref{orbital-positionen}.
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[distance=6cm]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
\subsubsection{Option \texttt{AO-width}}\label{option:AO-width}
-Die Länge \cmd=AO-width= enstpricht der Länge des waagerechten Strichs eines Orbitals im \cmd=plain=-Stil und beträgt per Default \SI{10}{pt}.
+Die Länge \lstinline=|AO|-width= enstpricht der Länge des waagerechten Strichs eines Orbitals im \lstinline=plain=-Stil und beträgt per Default \SI{10}{pt}.
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[AO-width=15pt]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[style=fancy,AO-width=15pt]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
+Durch das Verändern von \lstinline=|AO|-width= ändern sich auch die Positionen der p- und \textpi-Orbitale, siehe Abschnitt \ref{orbital-positionen}.
+
+\subsubsection{Optionen \texttt{el-sep}, \texttt{up-el-pos} und \texttt{down-el-pos}}\label{option:electrons}
+\marginnote*{NEU}Diese drei Optionen beeinflussen die horizontale Position der Pfeile, die die Elektronen in einem AO/MO repräsentieren. Die Option \lstinline+el-sep=<num>+ erwartet einen Wert zwischen \lstinline=0= und \lstinline=1=. Dabei bedeutet \lstinline=0= \emph{keinen} Abstand voneinander und \lstinline=1= \emph{vollen} Abstand voneinander (bezogen auf die Länge \lstinline=|AO|-width=, Abschnitt \ref{option:AO-width}).
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[el-sep=.2]% default
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[el-sep=0]
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[el-sep=1]
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
+Die Optionen \lstinline+up-el-pos=<num>+ und \lstinline+down-el-pos=<num>+ können alternativ dazu eingesetzt werden, um das Spin-Up- und Spin-Down-Elektron zu platzieren. Wieder werden Werte zwischen \lstinline=0= und \lstinline=1= erwartet. Diesmal bedeutet \lstinline=0= \emph{ganz links} und \lstinline=1= \emph{ganz rechts}
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[up-el-pos=.4,down-el-pos=.6]% default
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[up-el-pos=.333,down-el-pos=.667]
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[up-el-pos=.7,down-el-pos=.3]
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
-Durch das Verändern von \cmd=AO-width= ändern sich auch die Positionen der p- und \textpi-Orbitale, siehe Abschnitt \ref{orbital-positionen}.
+\newpage
\subsubsection{Option \texttt{lines}}\label{option:lines}
-Der Option \cmd=lines= können \TikZ-Keys angegeben werden, um den Stil der Verbindungslinien zu ändern.
+Der Option \lstinline=lines= können \TikZ-Keys angegeben werden, um den Stil der Verbindungslinien zu ändern.
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[lines={gray,thin}]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
\subsubsection{Option \texttt{names}}\label{option:names}
-Verwendet man die Option \cmd=names=, werden den Atomen und dem Molekül Beschriftungen hinzugefügt, sofern man die optionalen Argumente von \cmd=\atom= und/oder \cmd=\molecule= verwendet hat.
+Verwendet man die Option \lstinline=names=, werden den Atomen und dem Molekül Beschriftungen hinzugefügt, sofern man die optionalen Argumente von \lstinline=\atom= und/oder \lstinline=\molecule= verwendet hat.
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[names]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
+
+\subsubsection{Oprionen \texttt{names-style} und \texttt{names-style-add}}\label{option:names_style}
+\marginnote*{NEU}Diese Optionen erlauben die Gestaltung der Beschriftung der Atome und des Moleküls. Per Default wird folgende Einstellung verwendet: \lstinline+\names-style={anchor=base}+\footnote{Zur Bedeutung siehe "`\TikZ und PGF -- Manual for Version 2.10"' S.\,183 Abschnitt 16.4.4 (pgfmanual.pdf)}.
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[names,names-style={draw=blue}]
+ \atom[p]{left} { 1s = {;up} }
+ \atom[b]{right}{ 1s = {;up} }
+ \molecule[\ce{X2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
+Damit werden die Voreinstellungen überschrieben. Wie Sie erkennen können, zerstört das die vertikale Ausrichtung der Nodes. Um das zu vermeiden, können Sie \zB \lstinline=text height= und \lstinline=text depth= deklarieren \ldots
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[names,names-style={text height=1.5ex, text depth=.25ex, draw=blue}]
+ \atom[p]{left} { 1s = {;up} }
+ \atom[b]{right}{ 1s = {;up} }
+ \molecule[\ce{X2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
+\ldots, den \lstinline=anchor= wieder hinzufügen \ldots
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[names,names-style={anchor=base, draw=blue}]
+ \atom[p]{left} { 1s = {;up} }
+ \atom[b]{right}{ 1s = {;up} }
+ \molecule[\ce{X2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
+\ldots\ oder die Option \lstinline=names-style-add= verwenden. Diese überschreibt die Einstellung nicht, sondern fügt die neuen Deklarationen hinzu.
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[names,names-style-add={draw=blue}]
+ \atom[p]{left} { 1s = {;up} }
+ \atom[b]{right}{ 1s = {;up} }
+ \molecule[\ce{X2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
+\begin{LTXexample}[pos=b]
+ \MOsetup{names,names-style={text height=2.5ex,text depth=.5ex,draw=blue!80,rounded corners}}
+ \begin{MOdiagram}
+ \atom[p]{left} { 1s = {;up} }
+ \atom[b]{right}{ 1s = {;up} }
+ \molecule[\ce{X2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+ \begin{MOdiagram}[names-style-add={fill=blue!20}]
+ \atom[p]{left} { 1s = {;up} }
+ \atom[b]{right}{ 1s = {;up} }
+ \molecule[\ce{X2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
\subsubsection{Option \texttt{labels}}\label{option:labels}
-Mit der Option \cmd=labels= werden vordefinierte Labels an die Orbitale geschrieben. Diese Labels können auch geändert werden, siehe Abschnitt \ref{key:label}.
+Mit der Option \lstinline=labels= werden vordefinierte Labels an die Orbitale geschrieben. Diese Labels können auch geändert werden, siehe Abschnitt \ref{key:label}.
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[labels]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
+\newpage
\subsubsection{Option \texttt{labels-fs}}\label{option:labels-fs}
-Per Default werden die Labels mit der Schriftgröße \cmd=\small= gesetzt. Wenn man das ändern möchte, kann man die Option \cmd=labels-fs= verwenden.
+Per Default werden die Labels mit der Schriftgröße \lstinline=\small= gesetzt. Wenn man das ändern möchte, kann man die Option \lstinline=labels-fs= verwenden.
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[labels,labels-fs=\footnotesize]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
Damit ist es auch möglich, den Schriftstil zu verändern.
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[labels,labels-fs=\sffamily\footnotesize]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
\subsubsection{Option \texttt{labels-style}}\label{option:labels-style}
-Mit der Option \cmd=labels-style= kann man den \TikZ-Stil der Nodes ändern, in die die Labels geschrieben werden.
+Mit der Option \lstinline=labels-style= kann man den \TikZ-Stil der Nodes ändern, in die die Labels geschrieben werden.
\begin{LTXexample}
- % use package 'mhchem'
- \begin{MOdiagram}[labels,labels-style={blue}]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ % use package `mhchem'
+ \begin{MOdiagram}[labels,labels-style={blue,yshift=4pt}]
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
\subsection{\texttt{\textbackslash atom} und \texttt{\textbackslash molecule} spezifische Anpassungen}
\subsubsection{Der \texttt{label} Key}\label{key:label}
-Wenn man die vordefinierten Label nicht verwenden möchte, also eigene Label ändern möchte oder auch nur einzelne Label verwenden möchte, kann man den Key \cmd=label= einsetzen. Dieser Key wird im \cmd=\atom=- und im \cmd=\molecule=-Befehl bei \cmd=<AO-spec>= \bzw \cmd=<MO-spec>= eingesetzt. Der Key erwartet eine durch Kommata getrennte Schlüssel-Wert-Liste. Als Schlüssel werden die in Abschnitt \ref{Namensgebung} vorgestellten Namen verwendet, mit denen das zu beschriftende Orbital spezifiziert wird.
+Wenn man die vordefinierten Label nicht verwenden möchte, also eigene Label einsetzen oder auch nur einzelne Label verwenden möchte, kann man den Key \lstinline=label= einsetzen. Dieser Key wird im \lstinline=\atom=- und im \lstinline=\molecule=-Befehl bei \lstinline=<|AO|-spec>= \bzw \lstinline=<MO-spec>= eingesetzt. Der Key erwartet eine durch Kommata getrennte Schlüssel-Wert-Liste. Als Schlüssel werden die in Abschnitt \ref{Namensgebung} vorgestellten Namen verwendet, mit denen das zu beschriftende Orbital spezifiziert wird.
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[labels-fs=\footnotesize]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
\molecule[\ce{H2}]{
- 1sMO = {.75;pair,},
+ 1sMO = {.75;pair},
label = { 1sigma = {bindendes MO} }
}
\end{MOdiagram}
\end{LTXexample}
\begin{LTXexample}
\begin{MOdiagram}[style=square,distance=6cm]
- \atom{left} { 1s = {0;up} }
- \atom{right}{ 1s = {0;up} }
+ \atom{left} { 1s = {;up} }
+ \atom{right}{ 1s = {;up} }
\molecule{
- 1sMO = {.75;pair,} ,
+ 1sMO = {.75;pair} ,
label = {
1sigma = $\sigma$,
1sigma* = $\sigma^*$
@@ -638,87 +906,156 @@ Wenn man die vordefinierten Label nicht verwenden möchte, also eigene Label än
\end{MOdiagram}
\end{LTXexample}
+Wird der Key zusammen mit der \lstinline=labels=-Option (Seite \pageref{option:labels}) verwendet, dann werden damit einzelne Label überschrieben:
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[labels]
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{
+ 1sMO = {.75;pair},
+ label = { 1sigma = \textcolor{red}{??} }
+ }
+ \end{MOdiagram}
+\end{LTXexample}
+
\subsubsection{Der \texttt{color} Key}\label{key:color}
-Analog zum \cmd=label=-Key kann der \cmd=color=-Key verwendet werden, um die Elektronen eines Orbitals farbig darzustellen.
+Analog zum \lstinline=label=-Key kann der \lstinline=color=-Key verwendet werden, um die Elektronen eines Orbitals farbig darzustellen.
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[labels-fs=\footnotesize]
\atom[H]{left}{
- 1s = {0;pair},
- color = { 1sleft = blue }
+ 1s, color = { 1sleft = blue }
}
\atom[H]{right}{
- 1s = {0;pair},
- color = { 1sright = red }
+ 1s, color = { 1sright = red }
}
\molecule[\ce{H2}]{
- 1sMO = {.75;pair,pair},
+ 1sMO,
label = { 1sigma = {bindendes MO} },
color = { 1sigma = green, 1sigma* = cyan }
}
\end{MOdiagram}
\end{LTXexample}
+\subsubsection{Die \texttt{up-el-pos} und \texttt{down-el-pos} Keys}\label{key:electrons}
+\marginnote*{NEU}Mit den Keys \lstinline=up-el-pos= \bzw \lstinline=down-el-pos= ist es möglich, die Pfeile, die die Elektronen repräsentieren, in einem einzigen AO oder MO zu verschieben. Es können Werte zwischen \lstinline=0= und \lstinline=1= verwendet werden, siehe auch Abschnitt \ref{option:electrons}.
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}
+ \atom[H]{left}{
+ 1s = {;up},
+ up-el-pos = { 1sleft=.5 }
+ }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{
+ 1sMO = {.75;pair} ,
+ up-el-pos = { 1sigma=.15 } ,
+ down-el-pos = { 1sigma=.85 }
+ }
+ \end{MOdiagram}
+\end{LTXexample}
+
+\subsection{\texttt{\textbackslash AO} spezifische Anpassungen}\label{ssec:AO_anpassen}
+\marginnote*{NEU}Diese Keys erlauben, die mit \lstinline=\AO= erzeugten AOs \bzw MOs anzupassen.
+
+\subsubsection{Der \texttt{label} Key}\label{key:AO_label}
+Der Key \lstinline=label[x/y/z]= erlaubt, an ein frei gesetztes AO \bzw MO ein Label zu setzen. Wenn Sie den Typ \lstinline=p= verwenden, können Sie in eckigen Klammern das zu verwendende Orbital auswählen.
+\begin{LTXexample}
+ \begin{MOdiagram}[style=square]
+ \AO{s}[label=s-Orb]{0}
+ \AO{p}[label[y]=py,label[z]=pz]{1.5}
+ \end{MOdiagram}
+\end{LTXexample}
+
+\subsubsection{Der \texttt{color} Key}\label{key:AO_color}
+Analog zum \lstinline=label=-Key gibt es den Key \lstinline=color[x/y/z]=, der ermöglicht, die Elektronen zu färben. Wenn Sie den Typ \lstinline=p= verwenden, können Sie in eckigen Klammern das zu verwendende Orbital auswählen.
+\begin{LTXexample}
+ \begin{MOdiagram}[style=square]
+ \AO{s}[color=red]{0}
+ \AO{p}[color[y]=green,color[z]=cyan]{1.5}
+ \end{MOdiagram}
+\end{LTXexample}
+
+\subsubsection{Die \texttt{up-el-pos} und \texttt{down-el-pos} Keys}\label{key:AO_electrons}
+Weiter gibt es noch die Keys \lstinline=up-el-pos[x/y/z]= und \lstinline=down-el-pos[x/y/z]=, mit denen die Elektronen verschoben werden können. Dabei können Sie Werte zwischen \lstinline=0= und \lstinline=1= einsetzen, siehe auch Abschnitt \ref{option:electrons}. Wenn Sie den Typ \lstinline=p= verwenden, können Sie in eckigen Klammern das zu verwendende Orbital auswählen.
+\begin{LTXexample}
+ \begin{MOdiagram}[style=square]
+ \AO{s}[up-el-pos=.15]{0}
+ \AO{p}[up-el-pos[y]=.15,down-el-pos[z]=.15]{1.5}
+ \end{MOdiagram}
+\end{LTXexample}
+
\subsection{Energie-Achse}
-Zuletzt möchte man unter Umständen gerne eine Energie-Achse an das Diagramm zeichnen. Dafür gibt es den Befehl \cmd=\EnergyAxis=
+Zuletzt möchte man unter Umständen gerne eine Energie-Achse an das Diagramm zeichnen. Dafür gibt es den Befehl \lstinline=\EnergyAxis=
\begin{framed}
- \cmd+\EnergyAxis[<key = val>]+
+ \lstinline+\EnergyAxis[<key = val>]+
\begin{itemize}\small
- \item\cmd+<key = val>+ (o) Schlüssel-Wert-Paare, um die Achse zu modifizieren.
+ \item\lstinline+<key = val>+ (o) Schlüssel-Wert-Paare, um die Achse zu modifizieren.
\end{itemize}
\end{framed}
\begin{LTXexample}
\begin{MOdiagram}
- \atom{left} { 1s = {0;up} }
- \atom{right}{ 1s = {0;up} }
- \molecule{ 1sMO = {.75;pair,} }
+ \atom{left} { 1s = {;up} }
+ \atom{right}{ 1s = {;up} }
+ \molecule{ 1sMO = {.75;pair} }
\EnergyAxis
\end{MOdiagram}
\end{LTXexample}
Es gibt derzeit zwei Keys, mit denen die Achse modifiziert werden kann.
\begin{framed}
\begin{itemize}
- \item\cmd+title=<title>+ Achsenbeschriftung (Default: \cmd=energy=).
- \item\cmd+head=<tikz-arrow-head>+ Pfeilspitze; hier können die Pfeilspitzen verwendet werden, die in der \TikZ-Library \textsf{arrows} spezifiziert sind (pgf-Manual v2.10 Seiten 256ff.) (Default: \cmd=>=).
+ \item\lstinline+title=<title>+ Achsenbeschriftung (Default: \lstinline=energy=).
+ \item\lstinline+head=<tikz-arrow-head>+ Pfeilspitze; hier können die Pfeilspitzen verwendet werden, die in der \TikZ-Library \textsf{arrows} spezifiziert sind (pgf-Manual v2.10 Seiten 256ff.) (Default: \lstinline=>=).
\end{itemize}
\end{framed}
\begin{LTXexample}
\begin{MOdiagram}
- \atom{left} { 1s = {0;up} }
- \atom{right}{ 1s = {0;up} }
- \molecule{ 1sMO = {.75;pair,} }
+ \atom{left} { 1s = {;up} }
+ \atom{right}{ 1s = {;up} }
+ \molecule{ 1sMO = {.75;pair} }
\EnergyAxis[title]
\end{MOdiagram}
\end{LTXexample}
\begin{LTXexample}
\begin{MOdiagram}
- \atom{left} { 1s = {0;up} }
- \atom{right}{ 1s = {0;up} }
- \molecule{ 1sMO = {.75;pair,} }
+ \atom{left} { 1s = {;up} }
+ \atom{right}{ 1s = {;up} }
+ \molecule{ 1sMO = {.75;pair} }
\EnergyAxis[title=Energie,head=stealth]
\end{MOdiagram}
\end{LTXexample}
-\subsection{Beispiele}
+\section{Beispiele}
+Das Beispiel vom Beginn des Abschnitts \ref{ssec:AO_MO_irgendwo}.
+\begin{LTXexample}
+ % use packages `mhchem' and `chemfig'
+ \begin{MOdiagram}[names]
+ \atom[\lewis{0.,F}\hspace*{5mm}\lewis{4.,F}]{left}{1s=.2;up,up-el-pos={1sleft=.5}}
+ \atom[Xe]{right}{1s=1.25;pair}
+ \molecule[\ce{XeF2}]{1sMO={1/.25;pair}}
+ \AO(1cm){s}{0;up}
+ \AO(3cm){s}{0;pair}
+ \connect{ AO1 & AO2 }
+ \node[right,xshift=4mm] at (1sigma) {\footnotesize bindend};
+ \node[above] at (AO2.90) {\footnotesize nicht bindend};
+ \node[above] at (1sigma*.90) {\footnotesize antibindend};
+ \end{MOdiagram}
+\end{LTXexample}
+
\begin{LTXexample}[pos=b]
- % use packages 'mhchem' (and 'textgreek' loaded by 'MOdiagram')
+ % use packages `mhchem' (and `textgreek' loaded by `MOdiagram')
\begin{figure}
\centering
\begin{MOdiagram}[style=square,labels,names,AO-width=8pt,labels-fs=\footnotesize]
\atom[\ce{O_a}]{left}{
- 1s = {0;pair},
- 2s = {2;pair},
- 2p = {5;pair,up,up}
+ 1s, 2s, 2p = {;pair,up,up}
}
\atom[\ce{O_b}]{right}{
- 1s = {0;pair},
- 2s = {2;pair},
- 2p = {5;pair,up,up}
+ 1s, 2s, 2p = {;pair,up,up}
}
\molecule[\ce{O2}]{
- 1sMO = {.5;pair,pair},
- 2sMO = {.5;pair,pair},
- 2pMO = {1.5,.5;pair,pair,pair,up,up,},
+ 1sMO, 2sMO, 2pMO = {;pair,pair,pair,up,up},
color = { 2piy*=red, 2piz*=red }
}
\EnergyAxis
@@ -726,11 +1063,12 @@ Es gibt derzeit zwei Keys, mit denen die Achse modifiziert werden kann.
\caption{MO-Diagramm von $^3$\textSigma-\ce{O2}.}
\end{figure}
\end{LTXexample}
+
\begin{LTXexample}[pos=b]
- % use package 'chemfig'
+ % use package `chemfig'
\begin{figure}
- \centering
- \begin{MOdiagram}[style=fancy,distance=7cm,AO-width=15pt,labels]
+ \centering\MOsetup{style = fancy, distance = 7cm, AO-width = 15pt, labels}
+ \begin{MOdiagram}
\atom[N]{left}{
2p = {0;up,up,up}
}
@@ -738,10 +1076,10 @@ Es gibt derzeit zwei Keys, mit denen die Achse modifiziert werden kann.
2p = {2;pair,up,up}
}
\molecule[NO]{
- 2pMO = {1.8,.4;pair,pair,pair,up,,},
+ 2pMO = {1.8,.4;pair,pair,pair,up},
color = { 2piy*=red }
}
- \EnergyAxis[title]
+ \EnergyAxis[title=Energie]
\end{MOdiagram}
\caption{Ausschnitt aus dem MO-Diagramm von \protect\Lewis{4.,NO}.}
\end{figure}
diff --git a/Master/texmf-dist/doc/latex/modiagram/modiagram_doc_en.pdf b/Master/texmf-dist/doc/latex/modiagram/modiagram_doc_en.pdf
index 75a3cd1353a..f88d1b0b39b 100644
--- a/Master/texmf-dist/doc/latex/modiagram/modiagram_doc_en.pdf
+++ b/Master/texmf-dist/doc/latex/modiagram/modiagram_doc_en.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/modiagram/modiagram_doc_en.tex b/Master/texmf-dist/doc/latex/modiagram/modiagram_doc_en.tex
index f79000a55f2..a1008bea4d5 100644
--- a/Master/texmf-dist/doc/latex/modiagram/modiagram_doc_en.tex
+++ b/Master/texmf-dist/doc/latex/modiagram/modiagram_doc_en.tex
@@ -1,10 +1,10 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% --------------------------------------------------------------------------- %
-% - MOdiagram - modiagram_doc_en.tex - %
+% - MOdiagram - modiagram_doc_de.tex - %
% - easy creation of molecular orbital diagrams - %
% --------------------------------------------------------------------------- %
% - Clemens NIEDERBERGER - %
-% - 2011/09/25 - %
+% - 2011/10/27 - %
% --------------------------------------------------------------------------- %
% - http://www.mychemistry.eu/ - %
% - contact@mychemistry.eu - %
@@ -30,19 +30,48 @@
% - modiagram_doc_de.tex, README - %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{scrartcl}
-\usepackage{xparse}[2011/09/05]
\usepackage[english]{babel}
\usepackage[utf8]{inputenx}
+\usepackage{lmodern,emerald,microtype}
\usepackage[dvipsnames]{xcolor}
\colorlet{code}{RawSienna}
-\usepackage{modiagram,xspace,siunitx,framed,chemfig}
-\usepackage{showexpl}
+\usepackage{modiagram,xspace,siunitx,framed,chemfig,booktabs}
\usepackage[version=3]{mhchem}
\usepackage{showexpl}
\lstset{
+ explpreset={
+ language = [LaTeX]TeX,
+ basicstyle = {\ttfamily\small},
+ breaklines = true,
+ commentstyle = {\color[named]{Gray}},
+ backgroundcolor = \color{yellow!20},
+ numbers = left,
+ numberstyle = \tiny,
+ numberblanklines = true,
+ numbersep = .3em,
+ xleftmargin = 1em,
+ gobble = 1,
+ keywordstyle = \color{code},
+ morekeywords =
+ {
+ AO,
+ atom,
+ ce,
+ connect,
+ draw,
+ EnergyAxis,
+ lewis,
+ Lewis,
+ molecule,
+ MOsetup,
+ node,
+ textcolor,
+ textSigma
+ }
+ },
language = [LaTeX]TeX,
- basicstyle = {\ttfamily\small\color{code!80}},
+ basicstyle = {\ttfamily},
breaklines = true,
commentstyle = {\color[named]{Gray}},
backgroundcolor = \color{yellow!20},
@@ -51,7 +80,20 @@
numberblanklines = true,
numbersep = .3em,
xleftmargin = 1em,
- gobble = 1
+ gobble = 1,
+ moredelim = [is][\color{black}]{|}{|},
+ keywordstyle = \color{code},
+ morekeywords =
+ {
+ AO,
+ atom,
+ connect,
+ draw,
+ EnergyAxis,
+ molecule,
+ MOsetup,
+ usepackage
+ }
}
\usepackage{hyperref}
@@ -72,21 +114,40 @@
}
\newcommand*\MOname{\textsf{MOdiagram}\xspace}
-\newcommand*\MOversion{0.1\xspace}
-\newcommand*\MOdate{2011/09/25}
+\newcommand*\MOversion{0.2\xspace}
+\newcommand*\MOdate{2011/10/27}
-\newcommand*\paket[1]{\textsf{#1}\footnote{\url{http://www.ctan.org/pkg/#1/}}}
-% \newcommand*\paket[1]{\textsf{#1}}
+\newcommand*\paket[1]{\textsf{#1}\footnote{\url{http://www.ctan.org/pkg/#1}}}
\newcommand*\changefont[3]{\fontfamily{#1}\fontseries{#2}\fontshape{#3}\selectfont}
\DeclareDocumentEnvironment{myquote}{o}
{\quote\small\changefont{cmss}{m}{sl}}
{\IfNoValueF{#1}{\par\noindent\parbox{\linewidth}{\raggedleft\normalfont\itshape#1}}\endquote}
-\NewDocumentCommand\cmd{v}{{\color{code!80}\ttfamily#1}}
\newcommand*\TikZ{\mbox{Ti\textbf{\textit{k}}Z}\xspace}
-\newcommand*\bzw{\mbox{bzw.}\xspace}
+\newcommand*\etc{\mbox{etc.}\xspace}
+\newcommand*\ie{\mbox{i.e.}\xspace}
+
+\newlength\marginnotewidth
+\NewDocumentCommand\marginnote { s O{TeenSpirit} m } {%
+ \settowidth\marginnotewidth{\small\csname ECF#2\endcsname\color{red}#3}
+ \addtolength\marginnotewidth{20pt}
+ \noindent\makebox[0cm]{\hskip-\marginnotewidth\small\csname ECF#2\endcsname\color{red}#3}%
+ \IfBooleanF{#1}{\hspace{\parindent}}%
+}
+
+\NewDocumentCommand \AOinline { o m }
+ {
+ \begingroup
+ \IfNoValueTF{#1}
+ {\MOsetup{ style=square,AO-width=8pt }}%
+ {\MOsetup{ style=square,AO-width=8pt , #1 }}%
+ \begin{MOdiagram}
+ \AO{s}{0;#2}
+ \end{MOdiagram}%
+ \endgroup
+ }
\begin{document}
@@ -112,7 +173,7 @@
2p = {2;pair,up,up}
}
\molecule[NO]{
- 2pMO = {1.8,.4;pair,pair,pair,up,,},
+ 2pMO = {1.8,.4;pair,pair,pair,up},
color = { 2piy*=red }
}
\end{MOdiagram}
@@ -120,253 +181,268 @@
\tableofcontents
+\newpage
\section{Licence, Requirements}
\MOname v\MOversion underlies the \LaTeX\ Project Public License version 1.3 or later.\newline(\url{http://www.latex-project.org/lppl.txt})
-\MOname needs the packages \paket{expl3}, \paket{xparse}, \paket{l3keys2e}, \textsf{tikz}\footnote{\url{http://www.ctan.org/pkg/pgf/}}, \paket{amsmath} and \paket{textgreek}. Additionally the \TikZ libraries \textsf{calc} and \textsf{arrows} are loaded.
+\MOname needs the packages \paket{expl3}, \paket{xparse}, \paket{l3keys2e}, \textsf{tikz}\footnote{\url{http://www.ctan.org/pkg/pgf}} and \paket{textgreek}. Additionally the \TikZ libraries \textsf{calc} and \textsf{arrows} are loaded.
-It is useful to be familiar with the \paket{pgf} or the \paket{tikz} package.
+Knowledge of \textsf{pgf} or \textsf{tikz} would be useful.
\section{Motivation}
-This package has been written as a reaction to a question on \url{http://tex.stackexchange.com/}. To be more precise: as a rection to the question \href{http://tex.stackexchange.com/questions/13863/molecular-orbital-diagrams-in-latex}{Molecular orbital diagrams in LaTeX}. There it says
+This package has been written as a reaction to a question on \url{http://tex.stackexchange.com/}. To be more precise: as a reaction to the question \href{http://tex.stackexchange.com/questions/13863/molecular-orbital-diagrams-in-latex}{Molecular orbital diagrams in LaTeX}. There it says
\begin{myquote}
I'm wondering if anyone has seen a package for drawing (qualitative) molecular orbital splitting diagrams in \LaTeX? Or if there exist any packages that can be easily re-purposed to this task?
Otherwise, I think I'll have a go at it in \TikZ.
\end{myquote}
-The problem was solved using \TikZ, since no package existed for that purpose. \MOname is intended to fill this gap.
+The problem was solved using \TikZ, since no package existed for that purpose. For one thing \MOname is intended to fill this gap. I also found it very tedious, to make all this copying and pasting when I needed a second, third, \ldots\ diagram. \MOname took care of that.
\section{Main Commands}
-Every molecular orbital (MO) diagrams are created using the environment \cmd=MOdiagram= . Inside this environment two commands are important to begin with.
+All molecular orbital (MO) diagrams are created using the environment \lstinline=MOdiagram=. When the commands are described in the following sections, arguments are marked with (o) or (m) meaning \emph{optional} or \emph{mandatory} argument.
\subsection{The \texttt{\textbackslash atom} Command}
\begin{framed}
- \cmd=\atom[<name>]{<pos>}{<AO-spec>}=
+ \lstinline=\atom[<name>]{<pos>}{<|AO|-spec>}=
\begin{itemize}\small
- \item\cmd=<name>= (o) caption of the atom
- \item\cmd=<pos>= (m) on the left or the right in the diagram
- \item\cmd=<AO-spec>= (m) specifications of the atomic orbitals (AO)
+ \item\lstinline=<name>= (o) caption of the atom
+ \item\lstinline=<pos>= (m) on the left or the right in the diagram
+ \item\lstinline=<|AO|-spec>= (m) specifications of the atomic orbitals (AO)
\end{itemize}
\end{framed}
Let's take a look at an example:
-
\begin{LTXexample}
\begin{MOdiagram}
\atom{right}{
1s = { 0; pair} ,
2s = { 1; pair} ,
- 2p = {1.5; up, down, }
+ 2p = {1.5; up, down }
}
\end{MOdiagram}
\end{LTXexample}
-
-As you can see, the argument \cmd=<AO-spec>= is essential to create the actual orbitals and the electrons within. You can use these key/value pairs to specify what you need:
+As you can see, the argument \lstinline=<|AO|-spec>= is essential to create the actual orbitals and the electrons within. You can use these key/value pairs to specify what you need:
\begin{framed}
\begin{itemize}
- \item\cmd+1s={<rel. energy>; <el-spec>}+
- \item\cmd+2s={<rel. energy>; <el-spec>}+
- \item\cmd+2p={<rel. energy>; <x el-spec>, <y el-spec>, <z el-spec>}+
+ \item\lstinline+1s={<rel. energy>; <el-spec>}+
+ \item\lstinline+2s={<rel. energy>; <el-spec>}+
+ \item\lstinline+2p={<rel. energy>; <x el-spec>, <y el-spec>, <z el-spec>}+
\end{itemize}
\end{framed}
-\cmd=<el-spec>= can have the values \cmd=pair=, \cmd=up= and \cmd=down= or can be left empty. \cmd=<rel. energy>= actually is the $y$ coordinate ansd shifts the AO vertically by \cmd=<rel. energy>= \si{\centi\metre}.
-
-The argument \cmd=<pos>= is important, when p orbitals are used. For instance compare the following example to the one before:
+\lstinline=<el-spec>= can have the values \lstinline=pair=, \lstinline=up= and \lstinline=down= or can be left empty. \lstinline=<rel. energy>= actually is the $y$ coordinate and shifts the AO vertically by \lstinline=<rel. energy>= \si{\centi\metre}.
+The argument \lstinline=<pos>= is important, when p orbitals are used. For instance compare the following example to the one before:
\begin{LTXexample}
\begin{MOdiagram}
\atom{left}{
1s = { 0; pair} ,
2s = { 1; pair} ,
- 2p = {1.5; up, down, }
+ 2p = {1.5; up, down }
}
\end{MOdiagram}
\end{LTXexample}
-
When both variants are used one can also see, that the right atom is shifted to the right (hence the naming). The right atom is shifted by \SI{4}{\centi\metre} per default and canbe adjusted individually, see page \pageref{option:distance}.
-
-\begin{LTXexample}
+\begin{LTXexample}[pos=b]
\begin{MOdiagram}
\atom{left}{
1s = { 0; pair} ,
2s = { 1; pair} ,
- 2p = {1.5; up, down, }
+ 2p = {1.5; up, down }
}
\atom{right}{
1s = { 0; pair} ,
2s = { 1; pair} ,
- 2p = {1.5; up, down, }
+ 2p = {1.5; up, down }
}
\end{MOdiagram}
\end{LTXexample}
+With the command \lstinline=\molecule= (section \ref{ssec:molecule}) the reason for the shift becomes clear.
-With the next command the reason for the shift becomes clear.
+\marginnote{NEW}Any of the arguments for the AO can be left empty or be omitted.
+\begin{LTXexample}[pos=b]
+ Without argument: default height, full:
+ \begin{MOdiagram}
+ \atom{left}{1s, 2s, 2p}
+ \end{MOdiagram}
+\end{LTXexample}
+\begin{LTXexample}[pos=b]
+ empty argument: default height, empty:
+ \begin{MOdiagram}
+ \atom{left}{1s=, 2s=, 2p=}
+ \end{MOdiagram}
+\end{LTXexample}
+\begin{LTXexample}[pos=b]
+ using some values:\\
+ \begin{MOdiagram}
+ \atom{left}{1s, 2s=1, 2p={;,up} }
+ \end{MOdiagram}
+\end{LTXexample}
-\subsection{The \texttt{\textbackslash molecule} command}
+\subsection{The \texttt{\textbackslash molecule} Command}\label{ssec:molecule}
\begin{framed}
- \cmd=\molecule[<name>]{<MO-spec>}=
+ \lstinline=\molecule[<name>]{<MO-spec>}=
\begin{itemize}\small
- \item\cmd=<name>= (o) caption of the molekule
- \item\cmd=<MO-spec>= (m) specifications of the molecular orbitals (MO)
+ \item\lstinline=<name>= (o) caption of the molecule
+ \item\lstinline=<MO-spec>= (m) specifications of the molecular orbitals (MO)
\end{itemize}
\end{framed}
An example first:
-
\begin{LTXexample}
\begin{MOdiagram}
- \atom{left} { 1s = { 0; up} }
- \atom{right}{ 1s = { 0; up} }
- \molecule { 1sMO = {.75; pair, } }
+ \atom{left} { 1s = { 0; up } }
+ \atom{right}{ 1s = { 0; up } }
+ \molecule { 1sMO = {.75; pair } }
\end{MOdiagram}
\end{LTXexample}
+The command \lstinline=\molecule= connects the AO with the bonding and anti-bondung MO. \lstinline=\molecule= can only be used \emph{after} one has set \emph{both} atoms, since the orbitals, that should be connected, must be known.
-The command \cmd=\molecule= connects the AO with the bonding and anti-bondung MO. \cmd=\molecule= can only be used \emph{after} one has set \emph{both} atoms, since the orbitals, that should be connected, must be known.
-
-The argument \cmd=<MO-spec>= accepts a comma separated list of key/value pairs:
+The argument \lstinline=<MO-spec>= accepts a comma separated list of key/value pairs:
\begin{framed}
\begin{itemize}
- \item\cmd+1sMO={<energy gain>; <s el-spec>, <s* el-spec>}+ (connects the AO specified by \cmd=1s=)
- \item\cmd+2sMO={<energy gain>; <s el-spec>, <s* el-spec>}+ (connects the AO specified by \cmd=2s=)
- \item\cmd+2pMO={<s energy gain>, <p energy gain>; <s el-spec>, <py el-spec>, <pz el- spec>, <py* el-spec>, <pz* el-spec>, <s* el-spec>}+ (connects the AO specified by \cmd=2p=)
+ \item\lstinline+1sMO={<energy gain>/<energy loss>; <s el-spec>, <s* el-spec>}+ (connects the AO specified by \lstinline=1s=)
+ \item\lstinline+2sMO={<energy gain>/<energy loss>; <s el-spec>, <s* el-spec>}+ (connects the AO specified by \lstinline=2s=)
+ \item\lstinline+2pMO={<s energy gain>/<s energy loss>, <p energy gain>/<p energy loss>; <s el-spec>, <py el-spec>, <pz el- spec>, <py* el-spec>, <pz* el-spec>, <s* el-spec>}+ (connects the AO specified by \lstinline=2p=)
\end{itemize}
\end{framed}
Obviously the regarding AO must have been set in order to connect them. This for example won't work:
-\begin{lstlisting}
+\begin{lstlisting}[basicstyle = {\ttfamily\small}]
\begin{MOdiagram}
- \atom{left} { 1s = { 0; } }
- \atom{right}{ 1s = { 0; } }
- \molecule { 2sMO = {.75; , } }
+ \atom{left} { 1s = 0 }
+ \atom{right}{ 1s = 0 }
+ \molecule { 2sMO = .75 }
\end{MOdiagram}
\end{lstlisting}
-The value used in \cmd=<energy gain>= determines how many \si{\centi\metre} the bonding MO lies below the lower AO or how many \si{\centi\metre} the anti-bondung MO lies above the higher AO.
-%
+The value used in \lstinline=<energy gain>= determines how many \si{\centi\metre} the bonding MO lies below the lower AO or how many \si{\centi\metre} the anti-bondung MO lies above the higher AO.
+
\begin{LTXexample}[pos=b]
same level:
\begin{MOdiagram}
- \atom{left} { 1s = { 0; up} }
- \atom{right}{ 1s = { 0; up} }
- \molecule { 1sMO = {.75; pair, } }
+ \atom{left} { 1s = { 0; up } }
+ \atom{right}{ 1s = { 0; up } }
+ \molecule { 1sMO = {.75; pair } }
\end{MOdiagram}
different levels:
\begin{MOdiagram}
- \atom{left} { 1s = { 0; up} }
- \atom{right}{ 1s = { 1; up} }
- \molecule { 1sMO = {.25; pair, } }
+ \atom{left} { 1s = { 0; up } }
+ \atom{right}{ 1s = { 1; up } }
+ \molecule { 1sMO = {.25; pair } }
+ \end{MOdiagram}
+\end{LTXexample}
+\marginnote{NEW}If you specify \lstinline=<energy loss>=, you can create non-symmetrical splittings. Then, the first value (\lstinline=<energy gain>=) is used for the bonding MO and the second value (\lstinline=<energy loss>=) is used for the anti-bonding MO.
+\begin{LTXexample}[pos=b]
+ \begin{MOdiagram}
+ \atom{left} { 1s = { 0; up } }
+ \atom{right}{ 1s = { 0; up } }
+ \molecule { 1sMO = {.75/.25; pair } }
+ \end{MOdiagram}
+
+ \begin{MOdiagram}
+ \atom{left} { 1s = { 0; up } }
+ \atom{right}{ 1s = { 1; up } }
+ \molecule { 1sMO = {.25/.75; pair } }
\end{MOdiagram}
\end{LTXexample}
-%
-Please be aware, that you have to specify \emph{two} such values with \cmd=2pMO=: the splitting of the \textsigma\ orbitals and the splitting of the \textpi\ orbitals.
+Please be aware, that you have to specify \emph{two} such values or pairs with \lstinline=2pMO=: the splitting of the \textsigma\ orbitals and the splitting of the \textpi\ orbitals.
\begin{LTXexample}
\begin{MOdiagram}
- \atom{left} { 2p = { 0; up, up , } }
- \atom{right}{ 2p = { 1; up, up , } }
- \molecule { 2pMO = { 1.5, .75; pair, up, up , , , } }
+ \atom{left} { 2p = { 0; up, up } }
+ \atom{right}{ 2p = { 1; up, up } }
+ \molecule { 2pMO = { 1.5, .75; pair, up, up } }
\end{MOdiagram}
\end{LTXexample}
The complete MO diagram for triplett dioxygen now could look something like that:
-
\begin{LTXexample}
\begin{MOdiagram}
\atom{left}{
- 1s = {0;pair},
- 2s = {2;pair},
- 2p = {5;pair,up,up}
+ 1s, 2s, 2p = {;pair,up,up}
}
\atom{right}{
- 1s = {0;pair},
- 2s = {2;pair},
- 2p = {5;pair,up,up}
+ 1s, 2s, 2p = {;pair,up,up}
}
\molecule{
- 1sMO = {.5;pair,pair},
- 2sMO = {.5;pair,pair},
- 2pMO = {1.5,.5;pair,pair,pair,up,up,}
+ 1sMO, 2sMO, 2pMO = {;pair,pair,pair,up,up}
}
\end{MOdiagram}
\end{LTXexample}
-
+\newpage
\subsection{The Naming Scheme}\label{Namensgebung}
Since one wants to be able to put labels to the orbitals and since they are nodes in a tikzpicture, the internal naming scheme is important. It closely follows the function:
\begin{center}
-\begin{MOdiagram}[distance=6cm,AO-width=20pt,labels-fs=\tt\footnotesize]
+\begin{MOdiagram}[distance=6cm,AO-width=20pt,labels-fs=\tt\footnotesize,labels-style={yshift=10pt}]
\atom{left}{
- 1s={0;},
- 2s={2;},
- 2p={5;,,},
+ 1s=0,
+ 2s=2,
+ 2p=5,
label={ 1sleft={1sleft}, 2sleft={2sleft}, 2pxleft={2pxleft}, 2pyleft={2pyleft}, 2pzleft={2pzleft} }
}
\atom{right}{
- 1s={0;},
- 2s={2;},
- 2p={5;,,},
+ 1s=0,
+ 2s=2,
+ 2p=5,
label={ 1sright={1sright}, 2sright={2sright}, 2pxright={2pxright}, 2pyright={2pyright}, 2pzright={2pzright} }
}
\molecule{
- 1sMO={.5;,},
- 2sMO={.5;,},
- 2pMO={1.5,.5;,,,,,},
+ 1sMO=.5,
+ 2sMO=.5,
+ 2pMO={1.5,.5},
label={ 1sigma={1sigma}, 1sigma*={1sigma*}, 2sigma={2sigma}, 2sigma*={2sigma*}, 2psigma={2psigma}, 2psigma*={2psigma*}, 2piy={2piy}, 2piy*={2piy*}, 2piz={2piz}, 2piz*={2piz*} }
}
\end{MOdiagram}
\end{center}
With these names it is possible to reference the orbitals with the known \TikZ commands:
-
\begin{LTXexample}
\begin{MOdiagram}
- \atom{left} { 1s = {0; } }
- \atom{right}{ 1s = {0; } }
- \molecule { 1sMO = {.75; , } }
- \draw[<->,red,semithick] (1sigma) -- (1sigma*) ;
+ \atom{left} { 1s = 0 }
+ \atom{right}{ 1s = 0 }
+ \molecule { 1sMO = .75 }
+ \draw[<->,red,semithick] (1sigma.center) -- (1sigma*.center) ;
\draw[red] (1sigma*) ++ (2cm,.5cm) node {splitting} ;
\end{MOdiagram}
\end{LTXexample}
\begin{LTXexample}
\begin{MOdiagram}
- \atom{left} { 1s = {0; } }
- \atom{right}{ 1s = {0; } }
- \molecule { 1sMO = {.75; , } }
- \draw[draw=blue,fill=blue!20,opacity=.5] (1sigma*) circle (8pt);
+ \atom{left} { 1s = 0 }
+ \atom{right}{ 1s = 0 }
+ \molecule { 1sMO = .75 }
+ \draw[draw=blue,very thick,fill=blue!40,opacity=.5] (1sigma*) circle (8pt);
+ \draw[<-,shorten <=8pt,shorten >=15pt,blue] (1sigma*) --++(2,1) node {anti-bonding MO};
\end{MOdiagram}
\end{LTXexample}
-
-\subsection{Placing AO and MO Arbitrarily}
+\subsection{Placing AO and MO Arbitrarily}\label{ssec:AO_MO_irgendwo}
The standard orbitals are not always sufficient in order to draw a correct MO diagram. For example in the MO diagram of \ce{XeF2} one would need this part, that illustrates the interaction between the bonding and anti-bonding combination of two p orbitals of Flourine with one p orbital of Xenon:
-
\begin{center}
\begin{MOdiagram}[names]
- \atom[\lewis{0.,F}\hspace*{5mm}\lewis{4.,F}]{left}{}
- \atom[Xe]{right}{}
- \molecule[\ce{XeF2}]{}
- \AO[a](1cm){s}{0;up}
- \AO[b](1cm){s}{.25;up}
- \AO[c](3cm){s}{-1;pair}
- \AO[d](3cm){s}{0;pair}
- \AO[e](3cm){s}{1.5;}
- \AO[f](5cm){s}{1.25;pair}
- \connect{ a & d , b & c , b & e , c & f , e & f }
- \node[right,xshift=4mm] at (c) {\footnotesize bonding};
- \node[above] at (d.90) {\footnotesize not bonding};
- \node[above] at (e.90) {\footnotesize anti-bonding};
-\end{MOdiagram}
+ \atom[\lewis{0.,F}\hspace*{5mm}\lewis{4.,F}]{left}{1s=.2;up,up-el-pos={1sleft=.5}}
+ \atom[Xe]{right}{1s=1.25;pair}
+ \molecule[\ce{XeF2}]{1sMO={1/.25;pair}}
+ \AO(1cm){s}{0;up}
+ \AO(3cm){s}{0;pair}
+ \connect{ AO1 & AO2 }
+ \node[right,xshift=4mm] at (1sigma) {\footnotesize bonding};
+ \node[above] at (AO2.90) {\footnotesize non-bonding};
+ \node[above] at (1sigma*.90) {\footnotesize anti-bonding};
+ \end{MOdiagram}
\end{center}
To create diagrams like this there is the following command, which draws a single AO:
\begin{framed}
- \cmd=\AO[<name>](<xshift>){<type>}{<energy>;<el-spec>}=
+ \lstinline+\AO[<name>](<xshift>){<type>}[<key = val>]{<energy>;<el-spec>}+
\begin{itemize}\small
- \item\cmd=<name>= (o) name of the node
- \item\cmd=<xshift>= (o) vertical position of the Orbitals, a \TeX\ dimension.
- \item\cmd=<type>= (m) \cmd=s= or \cmd=p=
- \item\cmd=<AO-spec>= (m) specification of the AO
+ \item\lstinline=<name>= (o) name of the node; if not specified, \lstinline=|AO|#= is used where \lstinline=#= is a consecutive number.
+ \item\lstinline=<xshift>= (o) vertical position of the orbitals, a \TeX\ dimension.
+ \item\lstinline=<type>= (m) \lstinline=s= or \lstinline=p=
+ \item\lstinline+<key = val>+ (o) key/value pairs, with which the AO can be customized, see section \ref{ssec:AO_anpassen}.
+ \item\lstinline=<|AO|-spec>= (m) specification of the AO
\end{itemize}
\end{framed}
-Depending on the \cmd=<type>= one s or three p porbitals are drawn.
+\newpage
+Depending on the \lstinline=<type>= one s or three p orbitals are drawn.
\begin{LTXexample}
\begin{MOdiagram}
\AO{s}{0;}
@@ -374,72 +450,83 @@ Depending on the \cmd=<type>= one s or three p porbitals are drawn.
\end{MOdiagram}
\end{LTXexample}
-Please notice, that \cmd=<el-spec>= only awaits one specification with the type \cmd=s=, but three with the type \cmd=p=, separated with commas.
-
-If one wants to place such an AO at the position of an atom, one has to know their \cmd=<xshift>=. They have these predefined values (also see section \ref{orbital-positionen}):\label{xshift}
+If one wants to place such an AO at the position of an atom, one has to know their \lstinline=<xshift>=. They have predefined values (also see section \ref{orbital-positionen}):\label{xshift}
\begin{itemize}
\item atom left: \SI{1}{\centi\metre}
\item molecule: \SI{3}{\centi\metre}
\item atom right: \SI{5}{\centi\metre}
\end{itemize}
-
\begin{LTXexample}
\begin{MOdiagram}
- \atom{left} {1s={0;}}
- \atom{right}{1s={0;}}
- \molecule {1sMO={1;,}}
- \AO(1cm){s}{2;pair}
- \AO(3cm){s}{2;pair}
- \AO(5cm){s}{2;pair}
+ \atom{left} {1s=0}
+ \atom{right}{1s=0}
+ \molecule {1sMO=1}
+ \AO(1cm){s}{2}
+ \AO(3cm){s}{2}
+ \AO(5cm){s}{2}
\end{MOdiagram}
\end{LTXexample}
-
-Within the p orbitals there is an additional shift by \SI{20}{pt} per orbital. This is equivalent to a double shift by the length \cmd=AO-width= (see section \ref{option:AO-width}):
-
+Within the p orbitals there is an additional shift by \SI{20}{pt} per orbital. This is equivalent to a double shift by the length \lstinline=|AO|-width= (see section \ref{option:AO-width}):
\begin{LTXexample}
\begin{MOdiagram}
- \atom{left} {2p={0;,,}}
- \atom{right}{2p={0;,,}}
+ \atom{left} {2p=0}
+ \atom{right}{2p=0}
% above the left atom:
- \AO(1cm) {s}{ .5;pair}
+ \AO(1cm) {s}{ .5}
\AO(1cm-20pt){s}{ 1;up}
\AO(1cm-40pt){s}{1,5;down}
% above the right atom:
- \AO(5cm) {s}{ .5;pair}
+ \AO(5cm) {s}{ .5}
\AO(5cm+20pt){s}{ 1;up}
\AO(5cm+40pt){s}{1.5;down}
\end{MOdiagram}
\end{LTXexample}
-The AO created with \cmd=\AO= also can be connected. For this you can use the \TikZ command \cmd=\draw=, of course:
-
+The AO created with \lstinline=\AO= also can be connected. For this you can use the \TikZ command \lstinline=\draw= , of course. You can use the predefined node names \ldots
\begin{LTXexample}
\begin{MOdiagram}
- \AO[a]{s}{0;} \AO[b](2cm){s}{1;}
- \AO[c]{s}{2;} \AO[d](2cm){s}{1.5;}
- \draw (a) -- (b) (c) -- (d);
+ \AO{s}{0} \AO(2cm){s}{1}
+ \AO{s}{2} \AO(2cm){s}{1.5}
+ \draw[red] (AO1.0) -- (AO2.180) (AO3.0) -- (AO4.180);
+ \end{MOdiagram}
+\end{LTXexample}
+\ldots\ or use own node names
+\begin{LTXexample}
+ \begin{MOdiagram}
+ \AO[a]{s}{0} \AO[b](2cm){s}{1}
+ \AO[c]{s}{2} \AO[d](2cm){s}{1.5}
+ \draw[red] (a.0) -- (b.180) (c.0) -- (d.180);
+ \end{MOdiagram}
+\end{LTXexample}
+The predefined names are \lstinline=AO1=, \lstinline=AO2= \etc for the type \lstinline=s= and \lstinline=AO1x=, \lstinline=AO1y=, \lstinline=AO1z=, \lstinline=AO2x= \etc for the type \lstinline=p=. Nodes of the type \lstinline=p= get a \lstinline=x=, \lstinline=y= or a \lstinline=z= if you specify your own name, too.
+\begin{LTXexample}[pos=b]
+ \begin{MOdiagram}
+ \AO{p}{0}
+ \draw[<-,shorten >=5pt] (AO1y.-90) -- ++ (.5,-1) node {y};
+ \end{MOdiagram}
+ und
+ \begin{MOdiagram}
+ \AO[A]{p}{0}
+ \draw[<-,shorten >=5pt] (Ay.-90) -- ++ (.5,-1) node {y};
\end{MOdiagram}
\end{LTXexample}
-However, if you want the lines to be drawn in the same style as the ones created by \cmd=\molecule=\footnote{which can be customized, see page \pageref{option:lines}}, you should use the command \cmd=\connect=.
+However, if you want the lines to be drawn in the same style as the ones created by \lstinline=\molecule=\footnote{which can be customized, see page \pageref{option:lines}}, you should use the command \lstinline=\connect=.
\begin{framed}
- \cmd=\connect{<AO-connect>}=
+ \lstinline=\connect{<|AO-connect|>}=
\begin{itemize}\small
- \item\cmd=<AO-connect>= (m) comma separated list of node name pairs connected with \cmd=&=.
+ \item\lstinline=<|AO-connect|>= (m) comma separated list of node name pairs connected with \lstinline=&=
\end{itemize}
\end{framed}
-This command expects a comma separated list of node name pairs, that are to be connected. The names have to be connected with a \cmd=&=:
-
+This command expects a comma separated list of node name pairs, that are to be connected. The names have to be connected with a \lstinline=&=:
\begin{LTXexample}
\begin{MOdiagram}
- \AO[a]{s}{0;} \AO[b](2cm){s}{1;}
- \AO[c]{s}{2;} \AO[d](2cm){s}{1.5;}
- \connect{ a & b, c & d }
+ \AO{s}{0;} \AO(2cm){s}{1;}
+ \AO{s}{2;} \AO(2cm){s}{1.5;}
+ \connect{ AO1 & AO2, AO3 & AO4 }
\end{MOdiagram}
\end{LTXexample}
-
-Some things still need to be said: \cmd=\connect= adds the anchor \cmd=east= to the first name and the anchor \cmd=west= to the second one. This means a connection only makes sense from the left to the right. However, you can add own anchors using the usual \TikZ way:
-
+Some things still need to be said: \lstinline=\connect= adds the anchor \lstinline=east= to the first name and the anchor \lstinline=west= to the second one. This means a connection only makes sense from the left to the right. However, you can add own anchors using the usual \TikZ way:
\begin{LTXexample}
\begin{tikzpicture}
\draw (0,0) node (a) {a} ++ (1,0) node (b) {b}
@@ -448,233 +535,363 @@ Some things still need to be said: \cmd=\connect= adds the anchor \cmd=east= to
\end{tikzpicture}
\end{LTXexample}
-
\subsection{The Positioning Scheme}\label{orbital-positionen}
-The figure below shows the values of the $x$ coordinates of the orbitals, depending in the values of \cmd=<distance>= (\cmd=<dist>=) and \cmd=<AO-width>= (\cmd=<AO>=). In sections \ref{option:distance} and \ref{option:AO-width} these lengths and how they can be changed are discussed.
-
-\begin{MOdiagram}[distance=6cm,AO-width=25pt,labels-fs=\tt\footnotesize,labels-style={text width=40pt,align=center}]
+The figure below shows the values of the $x$ coordinates of the orbitals, depending in the values of \lstinline=<distance>= (\lstinline=<dist>=) and \lstinline=<|AO|-width>= (\lstinline=<|AO|>=). In sections \ref{option:distance} and \ref{option:AO-width} these lengths and how they can be changed are discussed.
+\begin{center}
+\begin{MOdiagram}[AO-width=22pt,labels-fs=\tt\scriptsize,labels-style={text width=40pt,align=center,yshift=11pt}]
\atom{left}{
- 1s={0;},
- 2s={3;},
- 2p={8;,,},
- label={ 1sleft={1cm}, 2sleft={1cm}, 2pxleft={1cm}, 2pyleft={1cm - 2*<AO>}, 2pzleft={1cm - 4*<AO>} } }
+ 1s=0,
+ 2s=2,
+ 2p=5.5,
+ label={ 1sleft={1cm}, 2sleft={1cm}, 2pxleft={1cm - 4*<AO>}, 2pyleft={1cm - 2*<AO>}, 2pzleft={1cm} } }
\atom{right}{
- 1s={0;},
- 2s={3;},
- 2p={8;,,},
+ 1s=0,
+ 2s=2,
+ 2p=5.5,
label={ 1sright={1cm + <dist>}, 2sright={1cm + <dist>}, 2pxright={1cm+ <dist>}, 2pyright={1cm + <dist> + 2*<AO>}, 2pzright={1cm + <dist> + 4*<AO>} } }
\molecule{
- 1sMO={.75;,},
- 2sMO={.75;,},
- 2pMO={3,1;,,,,,},
+ 1sMO=.5,
+ 2sMO=.5,
+ 2pMO={2,.75},
label={ 1sigma={.5*<dist> + 1cm}, 1sigma*={.5*<dist> + 1cm}, 2sigma={.5*<dist> + 1cm}, 2sigma*={.5*<dist> + 1cm}, 2psigma={.5*<dist> + 1cm}, 2psigma*={.5*<dist> + 1cm}, 2piy={.5*<dist> + 1cm - <AO>}, 2piy*={.5*<dist> + 1cm - <AO>}, 2piz={.5*<dist> + 1cm + <AO>}, 2piz*={.5*<dist> + 1cm + <AO>} }
}
\end{MOdiagram}
+\end{center}
+\newpage
+\subsection{Default Values}
+\marginnote*{NEW}If you leave the arguments (or better: values) for the specification of the AO or MO empty or omit them, default values are used. The table below shows you, which ones.
+\begin{center}\small
+\begin{tabular}{l>{\ttfamily}l>{\ttfamily}l>{\ttfamily}l}
+ \toprule & \normalfont\bfseries AO / MO & \normalfont\bfseries omitted & \normalfont\bfseries empty \\\midrule
+ syntax: & & 1s & 1s= \\\midrule
+ & 1s & \{0;pair\} & \{0;\} \\
+ & 2s & \{2;pair\} & \{2;\} \\
+ & 2p & \{5;pair,pair,pair\} & \{5;,,\} \\\midrule
+ & 1sMO & \{.5;pair,pair\} & \{.5;,\} \\
+ & 2sMO & \{.5;pair,pair\} & \{.5;,\} \\
+ & 2pMO & \{1.5,.5;pair,pair,pair,pair,pair,pair\} & \{1.5,.5;,,,,,\} \\\bottomrule
+\end{tabular}
+\end{center}
+This is similar for the \lstinline=\AO= command (page \pageref{ssec:AO_MO_irgendwo}); It needs a value for \lstinline=<energy>=, though.
+\begin{center}\small
+\begin{tabular}{>{\ttfamily}l>{\ttfamily}l>{\ttfamily}l}
+ \toprule\bfseries <type> & \bfseries <el-spec> \\\midrule
+ s & pair \\
+ p & pair,pair,pair \\\bottomrule
+\end{tabular}
+\end{center}
+Compare these examples:
+\begin{LTXexample}
+ \begin{MOdiagram}
+ \atom{left} { 1s={0;pair} }
+ \atom{right}{ 1s }
+ \end{MOdiagram}
+
+ \hrulefill
+
+ \begin{MOdiagram}
+ \atom{left}{ 1s=1 }
+ \atom{right}{ 1s= }
+ \end{MOdiagram}
+\end{LTXexample}
\section{Customization}
-\subsection{Environment Options}
+Th options of the section \ref{ssec:umgebungs_optionen} can be set global as package option, \ie with \lstinline+\usepackage[<key = val>]{modiagram}+, or via the setup command \lstinline+\MOsetup{<key = val>}+.
+
+\subsection{Environment Options}\label{ssec:umgebungs_optionen}
There are some options with which the layout of the MO diagrams can be changed:
\begin{itemize}
- \item\cmd+style=<type>+ change the style of the orbitals and the connecting lines, section \ref{option:style}.
- \item\cmd+distance=<dim>+ distance betwen left and right atom, section \ref{option:distance}.
- \item\cmd+AO-width=<dim>+ change the width of orbitals, section \ref{option:AO-width}.
- \item\cmd+lines=<tikz>+ change the \TikZ style of the connecting lines, section \ref{option:lines}.
- \item\cmd+names=<bool>+ add captions to the atoms and the molecule, section \ref{option:names}.
- \item\cmd+labels=<bool>+ add default labels to the orbitals, section \ref{option:labels}.
- \item\cmd+labels-fs=<cs>+ change the font size of the labels, section \ref{option:labels-fs}.
- \item\cmd+labels-style=<tikz>+ change the \TikZ style of the labels, section \ref{option:labels-style}.
+ \item\lstinline+style=<type>+ change the style of the orbitals and the connecting lines, section \ref{option:style}.
+ \item\lstinline+distance=<dim>+ distance betwen left and right atom, section \ref{option:distance}.
+ \item\lstinline+|AO|-width=<dim>+ change the width of orbitals, section \ref{option:AO-width}.
+ \item\lstinline+el-sep=<num>+ distance between the electron pair arrows, section \ref{option:electrons}.
+ \item\lstinline+up-el-pos=<num>+ position of the spin-up arrow, section \ref{option:electrons}.
+ \item\lstinline+down-el-pos=<num>+ position of the spin-down arrow, section \ref{option:electrons}.
+ \item\lstinline+lines=<tikz>+ change the \TikZ style of the connecting lines, section \ref{option:lines}.
+ \item\lstinline+names=<bool>+ add captions to the atoms and the molecule, section \ref{option:names}.
+ \item\lstinline+names-style=<tikz>+ change the \TikZ style of the captions, section \ref{option:names_style}.
+ \item\lstinline+names-style-add=<tikz>+ change the \TikZ style of the captions, section \ref{option:names_style}.
+ \item\lstinline+labels=<bool>+ add default labels to the orbitals, section \ref{option:labels}.
+ \item\lstinline+labels-fs=<cs>+ change the font size of the labels, section \ref{option:labels-fs}.
+ \item\lstinline+labels-style=<tikz>+ change the \TikZ style of the labels, section \ref{option:labels-style}.
\end{itemize}
-They all are discussed in the following sections. They are used either as option of the environment
+They all are discussed in the following sections. If they're used as options for the environment, they'r set locally and only change that environment.
\begin{lstlisting}
\begin{MOdiagram}[<key = value>]
...
\end{MOdiagram}
\end{lstlisting}
-or as argument of the setup command
-\begin{framed}
- \cmd+\MOsetup{<key = value>}+
- \begin{itemize}\small
- \item\cmd+<key = val>+ (m) comma separated key/value list
- \end{itemize}
-\end{framed}
\subsubsection{Option \texttt{style}}\label{option:style}
-There are four different styles, which can be chosen.
+There are five different styles, which can be chosen.
\begin{itemize}
- \item\cmd+style=plain+ \AOinline[style=plain]{pair} (default)
- \item\cmd+style=square+ \AOinline[style=square]{pair}
- \item\cmd+style=round+ \AOinline[style=round]{pair}
- \item\cmd+style=fancy+ \AOinline[style=fancy]{pair}
+ \item\lstinline+style=plain+ \AOinline[style=plain]{pair} (default)
+ \item\lstinline+style=square+ \AOinline[style=square]{pair}
+ \item\lstinline+style=circle+ \AOinline[style=circle]{pair}
+ \item\lstinline+style=round+ \AOinline[style=round]{pair}
+ \item\lstinline+style=fancy+ \AOinline[style=fancy]{pair}
\end{itemize}
Let's take the MO diagram of \ce{H2} to illustrate the different styles:
-
\begin{LTXexample}
- % use package 'mhchem'
- \begin{MOdiagram}[style=plain]% Default
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ % use package `mhchem'
+ \begin{MOdiagram}[style=plain]% default
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[style=square]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
+\marginnote*{NEW}\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[style=circle]
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[style=round]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[style=fancy]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
-
\subsubsection{Option \texttt{distance}}\label{option:distance}
-Depending on labels and captions the \SI{4}{\centi\metre} by which the right and left atom are separated can be too small. With \cmd+distance=<dim>+ the length can be adjusted. With this, the position of the right atom is changed to \cmd=1cm + <dim>= and the position of the molecule is changed to \cmd=0.5*(1cm + <dim>)=, also see page Seite \pageref{xshift} and section \ref{orbital-positionen}.
-
+Depending on labels and captions the \SI{4}{\centi\metre} by which the right and left atom are separated can be too small. With \lstinline+distance=<dim>+ he length can be adjusted. With this, the position of the right atom is changed to \lstinline=1cm + <dim>= and the position of the molecule is changed to \lstinline=0.5*(1cm + <dim>)=, also see page \pageref{xshift} and section \ref{orbital-positionen}.
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[distance=6cm]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
-
\subsubsection{Option \texttt{AO-width}}\label{option:AO-width}
-The length \cmd=AO-width= sets the length of the horizontal line in a orbital displayed with the \cmd=plain= style. It's default value is \SI{10}{pt}.
-
+The length \lstinline=|AO|-width= sets the length of the horizontal line in a orbital displayed with the \lstinline=plain= style. It's default value is \SI{10}{pt}.
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[AO-width=15pt]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[style=fancy,AO-width=15pt]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
+By changing the value of \lstinline=|AO|-width= the positions of the p and the \textpi\ orbitals also change, see section \ref{orbital-positionen}.
-By changing the value of \cmd=AO-width= the positions of the p and the \textpi\ orbitals also change, see section \ref{orbital-positionen}.
+\subsubsection{Optionen \texttt{el-sep}, \texttt{up-el-pos} und \texttt{down-el-pos}}\label{option:electrons}
+\marginnote*{NEW}These three options change the horizontal positions of the arrows representing the electrons in a AO/MO. The option \lstinline+el-sep=<num>+ needs a value between \lstinline=0= and \lstinline=1=. \lstinline=0= means \emph{no} distance between the arrows and \lstinline=1= \emph{full} distance (with respect to the langth \lstinline=|AO|-width=, see section \ref{option:AO-width}).
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[el-sep=.2]% default
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[el-sep=0]
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[el-sep=1]
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
+The options \lstinline+up-el-pos=<num>+ and \lstinline+down-el-pos=<num>+ can be used alternatively to place the spin-up and spin-down electron, respectively. Again they need values between \lstinline=0= and \lstinline=1=. This time \lstinline=0= means \emph{on the left} and \lstinline=1= means \emph{on the right}
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[up-el-pos=.4,down-el-pos=.6]% default
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[up-el-pos=.333,down-el-pos=.667]
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[up-el-pos=.7,down-el-pos=.3]
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
\subsubsection{Option \texttt{lines}}\label{option:lines}
-The option \cmd=lines= can be used to modify the \TikZ style of the connecting lines:
-
+The option \lstinline=lines= can be used to modify the \TikZ style of the connecting lines:
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[lines={gray,thin}]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
-
\subsubsection{Option \texttt{names}}\label{option:names}
-If you use the option \cmd=names=, the atoms and the molecule get captions, if you have used the optional \cmd=<name>= argument of \cmd=\atom= and/or \cmd=\molecule=.
-
+If you use the option \lstinline=names=, the atoms and the molecule get captions, if you have used the optional \lstinline=<name>= argument of \lstinline=\atom= and/or \lstinline=\molecule=.
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[names]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
+\subsubsection{Oprionen \texttt{names-style} und \texttt{names-style-add}}\label{option:names_style}
+\marginnote*{NEW}These options enable to customize the style of the captions of the atoms and of the molecule. By default this setting is used: \lstinline+\names-style={anchor=base}+\footnote{Please see "`\TikZ und PGF -- Manual for Version 2.10"' p.\,183 section 16.4.4 (pgfmanual.pdf) for the meaning}.
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[names,names-style={draw=blue}]
+ \atom[p]{left} { 1s = {;up} }
+ \atom[b]{right}{ 1s = {;up} }
+ \molecule[\ce{X2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
+With this the default setting is overwritten. As you can see, this destroys the vertical alignment of the nodes. In order to avoid that you can for example specify \lstinline=text height= and \lstinline=text depth= yourself \ldots
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[names,names-style={text height=1.5ex, text depth=.25ex, draw=blue}]
+ \atom[p]{left} { 1s = {;up} }
+ \atom[b]{right}{ 1s = {;up} }
+ \molecule[\ce{X2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
+\ldots, add the \lstinline=anchor= again \ldots
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[names,names-style={anchor=base, draw=blue}]
+ \atom[p]{left} { 1s = {;up} }
+ \atom[b]{right}{ 1s = {;up} }
+ \molecule[\ce{X2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
+\ldots\ or use the option \lstinline=names-style-add=. It doesn't overwrite the current setting, but appends the new declaration:
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[names,names-style-add={draw=blue}]
+ \atom[p]{left} { 1s = {;up} }
+ \atom[b]{right}{ 1s = {;up} }
+ \molecule[\ce{X2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
+\begin{LTXexample}[pos=b]
+ \MOsetup{names,names-style={text height=2.5ex,text depth=.5ex,draw=blue!80,rounded corners}}
+ \begin{MOdiagram}
+ \atom[p]{left} { 1s = {;up} }
+ \atom[b]{right}{ 1s = {;up} }
+ \molecule[\ce{X2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+ \begin{MOdiagram}[names-style-add={fill=blue!20}]
+ \atom[p]{left} { 1s = {;up} }
+ \atom[b]{right}{ 1s = {;up} }
+ \molecule[\ce{X2}]{ 1sMO = {.75;pair} }
+ \end{MOdiagram}
+\end{LTXexample}
\subsubsection{Option \texttt{labels}}\label{option:labels}
-If you use the option \cmd=labels=, predefined labels are written below the orbitals. These labels can be changed, see section \ref{key:label}.
-
+If you use the option \lstinline=labels=, predefined labels are written below the orbitals. These labels can be changed, see section \ref{key:label}.
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[labels]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
-
\subsubsection{Option \texttt{labels-fs}}\label{option:labels-fs}
-Labels are set with the font size \cmd=\small=. If you want to change that, you can use the option \cmd=labels-fs=.
-
+Labels are set with the font size \lstinline=\small=. If you want to change that, you can use the option \lstinline=labels-fs=.
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[labels,labels-fs=\footnotesize]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
-
This also allows you to change the font style or font shape of the labels.
-
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[labels,labels-fs=\sffamily\footnotesize]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
-
\subsubsection{Option \texttt{labels-style}}\label{option:labels-style}
-The option \cmd=labels-style= changes the \TikZ style of the nodes, within which the labels are written.
-
+The option \lstinline=labels-style= changes the \TikZ style of the nodes, within which the labels are written.
\begin{LTXexample}
- % use package 'mhchem'
- \begin{MOdiagram}[labels,labels-style={blue}]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
- \molecule[\ce{H2}]{ 1sMO = {.75;pair,} }
+ % use package `mhchem'
+ \begin{MOdiagram}[labels,labels-style={blue,yshift=4pt}]
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{ 1sMO = {.75;pair} }
\end{MOdiagram}
\end{LTXexample}
-
\subsection{\texttt{\textbackslash atom} and \texttt{\textbackslash molecule} Specific Customizations}
\subsubsection{The \texttt{label} Key}\label{key:label}
-If you don't want to use the predefined labels, change single labels or use only one or two labels, you can use the key \cmd=label=. This key is used in the \cmd=\atom= and \cmd=\molecule= commands in the \cmd=<AO-spec>= or \cmd=<MO-spec>= argument, respectively. The key awaits a comma separated key/value list. The names mentioned in section \ref{Namensgebung} are used as keys to specify the AO, that you want to label.
-
+If you don't want to use the predefined labels, change single labels or use only one or two labels, you can use the key \lstinline=label=. This key is used in the \lstinline=\atom= and \lstinline=\molecule= commands in the \lstinline=<|AO|-spec>= or \lstinline=<MO-spec>= argument, respectively. The key awaits a comma separated key/value list. The names mentioned in section \ref{Namensgebung} are used as keys to specify the AO, that you want to label.
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[labels-fs=\footnotesize]
- \atom[H]{left} { 1s = {0;up} }
- \atom[H]{right}{ 1s = {0;up} }
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
\molecule[\ce{H2}]{
- 1sMO = {.75;pair,},
+ 1sMO = {.75;pair},
label = { 1sigma = {bonding MO} }
}
\end{MOdiagram}
\end{LTXexample}
\begin{LTXexample}
\begin{MOdiagram}[style=square,distance=6cm]
- \atom{left} { 1s = {0;up} }
- \atom{right}{ 1s = {0;up} }
+ \atom{left} { 1s = {;up} }
+ \atom{right}{ 1s = {;up} }
\molecule{
- 1sMO = {.75;pair,} ,
+ 1sMO = {.75;pair} ,
label = {
1sigma = $\sigma$,
1sigma* = $\sigma^*$
@@ -685,95 +902,158 @@ If you don't want to use the predefined labels, change single labels or use only
\end{MOdiagram}
\end{LTXexample}
+If the key is used together with the \lstinline=labels= option (page \pageref{option:labels}), single labels are overwritten:
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}[labels]
+ \atom[H]{left} { 1s = {;up} }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{
+ 1sMO = {.75;pair},
+ label = { 1sigma = \textcolor{red}{??} }
+ }
+ \end{MOdiagram}
+\end{LTXexample}
\subsubsection{The \texttt{color} Key}\label{key:color}
-Analogous to the \cmd=label= key the \cmd=color= key can be used to display coloured electrons:
-
+Analogous to the \lstinline=label= key the \lstinline=color= key can be used to display coloured electrons:
\begin{LTXexample}
- % use package 'mhchem'
+ % use package `mhchem'
\begin{MOdiagram}[labels-fs=\footnotesize]
\atom[H]{left}{
- 1s = {0;pair},
- color = { 1sleft = blue }
+ 1s, color = { 1sleft = blue }
}
\atom[H]{right}{
- 1s = {0;pair},
- color = { 1sright = red }
+ 1s, color = { 1sright = red }
}
\molecule[\ce{H2}]{
- 1sMO = {.75;pair,pair},
+ 1sMO,
label = { 1sigma = {bonding MO} },
color = { 1sigma = green, 1sigma* = cyan }
}
\end{MOdiagram}
\end{LTXexample}
+\newpage
+\subsubsection{The \texttt{up-el-pos} and \texttt{down-el-pos} keys}\label{key:electrons}
+\marginnote*{NEW}The keys \lstinline=up-el-pos= and \lstinline=down-el-pos= allow it to shift the arrows representing the electrons in a single AO or MO individually. You need to use values between \lstinline=0= and \lstinline=1=, also see section \ref{option:electrons}.
+\begin{LTXexample}
+ % use package `mhchem'
+ \begin{MOdiagram}
+ \atom[H]{left}{
+ 1s = {;up},
+ up-el-pos = { 1sleft=.5 }
+ }
+ \atom[H]{right}{ 1s = {;up} }
+ \molecule[\ce{H2}]{
+ 1sMO = {.75;pair} ,
+ up-el-pos = { 1sigma=.15 } ,
+ down-el-pos = { 1sigma=.85 }
+ }
+ \end{MOdiagram}
+\end{LTXexample}
+
+\subsection{\texttt{\textbackslash AO} Specific Customizations}\label{ssec:AO_anpassen}
+\marginnote*{NEW}These keys enable to customize orbitals created with \lstinline=\AO=.
+
+\subsubsection{The \texttt{label} Key}\label{key:AO_label}
+The key \lstinline=label[x/y/z]= allows you to put a label to the AO/MO. If you use the type \lstinline=p=, you can specify the orbital you want to label in square brackets:
+\begin{LTXexample}
+ \begin{MOdiagram}[style=square]
+ \AO{s}[label={s orbital}]{0}
+ \AO{p}[label[y]=py,label[z]=pz]{1.5}
+ \end{MOdiagram}
+\end{LTXexample}
+
+\subsubsection{The \texttt{color} Key}\label{key:AO_color}
+Analogous to the \lstinline=label= key there is the key \lstinline=color[x/y/z]=, which enables you to choose a color for the electrons. If you use the type \lstinline=p=, you can specify the orbital in square brackets:
+\begin{LTXexample}
+ \begin{MOdiagram}[style=square]
+ \AO{s}[color=red]{0}
+ \AO{p}[color[y]=green,color[z]=cyan]{1.5}
+ \end{MOdiagram}
+\end{LTXexample}
+
+\subsubsection{The \texttt{up-el-pos} and \texttt{down-el-pos} Keys}\label{key:AO_electrons}
+Then there are the keys \lstinline=up-el-pos[x/y/z]= and \lstinline=down-el-pos[x/y/z]=, with which the electrons can be shifted horizontally. You can use values between \lstinline=0= and \lstinline=1=, also see section \ref{option:electrons}. If you use the type \lstinline=p=, you can specify the orbital in square brackets:
+\begin{LTXexample}
+ \begin{MOdiagram}[style=square]
+ \AO{s}[up-el-pos=.15]{0}
+ \AO{p}[up-el-pos[y]=.15,down-el-pos[z]=.15]{1.5}
+ \end{MOdiagram}
+\end{LTXexample}
\subsection{Energy Axis}
-Last but not least one might want to add an energy axis to the diagram. For this there is the command \cmd=\EnergyAxis=.
+Last but not least one might want to add an energy axis to the diagram. For this there is the command \lstinline=\EnergyAxis=
\begin{framed}
- \cmd+\EnergyAxis[<key = val>]+
+ \lstinline+\EnergyAxis[<key = val>]+
\begin{itemize}\small
- \item\cmd+<key = val>+ (o) key/value pairs to modify the axis
+ \item\lstinline+<key = val>+ (o) ey/value pairs to modify the axis
\end{itemize}
\end{framed}
-
\begin{LTXexample}
\begin{MOdiagram}
- \atom{left} { 1s = {0;up} }
- \atom{right}{ 1s = {0;up} }
- \molecule{ 1sMO = {.75;pair,} }
+ \atom{left} { 1s = {;up} }
+ \atom{right}{ 1s = {;up} }
+ \molecule{ 1sMO = {.75;pair} }
\EnergyAxis
\end{MOdiagram}
\end{LTXexample}
-
-For the time beeing there are two keys to modify the axis.
+For the time being there are two keys to modify the axis.
\begin{framed}
\begin{itemize}
- \item\cmd+title=<title>+ axis label (default: \cmd=energy=).
- \item\cmd+head=<tikz-arrow-head>+ arrow head; you can use the arrow heads specified in the \TikZ library \paket{arrows} (pgfmanual v2.10 pages 256ff.) (default: \cmd=>=).
+ \item\lstinline+title=<title>+ axis label (default: \lstinline=energy=).
+ \item\lstinline+head=<tikz-arrow-head>+ arrow head; you can use the arrow heads specified in the \TikZ library \paket{arrows} (pgfmanual v2.10 pages 256ff.) (default: \lstinline=>=).
\end{itemize}
\end{framed}
-
\begin{LTXexample}
\begin{MOdiagram}
- \atom{left} { 1s = {0;up} }
- \atom{right}{ 1s = {0;up} }
- \molecule{ 1sMO = {.75;pair,} }
+ \atom{left} { 1s = {;up} }
+ \atom{right}{ 1s = {;up} }
+ \molecule{ 1sMO = {.75;pair} }
\EnergyAxis[title]
\end{MOdiagram}
\end{LTXexample}
\begin{LTXexample}
\begin{MOdiagram}
- \atom{left} { 1s = {0;up} }
- \atom{right}{ 1s = {0;up} }
- \molecule{ 1sMO = {.75;pair,} }
+ \atom{left} { 1s = {;up} }
+ \atom{right}{ 1s = {;up} }
+ \molecule{ 1sMO = {.75;pair} }
\EnergyAxis[title=E,head=stealth]
\end{MOdiagram}
\end{LTXexample}
+\newpage
+\section{Examples}
+The example from the beginning of section \ref{ssec:AO_MO_irgendwo}.
+\begin{LTXexample}
+ % use packages `mhchem' and `chemfig'
+ \begin{MOdiagram}[names]
+ \atom[\lewis{0.,F}\hspace*{5mm}\lewis{4.,F}]{left}{1s=.2;up,up-el-pos={1sleft=.5}}
+ \atom[Xe]{right}{1s=1.25;pair}
+ \molecule[\ce{XeF2}]{1sMO={1/.25;pair}}
+ \AO(1cm){s}{0;up}
+ \AO(3cm){s}{0;pair}
+ \connect{ AO1 & AO2 }
+ \node[right,xshift=4mm] at (1sigma) {\footnotesize bonding};
+ \node[above] at (AO2.90) {\footnotesize non-bonding};
+ \node[above] at (1sigma*.90) {\footnotesize anti-bonding};
+ \end{MOdiagram}
+\end{LTXexample}
-\subsection{Examples}
-%
\begin{LTXexample}[pos=b]
- % use packages 'mhchem' (and 'textgreek' loaded by 'MOdiagram')
+ % use packages `mhchem' (and `textgreek' loaded by `MOdiagram')
\begin{figure}
\centering
\begin{MOdiagram}[style=square,labels,names,AO-width=8pt,labels-fs=\footnotesize]
\atom[\ce{O_a}]{left}{
- 1s = {0;pair},
- 2s = {2;pair},
- 2p = {5;pair,up,up}
+ 1s, 2s, 2p = {;pair,up,up}
}
\atom[\ce{O_b}]{right}{
- 1s = {0;pair},
- 2s = {2;pair},
- 2p = {5;pair,up,up}
+ 1s, 2s, 2p = {;pair,up,up}
}
\molecule[\ce{O2}]{
- 1sMO = {.5;pair,pair},
- 2sMO = {.5;pair,pair},
- 2pMO = {1.5,.5;pair,pair,pair,up,up,},
+ 1sMO, 2sMO, 2pMO = {;pair,pair,pair,up,up},
color = { 2piy*=red, 2piz*=red }
}
\EnergyAxis
@@ -781,11 +1061,12 @@ For the time beeing there are two keys to modify the axis.
\caption{MO diagram of $^3$\textSigma-\ce{O2}.}
\end{figure}
\end{LTXexample}
+
\begin{LTXexample}[pos=b]
- % use package 'chemfig'
+ % use package `chemfig'
\begin{figure}
- \centering
- \begin{MOdiagram}[style=fancy,distance=7cm,AO-width=15pt,labels]
+ \centering\MOsetup{style = fancy, distance = 7cm, AO-width = 15pt, labels}
+ \begin{MOdiagram}
\atom[N]{left}{
2p = {0;up,up,up}
}
@@ -793,14 +1074,13 @@ For the time beeing there are two keys to modify the axis.
2p = {2;pair,up,up}
}
\molecule[NO]{
- 2pMO = {1.8,.4;pair,pair,pair,up,,},
+ 2pMO = {1.8,.4;pair,pair,pair,up},
color = { 2piy*=red }
}
- \EnergyAxis[title]
+ \EnergyAxis
\end{MOdiagram}
\caption{Part of the MO diagram of \protect\Lewis{4.,NO}.}
\end{figure}
\end{LTXexample}
-%
\end{document} \ No newline at end of file
diff --git a/Master/texmf-dist/tex/latex/modiagram/modiagram.sty b/Master/texmf-dist/tex/latex/modiagram/modiagram.sty
index d3db03f942b..764eee8f50f 100644
--- a/Master/texmf-dist/tex/latex/modiagram/modiagram.sty
+++ b/Master/texmf-dist/tex/latex/modiagram/modiagram.sty
@@ -4,7 +4,7 @@
% - easy creation of molecular orbital diagrams - %
% --------------------------------------------------------------------------- %
% - Clemens Niederberger - %
-% - 2011/09/25 - %
+% - 2011/10/27 - %
% --------------------------------------------------------------------------- %
% - http://www.mychemistry.eu/ - %
% - contact@mychemistry.eu - %
@@ -29,9 +29,9 @@
% - This work consists of the files modiagram.sty, modiagram_doc_de.tex, - %
% - modiagram_doc_de.tex, README - %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\RequirePackage{ expl3 , xparse , l3keys2e , tikz , textgreek , amsmath }
+\RequirePackage{ expl3 , xparse , l3keys2e , tikz , textgreek }
\usetikzlibrary{calc,arrows}
-\ProvidesExplPackage {modiagram} {2011/09/25} {0.1} {easy creation of molecular orbital diagrams}
+\ProvidesExplPackage {modiagram} {2011/10/27} {0.2} {easy creation of molecular orbital diagrams}
% --------------------------------------------------------------------------- %
% error messages
@@ -47,12 +47,23 @@
#1~ \msg_line_context: .
}
+\msg_set:nnn { MOdiagram } { electron-placement }
+ {
+ The~value~for~the~electron~placement~must~be~between~0~and~1~
+ \msg_line_context: .
+ }
+
% --------------------------------------------------------------------------- %
% main environment
\NewDocumentEnvironment { MOdiagram } { o g }
{
+ \cs_set_eq:NN \atom \MOdiagram_atom:
+ \cs_set_eq:NN \molecule \MOdiagram_molecule:
+ \cs_set_eq:NN \AO \MOdiagram_arbitrary_AO:
+ \cs_set_eq:NN \EnergyAxis \MOdiagram_EnergyAxis:
\dim_gzero:N \g_MOdiagram_min_energy_dim
\dim_gzero:N \g_MOdiagram_max_energy_dim
+ \int_gzero:N \g_MOdiagram_AO_name_int
\IfNoValueF { #1 } { \keys_set:nn { MOdiagram / diagram } { #1 } }
\MOdiagram_set_labels:
\MOdiagram_tikzpicture:n { }
@@ -60,38 +71,42 @@
{
\bool_if:NT \l_MOdiagram_names_bool
{
- \MOdiagram_node:n { below }
+ \MOdiagram_node:f { \tl_use:N \l_MOdiagram_names_style_tl }
at
(
\l_MOdiagram_left_atom_position_dim ,
\g_MOdiagram_min_energy_dim - 1cm
)
- { \smash[b] { \tl_use:N \l_MOdiagram_atom_left_name_tl } } ;
- \MOdiagram_node:n { below }
+ { \tl_use:N \l_MOdiagram_atom_left_name_tl } ;
+ \MOdiagram_node:f { \tl_use:N \l_MOdiagram_names_style_tl }
at
(
\l_MOdiagram_molecule_position_dim ,
\g_MOdiagram_min_energy_dim - 1cm
)
- { \smash[b] { \tl_use:N \l_MOdiagram_molecule_name_tl } } ;
- \MOdiagram_node:n { below }
+ { \tl_use:N \l_MOdiagram_molecule_name_tl } ;
+ \MOdiagram_node:f { \tl_use:N \l_MOdiagram_names_style_tl }
at
(
\l_MOdiagram_left_atom_position_dim
+ \l_MOdiagram_inter_atom_distance_dim ,
\g_MOdiagram_min_energy_dim - 1cm
)
- { \smash[b] { \tl_use:N \l_MOdiagram_atom_right_name_tl } } ;
+ { \tl_use:N \l_MOdiagram_atom_right_name_tl } ;
}
\endtikzpicture
}
\bool_new:N \l_MOdiagram_AO_square_bool
\bool_new:N \l_MOdiagram_AO_round_bool
+\bool_new:N \l_MOdiagram_AO_circle_bool
\bool_new:N \l_MOdiagram_AO_fancy_bool
\bool_new:N \l_MOdiagram_AO_labels_bool
\bool_new:N \l_MOdiagram_names_bool
+\tl_new:N \l_MOdiagram_names_style_tl
+\tl_set:Nn \l_MOdiagram_names_style_tl { anchor=base }
+
\tl_new:N \l_MOdiagram_lines_tl
\tl_set:Nn \l_MOdiagram_lines_tl { dotted }
@@ -101,6 +116,11 @@
\dim_new:N \l_MOdiagram_AO_width_dim
\dim_set:Nn \l_MOdiagram_AO_width_dim { 10pt }
+\tl_new:N \l_MOdiagram_AO_up_electron_tl
+\tl_set:Nn \l_MOdiagram_AO_up_electron_tl { .4 }
+\tl_new:N \l_MOdiagram_AO_down_electron_tl
+\tl_set:Nn \l_MOdiagram_AO_down_electron_tl { .6 }
+
\dim_new:N \l_MOdiagram_left_atom_position_dim
\dim_set:Nn \l_MOdiagram_left_atom_position_dim { 1cm }
\dim_new:N \l_MOdiagram_inter_atom_distance_dim
@@ -110,6 +130,10 @@
\dim_new:N \g_MOdiagram_min_energy_dim
\dim_new:N \g_MOdiagram_max_energy_dim
+\dim_new:N \l_MOdiagram_energy_gain_dim
+\dim_new:N \l_MOdiagram_energy_loss_dim
+
+% detect lowest and highest orbital so we can draw the appropriate energy axis:
\cs_new_nopar:Npn \MOdiagram_energy_range:N #1
{
\dim_set:Nn \l_tmpa_dim { #1 }
@@ -120,6 +144,56 @@
}
\cs_generate_variant:Nn \MOdiagram_energy_range:N { n }
+% split energy levels for creating the MO; we need to detect wether the left
+% or the right AO is the lower or higher one, respectively
+\cs_if_free:NT \dim_compare:cNcTF { \cs_generate_variant:Nn \dim_compare:nNnTF { cNcTF } }
+
+\cs_new_nopar:Npn \MOdiagram_split_energy:NNN #1#2#3
+ {
+ \dim_compare:cNcTF { l_MOdiagram_atom_left_#1_dim } < { l_MOdiagram_atom_right_#1_dim }
+ {
+ \dim_set_eq:Nc \l_MOdiagram_energy_gain_dim { l_MOdiagram_atom_left_#1_dim }
+ \dim_sub:Nn \l_MOdiagram_energy_gain_dim { #2 }
+ \dim_set_eq:Nc \l_MOdiagram_energy_loss_dim { l_MOdiagram_atom_right_#1_dim }
+ \dim_add:Nn \l_MOdiagram_energy_loss_dim { #3 }
+ }
+ {
+ \dim_set_eq:Nc \l_MOdiagram_energy_gain_dim { l_MOdiagram_atom_right_#1_dim }
+ \dim_sub:Nn \l_MOdiagram_energy_gain_dim { #2 }
+ \dim_set_eq:Nc \l_MOdiagram_energy_loss_dim { l_MOdiagram_atom_left_#1_dim }
+ \dim_add:Nn \l_MOdiagram_energy_loss_dim { #3 }
+ }
+ }
+\cs_generate_variant:Nn \MOdiagram_split_energy:NNN { nNN }
+
+% position the spin-up/spin-down el:
+\cs_new_nopar:Npn \MOdiagram_AO_place_electron:nn #1#2
+ {
+ \fp_set:Nn \l_tmpa_tl { #2 }
+ \fp_compare:nNnT { \l_tmpa_tl } < { 0 }
+ { \msg_error:nn { MOdiagram } { electron-placement } }
+ \fp_abs:N \l_tmpa_tl
+ \fp_compare:nNnT { \l_tmpa_tl } > { 1 }
+ { \msg_error:nn { MOdiagram } { electron-placement } }
+ \bool_if:nTF { #1 }
+ { \tl_set:Nn \l_MOdiagram_AO_down_electron_tl { #2 } }
+ { \tl_set:Nn \l_MOdiagram_AO_up_electron_tl { #2 } }
+ }
+\cs_generate_variant:Nn \MOdiagram_AO_place_electron:nn { nx }
+
+\cs_new_nopar:Npn \MOdiagram_AO_place_electrons:n #1
+ {
+ \fp_set:Nn \l_tmpa_tl { 1 }
+ \fp_sub:Nn \l_tmpa_tl { #1 }
+ \fp_mul:Nn \l_tmpa_tl { .5 }
+ \MOdiagram_AO_place_electron:nx { 0 } { \fp_to_tl:N \l_tmpa_tl }
+ \fp_set:Nn \l_tmpa_tl { 1 }
+ \fp_add:Nn \l_tmpa_tl { #1 }
+ \fp_mul:Nn \l_tmpa_tl { .5 }
+ \MOdiagram_AO_place_electron:nx { 1 } { \fp_to_tl:N \l_tmpa_tl }
+ }
+
+% place the right atom
\cs_new_nopar:Npn \MOdiagram_molecule_position:n #1
{
\fp_set_from_dim:Nn \l_tmpa_tl { #1 }
@@ -132,6 +206,7 @@
\MOdiagram_molecule_position:f
{ \dim_use:N \l_MOdiagram_inter_atom_distance_dim }
+% set up keys for the environment
\keys_define:nn { MOdiagram / diagram }
{
style .choice: ,
@@ -139,6 +214,7 @@
{
\bool_set_false:N \l_MOdiagram_AO_square_bool
\bool_set_false:N \l_MOdiagram_AO_round_bool
+ \bool_set_false:N \l_MOdiagram_AO_circle_bool
\bool_set_false:N \l_MOdiagram_AO_fancy_bool
\tl_set:Nn \l_MOdiagram_lines_tl { dotted }
} ,
@@ -146,6 +222,15 @@
{
\bool_set_true:N \l_MOdiagram_AO_square_bool
\bool_set_false:N \l_MOdiagram_AO_round_bool
+ \bool_set_false:N \l_MOdiagram_AO_circle_bool
+ \bool_set_false:N \l_MOdiagram_AO_fancy_bool
+ \tl_set:Nn \l_MOdiagram_lines_tl { gray }
+ } ,
+ style / circle .code:n =
+ {
+ \bool_set_false:N \l_MOdiagram_AO_square_bool
+ \bool_set_false:N \l_MOdiagram_AO_round_bool
+ \bool_set_true:N \l_MOdiagram_AO_circle_bool
\bool_set_false:N \l_MOdiagram_AO_fancy_bool
\tl_set:Nn \l_MOdiagram_lines_tl { gray }
} ,
@@ -153,6 +238,7 @@
{
\bool_set_true:N \l_MOdiagram_AO_square_bool
\bool_set_true:N \l_MOdiagram_AO_round_bool
+ \bool_set_false:N \l_MOdiagram_AO_circle_bool
\bool_set_false:N \l_MOdiagram_AO_fancy_bool
\tl_set:Nn \l_MOdiagram_lines_tl { gray }
} ,
@@ -160,6 +246,7 @@
{
\bool_set_true:N \l_MOdiagram_AO_square_bool
\bool_set_true:N \l_MOdiagram_AO_round_bool
+ \bool_set_false:N \l_MOdiagram_AO_circle_bool
\bool_set_true:N \l_MOdiagram_AO_fancy_bool
\tl_set:Nn \l_MOdiagram_lines_tl { densely~dashed }
} ,
@@ -170,16 +257,23 @@
\MOdiagram_molecule_position:n { #1 }
} ,
AO-width .tl_set:N = \l_MOdiagram_AO_width_dim ,
+ up-el-pos .code:n = \MOdiagram_AO_place_electron:nn { 0 } { #1 } ,
+ down-el-pos .code:n = \MOdiagram_AO_place_electron:nn { 1 } { #1 } ,
+ el-sep .code:n = \MOdiagram_AO_place_electrons:n { #1 } ,
labels .bool_set:N = \l_MOdiagram_AO_labels_bool ,
names .bool_set:N = \l_MOdiagram_names_bool ,
+ names-style .tl_set:N = \l_MOdiagram_names_style_tl ,
+ names-style-add .code:n = { \tl_put_right:Nn \l_MOdiagram_names_style_tl { , #1 } } ,
labels-fs .tl_set:N = \l_MOdiagram_orbital_label_fontsize_tl ,
labels-style .tl_set:N = \l_MOdiagram_orbital_label_style_tl
}
+\ProcessKeysOptions { MOdiagram / diagram }
+
% --------------------------------------------------------------------------- %
% setup command
\NewDocumentCommand \MOsetup { m }
- { \keys_set:nn { MOdiagram / diagram } { #1 } \tex_unskip:D }
+ { \keys_set:nn { MOdiagram / diagram } { #1 } }
% --------------------------------------------------------------------------- %
% draw AOs
@@ -191,7 +285,7 @@
\bool_new:N \l_MOdiagram_right_atom_placed_bool
\bool_set_false:N \l_MOdiagram_right_atom_placed_bool
-\NewDocumentCommand \atom { o m m }
+\NewDocumentCommand \MOdiagram_atom: { o m m }
{
\MOdiagram_atom_disable:
\keys_set:nn { MOdiagram / atom } { position = #2 }
@@ -215,6 +309,7 @@
\bool_new:N \l_MOdiagram_atom_left_bool
+% is \atom placed left or right?
\keys_define:nn { MOdiagram / atom }
{
position .choice: ,
@@ -226,13 +321,19 @@
\dim_new:N \l_MOdiagram_atom_xshift_dim
+% these are going to be our `arguments' for the \atom command:
\keys_define:nn { MOdiagram / atom }
{
- 1s .code:n = { \MOdiagram_one_s_set:n #1 \q_stop } ,
- 2s .code:n = { \MOdiagram_two_s_set:n #1 \q_stop } ,
- 2p .code:n = { \MOdiagram_two_p_set:n #1 \q_stop } ,
- color .code:n = { \MOdiagram_electron_color_set:n { #1 } } ,
- label .code:n = { \MOdiagram_orbital_label_set:n { #1 } }
+ 1s .code:n = { \MOdiagram_one_s_set:n { #1 } } ,
+ 1s .default:n = { 0 ; pair } ,
+ 2s .code:n = { \MOdiagram_two_s_set:n { #1 } } ,
+ 2s .default:n = { 2 ; pair } ,
+ 2p .code:n = { \MOdiagram_two_p_set:n { #1 } } ,
+ 2p .default:n = { 5 ; pair , pair , pair } ,
+ color .code:n = { \MOdiagram_electron_color_set:n { #1 } } ,
+ label .code:n = { \MOdiagram_orbital_label_set:n { #1 } } ,
+ up-el-pos .code:n = { \MOdiagram_electron_up_set:n { #1 } } ,
+ down-el-pos .code:n = { \MOdiagram_electron_down_set:n { #1 } }
}
% --------------------------------------------------------------------------- %
@@ -249,13 +350,29 @@
\bool_new:N \l_MOdiagram_one_s_right_bool
\bool_set_false:N \l_MOdiagram_one_s_right_bool
-\cs_new_nopar:Npn \MOdiagram_one_s_set:n #1;#2 \q_stop
+% read 1s argument
+\cs_new_nopar:Npn \MOdiagram_one_s_set:n #1
{
\bool_set_true:N \l_MOdiagram_atom_one_s_bool
- \dim_set:Nn \l_MOdiagram_atom_one_s_dim { #1 cm }
+ \tl_if_in:onTF { #1 } { ; }
+ { \MOdiagram_one_s_set_aux:n #1 \q_stop }
+ {
+ \tl_clear:N \l_MOdiagram_AO_one_s_electron_tl
+ \tl_if_blank:nTF { #1 }
+ { \dim_set:Nn \l_MOdiagram_atom_one_s_dim { 0 cm } }
+ { \dim_set:Nn \l_MOdiagram_atom_one_s_dim { #1 cm } }
+ }
+ }
+
+\cs_new_nopar:Npn \MOdiagram_one_s_set_aux:n #1;#2 \q_stop
+ {
+ \tl_if_blank:nTF { #1 }
+ { \dim_set:Nn \l_MOdiagram_atom_one_s_dim { 0 cm } }
+ { \dim_set:Nn \l_MOdiagram_atom_one_s_dim { #1 cm } }
\tl_set:Nn \l_MOdiagram_AO_one_s_electron_tl { #2 }
}
+% display 1s orbital
\cs_new_nopar:Npn \MOdiagram_one_s:
{
\bool_if:NT \l_MOdiagram_atom_one_s_bool
@@ -291,11 +408,19 @@
at ( \l_MOdiagram_atom_xshift_dim , \l_MOdiagram_atom_one_s_dim )
{
\bool_if:NTF \l_MOdiagram_atom_left_bool
- { \MOdiagram_get_electron_color:n { 1sleft } }
- { \MOdiagram_get_electron_color:n { 1sright } }
+ {
+ \MOdiagram_get_electron_color:n { 1sleft }
+ \MOdiagram_get_electron_up:n { 1sleft }
+ \MOdiagram_get_electron_down:n { 1sleft }
+ }
+ {
+ \MOdiagram_get_electron_color:n { 1sright }
+ \MOdiagram_get_electron_up:n { 1sright }
+ \MOdiagram_get_electron_down:n { 1sright }
+ }
\MOdiagram_AO:ff
{ \tl_use:N \l_MOdiagram_AO_one_s_electron_tl }
- { \tl_use:N \l_tmpb_tl }
+ { \tl_use:N \l_MOdiagram_electron_current_color_tl }
} ;
\bool_if:NTF \l_MOdiagram_atom_left_bool
{ \MOdiagram_get_orbital_label:n { 1s left } }
@@ -317,13 +442,29 @@
\bool_new:N \l_MOdiagram_two_s_right_bool
\bool_set_false:N \l_MOdiagram_two_s_right_bool
-\cs_new_nopar:Npn \MOdiagram_two_s_set:n #1;#2 \q_stop
+% read 2s argument
+\cs_new_nopar:Npn \MOdiagram_two_s_set:n #1
{
\bool_set_true:N \l_MOdiagram_atom_two_s_bool
- \dim_set:Nn \l_MOdiagram_atom_two_s_dim { #1 cm }
+ \tl_if_in:onTF { #1 } { ; }
+ { \MOdiagram_two_s_set_aux:n #1 \q_stop }
+ {
+ \tl_clear:N \l_MOdiagram_AO_two_s_electron_tl
+ \tl_if_blank:nTF { #1 }
+ { \dim_set:Nn \l_MOdiagram_atom_two_s_dim { 2 cm } }
+ { \dim_set:Nn \l_MOdiagram_atom_two_s_dim { #1 cm } }
+ }
+ }
+
+\cs_new_nopar:Npn \MOdiagram_two_s_set_aux:n #1;#2 \q_stop
+ {
+ \tl_if_blank:nTF { #1 }
+ { \dim_set:Nn \l_MOdiagram_atom_two_s_dim { 2 cm } }
+ { \dim_set:Nn \l_MOdiagram_atom_two_s_dim { #1 cm } }
\tl_set:Nn \l_MOdiagram_AO_two_s_electron_tl { #2 }
}
+% display 2s orbital
\cs_new_nopar:Npn \MOdiagram_two_s:
{
\bool_if:NT \l_MOdiagram_atom_two_s_bool
@@ -359,11 +500,19 @@
at ( \l_MOdiagram_atom_xshift_dim , \l_MOdiagram_atom_two_s_dim )
{
\bool_if:NTF \l_MOdiagram_atom_left_bool
- { \MOdiagram_get_electron_color:n { 2sleft } }
- { \MOdiagram_get_electron_color:n { 2sright } }
+ {
+ \MOdiagram_get_electron_color:n { 2sleft }
+ \MOdiagram_get_electron_up:n { 2sleft }
+ \MOdiagram_get_electron_down:n { 2sleft }
+ }
+ {
+ \MOdiagram_get_electron_color:n { 2sright }
+ \MOdiagram_get_electron_up:n { 2sright }
+ \MOdiagram_get_electron_down:n { 2sright }
+ }
\MOdiagram_AO:ff
{ \tl_use:N \l_MOdiagram_AO_two_s_electron_tl }
- { \tl_use:N \l_tmpb_tl }
+ { \tl_use:N \l_MOdiagram_electron_current_color_tl }
} ;
\bool_if:NTF \l_MOdiagram_atom_left_bool
{ \MOdiagram_get_orbital_label:n { 2s left } }
@@ -391,15 +540,42 @@
\bool_new:N \l_MOdiagram_two_p_right_bool
\bool_set_false:N \l_MOdiagram_two_p_right_bool
-\cs_new_nopar:Npn \MOdiagram_two_p_set:n #1;#2,#3,#4 \q_stop
+% read 2p argument
+\cs_new_nopar:Npn \MOdiagram_two_p_set:n #1
{
\bool_set_true:N \l_MOdiagram_atom_two_p_bool
- \dim_set:Nn \l_MOdiagram_atom_two_p_dim { #1 cm }
- \tl_set:Nn \l_MOdiagram_AO_two_px_electron_tl { #2 }
- \tl_set:Nn \l_MOdiagram_AO_two_py_electron_tl { #3 }
- \tl_set:Nn \l_MOdiagram_AO_two_pz_electron_tl { #4 }
+ \tl_if_in:onTF { #1 } { ; }
+ { \MOdiagram_two_p_set_aux_i:n #1 \q_stop }
+ {
+ \tl_clear:N \l_MOdiagram_AO_two_px_electron_tl
+ \tl_clear:N \l_MOdiagram_AO_two_py_electron_tl
+ \tl_clear:N \l_MOdiagram_AO_two_pz_electron_tl
+ \tl_if_blank:nTF { #1 }
+ { \dim_set:Nn \l_MOdiagram_atom_two_p_dim { 5 cm } }
+ { \dim_set:Nn \l_MOdiagram_atom_two_p_dim { #1 cm } }
+ }
}
+\cs_new_nopar:Npn \MOdiagram_two_p_set_aux_i:n #1;#2 \q_stop
+ {
+ \tl_if_blank:nTF { #1 }
+ { \dim_set:Nn \l_MOdiagram_atom_two_p_dim { 5 cm } }
+ { \dim_set:Nn \l_MOdiagram_atom_two_p_dim { #1 cm } }
+ \MOdiagram_two_p_set_aux_ii:n { #2 }
+ }
+
+\NewDocumentCommand \MOdiagram_two_p_set_aux_ii:n
+ { > { \SplitArgument { 2 } { , } } m }
+ { \MOdiagram_two_p_set_aux_iii:nnn #1 }
+
+\cs_set_nopar:Npn \MOdiagram_two_p_set_aux_iii:nnn #1#2#3
+ {
+ \tl_if_blank:nF { #1 } { \tl_set:Nn \l_MOdiagram_AO_two_px_electron_tl { #1 } }
+ \tl_if_blank:nF { #2 } { \tl_set:Nn \l_MOdiagram_AO_two_py_electron_tl { #2 } }
+ \tl_if_blank:nF { #3 } { \tl_set:Nn \l_MOdiagram_AO_two_pz_electron_tl { #3 } }
+ }
+
+% place the x, y, and z orbitals
\cs_new_nopar:Npn \MOdiagram_p_orbitals_shift:nnn #1#2#3
{
\fp_set_from_dim:Nn \l_tmpa_tl { \l_MOdiagram_AO_width_dim }
@@ -417,6 +593,7 @@
}
}
+% display 2p orbitals
\cs_new_nopar:Npn \MOdiagram_two_p:
{
\bool_if:NT \l_MOdiagram_atom_two_p_bool
@@ -461,11 +638,19 @@
)
{
\bool_if:NTF \l_MOdiagram_atom_left_bool
- { \MOdiagram_get_electron_color:n { 2pz left } }
- { \MOdiagram_get_electron_color:n { 2pz right } }
+ {
+ \MOdiagram_get_electron_color:n { 2pz left }
+ \MOdiagram_get_electron_up:n { 2pz left }
+ \MOdiagram_get_electron_down:n { 2pz left }
+ }
+ {
+ \MOdiagram_get_electron_color:n { 2pz right }
+ \MOdiagram_get_electron_up:n { 2pz right }
+ \MOdiagram_get_electron_down:n { 2pz right }
+ }
\MOdiagram_AO:ff
{ \tl_use:N \l_MOdiagram_AO_two_pz_electron_tl }
- { \tl_use:N \l_tmpb_tl }
+ { \tl_use:N \l_MOdiagram_electron_current_color_tl }
} ;
\bool_if:NTF \l_MOdiagram_atom_left_bool
{ \MOdiagram_get_orbital_label:n { 2pz left } }
@@ -483,11 +668,19 @@
)
{
\bool_if:NTF \l_MOdiagram_atom_left_bool
- { \MOdiagram_get_electron_color:n { 2py left } }
- { \MOdiagram_get_electron_color:n { 2py right } }
+ {
+ \MOdiagram_get_electron_color:n { 2py left }
+ \MOdiagram_get_electron_up:n { 2py left }
+ \MOdiagram_get_electron_down:n { 2py left }
+ }
+ {
+ \MOdiagram_get_electron_color:n { 2py right }
+ \MOdiagram_get_electron_up:n { 2py right }
+ \MOdiagram_get_electron_down:n { 2py right }
+ }
\MOdiagram_AO:ff
{ \tl_use:N \l_MOdiagram_AO_two_py_electron_tl }
- { \tl_use:N \l_tmpb_tl }
+ { \tl_use:N \l_MOdiagram_electron_current_color_tl }
} ;
\bool_if:NTF \l_MOdiagram_atom_left_bool
{ \MOdiagram_get_orbital_label:n { 2py left } }
@@ -505,11 +698,19 @@
)
{
\bool_if:NTF \l_MOdiagram_atom_left_bool
- { \MOdiagram_get_electron_color:n { 2px left } }
- { \MOdiagram_get_electron_color:n { 2px right } }
+ {
+ \MOdiagram_get_electron_color:n { 2px left }
+ \MOdiagram_get_electron_up:n { 2px left }
+ \MOdiagram_get_electron_down:n { 2px left }
+ }
+ {
+ \MOdiagram_get_electron_color:n { 2px right }
+ \MOdiagram_get_electron_up:n { 2px right }
+ \MOdiagram_get_electron_down:n { 2px right }
+ }
\MOdiagram_AO:ff
{ \tl_use:N \l_MOdiagram_AO_two_px_electron_tl }
- { \tl_use:N \l_tmpb_tl }
+ { \tl_use:N \l_MOdiagram_electron_current_color_tl }
} ;
\bool_if:NTF \l_MOdiagram_atom_left_bool
{ \MOdiagram_get_orbital_label:n { 2px left } }
@@ -521,7 +722,7 @@
% draw MOs
\tl_new:N \l_MOdiagram_molecule_name_tl
-\NewDocumentCommand \molecule { o m }
+\NewDocumentCommand \MOdiagram_molecule: { o m }
{
\bool_if:nTF
{
@@ -544,13 +745,19 @@
{ \msg_error:nn { MOdiagram } { missing-atom } }
}
+% these are going to be our molecule arguments:
\keys_define:nn { MOdiagram / molecule }
{
- 1sMO .code:n = { \MOdiagram_one_mo_s_set:n #1 \q_stop } ,
- 2sMO .code:n = { \MOdiagram_two_mo_s_set:n #1 \q_stop } ,
- 2pMO .code:n = { \MOdiagram_two_mo_p_set:n #1 \q_stop } ,
- color .code:n = { \MOdiagram_electron_color_set:n { #1 } } ,
- label .code:n = { \MOdiagram_orbital_label_set:n { #1 } }
+ 1sMO .code:n = { \MOdiagram_one_mo_s_set:n { #1 } } ,
+ 1sMO .default:n = { .5 ; pair , pair } ,
+ 2sMO .code:n = { \MOdiagram_two_mo_s_set:n { #1 } } ,
+ 2sMO .default:n = { .5 ; pair , pair } ,
+ 2pMO .code:n = { \MOdiagram_two_mo_p_set:n { #1 } } ,
+ 2pMO .default:n = { 1.5 , .5 ; pair , pair , pair , pair , pair , pair } ,
+ color .code:n = { \MOdiagram_electron_color_set:n { #1 } } ,
+ label .code:n = { \MOdiagram_orbital_label_set:n { #1 } } ,
+ up-el-pos .code:n = { \MOdiagram_electron_up_set:n { #1 } } ,
+ down-el-pos .code:n = { \MOdiagram_electron_down_set:n { #1 } }
}
% --------------------------------------------------------------------------- %
@@ -562,14 +769,62 @@
\tl_new:N \l_MOdiagram_MO_one_sigmas_s_electron_tl
\bool_new:N \l_MOdiagram_molecule_one_mo_s_bool
-\cs_new_nopar:Npn \MOdiagram_one_mo_s_set:n #1;#2,#3 \q_stop
+% read 1sMO argument
+\cs_new_nopar:Npn \MOdiagram_one_mo_s_set:n #1
{
\bool_set_true:N \l_MOdiagram_molecule_one_mo_s_bool
- \tl_set:Nn \l_MOdiagram_MO_one_sigma_s_electron_tl { #2 }
- \tl_set:Nn \l_MOdiagram_MO_one_sigmas_s_electron_tl { #3 }
- \dim_set:Nn \l_MOdiagram_molecule_one_sigma_dim { #1 cm }
+ \tl_if_in:onTF { #1 } { ; }
+ { \MOdiagram_one_mo_s_set_aux:n #1 \q_stop }
+ { \MOdiagram_one_mo_s_set_energy:n { #1 } }
+ }
+
+\cs_new_nopar:Npn \MOdiagram_one_mo_s_set_aux:n #1;#2 \q_stop
+ {
+ \MOdiagram_one_mo_s_set_energy:n { #1 }
+ \MOdiagram_one_mo_s_set_electrons:n { #2 }
+ }
+
+\cs_new_nopar:Npn \MOdiagram_one_mo_s_set_energy:n #1
+ {
+ \tl_if_in:onTF { #1 } { / }
+ { \MOdiagram_one_mo_s_set_energy_aux:n #1 \q_stop }
+ {
+ \tl_if_blank:nTF { #1 }
+ {
+ \dim_set:Nn \l_MOdiagram_molecule_one_sigma_dim { .5 cm }
+ \dim_set:Nn \l_MOdiagram_molecule_one_sigmas_dim { .5 cm }
+ }
+ {
+ \dim_set:Nn \l_MOdiagram_molecule_one_sigma_dim { #1 cm }
+ \dim_set:Nn \l_MOdiagram_molecule_one_sigmas_dim { #1 cm }
+ }
+ }
+ }
+
+\cs_new_nopar:Npn \MOdiagram_one_mo_s_set_energy_aux:n #1/#2 \q_stop
+ {
+ \tl_if_blank:nTF { #1 }
+ { \dim_set:Nn \l_MOdiagram_molecule_one_sigma_dim { .5 cm } }
+ { \dim_set:Nn \l_MOdiagram_molecule_one_sigma_dim { #1 cm } }
+ \tl_if_blank:nTF { #2 }
+ { \dim_set:Nn \l_MOdiagram_molecule_one_sigmas_dim { .5 cm } }
+ { \dim_set:Nn \l_MOdiagram_molecule_one_sigmas_dim { #2 cm } }
}
+\cs_set_nopar:Npn \MOdiagram_one_mo_s_set_electrons:n #1
+ {
+ \tl_if_in:onTF { #1 } { , }
+ { \MOdiagram_one_mo_s_set_electrons_aux:n #1 \q_stop }
+ { \tl_set:Nn \l_MOdiagram_MO_one_sigma_s_electron_tl { #1 } }
+ }
+
+\cs_new_nopar:Npn \MOdiagram_one_mo_s_set_electrons_aux:n #1,#2 \q_stop
+ {
+ \tl_set:Nn \l_MOdiagram_MO_one_sigma_s_electron_tl { #1 }
+ \tl_set:Nn \l_MOdiagram_MO_one_sigmas_s_electron_tl { #2 }
+ }
+
+% display 1sigma/sigma* MOs:
\cs_new_nopar:Npn \MOdiagram_one_mo_s:
{
\bool_if:NT \l_MOdiagram_molecule_one_mo_s_bool
@@ -577,29 +832,25 @@
\bool_if:nF
{ \l_MOdiagram_one_s_left_bool && \l_MOdiagram_one_s_right_bool }
{ \msg_error:nnxx { MOdiagram } { missing-AO } { 1sMO } { 1s } }
- \MOdiagram_energy_range:n
- {
- \l_MOdiagram_atom_left_one_s_dim
- - \l_MOdiagram_molecule_one_sigma_dim
- }
- \MOdiagram_energy_range:n
- {
- \l_MOdiagram_atom_right_one_s_dim
- + \l_MOdiagram_molecule_one_sigma_dim
- }
+ \MOdiagram_split_energy:nNN { one_s }
+ \l_MOdiagram_molecule_one_sigma_dim
+ \l_MOdiagram_molecule_one_sigmas_dim
+ \MOdiagram_energy_range:N \l_MOdiagram_energy_gain_dim
+ \MOdiagram_energy_range:N \l_MOdiagram_energy_loss_dim
\MOdiagram_node:n { inner~sep=0 , outer~sep=0 }
(1sigma)
at
(
\l_MOdiagram_molecule_position_dim ,
- \l_MOdiagram_atom_left_one_s_dim
- - \l_MOdiagram_molecule_one_sigma_dim
+ \l_MOdiagram_energy_gain_dim
)
{
\MOdiagram_get_electron_color:n { 1sigma }
+ \MOdiagram_get_electron_up:n { 1sigma }
+ \MOdiagram_get_electron_down:n { 1sigma }
\MOdiagram_AO:ff
{ \tl_use:N \l_MOdiagram_MO_one_sigma_s_electron_tl }
- { \tl_use:N \l_tmpb_tl }
+ { \tl_use:N \l_MOdiagram_electron_current_color_tl }
} ;
\MOdiagram_get_orbital_label:n { 1sigma }
\MOdiagram_node:n { inner~sep=0 , outer~sep=0 }
@@ -607,14 +858,15 @@
at
(
\l_MOdiagram_molecule_position_dim ,
- \l_MOdiagram_atom_right_one_s_dim
- + \l_MOdiagram_molecule_one_sigma_dim
+ \l_MOdiagram_energy_loss_dim
)
{
\MOdiagram_get_electron_color:n { 1sigma* }
+ \MOdiagram_get_electron_up:n { 1sigma* }
+ \MOdiagram_get_electron_down:n { 1sigma* }
\MOdiagram_AO:ff
{ \tl_use:N \l_MOdiagram_MO_one_sigmas_s_electron_tl }
- { \tl_use:N \l_tmpb_tl }
+ { \tl_use:N \l_MOdiagram_electron_current_color_tl }
} ;
\MOdiagram_get_orbital_label:n { 1sigma* }
\MOdiagram_draw:f
@@ -633,14 +885,62 @@
\tl_new:N \l_MOdiagram_MO_two_sigmas_s_electron_tl
\bool_new:N \l_MOdiagram_molecule_two_mo_s_bool
-\cs_new_nopar:Npn \MOdiagram_two_mo_s_set:n #1;#2,#3 \q_stop
+% read 2sMO argument
+\cs_new_nopar:Npn \MOdiagram_two_mo_s_set:n #1
{
\bool_set_true:N \l_MOdiagram_molecule_two_mo_s_bool
- \tl_set:Nn \l_MOdiagram_MO_two_sigma_s_electron_tl { #2 }
- \tl_set:Nn \l_MOdiagram_MO_two_sigmas_s_electron_tl { #3 }
- \dim_set:Nn \l_MOdiagram_molecule_two_sigma_dim { #1 cm }
+ \tl_if_in:onTF { #1 } { ; }
+ { \MOdiagram_two_mo_s_set_aux:n #1 \q_stop }
+ { \MOdiagram_two_mo_s_set_energy:n { #1 } }
}
+\cs_new_nopar:Npn \MOdiagram_two_mo_s_set_aux:n #1;#2 \q_stop
+ {
+ \MOdiagram_two_mo_s_set_energy:n { #1 }
+ \MOdiagram_two_mo_s_set_electrons:n { #2 }
+ }
+
+\cs_new_nopar:Npn \MOdiagram_two_mo_s_set_energy:n #1
+ {
+ \tl_if_in:onTF { #1 } { / }
+ { \MOdiagram_two_mo_s_set_energy_aux:n #1 \q_stop }
+ {
+ \tl_if_blank:nTF { #1 }
+ {
+ \dim_set:Nn \l_MOdiagram_molecule_two_sigma_dim { .5 cm }
+ \dim_set:Nn \l_MOdiagram_molecule_two_sigmas_dim { .5 cm }
+ }
+ {
+ \dim_set:Nn \l_MOdiagram_molecule_two_sigma_dim { #1 cm }
+ \dim_set:Nn \l_MOdiagram_molecule_two_sigmas_dim { #1 cm }
+ }
+ }
+ }
+
+\cs_new_nopar:Npn \MOdiagram_two_mo_s_set_energy_aux:n #1/#2 \q_stop
+ {
+ \tl_if_blank:nTF { #1 }
+ { \dim_set:Nn \l_MOdiagram_molecule_two_sigma_dim { .5 cm } }
+ { \dim_set:Nn \l_MOdiagram_molecule_two_sigma_dim { #1 cm } }
+ \tl_if_blank:nTF { #2 }
+ { \dim_set:Nn \l_MOdiagram_molecule_two_sigmas_dim { .5 cm } }
+ { \dim_set:Nn \l_MOdiagram_molecule_two_sigmas_dim { #2 cm } }
+ }
+
+\cs_set_nopar:Npn \MOdiagram_two_mo_s_set_electrons:n #1
+ {
+ \tl_if_in:onTF { #1 } { , }
+ { \MOdiagram_two_mo_s_set_electrons_aux:n #1 \q_stop }
+ { \tl_set:Nn \l_MOdiagram_MO_two_sigma_s_electron_tl { #1 } }
+ }
+
+\cs_new_nopar:Npn \MOdiagram_two_mo_s_set_electrons_aux:n #1,#2 \q_stop
+ {
+ \tl_set:Nn \l_MOdiagram_MO_two_sigma_s_electron_tl { #1 }
+ \tl_set:Nn \l_MOdiagram_MO_two_sigmas_s_electron_tl { #2 }
+ }
+
+% display 2sigma/sigma* MOs:
\cs_new_nopar:Npn \MOdiagram_two_mo_s:
{
\bool_if:NT \l_MOdiagram_molecule_two_mo_s_bool
@@ -648,29 +948,25 @@
\bool_if:nF
{ \l_MOdiagram_two_s_left_bool && \l_MOdiagram_two_s_right_bool }
{ \msg_error:nnxx { MOdiagram } { missing-AO } { 2sMO } { 2s } }
- \MOdiagram_energy_range:n
- {
- \l_MOdiagram_atom_left_two_s_dim
- - \l_MOdiagram_molecule_two_sigma_dim
- }
- \MOdiagram_energy_range:n
- {
- \l_MOdiagram_atom_right_two_s_dim
- + \l_MOdiagram_molecule_two_sigma_dim
- }
+ \MOdiagram_split_energy:nNN { two_s }
+ \l_MOdiagram_molecule_two_sigma_dim
+ \l_MOdiagram_molecule_two_sigmas_dim
+ \MOdiagram_energy_range:N \l_MOdiagram_energy_gain_dim
+ \MOdiagram_energy_range:N \l_MOdiagram_energy_loss_dim
\MOdiagram_node:n { inner~sep=0 , outer~sep=0 }
(2sigma)
at
(
\l_MOdiagram_molecule_position_dim ,
- \l_MOdiagram_atom_left_two_s_dim
- - \l_MOdiagram_molecule_two_sigma_dim
+ \l_MOdiagram_energy_gain_dim
)
{
\MOdiagram_get_electron_color:n { 2sigma }
+ \MOdiagram_get_electron_up:n { 2sigma }
+ \MOdiagram_get_electron_down:n { 2sigma }
\MOdiagram_AO:ff
{ \tl_use:N \l_MOdiagram_MO_two_sigma_s_electron_tl }
- { \tl_use:N \l_tmpb_tl }
+ { \tl_use:N \l_MOdiagram_electron_current_color_tl }
} ;
\MOdiagram_get_orbital_label:n { 2sigma }
\MOdiagram_node:n { inner~sep=0 , outer~sep=0 }
@@ -678,14 +974,15 @@
at
(
\l_MOdiagram_molecule_position_dim ,
- \l_MOdiagram_atom_right_two_s_dim
- + \l_MOdiagram_molecule_two_sigma_dim
+ \l_MOdiagram_energy_loss_dim
)
{
\MOdiagram_get_electron_color:n { 2sigma* }
+ \MOdiagram_get_electron_up:n { 2sigma* }
+ \MOdiagram_get_electron_down:n { 2sigma* }
\MOdiagram_AO:ff
{ \tl_use:N \l_MOdiagram_MO_two_sigmas_s_electron_tl }
- { \tl_use:N \l_tmpb_tl }
+ { \tl_use:N \l_MOdiagram_electron_current_color_tl }
} ;
\MOdiagram_get_orbital_label:n { 2sigma* }
\MOdiagram_draw:f
@@ -696,9 +993,11 @@
}
% --------------------------------------------------------------------------- %
-% 2sigma orbitals
+% 2psigma and 2ppi orbitals
\dim_new:N \l_MOdiagram_molecule_two_psigma_dim
+\dim_new:N \l_MOdiagram_molecule_two_psigmas_dim
\dim_new:N \l_MOdiagram_molecule_two_ppi_dim
+\dim_new:N \l_MOdiagram_molecule_two_ppis_dim
\tl_new:N \l_MOdiagram_MO_two_sigma_p_electron_tl
\tl_new:N \l_MOdiagram_MO_two_sigmas_p_electron_tl
@@ -709,19 +1008,109 @@
\bool_new:N \l_MOdiagram_molecule_two_mo_p_bool
-\cs_new_nopar:Npn \MOdiagram_two_mo_p_set:n #1,#2;#3,#4,#5,#6,#7,#8 \q_stop
+% read 2pMO argument
+\cs_set_nopar:Npn \MOdiagram_two_mo_p_set:n #1
{
\bool_set_true:N \l_MOdiagram_molecule_two_mo_p_bool
- \tl_set:Nn \l_MOdiagram_MO_two_sigma_p_electron_tl { #3 }
- \tl_set:Nn \l_MOdiagram_MO_two_sigmas_p_electron_tl { #8 }
- \tl_set:Nn \l_MOdiagram_MO_two_piy_p_electron_tl { #4 }
- \tl_set:Nn \l_MOdiagram_MO_two_piys_p_electron_tl { #6 }
- \tl_set:Nn \l_MOdiagram_MO_two_piz_p_electron_tl { #5 }
- \tl_set:Nn \l_MOdiagram_MO_two_pizs_p_electron_tl { #7 }
- \dim_set:Nn \l_MOdiagram_molecule_two_psigma_dim { #1 cm }
- \dim_set:Nn \l_MOdiagram_molecule_two_ppi_dim { #2 cm }
+ \tl_if_in:onTF { #1 } { ; }
+ { \MOdiagram_two_mo_p_set_aux:n #1 \q_stop }
+ { \MOdiagram_two_mo_p_set_energy:n { #1 } }
+ }
+
+\cs_set_nopar:Npn \MOdiagram_two_mo_p_set_aux:n #1;#2 \q_stop
+ {
+ \MOdiagram_two_mo_p_set_energy:n { #1 }
+ \MOdiagram_two_mo_p_set_electrons:n { #2 }
+ }
+
+\cs_new_nopar:Npn \MOdiagram_two_mo_p_set_energy:n #1
+ {
+ \tl_if_in:onTF { #1 } { , }
+ { \MOdiagram_two_mo_p_set_energy_aux:n #1 \q_stop }
+ {
+ \tl_if_in:onTF { #1 } { / }
+ {
+ \MOdiagram_two_mo_p_set_energy_sigma_aux:n #1 \q_stop
+ \MOdiagram_two_mo_p_set_energy_pi:n { .5 }
+ }
+ {
+ \MOdiagram_two_mo_p_set_energy_sigma:n { #1 }
+ \MOdiagram_two_mo_p_set_energy_pi:n { .5 }
+ }
+ }
}
+\cs_new_nopar:Npn \MOdiagram_two_mo_p_set_energy_aux:n #1,#2 \q_stop
+ {
+ \tl_if_in:onTF { #1 } { / }
+ { \MOdiagram_two_mo_p_set_energy_sigma_aux:n #1 \q_stop }
+ { \MOdiagram_two_mo_p_set_energy_sigma:n { #1 } }
+ \tl_if_in:onTF { #2 } { / }
+ { \MOdiagram_two_mo_p_set_energy_pi_aux:n #2 \q_stop }
+ { \MOdiagram_two_mo_p_set_energy_pi:n { #2 } }
+ }
+
+\cs_new_nopar:Npn \MOdiagram_two_mo_p_set_energy_sigma:n #1
+ {
+ \tl_if_blank:nTF { #1 }
+ {
+ \dim_set:Nn \l_MOdiagram_molecule_two_psigma_dim { 1.5 cm }
+ \dim_set:Nn \l_MOdiagram_molecule_two_psigmas_dim { 1.5 cm }
+ }
+ {
+ \dim_set:Nn \l_MOdiagram_molecule_two_psigma_dim { #1 cm }
+ \dim_set:Nn \l_MOdiagram_molecule_two_psigmas_dim { #1 cm }
+ }
+ }
+
+\cs_new_nopar:Npn \MOdiagram_two_mo_p_set_energy_sigma_aux:n #1/#2 \q_stop
+ {
+ \tl_if_blank:nTF { #1 }
+ { \dim_set:Nn \l_MOdiagram_molecule_two_psigma_dim { 1.5 cm } }
+ { \dim_set:Nn \l_MOdiagram_molecule_two_psigma_dim { #1 cm } }
+ \tl_if_blank:nTF { #2 }
+ { \dim_set:Nn \l_MOdiagram_molecule_two_psigmas_dim { 1.5 cm } }
+ { \dim_set:Nn \l_MOdiagram_molecule_two_psigmas_dim { #2 cm } }
+ }
+
+\cs_new_nopar:Npn \MOdiagram_two_mo_p_set_energy_pi:n #1
+ {
+ \tl_if_blank:nTF { #1 }
+ {
+ \dim_set:Nn \l_MOdiagram_molecule_two_ppi_dim { .5 cm }
+ \dim_set:Nn \l_MOdiagram_molecule_two_ppis_dim { .5 cm }
+ }
+ {
+ \dim_set:Nn \l_MOdiagram_molecule_two_ppi_dim { #1 cm }
+ \dim_set:Nn \l_MOdiagram_molecule_two_ppis_dim { #1 cm }
+ }
+ }
+
+\cs_new_nopar:Npn \MOdiagram_two_mo_p_set_energy_pi_aux:n #1/#2 \q_stop
+ {
+ \tl_if_blank:nTF { #1 }
+ { \dim_set:Nn \l_MOdiagram_molecule_two_ppi_dim { .5 cm } }
+ { \dim_set:Nn \l_MOdiagram_molecule_two_ppi_dim { #1 cm } }
+ \tl_if_blank:nTF { #2 }
+ { \dim_set:Nn \l_MOdiagram_molecule_two_ppis_dim { .5 cm } }
+ { \dim_set:Nn \l_MOdiagram_molecule_two_ppis_dim { #2 cm } }
+ }
+
+\NewDocumentCommand \MOdiagram_two_mo_p_set_electrons:n
+ { > { \SplitArgument { 5 } { , } } m }
+ { \MOdiagram_two_mo_p_set_electrons_aux:n #1 }
+
+\cs_new_nopar:Npn \MOdiagram_two_mo_p_set_electrons_aux:n #1#2#3#4#5#6
+ {
+ \tl_set:Nn \l_MOdiagram_MO_two_sigma_p_electron_tl { #1 }
+ \tl_set:Nn \l_MOdiagram_MO_two_sigmas_p_electron_tl { #6 }
+ \tl_set:Nn \l_MOdiagram_MO_two_piy_p_electron_tl { #2 }
+ \tl_set:Nn \l_MOdiagram_MO_two_piys_p_electron_tl { #4 }
+ \tl_set:Nn \l_MOdiagram_MO_two_piz_p_electron_tl { #3 }
+ \tl_set:Nn \l_MOdiagram_MO_two_pizs_p_electron_tl { #5 }
+ }
+
+% display 2sigma+pi/sigma*+pi* orbitals:
\cs_new_nopar:Npn \MOdiagram_two_mo_p:
{
\bool_if:NT \l_MOdiagram_molecule_two_mo_p_bool
@@ -729,29 +1118,25 @@
\bool_if:nF
{ \l_MOdiagram_two_p_left_bool && \l_MOdiagram_two_p_right_bool }
{ \msg_error:nnxx { MOdiagram } { missing-AO } { 2pMO } { 2p } }
- \MOdiagram_energy_range:n
- {
- \l_MOdiagram_atom_left_two_p_dim
- - \l_MOdiagram_molecule_two_psigma_dim
- }
- \MOdiagram_energy_range:n
- {
- \l_MOdiagram_atom_right_two_p_dim
- + \l_MOdiagram_molecule_two_psigma_dim
- }
+ \MOdiagram_split_energy:nNN { two_p }
+ \l_MOdiagram_molecule_two_psigma_dim
+ \l_MOdiagram_molecule_two_psigmas_dim
+ \MOdiagram_energy_range:N \l_MOdiagram_energy_gain_dim
+ \MOdiagram_energy_range:N \l_MOdiagram_energy_loss_dim
\MOdiagram_node:n { inner~sep=0 , outer~sep=0 }
(2psigma)
at
(
\l_MOdiagram_molecule_position_dim ,
- \l_MOdiagram_atom_left_two_p_dim
- - \l_MOdiagram_molecule_two_psigma_dim
+ \l_MOdiagram_energy_gain_dim
)
{
\MOdiagram_get_electron_color:n { 2psigma }
+ \MOdiagram_get_electron_up:n { 2psigma }
+ \MOdiagram_get_electron_down:n { 2psigma }
\MOdiagram_AO:ff
{ \tl_use:N \l_MOdiagram_MO_two_sigma_p_electron_tl }
- { \tl_use:N \l_tmpb_tl }
+ { \tl_use:N \l_MOdiagram_electron_current_color_tl }
} ;
\MOdiagram_get_orbital_label:n { 2psigma }
\MOdiagram_node:n { inner~sep=0 , outer~sep=0 }
@@ -759,29 +1144,34 @@
at
(
\l_MOdiagram_molecule_position_dim ,
- \l_MOdiagram_atom_right_two_p_dim
- + \l_MOdiagram_molecule_two_psigma_dim
+ \l_MOdiagram_energy_loss_dim
)
{
\MOdiagram_get_electron_color:n { 2psigma* }
+ \MOdiagram_get_electron_up:n { 2psigma* }
+ \MOdiagram_get_electron_down:n { 2psigma* }
\MOdiagram_AO:ff
{ \tl_use:N \l_MOdiagram_MO_two_sigmas_p_electron_tl }
- { \tl_use:N \l_tmpb_tl }
+ { \tl_use:N \l_MOdiagram_electron_current_color_tl }
} ;
\MOdiagram_get_orbital_label:n { 2psigma* }
+ \MOdiagram_split_energy:nNN { two_p }
+ \l_MOdiagram_molecule_two_ppi_dim
+ \l_MOdiagram_molecule_two_ppis_dim
\MOdiagram_node:n { inner~sep=0 , outer~sep=0 }
(2piy)
at
(
\l_MOdiagram_molecule_position_dim - \l_MOdiagram_AO_width_dim ,
- \l_MOdiagram_atom_left_two_p_dim
- - \l_MOdiagram_molecule_two_ppi_dim
+ \l_MOdiagram_energy_gain_dim
)
{
\MOdiagram_get_electron_color:n { 2piy }
+ \MOdiagram_get_electron_up:n { 2piy }
+ \MOdiagram_get_electron_down:n { 2piy }
\MOdiagram_AO:ff
{ \tl_use:N \l_MOdiagram_MO_two_piy_p_electron_tl }
- { \tl_use:N \l_tmpb_tl }
+ { \tl_use:N \l_MOdiagram_electron_current_color_tl }
} ;
\MOdiagram_get_orbital_label:n { 2piy }
\MOdiagram_node:n { inner~sep=0 , outer~sep=0 }
@@ -789,14 +1179,15 @@
at
(
\l_MOdiagram_molecule_position_dim - \l_MOdiagram_AO_width_dim ,
- \l_MOdiagram_atom_right_two_p_dim
- + \l_MOdiagram_molecule_two_ppi_dim
+ \l_MOdiagram_energy_loss_dim
)
{
\MOdiagram_get_electron_color:n { 2piy* }
+ \MOdiagram_get_electron_up:n { 2piy* }
+ \MOdiagram_get_electron_down:n { 2piy* }
\MOdiagram_AO:ff
{ \tl_use:N \l_MOdiagram_MO_two_piys_p_electron_tl }
- { \tl_use:N \l_tmpb_tl }
+ { \tl_use:N \l_MOdiagram_electron_current_color_tl }
} ;
\MOdiagram_get_orbital_label:n { 2piy* }
\MOdiagram_node:n { inner~sep=0 , outer~sep=0 }
@@ -804,14 +1195,15 @@
at
(
\l_MOdiagram_molecule_position_dim + \l_MOdiagram_AO_width_dim ,
- \l_MOdiagram_atom_left_two_p_dim
- - \l_MOdiagram_molecule_two_ppi_dim
+ \l_MOdiagram_energy_gain_dim
)
{
\MOdiagram_get_electron_color:n { 2piz }
+ \MOdiagram_get_electron_up:n { 2piz }
+ \MOdiagram_get_electron_down:n { 2piz }
\MOdiagram_AO:ff
{ \tl_use:N \l_MOdiagram_MO_two_piz_p_electron_tl }
- { \tl_use:N \l_tmpb_tl }
+ { \tl_use:N \l_MOdiagram_electron_current_color_tl }
} ;
\MOdiagram_get_orbital_label:n { 2piz }
\MOdiagram_node:n { inner~sep=0 , outer~sep=0 }
@@ -819,14 +1211,15 @@
at
(
\l_MOdiagram_molecule_position_dim + \l_MOdiagram_AO_width_dim ,
- \l_MOdiagram_atom_right_two_p_dim
- + \l_MOdiagram_molecule_two_ppi_dim
+ \l_MOdiagram_energy_loss_dim
)
{
\MOdiagram_get_electron_color:n { 2piz* }
+ \MOdiagram_get_electron_up:n { 2piz* }
+ \MOdiagram_get_electron_down:n { 2piz* }
\MOdiagram_AO:ff
{ \tl_use:N \l_MOdiagram_MO_two_pizs_p_electron_tl }
- { \tl_use:N \l_tmpb_tl }
+ { \tl_use:N \l_MOdiagram_electron_current_color_tl }
} ;
\MOdiagram_get_orbital_label:n { 2piz* }
\MOdiagram_draw:f
@@ -853,13 +1246,26 @@
\draw (2pt+\l_MOdiagram_AO_width_dim,0)
-- ++(.5*\l_MOdiagram_AO_width_dim,0) ;
}
+ \bool_if:NT \l_MOdiagram_AO_circle_bool
+ {
+ \draw (-.4142pt,0) ++(-.2071*\l_MOdiagram_AO_width_dim,0)
+ -- ++(-.25*\l_MOdiagram_AO_width_dim,0) ;
+ \draw (2.4142pt,0) ++(1.2071*\l_MOdiagram_AO_width_dim,0)
+ -- ++(.25*\l_MOdiagram_AO_width_dim,0) ;
+ }
\MOdiagram_node:x
{
inner~sep = 0 ,
\bool_if:NT \l_MOdiagram_AO_square_bool { draw } ,
+ \bool_if:NT \l_MOdiagram_AO_circle_bool { circle , draw } ,
minimum~size =
\bool_if:NTF \l_MOdiagram_AO_square_bool
- { 2pt+\l_MOdiagram_AO_width_dim } { 0 } ,
+ { 2pt+\l_MOdiagram_AO_width_dim }
+ {
+ \bool_if:NTF \l_MOdiagram_AO_circle_bool
+ { 1.4142*(2pt+\l_MOdiagram_AO_width_dim) }
+ { \l_MOdiagram_AO_width_dim }
+ } ,
\bool_if:NT \l_MOdiagram_AO_round_bool
{ rounded~corners=2pt }
}
@@ -867,7 +1273,8 @@
{
\tikz
{
- \bool_if:NF \l_MOdiagram_AO_square_bool
+ \bool_if:nTF { \l_MOdiagram_AO_square_bool || \l_MOdiagram_AO_circle_bool }
+ { \draw[draw=none] (0,0) -- ++(\l_MOdiagram_AO_width_dim,0) ; }
{ \draw (0,0) -- ++(\l_MOdiagram_AO_width_dim,0) ; }
\tl_set:Nn \l_tmpa_tl { #1 }
\tl_remove_all:Nn \l_tmpa_tl { ~ }
@@ -876,26 +1283,26 @@
{ up }
{
\MOdiagram_draw:f
- { -left~to,semithick , \l_MOdiagram_electron_color_tl }
- (.4*\l_MOdiagram_AO_width_dim,-.4*\l_MOdiagram_AO_width_dim)
+ { -left~to,semithick , \l_MOdiagram_electron_color_tl , inner~sep=0,outer~sep=0 }
+ (\l_MOdiagram_AO_up_electron_tl*\l_MOdiagram_AO_width_dim,-.4*\l_MOdiagram_AO_width_dim)
-- ++(0,.8*\l_MOdiagram_AO_width_dim) ;
}
{ down }
{
\MOdiagram_draw:f
{ -left~to,semithick , \l_MOdiagram_electron_color_tl }
- (.6*\l_MOdiagram_AO_width_dim,.4*\l_MOdiagram_AO_width_dim)
+ (\l_MOdiagram_AO_down_electron_tl*\l_MOdiagram_AO_width_dim,.4*\l_MOdiagram_AO_width_dim)
-- ++(0,-.8*\l_MOdiagram_AO_width_dim) ;
}
{ pair }
{
\MOdiagram_draw:f
{ -left~to,semithick , \l_MOdiagram_electron_color_tl }
- (.4*\l_MOdiagram_AO_width_dim,-.4*\l_MOdiagram_AO_width_dim)
+ (\l_MOdiagram_AO_up_electron_tl*\l_MOdiagram_AO_width_dim,-.4*\l_MOdiagram_AO_width_dim)
-- ++(0,.8*\l_MOdiagram_AO_width_dim) ;
\MOdiagram_draw:f
{ -left~to,semithick , \l_MOdiagram_electron_color_tl }
- (.6*\l_MOdiagram_AO_width_dim,.4*\l_MOdiagram_AO_width_dim)
+ (\l_MOdiagram_AO_down_electron_tl*\l_MOdiagram_AO_width_dim,.4*\l_MOdiagram_AO_width_dim)
-- ++(0,-.8*\l_MOdiagram_AO_width_dim) ;
}
}
@@ -936,25 +1343,134 @@
\tl_new:N \l_MOdiagram_AO_py_electron_tl
\tl_new:N \l_MOdiagram_AO_pz_electron_tl
+\tl_new:N \l_MOdiagram_AO_x_electron_color_tl
+\tl_new:N \l_MOdiagram_AO_y_electron_color_tl
+\tl_new:N \l_MOdiagram_AO_z_electron_color_tl
+
+\bool_new:N \l_MOdiagram_AO_label_bool
+\bool_new:N \l_MOdiagram_AO_x_label_bool
+\bool_new:N \l_MOdiagram_AO_y_label_bool
+\bool_new:N \l_MOdiagram_AO_z_label_bool
+
+\tl_new:N \l_MOdiagram_AO_x_label_tl
+\tl_new:N \l_MOdiagram_AO_y_label_tl
+\tl_new:N \l_MOdiagram_AO_z_label_tl
+
+\bool_new:N \l_MOdiagram_AO_up_electron_bool
+\bool_new:N \l_MOdiagram_AO_x_up_electron_bool
+\bool_new:N \l_MOdiagram_AO_y_up_electron_bool
+\bool_new:N \l_MOdiagram_AO_z_up_electron_bool
+\tl_new:N \l_MOdiagram_AO_x_up_electron_tl
+\tl_new:N \l_MOdiagram_AO_y_up_electron_tl
+\tl_new:N \l_MOdiagram_AO_z_up_electron_tl
+
+\bool_new:N \l_MOdiagram_AO_down_electron_bool
+\bool_new:N \l_MOdiagram_AO_x_down_electron_bool
+\bool_new:N \l_MOdiagram_AO_y_down_electron_bool
+\bool_new:N \l_MOdiagram_AO_z_down_electron_bool
+\tl_new:N \l_MOdiagram_AO_x_down_electron_tl
+\tl_new:N \l_MOdiagram_AO_y_down_electron_tl
+\tl_new:N \l_MOdiagram_AO_z_down_electron_tl
+
\tl_new:N \l_MOdiagram_AO_name_tl
\bool_new:N \l_MOdiagram_AO_p_bool
\bool_new:N \l_MOdiagram_AO_left_bool
-\cs_new_nopar:Npn \MOdiagram_AO_s_set:n #1;#2 \q_stop
+\int_new:N \g_MOdiagram_AO_name_int
+
+% read argument in s case:
+\cs_new_nopar:Npn \MOdiagram_AO_s_set:n #1
+ {
+ \tl_if_in:onTF { #1 } { ; }
+ { \MOdiagram_AO_s_set_aux:n #1 \q_stop }
+ {
+ \dim_set:Nn \l_MOdiagram_AO_dim { #1 cm }
+ \tl_set:Nn \l_MOdiagram_AO_px_electron_tl { pair }
+ }
+ }
+
+\cs_new_nopar:Npn \MOdiagram_AO_s_set_aux:n #1;#2 \q_stop
{
\dim_set:Nn \l_MOdiagram_AO_dim { #1 cm }
\tl_set:Nn \l_MOdiagram_AO_px_electron_tl { #2 }
}
-\cs_new_nopar:Npn \MOdiagram_AO_p_set:n #1;#2,#3,#4 \q_stop
+% read argument in p case:
+\cs_new_nopar:Npn \MOdiagram_AO_p_set:n #1
+ {
+ \tl_if_in:onTF { #1 } { ; }
+ { \MOdiagram_AO_p_set_aux:n #1 \q_stop }
+ {
+ \dim_set:Nn \l_MOdiagram_AO_dim { #1 cm }
+ \tl_set:Nn \l_MOdiagram_AO_px_electron_tl { pair }
+ \tl_set:Nn \l_MOdiagram_AO_py_electron_tl { pair }
+ \tl_set:Nn \l_MOdiagram_AO_pz_electron_tl { pair }
+ }
+ }
+
+\cs_new_nopar:Npn \MOdiagram_AO_p_set_aux:n #1;#2 \q_stop
{
\dim_set:Nn \l_MOdiagram_AO_dim { #1 cm }
- \tl_set:Nn \l_MOdiagram_AO_px_electron_tl { #2 }
- \tl_set:Nn \l_MOdiagram_AO_py_electron_tl { #3 }
- \tl_set:Nn \l_MOdiagram_AO_pz_electron_tl { #4 }
+ \MOdiagram_AO_p_set_electrons:n { #2 }
+ }
+\NewDocumentCommand \MOdiagram_AO_p_set_electrons:n
+ { > { \SplitArgument { 2 } { , } } m }
+ { \MOdiagram_AO_p_set_electrons_aux:n #1 }
+
+\cs_new_nopar:Npn \MOdiagram_AO_p_set_electrons_aux:n #1#2#3
+ {
+ \tl_set:Nn \l_MOdiagram_AO_px_electron_tl { #1 }
+ \tl_set:Nn \l_MOdiagram_AO_py_electron_tl { #2 }
+ \tl_set:Nn \l_MOdiagram_AO_pz_electron_tl { #3 }
+ }
+
+\cs_new_nopar:Npn \MOdiagram_AO_get_orbital_x_label:n #1
+ {
+ \bool_if:nT { \l_MOdiagram_AO_x_label_bool || \l_MOdiagram_AO_label_bool }
+ {
+ \MOdiagram_node:x
+ { below , \tl_use:N \l_MOdiagram_orbital_label_style_tl }
+ at ( #1 . south )
+ {
+ \tl_use:N \l_MOdiagram_orbital_label_fontsize_tl
+ \tl_use:N \l_MOdiagram_AO_x_label_tl
+ } ;
+ }
+ }
+\cs_generate_variant:Nn \MOdiagram_AO_get_orbital_x_label:n { o }
+
+\cs_new_nopar:Npn \MOdiagram_AO_get_orbital_y_label:n #1
+ {
+ \bool_if:nT { \l_MOdiagram_AO_y_label_bool || \l_MOdiagram_AO_label_bool }
+ {
+ \MOdiagram_node:x
+ { below , \tl_use:N \l_MOdiagram_orbital_label_style_tl }
+ at ( #1 . south )
+ {
+ \tl_use:N \l_MOdiagram_orbital_label_fontsize_tl
+ \tl_use:N \l_MOdiagram_AO_y_label_tl
+ } ;
+ }
+ }
+\cs_generate_variant:Nn \MOdiagram_AO_get_orbital_y_label:n { o }
+
+\cs_new_nopar:Npn \MOdiagram_AO_get_orbital_z_label:n #1
+ {
+ \bool_if:nT { \l_MOdiagram_AO_z_label_bool || \l_MOdiagram_AO_label_bool }
+ {
+ \MOdiagram_node:x
+ { below , \tl_use:N \l_MOdiagram_orbital_label_style_tl }
+ at ( #1 . south )
+ {
+ \tl_use:N \l_MOdiagram_orbital_label_fontsize_tl
+ \tl_use:N \l_MOdiagram_AO_z_label_tl
+ } ;
+ }
}
+\cs_generate_variant:Nn \MOdiagram_AO_get_orbital_z_label:n { o }
+% these are going to be our arguments
\keys_define:nn { MOdiagram / AO }
{
type .choice: ,
@@ -962,16 +1478,102 @@
type / p .code:n = { \bool_set_true:N \l_MOdiagram_AO_p_bool }
}
-% AO[<name>](<x-coord>){<type>}{<AO-spec>}
-\NewDocumentCommand \AO { o D(){0cm} m m }
+\keys_define:nn { MOdiagram / AO / properties }
{
- \IfNoValueF { #1 } { \tl_set:Nn \l_MOdiagram_AO_name_tl { #1 } }
+ color .code:n =
+ {
+ \tl_set:Nn \l_MOdiagram_AO_x_electron_color_tl { #1 }
+ \tl_set:Nn \l_MOdiagram_AO_y_electron_color_tl { #1 }
+ \tl_set:Nn \l_MOdiagram_AO_z_electron_color_tl { #1 }
+ } ,
+ color[x] .tl_set:N = \l_MOdiagram_AO_x_electron_color_tl ,
+ color[y] .tl_set:N = \l_MOdiagram_AO_y_electron_color_tl ,
+ color[z] .tl_set:N = \l_MOdiagram_AO_z_electron_color_tl ,
+ label .code:n =
+ {
+ \bool_set_true:N \l_MOdiagram_AO_label_bool
+ \tl_set:Nn \l_MOdiagram_AO_x_label_tl { #1 }
+ \tl_set:Nn \l_MOdiagram_AO_y_label_tl { #1 }
+ \tl_set:Nn \l_MOdiagram_AO_z_label_tl { #1 }
+ } ,
+ label[x] .code:n =
+ {
+ \bool_set_true:N \l_MOdiagram_AO_x_label_bool
+ \tl_set:Nn \l_MOdiagram_AO_x_label_tl { #1 }
+ } ,
+ label[y] .code:n =
+ {
+ \bool_set_true:N \l_MOdiagram_AO_y_label_bool
+ \tl_set:Nn \l_MOdiagram_AO_y_label_tl { #1 }
+ } ,
+ label[z] .code:n =
+ {
+ \bool_set_true:N \l_MOdiagram_AO_z_label_bool
+ \tl_set:Nn \l_MOdiagram_AO_z_label_tl { #1 }
+ } ,
+ up-el-pos .code:n =
+ {
+ \bool_set_true:N \l_MOdiagram_AO_up_electron_bool
+ \tl_set:Nn \l_MOdiagram_AO_x_up_electron_tl { #1 }
+ \tl_set:Nn \l_MOdiagram_AO_y_up_electron_tl { #1 }
+ \tl_set:Nn \l_MOdiagram_AO_z_up_electron_tl { #1 }
+ } ,
+ up-el-pos[x] .code:n =
+ {
+ \bool_set_true:N \l_MOdiagram_AO_x_up_electron_bool
+ \tl_set:Nn \l_MOdiagram_AO_x_up_electron_tl { #1 }
+ } ,
+ up-el-pos[y] .code:n =
+ {
+ \bool_set_true:N \l_MOdiagram_AO_y_up_electron_bool
+ \tl_set:Nn \l_MOdiagram_AO_y_up_electron_tl { #1 }
+ } ,
+ up-el-pos[z] .code:n =
+ {
+ \bool_set_true:N \l_MOdiagram_AO_z_up_electron_bool
+ \tl_set:Nn \l_MOdiagram_AO_y_up_electron_tl { #1 }
+ } ,
+ down-el-pos .code:n =
+ {
+ \bool_set_true:N \l_MOdiagram_AO_down_electron_bool
+ \tl_set:Nn \l_MOdiagram_AO_x_down_electron_tl { #1 }
+ \tl_set:Nn \l_MOdiagram_AO_y_down_electron_tl { #1 }
+ \tl_set:Nn \l_MOdiagram_AO_z_down_electron_tl { #1 }
+ } ,
+ down-el-pos[x] .code:n =
+ {
+ \bool_set_true:N \l_MOdiagram_AO_x_down_electron_bool
+ \tl_set:Nn \l_MOdiagram_AO_x_down_electron_tl { #1 }
+ } ,
+ down-el-pos[y] .code:n =
+ {
+ \bool_set_true:N \l_MOdiagram_AO_y_down_electron_bool
+ \tl_set:Nn \l_MOdiagram_AO_y_down_electron_tl { #1 }
+ } ,
+ down-el-pos[z] .code:n =
+ {
+ \bool_set_true:N \l_MOdiagram_AO_z_down_electron_bool
+ \tl_set:Nn \l_MOdiagram_AO_z_down_electron_tl { #1 }
+ }
+ }
+
+% AO[<name>](<x-coord>){<type>}[<keyval>]{<AO-spec>}
+\NewDocumentCommand \MOdiagram_arbitrary_AO: { o D(){0cm} m o m }
+ {
+ \group_begin:
+ \IfNoValueTF { #1 }
+ {
+ \int_gincr:N \g_MOdiagram_AO_name_int
+ \tl_set:Nn \l_MOdiagram_AO_name_tl { AO \int_use:N \g_MOdiagram_AO_name_int }
+ }
+ { \tl_set:Nn \l_MOdiagram_AO_name_tl { #1 } }
+ \IfNoValueF { #4 }
+ { \keys_set:nn { MOdiagram / AO / properties } { #4 } }
\keys_set:nn { MOdiagram / AO } { type = #3 }
\bool_if:NTF \l_MOdiagram_AO_p_bool
- { \MOdiagram_AO_p_set:n #4 \q_stop }
- { \MOdiagram_AO_s_set:n #4 \q_stop }
+ { \MOdiagram_AO_p_set:n { #5 } }
+ { \MOdiagram_AO_s_set:n { #5 } }
\dim_set:Nn \l_MOdiagram_AO_position_dim { #2 }
-% \fp_set_from_dim:Nn \l_tmpa_tl { \l_MOdiagram_AO_width_dim }
\MOdiagram_p_orbitals_shift:nnn { 0 } { 2 } { 4 }
\MOdiagram_energy_range:N \l_MOdiagram_AO_dim
\MOdiagram_node:n { inner~sep=0 , outer~sep=0 }
@@ -985,11 +1587,25 @@
\l_MOdiagram_AO_dim
)
{
+ \bool_if:nT { \l_MOdiagram_AO_up_electron_bool || \l_MOdiagram_AO_x_up_electron_bool }
+ {
+ \MOdiagram_AO_place_electron:nx { 0 }
+ { \tl_use:N \l_MOdiagram_AO_x_up_electron_tl }
+ }
+ \bool_if:nT { \l_MOdiagram_AO_down_electron_bool || \l_MOdiagram_AO_x_down_electron_bool }
+ {
+ \MOdiagram_AO_place_electron:nx { 1 }
+ { \tl_use:N \l_MOdiagram_AO_x_down_electron_tl }
+ }
\MOdiagram_AO:ff
{ \tl_use:N \l_MOdiagram_AO_px_electron_tl }
- { }
+ { \tl_use:N \l_MOdiagram_AO_x_electron_color_tl }
} ;
- % TODO get & set label
+ \MOdiagram_AO_get_orbital_x_label:o
+ {
+ \tl_use:N \l_MOdiagram_AO_name_tl
+ \bool_if:NT \l_MOdiagram_AO_p_bool { x }
+ }
\bool_if:NT \l_MOdiagram_AO_p_bool
{
\MOdiagram_node:n { inner~sep=0 , outer~sep=0 }
@@ -1000,11 +1616,21 @@
\l_MOdiagram_AO_dim
)
{
+ \bool_if:nT { \l_MOdiagram_AO_up_electron_bool || \l_MOdiagram_AO_y_up_electron_bool }
+ {
+ \MOdiagram_AO_place_electron:nx { 0 }
+ { \tl_use:N \l_MOdiagram_AO_y_up_electron_tl }
+ }
+ \bool_if:nT { \l_MOdiagram_AO_down_electron_bool || \l_MOdiagram_AO_y_down_electron_bool }
+ {
+ \MOdiagram_AO_place_electron:nx { 1 }
+ { \tl_use:N \l_MOdiagram_AO_y_down_electron_tl }
+ }
\MOdiagram_AO:ff
{ \tl_use:N \l_MOdiagram_AO_py_electron_tl }
- { }
+ { \tl_use:N \l_MOdiagram_AO_y_electron_color_tl }
} ;
- % TODO get & set label
+ \MOdiagram_AO_get_orbital_y_label:o { \tl_use:N \l_MOdiagram_AO_name_tl y }
\MOdiagram_node:n { inner~sep=0 , outer~sep=0 }
( \tl_use:N \l_MOdiagram_AO_name_tl z )
at
@@ -1013,26 +1639,24 @@
\l_MOdiagram_AO_dim
)
{
+ \bool_if:nT { \l_MOdiagram_AO_up_electron_bool || \l_MOdiagram_AO_z_up_electron_bool }
+ {
+ \MOdiagram_AO_place_electron:nx { 0 }
+ { \tl_use:N \l_MOdiagram_AO_z_up_electron_tl }
+ }
+ \bool_if:nT { \l_MOdiagram_AO_down_electron_bool || \l_MOdiagram_AO_z_down_electron_bool }
+ {
+ \MOdiagram_AO_place_electron:nx { 1 }
+ { \tl_use:N \l_MOdiagram_AO_z_down_electron_tl }
+ }
\MOdiagram_AO:ff
{ \tl_use:N \l_MOdiagram_AO_pz_electron_tl }
- { }
+ { \tl_use:N \l_MOdiagram_AO_z_electron_color_tl }
} ;
- % TODO get & set label
+ \MOdiagram_AO_get_orbital_z_label:o { \tl_use:N \l_MOdiagram_AO_name_tl z }
}
- }
-
-% --------------------------------------------------------------------------- %
-\NewDocumentCommand \AOinline { o m }
- {
- \group_begin:
- \IfNoValueTF { #1 }
- { ~ \MOsetup { style=square,AO-width=8pt } }
- { ~ \MOsetup { style=square,AO-width=8pt , #1 } }
- \begin{MOdiagram}
- \AO{s}{0;#2}
- \end{MOdiagram}
\group_end:
- }
+ }
% --------------------------------------------------------------------------- %
% connect arbitrary AOs / MOs
@@ -1170,6 +1794,7 @@
% --------------------------------------------------------------------------- %
% electron colours
\prop_new:N \l_MOdiagram_electron_color_prop
+\tl_new:N \l_MOdiagram_electron_current_color_tl
\cs_new_nopar:Npn \MOdiagram_electron_color_set:n #1
{ \keys_set:nn { MOdiagram / color } { #1 } }
@@ -1179,7 +1804,7 @@
\tl_clear:N \l_tmpa_tl
\tl_clear:N \l_tmpb_tl
\prop_get:NnNT \l_MOdiagram_electron_color_prop { #1 } \l_tmpa_tl
- { \tl_set_eq:NN \l_tmpb_tl \l_tmpa_tl }
+ { \tl_set_eq:NN \l_MOdiagram_electron_current_color_tl \l_tmpa_tl }
}
\keys_define:nn { MOdiagram / color }
@@ -1227,6 +1852,122 @@
}
% --------------------------------------------------------------------------- %
+% electron positions
+\prop_new:N \l_MOdiagram_electron_up_prop
+
+\cs_new_nopar:Npn \MOdiagram_electron_up_set:n #1
+ { \keys_set:nn { MOdiagram / up-pos } { #1 } }
+
+\cs_new_nopar:Npn \MOdiagram_get_electron_up:n #1
+ {
+ \tl_clear:N \l_tmpa_tl
+ \tl_clear:N \l_tmpb_tl
+ \prop_get:NnNT \l_MOdiagram_electron_up_prop { #1 } \l_tmpa_tl
+ { \tl_set_eq:NN \l_MOdiagram_AO_up_electron_tl \l_tmpa_tl }
+ }
+
+\keys_define:nn { MOdiagram / up-pos }
+ {
+ 1sleft .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_up_prop { 1sleft } { #1 } } ,
+ 1sright .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_up_prop { 1sright } { #1 } } ,
+ 2sleft .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_up_prop { 2sleft } { #1 } } ,
+ 2sright .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_up_prop { 2sright } { #1 } } ,
+ 2pxleft .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_up_prop { 2pxleft } { #1 } } ,
+ 2pxright .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_up_prop { 2pxright } { #1 } } ,
+ 2pyleft .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_up_prop { 2pyleft } { #1 } } ,
+ 2pyright .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_up_prop { 2pyright } { #1 } } ,
+ 2pzleft .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_up_prop { 2pzleft } { #1 } } ,
+ 2pzright .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_up_prop { 2pzright } { #1 } } ,
+ 1sigma .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_up_prop { 1sigma } { #1 } } ,
+ 1sigma* .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_up_prop { 1sigma* } { #1 } } ,
+ 2sigma .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_up_prop { 2sigma } { #1 } } ,
+ 2sigma* .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_up_prop { 2sigma* } { #1 } } ,
+ 2psigma .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_up_prop { 2psigma } { #1 } } ,
+ 2psigma* .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_up_prop { 2psigma* } { #1 } } ,
+ 2piy .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_up_prop { 2piy } { #1 } } ,
+ 2piy* .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_up_prop { 2piy* } { #1 } } ,
+ 2piz .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_up_prop { 2piz } { #1 } } ,
+ 2piz* .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_up_prop { 2piz* } { #1 } }
+ }
+
+\prop_new:N \l_MOdiagram_electron_down_prop
+
+\cs_new_nopar:Npn \MOdiagram_electron_down_set:n #1
+ { \keys_set:nn { MOdiagram / down-pos } { #1 } }
+
+\cs_new_nopar:Npn \MOdiagram_get_electron_down:n #1
+ {
+ \tl_clear:N \l_tmpa_tl
+ \tl_clear:N \l_tmpb_tl
+ \prop_get:NnNT \l_MOdiagram_electron_down_prop { #1 } \l_tmpa_tl
+ { \tl_set_eq:NN \l_MOdiagram_AO_down_electron_tl \l_tmpa_tl }
+ }
+
+\keys_define:nn { MOdiagram / down-pos }
+ {
+ 1sleft .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_down_prop { 1sleft } { #1 } } ,
+ 1sright .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_down_prop { 1sright } { #1 } } ,
+ 2sleft .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_down_prop { 2sleft } { #1 } } ,
+ 2sright .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_down_prop { 2sright } { #1 } } ,
+ 2pxleft .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_down_prop { 2pxleft } { #1 } } ,
+ 2pxright .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_down_prop { 2pxright } { #1 } } ,
+ 2pyleft .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_down_prop { 2pyleft } { #1 } } ,
+ 2pyright .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_down_prop { 2pyright } { #1 } } ,
+ 2pzleft .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_down_prop { 2pzleft } { #1 } } ,
+ 2pzright .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_down_prop { 2pzright } { #1 } } ,
+ 1sigma .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_down_prop { 1sigma } { #1 } } ,
+ 1sigma* .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_down_prop { 1sigma* } { #1 } } ,
+ 2sigma .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_down_prop { 2sigma } { #1 } } ,
+ 2sigma* .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_down_prop { 2sigma* } { #1 } } ,
+ 2psigma .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_down_prop { 2psigma } { #1 } } ,
+ 2psigma* .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_down_prop { 2psigma* } { #1 } } ,
+ 2piy .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_down_prop { 2piy } { #1 } } ,
+ 2piy* .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_down_prop { 2piy* } { #1 } } ,
+ 2piz .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_down_prop { 2piz } { #1 } } ,
+ 2piz* .code:n =
+ { \prop_put:Nnn \l_MOdiagram_electron_down_prop { 2piz* } { #1 } }
+ }
+
+% --------------------------------------------------------------------------- %
% energy axis
\dim_new:N \l_energy_axis_dim
\dim_set:Nn \l_energy_axis_dim { 0pt }
@@ -1238,7 +1979,7 @@
\bool_new:N \l_MOdiagram_Eaxis_title_bool
\bool_set_false:N \l_MOdiagram_Eaxis_title_bool
-\NewDocumentCommand \EnergyAxis { o }
+\NewDocumentCommand \MOdiagram_EnergyAxis: { o }
{
\IfNoValueF { #1 } { \keys_set:nn { MOdiagram / axis } { #1 } }
\MOdiagram_draw:f { - \tl_use:N \l_MOdiagram_Eaxis_head_tl }
@@ -1284,11 +2025,19 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Version history
2011/09/25 version 0.1 - first upload to CTAN
+2011/10/27 version 0.2 - \atom, \molecule, \AO, \EnergyAxis only defined within
+ the MOdiagram environment
+ - bugfix in energy splitting process
+ - bugfix: wrong labelling of plain empty orbitals
+ - different values for energy gain and loss possible
+ - default values for the AO and MO; if empty values are
+ used, the ";" and "," can be omitted
+ - default node names for the arbitrary AOs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TODO
- 3s, 3p , 3sMO , 3pMO , 4s , sp3
-- Farbe und Label der \AO setzen können
-- key shift analog zu color und label, mit dem eine horizontale Verschiebung
- der el möglich ist.
-- energy axis: ticks? at orbital heights? \ No newline at end of file
+- energy axis: ticks? at orbital heights?
+- electron configuration
+- localisation for the energy axis title using the translator package
+- Default-Einheit (bislang cm) ändern können? \ No newline at end of file